@instincthub/react-ui 0.1.3 → 0.1.4

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 (524) hide show
  1. package/README.md +28 -3
  2. package/dist/_virtual/_commonjsHelpers.js +1 -1
  3. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -1
  4. package/dist/_virtual/index.js +1 -1
  5. package/dist/_virtual/index2.js +1 -1
  6. package/dist/_virtual/lodash.js +1 -1
  7. package/dist/_virtual/react-is.development.js +1 -1
  8. package/dist/_virtual/react-is.production.min.js +1 -1
  9. package/dist/node_modules/@tiptap/core/dist/index.js +1 -1
  10. package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
  11. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +1 -1
  12. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
  13. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +1 -1
  14. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
  15. package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js +1 -1
  16. package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js.map +1 -1
  17. package/dist/node_modules/@tiptap/extension-character-count/dist/index.js +1 -1
  18. package/dist/node_modules/@tiptap/extension-character-count/dist/index.js.map +1 -1
  19. package/dist/node_modules/@tiptap/extension-code/dist/index.js +1 -1
  20. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
  21. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +1 -1
  22. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
  23. package/dist/node_modules/@tiptap/extension-document/dist/index.js +1 -1
  24. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
  25. package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js +1 -1
  26. package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js.map +1 -1
  27. package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js +1 -1
  28. package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js.map +1 -1
  29. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +1 -1
  30. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
  31. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +1 -1
  32. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
  33. package/dist/node_modules/@tiptap/extension-highlight/dist/index.js +1 -1
  34. package/dist/node_modules/@tiptap/extension-highlight/dist/index.js.map +1 -1
  35. package/dist/node_modules/@tiptap/extension-history/dist/index.js +1 -1
  36. package/dist/node_modules/@tiptap/extension-history/dist/index.js.map +1 -1
  37. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +1 -1
  38. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
  39. package/dist/node_modules/@tiptap/extension-image/dist/index.js +1 -1
  40. package/dist/node_modules/@tiptap/extension-image/dist/index.js.map +1 -1
  41. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +1 -1
  42. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
  43. package/dist/node_modules/@tiptap/extension-link/dist/index.js +1 -1
  44. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
  45. package/dist/node_modules/@tiptap/extension-list-item/dist/index.js +1 -1
  46. package/dist/node_modules/@tiptap/extension-list-item/dist/index.js.map +1 -1
  47. package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js +1 -1
  48. package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js.map +1 -1
  49. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +1 -1
  50. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
  51. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +1 -1
  52. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
  53. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +1 -1
  54. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
  55. package/dist/node_modules/@tiptap/extension-table/dist/index.js +1 -1
  56. package/dist/node_modules/@tiptap/extension-table/dist/index.js.map +1 -1
  57. package/dist/node_modules/@tiptap/extension-table-cell/dist/index.js +1 -1
  58. package/dist/node_modules/@tiptap/extension-table-cell/dist/index.js.map +1 -1
  59. package/dist/node_modules/@tiptap/extension-table-header/dist/index.js +1 -1
  60. package/dist/node_modules/@tiptap/extension-table-header/dist/index.js.map +1 -1
  61. package/dist/node_modules/@tiptap/extension-table-row/dist/index.js +1 -1
  62. package/dist/node_modules/@tiptap/extension-table-row/dist/index.js.map +1 -1
  63. package/dist/node_modules/@tiptap/extension-task-item/dist/index.js +1 -1
  64. package/dist/node_modules/@tiptap/extension-task-item/dist/index.js.map +1 -1
  65. package/dist/node_modules/@tiptap/extension-task-list/dist/index.js +1 -1
  66. package/dist/node_modules/@tiptap/extension-task-list/dist/index.js.map +1 -1
  67. package/dist/node_modules/@tiptap/extension-text/dist/index.js +1 -1
  68. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
  69. package/dist/node_modules/@tiptap/react/dist/index.js +3 -3
  70. package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
  71. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +1 -1
  72. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
  73. package/dist/node_modules/attr-accept/dist/es/index.js +1 -1
  74. package/dist/node_modules/attr-accept/dist/es/index.js.map +1 -1
  75. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +1 -1
  76. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js.map +1 -1
  77. package/dist/node_modules/date-fns/_lib/defaultOptions.js +1 -1
  78. package/dist/node_modules/date-fns/_lib/defaultOptions.js.map +1 -1
  79. package/dist/node_modules/date-fns/_lib/format/formatters.js +1 -1
  80. package/dist/node_modules/date-fns/_lib/format/formatters.js.map +1 -1
  81. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +1 -1
  82. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -1
  83. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +1 -1
  84. package/dist/node_modules/date-fns/_lib/format/longFormatters.js.map +1 -1
  85. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +1 -1
  86. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +1 -1
  87. package/dist/node_modules/date-fns/_lib/normalizeDates.js +1 -1
  88. package/dist/node_modules/date-fns/_lib/normalizeDates.js.map +1 -1
  89. package/dist/node_modules/date-fns/_lib/protectedTokens.js +1 -1
  90. package/dist/node_modules/date-fns/_lib/protectedTokens.js.map +1 -1
  91. package/dist/node_modules/date-fns/constants.js +1 -1
  92. package/dist/node_modules/date-fns/constants.js.map +1 -1
  93. package/dist/node_modules/date-fns/constructFrom.js +1 -1
  94. package/dist/node_modules/date-fns/constructFrom.js.map +1 -1
  95. package/dist/node_modules/date-fns/differenceInCalendarDays.js +1 -1
  96. package/dist/node_modules/date-fns/differenceInCalendarDays.js.map +1 -1
  97. package/dist/node_modules/date-fns/format.js +1 -1
  98. package/dist/node_modules/date-fns/format.js.map +1 -1
  99. package/dist/node_modules/date-fns/getDayOfYear.js +1 -1
  100. package/dist/node_modules/date-fns/getDayOfYear.js.map +1 -1
  101. package/dist/node_modules/date-fns/getISOWeek.js +1 -1
  102. package/dist/node_modules/date-fns/getISOWeek.js.map +1 -1
  103. package/dist/node_modules/date-fns/getISOWeekYear.js +1 -1
  104. package/dist/node_modules/date-fns/getISOWeekYear.js.map +1 -1
  105. package/dist/node_modules/date-fns/getWeek.js +1 -1
  106. package/dist/node_modules/date-fns/getWeek.js.map +1 -1
  107. package/dist/node_modules/date-fns/getWeekYear.js +1 -1
  108. package/dist/node_modules/date-fns/getWeekYear.js.map +1 -1
  109. package/dist/node_modules/date-fns/isDate.js +1 -1
  110. package/dist/node_modules/date-fns/isDate.js.map +1 -1
  111. package/dist/node_modules/date-fns/isValid.js +1 -1
  112. package/dist/node_modules/date-fns/isValid.js.map +1 -1
  113. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +1 -1
  114. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -1
  115. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +1 -1
  116. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -1
  117. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +1 -1
  118. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -1
  119. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +1 -1
  120. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -1
  121. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +1 -1
  122. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +1 -1
  123. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +1 -1
  124. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +1 -1
  125. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +1 -1
  126. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +1 -1
  127. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +1 -1
  128. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js.map +1 -1
  129. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +1 -1
  130. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js.map +1 -1
  131. package/dist/node_modules/date-fns/locale/en-US.js +1 -1
  132. package/dist/node_modules/date-fns/locale/en-US.js.map +1 -1
  133. package/dist/node_modules/date-fns/startOfDay.js +1 -1
  134. package/dist/node_modules/date-fns/startOfDay.js.map +1 -1
  135. package/dist/node_modules/date-fns/startOfISOWeek.js +1 -1
  136. package/dist/node_modules/date-fns/startOfISOWeek.js.map +1 -1
  137. package/dist/node_modules/date-fns/startOfISOWeekYear.js +1 -1
  138. package/dist/node_modules/date-fns/startOfISOWeekYear.js.map +1 -1
  139. package/dist/node_modules/date-fns/startOfWeek.js +1 -1
  140. package/dist/node_modules/date-fns/startOfWeek.js.map +1 -1
  141. package/dist/node_modules/date-fns/startOfWeekYear.js +1 -1
  142. package/dist/node_modules/date-fns/startOfWeekYear.js.map +1 -1
  143. package/dist/node_modules/date-fns/startOfYear.js +1 -1
  144. package/dist/node_modules/date-fns/startOfYear.js.map +1 -1
  145. package/dist/node_modules/date-fns/toDate.js +1 -1
  146. package/dist/node_modules/date-fns/toDate.js.map +1 -1
  147. package/dist/node_modules/dompurify/dist/purify.es.mjs.js +2 -1
  148. package/dist/node_modules/dompurify/dist/purify.es.mjs.js.map +1 -1
  149. package/dist/node_modules/file-selector/dist/es2015/file-selector.js +1 -1
  150. package/dist/node_modules/file-selector/dist/es2015/file-selector.js.map +1 -1
  151. package/dist/node_modules/file-selector/dist/es2015/file.js +1 -1
  152. package/dist/node_modules/file-selector/dist/es2015/file.js.map +1 -1
  153. package/dist/node_modules/html2canvas/dist/html2canvas.esm.js +2 -1
  154. package/dist/node_modules/html2canvas/dist/html2canvas.esm.js.map +1 -1
  155. package/dist/node_modules/linkifyjs/dist/linkify.es.js +1 -1
  156. package/dist/node_modules/linkifyjs/dist/linkify.es.js.map +1 -1
  157. package/dist/node_modules/lodash/lodash.js +3 -2
  158. package/dist/node_modules/lodash/lodash.js.map +1 -1
  159. package/dist/node_modules/marked/lib/marked.esm.js +1 -1
  160. package/dist/node_modules/marked/lib/marked.esm.js.map +1 -1
  161. package/dist/node_modules/object-assign/index.js +2 -1
  162. package/dist/node_modules/object-assign/index.js.map +1 -1
  163. package/dist/node_modules/orderedmap/dist/index.js +1 -1
  164. package/dist/node_modules/orderedmap/dist/index.js.map +1 -1
  165. package/dist/node_modules/prop-types/checkPropTypes.js +1 -1
  166. package/dist/node_modules/prop-types/checkPropTypes.js.map +1 -1
  167. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +1 -1
  168. package/dist/node_modules/prop-types/factoryWithThrowingShims.js.map +1 -1
  169. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
  170. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
  171. package/dist/node_modules/prop-types/index.js +1 -1
  172. package/dist/node_modules/prop-types/index.js.map +1 -1
  173. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -1
  174. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +1 -1
  175. package/dist/node_modules/prop-types/lib/has.js +1 -1
  176. package/dist/node_modules/prop-types/lib/has.js.map +1 -1
  177. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +2 -2
  178. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js.map +1 -1
  179. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +2 -2
  180. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
  181. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  182. package/dist/node_modules/prop-types/node_modules/react-is/index.js.map +1 -1
  183. package/dist/node_modules/prosemirror-commands/dist/index.js +1 -1
  184. package/dist/node_modules/prosemirror-commands/dist/index.js.map +1 -1
  185. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +1 -1
  186. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
  187. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +1 -1
  188. package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +1 -1
  189. package/dist/node_modules/prosemirror-history/dist/index.js +1 -1
  190. package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
  191. package/dist/node_modules/prosemirror-keymap/dist/index.js +1 -1
  192. package/dist/node_modules/prosemirror-keymap/dist/index.js.map +1 -1
  193. package/dist/node_modules/prosemirror-model/dist/index.js +1 -1
  194. package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
  195. package/dist/node_modules/prosemirror-schema-list/dist/index.js +1 -1
  196. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
  197. package/dist/node_modules/prosemirror-state/dist/index.js +1 -1
  198. package/dist/node_modules/prosemirror-state/dist/index.js.map +1 -1
  199. package/dist/node_modules/prosemirror-tables/dist/index.js +1 -1
  200. package/dist/node_modules/prosemirror-tables/dist/index.js.map +1 -1
  201. package/dist/node_modules/prosemirror-transform/dist/index.js +1 -1
  202. package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
  203. package/dist/node_modules/prosemirror-view/dist/index.js +1 -1
  204. package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
  205. package/dist/node_modules/react-dropzone/dist/es/index.js +1 -1
  206. package/dist/node_modules/react-dropzone/dist/es/index.js.map +1 -1
  207. package/dist/node_modules/react-dropzone/dist/es/utils/index.js +1 -1
  208. package/dist/node_modules/react-dropzone/dist/es/utils/index.js.map +1 -1
  209. package/dist/node_modules/rope-sequence/dist/index.js +1 -1
  210. package/dist/node_modules/rope-sequence/dist/index.js.map +1 -1
  211. package/dist/node_modules/tslib/tslib.es6.js +1 -1
  212. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  213. package/dist/node_modules/w3c-keyname/index.js +1 -1
  214. package/dist/node_modules/w3c-keyname/index.js.map +1 -1
  215. package/dist/node_modules/xlsx/xlsx.mjs.js +2 -1
  216. package/dist/node_modules/xlsx/xlsx.mjs.js.map +1 -1
  217. package/dist/src/components/auth/ClientDetector.js +1 -1
  218. package/dist/src/components/auth/ClientOnly.js +1 -1
  219. package/dist/src/components/auth/FromInstinctHub.js +1 -1
  220. package/dist/src/components/auth/FromInstinctHub.js.map +1 -1
  221. package/dist/src/components/auth/IsUsernameEmailTaken.js +1 -1
  222. package/dist/src/components/auth/LoginForm.js +1 -1
  223. package/dist/src/components/auth/PasswordsMatch.js +1 -1
  224. package/dist/src/components/auth/ReactClientProviders.js +1 -1
  225. package/dist/src/components/cursors/Cursor.js +1 -1
  226. package/dist/src/components/cursors/CursorContext.js +1 -1
  227. package/dist/src/components/cursors/CursorControlDemo.js +1 -1
  228. package/dist/src/components/cursors/MagneticButton.js +1 -1
  229. package/dist/src/components/cursors/index.js +1 -1
  230. package/dist/src/components/cursors/index.js.map +1 -1
  231. package/dist/src/components/cursors/useCursorInteraction.js +1 -1
  232. package/dist/src/components/forms/ActionCallbackDropdown.js +1 -1
  233. package/dist/src/components/forms/ActionDropdown.js +1 -1
  234. package/dist/src/components/forms/AnimatedBox.js +1 -1
  235. package/dist/src/components/forms/CheckBoxes.js +1 -1
  236. package/dist/src/components/forms/CheckboxesField.js +1 -1
  237. package/dist/src/components/forms/ChipsInput.js +1 -1
  238. package/dist/src/components/forms/DateInput.js +1 -1
  239. package/dist/src/components/forms/DateInputPicker.js +1 -1
  240. package/dist/src/components/forms/DateTimeInput.js +1 -1
  241. package/dist/src/components/forms/DownloadAsExcel.js +1 -1
  242. package/dist/src/components/forms/DropFile.js +1 -1
  243. package/dist/src/components/forms/EmailList.js +1 -1
  244. package/dist/src/components/forms/FileField.js +1 -1
  245. package/dist/src/components/forms/FilterArray.js +1 -1
  246. package/dist/src/components/forms/FilterBy.js +1 -1
  247. package/dist/src/components/forms/FilterObjects.js +1 -1
  248. package/dist/src/components/forms/FormError.js +1 -1
  249. package/dist/src/components/forms/FormError.js.map +1 -1
  250. package/dist/src/components/forms/HandleError.js +1 -1
  251. package/dist/src/components/forms/InputAmount.js +1 -1
  252. package/dist/src/components/forms/InputNumber.js +1 -1
  253. package/dist/src/components/forms/InputText.js +1 -1
  254. package/dist/src/components/forms/InputTextarea.js +1 -1
  255. package/dist/src/components/forms/Logout.js +1 -1
  256. package/dist/src/components/forms/MessageDisplay.js +1 -1
  257. package/dist/src/components/forms/MessageDisplay.js.map +1 -1
  258. package/dist/src/components/forms/MultipleEmail.js +1 -1
  259. package/dist/src/components/forms/PageLoading.js +1 -1
  260. package/dist/src/components/forms/PageLoading.js.map +1 -1
  261. package/dist/src/components/forms/PasswordField.js +1 -1
  262. package/dist/src/components/forms/PhoneNumberInput.js +1 -1
  263. package/dist/src/components/forms/RadioField.js +1 -1
  264. package/dist/src/components/forms/RadioField.js.map +1 -1
  265. package/dist/src/components/forms/RadioSimple.js +1 -1
  266. package/dist/src/components/forms/RadioSimple.js.map +1 -1
  267. package/dist/src/components/forms/ReactTimeAgo.js +1 -1
  268. package/dist/src/components/forms/ReadTermsAndCondition.js +1 -1
  269. package/dist/src/components/forms/SearchField.js +1 -1
  270. package/dist/src/components/forms/SearchFieldDB.js +1 -1
  271. package/dist/src/components/forms/SearchObjectsFromDB.js +1 -1
  272. package/dist/src/components/forms/StepProgressBar.js +1 -1
  273. package/dist/src/components/forms/StepProgressBar.js.map +1 -1
  274. package/dist/src/components/forms/SubmitButton.js +1 -1
  275. package/dist/src/components/forms/TBodyNoData.js +1 -1
  276. package/dist/src/components/forms/TBodyNoData.js.map +1 -1
  277. package/dist/src/components/forms/THeadSortBtn.js +1 -1
  278. package/dist/src/components/forms/THeadSortBtn.js.map +1 -1
  279. package/dist/src/components/forms/THeadSortList.js +1 -1
  280. package/dist/src/components/forms/Tables.js +1 -1
  281. package/dist/src/components/forms/TextArea.js +1 -1
  282. package/dist/src/components/forms/TextArea.js.map +1 -1
  283. package/dist/src/components/forms/TextField.js +1 -1
  284. package/dist/src/components/forms/ToggleButton.js +1 -1
  285. package/dist/src/components/forms/Tooltip.js +1 -1
  286. package/dist/src/components/forms/UnsplashRandomImage.js +1 -1
  287. package/dist/src/components/forms/radio-btn/RadioButton.js +1 -1
  288. package/dist/src/components/forms/radio-btn/RadioButton.js.map +1 -1
  289. package/dist/src/components/forms/radio-btn/RadioGroup.js +1 -1
  290. package/dist/src/components/forms/radio-btn/RadioGroup.js.map +1 -1
  291. package/dist/src/components/forms/uploads/FileUploader.js +1 -1
  292. package/dist/src/components/forms/uploads/IhubFileUploader.js +1 -1
  293. package/dist/src/components/lib/auth/actions.js +1 -1
  294. package/dist/src/components/lib/auth/dbRequestst.js +1 -1
  295. package/dist/src/components/lib/auth/dbRequestst.js.map +1 -1
  296. package/dist/src/components/lib/charts.js +1 -1
  297. package/dist/src/components/lib/charts.js.map +1 -1
  298. package/dist/src/components/lib/convertArrayToObject.js +1 -1
  299. package/dist/src/components/lib/convertArrayToObject.js.map +1 -1
  300. package/dist/src/components/lib/createSubscription.js +1 -1
  301. package/dist/src/components/lib/createSubscription.js.map +1 -1
  302. package/dist/src/components/lib/elementIsVisibleInViewport.js +1 -1
  303. package/dist/src/components/lib/elementIsVisibleInViewport.js.map +1 -1
  304. package/dist/src/components/lib/fileToBase64.js +1 -1
  305. package/dist/src/components/lib/fileToBase64.js.map +1 -1
  306. package/dist/src/components/lib/formError.js +1 -1
  307. package/dist/src/components/lib/formError.js.map +1 -1
  308. package/dist/src/components/lib/format.js +1 -1
  309. package/dist/src/components/lib/format.js.map +1 -1
  310. package/dist/src/components/lib/getPriceObjects.js +1 -1
  311. package/dist/src/components/lib/getPriceObjects.js.map +1 -1
  312. package/dist/src/components/lib/helpFunction.js +1 -1
  313. package/dist/src/components/lib/helpFunction.js.map +1 -1
  314. package/dist/src/components/lib/index.js +1 -1
  315. package/dist/src/components/lib/index.js.map +1 -1
  316. package/dist/src/components/lib/json/accounts.js +1 -1
  317. package/dist/src/components/lib/json/accounts.js.map +1 -1
  318. package/dist/src/components/lib/json/countryObjects.js +1 -1
  319. package/dist/src/components/lib/json/countryObjects.js.map +1 -1
  320. package/dist/src/components/lib/json/unsplashDefaultObject.js +1 -1
  321. package/dist/src/components/lib/json/unsplashDefaultObject.js.map +1 -1
  322. package/dist/src/components/lib/loadScript.js +2 -0
  323. package/dist/src/components/lib/loadScript.js.map +1 -0
  324. package/dist/src/components/lib/modals/modals.js +1 -1
  325. package/dist/src/components/lib/modals/modals.js.map +1 -1
  326. package/dist/src/components/lib/modals/openConfirmDelete.js +1 -1
  327. package/dist/src/components/lib/modals/openConfirmDelete.js.map +1 -1
  328. package/dist/src/components/lib/oauth_json.js +1 -1
  329. package/dist/src/components/lib/oauth_json.js.map +1 -1
  330. package/dist/src/components/lib/paystack.js +1 -1
  331. package/dist/src/components/lib/paystack.js.map +1 -1
  332. package/dist/src/components/lib/permissions.js +1 -1
  333. package/dist/src/components/lib/permissions.js.map +1 -1
  334. package/dist/src/components/lib/queryParameters/index.js +1 -1
  335. package/dist/src/components/lib/queryParameters/index.js.map +1 -1
  336. package/dist/src/components/lib/redux/index.js +1 -1
  337. package/dist/src/components/lib/redux/middleware.js +1 -1
  338. package/dist/src/components/lib/redux/middleware.js.map +1 -1
  339. package/dist/src/components/lib/redux/rootReducer.js +1 -1
  340. package/dist/src/components/lib/redux/rootReducer.js.map +1 -1
  341. package/dist/src/components/lib/redux/slices/authSlice/channelCallbackUrl.js +1 -1
  342. package/dist/src/components/lib/redux/slices/authSlice/channelCallbackUrl.js.map +1 -1
  343. package/dist/src/components/lib/redux/slices/authSlice/selectors.js +1 -1
  344. package/dist/src/components/lib/redux/slices/authSlice/selectors.js.map +1 -1
  345. package/dist/src/components/lib/redux/slices/channelSlice/activeChannel.js +1 -1
  346. package/dist/src/components/lib/redux/slices/channelSlice/activeChannel.js.map +1 -1
  347. package/dist/src/components/lib/redux/slices/channelSlice/channelDetails.js +1 -1
  348. package/dist/src/components/lib/redux/slices/channelSlice/channelDetails.js.map +1 -1
  349. package/dist/src/components/lib/redux/slices/channelSlice/channelHandle.js +1 -1
  350. package/dist/src/components/lib/redux/slices/channelSlice/channelHandle.js.map +1 -1
  351. package/dist/src/components/lib/redux/slices/channelSlice/instructorChannelList.js +1 -1
  352. package/dist/src/components/lib/redux/slices/channelSlice/instructorChannelList.js.map +1 -1
  353. package/dist/src/components/lib/redux/slices/channelSlice/selectors.js +1 -1
  354. package/dist/src/components/lib/redux/slices/channelSlice/selectors.js.map +1 -1
  355. package/dist/src/components/lib/redux/slices/courseSlice/courseDetails.js +1 -1
  356. package/dist/src/components/lib/redux/slices/courseSlice/courseDetails.js.map +1 -1
  357. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterDuration.js +1 -1
  358. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterDuration.js.map +1 -1
  359. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterLevel.js +1 -1
  360. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterLevel.js.map +1 -1
  361. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterSubject.js +1 -1
  362. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterSubject.js.map +1 -1
  363. package/dist/src/components/lib/redux/slices/courseSlice/courseModules.js +1 -1
  364. package/dist/src/components/lib/redux/slices/courseSlice/courseModules.js.map +1 -1
  365. package/dist/src/components/lib/redux/slices/courseSlice/courseOverview.js +1 -1
  366. package/dist/src/components/lib/redux/slices/courseSlice/courseOverview.js.map +1 -1
  367. package/dist/src/components/lib/redux/slices/courseSlice/courseSearch.js +1 -1
  368. package/dist/src/components/lib/redux/slices/courseSlice/courseSearch.js.map +1 -1
  369. package/dist/src/components/lib/redux/slices/courseSlice/selectedCourses.js +1 -1
  370. package/dist/src/components/lib/redux/slices/courseSlice/selectedCourses.js.map +1 -1
  371. package/dist/src/components/lib/redux/slices/courseSlice/selectors.js +1 -1
  372. package/dist/src/components/lib/redux/slices/courseSlice/selectors.js.map +1 -1
  373. package/dist/src/components/lib/redux/slices/courseSlice/stepContent.js +1 -1
  374. package/dist/src/components/lib/redux/slices/courseSlice/stepContent.js.map +1 -1
  375. package/dist/src/components/lib/redux/slices/courseSlice/stepQuestions.js +1 -1
  376. package/dist/src/components/lib/redux/slices/courseSlice/stepQuestions.js.map +1 -1
  377. package/dist/src/components/lib/redux/slices/courseSlice/videoTimestamp.js +1 -1
  378. package/dist/src/components/lib/redux/slices/courseSlice/videoTimestamp.js.map +1 -1
  379. package/dist/src/components/lib/redux/slices/courseSlice/videoTimestampObject.js +1 -1
  380. package/dist/src/components/lib/redux/slices/courseSlice/videoTimestampObject.js.map +1 -1
  381. package/dist/src/components/lib/redux/slices/generics/arraySlice.js +1 -1
  382. package/dist/src/components/lib/redux/slices/generics/arraySlice.js.map +1 -1
  383. package/dist/src/components/lib/redux/slices/generics/objectSlice.js +1 -1
  384. package/dist/src/components/lib/redux/slices/generics/objectSlice.js.map +1 -1
  385. package/dist/src/components/lib/redux/slices/generics/selectors.js +1 -1
  386. package/dist/src/components/lib/redux/slices/generics/selectors.js.map +1 -1
  387. package/dist/src/components/lib/redux/slices/messageSlice/feedbackToggle.js +1 -1
  388. package/dist/src/components/lib/redux/slices/messageSlice/feedbackToggle.js.map +1 -1
  389. package/dist/src/components/lib/redux/slices/messageSlice/selectors.js +1 -1
  390. package/dist/src/components/lib/redux/slices/messageSlice/selectors.js.map +1 -1
  391. package/dist/src/components/lib/redux/slices/messageSlice/statusMessageState.js +1 -1
  392. package/dist/src/components/lib/redux/slices/messageSlice/statusMessageState.js.map +1 -1
  393. package/dist/src/components/lib/redux/slices/navigationSlice/IPAdress.js +1 -1
  394. package/dist/src/components/lib/redux/slices/navigationSlice/IPAdress.js.map +1 -1
  395. package/dist/src/components/lib/redux/slices/navigationSlice/appToggle.js +1 -1
  396. package/dist/src/components/lib/redux/slices/navigationSlice/appToggle.js.map +1 -1
  397. package/dist/src/components/lib/redux/slices/navigationSlice/confirmDelete.js +1 -1
  398. package/dist/src/components/lib/redux/slices/navigationSlice/confirmDelete.js.map +1 -1
  399. package/dist/src/components/lib/redux/slices/navigationSlice/courseNextStep.js +1 -1
  400. package/dist/src/components/lib/redux/slices/navigationSlice/courseNextStep.js.map +1 -1
  401. package/dist/src/components/lib/redux/slices/navigationSlice/currentPromo.js +1 -1
  402. package/dist/src/components/lib/redux/slices/navigationSlice/currentPromo.js.map +1 -1
  403. package/dist/src/components/lib/redux/slices/navigationSlice/searchValue.js +1 -1
  404. package/dist/src/components/lib/redux/slices/navigationSlice/searchValue.js.map +1 -1
  405. package/dist/src/components/lib/redux/slices/navigationSlice/selectors.js +1 -1
  406. package/dist/src/components/lib/redux/slices/navigationSlice/selectors.js.map +1 -1
  407. package/dist/src/components/lib/redux/slices/navigationSlice/settingsToggle.js +1 -1
  408. package/dist/src/components/lib/redux/slices/navigationSlice/settingsToggle.js.map +1 -1
  409. package/dist/src/components/lib/redux/slices/navigationSlice/toggleCreateCohort.js +1 -1
  410. package/dist/src/components/lib/redux/slices/navigationSlice/toggleCreateCohort.js.map +1 -1
  411. package/dist/src/components/lib/redux/slices/navigationSlice/toggleCreateCourse.js +1 -1
  412. package/dist/src/components/lib/redux/slices/navigationSlice/toggleCreateCourse.js.map +1 -1
  413. package/dist/src/components/lib/redux/slices/navigationSlice/userLocation.js +1 -1
  414. package/dist/src/components/lib/redux/slices/navigationSlice/userLocation.js.map +1 -1
  415. package/dist/src/components/lib/redux/slices/utilsSlice/screenSize.js +1 -1
  416. package/dist/src/components/lib/redux/slices/utilsSlice/screenSize.js.map +1 -1
  417. package/dist/src/components/lib/redux/slices/utilsSlice/selectors.js +1 -1
  418. package/dist/src/components/lib/redux/slices/utilsSlice/selectors.js.map +1 -1
  419. package/dist/src/components/lib/redux/store.js +1 -1
  420. package/dist/src/components/lib/redux/store.js.map +1 -1
  421. package/dist/src/components/lib/roles.js +1 -1
  422. package/dist/src/components/lib/roles.js.map +1 -1
  423. package/dist/src/components/lib/utils.js +1 -1
  424. package/dist/src/components/lib/utils.js.map +1 -1
  425. package/dist/src/components/navbar/Breadcrumb.js +1 -1
  426. package/dist/src/components/navbar/ChannelListAvatar.js +1 -1
  427. package/dist/src/components/navbar/MenuDropdown.js +1 -1
  428. package/dist/src/components/navbar/ResponsiveNavbar.js +1 -1
  429. package/dist/src/components/navbar/SideNavbar.js +1 -1
  430. package/dist/src/components/status/CopyToClipBoard.js +1 -1
  431. package/dist/src/components/status/DeleteConfirmationModal.js +1 -1
  432. package/dist/src/components/status/Error500.js +1 -1
  433. package/dist/src/components/status/Error500.js.map +1 -1
  434. package/dist/src/components/status/ErrorState.js +1 -1
  435. package/dist/src/components/status/ErrorState.js.map +1 -1
  436. package/dist/src/components/status/ModalExamples.js +1 -1
  437. package/dist/src/components/status/MultiPurposeModal.js +1 -1
  438. package/dist/src/components/status/NotFound.js +1 -1
  439. package/dist/src/components/status/ReactTimeTracker.js +1 -1
  440. package/dist/src/components/status/SessionHandleProvider.js +1 -1
  441. package/dist/src/components/status/Unauthorized.js +1 -1
  442. package/dist/src/components/status/Unauthorized.js.map +1 -1
  443. package/dist/src/components/tabs/TabContent.js +1 -1
  444. package/dist/src/components/tabs/TabContent.js.map +1 -1
  445. package/dist/src/components/tabs/Tabs.js +1 -1
  446. package/dist/src/components/tabs/VerticalTabs.js +1 -1
  447. package/dist/src/components/theme/ChangeStyleVariable.js +1 -1
  448. package/dist/src/components/theme/DarkModeProvider.js +1 -1
  449. package/dist/src/components/theme/LoadingAnimate.js +1 -1
  450. package/dist/src/components/theme/LoadingAnimate.js.map +1 -1
  451. package/dist/src/components/theme/SessionProviders.js +1 -1
  452. package/dist/src/components/theme/signout/SessionExpiresLogout.js +1 -1
  453. package/dist/src/components/theme/signout/SignOutSession.js +1 -1
  454. package/dist/src/components/ui/Action.js +1 -1
  455. package/dist/src/components/ui/Action.js.map +1 -1
  456. package/dist/src/components/ui/Badge.js +1 -1
  457. package/dist/src/components/ui/Badge.js.map +1 -1
  458. package/dist/src/components/ui/ColorPicker.js +1 -1
  459. package/dist/src/components/ui/ComponentLists.js +1 -1
  460. package/dist/src/components/ui/ComponentLists.js.map +1 -1
  461. package/dist/src/components/ui/Dropdown.js +1 -1
  462. package/dist/src/components/ui/OrDivider.js +1 -1
  463. package/dist/src/components/ui/cards/Card.js +1 -1
  464. package/dist/src/components/ui/cards/CardGrid.js +1 -1
  465. package/dist/src/components/ui/cards/CardGrid.js.map +1 -1
  466. package/dist/src/components/ui/cards/CardList.js +1 -1
  467. package/dist/src/components/ui/cards/CardList.js.map +1 -1
  468. package/dist/src/components/ui/cards/FeatureCard.js +1 -1
  469. package/dist/src/components/ui/cards/FeatureCard.js.map +1 -1
  470. package/dist/src/components/ui/cards/HorizontalCard.js +1 -1
  471. package/dist/src/components/ui/cards/HorizontalCard.js.map +1 -1
  472. package/dist/src/components/ui/cards/MediaCard.js +1 -1
  473. package/dist/src/components/ui/cards/MediaCard.js.map +1 -1
  474. package/dist/src/components/ui/cards/PricingCard.js +1 -1
  475. package/dist/src/components/ui/cards/PricingCard.js.map +1 -1
  476. package/dist/src/components/ui/cards/ProfileCard.js +1 -1
  477. package/dist/src/components/ui/cards/ProfileCard.js.map +1 -1
  478. package/dist/src/components/ui/charts/ChartConfigurator.js +1 -1
  479. package/dist/src/components/ui/charts/InstinctHubChart.js +1 -1
  480. package/dist/src/components/ui/charts/InstinctHubChartDashboard.js +1 -1
  481. package/dist/src/components/ui/create-button/CreateButton.js +1 -1
  482. package/dist/src/components/ui/create-button/CreateButtonExample.js +1 -1
  483. package/dist/src/components/ui/create-button/CreateButtonExample.js.map +1 -1
  484. package/dist/src/components/ui/dialogs/Dialog.js +1 -1
  485. package/dist/src/components/ui/editor/CustomTextEditor.js +1 -1
  486. package/dist/src/components/ui/editor/MenuBar.js +1 -1
  487. package/dist/src/components/ui/images/RandomGradientImage.js +1 -1
  488. package/dist/src/components/ui/images/RandomGradientImage.js.map +1 -1
  489. package/dist/src/components/ui/pagination/Pagination.js +1 -1
  490. package/dist/src/components/ui/pagination/PaginationDemo.js +1 -1
  491. package/dist/src/components/ui/tables/IHubTable.js +1 -1
  492. package/dist/src/components/ui/tables/IHubTableServer.js +1 -1
  493. package/dist/src/components/ui/viewer/CodeDisplay.js +1 -1
  494. package/dist/src/components/ui/viewer/ContentViewOrEdit.js +1 -1
  495. package/dist/src/components/ui/viewer/ContentViewer.js +1 -1
  496. package/dist/src/index.js +1 -1
  497. package/dist/src/ssr.js +1 -1
  498. package/dist/src/types/components/auth/IsUsernameEmailTaken.d.ts +13 -0
  499. package/dist/src/types/components/forms/DateInput.d.ts +3 -4
  500. package/dist/src/types/components/forms/FilterObjects.d.ts +1 -1
  501. package/dist/src/types/components/forms/uploads/IhubFileUploader.d.ts +1 -1
  502. package/dist/src/types/components/lib/index.d.ts +1 -1
  503. package/dist/src/types/components/lib/redux/slices/channelSlice/channelDetails.d.ts +1 -1
  504. package/dist/src/types/components/lib/redux/slices/channelSlice/instructorChannelList.d.ts +3 -2
  505. package/dist/src/types/components/lib/redux/slices/courseSlice/courseDetails.d.ts +1 -1
  506. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterDuration.d.ts +1 -1
  507. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterLevel.d.ts +1 -1
  508. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterSubject.d.ts +1 -1
  509. package/dist/src/types/components/lib/redux/slices/courseSlice/courseModules.d.ts +1 -1
  510. package/dist/src/types/components/lib/redux/slices/courseSlice/courseOverview.d.ts +1 -1
  511. package/dist/src/types/components/lib/redux/slices/courseSlice/courseSearch.d.ts +1 -1
  512. package/dist/src/types/components/lib/redux/slices/courseSlice/stepContent.d.ts +1 -1
  513. package/dist/src/types/components/lib/redux/slices/courseSlice/stepQuestions.d.ts +1 -1
  514. package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestamp.d.ts +1 -1
  515. package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestampObject.d.ts +1 -1
  516. package/dist/src/types/components/lib/redux/slices/navigationSlice/IPAdress.d.ts +1 -1
  517. package/dist/src/types/components/status/ReactTimeTracker.d.ts +1 -1
  518. package/dist/src/types/components/tabs/Tabs.d.ts +1 -1
  519. package/dist/src/types/components/tabs/VerticalTabs.d.ts +1 -1
  520. package/dist/src/types/components/theme/signout/SessionExpiresLogout.d.ts +1 -1
  521. package/dist/src/types/components/ui/Action.d.ts +1 -1
  522. package/dist/src/types/types/index.d.ts +4 -0
  523. package/dist/tsconfig.tsbuildinfo +1 -1
  524. package/package.json +26 -9
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e,asyncToGenerator as i,regeneratorRuntime as n,toConsumableArray as r,typeof as c}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{memo as l,useState as o,useEffect as s,useCallback as u}from"react";import{reqOptions as h,API_HOST_URL as d}from"../lib/helpFunction.js";import"../lib/utils.js";import m from"@mui/icons-material/SearchOutlined";import b from"@mui/icons-material/Check";import f from"@mui/icons-material/CloseOutlined";function p(l){var p=l.label,v=l.token,N=l.handle,g=l.setSelected,k=l.appLabel,y=l.modelName,x=l.filterChannel,C=void 0!==x&&x,_=l.limit_query,j=void 0===_?5:_,w=l.limit_select,E=void 0===w?0:w,T=l.options,S=l.key_name,O=void 0===S?"title":S,U=l.placeholder,q=void 0===U?"Search by Username or Email":U,A=l.searchUrl,D=l.selected,G=l.err,H=void 0!==G&&G,P=o(""),R=e(P,2),B=R[0],F=R[1],K=o([]),L=e(K,2),z=L[0],I=L[1],J=o(!1),M=e(J,2),Q=M[0],V=M[1],W=o(null),X=e(W,2),Y=X[0],Z=X[1];s((function(){D&&D.length>0&&0===z.length&&I(D)}),[D]),s((function(){I(T||[])}),[T]);var $=u(i(n().mark((function e(){var i,c,t,a,l;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V(!0),Z(null),i=h("GET",null,v),c=A?A.includes("/?")?"".concat(A,"&search=").concat(B):"".concat(A,"?search=").concat(B):k?"".concat(d,"channels/").concat(N,"/dynamic-search/?app_label=").concat(k,"&model_name=").concat(y,"&value=").concat(B,"&filter_channel=").concat(C):"".concat(d,"auth/").concat(N,"/search-user/").concat(B,"/?limit=").concat(j),e.prev=4,e.next=7,fetch(c,i);case 7:if((t=e.sent).ok){e.next=10;break}throw new Error("HTTP error ".concat(t.status));case 10:return e.next=12,t.json();case 12:a=e.sent,I([].concat(r(a.results||[]),r(T||[]))),e.next=22;break;case 16:e.prev=16,e.t0=e.catch(4),l=e.t0 instanceof Error?e.t0.message:"Unknown error occurred",console.error("Error fetching search results:",l),Z(l),I(r(T||[]));case 22:return e.prev=22,V(!1),e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[4,16,22,25]])}))),[B,v,A,k,y,N,C,j]),ee=u((function(e){"Enter"===e.key&&(e.preventDefault(),$())}),[$]),ie=u((function(){F(""),I(r(T||[])),Z(null)}),[]),ne=u((function(e){return D.some((function(i){return("object"===c(i)?null==i?void 0:i.id:i)===((null==e?void 0:e.username)||(null==e?void 0:e.id))}))}),[D]),re=u((function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.id){var n=D.find((function(i){return i.id===e.id}));i?g(D.filter((function(i){return i.id!==e.id}))):!n&&(0===E||D.length<E)?g([].concat(r(D),[e])):1===E&&g([e])}}),[D,g,E]);return t("div",{className:"ihub-react-search-container",children:a("div",{className:"ihub-react-search card",children:[p&&t("h4",{className:"ihub-fs-sm ihub-mt-2 ihub-mb-2",children:p}),a("div",{className:"ihub-search-input",children:[t("input",{type:"text",placeholder:q,onKeyDown:ee,value:B,onChange:function(e){return F(e.target.value)},disabled:Q}),a("div",{className:"ihub-search-icons",children:[B&&t(f,{onClick:ie,className:"ihub-search-icon ihub-close-icon"}),t(m,{onClick:$,className:"ihub-search-icon ihub-search-button ".concat(Q?"ihub-disabled":"")})]})]}),Q&&t("div",{className:"ihub-loading",children:"Searching..."}),Y&&t("div",{className:"ihub-search-error",children:Y}),a("ul",{className:"ihub-search-results",children:[null==z?void 0:z.map((function(e,i){return a("li",{className:"ihub-search-result-item ihub-valid",onClick:function(){return e&&re(e)},children:[ne(e)&&t(b,{className:"ihub-check-icon",style:{position:"relative",top:"5px",marginRight:"10px"}}),(null==e?void 0:e[O])||(null==e?void 0:e.title)||"",ne(e)?t(f,{className:"ihub-delete-icon ihub-ml-auto",onClick:function(){return e&&re(e,!0)}}):""]},"".concat((null==e?void 0:e.id)||(null==e?void 0:e.username)||i))})),Q||Y||z.length||D.length?"":t("li",{className:"ihub-no-results",children:"No available options"})]}),a("ul",{className:"ihub-selected-options ihub-mt-2 ihub-",children:[t("h4",{className:"ihub-fs-sm ihub-mt-2 ihub-mb-2",children:"Selected Options:"}),D.map((function(e){return a("li",{className:"ihub-fs-sm ihub-border-bottom ihub-pb-2 ihub-flex ihub-items-center",children:[e[O]||e.title,t(f,{className:"ihub-delete-icon ihub-ml-auto",onClick:function(){return re(e,!0)}})]},null==e?void 0:e.id)}))]}),H&&t("p",{className:"ihub-error",children:"This field is required"})]})})}var v=l(p);export{v as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react/jsx-runtime"),n=require("react"),i=require("../lib/helpFunction.js");require("../lib/utils.js");var a=require("@mui/icons-material/SearchOutlined"),t=require("@mui/icons-material/Check"),c=require("@mui/icons-material/CloseOutlined");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(a),u=l(t),o=l(c);function h(a){var t=a.label,c=a.token,l=a.handle,h=a.setSelected,d=a.appLabel,m=a.modelName,b=a.filterChannel,f=void 0!==b&&b,v=a.limit_query,p=void 0===v?5:v,x=a.limit_select,j=void 0===x?0:x,y=a.options,N=a.key_name,k=void 0===N?"title":N,C=a.placeholder,g=void 0===C?"Search by Username or Email":C,_=a.searchUrl,q=a.selected,A=a.err,S=void 0!==A&&A,T=n.useState(""),E=e.slicedToArray(T,2),O=E[0],w=E[1],P=n.useState([]),R=e.slicedToArray(P,2),U=R[0],H=R[1],L=n.useState(!1),D=e.slicedToArray(L,2),G=D[0],I=D[1],B=n.useState(null),F=e.slicedToArray(B,2),K=F[0],M=F[1];n.useEffect((function(){q&&q.length>0&&0===U.length&&H(q)}),[q]),n.useEffect((function(){H(y||[])}),[y]);var z=n.useCallback(e.asyncToGenerator(e.regeneratorRuntime().mark((function r(){var n,a,t,s,u;return e.regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return I(!0),M(null),n=i.reqOptions("GET",null,c),a=_?_.includes("/?")?"".concat(_,"&search=").concat(O):"".concat(_,"?search=").concat(O):d?"".concat(i.API_HOST_URL,"channels/").concat(l,"/dynamic-search/?app_label=").concat(d,"&model_name=").concat(m,"&value=").concat(O,"&filter_channel=").concat(f):"".concat(i.API_HOST_URL,"auth/").concat(l,"/search-user/").concat(O,"/?limit=").concat(p),r.prev=4,r.next=7,fetch(a,n);case 7:if((t=r.sent).ok){r.next=10;break}throw new Error("HTTP error ".concat(t.status));case 10:return r.next=12,t.json();case 12:s=r.sent,H([].concat(e.toConsumableArray(s.results||[]),e.toConsumableArray(y||[]))),r.next=22;break;case 16:r.prev=16,r.t0=r.catch(4),u=r.t0 instanceof Error?r.t0.message:"Unknown error occurred",console.error("Error fetching search results:",u),M(u),H(e.toConsumableArray(y||[]));case 22:return r.prev=22,I(!1),r.finish(22);case 25:case"end":return r.stop()}}),r,null,[[4,16,22,25]])}))),[O,c,_,d,m,l,f,p]),J=n.useCallback((function(e){"Enter"===e.key&&(e.preventDefault(),z())}),[z]),Q=n.useCallback((function(){w(""),H(e.toConsumableArray(y||[])),M(null)}),[]),V=n.useCallback((function(r){return q.some((function(n){return("object"===e.typeof(n)?null==n?void 0:n.id:n)===((null==r?void 0:r.username)||(null==r?void 0:r.id))}))}),[q]),W=n.useCallback((function(r){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r&&r.id){var i=q.find((function(e){return e.id===r.id}));n?h(q.filter((function(e){return e.id!==r.id}))):!i&&(0===j||q.length<j)?h([].concat(e.toConsumableArray(q),[r])):1===j&&h([r])}}),[q,h,j]);return r.jsx("div",{className:"ihub-react-search-container",children:r.jsxs("div",{className:"ihub-react-search card",children:[t&&r.jsx("h4",{className:"ihub-fs-sm ihub-mt-2 ihub-mb-2",children:t}),r.jsxs("div",{className:"ihub-search-input",children:[r.jsx("input",{type:"text",placeholder:g,onKeyDown:J,value:O,onChange:function(e){return w(e.target.value)},disabled:G}),r.jsxs("div",{className:"ihub-search-icons",children:[O&&r.jsx(o.default,{onClick:Q,className:"ihub-search-icon ihub-close-icon"}),r.jsx(s.default,{onClick:z,className:"ihub-search-icon ihub-search-button ".concat(G?"ihub-disabled":"")})]})]}),G&&r.jsx("div",{className:"ihub-loading",children:"Searching..."}),K&&r.jsx("div",{className:"ihub-search-error",children:K}),r.jsxs("ul",{className:"ihub-search-results",children:[null==U?void 0:U.map((function(e,n){return r.jsxs("li",{className:"ihub-search-result-item ihub-valid",onClick:function(){return e&&W(e)},children:[V(e)&&r.jsx(u.default,{className:"ihub-check-icon",style:{position:"relative",top:"5px",marginRight:"10px"}}),(null==e?void 0:e[k])||(null==e?void 0:e.title)||"",V(e)?r.jsx(o.default,{className:"ihub-delete-icon ihub-ml-auto",onClick:function(){return e&&W(e,!0)}}):""]},"".concat((null==e?void 0:e.id)||(null==e?void 0:e.username)||n))})),G||K||U.length||q.length?"":r.jsx("li",{className:"ihub-no-results",children:"No available options"})]}),r.jsxs("ul",{className:"ihub-selected-options ihub-mt-2 ihub-",children:[r.jsx("h4",{className:"ihub-fs-sm ihub-mt-2 ihub-mb-2",children:"Selected Options:"}),q.map((function(e){return r.jsxs("li",{className:"ihub-fs-sm ihub-border-bottom ihub-pb-2 ihub-flex ihub-items-center",children:[e[k]||e.title,r.jsx(o.default,{className:"ihub-delete-icon ihub-ml-auto",onClick:function(){return W(e,!0)}})]},null==e?void 0:e.id)}))]}),S&&r.jsx("p",{className:"ihub-error",children:"This field is required"})]})})}var d=n.memo(h);exports.default=d;
2
2
  //# sourceMappingURL=SearchObjectsFromDB.js.map
@@ -1,2 +1,2 @@
1
- import{objectWithoutProperties as t}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as e,jsxs as r}from"react/jsx-runtime";import i from"react";var s=["step","counts","widths"],a=function(a){var o=a.step,c=a.counts,n=a.widths,l=void 0===n?"400px":n;return t(a,s),e("div",{className:"ihub-progress-bar-container",style:{maxWidth:l},children:c.map((function(t,s){return r(i.Fragment,{children:[e("div",{className:"ihub-progress-step ".concat(o>=t?"ihub-step-active":""),children:t}),c.length!==s+1&&e("div",{className:"ihub-progress-line",style:{width:"calc(100% / ".concat(c.length,")")}})]},s)}))})};export{a as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react/jsx-runtime");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(require("react")),i=["step","counts","widths"];exports.default=function(r){var a=r.step,u=r.counts,n=r.widths,c=void 0===n?"400px":n;return e.objectWithoutProperties(r,i),t.jsx("div",{className:"ihub-progress-bar-container",style:{maxWidth:c},children:u.map((function(e,r){return t.jsxs(s.default.Fragment,{children:[t.jsx("div",{className:"ihub-progress-step ".concat(a>=e?"ihub-step-active":""),children:e}),u.length!==r+1&&t.jsx("div",{className:"ihub-progress-line",style:{width:"calc(100% / ".concat(u.length,")")}})]},r)}))})};
2
2
  //# sourceMappingURL=StepProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepProgressBar.js","sources":["../../../../src/components/forms/StepProgressBar.tsx"],"sourcesContent":["import React from \"react\";\r\n\r\ninterface StepProgressBarProps {\r\n step: number;\r\n counts: number[];\r\n widths?: string;\r\n [key: string]: any;\r\n}\r\n\r\nconst StepProgressBar: React.FC<StepProgressBarProps> = ({ \r\n step, \r\n counts, \r\n widths = \"400px\", \r\n ...props \r\n}) => {\r\n return (\r\n <div className=\"ihub-progress-bar-container\" style={{ maxWidth: widths }}>\r\n {counts.map((num, index) => (\r\n <React.Fragment key={index}>\r\n <div \r\n className={`ihub-progress-step ${step >= num ? \"ihub-step-active\" : \"\"}`}\r\n >\r\n {num}\r\n </div>\r\n {(counts.length !== index + 1) && (\r\n <div \r\n className=\"ihub-progress-line\" \r\n style={{ width: `calc(100% / ${counts.length})` }}\r\n />\r\n )}\r\n </React.Fragment>\r\n ))}\r\n </div>\r\n );\r\n};\r\n\r\nexport default StepProgressBar;"],"names":["StepProgressBar","_ref","step","counts","_ref$widths","widths","_objectWithoutProperties","_excluded","_jsx","className","style","maxWidth","children","map","num","index","_jsxs","React","Fragment","concat","length","width"],"mappings":"iMASMA,EAAkD,SAAnCC,GAKhB,IAJHC,EAAID,EAAJC,KACAC,EAAMF,EAANE,OAAMC,EAAAH,EACNI,OAAAA,OAAS,IAAHD,EAAG,QAAOA,EAGhB,OAFQE,EAAAL,EAAAM,GAGNC,EAAK,MAAA,CAAAC,UAAU,8BAA8BC,MAAO,CAAEC,SAAUN,GAAQO,SACrET,EAAOU,KAAI,SAACC,EAAKC,GAAK,OACrBC,EAACC,EAAMC,SAAQ,CAAAN,SAAA,CACbJ,SACEC,UAAS,sBAAAU,OAAwBjB,GAAQY,EAAM,mBAAqB,IAAIF,SAEvEE,IAEDX,EAAOiB,SAAWL,EAAQ,GAC1BP,EAAA,MAAA,CACEC,UAAU,qBACVC,MAAO,CAAEW,MAAKF,eAAAA,OAAiBhB,EAAOiB,OAAM,UAT7BL,OAgB7B"}
1
+ {"version":3,"file":"StepProgressBar.js","sources":["../../../../src/components/forms/StepProgressBar.tsx"],"sourcesContent":["import React from \"react\";\r\n\r\ninterface StepProgressBarProps {\r\n step: number;\r\n counts: number[];\r\n widths?: string;\r\n [key: string]: any;\r\n}\r\n\r\nconst StepProgressBar: React.FC<StepProgressBarProps> = ({ \r\n step, \r\n counts, \r\n widths = \"400px\", \r\n ...props \r\n}) => {\r\n return (\r\n <div className=\"ihub-progress-bar-container\" style={{ maxWidth: widths }}>\r\n {counts.map((num, index) => (\r\n <React.Fragment key={index}>\r\n <div \r\n className={`ihub-progress-step ${step >= num ? \"ihub-step-active\" : \"\"}`}\r\n >\r\n {num}\r\n </div>\r\n {(counts.length !== index + 1) && (\r\n <div \r\n className=\"ihub-progress-line\" \r\n style={{ width: `calc(100% / ${counts.length})` }}\r\n />\r\n )}\r\n </React.Fragment>\r\n ))}\r\n </div>\r\n );\r\n};\r\n\r\nexport default StepProgressBar;"],"names":["_ref","step","counts","_ref$widths","widths","_objectWithoutProperties","objectWithoutProperties","_excluded","_jsx","className","style","maxWidth","children","map","num","index","_jsxs","jsxs","React","Fragment","concat","length","jsx","width"],"mappings":"kTASwD,SAAnCA,GAKhB,IAJHC,EAAID,EAAJC,KACAC,EAAMF,EAANE,OAAMC,EAAAH,EACNI,OAAAA,OAAS,IAAHD,EAAG,QAAOA,EAGhB,OAFQE,EAAAC,wBAAAN,EAAAO,GAGNC,EAAAA,IAAK,MAAA,CAAAC,UAAU,8BAA8BC,MAAO,CAAEC,SAAUP,GAAQQ,SACrEV,EAAOW,KAAI,SAACC,EAAKC,GAAK,OACrBC,EAACC,KAAAC,EAAK,QAACC,SAAQ,CAAAP,SAAA,CACbJ,aACEC,UAAS,sBAAAW,OAAwBnB,GAAQa,EAAM,mBAAqB,IAAIF,SAEvEE,IAEDZ,EAAOmB,SAAWN,EAAQ,GAC1BP,EAAAc,IAAA,MAAA,CACEb,UAAU,qBACVC,MAAO,CAAEa,MAAKH,eAAAA,OAAiBlB,EAAOmB,OAAM,UAT7BN,OAgB7B"}
@@ -1,2 +1,2 @@
1
- import{slicedToArray as i}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{forwardRef as e,useState as n,useEffect as r,useCallback as o}from"react";import s from"@mui/icons-material/ChevronRight";var c=e((function(e,c){var u=e.label,l=e.status,m=void 0===l?1:l,d=e.type,b=void 0===d?"submit":d,f=e.name,v=e.variant,p=void 0===v?"important":v,h=e.disabled,g=void 0!==h&&h,w=e.onClick,z=e.autoResetTimeout,y=void 0===z?3e4:z,N=e.className,x=void 0===N?"":N,B=e.ariaLabel,T=e.id,C=void 0===T?"submitBtn":T,M=e.testId,j=void 0===M?"submit-button":M,k=n(m),R=i(k,2),S=R[0],_=R[1];r((function(){_(m)}),[m]),r((function(){if(0===S&&y>0){var i=setTimeout((function(){_(1)}),y);return function(){return clearTimeout(i)}}}),[S,y]);var A=o((function(i){w&&w(i)}),[w]),H=0===S,I=g||H;return t("div",{className:"ihub-submit-btn-wrapper",children:a("button",{ref:c,type:b,name:f,id:C,"data-testid":j,className:"ihub-submit-btn ".concat(p,"-btn ihub-anime-button-chevron ").concat(H?"ihub-rolling":""," ").concat(x),disabled:I,onClick:A,"aria-label":B||("string"==typeof u?u:""),"aria-busy":H,children:[H&&t("svg",{className:"ihub-bt-spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512","aria-hidden":"true",role:"presentation",fill:"#fff",children:t("path",{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"})}),u,"icon"!==p&&t(s,{fill:"#fff",id:"animate",width:"16",height:"16"})]})})}));c.displayName="SubmitButton";export{c as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react/jsx-runtime"),i=require("react");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(require("@mui/icons-material/ChevronRight")),n=i.forwardRef((function(a,n){var s=a.label,u=a.status,o=void 0===u?1:u,c=a.type,l=void 0===c?"submit":c,d=a.name,f=a.variant,b=void 0===f?"important":f,m=a.disabled,v=void 0!==m&&m,h=a.onClick,p=a.autoResetTimeout,x=void 0===p?3e4:p,j=a.className,g=void 0===j?"":j,w=a.ariaLabel,y=a.id,z=void 0===y?"submitBtn":y,N=a.testId,q=void 0===N?"submit-button":N,B=i.useState(o),C=e.slicedToArray(B,2),M=C[0],T=C[1];i.useEffect((function(){T(o)}),[o]),i.useEffect((function(){if(0===M&&x>0){var e=setTimeout((function(){T(1)}),x);return function(){return clearTimeout(e)}}}),[M,x]);var _=i.useCallback((function(e){h&&h(e)}),[h]),k=0===M,R=v||k;return t.jsx("div",{className:"ihub-submit-btn-wrapper",children:t.jsxs("button",{ref:n,type:l,name:d,id:z,"data-testid":q,className:"ihub-submit-btn ".concat(b,"-btn ihub-anime-button-chevron ").concat(k?"ihub-rolling":""," ").concat(g),disabled:R,onClick:_,"aria-label":w||("string"==typeof s?s:""),"aria-busy":k,children:[k&&t.jsx("svg",{className:"ihub-bt-spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512","aria-hidden":"true",role:"presentation",fill:"#fff",children:t.jsx("path",{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"})}),s,"icon"!==b&&t.jsx(r.default,{fill:"#fff",id:"animate",width:"16",height:"16"})]})})}));n.displayName="SubmitButton",exports.default=n;
2
2
  //# sourceMappingURL=SubmitButton.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"@mui/icons-material/GroupWorkOutlined";var i=function(){return e("tr",{children:e("td",{colSpan:99,children:r("div",{className:"ihub-empty-state",children:[e(t,{}),e("h4",{children:"No Data"}),e("p",{children:"You have no cohort with the selected category."})]})})})};export{i as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("@mui/icons-material/GroupWorkOutlined"));exports.default=function(){return e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsxs("div",{className:"ihub-empty-state",children:[e.jsx(r.default,{}),e.jsx("h4",{children:"No Data"}),e.jsx("p",{children:"You have no cohort with the selected category."})]})})})};
2
2
  //# sourceMappingURL=TBodyNoData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TBodyNoData.js","sources":["../../../../src/components/forms/TBodyNoData.tsx"],"sourcesContent":["import React from \"react\";\r\nimport GroupWorkOutlinedIcon from \"@mui/icons-material/GroupWorkOutlined\";\r\n\r\nconst TBodyNoData: React.FC = () => {\r\n return (\r\n <tr>\r\n <td colSpan={99}>\r\n <div className=\"ihub-empty-state\">\r\n <GroupWorkOutlinedIcon />\r\n <h4>No Data</h4>\r\n <p>You have no cohort with the selected category.</p>\r\n </div>\r\n </td>\r\n </tr>\r\n );\r\n};\r\n\r\nexport default TBodyNoData;\r\n"],"names":["TBodyNoData","_jsx","colSpan","children","_jsxs","className","GroupWorkOutlinedIcon"],"mappings":"uGAGA,IAAMA,EAAwB,WAC5B,OACEC,iBACEA,EAAI,KAAA,CAAAC,QAAS,GAAEC,SACbC,EAAK,MAAA,CAAAC,UAAU,6BACbJ,EAACK,EAAwB,CAAA,GACzBL,EAAgB,KAAA,CAAAE,SAAA,YAChBF,yEAKV"}
1
+ {"version":3,"file":"TBodyNoData.js","sources":["../../../../src/components/forms/TBodyNoData.tsx"],"sourcesContent":["import React from \"react\";\r\nimport GroupWorkOutlinedIcon from \"@mui/icons-material/GroupWorkOutlined\";\r\n\r\nconst TBodyNoData: React.FC = () => {\r\n return (\r\n <tr>\r\n <td colSpan={99}>\r\n <div className=\"ihub-empty-state\">\r\n <GroupWorkOutlinedIcon />\r\n <h4>No Data</h4>\r\n <p>You have no cohort with the selected category.</p>\r\n </div>\r\n </td>\r\n </tr>\r\n );\r\n};\r\n\r\nexport default TBodyNoData;\r\n"],"names":["_jsx","jsx","colSpan","children","_jsxs","jsxs","className","GroupWorkOutlinedIcon"],"mappings":"yPAG8B,WAC5B,OACEA,EAAAA,mBACEA,EAAIC,IAAA,KAAA,CAAAC,QAAS,GAAEC,SACbC,EAAKC,KAAA,MAAA,CAAAC,UAAU,6BACbN,EAAAA,IAACO,EAAAA,QAAwB,CAAA,GACzBP,EAAgBC,IAAA,KAAA,CAAAE,SAAA,YAChBH,6EAKV"}
@@ -1,2 +1,2 @@
1
- import{jsxs as r,jsx as t}from"react/jsx-runtime";import i from"@mui/icons-material/ArrowDownwardOutlined";import o from"@mui/icons-material/ArrowUpwardOutlined";var e=function(e){var a=e.keys,n=e.labels,d=e.sorted,m=e.widths,s=void 0===m?"auto":m,u=e.handleSort;return r("th",{onClick:function(){return u(a)},className:"ihub-thead-sort ".concat(d===a?"ihub-sorted":""),style:{minWidth:s},children:[n,t(d!==a?i:o,{})]})};export{e as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@mui/icons-material/ArrowDownwardOutlined"),r=require("@mui/icons-material/ArrowUpwardOutlined");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=i(t),a=i(r);exports.default=function(t){var r=t.keys,i=t.labels,n=t.sorted,o=t.widths,s=void 0===o?"auto":o,d=t.handleSort;return e.jsxs("th",{onClick:function(){return d(r)},className:"ihub-thead-sort ".concat(n===r?"ihub-sorted":""),style:{minWidth:s},children:[i,n!==r?e.jsx(u.default,{}):e.jsx(a.default,{})]})};
2
2
  //# sourceMappingURL=THeadSortBtn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"THeadSortBtn.js","sources":["../../../../src/components/forms/THeadSortBtn.tsx"],"sourcesContent":["import React from \"react\";\r\nimport ArrowDownwardOutlinedIcon from \"@mui/icons-material/ArrowDownwardOutlined\";\r\nimport ArrowUpwardOutlinedIcon from \"@mui/icons-material/ArrowUpwardOutlined\";\r\n\r\n/**\r\n * Props interface for the THeadSortBtn component\r\n * @interface THeadSortBtnProps\r\n */\r\ninterface THeadSortBtnProps {\r\n /** The key used for sorting */\r\n keys: string;\r\n /** The content to display in the table header */\r\n labels: React.ReactNode;\r\n /** The currently sorted column key */\r\n sorted: string;\r\n /** Optional minimum width for the column */\r\n widths?: string;\r\n /** Function to call when clicking the sort button */\r\n handleSort: (key: string) => void;\r\n}\r\n\r\n/**\r\n * A sortable table header component with up/down arrows to indicate sort direction\r\n *\r\n * @param {THeadSortBtnProps} props - Component props\r\n * @returns {JSX.Element} - Rendered component\r\n */\r\nconst THeadSortBtn: React.FC<THeadSortBtnProps> = ({\r\n keys,\r\n labels,\r\n sorted,\r\n widths = \"auto\",\r\n handleSort,\r\n}) => {\r\n return (\r\n <th\r\n onClick={() => handleSort(keys)}\r\n className={`ihub-thead-sort ${sorted === keys ? \"ihub-sorted\" : \"\"}`}\r\n style={{ minWidth: widths }}\r\n >\r\n {labels}\r\n {sorted !== keys ? (\r\n <ArrowDownwardOutlinedIcon />\r\n ) : (\r\n <ArrowUpwardOutlinedIcon />\r\n )}\r\n </th>\r\n );\r\n};\r\n\r\nexport default THeadSortBtn;\r\n"],"names":["THeadSortBtn","_ref","keys","labels","sorted","_ref$widths","widths","handleSort","_jsxs","onClick","className","concat","style","minWidth","children","_jsx","ArrowDownwardOutlinedIcon","ArrowUpwardOutlinedIcon"],"mappings":"kKA2BA,IAAMA,EAA4C,SAAhCC,GAMb,IALHC,EAAID,EAAJC,KACAC,EAAMF,EAANE,OACAC,EAAMH,EAANG,OAAMC,EAAAJ,EACNK,OAAAA,OAAS,IAAHD,EAAG,OAAMA,EACfE,EAAUN,EAAVM,WAEA,OACEC,EACE,KAAA,CAAAC,QAAS,WAAF,OAAQF,EAAWL,EAAK,EAC/BQ,UAAS,mBAAAC,OAAqBP,IAAWF,EAAO,cAAgB,IAChEU,MAAO,CAAEC,SAAUP,GAElBQ,SAAA,CAAAX,EAECY,EADDX,IAAWF,EACTc,EAEAC,EAF4B,CAAA,KAMrC"}
1
+ {"version":3,"file":"THeadSortBtn.js","sources":["../../../../src/components/forms/THeadSortBtn.tsx"],"sourcesContent":["import React from \"react\";\r\nimport ArrowDownwardOutlinedIcon from \"@mui/icons-material/ArrowDownwardOutlined\";\r\nimport ArrowUpwardOutlinedIcon from \"@mui/icons-material/ArrowUpwardOutlined\";\r\n\r\n/**\r\n * Props interface for the THeadSortBtn component\r\n * @interface THeadSortBtnProps\r\n */\r\ninterface THeadSortBtnProps {\r\n /** The key used for sorting */\r\n keys: string;\r\n /** The content to display in the table header */\r\n labels: React.ReactNode;\r\n /** The currently sorted column key */\r\n sorted: string;\r\n /** Optional minimum width for the column */\r\n widths?: string;\r\n /** Function to call when clicking the sort button */\r\n handleSort: (key: string) => void;\r\n}\r\n\r\n/**\r\n * A sortable table header component with up/down arrows to indicate sort direction\r\n *\r\n * @param {THeadSortBtnProps} props - Component props\r\n * @returns {JSX.Element} - Rendered component\r\n */\r\nconst THeadSortBtn: React.FC<THeadSortBtnProps> = ({\r\n keys,\r\n labels,\r\n sorted,\r\n widths = \"auto\",\r\n handleSort,\r\n}) => {\r\n return (\r\n <th\r\n onClick={() => handleSort(keys)}\r\n className={`ihub-thead-sort ${sorted === keys ? \"ihub-sorted\" : \"\"}`}\r\n style={{ minWidth: widths }}\r\n >\r\n {labels}\r\n {sorted !== keys ? (\r\n <ArrowDownwardOutlinedIcon />\r\n ) : (\r\n <ArrowUpwardOutlinedIcon />\r\n )}\r\n </th>\r\n );\r\n};\r\n\r\nexport default THeadSortBtn;\r\n"],"names":["_ref","keys","labels","sorted","_ref$widths","widths","handleSort","_jsxs","onClick","className","concat","style","minWidth","children","_jsx","jsx","ArrowDownwardOutlinedIcon","ArrowUpwardOutlinedIcon"],"mappings":"6TA2BkD,SAAhCA,GAMb,IALHC,EAAID,EAAJC,KACAC,EAAMF,EAANE,OACAC,EAAMH,EAANG,OAAMC,EAAAJ,EACNK,OAAAA,OAAS,IAAHD,EAAG,OAAMA,EACfE,EAAUN,EAAVM,WAEA,OACEC,EAAAA,KACE,KAAA,CAAAC,QAAS,WAAF,OAAQF,EAAWL,EAAK,EAC/BQ,UAAS,mBAAAC,OAAqBP,IAAWF,EAAO,cAAgB,IAChEU,MAAO,CAAEC,SAAUP,GAElBQ,SAAA,CAAAX,EACAC,IAAWF,EACVa,EAACC,IAAAC,UAA4B,CAAA,GAE7BF,EAAAA,IAACG,EAAuB,QAAG,CAAA,KAInC"}
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e,asyncToGenerator as r,regeneratorRuntime as t,toConsumableArray as a}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as n}from"react/jsx-runtime";import{useState as o}from"react";import{reqOptions as s,fetchAPI as l}from"../lib/helpFunction.js";import i from"./THeadSortBtn.js";var u=function(u){var c=o(!1),h=e(c,2),m=h[0],d=h[1],p=o(""),f=e(p,2),b=f[0],y=f[1],k=s("GET",null,u.token,!1,u.handle),v=function(){var e=r(t().mark((function e(r){var n,o,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],m){e.next=8;break}return e.next=4,l(d,"".concat(u.urlPath,"?limit=36500"),k,!0);case 4:o=e.sent,n=a(o.results),e.next=9;break;case 8:n=a(m.results);case 9:r===b?(u.onChange&&u.onChange(u.urlPath,!0),y("")):(s=r.replaceAll(" ","_").toLowerCase(),n.sort((function(e,r){var t=e[s],a=r[s];return t>a?-1:t<a?1:0})),u.setData(n),u.setNext(""),y(r));case 10:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();return n("thead",{children:n("tr",{children:u.headerItems.map((function(e,r){return e.key?n(i,{handleSort:v,sorted:b,labels:e.label,keys:e.key,widths:e.width},r):n("th",{style:{minWidth:e.width||"auto"},children:e.label},r)}))})})};export{u as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react/jsx-runtime"),t=require("react"),n=require("../lib/helpFunction.js"),a=require("./THeadSortBtn.js");exports.default=function(s){var u=t.useState(!1),l=e.slicedToArray(u,2),i=l[0],o=l[1],c=t.useState(""),d=e.slicedToArray(c,2),h=d[0],p=d[1],f=n.reqOptions("GET",null,s.token,!1,s.handle),x=function(){var r=e.asyncToGenerator(e.regeneratorRuntime().mark((function r(t){var a,u,l;return e.regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=[],i){r.next=8;break}return r.next=4,n.fetchAPI(o,"".concat(s.urlPath,"?limit=36500"),f,!0);case 4:u=r.sent,a=e.toConsumableArray(u.results),r.next=9;break;case 8:a=e.toConsumableArray(i.results);case 9:t===h?(s.onChange&&s.onChange(s.urlPath,!0),p("")):(l=t.replaceAll(" ","_").toLowerCase(),a.sort((function(e,r){var t=e[l],n=r[l];return t>n?-1:t<n?1:0})),s.setData(a),s.setNext(""),p(t));case 10:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}();return r.jsx("thead",{children:r.jsx("tr",{children:s.headerItems.map((function(e,t){return e.key?r.jsx(a.default,{handleSort:x,sorted:h,labels:e.label,keys:e.key,widths:e.width},t):r.jsx("th",{style:{minWidth:e.width||"auto"},children:e.label},t)}))})})};
2
2
  //# sourceMappingURL=THeadSortList.js.map
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as r}from"react/jsx-runtime";import{useState as i,useMemo as l}from"react";var a=function(a){var n=a.data,c=i(""),o=e(c,2),u=o[0],d=o[1],h=l((function(){return n.filter((function(e){return e.title.toLowerCase().includes(u.toLowerCase())}))}),[n,u]);return t("div",{className:"ihub-table-container",children:[r("div",{className:"ihub-table-filter",children:r("input",{type:"text",placeholder:"Filter by title...",value:u,onChange:function(e){d(e.target.value)},className:"ihub-table-filter-input"})}),t("table",{className:"ihub-table",children:[r("thead",{children:t("tr",{children:[r("th",{children:"No"}),r("th",{children:"Column 1"})]})}),r("tbody",{children:h.map((function(e,i){return t("tr",{children:[r("td",{children:i+1}),r("td",{children:e.title})]},e.id)}))})]})]})};export{a as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react/jsx-runtime"),r=require("react");exports.default=function(i){var l=i.data,s=r.useState(""),n=e.slicedToArray(s,2),a=n[0],u=n[1],c=r.useMemo((function(){return l.filter((function(e){return e.title.toLowerCase().includes(a.toLowerCase())}))}),[l,a]);return t.jsxs("div",{className:"ihub-table-container",children:[t.jsx("div",{className:"ihub-table-filter",children:t.jsx("input",{type:"text",placeholder:"Filter by title...",value:a,onChange:function(e){u(e.target.value)},className:"ihub-table-filter-input"})}),t.jsxs("table",{className:"ihub-table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"No"}),t.jsx("th",{children:"Column 1"})]})}),t.jsx("tbody",{children:c.map((function(e,r){return t.jsxs("tr",{children:[t.jsx("td",{children:r+1}),t.jsx("td",{children:e.title})]},e.id)}))})]})]})};
2
2
  //# sourceMappingURL=Tables.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as a}from"react/jsx-runtime";var l=function(l){return e("div",{className:l.name,children:[a("div",{className:"ihub-field",children:e("div",{className:"ihub-textarea-wrapper ".concat(l.defaultValue?"ihub-value":""),children:[a("textarea",{name:l.name,rows:l.rows,defaultValue:l.defaultValue,className:"ihub-textarea ".concat(l.clasName||""),disabled:l.disabled,required:l.required,onChange:function(e){l.setValue&&l.setValue(e.target.value),l.onChange&&l.onChange(e),function(e){var a,l;e.target.value?null===(a=e.target.parentElement)||void 0===a||a.classList.add("ihub-value"):null===(l=e.target.parentElement)||void 0===l||l.classList.remove("ihub-value")}(e)},placeholder:l.placeholder,maxLength:void 0!==l.maxLength?Number(l.maxLength):void 0}),a("span",{className:"ihub-textarea-label",children:l.label})]})}),l.helperText&&!l.error&&a("p",{className:"ihub-notes",children:l.helperText}),l.error&&a("p",{className:"ihub-notes ihub-is_invalid",children:l.error}),l.note&&a("p",{className:"ihub-input-notes",id:"".concat(l.id,"-note"),children:l.note})]})};export{l as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");exports.default=function(a){return e.jsxs("div",{className:a.name,children:[e.jsx("div",{className:"ihub-field",children:e.jsxs("div",{className:"ihub-textarea-wrapper ".concat(a.defaultValue?"ihub-value":""),children:[e.jsx("textarea",{name:a.name,rows:a.rows,defaultValue:a.defaultValue,className:"ihub-textarea ".concat(a.clasName||""),disabled:a.disabled,required:a.required,onChange:function(e){a.setValue&&a.setValue(e.target.value),a.onChange&&a.onChange(e),function(e){var a,t;e.target.value?null===(a=e.target.parentElement)||void 0===a||a.classList.add("ihub-value"):null===(t=e.target.parentElement)||void 0===t||t.classList.remove("ihub-value")}(e)},placeholder:a.placeholder,maxLength:void 0!==a.maxLength?Number(a.maxLength):void 0}),e.jsx("span",{className:"ihub-textarea-label",children:a.label})]})}),a.helperText&&!a.error&&e.jsx("p",{className:"ihub-notes",children:a.helperText}),a.error&&e.jsx("p",{className:"ihub-notes ihub-is_invalid",children:a.error}),a.note&&e.jsx("p",{className:"ihub-input-notes",id:"".concat(a.id,"-note"),children:a.note})]})};
2
2
  //# sourceMappingURL=TextArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sources":["../../../../src/components/forms/TextArea.tsx"],"sourcesContent":["import React from \"react\";\r\n\r\ninterface TextAreaProps {\r\n name: string;\r\n label: string;\r\n required?: boolean;\r\n disabled?: boolean;\r\n rows?: number;\r\n defaultValue?: string;\r\n placeholder?: string;\r\n clasName?: string;\r\n maxLength?: number | string;\r\n note?: string;\r\n error?: string;\r\n helperText?: string;\r\n id?: string;\r\n setValue?: (value: string) => void;\r\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\r\n}\r\n\r\n/**\r\n * TextArea component\r\n * @example\r\n * ```tsx\r\n * <TextArea\r\n * name=\"textArea\"\r\n * label=\"Text Area\"\r\n * rows={10}\r\n * defaultValue=\"Default value\"\r\n * />\r\n * ```\r\n * Props interface for the TextArea component\r\n * @property {string} name - The name of the TextArea\r\n * @property {string} label - The label of the TextArea\r\n * @property {boolean} [required] - Whether the TextArea is required\r\n * @property {boolean} [disabled] - Whether the TextArea is disabled\r\n * @property {number} rows - The number of rows of the TextArea\r\n * @property {string} defaultValue - The default value of the TextArea\r\n * @property {string} placeholder - The placeholder of the TextArea\r\n * @property {string} [clasName] - The class name of the TextArea\r\n * @property {number | string} maxLength - The max length of the TextArea\r\n * @property {string} note - The note of the TextArea\r\n * @property {string} error - The error message of the TextArea\r\n * @property {string} helperText - The helper text of the TextArea\r\n * @property {string} id - The id of the TextArea\r\n * @property {(value: string) => void} setValue - The function to set the value of the TextArea\r\n * @property {(e: React.ChangeEvent<HTMLTextAreaElement>) => void} onChange - The function to handle the change of the TextArea\r\n * @returns {React.ReactElement} The TextArea component\r\n */\r\nconst TextArea: React.FC<TextAreaProps> = (props) => {\r\n const showLabel = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\r\n if (e.target.value) e.target.parentElement?.classList.add(\"ihub-value\");\r\n else e.target.parentElement?.classList.remove(\"ihub-value\");\r\n };\r\n\r\n const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\r\n if (props.setValue) props.setValue(e.target.value);\r\n if (props.onChange) props.onChange(e);\r\n showLabel(e);\r\n };\r\n\r\n return (\r\n <div className={props.name}>\r\n <div className=\"ihub-field\">\r\n <div\r\n className={`ihub-textarea-wrapper ${\r\n props.defaultValue ? \"ihub-value\" : \"\"\r\n }`}\r\n >\r\n <textarea\r\n name={props.name}\r\n rows={props.rows}\r\n defaultValue={props.defaultValue}\r\n className={`ihub-textarea ${props.clasName || \"\"}`}\r\n disabled={props.disabled}\r\n required={props.required}\r\n onChange={handleInput}\r\n placeholder={props.placeholder}\r\n maxLength={\r\n props.maxLength !== undefined\r\n ? Number(props.maxLength)\r\n : undefined\r\n }\r\n ></textarea>\r\n <span className=\"ihub-textarea-label\">{props.label}</span>\r\n </div>\r\n </div>\r\n {props.helperText && !props.error && <p className=\"ihub-notes\">{props.helperText}</p>}\r\n\r\n {props.error && <p className=\"ihub-notes ihub-is_invalid\">{props.error}</p>}\r\n\r\n {props.note && (\r\n <p className=\"ihub-input-notes\" id={`${props.id}-note`}>\r\n {props.note}\r\n </p>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default TextArea;\r\n"],"names":["TextArea","props","_jsxs","className","name","children","_jsx","concat","defaultValue","rows","clasName","disabled","required","onChange","e","setValue","target","value","_e$target$parentEleme","_e$target$parentEleme2","parentElement","classList","add","remove","showLabel","placeholder","maxLength","undefined","Number","label","helperText","error","note","id"],"mappings":"kDAiDA,IAAMA,EAAoC,SAACC,GAYzC,OACEC,EAAK,MAAA,CAAAC,UAAWF,EAAMG,KACpBC,SAAA,CAAAC,EAAA,MAAA,CAAKH,UAAU,aACbE,SAAAH,EAAA,MAAA,CACEC,UAAS,yBAAAI,OACPN,EAAMO,aAAe,aAAe,IAGtCH,SAAA,CAAAC,EAAA,WAAA,CACEF,KAAMH,EAAMG,KACZK,KAAMR,EAAMQ,KACZD,aAAcP,EAAMO,aACpBL,UAAS,iBAAAI,OAAmBN,EAAMS,UAAY,IAC9CC,SAAUV,EAAMU,SAChBC,SAAUX,EAAMW,SAChBC,SArBU,SAACC,GACfb,EAAMc,UAAUd,EAAMc,SAASD,EAAEE,OAAOC,OACxChB,EAAMY,UAAUZ,EAAMY,SAASC,GAPnB,SAACA,GAAmD,IAAAI,EAAAC,EAChEL,EAAEE,OAAOC,MAA6BC,QAAtBA,EAAAJ,EAAEE,OAAOI,yBAAaF,GAAtBA,EAAwBG,UAAUC,IAAI,cAC/BH,QAAtBA,EAAAL,EAAEE,OAAOI,yBAAaD,GAAtBA,EAAwBE,UAAUE,OAAO,cAM9CC,CAAUV,IAmBFW,YAAaxB,EAAMwB,YACnBC,eACsBC,IAApB1B,EAAMyB,UACFE,OAAO3B,EAAMyB,gBACbC,IAGRrB,UAAMH,UAAU,sBAAqBE,SAAEJ,EAAM4B,aAGhD5B,EAAM6B,aAAe7B,EAAM8B,OAASzB,EAAG,IAAA,CAAAH,UAAU,sBAAcF,EAAM6B,aAErE7B,EAAM8B,OAASzB,EAAG,IAAA,CAAAH,UAAU,sCAA8BF,EAAM8B,QAEhE9B,EAAM+B,MACL1B,EAAG,IAAA,CAAAH,UAAU,mBAAmB8B,MAAE1B,OAAKN,EAAMgC,GAAS,SACnD5B,SAAAJ,EAAM+B,SAKjB"}
1
+ {"version":3,"file":"TextArea.js","sources":["../../../../src/components/forms/TextArea.tsx"],"sourcesContent":["import React from \"react\";\r\n\r\ninterface TextAreaProps {\r\n name: string;\r\n label: string;\r\n required?: boolean;\r\n disabled?: boolean;\r\n rows?: number;\r\n defaultValue?: string;\r\n placeholder?: string;\r\n clasName?: string;\r\n maxLength?: number | string;\r\n note?: string;\r\n error?: string;\r\n helperText?: string;\r\n id?: string;\r\n setValue?: (value: string) => void;\r\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\r\n}\r\n\r\n/**\r\n * TextArea component\r\n * @example\r\n * ```tsx\r\n * <TextArea\r\n * name=\"textArea\"\r\n * label=\"Text Area\"\r\n * rows={10}\r\n * defaultValue=\"Default value\"\r\n * />\r\n * ```\r\n * Props interface for the TextArea component\r\n * @property {string} name - The name of the TextArea\r\n * @property {string} label - The label of the TextArea\r\n * @property {boolean} [required] - Whether the TextArea is required\r\n * @property {boolean} [disabled] - Whether the TextArea is disabled\r\n * @property {number} rows - The number of rows of the TextArea\r\n * @property {string} defaultValue - The default value of the TextArea\r\n * @property {string} placeholder - The placeholder of the TextArea\r\n * @property {string} [clasName] - The class name of the TextArea\r\n * @property {number | string} maxLength - The max length of the TextArea\r\n * @property {string} note - The note of the TextArea\r\n * @property {string} error - The error message of the TextArea\r\n * @property {string} helperText - The helper text of the TextArea\r\n * @property {string} id - The id of the TextArea\r\n * @property {(value: string) => void} setValue - The function to set the value of the TextArea\r\n * @property {(e: React.ChangeEvent<HTMLTextAreaElement>) => void} onChange - The function to handle the change of the TextArea\r\n * @returns {React.ReactElement} The TextArea component\r\n */\r\nconst TextArea: React.FC<TextAreaProps> = (props) => {\r\n const showLabel = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\r\n if (e.target.value) e.target.parentElement?.classList.add(\"ihub-value\");\r\n else e.target.parentElement?.classList.remove(\"ihub-value\");\r\n };\r\n\r\n const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\r\n if (props.setValue) props.setValue(e.target.value);\r\n if (props.onChange) props.onChange(e);\r\n showLabel(e);\r\n };\r\n\r\n return (\r\n <div className={props.name}>\r\n <div className=\"ihub-field\">\r\n <div\r\n className={`ihub-textarea-wrapper ${\r\n props.defaultValue ? \"ihub-value\" : \"\"\r\n }`}\r\n >\r\n <textarea\r\n name={props.name}\r\n rows={props.rows}\r\n defaultValue={props.defaultValue}\r\n className={`ihub-textarea ${props.clasName || \"\"}`}\r\n disabled={props.disabled}\r\n required={props.required}\r\n onChange={handleInput}\r\n placeholder={props.placeholder}\r\n maxLength={\r\n props.maxLength !== undefined\r\n ? Number(props.maxLength)\r\n : undefined\r\n }\r\n ></textarea>\r\n <span className=\"ihub-textarea-label\">{props.label}</span>\r\n </div>\r\n </div>\r\n {props.helperText && !props.error && <p className=\"ihub-notes\">{props.helperText}</p>}\r\n\r\n {props.error && <p className=\"ihub-notes ihub-is_invalid\">{props.error}</p>}\r\n\r\n {props.note && (\r\n <p className=\"ihub-input-notes\" id={`${props.id}-note`}>\r\n {props.note}\r\n </p>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default TextArea;\r\n"],"names":["props","_jsxs","className","name","children","_jsx","jsx","jsxs","concat","defaultValue","rows","clasName","disabled","required","onChange","e","setValue","target","value","_e$target$parentEleme","_e$target$parentEleme2","parentElement","classList","add","remove","showLabel","placeholder","maxLength","undefined","Number","label","helperText","error","note","id"],"mappings":"uHAiD0C,SAACA,GAYzC,OACEC,EAAAA,KAAK,MAAA,CAAAC,UAAWF,EAAMG,KACpBC,SAAA,CAAAC,EAAAC,IAAA,MAAA,CAAKJ,UAAU,aACbE,SAAAH,EAAAM,KAAA,MAAA,CACEL,UAAS,yBAAAM,OACPR,EAAMS,aAAe,aAAe,IAGtCL,SAAA,CAAAC,EAAAC,IAAA,WAAA,CACEH,KAAMH,EAAMG,KACZO,KAAMV,EAAMU,KACZD,aAAcT,EAAMS,aACpBP,UAAS,iBAAAM,OAAmBR,EAAMW,UAAY,IAC9CC,SAAUZ,EAAMY,SAChBC,SAAUb,EAAMa,SAChBC,SArBU,SAACC,GACff,EAAMgB,UAAUhB,EAAMgB,SAASD,EAAEE,OAAOC,OACxClB,EAAMc,UAAUd,EAAMc,SAASC,GAPnB,SAACA,GAAmD,IAAAI,EAAAC,EAChEL,EAAEE,OAAOC,MAA6BC,QAAtBA,EAAAJ,EAAEE,OAAOI,yBAAaF,GAAtBA,EAAwBG,UAAUC,IAAI,cAC/BH,QAAtBA,EAAAL,EAAEE,OAAOI,yBAAaD,GAAtBA,EAAwBE,UAAUE,OAAO,cAM9CC,CAAUV,IAmBFW,YAAa1B,EAAM0B,YACnBC,eACsBC,IAApB5B,EAAM2B,UACFE,OAAO7B,EAAM2B,gBACbC,IAGRvB,cAAMH,UAAU,sBAAqBE,SAAEJ,EAAM8B,aAGhD9B,EAAM+B,aAAe/B,EAAMgC,OAAS3B,EAAGC,IAAA,IAAA,CAAAJ,UAAU,sBAAcF,EAAM+B,aAErE/B,EAAMgC,OAAS3B,EAAAA,IAAG,IAAA,CAAAH,UAAU,sCAA8BF,EAAMgC,QAEhEhC,EAAMiC,MACL5B,EAAAA,IAAG,IAAA,CAAAH,UAAU,mBAAmBgC,MAAE1B,OAAKR,EAAMkC,GAAS,SACnD9B,SAAAJ,EAAMiC,SAKjB"}
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useRef as t}from"react";function r(r){var l=t(null);return e("div",{className:"ihub-field-container ".concat(r.name),children:a("div",{className:"ihub-field",children:[a("div",{className:"ihub-wrapper ".concat(void 0!==r.defaultValue||!1===r.defaultValue||r.active||"file"===r.type?"ihub-value":""),"data-text-transform":r.TextTransform||"none",children:[e("input",{ref:l,type:r.type,name:r.name,required:r.required,defaultValue:"boolean"==typeof r.defaultValue?r.defaultValue.toString():r.defaultValue,id:r.id,maxLength:r.maxLength,onChange:function(e){l.current&&"lowercase"===r.TextTransform&&(l.current.value=l.current.value.toLowerCase());var a=e.target.value;"tel"===r.type&&((a=a.replace(/[^0-9+]/g,"")).includes("+")&&(a="+"+a.replace(/[^0-9]/g,"")),a.length>15&&(a=a.slice(0,15)),e.target.value=a),r.setValue&&r.setValue(a),r.onChange&&r.onChange(e),r.inputTarget&&r.inputTarget(e.target),r.setNameValue&&r.setNameValue(r.name,a),r.setArrayProps&&r.arrayProps&&r.setArrayProps(r.arrayProps,a),function(e){var a,t;e.target.value?null===(a=e.target.parentElement)||void 0===a||a.classList.add("ihub-value"):null===(t=e.target.parentElement)||void 0===t||t.classList.remove("ihub-value")}(e)},className:"ihub-input ".concat("auto"===r.width?"ihub-width-auto":""),readOnly:!!r.disabled&&r.disabled}),e("span",{className:"ihub-text-label",children:r.label})]}),r.note&&e("p",{className:"ihub-input-notes",children:r.note})]})})}export{r as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react");exports.default=function(t){var r=a.useRef(null);return e.jsx("div",{className:"ihub-field-container ".concat(t.name),children:e.jsxs("div",{className:"ihub-field",children:[e.jsxs("div",{className:"ihub-wrapper ".concat(void 0!==t.defaultValue||!1===t.defaultValue||t.active||"file"===t.type?"ihub-value":""),"data-text-transform":t.TextTransform||"none",children:[e.jsx("input",{ref:r,type:t.type,name:t.name,required:t.required,defaultValue:"boolean"==typeof t.defaultValue?t.defaultValue.toString():t.defaultValue,id:t.id,maxLength:t.maxLength,onChange:function(e){r.current&&"lowercase"===t.TextTransform&&(r.current.value=r.current.value.toLowerCase());var a=e.target.value;"tel"===t.type&&((a=a.replace(/[^0-9+]/g,"")).includes("+")&&(a="+"+a.replace(/[^0-9]/g,"")),a.length>15&&(a=a.slice(0,15)),e.target.value=a),t.setValue&&t.setValue(a),t.onChange&&t.onChange(e),t.inputTarget&&t.inputTarget(e.target),t.setNameValue&&t.setNameValue(t.name,a),t.setArrayProps&&t.arrayProps&&t.setArrayProps(t.arrayProps,a),function(e){var a,t;e.target.value?null===(a=e.target.parentElement)||void 0===a||a.classList.add("ihub-value"):null===(t=e.target.parentElement)||void 0===t||t.classList.remove("ihub-value")}(e)},className:"ihub-input ".concat("auto"===t.width?"ihub-width-auto":""),readOnly:!!t.disabled&&t.disabled}),e.jsx("span",{className:"ihub-text-label",children:t.label})]}),t.note&&e.jsx("p",{className:"ihub-input-notes",children:t.note})]})})};
2
2
  //# sourceMappingURL=TextField.js.map
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";var l=function(l){var n=l.name,r=l.initialState,c=void 0!==r&&r,g=l.onChange,s=l.className,u=void 0===s?"":s,d=l.disabled,h=void 0!==d&&d,b=l.size,m=void 0===b?"medium":b,v=l.label,p=l.labelPosition,f=void 0===p?"right":p,N=l.noAnimation,k=void 0!==N&&N,C=l.activeColor,y=void 0===C?"--DarkCyan":C,x=l.id,j=l.ariaLabel,w=t(c),A=e(w,2),P=A[0],S=A[1],T=x||"toggle-".concat(Math.random().toString(36).substring(2,11));o((function(){S(c)}),[c]);var _=function(){if(!h){var e=!P;S(e),g&&g(e)}};return a("div",{className:"ihub-toggle-container ".concat("left"===f?"ihub-toggle-reverse":""," ").concat(u),children:[v&&i("label",{htmlFor:T,className:"ihub-toggle-label",children:v}),a("div",{className:"ihub-toggle-wrapper ".concat(function(){switch(m){case"small":return"ihub-toggle-sm";case"large":return"ihub-toggle-lg";default:return""}}()," ").concat(h?"ihub-toggle-disabled":""),children:[n&&i("input",{type:"hidden",name:n,defaultValue:P?"true":"false"}),i("input",{type:"checkbox",id:T,className:"ihub-toggle-input ihub-ghost",checked:P,onChange:_,disabled:h,"aria-label":j||"Toggle"}),i("div",{className:"ihub-toggle-track ".concat(P?"ihub-toggle-active":""," ").concat(k?"ihub-toggle-no-animation":""),style:P?{backgroundColor:"var(".concat(y,")")}:void 0,onClick:_,role:"presentation",children:i("div",{className:"ihub-toggle-thumb"})})]})]})};export{l as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),a=require("react/jsx-runtime"),i=require("react");exports.default=function(t){var l=t.name,o=t.initialState,r=void 0!==o&&o,n=t.onChange,s=t.className,c=void 0===s?"":s,u=t.disabled,g=void 0!==u&&u,d=t.size,b=void 0===d?"medium":d,h=t.label,v=t.labelPosition,m=void 0===v?"right":v,f=t.noAnimation,p=void 0!==f&&f,x=t.activeColor,j=void 0===x?"--DarkCyan":x,N=t.id,k=t.ariaLabel,y=i.useState(r),C=e.slicedToArray(y,2),_=C[0],q=C[1],P=N||"toggle-".concat(Math.random().toString(36).substring(2,11));i.useEffect((function(){q(r)}),[r]);var S=function(){if(!g){var e=!_;q(e),n&&n(e)}};return a.jsxs("div",{className:"ihub-toggle-container ".concat("left"===m?"ihub-toggle-reverse":""," ").concat(c),children:[h&&a.jsx("label",{htmlFor:P,className:"ihub-toggle-label",children:h}),a.jsxs("div",{className:"ihub-toggle-wrapper ".concat(function(){switch(b){case"small":return"ihub-toggle-sm";case"large":return"ihub-toggle-lg";default:return""}}()," ").concat(g?"ihub-toggle-disabled":""),children:[l&&a.jsx("input",{type:"hidden",name:l,defaultValue:_?"true":"false"}),a.jsx("input",{type:"checkbox",id:P,className:"ihub-toggle-input ihub-ghost",checked:_,onChange:S,disabled:g,"aria-label":k||"Toggle"}),a.jsx("div",{className:"ihub-toggle-track ".concat(_?"ihub-toggle-active":""," ").concat(p?"ihub-toggle-no-animation":""),style:_?{backgroundColor:"var(".concat(j,")")}:void 0,onClick:S,role:"presentation",children:a.jsx("div",{className:"ihub-toggle-thumb"})})]})]})};
2
2
  //# sourceMappingURL=ToggleButton.js.map
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as t}from"react";import a from"./ReactTimeAgo.js";var n=function(n){var o=n.content,c=n.children,l=t(!1),s=e(l,2),m=s[0],u=s[1];return r("div",{className:"ihub-tooltip-container",onMouseEnter:function(){return u(!0)},onMouseLeave:function(){return u(!1)},children:[c,m&&i("div",{className:"ihub-tip-wrapper",children:i("div",{className:"ihub-tooltip",children:Array.isArray(o)?o.map((function(e,t){return r("div",{className:"ihub-tip-item",children:[i("p",{children:e.feedback}),i("p",{className:"ihub-timestamp",children:i(a,{date:new Date(e.timestamp)})})]},t)})):o})})]})};export{n as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react/jsx-runtime"),i=require("react"),t=require("./ReactTimeAgo.js");exports.default=function(s){var a=s.content,n=s.children,u=i.useState(!1),c=e.slicedToArray(u,2),l=c[0],o=c[1];return r.jsxs("div",{className:"ihub-tooltip-container",onMouseEnter:function(){return o(!0)},onMouseLeave:function(){return o(!1)},children:[n,l&&r.jsx("div",{className:"ihub-tip-wrapper",children:r.jsx("div",{className:"ihub-tooltip",children:Array.isArray(a)?a.map((function(e,i){return r.jsxs("div",{className:"ihub-tip-item",children:[r.jsx("p",{children:e.feedback}),r.jsx("p",{className:"ihub-timestamp",children:r.jsx(t.default,{date:new Date(e.timestamp)})})]},i)})):a})})]})};
2
2
  //# sourceMappingURL=Tooltip.js.map
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e,asyncToGenerator as a,regeneratorRuntime as n}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as i,jsx as s}from"react/jsx-runtime";import{useState as l,useEffect as r}from"react";import t from"next/link";import o from"next/image";import{unsplashDefaultObject as c}from"../lib/json/unsplashDefaultObject.js";import{IN_DEV_MODE as u}from"../lib/helpFunction.js";var d=function(d){var h,p,m,v,b,f,g=d.useDispatch,N=d.useSelector,k=d.selectUnsplashObject,y=d.unsplashObject,x=d.height,w=void 0===x?"100vh":x,_=d.width,j=void 0===_?"100%":_,C=d.borderRadius,L=void 0===C?"8px":C,S=d.overlayIntensity,T=void 0===S?.2:S,U=d.onImageClick,E=g(),F=N(k),I=l(!0),P=e(I,2),R=P[0],A=P[1],D=l(!1),O=e(D,2),B=O[0],H=O[1],q=l(null),z=e(q,2),G=z[0],K=z[1],X=function(){var e=a(n().mark((function e(){var a,i,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!B){e.next=2;break}return e.abrupt("return");case 2:if(H(!0),K(null),u){e.next=26;break}return e.prev=5,e.next=8,fetch("https://api.unsplash.com/photos/random?query=".concat(d.category,"&client_id=").concat(process.env.NEXT_PUBLIC_UNSPLASH_ACCESS_KEY));case 8:if((a=e.sent).ok){e.next=11;break}throw new Error("Failed to fetch: ".concat(a.status," ").concat(a.statusText));case 11:return e.next=13,a.json();case 13:i=e.sent,s=c,null!=i&&i.id&&(s=i),E(y.actions.add(s)),e.next=24;break;case 19:e.prev=19,e.t0=e.catch(5),console.error("Error fetching random image:",e.t0),K("Failed to load image. Please try again."),E(y.actions.add(c));case 24:e.next=27;break;case 26:E(y.actions.add(c));case 27:H(!1);case 28:case"end":return e.stop()}}),e,null,[[5,19]])})));return function(){return e.apply(this,arguments)}}();r((function(){X()}),[d.category]);return i("div",{className:"ihub-unsplash-container",style:{width:j,borderRadius:L,height:w,background:(null==F?void 0:F.color)||"#f5f5f5"},children:[R&&s("div",{className:"ihub-unsplash-loader",children:s("div",{className:"ihub-unsplash-spinner"})}),G&&i("div",{className:"ihub-unsplash-error",children:[s("p",{children:G}),s("button",{onClick:X,disabled:B,children:"Try Again"})]}),i("div",{className:"ihub-unsplash-image-container ".concat(R?"ihub-unsplash-loading":""),onClick:U,children:[s(o,{src:(null==F||null===(h=F.urls)||void 0===h?void 0:h.regular)||"",alt:(null==F?void 0:F.alt_description)||d.category||"Unsplash image",className:"ihub-unsplash-image",fill:!0,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",priority:!0,onLoad:function(){A(!1)},style:{objectFit:"cover",borderRadius:L}}),s("div",{className:"ihub-unsplash-overlay",style:{opacity:T}}),i("div",{className:"ihub-unsplash-info",children:[(null==F?void 0:F.description)&&s("p",{className:"ihub-unsplash-description",children:F.description}),i("div",{className:"ihub-unsplash-metadata",children:[(null==F||null===(p=F.user)||void 0===p||null===(p=p.profile_image)||void 0===p?void 0:p.small)&&s(o,{src:F.user.profile_image.small,alt:(null===(m=F.user)||void 0===m?void 0:m.name)||"Photographer",width:24,height:24,className:"ihub-unsplash-avatar"}),i("div",{className:"ihub-unsplash-user-info",children:[s(t,{href:(null==F||null===(v=F.user)||void 0===v||null===(v=v.links)||void 0===v?void 0:v.html)||"#",target:"_blank",rel:"noopener noreferrer",className:"ihub-unsplash-username",children:(null==F||null===(b=F.user)||void 0===b?void 0:b.name)||"Unknown"}),(null==F||null===(f=F.user)||void 0===f?void 0:f.location)&&s("span",{className:"ihub-unsplash-location",children:F.user.location})]}),i("div",{className:"ihub-unsplash-stats",children:[(null==F?void 0:F.created_at)&&s("span",{className:"ihub-unsplash-date",children:function(e){if(!e)return"";var a=new Date(e);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"numeric"}).format(a)}(F.created_at)}),void 0!==(null==F?void 0:F.likes)&&i("span",{className:"ihub-unsplash-likes",children:[s("span",{className:"ihub-unsplash-heart",children:"♥"})," ",F.likes]})]})]})]})]}),s("div",{className:"ihub-unsplash-actions",children:s("button",{className:"ihub-unsplash-refresh",onClick:X,disabled:B,"aria-label":"Load a new image",title:"Load a new image",children:B?"Loading...":"Refresh Image"})})]})};export{d as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),s=require("react/jsx-runtime"),a=require("react"),n=require("next/link"),i=require("next/image"),l=require("../lib/json/unsplashDefaultObject.js"),r=require("../lib/helpFunction.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=t(n),o=t(i);exports.default=function(n){var i,t,c,d,h,p,v=n.useDispatch,m=n.useSelector,b=n.selectUnsplashObject,f=n.unsplashObject,x=n.height,j=void 0===x?"100vh":x,g=n.width,y=void 0===g?"100%":g,N=n.borderRadius,k=void 0===N?"8px":N,w=n.overlayIntensity,_=void 0===w?.2:w,D=n.onImageClick,S=v(),q=m(b),E=a.useState(!0),O=e.slicedToArray(E,2),T=O[0],C=O[1],A=a.useState(!1),I=e.slicedToArray(A,2),L=I[0],P=I[1],R=a.useState(null),U=e.slicedToArray(R,2),F=U[0],B=U[1],H=function(){var s=e.asyncToGenerator(e.regeneratorRuntime().mark((function s(){var a,i,t;return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!L){e.next=2;break}return e.abrupt("return");case 2:if(P(!0),B(null),r.IN_DEV_MODE){e.next=26;break}return e.prev=5,e.next=8,fetch("https://api.unsplash.com/photos/random?query=".concat(n.category,"&client_id=").concat(process.env.NEXT_PUBLIC_UNSPLASH_ACCESS_KEY));case 8:if((a=e.sent).ok){e.next=11;break}throw new Error("Failed to fetch: ".concat(a.status," ").concat(a.statusText));case 11:return e.next=13,a.json();case 13:i=e.sent,t=l.unsplashDefaultObject,null!=i&&i.id&&(t=i),S(f.actions.add(t)),e.next=24;break;case 19:e.prev=19,e.t0=e.catch(5),console.error("Error fetching random image:",e.t0),B("Failed to load image. Please try again."),S(f.actions.add(l.unsplashDefaultObject));case 24:e.next=27;break;case 26:S(f.actions.add(l.unsplashDefaultObject));case 27:P(!1);case 28:case"end":return e.stop()}}),s,null,[[5,19]])})));return function(){return s.apply(this,arguments)}}();a.useEffect((function(){H()}),[n.category]);return s.jsxs("div",{className:"ihub-unsplash-container",style:{width:y,borderRadius:k,height:j,background:(null==q?void 0:q.color)||"#f5f5f5"},children:[T&&s.jsx("div",{className:"ihub-unsplash-loader",children:s.jsx("div",{className:"ihub-unsplash-spinner"})}),F&&s.jsxs("div",{className:"ihub-unsplash-error",children:[s.jsx("p",{children:F}),s.jsx("button",{onClick:H,disabled:L,children:"Try Again"})]}),s.jsxs("div",{className:"ihub-unsplash-image-container ".concat(T?"ihub-unsplash-loading":""),onClick:D,children:[s.jsx(o.default,{src:(null==q||null===(i=q.urls)||void 0===i?void 0:i.regular)||"",alt:(null==q?void 0:q.alt_description)||n.category||"Unsplash image",className:"ihub-unsplash-image",fill:!0,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",priority:!0,onLoad:function(){C(!1)},style:{objectFit:"cover",borderRadius:k}}),s.jsx("div",{className:"ihub-unsplash-overlay",style:{opacity:_}}),s.jsxs("div",{className:"ihub-unsplash-info",children:[(null==q?void 0:q.description)&&s.jsx("p",{className:"ihub-unsplash-description",children:q.description}),s.jsxs("div",{className:"ihub-unsplash-metadata",children:[(null==q||null===(t=q.user)||void 0===t||null===(t=t.profile_image)||void 0===t?void 0:t.small)&&s.jsx(o.default,{src:q.user.profile_image.small,alt:(null===(c=q.user)||void 0===c?void 0:c.name)||"Photographer",width:24,height:24,className:"ihub-unsplash-avatar"}),s.jsxs("div",{className:"ihub-unsplash-user-info",children:[s.jsx(u.default,{href:(null==q||null===(d=q.user)||void 0===d||null===(d=d.links)||void 0===d?void 0:d.html)||"#",target:"_blank",rel:"noopener noreferrer",className:"ihub-unsplash-username",children:(null==q||null===(h=q.user)||void 0===h?void 0:h.name)||"Unknown"}),(null==q||null===(p=q.user)||void 0===p?void 0:p.location)&&s.jsx("span",{className:"ihub-unsplash-location",children:q.user.location})]}),s.jsxs("div",{className:"ihub-unsplash-stats",children:[(null==q?void 0:q.created_at)&&s.jsx("span",{className:"ihub-unsplash-date",children:function(e){if(!e)return"";var s=new Date(e);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"numeric"}).format(s)}(q.created_at)}),void 0!==(null==q?void 0:q.likes)&&s.jsxs("span",{className:"ihub-unsplash-likes",children:[s.jsx("span",{className:"ihub-unsplash-heart",children:"♥"})," ",q.likes]})]})]})]})]}),s.jsx("div",{className:"ihub-unsplash-actions",children:s.jsx("button",{className:"ihub-unsplash-refresh",onClick:H,disabled:L,"aria-label":"Load a new image",title:"Load a new image",children:L?"Loading...":"Refresh Image"})})]})};
2
2
  //# sourceMappingURL=UnsplashRandomImage.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as a,jsx as e}from"react/jsx-runtime";var i=function(i){var r=i.id,d=i.name,c=i.value,o=i.label,l=i.checked,n=void 0!==l&&l,s=i.disabled,h=void 0!==s&&s,t=i.onChange,u=i.required,b=void 0!==u&&u,m=i.className,p=void 0===m?"":m,v=i.error,N=i.helpText,f=i.fontSize,x=void 0===f?"ihub-fs-sm":f;return a("div",{className:"ihub-radio-wrapper ".concat(p," ").concat(h?"ihub-radio-disabled":""," ").concat(v?"ihub-radio-error":""),children:[a("div",{className:"ihub-radio-container",children:[e("input",{type:"radio",id:r,name:d,value:c,checked:n,disabled:h,onChange:t,required:b,"aria-invalid":!!v,"aria-describedby":"".concat(r,"-").concat(v?"error":N?"help":""),className:"ihub-radio-input"}),a("label",{className:"ihub-radio-label",htmlFor:r,children:[e("span",{className:"ihub-radio-custom","aria-hidden":"true"}),e("span",{className:"ihub-radio-text ".concat(x),children:o}),b&&e("span",{className:"ihub-required-mark","aria-hidden":"true",children:"*"})]})]}),N&&!v&&e("div",{id:"".concat(r,"-help"),className:"ihub-radio-help-text",children:N}),v&&e("div",{id:"".concat(r,"-error"),className:"ihub-radio-error-message",role:"alert",children:v})]})};export{i as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");exports.default=function(a){var i=a.id,r=a.name,d=a.value,s=a.label,c=a.checked,o=void 0!==c&&c,l=a.disabled,n=void 0!==l&&l,t=a.onChange,h=a.required,u=void 0!==h&&h,b=a.className,m=void 0===b?"":b,p=a.error,v=a.helpText,x=a.fontSize,j=void 0===x?"ihub-fs-sm":x;return e.jsxs("div",{className:"ihub-radio-wrapper ".concat(m," ").concat(n?"ihub-radio-disabled":""," ").concat(p?"ihub-radio-error":""),children:[e.jsxs("div",{className:"ihub-radio-container",children:[e.jsx("input",{type:"radio",id:i,name:r,value:d,checked:o,disabled:n,onChange:t,required:u,"aria-invalid":!!p,"aria-describedby":"".concat(i,"-").concat(p?"error":v?"help":""),className:"ihub-radio-input"}),e.jsxs("label",{className:"ihub-radio-label",htmlFor:i,children:[e.jsx("span",{className:"ihub-radio-custom","aria-hidden":"true"}),e.jsx("span",{className:"ihub-radio-text ".concat(j),children:s}),u&&e.jsx("span",{className:"ihub-required-mark","aria-hidden":"true",children:"*"})]})]}),v&&!p&&e.jsx("div",{id:"".concat(i,"-help"),className:"ihub-radio-help-text",children:v}),p&&e.jsx("div",{id:"".concat(i,"-error"),className:"ihub-radio-error-message",role:"alert",children:p})]})};
2
2
  //# sourceMappingURL=RadioButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","sources":["../../../../../src/components/forms/radio-btn/RadioButton.tsx"],"sourcesContent":["import React from \"react\";\r\n\r\n/**\r\n * Props for the RadioButton component\r\n * @interface RadioButtonProps\r\n */\r\ninterface RadioButtonProps {\r\n /** Unique identifier for the radio button */\r\n id: string;\r\n /** Name attribute for the radio input (for grouping) */\r\n name: string;\r\n /** Value of the radio button */\r\n value: string;\r\n /** Label text to display */\r\n label: string;\r\n /** Whether the radio button is checked */\r\n checked?: boolean;\r\n /** Whether the radio button is disabled */\r\n disabled?: boolean;\r\n /** Callback function when the radio button changes */\r\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n /** Whether the input is required */\r\n required?: boolean;\r\n /** Additional CSS classes */\r\n className?: string;\r\n /** Error message to display */\r\n error?: string;\r\n /** Help text to provide additional context */\r\n helpText?: string;\r\n /** Font size of the radio button */\r\n fontSize?: string;\r\n}\r\n\r\n/**\r\n * A customizable, accessible radio button component\r\n * @example\r\n * ```tsx\r\n * <RadioButton\r\n * id=\"radio-button-1\"\r\n * name=\"radio-button-group\"\r\n * value=\"radio-button-1\"\r\n * label=\"Radio Button 1\"\r\n * />\r\n * ```\r\n * @param id Unique identifier for the radio button\r\n * @param name Name attribute for the radio input (for grouping)\r\n * @param value Value of the radio button\r\n * @param label Label text to display\r\n * @param checked Whether the radio button is checked\r\n * @param disabled Whether the radio button is disabled\r\n * @param onChange Callback function when the radio button changes\r\n * @param required Whether the radio button is required\r\n * @param className Additional CSS classes\r\n * @param error Error message to display\r\n * @param helpText Help text to provide additional context\r\n * @param fontSize Font size of the radio button\r\n */\r\nconst RadioButton: React.FC<RadioButtonProps> = ({\r\n id,\r\n name,\r\n value,\r\n label,\r\n checked = false,\r\n disabled = false,\r\n onChange,\r\n required = false,\r\n className = \"\",\r\n error,\r\n helpText,\r\n fontSize = \"ihub-fs-sm\",\r\n}) => {\r\n return (\r\n <div\r\n className={`ihub-radio-wrapper ${className} ${\r\n disabled ? \"ihub-radio-disabled\" : \"\"\r\n } ${error ? \"ihub-radio-error\" : \"\"}`}\r\n >\r\n <div className=\"ihub-radio-container\">\r\n <input\r\n type=\"radio\"\r\n id={id}\r\n name={name}\r\n value={value}\r\n checked={checked}\r\n disabled={disabled}\r\n onChange={onChange}\r\n required={required}\r\n aria-invalid={!!error}\r\n aria-describedby={`${id}-${error ? \"error\" : helpText ? \"help\" : \"\"}`}\r\n className=\"ihub-radio-input\"\r\n />\r\n <label className=\"ihub-radio-label\" htmlFor={id}>\r\n <span className=\"ihub-radio-custom\" aria-hidden=\"true\"></span>\r\n <span className={`ihub-radio-text ${fontSize}`}>{label}</span>\r\n {required && (\r\n <span className=\"ihub-required-mark\" aria-hidden=\"true\">\r\n *\r\n </span>\r\n )}\r\n </label>\r\n </div>\r\n\r\n {helpText && !error && (\r\n <div id={`${id}-help`} className=\"ihub-radio-help-text\">\r\n {helpText}\r\n </div>\r\n )}\r\n\r\n {error && (\r\n <div\r\n id={`${id}-error`}\r\n className=\"ihub-radio-error-message\"\r\n role=\"alert\"\r\n >\r\n {error}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default RadioButton;\r\n"],"names":["RadioButton","_ref","id","name","value","label","_ref$checked","checked","_ref$disabled","disabled","onChange","_ref$required","required","_ref$className","className","error","helpText","_ref$fontSize","fontSize","_jsxs","concat","children","_jsx","type","htmlFor","role"],"mappings":"kDAyDA,IAAMA,EAA0C,SAA/BC,GAaZ,IAZHC,EAAED,EAAFC,GACAC,EAAIF,EAAJE,KACAC,EAAKH,EAALG,MACAC,EAAKJ,EAALI,MAAKC,EAAAL,EACLM,QAAAA,OAAU,IAAHD,GAAQA,EAAAE,EAAAP,EACfQ,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAAQT,EAARS,SAAQC,EAAAV,EACRW,SAAAA,OAAW,IAAHD,GAAQA,EAAAE,EAAAZ,EAChBa,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EACdE,EAAKd,EAALc,MACAC,EAAQf,EAARe,SAAQC,EAAAhB,EACRiB,SAAAA,OAAW,IAAHD,EAAG,aAAYA,EAEvB,OACEE,EACE,MAAA,CAAAL,UAAS,sBAAAM,OAAwBN,OAASM,OACxCX,EAAW,sBAAwB,GACrC,KAAAW,OAAIL,EAAQ,mBAAqB,IAEjCM,SAAA,CAAAF,EAAA,MAAA,CAAKL,UAAU,iCACbQ,EACE,QAAA,CAAAC,KAAK,QACLrB,GAAIA,EACJC,KAAMA,EACNC,MAAOA,EACPG,QAASA,EACTE,SAAUA,EACVC,SAAUA,EACVE,SAAUA,EACI,iBAAEG,EAAK,sBAAAK,OACAlB,EAAE,KAAAkB,OAAIL,EAAQ,QAAUC,EAAW,OAAS,IACjEF,UAAU,qBAEZK,EAAO,QAAA,CAAAL,UAAU,mBAAmBU,QAAStB,YAC3CoB,EAAM,OAAA,CAAAR,UAAU,oBAAmB,cAAa,SAChDQ,EAAM,OAAA,CAAAR,UAASM,mBAAAA,OAAqBF,GAAaG,SAAAhB,IAChDO,GACCU,EAAA,OAAA,CAAMR,UAAU,mCAAiC,OAAMO,SAAA,YAO5DL,IAAaD,GACZO,EAAA,MAAA,CAAKpB,GAAEkB,GAAAA,OAAKlB,EAAS,SAAEY,UAAU,gCAC9BE,IAIJD,GACCO,EAAA,MAAA,CACEpB,GAAEkB,GAAAA,OAAKlB,EAAU,UACjBY,UAAU,2BACVW,KAAK,QAEJJ,SAAAN,MAKX"}
1
+ {"version":3,"file":"RadioButton.js","sources":["../../../../../src/components/forms/radio-btn/RadioButton.tsx"],"sourcesContent":["import React from \"react\";\r\n\r\n/**\r\n * Props for the RadioButton component\r\n * @interface RadioButtonProps\r\n */\r\ninterface RadioButtonProps {\r\n /** Unique identifier for the radio button */\r\n id: string;\r\n /** Name attribute for the radio input (for grouping) */\r\n name: string;\r\n /** Value of the radio button */\r\n value: string;\r\n /** Label text to display */\r\n label: string;\r\n /** Whether the radio button is checked */\r\n checked?: boolean;\r\n /** Whether the radio button is disabled */\r\n disabled?: boolean;\r\n /** Callback function when the radio button changes */\r\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n /** Whether the input is required */\r\n required?: boolean;\r\n /** Additional CSS classes */\r\n className?: string;\r\n /** Error message to display */\r\n error?: string;\r\n /** Help text to provide additional context */\r\n helpText?: string;\r\n /** Font size of the radio button */\r\n fontSize?: string;\r\n}\r\n\r\n/**\r\n * A customizable, accessible radio button component\r\n * @example\r\n * ```tsx\r\n * <RadioButton\r\n * id=\"radio-button-1\"\r\n * name=\"radio-button-group\"\r\n * value=\"radio-button-1\"\r\n * label=\"Radio Button 1\"\r\n * />\r\n * ```\r\n * @param id Unique identifier for the radio button\r\n * @param name Name attribute for the radio input (for grouping)\r\n * @param value Value of the radio button\r\n * @param label Label text to display\r\n * @param checked Whether the radio button is checked\r\n * @param disabled Whether the radio button is disabled\r\n * @param onChange Callback function when the radio button changes\r\n * @param required Whether the radio button is required\r\n * @param className Additional CSS classes\r\n * @param error Error message to display\r\n * @param helpText Help text to provide additional context\r\n * @param fontSize Font size of the radio button\r\n */\r\nconst RadioButton: React.FC<RadioButtonProps> = ({\r\n id,\r\n name,\r\n value,\r\n label,\r\n checked = false,\r\n disabled = false,\r\n onChange,\r\n required = false,\r\n className = \"\",\r\n error,\r\n helpText,\r\n fontSize = \"ihub-fs-sm\",\r\n}) => {\r\n return (\r\n <div\r\n className={`ihub-radio-wrapper ${className} ${\r\n disabled ? \"ihub-radio-disabled\" : \"\"\r\n } ${error ? \"ihub-radio-error\" : \"\"}`}\r\n >\r\n <div className=\"ihub-radio-container\">\r\n <input\r\n type=\"radio\"\r\n id={id}\r\n name={name}\r\n value={value}\r\n checked={checked}\r\n disabled={disabled}\r\n onChange={onChange}\r\n required={required}\r\n aria-invalid={!!error}\r\n aria-describedby={`${id}-${error ? \"error\" : helpText ? \"help\" : \"\"}`}\r\n className=\"ihub-radio-input\"\r\n />\r\n <label className=\"ihub-radio-label\" htmlFor={id}>\r\n <span className=\"ihub-radio-custom\" aria-hidden=\"true\"></span>\r\n <span className={`ihub-radio-text ${fontSize}`}>{label}</span>\r\n {required && (\r\n <span className=\"ihub-required-mark\" aria-hidden=\"true\">\r\n *\r\n </span>\r\n )}\r\n </label>\r\n </div>\r\n\r\n {helpText && !error && (\r\n <div id={`${id}-help`} className=\"ihub-radio-help-text\">\r\n {helpText}\r\n </div>\r\n )}\r\n\r\n {error && (\r\n <div\r\n id={`${id}-error`}\r\n className=\"ihub-radio-error-message\"\r\n role=\"alert\"\r\n >\r\n {error}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default RadioButton;\r\n"],"names":["_ref","id","name","value","label","_ref$checked","checked","_ref$disabled","disabled","onChange","_ref$required","required","_ref$className","className","error","helpText","_ref$fontSize","fontSize","_jsxs","concat","children","jsxs","_jsx","jsx","type","htmlFor","role"],"mappings":"uHAyDgD,SAA/BA,GAaZ,IAZHC,EAAED,EAAFC,GACAC,EAAIF,EAAJE,KACAC,EAAKH,EAALG,MACAC,EAAKJ,EAALI,MAAKC,EAAAL,EACLM,QAAAA,OAAU,IAAHD,GAAQA,EAAAE,EAAAP,EACfQ,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAAQT,EAARS,SAAQC,EAAAV,EACRW,SAAAA,OAAW,IAAHD,GAAQA,EAAAE,EAAAZ,EAChBa,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EACdE,EAAKd,EAALc,MACAC,EAAQf,EAARe,SAAQC,EAAAhB,EACRiB,SAAAA,OAAW,IAAHD,EAAG,aAAYA,EAEvB,OACEE,EAAAA,KACE,MAAA,CAAAL,UAAS,sBAAAM,OAAwBN,OAASM,OACxCX,EAAW,sBAAwB,GACrC,KAAAW,OAAIL,EAAQ,mBAAqB,IAEjCM,SAAA,CAAAF,EAAAG,KAAA,MAAA,CAAKR,UAAU,iCACbS,EACEC,IAAA,QAAA,CAAAC,KAAK,QACLvB,GAAIA,EACJC,KAAMA,EACNC,MAAOA,EACPG,QAASA,EACTE,SAAUA,EACVC,SAAUA,EACVE,SAAUA,EACI,iBAAEG,EAAK,sBAAAK,OACAlB,EAAE,KAAAkB,OAAIL,EAAQ,QAAUC,EAAW,OAAS,IACjEF,UAAU,qBAEZK,EAAOG,KAAA,QAAA,CAAAR,UAAU,mBAAmBY,QAASxB,YAC3CqB,EAAMC,IAAA,OAAA,CAAAV,UAAU,oBAAmB,cAAa,SAChDS,EAAMC,IAAA,OAAA,CAAAV,UAASM,mBAAAA,OAAqBF,GAAaG,SAAAhB,IAChDO,GACCW,EAAAC,IAAA,OAAA,CAAMV,UAAU,mCAAiC,OAAMO,SAAA,YAO5DL,IAAaD,GACZQ,EAAAA,IAAA,MAAA,CAAKrB,GAAEkB,GAAAA,OAAKlB,EAAS,SAAEY,UAAU,gCAC9BE,IAIJD,GACCQ,EAAAC,IAAA,MAAA,CACEtB,GAAEkB,GAAAA,OAAKlB,EAAU,UACjBY,UAAU,2BACVa,KAAK,QAEJN,SAAAN,MAKX"}
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";import r from"./RadioButton.js";var a=function(a){var d=a.label,o=a.name,n=a.options,l=a.selectedValue,c=a.onChange,u=a.required,s=void 0!==u&&u,t=a.error,h=a.className,p=void 0===h?"":h,m=a.inline,b=void 0!==m&&m,v=a.id,g=a.description,N=v||"radio-group-".concat(o),f=g?"".concat(N,"-description"):void 0;return e("fieldset",{className:"ihub-radio-group ".concat(p," ").concat(b?"ihub-radio-group-inline":""," ").concat(t?"ihub-radio-group-error":""),id:N,"aria-required":s,"aria-describedby":f,"aria-invalid":!!t,children:[e("legend",{className:"ihub-radio-group-legend",children:[d,s&&i("span",{className:"ihub-required-mark","aria-hidden":"true",children:"*"})]}),g&&i("div",{id:f,className:"ihub-radio-group-description",children:g}),i("div",{className:"ihub-radio-options",children:n.map((function(e){return i(r,{id:e.id,name:o,value:e.value,label:e.label,checked:l===e.value,disabled:e.disabled,onChange:c,required:s,helpText:e.helpText},e.id)}))}),t&&i("div",{className:"ihub-radio-group-error-message",role:"alert",children:t})]})};export{a as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("./RadioButton.js");exports.default=function(r){var a=r.label,d=r.name,o=r.options,s=r.selectedValue,l=r.onChange,n=r.required,u=void 0!==n&&n,c=r.error,t=r.className,h=void 0===t?"":t,p=r.inline,b=void 0!==p&&p,v=r.id,m=r.description,g=v||"radio-group-".concat(d),x=m?"".concat(g,"-description"):void 0;return e.jsxs("fieldset",{className:"ihub-radio-group ".concat(h," ").concat(b?"ihub-radio-group-inline":""," ").concat(c?"ihub-radio-group-error":""),id:g,"aria-required":u,"aria-describedby":x,"aria-invalid":!!c,children:[e.jsxs("legend",{className:"ihub-radio-group-legend",children:[a,u&&e.jsx("span",{className:"ihub-required-mark","aria-hidden":"true",children:"*"})]}),m&&e.jsx("div",{id:x,className:"ihub-radio-group-description",children:m}),e.jsx("div",{className:"ihub-radio-options",children:o.map((function(r){return e.jsx(i.default,{id:r.id,name:d,value:r.value,label:r.label,checked:s===r.value,disabled:r.disabled,onChange:l,required:u,helpText:r.helpText},r.id)}))}),c&&e.jsx("div",{className:"ihub-radio-group-error-message",role:"alert",children:c})]})};
2
2
  //# sourceMappingURL=RadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../../../../../src/components/forms/radio-btn/RadioGroup.tsx"],"sourcesContent":["import React from \"react\";\r\nimport RadioButton from \"./RadioButton\";\r\n\r\n/**\r\n * Interface for radio option items\r\n */\r\ninterface RadioOption {\r\n /** Unique identifier for the option */\r\n id: string;\r\n /** Value of the option */\r\n value: string;\r\n /** Display label for the option */\r\n label: string;\r\n /** Whether the option is disabled */\r\n disabled?: boolean;\r\n /** Help text for this specific option */\r\n helpText?: string;\r\n}\r\n\r\n/**\r\n * Props for the RadioGroup component\r\n */\r\ninterface RadioGroupProps {\r\n /** Group label that describes the collection of options */\r\n label: string;\r\n /** Name attribute for all radio inputs in the group */\r\n name: string;\r\n /** Array of radio options to display */\r\n options: RadioOption[];\r\n /** Currently selected value */\r\n selectedValue?: string;\r\n /** Callback function when selection changes */\r\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n /** Whether the field group is required */\r\n required?: boolean;\r\n /** Error message for the entire group */\r\n error?: string;\r\n /** Additional CSS classes */\r\n className?: string;\r\n /** Whether to display radio buttons inline horizontally */\r\n inline?: boolean;\r\n /** ID for the fieldset element */\r\n id?: string;\r\n /** Additional description for the group */\r\n description?: string;\r\n}\r\n\r\n/**\r\n * A component for grouping related radio buttons with a common label\r\n */\r\nconst RadioGroup: React.FC<RadioGroupProps> = ({\r\n label,\r\n name,\r\n options,\r\n selectedValue,\r\n onChange,\r\n required = false,\r\n error,\r\n className = \"\",\r\n inline = false,\r\n id,\r\n description,\r\n}) => {\r\n const groupId = id || `radio-group-${name}`;\r\n const descriptionId = description ? `${groupId}-description` : undefined;\r\n\r\n return (\r\n <fieldset\r\n className={`ihub-radio-group ${className} ${\r\n inline ? \"ihub-radio-group-inline\" : \"\"\r\n } ${error ? \"ihub-radio-group-error\" : \"\"}`}\r\n id={groupId}\r\n aria-required={required}\r\n aria-describedby={descriptionId}\r\n aria-invalid={!!error}\r\n >\r\n <legend className=\"ihub-radio-group-legend\">\r\n {label}\r\n {required && (\r\n <span className=\"ihub-required-mark\" aria-hidden=\"true\">\r\n *\r\n </span>\r\n )}\r\n </legend>\r\n\r\n {description && (\r\n <div id={descriptionId} className=\"ihub-radio-group-description\">\r\n {description}\r\n </div>\r\n )}\r\n\r\n <div className=\"ihub-radio-options\">\r\n {options.map((option) => (\r\n <RadioButton\r\n key={option.id}\r\n id={option.id}\r\n name={name}\r\n value={option.value}\r\n label={option.label}\r\n checked={selectedValue === option.value}\r\n disabled={option.disabled}\r\n onChange={onChange}\r\n required={required}\r\n helpText={option.helpText}\r\n />\r\n ))}\r\n </div>\r\n\r\n {error && (\r\n <div className=\"ihub-radio-group-error-message\" role=\"alert\">\r\n {error}\r\n </div>\r\n )}\r\n </fieldset>\r\n );\r\n};\r\n\r\nexport default RadioGroup;\r\n"],"names":["RadioGroup","_ref","label","name","options","selectedValue","onChange","_ref$required","required","error","_ref$className","className","_ref$inline","inline","id","description","groupId","concat","descriptionId","undefined","_jsxs","children","_jsx","map","option","RadioButton","value","checked","disabled","helpText","role"],"mappings":"kFAkDA,IAAMA,EAAwC,SAA9BC,GAYX,IAXHC,EAAKD,EAALC,MACAC,EAAIF,EAAJE,KACAC,EAAOH,EAAPG,QACAC,EAAaJ,EAAbI,cACAC,EAAQL,EAARK,SAAQC,EAAAN,EACRO,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAAKR,EAALQ,MAAKC,EAAAT,EACLU,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAAAE,EAAAX,EACdY,OAAAA,OAAS,IAAHD,GAAQA,EACdE,EAAEb,EAAFa,GACAC,EAAWd,EAAXc,YAEMC,EAAUF,kBAAEG,OAAmBd,GAC/Be,EAAgBH,EAAW,GAAAE,OAAMD,uBAAwBG,EAE/D,OACEC,EACE,WAAA,CAAAT,UAAS,oBAAAM,OAAsBN,OAASM,OACtCJ,EAAS,0BAA4B,GACvC,KAAAI,OAAIR,EAAQ,yBAA2B,IACvCK,GAAIE,EAAO,gBACIR,EACG,mBAAAU,mBACFT,EAEhBY,SAAA,CAAAD,EAAA,SAAA,CAAQT,UAAU,0BACfU,SAAA,CAAAnB,EACAM,GACCc,EAAA,OAAA,CAAMX,UAAU,qBAAiC,cAAA,yBAMpDI,GACCO,EAAA,MAAA,CAAKR,GAAII,EAAeP,UAAU,+BAC/BU,SAAAN,IAILO,EAAK,MAAA,CAAAX,UAAU,qBAAoBU,SAChCjB,EAAQmB,KAAI,SAACC,GAAM,OAClBF,EAACG,EAAW,CAEVX,GAAIU,EAAOV,GACXX,KAAMA,EACNuB,MAAOF,EAAOE,MACdxB,MAAOsB,EAAOtB,MACdyB,QAAStB,IAAkBmB,EAAOE,MAClCE,SAAUJ,EAAOI,SACjBtB,SAAUA,EACVE,SAAUA,EACVqB,SAAUL,EAAOK,UATZL,EAAOV,SAcjBL,GACCa,EAAK,MAAA,CAAAX,UAAU,iCAAiCmB,KAAK,QAClDT,SAAAZ,MAKX"}
1
+ {"version":3,"file":"RadioGroup.js","sources":["../../../../../src/components/forms/radio-btn/RadioGroup.tsx"],"sourcesContent":["import React from \"react\";\r\nimport RadioButton from \"./RadioButton\";\r\n\r\n/**\r\n * Interface for radio option items\r\n */\r\ninterface RadioOption {\r\n /** Unique identifier for the option */\r\n id: string;\r\n /** Value of the option */\r\n value: string;\r\n /** Display label for the option */\r\n label: string;\r\n /** Whether the option is disabled */\r\n disabled?: boolean;\r\n /** Help text for this specific option */\r\n helpText?: string;\r\n}\r\n\r\n/**\r\n * Props for the RadioGroup component\r\n */\r\ninterface RadioGroupProps {\r\n /** Group label that describes the collection of options */\r\n label: string;\r\n /** Name attribute for all radio inputs in the group */\r\n name: string;\r\n /** Array of radio options to display */\r\n options: RadioOption[];\r\n /** Currently selected value */\r\n selectedValue?: string;\r\n /** Callback function when selection changes */\r\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n /** Whether the field group is required */\r\n required?: boolean;\r\n /** Error message for the entire group */\r\n error?: string;\r\n /** Additional CSS classes */\r\n className?: string;\r\n /** Whether to display radio buttons inline horizontally */\r\n inline?: boolean;\r\n /** ID for the fieldset element */\r\n id?: string;\r\n /** Additional description for the group */\r\n description?: string;\r\n}\r\n\r\n/**\r\n * A component for grouping related radio buttons with a common label\r\n */\r\nconst RadioGroup: React.FC<RadioGroupProps> = ({\r\n label,\r\n name,\r\n options,\r\n selectedValue,\r\n onChange,\r\n required = false,\r\n error,\r\n className = \"\",\r\n inline = false,\r\n id,\r\n description,\r\n}) => {\r\n const groupId = id || `radio-group-${name}`;\r\n const descriptionId = description ? `${groupId}-description` : undefined;\r\n\r\n return (\r\n <fieldset\r\n className={`ihub-radio-group ${className} ${\r\n inline ? \"ihub-radio-group-inline\" : \"\"\r\n } ${error ? \"ihub-radio-group-error\" : \"\"}`}\r\n id={groupId}\r\n aria-required={required}\r\n aria-describedby={descriptionId}\r\n aria-invalid={!!error}\r\n >\r\n <legend className=\"ihub-radio-group-legend\">\r\n {label}\r\n {required && (\r\n <span className=\"ihub-required-mark\" aria-hidden=\"true\">\r\n *\r\n </span>\r\n )}\r\n </legend>\r\n\r\n {description && (\r\n <div id={descriptionId} className=\"ihub-radio-group-description\">\r\n {description}\r\n </div>\r\n )}\r\n\r\n <div className=\"ihub-radio-options\">\r\n {options.map((option) => (\r\n <RadioButton\r\n key={option.id}\r\n id={option.id}\r\n name={name}\r\n value={option.value}\r\n label={option.label}\r\n checked={selectedValue === option.value}\r\n disabled={option.disabled}\r\n onChange={onChange}\r\n required={required}\r\n helpText={option.helpText}\r\n />\r\n ))}\r\n </div>\r\n\r\n {error && (\r\n <div className=\"ihub-radio-group-error-message\" role=\"alert\">\r\n {error}\r\n </div>\r\n )}\r\n </fieldset>\r\n );\r\n};\r\n\r\nexport default RadioGroup;\r\n"],"names":["_ref","label","name","options","selectedValue","onChange","_ref$required","required","error","_ref$className","className","_ref$inline","inline","id","description","groupId","concat","descriptionId","undefined","_jsxs","children","jsxs","_jsx","jsx","map","option","RadioButton","value","checked","disabled","helpText","role"],"mappings":"qJAkD8C,SAA9BA,GAYX,IAXHC,EAAKD,EAALC,MACAC,EAAIF,EAAJE,KACAC,EAAOH,EAAPG,QACAC,EAAaJ,EAAbI,cACAC,EAAQL,EAARK,SAAQC,EAAAN,EACRO,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAAKR,EAALQ,MAAKC,EAAAT,EACLU,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAAAE,EAAAX,EACdY,OAAAA,OAAS,IAAHD,GAAQA,EACdE,EAAEb,EAAFa,GACAC,EAAWd,EAAXc,YAEMC,EAAUF,kBAAEG,OAAmBd,GAC/Be,EAAgBH,EAAW,GAAAE,OAAMD,uBAAwBG,EAE/D,OACEC,EAAAA,KACE,WAAA,CAAAT,UAAS,oBAAAM,OAAsBN,OAASM,OACtCJ,EAAS,0BAA4B,GACvC,KAAAI,OAAIR,EAAQ,yBAA2B,IACvCK,GAAIE,EAAO,gBACIR,EACG,mBAAAU,mBACFT,EAEhBY,SAAA,CAAAD,EAAAE,KAAA,SAAA,CAAQX,UAAU,0BACfU,SAAA,CAAAnB,EACAM,GACCe,EAAAA,IAAA,OAAA,CAAMZ,UAAU,qBAAiC,cAAA,yBAMpDI,GACCQ,EAAAC,IAAA,MAAA,CAAKV,GAAII,EAAeP,UAAU,+BAC/BU,SAAAN,IAILQ,EAAKC,IAAA,MAAA,CAAAb,UAAU,qBAAoBU,SAChCjB,EAAQqB,KAAI,SAACC,GAAM,OAClBH,EAAAA,IAACI,EAAAA,QAAW,CAEVb,GAAIY,EAAOZ,GACXX,KAAMA,EACNyB,MAAOF,EAAOE,MACd1B,MAAOwB,EAAOxB,MACd2B,QAASxB,IAAkBqB,EAAOE,MAClCE,SAAUJ,EAAOI,SACjBxB,SAAUA,EACVE,SAAUA,EACVuB,SAAUL,EAAOK,UATZL,EAAOZ,SAcjBL,GACCc,EAAKC,IAAA,MAAA,CAAAb,UAAU,iCAAiCqB,KAAK,QAClDX,SAAAZ,MAKX"}
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e,asyncToGenerator as r,regeneratorRuntime as t}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as n,jsx as s}from"react/jsx-runtime";import{useState as a}from"react";import{FileUpload as o}from"primereact/fileupload";import{FILE_URL as c,slugifyFileName as i,IN_DEV_MODE as l}from"../../lib/helpFunction.js";import{S3Client as p}from"@aws-sdk/client-s3";import{openToast as u}from"../../lib/modals/modals.js";var d=function(d){var m=a(null),f=e(m,2),_=f[0],v=f[1],h=a(d.labels||"Drag and drop files here to upload."),y=e(h,2),S=y[0],b=y[1],N=a(0),C=e(N,2),E=C[0],T=C[1],g=function(){var e=r(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:v(r.files[0]),T(0);case 2:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),I=function(){var e=r(t().mark((function e(){var r,n,s,a,o,m,f,v,h,y,S,b,N,C,E;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_){e.next=2;break}return e.abrupt("return");case 2:if(e.prev=2,r=new p({region:process.env.NEXT_PUBLIC_AWS_REGION,endpoint:process.env.NEXT_PUBLIC_AWS_S3_ENDPOINT_URL,credentials:{accessKeyId:process.env.NEXT_PUBLIC_AWS_ACCESS_KEY_ID||"",secretAccessKey:process.env.NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY||""}}),n=(new Date).toISOString(),s=i("".concat(d.username||"anonymous","-").concat(n,"-").concat(_.name)),a=l?"test-env__".concat(s):s,o="video/*"===d.accepts?process.env.NEXT_PUBLIC_AWS_LOCATION:process.env.NEXT_PUBLIC_AWS_LOCATION_FILES,m=process.env.NEXT_PUBLIC_AWS_BUCKET_NAME||"",f="".concat(o,"/").concat(a),!(_.size<104857600)){e.next=25;break}return e.next=14,import("@aws-sdk/client-s3");case 14:return v=e.sent,h=v.PutObjectCommand,T(10),y=new h({Bucket:m,Key:f,Body:_,ContentType:_.type,ACL:"public-read"}),S=setInterval((function(){T((function(e){return Math.min(e+5,95)}))}),300),e.next=21,r.send(y);case 21:clearInterval(S),T(100),e.next=33;break;case 25:return e.next=27,import("@aws-sdk/lib-storage");case 27:return b=e.sent,N=b.Upload,(C=new N({client:r,params:{Bucket:m,Key:f,Body:_,ContentType:_.type,ACL:"public-read"}})).on("httpUploadProgress",(function(e){var r=Math.round(e.loaded/e.total*100);T(r)})),e.next=33,C.done();case 33:u("File Uploaded Successfully!"),E={bucket:m,title:_.name,key:a,content_type:_.type,size:_.size,location:"".concat(c,"creators/").concat(a)},d.setResponse&&d.setResponse(E),d.setValues&&d.setValues(d.names||"",E.key),d.setModules&&d.setModules(d.module||"",d.names||"",E.key),d.setSteps&&d.setSteps(d.module||"",d.step||"",d.names||"",E.key),e.next=46;break;case 41:e.prev=41,e.t0=e.catch(2),console.error("Upload error:",e.t0),u("Error uploading file!",400),T(0);case 46:case"end":return e.stop()}}),e,null,[[2,41]])})));return function(){return e.apply(this,arguments)}}();return n("div",{className:"ihub-uploader card primereact",children:[s("h3",{children:d.headers}),s(o,{name:"upload",customUpload:!0,accept:d.accepts||"*",maxFileSize:d.maxFileSize||0,onSelect:g,uploadHandler:I,emptyTemplate:s("p",{className:"m-0",children:S}),onError:function(){return b("Upload failed, try again!")},progressBarTemplate:function(){return s("div",{className:"ihub-progress",children:n("div",{className:"ihub-progress-bar",style:{width:"".concat(E,"%")},children:[E,"%"]})})},itemTemplate:E?function(){return E&&E<100?s("div",{className:"ihub-progress",children:n("div",{className:"ihub-progress-bar",style:{width:"".concat(E,"%")},children:[E,"%"]})}):100===E?s("p",{children:"Processing..."}):null}:void 0,pt:{content:{className:"surface-ground"},message:{root:{className:"w-1rem"}}}})]})};export{d as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react/jsx-runtime"),t=require("react"),n=require("primereact/fileupload"),s=require("../../lib/helpFunction.js"),a=require("@aws-sdk/client-s3"),o=require("../../lib/modals/modals.js");function c(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}exports.default=function(i){var u=t.useState(null),l=e.slicedToArray(u,2),p=l[0],d=l[1],m=t.useState(i.labels||"Drag and drop files here to upload."),f=e.slicedToArray(m,2),_=f[0],y=f[1],v=t.useState(0),h=e.slicedToArray(v,2),b=h[0],S=h[1],g=function(){var r=e.asyncToGenerator(e.regeneratorRuntime().mark((function r(t){return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d(t.files[0]),S(0);case 2:case"end":return e.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}(),x=function(){var r=e.asyncToGenerator(e.regeneratorRuntime().mark((function r(){var t,n,u,l,d,m,f,_,y,v,h,b,g,x,E;return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p){e.next=2;break}return e.abrupt("return");case 2:if(e.prev=2,t=new a.S3Client({region:process.env.NEXT_PUBLIC_AWS_REGION,endpoint:process.env.NEXT_PUBLIC_AWS_S3_ENDPOINT_URL,credentials:{accessKeyId:process.env.NEXT_PUBLIC_AWS_ACCESS_KEY_ID||"",secretAccessKey:process.env.NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY||""}}),n=(new Date).toISOString(),u=s.slugifyFileName("".concat(i.username||"anonymous","-").concat(n,"-").concat(p.name)),l=s.IN_DEV_MODE?"test-env__".concat(u):u,d="video/*"===i.accepts?process.env.NEXT_PUBLIC_AWS_LOCATION:process.env.NEXT_PUBLIC_AWS_LOCATION_FILES,m=process.env.NEXT_PUBLIC_AWS_BUCKET_NAME||"",f="".concat(d,"/").concat(l),!(p.size<104857600)){e.next=25;break}return e.next=14,Promise.resolve().then((function(){return c(require("@aws-sdk/client-s3"))}));case 14:return _=e.sent,y=_.PutObjectCommand,S(10),v=new y({Bucket:m,Key:f,Body:p,ContentType:p.type,ACL:"public-read"}),h=setInterval((function(){S((function(e){return Math.min(e+5,95)}))}),300),e.next=21,t.send(v);case 21:clearInterval(h),S(100),e.next=33;break;case 25:return e.next=27,Promise.resolve().then((function(){return c(require("@aws-sdk/lib-storage"))}));case 27:return b=e.sent,g=b.Upload,(x=new g({client:t,params:{Bucket:m,Key:f,Body:p,ContentType:p.type,ACL:"public-read"}})).on("httpUploadProgress",(function(e){var r=Math.round(e.loaded/e.total*100);S(r)})),e.next=33,x.done();case 33:o.openToast("File Uploaded Successfully!"),E={bucket:m,title:p.name,key:l,content_type:p.type,size:p.size,location:"".concat(s.FILE_URL,"creators/").concat(l)},i.setResponse&&i.setResponse(E),i.setValues&&i.setValues(i.names||"",E.key),i.setModules&&i.setModules(i.module||"",i.names||"",E.key),i.setSteps&&i.setSteps(i.module||"",i.step||"",i.names||"",E.key),e.next=46;break;case 41:e.prev=41,e.t0=e.catch(2),console.error("Upload error:",e.t0),o.openToast("Error uploading file!",400),S(0);case 46:case"end":return e.stop()}}),r,null,[[2,41]])})));return function(){return r.apply(this,arguments)}}();return r.jsxs("div",{className:"ihub-uploader card primereact",children:[r.jsx("h3",{children:i.headers}),r.jsx(n.FileUpload,{name:"upload",customUpload:!0,accept:i.accepts||"*",maxFileSize:i.maxFileSize||0,onSelect:g,uploadHandler:x,emptyTemplate:r.jsx("p",{className:"m-0",children:_}),onError:function(){return y("Upload failed, try again!")},progressBarTemplate:function(){return r.jsx("div",{className:"ihub-progress",children:r.jsxs("div",{className:"ihub-progress-bar",style:{width:"".concat(b,"%")},children:[b,"%"]})})},itemTemplate:b?function(){return b&&b<100?r.jsx("div",{className:"ihub-progress",children:r.jsxs("div",{className:"ihub-progress-bar",style:{width:"".concat(b,"%")},children:[b,"%"]})}):100===b?r.jsx("p",{children:"Processing..."}):null}:void 0,pt:{content:{className:"surface-ground"},message:{root:{className:"w-1rem"}}}})]})};
2
2
  //# sourceMappingURL=FileUploader.js.map
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e,asyncToGenerator as n,regeneratorRuntime as r}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as o,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as l}from"react";import{FILE_URL as s,slugifyFileName as c,IN_DEV_MODE as u}from"../../lib/helpFunction.js";import{S3Client as d,PutObjectCommand as p}from"@aws-sdk/client-s3";import{Upload as h}from"@aws-sdk/lib-storage";import{openToast as m}from"../../lib/modals/modals.js";function v(v){var f=v.header,b=v.label,g=void 0===b?"Drag and drop files here or click to browse":b,y=v.accept,N=void 0===y?"*":y,k=v.maxFileSize,C=void 0===k?0:k,w=v.name,x=void 0===w?"upload":w,_=v.module,L=void 0===_?"":_,E=v.step,B=void 0===E?"":E,S=v.username,I=void 0===S?null:S,T=v.onUploadComplete,U=v.setValues,A=v.setModules,P=v.setSteps,W=v.className,M=void 0===W?"":W,z=a(null),D=e(z,2),j=D[0],O=D[1],R=a(!1),F=e(R,2),K=F[0],X=F[1],H=a(0),G=e(H,2),V=G[0],Y=G[1],q=a("idle"),Q=e(q,2),J=Q[0],Z=Q[1],$=a(""),ee=e($,2),ne=ee[0],re=ee[1],te=l(null),oe=function(e){if(0===e)return"0 Bytes";var n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(2))+" "+["Bytes","KB","MB","GB"][n]},ie=function(e){re(""),function(e){var n;if("*"===N)return!0;var r=e.type,t=".".concat(null===(n=e.name.split(".").pop())||void 0===n?void 0:n.toLowerCase());return!!N.split(",").map((function(e){return e.trim()})).some((function(e){if(e.startsWith("."))return t===e.toLowerCase();if(e.endsWith("/*")){var n=e.replace("/*","");return r.startsWith("".concat(n,"/"))}return r===e}))||(re("File type not accepted. Please upload a file matching: ".concat(N)),!1)}(e)&&function(e){if(C&&e.size>C){var n=oe(C);return re("File size exceeds the maximum limit of ".concat(n)),!1}return!0}(e)&&(O(e),Z("idle"),Y(0))},ae=function(){var e=n(r().mark((function e(){var n,t,o,i,a,l,v,f,b,g,y;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(j){e.next=3;break}return re("Please select a file first"),e.abrupt("return");case 3:if(Z("uploading"),re(""),e.prev=5,n=new d({region:process.env.NEXT_PUBLIC_AWS_REGION,endpoint:process.env.NEXT_PUBLIC_AWS_S3_ENDPOINT_URL,requestChecksumCalculation:"WHEN_REQUIRED",credentials:{accessKeyId:process.env.NEXT_PUBLIC_AWS_ACCESS_KEY_ID||"",secretAccessKey:process.env.NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY||""}}),t=(new Date).toISOString(),o=c("".concat(I||"anonymous","-").concat(t,"-").concat(j.name)),i=u?"test-env__".concat(o):o,a="video/*"===N?process.env.NEXT_PUBLIC_AWS_LOCATION:process.env.NEXT_PUBLIC_AWS_LOCATION_FILES,l=process.env.NEXT_PUBLIC_AWS_BUCKET_NAME||"",v="".concat(a,"/").concat(i),!(j.size<104857600)){e.next=24;break}return Y(10),f=new p({Bucket:l,Key:v,Body:j,ContentType:j.type,ACL:"public-read"}),b=setInterval((function(){Y((function(e){return Math.min(e+5,95)}))}),300),e.next=20,n.send(f);case 20:clearInterval(b),Y(100),e.next=28;break;case 24:return(g=new h({client:n,params:{Bucket:l,Key:v,Body:j,ContentType:j.type,ACL:"public-read"}})).on("httpUploadProgress",(function(e){var n=Math.round(e.loaded/e.total*100);Y(n)})),e.next=28,g.done();case 28:Z("success"),m("File Uploaded Successfully!"),y={bucket:l,title:j.name,key:i,content_type:j.type,size:j.size,location:"".concat(s,"creators/").concat(i)},T&&T(y),U&&U(x,y.key),A&&A(L,x,y.key),P&&P(L,B,x,y.key),setTimeout((function(){O(null),Z("idle"),Y(0)}),3e3),e.next=45;break;case 38:e.prev=38,e.t0=e.catch(5),console.error("Upload error:",e.t0),Z("error"),re("Error uploading file. Please try again."),m("Error uploading file!",400),Y(0);case 45:case"end":return e.stop()}}),e,null,[[5,38]])})));return function(){return e.apply(this,arguments)}}(),le=function(){O(null),Z("idle"),Y(0),re("")};return t("div",{className:"ihub-uploader ".concat(M),children:[f&&o("h3",{className:"ihub-uploader-header",children:f}),t("div",{className:"ihub-uploader-container",children:[!j&&t("div",{className:"ihub-uploader-dropzone ".concat(K?"ihub-uploader-dropzone-active":""),onDragOver:function(e){e.preventDefault(),e.stopPropagation(),X(!0)},onDragLeave:function(e){e.preventDefault(),e.stopPropagation(),X(!1)},onDrop:function(e){e.preventDefault(),e.stopPropagation(),X(!1);var n=e.dataTransfer.files;n&&n.length>0&&ie(n[0])},onClick:function(){te.current&&te.current.click()},children:[o("div",{className:"ihub-uploader-icon",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),o("polyline",{points:"17 8 12 3 7 8"}),o("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}),o("p",{className:"ihub-uploader-text",children:g}),o("p",{className:"ihub-uploader-hint",children:C>0&&"Maximum file size: ".concat(oe(C))}),o("input",{ref:te,type:"file",accept:N,onChange:function(e){var n=e.target.files;n&&n.length>0&&ie(n[0])},className:"ihub-uploader-input"})]}),j&&t("div",{className:"ihub-uploader-preview",children:[t("div",{className:"ihub-uploader-file-info",children:[o("div",{className:"ihub-uploader-file-icon",children:j.type.startsWith("image/")?o("img",{src:URL.createObjectURL(j),alt:j.name,className:"ihub-uploader-thumbnail"}):t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),o("polyline",{points:"14 2 14 8 20 8"}),o("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),o("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),o("polyline",{points:"10 9 9 9 8 9"})]})}),t("div",{className:"ihub-uploader-file-details",children:[o("p",{className:"ihub-uploader-file-name",children:j.name}),o("p",{className:"ihub-uploader-file-size",children:oe(j.size)})]})]}),"uploading"===J&&o("div",{className:"ihub-uploader-progress",children:o("div",{className:"ihub-uploader-progress-bar",style:{width:"".concat(V,"%")},children:t("span",{className:"ihub-uploader-progress-text",children:[V,"%"]})})}),t("div",{className:"ihub-uploader-actions",children:["idle"===J&&t(i,{children:[o("button",{className:"ihub-uploader-upload-btn ihub-important-btn",onClick:ae,children:"Upload"}),o("button",{className:"ihub-uploader-cancel-btn outlined-btn",onClick:le,children:"Cancel"})]}),"uploading"===J&&o("button",{className:"ihub-uploader-cancel-btn outlined-btn",onClick:le,children:"Cancel"}),"success"===J&&t("div",{className:"ihub-uploader-success",children:[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),o("polyline",{points:"22 4 12 14.01 9 11.01"})]}),o("span",{children:"Upload Complete"})]}),"error"===J&&t(i,{children:[o("button",{className:"ihub-uploader-retry-btn ihub-important-btn",onClick:ae,children:"Retry"}),o("button",{className:"ihub-uploader-cancel-btn outlined-btn",onClick:le,children:"Cancel"})]})]})]}),ne&&t("div",{className:"ihub-uploader-error",children:[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("circle",{cx:"12",cy:"12",r:"10"}),o("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),o("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),o("span",{children:ne})]})]})]})}export{v as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),n=require("react/jsx-runtime"),r=require("react"),t=require("../../lib/helpFunction.js"),s=require("@aws-sdk/client-s3"),i=require("@aws-sdk/lib-storage"),a=require("../../lib/modals/modals.js");exports.default=function(o){var l=o.header,c=o.label,u=void 0===c?"Drag and drop files here or click to browse":c,d=o.accept,p=void 0===d?"*":d,h=o.maxFileSize,x=void 0===h?0:h,m=o.name,v=void 0===m?"upload":m,b=o.module,f=void 0===b?"":b,j=o.step,y=void 0===j?"":j,g=o.username,N=void 0===g?null:g,C=o.onUploadComplete,_=o.setValues,k=o.setModules,w=o.setSteps,L=o.className,E=void 0===L?"":L,S=r.useState(null),T=e.slicedToArray(S,2),B=T[0],A=T[1],I=r.useState(!1),U=e.slicedToArray(I,2),P=U[0],W=U[1],M=r.useState(0),D=e.slicedToArray(M,2),z=D[0],F=D[1],O=r.useState("idle"),R=e.slicedToArray(O,2),q=R[0],K=R[1],X=r.useState(""),H=e.slicedToArray(X,2),V=H[0],G=H[1],Y=r.useRef(null),Q=function(e){if(0===e)return"0 Bytes";var n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(2))+" "+["Bytes","KB","MB","GB"][n]},J=function(e){G(""),function(e){var n;if("*"===p)return!0;var r=e.type,t=".".concat(null===(n=e.name.split(".").pop())||void 0===n?void 0:n.toLowerCase());return!!p.split(",").map((function(e){return e.trim()})).some((function(e){if(e.startsWith("."))return t===e.toLowerCase();if(e.endsWith("/*")){var n=e.replace("/*","");return r.startsWith("".concat(n,"/"))}return r===e}))||(G("File type not accepted. Please upload a file matching: ".concat(p)),!1)}(e)&&function(e){if(x&&e.size>x){var n=Q(x);return G("File size exceeds the maximum limit of ".concat(n)),!1}return!0}(e)&&(A(e),K("idle"),F(0))},Z=function(){var n=e.asyncToGenerator(e.regeneratorRuntime().mark((function n(){var r,o,l,c,u,d,h,x,m,b,j;return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(B){e.next=3;break}return G("Please select a file first"),e.abrupt("return");case 3:if(K("uploading"),G(""),e.prev=5,r=new s.S3Client({region:process.env.NEXT_PUBLIC_AWS_REGION,endpoint:process.env.NEXT_PUBLIC_AWS_S3_ENDPOINT_URL,requestChecksumCalculation:"WHEN_REQUIRED",credentials:{accessKeyId:process.env.NEXT_PUBLIC_AWS_ACCESS_KEY_ID||"",secretAccessKey:process.env.NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY||""}}),o=(new Date).toISOString(),l=t.slugifyFileName("".concat(N||"anonymous","-").concat(o,"-").concat(B.name)),c=t.IN_DEV_MODE?"test-env__".concat(l):l,u="video/*"===p?process.env.NEXT_PUBLIC_AWS_LOCATION:process.env.NEXT_PUBLIC_AWS_LOCATION_FILES,d=process.env.NEXT_PUBLIC_AWS_BUCKET_NAME||"",h="".concat(u,"/").concat(c),!(B.size<104857600)){e.next=24;break}return F(10),x=new s.PutObjectCommand({Bucket:d,Key:h,Body:B,ContentType:B.type,ACL:"public-read"}),m=setInterval((function(){F((function(e){return Math.min(e+5,95)}))}),300),e.next=20,r.send(x);case 20:clearInterval(m),F(100),e.next=28;break;case 24:return(b=new i.Upload({client:r,params:{Bucket:d,Key:h,Body:B,ContentType:B.type,ACL:"public-read"}})).on("httpUploadProgress",(function(e){var n=Math.round(e.loaded/e.total*100);F(n)})),e.next=28,b.done();case 28:K("success"),a.openToast("File Uploaded Successfully!"),j={bucket:d,title:B.name,key:c,content_type:B.type,size:B.size,location:"".concat(t.FILE_URL,"creators/").concat(c)},C&&C(j),_&&_(v,j.key),k&&k(f,v,j.key),w&&w(f,y,v,j.key),setTimeout((function(){A(null),K("idle"),F(0)}),3e3),e.next=45;break;case 38:e.prev=38,e.t0=e.catch(5),console.error("Upload error:",e.t0),K("error"),G("Error uploading file. Please try again."),a.openToast("Error uploading file!",400),F(0);case 45:case"end":return e.stop()}}),n,null,[[5,38]])})));return function(){return n.apply(this,arguments)}}(),$=function(){A(null),K("idle"),F(0),G("")};return n.jsxs("div",{className:"ihub-uploader ".concat(E),children:[l&&n.jsx("h3",{className:"ihub-uploader-header",children:l}),n.jsxs("div",{className:"ihub-uploader-container",children:[!B&&n.jsxs("div",{className:"ihub-uploader-dropzone ".concat(P?"ihub-uploader-dropzone-active":""),onDragOver:function(e){e.preventDefault(),e.stopPropagation(),W(!0)},onDragLeave:function(e){e.preventDefault(),e.stopPropagation(),W(!1)},onDrop:function(e){e.preventDefault(),e.stopPropagation(),W(!1);var n=e.dataTransfer.files;n&&n.length>0&&J(n[0])},onClick:function(){Y.current&&Y.current.click()},children:[n.jsx("div",{className:"ihub-uploader-icon",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.jsx("polyline",{points:"17 8 12 3 7 8"}),n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}),n.jsx("p",{className:"ihub-uploader-text",children:u}),n.jsx("p",{className:"ihub-uploader-hint",children:x>0&&"Maximum file size: ".concat(Q(x))}),n.jsx("input",{ref:Y,type:"file",accept:p,onChange:function(e){var n=e.target.files;n&&n.length>0&&J(n[0])},className:"ihub-uploader-input"})]}),B&&n.jsxs("div",{className:"ihub-uploader-preview",children:[n.jsxs("div",{className:"ihub-uploader-file-info",children:[n.jsx("div",{className:"ihub-uploader-file-icon",children:B.type.startsWith("image/")?n.jsx("img",{src:URL.createObjectURL(B),alt:B.name,className:"ihub-uploader-thumbnail"}):n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"}),n.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),n.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),n.jsx("polyline",{points:"10 9 9 9 8 9"})]})}),n.jsxs("div",{className:"ihub-uploader-file-details",children:[n.jsx("p",{className:"ihub-uploader-file-name",children:B.name}),n.jsx("p",{className:"ihub-uploader-file-size",children:Q(B.size)})]})]}),"uploading"===q&&n.jsx("div",{className:"ihub-uploader-progress",children:n.jsx("div",{className:"ihub-uploader-progress-bar",style:{width:"".concat(z,"%")},children:n.jsxs("span",{className:"ihub-uploader-progress-text",children:[z,"%"]})})}),n.jsxs("div",{className:"ihub-uploader-actions",children:["idle"===q&&n.jsxs(n.Fragment,{children:[n.jsx("button",{className:"ihub-uploader-upload-btn ihub-important-btn",onClick:Z,children:"Upload"}),n.jsx("button",{className:"ihub-uploader-cancel-btn outlined-btn",onClick:$,children:"Cancel"})]}),"uploading"===q&&n.jsx("button",{className:"ihub-uploader-cancel-btn outlined-btn",onClick:$,children:"Cancel"}),"success"===q&&n.jsxs("div",{className:"ihub-uploader-success",children:[n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),n.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),n.jsx("span",{children:"Upload Complete"})]}),"error"===q&&n.jsxs(n.Fragment,{children:[n.jsx("button",{className:"ihub-uploader-retry-btn ihub-important-btn",onClick:Z,children:"Retry"}),n.jsx("button",{className:"ihub-uploader-cancel-btn outlined-btn",onClick:$,children:"Cancel"})]})]})]}),V&&n.jsxs("div",{className:"ihub-uploader-error",children:[n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),n.jsx("span",{children:V})]})]})]})};
2
2
  //# sourceMappingURL=IhubFileUploader.js.map
@@ -1,2 +1,2 @@
1
- import{asyncToGenerator as r,regeneratorRuntime as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{signOut as n}from"next-auth/react";import"next/navigation";var t=function(){var t=r(e().mark((function r(){return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("undefined"==typeof window){r.next=4;break}return r.next=3,n({redirect:!1});case 3:window.location.reload();case 4:case"end":return r.stop()}}),r)})));return function(){return t.apply(this,arguments)}}();export{t as logout};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("next-auth/react");require("next/navigation");var t=function(){var t=e.asyncToGenerator(e.regeneratorRuntime().mark((function t(){return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"==typeof window){e.next=4;break}return e.next=3,r.signOut({redirect:!1});case 3:window.location.reload();case 4:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();exports.logout=t;
2
2
  //# sourceMappingURL=actions.js.map
@@ -1,2 +1,2 @@
1
- import{asyncToGenerator as t,regeneratorRuntime as e,objectSpread2 as r}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{reqOptions as n,extractSubDomain as a,API_HOST_URL as u}from"../helpFunction.js";var o={host_url:u,path:"",data:null,token:null,method:"GET",type:null,channel:""};function s(t){return c.apply(this,arguments)}function c(){return(c=t(e().mark((function t(a){var u,s,c,l;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=r(r({},o),a),t.prev=1,s=u.host_url+u.path,c=n(u.method||"GET",u.data,u.token,u.type||null,u.channel),t.next=6,fetch(s,c);case 6:if(401!==(l=t.sent).status&&403!==l.status){t.next=9;break}return t.abrupt("return",{detail:"Unauthorized"});case 9:if(404!==l.status){t.next=11;break}return t.abrupt("return",{detail:"Not found."});case 11:return t.next=13,l.json();case 13:return t.abrupt("return",t.sent);case 16:throw t.prev=16,t.t0=t.catch(1),console.error(t.t0),new Error("Couldn't fetch data from ".concat(u.path));case 20:case"end":return t.stop()}}),t,null,[[1,16]])})))).apply(this,arguments)}function l(t){return p.apply(this,arguments)}function p(){return(p=t(e().mark((function t(r){var n,u;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a(r)||{field:"",value:""},u={path:"channels/".concat(n.field,"/").concat(n.value,"/")},t.next=4,s(u);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}export{l as getChannel,s as getData};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("../helpFunction.js"),r={host_url:t.API_HOST_URL,path:"",data:null,token:null,method:"GET",type:null,channel:""};function n(e){return a.apply(this,arguments)}function a(){return(a=e.asyncToGenerator(e.regeneratorRuntime().mark((function n(a){var u,o,s,c;return e.regeneratorRuntime().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=e.objectSpread2(e.objectSpread2({},r),a),n.prev=1,o=u.host_url+u.path,s=t.reqOptions(u.method||"GET",u.data,u.token,u.type||null,u.channel),n.next=6,fetch(o,s);case 6:if(401!==(c=n.sent).status&&403!==c.status){n.next=9;break}return n.abrupt("return",{detail:"Unauthorized"});case 9:if(404!==c.status){n.next=11;break}return n.abrupt("return",{detail:"Not found."});case 11:return n.next=13,c.json();case 13:return n.abrupt("return",n.sent);case 16:throw n.prev=16,n.t0=n.catch(1),console.error(n.t0),new Error("Couldn't fetch data from ".concat(u.path));case 20:case"end":return n.stop()}}),n,null,[[1,16]])})))).apply(this,arguments)}function u(){return(u=e.asyncToGenerator(e.regeneratorRuntime().mark((function r(a){var u,o;return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=t.extractSubDomain(a)||{field:"",value:""},o={path:"channels/".concat(u.field,"/").concat(u.value,"/")},e.next=4,n(o);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),r)})))).apply(this,arguments)}exports.getChannel=function(e){return u.apply(this,arguments)},exports.getData=n;
2
2
  //# sourceMappingURL=dbRequestst.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dbRequestst.js","sources":["../../../../../src/components/lib/auth/dbRequestst.ts"],"sourcesContent":["import _ from \"lodash\";\r\nimport { extractSubDomain, reqOptions, API_HOST_URL } from \"../helpFunction\";\r\n\r\n// Define interfaces for parameters\r\ninterface RequestParams {\r\n host_url?: string;\r\n path: string;\r\n data?: any;\r\n token?: string | null;\r\n method?: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\";\r\n type?: \"json\" | \"form-data\" | null | false;\r\n channel?: string;\r\n}\r\n\r\ninterface DomainObjects {\r\n field: string;\r\n value: string;\r\n}\r\n\r\n// Default parameters with proper types\r\nconst defaultParams: RequestParams = {\r\n host_url: API_HOST_URL,\r\n path: \"\",\r\n data: null,\r\n token: null,\r\n method: \"GET\",\r\n type: null,\r\n channel: \"\",\r\n};\r\n\r\n/**\r\n * Fetches data from the API\r\n * @example\r\n * ```ts\r\n * const data = await getData({ path: \"/api/data\", token: \"your_token\" });\r\n * ```\r\n * @param params Request parameters\r\n * @param params.host_url The host url to use for the request (optional)\r\n * @param params.path The path to the API endpoint (required) eg. \"sis/${handle}/student/\"\r\n * @param params.token The token to use for the request (optional)\r\n * @param params.method The method to use for the request (optional)\r\n * @param params.type The type of the request (optional)\r\n * @param params.channel The channel to use for the request (optional)\r\n * @returns Promise with the response data\r\n */\r\nexport async function getData(params: Partial<RequestParams>): Promise<any> {\r\n const _par: RequestParams = { ...defaultParams, ...params };\r\n\r\n try {\r\n // Get the initial course list belonging to a channel..\r\n const endpoint = _par.host_url + _par.path;\r\n const options = reqOptions(\r\n _par.method || \"GET\",\r\n _par.data,\r\n _par.token,\r\n _par.type || null,\r\n _par.channel\r\n );\r\n const response = await fetch(endpoint, options);\r\n\r\n if (response.status === 401 || response.status === 403) {\r\n return { detail: \"Unauthorized\" };\r\n }\r\n\r\n if (response.status === 404) return { detail: \"Not found.\" };\r\n\r\n return await response.json();\r\n } catch (e) {\r\n console.error(e);\r\n throw new Error(`Couldn't fetch data from ${_par.path}`);\r\n }\r\n}\r\n\r\n/**\r\n * Gets channel information based on host\r\n * @param host The hostname to extract subdomain from\r\n * @returns Promise with channel data\r\n */\r\nexport async function getChannel(host: string): Promise<any> {\r\n const domainObjects: DomainObjects = extractSubDomain(host) || {\r\n field: \"\",\r\n value: \"\",\r\n };\r\n const funcParams: RequestParams = {\r\n path: `channels/${domainObjects.field}/${domainObjects.value}/`,\r\n };\r\n return await getData(funcParams);\r\n}\r\n"],"names":["defaultParams","host_url","API_HOST_URL","path","data","token","method","type","channel","getData","_x","_getData","apply","this","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","params","_par","endpoint","options","response","wrap","_context","prev","next","_objectSpread","reqOptions","fetch","sent","status","abrupt","detail","json","t0","console","error","Error","concat","stop","getChannel","_x2","_getChannel","_callee2","host","domainObjects","funcParams","_context2","extractSubDomain","field","value"],"mappings":"wNAoBA,IAAMA,EAA+B,CACnCC,SAAUC,EACVC,KAAM,GACNC,KAAM,KACNC,MAAO,KACPC,OAAQ,MACRC,KAAM,KACNC,QAAS,IAkBWC,SAAAA,EAAOC,GAAA,OAAAC,EAAAC,MAAAC,KAAAC,UAAA,CA4B7B,SAAAH,IAFC,OAEDA,EAAAI,EAAAC,IAAAC,MA5BO,SAAAC,EAAuBC,GAA8B,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAP,IAAAQ,MAAA,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAYvD,OAXGP,EAAIQ,EAAAA,EAAuB5B,CAAAA,EAAAA,GAAkBmB,GAAMM,EAAAC,KAAA,EAIjDL,EAAWD,EAAKnB,SAAWmB,EAAKjB,KAChCmB,EAAUO,EACdT,EAAKd,QAAU,MACfc,EAAKhB,KACLgB,EAAKf,MACLe,EAAKb,MAAQ,KACba,EAAKZ,SACNiB,EAAAE,KAAA,EACsBG,MAAMT,EAAUC,GAAQ,KAAA,EAAjC,GAEU,OAFlBC,EAAQE,EAAAM,MAEDC,QAAsC,MAApBT,EAASS,OAAc,CAAAP,EAAAE,KAAA,EAAA,KAAA,CAAA,OAAAF,EAAAQ,OAC7C,SAAA,CAAEC,OAAQ,iBAAgB,KAAA,EAAA,GAGX,MAApBX,EAASS,OAAc,CAAAP,EAAAE,KAAA,GAAA,KAAA,CAAA,OAAAF,EAAAQ,OAAS,SAAA,CAAEC,OAAQ,eAAc,KAAA,GAAA,OAAAT,EAAAE,KAAA,GAE/CJ,EAASY,OAAM,KAAA,GAAA,OAAAV,EAAAQ,OAAAR,SAAAA,EAAAM,MAAA,KAAA,GAEX,MAFWN,EAAAC,KAAA,GAAAD,EAAAW,GAAAX,EAAA,MAAA,GAE5BY,QAAQC,MAAKb,EAAAW,IACP,IAAIG,MAAKC,4BAAAA,OAA6BpB,EAAKjB,OAAO,KAAA,GAAA,IAAA,MAAA,OAAAsB,EAAAgB,OAAA,GAAAvB,EAAA,KAAA,CAAA,CAAA,EAAA,KAE3D,MAAAN,MAAAC,KAAAC,UAAA,CAOqB4B,SAAAA,EAAUC,GAAA,OAAAC,EAAAhC,MAAAC,KAAAC,UAAA,CAS/B,SAAA8B,IAAA,OAAAA,EAAA7B,EAAAC,IAAAC,MATM,SAAA4B,EAA0BC,GAAY,IAAAC,EAAAC,EAAA,OAAAhC,IAAAQ,MAAA,SAAAyB,GAAA,cAAAA,EAAAvB,KAAAuB,EAAAtB,MAAA,KAAA,EAO1C,OANKoB,EAA+BG,EAAiBJ,IAAS,CAC7DK,MAAO,GACPC,MAAO,IAEHJ,EAA4B,CAChC7C,KAAI,YAAAqC,OAAcO,EAAcI,MAAK,KAAAX,OAAIO,EAAcK,MAAK,MAC7DH,EAAAtB,KAAA,EACYlB,EAAQuC,GAAW,KAAA,EAAA,OAAAC,EAAAhB,OAAAgB,SAAAA,EAAAlB,MAAA,KAAA,EAAA,IAAA,MAAA,OAAAkB,EAAAR,OAAA,GAAAI,EACjC,MAAAjC,MAAAC,KAAAC,UAAA"}
1
+ {"version":3,"file":"dbRequestst.js","sources":["../../../../../src/components/lib/auth/dbRequestst.ts"],"sourcesContent":["import _ from \"lodash\";\r\nimport { extractSubDomain, reqOptions, API_HOST_URL } from \"../helpFunction\";\r\n\r\n// Define interfaces for parameters\r\ninterface RequestParams {\r\n host_url?: string;\r\n path: string;\r\n data?: any;\r\n token?: string | null;\r\n method?: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\";\r\n type?: \"json\" | \"form-data\" | null | false;\r\n channel?: string;\r\n}\r\n\r\ninterface DomainObjects {\r\n field: string;\r\n value: string;\r\n}\r\n\r\n// Default parameters with proper types\r\nconst defaultParams: RequestParams = {\r\n host_url: API_HOST_URL,\r\n path: \"\",\r\n data: null,\r\n token: null,\r\n method: \"GET\",\r\n type: null,\r\n channel: \"\",\r\n};\r\n\r\n/**\r\n * Fetches data from the API\r\n * @example\r\n * ```ts\r\n * const data = await getData({ path: \"/api/data\", token: \"your_token\" });\r\n * ```\r\n * @param params Request parameters\r\n * @param params.host_url The host url to use for the request (optional)\r\n * @param params.path The path to the API endpoint (required) eg. \"sis/${handle}/student/\"\r\n * @param params.token The token to use for the request (optional)\r\n * @param params.method The method to use for the request (optional)\r\n * @param params.type The type of the request (optional)\r\n * @param params.channel The channel to use for the request (optional)\r\n * @returns Promise with the response data\r\n */\r\nexport async function getData(params: Partial<RequestParams>): Promise<any> {\r\n const _par: RequestParams = { ...defaultParams, ...params };\r\n\r\n try {\r\n // Get the initial course list belonging to a channel..\r\n const endpoint = _par.host_url + _par.path;\r\n const options = reqOptions(\r\n _par.method || \"GET\",\r\n _par.data,\r\n _par.token,\r\n _par.type || null,\r\n _par.channel\r\n );\r\n const response = await fetch(endpoint, options);\r\n\r\n if (response.status === 401 || response.status === 403) {\r\n return { detail: \"Unauthorized\" };\r\n }\r\n\r\n if (response.status === 404) return { detail: \"Not found.\" };\r\n\r\n return await response.json();\r\n } catch (e) {\r\n console.error(e);\r\n throw new Error(`Couldn't fetch data from ${_par.path}`);\r\n }\r\n}\r\n\r\n/**\r\n * Gets channel information based on host\r\n * @param host The hostname to extract subdomain from\r\n * @returns Promise with channel data\r\n */\r\nexport async function getChannel(host: string): Promise<any> {\r\n const domainObjects: DomainObjects = extractSubDomain(host) || {\r\n field: \"\",\r\n value: \"\",\r\n };\r\n const funcParams: RequestParams = {\r\n path: `channels/${domainObjects.field}/${domainObjects.value}/`,\r\n };\r\n return await getData(funcParams);\r\n}\r\n"],"names":["defaultParams","host_url","API_HOST_URL","path","data","token","method","type","channel","getData","_x","_getData","apply","this","arguments","_asyncToGenerator","asyncToGenerator","_regeneratorRuntime","regeneratorRuntime","mark","_callee","params","_par","endpoint","options","response","wrap","_context","prev","next","_objectSpread","objectSpread2","reqOptions","fetch","sent","status","abrupt","detail","json","t0","console","error","Error","concat","stop","_getChannel","_callee2","host","domainObjects","funcParams","_context2","extractSubDomain","field","value","getChannel","_x2"],"mappings":"uKAoBMA,EAA+B,CACnCC,SAAUC,EAAYA,aACtBC,KAAM,GACNC,KAAM,KACNC,MAAO,KACPC,OAAQ,MACRC,KAAM,KACNC,QAAS,IAkBWC,SAAAA,EAAOC,GAAA,OAAAC,EAAAC,MAAAC,KAAAC,UAAA,CA4B7B,SAAAH,IAFC,OAEDA,EAAAI,EAAAC,iBAAAC,EAAAC,qBAAAC,MA5BO,SAAAC,EAAuBC,GAA8B,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAR,EAAAC,qBAAAQ,MAAA,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAYvD,OAXGP,EAAIQ,EAAAC,cAAAD,EAAAC,cAAuB/B,CAAAA,EAAAA,GAAkBqB,GAAMM,EAAAC,KAAA,EAIjDL,EAAWD,EAAKrB,SAAWqB,EAAKnB,KAChCqB,EAAUQ,EAAUA,WACxBV,EAAKhB,QAAU,MACfgB,EAAKlB,KACLkB,EAAKjB,MACLiB,EAAKf,MAAQ,KACbe,EAAKd,SACNmB,EAAAE,KAAA,EACsBI,MAAMV,EAAUC,GAAQ,KAAA,EAAjC,GAEU,OAFlBC,EAAQE,EAAAO,MAEDC,QAAsC,MAApBV,EAASU,OAAc,CAAAR,EAAAE,KAAA,EAAA,KAAA,CAAA,OAAAF,EAAAS,OAC7C,SAAA,CAAEC,OAAQ,iBAAgB,KAAA,EAAA,GAGX,MAApBZ,EAASU,OAAc,CAAAR,EAAAE,KAAA,GAAA,KAAA,CAAA,OAAAF,EAAAS,OAAS,SAAA,CAAEC,OAAQ,eAAc,KAAA,GAAA,OAAAV,EAAAE,KAAA,GAE/CJ,EAASa,OAAM,KAAA,GAAA,OAAAX,EAAAS,OAAAT,SAAAA,EAAAO,MAAA,KAAA,GAEX,MAFWP,EAAAC,KAAA,GAAAD,EAAAY,GAAAZ,EAAA,MAAA,GAE5Ba,QAAQC,MAAKd,EAAAY,IACP,IAAIG,MAAKC,4BAAAA,OAA6BrB,EAAKnB,OAAO,KAAA,GAAA,IAAA,MAAA,OAAAwB,EAAAiB,OAAA,GAAAxB,EAAA,KAAA,CAAA,CAAA,EAAA,KAE3D,MAAAR,MAAAC,KAAAC,UAAA,CAgBA,SAAA+B,IAAA,OAAAA,EAAA9B,EAAAC,iBAAAC,EAAAC,qBAAAC,MATM,SAAA2B,EAA0BC,GAAY,IAAAC,EAAAC,EAAA,OAAAhC,EAAAC,qBAAAQ,MAAA,SAAAwB,GAAA,cAAAA,EAAAtB,KAAAsB,EAAArB,MAAA,KAAA,EAO1C,OANKmB,EAA+BG,EAAAA,iBAAiBJ,IAAS,CAC7DK,MAAO,GACPC,MAAO,IAEHJ,EAA4B,CAChC9C,KAAI,YAAAwC,OAAcK,EAAcI,MAAK,KAAAT,OAAIK,EAAcK,MAAK,MAC7DH,EAAArB,KAAA,EACYpB,EAAQwC,GAAW,KAAA,EAAA,OAAAC,EAAAd,OAAAc,SAAAA,EAAAhB,MAAA,KAAA,EAAA,IAAA,MAAA,OAAAgB,EAAAN,OAAA,GAAAE,EACjC,MAAAlC,MAAAC,KAAAC,UAAA,oBATqBwC,SAAUC,GAAA,OAAAV,EAAAjC,MAAAC,KAAAC,UAAA"}