@bikdotai/bik-component-library 0.0.337 → 0.0.338

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 (367) hide show
  1. package/dist/cjs/assets/bundle-421aeced.css +8 -0
  2. package/dist/cjs/assets/icons/Bik_logo.svg.js +1 -1
  3. package/dist/cjs/assets/icons/RedirectToNew.svg.js +1 -1
  4. package/dist/cjs/assets/icons/alert.svg.js +1 -1
  5. package/dist/cjs/assets/icons/alert_triangle.svg.js +1 -1
  6. package/dist/cjs/assets/icons/arrow_back.svg.js +1 -1
  7. package/dist/cjs/assets/icons/arrow_down.svg.js +1 -1
  8. package/dist/cjs/assets/icons/arrow_left.svg.js +1 -1
  9. package/dist/cjs/assets/icons/arrow_up.svg.js +1 -1
  10. package/dist/cjs/assets/icons/back_icon.svg.js +1 -1
  11. package/dist/cjs/assets/icons/bold.svg.js +1 -1
  12. package/dist/cjs/assets/icons/box.svg.js +1 -1
  13. package/dist/cjs/assets/icons/box_round.svg.js +1 -1
  14. package/dist/cjs/assets/icons/calendar.svg.js +1 -1
  15. package/dist/cjs/assets/icons/check.svg.js +1 -1
  16. package/dist/cjs/assets/icons/chevronDown.svg.js +1 -1
  17. package/dist/cjs/assets/icons/chevronDownOutline.svg.js +1 -1
  18. package/dist/cjs/assets/icons/chevronLeft.svg.js +1 -1
  19. package/dist/cjs/assets/icons/chevronRightAlt.svg.js +1 -1
  20. package/dist/cjs/assets/icons/chevronUpOutline.svg.js +1 -1
  21. package/dist/cjs/assets/icons/clock.svg.js +1 -1
  22. package/dist/cjs/assets/icons/cross.svg.js +1 -1
  23. package/dist/cjs/assets/icons/cursor.svg.js +1 -1
  24. package/dist/cjs/assets/icons/delete.svg.js +1 -1
  25. package/dist/cjs/assets/icons/document_pdf.svg.js +1 -1
  26. package/dist/cjs/assets/icons/edit.svg.js +1 -1
  27. package/dist/cjs/assets/icons/emoji.svg.js +1 -1
  28. package/dist/cjs/assets/icons/errorIcon.svg.js +1 -1
  29. package/dist/cjs/assets/icons/errorInfo.svg.js +1 -1
  30. package/dist/cjs/assets/icons/file.svg.js +1 -1
  31. package/dist/cjs/assets/icons/filePdf.svg.js +1 -1
  32. package/dist/cjs/assets/icons/halfRectangle.svg.js +1 -1
  33. package/dist/cjs/assets/icons/horizontal_dots.svg.js +1 -1
  34. package/dist/cjs/assets/icons/image.svg.js +1 -1
  35. package/dist/cjs/assets/icons/info.svg.js +1 -1
  36. package/dist/cjs/assets/icons/instagram.svg.js +1 -1
  37. package/dist/cjs/assets/icons/italic.svg.js +1 -1
  38. package/dist/cjs/assets/icons/log_out.svg.js +1 -1
  39. package/dist/cjs/assets/icons/mobile_custom.svg.js +1 -1
  40. package/dist/cjs/assets/icons/more_vertical.svg.js +1 -1
  41. package/dist/cjs/assets/icons/phone.svg.js +1 -1
  42. package/dist/cjs/assets/icons/plus.svg.js +1 -1
  43. package/dist/cjs/assets/icons/question-mark.svg.js +1 -1
  44. package/dist/cjs/assets/icons/search.svg.js +1 -1
  45. package/dist/cjs/assets/icons/starEmpty.svg.js +1 -1
  46. package/dist/cjs/assets/icons/starFilled.svg.js +1 -1
  47. package/dist/cjs/assets/icons/strikeThrough.svg.js +1 -1
  48. package/dist/cjs/assets/icons/successIcon.svg.js +1 -1
  49. package/dist/cjs/assets/icons/triangle_error.svg.js +1 -1
  50. package/dist/cjs/assets/icons/undo.svg.js +1 -1
  51. package/dist/cjs/assets/icons/upload.svg.js +1 -1
  52. package/dist/cjs/assets/icons/user_icon.svg.js +1 -1
  53. package/dist/cjs/assets/icons/vertical_dots.svg.js +1 -1
  54. package/dist/cjs/assets/icons/videoRecorder.svg.js +1 -1
  55. package/dist/cjs/assets/icons/video_camcorder.svg.js +1 -1
  56. package/dist/cjs/assets/icons/warning.svg.js +1 -1
  57. package/dist/cjs/assets/icons/warningIcon.svg.js +1 -1
  58. package/dist/cjs/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
  59. package/dist/cjs/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
  60. package/dist/cjs/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
  61. package/dist/cjs/components/QueryBuilder/QueryBuilder.js +1 -1
  62. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.js +1 -1
  63. package/dist/cjs/components/QueryBuilder/components/AddNodeButton.js +1 -1
  64. package/dist/cjs/components/QueryBuilder/components/AllowedListDropdown.js +1 -1
  65. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/EmojiPicker.js +1 -1
  66. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/FreeText.js +1 -1
  67. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js +1 -1
  68. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
  69. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -1
  70. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/IntegerPositiveSingle.js +1 -1
  71. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/IntegerSingleValue.js +1 -1
  72. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
  73. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/NumberTime.js +1 -1
  74. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/SingleDate.js +1 -1
  75. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/SingleselectDropdownFreeText.js +1 -1
  76. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/StringSingleValue.js +1 -1
  77. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/TwoDate.js +1 -1
  78. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/TwoNumberInputsSeperatedByAnd.js +1 -1
  79. package/dist/cjs/components/QueryBuilder/components/Connectors/Connector.js +1 -1
  80. package/dist/cjs/components/QueryBuilder/components/DeleteButton.js +1 -1
  81. package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.js +1 -1
  82. package/dist/cjs/components/QueryBuilder/components/InputLoader.js +4 -4
  83. package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/AddPropertyButton.js +1 -1
  84. package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
  85. package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.js +1 -1
  86. package/dist/cjs/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
  87. package/dist/cjs/components/QueryBuilder/hooks/useQueryBuilderCache.js +1 -1
  88. package/dist/cjs/components/SearchFilter/components/FilterChipListRenderer.js +1 -1
  89. package/dist/cjs/components/SearchFilter/index.js +1 -1
  90. package/dist/cjs/components/TablePagination/TablePagination.js +1 -1
  91. package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js +1 -1
  92. package/dist/cjs/components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js +1 -1
  93. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  94. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMetric.js +1 -1
  95. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js +1 -1
  96. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  97. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Legend/Legend.js +1 -1
  98. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  99. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js +1 -1
  100. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  101. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js +1 -1
  102. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js +1 -1
  103. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/Chip.js +1 -1
  104. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/HorinzontalBar.js +1 -1
  105. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js +1 -1
  106. package/dist/cjs/components/bik-layout/CommonStyles.d.ts +1 -1
  107. package/dist/cjs/components/button/themes.js +1 -1
  108. package/dist/cjs/components/carousel-secondary/CarouselSecondary.js +1 -1
  109. package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js +1 -1
  110. package/dist/cjs/components/dashboard-review-popup/components/FiveStar.js +1 -1
  111. package/dist/cjs/components/dashboard-review-popup/components/Form.js +1 -1
  112. package/dist/cjs/components/dashboard-review-popup/components/ZeroState.js +1 -1
  113. package/dist/cjs/components/datePicker/DatePicker.js +1 -1
  114. package/dist/cjs/components/datePicker/DatePickerWrapper.js +1 -1
  115. package/dist/cjs/components/discount-modal/DiscountModal.d.ts +7 -0
  116. package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
  117. package/dist/cjs/components/discount-modal/DiscountUtils.d.ts +2 -0
  118. package/dist/cjs/components/discount-modal/DiscountUtils.js +1 -1
  119. package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.d.ts +3 -1
  120. package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
  121. package/dist/cjs/components/discount-modal/StaticCoupon/StaticCoupon.js +1 -1
  122. package/dist/cjs/components/discount-modal/type.d.ts +11 -2
  123. package/dist/cjs/components/discount-modal/type.js +1 -1
  124. package/dist/cjs/components/dropShadow/DropShadow.js +1 -1
  125. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  126. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.js +1 -1
  127. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js +1 -1
  128. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +1 -1
  129. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  130. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
  131. package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
  132. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  133. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  134. package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
  135. package/dist/cjs/components/floating-action-button/FloatingActionButton.styles.d.ts +8 -7
  136. package/dist/cjs/components/image-cropper/BikImagePipeline/BikImagePipeline.js +1 -1
  137. package/dist/cjs/components/input/ChipInput.js +1 -1
  138. package/dist/cjs/components/input/Input-helper.js +1 -1
  139. package/dist/cjs/components/input/Input.js +1 -1
  140. package/dist/cjs/components/input/Input.styled.js +1 -1
  141. package/dist/cjs/components/product-picker/ProductPickerModal.js +1 -1
  142. package/dist/cjs/components/product-picker-v2/emptyState.js +2 -2
  143. package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.js +1 -1
  144. package/dist/cjs/components/product-picker-v2/modal.d.ts +4 -0
  145. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  146. package/dist/cjs/components/product-picker-v2/productScreen.d.ts +4 -0
  147. package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
  148. package/dist/cjs/components/shimmer-image/ShimmerImage.js +1 -1
  149. package/dist/cjs/components/spinner/Spinner.js +1 -1
  150. package/dist/cjs/components/star-rating/Star.js +1 -1
  151. package/dist/cjs/components/star-rating/StarRating.js +1 -1
  152. package/dist/cjs/components/switch/Switch.js +1 -1
  153. package/dist/cjs/components/tag/Tag.js +1 -1
  154. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  155. package/dist/cjs/components/template-context-mapper/modalElements/DesktopPreview.js +1 -1
  156. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  157. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  158. package/dist/cjs/components/template-context-mapper/modalElements/Footer.js +1 -1
  159. package/dist/cjs/components/template-context-mapper/modalElements/Header.js +1 -1
  160. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +1 -1
  161. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  162. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +1 -1
  163. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  164. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +1 -1
  165. package/dist/cjs/components/template-context-mapper/modalElements/VariableEditorHeader.js +2 -2
  166. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  167. package/dist/cjs/components/template-preview/EmailTemplateThumbnailPreview.js +1 -1
  168. package/dist/cjs/components/template-preview/SmsTemplatePreview.js +1 -1
  169. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  170. package/dist/cjs/components/template-preview/WhatsApp/ChatBtn.js +1 -1
  171. package/dist/cjs/components/template-preview/WhatsApp/MediaCard.js +1 -1
  172. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  173. package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.js +1 -1
  174. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  175. package/dist/cjs/components/template-preview/helpers/VariableEditorHelper.js +1 -1
  176. package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.js +1 -1
  177. package/dist/cjs/components/toaster/Toaster.js +1 -1
  178. package/dist/cjs/components/zeroState/ZeroState.js +4 -4
  179. package/dist/cjs/hooks/useCurreny.js +1 -1
  180. package/dist/cjs/node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js +1 -1
  181. package/dist/cjs/utils/DateUtils.js +1 -1
  182. package/dist/cjs/utils/StringUtils.js +1 -1
  183. package/dist/esm/assets/bundle-421aeced.css +8 -0
  184. package/dist/esm/assets/icons/Bik_logo.svg.js +1 -1
  185. package/dist/esm/assets/icons/RedirectToNew.svg.js +1 -1
  186. package/dist/esm/assets/icons/alert.svg.js +1 -1
  187. package/dist/esm/assets/icons/alert_triangle.svg.js +1 -1
  188. package/dist/esm/assets/icons/arrow_back.svg.js +1 -1
  189. package/dist/esm/assets/icons/arrow_down.svg.js +1 -1
  190. package/dist/esm/assets/icons/arrow_left.svg.js +1 -1
  191. package/dist/esm/assets/icons/arrow_up.svg.js +1 -1
  192. package/dist/esm/assets/icons/back_icon.svg.js +1 -1
  193. package/dist/esm/assets/icons/bold.svg.js +1 -1
  194. package/dist/esm/assets/icons/box.svg.js +1 -1
  195. package/dist/esm/assets/icons/box_round.svg.js +1 -1
  196. package/dist/esm/assets/icons/calendar.svg.js +1 -1
  197. package/dist/esm/assets/icons/check.svg.js +1 -1
  198. package/dist/esm/assets/icons/chevronDown.svg.js +1 -1
  199. package/dist/esm/assets/icons/chevronDownOutline.svg.js +1 -1
  200. package/dist/esm/assets/icons/chevronLeft.svg.js +1 -1
  201. package/dist/esm/assets/icons/chevronRightAlt.svg.js +1 -1
  202. package/dist/esm/assets/icons/chevronUpOutline.svg.js +1 -1
  203. package/dist/esm/assets/icons/clock.svg.js +1 -1
  204. package/dist/esm/assets/icons/cross.svg.js +1 -1
  205. package/dist/esm/assets/icons/cursor.svg.js +1 -1
  206. package/dist/esm/assets/icons/delete.svg.js +1 -1
  207. package/dist/esm/assets/icons/document_pdf.svg.js +1 -1
  208. package/dist/esm/assets/icons/edit.svg.js +1 -1
  209. package/dist/esm/assets/icons/emoji.svg.js +1 -1
  210. package/dist/esm/assets/icons/errorIcon.svg.js +1 -1
  211. package/dist/esm/assets/icons/errorInfo.svg.js +1 -1
  212. package/dist/esm/assets/icons/file.svg.js +1 -1
  213. package/dist/esm/assets/icons/filePdf.svg.js +1 -1
  214. package/dist/esm/assets/icons/halfRectangle.svg.js +1 -1
  215. package/dist/esm/assets/icons/horizontal_dots.svg.js +1 -1
  216. package/dist/esm/assets/icons/image.svg.js +1 -1
  217. package/dist/esm/assets/icons/info.svg.js +1 -1
  218. package/dist/esm/assets/icons/instagram.svg.js +1 -1
  219. package/dist/esm/assets/icons/italic.svg.js +1 -1
  220. package/dist/esm/assets/icons/log_out.svg.js +1 -1
  221. package/dist/esm/assets/icons/mobile_custom.svg.js +1 -1
  222. package/dist/esm/assets/icons/more_vertical.svg.js +1 -1
  223. package/dist/esm/assets/icons/phone.svg.js +1 -1
  224. package/dist/esm/assets/icons/plus.svg.js +1 -1
  225. package/dist/esm/assets/icons/question-mark.svg.js +1 -1
  226. package/dist/esm/assets/icons/search.svg.js +1 -1
  227. package/dist/esm/assets/icons/starEmpty.svg.js +1 -1
  228. package/dist/esm/assets/icons/starFilled.svg.js +1 -1
  229. package/dist/esm/assets/icons/strikeThrough.svg.js +1 -1
  230. package/dist/esm/assets/icons/successIcon.svg.js +1 -1
  231. package/dist/esm/assets/icons/triangle_error.svg.js +1 -1
  232. package/dist/esm/assets/icons/undo.svg.js +1 -1
  233. package/dist/esm/assets/icons/upload.svg.js +1 -1
  234. package/dist/esm/assets/icons/user_icon.svg.js +1 -1
  235. package/dist/esm/assets/icons/vertical_dots.svg.js +1 -1
  236. package/dist/esm/assets/icons/videoRecorder.svg.js +1 -1
  237. package/dist/esm/assets/icons/video_camcorder.svg.js +1 -1
  238. package/dist/esm/assets/icons/warning.svg.js +1 -1
  239. package/dist/esm/assets/icons/warningIcon.svg.js +1 -1
  240. package/dist/esm/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
  241. package/dist/esm/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
  242. package/dist/esm/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
  243. package/dist/esm/components/QueryBuilder/QueryBuilder.js +1 -1
  244. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.js +1 -1
  245. package/dist/esm/components/QueryBuilder/components/AddNodeButton.js +1 -1
  246. package/dist/esm/components/QueryBuilder/components/AllowedListDropdown.js +1 -1
  247. package/dist/esm/components/QueryBuilder/components/Connectors/Components/EmojiPicker.js +1 -1
  248. package/dist/esm/components/QueryBuilder/components/Connectors/Components/FreeText.js +1 -1
  249. package/dist/esm/components/QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js +2 -2
  250. package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
  251. package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -1
  252. package/dist/esm/components/QueryBuilder/components/Connectors/Components/IntegerPositiveSingle.js +1 -1
  253. package/dist/esm/components/QueryBuilder/components/Connectors/Components/IntegerSingleValue.js +1 -1
  254. package/dist/esm/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
  255. package/dist/esm/components/QueryBuilder/components/Connectors/Components/NumberTime.js +1 -1
  256. package/dist/esm/components/QueryBuilder/components/Connectors/Components/SingleDate.js +1 -1
  257. package/dist/esm/components/QueryBuilder/components/Connectors/Components/SingleselectDropdownFreeText.js +1 -1
  258. package/dist/esm/components/QueryBuilder/components/Connectors/Components/StringSingleValue.js +1 -1
  259. package/dist/esm/components/QueryBuilder/components/Connectors/Components/TwoDate.js +1 -1
  260. package/dist/esm/components/QueryBuilder/components/Connectors/Components/TwoNumberInputsSeperatedByAnd.js +1 -1
  261. package/dist/esm/components/QueryBuilder/components/Connectors/Connector.js +1 -1
  262. package/dist/esm/components/QueryBuilder/components/DeleteButton.js +1 -1
  263. package/dist/esm/components/QueryBuilder/components/DropdownWrapper.js +1 -1
  264. package/dist/esm/components/QueryBuilder/components/InputLoader.js +4 -4
  265. package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/AddPropertyButton.js +1 -1
  266. package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
  267. package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.js +1 -1
  268. package/dist/esm/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
  269. package/dist/esm/components/QueryBuilder/hooks/useQueryBuilderCache.js +1 -1
  270. package/dist/esm/components/SearchFilter/components/FilterChipListRenderer.js +1 -1
  271. package/dist/esm/components/SearchFilter/index.js +1 -1
  272. package/dist/esm/components/TablePagination/TablePagination.js +1 -1
  273. package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js +1 -1
  274. package/dist/esm/components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js +1 -1
  275. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  276. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMetric.js +1 -1
  277. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js +1 -1
  278. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  279. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Legend/Legend.js +1 -1
  280. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  281. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js +1 -1
  282. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  283. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js +1 -1
  284. package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js +1 -1
  285. package/dist/esm/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/Chip.js +1 -1
  286. package/dist/esm/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/HorinzontalBar.js +1 -1
  287. package/dist/esm/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js +1 -1
  288. package/dist/esm/components/bik-layout/CommonStyles.d.ts +1 -1
  289. package/dist/esm/components/button/themes.js +1 -1
  290. package/dist/esm/components/carousel-secondary/CarouselSecondary.js +1 -1
  291. package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js +1 -1
  292. package/dist/esm/components/dashboard-review-popup/components/FiveStar.js +1 -1
  293. package/dist/esm/components/dashboard-review-popup/components/Form.js +1 -1
  294. package/dist/esm/components/dashboard-review-popup/components/ZeroState.js +1 -1
  295. package/dist/esm/components/datePicker/DatePicker.js +1 -1
  296. package/dist/esm/components/datePicker/DatePickerWrapper.js +1 -1
  297. package/dist/esm/components/discount-modal/DiscountModal.d.ts +7 -0
  298. package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
  299. package/dist/esm/components/discount-modal/DiscountUtils.d.ts +2 -0
  300. package/dist/esm/components/discount-modal/DiscountUtils.js +1 -1
  301. package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.d.ts +3 -1
  302. package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
  303. package/dist/esm/components/discount-modal/StaticCoupon/StaticCoupon.js +1 -1
  304. package/dist/esm/components/discount-modal/type.d.ts +11 -2
  305. package/dist/esm/components/discount-modal/type.js +1 -1
  306. package/dist/esm/components/dropShadow/DropShadow.js +1 -1
  307. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  308. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.js +1 -1
  309. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js +1 -1
  310. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +1 -1
  311. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  312. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
  313. package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
  314. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  315. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  316. package/dist/esm/components/dropdown/hooks/useDropdown.js +1 -1
  317. package/dist/esm/components/floating-action-button/FloatingActionButton.styles.d.ts +8 -7
  318. package/dist/esm/components/image-cropper/BikImagePipeline/BikImagePipeline.js +1 -1
  319. package/dist/esm/components/input/ChipInput.js +1 -1
  320. package/dist/esm/components/input/Input-helper.js +1 -1
  321. package/dist/esm/components/input/Input.js +1 -1
  322. package/dist/esm/components/input/Input.styled.js +1 -1
  323. package/dist/esm/components/product-picker/ProductPickerModal.js +1 -1
  324. package/dist/esm/components/product-picker-v2/emptyState.js +1 -1
  325. package/dist/esm/components/product-picker-v2/helpers/ProductHelper.js +1 -1
  326. package/dist/esm/components/product-picker-v2/modal.d.ts +4 -0
  327. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  328. package/dist/esm/components/product-picker-v2/productScreen.d.ts +4 -0
  329. package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
  330. package/dist/esm/components/shimmer-image/ShimmerImage.js +1 -1
  331. package/dist/esm/components/spinner/Spinner.js +1 -1
  332. package/dist/esm/components/star-rating/Star.js +1 -1
  333. package/dist/esm/components/star-rating/StarRating.js +1 -1
  334. package/dist/esm/components/switch/Switch.js +1 -1
  335. package/dist/esm/components/tag/Tag.js +1 -1
  336. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  337. package/dist/esm/components/template-context-mapper/modalElements/DesktopPreview.js +1 -1
  338. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  339. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  340. package/dist/esm/components/template-context-mapper/modalElements/Footer.js +2 -2
  341. package/dist/esm/components/template-context-mapper/modalElements/Header.js +2 -2
  342. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +2 -2
  343. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  344. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +1 -1
  345. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  346. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +1 -1
  347. package/dist/esm/components/template-context-mapper/modalElements/VariableEditorHeader.js +2 -2
  348. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  349. package/dist/esm/components/template-preview/EmailTemplateThumbnailPreview.js +1 -1
  350. package/dist/esm/components/template-preview/SmsTemplatePreview.js +1 -1
  351. package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
  352. package/dist/esm/components/template-preview/WhatsApp/ChatBtn.js +1 -1
  353. package/dist/esm/components/template-preview/WhatsApp/MediaCard.js +1 -1
  354. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  355. package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.js +1 -1
  356. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  357. package/dist/esm/components/template-preview/helpers/VariableEditorHelper.js +1 -1
  358. package/dist/esm/components/template-preview/utils/TemplateHelperUtils.js +1 -1
  359. package/dist/esm/components/toaster/Toaster.js +1 -1
  360. package/dist/esm/components/zeroState/ZeroState.js +2 -2
  361. package/dist/esm/hooks/useCurreny.js +1 -1
  362. package/dist/esm/node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js +1 -1
  363. package/dist/esm/utils/DateUtils.js +1 -1
  364. package/dist/esm/utils/StringUtils.js +1 -1
  365. package/package.json +1 -1
  366. package/dist/cjs/assets/bundle-3ad9b33d.css +0 -8
  367. package/dist/esm/assets/bundle-3ad9b33d.css +0 -8
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as i,useRef as n}from"react";import{StarRating as s}from"../../star-rating/StarRating.js";import{TitleRegular as c,BodySecondary as o,ButtonLarge as a}from"../../TypographyStyle.js";import{COLORS as l}from"../../../constants/Theme.js";import{Container as t,StarWrapper as d,Wrapper as p,Chip as u,TextArea as m,Button as h}from"./Form.styled.js";const f={1:"Your feedback helps us improve",2:"Your feedback helps us improve",3:"Your feedback helps us improve",4:"Your feedback helps us improve",5:"Your feedback helps us improve"},v={1:"Where can we improve?",2:"Where can we improve?",3:"Where can we improve?",4:"Where can we improve?",5:"Where can we improve?"},b=({stars:b,titleMap:g,feedbackMap:j,onStarChange:k,onSubmit:y,quickAnswerOptions:O})=>{const w=null!=g?g:f,x=null!=j?j:v,[S,W]=i([]),Y=n(null),C=w[b],A=x[b];return e(t,{children:[e(d,{children:[r(c,Object.assign({color:l.surface.standard},{children:C})),r(s,{starSize:24,value:b,onChange:k})]}),O&&e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:8}},{children:[r(c,Object.assign({color:l.surface.standard},{children:A})),r(p,{children:null==O?void 0:O.map(((e,i)=>{const n=S.includes(e);return r(u,Object.assign({selected:n,onClick:()=>{W(n?r=>r.filter((r=>r!==e)):r=>[...r,e])}},{children:r(o,Object.assign({color:n?l.background.inverse:l.surface.standard},{children:e}))}),i)}))})]})),e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:8,width:"100%"}},{children:[r(c,Object.assign({color:l.surface.standard},{children:"Add detailed feedback"})),r(m,{placeholder:"We read every response!",ref:Y})]})),r("div",Object.assign({style:{width:"100%"}},{children:r(h,Object.assign({onClick:function(){var e,r;y(b,S,null!==(r=null===(e=Y.current)||void 0===e?void 0:e.value)&&void 0!==r?r:"")}},{children:r(a,Object.assign({color:l.content.primaryInverse},{children:"Submit"}))}))}))]})};export{b as Form};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as i,useRef as n}from"react";import{StarRating as s}from"../../star-rating/StarRating.js";import{TitleRegular as c,BodySecondary as o,ButtonLarge as a}from"../../TypographyStyle.js";import{COLORS as l}from"../../../constants/Theme.js";import{Container as t,StarWrapper as d,Wrapper as p,Chip as u,TextArea as m,Button as h}from"./Form.styled.js";const f={1:"Your feedback helps us improve",2:"Your feedback helps us improve",3:"Your feedback helps us improve",4:"Your feedback helps us improve",5:"Your feedback helps us improve"},v={1:"Where can we improve?",2:"Where can we improve?",3:"Where can we improve?",4:"Where can we improve?",5:"Where can we improve?"},b=b=>{let{stars:g,titleMap:j,feedbackMap:k,onStarChange:y,onSubmit:O,quickAnswerOptions:w}=b;const x=null!=j?j:f,S=null!=k?k:v,[W,Y]=i([]),C=n(null),A=x[g],D=S[g];return e(t,{children:[e(d,{children:[r(c,Object.assign({color:l.surface.standard},{children:A})),r(s,{starSize:24,value:g,onChange:y})]}),w&&e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:8}},{children:[r(c,Object.assign({color:l.surface.standard},{children:D})),r(p,{children:null==w?void 0:w.map(((e,i)=>{const n=W.includes(e);return r(u,Object.assign({selected:n,onClick:()=>{Y(n?r=>r.filter((r=>r!==e)):r=>[...r,e])}},{children:r(o,Object.assign({color:n?l.background.inverse:l.surface.standard},{children:e}))}),i)}))})]})),e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:8,width:"100%"}},{children:[r(c,Object.assign({color:l.surface.standard},{children:"Add detailed feedback"})),r(m,{placeholder:"We read every response!",ref:C})]})),r("div",Object.assign({style:{width:"100%"}},{children:r(h,Object.assign({onClick:function(){var e,r;O(g,W,null!==(r=null===(e=C.current)||void 0===e?void 0:e.value)&&void 0!==r?r:"")}},{children:r(a,Object.assign({color:l.content.primaryInverse},{children:"Submit"}))}))}))]})};export{b as Form};
@@ -1 +1 @@
1
- import c from"@emotion/styled/base";import{jsxs as e,jsx as g}from"react/jsx-runtime";import{StarRating as t}from"../../star-rating/StarRating.js";import{TitleMedium as l}from"../../TypographyStyle.js";import{COLORS as i}from"../../../constants/Theme.js";const a=c("div","production"===process.env.NODE_ENV?{target:"e2npj5k0"}:{target:"e2npj5k0",label:"Container"})("production"===process.env.NODE_ENV?{name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"}:{name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlplcm9TdGF0ZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSzZCIiwiZmlsZSI6Ilplcm9TdGF0ZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJyZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IFN0YXJSYXRpbmcgfSBmcm9tIFwiLi4vLi4vc3Rhci1yYXRpbmdcIjtcclxuaW1wb3J0IHsgVGl0bGVNZWRpdW0gfSBmcm9tIFwiLi4vLi4vVHlwb2dyYXBoeVN0eWxlXCI7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuY29uc3QgQ29udGFpbmVyID0gc3R5bGVkLmRpdiBgXG5cdGRpc3BsYXk6IGZsZXg7XG5cdGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG5cdGdhcDogMTZweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBaZXJvU3RhdGUgPSAoeyBoYW5kbGVTdGFyU2VsZWN0aW9uLCBpbml0aWFsVGV4dCB9KSA9PiB7XHJcbiAgICByZXR1cm4gKF9qc3hzKENvbnRhaW5lciwgeyBjaGlsZHJlbjogW19qc3goVGl0bGVNZWRpdW0sIE9iamVjdC5hc3NpZ24oeyBjb2xvcjogQ09MT1JTLnN1cmZhY2Uuc3RhbmRhcmQgfSwgeyBjaGlsZHJlbjogaW5pdGlhbFRleHQgIT09IG51bGwgJiYgaW5pdGlhbFRleHQgIT09IHZvaWQgMCA/IGluaXRpYWxUZXh0IDogJ1JhdGUgeW91ciBleHBlcmllbmNlIHdpdGggdXMnIH0pKSwgX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ3JvdycsXHJcbiAgICAgICAgICAgICAgICAgICAganVzdGlmeUNvbnRlbnQ6ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFN0YXJSYXRpbmcsIHsgc3RhclNpemU6IDMyLCBvbkNoYW5nZTogaGFuZGxlU3RhclNlbGVjdGlvbiB9KSB9KSldIH0pKTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9WmVyb1N0YXRlLmpzLm1hcCJdfQ== */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}),d=({handleStarSelection:c,initialText:d})=>e(a,{children:[g(l,Object.assign({color:i.surface.standard},{children:null!=d?d:"Rate your experience with us"})),g("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"center"}},{children:g(t,{starSize:32,onChange:c})}))]});export{d as ZeroState};
1
+ import c from"@emotion/styled/base";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{StarRating as g}from"../../star-rating/StarRating.js";import{TitleMedium as l}from"../../TypographyStyle.js";import{COLORS as i}from"../../../constants/Theme.js";const a=c("div","production"===process.env.NODE_ENV?{target:"e2npj5k0"}:{target:"e2npj5k0",label:"Container"})("production"===process.env.NODE_ENV?{name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"}:{name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlplcm9TdGF0ZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSzZCIiwiZmlsZSI6Ilplcm9TdGF0ZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJyZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IFN0YXJSYXRpbmcgfSBmcm9tIFwiLi4vLi4vc3Rhci1yYXRpbmdcIjtcclxuaW1wb3J0IHsgVGl0bGVNZWRpdW0gfSBmcm9tIFwiLi4vLi4vVHlwb2dyYXBoeVN0eWxlXCI7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuY29uc3QgQ29udGFpbmVyID0gc3R5bGVkLmRpdiBgXG5cdGRpc3BsYXk6IGZsZXg7XG5cdGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG5cdGdhcDogMTZweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBaZXJvU3RhdGUgPSAoeyBoYW5kbGVTdGFyU2VsZWN0aW9uLCBpbml0aWFsVGV4dCB9KSA9PiB7XHJcbiAgICByZXR1cm4gKF9qc3hzKENvbnRhaW5lciwgeyBjaGlsZHJlbjogW19qc3goVGl0bGVNZWRpdW0sIE9iamVjdC5hc3NpZ24oeyBjb2xvcjogQ09MT1JTLnN1cmZhY2Uuc3RhbmRhcmQgfSwgeyBjaGlsZHJlbjogaW5pdGlhbFRleHQgIT09IG51bGwgJiYgaW5pdGlhbFRleHQgIT09IHZvaWQgMCA/IGluaXRpYWxUZXh0IDogJ1JhdGUgeW91ciBleHBlcmllbmNlIHdpdGggdXMnIH0pKSwgX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ3JvdycsXHJcbiAgICAgICAgICAgICAgICAgICAganVzdGlmeUNvbnRlbnQ6ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFN0YXJSYXRpbmcsIHsgc3RhclNpemU6IDMyLCBvbkNoYW5nZTogaGFuZGxlU3RhclNlbGVjdGlvbiB9KSB9KSldIH0pKTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9WmVyb1N0YXRlLmpzLm1hcCJdfQ== */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}),d=c=>{let{handleStarSelection:d,initialText:n}=c;return e(a,{children:[t(l,Object.assign({color:i.surface.standard},{children:null!=n?n:"Rate your experience with us"})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"center"}},{children:t(g,{starSize:32,onChange:d})}))]})};export{d as ZeroState};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t}from"react";import n from"react-calendar";import{PickerContainer as a}from"./DatePicker.styled.js";const r=r=>{const[l,i]=t(r.selectedDates),[c,o]=t(r.selectedDate),s=null===r.maxRangeLimit?null:void 0===r.maxRangeLimit?180:r.maxRangeLimit;return e(a,Object.assign({selectRange:r.selectRange},{children:e(n,{onChange:e=>{r.selectRange&&r.onSelectRange?function(e){var t;null===(t=r.onSelectRange)||void 0===t||t.call(r,e[0],e[1]),i([e[0],e[1]])}(e):r.onSelectDate&&(r.onSelectDate(e),o(e))},tileDisabled:({date:e,view:t})=>{if(!Array.isArray(l))return!1;const[n,a]=l;if(n&&!a&&null!==s){const a=Math.round((e-n)/864e5);return"month"===t&&(a<-s||a>s)}return!1},onClickDay:function(e){if(!Array.isArray(l))return void i([e,null]);const[t,n]=l;i(t&&t&&!n?[t,e]:[e,null])},value:r.selectRange?l:c,selectRange:r.selectRange,minDate:r.minDate,maxDate:r.maxDate})}))};export{r as DatePicker};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t}from"react";import n from"react-calendar";import{PickerContainer as a}from"./DatePicker.styled.js";const r=r=>{const[l,i]=t(r.selectedDates),[c,o]=t(r.selectedDate),s=null===r.maxRangeLimit?null:void 0===r.maxRangeLimit?180:r.maxRangeLimit;return e(a,Object.assign({selectRange:r.selectRange},{children:e(n,{onChange:e=>{r.selectRange&&r.onSelectRange?function(e){var t;null===(t=r.onSelectRange)||void 0===t||t.call(r,e[0],e[1]),i([e[0],e[1]])}(e):r.onSelectDate&&(r.onSelectDate(e),o(e))},tileDisabled:e=>{let{date:t,view:n}=e;if(!Array.isArray(l))return!1;const[a,r]=l;if(a&&!r&&null!==s){const e=Math.round((t-a)/864e5);return"month"===n&&(e<-s||e>s)}return!1},onClickDay:function(e){if(!Array.isArray(l))return void i([e,null]);const[t,n]=l;i(t&&t&&!n?[t,e]:[e,null])},value:r.selectRange?l:c,selectRange:r.selectRange,minDate:r.minDate,maxDate:r.maxDate})}))};export{r as DatePicker};
@@ -1 +1 @@
1
- import{jsxs as t,Fragment as e,jsx as r}from"react/jsx-runtime";import a,{useState as o}from"react";import n from"react-calendar";import{useOutside as i}from"../../hooks/useOutside.js";import l from"../../utils/DateUtils.js";import{COLORS as s}from"../../constants/Theme.js";import c from"../../assets/icons/calendar.svg.js";import{BodySecondary as d}from"../TypographyStyle.js";import{DateBtn as m,PickerContainer as u}from"./DatePickerWrapper.styled.js";const g=({val:g,onChange:D,calendarProps:p,disabled:v,pickerStyles:b,nativeID:y,maxDate:f,minDate:h})=>{var S,j,w,C;const[k,L]=o(!1),O=a.createRef();return i(O,(()=>{L(!1)})),t(e,{children:[t(m,Object.assign({id:y,bgColor:v?s.background.base:s.surface.standard,borderColor:s.stroke.primary,onClick:()=>L(!k)},{children:[r(d,Object.assign({style:{color:v?s.content.inactive:s.content.primary,flex:1}},{children:g?Array.isArray(g)?(null===(S=null==g?void 0:g[0])||void 0===S?void 0:S.toString())&&(null===(j=null==g?void 0:g[1])||void 0===j?void 0:j.toString())?`${new Date(null===(w=null==g?void 0:g[0])||void 0===w?void 0:w.toString()).toLocaleDateString()}-${new Date(null===(C=null==g?void 0:g[1])||void 0===C?void 0:C.toString()).toLocaleDateString()}`:`${l.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(g.toString()).toLocaleDateString():(new Date).toLocaleDateString()})),r(c,{width:20,height:20,color:v?s.content.inactive:s.content.primary})]})),k&&!v&&r(u,Object.assign({ref:O,style:Object.assign({},b),contentPrimary:s.content.primary,subDued:s.surface.subdued,brandColor:s.background.brand,bgColor:s.surface.standard,borderColor:s.stroke.primary},{children:r(n,Object.assign({tileClassName:["custom__tile"],className:["custom__calendar"],onChange:t=>{D(t),L(!1)},maxDate:f,minDate:h,value:g?Array.isArray(g)?2===g.length?[new Date(g[0]),new Date(g[1])]:null:new Date(g):null},p))}))]})};export{g as default};
1
+ import{jsxs as t,Fragment as e,jsx as r}from"react/jsx-runtime";import a,{useState as o}from"react";import n from"react-calendar";import{useOutside as i}from"../../hooks/useOutside.js";import l from"../../utils/DateUtils.js";import{COLORS as s}from"../../constants/Theme.js";import c from"../../assets/icons/calendar.svg.js";import{BodySecondary as d}from"../TypographyStyle.js";import{DateBtn as m,PickerContainer as u}from"./DatePickerWrapper.styled.js";const g=g=>{let{val:D,onChange:p,calendarProps:v,disabled:b,pickerStyles:y,nativeID:f,maxDate:h,minDate:S}=g;var j,w,C,k;const[L,O]=o(!1),x=a.createRef();return i(x,(()=>{O(!1)})),t(e,{children:[t(m,Object.assign({id:f,bgColor:b?s.background.base:s.surface.standard,borderColor:s.stroke.primary,onClick:()=>O(!L)},{children:[r(d,Object.assign({style:{color:b?s.content.inactive:s.content.primary,flex:1}},{children:D?Array.isArray(D)?(null===(j=null==D?void 0:D[0])||void 0===j?void 0:j.toString())&&(null===(w=null==D?void 0:D[1])||void 0===w?void 0:w.toString())?`${new Date(null===(C=null==D?void 0:D[0])||void 0===C?void 0:C.toString()).toLocaleDateString()}-${new Date(null===(k=null==D?void 0:D[1])||void 0===k?void 0:k.toString()).toLocaleDateString()}`:`${l.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(D.toString()).toLocaleDateString():(new Date).toLocaleDateString()})),r(c,{width:20,height:20,color:b?s.content.inactive:s.content.primary})]})),L&&!b&&r(u,Object.assign({ref:x,style:Object.assign({},y),contentPrimary:s.content.primary,subDued:s.surface.subdued,brandColor:s.background.brand,bgColor:s.surface.standard,borderColor:s.stroke.primary},{children:r(n,Object.assign({tileClassName:["custom__tile"],className:["custom__calendar"],onChange:t=>{p(t),O(!1)},maxDate:h,minDate:S,value:D?Array.isArray(D)?2===D.length?[new Date(D[0]),new Date(D[1])]:null:new Date(D):null},v))}))]})};export{g as default};
@@ -20,5 +20,12 @@ export interface DiscountDialogueI {
20
20
  collection?: Collection[];
21
21
  discountAdminUrl?: string;
22
22
  currency?: string;
23
+ newPickerConf?: {
24
+ searchInCollection: any;
25
+ searchProducts: any;
26
+ fetchCollections: any;
27
+ fetchProducts: any;
28
+ storeId: string;
29
+ };
23
30
  }
24
31
  export declare const DiscountModal: React.FC<DiscountDialogueI>;
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_TARGET_TYPES as d,DISCOUNT_TYPES as s,DISCOUNT_TARGET_SELECTION as c,DISCOUNT_VALUE_TYPES as l}from"./type.js";import"../dropdown/DropdownPopover/index.js";import{Dropdown as a}from"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{TitleSmall as p,BodyCaption as u}from"../TypographyStyle.js";import{DEFAULT_THEME as m}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as y}from"../modals/styledModal.js";import{ProductPickerContent as b}from"../product-picker/ProductPickerModal.js";import{Tag as v}from"../tag/Tag.js";import{Tooltip as C}from"../tooltips/Tooltip.js";import E from"../../assets/icons/triangle_error.svg.js";import{StyledDiscountDialogueContainer as T,CouponTypeContainerStyled as I}from"./DiscountModal.styled.js";import{validateDiscountData as P}from"./DiscountUtils.js";import g,{DISCOUNT_PRODUCTS as h}from"./DynamicCoupon/DynamicCoupon.js";import S from"./StaticCoupon/StaticCoupon.js";const j=j=>{var O,N,D,f,w;const[_,A]=i(),[q,x]=i(),[G,L]=i(null!==(O=j.data)&&void 0!==O?O:"string"==typeof j.hideOption?{isStaticCoupon:"dynamic"===j.hideOption}:{isStaticCoupon:!1}),[M,k]=i(!0),[F,R]=i(),[U,B]=i((null===(N=j.data)||void 0===N?void 0:N.minAmount)?r.AMOUNT:(null===(D=j.data)||void 0===D?void 0:D.minQuantity)?r.QUANTITY:r.NA),[X,Y]=i([]),[Q,H]=i([]),[V,z]=i([]),[K,$]=i([]),[Z,J]=i(0);n((()=>{let t;j.hideProbability||(t=tt()),k(P(G,U,F,j.hideProbability||!1,t,!!G.isStaticCoupon)),j.hideProbability||tt()}),[]),n((()=>{let t;j.hideProbability||(t=tt()),k(P(G,U,F,j.hideProbability||!1,t,!!G.isStaticCoupon))}),[G,Z,F,U]),n((()=>{var t,e,o,i,n;if(j.products&&(null===(t=j.products)||void 0===t?void 0:t.length)){if(null===(e=j.data)||void 0===e?void 0:e.entitledProductIds){const t=j.products.filter((t=>{var e,o;return null===(o=null===(e=j.data)||void 0===e?void 0:e.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));H(t)}if(null===(o=j.data)||void 0===o?void 0:o.prerequisiteProductIds){const t=j.products.filter((t=>{var e,o;return null===(o=null===(e=j.data)||void 0===e?void 0:e.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));Y(t)}}if(j.collection&&j.collection.length){if(null===(i=j.data)||void 0===i?void 0:i.entitledCollectionIds){const t=j.collection.filter((t=>{var e,o;return null===(o=null===(e=j.data)||void 0===e?void 0:e.entitledCollectionIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));$(t)}if(null===(n=j.data)||void 0===n?void 0:n.prerequisiteCollectionIds){const t=j.collection.filter((t=>{var e,o;return null===(o=null===(e=j.data)||void 0===e?void 0:e.prerequisiteCollectionIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));z(t)}}}),[j.products,j.collection]),n((()=>{const t=Q.map((t=>parseInt(t.id)));L(Object.assign(Object.assign({},G),{entitledProductIds:t}))}),[Q]),n((()=>{const t=X.map((t=>parseInt(t.id)));L(Object.assign(Object.assign({},G),{prerequisiteProductIds:t}))}),[X]),n((()=>{const t=K.map((t=>parseInt(t.id)));L(Object.assign(Object.assign({},G),{entitledCollectionIds:t}))}),[K]),n((()=>{const t=V.map((t=>parseInt(t.id)));L(Object.assign(Object.assign({},G),{prerequisiteCollectionIds:t}))}),[V]),n((()=>{G.targetType===d.SHIPPING_LINE?R(s.FREE_SHIPPING):G.targetSelection===c.ENTITLED?R(s.BUY_X_GET_Y):G.valueType===l.FIXED_AMOUNT?R(s.FIXED_AMOUNT):G.valueType===l.PERCENTAGE&&R(s.PERCENTAGE)}),[]);const W=[{value:s.FIXED_AMOUNT,label:"Fixed Amount",selected:F===s.FIXED_AMOUNT},{value:s.PERCENTAGE,label:"Percentage",selected:F===s.PERCENTAGE},{value:s.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:F===s.BUY_X_GET_Y},{value:s.FREE_SHIPPING,label:"Free shipping",selected:F===s.FREE_SHIPPING}],tt=()=>{if(!j.quadrant||!j.probability)return;const t=[...j.probability];let e=[];t.length>=j.quadrant&&t.splice(j.quadrant-1,1),e=t;const o=e.reduce(((t,e)=>t+e),0)+(G.probability||0);return J(parseFloat(o.toFixed(4))),parseFloat(o.toFixed(4))},et=t=>{const e=t.value;R(e),e===s.FREE_SHIPPING?(Y([]),H([]),L(Object.assign(Object.assign({},G),{value:100,targetSelection:c.ALL,targetType:d.SHIPPING_LINE,valueType:l.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):e===s.BUY_X_GET_Y?L(Object.assign(Object.assign({},G),{targetSelection:c.ENTITLED,targetType:d.LINE_ITEM,valueType:l.PERCENTAGE})):e===s.PERCENTAGE?(Y([]),H([]),L(Object.assign(Object.assign({},G),{targetSelection:c.ALL,targetType:d.LINE_ITEM,valueType:l.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):e===s.FIXED_AMOUNT&&(Y([]),H([]),L(Object.assign(Object.assign({},G),{targetSelection:c.ALL,targetType:d.LINE_ITEM,valueType:l.FIXED_AMOUNT,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0})))};return t(y,Object.assign({width:"750px",open:j.isOpen,headingTitle:_?"Select Products":j.title,headingSubtitle:_?void 0:j.subTitle,footerLeftCustomElement:!j.quadrant||j.hideProbability?e(o,{}):Z<=1?e(v,{theme:"light",tagText:`Current probability sum: ${Z}`,type:"white"}):e(C,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e("div",{children:e(v,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${Z}`,type:"negative",LeadingIcon:E})})})),headerRightCustomElement:j.allowStaticCoupon||_?void 0:e(a,{options:W,width:"200px",placement:"bottom-start",size:"small",onSelect:t=>{et(t)}}),onClose:j.onClose,footerShadow:!0,primaryButton:_?{buttonType:"primary",onClick:()=>{A(void 0)},buttonText:"Add"}:q?{buttonType:"primary",onClick:()=>{x(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:M,onClick:()=>{G.isStaticCoupon?j.onSaveClicked({quadrant:G.quadrant,couponCode:G.couponCode,description:G.description,isStaticCoupon:G.isStaticCoupon,probability:G.probability,title:G.title}):j.onSaveClicked(G),L({})}},secondaryButton:_?{buttonType:"tertiaryGray",onClick:()=>{A(void 0)},buttonText:"Back"}:q?{buttonType:"tertiaryGray",onClick:()=>{x(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:j.onClose,buttonText:"Close"}},{children:[!_&&!q&&t(T,{children:[j.allowStaticCoupon&&!_&&t(I,Object.assign({selectedDiv:G.isStaticCoupon?1:2},{children:["static"===j.hideOption?e(o,{}):t("div",Object.assign({className:"coupon-type__container",onClick:()=>{L({isStaticCoupon:!0,couponCode:G.couponCode,description:G.description,quadrant:G.quadrant})}},{children:[e(p,Object.assign({style:G.isStaticCoupon?{color:m.colorsV2.content.brand}:{}},{children:"Static code"})),e(u,Object.assign({style:G.isStaticCoupon?{color:m.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),"dynamic"===j.hideOption?e(o,{}):t("div",Object.assign({className:"coupon-type__container",onClick:()=>{L(Object.assign(Object.assign({},G),{isStaticCoupon:!1}))}},{children:[e(p,Object.assign({style:G.isStaticCoupon?{}:{color:m.colorsV2.content.brand}},{children:"Dynamic code"})),e(u,Object.assign({style:G.isStaticCoupon?{}:{color:m.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),G.isStaticCoupon&&!_&&e(S,{discountData:G,setDiscountData:L,hideProbability:j.hideProbability||!1,discountAdminUrl:j.discountAdminUrl}),!G.isStaticCoupon&&!_&&!q&&e(g,{currency:j.currency,entitledProducts:Q,prerequisiteProducts:X,setEntitledProducts:H,setPrerequisiteProducts:Y,discountData:G,productPickerOpen:_,setIsProductPickerOpen:A,setDiscountData:L,selectedCouponType:F,setSelectedCouponType:R,selectedMinimumRequirement:U,setSelectedMinimumRequirement:B,hideProbability:j.hideProbability||!1,hideExpiration:j.hideExpiration||!1,allowStaticCoupon:j.allowStaticCoupon,onChangeCouponType:et,collectionPickerOpen:q,entitledCollections:K,prerequisiteCollections:V,setIsCollectionPickerOpen:x,setEntitledCollections:$,setPrerequisiteCollections:z})]}),!!_&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(b,{show:!0,onSave:()=>{},products:null!==(f=j.products)&&void 0!==f?f:[],title:"Select Products",onClose:()=>{A(void 0)},selectedProducts:_===h.ENTITLED?Q:X,setSelectedProducts:_===h.ENTITLED?H:Y,onSearchKeyChange:j.onProductSearch})})),!!q&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(b,{show:!0,onSave:()=>{},products:null!==(w=j.collection)&&void 0!==w?w:[],title:"Select Products",onClose:()=>{x(void 0)},selectedProducts:q===h.ENTITLED?K:V,setSelectedProducts:q===h.ENTITLED?$:z,onSearchKeyChange:j.onCollectionSearch,searchPlaceholder:"Search collections..."})}))]}))};export{j as DiscountModal};
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_TARGET_TYPES as c,DISCOUNT_TYPES as d,DISCOUNT_TARGET_SELECTION as s,DISCOUNT_VALUE_TYPES as l}from"./type.js";import"../dropdown/DropdownPopover/index.js";import{Dropdown as a}from"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{TitleSmall as u,BodyCaption as p}from"../TypographyStyle.js";import{DEFAULT_THEME as C}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as v}from"../modals/styledModal.js";import{ProductPickerContent as m}from"../product-picker/ProductPickerModal.js";import{Tag as b}from"../tag/Tag.js";import{Tooltip as h}from"../tooltips/Tooltip.js";import P from"../../assets/icons/triangle_error.svg.js";import{ProductPickerModal as y}from"../product-picker-v2/modal.js";import{StyledDiscountDialogueContainer as I,CouponTypeContainerStyled as T}from"./DiscountModal.styled.js";import{validateDiscountData as O,descriptionBuilder as f}from"./DiscountUtils.js";import S,{DISCOUNT_PRODUCTS as E}from"./DynamicCoupon/DynamicCoupon.js";import g from"./StaticCoupon/StaticCoupon.js";const j=j=>{var w,k,_,D,N,F,q;const[A,x]=i(),[M,L]=i(),[R,U]=i(null!==(w=j.data)&&void 0!==w?w:"string"==typeof j.hideOption?{isStaticCoupon:"dynamic"===j.hideOption}:{isStaticCoupon:!1}),[G,B]=i(!0),[Y,X]=i(),[H,V]=i((null===(k=j.data)||void 0===k?void 0:k.minAmount)?r.AMOUNT:(null===(_=j.data)||void 0===_?void 0:_.minQuantity)?r.QUANTITY:r.NA),[z,K]=i([]),[Q,$]=i([]),[Z,J]=i([]),[W,ee]=i([]),[te,oe]=i(0);n((()=>{let e;ie(),j.hideProbability||(e=re()),B(O(R,H,Y,j.hideProbability||!1,e,!!R.isStaticCoupon)),j.hideProbability||re()}),[]),n((()=>{let e;j.hideProbability||(e=re()),B(O(R,H,Y,j.hideProbability||!1,e,!!R.isStaticCoupon))}),[R,te,Y,H]),n((()=>{var e,t,o,i,n;if(!j.newPickerConf){if(j.products&&(null===(e=j.products)||void 0===e?void 0:e.length)){if(null===(t=j.data)||void 0===t?void 0:t.entitledProductIds){const e=j.products.filter((e=>{var t,o;return null===(o=null===(t=j.data)||void 0===t?void 0:t.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));$(e)}if(null===(o=j.data)||void 0===o?void 0:o.prerequisiteProductIds){const e=j.products.filter((e=>{var t,o;return null===(o=null===(t=j.data)||void 0===t?void 0:t.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));K(e)}}if(j.collection&&j.collection.length){if(null===(i=j.data)||void 0===i?void 0:i.entitledCollectionIds){const e=j.collection.filter((e=>{var t,o;return null===(o=null===(t=j.data)||void 0===t?void 0:t.entitledCollectionIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));ee(e)}if(null===(n=j.data)||void 0===n?void 0:n.prerequisiteCollectionIds){const e=j.collection.filter((e=>{var t,o;return null===(o=null===(t=j.data)||void 0===t?void 0:t.prerequisiteCollectionIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));J(e)}}}}),[j.products,j.collection]),n((()=>{var e,t,o,i,n,r,c,d;(null===(t=null===(e=j.data)||void 0===e?void 0:e.productsConf)||void 0===t?void 0:t.entitledProducts)&&$(j.data.productsConf.entitledProducts),(null===(i=null===(o=j.data)||void 0===o?void 0:o.productsConf)||void 0===i?void 0:i.prerequisiteProducts)&&K(j.data.productsConf.prerequisiteProducts),(null===(r=null===(n=j.data)||void 0===n?void 0:n.collectionsConf)||void 0===r?void 0:r.entitledCollections)&&ee(j.data.collectionsConf.entitledCollections),(null===(d=null===(c=j.data)||void 0===c?void 0:c.collectionsConf)||void 0===d?void 0:d.prerequisiteCollections)&&J(j.data.collectionsConf.prerequisiteCollections)}),[null===(D=j.data)||void 0===D?void 0:D.productsConf,null===(N=j.data)||void 0===N?void 0:N.collectionsConf]),n((()=>{if(j.newPickerConf){const e=[];return Object.values(Q).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void U(Object.assign(Object.assign({},R),{entitledProductIds:e}))}const e=Q.map((e=>parseInt(e.id)));U(Object.assign(Object.assign({},R),{entitledProductIds:e}))}),[Q]),n((()=>{if(j.newPickerConf){const e=[];return Object.values(z).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void U(Object.assign(Object.assign({},R),{prerequisiteProductIds:e}))}const e=z.map((e=>parseInt(e.id)));U(Object.assign(Object.assign({},R),{prerequisiteProductIds:e}))}),[z]),n((()=>{if(j.newPickerConf){(null==W?void 0:W.isCustom)&&delete W.isCustom;const e=Object.keys(W).map((e=>parseInt(e)));return void U(Object.assign(Object.assign({},R),{entitledCollectionIds:e}))}const e=W.map((e=>parseInt(e.id)));U(Object.assign(Object.assign({},R),{entitledCollectionIds:e}))}),[W]),n((()=>{if(j.newPickerConf){(null==Z?void 0:Z.isCustom)&&delete Z.isCustom;const e=Object.keys(Z).map((e=>parseInt(e)));return void U(Object.assign(Object.assign({},R),{prerequisiteCollectionIds:e}))}const e=Z.map((e=>parseInt(e.id)));U(Object.assign(Object.assign({},R),{prerequisiteCollectionIds:e}))}),[Z]);const ie=()=>{var e,t;R.isStaticCoupon||(R.targetType===c.SHIPPING_LINE?X(d.FREE_SHIPPING):R.targetType===c.LINE_ITEM?R.targetSelection===s.ENTITLED?(null===(e=R.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(t=R.prerequisiteCollectionIds)||void 0===t?void 0:t.length)?X(d.BUY_X_GET_Y):X(d.AMOUNT_OFF_PRODUCTS):X(d.AMOUNT_OFF_ORDER):(U(Object.assign(Object.assign({},R),{targetType:c.LINE_ITEM,targetSelection:s.ALL,valueType:l.FIXED_AMOUNT})),X(d.AMOUNT_OFF_ORDER)))};n((()=>{ie()}),[R.isStaticCoupon]);const ne=[{value:d.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:Y===d.AMOUNT_OFF_ORDER},{value:d.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:Y===d.AMOUNT_OFF_PRODUCTS},{value:d.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:Y===d.BUY_X_GET_Y},{value:d.FREE_SHIPPING,label:"Free shipping",selected:Y===d.FREE_SHIPPING}],re=()=>{if(!j.quadrant||!j.probability)return;const e=[...j.probability];let t=[];e.length>=j.quadrant&&e.splice(j.quadrant-1,1),t=e;const o=t.reduce(((e,t)=>e+t),0)+(R.probability||0);return oe(parseFloat(o.toFixed(4))),parseFloat(o.toFixed(4))},ce=e=>{var t,o,i,n;const a=e.value;X(a),K([]),$([]),J([]),ee([]),V(r.NA),a===d.FREE_SHIPPING?U({value:100,targetSelection:s.ALL,targetType:c.SHIPPING_LINE,valueType:l.PERCENTAGE,quadrant:R.quadrant,isStaticCoupon:!1}):a===d.BUY_X_GET_Y?U({targetSelection:s.ENTITLED,targetType:c.LINE_ITEM,valueType:l.PERCENTAGE,quadrant:R.quadrant,isStaticCoupon:!1}):a===d.AMOUNT_OFF_ORDER?U({targetSelection:s.ALL,targetType:c.LINE_ITEM,valueType:null!==(o=null===(t=j.data)||void 0===t?void 0:t.valueType)&&void 0!==o?o:l.FIXED_AMOUNT,quadrant:R.quadrant,isStaticCoupon:!1}):a===d.AMOUNT_OFF_PRODUCTS&&U({targetSelection:s.ENTITLED,targetType:c.LINE_ITEM,valueType:null!==(n=null===(i=j.data)||void 0===i?void 0:i.valueType)&&void 0!==n?n:l.FIXED_AMOUNT,quadrant:R.quadrant,isStaticCoupon:!1})};return e(v,Object.assign({width:(M||A)&&j.newPickerConf?"25px":"750px",open:j.isOpen,headingTitle:A?"Select Products":j.title,headingSubtitle:A?void 0:j.subTitle,footerLeftCustomElement:!j.quadrant||j.hideProbability?t(o,{}):te<=1?t(b,{theme:"light",tagText:`Current probability sum: ${te}`,type:"white"}):t(h,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:t("div",{children:t(b,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${te}`,type:"negative",LeadingIcon:P})})})),headerRightCustomElement:j.allowStaticCoupon||A?void 0:t(a,{options:ne,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{ce(e)}}),onClose:j.onClose,footerShadow:!0,primaryButton:A?{buttonType:"primary",onClick:()=>{x(void 0)},buttonText:"Add"}:M?{buttonType:"primary",onClick:()=>{L(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:G,onClick:()=>{var e,t;R.isStaticCoupon?j.onSaveClicked({quadrant:R.quadrant,couponCode:R.couponCode,description:R.description,isStaticCoupon:R.isStaticCoupon,probability:R.probability,title:R.title}):j.onSaveClicked(Object.assign(Object.assign({},R),{description:f(R,j.currency,null!==(e=j.products)&&void 0!==e?e:[],null!==(t=j.collection)&&void 0!==t?t:[]),productsConf:{entitledProducts:Q,prerequisiteProducts:z},collectionsConf:{entitledCollections:W,prerequisiteCollections:Z}})),U({})}},secondaryButton:A?{buttonType:"tertiaryGray",onClick:()=>{x(void 0)},buttonText:"Back"}:M?{buttonType:"tertiaryGray",onClick:()=>{L(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:j.onClose,buttonText:"Close"}},{children:[!A&&!M&&e(I,{children:[j.allowStaticCoupon&&!A&&e(T,Object.assign({selectedDiv:R.isStaticCoupon?1:2},{children:["static"===j.hideOption?t(o,{}):e("div",Object.assign({className:"coupon-type__container",onClick:()=>{R.isStaticCoupon||U({isStaticCoupon:!0,quadrant:R.quadrant})}},{children:[t(u,Object.assign({style:R.isStaticCoupon?{color:C.colorsV2.content.brand}:{}},{children:"Static code"})),t(p,Object.assign({style:R.isStaticCoupon?{color:C.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),"dynamic"===j.hideOption?t(o,{}):e("div",Object.assign({className:"coupon-type__container",onClick:()=>{R.isStaticCoupon&&U({isStaticCoupon:!1,quadrant:R.quadrant})}},{children:[t(u,Object.assign({style:R.isStaticCoupon?{}:{color:C.colorsV2.content.brand}},{children:"Dynamic code"})),t(p,Object.assign({style:R.isStaticCoupon?{}:{color:C.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),R.isStaticCoupon&&!A&&t(g,{discountData:R,setDiscountData:U,hideProbability:j.hideProbability||!1,discountAdminUrl:j.discountAdminUrl}),!R.isStaticCoupon&&!A&&!M&&t(S,{currency:j.currency,entitledProducts:Q,prerequisiteProducts:z,setEntitledProducts:$,setPrerequisiteProducts:K,discountData:R,productPickerOpen:A,setIsProductPickerOpen:x,setDiscountData:U,selectedCouponType:Y,setSelectedCouponType:X,selectedMinimumRequirement:H,setSelectedMinimumRequirement:V,hideProbability:j.hideProbability||!1,hideExpiration:j.hideExpiration||!1,allowStaticCoupon:j.allowStaticCoupon,onChangeCouponType:ce,collectionPickerOpen:M,entitledCollections:W,prerequisiteCollections:Z,setIsCollectionPickerOpen:L,setEntitledCollections:ee,setPrerequisiteCollections:J,useNewPicker:!!j.newPickerConf})]}),!!A&&e(o,{children:[!j.newPickerConf&&t("div",Object.assign({style:{padding:"12px 0"}},{children:t(m,{show:!0,onSave:()=>{},products:null!==(F=j.products)&&void 0!==F?F:[],title:"Select Products",onClose:()=>{x(void 0)},selectedProducts:A===E.ENTITLED?Q:z,setSelectedProducts:A===E.ENTITLED?$:K,onSearchKeyChange:j.onProductSearch})})),j.newPickerConf&&t(y,{visible:!0,onClose:()=>x(void 0),collectionFetcher:j.newPickerConf.fetchCollections,productFetcher:j.newPickerConf.fetchProducts,selectedItems:A===E.ENTITLED?Q:z,onAdd:e=>{A===E.ENTITLED?$(e):K(e),x(void 0)},zIndex:200,storeId:j.newPickerConf.storeId,searchInCollectionFetcher:j.newPickerConf.searchInCollection,customCollectionRestriction:!1,searchFetcher:j.newPickerConf.searchProducts,hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!M&&t("div",Object.assign({style:{padding:"12px 0"}},{children:e(o,{children:[j.newPickerConf&&t(y,{visible:!0,onClose:()=>L(void 0),collectionFetcher:j.newPickerConf.fetchCollections,productFetcher:j.newPickerConf.fetchProducts,selectedItems:M===E.ENTITLED?W:Z,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),M===E.ENTITLED?ee(e):J(e),L(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:j.newPickerConf.storeId,searchInCollectionFetcher:j.newPickerConf.searchInCollection,searchFetcher:j.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!j.newPickerConf&&t(m,{show:!0,onSave:()=>{},products:null!==(q=j.collection)&&void 0!==q?q:[],title:"Select Products",onClose:()=>{L(void 0)},selectedProducts:M===E.ENTITLED?W:Z,setSelectedProducts:M===E.ENTITLED?ee:J,onSearchKeyChange:j.onCollectionSearch,searchPlaceholder:"Search collections..."})]})}))]}))};export{j as DiscountModal};
@@ -1,2 +1,4 @@
1
1
  import { DISCOUNT_TYPES, ICouponData, MIN_PURCHASE_REQUIREMENT } from "./type";
2
+ import { Collection, Product } from '../product-picker/type';
2
3
  export declare const validateDiscountData: (couponData: ICouponData, selectedMinimumRequirement: MIN_PURCHASE_REQUIREMENT | undefined, selectedCouponType: DISCOUNT_TYPES | undefined, hideProbability: boolean, currentProbability: number, isStatic: boolean) => boolean;
4
+ export declare const descriptionBuilder: (data: ICouponData, currencySymbol: string, products: Product[], collections: Collection[]) => string | undefined;
@@ -1 +1 @@
1
- import{DISCOUNT_TYPES as e,DISCOUNT_VALUE_TYPES as i,MIN_PURCHASE_REQUIREMENT as t,DISCOUNT_TARGET_TYPES as r,DISCOUNT_TARGET_SELECTION as n}from"./type.js";const u=(u,l,o,f,v,a)=>{var d,T,A,E;if(!u.title)return!0;if(!f){if(isNaN(u.probability))return!0;if((u.probability||0)>1)return!0;if((u.probability||0)<0)return!0;if(v>1)return!0}if(a){if(!(null==u?void 0:u.couponCode))return!0;if(!u.description)return!0}else{if(o&&o===e.FIXED_AMOUNT){if(u.valueType!==i.FIXED_AMOUNT)return!0;if(!(null==u?void 0:u.value)||(null==u?void 0:u.value)<=0)return!0;if(l===t.AMOUNT&&(!u.minAmount||(null==u?void 0:u.minAmount)<=0))return!0;if(l===t.QUANTITY&&(!(null==u?void 0:u.minQuantity)||(null==u?void 0:u.minQuantity)<=0))return!0;if(u.targetType!==r.LINE_ITEM)return!0;if(u.targetSelection!==n.ALL)return!0}else if(o&&o===e.PERCENTAGE){if(u.valueType!==i.PERCENTAGE)return!0;if(!(null==u?void 0:u.value)||(null==u?void 0:u.value)<=0||(null==u?void 0:u.value)>100)return!0;if(l===t.AMOUNT&&(!u.minAmount||(null==u?void 0:u.minAmount)<=0))return!0;if(l===t.QUANTITY&&(!(null==u?void 0:u.minQuantity)||(null==u?void 0:u.minQuantity)<=0))return!0;if(u.targetType!==r.LINE_ITEM)return!0;if(u.targetSelection!==n.ALL)return!0}else if(o&&o===e.BUY_X_GET_Y){if(!u.entitledQuantity||!(null===(d=u.entitledProductIds)||void 0===d?void 0:d.length)&&!(null===(T=u.entitledCollectionIds)||void 0===T?void 0:T.length)||!u.prerequisiteQuantity||!(null===(A=u.prerequisiteProductIds)||void 0===A?void 0:A.length)&&!(null===(E=u.prerequisiteCollectionIds)||void 0===E?void 0:E.length))return!0;if(u.valueType!==i.PERCENTAGE)return!0;if(!u.value)return!0;if(u.value<=0||u.value>100)return!0;if(u.targetSelection!==n.ENTITLED)return!0;if(u.targetType!==r.LINE_ITEM)return!0}else if(o&&e.FREE_SHIPPING){if(u.valueType!==i.PERCENTAGE)return!0;if(u.targetType!==r.SHIPPING_LINE)return!0;if(100!==u.value)return!0;if(u.targetSelection!==n.ALL)return!0;if(l===t.AMOUNT&&(!u.minAmount||(null==u?void 0:u.minAmount)<=0))return!0;if(l===t.QUANTITY&&(!(null==u?void 0:u.minQuantity)||(null==u?void 0:u.minQuantity)<=0))return!0}if(null!==u.expireAfter&&void 0!==u.expireAfter&&u.expireAfter<=0)return!0;if(u.expireAt&&u.expireAt<new Date)return!0}return!1};export{u as validateDiscountData};
1
+ import{DISCOUNT_TYPES as e,DISCOUNT_VALUE_TYPES as i,MIN_PURCHASE_REQUIREMENT as t,DISCOUNT_TARGET_TYPES as n,DISCOUNT_TARGET_SELECTION as r}from"./type.js";import l from"../../utils/DateUtils.js";const o=(l,o,u,d,v,s)=>{var a,p,f,c,y,g,m,I,A,E,T,$,h;if(!l.title||(null===(a=l.title)||void 0===a?void 0:a.length)>18)return!0;if(!d){if(isNaN(l.probability))return!0;if((l.probability||0)>1)return!0;if((l.probability||0)<0)return!0;if(v>1)return!0}if(s){if(!(null==l?void 0:l.couponCode))return!0;if(!l.description)return!0}else{if(u&&u===e.AMOUNT_OFF_ORDER){if((null==l?void 0:l.valueType)===i.FIXED_AMOUNT){if(!(null==l?void 0:l.value)||(null==l?void 0:l.value)<=0)return!0}else if(!(null==l?void 0:l.value)||(null==l?void 0:l.value)<=0||(null==l?void 0:l.value)>100)return!0;if(o===t.AMOUNT&&(!l.minAmount||(null==l?void 0:l.minAmount)<=0))return!0;if(o===t.QUANTITY&&(!(null==l?void 0:l.minQuantity)||(null==l?void 0:l.minQuantity)<=0))return!0;if(l.targetType!==n.LINE_ITEM)return!0;if(l.targetSelection!==r.ALL)return!0}else if(u&&u===e.AMOUNT_OFF_PRODUCTS){if(!(null===(p=l.entitledProductIds)||void 0===p?void 0:p.length)&&!(null===(f=l.entitledCollectionIds)||void 0===f?void 0:f.length))return!0;if((null===(c=l.entitledProductIds)||void 0===c?void 0:c.length)&&(null===(y=l.entitledCollectionIds)||void 0===y?void 0:y.length))return!0;if(!l.value)return!0;if((null==l?void 0:l.valueType)===i.FIXED_AMOUNT){if(!(null==l?void 0:l.value)||(null==l?void 0:l.value)<=0)return!0}else if(!(null==l?void 0:l.value)||(null==l?void 0:l.value)<=0||(null==l?void 0:l.value)>100)return!0;if(l.targetSelection!==r.ENTITLED)return!0;if(l.targetType!==n.LINE_ITEM)return!0}else if(u&&u===e.BUY_X_GET_Y){if(!l.entitledQuantity||l.entitledQuantity<0||!(null===(g=l.entitledProductIds)||void 0===g?void 0:g.length)&&!(null===(m=l.entitledCollectionIds)||void 0===m?void 0:m.length)||!l.prerequisiteQuantity||l.prerequisiteQuantity<0||!(null===(I=l.prerequisiteProductIds)||void 0===I?void 0:I.length)&&!(null===(A=l.prerequisiteCollectionIds)||void 0===A?void 0:A.length))return!0;if((null===(E=l.entitledProductIds)||void 0===E?void 0:E.length)&&(null===(T=l.entitledCollectionIds)||void 0===T?void 0:T.length))return!0;if((null===($=l.prerequisiteCollectionIds)||void 0===$?void 0:$.length)&&(null===(h=l.prerequisiteProductIds)||void 0===h?void 0:h.length))return!0;if(l.valueType!==i.PERCENTAGE)return!0;if(!l.value)return!0;if(l.value<=0||l.value>100)return!0;if(l.targetSelection!==r.ENTITLED)return!0;if(l.targetType!==n.LINE_ITEM)return!0}else if(u&&e.FREE_SHIPPING){if(l.valueType!==i.PERCENTAGE)return!0;if(l.targetType!==n.SHIPPING_LINE)return!0;if(100!==l.value)return!0;if(l.targetSelection!==r.ALL)return!0;if(o===t.AMOUNT&&(!l.minAmount||(null==l?void 0:l.minAmount)<=0))return!0;if(o===t.QUANTITY&&(!(null==l?void 0:l.minQuantity)||(null==l?void 0:l.minQuantity)<=0))return!0}if(null!==l.expireAfter&&void 0!==l.expireAfter&&l.expireAfter<=0)return!0;if(l.expireAt&&l.expireAt<new Date)return!0}return!1},u=(e,t,o,u)=>{var v,s,a;return(null==e?void 0:e.isStaticCoupon)&&(null==e?void 0:e.description)?e.description:e.targetType===n.LINE_ITEM&&e.targetSelection===r.ALL?`${e.valueType===i.FIXED_AMOUNT?t:""}${(null!==(v=e.value)&&void 0!==v?v:0).toString()}${e.valueType===i.PERCENTAGE?"% off":" off"} on all products\n ${e.minAmount?`| Minimum purchase of ${t}${e.minAmount}`:""} ${e.minQuantity?`| Buy ${e.minQuantity} products`:""} | One use per customer${e.expireAfter?` | Expires in ${e.expireAfter} day(s)`:e.expireAt?` | Expires at ${l.getStringFromDate(e.expireAt,"dd MMM yyyy")}`:""}`.replace(/\s\s+/g," ").trim():e.targetType===n.SHIPPING_LINE?`\n Free shipping on your order ${e.minAmount?`| Minimum purchase of ${t}${e.minAmount}`:""} ${e.minQuantity?`| Buy ${e.minQuantity} products`:""} | One use per customer${e.expireAfter?` | Expires in ${e.expireAfter} day(s)`:e.expireAt?` | Expires at ${l.getStringFromDate(e.expireAt,"dd MMM yyyy")}`:""}`.replace(/\s\s+/g," ").trim():e.targetSelection===r.ENTITLED?(null===(s=e.prerequisiteProductIds)||void 0===s?void 0:s.length)||(null===(a=e.prerequisiteCollectionIds)||void 0===a?void 0:a.length)?`${function(e,i,t){var n,r,l,o,u,v,s,a;let p=`Buy ${e.prerequisiteQuantity} item`;if((null===(n=e.prerequisiteProductIds)||void 0===n?void 0:n.length)||(null===(r=e.prerequisiteCollectionIds)||void 0===r?void 0:r.length)){const n=d(null!==(l=e.prerequisiteProductIds)&&void 0!==l?l:[],i),r=d(null!==(o=e.prerequisiteCollectionIds)&&void 0!==o?o:[],t);p+=" from a selection of ",n.length>0&&(p+=`${n.join(", ")} or `),r.length>0&&(p+=`products in ${r.join(", ")} collection or `),p=p.slice(0,-4)}if(p+=` and get ${e.entitledQuantity} item`,(null===(u=e.entitledProductIds)||void 0===u?void 0:u.length)||(null===(v=e.entitledCollectionIds)||void 0===v?void 0:v.length)){const n=d(null!==(s=e.entitledProductIds)&&void 0!==s?s:[],i),r=d(null!==(a=e.entitledCollectionIds)&&void 0!==a?a:[],t);p+=" from ",n.length>0&&(p+=`${n.join(", ")} or `),r.length>0&&(p+=`products in ${r.join(", ")} collection or `),p=p.slice(0,-4)}return p}(e,o,u)} ${100===e.value?"for free":`at ${e.value}% off`} | One use per customer${e.expireAfter?` | Expires in ${e.expireAfter} day(s)`:e.expireAt?` | Expires at ${l.getStringFromDate(e.expireAt,"dd MMM yyyy")}`:""}`.replace(/\s\s+/g," ").trim():`${function(e,t,n,r){var l,o,u;let v=`Get ${e.valueType===i.FIXED_AMOUNT?r:""}${(null!==(l=e.value)&&void 0!==l?l:0).toString()}${e.valueType===i.PERCENTAGE?"% off":" off"} on `;const s=d(null!==(o=e.entitledProductIds)&&void 0!==o?o:[],t),a=d(null!==(u=e.entitledCollectionIds)&&void 0!==u?u:[],n);s.length>0&&(v+=`${s.join(", ")} or `);a.length>0&&(v+=`products in ${a.join(", ")} collection or `);return v.slice(0,-4)}(e,o,u,t)} | One use per customer${e.expireAfter?` | Expires in ${e.expireAfter} day(s)`:e.expireAt?` | Expires at ${l.getStringFromDate(e.expireAt,"dd MMM yyyy")}`:""}`.replace(/\s\s+/g," ").trim():void 0};function d(e,i){const t=[];return i.forEach((i=>{e.find((e=>e.toString()===i.id))&&t.push(i.name)})),t}export{u as descriptionBuilder,o as validateDiscountData};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { DISCOUNT_TYPES, ICouponData, MIN_PURCHASE_REQUIREMENT } from "../type";
2
+ import { DISCOUNT_TYPES } from "..";
3
+ import { ICouponData, MIN_PURCHASE_REQUIREMENT } from "../type";
3
4
  import { SingleOption } from "../../dropdown/type";
4
5
  import { Collection, Product } from "../../product-picker/type";
5
6
  export declare enum DISCOUNT_PRODUCTS {
@@ -30,6 +31,7 @@ interface DynamicCouponI {
30
31
  hideProbability?: boolean;
31
32
  allowStaticCoupon: boolean;
32
33
  currency?: string;
34
+ useNewPicker?: boolean;
33
35
  }
34
36
  declare const DynamicCoupon: React.FC<DynamicCouponI>;
35
37
  export default DynamicCoupon;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{Button as n}from"../../button/Button.js";import"react";import{DISCOUNT_TYPES as s,MIN_PURCHASE_REQUIREMENT as a}from"../type.js";import"../../dropdown/DropdownPopover/index.js";import{Dropdown as o}from"../../dropdown/Dropdown.js";import"../../dropdown/ChipDropdown.js";import"../../zeroState/ZeroState.js";import{TitleRegular as r,BodySecondary as l,TitleMedium as c,BodyPrimary as d,TitleSmall as p}from"../../TypographyStyle.js";import{DEFAULT_THEME as u}from"../../../constants/Theme.js";import"../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../checkBox/CheckBox.styled.js";import"../../list-item/ListItem.js";import"../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as m}from"../../input/Input.js";import g from"../../../assets/icons/cross.svg.js";import"../../dropdown/MenuItem/MenuItem.js";import"../../modals/styledModal.js";import"../../../node_modules/lodash.debounce/index.js";import"../../bik-layout/CommonStyles.js";import"../../product-picker/ProductPicker.styled.js";import"../../../utils/DateUtils.js";import"../../tag/Tag.js";import"@tippyjs/react";import"../../tooltips/TooltipInternal.js";import{DynamicCouponContainer as b}from"../DiscountModal.styled.js";import{CouponExpiration as v}from"../CouponExpiration/CouponExpiration.js";import{RadioButton as y}from"../../radioButton/RadioButton.js";import h from"../../../assets/icons/cursor.svg.js";import j from"../../../assets/icons/plus.svg.js";const D="https://jkfenner.com/wp-content/uploads/2019/11/default.jpg";var O;function T(){return null}!function(e){e.ENTITLED="entitled",e.PREREQUISITE="prerequisite"}(O||(O={}));const x=x=>{var E;const C=[{value:s.FIXED_AMOUNT,label:"Fixed Amount",selected:x.selectedCouponType===s.FIXED_AMOUNT},{value:s.PERCENTAGE,label:"Percentage",selected:x.selectedCouponType===s.PERCENTAGE},{value:s.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:x.selectedCouponType===s.BUY_X_GET_Y},{value:s.FREE_SHIPPING,label:"Free shipping",selected:x.selectedCouponType===s.FREE_SHIPPING}],f=[{selected:x.selectedMinimumRequirement===a.NA,label:"No minimum requirements",value:a.NA},{selected:x.selectedMinimumRequirement===a.AMOUNT,label:`Minimum purchase amount (${null!==(E=x.currency)&&void 0!==E?E:"₹"})`,value:a.AMOUNT},{selected:x.selectedMinimumRequirement===a.QUANTITY,label:"Minimum quantity of items",value:a.QUANTITY}],_=()=>{var i,n,s,r,c;return e("div",Object.assign({className:"input__rows"},{children:[e("div",Object.assign({className:"input__wrapper"},{children:[t(l,Object.assign({style:{marginBottom:10}},{children:"Min purchase requirements"})),t(o,{options:f,placement:"bottom-start",onSelect:e=>{const t=e.value;x.setSelectedMinimumRequirement(t),x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minQuantity:void 0,minAmount:void 0}))}})]})),t("div",Object.assign({className:"input__wrapper"},{children:x.selectedMinimumRequirement!==a.NA&&t(m,{value:x.selectedMinimumRequirement===a.AMOUNT?null!==(n=null===(i=x.discountData.minAmount)||void 0===i?void 0:i.toString())&&void 0!==n?n:"":null!==(r=null===(s=x.discountData.minQuantity)||void 0===s?void 0:s.toString())&&void 0!==r?r:"",onChangeText:e=>{x.selectedMinimumRequirement===a.AMOUNT?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minAmount:parseInt(e)})):x.selectedMinimumRequirement===a.QUANTITY&&x.setDiscountData(Object.assign(Object.assign({},x.discountData),{minQuantity:parseInt(e)}))},labelText:x.selectedMinimumRequirement===a.AMOUNT?"Minimum purchase amount":"Minimum purchase quantity",prefixText:x.selectedMinimumRequirement===a.AMOUNT?null!==(c=x.currency)&&void 0!==c?c:"₹":void 0,type:"number",placeholder:x.selectedMinimumRequirement===a.AMOUNT?"1000.00":"2"})}))]}))},N=s=>{var a,o,l;const c=s===O.ENTITLED?x.entitledProducts:x.prerequisiteProducts,d=null!==(a=s===O.ENTITLED?x.entitledCollections:x.prerequisiteCollections)&&void 0!==a?a:[];return e(i,{children:[t(r,{children:s===O.PREREQUISITE?"Customer spends":"Customer gets"}),e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(m,{value:s===O.ENTITLED?null===(o=x.discountData.entitledQuantity)||void 0===o?void 0:o.toString():null===(l=x.discountData.prerequisiteQuantity)||void 0===l?void 0:l.toString(),type:"number",onChangeText:e=>{s===O.ENTITLED?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{entitledQuantity:parseInt(e)})):x.setDiscountData(Object.assign(Object.assign({},x.discountData),{prerequisiteQuantity:parseInt(e)}))},labelText:"Add quantity",placeholder:"Add quantity"})})),t("div",{className:"input__wrapper"})]})),e("div",Object.assign({style:{display:"flex",gap:18}},{children:[t(n,{buttonText:"Add product",buttonType:"tertiary",LeadingIcon:j,onClick:()=>{x.setIsProductPickerOpen(s)}}),t(n,{buttonText:"Add collection",buttonType:"tertiary",LeadingIcon:j,onClick:()=>{x.setIsCollectionPickerOpen(s)}})]})),!!c.length&&e("div",Object.assign({style:{margin:"8px 0"}},{children:[t(p,{children:"Products"}),c.map((i=>e("div",Object.assign({style:{padding:"20px 0 12px 0",borderBottom:`1px solid ${u.colorsV2.stroke.primary}`,display:"flex"}},{children:[e("div",Object.assign({style:{display:"flex",gap:16,alignItems:"center",flex:.8}},{children:[t("img",{src:i.image,onError:e=>{e.target.onerror=null,e.target.src=D},style:{height:40,width:40,objectFit:"cover",borderRadius:4}}),t(p,{children:i.name})]})),t("div",Object.assign({style:{flex:.2,display:"flex",justifyContent:"flex-end",alignItems:"center"}},{children:t("div",Object.assign({style:{cursor:"pointer"},onClick:()=>{const e=c.filter((e=>e.id!==i.id));s===O.ENTITLED?x.setEntitledProducts(e):x.setPrerequisiteProducts(e)}},{children:t(g,{width:14,color:u.colorsV2.content.primary})}))}))]}),i.id)))]})),!!d.length&&e("div",Object.assign({style:{margin:"8px 0"}},{children:[t(p,{children:"Collections"}),d.map((i=>e("div",Object.assign({style:{padding:"20px 0 12px 0",borderBottom:`1px solid ${u.colorsV2.stroke.primary}`,display:"flex"}},{children:[e("div",Object.assign({style:{display:"flex",gap:16,alignItems:"center",flex:.8}},{children:[t("img",{src:i.image,onError:e=>{e.target.onerror=null,e.target.src=D},style:{height:40,width:40,objectFit:"cover",borderRadius:4}}),t(p,{children:i.name})]})),t("div",Object.assign({style:{flex:.2,display:"flex",justifyContent:"flex-end",alignItems:"center"}},{children:t("div",Object.assign({style:{cursor:"pointer"},onClick:()=>{const e=d.filter((e=>e.id!==i.id));s===O.ENTITLED?x.setEntitledCollections(e):x.setPrerequisiteCollections(e)}},{children:t(g,{width:14,color:u.colorsV2.content.primary})}))}))]}),i.id)))]}))]})};return e(b,{children:[x.allowStaticCoupon&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(o,{options:C,width:"290px",placement:"bottom-start",onSelect:e=>{x.onChangeCouponType(e)}})})),t("div",{className:"input__wrapper"})]})),(x.selectedCouponType===s.PERCENTAGE||x.selectedCouponType===s.FIXED_AMOUNT)&&(()=>{var n,a,o,r;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(m,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),t("div",Object.assign({className:"input__wrapper"},{children:t(m,{value:null===(a=null===(n=x.discountData)||void 0===n?void 0:n.value)||void 0===a?void 0:a.toString(),labelText:"Discount code value",type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:parseInt(e)}))},placeholder:x.selectedCouponType===s.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:x.selectedCouponType===s.FIXED_AMOUNT?null!==(o=x.currency)&&void 0!==o?o:"₹":void 0,suffixText:x.selectedCouponType===s.PERCENTAGE?"%":void 0})}))]})),_(),!x.hideProbability&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(m,{type:"number",value:null===(r=x.discountData.probability)||void 0===r?void 0:r.toString(),onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})})),t("div",{className:"input__wrapper"})]}))]})})(),x.selectedCouponType===s.FREE_SHIPPING&&(()=>{var n;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(m,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},labelText:"Code title",placeholder:"eg: Flat 50% Off",maxCharLimit:18})})),t("div",Object.assign({className:"input__wrapper"},{children:!x.hideProbability&&t(m,{value:null===(n=x.discountData.probability)||void 0===n?void 0:n.toString(),type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})}))]})),_()]})})(),x.selectedCouponType===s.BUY_X_GET_Y&&(()=>{var i;return e(b,{children:[t("div",Object.assign({className:"input__rows"},{children:e("div",Object.assign({style:{display:"flex",gap:20,flex:1}},{children:[t("div",Object.assign({style:{flex:1}},{children:t(m,{value:x.discountData.title,onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),!x.hideProbability&&t("div",Object.assign({style:{flex:1}},{children:t(m,{value:null===(i=x.discountData.probability)||void 0===i?void 0:i.toString(),type:"number",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})}))]}))})),t(T,{}),N(O.PREREQUISITE),t(T,{}),N(O.ENTITLED),t(T,{}),t(r,{children:"At a discount value"}),e("div",Object.assign({style:{display:"flex",gap:18,alignItems:"center"}},{children:[t(y,{isActive:100!==x.discountData.value,onValueChange:()=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:void 0}))}}),t(l,{children:"Percentage"}),100!==x.discountData.value&&t(m,{variant:"small",onChangeText:e=>{x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:parseInt(e)}))},type:"number",placeholder:"Enter percentage eg: 10%",suffixText:"%",width:"238px"})]})),e("div",Object.assign({style:{display:"flex",gap:18}},{children:[t(y,{isActive:100===x.discountData.value,onValueChange:e=>{e?x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:100})):x.setDiscountData(Object.assign(Object.assign({},x.discountData),{value:void 0}))}}),t(l,{children:"Free"})]}))]})})(),x.selectedCouponType&&!x.hideExpiration&&e(i,{children:[t("div",{style:{height:6,borderTop:`1px solid ${u.colorsV2.stroke.primary}`,marginTop:12}}),t(v,{discountData:x.discountData,setDiscountData:x.setDiscountData})]}),!x.selectedCouponType&&e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:10,padding:"40px 0",justifyContent:"center",alignItems:"center"}},{children:[t("div",Object.assign({style:{height:52,width:52,backgroundColor:u.colorsV2.background.inverse,borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center"}},{children:t(h,{width:32,color:u.colorsV2.content.primaryInverse})})),t(c,{children:"No discount has been selected"}),t(d,{children:"Please select a discount type"})]}))]})};export{O as DISCOUNT_PRODUCTS,x as default};
1
+ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{cloneDeep as s}from"lodash";import{Button as n}from"../../button/Button.js";import"react";import{DISCOUNT_TYPES as a,MIN_PURCHASE_REQUIREMENT as o,DISCOUNT_VALUE_TYPES as l}from"../type.js";import"../../dropdown/DropdownPopover/index.js";import{Dropdown as r}from"../../dropdown/Dropdown.js";import"../../dropdown/ChipDropdown.js";import"../../zeroState/ZeroState.js";import{TitleRegular as d,TitleSmall as c,TitleMedium as u,BodyPrimary as p,BodySecondary as m}from"../../TypographyStyle.js";import{DEFAULT_THEME as v}from"../../../constants/Theme.js";import"../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../checkBox/CheckBox.styled.js";import"../../list-item/ListItem.js";import"../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as b}from"../../input/Input.js";import g from"../../../assets/icons/cross.svg.js";import"../../dropdown/MenuItem/MenuItem.js";import"../../modals/styledModal.js";import"../../../node_modules/lodash.debounce/index.js";import"../../bik-layout/CommonStyles.js";import"../../product-picker/ProductPicker.styled.js";import"../../../utils/DateUtils.js";import"../../tag/Tag.js";import"@tippyjs/react";import"../../tooltips/TooltipInternal.js";import"../../spinner/Spinner.js";import"../../icon-button/IconButton.js";import"../../shimmer/ShimmerComponent/ShimmerStyled.js";import"../../product-picker-v2/emptyState.js";import"../../product-picker-v2/style.js";import"../../product-picker-v2/type.js";import{DynamicCouponContainer as D}from"../DiscountModal.styled.js";import{CouponExpiration as h}from"../CouponExpiration/CouponExpiration.js";import{RadioButton as y}from"../../radioButton/RadioButton.js";import O from"../../../assets/icons/cursor.svg.js";import T from"../../../assets/icons/plus.svg.js";const j="https://jkfenner.com/wp-content/uploads/2019/11/default.jpg";var x;function E(){return null}!function(e){e.ENTITLED="entitled",e.PREREQUISITE="prerequisite"}(x||(x={}));const _=_=>{var C;const f=[{value:a.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:_.selectedCouponType===a.AMOUNT_OFF_ORDER},{value:a.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:_.selectedCouponType===a.AMOUNT_OFF_PRODUCTS},{value:a.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:_.selectedCouponType===a.BUY_X_GET_Y},{value:a.FREE_SHIPPING,label:"Free shipping",selected:_.selectedCouponType===a.FREE_SHIPPING}],N=[{selected:_.selectedMinimumRequirement===o.NA,label:"No minimum requirements",value:o.NA},{selected:_.selectedMinimumRequirement===o.AMOUNT,label:`Minimum purchase amount (${null!==(C=_.currency)&&void 0!==C?C:"₹"})`,value:o.AMOUNT},{selected:_.selectedMinimumRequirement===o.QUANTITY,label:"Minimum quantity of items",value:o.QUANTITY}],F=()=>{var e,t,i,s,n;if(_.discountData.valueType===l.FIXED_AMOUNT){if((null===(e=_.discountData)||void 0===e?void 0:e.value)&&(null===(t=_.discountData)||void 0===t?void 0:t.value)<=0)return"Enter a valid input"}else if((null===(i=_.discountData)||void 0===i?void 0:i.value)&&((null===(s=_.discountData)||void 0===s?void 0:s.value)<=0||(null===(n=_.discountData)||void 0===n?void 0:n.value)>100))return"Enter a valid input"},I=()=>{var i,s,n,a,l;return e("div",Object.assign({className:"input__rows"},{children:[e("div",Object.assign({className:"input__wrapper"},{children:[t(m,Object.assign({style:{marginBottom:10}},{children:"Min purchase requirements"})),t(r,{options:N,placement:"bottom-start",onSelect:e=>{const t=e.value;_.setSelectedMinimumRequirement(t),_.setDiscountData(Object.assign(Object.assign({},_.discountData),{minQuantity:void 0,minAmount:void 0}))}})]})),t("div",Object.assign({className:"input__wrapper"},{children:_.selectedMinimumRequirement!==o.NA&&t(b,{value:_.selectedMinimumRequirement===o.AMOUNT?null!==(s=null===(i=_.discountData.minAmount)||void 0===i?void 0:i.toString())&&void 0!==s?s:"":null!==(a=null===(n=_.discountData.minQuantity)||void 0===n?void 0:n.toString())&&void 0!==a?a:"",onChangeText:e=>{_.selectedMinimumRequirement===o.AMOUNT?_.setDiscountData(Object.assign(Object.assign({},_.discountData),{minAmount:parseInt(e)})):_.selectedMinimumRequirement===o.QUANTITY&&_.setDiscountData(Object.assign(Object.assign({},_.discountData),{minQuantity:parseInt(e)}))},labelText:_.selectedMinimumRequirement===o.AMOUNT?"Minimum purchase amount":"Minimum purchase quantity",prefixText:_.selectedMinimumRequirement===o.AMOUNT?null!==(l=_.currency)&&void 0!==l?l:"₹":void 0,type:"number",placeholder:_.selectedMinimumRequirement===o.AMOUNT?"1000.00":"2"})}))]}))},w=(a,o)=>{var l,r,u,p;let m=[],D=[],h={},y={};return _.useNewPicker?(h=a===x.ENTITLED?_.entitledProducts:_.prerequisiteProducts,y=null!==(l=a===x.ENTITLED?_.entitledCollections:_.prerequisiteCollections)&&void 0!==l?l:[],(null==h?void 0:h.isCustom)&&delete h.isCustom,(null==y?void 0:y.isCustom)&&delete y.isCustom,Object.values(h).forEach((e=>{Object.keys(e.products).forEach((t=>{m.push({id:t,name:e.products[t].name,image:e.products[t].image})}))})),Object.keys(y).forEach((e=>{"isCustom"!==e&&D.push({id:e,name:y[e].name,image:y[e].image})}))):(m=a===x.ENTITLED?_.entitledProducts:_.prerequisiteProducts,D=null!==(r=a===x.ENTITLED?_.entitledCollections:_.prerequisiteCollections)&&void 0!==r?r:[]),e(i,{children:[!o&&e(i,{children:[t(d,{children:a===x.PREREQUISITE?"Customer buys":"Customer gets"}),e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:a===x.ENTITLED?null===(u=_.discountData.entitledQuantity)||void 0===u?void 0:u.toString():null===(p=_.discountData.prerequisiteQuantity)||void 0===p?void 0:p.toString(),type:"number",onChangeText:e=>{a===x.ENTITLED?_.setDiscountData(Object.assign(Object.assign({},_.discountData),{entitledQuantity:parseInt(e)})):_.setDiscountData(Object.assign(Object.assign({},_.discountData),{prerequisiteQuantity:parseInt(e)}))},labelText:"Add quantity",placeholder:"Add quantity"})})),t("div",{className:"input__wrapper"})]}))]}),e("div",Object.assign({style:{display:"flex",gap:18}},{children:[!(null==D?void 0:D.length)&&t(n,{buttonText:"Add product",buttonType:"tertiary",LeadingIcon:T,onClick:()=>{_.setIsProductPickerOpen(a)}}),!(null==m?void 0:m.length)&&t(n,{buttonText:"Add collection",buttonType:"tertiary",LeadingIcon:T,onClick:()=>{_.setIsCollectionPickerOpen(a)}})]})),!!m.length&&e("div",Object.assign({style:{margin:"8px 0"}},{children:[t(c,{children:"Products"}),m.map((i=>e("div",Object.assign({style:{padding:"20px 0 12px 0",borderBottom:`1px solid ${v.colorsV2.stroke.primary}`,display:"flex"}},{children:[e("div",Object.assign({style:{display:"flex",gap:16,alignItems:"center",flex:.8}},{children:[t("img",{src:i.image,onError:e=>{e.target.onerror=null,e.target.src=j},style:{height:40,width:40,objectFit:"cover",borderRadius:4}}),t(c,{children:i.name})]})),t("div",Object.assign({style:{flex:.2,display:"flex",justifyContent:"flex-end",alignItems:"center"}},{children:t("div",Object.assign({style:{cursor:"pointer"},onClick:()=>{if(_.useNewPicker){const e=s(h);Object.values(e).forEach((e=>{var t,s;(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t[i.id])&&(null===(s=null==e?void 0:e.products)||void 0===s||delete s[i.id])})),a===x.ENTITLED?_.setEntitledProducts(e):_.setPrerequisiteProducts(e)}else{const e=m.filter((e=>e.id!==i.id));a===x.ENTITLED?_.setEntitledProducts(e):_.setPrerequisiteProducts(e)}}},{children:t(g,{width:14,color:v.colorsV2.content.primary})}))}))]}),i.id)))]})),!!D.length&&e("div",Object.assign({style:{margin:"8px 0"}},{children:[t(c,{children:"Collections"}),D.map((i=>e("div",Object.assign({style:{padding:"20px 0 12px 0",borderBottom:`1px solid ${v.colorsV2.stroke.primary}`,display:"flex"}},{children:[e("div",Object.assign({style:{display:"flex",gap:16,alignItems:"center",flex:.8}},{children:[t("img",{src:i.image,onError:e=>{e.target.onerror=null,e.target.src=j},style:{height:40,width:40,objectFit:"cover",borderRadius:4}}),t(c,{children:i.name})]})),t("div",Object.assign({style:{flex:.2,display:"flex",justifyContent:"flex-end",alignItems:"center"}},{children:t("div",Object.assign({style:{cursor:"pointer"},onClick:()=>{if(_.useNewPicker){const e=s(y);delete e[i.id],a===x.ENTITLED?_.setEntitledCollections(e):_.setPrerequisiteCollections(e)}else{const e=D.filter((e=>e.id!==i.id));a===x.ENTITLED?_.setEntitledCollections(e):_.setPrerequisiteCollections(e)}}},{children:t(g,{width:14,color:v.colorsV2.content.primary})}))}))]}),i.id)))]}))]})};return e(D,{children:[_.allowStaticCoupon&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(r,{options:f,width:"338px",placement:"bottom-start",onSelect:e=>{_.onChangeCouponType(e)}})})),t("div",Object.assign({className:"input__wrapper",style:{display:"flex",alignItems:"center",gap:8}},{children:(_.selectedCouponType===a.AMOUNT_OFF_PRODUCTS||_.selectedCouponType===a.AMOUNT_OFF_ORDER)&&e(i,{children:[t(y,{isActive:_.discountData.valueType===l.FIXED_AMOUNT,onValueChange:()=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{valueType:l.FIXED_AMOUNT,value:void 0}))},label:"Fixed amount"}),t(y,{isActive:_.discountData.valueType===l.PERCENTAGE,onValueChange:()=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{valueType:l.PERCENTAGE,value:void 0}))},label:"Percentage"})]})}))]})),_.selectedCouponType===a.AMOUNT_OFF_ORDER&&(()=>{var s,n,a,o,r;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:_.discountData.title,onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{title:e.trim()}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:null!==(a=null===(n=null===(s=_.discountData)||void 0===s?void 0:s.value)||void 0===n?void 0:n.toString())&&void 0!==a?a:"",labelText:"Discount code value",type:"number",errorMessage:F(),onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{value:parseInt(e)}))},placeholder:_.discountData.valueType===l.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:_.discountData.valueType===l.FIXED_AMOUNT?null!==(o=_.currency)&&void 0!==o?o:"₹":void 0,suffixText:_.discountData.valueType===l.PERCENTAGE?"%":void 0})}))]})),I(),!_.hideProbability&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{type:"number",value:null===(r=_.discountData.probability)||void 0===r?void 0:r.toString(),onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})})),t("div",{className:"input__wrapper"})]}))]})})(),_.selectedCouponType===a.AMOUNT_OFF_PRODUCTS&&(()=>{var s,n,a,o,r;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:_.discountData.title,onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{title:e.trim()}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:null!==(a=null===(n=null===(s=_.discountData)||void 0===s?void 0:s.value)||void 0===n?void 0:n.toString())&&void 0!==a?a:"",labelText:"Discount code value",type:"number",errorMessage:F(),onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{value:parseInt(e)}))},placeholder:_.discountData.valueType===l.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:_.discountData.valueType===l.FIXED_AMOUNT?null!==(o=_.currency)&&void 0!==o?o:"₹":void 0,suffixText:_.discountData.valueType===l.PERCENTAGE?"%":void 0})}))]})),w(x.ENTITLED,!0),!_.hideProbability&&e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{type:"number",value:null===(r=_.discountData.probability)||void 0===r?void 0:r.toString(),onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})})),t("div",{className:"input__wrapper"})]}))]})})(),_.selectedCouponType===a.FREE_SHIPPING&&(()=>{var s;return e(i,{children:[e("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(b,{value:_.discountData.title,onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{title:e.trim()}))},labelText:"Code title",placeholder:"eg: Flat 50% Off",maxCharLimit:18})})),t("div",Object.assign({className:"input__wrapper"},{children:!_.hideProbability&&t(b,{value:null===(s=_.discountData.probability)||void 0===s?void 0:s.toString(),type:"number",onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})}))]})),I()]})})(),_.selectedCouponType===a.BUY_X_GET_Y&&(()=>{var i,s,n,a;return e(D,{children:[t("div",Object.assign({className:"input__rows"},{children:e("div",Object.assign({style:{display:"flex",gap:20,flex:1}},{children:[t("div",Object.assign({style:{flex:1}},{children:t(b,{value:_.discountData.title,onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{title:e.trim()}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),!_.hideProbability&&t("div",Object.assign({style:{flex:1}},{children:t(b,{value:null===(i=_.discountData.probability)||void 0===i?void 0:i.toString(),type:"number",onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})}))]}))})),t(E,{}),w(x.PREREQUISITE),t(E,{}),w(x.ENTITLED),t(E,{}),t(d,{children:"At a discount value"}),e("div",Object.assign({style:{display:"flex",gap:18,alignItems:"flex-start"}},{children:[t(y,{label:"Percentage",isActive:100!==_.discountData.value,onValueChange:()=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{value:void 0}))}}),100!==_.discountData.value&&t(b,{variant:"small",value:null!==(a=null===(n=null===(s=_.discountData)||void 0===s?void 0:s.value)||void 0===n?void 0:n.toString())&&void 0!==a?a:"",onChangeText:e=>{_.setDiscountData(Object.assign(Object.assign({},_.discountData),{value:parseInt(e)}))},errorMessage:F(),type:"number",placeholder:"Enter percentage eg: 10%",suffixText:"%",width:"238px"})]})),t("div",{children:t(y,{label:"Free",isActive:100===_.discountData.value,onValueChange:e=>{e?_.setDiscountData(Object.assign(Object.assign({},_.discountData),{value:100})):_.setDiscountData(Object.assign(Object.assign({},_.discountData),{value:void 0}))}})})]})})(),_.selectedCouponType&&!_.hideExpiration&&e(i,{children:[t("div",{style:_.selectedCouponType!==a.BUY_X_GET_Y&&_.selectedCouponType!==a.AMOUNT_OFF_PRODUCTS||!_.hideProbability?{height:6,borderTop:`1px solid ${v.colorsV2.stroke.primary}`,marginTop:12}:{}}),t(h,{discountData:_.discountData,setDiscountData:_.setDiscountData})]}),!_.selectedCouponType&&e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:10,padding:"40px 0",justifyContent:"center",alignItems:"center"}},{children:[t("div",Object.assign({style:{height:52,width:52,backgroundColor:v.colorsV2.background.inverse,borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center"}},{children:t(O,{width:32,color:v.colorsV2.content.primaryInverse})})),t(u,{children:"No discount has been selected"}),t(p,{children:"Please select a discount type"})]}))]})};export{x as DISCOUNT_PRODUCTS,_ as default};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import i from"../../../assets/icons/info.svg.js";import{Input as a}from"../../input/Input.js";import{BodySecondaryLink as o,BodySecondary as n}from"../../TypographyStyle.js";import{DEFAULT_THEME as s}from"../../../constants/Theme.js";import{StaticCouponContainerStyled as c}from"../DiscountModal.styled.js";const r=r=>t(c,{children:[t("div",Object.assign({className:"static-coupon__data"},{children:[e("div",Object.assign({className:"static-input__wrapper"},{children:e(a,{onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{couponCode:t}))},labelText:"Coupon code",value:r.discountData.couponCode,placeholder:"Enter code created on shopify"})})),e("div",Object.assign({className:"static-input__wrapper"},{children:e(a,{maxCharLimit:18,labelText:"Coupon title",value:r.discountData.title,onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{title:t}))},placeholder:"Enter coupon title"})}))]})),e(a,{labelText:"Coupon description",value:r.discountData.description,onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{description:t}))},placeholder:"Enter coupon description"}),!r.hideProbability&&e(a,{labelText:"Probability",value:r.discountData.probability?r.discountData.probability.toString():"",onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{probability:t.startsWith(".")?parseFloat(`0${t}`):parseFloat(t)}))},placeholder:"Enter probability in decimals (0 - 1)"}),r.discountAdminUrl&&t("div",Object.assign({className:"info__container"},{children:[e(i,{height:18,width:18,color:s.colorsV2.content.secondary}),e(o,Object.assign({onClick:()=>{window.open(r.discountAdminUrl,"_blank")}},{children:"Click here"})),e(n,{children:"to create discount code on Shopify"})]}))]});export{r as default};
1
+ import{jsxs as t,jsx as i}from"react/jsx-runtime";import e from"../../../assets/icons/info.svg.js";import{Input as o}from"../../input/Input.js";import{BodySecondaryLink as a,BodySecondary as n}from"../../TypographyStyle.js";import{DEFAULT_THEME as s}from"../../../constants/Theme.js";import{StaticCouponContainerStyled as c}from"../DiscountModal.styled.js";const r=r=>t(c,{children:[t("div",Object.assign({className:"static-coupon__data"},{children:[i("div",Object.assign({className:"static-input__wrapper"},{children:i(o,{onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{couponCode:null==t?void 0:t.trim()}))},labelText:"Coupon code",value:r.discountData.couponCode,placeholder:"Enter code created on shopify"})})),i("div",Object.assign({className:"static-input__wrapper"},{children:i(o,{maxCharLimit:18,labelText:"Coupon title",value:r.discountData.title,onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{title:null==t?void 0:t.trim()}))},placeholder:"Enter coupon title"})}))]})),i(o,{labelText:"Coupon description",value:r.discountData.description,onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{description:null==t?void 0:t.trim()}))},placeholder:"Enter coupon description"}),!r.hideProbability&&i(o,{labelText:"Probability",value:r.discountData.probability?r.discountData.probability.toString():"",onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{probability:t.startsWith(".")?parseFloat(parseFloat(`0${t}`).toFixed(2)):parseFloat(parseFloat(t).toFixed(2))}))},placeholder:"Enter probability in decimals (0 - 1)"}),r.discountAdminUrl&&t("div",Object.assign({className:"info__container"},{children:[i(e,{height:18,width:18,color:s.colorsV2.content.secondary}),i(a,Object.assign({onClick:()=>{window.open(r.discountAdminUrl,"_blank")}},{children:"Click here"})),i(n,{children:"to create discount code on Shopify"})]}))]});export{r as default};
@@ -1,3 +1,4 @@
1
+ import { SelectedItems } from '../product-picker-v2';
1
2
  export declare enum MIN_PURCHASE_REQUIREMENT {
2
3
  AMOUNT = "amount",
3
4
  QUANTITY = "quantity",
@@ -16,8 +17,8 @@ export declare enum DISCOUNT_TARGET_SELECTION {
16
17
  ALL = "all"
17
18
  }
18
19
  export declare enum DISCOUNT_TYPES {
19
- FIXED_AMOUNT = "fixedAmount",
20
- PERCENTAGE = "percentage",
20
+ AMOUNT_OFF_PRODUCTS = "amountOffProducts",
21
+ AMOUNT_OFF_ORDER = "amountOffOrder",
21
22
  BUY_X_GET_Y = "buyXGetY",
22
23
  FREE_SHIPPING = "freeShipping"
23
24
  }
@@ -46,4 +47,12 @@ export interface ICouponData {
46
47
  entitledQuantity?: number;
47
48
  minPurchaseReq?: MIN_PURCHASE_REQUIREMENT;
48
49
  probability?: number;
50
+ productsConf?: {
51
+ entitledProducts: SelectedItems;
52
+ prerequisiteProducts: SelectedItems;
53
+ };
54
+ collectionsConf?: {
55
+ entitledCollections: SelectedItems;
56
+ prerequisiteCollections: SelectedItems;
57
+ };
49
58
  }
@@ -1 +1 @@
1
- var n,e,t,E,i;!function(n){n.AMOUNT="amount",n.QUANTITY="quantity",n.NA="na"}(n||(n={})),function(n){n.FIXED_AMOUNT="fixedAmount",n.PERCENTAGE="percentage"}(e||(e={})),function(n){n.LINE_ITEM="lineItem",n.SHIPPING_LINE="shippingLine"}(t||(t={})),function(n){n.ENTITLED="entitled",n.ALL="all"}(E||(E={})),function(n){n.FIXED_AMOUNT="fixedAmount",n.PERCENTAGE="percentage",n.BUY_X_GET_Y="buyXGetY",n.FREE_SHIPPING="freeShipping"}(i||(i={}));export{E as DISCOUNT_TARGET_SELECTION,t as DISCOUNT_TARGET_TYPES,i as DISCOUNT_TYPES,e as DISCOUNT_VALUE_TYPES,n as MIN_PURCHASE_REQUIREMENT};
1
+ var n,t,e,i,E;!function(n){n.AMOUNT="amount",n.QUANTITY="quantity",n.NA="na"}(n||(n={})),function(n){n.FIXED_AMOUNT="fixedAmount",n.PERCENTAGE="percentage"}(t||(t={})),function(n){n.LINE_ITEM="lineItem",n.SHIPPING_LINE="shippingLine"}(e||(e={})),function(n){n.ENTITLED="entitled",n.ALL="all"}(i||(i={})),function(n){n.AMOUNT_OFF_PRODUCTS="amountOffProducts",n.AMOUNT_OFF_ORDER="amountOffOrder",n.BUY_X_GET_Y="buyXGetY",n.FREE_SHIPPING="freeShipping"}(E||(E={}));export{i as DISCOUNT_TARGET_SELECTION,e as DISCOUNT_TARGET_TYPES,E as DISCOUNT_TYPES,t as DISCOUNT_VALUE_TYPES,n as MIN_PURCHASE_REQUIREMENT};
@@ -1 +1 @@
1
- import{jsx as p}from"react/jsx-runtime";const x={z1:{up:"0px -2px 8px rgba(0, 0, 0, 0.12)",down:"0px 2px 8px rgba(0, 0, 0, 0.12)"},z2:{up:"0px -4px 12px rgba(0, 0, 0, 0.12)",down:"0px 4px 12px rgba(0, 0, 0, 0.12)"}},e=({level:e="z1",position:n="down",children:r,style:t})=>{const o=x[e][n];return p("div",Object.assign({style:Object.assign({boxShadow:o},null!=t?t:{})},{children:r}))};export{e as default};
1
+ import{jsx as p}from"react/jsx-runtime";const x={z1:{up:"0px -2px 8px rgba(0, 0, 0, 0.12)",down:"0px 2px 8px rgba(0, 0, 0, 0.12)"},z2:{up:"0px -4px 12px rgba(0, 0, 0, 0.12)",down:"0px 4px 12px rgba(0, 0, 0, 0.12)"}},e=e=>{let{level:t="z1",position:n="down",children:r,style:o}=e;const s=x[t][n];return p("div",Object.assign({style:Object.assign({boxShadow:s},null!=o?o:{})},{children:r}))};export{e as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useRef as r,useEffect as i}from"react";import{ZeroState as n}from"../../../zeroState/ZeroState.js";import{useOutside as l}from"../../../../hooks/useOutside.js";import{useDropdown as s}from"../../hooks/useDropdown.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as p}from"./menu/MenuList.js";import{SelectAllMenu as u}from"./menu/SelectAllMenu.js";import d from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as h,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as f}from"./searchbox/SearchBox.js";import{SearchZeroState as S}from"./searchbox/SearchZeroState.js";const g=304,v=290,b=({options:b,isSearchable:j,isMultiSelect:w,width:y,allowFreeForm:x,height:O,onClose:C,onSelect:M,onSearch:D,version:L,skipSorting:F})=>{const{dropdownOptions:k,search:A,searchedString:H,searchedOptions:B,onApplyHandler:Z,selectAllHandler:q,onMultiSelectClear:z,onFreeFormSelect:I,onMultiSelectApply:K,latestDropdownOptionsRef:N,getSelectedOptions:P}=s(L,b,M,F,w,D),[R,T]=o(null!=y?y:v),[W,E]=o(null),G=r(null);l(G,(()=>{if(E(null),w&&"2.0"===L){const e=P(N.current);null==C||C(e)}else null==C||C(k)}));const J=null!=O?O:g,Q="number"==typeof J?j&&w?J-96:j&&!w||!j&&w?J-48:J:J;i((()=>{const e=null!=y?y:v;if(null===W)T(e);else if("number"==typeof e)T(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));T(t)}}),[W]);const U=[],V=(H&&D?B:k).map((e=>{var t,o;if(H&&!D){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(H.toLowerCase()))&&(U.push(!H||e.label===H),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(H.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(H.toLowerCase()))?(U.push(!H||e.label===H),e):null}return e})).filter((e=>null!==e)),X=!!j&&H&&0===V.length;return e(h,Object.assign({version:L,ref:G,style:{width:R}},{children:[e("div",Object.assign({style:{width:W?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!j&&t(f,{onSearch:A,version:L}),V.length||H?e(m,Object.assign({minHeight:J,maxHeight:Q},{children:[!!w&&!X&&t(u,{version:L,options:H&&D?B:k,onSelect:q}),!x&&X&&t(S,{height:Q,searchedString:H}),x&&(X||!!U.length&&U.every((e=>!1===e)))&&t(a,{version:L,isMultiSelect:w,onSelect:I,searchedString:H}),t(p,{version:L,onSelect:Z,showDescription:function(e,t){E(e&&t?{title:e,description:t}:null)},isMultiSelect:w,options:V})]})):t("div",Object.assign({style:{height:J,display:"flex"}},{children:t(n,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!w&&!(!V.length&&!H)&&"2.0"!==L&&t(d,{onClear:z,onApply:K,list:H&&D?B:k})]})),!!W&&t(c,{title:W.title,description:W.description,version:L})]}))};export{b as OpenedDropdown};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useRef as r,useEffect as i}from"react";import{ZeroState as n}from"../../../zeroState/ZeroState.js";import{useOutside as l}from"../../../../hooks/useOutside.js";import{useDropdown as s}from"../../hooks/useDropdown.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as p}from"./menu/MenuList.js";import{SelectAllMenu as u}from"./menu/SelectAllMenu.js";import d from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as h,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as f}from"./searchbox/SearchBox.js";import{SearchZeroState as S}from"./searchbox/SearchZeroState.js";const g=304,v=290,b=b=>{let{options:j,isSearchable:w,isMultiSelect:y,width:x,allowFreeForm:O,height:C,onClose:M,onSelect:D,onSearch:L,version:F,skipSorting:k}=b;const{dropdownOptions:A,search:H,searchedString:B,searchedOptions:Z,onApplyHandler:q,selectAllHandler:z,onMultiSelectClear:I,onFreeFormSelect:K,onMultiSelectApply:N,latestDropdownOptionsRef:P,getSelectedOptions:R}=s(F,j,D,k,y,L),[T,W]=o(null!=x?x:v),[E,G]=o(null),J=r(null);l(J,(()=>{if(G(null),y&&"2.0"===F){const e=R(P.current);null==M||M(e)}else null==M||M(A)}));const Q=null!=C?C:g,U="number"==typeof Q?w&&y?Q-96:w&&!y||!w&&y?Q-48:Q:Q;i((()=>{const e=null!=x?x:v;if(null===E)W(e);else if("number"==typeof e)W(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));W(t)}}),[E]);const V=[],X=(B&&L?Z:A).map((e=>{var t,o;if(B&&!L){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))&&(V.push(!B||e.label===B),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(B.toLowerCase()))?(V.push(!B||e.label===B),e):null}return e})).filter((e=>null!==e)),Y=!!w&&B&&0===X.length;return e(h,Object.assign({version:F,ref:J,style:{width:T}},{children:[e("div",Object.assign({style:{width:E?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!w&&t(f,{onSearch:H,version:F}),X.length||B?e(m,Object.assign({minHeight:Q,maxHeight:U},{children:[!!y&&!Y&&t(u,{version:F,options:B&&L?Z:A,onSelect:z}),!O&&Y&&t(S,{height:U,searchedString:B}),O&&(Y||!!V.length&&V.every((e=>!1===e)))&&t(a,{version:F,isMultiSelect:y,onSelect:K,searchedString:B}),t(p,{version:F,onSelect:q,showDescription:function(e,t){G(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:X})]})):t("div",Object.assign({style:{height:Q,display:"flex"}},{children:t(n,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!y&&!(!X.length&&!B)&&"2.0"!==F&&t(d,{onClear:I,onApply:N,list:B&&L?Z:A})]})),!!E&&t(c,{title:E.title,description:E.description,version:F})]}))};export{b as OpenedDropdown};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{TitleRegular as r,BodySecondary as o}from"../../../../TypographyStyle.js";import{COLORS as i}from"../../../../../constants/Theme.js";import{DescriptionContainer as s}from"./Description.styled.js";const n=({title:n,description:c,version:m})=>t(s,Object.assign({version:m},{children:e("div",Object.assign({style:{padding:"2.0"===m?12:24}},{children:[t(r,Object.assign({style:{color:i.content.primary,marginBottom:4}},{children:n})),t(o,Object.assign({style:{color:i.content.secondary}},{children:c}))]}))}));export{n as Description};
1
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{TitleRegular as r,BodySecondary as o}from"../../../../TypographyStyle.js";import{COLORS as i}from"../../../../../constants/Theme.js";import{DescriptionContainer as n}from"./Description.styled.js";const s=s=>{let{title:c,description:l,version:m}=s;return t(n,Object.assign({version:m},{children:e("div",Object.assign({style:{padding:"2.0"===m?12:24}},{children:[t(r,Object.assign({style:{color:i.content.primary,marginBottom:4}},{children:c})),t(o,Object.assign({style:{color:i.content.secondary}},{children:l}))]}))}))};export{s as Description};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t}from"react/jsx-runtime";import{useState as o}from"react";import{CheckBox as r}from"../../../../checkBox/CheckBox.js";import{ListItem as i}from"../../../../list-item/ListItem.js";import{BodyCaption as n}from"../../../../TypographyStyle.js";import{COLORS as s}from"../../../../../constants/Theme.js";import{FreeFormContainer as c}from"./FreeFormMenu.styled.js";const m=({searchedString:m,onSelect:l,isMultiSelect:a,version:p})=>{const[f,h]=o(!1);function u(){h(!f),l(!f)}return e(i,{version:p,onClick:e=>{e.preventDefault(),u()},listItem:{label:m,value:m},leadingIcon:a?e(r,{size:"2.0"===p?"SMALL":"DEFAULT",isChecked:f,onValueChange:u}):e(t,{}),trailingIcon:e(c,{children:e(n,Object.assign({style:{color:s.content.secondary}},{children:"Freeform"}))})})};export{m as FreeFormMenu};
1
+ import{jsx as e,Fragment as t}from"react/jsx-runtime";import{useState as o}from"react";import{CheckBox as r}from"../../../../checkBox/CheckBox.js";import{ListItem as i}from"../../../../list-item/ListItem.js";import{BodyCaption as n}from"../../../../TypographyStyle.js";import{COLORS as s}from"../../../../../constants/Theme.js";import{FreeFormContainer as c}from"./FreeFormMenu.styled.js";const m=m=>{let{searchedString:l,onSelect:a,isMultiSelect:p,version:f}=m;const[h,u]=o(!1);function d(){u(!h),a(!h)}return e(i,{version:f,onClick:e=>{e.preventDefault(),d()},listItem:{label:l,value:l},leadingIcon:p?e(r,{size:"2.0"===f?"SMALL":"DEFAULT",isChecked:h,onValueChange:d}):e(t,{}),trailingIcon:e(c,{children:e(n,Object.assign({style:{color:s.content.secondary}},{children:"Freeform"}))})})};export{m as FreeFormMenu};
@@ -2,4 +2,4 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import i from"st
2
2
  padding: ${e=>"2.0"===e.version?"8px 12px":"14px 16px"} !important;
3
3
  cursor: pointer;
4
4
  margin-top: ${e=>"2.0"===e.version?"2px":"0"};
5
- `,d=({option:i,isMultiSelect:s,showDescription:d,onSelect:m,last:p,version:g})=>{var u;function b(e){i.disabled||m(Object.assign(Object.assign({},i),{selected:e}))}return e(a,{version:g,style:p?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),b(!i.selected)},onMouseOver:function(){i.description?d(i.label,i.description):d()},listItem:{value:i.value,label:i.label},subText:i.subText,leadingIcon:s?t("div",Object.assign({style:{display:"flex",alignContent:"center",justifyContent:"center",gap:8}},{children:[e(o,{size:"2.0"===g?"SMALL":"DEFAULT",isDisabled:null!==(u=i.disabled)&&void 0!==u&&u,isChecked:!!i.selected,onValueChange:b}),e("div",Object.assign({style:{marginRight:"-4px"}},{children:i.leadingIcon}))]})):i.leadingIcon?e(n,{children:i.leadingIcon}):e(n,{}),customComponent:i.customComponent,trailingIcon:i.isFreeForm?e(c,{children:e(r,Object.assign({style:{color:l.content.secondary}},{children:"Freeform"}))}):i.trailingIcon?e(n,{children:i.trailingIcon}):e(n,{}),variant:i.disabled?"inactive":i.selected?"selected":"default"})};export{d as MenuItem};
5
+ `,d=i=>{let{option:s,isMultiSelect:d,showDescription:m,onSelect:p,last:g,version:u}=i;var b;function f(e){s.disabled||p(Object.assign(Object.assign({},s),{selected:e}))}return e(a,{version:u,style:g?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),f(!s.selected)},onMouseOver:function(){s.description?m(s.label,s.description):m()},listItem:{value:s.value,label:s.label},subText:s.subText,leadingIcon:d?t("div",Object.assign({style:{display:"flex",alignContent:"center",justifyContent:"center",gap:8}},{children:[e(o,{size:"2.0"===u?"SMALL":"DEFAULT",isDisabled:null!==(b=s.disabled)&&void 0!==b&&b,isChecked:!!s.selected,onValueChange:f}),e("div",Object.assign({style:{marginRight:"-4px"}},{children:s.leadingIcon}))]})):s.leadingIcon?e(n,{children:s.leadingIcon}):e(n,{}),customComponent:s.customComponent,trailingIcon:s.isFreeForm?e(c,{children:e(r,Object.assign({style:{color:l.content.secondary}},{children:"Freeform"}))}):s.trailingIcon?e(n,{children:s.trailingIcon}):e(n,{}),variant:s.disabled?"inactive":s.selected?"selected":"default"})};export{d as MenuItem};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{MenuItem as n}from"./MenuItem.js";import{StyledGroupedLabel as o}from"./MenuList.styled.js";const s=({options:s,isMultiSelect:r,showDescription:l,onSelect:c,version:p})=>e(t,{children:s.map(((a,m)=>{const g=m===s.length-1;if(a.options){const s=a;return i("div",Object.assign({style:{marginTop:"2.0"===p?2:0}},{children:[i(o,Object.assign({version:p},{children:[s.leadingIcon?e("span",Object.assign({style:{marginRight:8}},{children:s.leadingIcon})):e(t,{}),s.label]})),s.options.map(((t,i)=>e(n,{version:p,last:i===s.options.length-1,onSelect:c,showDescription:l,isMultiSelect:r,option:t},`${m}-${i}`)))]}),m)}return e(n,{version:p,last:g,onSelect:c,showDescription:l,isMultiSelect:r,option:a},m)}))});export{s as MenuList};
1
+ import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{MenuItem as n}from"./MenuItem.js";import{StyledGroupedLabel as o}from"./MenuList.styled.js";const s=s=>{let{options:r,isMultiSelect:l,showDescription:c,onSelect:p,version:a}=s;return e(t,{children:r.map(((s,m)=>{const g=m===r.length-1;if(s.options){const r=s;return i("div",Object.assign({style:{marginTop:"2.0"===a?2:0}},{children:[i(o,Object.assign({version:a},{children:[r.leadingIcon?e("span",Object.assign({style:{marginRight:8}},{children:r.leadingIcon})):e(t,{}),r.label]})),r.options.map(((t,i)=>e(n,{version:a,last:i===r.options.length-1,onSelect:p,showDescription:c,isMultiSelect:l,option:t},`${m}-${i}`)))]}),m)}return e(n,{version:a,last:g,onSelect:p,showDescription:c,isMultiSelect:l,option:s},m)}))})};export{s as MenuList};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as l}from"react";import{CheckBox as o}from"../../../../checkBox/CheckBox.js";import{ListItem as i}from"../../../../list-item/ListItem.js";const c=({options:c,onSelect:n,version:r})=>{const[s,a]=t("notSelected");function d(){"partiallySelected"===s&&n("notSelected"),"selectAll"===s&&n("notSelected"),"notSelected"===s&&n("selectAll")}return l((()=>{const e=[];c.filter((e=>!e.disabled)).forEach((t=>{t.options?t.options.filter((e=>!e.disabled)).forEach((t=>{e.push(t.selected||!1)})):e.push(t.selected||!1)})),e.every(Boolean)?a("selectAll"):e.filter(Boolean).length>0?a("partiallySelected"):a("notSelected")}),[c]),e(i,{version:r,onClick:e=>{e.preventDefault(),d()},listItem:{label:"Select All",value:"All"},leadingIcon:e("div",Object.assign({style:{width:18}},{children:e(o,{size:"2.0"===r?"SMALL":"DEFAULT",isChecked:"selectAll"===s||"partiallySelected"===s,isPartiallyChecked:"partiallySelected"===s,onValueChange:d})})),variant:"default"})};export{c as SelectAllMenu};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as l}from"react";import{CheckBox as o}from"../../../../checkBox/CheckBox.js";import{ListItem as i}from"../../../../list-item/ListItem.js";const c=c=>{let{options:n,onSelect:r,version:s}=c;const[a,d]=t("notSelected");function p(){"partiallySelected"===a&&r("notSelected"),"selectAll"===a&&r("notSelected"),"notSelected"===a&&r("selectAll")}return l((()=>{const e=[];n.filter((e=>!e.disabled)).forEach((t=>{t.options?t.options.filter((e=>!e.disabled)).forEach((t=>{e.push(t.selected||!1)})):e.push(t.selected||!1)})),e.every(Boolean)?d("selectAll"):e.filter(Boolean).length>0?d("partiallySelected"):d("notSelected")}),[n]),e(i,{version:s,onClick:e=>{e.preventDefault(),p()},listItem:{label:"Select All",value:"All"},leadingIcon:e("div",Object.assign({style:{width:18}},{children:e(o,{size:"2.0"===s?"SMALL":"DEFAULT",isChecked:"selectAll"===a||"partiallySelected"===a,isPartiallyChecked:"partiallySelected"===a,onValueChange:p})})),variant:"default"})};export{c as SelectAllMenu};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Button as o}from"../../../../button/Button.js";import{BodySecondary as r}from"../../../../TypographyStyle.js";import{COLORS as n}from"../../../../../constants/Theme.js";import{BottomBarContainer as s}from"./MultiSelectDropdownBottomBar.styled.js";const l=({onApply:l,onClear:i,list:c})=>{const p=c.reduce(((t,e)=>{if(e.options){return t+e.options.filter((t=>!0===t.selected)).length}return e.selected?t+1:t}),0);return t(s,Object.assign({style:{justifyContent:"space-between"}},{children:[e(r,Object.assign({style:{flex:1,color:n.content.primary}},{children:p?`${p} selected`:""})),t("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12}},{children:[e(o,{size:"small",buttonType:"tertiaryGray",buttonText:"Clear",onClick:i}),e(o,{size:"small",buttonText:"Apply",onClick:()=>{l()}})]}))]}))};export{l as default};
1
+ import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Button as o}from"../../../../button/Button.js";import{BodySecondary as r}from"../../../../TypographyStyle.js";import{COLORS as l}from"../../../../../constants/Theme.js";import{BottomBarContainer as n}from"./MultiSelectDropdownBottomBar.styled.js";const s=s=>{let{onApply:i,onClear:c,list:p}=s;const a=p.reduce(((t,e)=>{if(e.options){return t+e.options.filter((t=>!0===t.selected)).length}return e.selected?t+1:t}),0);return t(n,Object.assign({style:{justifyContent:"space-between"}},{children:[e(r,Object.assign({style:{flex:1,color:l.content.primary}},{children:a?`${a} selected`:""})),t("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12}},{children:[e(o,{size:"small",buttonType:"tertiaryGray",buttonText:"Clear",onClick:c}),e(o,{size:"small",buttonText:"Apply",onClick:()=>{i()}})]}))]}))};export{s as default};
@@ -1 +1 @@
1
- import{jsx as o,Fragment as r}from"react/jsx-runtime";import{useState as t}from"react";import{Input as e}from"../../../../input/Input.js";import{InputStyleContext as n}from"../../../../input/context/InputStyleProvider.js";import{COLORS as i}from"../../../../../constants/Theme.js";import s from"../../../../../assets/icons/cross.svg.js";import c from"../../../../../assets/icons/search.svg.js";const p=({onSearch:p,version:a})=>{const[m,h]=t(""),[l,d]=t(!1);return o(n.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:`${"2.0"===a?.5:1}px solid ${i.stroke.primary}`,padding:""+("2.0"===a?"6px 8px":"14px 16px"),marginBottom:4},IconHolder:{marginLeft:0},input:{marginLeft:4,minHeight:"100%"}}},{children:o(e,{noKeyDownChange:!0,skipFocus:!0,placeholder:"Search",variant:"2.0"===a?"small":"default",leftIcon:{icon:()=>o(c,{width:"2.0"===a?18:24,height:"2.0"===a?18:24,color:i.content.placeholder})},rightIcon:{icon:()=>m?o(s,{onClick:()=>{d(!0),p(""),h("")},width:24,height:24,color:i.content.placeholder}):o(r,{})},reset:l,onChangeText:o=>{d(!1),h(o),p(o)}})}))};export{p as SearchBox};
1
+ import{jsx as o,Fragment as r}from"react/jsx-runtime";import{useState as t}from"react";import{Input as e}from"../../../../input/Input.js";import{InputStyleContext as n}from"../../../../input/context/InputStyleProvider.js";import{COLORS as i}from"../../../../../constants/Theme.js";import s from"../../../../../assets/icons/cross.svg.js";import c from"../../../../../assets/icons/search.svg.js";const p=p=>{let{onSearch:a,version:m}=p;const[l,h]=t(""),[d,g]=t(!1);return o(n.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:`${"2.0"===m?.5:1}px solid ${i.stroke.primary}`,padding:""+("2.0"===m?"6px 8px":"14px 16px"),marginBottom:4},IconHolder:{marginLeft:0},input:{marginLeft:4,minHeight:"100%"}}},{children:o(e,{noKeyDownChange:!0,skipFocus:!0,placeholder:"Search",variant:"2.0"===m?"small":"default",leftIcon:{icon:()=>o(c,{width:"2.0"===m?18:24,height:"2.0"===m?18:24,color:i.content.placeholder})},rightIcon:{icon:()=>l?o(s,{onClick:()=>{g(!0),a(""),h("")},width:24,height:24,color:i.content.placeholder}):o(r,{})},reset:d,onChangeText:o=>{g(!1),h(o),a(o)}})}))};export{p as SearchBox};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{ZeroState as t}from"../../../../zeroState/ZeroState.js";const r=({searchedString:r,height:i})=>e("div",Object.assign({style:{height:i,display:"flex",alignItems:"center"}},{children:e(t,{title:"No results found",subTitle:`Sorry we could not find any results for "${null!=r?r:""}"`})}));export{r as SearchZeroState};
1
+ import{jsx as e}from"react/jsx-runtime";import{ZeroState as t}from"../../../../zeroState/ZeroState.js";const r=r=>{let{searchedString:i,height:o}=r;return e("div",Object.assign({style:{height:o,display:"flex",alignItems:"center"}},{children:e(t,{title:"No results found",subTitle:`Sorry we could not find any results for "${null!=i?i:""}"`})}))};export{r as SearchZeroState};
@@ -1 +1 @@
1
- import{useState as e,useRef as t,useEffect as s}from"react";import{iterateOnOptionsRaw as l,iterateOnOptions as n}from"../OpenedDropdown/utils/iterationOnOptions.js";const c=(c="1.0",o,i,a,u,r)=>{const[d,p]=e(null!=o?o:[]),[f,v]=e([]),[b,O]=e(""),g=t(d);s((()=>{if(g.current=d,f.length&&b&&r){let e=[...f];const t=d.map((e=>e.options?e.options.map((e=>({value:e.value,selected:e.selected}))):{value:e.value,selected:e.selected})).flat();e=e.map((e=>{const s=t.find((t=>e.value===t.value));return s?Object.assign(Object.assign({},e),{selected:s.selected}):e})),v([...e])}}),[d]),s((()=>{if(o){const e=[...o];p(u&&!a?[...e.sort((e=>e.selected?-1:1))]:[...e])}}),[o]);const j=e=>{const t=[];return e.forEach((e=>{if(e.options){const s=e.options.filter((e=>!0===e.selected));t.push(Object.assign(Object.assign({},e),{options:[...s]}))}else e.selected&&t.push(Object.assign({},e))})),t};function h(e,t){if(u)if(f.length&&b&&r)if(e.selected){let s=!1;const l=n(d,{selected:e.selected},(t=>t.value===e.value&&(s=!0,!0)));if(s||l.push(e),t)return[...l];p([...l]),"2.0"===c&&m(l)}else{let s=!1,l=n(d,{selected:e.selected},(t=>t.value===e.value&&(s=!0,!0)));if(s&&(l=l.filter((t=>t.value!==e.value))),t)return[...l];p([...l]),"2.0"===c&&m(l)}else{const s=n(d,{selected:e.selected},(t=>t.value===e.value));if(t)return[...s];p([...s]),"2.0"===c&&m(s)}else null==i||i(e)}function m(e){const t=j(null!=e?e:g.current);null==i||i([...t])}return{latestDropdownOptionsRef:g,dropdownOptions:d,search:function(e){if(O(e),v([]),e&&r){const t=[];l(d,(e=>{e.selected&&!t.includes(e.value)&&t.push(e.value)})),r(e).then((e=>{if(e){const s=e.map((e=>{if(e.options){const s=e;return Object.assign(Object.assign({},s),{options:s.options.map((e=>Object.assign(Object.assign({},e),{selected:t.includes(e.value)})))})}return Object.assign(Object.assign({},e),{selected:t.includes(e.value)})}));v([...s])}}))}},searchedString:b,searchedOptions:f,onApplyHandler:h,selectAllHandler:function(e){if(f.length&&b&&r)!function(e){let t=[...d];e?f.forEach((e=>{let s=!1;t=t.map((t=>{const l=e;return void 0!==l.value&&l.value===t.value?(s=!0,Object.assign(Object.assign({},t),{selected:!0})):t})),s||t.push(Object.assign(Object.assign({},e),{selected:!0}))})):f.forEach((e=>{t=t.map((t=>{const s=e;return void 0!==s.value&&s.value===t.value?Object.assign(Object.assign({},t),{selected:!1}):t}))})),p([...t]),"2.0"===c&&m(t)}("selectAll"===e);else if("selectAll"===e){const e=n(d,{selected:!0},(e=>{var t;return b?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(b.toLowerCase()))&&!e.disabled:!e.disabled}));p([...e]),"2.0"===c&&m(e)}else if("notSelected"===e){const e=n(d,{selected:!1},(e=>!e.disabled));p([...e]),"2.0"===c&&m(e)}},onMultiSelectClear:function(){const e=n(d,{selected:!1});p([...e]),"2.0"===c&&m(e)},onFreeFormSelect:function(e){if(!u)return void h({label:b,value:b,isFreeForm:!0,selected:!0});const t=d.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===b&&t.value===b?e:t.selected})));e&&(t.some((e=>e.label===b&&e.value===b))||t.unshift({label:b,value:b,isFreeForm:!0,selected:!0})),p([...t]),"2.0"===c&&m(t)},onMultiSelectApply:m,getSelectedOptions:j}};export{c as useDropdown};
1
+ import{useState as e,useRef as t,useEffect as s}from"react";import{iterateOnOptionsRaw as l,iterateOnOptions as n}from"../OpenedDropdown/utils/iterationOnOptions.js";const c=function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1.0",o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,d=arguments.length>5?arguments[5]:void 0;const[r,v]=e(null!=o?o:[]),[p,f]=e([]),[g,b]=e(""),O=t(r);s((()=>{if(O.current=r,p.length&&g&&d){let e=[...p];const t=r.map((e=>e.options?e.options.map((e=>({value:e.value,selected:e.selected}))):{value:e.value,selected:e.selected})).flat();e=e.map((e=>{const s=t.find((t=>e.value===t.value));return s?Object.assign(Object.assign({},e),{selected:s.selected}):e})),f([...e])}}),[r]),s((()=>{if(o){const e=[...o];v(u&&!a?[...e.sort((e=>e.selected?-1:1))]:[...e])}}),[o]);const h=e=>{const t=[];return e.forEach((e=>{if(e.options){const s=e.options.filter((e=>!0===e.selected));t.push(Object.assign(Object.assign({},e),{options:[...s]}))}else e.selected&&t.push(Object.assign({},e))})),t};function j(e,t){if(u)if(p.length&&g&&d)if(e.selected){let s=!1;const l=n(r,{selected:e.selected},(t=>t.value===e.value&&(s=!0,!0)));if(s||l.push(e),t)return[...l];v([...l]),"2.0"===c&&m(l)}else{let s=!1,l=n(r,{selected:e.selected},(t=>t.value===e.value&&(s=!0,!0)));if(s&&(l=l.filter((t=>t.value!==e.value))),t)return[...l];v([...l]),"2.0"===c&&m(l)}else{const s=n(r,{selected:e.selected},(t=>t.value===e.value));if(t)return[...s];v([...s]),"2.0"===c&&m(s)}else null==i||i(e)}function m(e){const t=h(null!=e?e:O.current);null==i||i([...t])}return{latestDropdownOptionsRef:O,dropdownOptions:r,search:function(e){if(b(e),f([]),e&&d){const t=[];l(r,(e=>{e.selected&&!t.includes(e.value)&&t.push(e.value)})),d(e).then((e=>{if(e){const s=e.map((e=>{if(e.options){const s=e;return Object.assign(Object.assign({},s),{options:s.options.map((e=>Object.assign(Object.assign({},e),{selected:t.includes(e.value)})))})}return Object.assign(Object.assign({},e),{selected:t.includes(e.value)})}));f([...s])}}))}},searchedString:g,searchedOptions:p,onApplyHandler:j,selectAllHandler:function(e){if(p.length&&g&&d)!function(e){let t=[...r];e?p.forEach((e=>{let s=!1;t=t.map((t=>{const l=e;return void 0!==l.value&&l.value===t.value?(s=!0,Object.assign(Object.assign({},t),{selected:!0})):t})),s||t.push(Object.assign(Object.assign({},e),{selected:!0}))})):p.forEach((e=>{t=t.map((t=>{const s=e;return void 0!==s.value&&s.value===t.value?Object.assign(Object.assign({},t),{selected:!1}):t}))})),v([...t]),"2.0"===c&&m(t)}("selectAll"===e);else if("selectAll"===e){const e=n(r,{selected:!0},(e=>{var t;return g?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(g.toLowerCase()))&&!e.disabled:!e.disabled}));v([...e]),"2.0"===c&&m(e)}else if("notSelected"===e){const e=n(r,{selected:!1},(e=>!e.disabled));v([...e]),"2.0"===c&&m(e)}},onMultiSelectClear:function(){const e=n(r,{selected:!1});v([...e]),"2.0"===c&&m(e)},onFreeFormSelect:function(e){if(!u)return void j({label:g,value:g,isFreeForm:!0,selected:!0});const t=r.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===g&&t.value===g?e:t.selected})));e&&(t.some((e=>e.label===g&&e.value===g))||t.unshift({label:g,value:g,isFreeForm:!0,selected:!0})),v([...t]),"2.0"===c&&m(t)},onMultiSelectApply:m,getSelectedOptions:h}};export{c as useDropdown};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare enum FAB_POSITION {
2
3
  TOP_LEFT = "top left",
