@bigbinary/neeto-molecules 1.1.16 → 1.1.17

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 (392) hide show
  1. package/dist/AutoSaveInput.js +658 -0
  2. package/dist/AutoSaveInput.js.map +1 -0
  3. package/dist/Breadcrumbs.js +38 -0
  4. package/dist/Breadcrumbs.js.map +1 -0
  5. package/dist/BrowserSupport.js +418 -0
  6. package/dist/BrowserSupport.js.map +1 -0
  7. package/dist/Builder.js +662 -0
  8. package/dist/Builder.js.map +1 -0
  9. package/dist/CalendarView.js +538 -0
  10. package/dist/CalendarView.js.map +1 -0
  11. package/dist/Codeblock.js +236 -0
  12. package/dist/Codeblock.js.map +1 -0
  13. package/dist/{Columns/index.js → Columns.js} +130 -13
  14. package/dist/Columns.js.map +1 -0
  15. package/dist/{ConfirmationModal/index.js → ConfirmationModal.js} +20 -8
  16. package/dist/ConfirmationModal.js.map +1 -0
  17. package/dist/Container.js +1211 -0
  18. package/dist/Container.js.map +1 -0
  19. package/dist/CopyToClipboardButton.js +209 -0
  20. package/dist/CopyToClipboardButton.js.map +1 -0
  21. package/dist/CustomDomain.js +688 -0
  22. package/dist/CustomDomain.js.map +1 -0
  23. package/dist/CustomDomainDashboard.js +2283 -0
  24. package/dist/CustomDomainDashboard.js.map +1 -0
  25. package/dist/{DateFormat/index.js → DateFormat.js} +25 -8
  26. package/dist/DateFormat.js.map +1 -0
  27. package/dist/DateRangeFilter.js +229 -0
  28. package/dist/DateRangeFilter.js.map +1 -0
  29. package/dist/DynamicVariables.js +183 -0
  30. package/dist/DynamicVariables.js.map +1 -0
  31. package/dist/EmailForm.js +2291 -0
  32. package/dist/EmailForm.js.map +1 -0
  33. package/dist/EmailPreview.js +1353 -0
  34. package/dist/EmailPreview.js.map +1 -0
  35. package/dist/{ErrorPage/constants.js → ErrorPage.js} +137 -36
  36. package/dist/ErrorPage.js.map +1 -0
  37. package/dist/Header.js +122 -0
  38. package/dist/Header.js.map +1 -0
  39. package/dist/IconPicker.js +313 -0
  40. package/dist/IconPicker.js.map +1 -0
  41. package/dist/ImageWithFallback.js +181 -0
  42. package/dist/ImageWithFallback.js.map +1 -0
  43. package/dist/IntegrationCard.js +343 -0
  44. package/dist/IntegrationCard.js.map +1 -0
  45. package/dist/IntegrationDisconnectAlert.js +80 -0
  46. package/dist/IntegrationDisconnectAlert.js.map +1 -0
  47. package/dist/{IntegrationWalkthroughModal/index.js → IntegrationWalkthroughModal.js} +8 -6
  48. package/dist/IntegrationWalkthroughModal.js.map +1 -0
  49. package/dist/IpRestriction.js +857 -0
  50. package/dist/IpRestriction.js.map +1 -0
  51. package/dist/KeyboardShortcuts.js +359 -0
  52. package/dist/KeyboardShortcuts.js.map +1 -0
  53. package/dist/LoginPage.js +593 -0
  54. package/dist/LoginPage.js.map +1 -0
  55. package/dist/MenuBar.js +1461 -0
  56. package/dist/MenuBar.js.map +1 -0
  57. package/dist/Metadata.js +206 -0
  58. package/dist/Metadata.js.map +1 -0
  59. package/dist/{MoreDropdown/index.js → MoreDropdown.js} +102 -9
  60. package/dist/MoreDropdown.js.map +1 -0
  61. package/dist/NavigationHeader.js +690 -0
  62. package/dist/NavigationHeader.js.map +1 -0
  63. package/dist/NeetoWidget.js +1333 -0
  64. package/dist/NeetoWidget.js.map +1 -0
  65. package/dist/PageLoader.js +134 -0
  66. package/dist/PageLoader.js.map +1 -0
  67. package/dist/PhoneNumber.js +365 -0
  68. package/dist/PhoneNumber.js.map +1 -0
  69. package/dist/PublishBlock.js +158 -0
  70. package/dist/PublishBlock.js.map +1 -0
  71. package/dist/Rename.js +450 -0
  72. package/dist/Rename.js.map +1 -0
  73. package/dist/ResponsiveDevicePicker.js +194 -0
  74. package/dist/ResponsiveDevicePicker.js.map +1 -0
  75. package/dist/Schedule.js +1046 -0
  76. package/dist/Schedule.js.map +1 -0
  77. package/dist/Scrollable.js +122 -0
  78. package/dist/Scrollable.js.map +1 -0
  79. package/dist/Search.js +151 -0
  80. package/dist/Search.js.map +1 -0
  81. package/dist/Security.js +1835 -0
  82. package/dist/Security.js.map +1 -0
  83. package/dist/SendToFields.js +601 -0
  84. package/dist/SendToFields.js.map +1 -0
  85. package/dist/Settings.js +435 -0
  86. package/dist/Settings.js.map +1 -0
  87. package/dist/ShareViaEmail.js +2277 -0
  88. package/dist/ShareViaEmail.js.map +1 -0
  89. package/dist/ShareViaLink.js +628 -0
  90. package/dist/ShareViaLink.js.map +1 -0
  91. package/dist/Sidebar.js +972 -0
  92. package/dist/Sidebar.js.map +1 -0
  93. package/dist/SubHeader.js +216 -0
  94. package/dist/SubHeader.js.map +1 -0
  95. package/dist/{TableWrapper/index.js → TableWrapper.js} +6 -3
  96. package/dist/TableWrapper.js.map +1 -0
  97. package/dist/ThemeSidebar.js +1984 -0
  98. package/dist/ThemeSidebar.js.map +1 -0
  99. package/dist/TimeFormat.js +47 -0
  100. package/dist/TimeFormat.js.map +1 -0
  101. package/dist/TimezoneMismatchModal.js +168 -0
  102. package/dist/TimezoneMismatchModal.js.map +1 -0
  103. package/dist/ToggleFeatureCard.js +323 -0
  104. package/dist/ToggleFeatureCard.js.map +1 -0
  105. package/package.json +22 -13
  106. package/dist/AutoSaveInput/autosaveinput.scss +0 -15
  107. package/dist/AutoSaveInput/constants.js +0 -13
  108. package/dist/AutoSaveInput/index.js +0 -124
  109. package/dist/AutoSaveInput/utils.js +0 -10
  110. package/dist/Breadcrumbs/breadcrumbs.scss +0 -33
  111. package/dist/Breadcrumbs/index.js +0 -31
  112. package/dist/BrowserSupport/Callout.js +0 -15
  113. package/dist/BrowserSupport/ContactUs.js +0 -21
  114. package/dist/BrowserSupport/DownloadLink.js +0 -17
  115. package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +0 -17
  116. package/dist/BrowserSupport/UnknownBrowser.js +0 -13
  117. package/dist/BrowserSupport/UnsupportedBrowser.js +0 -24
  118. package/dist/BrowserSupport/UnsupportedBrowserMessage.js +0 -22
  119. package/dist/BrowserSupport/UnsupportedBrowserVersion.js +0 -27
  120. package/dist/BrowserSupport/UnsupportedVersionMessage.js +0 -30
  121. package/dist/BrowserSupport/browsersupport.scss +0 -71
  122. package/dist/BrowserSupport/constants.js +0 -63
  123. package/dist/BrowserSupport/index.js +0 -58
  124. package/dist/BrowserSupport/utils.js +0 -32
  125. package/dist/Builder/Body.js +0 -9
  126. package/dist/Builder/ElementsPanel/ElementsList/Element.js +0 -27
  127. package/dist/Builder/ElementsPanel/ElementsList/Section.js +0 -28
  128. package/dist/Builder/ElementsPanel/ElementsList/TitleBar.js +0 -28
  129. package/dist/Builder/ElementsPanel/ElementsList/index.js +0 -63
  130. package/dist/Builder/ElementsPanel/SelectedElementsList/SelectedElement.js +0 -73
  131. package/dist/Builder/ElementsPanel/SelectedElementsList/TitleBar.js +0 -50
  132. package/dist/Builder/ElementsPanel/SelectedElementsList/index.js +0 -91
  133. package/dist/Builder/ElementsPanel/index.js +0 -70
  134. package/dist/Builder/PropertiesPanel/EmptyProperty.js +0 -21
  135. package/dist/Builder/PropertiesPanel/Skeleton.js +0 -24
  136. package/dist/Builder/PropertiesPanel/index.js +0 -12
  137. package/dist/Builder/index.js +0 -3
  138. package/dist/Builder/styles.scss +0 -84
  139. package/dist/CalendarView/CustomDatePicker.js +0 -87
  140. package/dist/CalendarView/Header.js +0 -53
  141. package/dist/CalendarView/constants.js +0 -19
  142. package/dist/CalendarView/index.js +0 -83
  143. package/dist/CalendarView/utils.js +0 -50
  144. package/dist/Codeblock/index.js +0 -30
  145. package/dist/Columns/utils.js +0 -20
  146. package/dist/ConfirmationModal/constants.js +0 -3
  147. package/dist/ConfirmationModal/utils.js +0 -6
  148. package/dist/Container/container.scss +0 -21
  149. package/dist/Container/index.js +0 -23
  150. package/dist/CopyToClipboardButton/constants.js +0 -13
  151. package/dist/CopyToClipboardButton/copyToClipboard.scss +0 -22
  152. package/dist/CopyToClipboardButton/index.js +0 -59
  153. package/dist/CustomDomain/index.js +0 -98
  154. package/dist/CustomDomainDashboard/DeleteAlert.js +0 -28
  155. package/dist/CustomDomainDashboard/Header.js +0 -32
  156. package/dist/CustomDomainDashboard/Manage/Record.js +0 -42
  157. package/dist/CustomDomainDashboard/Manage/StatusInfo.js +0 -21
  158. package/dist/CustomDomainDashboard/Manage/TagBlock.js +0 -36
  159. package/dist/CustomDomainDashboard/Manage/constants.js +0 -4
  160. package/dist/CustomDomainDashboard/Manage/index.js +0 -125
  161. package/dist/CustomDomainDashboard/Manage/utils.js +0 -8
  162. package/dist/CustomDomainDashboard/api.js +0 -35
  163. package/dist/CustomDomainDashboard/constants.js +0 -2
  164. package/dist/CustomDomainDashboard/index.js +0 -118
  165. package/dist/CustomDomainDashboard/useCustomDomainApi.js +0 -71
  166. package/dist/CustomDomainDashboard/utils.js +0 -84
  167. package/dist/DateRangeFilter/index.js +0 -60
  168. package/dist/DateRangeFilter/utils.js +0 -113
  169. package/dist/DynamicVariables/dynamic-variables.scss +0 -34
  170. package/dist/DynamicVariables/index.js +0 -59
  171. package/dist/DynamicVariables/utils.js +0 -37
  172. package/dist/EmailForm/EmailForm.js +0 -98
  173. package/dist/EmailForm/EmailFormProvider.js +0 -45
  174. package/dist/EmailForm/EmailPreview.js +0 -129
  175. package/dist/EmailForm/ReplyToField.js +0 -55
  176. package/dist/EmailForm/SendToField.js +0 -28
  177. package/dist/EmailForm/SubjectField.js +0 -64
  178. package/dist/EmailForm/constants.js +0 -33
  179. package/dist/EmailForm/contexts/EmailForm.js +0 -7
  180. package/dist/EmailForm/index.js +0 -4
  181. package/dist/EmailForm/utils.js +0 -10
  182. package/dist/EmailPreview/index.js +0 -2
  183. package/dist/ErrorPage/index.js +0 -78
  184. package/dist/Header/Breadcrumbs.js +0 -31
  185. package/dist/Header/Dropdown.js +0 -12
  186. package/dist/Header/constants.js +0 -6
  187. package/dist/Header/header.scss +0 -121
  188. package/dist/Header/index.js +0 -61
  189. package/dist/IconPicker/Icon.js +0 -34
  190. package/dist/IconPicker/NoResults.js +0 -12
  191. package/dist/IconPicker/constants.js +0 -8
  192. package/dist/IconPicker/icon-picker.scss +0 -1
  193. package/dist/IconPicker/index.js +0 -164
  194. package/dist/ImageWithFallback/ImagePlaceholder.js +0 -16
  195. package/dist/ImageWithFallback/index.js +0 -31
  196. package/dist/IntegrationCard/Dropdown.js +0 -45
  197. package/dist/IntegrationCard/Status.js +0 -25
  198. package/dist/IntegrationCard/index.js +0 -128
  199. package/dist/IntegrationDisconnectAlert/index.js +0 -36
  200. package/dist/IpRestriction/AllowedIpRanges.js +0 -75
  201. package/dist/IpRestriction/CurrentIp.js +0 -26
  202. package/dist/IpRestriction/FormRow.js +0 -84
  203. package/dist/IpRestriction/Row.js +0 -91
  204. package/dist/IpRestriction/apis/allowed_ip_ranges.js +0 -28
  205. package/dist/IpRestriction/apis/current_ip.js +0 -11
  206. package/dist/IpRestriction/apis/ip_restriction.js +0 -16
  207. package/dist/IpRestriction/constants.js +0 -20
  208. package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +0 -34
  209. package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +0 -10
  210. package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +0 -18
  211. package/dist/IpRestriction/index.js +0 -102
  212. package/dist/IpRestriction/utils.js +0 -85
  213. package/dist/KeyboardShortcuts/Pane/HotKey.js +0 -44
  214. package/dist/KeyboardShortcuts/Pane/HotKeyList.js +0 -42
  215. package/dist/KeyboardShortcuts/Pane/constants.js +0 -25
  216. package/dist/KeyboardShortcuts/Pane/index.js +0 -61
  217. package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +0 -5
  218. package/dist/KeyboardShortcuts/Pane/utils.js +0 -66
  219. package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +0 -31
  220. package/dist/KeyboardShortcuts/index.js +0 -9
  221. package/dist/LoginPage/Form.js +0 -57
  222. package/dist/LoginPage/constants.js +0 -12
  223. package/dist/LoginPage/index.js +0 -103
  224. package/dist/MenuBar/AddNew.js +0 -25
  225. package/dist/MenuBar/Block.js +0 -60
  226. package/dist/MenuBar/Item.js +0 -32
  227. package/dist/MenuBar/Search.js +0 -39
  228. package/dist/MenuBar/SubTitle.js +0 -23
  229. package/dist/MenuBar/index.js +0 -46
  230. package/dist/MenuBar/menubar.scss +0 -154
  231. package/dist/Metadata/Block.js +0 -30
  232. package/dist/Metadata/DetailsBlock.js +0 -86
  233. package/dist/Metadata/constants.js +0 -9
  234. package/dist/Metadata/index.js +0 -29
  235. package/dist/Metadata/metadata.scss +0 -15
  236. package/dist/MoreDropdown/constants.js +0 -25
  237. package/dist/NavigationHeader/LeftBlock.js +0 -32
  238. package/dist/NavigationHeader/Navigation.js +0 -24
  239. package/dist/NavigationHeader/RightBlock.js +0 -68
  240. package/dist/NavigationHeader/constants.js +0 -11
  241. package/dist/NavigationHeader/index.js +0 -19
  242. package/dist/NavigationHeader/navigation-header.scss +0 -3
  243. package/dist/NeetoWidget/CodeBlock.js +0 -57
  244. package/dist/NeetoWidget/CodeSnippet.js +0 -119
  245. package/dist/NeetoWidget/EmbedCode.js +0 -281
  246. package/dist/NeetoWidget/Main.js +0 -19
  247. package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +0 -25
  248. package/dist/NeetoWidget/SelectionSwitches/index.js +0 -44
  249. package/dist/NeetoWidget/SyntaxHighlighter.js +0 -17
  250. package/dist/NeetoWidget/api.js +0 -20
  251. package/dist/NeetoWidget/constants.js +0 -62
  252. package/dist/NeetoWidget/hooks/useForceUpdate.js +0 -14
  253. package/dist/NeetoWidget/index.js +0 -7
  254. package/dist/NeetoWidget/mutations.js +0 -9
  255. package/dist/NeetoWidget/queries.js +0 -32
  256. package/dist/NeetoWidget/utils.js +0 -83
  257. package/dist/PageLoader/index.js +0 -81
  258. package/dist/PageLoader/page-loader.scss +0 -95
  259. package/dist/PhoneNumber/CountryPicker/SingleValue.js +0 -21
  260. package/dist/PhoneNumber/CountryPicker/constants.js +0 -26
  261. package/dist/PhoneNumber/CountryPicker/index.js +0 -59
  262. package/dist/PhoneNumber/FormikPhoneNumberInput.js +0 -21
  263. package/dist/PhoneNumber/PhoneNumber.js +0 -30
  264. package/dist/PhoneNumber/PhoneNumberInput.js +0 -79
  265. package/dist/PhoneNumber/index.js +0 -5
  266. package/dist/PhoneNumber/utils.js +0 -55
  267. package/dist/PublishBlock/AlertBlock.js +0 -14
  268. package/dist/PublishBlock/index.js +0 -100
  269. package/dist/PublishBlock/publish-block.scss +0 -25
  270. package/dist/Rename/DummySpan.js +0 -21
  271. package/dist/Rename/constants.js +0 -1
  272. package/dist/Rename/index.js +0 -191
  273. package/dist/Rename/rename.scss +0 -69
  274. package/dist/Rename/utils.js +0 -10
  275. package/dist/ResponsiveDevicePicker/constants.js +0 -19
  276. package/dist/ResponsiveDevicePicker/index.js +0 -36
  277. package/dist/Schedule/DisplayAvailability.js +0 -58
  278. package/dist/Schedule/Fields.js +0 -43
  279. package/dist/Schedule/Form/ScheduleRow.js +0 -125
  280. package/dist/Schedule/Form/constants.js +0 -20
  281. package/dist/Schedule/Form/index.js +0 -144
  282. package/dist/Schedule/Form/utils.js +0 -63
  283. package/dist/Schedule/Header.js +0 -76
  284. package/dist/Schedule/ScheduleContext.js +0 -8
  285. package/dist/Schedule/constants.js +0 -8
  286. package/dist/Schedule/dayjsExtended/constants.js +0 -1
  287. package/dist/Schedule/dayjsExtended/index.js +0 -14
  288. package/dist/Schedule/dayjsExtended/range.js +0 -73
  289. package/dist/Schedule/index.js +0 -80
  290. package/dist/Schedule/utils.js +0 -152
  291. package/dist/Scrollable/constants.js +0 -8
  292. package/dist/Scrollable/index.js +0 -26
  293. package/dist/Scrollable/scrollable.scss +0 -32
  294. package/dist/Search/index.js +0 -52
  295. package/dist/Security/AllowedKeywords/Add.js +0 -38
  296. package/dist/Security/AllowedKeywords/index.js +0 -38
  297. package/dist/Security/PasswordBlock.js +0 -31
  298. package/dist/Security/RadioBlock.js +0 -38
  299. package/dist/Security/api.js +0 -12
  300. package/dist/Security/constants.js +0 -58
  301. package/dist/Security/index.js +0 -68
  302. package/dist/Security/useSecurityApi.js +0 -22
  303. package/dist/Security/utils.js +0 -31
  304. package/dist/SendToFields/FilePicker.js +0 -34
  305. package/dist/SendToFields/constants.js +0 -6
  306. package/dist/SendToFields/index.js +0 -102
  307. package/dist/SendToFields/utils.js +0 -54
  308. package/dist/Settings/Category.js +0 -30
  309. package/dist/Settings/Item.js +0 -38
  310. package/dist/Settings/index.js +0 -37
  311. package/dist/Settings/utils.js +0 -4
  312. package/dist/ShareViaEmail/EmailBodyEditor.js +0 -22
  313. package/dist/ShareViaEmail/FilePicker.js +0 -43
  314. package/dist/ShareViaEmail/Form.js +0 -105
  315. package/dist/ShareViaEmail/FormikDatePicker.js +0 -24
  316. package/dist/ShareViaEmail/constants.js +0 -14
  317. package/dist/ShareViaEmail/index.js +0 -92
  318. package/dist/ShareViaEmail/utils.js +0 -72
  319. package/dist/ShareViaLink/EditURL.js +0 -74
  320. package/dist/ShareViaLink/Link.js +0 -105
  321. package/dist/ShareViaLink/QRCode.js +0 -41
  322. package/dist/ShareViaLink/RegenerateURL.js +0 -47
  323. package/dist/ShareViaLink/SocialMedia.js +0 -52
  324. package/dist/ShareViaLink/constants.js +0 -25
  325. package/dist/ShareViaLink/edit-url.scss +0 -8
  326. package/dist/ShareViaLink/index.js +0 -46
  327. package/dist/ShareViaLink/utils.js +0 -47
  328. package/dist/Sidebar/AppSwitcher/AppLink.js +0 -45
  329. package/dist/Sidebar/AppSwitcher/Backdrop.js +0 -13
  330. package/dist/Sidebar/AppSwitcher/Body.js +0 -65
  331. package/dist/Sidebar/AppSwitcher/Portal.js +0 -27
  332. package/dist/Sidebar/AppSwitcher/appswitcher.scss +0 -164
  333. package/dist/Sidebar/AppSwitcher/index.js +0 -47
  334. package/dist/Sidebar/AppSwitcher/utils.js +0 -25
  335. package/dist/Sidebar/Chevron.js +0 -14
  336. package/dist/Sidebar/FeaturedTooltip.js +0 -19
  337. package/dist/Sidebar/Footer/AppSwitcherButton.js +0 -48
  338. package/dist/Sidebar/Footer/ProfileButton.js +0 -30
  339. package/dist/Sidebar/Footer/index.js +0 -56
  340. package/dist/Sidebar/Footer/utils.js +0 -39
  341. package/dist/Sidebar/Header.js +0 -33
  342. package/dist/Sidebar/HelpSection/HelpSectionMenu.js +0 -52
  343. package/dist/Sidebar/HelpSection/index.js +0 -32
  344. package/dist/Sidebar/Links.js +0 -112
  345. package/dist/Sidebar/NavIconWrapper.js +0 -20
  346. package/dist/Sidebar/ProfileSection/LinkSection.js +0 -36
  347. package/dist/Sidebar/ProfileSection/ProfileMenu.js +0 -48
  348. package/dist/Sidebar/ProfileSection/index.js +0 -42
  349. package/dist/Sidebar/constants.js +0 -40
  350. package/dist/Sidebar/index.js +0 -94
  351. package/dist/Sidebar/sidebar.scss +0 -379
  352. package/dist/Sidebar/utils.js +0 -18
  353. package/dist/SubHeader/RightBlock/Columns.js +0 -35
  354. package/dist/SubHeader/RightBlock/Download.js +0 -28
  355. package/dist/SubHeader/RightBlock/Filter.js +0 -31
  356. package/dist/SubHeader/RightBlock/index.js +0 -21
  357. package/dist/SubHeader/RightBlock/utils.js +0 -13
  358. package/dist/SubHeader/index.js +0 -28
  359. package/dist/SubHeader/subheader.scss +0 -78
  360. package/dist/ThemeSidebar/Customize/Logo.js +0 -39
  361. package/dist/ThemeSidebar/Customize/Properties.js +0 -170
  362. package/dist/ThemeSidebar/Customize/index.js +0 -66
  363. package/dist/ThemeSidebar/Themes/ThemeCard.js +0 -135
  364. package/dist/ThemeSidebar/Themes/index.js +0 -110
  365. package/dist/ThemeSidebar/TitleBar.js +0 -62
  366. package/dist/ThemeSidebar/constants.js +0 -127
  367. package/dist/ThemeSidebar/fields/AlignmentBlock.js +0 -50
  368. package/dist/ThemeSidebar/fields/Card.js +0 -19
  369. package/dist/ThemeSidebar/fields/ColorBlock.js +0 -19
  370. package/dist/ThemeSidebar/fields/FontPickerBlock.js +0 -35
  371. package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +0 -67
  372. package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +0 -22
  373. package/dist/ThemeSidebar/fields/ImageBlock/index.js +0 -55
  374. package/dist/ThemeSidebar/fields/SelectBlock.js +0 -24
  375. package/dist/ThemeSidebar/fields/SliderBlock.js +0 -30
  376. package/dist/ThemeSidebar/fields/SwitchBlock.js +0 -17
  377. package/dist/ThemeSidebar/fields/TextBlock.js +0 -13
  378. package/dist/ThemeSidebar/fields/slider.scss +0 -199
  379. package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +0 -149
  380. package/dist/ThemeSidebar/index.js +0 -118
  381. package/dist/ThemeSidebar/themeSidebar.scss +0 -45
  382. package/dist/ThemeSidebar/utils.js +0 -169
  383. package/dist/TimeFormat/index.js +0 -3
  384. package/dist/TimezoneMismatchModal/apis/time_zone.js +0 -9
  385. package/dist/TimezoneMismatchModal/index.js +0 -83
  386. package/dist/TimezoneMismatchModal/useTimeZoneApi.js +0 -10
  387. package/dist/TimezoneMismatchModal/utils.js +0 -12
  388. package/dist/ToggleFeatureCard/ToolTipSwitch.js +0 -31
  389. package/dist/ToggleFeatureCard/constants.js +0 -5
  390. package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +0 -11
  391. package/dist/ToggleFeatureCard/index.js +0 -148
  392. package/dist/ToggleFeatureCard/toggleFeatureCard.scss +0 -4