3
4
  TOP_RIGHT = "top right",
@@ -32,18 +33,18 @@ export declare const FloatingActionButtonOuterContainer: import("styled-componen
32
33
  zIndex: number;
33
34
  }, never>;
34
35
  export declare const StyledDropdown: import("styled-components").StyledComponent<import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap").DropdownProps> & {
35
- Toggle: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"button", import("react-bootstrap").DropdownToggleProps>;
36
- Menu: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap").DropdownMenuProps>;
37
- Item: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"a", import("react-bootstrap").DropdownItemProps>;
38
- ItemText: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"span", import("react-bootstrap").DropdownItemTextProps>;
39
- Divider: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"hr", import("react-bootstrap").DropdownDividerProps>;
40
- Header: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap").DropdownHeaderProps>;
36
+ Toggle: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"button", import("react-bootstrap/esm/DropdownToggle").DropdownToggleProps>;
37
+ Menu: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap/esm/DropdownMenu").DropdownMenuProps>;
38
+ Item: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<import("@restart/ui/esm/types").DynamicRefForwardingComponent<import("react").ForwardRefExoticComponent<import("@restart/ui/esm/Button").ButtonProps & import("react").RefAttributes<HTMLElement>>, import("@restart/ui/esm/DropdownItem").DropdownItemProps>, import("react-bootstrap/esm/DropdownItem").DropdownItemProps>;
39
+ ItemText: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"span", unknown>;
40
+ Divider: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"hr", unknown>;
41
+ Header: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", unknown>;
41
42
  }, any, {
42
43
  active?: string | undefined;
43
44
  width?: string | undefined;
44
45
  height?: string | undefined;
45
46
  }, never>;
46
- export declare const DropdownToggleContainer: import("styled-components").StyledComponent<import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"button", import("react-bootstrap").DropdownToggleProps>, any, {}, never>;
47
+ export declare const DropdownToggleContainer: import("styled-components").StyledComponent<import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"button", import("react-bootstrap/esm/DropdownToggle").DropdownToggleProps>, any, {}, never>;
47
48
  export declare const TooltipStyled: import("styled-components").StyledComponent<"div", any, {
48
49
  tooltipWidth?: number | undefined;
49
50
  }, never>;
@@ -1 +1 @@
1
- import{jsx as o,Fragment as e,jsxs as r}from"react/jsx-runtime";import{useRef as s,useState as t,useEffect as a,useCallback as i}from"react";import{ImageService as p}from"../../image-compress/ImageCompress.js";import{StateInterface as l}from"../../states/StateComponent.js";import"../../../_virtual/_tslib.js";import{StateModalComponent as n}from"../../states-modal/StateModalComponent.js";import"../../modals/styledModal.js";import{BikImageCropper as c}from"../BikImageCropper.js";const d=({cropOptions:d,fileTitle:m,compressionOptions:u,currentImage:g,options:h,onFinish:f,onCancel:C,fileUploadOptions:w})=>{const y=s(null),[b,j]=t(),[F,R]=t(g),[v,I]=t(!1);a((()=>{h.upload?(j("upload"),setTimeout((()=>{E()}),500)):h.crop?j("crop"):h.compress?j("compress"):h.uploadToFirestorage?j("cloud-upload"):I(!0)}),[h.upload,h.crop,h.compress,h.uploadToFirestorage]);const T=i(((o,e)=>{if(!h.uploadToFirestorage)return f(o,e),void I(!0);j("cloud-upload"),w&&w.uploadFile(e,w.path).then((r=>{f(o,e,r),I(!0)})).catch((o=>{console.log("starting err process with ")}))}),[]),O=o=>{o||C();const e=p.base64ToImage(o);h.compress?(j("compress"),p.compressImage(e,u).then((o=>{if(!o)return I(!0),void C();T(o.base64,o.compressedFile)}))):T(o,e)},E=()=>{y.current.click()};return v?o(e,{}):"cloud-upload"===b?!w||w.success?o(e,{}):w.error?o("div",{children:o(n,{states:l.ERROR,heading:"Error while uploading",subline:"Please check your image and try again",isButtonEnabled:!1,width:300,onClose:()=>{I(!0),C()}})}):o("div",{children:o(n,{states:l.LOADING,heading:`Uploading your ${m||"photo"}`,subline:`Please wait while we upload your ${m||"photo"}`,isButtonEnabled:!1,width:300})}):r(e,{children:[h.upload&&o("input",{ref:y,type:"file",accept:"image/*",style:{display:"none"},onChange:o=>{const e=o.target.files[0],r=new FileReader;r.onload=()=>{var o;R({src:r.result}),o=r.result,h.crop?j("crop"):O(o)},e&&r.readAsDataURL(e)}}),"crop"===b&&o(c,{src:F.src,onCropComplete:o=>{R({src:o}),O(o)},aspectRatio:d.aspectRatio,onCancel:C})]})};export{d as BikImagePipeline};
1
+ import{jsx as o,Fragment as e,jsxs as r}from"react/jsx-runtime";import{useRef as t,useState as s,useEffect as a,useCallback as i}from"react";import{ImageService as p}from"../../image-compress/ImageCompress.js";import{StateInterface as l}from"../../states/StateComponent.js";import"../../../_virtual/_tslib.js";import{StateModalComponent as n}from"../../states-modal/StateModalComponent.js";import"../../modals/styledModal.js";import{BikImageCropper as c}from"../BikImageCropper.js";const d=d=>{let{cropOptions:m,fileTitle:u,compressionOptions:g,currentImage:h,options:f,onFinish:C,onCancel:w,fileUploadOptions:y}=d;const b=t(null),[j,F]=s(),[R,v]=s(h),[I,T]=s(!1);a((()=>{f.upload?(F("upload"),setTimeout((()=>{k()}),500)):f.crop?F("crop"):f.compress?F("compress"):f.uploadToFirestorage?F("cloud-upload"):T(!0)}),[f.upload,f.crop,f.compress,f.uploadToFirestorage]);const O=i(((o,e)=>{if(!f.uploadToFirestorage)return C(o,e),void T(!0);F("cloud-upload"),y&&y.uploadFile(e,y.path).then((r=>{C(o,e,r),T(!0)})).catch((o=>{console.log("starting err process with ")}))}),[]),E=o=>{o||w();const e=p.base64ToImage(o);f.compress?(F("compress"),p.compressImage(e,g).then((o=>{if(!o)return T(!0),void w();O(o.base64,o.compressedFile)}))):O(o,e)},k=()=>{b.current.click()};return I?o(e,{}):"cloud-upload"===j?!y||y.success?o(e,{}):y.error?o("div",{children:o(n,{states:l.ERROR,heading:"Error while uploading",subline:"Please check your image and try again",isButtonEnabled:!1,width:300,onClose:()=>{T(!0),w()}})}):o("div",{children:o(n,{states:l.LOADING,heading:`Uploading your ${u||"photo"}`,subline:`Please wait while we upload your ${u||"photo"}`,isButtonEnabled:!1,width:300})}):r(e,{children:[f.upload&&o("input",{ref:b,type:"file",accept:"image/*",style:{display:"none"},onChange:o=>{const e=o.target.files[0],r=new FileReader;r.onload=()=>{var o;v({src:r.result}),o=r.result,f.crop?F("crop"):E(o)},e&&r.readAsDataURL(e)}}),"crop"===j&&o(c,{src:R.src,onCropComplete:o=>{v({src:o}),E(o)},aspectRatio:m.aspectRatio,onCancel:w})]})};export{d as BikImagePipeline};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useEffect as r}from"react";import o from"react-chips";import{COLORS as i}from"../../constants/Theme.js";import{BodySecondary as c,BodyCaption as l}from"../TypographyStyle.js";import{theme as a,chipTheme as s}from"./ChipInput.styled.js";const p=({onChipsChange:p,placeholder:h,chips:m,label:d,labelColor:u,hintText:y,hintTextColor:g,error:f,inputHeight:v,createChipKeys:C,chipsContainerCustomStyle:b,nativeID:j})=>{const[x,T]=n(!1);return r((()=>{var e,t;null===(e=document.querySelector(`#${j} input`))||void 0===e||e.addEventListener("focus",(()=>{T(!0)})),null===(t=document.querySelector(`#${j} input`))||void 0===t||t.addEventListener("blur",(()=>{T(!1)}))}),[]),e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:8},id:j},{children:[d&&t(c,Object.assign({style:{color:x?i.content.brand:f?i.content.negative:u||i.content.primary}},{children:d})),t(o,{value:m,theme:a(!!f,v,b,x),chipTheme:s,placeholder:0===m.length&&!!h&&!x&&h,onChange:e=>{p(e)},createChipKeys:C||","}),(!!y||!!f)&&t(l,Object.assign({style:{color:f?i.content.negative:g||i.content.secondary}},{children:f||y}))]}))};export{p as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useEffect as r}from"react";import o from"react-chips";import{COLORS as i}from"../../constants/Theme.js";import{BodySecondary as l,BodyCaption as c}from"../TypographyStyle.js";import{theme as a,chipTheme as s}from"./ChipInput.styled.js";const p=p=>{let{onChipsChange:h,placeholder:m,chips:d,label:u,labelColor:y,hintText:g,hintTextColor:f,error:v,inputHeight:C,createChipKeys:b,chipsContainerCustomStyle:j,nativeID:x}=p;const[T,S]=n(!1);return r((()=>{var e,t;null===(e=document.querySelector(`#${x} input`))||void 0===e||e.addEventListener("focus",(()=>{S(!0)})),null===(t=document.querySelector(`#${x} input`))||void 0===t||t.addEventListener("blur",(()=>{S(!1)}))}),[]),e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:8},id:x},{children:[u&&t(l,Object.assign({style:{color:T?i.content.brand:v?i.content.negative:y||i.content.primary}},{children:u})),t(o,{value:d,theme:a(!!v,C,j,T),chipTheme:s,placeholder:0===d.length&&!!m&&!T&&m,onChange:e=>{h(e)},createChipKeys:b||","}),(!!g||!!v)&&t(c,Object.assign({style:{color:v?i.content.negative:f||i.content.secondary}},{children:v||g}))]}))};export{p as default};
@@ -1 +1 @@
1
- import{phone as n}from"phone";const r=n=>n&&"function"==typeof n,e=(r,e,t={})=>{let i;const a=["phonenumber","zip","number"].includes(e),l=a?r?Number(r):null:r;if(null==l||""===l)return[!0,""];if(a&&String(l).length&&(t.min&&l<t.min||t.max&&l>t.max))return[!1,`Enter valid number between ${t.min} and ${t.max}`];if("email"===e)return i=/(.+)@(.+){2,}\.(.+){2,}/,l.match(i)?[!0,""]:[!1,"Enter a valid email id"];if("url"===e)return i=/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,l.match(i)?[!0,""]:[!1,"Enter a valid url"];if("number"===e)return l>=0?[!0,""]:[!1,"Enter a valid number"];if("zip"===e)return 6===String(l).trim().length?[!0,""]:[!1,"Enter a valid zip code"];if("phonenumber"===e){const{isValid:r}=n("+"+String(l));return r?[!0,""]:[!1,"Enter a valid phonenumber"]}return(null==l?void 0:l.trim().length)>0?[!0,""]:[!1,"Enter a valid data"]};export{r as isFunction,e as validateInput};
1
+ import{phone as n}from"phone";const e=n=>n&&"function"==typeof n,r=function(e,r){let t,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=["phonenumber","zip","number"].includes(r),l=a?e?Number(e):null:e;if(null==l||""===l)return[!0,""];if(a&&String(l).length&&(i.min&&l<i.min||i.max&&l>i.max))return[!1,`Enter valid number between ${i.min} and ${i.max}`];if("email"===r)return t=/(.+)@(.+){2,}\.(.+){2,}/,l.match(t)?[!0,""]:[!1,"Enter a valid email id"];if("url"===r)return t=/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,l.match(t)?[!0,""]:[!1,"Enter a valid url"];if("number"===r)return l>=0?[!0,""]:[!1,"Enter a valid number"];if("zip"===r)return 6===String(l).trim().length?[!0,""]:[!1,"Enter a valid zip code"];if("phonenumber"===r){const{isValid:e}=n("+"+String(l));return e?[!0,""]:[!1,"Enter a valid phonenumber"]}return(null==l?void 0:l.trim().length)>0?[!0,""]:[!1,"Enter a valid data"]};export{e as isFunction,r as validateInput};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{forwardRef as i,useState as l,useContext as r,useRef as o,useEffect as a}from"react";import{Button as s}from"../button/Button.js";import{isFunction as c,validateInput as u}from"./Input-helper.js";import{BodySecondary as d}from"../TypographyStyle.js";import v from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as h}from"./context/InputStyleProvider.js";import{RootContainer as p,InputFooter as m,InputWrapper as g,IconHolder as f,PrefixHolder as x,InputContainer as b,InputContainerSmall as y,SuffixHolder as j,InputHeader as C,MaxCharStyle as I}from"./Input.styled.js";const k=i(((i,k)=>{var w,O,T,F,L;const{placeholder:M,leftIcon:z,rightIcon:A,labelText:B,maxCharLimit:D,isRequired:S,hintText:E,type:K,state:R,validate:H,variant:q,button:N,suffixText:P,prefixText:V,onChangeText:W,value:G,noErrorHint:J,reset:Q,rangeValidation:U,noKeyDownChange:X,version:Y,noMaxCharCheck:Z}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},i),$=null==z?void 0:z.icon,_=null==A?void 0:A.icon,[ee,ne]=l(!1),[te,ie]=l(!1),[le,re]=l(),oe="small"===q?"18px":"22px",ae=r(h),[se,ce]=l(),ue=o(null),de=null!=k?k:ue;a((()=>{ce(G)}),[G]),a((()=>{var e;de.current&&(null===(e=i.onReferenceInit)||void 0===e||e.call(i,de.current))}),[de]),a((()=>{Q&&ce("")}),[Q]),a((()=>{var e;ie(!!i.isActive),i.isActive&&(null===(e=de.current)||void 0===e||e.focus())}),[i.isActive]),a((()=>{re(i.errorMessage)}),[i.errorMessage]),a((()=>{var e;ne(!1),("invalid"===i.state||le)&&ne(!0),"active"===i.state&&(null===(e=de.current)||void 0===e||e.focus())}),[i.state,le]),a((()=>{ne(!!le)}),[le]);const ve=(e,...n)=>{c(e)&&e(...n)},he=e=>{const n=D||("zip"===K?6:60);X||W(G||"",e),Z||![8].includes(e.which)&&n>0&&e.target.value.length===n&&e.preventDefault()},pe=e=>{const n=e.target.value;W(n,e),i.textControl||ce(n);const t=H||u;if(!t||!c(t))return;const[l,r]=t(n,K,U);ne(!l),re(i.errorMessage?i.errorMessage:r)},me=e=>{var n;i.skipFocus||ie(!0),ve(null===(n=i.onFocus)||void 0===n?void 0:n.call(i,e))},ge=e=>{var n;i.skipFocus||ie(!1),ve(null===(n=i.onBlur)||void 0===n?void 0:n.call(i,e))},fe=()=>{var l;return e(t,{children:["multiline"!==K&&n("input",{id:i.id,style:null!==(l=null==ae?void 0:ae.input)&&void 0!==l?l:{},ref:de,type:["phonenumber","zip","number"].includes(K)?"number":K,value:se,onFocus:e=>me(e),onBlur:e=>ge(e),placeholder:M||"Enter here",onChange:pe,onKeyDown:e=>he(e)}),"multiline"===K&&n("textarea",{value:se,ref:de,onFocus:e=>me(e),onBlur:e=>ge(e),placeholder:M||"Enter here",onChange:pe,onKeyDown:e=>he(e),maxLength:D>0?D:void 0})]})};return e(p,Object.assign({width:i.width,height:i.height,state:R,type:K,style:null!==(w=null==ae?void 0:ae.RootContainer)&&void 0!==w?w:{}},{children:[!J&&(!!E||!!le)&&e(m,Object.assign({invalid:!!le},{children:[!!le&&n(v,{width:16,height:16}),le||E]})),e(g,Object.assign({variant:q,state:R,width:i.width,isActive:"active"===R||te,isInvalid:ee,style:null!==(O=null==ae?void 0:ae.InputWrapper)&&void 0!==O?O:{},version:Y},{children:[!!$&&n(f,Object.assign({variant:q,iconSize:oe,onClick:()=>ve(null==z?void 0:z.callback),isLeft:!0,style:null!==(T=null==ae?void 0:ae.IconHolder)&&void 0!==T?T:{}},{children:n($,{})})),!!V&&n(x,Object.assign({variant:q},{children:V})),"default"===q&&n(b,{children:fe()}),"small"===q&&n(y,{children:fe()}),!!_&&n(f,Object.assign({variant:q,iconSize:oe,onClick:()=>ve(null==A?void 0:A.callback),isLeft:!1},{children:n(_,{})})),!!P&&n(j,Object.assign({variant:q},{children:P})),N&&N.text&&n(s,{buttonText:N.text,onClick:()=>ve(null==N?void 0:N.onClick)})]})),(!!B||!!D)&&e(C,Object.assign({invalid:ee},{children:[e(d,{children:[B,S?n("span",{children:"*"}):""]}),D>0&&e(I,{children:[null!==(L=null===(F=i.value)||void 0===F?void 0:F.length)&&void 0!==L?L:0,"/",D]})]}))]}))}));k.displayName="Input";export{k as Input};
1
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{forwardRef as i,useState as r,useContext as l,useRef as o,useEffect as a}from"react";import{Button as s}from"../button/Button.js";import{isFunction as c,validateInput as u}from"./Input-helper.js";import{BodySecondary as v}from"../TypographyStyle.js";import d from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as h}from"./context/InputStyleProvider.js";import{RootContainer as p,InputFooter as m,InputWrapper as g,IconHolder as f,PrefixHolder as x,InputContainer as b,InputContainerSmall as y,SuffixHolder as j,InputHeader as C,MaxCharStyle as w}from"./Input.styled.js";const I=i(((i,I)=>{var k,O,L,T,A;const{placeholder:D,leftIcon:E,rightIcon:F,labelText:M,maxCharLimit:z,isRequired:B,hintText:S,type:K,state:R,validate:H,variant:q,button:N,suffixText:P,prefixText:V,onChangeText:W,value:G,noErrorHint:J,reset:Q,rangeValidation:U,noKeyDownChange:X,version:Y,noMaxCharCheck:Z}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},i),$=null==E?void 0:E.icon,_=null==F?void 0:F.icon,[ee,ne]=r(!1),[te,ie]=r(!1),[re,le]=r(),oe="small"===q?"18px":"22px",ae=l(h),[se,ce]=r(),ue=o(null),ve=null!=I?I:ue;a((()=>{ce(G)}),[G]),a((()=>{var e;ve.current&&(null===(e=i.onReferenceInit)||void 0===e||e.call(i,ve.current))}),[ve]),a((()=>{const e=ve.current;if(e)return e.addEventListener("wheel",pe,{passive:!1}),()=>{e.removeEventListener("wheel",pe)}}),[]),a((()=>{Q&&ce("")}),[Q]),a((()=>{var e;ie(!!i.isActive),i.isActive&&(null===(e=ve.current)||void 0===e||e.focus())}),[i.isActive]),a((()=>{le(i.errorMessage)}),[i.errorMessage]),a((()=>{var e;ne(!1),("invalid"===i.state||re)&&ne(!0),"active"===i.state&&(null===(e=ve.current)||void 0===e||e.focus())}),[i.state,re]),a((()=>{ne(!!re)}),[re]);const de=function(e){if(c(e)){for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++)t[i-1]=arguments[i];e(...t)}},he=e=>{const n=z||("zip"===K?6:60);X||W(G||"",e),Z||![8].includes(e.which)&&n>0&&e.target.value.length===n&&e.preventDefault()},pe=e=>{e.preventDefault()},me=e=>{const n=e.target.value;W(n,e),i.textControl||ce(n);const t=H||u;if(!t||!c(t))return;const[r,l]=t(n,K,U);ne(!r),le(i.errorMessage?i.errorMessage:l)},ge=e=>{var n;i.skipFocus||ie(!0),de(null===(n=i.onFocus)||void 0===n?void 0:n.call(i,e))},fe=e=>{var n;i.skipFocus||ie(!1),de(null===(n=i.onBlur)||void 0===n?void 0:n.call(i,e))},xe=()=>{var r;return e(t,{children:["multiline"!==K&&n("input",{id:i.id,style:null!==(r=null==ae?void 0:ae.input)&&void 0!==r?r:{},ref:ve,type:["phonenumber","zip","number"].includes(K)?"number":K,value:se,onFocus:e=>ge(e),onBlur:e=>fe(e),placeholder:D||"Enter here",onChange:me,onKeyDown:e=>he(e)}),"multiline"===K&&n("textarea",{value:se,ref:ve,onFocus:e=>ge(e),onBlur:e=>fe(e),placeholder:D||"Enter here",onChange:me,onKeyDown:e=>he(e),maxLength:z>0?z:void 0})]})};return e(p,Object.assign({width:i.width,height:i.height,state:R,type:K,style:null!==(k=null==ae?void 0:ae.RootContainer)&&void 0!==k?k:{}},{children:[!J&&(!!S||!!re)&&e(m,Object.assign({invalid:!!re},{children:[!!re&&n(d,{width:16,height:16}),re||S]})),e(g,Object.assign({variant:q,state:R,width:i.width,isActive:"active"===R||te,isInvalid:ee,style:null!==(O=null==ae?void 0:ae.InputWrapper)&&void 0!==O?O:{},version:Y},{children:[!!$&&n(f,Object.assign({variant:q,iconSize:oe,onClick:()=>de(null==E?void 0:E.callback),isLeft:!0,style:null!==(L=null==ae?void 0:ae.IconHolder)&&void 0!==L?L:{}},{children:n($,{})})),!!V&&n(x,Object.assign({variant:q},{children:V})),"default"===q&&n(b,{children:xe()}),"small"===q&&n(y,{children:xe()}),!!_&&n(f,Object.assign({variant:q,iconSize:oe,onClick:()=>de(null==F?void 0:F.callback),isLeft:!1},{children:n(_,{})})),!!P&&n(j,Object.assign({variant:q},{children:P})),N&&N.text&&n(s,{buttonText:N.text,onClick:()=>de(null==N?void 0:N.onClick)})]})),(!!M||!!z)&&e(C,Object.assign({invalid:ee},{children:[e(v,{children:[M,B?n("span",{children:"*"}):""]}),z>0&&e(w,{children:[null!==(A=null===(T=i.value)||void 0===T?void 0:T.length)&&void 0!==A?A:0,"/",z]})]}))]}))}));I.displayName="Input";export{I as Input};