@@ -0,0 +1,2277 @@
1
+ import React, { useRef, forwardRef } from 'react';
2
+ import { Upload, LeftArrow } from '@bigbinary/neeto-icons';
3
+ import { Typography, Button, Toastr, DatePicker, Label } from '@bigbinary/neetoui';
4
+ import { MultiEmailInput, Input, Switch, ActionBlock, Form as Form$1 } from '@bigbinary/neetoui/formik';
5
+ import { useTranslation } from 'react-i18next';
6
+ import classnames from 'classnames';
7
+ import { isPresent, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
8
+ import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
9
+ import { EditorContent, FormikEditor, isEditorEmpty } from '@bigbinary/neeto-editor';
10
+ import { useFormikContext, useField } from 'formik';
11
+ import { t } from 'i18next';
12
+ import Papa from 'papaparse';
13
+ import { prop } from 'ramda';
14
+ import * as yup from 'yup';
15
+ import { string } from 'yup';
16
+ import dayjs from 'dayjs';
17
+
18
+ function _typeof$1(obj) {
19
+ "@babel/helpers - typeof";
20
+
21
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
22
+ return typeof obj;
23
+ } : function (obj) {
24
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
25
+ }, _typeof$1(obj);
26
+ }
27
+
28
+ function _toPrimitive(input, hint) {
29
+ if (_typeof$1(input) !== "object" || input === null) return input;
30
+ var prim = input[Symbol.toPrimitive];
31
+ if (prim !== undefined) {
32
+ var res = prim.call(input, hint || "default");
33
+ if (_typeof$1(res) !== "object") return res;
34
+ throw new TypeError("@@toPrimitive must return a primitive value.");
35
+ }
36
+ return (hint === "string" ? String : Number)(input);
37
+ }
38
+
39
+ function _toPropertyKey(arg) {
40
+ var key = _toPrimitive(arg, "string");
41
+ return _typeof$1(key) === "symbol" ? key : String(key);
42
+ }
43
+
44
+ function _defineProperty(obj, key, value) {
45
+ key = _toPropertyKey(key);
46
+ if (key in obj) {
47
+ Object.defineProperty(obj, key, {
48
+ value: value,
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true
52
+ });
53
+ } else {
54
+ obj[key] = value;
55
+ }
56
+ return obj;
57
+ }
58
+
59
+ var propTypes = {exports: {}};
60
+
61
+ var reactIs = {exports: {}};
62
+
63
+ var reactIs_production_min = {};
64
+
65
+ /** @license React v16.13.1
66
+ * react-is.production.min.js
67
+ *
68
+ * Copyright (c) Facebook, Inc. and its affiliates.
69
+ *
70
+ * This source code is licensed under the MIT license found in the
71
+ * LICENSE file in the root directory of this source tree.
72
+ */
73
+
74
+ var hasRequiredReactIs_production_min;
75
+
76
+ function requireReactIs_production_min () {
77
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
78
+ hasRequiredReactIs_production_min = 1;
79
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
80
+ Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
81
+ function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
82
+ reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
83
+ reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
84
+ reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
85
+ return reactIs_production_min;
86
+ }
87
+
88
+ var reactIs_development = {};
89
+
90
+ /** @license React v16.13.1
91
+ * react-is.development.js
92
+ *
93
+ * Copyright (c) Facebook, Inc. and its affiliates.
94
+ *
95
+ * This source code is licensed under the MIT license found in the
96
+ * LICENSE file in the root directory of this source tree.
97
+ */
98
+
99
+ var hasRequiredReactIs_development;
100
+
101
+ function requireReactIs_development () {
102
+ if (hasRequiredReactIs_development) return reactIs_development;
103
+ hasRequiredReactIs_development = 1;
104
+
105
+
106
+
107
+ if (process.env.NODE_ENV !== "production") {
108
+ (function() {
109
+
110
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
111
+ // nor polyfill, then a plain number is used for performance.
112
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
113
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
114
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
115
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
116
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
117
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
118
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
119
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
120
+ // (unstable) APIs that have been removed. Can we remove the symbols?
121
+
122
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
123
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
124
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
125
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
126
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
127
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
128
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
129
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
130
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
131
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
132
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
133
+
134
+ function isValidElementType(type) {
135
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
136
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
137
+ }
138
+
139
+ function typeOf(object) {
140
+ if (typeof object === 'object' && object !== null) {
141
+ var $$typeof = object.$$typeof;
142
+
143
+ switch ($$typeof) {
144
+ case REACT_ELEMENT_TYPE:
145
+ var type = object.type;
146
+
147
+ switch (type) {
148
+ case REACT_ASYNC_MODE_TYPE:
149
+ case REACT_CONCURRENT_MODE_TYPE:
150
+ case REACT_FRAGMENT_TYPE:
151
+ case REACT_PROFILER_TYPE:
152
+ case REACT_STRICT_MODE_TYPE:
153
+ case REACT_SUSPENSE_TYPE:
154
+ return type;
155
+
156
+ default:
157
+ var $$typeofType = type && type.$$typeof;
158
+
159
+ switch ($$typeofType) {
160
+ case REACT_CONTEXT_TYPE:
161
+ case REACT_FORWARD_REF_TYPE:
162
+ case REACT_LAZY_TYPE:
163
+ case REACT_MEMO_TYPE:
164
+ case REACT_PROVIDER_TYPE:
165
+ return $$typeofType;
166
+
167
+ default:
168
+ return $$typeof;
169
+ }
170
+
171
+ }
172
+
173
+ case REACT_PORTAL_TYPE:
174
+ return $$typeof;
175
+ }
176
+ }
177
+
178
+ return undefined;
179
+ } // AsyncMode is deprecated along with isAsyncMode
180
+
181
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
182
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
183
+ var ContextConsumer = REACT_CONTEXT_TYPE;
184
+ var ContextProvider = REACT_PROVIDER_TYPE;
185
+ var Element = REACT_ELEMENT_TYPE;
186
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
187
+ var Fragment = REACT_FRAGMENT_TYPE;
188
+ var Lazy = REACT_LAZY_TYPE;
189
+ var Memo = REACT_MEMO_TYPE;
190
+ var Portal = REACT_PORTAL_TYPE;
191
+ var Profiler = REACT_PROFILER_TYPE;
192
+ var StrictMode = REACT_STRICT_MODE_TYPE;
193
+ var Suspense = REACT_SUSPENSE_TYPE;
194
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
195
+
196
+ function isAsyncMode(object) {
197
+ {
198
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
199
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
200
+
201
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
202
+ }
203
+ }
204
+
205
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
206
+ }
207
+ function isConcurrentMode(object) {
208
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
209
+ }
210
+ function isContextConsumer(object) {
211
+ return typeOf(object) === REACT_CONTEXT_TYPE;
212
+ }
213
+ function isContextProvider(object) {
214
+ return typeOf(object) === REACT_PROVIDER_TYPE;
215
+ }
216
+ function isElement(object) {
217
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
218
+ }
219
+ function isForwardRef(object) {
220
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
221
+ }
222
+ function isFragment(object) {
223
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
224
+ }
225
+ function isLazy(object) {
226
+ return typeOf(object) === REACT_LAZY_TYPE;
227
+ }
228
+ function isMemo(object) {
229
+ return typeOf(object) === REACT_MEMO_TYPE;
230
+ }
231
+ function isPortal(object) {
232
+ return typeOf(object) === REACT_PORTAL_TYPE;
233
+ }
234
+ function isProfiler(object) {
235
+ return typeOf(object) === REACT_PROFILER_TYPE;
236
+ }
237
+ function isStrictMode(object) {
238
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
239
+ }
240
+ function isSuspense(object) {
241
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
242
+ }
243
+
244
+ reactIs_development.AsyncMode = AsyncMode;
245
+ reactIs_development.ConcurrentMode = ConcurrentMode;
246
+ reactIs_development.ContextConsumer = ContextConsumer;
247
+ reactIs_development.ContextProvider = ContextProvider;
248
+ reactIs_development.Element = Element;
249
+ reactIs_development.ForwardRef = ForwardRef;
250
+ reactIs_development.Fragment = Fragment;
251
+ reactIs_development.Lazy = Lazy;
252
+ reactIs_development.Memo = Memo;
253
+ reactIs_development.Portal = Portal;
254
+ reactIs_development.Profiler = Profiler;
255
+ reactIs_development.StrictMode = StrictMode;
256
+ reactIs_development.Suspense = Suspense;
257
+ reactIs_development.isAsyncMode = isAsyncMode;
258
+ reactIs_development.isConcurrentMode = isConcurrentMode;
259
+ reactIs_development.isContextConsumer = isContextConsumer;
260
+ reactIs_development.isContextProvider = isContextProvider;
261
+ reactIs_development.isElement = isElement;
262
+ reactIs_development.isForwardRef = isForwardRef;
263
+ reactIs_development.isFragment = isFragment;
264
+ reactIs_development.isLazy = isLazy;
265
+ reactIs_development.isMemo = isMemo;
266
+ reactIs_development.isPortal = isPortal;
267
+ reactIs_development.isProfiler = isProfiler;
268
+ reactIs_development.isStrictMode = isStrictMode;
269
+ reactIs_development.isSuspense = isSuspense;
270
+ reactIs_development.isValidElementType = isValidElementType;
271
+ reactIs_development.typeOf = typeOf;
272
+ })();
273
+ }
274
+ return reactIs_development;
275
+ }
276
+
277
+ var hasRequiredReactIs;
278
+
279
+ function requireReactIs () {
280
+ if (hasRequiredReactIs) return reactIs.exports;
281
+ hasRequiredReactIs = 1;
282
+ (function (module) {
283
+
284
+ if (process.env.NODE_ENV === 'production') {
285
+ module.exports = requireReactIs_production_min();
286
+ } else {
287
+ module.exports = requireReactIs_development();
288
+ }
289
+ } (reactIs));
290
+ return reactIs.exports;
291
+ }
292
+
293
+ /*
294
+ object-assign
295
+ (c) Sindre Sorhus
296
+ @license MIT
297
+ */
298
+
299
+ var objectAssign;
300
+ var hasRequiredObjectAssign;
301
+
302
+ function requireObjectAssign () {
303
+ if (hasRequiredObjectAssign) return objectAssign;
304
+ hasRequiredObjectAssign = 1;
305
+ /* eslint-disable no-unused-vars */
306
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
307
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
308
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
309
+
310
+ function toObject(val) {
311
+ if (val === null || val === undefined) {
312
+ throw new TypeError('Object.assign cannot be called with null or undefined');
313
+ }
314
+
315
+ return Object(val);
316
+ }
317
+
318
+ function shouldUseNative() {
319
+ try {
320
+ if (!Object.assign) {
321
+ return false;
322
+ }
323
+
324
+ // Detect buggy property enumeration order in older V8 versions.
325
+
326
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
327
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
328
+ test1[5] = 'de';
329
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
330
+ return false;
331
+ }
332
+
333
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
334
+ var test2 = {};
335
+ for (var i = 0; i < 10; i++) {
336
+ test2['_' + String.fromCharCode(i)] = i;
337
+ }
338
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
339
+ return test2[n];
340
+ });
341
+ if (order2.join('') !== '0123456789') {
342
+ return false;
343
+ }
344
+
345
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
346
+ var test3 = {};
347
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
348
+ test3[letter] = letter;
349
+ });
350
+ if (Object.keys(Object.assign({}, test3)).join('') !==
351
+ 'abcdefghijklmnopqrst') {
352
+ return false;
353
+ }
354
+
355
+ return true;
356
+ } catch (err) {
357
+ // We don't expect any of the above to throw, but better to be safe.
358
+ return false;
359
+ }
360
+ }
361
+
362
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
363
+ var from;
364
+ var to = toObject(target);
365
+ var symbols;
366
+
367
+ for (var s = 1; s < arguments.length; s++) {
368
+ from = Object(arguments[s]);
369
+
370
+ for (var key in from) {
371
+ if (hasOwnProperty.call(from, key)) {
372
+ to[key] = from[key];
373
+ }
374
+ }
375
+
376
+ if (getOwnPropertySymbols) {
377
+ symbols = getOwnPropertySymbols(from);
378
+ for (var i = 0; i < symbols.length; i++) {
379
+ if (propIsEnumerable.call(from, symbols[i])) {
380
+ to[symbols[i]] = from[symbols[i]];
381
+ }
382
+ }
383
+ }
384
+ }
385
+
386
+ return to;
387
+ };
388
+ return objectAssign;
389
+ }
390
+
391
+ /**
392
+ * Copyright (c) 2013-present, Facebook, Inc.
393
+ *
394
+ * This source code is licensed under the MIT license found in the
395
+ * LICENSE file in the root directory of this source tree.
396
+ */
397
+
398
+ var ReactPropTypesSecret_1;
399
+ var hasRequiredReactPropTypesSecret;
400
+
401
+ function requireReactPropTypesSecret () {
402
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
403
+ hasRequiredReactPropTypesSecret = 1;
404
+
405
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
406
+
407
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
408
+ return ReactPropTypesSecret_1;
409
+ }
410
+
411
+ var has;
412
+ var hasRequiredHas;
413
+
414
+ function requireHas () {
415
+ if (hasRequiredHas) return has;
416
+ hasRequiredHas = 1;
417
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
418
+ return has;
419
+ }
420
+
421
+ /**
422
+ * Copyright (c) 2013-present, Facebook, Inc.
423
+ *
424
+ * This source code is licensed under the MIT license found in the
425
+ * LICENSE file in the root directory of this source tree.
426
+ */
427
+
428
+ var checkPropTypes_1;
429
+ var hasRequiredCheckPropTypes;
430
+
431
+ function requireCheckPropTypes () {
432
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
433
+ hasRequiredCheckPropTypes = 1;
434
+
435
+ var printWarning = function() {};
436
+
437
+ if (process.env.NODE_ENV !== 'production') {
438
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
439
+ var loggedTypeFailures = {};
440
+ var has = requireHas();
441
+
442
+ printWarning = function(text) {
443
+ var message = 'Warning: ' + text;
444
+ if (typeof console !== 'undefined') {
445
+ console.error(message);
446
+ }
447
+ try {
448
+ // --- Welcome to debugging React ---
449
+ // This error was thrown as a convenience so that you can use this stack
450
+ // to find the callsite that caused this warning to fire.
451
+ throw new Error(message);
452
+ } catch (x) { /**/ }
453
+ };
454
+ }
455
+
456
+ /**
457
+ * Assert that the values match with the type specs.
458
+ * Error messages are memorized and will only be shown once.
459
+ *
460
+ * @param {object} typeSpecs Map of name to a ReactPropType
461
+ * @param {object} values Runtime values that need to be type-checked
462
+ * @param {string} location e.g. "prop", "context", "child context"
463
+ * @param {string} componentName Name of the component for error messages.
464
+ * @param {?Function} getStack Returns the component stack.
465
+ * @private
466
+ */
467
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
468
+ if (process.env.NODE_ENV !== 'production') {
469
+ for (var typeSpecName in typeSpecs) {
470
+ if (has(typeSpecs, typeSpecName)) {
471
+ var error;
472
+ // Prop type validation may throw. In case they do, we don't want to
473
+ // fail the render phase where it didn't fail before. So we log it.
474
+ // After these have been cleaned up, we'll let them throw.
475
+ try {
476
+ // This is intentionally an invariant that gets caught. It's the same
477
+ // behavior as without this statement except with a better message.
478
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
479
+ var err = Error(
480
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
481
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
482
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
483
+ );
484
+ err.name = 'Invariant Violation';
485
+ throw err;
486
+ }
487
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
488
+ } catch (ex) {
489
+ error = ex;
490
+ }
491
+ if (error && !(error instanceof Error)) {
492
+ printWarning(
493
+ (componentName || 'React class') + ': type specification of ' +
494
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
495
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
496
+ 'You may have forgotten to pass an argument to the type checker ' +
497
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
498
+ 'shape all require an argument).'
499
+ );
500
+ }
501
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
502
+ // Only monitor this failure once because there tends to be a lot of the
503
+ // same error.
504
+ loggedTypeFailures[error.message] = true;
505
+
506
+ var stack = getStack ? getStack() : '';
507
+
508
+ printWarning(
509
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
510
+ );
511
+ }
512
+ }
513
+ }
514
+ }
515
+ }
516
+
517
+ /**
518
+ * Resets warning cache when testing.
519
+ *
520
+ * @private
521
+ */
522
+ checkPropTypes.resetWarningCache = function() {
523
+ if (process.env.NODE_ENV !== 'production') {
524
+ loggedTypeFailures = {};
525
+ }
526
+ };
527
+
528
+ checkPropTypes_1 = checkPropTypes;
529
+ return checkPropTypes_1;
530
+ }
531
+
532
+ /**
533
+ * Copyright (c) 2013-present, Facebook, Inc.
534
+ *
535
+ * This source code is licensed under the MIT license found in the
536
+ * LICENSE file in the root directory of this source tree.
537
+ */
538
+
539
+ var factoryWithTypeCheckers;
540
+ var hasRequiredFactoryWithTypeCheckers;
541
+
542
+ function requireFactoryWithTypeCheckers () {
543
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
544
+ hasRequiredFactoryWithTypeCheckers = 1;
545
+
546
+ var ReactIs = requireReactIs();
547
+ var assign = requireObjectAssign();
548
+
549
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
550
+ var has = requireHas();
551
+ var checkPropTypes = requireCheckPropTypes();
552
+
553
+ var printWarning = function() {};
554
+
555
+ if (process.env.NODE_ENV !== 'production') {
556
+ printWarning = function(text) {
557
+ var message = 'Warning: ' + text;
558
+ if (typeof console !== 'undefined') {
559
+ console.error(message);
560
+ }
561
+ try {
562
+ // --- Welcome to debugging React ---
563
+ // This error was thrown as a convenience so that you can use this stack
564
+ // to find the callsite that caused this warning to fire.
565
+ throw new Error(message);
566
+ } catch (x) {}
567
+ };
568
+ }
569
+
570
+ function emptyFunctionThatReturnsNull() {
571
+ return null;
572
+ }
573
+
574
+ factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
575
+ /* global Symbol */
576
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
577
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
578
+
579
+ /**
580
+ * Returns the iterator method function contained on the iterable object.
581
+ *
582
+ * Be sure to invoke the function with the iterable as context:
583
+ *
584
+ * var iteratorFn = getIteratorFn(myIterable);
585
+ * if (iteratorFn) {
586
+ * var iterator = iteratorFn.call(myIterable);
587
+ * ...
588
+ * }
589
+ *
590
+ * @param {?object} maybeIterable
591
+ * @return {?function}
592
+ */
593
+ function getIteratorFn(maybeIterable) {
594
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
595
+ if (typeof iteratorFn === 'function') {
596
+ return iteratorFn;
597
+ }
598
+ }
599
+
600
+ /**
601
+ * Collection of methods that allow declaration and validation of props that are
602
+ * supplied to React components. Example usage:
603
+ *
604
+ * var Props = require('ReactPropTypes');
605
+ * var MyArticle = React.createClass({
606
+ * propTypes: {
607
+ * // An optional string prop named "description".
608
+ * description: Props.string,
609
+ *
610
+ * // A required enum prop named "category".
611
+ * category: Props.oneOf(['News','Photos']).isRequired,
612
+ *
613
+ * // A prop named "dialog" that requires an instance of Dialog.
614
+ * dialog: Props.instanceOf(Dialog).isRequired
615
+ * },
616
+ * render: function() { ... }
617
+ * });
618
+ *
619
+ * A more formal specification of how these methods are used:
620
+ *
621
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
622
+ * decl := ReactPropTypes.{type}(.isRequired)?
623
+ *
624
+ * Each and every declaration produces a function with the same signature. This
625
+ * allows the creation of custom validation functions. For example:
626
+ *
627
+ * var MyLink = React.createClass({
628
+ * propTypes: {
629
+ * // An optional string or URI prop named "href".
630
+ * href: function(props, propName, componentName) {
631
+ * var propValue = props[propName];
632
+ * if (propValue != null && typeof propValue !== 'string' &&
633
+ * !(propValue instanceof URI)) {
634
+ * return new Error(
635
+ * 'Expected a string or an URI for ' + propName + ' in ' +
636
+ * componentName
637
+ * );
638
+ * }
639
+ * }
640
+ * },
641
+ * render: function() {...}
642
+ * });
643
+ *
644
+ * @internal
645
+ */
646
+
647
+ var ANONYMOUS = '<<anonymous>>';
648
+
649
+ // Important!
650
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
651
+ var ReactPropTypes = {
652
+ array: createPrimitiveTypeChecker('array'),
653
+ bigint: createPrimitiveTypeChecker('bigint'),
654
+ bool: createPrimitiveTypeChecker('boolean'),
655
+ func: createPrimitiveTypeChecker('function'),
656
+ number: createPrimitiveTypeChecker('number'),
657
+ object: createPrimitiveTypeChecker('object'),
658
+ string: createPrimitiveTypeChecker('string'),
659
+ symbol: createPrimitiveTypeChecker('symbol'),
660
+
661
+ any: createAnyTypeChecker(),
662
+ arrayOf: createArrayOfTypeChecker,
663
+ element: createElementTypeChecker(),
664
+ elementType: createElementTypeTypeChecker(),
665
+ instanceOf: createInstanceTypeChecker,
666
+ node: createNodeChecker(),
667
+ objectOf: createObjectOfTypeChecker,
668
+ oneOf: createEnumTypeChecker,
669
+ oneOfType: createUnionTypeChecker,
670
+ shape: createShapeTypeChecker,
671
+ exact: createStrictShapeTypeChecker,
672
+ };
673
+
674
+ /**
675
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
676
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
677
+ */
678
+ /*eslint-disable no-self-compare*/
679
+ function is(x, y) {
680
+ // SameValue algorithm
681
+ if (x === y) {
682
+ // Steps 1-5, 7-10
683
+ // Steps 6.b-6.e: +0 != -0
684
+ return x !== 0 || 1 / x === 1 / y;
685
+ } else {
686
+ // Step 6.a: NaN == NaN
687
+ return x !== x && y !== y;
688
+ }
689
+ }
690
+ /*eslint-enable no-self-compare*/
691
+
692
+ /**
693
+ * We use an Error-like object for backward compatibility as people may call
694
+ * PropTypes directly and inspect their output. However, we don't use real
695
+ * Errors anymore. We don't inspect their stack anyway, and creating them
696
+ * is prohibitively expensive if they are created too often, such as what
697
+ * happens in oneOfType() for any type before the one that matched.
698
+ */
699
+ function PropTypeError(message, data) {
700
+ this.message = message;
701
+ this.data = data && typeof data === 'object' ? data: {};
702
+ this.stack = '';
703
+ }
704
+ // Make `instanceof Error` still work for returned errors.
705
+ PropTypeError.prototype = Error.prototype;
706
+
707
+ function createChainableTypeChecker(validate) {
708
+ if (process.env.NODE_ENV !== 'production') {
709
+ var manualPropTypeCallCache = {};
710
+ var manualPropTypeWarningCount = 0;
711
+ }
712
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
713
+ componentName = componentName || ANONYMOUS;
714
+ propFullName = propFullName || propName;
715
+
716
+ if (secret !== ReactPropTypesSecret) {
717
+ if (throwOnDirectAccess) {
718
+ // New behavior only for users of `prop-types` package
719
+ var err = new Error(
720
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
721
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
722
+ 'Read more at http://fb.me/use-check-prop-types'
723
+ );
724
+ err.name = 'Invariant Violation';
725
+ throw err;
726
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
727
+ // Old behavior for people using React.PropTypes
728
+ var cacheKey = componentName + ':' + propName;
729
+ if (
730
+ !manualPropTypeCallCache[cacheKey] &&
731
+ // Avoid spamming the console because they are often not actionable except for lib authors
732
+ manualPropTypeWarningCount < 3
733
+ ) {
734
+ printWarning(
735
+ 'You are manually calling a React.PropTypes validation ' +
736
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
737
+ 'and will throw in the standalone `prop-types` package. ' +
738
+ 'You may be seeing this warning due to a third-party PropTypes ' +
739
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
740
+ );
741
+ manualPropTypeCallCache[cacheKey] = true;
742
+ manualPropTypeWarningCount++;
743
+ }
744
+ }
745
+ }
746
+ if (props[propName] == null) {
747
+ if (isRequired) {
748
+ if (props[propName] === null) {
749
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
750
+ }
751
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
752
+ }
753
+ return null;
754
+ } else {
755
+ return validate(props, propName, componentName, location, propFullName);
756
+ }
757
+ }
758
+
759
+ var chainedCheckType = checkType.bind(null, false);
760
+ chainedCheckType.isRequired = checkType.bind(null, true);
761
+
762
+ return chainedCheckType;
763
+ }
764
+
765
+ function createPrimitiveTypeChecker(expectedType) {
766
+ function validate(props, propName, componentName, location, propFullName, secret) {
767
+ var propValue = props[propName];
768
+ var propType = getPropType(propValue);
769
+ if (propType !== expectedType) {
770
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
771
+ // check, but we can offer a more precise error message here rather than
772
+ // 'of type `object`'.
773
+ var preciseType = getPreciseType(propValue);
774
+
775
+ return new PropTypeError(
776
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
777
+ {expectedType: expectedType}
778
+ );
779
+ }
780
+ return null;
781
+ }
782
+ return createChainableTypeChecker(validate);
783
+ }
784
+
785
+ function createAnyTypeChecker() {
786
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
787
+ }
788
+
789
+ function createArrayOfTypeChecker(typeChecker) {
790
+ function validate(props, propName, componentName, location, propFullName) {
791
+ if (typeof typeChecker !== 'function') {
792
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
793
+ }
794
+ var propValue = props[propName];
795
+ if (!Array.isArray(propValue)) {
796
+ var propType = getPropType(propValue);
797
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
798
+ }
799
+ for (var i = 0; i < propValue.length; i++) {
800
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
801
+ if (error instanceof Error) {
802
+ return error;
803
+ }
804
+ }
805
+ return null;
806
+ }
807
+ return createChainableTypeChecker(validate);
808
+ }
809
+
810
+ function createElementTypeChecker() {
811
+ function validate(props, propName, componentName, location, propFullName) {
812
+ var propValue = props[propName];
813
+ if (!isValidElement(propValue)) {
814
+ var propType = getPropType(propValue);
815
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
816
+ }
817
+ return null;
818
+ }
819
+ return createChainableTypeChecker(validate);
820
+ }
821
+
822
+ function createElementTypeTypeChecker() {
823
+ function validate(props, propName, componentName, location, propFullName) {
824
+ var propValue = props[propName];
825
+ if (!ReactIs.isValidElementType(propValue)) {
826
+ var propType = getPropType(propValue);
827
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
828
+ }
829
+ return null;
830
+ }
831
+ return createChainableTypeChecker(validate);
832
+ }
833
+
834
+ function createInstanceTypeChecker(expectedClass) {
835
+ function validate(props, propName, componentName, location, propFullName) {
836
+ if (!(props[propName] instanceof expectedClass)) {
837
+ var expectedClassName = expectedClass.name || ANONYMOUS;
838
+ var actualClassName = getClassName(props[propName]);
839
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
840
+ }
841
+ return null;
842
+ }
843
+ return createChainableTypeChecker(validate);
844
+ }
845
+
846
+ function createEnumTypeChecker(expectedValues) {
847
+ if (!Array.isArray(expectedValues)) {
848
+ if (process.env.NODE_ENV !== 'production') {
849
+ if (arguments.length > 1) {
850
+ printWarning(
851
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
852
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
853
+ );
854
+ } else {
855
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
856
+ }
857
+ }
858
+ return emptyFunctionThatReturnsNull;
859
+ }
860
+
861
+ function validate(props, propName, componentName, location, propFullName) {
862
+ var propValue = props[propName];
863
+ for (var i = 0; i < expectedValues.length; i++) {
864
+ if (is(propValue, expectedValues[i])) {
865
+ return null;
866
+ }
867
+ }
868
+
869
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
870
+ var type = getPreciseType(value);
871
+ if (type === 'symbol') {
872
+ return String(value);
873
+ }
874
+ return value;
875
+ });
876
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
877
+ }
878
+ return createChainableTypeChecker(validate);
879
+ }
880
+
881
+ function createObjectOfTypeChecker(typeChecker) {
882
+ function validate(props, propName, componentName, location, propFullName) {
883
+ if (typeof typeChecker !== 'function') {
884
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
885
+ }
886
+ var propValue = props[propName];
887
+ var propType = getPropType(propValue);
888
+ if (propType !== 'object') {
889
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
890
+ }
891
+ for (var key in propValue) {
892
+ if (has(propValue, key)) {
893
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
894
+ if (error instanceof Error) {
895
+ return error;
896
+ }
897
+ }
898
+ }
899
+ return null;
900
+ }
901
+ return createChainableTypeChecker(validate);
902
+ }
903
+
904
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
905
+ if (!Array.isArray(arrayOfTypeCheckers)) {
906
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
907
+ return emptyFunctionThatReturnsNull;
908
+ }
909
+
910
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
911
+ var checker = arrayOfTypeCheckers[i];
912
+ if (typeof checker !== 'function') {
913
+ printWarning(
914
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
915
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
916
+ );
917
+ return emptyFunctionThatReturnsNull;
918
+ }
919
+ }
920
+
921
+ function validate(props, propName, componentName, location, propFullName) {
922
+ var expectedTypes = [];
923
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
924
+ var checker = arrayOfTypeCheckers[i];
925
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
926
+ if (checkerResult == null) {
927
+ return null;
928
+ }
929
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
930
+ expectedTypes.push(checkerResult.data.expectedType);
931
+ }
932
+ }
933
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
934
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
935
+ }
936
+ return createChainableTypeChecker(validate);
937
+ }
938
+
939
+ function createNodeChecker() {
940
+ function validate(props, propName, componentName, location, propFullName) {
941
+ if (!isNode(props[propName])) {
942
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
943
+ }
944
+ return null;
945
+ }
946
+ return createChainableTypeChecker(validate);
947
+ }
948
+
949
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
950
+ return new PropTypeError(
951
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
952
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
953
+ );
954
+ }
955
+
956
+ function createShapeTypeChecker(shapeTypes) {
957
+ function validate(props, propName, componentName, location, propFullName) {
958
+ var propValue = props[propName];
959
+ var propType = getPropType(propValue);
960
+ if (propType !== 'object') {
961
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
962
+ }
963
+ for (var key in shapeTypes) {
964
+ var checker = shapeTypes[key];
965
+ if (typeof checker !== 'function') {
966
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
967
+ }
968
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
969
+ if (error) {
970
+ return error;
971
+ }
972
+ }
973
+ return null;
974
+ }
975
+ return createChainableTypeChecker(validate);
976
+ }
977
+
978
+ function createStrictShapeTypeChecker(shapeTypes) {
979
+ function validate(props, propName, componentName, location, propFullName) {
980
+ var propValue = props[propName];
981
+ var propType = getPropType(propValue);
982
+ if (propType !== 'object') {
983
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
984
+ }
985
+ // We need to check all keys in case some are required but missing from props.
986
+ var allKeys = assign({}, props[propName], shapeTypes);
987
+ for (var key in allKeys) {
988
+ var checker = shapeTypes[key];
989
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
990
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
991
+ }
992
+ if (!checker) {
993
+ return new PropTypeError(
994
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
995
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
996
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
997
+ );
998
+ }
999
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1000
+ if (error) {
1001
+ return error;
1002
+ }
1003
+ }
1004
+ return null;
1005
+ }
1006
+
1007
+ return createChainableTypeChecker(validate);
1008
+ }
1009
+
1010
+ function isNode(propValue) {
1011
+ switch (typeof propValue) {
1012
+ case 'number':
1013
+ case 'string':
1014
+ case 'undefined':
1015
+ return true;
1016
+ case 'boolean':
1017
+ return !propValue;
1018
+ case 'object':
1019
+ if (Array.isArray(propValue)) {
1020
+ return propValue.every(isNode);
1021
+ }
1022
+ if (propValue === null || isValidElement(propValue)) {
1023
+ return true;
1024
+ }
1025
+
1026
+ var iteratorFn = getIteratorFn(propValue);
1027
+ if (iteratorFn) {
1028
+ var iterator = iteratorFn.call(propValue);
1029
+ var step;
1030
+ if (iteratorFn !== propValue.entries) {
1031
+ while (!(step = iterator.next()).done) {
1032
+ if (!isNode(step.value)) {
1033
+ return false;
1034
+ }
1035
+ }
1036
+ } else {
1037
+ // Iterator will provide entry [k,v] tuples rather than values.
1038
+ while (!(step = iterator.next()).done) {
1039
+ var entry = step.value;
1040
+ if (entry) {
1041
+ if (!isNode(entry[1])) {
1042
+ return false;
1043
+ }
1044
+ }
1045
+ }
1046
+ }
1047
+ } else {
1048
+ return false;
1049
+ }
1050
+
1051
+ return true;
1052
+ default:
1053
+ return false;
1054
+ }
1055
+ }
1056
+
1057
+ function isSymbol(propType, propValue) {
1058
+ // Native Symbol.
1059
+ if (propType === 'symbol') {
1060
+ return true;
1061
+ }
1062
+
1063
+ // falsy value can't be a Symbol
1064
+ if (!propValue) {
1065
+ return false;
1066
+ }
1067
+
1068
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1069
+ if (propValue['@@toStringTag'] === 'Symbol') {
1070
+ return true;
1071
+ }
1072
+
1073
+ // Fallback for non-spec compliant Symbols which are polyfilled.
1074
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1075
+ return true;
1076
+ }
1077
+
1078
+ return false;
1079
+ }
1080
+
1081
+ // Equivalent of `typeof` but with special handling for array and regexp.
1082
+ function getPropType(propValue) {
1083
+ var propType = typeof propValue;
1084
+ if (Array.isArray(propValue)) {
1085
+ return 'array';
1086
+ }
1087
+ if (propValue instanceof RegExp) {
1088
+ // Old webkits (at least until Android 4.0) return 'function' rather than
1089
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1090
+ // passes PropTypes.object.
1091
+ return 'object';
1092
+ }
1093
+ if (isSymbol(propType, propValue)) {
1094
+ return 'symbol';
1095
+ }
1096
+ return propType;
1097
+ }
1098
+
1099
+ // This handles more types than `getPropType`. Only used for error messages.
1100
+ // See `createPrimitiveTypeChecker`.
1101
+ function getPreciseType(propValue) {
1102
+ if (typeof propValue === 'undefined' || propValue === null) {
1103
+ return '' + propValue;
1104
+ }
1105
+ var propType = getPropType(propValue);
1106
+ if (propType === 'object') {
1107
+ if (propValue instanceof Date) {
1108
+ return 'date';
1109
+ } else if (propValue instanceof RegExp) {
1110
+ return 'regexp';
1111
+ }
1112
+ }
1113
+ return propType;
1114
+ }
1115
+
1116
+ // Returns a string that is postfixed to a warning about an invalid type.
1117
+ // For example, "undefined" or "of type array"
1118
+ function getPostfixForTypeWarning(value) {
1119
+ var type = getPreciseType(value);
1120
+ switch (type) {
1121
+ case 'array':
1122
+ case 'object':
1123
+ return 'an ' + type;
1124
+ case 'boolean':
1125
+ case 'date':
1126
+ case 'regexp':
1127
+ return 'a ' + type;
1128
+ default:
1129
+ return type;
1130
+ }
1131
+ }
1132
+
1133
+ // Returns class name of the object, if any.
1134
+ function getClassName(propValue) {
1135
+ if (!propValue.constructor || !propValue.constructor.name) {
1136
+ return ANONYMOUS;
1137
+ }
1138
+ return propValue.constructor.name;
1139
+ }
1140
+
1141
+ ReactPropTypes.checkPropTypes = checkPropTypes;
1142
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1143
+ ReactPropTypes.PropTypes = ReactPropTypes;
1144
+
1145
+ return ReactPropTypes;
1146
+ };
1147
+ return factoryWithTypeCheckers;
1148
+ }
1149
+
1150
+ /**
1151
+ * Copyright (c) 2013-present, Facebook, Inc.
1152
+ *
1153
+ * This source code is licensed under the MIT license found in the
1154
+ * LICENSE file in the root directory of this source tree.
1155
+ */
1156
+
1157
+ var factoryWithThrowingShims;
1158
+ var hasRequiredFactoryWithThrowingShims;
1159
+
1160
+ function requireFactoryWithThrowingShims () {
1161
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1162
+ hasRequiredFactoryWithThrowingShims = 1;
1163
+
1164
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
1165
+
1166
+ function emptyFunction() {}
1167
+ function emptyFunctionWithReset() {}
1168
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
1169
+
1170
+ factoryWithThrowingShims = function() {
1171
+ function shim(props, propName, componentName, location, propFullName, secret) {
1172
+ if (secret === ReactPropTypesSecret) {
1173
+ // It is still safe when called from React.
1174
+ return;
1175
+ }
1176
+ var err = new Error(
1177
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1178
+ 'Use PropTypes.checkPropTypes() to call them. ' +
1179
+ 'Read more at http://fb.me/use-check-prop-types'
1180
+ );
1181
+ err.name = 'Invariant Violation';
1182
+ throw err;
1183
+ } shim.isRequired = shim;
1184
+ function getShim() {
1185
+ return shim;
1186
+ } // Important!
1187
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1188
+ var ReactPropTypes = {
1189
+ array: shim,
1190
+ bigint: shim,
1191
+ bool: shim,
1192
+ func: shim,
1193
+ number: shim,
1194
+ object: shim,
1195
+ string: shim,
1196
+ symbol: shim,
1197
+
1198
+ any: shim,
1199
+ arrayOf: getShim,
1200
+ element: shim,
1201
+ elementType: shim,
1202
+ instanceOf: getShim,
1203
+ node: shim,
1204
+ objectOf: getShim,
1205
+ oneOf: getShim,
1206
+ oneOfType: getShim,
1207
+ shape: getShim,
1208
+ exact: getShim,
1209
+
1210
+ checkPropTypes: emptyFunctionWithReset,
1211
+ resetWarningCache: emptyFunction
1212
+ };
1213
+
1214
+ ReactPropTypes.PropTypes = ReactPropTypes;
1215
+
1216
+ return ReactPropTypes;
1217
+ };
1218
+ return factoryWithThrowingShims;
1219
+ }
1220
+
1221
+ /**
1222
+ * Copyright (c) 2013-present, Facebook, Inc.
1223
+ *
1224
+ * This source code is licensed under the MIT license found in the
1225
+ * LICENSE file in the root directory of this source tree.
1226
+ */
1227
+
1228
+ if (process.env.NODE_ENV !== 'production') {
1229
+ var ReactIs = requireReactIs();
1230
+
1231
+ // By explicitly using `prop-types` you are opting into new development behavior.
1232
+ // http://fb.me/prop-types-in-prod
1233
+ var throwOnDirectAccess = true;
1234
+ propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1235
+ } else {
1236
+ // By explicitly using `prop-types` you are opting into new production behavior.
1237
+ // http://fb.me/prop-types-in-prod
1238
+ propTypes.exports = requireFactoryWithThrowingShims()();
1239
+ }
1240
+
1241
+ var MemoizedEditorContent = /*#__PURE__*/React.memo(EditorContent);
1242
+ var EmailPreview = withT(function (_ref) {
1243
+ var t = _ref.t,
1244
+ _ref$to = _ref.to,
1245
+ to = _ref$to === void 0 ? [] : _ref$to,
1246
+ from = _ref.from,
1247
+ subject = _ref.subject,
1248
+ body = _ref.body,
1249
+ productName = _ref.productName,
1250
+ actionButtonText = _ref.actionButtonText,
1251
+ logo = _ref.logo,
1252
+ _ref$className = _ref.className,
1253
+ className = _ref$className === void 0 ? "" : _ref$className;
1254
+ return /*#__PURE__*/React.createElement("div", {
1255
+ "data-cy": "email-preview-card",
1256
+ "data-testid": "email-preview",
1257
+ className: classnames("neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border", _defineProperty({}, className, className))
1258
+ }, /*#__PURE__*/React.createElement("div", {
1259
+ className: "neeto-ui-border-gray-300 space-y-3 divide-y divide-gray-200 border-b p-6"
1260
+ }, /*#__PURE__*/React.createElement("div", {
1261
+ className: "flex gap-2",
1262
+ "data-cy": "email-send-to-preview",
1263
+ "data-testid": "email-to-block"
1264
+ }, /*#__PURE__*/React.createElement(Typography, {
1265
+ className: "neeto-ui-text-gray-500",
1266
+ lineHeight: "normal",
1267
+ style: "body2"
1268
+ }, t("neetoMolecules.emailPreview.to"), ":"), isPresent(to) && isNotEmpty(to) ? /*#__PURE__*/React.createElement(Typography, {
1269
+ className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
1270
+ lineHeight: "normal",
1271
+ style: "body2"
1272
+ }, to.join(", ")) : /*#__PURE__*/React.createElement("div", {
1273
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full mt-2 h-2 w-40"
1274
+ })), from && /*#__PURE__*/React.createElement("div", {
1275
+ className: "flex items-center gap-2 pt-3"
1276
+ }, /*#__PURE__*/React.createElement(Typography, {
1277
+ className: "neeto-ui-text-gray-500",
1278
+ lineHeight: "normal",
1279
+ style: "body2"
1280
+ }, t("neetoMolecules.emailPreview.from"), ":"), /*#__PURE__*/React.createElement(Typography, {
1281
+ className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
1282
+ "data-cy": "email-send-from-preview",
1283
+ lineHeight: "normal",
1284
+ style: "body2"
1285
+ }, from)), /*#__PURE__*/React.createElement("div", {
1286
+ className: "flex items-center gap-2 pt-3"
1287
+ }, /*#__PURE__*/React.createElement(Typography, {
1288
+ className: "neeto-ui-text-gray-500",
1289
+ lineHeight: "normal",
1290
+ style: "body2"
1291
+ }, t("neetoMolecules.emailPreview.subject"), ":"), /*#__PURE__*/React.createElement(Typography, {
1292
+ className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
1293
+ "data-cy": "email-subject-preview",
1294
+ lineHeight: "normal",
1295
+ style: "body2"
1296
+ }, subject || /*#__PURE__*/React.createElement("span", {
1297
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40"
1298
+ })))), /*#__PURE__*/React.createElement("div", {
1299
+ className: "neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed",
1300
+ "data-cy": "email-body-preview-container"
1301
+ }, body ? /*#__PURE__*/React.createElement(MemoizedEditorContent, {
1302
+ content: body
1303
+ }) : /*#__PURE__*/React.createElement("div", {
1304
+ className: "space-y-4"
1305
+ }, /*#__PURE__*/React.createElement("div", {
1306
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-80"
1307
+ }), /*#__PURE__*/React.createElement("div", {
1308
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-72"
1309
+ }), /*#__PURE__*/React.createElement("div", {
1310
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-80"
1311
+ })), actionButtonText && /*#__PURE__*/React.createElement("div", {
1312
+ className: "mt-6 flex w-full items-center justify-center"
1313
+ }, /*#__PURE__*/React.createElement(Button, {
1314
+ className: "pointer-events-none",
1315
+ label: actionButtonText
1316
+ })), logo && /*#__PURE__*/React.createElement("img", {
1317
+ alt: t("neetoMolecules.emailPreview.logoAltText"),
1318
+ className: "h-20 w-36 object-cover",
1319
+ "data-cy": "company-logo-preview",
1320
+ src: logo
1321
+ })), productName && /*#__PURE__*/React.createElement("div", {
1322
+ className: "neeto-ui-bg-gray-100 mt-auto p-2",
1323
+ "data-testid": "product-name-block"
1324
+ }, /*#__PURE__*/React.createElement(Typography, {
1325
+ className: "neeto-ui-text-gray-600 text-center leading-6",
1326
+ style: "body3"
1327
+ }, t("neetoMolecules.emailPreview.poweredBy"), /*#__PURE__*/React.createElement("span", {
1328
+ className: "neeto-ui-text-gray-800 font-medium"
1329
+ }, productName))));
1330
+ });
1331
+ EmailPreview.propTypes = {
1332
+ /**
1333
+ * The value of the send-to field.
1334
+ */
1335
+ to: propTypes.exports.arrayOf(propTypes.exports.string),
1336
+ /**
1337
+ * The value of the send-from field.
1338
+ */
1339
+ from: propTypes.exports.string,
1340
+ /**
1341
+ * The subject of the email.
1342
+ */
1343
+ subject: propTypes.exports.string,
1344
+ /**
1345
+ * The body of the email.
1346
+ */
1347
+ body: propTypes.exports.string,
1348
+ /**
1349
+ * The name of the neeto product to be previewed.
1350
+ */
1351
+ productName: propTypes.exports.string,
1352
+ /**
1353
+ * The text to be shown in the action button.
1354
+ */
1355
+ actionButtonText: propTypes.exports.string,
1356
+ /**
1357
+ * Source link for the company logo.
1358
+ */
1359
+ logo: propTypes.exports.string
1360
+ };
1361
+
1362
+ function _extends() {
1363
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
1364
+ for (var i = 1; i < arguments.length; i++) {
1365
+ var source = arguments[i];
1366
+ for (var key in source) {
1367
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1368
+ target[key] = source[key];
1369
+ }
1370
+ }
1371
+ }
1372
+ return target;
1373
+ };
1374
+ return _extends.apply(this, arguments);
1375
+ }
1376
+
1377
+ function _arrayLikeToArray(arr, len) {
1378
+ if (len == null || len > arr.length) len = arr.length;
1379
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1380
+ return arr2;
1381
+ }
1382
+
1383
+ function _arrayWithoutHoles(arr) {
1384
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
1385
+ }
1386
+
1387
+ function _iterableToArray(iter) {
1388
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1389
+ }
1390
+
1391
+ function _unsupportedIterableToArray(o, minLen) {
1392
+ if (!o) return;
1393
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1394
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1395
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1396
+ if (n === "Map" || n === "Set") return Array.from(o);
1397
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1398
+ }
1399
+
1400
+ function _nonIterableSpread() {
1401
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1402
+ }
1403
+
1404
+ function _toConsumableArray(arr) {
1405
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
1406
+ }
1407
+
1408
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1409
+ try {
1410
+ var info = gen[key](arg);
1411
+ var value = info.value;
1412
+ } catch (error) {
1413
+ reject(error);
1414
+ return;
1415
+ }
1416
+ if (info.done) {
1417
+ resolve(value);
1418
+ } else {
1419
+ Promise.resolve(value).then(_next, _throw);
1420
+ }
1421
+ }
1422
+ function _asyncToGenerator(fn) {
1423
+ return function () {
1424
+ var self = this,
1425
+ args = arguments;
1426
+ return new Promise(function (resolve, reject) {
1427
+ var gen = fn.apply(self, args);
1428
+ function _next(value) {
1429
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1430
+ }
1431
+ function _throw(err) {
1432
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1433
+ }
1434
+ _next(undefined);
1435
+ });
1436
+ };
1437
+ }
1438
+
1439
+ var regeneratorRuntime$1 = {exports: {}};
1440
+
1441
+ var _typeof = {exports: {}};
1442
+
1443
+ (function (module) {
1444
+ function _typeof(obj) {
1445
+ "@babel/helpers - typeof";
1446
+
1447
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1448
+ return typeof obj;
1449
+ } : function (obj) {
1450
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1451
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
1452
+ }
1453
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
1454
+ } (_typeof));
1455
+
1456
+ (function (module) {
1457
+ var _typeof$1 = _typeof.exports["default"];
1458
+ function _regeneratorRuntime() {
1459
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
1460
+ return exports;
1461
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
1462
+ var exports = {},
1463
+ Op = Object.prototype,
1464
+ hasOwn = Op.hasOwnProperty,
1465
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
1466
+ obj[key] = desc.value;
1467
+ },
1468
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
1469
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
1470
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
1471
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1472
+ function define(obj, key, value) {
1473
+ return Object.defineProperty(obj, key, {
1474
+ value: value,
1475
+ enumerable: !0,
1476
+ configurable: !0,
1477
+ writable: !0
1478
+ }), obj[key];
1479
+ }
1480
+ try {
1481
+ define({}, "");
1482
+ } catch (err) {
1483
+ define = function define(obj, key, value) {
1484
+ return obj[key] = value;
1485
+ };
1486
+ }
1487
+ function wrap(innerFn, outerFn, self, tryLocsList) {
1488
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
1489
+ generator = Object.create(protoGenerator.prototype),
1490
+ context = new Context(tryLocsList || []);
1491
+ return defineProperty(generator, "_invoke", {
1492
+ value: makeInvokeMethod(innerFn, self, context)
1493
+ }), generator;
1494
+ }
1495
+ function tryCatch(fn, obj, arg) {
1496
+ try {
1497
+ return {
1498
+ type: "normal",
1499
+ arg: fn.call(obj, arg)
1500
+ };
1501
+ } catch (err) {
1502
+ return {
1503
+ type: "throw",
1504
+ arg: err
1505
+ };
1506
+ }
1507
+ }
1508
+ exports.wrap = wrap;
1509
+ var ContinueSentinel = {};
1510
+ function Generator() {}
1511
+ function GeneratorFunction() {}
1512
+ function GeneratorFunctionPrototype() {}
1513
+ var IteratorPrototype = {};
1514
+ define(IteratorPrototype, iteratorSymbol, function () {
1515
+ return this;
1516
+ });
1517
+ var getProto = Object.getPrototypeOf,
1518
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1519
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
1520
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
1521
+ function defineIteratorMethods(prototype) {
1522
+ ["next", "throw", "return"].forEach(function (method) {
1523
+ define(prototype, method, function (arg) {
1524
+ return this._invoke(method, arg);
1525
+ });
1526
+ });
1527
+ }
1528
+ function AsyncIterator(generator, PromiseImpl) {
1529
+ function invoke(method, arg, resolve, reject) {
1530
+ var record = tryCatch(generator[method], generator, arg);
1531
+ if ("throw" !== record.type) {
1532
+ var result = record.arg,
1533
+ value = result.value;
1534
+ return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
1535
+ invoke("next", value, resolve, reject);
1536
+ }, function (err) {
1537
+ invoke("throw", err, resolve, reject);
1538
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
1539
+ result.value = unwrapped, resolve(result);
1540
+ }, function (error) {
1541
+ return invoke("throw", error, resolve, reject);
1542
+ });
1543
+ }
1544
+ reject(record.arg);
1545
+ }
1546
+ var previousPromise;
1547
+ defineProperty(this, "_invoke", {
1548
+ value: function value(method, arg) {
1549
+ function callInvokeWithMethodAndArg() {
1550
+ return new PromiseImpl(function (resolve, reject) {
1551
+ invoke(method, arg, resolve, reject);
1552
+ });
1553
+ }
1554
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
1555
+ }
1556
+ });
1557
+ }
1558
+ function makeInvokeMethod(innerFn, self, context) {
1559
+ var state = "suspendedStart";
1560
+ return function (method, arg) {
1561
+ if ("executing" === state) throw new Error("Generator is already running");
1562
+ if ("completed" === state) {
1563
+ if ("throw" === method) throw arg;
1564
+ return doneResult();
1565
+ }
1566
+ for (context.method = method, context.arg = arg;;) {
1567
+ var delegate = context.delegate;
1568
+ if (delegate) {
1569
+ var delegateResult = maybeInvokeDelegate(delegate, context);
1570
+ if (delegateResult) {
1571
+ if (delegateResult === ContinueSentinel) continue;
1572
+ return delegateResult;
1573
+ }
1574
+ }
1575
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
1576
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
1577
+ context.dispatchException(context.arg);
1578
+ } else "return" === context.method && context.abrupt("return", context.arg);
1579
+ state = "executing";
1580
+ var record = tryCatch(innerFn, self, context);
1581
+ if ("normal" === record.type) {
1582
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
1583
+ return {
1584
+ value: record.arg,
1585
+ done: context.done
1586
+ };
1587
+ }
1588
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
1589
+ }
1590
+ };
1591
+ }
1592
+ function maybeInvokeDelegate(delegate, context) {
1593
+ var methodName = context.method,
1594
+ method = delegate.iterator[methodName];
1595
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
1596
+ var record = tryCatch(method, delegate.iterator, context.arg);
1597
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
1598
+ var info = record.arg;
1599
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
1600
+ }
1601
+ function pushTryEntry(locs) {
1602
+ var entry = {
1603
+ tryLoc: locs[0]
1604
+ };
1605
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
1606
+ }
1607
+ function resetTryEntry(entry) {
1608
+ var record = entry.completion || {};
1609
+ record.type = "normal", delete record.arg, entry.completion = record;
1610
+ }
1611
+ function Context(tryLocsList) {
1612
+ this.tryEntries = [{
1613
+ tryLoc: "root"
1614
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
1615
+ }
1616
+ function values(iterable) {
1617
+ if (iterable) {
1618
+ var iteratorMethod = iterable[iteratorSymbol];
1619
+ if (iteratorMethod) return iteratorMethod.call(iterable);
1620
+ if ("function" == typeof iterable.next) return iterable;
1621
+ if (!isNaN(iterable.length)) {
1622
+ var i = -1,
1623
+ next = function next() {
1624
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
1625
+ return next.value = undefined, next.done = !0, next;
1626
+ };
1627
+ return next.next = next;
1628
+ }
1629
+ }
1630
+ return {
1631
+ next: doneResult
1632
+ };
1633
+ }
1634
+ function doneResult() {
1635
+ return {
1636
+ value: undefined,
1637
+ done: !0
1638
+ };
1639
+ }
1640
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
1641
+ value: GeneratorFunctionPrototype,
1642
+ configurable: !0
1643
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
1644
+ value: GeneratorFunction,
1645
+ configurable: !0
1646
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
1647
+ var ctor = "function" == typeof genFun && genFun.constructor;
1648
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
1649
+ }, exports.mark = function (genFun) {
1650
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
1651
+ }, exports.awrap = function (arg) {
1652
+ return {
1653
+ __await: arg
1654
+ };
1655
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
1656
+ return this;
1657
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1658
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
1659
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
1660
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
1661
+ return result.done ? result.value : iter.next();
1662
+ });
1663
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
1664
+ return this;
1665
+ }), define(Gp, "toString", function () {
1666
+ return "[object Generator]";
1667
+ }), exports.keys = function (val) {
1668
+ var object = Object(val),
1669
+ keys = [];
1670
+ for (var key in object) keys.push(key);
1671
+ return keys.reverse(), function next() {
1672
+ for (; keys.length;) {
1673
+ var key = keys.pop();
1674
+ if (key in object) return next.value = key, next.done = !1, next;
1675
+ }
1676
+ return next.done = !0, next;
1677
+ };
1678
+ }, exports.values = values, Context.prototype = {
1679
+ constructor: Context,
1680
+ reset: function reset(skipTempReset) {
1681
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
1682
+ },
1683
+ stop: function stop() {
1684
+ this.done = !0;
1685
+ var rootRecord = this.tryEntries[0].completion;
1686
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
1687
+ return this.rval;
1688
+ },
1689
+ dispatchException: function dispatchException(exception) {
1690
+ if (this.done) throw exception;
1691
+ var context = this;
1692
+ function handle(loc, caught) {
1693
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
1694
+ }
1695
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1696
+ var entry = this.tryEntries[i],
1697
+ record = entry.completion;
1698
+ if ("root" === entry.tryLoc) return handle("end");
1699
+ if (entry.tryLoc <= this.prev) {
1700
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
1701
+ hasFinally = hasOwn.call(entry, "finallyLoc");
1702
+ if (hasCatch && hasFinally) {
1703
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
1704
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
1705
+ } else if (hasCatch) {
1706
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
1707
+ } else {
1708
+ if (!hasFinally) throw new Error("try statement without catch or finally");
1709
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
1710
+ }
1711
+ }
1712
+ }
1713
+ },
1714
+ abrupt: function abrupt(type, arg) {
1715
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1716
+ var entry = this.tryEntries[i];
1717
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
1718
+ var finallyEntry = entry;
1719
+ break;
1720
+ }
1721
+ }
1722
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
1723
+ var record = finallyEntry ? finallyEntry.completion : {};
1724
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
1725
+ },
1726
+ complete: function complete(record, afterLoc) {
1727
+ if ("throw" === record.type) throw record.arg;
1728
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
1729
+ },
1730
+ finish: function finish(finallyLoc) {
1731
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1732
+ var entry = this.tryEntries[i];
1733
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
1734
+ }
1735
+ },
1736
+ "catch": function _catch(tryLoc) {
1737
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1738
+ var entry = this.tryEntries[i];
1739
+ if (entry.tryLoc === tryLoc) {
1740
+ var record = entry.completion;
1741
+ if ("throw" === record.type) {
1742
+ var thrown = record.arg;
1743
+ resetTryEntry(entry);
1744
+ }
1745
+ return thrown;
1746
+ }
1747
+ }
1748
+ throw new Error("illegal catch attempt");
1749
+ },
1750
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
1751
+ return this.delegate = {
1752
+ iterator: values(iterable),
1753
+ resultName: resultName,
1754
+ nextLoc: nextLoc
1755
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
1756
+ }
1757
+ }, exports;
1758
+ }
1759
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
1760
+ } (regeneratorRuntime$1));
1761
+
1762
+ // TODO(Babel 8): Remove this file.
1763
+
1764
+ var runtime = regeneratorRuntime$1.exports();
1765
+ var regenerator = runtime;
1766
+
1767
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
1768
+ try {
1769
+ regeneratorRuntime = runtime;
1770
+ } catch (accidentalStrictMode) {
1771
+ if (typeof globalThis === "object") {
1772
+ globalThis.regeneratorRuntime = runtime;
1773
+ } else {
1774
+ Function("r", "regeneratorRuntime = r")(runtime);
1775
+ }
1776
+ }
1777
+
1778
+ var ALLOWED_FILE_PICKER_TYPES = [".csv"];
1779
+
1780
+ var FilePicker = function FilePicker(_ref) {
1781
+ var _ref$types = _ref.types,
1782
+ types = _ref$types === void 0 ? [] : _ref$types,
1783
+ onChange = _ref.onChange,
1784
+ children = _ref.children;
1785
+ var inputRef = useRef();
1786
+ var accept = types.reduce(function (acc, ext) {
1787
+ return "".concat(acc, ", ").concat(ext);
1788
+ }, "");
1789
+ var handleInputChange = function handleInputChange(_ref2) {
1790
+ var target = _ref2.target;
1791
+ if (!target.files) return;
1792
+ onChange(target.files);
1793
+
1794
+ // This will trigger handleClick when same file is uploaded again.
1795
+ inputRef.current.value = "";
1796
+ handleClick();
1797
+ };
1798
+ var handleClick = function handleClick() {
1799
+ if (!inputRef.current) return;
1800
+ inputRef.current.click();
1801
+ };
1802
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1803
+ onClick: handleClick
1804
+ }, children), /*#__PURE__*/React.createElement("input", {
1805
+ accept: accept,
1806
+ className: "hidden",
1807
+ ref: inputRef,
1808
+ type: "file",
1809
+ onChange: handleInputChange
1810
+ }));
1811
+ };
1812
+
1813
+ var isValidEmail = function isValidEmail(email) {
1814
+ return string().email().isValidSync(email);
1815
+ };
1816
+ var createEmailOptions = function createEmailOptions() {
1817
+ var emails = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1818
+ return emails.map(function (email) {
1819
+ return {
1820
+ label: email,
1821
+ value: email,
1822
+ valid: isValidEmail(email)
1823
+ };
1824
+ });
1825
+ };
1826
+ var parseCsvEmails = /*#__PURE__*/function () {
1827
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(file, onSuccess) {
1828
+ return regenerator.wrap(function _callee$(_context) {
1829
+ while (1) switch (_context.prev = _context.next) {
1830
+ case 0:
1831
+ Papa.parse(file, {
1832
+ header: true,
1833
+ skipEmptyLines: true,
1834
+ transformHeader: function transformHeader(h) {
1835
+ return h.toLowerCase().replace(/\W/g, "");
1836
+ },
1837
+ complete: function complete(results) {
1838
+ var _results$meta$fields;
1839
+ var isEmailFieldPresent = (_results$meta$fields = results.meta.fields) === null || _results$meta$fields === void 0 ? void 0 : _results$meta$fields.includes("email");
1840
+ if (isEmailFieldPresent) {
1841
+ var emails = results.data.filter(prop("email")).map(function (item) {
1842
+ return item.email.trim();
1843
+ });
1844
+ onSuccess(createEmailOptions(emails));
1845
+ } else {
1846
+ Toastr.error(t("neetoMolecules.sendToFields.errors.invalidCsv"));
1847
+ }
1848
+ }
1849
+ });
1850
+ case 1:
1851
+ case "end":
1852
+ return _context.stop();
1853
+ }
1854
+ }, _callee);
1855
+ }));
1856
+ return function parseCsvEmails(_x, _x2) {
1857
+ return _ref.apply(this, arguments);
1858
+ };
1859
+ }();
1860
+
1861
+ var SendToFields = function SendToFields(_ref) {
1862
+ var emailInputProps = _ref.emailInputProps,
1863
+ ccInputProps = _ref.ccInputProps,
1864
+ bccInputProps = _ref.bccInputProps,
1865
+ _ref$showUploadCsvBut = _ref.showUploadCsvButton,
1866
+ showUploadCsvButton = _ref$showUploadCsvBut === void 0 ? false : _ref$showUploadCsvBut,
1867
+ _ref$showCcBccButton = _ref.showCcBccButton,
1868
+ showCcBccButton = _ref$showCcBccButton === void 0 ? false : _ref$showCcBccButton;
1869
+ var sendToFieldRef = useRef();
1870
+ var _useFormikContext = useFormikContext(),
1871
+ _useFormikContext$val = _useFormikContext.values,
1872
+ showCopyEmails = _useFormikContext$val.showCopyEmails,
1873
+ existingSendToEmails = _useFormikContext$val[emailInputProps.name || "sendTo"],
1874
+ setFieldValue = _useFormikContext.setFieldValue;
1875
+ var _useTranslation = useTranslation(),
1876
+ t = _useTranslation.t;
1877
+ var handleCSVFile = /*#__PURE__*/function () {
1878
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(files) {
1879
+ var _sendToFieldRef$curre, onSuccess;
1880
+ return regenerator.wrap(function _callee$(_context) {
1881
+ while (1) switch (_context.prev = _context.next) {
1882
+ case 0:
1883
+ _context.prev = 0;
1884
+ onSuccess = function onSuccess(values) {
1885
+ return setFieldValue(emailInputProps.name || "sendTo", [].concat(_toConsumableArray(existingSendToEmails), _toConsumableArray(values)));
1886
+ };
1887
+ _context.next = 4;
1888
+ return parseCsvEmails(files[0], onSuccess);
1889
+ case 4:
1890
+ (_sendToFieldRef$curre = sendToFieldRef.current) === null || _sendToFieldRef$curre === void 0 ? void 0 : _sendToFieldRef$curre.focus();
1891
+ _context.next = 10;
1892
+ break;
1893
+ case 7:
1894
+ _context.prev = 7;
1895
+ _context.t0 = _context["catch"](0);
1896
+ Toastr.error(_context.t0);
1897
+ case 10:
1898
+ case "end":
1899
+ return _context.stop();
1900
+ }
1901
+ }, _callee, null, [[0, 7]]);
1902
+ }));
1903
+ return function handleCSVFile(_x) {
1904
+ return _ref2.apply(this, arguments);
1905
+ };
1906
+ }();
1907
+ var handelCcBccButtonClick = function handelCcBccButtonClick(e) {
1908
+ e.stopPropagation();
1909
+ setFieldValue("showCopyEmails", !showCopyEmails);
1910
+ };
1911
+ return /*#__PURE__*/React.createElement("div", {
1912
+ className: "relative w-full flex-col gap-2"
1913
+ }, showUploadCsvButton && /*#__PURE__*/React.createElement("div", {
1914
+ className: "absolute top-0 right-1"
1915
+ }, /*#__PURE__*/React.createElement(FilePicker, {
1916
+ types: ALLOWED_FILE_PICKER_TYPES,
1917
+ onChange: handleCSVFile
1918
+ }, /*#__PURE__*/React.createElement(Button, {
1919
+ "data-cy": "upload-csv-button",
1920
+ icon: Upload,
1921
+ label: t("neetoMolecules.emailForm.uploadCSV"),
1922
+ size: "small",
1923
+ style: "link",
1924
+ tooltipProps: {
1925
+ content: t("neetoMolecules.sendToFields.uploadCsvTooltip"),
1926
+ position: "right"
1927
+ }
1928
+ }))), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
1929
+ "data-testid": "emails",
1930
+ name: "sendTo",
1931
+ ref: sendToFieldRef
1932
+ }, emailInputProps, {
1933
+ suffix: showCcBccButton && /*#__PURE__*/React.createElement(Button, {
1934
+ "data-cy": "cc-bcc-button",
1935
+ "data-testid": "cc-bcc-button",
1936
+ label: t("neetoMolecules.emailForm.labels.ccBcc"),
1937
+ size: "small",
1938
+ style: "link",
1939
+ onClick: handelCcBccButtonClick
1940
+ })
1941
+ })), showCopyEmails && /*#__PURE__*/React.createElement("div", {
1942
+ className: "mt-5 flex w-full flex-col gap-6"
1943
+ }, /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
1944
+ name: "sendToBcc"
1945
+ }, ccInputProps)), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
1946
+ name: "sendToCc"
1947
+ }, bccInputProps))));
1948
+ };
1949
+
1950
+ var INITIAL_VALUES = {
1951
+ sendFromEmail: "",
1952
+ replyToEmail: "",
1953
+ notifyEmails: [],
1954
+ emailSubject: "",
1955
+ emailBody: "",
1956
+ isSendLaterEnabled: false,
1957
+ sendEmailDatetime: undefined,
1958
+ category: "email_share",
1959
+ actionButtonText: ""
1960
+ };
1961
+ var EDITOR_ADDONS = ["emoji", "block-quote", "image-upload", "divider"];
1962
+
1963
+ var EmailBody = function EmailBody(_ref, ref) {
1964
+ var id = _ref.id,
1965
+ showVideoEmbedInEditor = _ref.showVideoEmbedInEditor;
1966
+ var _useTranslation = useTranslation(),
1967
+ t = _useTranslation.t;
1968
+ return /*#__PURE__*/React.createElement(FormikEditor, {
1969
+ required: true,
1970
+ className: "mb-6",
1971
+ "data-cy": "email-body",
1972
+ id: id,
1973
+ label: t("neetoMolecules.shareViaEmail.emailBody"),
1974
+ name: "emailBody",
1975
+ ref: ref,
1976
+ addons: showVideoEmbedInEditor ? [].concat(_toConsumableArray(EDITOR_ADDONS), ["video-embed"]) : EDITOR_ADDONS
1977
+ });
1978
+ };
1979
+ var EmailBody$1 = /*#__PURE__*/forwardRef(EmailBody);
1980
+
1981
+ function _arrayWithHoles(arr) {
1982
+ if (Array.isArray(arr)) return arr;
1983
+ }
1984
+
1985
+ function _iterableToArrayLimit(arr, i) {
1986
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
1987
+ if (null != _i) {
1988
+ var _s,
1989
+ _e,
1990
+ _x,
1991
+ _r,
1992
+ _arr = [],
1993
+ _n = !0,
1994
+ _d = !1;
1995
+ try {
1996
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
1997
+ if (Object(_i) !== _i) return;
1998
+ _n = !1;
1999
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
2000
+ } catch (err) {
2001
+ _d = !0, _e = err;
2002
+ } finally {
2003
+ try {
2004
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
2005
+ } finally {
2006
+ if (_d) throw _e;
2007
+ }
2008
+ }
2009
+ return _arr;
2010
+ }
2011
+ }
2012
+
2013
+ function _nonIterableRest() {
2014
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2015
+ }
2016
+
2017
+ function _slicedToArray(arr, i) {
2018
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
2019
+ }
2020
+
2021
+ function _objectWithoutPropertiesLoose(source, excluded) {
2022
+ if (source == null) return {};
2023
+ var target = {};
2024
+ var sourceKeys = Object.keys(source);
2025
+ var key, i;
2026
+ for (i = 0; i < sourceKeys.length; i++) {
2027
+ key = sourceKeys[i];
2028
+ if (excluded.indexOf(key) >= 0) continue;
2029
+ target[key] = source[key];
2030
+ }
2031
+ return target;
2032
+ }
2033
+
2034
+ function _objectWithoutProperties(source, excluded) {
2035
+ if (source == null) return {};
2036
+ var target = _objectWithoutPropertiesLoose(source, excluded);
2037
+ var key, i;
2038
+ if (Object.getOwnPropertySymbols) {
2039
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
2040
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
2041
+ key = sourceSymbolKeys[i];
2042
+ if (excluded.indexOf(key) >= 0) continue;
2043
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
2044
+ target[key] = source[key];
2045
+ }
2046
+ }
2047
+ return target;
2048
+ }
2049
+
2050
+ var _excluded = ["name"];
2051
+ var FormikDatePicker = function FormikDatePicker(_ref) {
2052
+ var name = _ref.name,
2053
+ props = _objectWithoutProperties(_ref, _excluded);
2054
+ var _useField = useField(name),
2055
+ _useField2 = _slicedToArray(_useField, 3),
2056
+ field = _useField2[0],
2057
+ meta = _useField2[1],
2058
+ setValue = _useField2[2].setValue;
2059
+ return /*#__PURE__*/React.createElement(DatePicker, _extends({}, field, meta, {
2060
+ onChange: function onChange(date) {
2061
+ return setValue(date || undefined);
2062
+ }
2063
+ }, props, {
2064
+ "data-cy": "email-share-date-input"
2065
+ }));
2066
+ };
2067
+
2068
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2069
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2070
+ var isPastDate = function isPastDate(date) {
2071
+ return dayjs(date).isBefore(dayjs().subtract(1, "days"));
2072
+ };
2073
+ var generateInitialValues = function generateInitialValues(defaultValues) {
2074
+ return _objectSpread(_objectSpread({}, INITIAL_VALUES), defaultValues);
2075
+ };
2076
+ var emailFormValidationSchema = function emailFormValidationSchema(disableReplyTo) {
2077
+ return yup.object().shape({
2078
+ emailSubject: yup.string().required(t("neetoMolecules.shareViaEmail.validations.requiredField.subject")),
2079
+ emailBody: yup.string().test("emailBody", t("neetoMolecules.shareViaEmail.validations.requiredField.emailBody"), function (value) {
2080
+ return !isEditorEmpty(value);
2081
+ }),
2082
+ sendFromEmail: yup.string().trim().email(t("neetoMolecules.shareViaEmail.validations.invalidField.emailAddress")).required(t("neetoMolecules.shareViaEmail.validations.requiredField.sendFrom")),
2083
+ replyToEmail: !disableReplyTo && yup.string().trim().email(t("neetoMolecules.shareViaEmail.validations.invalidField.emailAddress")).required(t("neetoMolecules.shareViaEmail.validations.requiredField.replyTo")),
2084
+ notifyEmails: yup.array().min(1, t("neetoMolecules.shareViaEmail.validations.atleastOneIsRequired.emailAddress")).test("are-all-emails-valid", t("neetoMolecules.shareViaEmail.validations.invalidField.emailAddress"), function (emails) {
2085
+ return emails.every(prop("valid"));
2086
+ }),
2087
+ isSendLaterEnabled: yup["boolean"](),
2088
+ sendEmailDatetime: yup.date().when("isSendLaterEnabled", {
2089
+ is: true,
2090
+ then: yup.date().required(t("neetoMolecules.shareViaEmail.validations.requiredField.sendLater"))
2091
+ }),
2092
+ name: yup.string(),
2093
+ actionButtonText: yup.string().required(t("neetoMolecules.shareViaEmail.validations.requiredField.startButtonText"))
2094
+ });
2095
+ };
2096
+
2097
+ var Form = function Form(_ref) {
2098
+ var isSendFromDisabled = _ref.isSendFromDisabled,
2099
+ disableReplyTo = _ref.disableReplyTo,
2100
+ showVideoEmbedInEditor = _ref.showVideoEmbedInEditor,
2101
+ children = _ref.children;
2102
+ var _useFormikContext = useFormikContext(),
2103
+ values = _useFormikContext.values,
2104
+ initialValues = _useFormikContext.initialValues;
2105
+ var editorRef = useRef();
2106
+ var _useTranslation = useTranslation(),
2107
+ t = _useTranslation.t;
2108
+ var handleReset = function handleReset() {
2109
+ return editorRef.current.editor.commands.setContent(initialValues.emailBody);
2110
+ };
2111
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2112
+ className: "space-y-4"
2113
+ }, /*#__PURE__*/React.createElement(SendToFields, {
2114
+ showUploadCsvButton: true,
2115
+ emailInputProps: {
2116
+ label: t("neetoMolecules.shareViaEmail.sendTo"),
2117
+ name: "notifyEmails",
2118
+ required: true
2119
+ }
2120
+ }), /*#__PURE__*/React.createElement(Input, {
2121
+ required: true,
2122
+ className: "col-span-1",
2123
+ label: t("neetoMolecules.shareViaEmail.subject"),
2124
+ name: "emailSubject"
2125
+ }), /*#__PURE__*/React.createElement(EmailBody$1, {
2126
+ id: "emailBody",
2127
+ ref: editorRef,
2128
+ showVideoEmbedInEditor: showVideoEmbedInEditor
2129
+ }), /*#__PURE__*/React.createElement("div", {
2130
+ ref: editorRef
2131
+ }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Label, {
2132
+ className: "flex items-center gap-2"
2133
+ }, /*#__PURE__*/React.createElement(Switch, {
2134
+ "data-cy": "send-later-switch",
2135
+ "data-testid": "send-later-switch",
2136
+ name: "isSendLaterEnabled"
2137
+ }), /*#__PURE__*/React.createElement(Typography, {
2138
+ component: "span",
2139
+ "data-cy": "send-later-label",
2140
+ lineHeight: "normal",
2141
+ style: "h4",
2142
+ weight: "semibold"
2143
+ }, t("neetoMolecules.shareViaEmail.sendLater")))), values.isSendLaterEnabled && /*#__PURE__*/React.createElement(FormikDatePicker, {
2144
+ autoFocus: true,
2145
+ showTime: true,
2146
+ "data-cy": "email-share-date-input",
2147
+ "data-testid": "formik-date-picker",
2148
+ disabledDate: isPastDate,
2149
+ name: "sendEmailDatetime",
2150
+ picker: "date",
2151
+ size: "large",
2152
+ type: "date"
2153
+ }), /*#__PURE__*/React.createElement(Input, {
2154
+ required: true,
2155
+ label: t("neetoMolecules.shareViaEmail.startButtonText"),
2156
+ name: "actionButtonText"
2157
+ }), /*#__PURE__*/React.createElement("div", {
2158
+ className: classnames({
2159
+ "grid grid-cols-2 gap-6": !disableReplyTo
2160
+ })
2161
+ }, /*#__PURE__*/React.createElement(Input, {
2162
+ required: true,
2163
+ className: "col-auto",
2164
+ "data-testid": "neeto-molecules-share-via-email-send-from",
2165
+ disabled: isSendFromDisabled,
2166
+ label: t("neetoMolecules.shareViaEmail.sendFrom"),
2167
+ name: "sendFromEmail"
2168
+ }), !disableReplyTo && /*#__PURE__*/React.createElement(Input, {
2169
+ required: true,
2170
+ className: "col-auto",
2171
+ "data-testid": "replyTo-field",
2172
+ label: t("neetoMolecules.shareViaEmail.replyTo"),
2173
+ name: "replyToEmail"
2174
+ }))), children && /*#__PURE__*/React.createElement("div", {
2175
+ className: "neeto-ui-border-gray-300 mt-4 border-t py-4"
2176
+ }, /*#__PURE__*/React.createElement("h3", {
2177
+ className: "mb-4"
2178
+ }, t("neetoMolecules.shareViaEmail.additionalOptions")), children), /*#__PURE__*/React.createElement("div", {
2179
+ className: "mt-6"
2180
+ }, /*#__PURE__*/React.createElement(ActionBlock, {
2181
+ cancelButtonProps: {
2182
+ label: t("neetoMolecules.shareViaEmail.reset"),
2183
+ type: "reset",
2184
+ onClick: handleReset
2185
+ },
2186
+ submitButtonProps: {
2187
+ label: t("neetoMolecules.shareViaEmail.sendEmail")
2188
+ }
2189
+ })));
2190
+ };
2191
+
2192
+ var ShareViaEmail = function ShareViaEmail(_ref) {
2193
+ var _ref$isSendFromDisabl = _ref.isSendFromDisabled,
2194
+ isSendFromDisabled = _ref$isSendFromDisabl === void 0 ? true : _ref$isSendFromDisabl,
2195
+ backToUrl = _ref.backToUrl,
2196
+ handleSubmit = _ref.handleSubmit,
2197
+ children = _ref.children,
2198
+ description = _ref.description,
2199
+ defaultValues = _ref.defaultValues,
2200
+ disableReplyTo = _ref.disableReplyTo,
2201
+ productName = _ref.productName,
2202
+ showVideoEmbedInEditor = _ref.showVideoEmbedInEditor,
2203
+ _ref$title = _ref.title,
2204
+ title = _ref$title === void 0 ? "" : _ref$title;
2205
+ var _useTranslation = useTranslation(),
2206
+ t = _useTranslation.t;
2207
+ var shareViaEmailTitle = title || t("neetoMolecules.shareViaEmail.title");
2208
+ var sendToEmails = function sendToEmails(notifyEmails) {
2209
+ return notifyEmails.map(function (email) {
2210
+ return email === null || email === void 0 ? void 0 : email.value;
2211
+ });
2212
+ };
2213
+ return /*#__PURE__*/React.createElement("div", {
2214
+ className: "neeto-ui-bg-gray-100 flex w-full flex-1 flex-col p-8"
2215
+ }, /*#__PURE__*/React.createElement("div", {
2216
+ className: "mx-auto flex w-full max-w-7xl flex-col"
2217
+ }, /*#__PURE__*/React.createElement(Form$1, {
2218
+ scrollToErrorField: true,
2219
+ formProps: {
2220
+ noValidate: true
2221
+ },
2222
+ formikProps: {
2223
+ enableReinitialize: true,
2224
+ validateOnMount: true,
2225
+ initialValues: generateInitialValues(defaultValues),
2226
+ validationSchema: emailFormValidationSchema(disableReplyTo),
2227
+ onSubmit: handleSubmit
2228
+ }
2229
+ }, function (_ref2) {
2230
+ var values = _ref2.values;
2231
+ return /*#__PURE__*/React.createElement("div", {
2232
+ className: "grid grid-cols-12 gap-8"
2233
+ }, /*#__PURE__*/React.createElement("div", {
2234
+ className: "col-span-5"
2235
+ }, backToUrl && /*#__PURE__*/React.createElement(Button, {
2236
+ className: "mb-4",
2237
+ "data-testid": "back-to-url-button",
2238
+ icon: LeftArrow,
2239
+ iconPosition: "left",
2240
+ label: t("neetoMolecules.shareViaEmail.backToShare"),
2241
+ size: "small",
2242
+ style: "link",
2243
+ to: backToUrl
2244
+ }), /*#__PURE__*/React.createElement("div", {
2245
+ className: "mb-6"
2246
+ }, /*#__PURE__*/React.createElement(Typography, {
2247
+ className: "mb-0.5 break-words",
2248
+ "data-cy": "share-via-email-heading",
2249
+ lineHeight: "normal",
2250
+ style: "h2",
2251
+ weight: "semibold"
2252
+ }, shareViaEmailTitle), description && /*#__PURE__*/React.createElement(Typography, {
2253
+ className: "neeto-ui-text-gray-700",
2254
+ "data-cy": "share-via-email-sub-heading",
2255
+ lineHeight: "normal",
2256
+ style: "body2"
2257
+ }, description)), /*#__PURE__*/React.createElement(Form, {
2258
+ disableReplyTo: disableReplyTo,
2259
+ isSendFromDisabled: isSendFromDisabled,
2260
+ showVideoEmbedInEditor: showVideoEmbedInEditor
2261
+ }, children)), /*#__PURE__*/React.createElement("div", {
2262
+ className: "col-span-7"
2263
+ }, /*#__PURE__*/React.createElement("div", {
2264
+ className: "sticky top-10 pt-10"
2265
+ }, /*#__PURE__*/React.createElement(EmailPreview, {
2266
+ actionButtonText: values.actionButtonText,
2267
+ body: values.emailBody,
2268
+ from: values.sendFromEmail,
2269
+ productName: productName,
2270
+ subject: values.emailSubject,
2271
+ to: sendToEmails(values.notifyEmails)
2272
+ }))));
2273
+ })));
2274
+ };
2275
+
2276
+ export { ShareViaEmail as default };
2277
+ //# sourceMappingURL=ShareViaEmail.js.map