@uploadcare/file-uploader 1.28.0-alpha.0 → 1.28.0-alpha.111

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 (564) hide show
  1. package/dist/abstract/CTX.d.ts +5 -3
  2. package/dist/abstract/CTX.d.ts.map +1 -0
  3. package/dist/abstract/TypedCollection.d.ts +2 -1
  4. package/dist/abstract/TypedCollection.d.ts.map +1 -0
  5. package/dist/abstract/TypedData.d.ts +3 -2
  6. package/dist/abstract/TypedData.d.ts.map +1 -0
  7. package/dist/abstract/UploaderPublicApi.d.ts +7 -6
  8. package/dist/abstract/UploaderPublicApi.d.ts.map +1 -0
  9. package/dist/abstract/buildOutputCollectionState.d.ts +3 -2
  10. package/dist/abstract/buildOutputCollectionState.d.ts.map +1 -0
  11. package/dist/abstract/customConfigOptions.d.ts +1 -0
  12. package/dist/abstract/customConfigOptions.d.ts.map +1 -0
  13. package/dist/abstract/defineComponents.d.ts +1 -0
  14. package/dist/abstract/defineComponents.d.ts.map +1 -0
  15. package/dist/abstract/features/ClipboardLayer.d.ts +2 -1
  16. package/dist/abstract/features/ClipboardLayer.d.ts.map +1 -0
  17. package/dist/abstract/loadFileUploaderFrom.d.ts +1 -0
  18. package/dist/abstract/loadFileUploaderFrom.d.ts.map +1 -0
  19. package/dist/abstract/loadFileUploaderFrom.js +1 -8
  20. package/dist/abstract/localeRegistry.d.ts +1 -0
  21. package/dist/abstract/localeRegistry.d.ts.map +1 -0
  22. package/dist/abstract/managers/LocaleManager.d.ts +3 -2
  23. package/dist/abstract/managers/LocaleManager.d.ts.map +1 -0
  24. package/dist/abstract/managers/ModalManager.d.ts +3 -2
  25. package/dist/abstract/managers/ModalManager.d.ts.map +1 -0
  26. package/dist/abstract/managers/SecureUploadsManager.d.ts +2 -1
  27. package/dist/abstract/managers/SecureUploadsManager.d.ts.map +1 -0
  28. package/dist/abstract/managers/TelemetryManager.d.ts +4 -3
  29. package/dist/abstract/managers/TelemetryManager.d.ts.map +1 -0
  30. package/dist/abstract/managers/ValidationManager.d.ts +7 -6
  31. package/dist/abstract/managers/ValidationManager.d.ts.map +1 -0
  32. package/dist/abstract/managers/a11y.d.ts +3 -2
  33. package/dist/abstract/managers/a11y.d.ts.map +1 -0
  34. package/dist/abstract/managers/plugin/PluginManager.d.ts +3 -2
  35. package/dist/abstract/managers/plugin/PluginManager.d.ts.map +1 -0
  36. package/dist/abstract/managers/plugin/PluginTypes.d.ts +4 -3
  37. package/dist/abstract/managers/plugin/PluginTypes.d.ts.map +1 -0
  38. package/dist/abstract/managers/plugin/index.d.ts +1 -0
  39. package/dist/abstract/managers/plugin/index.d.ts.map +1 -0
  40. package/dist/abstract/sharedConfigKey.d.ts +2 -1
  41. package/dist/abstract/sharedConfigKey.d.ts.map +1 -0
  42. package/dist/abstract/uploadEntrySchema.d.ts +4 -3
  43. package/dist/abstract/uploadEntrySchema.d.ts.map +1 -0
  44. package/dist/blocks/ActivityHeader/ActivityHeader.d.ts +2 -0
  45. package/dist/blocks/ActivityHeader/ActivityHeader.d.ts.map +1 -0
  46. package/dist/blocks/CameraSource/CameraSource.d.ts +7 -2
  47. package/dist/blocks/CameraSource/CameraSource.d.ts.map +1 -0
  48. package/dist/blocks/CameraSource/calcCameraModes.d.ts +2 -1
  49. package/dist/blocks/CameraSource/calcCameraModes.d.ts.map +1 -0
  50. package/dist/blocks/CameraSource/constants.d.ts +1 -0
  51. package/dist/blocks/CameraSource/constants.d.ts.map +1 -0
  52. package/dist/blocks/CloudImageEditor/index.d.ts +2 -0
  53. package/dist/blocks/CloudImageEditor/index.d.ts.map +1 -0
  54. package/dist/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +10 -2
  55. package/dist/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts.map +1 -0
  56. package/dist/blocks/CloudImageEditor/src/CropFrame.d.ts +2 -1
  57. package/dist/blocks/CloudImageEditor/src/CropFrame.d.ts.map +1 -0
  58. package/dist/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +5 -3
  59. package/dist/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts.map +1 -0
  60. package/dist/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +4 -2
  61. package/dist/blocks/CloudImageEditor/src/EditorButtonControl.d.ts.map +1 -0
  62. package/dist/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +3 -2
  63. package/dist/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts.map +1 -0
  64. package/dist/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +4 -2
  65. package/dist/blocks/CloudImageEditor/src/EditorFilterControl.d.ts.map +1 -0
  66. package/dist/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +4 -2
  67. package/dist/blocks/CloudImageEditor/src/EditorImageCropper.d.ts.map +1 -0
  68. package/dist/blocks/CloudImageEditor/src/EditorImageFader.d.ts +3 -2
  69. package/dist/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +1 -0
  70. package/dist/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +2 -1
  71. package/dist/blocks/CloudImageEditor/src/EditorOperationControl.d.ts.map +1 -0
  72. package/dist/blocks/CloudImageEditor/src/EditorScroller.d.ts +1 -0
  73. package/dist/blocks/CloudImageEditor/src/EditorScroller.d.ts.map +1 -0
  74. package/dist/blocks/CloudImageEditor/src/EditorSlider.d.ts +5 -3
  75. package/dist/blocks/CloudImageEditor/src/EditorSlider.d.ts.map +1 -0
  76. package/dist/blocks/CloudImageEditor/src/EditorToolbar.d.ts +12 -2
  77. package/dist/blocks/CloudImageEditor/src/EditorToolbar.d.ts.map +1 -0
  78. package/dist/blocks/CloudImageEditor/src/crop-utils.d.ts +2 -1
  79. package/dist/blocks/CloudImageEditor/src/crop-utils.d.ts.map +1 -0
  80. package/dist/blocks/CloudImageEditor/src/cropper-constants.d.ts +1 -0
  81. package/dist/blocks/CloudImageEditor/src/cropper-constants.d.ts.map +1 -0
  82. package/dist/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +5 -3
  83. package/dist/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts.map +1 -0
  84. package/dist/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +3 -2
  85. package/dist/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts.map +1 -0
  86. package/dist/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +1 -0
  87. package/dist/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts.map +1 -0
  88. package/dist/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +3 -2
  89. package/dist/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts.map +1 -0
  90. package/dist/blocks/CloudImageEditor/src/index.d.ts +1 -0
  91. package/dist/blocks/CloudImageEditor/src/index.d.ts.map +1 -0
  92. package/dist/blocks/CloudImageEditor/src/lib/classNames.d.ts +1 -0
  93. package/dist/blocks/CloudImageEditor/src/lib/classNames.d.ts.map +1 -0
  94. package/dist/blocks/CloudImageEditor/src/lib/linspace.d.ts +1 -0
  95. package/dist/blocks/CloudImageEditor/src/lib/linspace.d.ts.map +1 -0
  96. package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +3 -2
  97. package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts.map +1 -0
  98. package/dist/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +2 -1
  99. package/dist/blocks/CloudImageEditor/src/lib/parseTabs.d.ts.map +1 -0
  100. package/dist/blocks/CloudImageEditor/src/lib/pick.d.ts +1 -0
  101. package/dist/blocks/CloudImageEditor/src/lib/pick.d.ts.map +1 -0
  102. package/dist/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +2 -1
  103. package/dist/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts.map +1 -0
  104. package/dist/blocks/CloudImageEditor/src/state.d.ts +3 -2
  105. package/dist/blocks/CloudImageEditor/src/state.d.ts.map +1 -0
  106. package/dist/blocks/CloudImageEditor/src/svg-sprite.d.ts +1 -0
  107. package/dist/blocks/CloudImageEditor/src/svg-sprite.d.ts.map +1 -0
  108. package/dist/blocks/CloudImageEditor/src/toolbar-constants.d.ts +1 -0
  109. package/dist/blocks/CloudImageEditor/src/toolbar-constants.d.ts.map +1 -0
  110. package/dist/blocks/CloudImageEditor/src/types.d.ts +1 -0
  111. package/dist/blocks/CloudImageEditor/src/types.d.ts.map +1 -0
  112. package/dist/blocks/CloudImageEditor/src/util.d.ts +2 -1
  113. package/dist/blocks/CloudImageEditor/src/util.d.ts.map +1 -0
  114. package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +1 -0
  115. package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts.map +1 -0
  116. package/dist/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +5 -2
  117. package/dist/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -0
  118. package/dist/blocks/Config/Config.d.ts +4 -2
  119. package/dist/blocks/Config/Config.d.ts.map +1 -0
  120. package/dist/blocks/Config/assertions.d.ts +2 -1
  121. package/dist/blocks/Config/assertions.d.ts.map +1 -0
  122. package/dist/blocks/Config/computed-properties.d.ts +2 -1
  123. package/dist/blocks/Config/computed-properties.d.ts.map +1 -0
  124. package/dist/blocks/Config/initialConfig.d.ts +2 -1
  125. package/dist/blocks/Config/initialConfig.d.ts.map +1 -0
  126. package/dist/blocks/Config/normalizeConfigValue.d.ts +2 -1
  127. package/dist/blocks/Config/normalizeConfigValue.d.ts.map +1 -0
  128. package/dist/blocks/Config/validatorsType.d.ts +5 -4
  129. package/dist/blocks/Config/validatorsType.d.ts.map +1 -0
  130. package/dist/blocks/Copyright/Copyright.d.ts +3 -1
  131. package/dist/blocks/Copyright/Copyright.d.ts.map +1 -0
  132. package/dist/blocks/DropArea/DropArea.d.ts +5 -2
  133. package/dist/blocks/DropArea/DropArea.d.ts.map +1 -0
  134. package/dist/blocks/DropArea/addDropzone.d.ts +1 -0
  135. package/dist/blocks/DropArea/addDropzone.d.ts.map +1 -0
  136. package/dist/blocks/DropArea/getDropItems.d.ts +1 -0
  137. package/dist/blocks/DropArea/getDropItems.d.ts.map +1 -0
  138. package/dist/blocks/ExternalSource/ExternalSource.d.ts +6 -1
  139. package/dist/blocks/ExternalSource/ExternalSource.d.ts.map +1 -0
  140. package/dist/blocks/ExternalSource/MessageBridge.d.ts +2 -1
  141. package/dist/blocks/ExternalSource/MessageBridge.d.ts.map +1 -0
  142. package/dist/blocks/ExternalSource/buildThemeDefinition.d.ts +2 -1
  143. package/dist/blocks/ExternalSource/buildThemeDefinition.d.ts.map +1 -0
  144. package/dist/blocks/ExternalSource/query-string.d.ts +1 -0
  145. package/dist/blocks/ExternalSource/query-string.d.ts.map +1 -0
  146. package/dist/blocks/ExternalSource/types.d.ts +1 -0
  147. package/dist/blocks/ExternalSource/types.d.ts.map +1 -0
  148. package/dist/blocks/FileItem/FileItem.d.ts +8 -3
  149. package/dist/blocks/FileItem/FileItem.d.ts.map +1 -0
  150. package/dist/blocks/FileItem/FileItemConfig.d.ts +2 -1
  151. package/dist/blocks/FileItem/FileItemConfig.d.ts.map +1 -0
  152. package/dist/blocks/FormInput/FormInput.d.ts +1 -0
  153. package/dist/blocks/FormInput/FormInput.d.ts.map +1 -0
  154. package/dist/blocks/Icon/Icon.d.ts +4 -2
  155. package/dist/blocks/Icon/Icon.d.ts.map +1 -0
  156. package/dist/blocks/Img/Img.d.ts +1 -0
  157. package/dist/blocks/Img/Img.d.ts.map +1 -0
  158. package/dist/blocks/Img/ImgBase.d.ts +1 -0
  159. package/dist/blocks/Img/ImgBase.d.ts.map +1 -0
  160. package/dist/blocks/Img/ImgConfig.d.ts +3 -2
  161. package/dist/blocks/Img/ImgConfig.d.ts.map +1 -0
  162. package/dist/blocks/Img/configurations.d.ts +1 -0
  163. package/dist/blocks/Img/configurations.d.ts.map +1 -0
  164. package/dist/blocks/Img/props-map.d.ts +1 -0
  165. package/dist/blocks/Img/props-map.d.ts.map +1 -0
  166. package/dist/blocks/Img/utils/parseObjectToString.d.ts +1 -0
  167. package/dist/blocks/Img/utils/parseObjectToString.d.ts.map +1 -0
  168. package/dist/blocks/Modal/Modal.d.ts +4 -2
  169. package/dist/blocks/Modal/Modal.d.ts.map +1 -0
  170. package/dist/blocks/PluginActivityRenderer/PluginActivityRenderer.d.ts +8 -5
  171. package/dist/blocks/PluginActivityRenderer/PluginActivityRenderer.d.ts.map +1 -0
  172. package/dist/blocks/PluginActivityRenderer/index.d.ts +1 -0
  173. package/dist/blocks/PluginActivityRenderer/index.d.ts.map +1 -0
  174. package/dist/blocks/ProgressBar/ProgressBar.d.ts +4 -2
  175. package/dist/blocks/ProgressBar/ProgressBar.d.ts.map +1 -0
  176. package/dist/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +5 -2
  177. package/dist/blocks/ProgressBarCommon/ProgressBarCommon.d.ts.map +1 -0
  178. package/dist/blocks/Select/Select.d.ts +3 -1
  179. package/dist/blocks/Select/Select.d.ts.map +1 -0
  180. package/dist/blocks/SimpleBtn/SimpleBtn.d.ts +5 -1
  181. package/dist/blocks/SimpleBtn/SimpleBtn.d.ts.map +1 -0
  182. package/dist/blocks/SourceBtn/SourceBtn.d.ts +5 -2
  183. package/dist/blocks/SourceBtn/SourceBtn.d.ts.map +1 -0
  184. package/dist/blocks/SourceList/SourceList.d.ts +4 -2
  185. package/dist/blocks/SourceList/SourceList.d.ts.map +1 -0
  186. package/dist/blocks/Spinner/Spinner.d.ts +3 -1
  187. package/dist/blocks/Spinner/Spinner.d.ts.map +1 -0
  188. package/dist/blocks/StartFrom/StartFrom.d.ts +4 -2
  189. package/dist/blocks/StartFrom/StartFrom.d.ts.map +1 -0
  190. package/dist/blocks/Thumb/Thumb.d.ts +6 -3
  191. package/dist/blocks/Thumb/Thumb.d.ts.map +1 -0
  192. package/dist/blocks/UploadCtxProvider/EventEmitter.d.ts +5 -4
  193. package/dist/blocks/UploadCtxProvider/EventEmitter.d.ts.map +1 -0
  194. package/dist/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +2 -1
  195. package/dist/blocks/UploadCtxProvider/UploadCtxProvider.d.ts.map +1 -0
  196. package/dist/blocks/UploadList/UploadList.d.ts +7 -1
  197. package/dist/blocks/UploadList/UploadList.d.ts.map +1 -0
  198. package/dist/blocks/UrlSource/UrlSource.d.ts +5 -1
  199. package/dist/blocks/UrlSource/UrlSource.d.ts.map +1 -0
  200. package/dist/blocks/svg-backgrounds/svg-backgrounds.d.ts +1 -0
  201. package/dist/blocks/svg-backgrounds/svg-backgrounds.d.ts.map +1 -0
  202. package/dist/blocks/themes/uc-basic/svg-sprite.d.ts +1 -0
  203. package/dist/blocks/themes/uc-basic/svg-sprite.d.ts.map +1 -0
  204. package/dist/cameraPlugin.js +1 -0
  205. package/dist/cloudImageEditorPlugin.css +1282 -0
  206. package/dist/cloudImageEditorPlugin.js +1 -0
  207. package/dist/cloudImageEditorPlugin.layered.css +1289 -0
  208. package/dist/core.d.ts +3 -0
  209. package/dist/core.d.ts.map +1 -0
  210. package/dist/env.d.ts +1 -0
  211. package/dist/env.d.ts.map +1 -0
  212. package/dist/env.js +1 -8
  213. package/dist/externalSourcesPlugin.js +1 -0
  214. package/dist/imageShrinkPlugin.js +1 -0
  215. package/dist/index.css +1376 -3328
  216. package/dist/index.d.ts +16 -0
  217. package/dist/index.d.ts.map +1 -0
  218. package/dist/index.js +7 -1011
  219. package/dist/index.layered.css +1046 -3564
  220. package/dist/index.ssr.js +1290 -0
  221. package/dist/instagramPlugin.js +1 -0
  222. package/dist/lit/BaseComponent.d.ts +4 -3
  223. package/dist/lit/BaseComponent.d.ts.map +1 -0
  224. package/dist/lit/Constructor.d.ts +1 -0
  225. package/dist/lit/Constructor.d.ts.map +1 -0
  226. package/dist/lit/CssDataMixin.d.ts +3 -2
  227. package/dist/lit/CssDataMixin.d.ts.map +1 -0
  228. package/dist/lit/LightDomMixin.d.ts +3 -2
  229. package/dist/lit/LightDomMixin.d.ts.map +1 -0
  230. package/dist/lit/LitActivityBlock.d.ts +4 -3
  231. package/dist/lit/LitActivityBlock.d.ts.map +1 -0
  232. package/dist/lit/LitBlock.d.ts +17 -16
  233. package/dist/lit/LitBlock.d.ts.map +1 -0
  234. package/dist/lit/LitSolutionBlock.d.ts +6 -5
  235. package/dist/lit/LitSolutionBlock.d.ts.map +1 -0
  236. package/dist/lit/LitUploaderBlock.d.ts +8 -7
  237. package/dist/lit/LitUploaderBlock.d.ts.map +1 -0
  238. package/dist/lit/PubSubCompat.d.ts +1 -0
  239. package/dist/lit/PubSubCompat.d.ts.map +1 -0
  240. package/dist/lit/RegisterableElementMixin.d.ts +3 -2
  241. package/dist/lit/RegisterableElementMixin.d.ts.map +1 -0
  242. package/dist/lit/SharedState.d.ts +23 -22
  243. package/dist/lit/SharedState.d.ts.map +1 -0
  244. package/dist/lit/SymbioteCompatMixin.d.ts +3 -2
  245. package/dist/lit/SymbioteCompatMixin.d.ts.map +1 -0
  246. package/dist/lit/TestModeController.d.ts +3 -2
  247. package/dist/lit/TestModeController.d.ts.map +1 -0
  248. package/dist/lit/Uid.d.ts +1 -0
  249. package/dist/lit/Uid.d.ts.map +1 -0
  250. package/dist/lit/activity-constants.d.ts +2 -1
  251. package/dist/lit/activity-constants.d.ts.map +1 -0
  252. package/dist/lit/createDebugPrinter.d.ts +3 -2
  253. package/dist/lit/createDebugPrinter.d.ts.map +1 -0
  254. package/dist/lit/findBlockInCtx.d.ts +3 -2
  255. package/dist/lit/findBlockInCtx.d.ts.map +1 -0
  256. package/dist/lit/getOutputData.d.ts +3 -2
  257. package/dist/lit/getOutputData.d.ts.map +1 -0
  258. package/dist/lit/hasBlockInCtx.d.ts +3 -2
  259. package/dist/lit/hasBlockInCtx.d.ts.map +1 -0
  260. package/dist/lit/l10n.d.ts +3 -2
  261. package/dist/lit/l10n.d.ts.map +1 -0
  262. package/dist/lit/parseCssPropertyValue.d.ts +1 -0
  263. package/dist/lit/parseCssPropertyValue.d.ts.map +1 -0
  264. package/dist/lit/shared-instances.d.ts +15 -14
  265. package/dist/lit/shared-instances.d.ts.map +1 -0
  266. package/dist/locales/file-uploader/ar.d.ts +1 -0
  267. package/dist/locales/file-uploader/ar.d.ts.map +1 -0
  268. package/dist/locales/file-uploader/ar.js +1 -143
  269. package/dist/locales/file-uploader/az.d.ts +1 -0
  270. package/dist/locales/file-uploader/az.d.ts.map +1 -0
  271. package/dist/locales/file-uploader/az.js +1 -135
  272. package/dist/locales/file-uploader/ca.d.ts +1 -0
  273. package/dist/locales/file-uploader/ca.d.ts.map +1 -0
  274. package/dist/locales/file-uploader/ca.js +1 -137
  275. package/dist/locales/file-uploader/cs.d.ts +1 -0
  276. package/dist/locales/file-uploader/cs.d.ts.map +1 -0
  277. package/dist/locales/file-uploader/cs.js +1 -139
  278. package/dist/locales/file-uploader/da.d.ts +1 -0
  279. package/dist/locales/file-uploader/da.d.ts.map +1 -0
  280. package/dist/locales/file-uploader/da.js +1 -135
  281. package/dist/locales/file-uploader/de.d.ts +1 -0
  282. package/dist/locales/file-uploader/de.d.ts.map +1 -0
  283. package/dist/locales/file-uploader/de.js +1 -135
  284. package/dist/locales/file-uploader/el.d.ts +1 -0
  285. package/dist/locales/file-uploader/el.d.ts.map +1 -0
  286. package/dist/locales/file-uploader/el.js +1 -135
  287. package/dist/locales/file-uploader/en.d.ts +1 -0
  288. package/dist/locales/file-uploader/en.d.ts.map +1 -0
  289. package/dist/locales/file-uploader/en.js +1 -8
  290. package/dist/locales/file-uploader/es.d.ts +1 -0
  291. package/dist/locales/file-uploader/es.d.ts.map +1 -0
  292. package/dist/locales/file-uploader/es.js +1 -137
  293. package/dist/locales/file-uploader/et.d.ts +1 -0
  294. package/dist/locales/file-uploader/et.d.ts.map +1 -0
  295. package/dist/locales/file-uploader/et.js +1 -135
  296. package/dist/locales/file-uploader/fi.d.ts +1 -0
  297. package/dist/locales/file-uploader/fi.d.ts.map +1 -0
  298. package/dist/locales/file-uploader/fi.js +1 -135
  299. package/dist/locales/file-uploader/fr.d.ts +1 -0
  300. package/dist/locales/file-uploader/fr.d.ts.map +1 -0
  301. package/dist/locales/file-uploader/fr.js +1 -137
  302. package/dist/locales/file-uploader/he.d.ts +1 -0
  303. package/dist/locales/file-uploader/he.d.ts.map +1 -0
  304. package/dist/locales/file-uploader/he.js +1 -137
  305. package/dist/locales/file-uploader/hy.d.ts +1 -0
  306. package/dist/locales/file-uploader/hy.d.ts.map +1 -0
  307. package/dist/locales/file-uploader/hy.js +1 -135
  308. package/dist/locales/file-uploader/is.d.ts +1 -0
  309. package/dist/locales/file-uploader/is.d.ts.map +1 -0
  310. package/dist/locales/file-uploader/is.js +1 -135
  311. package/dist/locales/file-uploader/it.d.ts +1 -0
  312. package/dist/locales/file-uploader/it.d.ts.map +1 -0
  313. package/dist/locales/file-uploader/it.js +1 -137
  314. package/dist/locales/file-uploader/ja.d.ts +1 -0
  315. package/dist/locales/file-uploader/ja.d.ts.map +1 -0
  316. package/dist/locales/file-uploader/ja.js +1 -135
  317. package/dist/locales/file-uploader/ka.d.ts +1 -0
  318. package/dist/locales/file-uploader/ka.d.ts.map +1 -0
  319. package/dist/locales/file-uploader/ka.js +1 -135
  320. package/dist/locales/file-uploader/kk.d.ts +1 -0
  321. package/dist/locales/file-uploader/kk.d.ts.map +1 -0
  322. package/dist/locales/file-uploader/kk.js +1 -135
  323. package/dist/locales/file-uploader/ko.d.ts +1 -0
  324. package/dist/locales/file-uploader/ko.d.ts.map +1 -0
  325. package/dist/locales/file-uploader/ko.js +1 -135
  326. package/dist/locales/file-uploader/lv.d.ts +1 -0
  327. package/dist/locales/file-uploader/lv.d.ts.map +1 -0
  328. package/dist/locales/file-uploader/lv.js +1 -137
  329. package/dist/locales/file-uploader/nb.d.ts +1 -0
  330. package/dist/locales/file-uploader/nb.d.ts.map +1 -0
  331. package/dist/locales/file-uploader/nb.js +1 -135
  332. package/dist/locales/file-uploader/nl.d.ts +1 -0
  333. package/dist/locales/file-uploader/nl.d.ts.map +1 -0
  334. package/dist/locales/file-uploader/nl.js +1 -135
  335. package/dist/locales/file-uploader/pl.d.ts +1 -0
  336. package/dist/locales/file-uploader/pl.d.ts.map +1 -0
  337. package/dist/locales/file-uploader/pl.js +1 -139
  338. package/dist/locales/file-uploader/pt.d.ts +1 -0
  339. package/dist/locales/file-uploader/pt.d.ts.map +1 -0
  340. package/dist/locales/file-uploader/pt.js +1 -137
  341. package/dist/locales/file-uploader/ro.d.ts +1 -0
  342. package/dist/locales/file-uploader/ro.d.ts.map +1 -0
  343. package/dist/locales/file-uploader/ro.js +1 -137
  344. package/dist/locales/file-uploader/ru.d.ts +1 -0
  345. package/dist/locales/file-uploader/ru.d.ts.map +1 -0
  346. package/dist/locales/file-uploader/ru.js +1 -139
  347. package/dist/locales/file-uploader/sk.d.ts +1 -0
  348. package/dist/locales/file-uploader/sk.d.ts.map +1 -0
  349. package/dist/locales/file-uploader/sk.js +1 -139
  350. package/dist/locales/file-uploader/sr.d.ts +1 -0
  351. package/dist/locales/file-uploader/sr.d.ts.map +1 -0
  352. package/dist/locales/file-uploader/sr.js +1 -137
  353. package/dist/locales/file-uploader/sv.d.ts +1 -0
  354. package/dist/locales/file-uploader/sv.d.ts.map +1 -0
  355. package/dist/locales/file-uploader/sv.js +1 -135
  356. package/dist/locales/file-uploader/tr.d.ts +1 -0
  357. package/dist/locales/file-uploader/tr.d.ts.map +1 -0
  358. package/dist/locales/file-uploader/tr.js +1 -135
  359. package/dist/locales/file-uploader/uk.d.ts +1 -0
  360. package/dist/locales/file-uploader/uk.d.ts.map +1 -0
  361. package/dist/locales/file-uploader/uk.js +1 -139
  362. package/dist/locales/file-uploader/vi.d.ts +1 -0
  363. package/dist/locales/file-uploader/vi.d.ts.map +1 -0
  364. package/dist/locales/file-uploader/vi.js +1 -135
  365. package/dist/locales/file-uploader/zh-TW.d.ts +1 -0
  366. package/dist/locales/file-uploader/zh-TW.d.ts.map +1 -0
  367. package/dist/locales/file-uploader/zh-TW.js +1 -135
  368. package/dist/locales/file-uploader/zh.d.ts +1 -0
  369. package/dist/locales/file-uploader/zh.d.ts.map +1 -0
  370. package/dist/locales/file-uploader/zh.js +1 -135
  371. package/dist/plugins/cameraPlugin.d.ts +2 -1
  372. package/dist/plugins/cameraPlugin.d.ts.map +1 -0
  373. package/dist/plugins/cloudImageEditorPlugin.d.ts +2 -1
  374. package/dist/plugins/cloudImageEditorPlugin.d.ts.map +1 -0
  375. package/dist/plugins/externalSourcesPlugin.d.ts +2 -1
  376. package/dist/plugins/externalSourcesPlugin.d.ts.map +1 -0
  377. package/dist/plugins/imageShrinkPlugin.d.ts +2 -1
  378. package/dist/plugins/imageShrinkPlugin.d.ts.map +1 -0
  379. package/dist/plugins/instagramPlugin.d.ts +2 -1
  380. package/dist/plugins/instagramPlugin.d.ts.map +1 -0
  381. package/dist/plugins/unsplashPlugin.d.ts +2 -1
  382. package/dist/plugins/unsplashPlugin.d.ts.map +1 -0
  383. package/dist/plugins/urlSourcePlugin.d.ts +2 -1
  384. package/dist/plugins/urlSourcePlugin.d.ts.map +1 -0
  385. package/dist/solutions/adaptive-image/index.d.ts +1 -0
  386. package/dist/solutions/adaptive-image/index.d.ts.map +1 -0
  387. package/dist/solutions/cloud-image-editor/CloudImageEditor.d.ts +1 -0
  388. package/dist/solutions/cloud-image-editor/CloudImageEditor.d.ts.map +1 -0
  389. package/dist/solutions/cloud-image-editor/index.d.ts +2 -0
  390. package/dist/solutions/cloud-image-editor/index.d.ts.map +1 -0
  391. package/dist/solutions/file-uploader/inline/FileUploaderInline.d.ts +10 -1
  392. package/dist/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +1 -0
  393. package/dist/solutions/file-uploader/inline/index.d.ts +1 -0
  394. package/dist/solutions/file-uploader/inline/index.d.ts.map +1 -0
  395. package/dist/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +11 -1
  396. package/dist/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -0
  397. package/dist/solutions/file-uploader/minimal/index.d.ts +1 -0
  398. package/dist/solutions/file-uploader/minimal/index.d.ts.map +1 -0
  399. package/dist/solutions/file-uploader/regular/FileUploaderRegular.d.ts +12 -1
  400. package/dist/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -0
  401. package/dist/solutions/file-uploader/regular/index.d.ts +1 -0
  402. package/dist/solutions/file-uploader/regular/index.d.ts.map +1 -0
  403. package/dist/types/dom.d.ts +1 -0
  404. package/dist/types/dom.d.ts.map +1 -0
  405. package/dist/types/events.d.ts +2 -1
  406. package/dist/types/events.d.ts.map +1 -0
  407. package/dist/types/exported.d.ts +11 -10
  408. package/dist/types/exported.d.ts.map +1 -0
  409. package/dist/types/index.d.ts +2 -1
  410. package/dist/types/index.d.ts.map +1 -0
  411. package/dist/urlSourcePlugin.js +1 -0
  412. package/dist/utils/UID.d.ts +2 -1
  413. package/dist/utils/UID.d.ts.map +1 -0
  414. package/dist/utils/UploadSource.d.ts +1 -0
  415. package/dist/utils/UploadSource.d.ts.map +1 -0
  416. package/dist/utils/WindowHeightTracker.d.ts +2 -1
  417. package/dist/utils/WindowHeightTracker.d.ts.map +1 -0
  418. package/dist/utils/abilities.d.ts +1 -0
  419. package/dist/utils/abilities.d.ts.map +1 -0
  420. package/dist/utils/applyStyles.d.ts +1 -0
  421. package/dist/utils/applyStyles.d.ts.map +1 -0
  422. package/dist/utils/browser-info.d.ts +1 -0
  423. package/dist/utils/browser-info.d.ts.map +1 -0
  424. package/dist/utils/cdn-utils.d.ts +1 -0
  425. package/dist/utils/cdn-utils.d.ts.map +1 -0
  426. package/dist/utils/comma-separated.d.ts +1 -0
  427. package/dist/utils/comma-separated.d.ts.map +1 -0
  428. package/dist/utils/debounce.d.ts +1 -0
  429. package/dist/utils/debounce.d.ts.map +1 -0
  430. package/dist/utils/delay.d.ts +1 -0
  431. package/dist/utils/delay.d.ts.map +1 -0
  432. package/dist/utils/fileTypes.d.ts +1 -0
  433. package/dist/utils/fileTypes.d.ts.map +1 -0
  434. package/dist/utils/get-top-level-origin.d.ts +1 -0
  435. package/dist/utils/get-top-level-origin.d.ts.map +1 -0
  436. package/dist/utils/getLocaleDirection.d.ts +1 -0
  437. package/dist/utils/getLocaleDirection.d.ts.map +1 -0
  438. package/dist/utils/getPluralForm.d.ts +1 -0
  439. package/dist/utils/getPluralForm.d.ts.map +1 -0
  440. package/dist/utils/isPromiseLike.d.ts +1 -0
  441. package/dist/utils/isPromiseLike.d.ts.map +1 -0
  442. package/dist/utils/isSecureTokenExpired.d.ts +2 -1
  443. package/dist/utils/isSecureTokenExpired.d.ts.map +1 -0
  444. package/dist/utils/memoize.d.ts +1 -0
  445. package/dist/utils/memoize.d.ts.map +1 -0
  446. package/dist/utils/mixinClass.d.ts +1 -0
  447. package/dist/utils/mixinClass.d.ts.map +1 -0
  448. package/dist/utils/parseCdnUrl.d.ts +1 -0
  449. package/dist/utils/parseCdnUrl.d.ts.map +1 -0
  450. package/dist/utils/parseShrink.d.ts +1 -0
  451. package/dist/utils/parseShrink.d.ts.map +1 -0
  452. package/dist/utils/preloadImage.d.ts +1 -0
  453. package/dist/utils/preloadImage.d.ts.map +1 -0
  454. package/dist/utils/prettyBytes.d.ts +1 -0
  455. package/dist/utils/prettyBytes.d.ts.map +1 -0
  456. package/dist/utils/resizeImage.d.ts +1 -0
  457. package/dist/utils/resizeImage.d.ts.map +1 -0
  458. package/dist/utils/stringToArray.d.ts +1 -0
  459. package/dist/utils/stringToArray.d.ts.map +1 -0
  460. package/dist/utils/template-utils.d.ts +1 -0
  461. package/dist/utils/template-utils.d.ts.map +1 -0
  462. package/dist/utils/throttle.d.ts +1 -0
  463. package/dist/utils/throttle.d.ts.map +1 -0
  464. package/dist/utils/toKebabCase.d.ts +1 -0
  465. package/dist/utils/toKebabCase.d.ts.map +1 -0
  466. package/dist/utils/transparentPixelSrc.d.ts +1 -0
  467. package/dist/utils/transparentPixelSrc.d.ts.map +1 -0
  468. package/dist/utils/uniqueArray.d.ts +1 -0
  469. package/dist/utils/uniqueArray.d.ts.map +1 -0
  470. package/dist/utils/userAgent.d.ts +2 -1
  471. package/dist/utils/userAgent.d.ts.map +1 -0
  472. package/dist/utils/validators/collection/index.d.ts +1 -0
  473. package/dist/utils/validators/collection/index.d.ts.map +1 -0
  474. package/dist/utils/validators/collection/validateCollectionUploadError.d.ts +2 -1
  475. package/dist/utils/validators/collection/validateCollectionUploadError.d.ts.map +1 -0
  476. package/dist/utils/validators/collection/validateMultiple.d.ts +2 -1
  477. package/dist/utils/validators/collection/validateMultiple.d.ts.map +1 -0
  478. package/dist/utils/validators/file/index.d.ts +1 -0
  479. package/dist/utils/validators/file/index.d.ts.map +1 -0
  480. package/dist/utils/validators/file/validateFileType.d.ts +2 -1
  481. package/dist/utils/validators/file/validateFileType.d.ts.map +1 -0
  482. package/dist/utils/validators/file/validateIsImage.d.ts +2 -1
  483. package/dist/utils/validators/file/validateIsImage.d.ts.map +1 -0
  484. package/dist/utils/validators/file/validateMaxSizeLimit.d.ts +2 -1
  485. package/dist/utils/validators/file/validateMaxSizeLimit.d.ts.map +1 -0
  486. package/dist/utils/validators/file/validateUploadError.d.ts +2 -1
  487. package/dist/utils/validators/file/validateUploadError.d.ts.map +1 -0
  488. package/dist/utils/warnOnce.d.ts +1 -0
  489. package/dist/utils/warnOnce.d.ts.map +1 -0
  490. package/dist/utils/wildcardRegexp.d.ts +1 -0
  491. package/dist/utils/wildcardRegexp.d.ts.map +1 -0
  492. package/dist/utils/withResolvers.d.ts +1 -0
  493. package/dist/utils/withResolvers.d.ts.map +1 -0
  494. package/package.json +3 -5
  495. package/web/file-uploader.iife.min.js +8 -0
  496. package/web/file-uploader.min.js +8 -0
  497. package/web/uc-basic.layered.min.css +3243 -0
  498. package/web/uc-basic.min.css +3561 -0
  499. package/web/uc-cloud-image-editor.layered.min.css +1909 -0
  500. package/web/uc-cloud-image-editor.min.css +1859 -0
  501. package/web/uc-cloud-image-editor.min.js +8 -0
  502. package/web/uc-file-uploader-inline.layered.min.css +3243 -0
  503. package/web/uc-file-uploader-inline.min.css +3561 -0
  504. package/web/uc-file-uploader-inline.min.js +8 -0
  505. package/web/uc-file-uploader-minimal.layered.min.css +3243 -0
  506. package/web/uc-file-uploader-minimal.min.css +3561 -0
  507. package/web/uc-file-uploader-minimal.min.js +8 -0
  508. package/web/uc-file-uploader-regular.layered.min.css +3243 -0
  509. package/web/uc-file-uploader-regular.min.css +3561 -0
  510. package/web/uc-file-uploader-regular.min.js +8 -0
  511. package/web/uc-img.min.js +5 -0
  512. package/dist/CameraSource-DbyO6GoK.js +0 -481
  513. package/dist/CameraSource-px4BzEMI.js +0 -9
  514. package/dist/CloudImageEditor-BIxf1V4M.js +0 -2162
  515. package/dist/CloudImageEditorActivity-CJxP5N0S.js +0 -9
  516. package/dist/CloudImageEditorActivity-d4DpK6fQ.js +0 -87
  517. package/dist/Config-DuWre5p3.js +0 -433
  518. package/dist/ExternalSource-BKTFp95O.js +0 -248
  519. package/dist/ExternalSource-CR5DG0Jv.js +0 -9
  520. package/dist/Icon-CqTVC82Q.js +0 -1811
  521. package/dist/LitUploaderBlock-BA34rzeU.js +0 -998
  522. package/dist/UrlSource-BxVL9Pve.js +0 -9
  523. package/dist/UrlSource-DZK5EBwT.js +0 -73
  524. package/dist/abstract/TypedCollection.test.d.ts +0 -1
  525. package/dist/abstract/TypedData.test.d.ts +0 -1
  526. package/dist/abstract/managers/__tests__/ModalManager.test.d.ts +0 -13
  527. package/dist/abstract/managers/__tests__/SecureUploadsManager.test.d.ts +0 -1
  528. package/dist/blocks/CameraSource/__tests__/calcCameraModes.test.d.ts +0 -1
  529. package/dist/blocks/CloudImageEditor/src/crop-utils.test.d.ts +0 -1
  530. package/dist/blocks/CloudImageEditor/src/lib/classNames.test.d.ts +0 -1
  531. package/dist/blocks/CloudImageEditor/src/lib/linspace.test.d.ts +0 -1
  532. package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +0 -1
  533. package/dist/blocks/CloudImageEditor/src/lib/pick.test.d.ts +0 -1
  534. package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.test.d.ts +0 -1
  535. package/dist/blocks/Config/computed-properties.test.d.ts +0 -1
  536. package/dist/cameraPlugin-dGash48Q.js +0 -8
  537. package/dist/cloud-image-editor-fNswWrI4.js +0 -11
  538. package/dist/cloudImageEditorPlugin-2EU0Pm_j.js +0 -8
  539. package/dist/en-DNCwRJsB.js +0 -135
  540. package/dist/env-B1nfXy9i.js +0 -8
  541. package/dist/externalSourcesPlugin-DKQqk3AC.js +0 -8
  542. package/dist/imageShrinkPlugin-DAx8eRen.js +0 -8
  543. package/dist/instagramPlugin-k67tMAo3.js +0 -8
  544. package/dist/loadFileUploaderFrom-BWJM43Yq.js +0 -28
  545. package/dist/plugins-DxjsQUa8.js +0 -278
  546. package/dist/urlSourcePlugin-9xdB7Pvw.js +0 -8
  547. package/dist/utils/UID.test.d.ts +0 -1
  548. package/dist/utils/browser-info.test.d.ts +0 -1
  549. package/dist/utils/cdn-utils.test.d.ts +0 -1
  550. package/dist/utils/fileTypes.test.d.ts +0 -1
  551. package/dist/utils/get-top-level-origin.test.d.ts +0 -1
  552. package/dist/utils/getPluralForm.test.d.ts +0 -1
  553. package/dist/utils/isPromiseLike.test.d.ts +0 -1
  554. package/dist/utils/isSecureTokenExpired.test.d.ts +0 -1
  555. package/dist/utils/memoize.test.d.ts +0 -1
  556. package/dist/utils/parseCdnUrl.test.d.ts +0 -1
  557. package/dist/utils/parseShrink.test.d.ts +0 -1
  558. package/dist/utils/prettyBytes.test.d.ts +0 -1
  559. package/dist/utils/stringToArray.test.d.ts +0 -1
  560. package/dist/utils/template-utils.test.d.ts +0 -1
  561. package/dist/utils/toKebabCase.test.d.ts +0 -1
  562. package/dist/utils/uniqueArray.test.d.ts +0 -1
  563. package/dist/utils/wildcardRegexp.test.d.ts +0 -1
  564. package/dist/utils/withResolvers.test.d.ts +0 -1
package/dist/index.js CHANGED
@@ -1,1011 +1,7 @@
1
- /**
2
- * @license
3
- * Package: @uploadcare/file-uploader@1.28.0-alpha.0 (MIT)
4
- * License: https://github.com/uploadcare/blob/main/LICENSE
5
- * Built: 2026-03-02T14:46:15.080Z
6
- */
7
- import { F as InternalEventType, L as solutionBlockCtx, P as EventType, Q as stringToArray, at as defineLocale, ct as __decorate, dt as LightDomMixin, ft as CssDataMixin, j as LitBlock, lt as debounce, ot as UID, pt as PubSub, st as SymbioteMixin, ut as RegisterableElementMixin, z as ModalEvents } from "./Icon-CqTVC82Q.js";
8
- import { c as UploadSource, m as defineComponents, s as ExternalUploadSource } from "./plugins-DxjsQUa8.js";
9
- import { n as loadFileUploaderFrom } from "./loadFileUploaderFrom-BWJM43Yq.js";
10
- import { n as toKebabCase, t as Config } from "./Config-DuWre5p3.js";
11
- import { n as PACKAGE_VERSION, t as PACKAGE_NAME } from "./env-B1nfXy9i.js";
12
- import { n as LitActivityBlock, t as LitUploaderBlock } from "./LitUploaderBlock-BA34rzeU.js";
13
- import { v as throttle } from "./CloudImageEditor-BIxf1V4M.js";
14
- import { t as UrlSource } from "./UrlSource-DZK5EBwT.js";
15
- import { t as CameraSource } from "./CameraSource-DbyO6GoK.js";
16
- import { t as ExternalSource } from "./ExternalSource-BKTFp95O.js";
17
- import "./CloudImageEditorActivity-d4DpK6fQ.js";
18
- import { LitElement, html } from "lit";
19
- import { property, state } from "lit/decorators.js";
20
- import { CancelError, UploadcareError, uploadFile } from "@uploadcare/upload-client";
21
- import { unsafeSVG } from "lit/directives/unsafe-svg.js";
22
- import { repeat } from "lit/directives/repeat.js";
23
- import { createRef, ref } from "lit/directives/ref.js";
24
- var BaseComponent = class extends RegisterableElementMixin(SymbioteMixin()(CssDataMixin(LightDomMixin(LitElement)))) {}, svg_sprite_default = "<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol fill='none' viewBox='0 0 9 6' id='uc-icon-arrow-dropdown' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='m1.5 1.667 3 2.666 3-2.666' opacity='.5'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-aspect-ratio' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='M7.395 22.5H2.454v-5.25m14.824 5.25h4.94v-5.25m0-10.5V1.5h-4.94m-9.883 0H2.454v5.25'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-camera-full' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2 4.667a2 2 0 0 0-2 2V16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6.667a2 2 0 0 0-2-2h-2.667l-2-2.667H6.667l-2 2.667H2Zm8 10a3.667 3.667 0 1 0 0-7.334 3.667 3.667 0 0 0 0 7.334Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0v6.469a4.5 4.5 0 1 1-9 0V4.781Zm4.5-3a3 3 0 0 0-3 3v6.469a3 3 0 1 0 6 0V4.781a3 3 0 0 0-3-3Zm-8.156 8.11a.75.75 0 0 1 .75.75 7.406 7.406 0 1 0 14.812 0 .75.75 0 0 1 1.5 0 8.907 8.907 0 0 1-8.156 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.907 8.907 0 0 1-8.156-8.875.75.75 0 0 1 .75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone-mute' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0V6l3.524-3.524a.75.75 0 1 1 1.061 1.06L5.036 19.585a.75.75 0 0 1-1.06-1.06l1.656-1.657a8.88 8.88 0 0 1-2.538-6.227.75.75 0 0 1 1.5 0c0 2.009.8 3.83 2.1 5.166l1.771-1.772A4.483 4.483 0 0 1 7.5 11.25V4.781Zm2.037 8.182L15 7.5V4.781a3 3 0 1 0-6 0v6.469c0 .637.198 1.227.537 1.713Zm10.62-3.072a.75.75 0 0 1 .75.75 8.907 8.907 0 0 1-8.157 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.855 8.855 0 0 1-3.035-.811.75.75 0 1 1 .638-1.358 7.406 7.406 0 0 0 10.553-6.707.75.75 0 0 1 .75-.75ZM15 10.81a.75.75 0 0 1 1.5 0v.439a4.5 4.5 0 0 1-5 4.473.75.75 0 1 1 .166-1.491A3 3 0 0 0 15 11.25v-.44Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-photo-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-ngdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-pause' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' d='M1 0h2.5v10H1zM6.5 0H9v10H6.5z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-play' xmlns='http://www.w3.org/2000/svg'><path d='m1 0 9 5-9 5V0Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol fill='none' viewBox='0 0 20 20' id='uc-icon-square' xmlns='http://www.w3.org/2000/svg'><rect width='20' height='20' rx='4' fill='#fff'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-video-camera-full' xmlns='http://www.w3.org/2000/svg'><path d='M2 3.333a2 2 0 0 0-2 2v9.334a2 2 0 0 0 2 2h10.938a2 2 0 0 0 2-2v-2.013L20 15.646V4.354l-5.063 3.03v-2.05a2 2 0 0 0-2-2H2Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol></svg>", LitSolutionBlock = class extends LitBlock {
25
- constructor(...f) {
26
- super(...f), this.init$ = solutionBlockCtx(this);
27
- }
28
- static {
29
- this.styleAttrs = ["uc-wgt-common"];
30
- }
31
- initCallback() {
32
- super.initCallback(), this.a11y?.registerBlock(this), this.clipboardLayer?.registerBlock(this), this.sharedCtx.pub("*solution", this.tagName);
33
- }
34
- render() {
35
- return html`${unsafeSVG(svg_sprite_default)}`;
36
- }
37
- }, StartFrom = class extends LitActivityBlock {
38
- constructor(...f) {
39
- super(...f), this.historyTracked = !0, this.activityType = LitActivityBlock.activities.START_FROM;
40
- }
41
- initCallback() {
42
- super.initCallback(), this.registerActivity(this.activityType ?? "");
43
- }
44
- render() {
45
- return html` <div class="uc-content">${this.yield("")}</div> `;
46
- }
47
- }, UploadCtxProvider = class extends LitUploaderBlock {
48
- constructor(...f) {
49
- super(...f), this._unbindEventEmitter = null;
50
- }
51
- static {
52
- this.styleAttrs = ["uc-wgt-common"];
53
- }
54
- static {
55
- this.EventType = EventType;
56
- }
57
- initCallback() {
58
- super.initCallback(), this._unbindEventEmitter = this.eventEmitter.bindTarget(this);
59
- }
60
- disconnectedCallback() {
61
- super.disconnectedCallback(), this._unbindEventEmitter?.();
62
- }
63
- }, FileItemConfig = class extends LitUploaderBlock {
64
- constructor(...f) {
65
- super(...f), this._entrySubs = /* @__PURE__ */ new Set(), this.entry = null;
66
- }
67
- withEntry(f) {
68
- return (...V) => {
69
- let H = this.entry;
70
- if (!H) {
71
- console.warn("No entry found");
72
- return;
73
- }
74
- return f(H, ...V);
75
- };
76
- }
77
- subEntry(f, V) {
78
- this.withEntry((f, V, H) => {
79
- let U = f.subscribe(V, (f) => {
80
- this.isConnected && H(f);
81
- });
82
- this._entrySubs.add(U);
83
- })(f, V);
84
- }
85
- reset() {
86
- for (let f of this._entrySubs) f();
87
- this._entrySubs = /* @__PURE__ */ new Set(), this.entry = null;
88
- }
89
- disconnectedCallback() {
90
- super.disconnectedCallback(), this._entrySubs = /* @__PURE__ */ new Set();
91
- }
92
- }, FileItemState = Object.freeze({
93
- FINISHED: Symbol("FINISHED"),
94
- FAILED: Symbol("FAILED"),
95
- UPLOADING: Symbol("UPLOADING"),
96
- VALIDATION: Symbol("VALIDATION"),
97
- QUEUED_UPLOADING: Symbol("QUEUED-UPLOADING"),
98
- QUEUED_VALIDATION: Symbol("QUEUED-VALIDATION"),
99
- IDLE: Symbol("IDLE")
100
- }), FileItem = class f extends FileItemConfig {
101
- constructor(...f) {
102
- super(...f), this.couldBeCtxOwner = !0, this._pauseRender = !0, this.uid = "", this._itemName = "", this._errorText = "", this._hint = "", this._progressValue = 0, this._progressVisible = !1, this._badgeIcon = "", this._isFinished = !1, this._isFailed = !1, this._isUploading = !1, this._isFocused = !1, this._showFileNames = !1, this._ariaLabelStatusFile = "", this._pluginFileActions = [], this._renderedOnce = !1, this._handleRemove = () => {
103
- this.telemetryManager.sendEvent({ payload: { metadata: {
104
- event: "remove-file",
105
- node: this.tagName
106
- } } }), this.uid && this.uploadCollection.hasItem(this.uid) && this.uploadCollection.remove(this.uid);
107
- }, this._handleUploadClick = () => {
108
- this._upload();
109
- }, this._debouncedCalculateState = debounce(() => this._calculateState(), 100), this._updateHintAndProgress = this.withEntry(throttle((f, V) => {
110
- let H = f.getValue("errors")?.[0]?.message ?? "", U = f.getValue("source"), W = f.getValue("externalUrl"), G = V === FileItemState.FINISHED, K = V === FileItemState.UPLOADING, q = V === FileItemState.QUEUED_UPLOADING, J = V === FileItemState.QUEUED_VALIDATION, Y = V === FileItemState.VALIDATION, X = f.getValue("fileName"), Z = "";
111
- H ? Z = "" : !G && W && U && Object.values(ExternalUploadSource).includes(U) && (Z = this.l10n("waiting-for", { source: this.l10n(`src-type-${U}`) })), this._hint = Z, this._errorText = H, this._progressVisible = K || q || J || Y, this._progressValue = J || Y ? 0 : f.getValue("uploadProgress"), this._ariaLabelStatusFile = X ? this.l10n("a11y-file-item-status", {
112
- fileName: X,
113
- status: this.l10n(V?.description?.toLocaleLowerCase() ?? "").toLocaleLowerCase()
114
- }) : "";
115
- }, 100)), this._upload = this.withEntry(async (f) => {
116
- if (!this.uploadCollection.read(f.uid) || f.getValue("fileInfo") || f.getValue("isUploading") || f.getValue("errors").length > 0 || f.getValue("isValidationPending")) return;
117
- let V = this.cfg.multiple ? this.cfg.multipleMax : 1;
118
- if (!(V && this.uploadCollection.size > V)) {
119
- f.setMultipleValues({
120
- isUploading: !0,
121
- errors: [],
122
- isQueuedForUploading: !0
123
- }), this._debouncedCalculateState();
124
- try {
125
- let V = new AbortController();
126
- f.setValue("abortController", V);
127
- let H = await this.$["*uploadQueue"].add(async () => {
128
- f.setValue("isQueuedForUploading", !1);
129
- let H = f.getValue("file");
130
- if (H instanceof File || H instanceof Blob) {
131
- let V = (this._sharedInstancesBag.pluginManager?.snapshot().fileHooks ?? []).filter((f) => f.type === "beforeUpload");
132
- for (let U of V) try {
133
- let { file: V, mimeType: W } = await U.handler({
134
- file: H,
135
- mimeType: f.getValue("mimeType")
136
- });
137
- H = V, W !== f.getValue("mimeType") && f.setValue("mimeType", W);
138
- } catch (f) {
139
- this.debugPrint(`File hook "beforeUpload" from plugin "${U.pluginId}" failed`, f);
140
- }
141
- }
142
- let U = H || f.getValue("externalUrl") || f.getValue("uuid");
143
- if (!U) throw Error("No file input");
144
- let W = {
145
- ...await this.getUploadClientOptions(),
146
- fileName: f.getValue("fileName") ?? void 0,
147
- source: f.getValue("source") ?? void 0,
148
- onProgress: (V) => {
149
- if (V.isComputable) {
150
- let H = V.value * 100;
151
- f.setValue("uploadProgress", H);
152
- }
153
- },
154
- signal: V.signal,
155
- metadata: await this.getMetadataFor(f.uid)
156
- };
157
- return this.debugPrint("upload options", U, W), uploadFile(U, W);
158
- });
159
- f.setMultipleValues({
160
- fileInfo: H,
161
- isQueuedForUploading: !1,
162
- isUploading: !1,
163
- fileName: H.originalFilename,
164
- fileSize: H.size,
165
- isImage: H.isImage ?? !1,
166
- mimeType: H.contentInfo?.mime?.mime ?? H.mimeType,
167
- uuid: H.uuid,
168
- cdnUrl: f.getValue("cdnUrl") ?? H.cdnUrl,
169
- cdnUrlModifiers: f.getValue("cdnUrlModifiers") ?? "",
170
- uploadProgress: 100,
171
- source: f.getValue("source") ?? null
172
- }), f === this.entry && this._debouncedCalculateState();
173
- } catch (V) {
174
- this.telemetryManager.sendEventError(V, "file upload. Failed to upload file"), V instanceof CancelError && V.isCancel ? f.setMultipleValues({
175
- isUploading: !1,
176
- uploadProgress: 0
177
- }) : V instanceof UploadcareError ? f.setMultipleValues({
178
- isUploading: !1,
179
- uploadProgress: 0,
180
- uploadError: V
181
- }) : (console.error("Unknown upload error", V), f.setMultipleValues({
182
- isUploading: !1,
183
- uploadProgress: 0,
184
- uploadError: Error("Something went wrong", { cause: V })
185
- })), f === this.entry && this._debouncedCalculateState();
186
- }
187
- }
188
- });
189
- }
190
- _calculateState() {
191
- let f = this.entry;
192
- if (!f) return;
193
- let V = FileItemState.IDLE;
194
- f.getValue("errors").length > 0 ? V = FileItemState.FAILED : f.getValue("isQueuedForUploading") ? V = FileItemState.QUEUED_UPLOADING : f.getValue("isQueuedForValidation") ? V = FileItemState.QUEUED_VALIDATION : f.getValue("isValidationPending") ? V = FileItemState.VALIDATION : f.getValue("isUploading") ? V = FileItemState.UPLOADING : f.getValue("fileInfo") && (V = FileItemState.FINISHED), this._handleState(f, V);
195
- }
196
- _handleState(f, V) {
197
- V === FileItemState.FAILED ? this._badgeIcon = "badge-error" : V === FileItemState.FINISHED && (this._badgeIcon = "badge-success"), V === FileItemState.UPLOADING && (this._isFocused = !1, this.removeAttribute("focused")), this._isFailed = V === FileItemState.FAILED, this._isUploading = V === FileItemState.UPLOADING, this._isFinished = V === FileItemState.FINISHED, this._updateHintAndProgress(V);
198
- }
199
- reset() {
200
- super.reset(), this._debouncedCalculateState.cancel();
201
- }
202
- _observerCallback(f) {
203
- let [V] = f;
204
- V && V.isIntersecting && !this._renderedOnce && (this._pauseRender = !1, this._renderedOnce = !0);
205
- }
206
- _handleEntryId(f) {
207
- this.reset();
208
- let V = this.uploadCollection?.read(f);
209
- if (this.entry = V, !V) {
210
- this._updatePluginFileActions();
211
- return;
212
- }
213
- this.subEntry("isQueuedForValidation", () => {
214
- this._debouncedCalculateState();
215
- }), this.subEntry("isValidationPending", () => {
216
- this._debouncedCalculateState();
217
- }), this.subEntry("uploadProgress", () => {
218
- this._debouncedCalculateState();
219
- }), this.subEntry("isQueuedForUploading", () => {
220
- this._debouncedCalculateState();
221
- }), this.subEntry("fileName", (f) => {
222
- this._itemName = f || V.getValue("externalUrl") || this.l10n("file-no-name"), this._debouncedCalculateState();
223
- }), this.subEntry("externalUrl", (f) => {
224
- this._itemName = V.getValue("fileName") || f || this.l10n("file-no-name");
225
- }), this.subEntry("fileInfo", () => {
226
- this._debouncedCalculateState();
227
- }), this.subEntry("errors", () => this._debouncedCalculateState()), this.subEntry("isUploading", () => this._debouncedCalculateState()), this.subEntry("fileSize", () => this._debouncedCalculateState()), this.subEntry("mimeType", () => this._debouncedCalculateState()), this.subEntry("isImage", () => this._debouncedCalculateState()), this.subEntry("fileInfo", () => this._updatePluginFileActions()), this.subEntry("isUploading", () => this._updatePluginFileActions()), this.subEntry("errors", () => this._updatePluginFileActions()), this._calculateState(), this._updatePluginFileActions(), this._applyOnAddHooks(V);
228
- }
229
- async _applyOnAddHooks(f) {
230
- let V = f.getValue("file");
231
- if (!V) return;
232
- let H = (this._sharedInstancesBag.pluginManager?.snapshot().fileHooks ?? []).filter((f) => f.type === "onAdd"), U = V, W = f.getValue("mimeType");
233
- for (let f of H) try {
234
- ({file: U, mimeType: W} = await f.handler({
235
- file: U,
236
- mimeType: W
237
- }));
238
- } catch (V) {
239
- this.debugPrint(`File hook "onAdd" from plugin "${f.pluginId}" failed`, V);
240
- }
241
- U !== V && (f.setValue("file", U), f.setValue("fileSize", U.size)), W !== f.getValue("mimeType") && f.setValue("mimeType", W);
242
- }
243
- _updateShowFileNames(f) {
244
- if (this.cfg.filesViewMode === "list") {
245
- this._showFileNames = !0;
246
- return;
247
- }
248
- this._showFileNames = f;
249
- }
250
- willUpdate(f) {
251
- super.willUpdate(f), f.has("uid") && this._handleEntryId(this.uid);
252
- }
253
- _updatePluginFileActions() {
254
- let f = this._sharedInstancesBag.pluginManager;
255
- if (!f || !this.uid) {
256
- this._pluginFileActions = [];
257
- return;
258
- }
259
- let V = f.snapshot().fileActions, H = this.api.getOutputItem(this.uid);
260
- if (!H) {
261
- this._pluginFileActions = [];
262
- return;
263
- }
264
- this._pluginFileActions = V.filter((f) => {
265
- try {
266
- return f.shouldRender(H);
267
- } catch (V) {
268
- return console.error(`Error in plugin file action shouldRender (${f.id}):`, V), !1;
269
- }
270
- });
271
- }
272
- _handlePluginFileAction(f) {
273
- if (!this.uid) return;
274
- let V = this.api.getOutputItem(this.uid);
275
- if (V) try {
276
- f.onClick(V);
277
- } catch (V) {
278
- console.error(`Error in plugin file action onClick (${f.id}):`, V);
279
- }
280
- }
281
- initCallback() {
282
- super.initCallback(), this._handleEntryId(this.uid), this.subConfigValue("filesViewMode", (f) => {
283
- this._updateShowFileNames(this.cfg.gridShowFileNames), this.setAttribute("mode", f);
284
- }), this.subConfigValue("gridShowFileNames", (f) => {
285
- this._updateShowFileNames(f);
286
- }), this.onclick = () => {
287
- f.activeInstances.forEach((f) => {
288
- f === this ? f.setAttribute("focused", "") : f.removeAttribute("focused");
289
- });
290
- }, this.sub("*uploadTrigger", (f) => {
291
- this.entry && !f.has(this.entry.uid) || setTimeout(() => this.isConnected && this._upload());
292
- });
293
- let V = this._sharedInstancesBag.pluginManager;
294
- V?.onPluginsChange && (this._unsubscribePlugins = V.onPluginsChange(() => this._updatePluginFileActions())), this._updatePluginFileActions(), f.activeInstances.add(this);
295
- }
296
- connectedCallback() {
297
- super.connectedCallback(), this._observer = new window.IntersectionObserver(this._observerCallback.bind(this), { threshold: [0, 1] }), this._observer.observe(this);
298
- }
299
- disconnectedCallback() {
300
- this._unsubscribePlugins?.(), this._unsubscribePlugins = void 0, super.disconnectedCallback(), this._observer?.disconnect(), f.activeInstances.delete(this), this.reset();
301
- }
302
- static {
303
- this.activeInstances = /* @__PURE__ */ new Set();
304
- }
305
- shouldUpdate(f) {
306
- return this._pauseRender ? !1 : super.shouldUpdate(f);
307
- }
308
- render() {
309
- return html`
310
- <div
311
- class="uc-inner"
312
- ?data-finished=${this._isFinished}
313
- ?data-uploading=${this._isUploading}
314
- ?data-failed=${this._isFailed}
315
- ?data-focused=${this._isFocused}
316
- >
317
- <uc-thumb .uid=${this.uid} .badgeIcon=${this._badgeIcon}></uc-thumb>
318
-
319
- <div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" aria-label=${this._ariaLabelStatusFile}>
320
- <span class="uc-file-name" ?hidden=${!this._showFileNames}>${this._itemName}</span>
321
- <span class="uc-file-error" ?hidden=${!this._errorText}>${this._errorText}</span>
322
- <span class="uc-file-hint" ?hidden=${!this._hint}>${this._hint}</span>
323
- </div>
324
- <div class="uc-file-actions">
325
- ${this._pluginFileActions.map((f) => html`
326
- <button
327
- type="button"
328
- @click=${() => this._handlePluginFileAction(f)}
329
- title=${f.id}
330
- aria-label=${f.id}
331
- class="uc-plugin-action-btn uc-mini-btn"
332
- data-plugin-action-id=${f.id}
333
- >
334
- <uc-icon name=${f.icon}></uc-icon>
335
- </button>
336
- `)}
337
- <button
338
- type="button"
339
- @click=${this._handleRemove}
340
- title=${this.l10n("file-item-remove-button")}
341
- aria-label=${this.l10n("file-item-remove-button")}
342
- class="uc-remove-btn uc-mini-btn"
343
- >
344
- <uc-icon name="remove-file"></uc-icon>
345
- </button>
346
- <button type="button" class="uc-upload-btn uc-mini-btn" @click=${this._handleUploadClick}>
347
- <uc-icon name="upload"></uc-icon>
348
- </button>
349
- </div>
350
- <uc-progress-bar class="uc-progress-bar" .value=${this._progressValue} .visible=${this._progressVisible} ?hasFileName=${this._showFileNames}>
351
- </uc-progress-bar>
352
- </div>
353
- `;
354
- }
355
- };
356
- __decorate([state()], FileItem.prototype, "_pauseRender", void 0), __decorate([property({ attribute: !1 })], FileItem.prototype, "uid", void 0), __decorate([state()], FileItem.prototype, "_itemName", void 0), __decorate([state()], FileItem.prototype, "_errorText", void 0), __decorate([state()], FileItem.prototype, "_hint", void 0), __decorate([state()], FileItem.prototype, "_progressValue", void 0), __decorate([state()], FileItem.prototype, "_progressVisible", void 0), __decorate([state()], FileItem.prototype, "_badgeIcon", void 0), __decorate([state()], FileItem.prototype, "_isFinished", void 0), __decorate([state()], FileItem.prototype, "_isFailed", void 0), __decorate([state()], FileItem.prototype, "_isUploading", void 0), __decorate([state()], FileItem.prototype, "_isFocused", void 0), __decorate([state()], FileItem.prototype, "_showFileNames", void 0), __decorate([state()], FileItem.prototype, "_ariaLabelStatusFile", void 0), __decorate([state()], FileItem.prototype, "_pluginFileActions", void 0);
357
- function checkIsDirectory(f) {
358
- return new Promise((V) => {
359
- typeof window.FileReader != "function" && V(!1);
360
- try {
361
- let H = new FileReader();
362
- H.onerror = () => {
363
- V(!0);
364
- };
365
- let U = (f) => {
366
- f.type !== "loadend" && H.abort(), V(!1);
367
- };
368
- H.onloadend = U, H.onprogress = U, H.readAsDataURL(f);
369
- } catch {
370
- V(!1);
371
- }
372
- });
373
- }
374
- function readEntryContentAsync(f, V) {
375
- return new Promise((H) => {
376
- let U = 0, W = [], G = (f) => {
377
- if (!f) {
378
- console.warn("Unexpectedly received empty content entry", { scope: "drag-and-drop" }), H(null);
379
- return;
380
- }
381
- f.isFile ? (U++, f.file((G) => {
382
- U--;
383
- let K = new File([G], G.name, { type: G.type || V });
384
- W.push({
385
- type: "file",
386
- file: K,
387
- fullPath: f.fullPath
388
- }), U === 0 && H(W);
389
- })) : f.isDirectory && K(f.createReader());
390
- }, K = (f) => {
391
- U++, f.readEntries((f) => {
392
- U--;
393
- for (let V of f) G(V);
394
- U === 0 && H(W);
395
- });
396
- };
397
- G(f);
398
- });
399
- }
400
- function getDropItems(f) {
401
- let V = [], H = [];
402
- for (let U = 0; U < f.items.length; U++) {
403
- let W = f.items[U];
404
- if (W) if (W.kind === "file") {
405
- let f = W.type, U = W;
406
- if (typeof U.webkitGetAsEntry == "function" || typeof U.getAsEntry == "function") {
407
- let W = typeof U.webkitGetAsEntry == "function" ? U.webkitGetAsEntry() : U.getAsEntry?.();
408
- W && H.push(readEntryContentAsync(W, f).then((f) => {
409
- f && V.push(...f);
410
- }));
411
- continue;
412
- }
413
- let G = W.getAsFile();
414
- G && H.push(checkIsDirectory(G).then((f) => {
415
- f || V.push({
416
- type: "file",
417
- file: G
418
- });
419
- }));
420
- } else W.kind === "string" && /^text\/uri-list/.test(W.type) && H.push(new Promise((f) => {
421
- W.getAsString((H) => {
422
- V.push({
423
- type: "url",
424
- url: H
425
- }), f();
426
- });
427
- }));
428
- }
429
- return Promise.all(H).then(() => V);
430
- }
431
- const DropzoneState = Object.freeze({
432
- ACTIVE: 0,
433
- INACTIVE: 1,
434
- NEAR: 2,
435
- OVER: 3
436
- });
437
- var RESET_EVENTS = ["focus"], NEAR_OFFSET = 100, nearnessRegistry = /* @__PURE__ */ new Map();
438
- function distance(f, V) {
439
- let H = Math.max(Math.min(f[0], V.x + V.width), V.x), U = Math.max(Math.min(f[1], V.y + V.height), V.y);
440
- return Math.sqrt((f[0] - H) * (f[0] - H) + (f[1] - U) * (f[1] - U));
441
- }
442
- function addDropzone(f) {
443
- let V = 0, H = document.body, U = /* @__PURE__ */ new Set(), W = (f) => {
444
- U.add(f);
445
- }, G = DropzoneState.INACTIVE, K = (V) => {
446
- f.shouldIgnore() && V !== DropzoneState.INACTIVE || (G !== V && U.forEach((f) => {
447
- f(V);
448
- }), G = V);
449
- }, q = () => V > 0;
450
- W((V) => f.onChange(V));
451
- let J = () => {
452
- V = 0, K(DropzoneState.INACTIVE);
453
- }, Y = () => {
454
- V += 1, G === DropzoneState.INACTIVE && K(DropzoneState.ACTIVE);
455
- }, X = () => {
456
- --V, q() || K(DropzoneState.INACTIVE);
457
- }, Z = (f) => {
458
- f.preventDefault(), V = 0, K(DropzoneState.INACTIVE);
459
- }, Q = (H) => {
460
- if (f.shouldIgnore()) return;
461
- q() || (V += 1);
462
- let U = [H.x, H.y], W = f.element.getBoundingClientRect(), G = Math.floor(distance(U, W)), J = G < NEAR_OFFSET, Y = H.composedPath().includes(f.element);
463
- nearnessRegistry.set(f.element, G);
464
- let X = Math.min(...nearnessRegistry.values()) === G;
465
- Y && X ? (H.preventDefault(), K(DropzoneState.OVER)) : K(J && X ? DropzoneState.NEAR : DropzoneState.ACTIVE);
466
- }, $ = async (V) => {
467
- if (f.shouldIgnore()) return;
468
- V.preventDefault();
469
- let { dataTransfer: H } = V;
470
- if (!H) return;
471
- let U = await getDropItems(H);
472
- f.onItems(U), K(DropzoneState.INACTIVE);
473
- };
474
- return H.addEventListener("drop", Z), H.addEventListener("dragleave", X), H.addEventListener("dragenter", Y), H.addEventListener("dragover", Q), f.element.addEventListener("drop", $), RESET_EVENTS.forEach((f) => {
475
- window.addEventListener(f, J);
476
- }), () => {
477
- nearnessRegistry.delete(f.element), H.removeEventListener("drop", Z), H.removeEventListener("dragleave", X), H.removeEventListener("dragenter", Y), H.removeEventListener("dragover", Q), f.element.removeEventListener("drop", $), RESET_EVENTS.forEach((f) => {
478
- window.removeEventListener(f, J);
479
- });
480
- };
481
- }
482
- var dropAreaRegistry = /* @__PURE__ */ new Set(), DropArea = class extends LitUploaderBlock {
483
- constructor(...f) {
484
- super(...f), this.single = !1, this.ghost = !1, this.disabled = !1, this.clickable = !1, this.withIcon = !1, this.fullscreen = !1, this.initflow = !1, this._isEnabled = !0, this._isVisible = !0, this._destroyDropzone = null, this._destroyContentWrapperDropzone = null, this._contentWrapperRef = createRef(), this._handleAreaInteraction = (f) => {
485
- if (f instanceof KeyboardEvent) {
486
- if (f.code !== "Space" && f.code !== "Enter") return;
487
- } else if (!(f instanceof MouseEvent)) return;
488
- if (this.initflow) {
489
- this.api.initFlow();
490
- return;
491
- }
492
- this.api.openSystemDialog();
493
- }, this._sourceListAllowsLocal = !0, this._clickableListenersAttached = !1;
494
- }
495
- static {
496
- this.styleAttrs = [...super.styleAttrs, "uc-drop-area"];
497
- }
498
- get _localizedText() {
499
- let f = this.text;
500
- return typeof f == "string" && f.length > 0 ? this.l10n(f) || f : this.l10n("drop-files-here");
501
- }
502
- isActive() {
503
- if (!this._isEnabled) return !1;
504
- let f = this.getBoundingClientRect(), V = f.width > 0 && f.height > 0, H = f.top >= 0 && f.left >= 0 && f.bottom <= (window.innerHeight || document.documentElement.clientHeight) && f.right <= (window.innerWidth || document.documentElement.clientWidth), U = window.getComputedStyle(this), W = U.visibility !== "hidden" && U.display !== "none";
505
- return V && W && H;
506
- }
507
- initCallback() {
508
- super.initCallback(), dropAreaRegistry.add(this), this._updateIsEnabled(), this._updateVisibility(), this._updateClickableListeners(), this._updateDragStateAttribute(DropzoneState.INACTIVE), this._destroyDropzone = addDropzone({
509
- element: this,
510
- shouldIgnore: () => this._shouldIgnore(),
511
- onChange: (f) => {
512
- this._updateDragStateAttribute(f);
513
- },
514
- onItems: (f) => {
515
- f.length && (f.forEach((f) => {
516
- f.type === "url" ? this.api.addFileFromUrl(f.url, { source: UploadSource.DROP_AREA }) : f.type === "file" && this.api.addFileFromObject(f.file, {
517
- source: UploadSource.DROP_AREA,
518
- fullPath: f.fullPath
519
- });
520
- }), this.uploadCollection.size && (this.set$({ "*currentActivity": LitActivityBlock.activities.UPLOAD_LIST }), this.modalManager?.open(LitActivityBlock.activities.UPLOAD_LIST)));
521
- }
522
- }), this.updateComplete.then(() => this._setupContentWrapperDropzone()), this.subConfigValue("sourceList", (f) => {
523
- this._sourceListAllowsLocal = stringToArray(f).includes(UploadSource.LOCAL), this._updateIsEnabled(), this._updateVisibility();
524
- });
525
- }
526
- willUpdate(f) {
527
- super.willUpdate(f), f.has("disabled") && (this._updateIsEnabled(), this._updateVisibility());
528
- }
529
- updated(f) {
530
- super.updated(f), f.has("clickable") && this._updateClickableListeners();
531
- }
532
- _shouldIgnore() {
533
- if (!this._isEnabled || !this._couldHandleFiles()) return !0;
534
- if (!this.fullscreen) return !1;
535
- let f = dropAreaRegistry;
536
- return f.size === 0 ? !1 : [...f].filter((f) => f !== this).filter((f) => f.isActive()).length > 0;
537
- }
538
- _couldHandleFiles() {
539
- let f = this.cfg.multiple, V = this.cfg.multipleMax, H = this.uploadCollection.size;
540
- return !(f && V && H >= V || !f && H > 0);
541
- }
542
- _updateIsEnabled() {
543
- this._isEnabled = this._sourceListAllowsLocal && !this.disabled;
544
- }
545
- _updateVisibility() {
546
- let f = this._isEnabled || !this.querySelector("[data-default-slot]");
547
- this._isVisible = f, this.hidden = !f;
548
- }
549
- _updateDragStateAttribute(f) {
550
- let V = Object.entries(DropzoneState).find(([, V]) => V === f)?.[0].toLowerCase();
551
- V && this.setAttribute("drag-state", V);
552
- }
553
- _setupContentWrapperDropzone() {
554
- if (this._destroyContentWrapperDropzone) return;
555
- let f = this._contentWrapperRef.value;
556
- f && (this._destroyContentWrapperDropzone = addDropzone({
557
- element: f,
558
- onChange: (V) => {
559
- let H = Object.entries(DropzoneState).find(([, f]) => f === V)?.[0].toLowerCase();
560
- H && f.setAttribute("drag-state", H);
561
- },
562
- onItems: () => {},
563
- shouldIgnore: () => this._shouldIgnore()
564
- }));
565
- }
566
- _updateClickableListeners() {
567
- this.clickable && !this._clickableListenersAttached ? (this.addEventListener("keydown", this._handleAreaInteraction), this.addEventListener("click", this._handleAreaInteraction), this._clickableListenersAttached = !0) : !this.clickable && this._clickableListenersAttached && (this.removeEventListener("keydown", this._handleAreaInteraction), this.removeEventListener("click", this._handleAreaInteraction), this._clickableListenersAttached = !1);
568
- }
569
- disconnectedCallback() {
570
- super.disconnectedCallback(), dropAreaRegistry.delete(this), this._destroyDropzone?.(), this._destroyContentWrapperDropzone?.(), this._clickableListenersAttached &&= (this.removeEventListener("keydown", this._handleAreaInteraction), this.removeEventListener("click", this._handleAreaInteraction), !1);
571
- }
572
- render() {
573
- return html`
574
- ${this.yield("", html`<div data-default-slot hidden></div>
575
- <div ${ref(this._contentWrapperRef)} class="uc-content-wrapper" ?hidden=${!this._isVisible}>
576
- <div class="uc-icon-container" ?hidden=${!this.withIcon}>
577
- <uc-icon name="default"></uc-icon>
578
- <uc-icon name="arrow-down"></uc-icon>
579
- </div>
580
- <span class="uc-text">${this._localizedText}</span>
581
- </div>`)}
582
- `;
583
- }
584
- };
585
- __decorate([property({
586
- type: Boolean,
587
- noAccessor: !0
588
- })], DropArea.prototype, "single", void 0), __decorate([property({
589
- type: Boolean,
590
- noAccessor: !0
591
- })], DropArea.prototype, "ghost", void 0), __decorate([property({
592
- type: Boolean,
593
- reflect: !0
594
- })], DropArea.prototype, "disabled", void 0), __decorate([property({
595
- type: Boolean,
596
- reflect: !0
597
- })], DropArea.prototype, "clickable", void 0), __decorate([property({
598
- type: Boolean,
599
- attribute: "with-icon",
600
- reflect: !0
601
- })], DropArea.prototype, "withIcon", void 0), __decorate([property({
602
- type: Boolean,
603
- reflect: !0
604
- })], DropArea.prototype, "fullscreen", void 0), __decorate([property({
605
- type: Boolean,
606
- reflect: !0
607
- })], DropArea.prototype, "initflow", void 0), __decorate([property({ type: String })], DropArea.prototype, "text", void 0), __decorate([state()], DropArea.prototype, "_isEnabled", void 0), __decorate([state()], DropArea.prototype, "_isVisible", void 0);
608
- var UploadList = class extends LitUploaderBlock {
609
- constructor(...V) {
610
- super(...V), this.couldBeCtxOwner = !0, this.historyTracked = !0, this.activityType = LitActivityBlock.activities.UPLOAD_LIST, this._doneBtnVisible = !1, this._doneBtnEnabled = !1, this._uploadBtnVisible = !1, this._addMoreBtnVisible = !1, this._addMoreBtnEnabled = !1, this._commonErrorMessage = null, this._hasFiles = !1, this._latestSummary = null, this._handleAdd = () => {
611
- this.telemetryManager.sendEvent({
612
- eventType: InternalEventType.ACTION_EVENT,
613
- payload: { metadata: {
614
- event: "add-more",
615
- node: this.tagName
616
- } }
617
- }), this.api.initFlow(!0);
618
- }, this._handleUpload = () => {
619
- this.emit(EventType.UPLOAD_CLICK), this.api.uploadAll(), this._throttledHandleCollectionUpdate();
620
- }, this._handleDone = () => {
621
- this.emit(EventType.DONE_CLICK, this.api.getOutputCollectionState()), this.api.doneFlow();
622
- }, this._handleCancel = () => {
623
- this.telemetryManager.sendEvent({
624
- eventType: InternalEventType.ACTION_EVENT,
625
- payload: { metadata: {
626
- event: "clear-all",
627
- node: this.tagName
628
- } }
629
- }), this.uploadCollection.clearAll();
630
- }, this._throttledHandleCollectionUpdate = throttle(() => {
631
- this.isConnected && (this._updateUploadsState(), !this.couldOpenActivity && this.$["*currentActivity"] === this.activityType && this.historyBack(), this.cfg.confirmUpload || this.api.uploadAll());
632
- }, 300);
633
- }
634
- get _headerText() {
635
- return this._latestSummary ? this._getHeaderText(this._latestSummary) : "";
636
- }
637
- _updateUploadsState() {
638
- let f = this.api.getOutputCollectionState(), V = {
639
- total: f.totalCount,
640
- succeed: f.successCount,
641
- uploading: f.uploadingCount,
642
- failed: f.failedCount,
643
- validatingBeforeUploading: f.idleEntries.filter((f) => f.isValidationPending).length
644
- }, H = !f.errors.some((f) => f.type === "TOO_MANY_FILES" || f.type === "TOO_FEW_FILES"), U = f.errors.some((f) => f.type === "TOO_MANY_FILES"), W = f.totalCount === (this.cfg.multiple ? this.cfg.multipleMax : 1), G = f.allEntries.some((f) => f.isValidationPending), K = V.failed === 0 && f.errors.length === 0 && !G, q = !1, J = !1, Y = !1;
645
- if (V.total - V.succeed - V.uploading - V.failed > 0 && H && K && this.cfg.confirmUpload) q = !0;
646
- else {
647
- J = !0;
648
- let U = this.cfg.groupOutput ? !!f.group : !0;
649
- Y = V.total === V.succeed && H && K && U;
650
- }
651
- this._doneBtnVisible = J, this._doneBtnEnabled = Y, this._uploadBtnVisible = q, this._addMoreBtnEnabled = V.total === 0 || !U && !W, this._addMoreBtnVisible = !W || this.cfg.multiple, this._hasFiles = V.total > 0, this._latestSummary = V;
652
- }
653
- _getHeaderText(f) {
654
- let V = (V) => {
655
- let H = f[V];
656
- return V === "uploading" && (H += f.validatingBeforeUploading), this.l10n(`header-${V}`, { count: H });
657
- };
658
- return f.uploading > 0 || f.validatingBeforeUploading > 0 ? V("uploading") : f.failed > 0 ? V("failed") : f.succeed > 0 ? V("succeed") : V("total");
659
- }
660
- get couldOpenActivity() {
661
- return this.cfg.showEmptyList || this.uploadCollection.size > 0;
662
- }
663
- initCallback() {
664
- super.initCallback(), this.registerActivity(this.activityType), this.subConfigValue("multiple", this._throttledHandleCollectionUpdate), this.subConfigValue("multipleMin", this._throttledHandleCollectionUpdate), this.subConfigValue("multipleMax", this._throttledHandleCollectionUpdate), this.sub("*groupInfo", (f) => {
665
- f && this._throttledHandleCollectionUpdate();
666
- }), this.subConfigValue("filesViewMode", (f) => {
667
- this.setAttribute("mode", f);
668
- }), this.sub("*currentActivity", (f) => {
669
- !this.couldOpenActivity && f === this.activityType && (this.$["*currentActivity"] = this.initActivity);
670
- }), this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate), this.uploadCollection.observeCollection(this._throttledHandleCollectionUpdate), this.sub("*collectionErrors", (f) => {
671
- let V = f.filter((f) => f.type !== "SOME_FILES_HAS_ERRORS")[0];
672
- if (!V) {
673
- this._commonErrorMessage = null;
674
- return;
675
- }
676
- this._commonErrorMessage = V.message;
677
- });
678
- }
679
- disconnectedCallback() {
680
- super.disconnectedCallback(), this.has("*uploadCollection") && (this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate), this.uploadCollection.unobserveCollection(this._throttledHandleCollectionUpdate));
681
- }
682
- render() {
683
- return html`
684
- <uc-activity-header>
685
- <span aria-live="polite" class="uc-header-text">${this._headerText}</span>
686
- <button
687
- type="button"
688
- class="uc-mini-btn uc-close-btn"
689
- @click=${this.$["*closeModal"]}
690
- title=${this.l10n("a11y-activity-header-button-close")}
691
- aria-label=${this.l10n("a11y-activity-header-button-close")}
692
- >
693
- <uc-icon name="close"></uc-icon>
694
- </button>
695
- </uc-activity-header>
696
-
697
- <div class="uc-no-files" ?hidden=${this._hasFiles}>
698
- ${this.yield("empty", html`<span>${this.l10n("no-files")}</span>`)}
699
- </div>
700
-
701
- <div class="uc-files">
702
- <div class="uc-files-wrapper">
703
- ${repeat(this.$["*uploadList"] ?? [], ({ uid: f }) => f, ({ uid: f }) => html`<uc-file-item .uid=${f}></uc-file-item>`)}
704
- </div>
705
- <button
706
- type="button"
707
- class="uc-add-more-btn uc-secondary-btn"
708
- @click=${this._handleAdd}
709
- ?disabled=${!this._addMoreBtnEnabled}
710
- ?hidden=${!this._addMoreBtnVisible}
711
- >
712
- <uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span>
713
- </button>
714
- </div>
715
-
716
- <div class="uc-common-error"
717
- ?hidden=${!this._commonErrorMessage}
718
- >
719
- ${this._commonErrorMessage ?? ""}
720
- </div>
721
-
722
- <div class="uc-toolbar">
723
- <button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel}>${this.l10n("clear")}</button>
724
- <div class="uc-toolbar-spacer"></div>
725
- <button
726
- type="button"
727
- class="uc-add-more-btn uc-secondary-btn"
728
- ?hidden=${!this._addMoreBtnVisible}
729
- ?disabled=${!this._addMoreBtnEnabled}
730
- @click=${this._handleAdd}
731
- >
732
- <uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span>
733
- </button>
734
- <button
735
- type="button"
736
- class="uc-upload-btn uc-primary-btn"
737
- ?hidden=${!this._uploadBtnVisible}
738
- @click=${this._handleUpload}
739
- >${this.l10n("upload")}</button>
740
- <button
741
- type="button"
742
- class="uc-done-btn uc-primary-btn"
743
- ?hidden=${!this._doneBtnVisible}
744
- ?disabled=${!this._doneBtnEnabled}
745
- @click=${this._handleDone}
746
- >
747
- ${this.l10n("done")}
748
- </button>
749
- </div>
750
-
751
- <uc-drop-area ghost></uc-drop-area>
752
- `;
753
- }
754
- };
755
- __decorate([state()], UploadList.prototype, "_doneBtnVisible", void 0), __decorate([state()], UploadList.prototype, "_doneBtnEnabled", void 0), __decorate([state()], UploadList.prototype, "_uploadBtnVisible", void 0), __decorate([state()], UploadList.prototype, "_addMoreBtnVisible", void 0), __decorate([state()], UploadList.prototype, "_addMoreBtnEnabled", void 0), __decorate([state()], UploadList.prototype, "_commonErrorMessage", void 0), __decorate([state()], UploadList.prototype, "_hasFiles", void 0), __decorate([state()], UploadList.prototype, "_latestSummary", void 0);
756
- var SimpleBtn = class extends LitUploaderBlock {
757
- constructor(...f) {
758
- super(...f), this.couldBeCtxOwner = !0, this.dropzone = !0, this._buttonTextKey = "upload-file", this._handleClick = () => {
759
- this.api.initFlow();
760
- };
761
- }
762
- static {
763
- this.styleAttrs = [...super.styleAttrs, "uc-simple-btn"];
764
- }
765
- initCallback() {
766
- super.initCallback(), this.subConfigValue("multiple", (f) => {
767
- this._buttonTextKey = f ? "upload-files" : "upload-file";
768
- });
769
- }
770
- render() {
771
- return html`
772
- <uc-drop-area .disabled=${!this.dropzone}>
773
- <button type="button" @click=${this._handleClick}>
774
- <uc-icon name="upload"></uc-icon>
775
- <span>${this.l10n(this._buttonTextKey)}</span>
776
- ${this.yield("")}
777
- <div class="uc-visual-drop-area">${this.l10n("drop-files-here")}</div>
778
- </button>
779
- </uc-drop-area>
780
- `;
781
- }
782
- };
783
- __decorate([property({
784
- attribute: "dropzone",
785
- type: Boolean
786
- })], SimpleBtn.prototype, "dropzone", void 0), __decorate([state()], SimpleBtn.prototype, "_buttonTextKey", void 0);
787
- var PluginActivityHost = class extends LitActivityBlock {
788
- constructor(...f) {
789
- super(...f), this.activityType = null, this._containerRef = createRef();
790
- }
791
- initCallback() {
792
- this.activityType = this.registration?.id ?? null, super.initCallback(), this._ensureRegistered();
793
- }
794
- willUpdate(f) {
795
- super.willUpdate(f), f.has("registration") && (this._ensureRegistered(), this.isActivityActive && (this._disposeActivity(), this._renderActivity()));
796
- }
797
- _ensureRegistered() {
798
- this.registration && (this._isActivityRegistered() || this.registerActivity(this.activityType ?? "", {
799
- onActivate: () => this._renderActivity(),
800
- onDeactivate: () => this._disposeActivity()
801
- }));
802
- }
803
- _renderActivity() {
804
- let f = this._containerRef.value;
805
- if (!f || !this.registration) return;
806
- this._disposeActivity();
807
- let V = this.$["*currentActivityParams"];
808
- this._dispose = this.registration.render(f, V) ?? void 0;
809
- }
810
- _disposeActivity() {
811
- this._dispose?.(), this._dispose = void 0;
812
- let f = this._containerRef.value;
813
- f && f.replaceChildren();
814
- }
815
- disconnectedCallback() {
816
- this._disposeActivity(), super.disconnectedCallback();
817
- }
818
- render() {
819
- return html`<div
820
- style="display: flex; flex-direction: column; width: 100%; min-height: 0;"
821
- ${ref(this._containerRef)}
822
- ></div>`;
823
- }
824
- };
825
- __decorate([property({ attribute: !1 })], PluginActivityHost.prototype, "registration", void 0);
826
- var PluginActivityRenderer = class extends LitBlock {
827
- constructor(...f) {
828
- super(...f), this.mode = "modal", this._activities = [];
829
- }
830
- initCallback() {
831
- super.initCallback();
832
- let f = this._sharedInstancesBag.pluginManager;
833
- f?.onPluginsChange && (this._unsubscribePlugins = f.onPluginsChange(() => this._syncActivities())), this._syncActivities();
834
- }
835
- _syncActivities() {
836
- let f = this._sharedInstancesBag.pluginManager;
837
- if (!f) {
838
- this._activities = [];
839
- return;
840
- }
841
- this._activities = f.snapshot().activities;
842
- }
843
- disconnectedCallback() {
844
- this._unsubscribePlugins?.(), this._unsubscribePlugins = void 0, super.disconnectedCallback();
845
- }
846
- render() {
847
- return this.mode === "inline" ? html`${repeat(this._activities, (f) => f.id, (f) => html`<uc-plugin-activity-host .registration=${f}></uc-plugin-activity-host>`)}` : html`${repeat(this._activities, (f) => f.id, (f) => html`
848
- <uc-modal id=${f.id} strokes block-body-scrolling>
849
- <uc-plugin-activity-host .registration=${f}></uc-plugin-activity-host>
850
- </uc-modal>
851
- `)}`;
852
- }
853
- };
854
- __decorate([property({ type: String })], PluginActivityRenderer.prototype, "mode", void 0), __decorate([state()], PluginActivityRenderer.prototype, "_activities", void 0);
855
- var FileUploaderRegular = class extends LitSolutionBlock {
856
- static {
857
- this.styleAttrs = [...super.styleAttrs, "uc-file-uploader-regular"];
858
- }
859
- constructor() {
860
- super(), this.headless = !1, this.init$ = { ...this.init$ };
861
- }
862
- initCallback() {
863
- super.initCallback(), this.telemetryManager.sendEvent({ eventType: InternalEventType.INIT_SOLUTION });
864
- }
865
- render() {
866
- return html`
867
- ${super.render()}
868
- <uc-simple-btn ?hidden=${this.headless}></uc-simple-btn>
869
-
870
- <uc-modal id="start-from" strokes block-body-scrolling>
871
- <uc-start-from>
872
- <uc-drop-area with-icon clickable></uc-drop-area>
873
- <uc-source-list role="list" wrap></uc-source-list>
874
- <button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]}>${this.l10n("start-from-cancel")}</button>
875
- <uc-copyright></uc-copyright>
876
- </uc-start-from>
877
- </uc-modal>
878
-
879
- <uc-modal id="upload-list" strokes block-body-scrolling>
880
- <uc-upload-list></uc-upload-list>
881
- </uc-modal>
882
-
883
- <uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>
884
- `;
885
- }
886
- };
887
- __decorate([property({ type: Boolean })], FileUploaderRegular.prototype, "headless", void 0);
888
- var FileUploaderInline = class extends LitSolutionBlock {
889
- static {
890
- this.styleAttrs = [...super.styleAttrs, "uc-file-uploader-inline"];
891
- }
892
- constructor() {
893
- super(), this._couldCancel = !1, this._handleCancel = () => {
894
- if (this._couldHistoryBack) {
895
- let f = this.$["*historyBack"];
896
- f?.();
897
- return;
898
- }
899
- this._couldShowList && (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST);
900
- }, this.init$ = { ...this.init$ };
901
- }
902
- get _couldHistoryBack() {
903
- let f = this.$["*history"];
904
- return !f || f.length <= 1 ? !1 : f[f.length - 1] !== LitActivityBlock.activities.START_FROM;
905
- }
906
- get _couldShowList() {
907
- let f = this.$["*uploadList"];
908
- return this.cfg.showEmptyList || Array.isArray(f) && f.length > 0;
909
- }
910
- _getInitActivity() {
911
- return this.getCssData("--cfg-init-activity") || LitActivityBlock.activities.START_FROM;
912
- }
913
- initCallback() {
914
- super.initCallback(), this.telemetryManager.sendEvent({ eventType: InternalEventType.INIT_SOLUTION });
915
- let V = this._getInitActivity();
916
- this.sub("*currentActivity", (f) => {
917
- f || (this.$["*currentActivity"] = V);
918
- }), this.sub("*uploadList", (f) => {
919
- Array.isArray(f) && f.length > 0 && this.$["*currentActivity"] === V && (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST);
920
- }), this.sub("*history", () => {
921
- this._couldCancel = this._couldHistoryBack || this._couldShowList;
922
- });
923
- }
924
- render() {
925
- return html`
926
- ${super.render()}
927
- <uc-start-from>
928
- <uc-drop-area with-icon clickable></uc-drop-area>
929
- <uc-source-list role="list" wrap></uc-source-list>
930
- <button
931
- type="button"
932
- class="uc-cancel-btn uc-secondary-btn"
933
- @click=${this._handleCancel}
934
- ?hidden=${!this._couldCancel}
935
- >
936
- ${this.l10n("start-from-cancel")}
937
- </button>
938
- <uc-copyright></uc-copyright>
939
- </uc-start-from>
940
- <uc-upload-list></uc-upload-list>
941
- <uc-plugin-activity-renderer mode="inline"></uc-plugin-activity-renderer>
942
- `;
943
- }
944
- };
945
- __decorate([state()], FileUploaderInline.prototype, "_couldCancel", void 0);
946
- var ACTIVE_CLASS = "active", EMPTY_CLASS = "", FileUploaderMinimal = class extends LitSolutionBlock {
947
- static {
948
- this.styleAttrs = [...super.styleAttrs, "uc-file-uploader-minimal"];
949
- }
950
- _getInitActivity() {
951
- return this.getCssData("--cfg-init-activity") || LitActivityBlock.activities.START_FROM;
952
- }
953
- constructor() {
954
- super(), this._singleUpload = !1, this._isHiddenStartFrom = !1, this._classUploadList = EMPTY_CLASS, this._classStartFrom = EMPTY_CLASS, this._handleModalOpen = (f) => {
955
- f.id === LitActivityBlock.activities.CLOUD_IMG_EDIT && (this._classUploadList = ACTIVE_CLASS), this.$["*currentActivity"] === LitActivityBlock.activities.UPLOAD_LIST && (this._classUploadList = ACTIVE_CLASS, this._isHiddenStartFrom = !0);
956
- let V = this.$["*uploadList"];
957
- (!V || V.length <= 0) && (this._classStartFrom = ACTIVE_CLASS);
958
- }, this._handleModalClose = (f) => {
959
- f.id === this.$["*currentActivity"] && (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST, this._isHiddenStartFrom = !1), f.id === LitActivityBlock.activities.CLOUD_IMG_EDIT && (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST);
960
- }, this.init$ = { ...this.init$ };
961
- }
962
- initCallback() {
963
- super.initCallback(), this.telemetryManager.sendEvent({ eventType: InternalEventType.INIT_SOLUTION });
964
- let V = this._getInitActivity();
965
- this.sub("*currentActivity", (f) => {
966
- f === LitActivityBlock.activities.UPLOAD_LIST && this.modalManager?.closeAll(), f || (this.$["*currentActivity"] = V);
967
- }), this.sub("*uploadList", (f) => {
968
- Array.isArray(f) && f.length > 0 ? (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST, this._classStartFrom = EMPTY_CLASS) : (this._classUploadList = EMPTY_CLASS, this._isHiddenStartFrom = !1, this.$["*currentActivity"] = V);
969
- }), this.subConfigValue("confirmUpload", (f) => {
970
- f !== !1 && (this.cfg.confirmUpload = !1);
971
- }), this.subConfigValue("filesViewMode", (f) => {
972
- this.setAttribute("mode", f), this.subConfigValue("multiple", (V) => {
973
- f === "grid" ? (V ? this.style.removeProperty("--uc-grid-col") : this.style.setProperty("--uc-grid-col", "1"), this._singleUpload = !V) : (this.style.removeProperty("--uc-grid-col"), this._singleUpload = !1);
974
- });
975
- }), this.modalManager?.subscribe(ModalEvents.OPEN, this._handleModalOpen), this.modalManager?.subscribe(ModalEvents.CLOSE, this._handleModalClose);
976
- }
977
- disconnectedCallback() {
978
- super.disconnectedCallback(), this.modalManager?.unsubscribe(ModalEvents.OPEN, this._handleModalOpen), this.modalManager?.unsubscribe(ModalEvents.CLOSE, this._handleModalClose);
979
- }
980
- render() {
981
- return html`
982
- ${super.render()}
983
- <uc-start-from ?hidden=${this._isHiddenStartFrom} class=${this._classStartFrom}>
984
- <uc-drop-area
985
- ?single=${this._singleUpload}
986
- initflow
987
- clickable
988
- tabindex="0"
989
- ><span>${this.l10n("choose-file")}</span></uc-drop-area>
990
- <uc-copyright></uc-copyright>
991
- </uc-start-from>
992
- <uc-upload-list class=${this._classUploadList}></uc-upload-list>
993
-
994
- <uc-modal id="start-from" strokes block-body-scrolling>
995
- <uc-start-from>
996
- <uc-drop-area with-icon clickable></uc-drop-area>
997
- <uc-source-list role="list" wrap></uc-source-list>
998
- <button
999
- type="button"
1000
- class="uc-secondary-btn"
1001
- @click=${this.$["*historyBack"]}
1002
- >${this.l10n("start-from-cancel")}</button>
1003
- </uc-start-from>
1004
- </uc-modal>
1005
-
1006
- <uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>
1007
- `;
1008
- }
1009
- };
1010
- __decorate([state()], FileUploaderMinimal.prototype, "_singleUpload", void 0), __decorate([state()], FileUploaderMinimal.prototype, "_isHiddenStartFrom", void 0), __decorate([state()], FileUploaderMinimal.prototype, "_classUploadList", void 0), __decorate([state()], FileUploaderMinimal.prototype, "_classStartFrom", void 0);
1011
- export { LitActivityBlock as ActivityBlock, BaseComponent, LitBlock as Block, CameraSource, Config, PubSub as Data, DropArea, ExternalSource, ExternalUploadSource, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, ModalEvents, PACKAGE_NAME, PACKAGE_VERSION, PluginActivityHost, PluginActivityRenderer, SimpleBtn, LitSolutionBlock as SolutionBlock, StartFrom, UID, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };
1
+ import*as __rspack_external__uploadcare_upload_client_41a5a0bd from"@uploadcare/upload-client";import*as __rspack_external_lit from"lit";import*as __rspack_external_lit_decorators_js_aaefadbe from"lit/decorators.js";import*as __rspack_external_lit_directives_ref_js_a17221f9 from"lit/directives/ref.js";import*as __rspack_external_lit_directives_style_map_js_cb619b3b from"lit/directives/style-map.js";import*as __rspack_external_lit_directives_unsafe_svg_js_aeac3291 from"lit/directives/unsafe-svg.js";import*as __rspack_external_nanostores from"nanostores";import*as __rspack_external__lit_context_417c9377 from"@lit/context";import*as __rspack_external_keyux from"keyux";import*as __rspack_external__uploadcare_quality_insights_89d21ee8 from"@uploadcare/quality-insights";import*as __rspack_external_lit_directives_repeat_js_fd3099f6 from"lit/directives/repeat.js";import*as __rspack_external__uploadcare_cname_prefix_async_eddbdf1f from"@uploadcare/cname-prefix/async";var scriptUrl,installedChunks,loadCssChunkData,loadingAttribute,installedChunks1,installChunk,__webpack_modules__={7992(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{HU:()=>blockCtx,_H:()=>activityBlockCtx,lu:()=>uploaderBlockCtx,u8:()=>solutionBlockCtx});var _uploadcare_upload_client__rspack_import_0=__webpack_require__(5474);let blockCtx=()=>({}),activityBlockCtx=fnCtx=>({...blockCtx(),"*currentActivity":null,"*currentActivityParams":{},"*history":[],"*historyBack":null,"*closeModal":()=>{fnCtx.modalManager?.close(fnCtx.$["*currentActivity"]),fnCtx.pub("*currentActivity",null)}}),uploaderBlockCtx=fnCtx=>({...activityBlockCtx(fnCtx),"*commonProgress":0,"*uploadList":[],"*uploadQueue":new _uploadcare_upload_client__rspack_import_0.Queue(1),"*collectionErrors":[],"*collectionState":null,"*groupInfo":null,"*uploadTrigger":new Set}),solutionBlockCtx=fnCtx=>({...uploaderBlockCtx(fnCtx),"*solution":null})},3962(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Y:()=>defineComponents});let EXCLUDE_COMPONENTS=["UploaderBlock","ActivityBlock","Block","SolutionBlock"];function defineComponents(blockExports){for(let blockName in blockExports){if(EXCLUDE_COMPONENTS.includes(blockName))continue;let tagName=[...blockName].reduce((name,char)=>(char.toUpperCase()===char&&(char=`-${char.toLowerCase()}`),name+=char),"");tagName.startsWith("-")&&(tagName=tagName.replace("-","")),tagName.startsWith("uc-")||(tagName=`uc-${tagName}`),blockExports[blockName].reg&&blockExports[blockName].reg(tagName)}}},225(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{D:()=>loadFileUploaderFrom});var _defineComponents__rspack_import_0=__webpack_require__(3962);function loadFileUploaderFrom(url,register=!1){return new Promise((resolve,reject)=>{if("object"!=typeof document)return void resolve(null);if("object"==typeof window&&window.UC)return void resolve(window.UC);let script=document.createElement("script");script.async=!0,script.src=url,script.onerror=()=>{reject()},script.onload=()=>{let blocks=window.UC;register&&(0,_defineComponents__rspack_import_0.Y)(blocks),resolve(blocks)},document.head.appendChild(script)})}},7444(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{m:()=>defineLocale,s:()=>resolveLocaleDefinition});var _locales_file_uploader_en__rspack_import_0=__webpack_require__(1491);let localeRegistry=new Map,localeResolvers=new Map,defineLocaleSync=(localeName,definition)=>{localeRegistry.has(localeName)&&console.log(`Locale ${localeName} is already defined. Overwriting...`);let locale={..._locales_file_uploader_en__rspack_import_0.A,...definition};return localeRegistry.set(localeName,locale),locale},defineLocale=(localeName,definitionOrResolver)=>{if("function"==typeof definitionOrResolver)localeResolvers.set(localeName,definitionOrResolver);else defineLocaleSync(localeName,definitionOrResolver)},resolveLocaleDefinition=async localeName=>{let localeDefinition=localeRegistry.get(localeName);if(!localeDefinition){let definitionResolver=localeResolvers.get(localeName);if(!definitionResolver)throw Error(`Locale ${localeName} is not defined`);localeDefinition=defineLocaleSync(localeName,await definitionResolver())}return localeDefinition};defineLocale("en",_locales_file_uploader_en__rspack_import_0.A)},7959(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{OZ:()=>LocaleManager,PI:()=>localeStateKey});var _lit_shared_instances__rspack_import_0=__webpack_require__(5890),_locales_file_uploader_en__rspack_import_1=__webpack_require__(1491),_localeRegistry__rspack_import_3=__webpack_require__(7444),_sharedConfigKey__rspack_import_2=__webpack_require__(1971);let localeStateKey=key=>`*l10n/${key}`;class LocaleManager extends _lit_shared_instances__rspack_import_0.jM{constructor(sharedInstancesBag){for(let[key,value]of(super(sharedInstancesBag),this._localeName="",Object.entries(_locales_file_uploader_en__rspack_import_1.A))){let noTranslation=!this._ctx.has(localeStateKey(key))||!this._ctx.read(localeStateKey(key));this._ctx.add(localeStateKey(key),value,noTranslation)}let pluginManager=sharedInstancesBag.pluginManager;pluginManager?.onPluginsChange&&this.addSub(pluginManager.onPluginsChange(()=>{this._localeName&&this._applyPluginLocales(this._localeName)})),this.addSub(this._ctx.sub((0,_sharedConfigKey__rspack_import_2.T)("localeName"),async localeName=>{if(!localeName)return;this._localeName=localeName;let definition=await (0,_localeRegistry__rspack_import_3.s)(localeName);("en"===localeName||this._localeName===localeName)&&(this._applyPluginLocales(localeName),this._applyOverrides(localeName,definition))})),this.addSub(this._ctx.sub((0,_sharedConfigKey__rspack_import_2.T)("localeDefinitionOverride"),localeDefinitionOverride=>{if(!localeDefinitionOverride)return;let definition=localeDefinitionOverride[this._localeName];definition&&this._applyOverrides(this._localeName,definition)}))}_applyOverrides(localeName,definition){let overrides=this._cfg.localeDefinitionOverride?.[localeName];for(let[key,value]of Object.entries(definition)){let overriddenValue=overrides?.[key];this._ctx.add(localeStateKey(key),overriddenValue??value,!0)}}_applyPluginLocales(localeName){let pluginManager=this._sharedInstancesBag.pluginManager;if(pluginManager)for(let entry of pluginManager.snapshot().i18n){let{pluginId:_pluginId,...locales}=entry,pluginDefinition=locales[localeName];if(pluginDefinition)for(let[key,value]of Object.entries(pluginDefinition))void 0!==value&&this._ctx.add(localeStateKey(key),value,!0)}}}},3076(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{D:()=>ModalEvents,P:()=>ModalManager});var _lit_shared_instances__rspack_import_0=__webpack_require__(5890);let ModalEvents=Object.freeze({ADD:"modal:add",DELETE:"modal:delete",OPEN:"modal:open",CLOSE:"modal:close",CLOSE_ALL:"modal:closeAll",DESTROY:"modal:destroy"});class ModalManager extends _lit_shared_instances__rspack_import_0.jM{registerModal(id,modal){this._modals.set(id,modal),this._notify(ModalEvents.ADD,{id,modal})}deleteModal(id){let modal=this._modals.get(id);return!!modal&&(this._modals.delete(id),this._activeModals.delete(id),this._notify(ModalEvents.DELETE,{id,modal}),!0)}open(id){let modal=this._modals.get(id);return modal?(this._activeModals.add(id),this._notify(ModalEvents.OPEN,{modal,id}),!0):(this._debugPrint(`Modal with ID "${id}" not found`),!1)}close(id){let modal=this._modals.get(id);return modal&&this._activeModals.has(id)?(this._activeModals.delete(id),this._notify(ModalEvents.CLOSE,{id,modal}),!0):(this._debugPrint(`Modal with ID "${id}" not found or not active`),!1)}toggle(id){return this._modals.has(id)?this._activeModals.has(id)?this.close(id):this.open(id):(this._debugPrint(`Modal with ID "${id}" not found`),!1)}get hasActiveModals(){return this._activeModals.size>0}back(){if(0===this._activeModals.size)return this._debugPrint("No active modals to go back from"),!1;let lastModalId=Array.from(this._activeModals).pop();return!!lastModalId&&this.close(lastModalId)}closeAll(){let count=this._activeModals.size;return this._activeModals.clear(),this._notify(ModalEvents.CLOSE_ALL,{}),count}subscribe(event,callback){return this._subscribers.has(event)||this._subscribers.set(event,new Set),this._subscribers.get(event)?.add(callback),()=>this.unsubscribe(event,callback)}unsubscribe(event,callback){this._subscribers.has(event)&&this._subscribers.get(event)?.delete(callback)}_notify(event,data){if(this._subscribers.has(event))for(let callback of this._subscribers.get(event)??new Set)try{callback(data)}catch(error){this._sharedInstancesBag.telemetryManager.sendEventError(error,"modal subscriber"),this._debugPrint("Error in modal subscriber:",error)}}destroy(){super.destroy(),this.closeAll(),this._modals.clear(),this._subscribers.clear(),this._notify(ModalEvents.DESTROY,{})}constructor(...args){super(...args),this._modals=new Map,this._activeModals=new Set,this._subscribers=new Map}}},1971(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{T:()=>sharedConfigKey});let sharedConfigKey=key=>`*cfg/${key}`},4252(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{r:()=>CameraSource});var external_lit_=__webpack_require__(2927),decorators_js_=__webpack_require__(8899),LitActivityBlock=__webpack_require__(5923),LitUploaderBlock=__webpack_require__(5544),comma_separated=__webpack_require__(9101),debounce=__webpack_require__(4441),stringToArray=__webpack_require__(2513),UploadSource=__webpack_require__(5730),EventEmitter=__webpack_require__(9963),ref_js_=__webpack_require__(5337),style_map_js_=__webpack_require__(1156),constants=__webpack_require__(5973);function _ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}let DEFAULT_VIDEO_CONFIG={width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},DEFAULT_PERMISSIONS=["camera","microphone"];function formatTime(time){let minutes=Math.floor(time/60).toString().padStart(2,"0"),seconds=Math.floor(time%60).toString().padStart(2,"0");return`${minutes}:${seconds}`}let DEFAULT_PICTURE_FORMAT="image/jpeg",DEFAULT_VIDEO_FORMAT="video/webm";class CameraSource extends LitUploaderBlock.z{_attachPreviewListeners(videoElement){this._detachPreviewListeners(videoElement),videoElement.addEventListener("play",this._handlePreviewPlay),videoElement.addEventListener("pause",this._handlePreviewPause)}_detachPreviewListeners(videoElement){videoElement?.removeEventListener("play",this._handlePreviewPlay),videoElement?.removeEventListener("pause",this._handlePreviewPause)}_setVideoSource(stream){this._currentVideoSource!==stream&&(this._currentVideoSource=stream,this._applyVideoSource())}_applyVideoSource(){let videoElement=this._videoRef.value;if(!videoElement)return;let nextSource=this._currentVideoSource??null;videoElement.srcObject!==nextSource&&(videoElement.srcObject=nextSource)}_shot(){if(this._setCameraState("shot"),this._canvas=document.createElement("canvas"),this._ctx=this._canvas.getContext("2d"),!this._ctx)throw Error("Failed to get canvas context");let videoEl=this._videoRef.value;if(!videoEl)throw Error("Video element not found");this._canvas.height=videoEl.videoHeight,this._canvas.width=videoEl.videoWidth,this.cfg.cameraMirror&&(this._ctx.translate(this._canvas.width,0),this._ctx.scale(-1,1)),this._ctx.drawImage(videoEl,0,0),videoEl.pause()}_guessExtensionByMime(mime){let knownContainers={mp4:"mp4",ogg:"ogg",webm:"webm",quicktime:"mov","x-matroska":"mkv"};if(""===mime)return"webm";if(mime){let parts=mime.split("/");if(parts?.[0]==="video"){let rest=parts.slice(1).join("/"),container=rest?.split(";")[0];if(container&&knownContainers[container])return knownContainers[container]}}return"avi"}get _cameraModes(){return(0,stringToArray.G)(this.cfg.cameraModes).filter(mode=>mode===constants.S.PHOTO||mode===constants.S.VIDEO)}_teardownPermissionListeners(){if(0!==this._permissionCleanupFns.length){for(let cleanup of this._permissionCleanupFns)cleanup();this._permissionCleanupFns=[],this._unsubPermissions=null}}initCallback(){super.initCallback(),this.subConfigValue("cameraMirror",val=>{this._videoTransformCss=val?"scaleX(-1)":null}),this.subConfigValue("enableAudioRecording",val=>{this._audioToggleMicrophoneHidden=!val,this._audioSelectDisabled=!val}),this.subConfigValue("cameraModes",val=>{if(!this.isConnected)return;let cameraModes=(0,comma_separated.A)(val);this._handleCameraModes(cameraModes.filter(mode=>mode===constants.S.PHOTO||mode===constants.S.VIDEO))}),this._onActivate()}firstUpdated(changedProperties){super.firstUpdated(changedProperties),this._applyVideoSource()}updated(changedProperties){super.updated(changedProperties),this._applyVideoSource()}_destroy(){this._teardownPermissionListeners(),navigator.mediaDevices?.removeEventListener("devicechange",this._getDevices),this._detachPreviewListeners(this._videoRef.value),this._setVideoSource(null)}disconnectedCallback(){super.disconnectedCallback(),this._onDeactivate(),this._destroy()}render(){return(0,external_lit_.html)`<uc-activity-header><button type="button" class="uc-mini-btn" @click=${this.$["*historyBack"]} title=${this.l10n("back")} ><uc-icon name="back"></uc-icon></button><div ?hidden=${!this._cameraSelectHidden}><uc-icon name="camera"></uc-icon><span>${this.l10n("caption-camera")}</span></div><uc-select class="uc-camera-select" .options=${this._cameraSelectOptions} ?hidden=${this._cameraSelectHidden} @change=${this._handleCameraSelectChange} ></uc-select><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><video muted autoplay playsinline style=${(0,style_map_js_.styleMap)({transform:this._videoTransformCss})} ?hidden=${this._videoHidden} ${(0,ref_js_.ref)(this._videoRef)} ></video><div class="uc-message-box" ?hidden=${this._messageHidden}><span>${this.l10n(this._l10nMessage)}</span><button type="button" @click=${this._handleRequestPermissions} ?hidden=${this._requestBtnHidden} >${this.l10n("camera-permissions-request")}</button></div></div><div class="uc-controls"><div ${(0,ref_js_.ref)(this._switcherRef)} class="uc-switcher" ?hidden=${!this._timerHidden}><button data-id="photo" type="button" class="uc-switch uc-mini-btn" @click=${this._handleClickTab} ?hidden=${this._tabCameraHidden} data-testid="tab-photo" ><uc-icon name="camera"></uc-icon></button><button data-id="video" type="button" class="uc-switch uc-mini-btn" @click=${this._handleClickTab} ?hidden=${this._tabVideoHidden} data-testid="tab-video" ><uc-icon name="video-camera"></uc-icon></button></div><button class="uc-secondary-btn uc-recording-timer" @click=${this._handleToggleRecording} ?hidden=${this._timerHidden} data-testid="recording-timer" ><uc-icon name=${this._currentTimelineIcon}></uc-icon><span ${(0,ref_js_.ref)(this._timerRef)}> 00:00 </span><span ${(0,ref_js_.ref)(this._lineRef)} class="uc-line"></span></button><div class="uc-camera-actions uc-camera-action" ?hidden=${this._cameraActionsHidden} ><button type="button" class="uc-secondary-btn" @click=${this._handleRetake}> Retake </button><button type="button" class="uc-primary-btn" @click=${this._handleAccept} data-testid="accept" > Accept </button></div><button type="button" data-testid="shot" @click=${this._handleStartCamera} class=${this._mutableClassButton} ?hidden=${this._cameraHidden} ><uc-icon name=${this._currentIcon}></uc-icon></button><div class="uc-select"><button type="button" class="uc-mini-btn uc-btn-microphone" @click=${this._handleToggleAudio} ?hidden=${this._audioToggleMicrophoneHidden} data-testid="toggle-microphone" ><uc-icon name=${this._toggleMicrophoneIcon}></uc-icon></button><uc-select class="uc-audio-select" .options=${this._audioSelectOptions} ?hidden=${this._audioSelectHidden} ?disabled=${this._audioSelectDisabled} @change=${this._handleAudioSelectChange} data-testid="audio-select" ></uc-select></div></div>`}constructor(...args){super(...args),this.couldBeCtxOwner=!0,this._unsubPermissions=null,this._capturing=!1,this._chunks=[],this._mediaRecorder=null,this._stream=null,this._selectedAudioId=null,this._selectedCameraId=null,this._activeTab=null,this._options={},this._canvas=null,this._ctx=null,this._cameraDevices=[],this._audioDevices=[],this._permissionResponses={},this._permissionCleanupFns=[],this._currentVideoSource=null,this._handlePreviewPlay=()=>{this._startTimeline(),this._currentTimelineIcon="pause"},this._handlePreviewPause=()=>{this._currentTimelineIcon="play",this._stopTimeline()},this._timerRef=(0,ref_js_.createRef)(),this._lineRef=(0,ref_js_.createRef)(),this._videoRef=(0,ref_js_.createRef)(),this._switcherRef=(0,ref_js_.createRef)(),this._startTime=0,this._elapsedTime=0,this._videoTransformCss=null,this._videoHidden=!0,this._messageHidden=!0,this._requestBtnHidden=void 0!==navigator.permissions,this._cameraSelectOptions=[],this._cameraSelectHidden=!0,this._l10nMessage="",this._timerHidden=!0,this._cameraHidden=!0,this._cameraActionsHidden=!0,this._audioSelectOptions=[],this._audioSelectHidden=!0,this._audioSelectDisabled=!0,this._audioToggleMicrophoneHidden=!0,this._tabCameraHidden=!0,this._tabVideoHidden=!0,this._currentIcon="camera-full",this._currentTimelineIcon="play",this._toggleMicrophoneIcon="microphone",this._mutableClassButton="uc-shot-btn uc-camera-action",this._chooseActionWithCamera=()=>{if(this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{event:"start-camera",node:this.tagName,tabId:this._activeTab}}}),this._activeTab===constants.S.PHOTO&&this._shot(),this._activeTab===constants.S.VIDEO){if(this._mediaRecorder?.state==="recording")return void this._stopRecording();this._startRecording()}},this._handleCameraSelectChange=event=>{let target=event.target;target&&(this._selectedCameraId=target.value,this._capture())},this._handleAudioSelectChange=event=>{let target=event.target;target&&(this._selectedAudioId=target.value,this._capture())},this._handleRequestPermissions=()=>{this._capture()},this._handleStartCamera=()=>{this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{event:"shot-camera",node:this.tagName,tabId:this._activeTab}}}),this._chooseActionWithCamera()},this._handleToggleRecording=()=>{this._toggleRecording()},this._handleToggleAudio=()=>{this._toggleEnableAudio()},this._handleRetake=()=>{this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{event:"retake-camera",node:this.tagName,tabId:this._activeTab}}}),this._retake()},this._handleAccept=()=>{this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{event:"accept-camera",node:this.tagName,tabId:this._activeTab}}}),this._accept()},this._handleClickTab=event=>{let target=event.currentTarget,id=target?.getAttribute("data-id");id&&this._handleActiveTab(id)},this._updateTimer=()=>{let currentTime=Math.floor((performance.now()-this._startTime+this._elapsedTime)/1e3);if("number"==typeof this.cfg.maxVideoRecordingDuration&&this.cfg.maxVideoRecordingDuration>0){let remainingTime=this.cfg.maxVideoRecordingDuration-currentTime;if(remainingTime<=0){let timer=this._timerRef.value;timer&&(timer.textContent=formatTime(remainingTime)),this._stopRecording();return}let timer=this._timerRef.value;timer&&(timer.textContent=formatTime(remainingTime))}else{let timer=this._timerRef.value;timer&&(timer.textContent=formatTime(currentTime))}this._animationFrameId=requestAnimationFrame(this._updateTimer)},this._startTimer=()=>{this._startTime=performance.now(),this._elapsedTime=0,this._updateTimer()},this._stopTimer=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId)},this._startTimeline=()=>{let video=this._videoRef.value;if(!video)return;let currentTime=video.currentTime,duration=video.duration||1,line=this._lineRef.value;line&&(line.style.transform=`scaleX(${currentTime/duration})`);let timer=this._timerRef.value;timer&&(timer.textContent=formatTime(currentTime)),this._animationFrameId=requestAnimationFrame(this._startTimeline)},this._stopTimeline=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId)},this._animationFrameId=null,this._startRecording=()=>{try{this._chunks=[],this._options={...this.cfg.mediaRecorderOptions};let{mimeType}=this.cfg.mediaRecorderOptions||{};mimeType&&MediaRecorder.isTypeSupported(mimeType)?this._options.mimeType=mimeType:MediaRecorder.isTypeSupported(DEFAULT_VIDEO_FORMAT)?this._options.mimeType=DEFAULT_VIDEO_FORMAT:this._options.mimeType="video/mp4",this._stream&&(this._mediaRecorder=new MediaRecorder(this._stream,this._options),this._mediaRecorder.start(),this._mediaRecorder.addEventListener("dataavailable",event=>{this._chunks.push(event.data)}),this._startTimer(),this.classList.add("uc-recording"),this._setCameraState(constants.q.PLAY))}catch(error){console.error("Failed to start recording",error),this.telemetryManager.sendEventError(error,"camera recording. Failed to start recording")}},this._stopRecording=()=>{this._mediaRecorder?.addEventListener("stop",()=>{this._previewVideo(),this._stopTimer(),this._setCameraState(constants.q.STOP)}),this._mediaRecorder?.stop(),this.classList.remove("uc-recording"),this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{event:"stop-camera",node:this.tagName,tabId:this._activeTab}}})},this._toggleRecording=()=>{if(this._mediaRecorder?.state==="recording")return;let videoEl=this._videoRef.value;videoEl&&(videoEl.paused||videoEl.ended||!(videoEl.readyState>2)?videoEl.paused&&videoEl.play():videoEl.pause())},this._toggleEnableAudio=()=>{this._stream?.getAudioTracks().forEach(track=>{track.enabled=!track.enabled,this._toggleMicrophoneIcon=track.enabled?"microphone":"microphone-mute",this._audioSelectDisabled=!track.enabled})},this._previewVideo=()=>{try{let blob=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),videoURL=URL.createObjectURL(blob),videoElement=this._videoRef.value;if(!videoElement)return;videoElement.muted=!1,videoElement.volume=1,this._setVideoSource(null),videoElement.src=videoURL,this._attachPreviewListeners(videoElement)}catch(error){console.error("Failed to preview video",error),this.telemetryManager.sendEventError(error,"camera previewing. Failed to preview video")}},this._retake=()=>{if(this._setCameraState(constants.q.RETAKE),this._activeTab===constants.S.VIDEO){this._setVideoSource(this._stream);let videoElement=this._videoRef.value;videoElement&&(videoElement.muted=!0)}this._videoRef.value?.play?.()},this._accept=()=>{if(this._setCameraState(constants.q.ACCEPT),this._activeTab===constants.S.PHOTO)return void this._canvas?.toBlob(blob=>{if(!blob)return;let file=this._createFile("camera","jpeg",DEFAULT_PICTURE_FORMAT,blob);this._toSend(file)},DEFAULT_PICTURE_FORMAT);let blob=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),ext=this._guessExtensionByMime(this._mediaRecorder?.mimeType),file=this._createFile("video",ext,`video/${ext}`,blob);this._toSend(file),this._chunks=[]},this._handlePhoto=status=>{status===constants.q.SHOT&&(this._tabVideoHidden=!0,this._cameraHidden=!0,this._tabCameraHidden=!0,this._cameraActionsHidden=!1,this._cameraSelectHidden=!0),(status===constants.q.RETAKE||status===constants.q.ACCEPT)&&(this._tabVideoHidden=!this._cameraModes.includes(constants.S.VIDEO),this._tabCameraHidden=!this._cameraModes.includes(constants.S.PHOTO),this._cameraHidden=!1,this._cameraActionsHidden=!0,this._cameraSelectHidden=this._cameraDevices.length<=1)},this._handleVideo=status=>{status===constants.q.PLAY&&(this._timerHidden=!1,this._tabCameraHidden=!0,this._cameraSelectHidden=!0,this._audioSelectHidden=!0,this._currentTimelineIcon="pause",this._currentIcon="square",this._mutableClassButton="uc-shot-btn uc-camera-action uc-stop-record"),status===constants.q.STOP&&(this._timerHidden=!1,this._cameraHidden=!0,this._audioToggleMicrophoneHidden=!0,this._cameraActionsHidden=!1),(status===constants.q.RETAKE||status===constants.q.ACCEPT)&&(this._timerHidden=!0,this._tabVideoHidden=!this._cameraModes.includes(constants.S.VIDEO),this._tabCameraHidden=!this._cameraModes.includes(constants.S.PHOTO),this._cameraHidden=!1,this._cameraActionsHidden=!0,this._audioToggleMicrophoneHidden=!this.cfg.enableAudioRecording,this._currentIcon="video-camera-full",this._mutableClassButton="uc-shot-btn uc-camera-action",this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._cameraSelectHidden=this._cameraDevices.length<=1)},this._setCameraState=status=>{this._activeTab===constants.S.PHOTO&&("shot"===status||"retake"===status||"accept"===status)&&this._handlePhoto(status),this._activeTab===constants.S.VIDEO&&("play"===status||"stop"===status||"retake"===status||"accept"===status||"pause"===status||"resume"===status)&&this._handleVideo(status)},this._handleActiveTab=tabId=>{let switcher=this._switcherRef.value;switcher?.querySelectorAll("button").forEach(btn=>{btn.classList.toggle("uc-active",btn.getAttribute("data-id")===tabId)}),tabId===constants.S.PHOTO&&(this._currentIcon="camera-full",this._audioSelectHidden=!0,this._audioToggleMicrophoneHidden=!0),tabId===constants.S.VIDEO&&(this._currentTimelineIcon="play",this._currentIcon="video-camera-full",this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._audioToggleMicrophoneHidden=!this.cfg.enableAudioRecording),this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{event:"camera-tab-switch",node:this.tagName,tabId}}}),this._activeTab=tabId},this._createFile=(type,ext,format,blob)=>{let date=Date.now();return new File([blob],`${type}-${date}.${ext}`,{lastModified:date,type:format})},this._toSend=file=>{this.api.addFileFromObject(file,{source:UploadSource.pc.CAMERA}),this.set$({"*currentActivity":LitActivityBlock.S.activities.UPLOAD_LIST}),this.modalManager?.open(LitActivityBlock.S.activities.UPLOAD_LIST)},this._setPermissionsState=(0,debounce.s)(state=>{this.classList.toggle("uc-initialized","granted"===state);let visibleAudio=this._activeTab===constants.S.VIDEO&&this.cfg.enableAudioRecording,currentIcon=this._activeTab===constants.S.PHOTO?"camera-full":"video-camera-full";"granted"===state?(this._videoHidden=!1,this._cameraHidden=!1,this._tabCameraHidden=!this._cameraModes.includes(constants.S.PHOTO),this._tabVideoHidden=!this._cameraModes.includes(constants.S.VIDEO),this._messageHidden=!0,this._timerHidden=!0,this._currentIcon=currentIcon,this._audioToggleMicrophoneHidden=!visibleAudio,this._audioSelectHidden=!visibleAudio):("prompt"===state?(this._l10nMessage="camera-permissions-prompt",this._videoHidden=!0,this._cameraHidden=!0,this._tabCameraHidden=!0,this._messageHidden=!1):(this._l10nMessage="camera-permissions-denied",this._videoHidden=!0,this._messageHidden=!1,this._tabCameraHidden=!this._cameraModes.includes(constants.S.PHOTO),this._tabVideoHidden=!this._cameraModes.includes(constants.S.VIDEO),this._cameraActionsHidden=!0,this._mutableClassButton="uc-shot-btn uc-camera-action"),this._stopCapture())},300),this._makeStreamInactive=()=>{if(!this._stream)return!1;let audioTracks=this._stream?.getAudioTracks(),videoTracks=this._stream?.getVideoTracks();return audioTracks.forEach(track=>{track.stop()}),videoTracks.forEach(track=>{track.stop()}),!0},this._stopCapture=()=>{if(this._capturing){this._videoRef.value&&(this._videoRef.value.volume=0);let tracks=this._currentVideoSource?.getTracks?.();tracks?.[0]?.stop(),this._detachPreviewListeners(this._videoRef.value),this._setVideoSource(null),this._makeStreamInactive(),this._stopTimer(),this._capturing=!1}},this._capture=async()=>{let constraints={video:{...DEFAULT_VIDEO_CONFIG},audio:!!this.cfg.enableAudioRecording&&{}};this._selectedCameraId&&(constraints.video={deviceId:{exact:this._selectedCameraId}}),this._selectedAudioId&&this.cfg.enableAudioRecording&&(constraints.audio={deviceId:{exact:this._selectedAudioId}}),this._videoRef.value&&(this._videoRef.value.volume=0);try{this._setPermissionsState("prompt"),this._stream=await navigator.mediaDevices.getUserMedia(constraints),this._stream.addEventListener("inactive",()=>{this._setPermissionsState("denied")}),this._setVideoSource(this._stream),this._capturing=!0,this._setPermissionsState("granted")}catch(error){this._setPermissionsState("denied"),console.log("Failed to capture camera",error),this.telemetryManager.sendEventError(error,"camera capturing. Failed to capture camera")}},this._handlePermissionsChange=()=>{this._capture()},this._permissionAccess=async()=>{try{for(let permission of(this._teardownPermissionListeners(),DEFAULT_PERMISSIONS)){let response=await navigator.permissions.query({name:permission});this._permissionResponses[permission]=response,response.addEventListener("change",this._handlePermissionsChange),this._permissionCleanupFns.push(()=>{response.removeEventListener("change",this._handlePermissionsChange)})}this._unsubPermissions=()=>{this._teardownPermissionListeners()}}catch(error){this._teardownPermissionListeners(),console.log("Failed to use permissions API. Fallback to manual request mode.",error),this.telemetryManager.sendEventError(error,"camera permissions. Failed to use permissions API"),this._capture()}},this._requestDeviceAccess=async()=>{try{await navigator.mediaDevices.getUserMedia({video:!0,audio:this.cfg.enableAudioRecording}),await this._getDevices(),navigator.mediaDevices.addEventListener("devicechange",this._getDevices)}catch(error){this.telemetryManager.sendEventError(error,"camera devices. Failed to get user media"),console.log("Failed to get user media",error)}},this._getDevices=async()=>{try{let devices=await navigator.mediaDevices.enumerateDevices();this._cameraDevices=devices.filter(device=>"videoinput"===device.kind).map((device,index)=>({text:device.label.trim()||`${this.l10n("caption-camera")} ${index+1}`,value:device.deviceId})),this._audioDevices=this.cfg.enableAudioRecording?devices.filter(device=>"audioinput"===device.kind).map(device=>({text:device.label.trim(),value:device.deviceId})):[],this._cameraSelectOptions=this._cameraDevices,this._cameraSelectHidden=this._cameraDevices.length<=1,this._selectedCameraId=this._cameraDevices[0]?.value??null,this._audioSelectOptions=this._audioDevices,this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._selectedAudioId=this._audioDevices[0]?.value??null}catch(error){this.telemetryManager.sendEventError(error,"camera devices. Failed to get devices"),console.log("Failed to get devices",error)}},this._onActivate=async()=>{await this._permissionAccess(),await this._requestDeviceAccess(),await this._capture(),this._handleCameraModes(this._cameraModes)},this._onDeactivate=async()=>{this._unsubPermissions&&this._unsubPermissions(),window.chrome||this._setPermissionsState("denied"),this._stopCapture()},this._handleCameraModes=cameraModes=>{this._tabVideoHidden=!cameraModes.includes(constants.S.VIDEO),this._tabCameraHidden=!cameraModes.includes(constants.S.PHOTO);let defaultTab=cameraModes[0];!defaultTab||this._activeTab&&cameraModes.includes(this._activeTab)||this._handleActiveTab(defaultTab)}}}_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_videoTransformCss",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_videoHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_messageHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_requestBtnHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_cameraSelectOptions",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_cameraSelectHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_l10nMessage",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_timerHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_cameraHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_cameraActionsHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_audioSelectOptions",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_audioSelectHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_audioSelectDisabled",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_audioToggleMicrophoneHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_tabCameraHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_tabVideoHidden",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_currentIcon",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_currentTimelineIcon",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_toggleMicrophoneIcon",void 0),_ts_decorate([(0,decorators_js_.state)()],CameraSource.prototype,"_mutableClassButton",void 0)},5973(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{S:()=>CameraSourceTypes,q:()=>CameraSourceEvents});let CameraSourceTypes=Object.freeze({PHOTO:"photo",VIDEO:"video"}),CameraSourceEvents=Object.freeze({IDLE:"idle",SHOT:"shot",PLAY:"play",PAUSE:"pause",RESUME:"resume",STOP:"stop",RETAKE:"retake",ACCEPT:"accept"})},8996(__unused_rspack_module,__webpack_exports__,__webpack_require__){function setSvgNodeAttrs(node,attrs){for(let[name,value]of Object.entries(attrs))node.setAttributeNS(null,name,value.toString())}function createSvgNode(name,attrs={}){let node=document.createElementNS("http://www.w3.org/2000/svg",name);return setSvgNodeAttrs(node,attrs),node}function cornerPath(rect,direction,sizeMultiplier){let{x,y,width,height}=rect,wMul=+!direction.includes("w"),hMul=+!direction.includes("n"),xSide=0===wMul?-1:1,ySide=0===hMul?-1:1,p1=[x+wMul*width+1.5*xSide,y+hMul*height+1.5*ySide-24*sizeMultiplier*ySide],p2=[x+wMul*width+1.5*xSide,y+hMul*height+1.5*ySide],p3=[x+wMul*width-24*sizeMultiplier*xSide+1.5*xSide,y+hMul*height+1.5*ySide];return{d:`M ${p1[0]} ${p1[1]} L ${p2[0]} ${p2[1]} L ${p3[0]} ${p3[1]}`,center:[p2[0],p2[1]]}}function sidePath(rect,direction,sizeMultiplier){let p1,p2,{x,y,width,height}=rect,isHorizontal="n"===direction||"s"===direction,wMul=isHorizontal?.5:+("w"!==direction),hMul="w"===direction||"e"===direction?.5:+("n"!==direction),xSide="w"===direction?-1:+("e"===direction),ySide="n"===direction?-1:+("s"===direction);return isHorizontal?(p1=[x+wMul*width-34*sizeMultiplier/2,y+hMul*height+1.5*ySide],p2=[x+wMul*width+34*sizeMultiplier/2,y+hMul*height+1.5*ySide]):(p1=[x+wMul*width+1.5*xSide,y+hMul*height-34*sizeMultiplier/2],p2=[x+wMul*width+1.5*xSide,y+hMul*height+34*sizeMultiplier/2]),{d:`M ${p1[0]} ${p1[1]} L ${p2[0]} ${p2[1]}`,center:[(p1[0]+p2[0])/2,(p1[1]+p2[1])/2]}}function thumbCursor(direction){return""===direction?"move":["e","w"].includes(direction)?"ew-resize":["n","s"].includes(direction)?"ns-resize":["nw","se"].includes(direction)?"nwse-resize":"nesw-resize"}function moveRect({rect,delta:[dx,dy],imageBox}){return constraintRect({...rect,x:rect.x+dx,y:rect.y+dy},imageBox)}function constraintRect(rect1,rect2){let{x}=rect1,{y}=rect1;return rect1.x<rect2.x?x=rect2.x:rect1.x+rect1.width>rect2.x+rect2.width&&(x=rect2.x+rect2.width-rect1.width),rect1.y<rect2.y?y=rect2.y:rect1.y+rect1.height>rect2.y+rect2.height&&(y=rect2.y+rect2.height-rect1.height),{...rect1,x,y}}function resizeRect({direction,...rest}){switch(direction){case"n":return function({rect,delta,aspectRatio,imageBox}){let[,dy]=delta,{y,width,height}=rect;y+=dy,height-=dy,aspectRatio&&(width=height*aspectRatio);let x=rect.x+rect.width/2-width/2;return y<=imageBox.y&&(y=imageBox.y,height=rect.y+rect.height-y,aspectRatio&&(width=height*aspectRatio,x=rect.x+rect.width/2-width/2)),x<=imageBox.x&&(x=imageBox.x,y=rect.y+rect.height-height),x+width>=imageBox.x+imageBox.width&&(x=Math.max(imageBox.x,imageBox.x+imageBox.width-width),width=imageBox.x+imageBox.width-x,aspectRatio&&(height=width/aspectRatio),y=rect.y+rect.height-height),height<1&&(height=1,aspectRatio&&(width=height*aspectRatio,x=rect.x+rect.width/2-width/2),y=rect.y+rect.height-height),width<1&&(width=1,aspectRatio&&(height=width/aspectRatio,x=rect.x+rect.width/2-width/2),y=rect.y+rect.height-height),{x,y,width,height}}(rest);case"w":return function({rect,delta,aspectRatio,imageBox}){let[dx]=delta,{x,width,height}=rect;x+=dx,width-=dx,aspectRatio&&(height=width/aspectRatio);let y=rect.y+rect.height/2-height/2;return x<=imageBox.x&&(x=imageBox.x,width=rect.x+rect.width-x,aspectRatio&&(height=width/aspectRatio,y=rect.y+rect.height/2-height/2)),y<=imageBox.y&&(y=imageBox.y,x=rect.x+rect.width-width),y+height>=imageBox.y+imageBox.height&&(y=Math.max(imageBox.y,imageBox.y+imageBox.height-height),height=imageBox.y+imageBox.height-y,aspectRatio&&(width=height*aspectRatio),x=rect.x+rect.width-width),height<1&&(height=1,aspectRatio&&(width=height*aspectRatio),y=rect.y+rect.height/2-height/2,x=rect.x+rect.width-width),width<1&&(width=1,aspectRatio&&(height=width/aspectRatio),y=rect.y+rect.height/2-height/2,x=rect.x+rect.width-width),{x,y,width,height}}(rest);case"s":return function({rect,delta,aspectRatio,imageBox}){let[,dy]=delta,{y,width,height}=rect;height+=dy,aspectRatio&&(width=height*aspectRatio);let x=rect.x+rect.width/2-width/2;return y+height>=imageBox.y+imageBox.height&&(height=imageBox.y+imageBox.height-y,aspectRatio&&(width=height*aspectRatio),x=rect.x+rect.width/2-width/2),x<=imageBox.x&&(x=imageBox.x,y=rect.y),x+width>=imageBox.x+imageBox.width&&(x=Math.max(imageBox.x,imageBox.x+imageBox.width-width),width=imageBox.x+imageBox.width-x,aspectRatio&&(height=width/aspectRatio),y=rect.y),height<1&&(height=1,aspectRatio&&(width=height*aspectRatio),x=rect.x+rect.width/2-width/2),width<1&&(width=1,aspectRatio&&(height=width/aspectRatio),x=rect.x+rect.width/2-width/2),{x,y,width,height}}(rest);case"e":return function({rect,delta,aspectRatio,imageBox}){let[dx]=delta,{x,width,height}=rect;width+=dx,aspectRatio&&(height=width/aspectRatio);let y=rect.y+rect.height/2-height/2;return x+width>=imageBox.x+imageBox.width&&(width=imageBox.x+imageBox.width-x,aspectRatio&&(height=width/aspectRatio),y=rect.y+rect.height/2-height/2),y<=imageBox.y&&(y=imageBox.y,x=rect.x),y+height>=imageBox.y+imageBox.height&&(y=Math.max(imageBox.y,imageBox.y+imageBox.height-height),height=imageBox.y+imageBox.height-y,aspectRatio&&(width=height*aspectRatio),x=rect.x),height<1&&(height=1,aspectRatio&&(width=height*aspectRatio),y=rect.y+rect.height/2-height/2),width<1&&(width=1,aspectRatio&&(height=width/aspectRatio),y=rect.y+rect.height/2-height/2),{x,y,width,height}}(rest);case"nw":return function({rect,delta,aspectRatio,imageBox}){let[dx,dy]=delta,{x,y,width,height}=rect;return x+dx<imageBox.x&&(dx=imageBox.x-x),y+dy<imageBox.y&&(dy=imageBox.y-y),x+=dx,width-=dx,y+=dy,height-=dy,aspectRatio&&Math.abs(width/height)>aspectRatio?(dy=width/aspectRatio-height,height+=dy,(y-=dy)<=imageBox.y&&(height-=imageBox.y-y,width=height*aspectRatio,x=rect.x+rect.width-width,y=imageBox.y)):aspectRatio&&(dx=height*aspectRatio-width,width+=dx,(x-=dx)<=imageBox.x&&(width-=imageBox.x-x,height=width/aspectRatio,x=imageBox.x,y=rect.y+rect.height-height)),height<1&&(height=1,aspectRatio&&(width=height*aspectRatio),x=rect.x+rect.width-width,y=rect.y+rect.height-height),width<1&&(width=1,aspectRatio&&(height=width/aspectRatio),x=rect.x+rect.width-width,y=rect.y+rect.height-height),{x,y,width,height}}(rest);case"ne":return function({rect,delta,aspectRatio,imageBox}){let[dx,dy]=delta,{x,y,width,height}=rect;return x+width+dx>imageBox.x+imageBox.width&&(dx=imageBox.x+imageBox.width-x-width),y+dy<imageBox.y&&(dy=imageBox.y-y),width+=dx,y+=dy,height-=dy,aspectRatio&&Math.abs(width/height)>aspectRatio?(dy=width/aspectRatio-height,height+=dy,(y-=dy)<=imageBox.y&&(height-=imageBox.y-y,width=height*aspectRatio,x=rect.x,y=imageBox.y)):aspectRatio&&(dx=height*aspectRatio-width,x+(width+=dx)>=imageBox.x+imageBox.width&&(height=(width=imageBox.x+imageBox.width-x)/aspectRatio,x=imageBox.x+imageBox.width-width,y=rect.y+rect.height-height)),height<1&&(height=1,aspectRatio&&(width=height*aspectRatio),y=rect.y+rect.height-height),width<1&&(width=1,aspectRatio&&(height=width/aspectRatio),y=rect.y+rect.height-height),{x,y,width,height}}(rest);case"sw":return function({rect,delta,aspectRatio,imageBox}){let[dx,dy]=delta,{x,y,width,height}=rect;return x+dx<imageBox.x&&(dx=imageBox.x-x),y+height+dy>imageBox.y+imageBox.height&&(dy=imageBox.y+imageBox.height-y-height),x+=dx,width-=dx,height+=dy,aspectRatio&&Math.abs(width/height)>aspectRatio?(dy=width/aspectRatio-height,y+(height+=dy)>=imageBox.y+imageBox.height&&(width=(height=imageBox.y+imageBox.height-y)*aspectRatio,x=rect.x+rect.width-width,y=imageBox.y+imageBox.height-height)):aspectRatio&&(dx=height*aspectRatio-width,width+=dx,(x-=dx)<=imageBox.x&&(width-=imageBox.x-x,height=width/aspectRatio,x=imageBox.x,y=rect.y)),height<1&&(height=1,aspectRatio&&(width=height*aspectRatio),x=rect.x+rect.width-width),width<1&&(width=1,aspectRatio&&(height=width/aspectRatio),x=rect.x+rect.width-width),{x,y,width,height}}(rest);case"se":return function({rect,delta,aspectRatio,imageBox}){let[dx,dy]=delta,{x,y,width,height}=rect;return x+width+dx>imageBox.x+imageBox.width&&(dx=imageBox.x+imageBox.width-x-width),y+height+dy>imageBox.y+imageBox.height&&(dy=imageBox.y+imageBox.height-y-height),width+=dx,height+=dy,aspectRatio&&Math.abs(width/height)>aspectRatio?(dy=width/aspectRatio-height,y+(height+=dy)>=imageBox.y+imageBox.height&&(width=(height=imageBox.y+imageBox.height-y)*aspectRatio,x=rect.x,y=imageBox.y+imageBox.height-height)):aspectRatio&&(dx=height*aspectRatio-width,x+(width+=dx)>=imageBox.x+imageBox.width&&(height=(width=imageBox.x+imageBox.width-x)/aspectRatio,x=imageBox.x+imageBox.width-width,y=rect.y)),height<1&&(height=1,aspectRatio&&(width=height*aspectRatio)),width<1&&(width=1,aspectRatio&&(height=width/aspectRatio)),{x,y,width,height}}(rest);default:return rest.rect}}function rectContainsPoint(rect,[x,y]){return rect.x<=x&&x<=rect.x+rect.width&&rect.y<=y&&y<=rect.y+rect.height}function isRectInsideRect(rect1,rect2){return rect1.x>=rect2.x&&rect1.y>=rect2.y&&rect1.x+rect1.width<=rect2.x+rect2.width&&rect1.y+rect1.height<=rect2.y+rect2.height}function isRectMatchesAspectRatio(rect,aspectRatio){return .1>Math.abs(rect.width/rect.height-aspectRatio)}function rotateSize({width,height},angle){let swap=angle/90%2!=0;return{width:swap?height:width,height:swap?width:height}}function calculateMaxCenteredCropFrame(width,height,aspectRatio){let cropWidth,cropHeight;width/height>aspectRatio?(cropWidth=Math.round(height*aspectRatio),cropHeight=height):(cropWidth=width,cropHeight=Math.round(width/aspectRatio));let cropX=Math.round((width-cropWidth)/2),cropY=Math.round((height-cropHeight)/2);return cropX+cropWidth>width&&(cropWidth=width-cropX),cropY+cropHeight>height&&(cropHeight=height-cropY),{x:cropX,y:cropY,width:cropWidth,height:cropHeight}}function roundRect(rect){return{x:Math.round(rect.x),y:Math.round(rect.y),width:Math.round(rect.width),height:Math.round(rect.height)}}function clamp(value,min,max){return Math.min(Math.max(value,min),max)}__webpack_require__.d(__webpack_exports__,{BT:()=>rotateSize,F2:()=>setSvgNodeAttrs,VH:()=>cornerPath,YH:()=>constraintRect,Ze:()=>isRectInsideRect,_J:()=>moveRect,_c:()=>rectContainsPoint,dz:()=>resizeRect,fN:()=>sidePath,l8:()=>createSvgNode,n:()=>isRectMatchesAspectRatio,qE:()=>clamp,rH:()=>roundRect,u3:()=>calculateMaxCenteredCropFrame,vv:()=>thumbCursor})},5342(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{j:()=>parseCropPreset,t:()=>getClosestAspectRatio});var _utils_stringToArray__rspack_import_0=__webpack_require__(2513),_utils_UID__rspack_import_1=__webpack_require__(5446);let EXCLUDED_TYPES=["free"],parseCropPreset=cropPreset=>{let items=(0,_utils_stringToArray__rspack_import_0.G)(cropPreset);if(!items||0===items.length)return[];let result=[];for(let item of items){let raw=item.trim();if(!raw)continue;let sep=raw.indexOf(":");if(-1===sep&&!EXCLUDED_TYPES.includes(raw)){console.warn(`Invalid crop preset: ${raw}`);continue}let w=Number(raw.slice(0,sep)),h=Number(raw.slice(sep+1));if((!Number.isFinite(w)||!Number.isFinite(h)||w<=0||h<=0)&&!EXCLUDED_TYPES.includes(raw)){console.warn(`Invalid crop preset: ${raw}`);continue}result.push({id:_utils_UID__rspack_import_1.V.generateFastUid(),type:"aspect-ratio",width:EXCLUDED_TYPES.includes(raw)?0:w,height:EXCLUDED_TYPES.includes(raw)?0:h,hasFreeform:EXCLUDED_TYPES.includes(raw)})}return result},getClosestAspectRatio=(width,height,ratios,tolerance=.1)=>{let inputRatio=width/height,closest=null,minDiff=1/0;for(let r of ratios){let[w,h]=[r.width,r.height],diff=Math.abs(inputRatio-w/h);diff<minDiff&&(minDiff=diff,closest=r)}if(closest){let[cw,ch]=[closest.width,closest.height],closestRatio=cw/ch;if(Math.abs(inputRatio-closestRatio)/closestRatio>tolerance)return null}return closest}},8930(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{ON:()=>transformationsToOperations,jO:()=>COMMON_OPERATIONS,yj:()=>OPERATIONS_DEFAULTS,ym:()=>operationsToTransformations});var _utils_cdn_utils_js__rspack_import_0=__webpack_require__(6339),_utils_stringToArray_js__rspack_import_1=__webpack_require__(2513);let OPERATIONS_DEFAULTS=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:!1,flip:!1,crop:void 0}),SUPPORTED_OPERATIONS_ORDERED=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function transformationsToOperations(transformations){return(0,_utils_cdn_utils_js__rspack_import_0.OB)(...SUPPORTED_OPERATIONS_ORDERED.filter(operation=>void 0!==transformations[operation]&&null!==transformations[operation]).map(operation=>{let options=transformations[operation];return function(operation,options){if("number"==typeof options)return OPERATIONS_DEFAULTS[operation]!==options?`${operation}/${options}`:"";if("boolean"==typeof options)return OPERATIONS_DEFAULTS[operation]!==options?`${operation}`:"";if("filter"===operation&&options){let{name,amount}=options;return OPERATIONS_DEFAULTS.filter===amount?"":`${operation}/${name}/${amount}`}if("crop"===operation&&options){let{dimensions,coords}=options;return`${operation}/${dimensions.join("x")}/${coords.join(",")}`}return""}(operation,options)}).filter(str=>!!str))}let COMMON_OPERATIONS=(0,_utils_cdn_utils_js__rspack_import_0.OB)("format/auto","progressive/yes"),asNumber=([value])=>void 0!==value?Number(value):void 0,asBoolean=()=>!0,OPERATION_PROCESSORS=Object.freeze({enhance:asNumber,brightness:asNumber,exposure:asNumber,gamma:asNumber,contrast:asNumber,saturation:asNumber,vibrance:asNumber,warmth:asNumber,filter:([name,amount])=>({name,amount:void 0!==amount?Number(amount):100}),mirror:asBoolean,flip:asBoolean,rotate:asNumber,crop:args=>{let[dimensions,alignment]=args,{dimensions:parsedDimensions,coords}=(([dimensions,alignment])=>{if(!/\d+x\d+/.test(dimensions)||!/\d+,\d+/.test(alignment))throw Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return{dimensions:(0,_utils_stringToArray_js__rspack_import_1.G)(dimensions,"x").map(Number),coords:(0,_utils_stringToArray_js__rspack_import_1.G)(alignment).map(Number)}})([dimensions,alignment]);return{dimensions:parsedDimensions,coords:coords}}});function operationsToTransformations(operations){let transformations={};for(let operation of operations){let[name,...args]=operation.split("/");if(!name||!SUPPORTED_OPERATIONS_ORDERED.includes(name))continue;let processor=OPERATION_PROCESSORS[name];try{let value=processor(args);transformations[name]=value}catch(err){console.warn([`Failed to parse URL operation "${operation}". It will be ignored.`,err instanceof Error?`Error message: "${err.message}"`:err,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join("\n"))}}return transformations}},1583(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{DY:()=>ALL_COLOR_OPERATIONS,UA:()=>COLOR_OPERATIONS_CONFIG,XB:()=>TabId,Y_:()=>ALL_CROP_OPERATIONS,_6:()=>ALL_FILTERS,nz:()=>ALL_TABS});var _lib_transformationUtils_js__rspack_import_0=__webpack_require__(8930);let TabId=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),ALL_TABS=Object.freeze([TabId.CROP,TabId.TUNING,TabId.FILTERS]),ALL_COLOR_OPERATIONS=Object.freeze(["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"]),ALL_FILTERS=Object.freeze(["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"]),ALL_CROP_OPERATIONS=Object.freeze(["rotate","mirror","flip"]),NUMERIC_OPERATION_DEFAULTS=_lib_transformationUtils_js__rspack_import_0.yj,COLOR_OPERATIONS_CONFIG=Object.freeze({brightness:{zero:NUMERIC_OPERATION_DEFAULTS.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:NUMERIC_OPERATION_DEFAULTS.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:NUMERIC_OPERATION_DEFAULTS.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:NUMERIC_OPERATION_DEFAULTS.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:NUMERIC_OPERATION_DEFAULTS.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:NUMERIC_OPERATION_DEFAULTS.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:NUMERIC_OPERATION_DEFAULTS.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:NUMERIC_OPERATION_DEFAULTS.enhance,range:[0,100],keypointsNumber:1},filter:{zero:NUMERIC_OPERATION_DEFAULTS.filter,range:[0,100],keypointsNumber:1}})},8183(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{T:()=>Config});var sharedConfigKey=__webpack_require__(1971),toKebabCase=__webpack_require__(2402),debounce=__webpack_require__(4441),warnOnce=__webpack_require__(6783);let ASSERTIONS=[{test:cfg=>!!cfg.accept&&!!cfg.imgOnly,message:"There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list."},{test:cfg=>null!==cfg.enableVideoRecording,message:"The `enableVideoRecording` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."},{test:cfg=>null!==cfg.defaultCameraMode,message:"The `defaultCameraMode` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."}],runAssertions=(0,debounce.s)(cfg=>{for(let{test,message}of ASSERTIONS)test(cfg)&&(0,warnOnce.m)(message)},0);var LitBlock=__webpack_require__(204),comma_separated=__webpack_require__(9101);let isPromiseLike=value=>value instanceof Promise||!!(value&&"object"==typeof value&&"then"in value&&"function"==typeof value.then);var UploadSource=__webpack_require__(5730),initialConfig=__webpack_require__(318);let withLazyPlugins=async({plugins,entries,signal})=>{let current=plugins(),lazyIds=new Set(entries.map(e=>e.pluginId)),userPlugins=current.filter(p=>!lazyIds.has(p?.id)),loadResults=await Promise.all(entries.map(async entry=>{if(!entry.isEnabled())return null;let existing=current.find(p=>p?.id===entry.pluginId);if(existing)return existing;try{let plugin=await entry.load();if(signal.aborted||!entry.isEnabled())return null;return plugin??null}catch(error){return signal.aborted||console.warn(`[${entry.pluginId}] Failed to load plugin`,error),null}}));if(signal.aborted)return current;let next=[...userPlugins,...loadResults.filter(p=>null!==p)];return next.length===current.length&&next.every((p,i)=>p===current[i])?current:next},COMPUTED_PROPERTIES=[{key:"cameraModes",deps:["enableVideoRecording"],fn:({cameraModes,enableVideoRecording})=>{let evr=enableVideoRecording();if(null===evr)return cameraModes();let cameraModesCsv=(0,comma_separated.A)(cameraModes());return evr&&!cameraModesCsv.includes("video")?cameraModesCsv=cameraModesCsv.concat("video"):evr||(cameraModesCsv=cameraModesCsv.filter(mode=>"video"!==mode)),(0,comma_separated.L)(cameraModesCsv)}},{key:"cameraModes",deps:["defaultCameraMode"],fn:({cameraModes,defaultCameraMode})=>{let dcm=defaultCameraMode();if(null===dcm)return cameraModes();let cameraModesCsv=(0,comma_separated.A)(cameraModes());return cameraModesCsv=cameraModesCsv.sort((a,b)=>a===dcm?-1:+(b===dcm)),(0,comma_separated.L)(cameraModesCsv)}},{key:"cdnCname",deps:["pubkey","cdnCnamePrefixed"],fn:({pubkey,cdnCname,cdnCnamePrefixed})=>{let pk=pubkey(),cname=cdnCname(),prefixed=cdnCnamePrefixed();return pk&&(cname===initialConfig.Tw||(0,__rspack_external__uploadcare_cname_prefix_async_eddbdf1f.isPrefixedCdnBase)(cname,prefixed))?(0,__rspack_external__uploadcare_cname_prefix_async_eddbdf1f.getPrefixedCdnBaseAsync)(pk,prefixed):cname}},{key:"plugins",deps:["useCloudImageEditor","imageShrink","sourceList"],fn:({plugins,useCloudImageEditor,imageShrink,sourceList},{signal})=>withLazyPlugins({plugins,entries:[{pluginId:"cloud-image-editor",isEnabled:()=>!!useCloudImageEditor(),load:async()=>{let{cloudImageEditorPlugin}=await __webpack_require__.e("cloudImageEditorPlugin").then(__webpack_require__.bind(__webpack_require__,6027));return cloudImageEditorPlugin}},{pluginId:"image-shrink",isEnabled:()=>!!imageShrink(),load:async()=>{let{imageShrinkPlugin}=await __webpack_require__.e("imageShrinkPlugin").then(__webpack_require__.bind(__webpack_require__,6677));return imageShrinkPlugin}},{pluginId:"camera",isEnabled:()=>(0,comma_separated.A)(sourceList()).includes("camera"),load:async()=>{let{cameraPlugin}=await __webpack_require__.e("cameraPlugin").then(__webpack_require__.bind(__webpack_require__,7777));return cameraPlugin}},{pluginId:"instagram",isEnabled:()=>(0,comma_separated.A)(sourceList()).includes("instagram"),load:async()=>{let{instagramPlugin}=await __webpack_require__.e("instagramPlugin").then(__webpack_require__.bind(__webpack_require__,1746));return instagramPlugin}},{pluginId:"external-sources",isEnabled:()=>Object.values(UploadSource.y5).some(src=>(0,comma_separated.A)(sourceList()).includes(src)),load:async()=>{let{externalSourcesPlugin}=await __webpack_require__.e("externalSourcesPlugin").then(__webpack_require__.bind(__webpack_require__,2061));return externalSourcesPlugin}},{pluginId:"url-source",isEnabled:()=>(0,comma_separated.A)(sourceList()).includes("url"),load:async()=>{let{urlSourcePlugin}=await __webpack_require__.e("urlSourcePlugin").then(__webpack_require__.bind(__webpack_require__,1938));return urlSourcePlugin}}],signal})}],computeProperty=({key,setValue,getValue,computationControllers})=>{for(let computed of COMPUTED_PROPERTIES)if(computed.deps.includes(key)){let result,args={[computed.key]:()=>getValue(computed.key)};for(let dep of computed.deps)args[dep]=()=>getValue(dep);let abortController=new AbortController;computationControllers.get(computed.fn)?.abort(),computationControllers.set(computed.fn,abortController);try{result=computed.fn(args,{signal:abortController.signal})}catch(error){computationControllers.get(computed.fn)===abortController&&computationControllers.delete(computed.fn),console.error(`Failed to compute value for "${computed.key}"`,error);return}isPromiseLike(result)?result.then(resolvedValue=>{abortController.signal.aborted||setValue(computed.key,resolvedValue)}).catch(error=>{abortController.signal.aborted||console.error(`Failed to compute value for "${computed.key}"`,error)}).finally(()=>{computationControllers.get(computed.fn)===abortController&&computationControllers.delete(computed.fn)}):setValue(computed.key,result)}};var constants=__webpack_require__(5973);let asString=value=>String(value),asNumber=value=>{let number=Number(value);if(Number.isNaN(number))throw Error(`Invalid number: "${value}"`);return number},asBoolean=value=>{if(null==value)return!1;if("boolean"==typeof value)return value;if("true"===value||""===value)return!0;if("false"===value)return!1;throw Error(`Invalid boolean: "${value}"`)},asObject=value=>{if("object"==typeof value)return value;throw Error("Invalid value. Must be an object.")},asFunction=value=>{if("function"==typeof value)return value;throw Error("Invalid value. Must be a function.")},asArray=value=>{if(Array.isArray(value))return value;throw Error("Must be an array.")},mapping={pubkey:asString,multiple:asBoolean,multipleMin:asNumber,multipleMax:asNumber,confirmUpload:asBoolean,imgOnly:asBoolean,accept:asString,externalSourcesPreferredTypes:asString,externalSourcesEmbedCss:asString,store:value=>"auto"===value?value:asBoolean(value),cameraMirror:asBoolean,cameraCapture:value=>{let strValue=asString(value);if("user"!==strValue&&"environment"!==strValue&&""!==strValue)throw Error(`Invalid value: "${strValue}"`);return strValue},sourceList:asString,topLevelOrigin:asString,maxLocalFileSizeBytes:asNumber,thumbSize:asNumber,showEmptyList:asBoolean,useLocalImageEditor:asBoolean,useCloudImageEditor:asBoolean,cloudImageEditorTabs:asString,removeCopyright:asBoolean,cropPreset:asString,imageShrink:asString,modalScrollLock:asBoolean,modalBackdropStrokes:asBoolean,sourceListWrap:asBoolean,remoteTabSessionKey:asString,cdnCname:asString,cdnCnamePrefixed:asString,baseUrl:asString,socialBaseUrl:asString,secureSignature:asString,secureExpire:asString,secureDeliveryProxy:asString,retryThrottledRequestMaxTimes:asNumber,retryNetworkErrorMaxTimes:asNumber,multipartMinFileSize:asNumber,multipartChunkSize:asNumber,maxConcurrentRequests:asNumber,multipartMaxConcurrentRequests:asNumber,multipartMaxAttempts:asNumber,checkForUrlDuplicates:asBoolean,saveUrlForRecurrentUploads:asBoolean,groupOutput:asBoolean,userAgentIntegration:asString,debug:asBoolean,localeName:asString,metadata:value=>{if("object"==typeof value&&!Array.isArray(value)||"function"==typeof value)return value;throw Error("Invalid metadata value. Must be an object or function.")},secureUploadsExpireThreshold:asNumber,localeDefinitionOverride:value=>asObject(value),secureUploadsSignatureResolver:value=>asFunction(value),secureDeliveryProxyUrlResolver:value=>asFunction(value),iconHrefResolver:value=>asFunction(value),plugins:value=>asArray(value),fileValidators:asArray,collectionValidators:asArray,validationTimeout:asNumber,validationConcurrency:asNumber,cameraModes:value=>{let str=asString(value),array=(0,comma_separated.A)(str);if(array.some(item=>!Object.values(constants.S).includes(item)))throw Error(`Invalid value: "${JSON.stringify(array)}"`);return str},defaultCameraMode:value=>{let strValue=asString(value);if(!Object.values(constants.S).includes(strValue))throw Error(`Invalid value: "${strValue}"`);return strValue},enableAudioRecording:asBoolean,enableVideoRecording:asBoolean,mediaRecorderOptions:asObject,maxVideoRecordingDuration:asNumber,filesViewMode:value=>{let strValue=asString(value);if(["grid","list"].includes(strValue))return strValue;throw Error(`Invalid value: "${strValue}"`)},gridShowFileNames:asBoolean,cloudImageEditorAutoOpen:asBoolean,cloudImageEditorMaskHref:asString,testMode:asBoolean,qualityInsights:asBoolean,pasteScope:value=>{let strValue=asString(value);if("local"===strValue||"global"===strValue)return strValue;if(!1===asBoolean(value))return!1;throw Error(`Invalid value: "${strValue}"`)}},allConfigKeys=[...new Set(["debug",...Object.keys(initialConfig.Dz)])],complexConfigKeys=["metadata","plugins","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators","mediaRecorderOptions"],plainConfigKeys=allConfigKeys.filter(key=>!complexConfigKeys.includes(key)),builtinAttrKeyMapping={...Object.fromEntries(plainConfigKeys.map(key=>[(0,toKebabCase.f)(key),key])),...Object.fromEntries(plainConfigKeys.map(key=>[key.toLowerCase(),key]))},getLocalPropName=key=>`__${key}`;class Config extends LitBlock.x{_isCustomConfig(key){return this._customConfigKeys.has(key)}_getCustomConfigDefinition(key){let pluginManager=this._sharedInstancesBag.pluginManager;if(pluginManager)return pluginManager.configRegistry.get(key)}_getAttributeNames(key){return[...new Set([(0,toKebabCase.f)(key),key.toLowerCase()])]}_flushValueToAttribute(key,value){if(!complexConfigKeys.includes(key)){if(this._isCustomConfig(key)){let config=this._getCustomConfigDefinition(key);if(config?.attribute===!1)return}for(let attr of this._getAttributeNames(key))null==value?this.removeAttribute(attr):this.getAttribute(attr)!==value.toString()&&this.setAttribute(attr,value.toString())}}_flushValueToState(key,value){let stateKey=(0,sharedConfigKey.T)(key);if(this.$[stateKey]!==value)if(null==value){let defaultValue=initialConfig.Dz[key];this.$[stateKey]=void 0!==defaultValue?defaultValue:value}else this.$[stateKey]=value}_setValue(key,value){let normalizedValue;if(this._isCustomConfig(key)){let config=this._getCustomConfigDefinition(key);normalizedValue=config?.normalize?.(value)??value}else normalizedValue=((key,value)=>{if(null!=value)try{return mapping[key](value)}catch(reason){return console.error(`Invalid value for config key "${key}".`,reason),initialConfig.Dz[key]}})(key,value);let localPropName=getLocalPropName(key);this[localPropName]!==normalizedValue&&(this._assertSameValueDifferentReference(key,this[localPropName],normalizedValue),this[localPropName]=normalizedValue,this._flushValueToAttribute(key,normalizedValue),this._flushValueToState(key,normalizedValue),this.debugPrint(`"${key}"`,normalizedValue),this._isCustomConfig(key)||runAssertions(this.cfg))}_getValue(key){return this[getLocalPropName(key)]??this.$[(0,sharedConfigKey.T)(key)]}_assertSameValueDifferentReference(key,previousValue,nextValue){this.cfg.debug&&nextValue!==previousValue&&"object"==typeof nextValue&&"object"==typeof previousValue&&JSON.stringify(nextValue)===JSON.stringify(previousValue)&&(console.warn(`[uc-config] Option "${key}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${key}" previous value:`,previousValue),console.warn(`[uc-config] "${key}" new value:`,nextValue))}_processCustomConfigs(pluginManager){let customConfigs=pluginManager.configRegistry.getAll();for(let[name,unsub]of(this._customAttrKeyMapping={},this._customConfigKeys=new Set(customConfigs.keys()),this._customConfigSubscriptions))customConfigs.has(name)||(unsub(),this._customConfigSubscriptions.delete(name));for(let[name,definition]of customConfigs){let stateKey=(0,sharedConfigKey.T)(name);if(definition.attribute)for(let attrName of this._getAttributeNames(name))this._customAttrKeyMapping[attrName]=name;this.sharedCtx.has(stateKey)||this.sharedCtx.add(stateKey,definition.defaultValue);let descriptor=Object.getOwnPropertyDescriptor(this,name);if(descriptor&&descriptor.set&&descriptor.get||Object.defineProperty(this,name,{set:value=>{this._setValue(name,value)},get:()=>this._getValue(name),enumerable:!0,configurable:!0}),!this._customConfigSubscriptions.has(name)){let unsub=this.sub(stateKey,value=>{this._setValue(name,value)},!1);this._customConfigSubscriptions.set(name,unsub)}}}_setupCustomConfigs(){this._sharedInstancesBag.when("pluginManager",pluginManager=>{this._processCustomConfigs(pluginManager),this._pluginChangeUnsubscribe=pluginManager.onPluginsChange(()=>{this._processCustomConfigs(pluginManager)})})}_setupMutationObserver(){this._mutationObserver=new MutationObserver(mutations=>{for(let mutation of mutations)if("attributes"===mutation.type&&mutation.attributeName){let attrName=mutation.attributeName,oldValue=mutation.oldValue,newValue=this.getAttribute(attrName);if(oldValue===newValue||attrName in builtinAttrKeyMapping)continue;attrName in this._customAttrKeyMapping&&this.attributeChangedCallback(attrName,oldValue??"",newValue??"")}}),this._mutationObserver.observe(this,{attributes:!0,attributeOldValue:!0})}initCallback(){for(let key of(super.initCallback(),this._setupCustomConfigs(),this._setupMutationObserver(),plainConfigKeys))this.sub((0,sharedConfigKey.T)(key),value=>{this._setValue(key,value)},!1);for(let key of allConfigKeys){let initialValue=this[key]??this.$[(0,sharedConfigKey.T)(key)];initialValue!==initialConfig.Dz[key]&&this._setValue(key,initialValue);let descriptor=Object.getOwnPropertyDescriptor(this,key);descriptor&&descriptor.set&&descriptor.get||Object.defineProperty(this,key,{set:value=>{this._setValue(key,value)},get:()=>this._getValue(key)})}for(let key of allConfigKeys)this.sub((0,sharedConfigKey.T)(key),()=>{computeProperty({key,setValue:this._setValue.bind(this),getValue:this._getValue.bind(this),computationControllers:this._computationControllers})})}attributeChangedCallback(name,oldVal,newVal){if(super.attributeChangedCallback(name,oldVal,newVal),oldVal===newVal)return;let builtInKey=builtinAttrKeyMapping[name];builtInKey?this[builtInKey]=newVal:this._sharedInstancesBag.when("pluginManager",pluginManager=>{if(this.getAttribute(name)!==newVal)return;let key=this._customAttrKeyMapping[name],config=key?pluginManager.configRegistry.get(key):void 0;if(key&&config){let val=config.fromAttribute?config.fromAttribute(newVal):newVal;if(this._getValue(key)===val)return;this._setValue(key,val)}})}disconnectedCallback(){for(let unsub of(super.disconnectedCallback(),this._pluginChangeUnsubscribe&&(this._pluginChangeUnsubscribe(),this._pluginChangeUnsubscribe=void 0),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=void 0),this._customConfigSubscriptions.values()))unsub();this._customConfigSubscriptions.clear()}static get observedAttributes(){return[...super.observedAttributes,...Object.keys(builtinAttrKeyMapping)]}constructor(...args){super(...args),this.init$={...this.init$,...Object.fromEntries(Object.entries(initialConfig.Dz).map(([key,value])=>[(0,sharedConfigKey.T)(key),value]))},this._computationControllers=new Map,this._customAttrKeyMapping={},this._customConfigKeys=new Set,this._customConfigSubscriptions=new Map}}for(let key of allConfigKeys)Config.prototype[key]=void 0},318(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Dz:()=>initialConfig,Tw:()=>DEFAULT_CDN_CNAME});var _utils_comma_separated__rspack_import_0=__webpack_require__(9101),_CloudImageEditor_src_toolbar_constants__rspack_import_1=__webpack_require__(1583);let DEFAULT_CDN_CNAME="https://ucarecdn.com",initialConfig=Object.freeze({pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",externalSourcesEmbedCss:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",topLevelOrigin:"",maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:DEFAULT_CDN_CNAME,cdnCnamePrefixed:"https://ucarecd.net",baseUrl:"https://upload.uploadcare.com",socialBaseUrl:"https://social.uploadcare.com",secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:3,retryNetworkErrorMaxTimes:3,multipartMinFileSize:0x1900000,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:6e5,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[],validationTimeout:15e3,validationConcurrency:100,cameraModes:"photo, video",defaultCameraMode:null,enableAudioRecording:!0,enableVideoRecording:null,maxVideoRecordingDuration:null,mediaRecorderOptions:null,filesViewMode:"list",gridShowFileNames:!1,useCloudImageEditor:!0,cloudImageEditorAutoOpen:!1,cloudImageEditorTabs:(0,_utils_comma_separated__rspack_import_0.L)(_CloudImageEditor_src_toolbar_constants__rspack_import_1.nz),cloudImageEditorMaskHref:null,testMode:!1,qualityInsights:!0,pasteScope:"local",plugins:[]})},7860(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{B:()=>ExternalSource});var LitActivityBlock=__webpack_require__(5923),stringToArray=__webpack_require__(2513),UploadSource=__webpack_require__(5730);let escapeRegExp=str=>str.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),wildcardRegexp=(str,flags="i")=>{let parts=str.split("*").map(escapeRegExp);return RegExp(`^${parts.join(".+")}$`,flags)},ucCustomProperties=["--uc-font-family","--uc-font-size","--uc-line-height","--uc-button-size","--uc-preview-size","--uc-input-size","--uc-padding","--uc-radius","--uc-transition","--uc-background","--uc-foreground","--uc-primary","--uc-primary-hover","--uc-primary-transparent","--uc-primary-foreground","--uc-secondary","--uc-secondary-hover","--uc-secondary-foreground","--uc-muted","--uc-muted-foreground","--uc-destructive","--uc-destructive-foreground","--uc-border"],getCssValue=(element,propName)=>window.getComputedStyle(element).getPropertyValue(propName).trim();var external_lit_=__webpack_require__(2927),decorators_js_=__webpack_require__(8899),ref_js_=__webpack_require__(5337),LitUploaderBlock=__webpack_require__(5544);let MESSAGE_TYPE_WHITELIST=["selected-files-change","toolbar-state-change"];class MessageBridge{constructor(context,getTargetOrigin){this._handlerMap=new Map,this._handleMessage=e=>{if(e.source!==this._context)return;let message=e.data;if(!(message=>{if(!message||"object"!=typeof message||!("type"in message))return!1;let type=message.type;return"string"==typeof type&&!!MESSAGE_TYPE_WHITELIST.includes(type)})(message))return;let handlers=this._handlerMap.get(message.type);if(handlers)for(let handler of handlers)handler(message)},this._context=context,this._getTargetOrigin=getTargetOrigin,window.addEventListener("message",this._handleMessage)}on(type,handler){let handlers=this._handlerMap.get(type)??new Set;this._handlerMap.has(type)||this._handlerMap.set(type,handlers),handlers.add(handler)}send(message){let targetOrigin=this._getTargetOrigin();this._context.postMessage(message,targetOrigin)}destroy(){window.removeEventListener("message",this._handleMessage)}}function _ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}let SOCIAL_SOURCE_MAPPING={[UploadSource.y5.GDRIVE]:"ngdrive"};class ExternalSource extends LitUploaderBlock.z{get _counterText(){if(!this._latestSelectionSummary)return"";let{selectedCount,total}=this._latestSelectionSummary;return this.l10n("selected-count",{count:selectedCount,total})}get activityParams(){let params=super.activityParams;if("externalSourceType"in params)return params;throw Error("External Source activity params not found")}initCallback(){super.initCallback();let{externalSourceType}=this.activityParams;externalSourceType?this._mountIframe():console.error('Param "externalSourceType" is required for external source activity'),this.sub("*currentActivityParams",()=>{setTimeout(()=>{this.isConnected&&(this._unmountIframe(),this._mountIframe())})}),this.subConfigValue("multiple",multiple=>{this._showSelectionStatus=multiple}),this.subConfigValue("localeName",()=>{this._setupL10n()}),this.subConfigValue("externalSourcesEmbedCss",embedCss=>{this._applyEmbedCss(embedCss)})}_extractUrlFromSelectedFile(selectedFile){if(selectedFile.alternatives)for(let preferredType of(0,stringToArray.G)(this.cfg.externalSourcesPreferredTypes)){let regexp=wildcardRegexp(preferredType);for(let[type,typeUrl]of Object.entries(selectedFile.alternatives))if(regexp.test(type))return typeUrl}return selectedFile.url}_handleToolbarStateChange(message){this._toolbarVisible=message.isVisible}async _handleSelectedFilesChange(message){this.cfg.multiple!==message.isMultipleMode?console.error("Multiple mode mismatch"):(this._setSelectionSummary(message.selectedCount,message.total),this._doneBtnTextClass=message.isReady?"":"uc-hidden",this._isSelectionReady=message.isReady,this._isDoneBtnEnabled=message.isReady&&message.selectedFiles.length>0,this._showSelectionStatus=message.isMultipleMode&&message.total>0,this._couldSelectAll=message.selectedCount<message.total,this._couldDeselectAll=message.selectedCount===message.total,this._selectedList=message.selectedFiles??[],this._showDoneBtn=message.total>0)}_handleIframeLoad(){this._applyEmbedCss(this.cfg.externalSourcesEmbedCss),this._applyTheme(),this._setupL10n()}_applyTheme(){this._messageBridge?.send({type:"set-theme-definition",theme:(element=>{let theme={};for(let prop of ucCustomProperties){let value=getCssValue(element,prop);value&&(theme[prop]=value)}return theme})(this)})}_applyEmbedCss(css){this._messageBridge?.send({type:"set-embed-css",css})}_setupL10n(){this._messageBridge?.send({type:"set-locale-definition",localeDefinition:this.cfg.localeName})}_remoteUrl(){let{pubkey,remoteTabSessionKey,socialBaseUrl,multiple}=this.cfg,{externalSourceType}=this.activityParams,sourceName=SOCIAL_SOURCE_MAPPING[externalSourceType]??externalSourceType,params={lang:this.l10n("social-source-lang")?.split("-")?.[0]||"en",public_key:pubkey,images_only:(!1).toString(),session_key:remoteTabSessionKey,wait_for_theme:!0,multiple:multiple.toString(),origin:this.cfg.topLevelOrigin||(()=>{let topLevelWindow=globalThis.top??globalThis.parent??globalThis.self;try{return topLevelWindow.location.origin}catch(e){return console.warn("Unable to access top-level window location:",e),globalThis.location.origin}})(),debug:this.cfg.debug},url=new URL(`/window4/${sourceName}`,socialBaseUrl);return url.search=function(params){let list=[];for(let[key,value]of Object.entries(params))null!=value&&("string"!=typeof value||0!==value.length)&&list.push(`${key}=${encodeURIComponent(value)}`);return list.join("&")}(params),url.toString()}_setSelectionSummary(selectedCount,total){this._latestSelectionSummary={selectedCount,total}}_mountIframe(){let iframe=document.createElement("iframe");iframe.src=this._remoteUrl(),iframe.marginHeight=0,iframe.marginWidth=0,iframe.frameBorder="0",iframe.allowTransparency=!0,iframe.addEventListener("load",this._handleIframeLoad.bind(this)),iframe.addEventListener("load",this._handleIframeLoad.bind(this)),this._iframeRef.value&&(this._iframeRef.value.innerHTML="",this._iframeRef.value.appendChild(iframe)),iframe.contentWindow&&(this._messageBridge?.destroy(),this._messageBridge=new MessageBridge(iframe.contentWindow,()=>this.cfg.socialBaseUrl),this._messageBridge.on("selected-files-change",this._handleSelectedFilesChange.bind(this)),this._messageBridge.on("toolbar-state-change",this._handleToolbarStateChange.bind(this)),this._resetSelectionStatus())}_unmountIframe(){this._messageBridge?.destroy(),this._messageBridge=void 0,this._iframeRef.value&&(this._iframeRef.value.innerHTML=""),this._resetSelectionStatus()}_resetSelectionStatus(){this._selectedList=[],this._isSelectionReady=!1,this._isDoneBtnEnabled=!1,this._couldSelectAll=!1,this._couldDeselectAll=!1,this._showSelectionStatus=!1,this._showDoneBtn=!1,this._doneBtnTextClass="uc-hidden",this._latestSelectionSummary=null}disconnectedCallback(){super.disconnectedCallback(),this._unmountIframe()}render(){return(0,external_lit_.html)`<uc-activity-header><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*historyBack"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><div ${(0,ref_js_.ref)(this._iframeRef)} class="uc-iframe-wrapper"></div><div class="uc-toolbar" ?hidden=${!this._toolbarVisible}><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel}>${this.l10n("cancel")}</button><div class="uc-selection-status-box" ?hidden=${!this._showSelectionStatus}><span>${this._counterText}</span><button type="button" @click=${this._handleSelectAll} ?hidden=${!this._couldSelectAll}>${this.l10n("select-all")}</button><button type="button" @click=${this._handleDeselectAll} ?hidden=${!this._couldDeselectAll}>${this.l10n("deselect-all")}</button></div><button type="button" class="uc-done-btn uc-primary-btn" @click=${this._handleDone} ?disabled=${!this._isDoneBtnEnabled} ?hidden=${!this._showDoneBtn} ><uc-spinner ?hidden=${this._isSelectionReady}></uc-spinner><span class=${this._doneBtnTextClass}>${this.l10n("done")}</span></button></div></div>`}constructor(...args){super(...args),this.couldBeCtxOwner=!0,this._iframeRef=(0,ref_js_.createRef)(),this._latestSelectionSummary=null,this._selectedList=[],this._isSelectionReady=!1,this._isDoneBtnEnabled=!1,this._couldSelectAll=!1,this._couldDeselectAll=!1,this._showSelectionStatus=!1,this._showDoneBtn=!1,this._doneBtnTextClass="uc-hidden",this._toolbarVisible=!0,this._handleDone=()=>{for(let message of this._selectedList){let url=this._extractUrlFromSelectedFile(message),{filename}=message,{externalSourceType}=this.activityParams;this.api.addFileFromUrl(url,{fileName:filename,source:externalSourceType})}this.$["*currentActivity"]=LitActivityBlock.S.activities.UPLOAD_LIST,this.modalManager?.open(LitActivityBlock.S.activities.UPLOAD_LIST)},this._handleCancel=()=>{this.historyBack()},this._handleSelectAll=()=>{this._messageBridge?.send({type:"select-all"})},this._handleDeselectAll=()=>{this._messageBridge?.send({type:"deselect-all"})}}}_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_selectedList",void 0),_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_isSelectionReady",void 0),_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_isDoneBtnEnabled",void 0),_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_couldSelectAll",void 0),_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_couldDeselectAll",void 0),_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_showSelectionStatus",void 0),_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_showDoneBtn",void 0),_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_doneBtnTextClass",void 0),_ts_decorate([(0,decorators_js_.state)()],ExternalSource.prototype,"_toolbarVisible",void 0)},8610(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{I:()=>Icon});var lit__rspack_import_0=__webpack_require__(2927),lit_decorators_js__rspack_import_1=__webpack_require__(8899),lit_directives_unsafe_svg_js__rspack_import_2=__webpack_require__(3943),_lit_LitBlock__rspack_import_3=__webpack_require__(204);function _ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}class Icon extends _lit_LitBlock__rspack_import_3.x{initCallback(){super.initCallback(),this.setAttribute("aria-hidden","true"),this.subConfigValue("iconHrefResolver",resolver=>{this._iconHrefResolver=resolver,this._updateResolvedHref()});let pluginManager=this._sharedInstancesBag.pluginManager;pluginManager?.onPluginsChange&&(this._unsubscribePlugins=pluginManager.onPluginsChange(()=>this._updateResolvedHref()))}willUpdate(changedProperties){super.willUpdate(changedProperties),changedProperties.has("name")&&this._updateResolvedHref()}_updateResolvedHref(){if(!this.name){this._resolvedHref="",this._pluginSvg=null;return}let pluginManager=this._sharedInstancesBag.pluginManager,pluginIcon=pluginManager?.snapshot().icons.find(icon=>icon.name===this.name);if(pluginIcon){this._pluginSvg=pluginIcon.svg,this._resolvedHref="";return}this._pluginSvg=null;let defaultHref=`#uc-icon-${this.name}`,customHref=this._iconHrefResolver?.(this.name);this._resolvedHref=customHref??defaultHref}render(){return this._pluginSvg?(0,lit__rspack_import_0.html)`${this.yield("",(0,lit__rspack_import_0.html)`${(0,lit_directives_unsafe_svg_js__rspack_import_2.unsafeSVG)(this._pluginSvg)}`)}`:(0,lit__rspack_import_0.html)` ${this.yield("",(0,lit__rspack_import_0.html)`<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use href=${this._resolvedHref}></use></svg>`)} `}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback()}constructor(...args){super(...args),this.name="",this._resolvedHref="",this._pluginSvg=null,this._iconHrefResolver=null}}_ts_decorate([(0,lit_decorators_js__rspack_import_1.property)({type:String})],Icon.prototype,"name",void 0),_ts_decorate([(0,lit_decorators_js__rspack_import_1.state)()],Icon.prototype,"_resolvedHref",void 0),_ts_decorate([(0,lit_decorators_js__rspack_import_1.state)()],Icon.prototype,"_pluginSvg",void 0)},9963(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Bx:()=>EventType,Kc:()=>InternalEventType,bk:()=>EventEmitter});var _lit_shared_instances__rspack_import_0=__webpack_require__(5890);let InternalEventType=Object.freeze({INIT_SOLUTION:"init-solution",CHANGE_CONFIG:"change-config",ACTION_EVENT:"action-event",ERROR_EVENT:"error-event"}),EventType=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"});class EventEmitter extends _lit_shared_instances__rspack_import_0.jM{bindTarget(target){return this._targets.add(target),()=>{this._targets.delete(target)}}_dispatch(type,payload){for(let target of this._targets)target.dispatchEvent(new CustomEvent(type,{detail:payload}));this._debugPrint?.(()=>[`event "${type}"`,payload&&"object"==typeof payload?{...payload}:payload])}emit(type,payload,options={}){let{debounce}=options;if("number"!=typeof debounce&&!debounce)return void this._dispatch(type,"function"==typeof payload?payload():payload);this._timeoutStore.has(type)&&window.clearTimeout(this._timeoutStore.get(type));let timeoutId=window.setTimeout(()=>{try{let data="function"==typeof payload?payload():payload;this._dispatch(type,data),this._timeoutStore.delete(type)}catch(error){this._debugPrint?.(()=>`Error while getting payload for event "${type}"`,error)}},"number"==typeof debounce?debounce:20);this._timeoutStore.set(type,timeoutId)}destroy(){for(let timeoutId of this._timeoutStore.values())window.clearTimeout(timeoutId);this._targets.clear()}constructor(...args){super(...args),this._timeoutStore=new Map,this._targets=new Set}}},8130(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{T:()=>UrlSource});var lit__rspack_import_0=__webpack_require__(2927),lit_decorators_js__rspack_import_1=__webpack_require__(8899),lit_directives_ref_js__rspack_import_2=__webpack_require__(5337),_lit_LitActivityBlock__rspack_import_6=__webpack_require__(5923),_lit_LitUploaderBlock__rspack_import_3=__webpack_require__(5544),_utils_UploadSource__rspack_import_5=__webpack_require__(5730),_UploadCtxProvider_EventEmitter__rspack_import_4=__webpack_require__(9963);class UrlSource extends _lit_LitUploaderBlock__rspack_import_3.z{firstUpdated(){let input=this._inputRef.value;input&&(input.value="",input.focus())}render(){return(0,lit__rspack_import_0.html)`<uc-activity-header><button type="button" class="uc-mini-btn" @click=${this.historyBack} title=${this.l10n("back")} aria-label=${this.l10n("back")}><uc-icon name="back"></uc-icon></button><div><uc-icon name="url"></uc-icon><span>${this.l10n("caption-from-url")}</span></div><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><form class="uc-content" @submit=${this._handleUpload}><label><input ${(0,lit_directives_ref_js__rspack_import_2.ref)(this._inputRef)} placeholder="https://" class="uc-url-input" type="text" @input=${this._handleInput} /></label><button type="submit" class="uc-url-upload-btn uc-primary-btn" ?disabled=${this._formState.importDisabled} >${this.l10n("upload-url")}</button></form>`}constructor(...args){super(...args),this._formState={importDisabled:!0},this._inputRef=(0,lit_directives_ref_js__rspack_import_2.createRef)(),this._handleInput=event=>{let value=event.target?.value??"";this._formState={importDisabled:!value}},this._handleUpload=event=>{event.preventDefault(),this.telemetryManager.sendEvent({eventType:_UploadCtxProvider_EventEmitter__rspack_import_4.Kc.ACTION_EVENT,payload:{metadata:{event:"upload-from-url",node:this.tagName}}});let input=this._inputRef.value,url=input?.value?.trim();url&&(this.api.addFileFromUrl(url,{source:_utils_UploadSource__rspack_import_5.pc.URL}),this.$["*currentActivity"]=_lit_LitActivityBlock__rspack_import_6.S.activities.UPLOAD_LIST,this.modalManager?.open(_lit_LitActivityBlock__rspack_import_6.S.activities.UPLOAD_LIST))}}}!function(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);c>3&&r&&Object.defineProperty(target,key,r)}([(0,lit_decorators_js__rspack_import_1.state)()],UrlSource.prototype,"_formState",void 0)},5704(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{r:()=>PACKAGE_NAME,i:()=>PACKAGE_VERSION});var package_namespaceObject=JSON.parse('{"rE":"1.28.0-alpha.111"}');let PACKAGE_NAME="blocks",PACKAGE_VERSION=package_namespaceObject.rE},3361(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{N:()=>CssDataMixin});let ESCAPED_PATTERN=/\\([0-9a-fA-F]{1,6} ?)/g;function CssDataMixin(ctor){return class extends ctor{getCssData(propName,silentCheck=!1){let cssDataCache=this._cssDataCache??Object.create(null);if(!Object.keys(cssDataCache).includes(propName)||!cssDataCache[propName]){this._computedStyle||(this._computedStyle=window.getComputedStyle(this));let val=this._computedStyle.getPropertyValue(propName).trim();try{cssDataCache[propName]=function(input){let output=input;if(!(input.length<2)&&('"'===input[0]||"'"===input[0])&&('"'===input[input.length-1]||"'"===input[input.length-1])){let result;('"'===(result=output)[0]||"'"===result[0])&&(result=result.slice(1)),('"'===result[result.length-1]||"'"===result[result.length-1])&&(result=result.slice(0,-1)),output='"'+(output=function(str){let result="",prev="";for(let i=0;i<str.length;i++){let next=str[i+1];"\\"===str[i]&&'"'===next?(result+='\\"',i++):'"'===str[i]&&"\\"!==prev?result+='\\"':result+=str[i],prev=str[i]??""}return result}(output=(output=(output=result).replace(ESCAPED_PATTERN,(_match,group)=>String.fromCodePoint(parseInt(group.trim(),16)))).replaceAll("\\\n","\\n")))+'"'}try{return JSON.parse(output)}catch(_error){return}}(val)}catch(error){silentCheck||console.warn(`CSS Data error: ${propName}`,error),cssDataCache[propName]=null}}return this._cssDataCache=cssDataCache,cssDataCache[propName]}constructor(...args){super(...args),this._cssDataCache=null,this._computedStyle=null}}}},7337(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Q:()=>LightDomMixin});var lit__rspack_import_0=__webpack_require__(2927);function LightDomMixin(ctor){return class extends ctor{createRenderRoot(){return this}connectedCallback(){this._initialLightDomChildren||(this._initialLightDomChildren=Array.from(this.childNodes)),super.connectedCallback()}_adoptChildren(){if(this._hasAdoptedChildren)return;this._hasAdoptedChildren=!0,this._slotsMap={};let directChildren=Array.from(this.childNodes);for(let child of directChildren.length?directChildren:this._initialLightDomChildren??[]){let slotName=this._getSlotNameForChild(child),slotContent=this._slotsMap[slotName]??[];child instanceof Element&&(child.removeAttribute("slot"),child.removeAttribute("content-for")),slotContent.push(child),this._slotsMap[slotName]=slotContent}this._initialLightDomChildren=null}_getSlotNameForChild(child){return child instanceof Comment&&child.nextSibling instanceof Element?this._getSlotNameForChild(child.nextSibling):"contentFor"in child?child.contentFor||"":child instanceof Element&&child.hasAttribute("content-for")&&child.getAttribute("content-for")||""}_isTextNodeEmpty(node){return!node.textContent||!node.textContent.trim()}_isSlotEmpty(slot){let content=this._slotsMap[slot];return!content||content.every(child=>child instanceof Comment||child instanceof Text&&this._isTextNodeEmpty(child))}update(changedProperties){!this.hasUpdated&&this.willYield&&this._adoptChildren(),super.update(changedProperties)}yield(slot,defaultContent){if(""===slot&&!this._slotsMap[slot]&&!this._hasAdoptedChildren&&this._initialLightDomChildren?.length){let slotContent=[];for(let child of this._initialLightDomChildren)child instanceof Element&&(child.removeAttribute("slot"),child.removeAttribute("content-for")),slotContent.push(child);this._slotsMap[slot]=slotContent,this._hasAdoptedChildren=!0,this._initialLightDomChildren=null}let slotContent=this._slotsMap[slot];return(0,lit__rspack_import_0.html)`
2
+ ${slotContent}
3
+ ${this._isSlotEmpty(slot)?defaultContent:void 0}
4
+ `}constructor(...args){super(...args),this.willYield=!0,this._slotsMap={},this._initialLightDomChildren=null,this._hasAdoptedChildren=!1}}}},5923(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{S:()=>LitActivityBlock});var _abstract_CTX__rspack_import_2=__webpack_require__(7992),_blocks_UploadCtxProvider_EventEmitter__rspack_import_1=__webpack_require__(9963),_utils_debounce__rspack_import_3=__webpack_require__(4441),_activity_constants__rspack_import_4=__webpack_require__(7715),_LitBlock__rspack_import_0=__webpack_require__(204);let ACTIVE_ATTR="active",ACTIVE_PROP="___ACTIVITY_IS_ACTIVE___";class LitActivityBlock extends _LitBlock__rspack_import_0.x{_deactivate(){let actDesc=LitActivityBlock._activityCallbacks.get(this);this[ACTIVE_PROP]=!1,this.removeAttribute(ACTIVE_ATTR),actDesc?.deactivateCallback?.()}_activate(){let actDesc=LitActivityBlock._activityCallbacks.get(this);this.$["*historyBack"]=this.historyBack.bind(this),this[ACTIVE_PROP]=!0,this.setAttribute(ACTIVE_ATTR,""),actDesc?.activateCallback?.(),this._debouncedHistoryFlush(),this.emit(_blocks_UploadCtxProvider_EventEmitter__rspack_import_1.Bx.ACTIVITY_CHANGE,{activity:this.activityType})}initCallback(){super.initCallback(),this.activityType&&(this.hasAttribute("activity")||this.setAttribute("activity",this.activityType),this.sub("*currentActivity",val=>{try{this.activityType!==val&&this[ACTIVE_PROP]?this._deactivate():this.activityType!==val||this[ACTIVE_PROP]||this._activate()}catch(err){this.telemetryManager.sendEventError(err,`activity "${this.activityType}"`),console.error(`Error in activity "${this.activityType}". `,err);let nextActivity=this.$["*history"][this.$["*history"].length-1];this.$["*currentActivity"]=nextActivity??null}val||(this.$["*history"]=[])}))}_historyFlush(){let history=this.$["*history"];history&&(history.length>10&&(history=history.slice(history.length-11,history.length-1)),this.historyTracked&&history[history.length-1]!==this.activityType&&history.push(this.activityType),this.$["*history"]=history)}_isActivityRegistered(){return!!this.activityType&&LitActivityBlock._activityCallbacks.has(this)}static{this._activityCallbacks=new Map}get isActivityActive(){return!!this[ACTIVE_PROP]}get couldOpenActivity(){return!0}registerActivity(_name,options={}){let{onActivate,onDeactivate}=options;LitActivityBlock._activityCallbacks.set(this,{activateCallback:onActivate,deactivateCallback:onDeactivate})}_unregisterActivity(){this.isActivityActive&&this._deactivate(),LitActivityBlock._activityCallbacks.delete(this)}disconnectedCallback(){super.disconnectedCallback(),this._isActivityRegistered()&&this._unregisterActivity();let currentActivity=this.$["*currentActivity"];this.blocksRegistry&&([...this.blocksRegistry].find(block=>block instanceof LitActivityBlock&&block.activityType===currentActivity)||(this.$["*currentActivity"]=null,this.modalManager?.closeAll()))}get activityParams(){return this.$["*currentActivityParams"]}get initActivity(){return this.getCssData("--cfg-init-activity")??null}get doneActivity(){return this.getCssData("--cfg-done-activity")??null}historyBack(){let history=this.$["*history"];if(history){let nextActivity=history.pop();for(;nextActivity===this.activityType;)nextActivity=history.pop();let couldOpenActivity=!!nextActivity;if(nextActivity){let nextLitActivityBlock=[...this.blocksRegistry].find(block=>block.activityType===nextActivity);couldOpenActivity=nextLitActivityBlock?.couldOpenActivity??!1}nextActivity=couldOpenActivity?nextActivity:null,this.$["*currentActivity"]=nextActivity??null,nextActivity&&this.modalManager?.open(nextActivity),this.$["*history"]=history,nextActivity||this.modalManager?.closeAll()}}constructor(...args){super(...args),this.historyTracked=!1,this.init$=(0,_abstract_CTX__rspack_import_2._H)(this),this._debouncedHistoryFlush=(0,_utils_debounce__rspack_import_3.s)(this._historyFlush.bind(this),10)}}LitActivityBlock.activities=_activity_constants__rspack_import_4.g},204(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{x:()=>LitBlock});var external_lit_=__webpack_require__(2927),CTX=__webpack_require__(7992),activity_constants=__webpack_require__(7715),shared_instances=__webpack_require__(5890);class ClipboardLayer extends shared_instances.jM{constructor(sharedInstancesBag){super(sharedInstancesBag),this.scopes=new Set,this.listener=this._listener.bind(this),window.addEventListener("paste",this.listener)}openUploadList(){this._sharedInstancesBag.api.setCurrentActivity(activity_constants.g.UPLOAD_LIST),this._sharedInstancesBag.api.setModalState(!0)}async _listener(event){if(event.clipboardData){for(let scope of this.scopes)if(scope.isConnected)switch(this._cfg.pasteScope){case"global":await this.handlePaste(event);break;case"local":if(!scope.contains(event.target))continue;await this.handlePaste(event);break;default:continue}}}async handlePaste(event){let items=Array.from(event.clipboardData.items),files=items.map(item=>item.getAsFile()).filter(file=>null!==file),urls=items.filter(item=>"string"===item.kind&&"text/plain"===item.type).map(item=>new Promise(resolve=>{item.getAsString(text=>{resolve(text)})}));files.length>0&&(files.forEach(file=>{this._sharedInstancesBag.api.addFileFromObject(file,{source:"clipboard"})}),this.openUploadList()),urls.length>0&&((await Promise.all(urls)).forEach(url=>{this._sharedInstancesBag.api.addFileFromUrl(url,{source:"clipboard"})}),this.openUploadList())}registerBlock(scope){return this.scopes.add(scope),()=>{this.scopes.delete(scope)}}destroy(){super.destroy(),window.removeEventListener("paste",this.listener),this.scopes.clear()}}class ScopedMinimalWindow{addEventListener(type,listener){let wrappedListener=event=>{let target=event.target;target instanceof Node&&this._scope.some(el=>el===target||el.contains(target))&&listener(event)};this._listeners.set(listener,wrappedListener),window.addEventListener(type,wrappedListener)}removeEventListener(type,listener){let wrappedListener=this._listeners.get(listener);wrappedListener&&window.removeEventListener(type,wrappedListener),this._listeners.delete(listener)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(scope){this._scope.push(scope)}destroy(){for(let wrappedListener of(this._scope=[],this._listeners.values()))window.removeEventListener("keydown",wrappedListener),window.removeEventListener("keyup",wrappedListener);this._listeners.clear()}constructor(){this._listeners=new Map,this._scope=[]}}class A11y{constructor(){this._scopedWindow=new ScopedMinimalWindow,this._destroyKeyUX=(0,__rspack_external_keyux.startKeyUX)(this._scopedWindow,[(0,__rspack_external_keyux.focusGroupKeyUX)(),(0,__rspack_external_keyux.pressKeyUX)("is-pressed"),(0,__rspack_external_keyux.jumpKeyUX)(),(0,__rspack_external_keyux.hiddenKeyUX)()])}registerBlock(scope){this._scopedWindow.registerScope(scope)}destroy(){this._destroyKeyUX?.(),this._scopedWindow.destroy()}}var LocaleManager=__webpack_require__(7959),ModalManager=__webpack_require__(3076);class CustomConfigRegistry{register(pluginId,definition){if(this._definitions.has(definition.name))return void console.warn(`[CustomConfig] Config option "${definition.name}" is already registered`);let ownedDefinition={attribute:!0,...definition,pluginId};this._definitions.set(definition.name,ownedDefinition)}unregister(name){this._definitions.delete(name)}unregisterByPlugin(pluginId){for(let[name,definition]of this._definitions)definition.pluginId===pluginId&&this._definitions.delete(name)}get(name){return this._definitions.get(name)}getAll(){return new Map(this._definitions)}constructor(){this._definitions=new Map}}var sharedConfigKey=__webpack_require__(1971);class PluginManager extends shared_instances.jM{constructor(sharedInstancesBag){super(sharedInstancesBag),this._plugins=new Map,this._sources=[],this._activities=[],this._fileActions=[],this._fileHooks=[],this._icons=[],this._i18n=[],this._subscribers=new Set,this._pluginsUpdate=Promise.resolve(),this.configRegistry=new CustomConfigRegistry,this.addSub(this._ctx.sub((0,sharedConfigKey.T)("plugins"),plugins=>{this._pluginsUpdate=this._pluginsUpdate.then(()=>this._syncPlugins(plugins))}))}onPluginsChange(callback){return this._subscribers.add(callback),()=>{this._subscribers.delete(callback)}}async _syncPlugins(plugins){let currentPluginIds=new Set(this._plugins.keys()),processedIds=new Set;for(let plugin of plugins){if(processedIds.has(plugin.id)){this._debugPrint(`Plugin "${plugin.id}" is already in the list, skipping duplicate`);continue}processedIds.add(plugin.id);let registered=this._plugins.get(plugin.id);if(!registered||registered.plugin!==plugin)try{await this._registerPlugin(plugin)}catch(error){this._purgeRegistrations(plugin.id),this._notifySubscribers(),this._debugPrint(`Plugin "${plugin.id}" setup failed`,error)}currentPluginIds.delete(plugin.id)}for(let pluginId of currentPluginIds)this._unregisterPlugin(pluginId)}async _registerPlugin(plugin){let pluginExports;this._plugins.has(plugin.id)&&this._unregisterPlugin(plugin.id);let registrations={sources:[],activities:[],fileActions:[],fileHooks:[],icons:[],i18n:[]},configSubscriptions=[],uploaderApi=this._sharedInstancesBag.api;try{pluginExports=await plugin.setup({pluginApi:{registry:{registerSource:source=>this._register(this._sources,registrations.sources,plugin.id,source),registerActivity:activity=>this._register(this._activities,registrations.activities,plugin.id,activity),registerFileAction:fileAction=>this._register(this._fileActions,registrations.fileActions,plugin.id,fileAction),registerFileHook:hook=>this._register(this._fileHooks,registrations.fileHooks,plugin.id,hook),registerIcon:icon=>this._register(this._icons,registrations.icons,plugin.id,icon),registerI18n:i18n=>this._register(this._i18n,registrations.i18n,plugin.id,i18n),registerConfig:definition=>{this.configRegistry.register(plugin.id,definition)}},config:{get:configName=>{let stateKey=(0,sharedConfigKey.T)(configName);return this._ctx.read(stateKey)},subscribe:(configName,callback)=>{let stateKey=(0,sharedConfigKey.T)(configName),unsub=this._ctx.sub(stateKey,value=>{callback(value)});return configSubscriptions.push(unsub),unsub}},activity:{getParams:()=>this._ctx.read("*currentActivityParams"),subscribeToParams:callback=>{let unsub=this._ctx.sub("*currentActivityParams",params=>{callback(params)});return configSubscriptions.push(unsub),unsub}},files:{update:(internalId,changes)=>{let entry=this._sharedInstancesBag.uploadCollection?.read(internalId);entry&&(void 0!==changes.file&&(entry.setValue("file",changes.file),entry.setValue("fileSize",changes.file.size)),void 0!==changes.cdnUrl&&entry.setValue("cdnUrl",changes.cdnUrl),void 0!==changes.cdnUrlModifiers&&entry.setValue("cdnUrlModifiers",changes.cdnUrlModifiers),void 0!==changes.mimeType&&entry.setValue("mimeType",changes.mimeType))}}},uploaderApi})??void 0}catch(error){for(let unsub of configSubscriptions)try{unsub()}catch(e){this._debugPrint("Failed to unsubscribe config listener",e)}throw error}this._plugins.set(plugin.id,{plugin,exports:pluginExports,registrations,configSubscriptions}),this._notifySubscribers()}_unregisterPlugin(pluginId){let registered=this._plugins.get(pluginId);if(registered){for(let unsub of(this._purgeRegistrations(pluginId),registered.configSubscriptions))try{unsub()}catch(error){this._debugPrint("Failed to unsubscribe config listener",error)}registered.exports?.dispose?.(),this._plugins.delete(pluginId),this._notifySubscribers()}}snapshot(){return{sources:[...this._sources],activities:[...this._activities],fileActions:[...this._fileActions],fileHooks:[...this._fileHooks],icons:[...this._icons],i18n:[...this._i18n]}}destroy(){for(let pluginId of Array.from(this._plugins.keys()))this._unregisterPlugin(pluginId);super.destroy()}_register(target,bucket,pluginId,registration){let owned={...registration,pluginId};return target.push(owned),bucket.push(owned),registration}_purgeRegistrations(pluginId){this._sources=this._sources.filter(item=>item.pluginId!==pluginId),this._activities=this._activities.filter(item=>item.pluginId!==pluginId),this._fileActions=this._fileActions.filter(item=>item.pluginId!==pluginId),this._fileHooks=this._fileHooks.filter(item=>item.pluginId!==pluginId),this._icons=this._icons.filter(item=>item.pluginId!==pluginId),this._i18n=this._i18n.filter(item=>item.pluginId!==pluginId),this.configRegistry.unregisterByPlugin(pluginId)}_notifySubscribers(){for(let callback of this._subscribers)try{callback()}catch{}}}var upload_client_=__webpack_require__(5474),initialConfig=__webpack_require__(318),EventEmitter=__webpack_require__(9963),env=__webpack_require__(5704),UID=__webpack_require__(5446);class TelemetryManager extends shared_instances.jM{constructor(sharedInstancesBag){for(let key of(super(sharedInstancesBag),this._sessionId=UID.V.generateRandomUUID(),this._config=structuredClone(initialConfig.Dz),this._initialized=!1,this._lastPayload=null,this._isEnabled=!1,this._telemetryInstance=new __rspack_external__uploadcare_quality_insights_89d21ee8.TelemetryAPIService,this._queue=new upload_client_.Queue(10),this.addSub(this._ctx.sub((0,sharedConfigKey.T)("qualityInsights"),value=>{this._isEnabled=!!value})),Object.keys(this._config)))this.addSub(this._ctx.sub((0,sharedConfigKey.T)(key),value=>{this._isEnabled&&(this._initialized&&this._config[key]!==value&&this.sendEvent({eventType:EventEmitter.Kc.CHANGE_CONFIG}),this._setConfig(key,value))}))}_init(type){type!==EventEmitter.Kc.INIT_SOLUTION||this._initialized||(this._initialized=!0)}_setConfig(key,value){this._config[key]!==value&&(this._config[key]=value)}_formattingPayload(body){let payload=body.payload?{...body.payload}:{};payload.activity&&(payload.activity=void 0);let result={...body};return(body.eventType===EventEmitter.Kc.INIT_SOLUTION||body.eventType===EventEmitter.Kc.CHANGE_CONFIG)&&(result.config=this._config),{...result,appVersion:env.i,appName:env.r,sessionId:this._sessionId,component:this._solution,activity:this._activity,projectPubkey:this._config.pubkey,userAgent:navigator.userAgent,eventType:result.eventType??"",eventTimestamp:this._timestamp,payload:{location:this._location,...payload}}}_excludedEvents(type){return!!(type&&[EventEmitter.Bx.CHANGE,EventEmitter.Bx.COMMON_UPLOAD_PROGRESS,EventEmitter.Bx.FILE_ADDED,EventEmitter.Bx.FILE_REMOVED,EventEmitter.Bx.FILE_UPLOAD_START,EventEmitter.Bx.FILE_UPLOAD_PROGRESS,EventEmitter.Bx.FILE_UPLOAD_SUCCESS,EventEmitter.Bx.FILE_UPLOAD_FAILED].includes(type))}sendEvent(body){if(!this._isEnabled)return;let payload=this._formattingPayload({eventType:body.eventType,payload:body.payload,config:body.config});this._init(body.eventType),this._excludedEvents(body.eventType)||this._lastPayload&&this._checkObj(this._lastPayload,payload)||this._queue.add(async()=>{this._lastPayload=payload,await this._telemetryInstance.sendEvent(payload)})}sendEventError(error,context="unknown"){this.sendEvent({eventType:EventEmitter.Kc.ERROR_EVENT,payload:{metadata:{event:"error",text:`Error in ${context}`,error:error.message}}})}sendEventCloudImageEditor(e,tabId,options={}){this.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{tabId,node:e.currentTarget?.tagName,event:e.type,...options}}})}_checkObj(last,current){if(JSON.stringify(last)===JSON.stringify(current))return!0;if("object"!=typeof last||"object"!=typeof current||null==last||null==current)return!1;let lastKeys=Object.keys(last),currentKeys=Object.keys(current);if(lastKeys.length!==currentKeys.length)return!1;for(let key of lastKeys)if(!Object.hasOwn(current,key)||!this._checkObj(last[key],current[key]))return!1;return!0}get _timestamp(){return Date.now()}get _solution(){if(!this._ctx.has("*solution"))return null;let solution=this._ctx.read("*solution");return solution?solution.toLowerCase():null}get _activity(){return this._ctx.has("*currentActivity")?this._ctx.read("*currentActivity"):null}get _location(){return location.origin}}var PubSubCompat=__webpack_require__(8594),cdn_utils=__webpack_require__(6339),template_utils=__webpack_require__(664),debounce=__webpack_require__(4441);let WINDOW_HEIGHT_TRACKER_PROPERTY="--uploadcare-blocks-window-height";class WindowHeightTracker{static{this.clientsRegistry=new Set}static{this.flush=(0,debounce.s)(()=>{document.documentElement.style.setProperty(WINDOW_HEIGHT_TRACKER_PROPERTY,`${window.innerHeight}px`)},100)}static registerClient(client){0===WindowHeightTracker.clientsRegistry.size&&WindowHeightTracker.attachTracker(),WindowHeightTracker.clientsRegistry.add(client)}static unregisterClient(client){WindowHeightTracker.clientsRegistry.delete(client),0===WindowHeightTracker.clientsRegistry.size&&WindowHeightTracker.detachTracker()}static attachTracker(){window.addEventListener("resize",WindowHeightTracker.flush,{passive:!0,capture:!0}),WindowHeightTracker.flush()}static detachTracker(){window.removeEventListener("resize",WindowHeightTracker.flush,{capture:!0}),document.documentElement.style.removeProperty(WINDOW_HEIGHT_TRACKER_PROPERTY)}}var CssDataMixin=__webpack_require__(3361),createDebugPrinter=__webpack_require__(255),LightDomMixin=__webpack_require__(7337),l10n=__webpack_require__(263),RegisterableElementMixin=__webpack_require__(3282),SymbioteCompatMixin=__webpack_require__(9280);class TestModeController{constructor(host){this._trackedElements=new Set,this._originalValues=new Map,this._enabled=!1,this._host=host,this._host.addController(this)}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=void 0,this._trackedElements.clear(),this._originalValues.clear()}hostUpdated(){if(!this._unsubscribe&&this._host.has((0,sharedConfigKey.T)("testMode"))){let unsubscribe=this._host.subConfigValue("testMode",isEnabled=>{this._enabled=!!isEnabled,this._applyTestMode()});this._unsubscribe=unsubscribe}this._collectElements(),this._applyTestMode()}_collectElements(){let litHost=this._host,root=litHost.renderRoot??litHost;if(!root)return;let hostElement=this._host,hostTag=hostElement.tagName?.toLowerCase();for(let el of Array.from(root.querySelectorAll("[data-testid]")).filter(el=>!el.tagName?.includes("-")))if((!hostTag||el.closest(hostTag)===hostElement)&&!this._trackedElements.has(el)){let attrValue=el.getAttribute("data-testid");if(!attrValue)continue;this._trackedElements.add(el),this._originalValues.set(el,attrValue)}for(let el of Array.from(this._trackedElements))(!el.isConnected||hostTag&&el.closest(hostTag)!==hostElement)&&(this._trackedElements.delete(el),this._originalValues.delete(el))}_applyTestMode(){if(!this._trackedElements.size)return;let prefix=this._host.testId||"";for(let el of this._trackedElements){let baseValue=this._originalValues.get(el);baseValue&&(this._enabled?el.setAttribute("data-testid",`${prefix}--${baseValue}`):el.removeAttribute("data-testid"))}}}let LitBlockBase=(0,RegisterableElementMixin.d)((0,SymbioteCompatMixin.w)()((0,CssDataMixin.N)((0,LightDomMixin.Q)(external_lit_.LitElement))));class LitBlock extends LitBlockBase{static{this.styleAttrs=[]}constructor(){super(),this.activityType=null,this.init$=(0,CTX.HU)(),this.l10n=(0,l10n.k)(()=>this.sharedCtx),this.debugPrint=(0,createDebugPrinter.W)(()=>this.sharedCtx,this.constructor.name),this._sharedInstancesBag=(0,shared_instances.EC)(()=>this.sharedCtx),new TestModeController(this)}emit(type,payload,options){let eventEmitter=this.has("*eventEmitter")?this.$["*eventEmitter"]:void 0;if(!eventEmitter)return;eventEmitter.emit(type,payload,options);let resolvedPayload="function"==typeof payload?payload():payload;this.telemetryManager.sendEvent({eventType:type,payload:resolvedPayload??void 0})}hasBlockInCtx(callback){for(let block of this.blocksRegistry)if(callback(block))return!0;return!1}connectedCallback(){this.constructor.styleAttrs.forEach(attr=>{this.setAttribute(attr,"")}),super.connectedCallback(),WindowHeightTracker.registerClient(this)}initCallback(){this._addSharedContextInstance("*blocksRegistry",()=>new Set),this._addSharedContextInstance("*pluginManager",sharedInstancesBag=>new PluginManager(sharedInstancesBag)),this._addSharedContextInstance("*eventEmitter",sharedInstancesBag=>new EventEmitter.bk(sharedInstancesBag)),this._addSharedContextInstance("*localeManager",sharedInstancesBag=>new LocaleManager.OZ(sharedInstancesBag)),this._addSharedContextInstance("*modalManager",sharedInstancesBag=>new ModalManager.P(sharedInstancesBag)),this._addSharedContextInstance("*a11y",()=>new A11y),this._addSharedContextInstance("*clipboard",sharedInstancesBag=>new ClipboardLayer(sharedInstancesBag)),this._addSharedContextInstance("*telemetryManager",sharedInstancesBag=>new TelemetryManager(sharedInstancesBag)),this.sub((0,LocaleManager.PI)("locale-id"),localeId=>{let locale,direction,fromGetter,direction1=(locale=new Intl.Locale(localeId),direction="ltr",(fromGetter=locale.getTextInfo?.().direction)?direction=fromGetter:locale.textInfo?.direction&&(direction=locale.textInfo.direction),direction);this.style.direction="ltr"===direction1?"":direction1,this.requestUpdate()}),this.subConfigValue("testMode",testMode=>{testMode&&this.testId?this.setAttribute("data-testid",this.testId):this.removeAttribute("data-testid")}),this.blocksRegistry.add(this)}get testId(){return window.customElements.getName(this.constructor)}get modalManager(){return this._getSharedContextInstance("*modalManager",!1)}get telemetryManager(){return this._getSharedContextInstance("*telemetryManager")}get localeManager(){return this._getSharedContextInstance("*localeManager")}get a11y(){return this._getSharedContextInstance("*a11y")}get clipboardLayer(){return this._getSharedContextInstance("*clipboard")}get blocksRegistry(){return this._getSharedContextInstance("*blocksRegistry")}get eventEmitter(){return this._getSharedContextInstance("*eventEmitter")}disconnectedCallback(){super.disconnectedCallback(),WindowHeightTracker.unregisterClient(this);let blocksRegistry=this.blocksRegistry;blocksRegistry?.delete(this),blocksRegistry?.size===0&&setTimeout(()=>{this.isConnected||blocksRegistry?.size>0||this.destroyCtxCallback()},0)}destroyCtxCallback(){this._destroySharedContextInstances(),PubSubCompat.G.deleteCtx(this.ctxName)}_getSharedContextInstances(){let key="*sharedContextInstances";if(!this.has(key)||!this.$[key]){let map=new Map;this.add(key,map,!0)}return this.$[key]}_addSharedContextInstance(key,resolver){let instances=this._getSharedContextInstances();if(!instances.has(key)&&(!this.has(key)||!this.$[key])){let instance=resolver(this._sharedInstancesBag);this.add(key,instance,!0),instances.set(key,instance);return}}_destroySharedContextInstances(){let instances=this._getSharedContextInstances();for(let[key,instance]of instances.entries())instance?.destroy?.(),this.pub(key,null);instances.clear()}_getSharedContextInstance(key,isRequired=!0){if(this.has(key)&&this.$[key]||!isRequired)return this.$[key];throw Error(`Unexpected error: context manager for key "${String(key)}" is not available`)}async proxyUrl(url){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(url,{uuid:(0,cdn_utils.p_)(url),cdnUrlModifiers:(0,cdn_utils._A)(url),fileName:(0,cdn_utils.v6)(url)})}catch(err){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",err),this.telemetryManager.sendEventError(err,"secureDeliveryProxyUrlResolver. Failed to resolve secure delivery proxy URL. Falling back to the default URL."),url}return this.cfg.secureDeliveryProxy?(0,template_utils.x)(this.cfg.secureDeliveryProxy,{previewUrl:url},{transform:value=>window.encodeURIComponent(value)}):url}get cfg(){return this._cfgProxy||(this._cfgProxy=new Proxy({},{set:(_obj,key,value)=>{if("string"!=typeof key||!(key in initialConfig.Dz))return!1;let sharedKey=(0,sharedConfigKey.T)(key);return this.has(sharedKey)||this.add(sharedKey,initialConfig.Dz[key]),this.$[sharedKey]=value,!0},get:(_obj,key)=>{let sharedKey=(0,sharedConfigKey.T)(key);return this.has(sharedKey)||this.add(sharedKey,initialConfig.Dz[key]),this.$[sharedKey]}})),this._cfgProxy}subConfigValue(key,callback){let sharedKey=(0,sharedConfigKey.T)(key);return this.has(sharedKey)||this.add(sharedKey,initialConfig.Dz[key]),this.sub(sharedKey,callback)}}},5544(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{z:()=>LitUploaderBlock});var upload_client_=__webpack_require__(5474),CTX=__webpack_require__(7992),shared_instances=__webpack_require__(5890);let msToUnixTimestamp=ms=>"number"!=typeof ms?0:Math.floor(ms/1e3);class SecureUploadsManager extends shared_instances.jM{async getSecureToken(){let{secureSignature,secureExpire,secureUploadsSignatureResolver,secureUploadsExpireThreshold}=this._cfg;if((secureSignature||secureExpire)&&secureUploadsSignatureResolver&&console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."),secureUploadsSignatureResolver){if(!this._secureToken||((secureToken,{threshold})=>{let{secureExpire}=secureToken,nowUnix=msToUnixTimestamp(Date.now()),expireUnix=Number(secureExpire);return nowUnix+msToUnixTimestamp(threshold)>=expireUnix})(this._secureToken,{threshold:secureUploadsExpireThreshold})){this._secureToken?this._debugPrint("Secure signature is expired. Resolving a new one..."):this._debugPrint("Secure signature is not set yet.");try{let result=await secureUploadsSignatureResolver();result?result.secureSignature&&result.secureExpire?(this._debugPrint("Secure signature resolved:",result),this._debugPrint("Secure signature will expire in",new Date(1e3*Number(result.secureExpire)).toISOString()),this._secureToken=result):console.error("Secure signature resolver returned an invalid result:",result):(this._debugPrint("Secure signature resolver returned nothing."),this._secureToken=null)}catch(err){console.error("Secure signature resolving failed. Falling back to the previous one.",err),this._sharedInstancesBag.telemetryManager.sendEventError(err,"secureUploadsSignatureResolver. Secure signature resolving failed. Falling back to the previous one.")}}return this._secureToken}return secureSignature&&secureExpire?(this._debugPrint("Secure signature and expire are set. Using them...",{secureSignature,secureExpire}),{secureSignature,secureExpire}):null}destroy(){super.destroy(),this._secureToken=null}constructor(...args){super(...args),this._secureToken=null}}var EventEmitter=__webpack_require__(9963),debounce=__webpack_require__(4441);let validateMultiple=(collection,api)=>{let total=collection.totalCount,multipleMin=api.cfg.multiple?api.cfg.multipleMin:0,multipleMax=api.cfg.multiple?api.cfg.multipleMax:1;return multipleMin&&total<multipleMin?{type:"TOO_FEW_FILES",message:api.l10n("files-count-limit-error-too-few",{min:multipleMin,max:multipleMax,total}),payload:{total,min:multipleMin,max:multipleMax}}:multipleMax&&total>multipleMax?{type:"TOO_MANY_FILES",message:api.l10n("files-count-limit-error-too-many",{min:multipleMin,max:multipleMax,total}),payload:{total,min:multipleMin,max:multipleMax}}:void 0},validateCollectionUploadError=(collection,api)=>{if(collection.failedCount>0)return{type:"SOME_FILES_HAS_ERRORS",message:api.l10n("some-files-were-not-uploaded")}},validateIsImage=(outputEntry,api)=>{let imagesOnly=api.cfg.imgOnly,isImage=outputEntry.isImage;if(imagesOnly&&!isImage&&(outputEntry.fileInfo||!outputEntry.externalUrl)&&(outputEntry.fileInfo||outputEntry.mimeType))return{type:"NOT_AN_IMAGE",message:api.l10n("images-only-accepted"),payload:{entry:outputEntry}}};var browser_info=__webpack_require__(1633),stringToArray=__webpack_require__(2513);let BASIC_IMAGE_WILDCARD="image/*",BASIC_VIDEO_WILDCARD="video/*",IMAGE_ACCEPT_LIST=browser_info.R5.safariDesktop?[BASIC_IMAGE_WILDCARD]:[BASIC_IMAGE_WILDCARD,"image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"],mergeFileTypes=fileTypes=>fileTypes?fileTypes.filter(item=>"string"==typeof item).flatMap(str=>(0,stringToArray.G)(str)):[],matchMimeType=(mimeType,allowedFileTypes)=>allowedFileTypes.some(type=>{if(type.endsWith("*")){let normalizedType=type.replace("*","");return mimeType.startsWith(normalizedType)}return mimeType===type}),validateFileType=(outputEntry,api)=>{let allowedFileTypes=mergeFileTypes([...api.cfg.imgOnly?IMAGE_ACCEPT_LIST:[],api.cfg.accept]);if(!allowedFileTypes.length)return;let mimeType=outputEntry.mimeType,fileName=outputEntry.name;if(!mimeType||!fileName)return;let mimeOk=matchMimeType(mimeType,allowedFileTypes),extOk=allowedFileTypes.some(type=>!!type.startsWith(".")&&fileName.toLowerCase().endsWith(type.toLowerCase()));if(!mimeOk&&!extOk)return{type:"FORBIDDEN_FILE_TYPE",message:api.l10n("file-type-not-allowed"),payload:{entry:outputEntry}}};var getPluralForm=__webpack_require__(9364);let ByteUnitEnum=Object.freeze({AUTO:"auto",BYTE:"byte",KB:"kb",MB:"mb",GB:"gb",TB:"tb",PB:"pb"}),round=number=>Math.ceil(100*number)/100,validateMaxSizeLimit=(outputEntry,api)=>{let maxFileSize=api.cfg.maxLocalFileSizeBytes,fileSize=outputEntry.size;if(maxFileSize&&fileSize&&fileSize>maxFileSize)return{type:"FILE_SIZE_EXCEEDED",message:api.l10n("files-max-size-limit-error",{maxFileSize:((bytes,unit=ByteUnitEnum.AUTO)=>{let isAutoMode=unit===ByteUnitEnum.AUTO;if(unit===ByteUnitEnum.BYTE||isAutoMode&&bytes<1e3){let pluralForm=(0,getPluralForm.Z)("en-US",bytes);return`${bytes} ${"one"===pluralForm?"byte":"bytes"}`}return unit===ByteUnitEnum.KB||isAutoMode&&bytes<1e6?`${round(bytes/1e3)} KB`:unit===ByteUnitEnum.MB||isAutoMode&&bytes<1e9?`${round(bytes/1e6)} MB`:unit===ByteUnitEnum.GB||isAutoMode&&bytes<1e12?`${round(bytes/1e9)} GB`:unit===ByteUnitEnum.TB||isAutoMode&&bytes<1e15?`${round(bytes/1e12)} TB`:`${round(bytes/1e15)} PB`})(maxFileSize)}),payload:{entry:outputEntry}}},validateUploadError=(outputEntry,api)=>{let{internalId}=outputEntry;if(!api._uploadCollection.hasItem(internalId))return;let internalEntry=api._uploadCollection.read(internalId),cause=internalEntry?.getValue("uploadError");if(!cause)return;if(cause instanceof upload_client_.UploadError)return{type:"UPLOAD_ERROR",message:cause.message,payload:{entry:outputEntry,error:cause}};if(cause instanceof upload_client_.NetworkError)return{type:"NETWORK_ERROR",message:cause.message,payload:{entry:outputEntry,error:cause}};let error=cause instanceof Error?cause:Error("Unknown error",{cause});return{type:"UNKNOWN_ERROR",message:error.message,payload:{entry:outputEntry,error}}};var sharedConfigKey=__webpack_require__(1971);let LOG_TEXT_FILE_VALIDATION_FAILED="File validator execution has failed",LOG_TEXT_MISSING_ERROR_MESSAGE="Missing message. We recommend adding message: value.",getValidatorDescriptor=validator=>"function"==typeof validator?{runOn:"change",validator}:validator;class ValidationManager extends shared_instances.jM{get _uploadCollection(){return this._sharedInstancesBag.uploadCollection}constructor(sharedInstancesBag){super(sharedInstancesBag),this._commonFileValidators=[validateIsImage,validateFileType,validateMaxSizeLimit,validateUploadError],this._commonCollectionValidators=[validateMultiple,validateCollectionUploadError],this._queue=new upload_client_.Queue(20),this._runQueueDebounced=(0,debounce.s)(()=>{this._queue.run()},500),this._isDestroyed=!1,this._entryValidationState=new Map;let runAllValidators=(0,debounce.s)(()=>{this.runFileValidators("change"),this.runCollectionValidators()},0);this.addSub(this._ctx.sub((0,sharedConfigKey.T)("maxLocalFileSizeBytes"),runAllValidators)),this.addSub(this._ctx.sub((0,sharedConfigKey.T)("multipleMin"),runAllValidators)),this.addSub(this._ctx.sub((0,sharedConfigKey.T)("multipleMax"),runAllValidators)),this.addSub(this._ctx.sub((0,sharedConfigKey.T)("multiple"),runAllValidators)),this.addSub(this._ctx.sub((0,sharedConfigKey.T)("imgOnly"),runAllValidators)),this.addSub(this._ctx.sub((0,sharedConfigKey.T)("accept"),runAllValidators)),this.addSub(this._ctx.sub((0,sharedConfigKey.T)("validationConcurrency"),concurrency=>{this._queue.concurrency=concurrency}))}runFileValidators(runOn,entryIds){if(!this._isDestroyed)for(let id of entryIds??this._uploadCollection.items()){let entry=this._uploadCollection.read(id);entry&&this._runFileValidatorsForEntry(entry,runOn)}}runCollectionValidators(){if(this._isDestroyed)return;let api=this._sharedInstancesBag.api,collection=api.getOutputCollectionState(),errors=[],collectionValidators=this._cfg.collectionValidators;for(let validator of[...this._commonCollectionValidators,...collectionValidators])try{let error=validator(collection,api);if(!error)continue;error&&(errors.push(this._addCustomTypeToValidationError(error)),error.message||console.warn(LOG_TEXT_MISSING_ERROR_MESSAGE))}catch(error){console.warn("Collection validator execution has failed",error)}this._ctx.pub("*collectionErrors",errors),errors.length>0&&this._sharedInstancesBag.eventEmitter.emit(EventEmitter.Bx.COMMON_UPLOAD_FAILED,()=>api.getOutputCollectionState(),{debounce:!0})}cleanupValidationForEntry(entry){let state=this._entryValidationState.get(entry.uid);state&&(state.abortController?.abort(),this._entryValidationState.delete(entry.uid))}async _runFileValidatorsForEntry(entry,runOn){if(this._isDestroyed)return;let api=this._sharedInstancesBag.api,state=this._getEntryValidationState(entry),previousPromise=state.promise??Promise.resolve(),runPromise=(async()=>{if(this._isDestroyed||(await previousPromise,this._isDestroyed))return;let entryDescriptors=this._getValidatorDescriptorsForEntry(entry,runOn);if(0===entryDescriptors.length||!this._uploadCollection.hasItem(entry.uid))return;entry.setMultipleValues({isQueuedForValidation:!0,isValidationPending:!0});let outputEntry=api.getOutputItem(entry.uid),abortController=new AbortController;state.abortController=abortController;let timeoutMs=this._cfg.validationTimeout,allDescriptors=this._getValidatorDescriptors(),entryValidatorSet=new Set(entryDescriptors.map(d=>d.validator)),errors=[];for(let descriptor of allDescriptors)if(!entryValidatorSet.has(descriptor.validator)){let error=state.lastErrorThrownByValidator.get(descriptor.validator);error&&errors.push(error)}let tasks=entryDescriptors.map(validatorDescriptor=>async()=>{if(this._isDestroyed)return;let timeoutId=setTimeout(()=>{state.skippedValidators.add(validatorDescriptor.validator),abortController.abort(),console.warn("File validator execution has timed out")},timeoutMs);try{let error=await validatorDescriptor.validator(outputEntry,api,{signal:abortController.signal});if(!error||abortController.signal.aborted)return void state.lastErrorThrownByValidator.set(validatorDescriptor.validator,void 0);let normalizedError=this._addCustomTypeToValidationError(error);state.lastErrorThrownByValidator.set(validatorDescriptor.validator,normalizedError),errors.push(normalizedError),error.message||console.warn(LOG_TEXT_MISSING_ERROR_MESSAGE)}catch(error){abortController.signal.aborted||(state.skippedValidators.add(validatorDescriptor.validator),console.warn(LOG_TEXT_FILE_VALIDATION_FAILED,error),this._sharedInstancesBag.telemetryManager.sendEventError(error,`file validator. ${LOG_TEXT_FILE_VALIDATION_FAILED}`))}finally{clearTimeout(timeoutId),"change"!==validatorDescriptor.runOn&&state.skippedValidators.add(validatorDescriptor.validator)}});(this._runQueueDebounced(),await this._queue.add(async()=>{this._isDestroyed||(entry.setValue("isQueuedForValidation",!1),await Promise.all(tasks.map(task=>task())).catch(()=>{}))},{autoRun:!1}),abortController.signal.aborted)?entry.setMultipleValues({isQueuedForValidation:!1,isValidationPending:!1}):entry.setMultipleValues({isValidationPending:!1,isQueuedForValidation:!1,errors})})();state.promise=runPromise;try{await runPromise}finally{state.promise===runPromise&&(state.promise=void 0)}}_addCustomTypeToValidationError(error){return{...error,type:error.type??"CUSTOM_ERROR"}}_getEntryValidationState(entry){let currentState=this._entryValidationState.get(entry.uid);if(currentState)return currentState;let newState={abortController:void 0,skippedValidators:new WeakSet,promise:void 0,lastErrorThrownByValidator:new WeakMap};return this._entryValidationState.set(entry.uid,newState),newState}_getValidatorDescriptors(){let fileValidators=this._cfg.fileValidators;return[...this._commonFileValidators,...fileValidators].map(getValidatorDescriptor)}_getValidatorDescriptorsForEntry(entry,runOn){let state=this._getEntryValidationState(entry);return this._getValidatorDescriptors().filter(descriptor=>!state.skippedValidators.has(descriptor.validator)).filter(descriptor=>descriptor.runOn===runOn)}destroy(){for(let state of(this._isDestroyed=!0,this._runQueueDebounced.cancel(),this._entryValidationState.values()))state.abortController?.abort(),state.promise=void 0;this._entryValidationState.clear()}}var PubSubCompat=__webpack_require__(8594),UID=__webpack_require__(5446);let MSG_NAME="[Typed State] Wrong property name: ";class TypedData{constructor(initialValue){this._ctxId=UID.V.generateFastUid(),this._data=PubSubCompat.G.registerCtx(initialValue,this._ctxId)}get uid(){return this._ctxId}setValue(prop,value){this._data.has(prop)?this._data.read(prop)!==value&&this._data.pub(prop,value):console.warn(`${MSG_NAME}${String(prop)}`)}setMultipleValues(updObj){for(let[prop,value]of Object.entries(updObj))this.setValue(prop,value)}getValue(prop){return this._data.has(prop)||console.warn(`${MSG_NAME}${String(prop)}`),this._data.read(prop)}subscribe(prop,handler){return this._data.sub(prop,handler)}destroy(){PubSubCompat.G.deleteCtx(this._ctxId)}}class TypedCollection{static{this._destroyDelayMs=1e4}constructor(options){this._subsMap=Object.create(null),this._propertyObservers=new Set,this._collectionObservers=new Set,this._items=new Set,this._removed=new Set,this._added=new Set,this._markedToDestroy=new Set,this._initialValue=options.initialValue,this._ctxId=UID.V.generateFastUid(),this._data=PubSubCompat.G.registerCtx({},this._ctxId),this._watchList=options.watchList||[];let changeMap=Object.create(null);this._notifyObservers=(propName,ctxId)=>{this._observeTimeout&&window.clearTimeout(this._observeTimeout),changeMap[propName]||(changeMap[propName]=new Set),changeMap[propName].add(ctxId),this._observeTimeout=window.setTimeout(()=>{0!==Object.keys(changeMap).length&&(this._propertyObservers.forEach(handler=>{handler({...changeMap})}),changeMap=Object.create(null))}),this._scheduleDestroyMarkedItems()},options.handler&&this.observeCollection(options.handler)}_notify(){this._notifyTimeout&&window.clearTimeout(this._notifyTimeout),this._notifyTimeout=window.setTimeout(()=>{let added=new Set(this._added),removed=new Set(this._removed);for(let handler of(this._added.clear(),this._removed.clear(),this._collectionObservers))handler?.([...this._items],added,removed);this._scheduleDestroyMarkedItems()})}_scheduleDestroyMarkedItems(){0!==this._markedToDestroy.size&&(this._destroyTimeout&&window.clearTimeout(this._destroyTimeout),this._destroyTimeout=window.setTimeout(()=>{let marked=[...this._markedToDestroy];for(let item of(this._markedToDestroy.clear(),marked))item.destroy()},TypedCollection._destroyDelayMs))}observeCollection(handler){return this._collectionObservers.add(handler),this._items.size>0&&this._notify(),()=>{this.unobserveCollection(handler)}}unobserveCollection(handler){this._collectionObservers.delete(handler)}add(init){let item=new TypedData(this._initialValue);for(let[prop,value]of Object.entries(init))item.setValue(prop,value);return this._items.add(item.uid),this._notify(),this._data.add(item.uid,item),this._added.add(item),this._watchList.forEach(propName=>{this._subsMap[item.uid]||(this._subsMap[item.uid]=[]),this._subsMap[item.uid]?.push(item.subscribe(propName,()=>{this._notifyObservers(propName,item.uid)}))}),item.uid}hasItem(id){return this._items.has(id)}read(id){return this._data.read(id)??null}readProp(id,propName){let item=this.read(id);if(!item)throw Error(`TypedCollection#readProp: Item with id ${id} not found`);return item.getValue(propName)}publishProp(id,propName,value){let item=this.read(id);if(!item)throw Error(`TypedCollection#publishProp: Item with id ${id} not found`);item.setValue(propName,value)}remove(id){let item=this.read(id);item&&(this._removed.add(item),this._markedToDestroy.add(item)),this._items.delete(id),this._notify(),this._data.pub(id,void 0),this._subsMap[id]?.forEach(sub=>{sub()}),delete this._subsMap[id]}clearAll(){this._items.forEach(id=>{this.remove(id)})}observeProperties(handler){return this._propertyObservers.add(handler),()=>{this.unobserveProperties(handler)}}unobserveProperties(handler){this._propertyObservers.delete(handler)}findItems(checkFn){let result=[];return this._items.forEach(id=>{let item=this.read(id);item&&checkFn(item)&&result.push(id)}),result}items(){return[...this._items]}get size(){return this._items.size}destroy(){for(let item of(this._observeTimeout&&window.clearTimeout(this._observeTimeout),this._notifyTimeout&&window.clearTimeout(this._notifyTimeout),this._destroyTimeout&&window.clearTimeout(this._destroyTimeout),this._markedToDestroy))item.destroy();for(let id of(this._markedToDestroy.clear(),PubSubCompat.G.deleteCtx(this._ctxId),this._propertyObservers=new Set,this._collectionObservers=new Set,Object.keys(this._subsMap)))this._subsMap[id]?.forEach(sub=>{sub()}),delete this._subsMap[id]}}var comma_separated=__webpack_require__(9101),constants=__webpack_require__(5973);let calcCameraModes=cfg=>({isVideoRecordingEnabled:(0,comma_separated.A)(cfg.cameraModes).includes(constants.S.VIDEO),isPhotoEnabled:(0,comma_separated.A)(cfg.cameraModes).includes(constants.S.PHOTO)});var activity_constants=__webpack_require__(7715);let findBlockInCtx=(blocksRegistry,callback)=>{for(let block of blocksRegistry)if(callback(block))return block};var l10n=__webpack_require__(263),applyStyles=__webpack_require__(3254),initialConfig=__webpack_require__(318);let cdnUrlRegex=RegExp(`^/?(${/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`,"i");var UploadSource=__webpack_require__(5730);let getOutputData=bag=>bag.uploadCollection.items().map(itemId=>bag.api.getOutputItem(itemId));var warnOnce=__webpack_require__(6783);class UploaderPublicApi extends shared_instances.jM{get _uploadCollection(){return this._sharedInstancesBag.uploadCollection}get cfg(){return this._cfg}get l10n(){return this._l10n}removeAllFiles(){this._uploadCollection.clearAll()}getOutputItem(entryId){let ctx=PubSubCompat.G.getCtx(entryId);if(!ctx)throw Error(`UploaderPublicApi#getOutputItem: Entry with ID "${entryId}" not found in the upload collection`);let uploadEntryData=ctx.store,fileInfo=uploadEntryData.fileInfo,status=uploadEntryData.isRemoved?"removed":uploadEntryData.errors.length>0?"failed":uploadEntryData.fileInfo?"success":uploadEntryData.isUploading?"uploading":"idle";return{uuid:fileInfo?.uuid??uploadEntryData.uuid??null,internalId:entryId,name:fileInfo?.originalFilename??uploadEntryData.fileName,size:fileInfo?.size??uploadEntryData.fileSize,isImage:fileInfo?.isImage??uploadEntryData.isImage,mimeType:fileInfo?.mimeType??uploadEntryData.mimeType,file:uploadEntryData.file,externalUrl:uploadEntryData.externalUrl,cdnUrlModifiers:uploadEntryData.cdnUrlModifiers,cdnUrl:uploadEntryData.cdnUrl??fileInfo?.cdnUrl??null,fullPath:uploadEntryData.fullPath,uploadProgress:uploadEntryData.uploadProgress,fileInfo:fileInfo??null,metadata:uploadEntryData.metadata??fileInfo?.metadata??null,isSuccess:"success"===status,isUploading:"uploading"===status,isFailed:"failed"===status,isRemoved:"removed"===status,isValidationPending:uploadEntryData.isValidationPending,errors:uploadEntryData.errors,status,source:uploadEntryData?.source}}getOutputCollectionState(){return function(bag){let isAsync,state={},ctx=bag.ctx,withAssert=(isAsync=!1,setTimeout(()=>{isAsync=!0},0),fn=>(...args)=>(isAsync&&(0,warnOnce.m)("You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`"),fn(...args)));for(let[key,value]of Object.entries({progress:()=>ctx.read("*commonProgress"),errors:()=>ctx.read("*collectionErrors"),group:()=>ctx.read("*groupInfo"),totalCount:()=>bag.uploadCollection.size,failedCount:()=>state.failedEntries.length,successCount:()=>state.successEntries.length,uploadingCount:()=>state.uploadingEntries.length,status:()=>state.isFailed?"failed":state.isUploading?"uploading":state.isSuccess?"success":"idle",isSuccess:()=>state.allEntries.length>0&&0===state.errors.length&&state.successEntries.length===state.allEntries.length,isUploading:()=>state.allEntries.some(entry=>"uploading"===entry.status),isFailed:()=>state.errors.length>0||state.failedEntries.length>0,allEntries:()=>getOutputData(bag),successEntries:()=>state.allEntries.filter(entry=>"success"===entry.status),failedEntries:()=>state.allEntries.filter(entry=>"failed"===entry.status),uploadingEntries:()=>state.allEntries.filter(entry=>"uploading"===entry.status),idleEntries:()=>state.allEntries.filter(entry=>"idle"===entry.status)}))Object.defineProperty(state,key,{get:function(fn){let cache=new Map;return(...args)=>{let key=JSON.stringify(args);if(cache.has(key))return cache.get(key);let result=fn(...args);return cache.set(key,result),result}}(withAssert(value)),enumerable:!0});return state}(this._sharedInstancesBag)}get _sourceList(){let list=[];return this.cfg.sourceList&&(list=(0,stringToArray.G)(this.cfg.sourceList)),list}constructor(...args){super(...args),this._l10n=(0,l10n.k)(()=>this._ctx),this.addFileFromUrl=(url,{silent,fileName,source}={})=>{let internalId=this._uploadCollection.add({externalUrl:url,fileName:fileName??null,silent:silent??!1,source:source??UploadSource.pc.API});return this.getOutputItem(internalId)},this.addFileFromUuid=(uuid,{silent,fileName,source}={})=>{let internalId=this._uploadCollection.add({uuid,fileName:fileName??null,silent:silent??!1,source:source??UploadSource.pc.API});return this.getOutputItem(internalId)},this.addFileFromCdnUrl=(cdnUrl,{silent,fileName,source}={})=>{let parsedCdnUrl=(({url,cdnBase})=>{let cdnBaseUrlObj=new URL(cdnBase),fallbackCdnBaseUrlObj=new URL(initialConfig.Tw),urlObj=new URL(url);if(cdnBaseUrlObj.host!==urlObj.host&&fallbackCdnBaseUrlObj.host!==urlObj.host)return null;let match=cdnUrlRegex.exec(urlObj.pathname);if(!match)return null;let[,uuid,cdnUrlModifiers,filename]=match;return uuid?{uuid,cdnUrlModifiers:cdnUrlModifiers||"",filename:filename||null}:null})({url:cdnUrl,cdnBase:this.cfg.cdnCname});if(!parsedCdnUrl)throw Error("Invalid CDN URL");let internalId=this._uploadCollection.add({uuid:parsedCdnUrl.uuid,cdnUrl,cdnUrlModifiers:parsedCdnUrl.cdnUrlModifiers,fileName:fileName??parsedCdnUrl.filename??null,silent:silent??!1,source:source??UploadSource.pc.API});return this.getOutputItem(internalId)},this.addFileFromObject=(file,{silent,fileName,source,fullPath}={})=>{let type,internalId=this._uploadCollection.add({file,isImage:!!(type=file?.type)&&matchMimeType(type,IMAGE_ACCEPT_LIST),mimeType:file.type,fileName:fileName??file.name,fileSize:file.size,silent:silent??!1,source:source??UploadSource.pc.API,fullPath:fullPath??null});return this.getOutputItem(internalId)},this.removeFileByInternalId=internalId=>{if(!this._uploadCollection.read(internalId))throw Error(`File with internalId ${internalId} not found`);this._uploadCollection.remove(internalId)},this.uploadAll=()=>{let itemsToUpload=this._uploadCollection.items().filter(id=>{let entry=this._uploadCollection.read(id);return!!entry&&!entry.getValue("isRemoved")&&!entry.getValue("isUploading")&&!entry.getValue("fileInfo")&&0===entry.getValue("errors").length&&!entry.getValue("isValidationPending")&&!entry.getValue("isQueuedForValidation")});0!==itemsToUpload.length&&(this._ctx.pub("*uploadTrigger",new Set(itemsToUpload)),this._sharedInstancesBag.eventEmitter.emit(EventEmitter.Bx.COMMON_UPLOAD_START,this.getOutputCollectionState()))},this.openSystemDialog=(options={})=>{let accept=(0,comma_separated.L)(mergeFileTypes([this.cfg.accept??"",...this.cfg.imgOnly?IMAGE_ACCEPT_LIST:[]])),INPUT_ATTR_NAME="uploadcare-file-input",fileInput=document.createElement("input");if(fileInput.setAttribute(INPUT_ATTR_NAME,""),(0,applyStyles.Z)(fileInput,{opacity:0,height:0,width:0,visibility:"hidden",position:"absolute",top:0,left:0}),fileInput.type="file",fileInput.multiple=this.cfg.multiple,options.captureCamera){fileInput.capture=this.cfg.cameraCapture;let{isPhotoEnabled,isVideoRecordingEnabled}=calcCameraModes(this.cfg);options.modeCamera===constants.S.PHOTO&&isPhotoEnabled?fileInput.accept=BASIC_IMAGE_WILDCARD:options.modeCamera===constants.S.VIDEO&&isVideoRecordingEnabled?fileInput.accept=BASIC_VIDEO_WILDCARD:fileInput.accept=[BASIC_IMAGE_WILDCARD,isVideoRecordingEnabled&&BASIC_VIDEO_WILDCARD].filter(Boolean).join(",")}else fileInput.accept=accept;fileInput.addEventListener("change",()=>{fileInput.files&&([...fileInput.files].forEach(file=>{this.addFileFromObject(file,{source:options.captureCamera?UploadSource.pc.CAMERA:UploadSource.pc.LOCAL})}),this._ctx.pub("*currentActivity",activity_constants.g.UPLOAD_LIST),this._sharedInstancesBag.modalManager?.open(activity_constants.g.UPLOAD_LIST),fileInput.remove())},{once:!0}),document.querySelectorAll(`[${INPUT_ATTR_NAME}]`).forEach(el=>{el.remove()}),document.body.appendChild(fileInput),fileInput.dispatchEvent(new MouseEvent("click"))},this.initFlow=(force=!1)=>{if(this._uploadCollection.size>0&&!force)this._ctx.pub("*currentActivity",activity_constants.g.UPLOAD_LIST),this._sharedInstancesBag.modalManager?.open(activity_constants.g.UPLOAD_LIST);else if(this._sourceList?.length===1){let srcKey=this._sourceList[0];if("local"===srcKey){this._ctx.pub("*currentActivity",activity_constants.g.UPLOAD_LIST),this.openSystemDialog();return}if("camera"===srcKey&&browser_info.wN.htmlMediaCapture){let{isPhotoEnabled,isVideoRecordingEnabled}=calcCameraModes(this.cfg);if(isPhotoEnabled&&isVideoRecordingEnabled)return void this._ctx.pub("*currentActivity",activity_constants.g.START_FROM);if(isPhotoEnabled||isVideoRecordingEnabled)return void this.openSystemDialog({captureCamera:!0,modeCamera:isPhotoEnabled?constants.S.PHOTO:constants.S.VIDEO});this.openSystemDialog({captureCamera:!0,modeCamera:constants.S.PHOTO})}setTimeout(()=>{if(srcKey!==this._sourceList[0])return;let sourceBtnBlock=findBlockInCtx(this._sharedInstancesBag.blocksRegistry,block=>"type"in block&&block.type===srcKey);sourceBtnBlock?.activate()},0),this._ctx.read("*currentActivity")&&this._sharedInstancesBag.modalManager?.open(this._ctx.read("*currentActivity"))}else this._ctx.pub("*currentActivity",activity_constants.g.START_FROM),this._sharedInstancesBag.modalManager?.open(activity_constants.g.START_FROM)},this.doneFlow=()=>{let activityBlock=findBlockInCtx(this._sharedInstancesBag.blocksRegistry,b=>"doneActivity"in b);activityBlock&&(this._ctx.pub("*currentActivity",activityBlock.doneActivity),this._ctx.pub("*history",activityBlock.doneActivity?[activityBlock.doneActivity]:[]),this._ctx.read("*currentActivity")||this._sharedInstancesBag.modalManager?.closeAll())},this.setCurrentActivity=(activityType,...params)=>{setTimeout(()=>{if(((blocksRegistry,callback)=>{for(let block of blocksRegistry)if(callback(block))return!0;return!1})(this._sharedInstancesBag.blocksRegistry,b=>b.activityType===activityType)){this._ctx.pub("*currentActivityParams",params[0]??{}),this._ctx.pub("*currentActivity",activityType);return}console.warn(`Activity type "${activityType}" not found in the context`)})},this.getCurrentActivity=()=>this._ctx.read("*currentActivity"),this.setModalState=opened=>{setTimeout(()=>{opened&&!this._ctx.read("*currentActivity")?console.warn('Can\'t open modal without current activity. Please use "setCurrentActivity" method first.'):opened?this._sharedInstancesBag.modalManager?.open(this._ctx.read("*currentActivity")):(this._sharedInstancesBag.modalManager?.close(this._ctx.read("*currentActivity")),this._ctx.pub("*currentActivity",null))})}}}let initialUploadEntryData={file:null,externalUrl:null,fileName:null,fileSize:null,lastModified:Date.now(),uploadProgress:0,uuid:null,isImage:!1,mimeType:null,ctxName:null,cdnUrl:null,cdnUrlModifiers:null,fileInfo:null,isUploading:!1,abortController:null,thumbUrl:null,silent:!1,source:null,fullPath:null,metadata:null,errors:[],uploadError:null,isRemoved:!1,isQueuedForUploading:!1,isValidationPending:!1,isQueuedForValidation:!1};var crop_utils=__webpack_require__(8996),parseCropPreset=__webpack_require__(5342),cdn_utils=__webpack_require__(6339),env=__webpack_require__(5704);function customUserAgent(options){return(0,upload_client_.getUserAgent)({...options,libraryName:env.r,libraryVersion:env.i})}var LitActivityBlock=__webpack_require__(5923);class LitUploaderBlock extends LitActivityBlock.S{get _hasCtxOwner(){return this.hasBlockInCtx(block=>block instanceof LitUploaderBlock&&block._isCtxOwner&&block.isConnected&&block!==this)}initCallback(){super.initCallback(),this._addSharedContextInstance("*uploadCollection",()=>new TypedCollection({initialValue:initialUploadEntryData,watchList:["uploadProgress","uploadError","fileInfo","errors","cdnUrl","isUploading","isValidationPending"]})),this._addSharedContextInstance("*secureUploadsManager",sharedInstancesBag=>new SecureUploadsManager(sharedInstancesBag)),this._addSharedContextInstance("*validationManager",sharedInstancesBag=>new ValidationManager(sharedInstancesBag)),this._addSharedContextInstance("*publicApi",sharedInstancesBag=>new UploaderPublicApi(sharedInstancesBag)),!this._hasCtxOwner&&this.couldBeCtxOwner&&this._initCtxOwner()}getAPI(){return this.api}get validationManager(){return this._getSharedContextInstance("*validationManager")}get api(){return this._getSharedContextInstance("*publicApi")}get uploadCollection(){return this._getSharedContextInstance("*uploadCollection")}get secureUploadsManager(){return this._getSharedContextInstance("*secureUploadsManager")}disconnectedCallback(){super.disconnectedCallback(),this._isCtxOwner&&this._unobserveUploadCollection(),this._flushOutputItems.cancel()}connectedCallback(){super.connectedCallback(),this._isCtxOwner&&this._observeUploadCollection()}_initCtxOwner(){this._isCtxOwner=!0,this._observeUploadCollection(),this.subConfigValue("maxConcurrentRequests",value=>{this.$["*uploadQueue"].concurrency=Number(value)||1})}_observeUploadCollection(){this._unobserveUploadCollection(),this._unobserveCollection=this.uploadCollection.observeCollection(this._handleCollectionUpdate),this._unobserveCollectionProperties=this.uploadCollection.observeProperties(this._handleCollectionPropertiesUpdate)}_unobserveUploadCollection(){this._unobserveCollectionProperties?.(),this._unobserveCollection?.(),this._unobserveCollectionProperties=void 0,this._unobserveCollection=void 0}async _createGroup(collectionState){let uploadClientOptions=await this.getUploadClientOptions(),uuidList=collectionState.allEntries.map(entry=>entry.uuid+(entry.cdnUrlModifiers?`/${entry.cdnUrlModifiers}`:"")),abortController=new AbortController,resp=await (0,upload_client_.uploadFileGroup)(uuidList,{...uploadClientOptions,signal:abortController.signal});if(this.$["*collectionState"]!==collectionState)return void abortController.abort();this.$["*groupInfo"]=resp;let collectionStateWithGroup=this.api.getOutputCollectionState();this.emit(EventEmitter.Bx.GROUP_CREATED,collectionStateWithGroup),this.emit(EventEmitter.Bx.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.$["*collectionState"]=collectionStateWithGroup}_openCloudImageEditor(){let[entry]=this.uploadCollection.findItems(entry=>!!entry.getValue("fileInfo")&&entry.getValue("isImage")).map(id=>this.uploadCollection.read(id));entry&&1===this.uploadCollection.size&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(block=>block.activityType===LitActivityBlock.S.activities.CLOUD_IMG_EDIT)&&(this.$["*currentActivityParams"]={internalId:entry.uid},this.$["*currentActivity"]=LitActivityBlock.S.activities.CLOUD_IMG_EDIT,this.modalManager?.open(LitActivityBlock.S.activities.CLOUD_IMG_EDIT))}_setInitialCrop(){let cropPreset=(0,parseCropPreset.j)(this.cfg.cropPreset);if(cropPreset){let[aspectRatioPreset]=cropPreset;for(let entry of this.uploadCollection.findItems(entry=>!!entry.getValue("fileInfo")&&entry.getValue("isImage")&&!entry.getValue("cdnUrlModifiers")?.includes("/crop/")).map(id=>this.uploadCollection.read(id)).filter(Boolean)){let fileInfo=entry.getValue("fileInfo");if(!fileInfo||!fileInfo.imageInfo){console.warn("Failed to get image info for entry",entry.uid);continue}let{width,height}=fileInfo.imageInfo,expectedAspectRatio="number"==typeof aspectRatioPreset?.width&&"number"==typeof aspectRatioPreset?.height&&aspectRatioPreset.width>0&&aspectRatioPreset.height>0?aspectRatioPreset.width/aspectRatioPreset.height:1,crop=(0,crop_utils.u3)(width,height,expectedAspectRatio),cdnUrlModifiers=(0,cdn_utils.$z)(`crop/${crop.width}x${crop.height}/${crop.x},${crop.y}`,"preview"),cdnUrl=entry.getValue("cdnUrl");if(!cdnUrl){console.warn("Failed to get cdnUrl for entry",entry.uid);continue}entry.setMultipleValues({cdnUrlModifiers,cdnUrl:(0,cdn_utils.LN)(cdnUrl,cdnUrlModifiers)}),1===this.uploadCollection.size&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(block=>block.activityType===LitActivityBlock.S.activities.CLOUD_IMG_EDIT)&&(this.$["*currentActivityParams"]={internalId:entry.uid},this.$["*currentActivity"]=LitActivityBlock.S.activities.CLOUD_IMG_EDIT,this.modalManager?.open(LitActivityBlock.S.activities.CLOUD_IMG_EDIT))}}}async getMetadataFor(entryId){let configValue=this.cfg.metadata||void 0;if("function"==typeof configValue){let outputFileEntry=this.api.getOutputItem(entryId);return await configValue(outputFileEntry)}return configValue}async getUploadClientOptions(){let secureToken=await this.secureUploadsManager.getSecureToken().catch(()=>null);return{store:this.cfg.store,publicKey:this.cfg.pubkey,baseCDN:this.cfg.cdnCname,baseURL:this.cfg.baseUrl,userAgent:customUserAgent,integration:this.cfg.userAgentIntegration,secureSignature:secureToken?.secureSignature,secureExpire:secureToken?.secureExpire,retryThrottledRequestMaxTimes:this.cfg.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:this.cfg.retryNetworkErrorMaxTimes,multipartMinFileSize:this.cfg.multipartMinFileSize,multipartChunkSize:this.cfg.multipartChunkSize,maxConcurrentRequests:this.cfg.multipartMaxConcurrentRequests,multipartMaxAttempts:this.cfg.multipartMaxAttempts,checkForUrlDuplicates:!!this.cfg.checkForUrlDuplicates,saveUrlForRecurrentUploads:!!this.cfg.saveUrlForRecurrentUploads}}getOutputData(){return getOutputData(this._sharedInstancesBag)}constructor(...args){super(...args),this.couldBeCtxOwner=!1,this._isCtxOwner=!1,this.init$=(0,CTX.lu)(this),this._flushOutputItems=(0,debounce.s)(async()=>{if(this.getOutputData().length!==this.uploadCollection.size)return;let collectionState=this.api.getOutputCollectionState();this.$["*collectionState"]=collectionState,this.emit(EventEmitter.Bx.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.cfg.groupOutput&&collectionState.totalCount>0&&"success"===collectionState.status&&this._createGroup(collectionState)},300),this._handleCollectionUpdate=(entries,added,removed)=>{if(this.isConnected){for(let entry of((added.size||removed.size)&&(this.$["*groupInfo"]=null),this.validationManager.runFileValidators("add",[...added].map(e=>e.uid)),added))entry.getValue("silent")||this.emit(EventEmitter.Bx.FILE_ADDED,this.api.getOutputItem(entry.uid));for(let entry of(this.validationManager.runCollectionValidators(),removed)){this.$["*uploadTrigger"].delete(entry.uid),this.validationManager.cleanupValidationForEntry(entry),entry.getValue("abortController")?.abort(),entry.setMultipleValues({isRemoved:!0,abortController:null,isUploading:!1,uploadProgress:0});let thumbUrl=entry?.getValue("thumbUrl");thumbUrl&&URL.revokeObjectURL(thumbUrl),this.emit(EventEmitter.Bx.FILE_REMOVED,this.api.getOutputItem(entry.uid))}this.$["*uploadList"]=entries.map(uid=>({uid})),this._flushCommonUploadProgress(),this._flushOutputItems()}},this._handleCollectionPropertiesUpdate=changeMap=>{if(!this.isConnected)return;this._flushOutputItems();let uploadCollection=this.uploadCollection,entriesToRunValidation=[...new Set(Object.entries(changeMap).filter(([key])=>["uploadError","fileInfo","cdnUrl","cdnUrlModifiers"].includes(key)).flatMap(([,ids])=>[...ids]))];if(entriesToRunValidation.length>0&&setTimeout(()=>{if(!this.isConnected)return;let entriesToRunOnUpload=entriesToRunValidation.filter(entryId=>changeMap.fileInfo?.has(entryId)&&!!PubSubCompat.G.getCtx(entryId)?.store.fileInfo);entriesToRunOnUpload.length>0&&this.validationManager.runFileValidators("upload",entriesToRunOnUpload),this.validationManager.runFileValidators("change",entriesToRunValidation)}),changeMap.uploadProgress){for(let entryId of changeMap.uploadProgress){let ctx=PubSubCompat.G.getCtx(entryId);if(!ctx)continue;let{isUploading,silent}=ctx.store;isUploading&&!silent&&this.emit(EventEmitter.Bx.FILE_UPLOAD_PROGRESS,this.api.getOutputItem(entryId))}this._flushCommonUploadProgress()}if(changeMap.isUploading)for(let entryId of changeMap.isUploading){let ctx=PubSubCompat.G.getCtx(entryId);if(!ctx)continue;let{isUploading,silent}=ctx.store;isUploading&&!silent&&this.emit(EventEmitter.Bx.FILE_UPLOAD_START,this.api.getOutputItem(entryId))}if(changeMap.fileInfo){for(let entryId of changeMap.fileInfo){let ctx=PubSubCompat.G.getCtx(entryId);if(!ctx)continue;let{fileInfo,silent}=ctx.store;fileInfo&&!silent&&this.emit(EventEmitter.Bx.FILE_UPLOAD_SUCCESS,this.api.getOutputItem(entryId))}this.cfg.cropPreset&&this._setInitialCrop(),this.cfg.cloudImageEditorAutoOpen&&this._openCloudImageEditor()}if(changeMap.errors){for(let entryId of(this.validationManager.runCollectionValidators(),changeMap.errors)){let ctx=PubSubCompat.G.getCtx(entryId);if(!ctx)continue;let{errors}=ctx.store;errors.length>0&&(this.emit(EventEmitter.Bx.FILE_UPLOAD_FAILED,this.api.getOutputItem(entryId)),this.emit(EventEmitter.Bx.COMMON_UPLOAD_FAILED,()=>this.api.getOutputCollectionState(),{debounce:!0}))}let loadedItems=uploadCollection.findItems(entry=>!!entry.getValue("fileInfo")),errorItems=uploadCollection.findItems(entry=>entry.getValue("errors").length>0);uploadCollection.size>0&&0===errorItems.length&&uploadCollection.size===loadedItems.length&&0===this.$["*collectionErrors"].length&&this.emit(EventEmitter.Bx.COMMON_UPLOAD_SUCCESS,this.api.getOutputCollectionState())}changeMap.cdnUrl&&([...changeMap.cdnUrl].filter(uid=>!!this.uploadCollection.read(uid)?.getValue("cdnUrl")).forEach(uid=>{this.emit(EventEmitter.Bx.FILE_URL_CHANGED,this.api.getOutputItem(uid))}),this.$["*groupInfo"]=null)},this._flushCommonUploadProgress=()=>{let commonProgress=0,items=[...this.$["*uploadTrigger"]].filter(id=>!!this.uploadCollection.read(id));items.forEach(id=>{let uploadProgress=this.uploadCollection.readProp(id,"uploadProgress");"number"==typeof uploadProgress&&(commonProgress+=uploadProgress)});let progress=items.length?Math.round(commonProgress/items.length):0;this.$["*commonProgress"]!==progress&&(this.$["*commonProgress"]=progress,this.emit(EventEmitter.Bx.COMMON_UPLOAD_PROGRESS,this.api.getOutputCollectionState()))}}}LitUploaderBlock.extSrcList=Object.freeze({...UploadSource.y5}),LitUploaderBlock.sourceTypes=Object.freeze({...UploadSource.pc})},8594(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{G:()=>PubSub});class PubSub{static{this._contexts=new Map}constructor(_ctxId,store){this._ctxId=_ctxId,this._store=store}get id(){return this._ctxId}pub(key,value){key in this._store.get()||console.warn(`PubSub#pub: Key "${String(key)}" not found`),this._store.setKey(key,value)}sub(key,callback,init=!0){return(init?__rspack_external_nanostores.subscribeKeys:__rspack_external_nanostores.listenKeys)(this._store,[key],values=>{callback(values[key])})}read(key){return key in this._store.get()||console.warn(`PubSub#read: Key "${String(key)}" not found`),this._store.get()[key]}add(key,value,rewrite=!1){key in this._store.get()&&!rewrite||this._store.setKey(key,value)}has(key){return key in this._store.get()}get store(){return this._store.get()}static registerCtx(initialValue,ctxId){if(PubSub._contexts.has(ctxId))throw Error(`PubSub: Context with id "${ctxId}" already exists`);let store=(0,__rspack_external_nanostores.map)(initialValue);return PubSub._contexts.set(ctxId,store),new PubSub(ctxId,store)}static deleteCtx(ctxId){PubSub._contexts.delete(ctxId)}static getCtx(ctxId){let store=PubSub._contexts.get(ctxId);return store?new PubSub(ctxId,store):null}static hasCtx(ctxId){return PubSub._contexts.has(ctxId)}}},3282(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{d:()=>RegisterableElementMixin});function RegisterableElementMixin(ctor){return class extends ctor{static reg(tagName){let registeredClass=window.customElements.get(tagName);if(registeredClass){registeredClass!==this&&console.warn(`Element with tag name "${tagName}" already registered.
5
+ You're trying to override it with another class "${this.name}".
6
+ This is most likely a mistake.
7
+ New element will not be registered.`);return}window.customElements.define(tagName,this)}}}},9280(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{w:()=>SymbioteMixin});var decorators_js_=__webpack_require__(8899),debounce=__webpack_require__(4441),PubSubCompat=__webpack_require__(8594);function _ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}let ctxNameContext=(0,__rspack_external__lit_context_417c9377.createContext)("ctx-name-context");function SymbioteMixin(){return function(ctor){class SymbioteMixinClass extends ctor{static set template(_value){console.error("Caution: static 'template' property is deprecated and has no effect. See https://github.com/uploadcare/file-uploader/releases/tag/v1.25.0 for details.")}get _ctxNameAttr(){return this._ctxNameAttrValue}set _ctxNameAttr(value){let normalizedValue=value??void 0;this._ctxNameAttrValue!==normalizedValue&&(this._ctxNameAttrValue=normalizedValue,this._handleCtxNameSourceChange())}shouldUpdate(changedProperties){return!!this._isInitialized&&super.shouldUpdate(changedProperties)}constructor(...args){super(...args),this._symbioteSharedPubSub=null,this._symbioteFirstUpdated=!1,this._needsReconnectInit=!1,this._ctxNameProvider=void 0,this._pendingSharedAdds=new Map,this._symbioteSubscriptions=new Set,this.init$={},this.ctxOwner=!1,this._ctxNameAttrValue=void 0,this._pendingCtxInitOnConnect=!1,this.ctxName=this._effectiveCtxName,this._isInitialized=!1,this._ctxNameAttrValue=this.getAttribute("ctx-name")||void 0,this.ctxName=this._effectiveCtxName,this._ctxNameConsumer=new __rspack_external__lit_context_417c9377.ContextConsumer(this,{context:ctxNameContext,callback:value=>{value?(this._ctxNameFromContext=value,this._handleCtxNameSourceChange()):console.error("SymbioteMixin: Received invalid ctx-name from context")},subscribe:!0})}get _effectiveCtxName(){return this._ctxNameAttr||this._ctxNameFromContext||void 0}_handleCtxNameSourceChange(){if(this.ctxName=this._effectiveCtxName,this.ctxName&&!this._symbioteFirstUpdated){if(this.isConnected)return void this._performInitialization();this._pendingCtxInitOnConnect=!0}}willUpdate(changedProperties){super.willUpdate(changedProperties),this.ctxName=this._effectiveCtxName,this.ctxName&&(this._ctxNameProvider?this._ctxNameProvider.setValue(this.ctxName):this._ctxNameProvider=new __rspack_external__lit_context_417c9377.ContextProvider(this,{context:ctxNameContext,initialValue:this.ctxName}))}_applyPendingSharedAdds(){if(this._symbioteSharedPubSub&&0!==this._pendingSharedAdds.size){for(let[key,{value,rewrite}]of this._pendingSharedAdds)this._symbioteSharedPubSub.add(key,value,rewrite);this._pendingSharedAdds.clear()}}_getSharedPubSub(){return!this._symbioteSharedPubSub&&this._effectiveCtxName&&this._initSharedContext(),this._symbioteSharedPubSub&&this._applyPendingSharedAdds(),this._symbioteSharedPubSub}_requireSharedPubSub(){let pubsub=this._getSharedPubSub();if(!pubsub)throw Error("SymbioteMixin: Shared context is not initialized.");return pubsub}_initSharedContext(){let initialValue=this.init$,ctxName=this._effectiveCtxName;if(!ctxName)return void console.error("SymbioteMixin: ctx-name is required for components with shared properties (*)");if(!this._symbioteSharedPubSub){for(let[key,defaultValue]of(this._symbioteSharedPubSub=PubSubCompat.G.getCtx(ctxName)??PubSubCompat.G.registerCtx(initialValue,ctxName),Object.entries(this.init$)))this._symbioteSharedPubSub.add(key,defaultValue,this.ctxOwner);this._applyPendingSharedAdds()}}get $(){return this._effectiveCtxName&&this._initSharedContext(),new Proxy({},{get:(_target,key)=>{if("string"==typeof key)return this._symbioteSharedPubSub?.read(key)},set:(_target,key,value)=>"string"!=typeof key||(this._symbioteSharedPubSub?.pub(key,value),!0)})}sub(key,callback,init=!0){let subscription=this._requireSharedPubSub().sub(key,callback,init);if(!subscription||"function"!=typeof subscription)return()=>{};let removeFn=subscription.bind(subscription),removed=!1,trackedRemove=()=>{removed||(removed=!0,removeFn(),this._symbioteSubscriptions.delete(trackedRemove))};return this._symbioteSubscriptions.add(trackedRemove),trackedRemove}pub(key,value){this._requireSharedPubSub().pub(key,value)}set$(obj){for(let[prop,value]of Object.entries(obj))this.pub(prop,value)}get sharedCtx(){return this._requireSharedPubSub()}has(key){return this._symbioteSharedPubSub?.has(key)??!1}add(key,val,rewrite=!1){let pubsub=this._getSharedPubSub();if(!pubsub){if(!rewrite&&this._pendingSharedAdds.has(key))return;this._pendingSharedAdds.set(key,{value:val,rewrite});return}this._pendingSharedAdds.delete(key),pubsub.add(key,val,rewrite)}add$(obj,rewrite=!1){for(let[prop,value]of Object.entries(obj))this.add(prop,value,rewrite)}connectedCallback(){super.connectedCallback(),this._symbioteFirstUpdated?this._isInitialized&&this._needsReconnectInit&&(this._needsReconnectInit=!1,this.initCallback()):this.ctxName?(this._pendingCtxInitOnConnect=!1,this._performInitialization()):this._pendingCtxInitOnConnect&&this._effectiveCtxName&&(this._pendingCtxInitOnConnect=!1,this._performInitialization())}_performInitialization(){if(this._symbioteFirstUpdated)return;this._symbioteFirstUpdated=!0,this._initSharedContext();let sharedSchema=this.init$;if(Object.keys(sharedSchema).length>0){let pubsub=this._requireSharedPubSub();for(let[key,defaultValue]of Object.entries(sharedSchema))void 0===pubsub.read(key)&&pubsub.pub(key,defaultValue),this.sub(key,(0,debounce.s)(async()=>{this.isConnected&&(await this.updateComplete,this.requestUpdate())},0),!1)}this.initCallback(),this._isInitialized=!0,this.requestUpdate()}firstUpdated(changedProperties){super.firstUpdated(changedProperties)}disconnectedCallback(){this._cleanupSymbioteSubscriptions(),super.disconnectedCallback(),this._symbioteFirstUpdated&&(this._needsReconnectInit=!0)}_cleanupSymbioteSubscriptions(){if(0!==this._symbioteSubscriptions.size){for(let unsubscribe of[...this._symbioteSubscriptions])unsubscribe();this._symbioteSubscriptions.clear()}}initCallback(){}}return _ts_decorate([(0,decorators_js_.property)({type:String,attribute:"ctx-name",noAccessor:!0})],SymbioteMixinClass.prototype,"_ctxNameAttr",null),_ts_decorate([(0,decorators_js_.state)()],SymbioteMixinClass.prototype,"_ctxNameFromContext",void 0),_ts_decorate([(0,decorators_js_.state)()],SymbioteMixinClass.prototype,"ctxName",void 0),_ts_decorate([(0,decorators_js_.state)()],SymbioteMixinClass.prototype,"_isInitialized",void 0),SymbioteMixinClass}}},7715(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{g:()=>ACTIVITY_TYPES});let ACTIVITY_TYPES=Object.freeze({START_FROM:"start-from",CAMERA:"camera",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external"})},255(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{W:()=>createDebugPrinter});var _abstract_sharedConfigKey__rspack_import_0=__webpack_require__(1971);let createDebugPrinter=(getCtx,scope)=>(...args)=>{let ctx=getCtx();if(!ctx.read((0,_abstract_sharedConfigKey__rspack_import_0.T)("debug")))return;let consoleArgs=args;"function"==typeof args?.[0]&&(consoleArgs=(0,args[0])());let prefixes=[ctx.id,scope].filter(Boolean);console.log(`[${prefixes.join("][")}]`,...consoleArgs)}},263(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{k:()=>createL10n});var _abstract_managers_LocaleManager__rspack_import_1=__webpack_require__(7959),_utils_getPluralForm__rspack_import_0=__webpack_require__(9364),_utils_template_utils__rspack_import_2=__webpack_require__(664);let createL10n=getCtx=>{let getL10n,pluralizer=(getL10n=()=>l10n,(key,count)=>{let l10n=getL10n(),locale=l10n("locale-id")||"en",pluralForm=(0,_utils_getPluralForm__rspack_import_0.Z)(locale,count);return l10n(`${key}__${pluralForm}`)}),l10n=(str,variables={})=>{if(!str)return"";let template=getCtx().read((0,_abstract_managers_LocaleManager__rspack_import_1.PI)(str))||str;for(let pluralObject of(0,_utils_template_utils__rspack_import_2.Q)(template))variables[pluralObject.variable]=pluralizer(pluralObject.pluralKey,Number(variables[pluralObject.countVariable]));return(0,_utils_template_utils__rspack_import_2.x)(template,variables)};return l10n}},5890(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{EC:()=>createSharedInstancesBag,jM:()=>SharedInstance});var _abstract_sharedConfigKey__rspack_import_1=__webpack_require__(1971),_blocks_Config_initialConfig__rspack_import_2=__webpack_require__(318),_createDebugPrinter__rspack_import_0=__webpack_require__(255);class SharedInstance{constructor(sharedInstancesBag){this._subscriptions=new Set,this._cfgProxy=null,this._debugPrint=(0,_createDebugPrinter__rspack_import_0.W)(()=>this._sharedInstancesBag.ctx,this.constructor.name),this._sharedInstancesBag=sharedInstancesBag,this._ctx=sharedInstancesBag.ctx}addSub(unsub){this._subscriptions.add(unsub)}get _cfg(){return this._cfgProxy||(this._cfgProxy=new Proxy({},{set:()=>{throw Error("SharedInstance cfg proxy is read-only")},get:(_obj,key)=>{if("string"!=typeof key)return;let sharedKey=(0,_abstract_sharedConfigKey__rspack_import_1.T)(key);return this._sharedInstancesBag.ctx.has(sharedKey)?this._sharedInstancesBag.ctx.read(sharedKey):_blocks_Config_initialConfig__rspack_import_2.Dz[key]}})),this._cfgProxy}destroy(){for(let unsub of this._subscriptions)try{unsub()}catch{}this._subscriptions.clear()}}let instanceKeyMap={modalManager:"*modalManager",pluginManager:"*pluginManager",telemetryManager:"*telemetryManager",localeManager:"*localeManager",a11y:"*a11y",clipboard:"*clipboard",blocksRegistry:"*blocksRegistry",eventEmitter:"*eventEmitter",uploadCollection:"*uploadCollection",secureUploadsManager:"*secureUploadsManager",api:"*publicApi",validationManager:"*validationManager"},getSharedInstance=(ctx,key,isRequired=!0)=>{let hasKey=ctx.has(key),value=hasKey?ctx.read(key):null;if(hasKey&&value||!isRequired)return value;throw Error(`Unexpected error: shared instance for key "${String(key)}" is not available`)},createSharedInstancesBag=getCtx=>({get ctx(){return getCtx()},get modalManager(){return getSharedInstance(getCtx(),"*modalManager",!1)},get pluginManager(){return getSharedInstance(getCtx(),"*pluginManager")},get telemetryManager(){return getSharedInstance(getCtx(),"*telemetryManager")},get localeManager(){return getSharedInstance(getCtx(),"*localeManager")},get a11y(){return getSharedInstance(getCtx(),"*a11y")},get blocksRegistry(){return getSharedInstance(getCtx(),"*blocksRegistry")},get eventEmitter(){return getSharedInstance(getCtx(),"*eventEmitter")},get uploadCollection(){return getSharedInstance(getCtx(),"*uploadCollection")},get secureUploadsManager(){return getSharedInstance(getCtx(),"*secureUploadsManager",!1)},get api(){return getSharedInstance(getCtx(),"*publicApi")},get validationManager(){return getSharedInstance(getCtx(),"*validationManager")},when(name,callback){let stateKey=instanceKeyMap[name],ctx=getCtx(),existingInstance=ctx.has(stateKey)?ctx.read(stateKey):void 0;if(existingInstance)return callback(existingInstance),()=>{};let unsub=ctx.sub(stateKey,instance=>{instance&&(callback(instance),unsub())});return unsub}})},1491(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>__rspack_default_export});let __rspack_default_export={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"{{count}} of {{total}} selected","select-all":"Select all","deselect-all":"Deselect all","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-mobile-video-camera":"Video","src-type-mobile-photo-camera":"Photo","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-ngdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"OneDrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You’ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You’ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error occurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit","file-item-remove-button":"Remove","a11y-editor-tab-filters":"Filters","a11y-editor-tab-tuning":"Tuning","a11y-editor-tab-crop":"Crop","a11y-activity-header-button-close":"Close",flip:"Flip",mirror:"Mirror","a11y-cloud-editor-apply-filter":"Apply {{name}} filter","a11y-cloud-editor-apply-crop":"Apply {{name}} operation","a11y-cloud-editor-apply-tuning":"Apply {{name}} tuning","a11y-cloud-editor-apply-aspect-ratio":"Apply operation {{name}} {{value}}",finished:"Finished",failed:"Failed",uploading:"Uploading",idle:"Idle","a11y-file-item-status":"File {{fileName}} in status {{status}}","waiting-for":"Waiting for {{source}}","queued-uploading":"Queued for upload","queued-validation":"Queued for validation",validation:"Validating","crop-to-shape":"Crop to {{value}}",custom:"Freeform","freeform-crop":"Freeform crop"}},5446(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{V:()=>UID});class UID{static generateFastUid(){return`uid-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}static generateRandomUUID(){let cryptoObj=globalThis.crypto;return cryptoObj&&"function"==typeof cryptoObj.randomUUID?cryptoObj.randomUUID():UID.generateFastUid()}}},5730(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{pc:()=>UploadSource,y5:()=>ExternalUploadSource});let ExternalUploadSource=Object.freeze({FACEBOOK:"facebook",DROPBOX:"dropbox",GDRIVE:"gdrive",GPHOTOS:"gphotos",FLICKR:"flickr",VK:"vk",EVERNOTE:"evernote",BOX:"box",ONEDRIVE:"onedrive",HUDDLE:"huddle"}),UploadSource=Object.freeze({LOCAL:"local",DROP_AREA:"drop-area",CAMERA:"camera",EXTERNAL:"external",API:"js-api",URL:"url",...Object.freeze({MOBILE_VIDEO_CAMERA:"mobile-video-camera",MOBILE_PHOTO_CAMERA:"mobile-photo-camera"}),...ExternalUploadSource})},3254(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Z:()=>applyStyles});function applyStyles(el,styleMap){for(let prop in styleMap)prop.includes("-")?el.style.setProperty(prop,String(styleMap[prop])):el.style[prop]=String(styleMap[prop])}},1633(__unused_rspack_module,__webpack_exports__,__webpack_require__){let ua;__webpack_require__.d(__webpack_exports__,{R5:()=>browserInfo,wN:()=>browserFeatures});let browserInfo={safariDesktop:(ua=navigator.userAgent,/Macintosh|Windows/.test(ua)&&/Version\/[\d.]+.*Safari/.test(ua)&&!/Chrome|Chromium|Edg|OPR/.test(ua))},browserFeatures={htmlMediaCapture:"capture"in document.createElement("input")}},6339(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{$z:()=>createCdnUrlModifiers,I1:()=>extractOperations,LN:()=>createCdnUrl,OB:()=>joinCdnOperations,_A:()=>extractCdnUrlModifiers,p_:()=>extractUuid,v6:()=>extractFilename,vo:()=>createOriginalUrl});let normalizeCdnOperation=operation=>{if("string"!=typeof operation||!operation)return"";let str=operation.trim();return str.startsWith("-/")?str=str.slice(2):str.startsWith("/")&&(str=str.slice(1)),str.endsWith("/")&&(str=str.slice(0,str.length-1)),str},joinCdnOperations=(...operations)=>operations.filter(op=>"string"==typeof op&&!!op).map(op=>normalizeCdnOperation(op)).join("/-/"),createCdnUrlModifiers=(...cdnOperations)=>{let joined=joinCdnOperations(...cdnOperations);return joined?`-/${joined}/`:""};function extractFilename(cdnUrl){let url=new URL(cdnUrl),noOrigin=url.pathname+url.search+url.hash,urlFilenameIdx=noOrigin.lastIndexOf("http"),plainFilenameIdx=noOrigin.lastIndexOf("/"),filename="";return urlFilenameIdx>=0?filename=noOrigin.slice(urlFilenameIdx):plainFilenameIdx>=0&&(filename=noOrigin.slice(plainFilenameIdx+1)),filename}function extractUuid(cdnUrl){let{pathname}=new URL(cdnUrl),slashIndex=pathname.indexOf("/"),secondSlashIndex=pathname.indexOf("/",slashIndex+1);return pathname.substring(slashIndex+1,secondSlashIndex)}function extractCdnUrlModifiers(cdnUrl){let url=new URL(trimFilename(cdnUrl)),operationsMarker=url.pathname.indexOf("/-/");return -1===operationsMarker?"":url.pathname.substring(operationsMarker).slice(1)}function extractOperations(cdnUrl){return extractCdnUrlModifiers(cdnUrl).split("/-/").filter(Boolean).map(operation=>normalizeCdnOperation(operation))}function trimFilename(cdnUrl){let url=new URL(cdnUrl),filename=extractFilename(cdnUrl),filenamePathPart=isFileUrl(filename)?splitFileUrl(filename).pathname:filename;return url.pathname=url.pathname.replace(filenamePathPart,""),url.search="",url.hash="",url.toString()}function isFileUrl(filename){return filename.startsWith("http")}function splitFileUrl(fileUrl){let url=new URL(fileUrl);return{pathname:`${url.origin}${url.pathname??""}`,search:url.search??"",hash:url.hash??""}}let createCdnUrl=(baseCdnUrl,cdnModifiers,filename)=>{let url=new URL(trimFilename(baseCdnUrl)),resolvedFilename=filename??extractFilename(baseCdnUrl),resolvedModifiers=cdnModifiers??"";if(url.pathname.startsWith("//")&&(url.pathname=url.pathname.replace("//","/")),resolvedFilename&&isFileUrl(resolvedFilename)){let splitted=splitFileUrl(resolvedFilename);url.pathname=`${url.pathname}${resolvedModifiers}${splitted.pathname||""}`,url.search=splitted.search,url.hash=splitted.hash}else url.pathname=`${url.pathname}${resolvedModifiers}${resolvedFilename||""}`;return url.toString()},createOriginalUrl=(cdnUrl,uuid)=>{let url=new URL(cdnUrl);return url.pathname=`${uuid}/`,url.toString()}},9101(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>deserializeCsv,L:()=>serializeCsv});let deserializeCsv=value=>value?value.split(",").map(item=>item.trim()).filter(Boolean):[],serializeCsv=value=>value.join(",")},4441(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{s:()=>debounce});function debounce(callback,wait){let timer,debounced=(...args)=>{timer&&clearTimeout(timer),timer=setTimeout(()=>callback(...args),wait)};return debounced.cancel=()=>{timer&&clearTimeout(timer)},debounced}},9364(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Z:()=>getPluralForm});let getPluralForm=(locale,count)=>new Intl.PluralRules(locale).select(count)},6756(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{N:()=>preloadImage,e:()=>batchPreloadImages});var _transparentPixelSrc__rspack_import_0=__webpack_require__(8608);function preloadImage(src){let image=new Image;return{promise:new Promise((resolve,reject)=>{image.src=src,image.onload=()=>resolve(),image.onerror=err=>reject(err)}),image,cancel:()=>{0===image.naturalWidth&&(image.src=_transparentPixelSrc__rspack_import_0.d)}}}function batchPreloadImages(list){let preloaders=[];for(let src of list){let preload=preloadImage(src);preloaders.push(preload)}let images=preloaders.map(preload=>preload.image);return{promise:Promise.allSettled(preloaders.map(preload=>preload.promise)),images,cancel:()=>{preloaders.forEach(preload=>{preload.cancel()})}}}},2513(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{G:()=>stringToArray});let stringToArray=(str,delimiter=",")=>str.trim().split(delimiter).map(part=>part.trim()).filter(part=>part.length>0)},664(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Q:()=>getPluralObjects,x:()=>applyTemplateData});let DEFAULT_TRANSFORMER=value=>value,PLURAL_PREFIX="plural:";function applyTemplateData(template,data={},options={}){let{openToken="{{",closeToken="}}",transform=DEFAULT_TRANSFORMER}=options;for(let key in data){let rawValue=data[key],value=null!=rawValue?rawValue.toString():void 0,replacement="string"==typeof value?transform(value):String(value);template=template.replaceAll(openToken+key+closeToken,replacement)}return template}function getPluralObjects(template){let pluralObjects=[],open=template.indexOf("{{");for(;-1!==open;){let close=template.indexOf("}}",open);if(-1===close)break;let variable=template.substring(open+2,close);if(variable.startsWith(PLURAL_PREFIX)){let keyValue=template.substring(open+2,close).replace(PLURAL_PREFIX,""),key=keyValue.substring(0,keyValue.indexOf("(")),count=keyValue.substring(keyValue.indexOf("(")+1,keyValue.indexOf(")"));pluralObjects.push({variable,pluralKey:key,countVariable:count})}open=template.indexOf("{{",close)}return pluralObjects}},3442(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{n:()=>throttle});let throttle=(fn,wait)=>{let lastFn,inThrottle=!1,lastTime=0,throttled=(...args)=>{inThrottle?(lastFn&&clearTimeout(lastFn),lastFn=setTimeout(()=>{Date.now()-lastTime>=wait&&(fn(...args),lastTime=Date.now())},Math.max(wait-(Date.now()-lastTime),0))):(fn(...args),lastTime=Date.now(),inThrottle=!0)};return Object.defineProperty(throttled,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{lastFn&&clearTimeout(lastFn)}}),throttled}},2402(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{f:()=>toKebabCase});let toKebabCase=str=>str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(x=>x.toLowerCase()).join("-")},8608(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{d:()=>TRANSPARENT_PIXEL_SRC});let TRANSPARENT_PIXEL_SRC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="},6783(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{m:()=>warnOnce});let warnings=new Set;function warnOnce(message){warnings.has(message)||(warnings.add(message),console.warn(message))}},5474(module){module.exports=__rspack_external__uploadcare_upload_client_41a5a0bd},2927(module){module.exports=__rspack_external_lit},8899(module){module.exports=__rspack_external_lit_decorators_js_aaefadbe},5337(module){module.exports=__rspack_external_lit_directives_ref_js_a17221f9},1156(module){module.exports=__rspack_external_lit_directives_style_map_js_cb619b3b},3943(module){module.exports=__rspack_external_lit_directives_unsafe_svg_js_aeac3291}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module,module.exports,__webpack_require__),module.exports}if(__webpack_require__.m=__webpack_modules__,__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.f={},__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce((promises,key)=>(__webpack_require__.f[key](chunkId,promises),promises),[])),__webpack_require__.k=chunkId=>""+chunkId+".css",__webpack_require__.u=chunkId=>""+chunkId+".js",__webpack_require__.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},"string"==typeof import.meta.url&&(scriptUrl=import.meta.url),!scriptUrl)throw Error("Automatic publicPath is not supported in this browser");__webpack_require__.p=scriptUrl=scriptUrl.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),installedChunks={index:0},loadingAttribute="data-rspack-loading",(loadCssChunkData=(target,chunkId)=>{installedChunks[chunkId]=0})(__webpack_require__.m,0,"index"),__webpack_require__.f.css=(chunkId,promises,fetchPriority)=>{var installedChunkData=__webpack_require__.o(installedChunks,chunkId)?installedChunks[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(/^(cloudImageEditorPlugin|index)$/.test(chunkId)){var promise=new Promise(function(resolve,reject){installedChunkData=installedChunks[chunkId]=[resolve,reject]});promises.push(installedChunkData[2]=promise);var url=__webpack_require__.p+__webpack_require__.k(chunkId),error=Error(),loadingEnded=function(event){if(__webpack_require__.o(installedChunks,chunkId)&&(0!==(installedChunkData=installedChunks[chunkId])&&(installedChunks[chunkId]=void 0),installedChunkData))if("load"!==event.type){var errorType=event&&event.type,realSrc=event&&event.target&&event.target.src;error.message="Loading css chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,installedChunkData[1](error)}else loadCssChunkData(__webpack_require__.m,chunkId),installedChunkData[0]()};"u">typeof document?((chunkId,url,done,hmr,fetchPriority)=>{var link,needAttach,key="chunk-"+chunkId;if(!hmr){for(var links=document.getElementsByTagName("link"),i=0;i<links.length;i++){var l=links[i],href=l.getAttribute("href")||l.href;if(href&&!href.startsWith(__webpack_require__.p)&&(href=__webpack_require__.p+(href.startsWith("/")?href.slice(1):href)),"stylesheet"==l.rel&&(href&&href.startsWith(url)||l.getAttribute("data-rspack")=="@uploadcare/file-uploader:"+key)){link=l;break}}if(!done)return}link||(needAttach=!0,link=document.createElement("link"),__webpack_require__.nc&&link.setAttribute("nonce",__webpack_require__.nc),link.setAttribute("data-rspack","@uploadcare/file-uploader:"+key),link.setAttribute(loadingAttribute,1),link.rel="stylesheet",link.href=url);var onLinkComplete=(prev,event)=>{if(link.onerror=link.onload=null,link.removeAttribute(loadingAttribute),clearTimeout(timeout),event&&"load"!=event.type&&link.parentNode.removeChild(link),done(event),prev)return prev(event)};if(link.getAttribute(loadingAttribute)){var timeout=setTimeout(onLinkComplete.bind(null,void 0,{type:"timeout",target:link}),12e4);link.onerror=onLinkComplete.bind(null,link.onerror),link.onload=onLinkComplete.bind(null,link.onload)}else onLinkComplete(void 0,{type:"load",target:link});return hmr&&hmr.getAttribute("fetchpriority")&&link.setAttribute("fetchpriority",hmr.getAttribute("fetchpriority")),hmr?document.head.insertBefore(link,hmr):needAttach&&document.head.appendChild(link)})(chunkId,url,loadingEnded,void 0,0):loadingEnded({type:"load"})}else installedChunks[chunkId]=0},installedChunks1={index:0},installChunk=data=>{var moduleId,chunkId,__rspack_esm_ids=data.__rspack_esm_ids,__webpack_modules__=data.__webpack_modules__,__rspack_esm_runtime=data.__rspack_esm_runtime,i=0;for(moduleId in __webpack_modules__)__webpack_require__.o(__webpack_modules__,moduleId)&&(__webpack_require__.m[moduleId]=__webpack_modules__[moduleId]);for(__rspack_esm_runtime&&__rspack_esm_runtime(__webpack_require__);i<__rspack_esm_ids.length;i++)chunkId=__rspack_esm_ids[i],__webpack_require__.o(installedChunks1,chunkId)&&installedChunks1[chunkId]&&installedChunks1[chunkId][0](),installedChunks1[__rspack_esm_ids[i]]=0},__webpack_require__.f.j=function(chunkId,promises){var installedChunkData=__webpack_require__.o(installedChunks1,chunkId)?installedChunks1[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[1]);else{var promise=import("./"+__webpack_require__.u(chunkId)).then(installChunk,e=>{throw 0!==installedChunks1[chunkId]&&(installedChunks1[chunkId]=void 0),e}),promise=Promise.race([promise,new Promise(resolve=>{installedChunkData=installedChunks1[chunkId]=[resolve]})]);promises.push(installedChunkData[1]=promise)}};var __webpack_exports__={};(()=>{__webpack_require__.d(__webpack_exports__,{JU:()=>DropArea,vr:()=>ActivityHeader,eB:()=>LitBlock.x,z2:()=>ProgressBar,Vd:()=>LitSolutionBlock,y5:()=>UploadSource.y5,aF:()=>Modal,Bp:()=>ExternalSource.B,eK:()=>FileUploaderMinimal,ru:()=>CameraSource.r,$G:()=>BaseComponent,jj:()=>SimpleBtn,rM:()=>env.r,Y0:()=>Copyright,DJ:()=>loadFileUploaderFrom.D,rt:()=>PluginActivityHost,Ar:()=>SourceList,iE:()=>LitUploaderBlock.z,V0:()=>UID.V,cx:()=>UploadList,Ts:()=>UrlSource.T,Zz:()=>StartFrom,fX:()=>toKebabCase.f,Az:()=>FileUploaderInline,wB:()=>PluginActivityRenderer,TS:()=>Config.T,ZQ:()=>FormInput,vY:()=>FileUploaderRegular,Do:()=>ModalManager.D,zi:()=>Thumb,E9:()=>Img,i8:()=>env.i,Yi:()=>defineComponents.Y,qB:()=>ProgressBarCommon,l6:()=>Select,_Q:()=>UploadCtxProvider,I3:()=>FileItem,pc:()=>UploadSource.pc,In:()=>Icon.I,y$:()=>Spinner,mO:()=>localeRegistry.m,hC:()=>LitActivityBlock.S,B_:()=>PubSubCompat.G,s9:()=>SourceBtn});var PubSubCompat=__webpack_require__(8594),external_lit_=__webpack_require__(2927),CssDataMixin=__webpack_require__(3361),LightDomMixin=__webpack_require__(7337),RegisterableElementMixin=__webpack_require__(3282),SymbioteCompatMixin=__webpack_require__(9280);class BaseComponent extends(0,RegisterableElementMixin.d)((0,SymbioteCompatMixin.w)()((0,CssDataMixin.N)((0,LightDomMixin.Q)(external_lit_.LitElement)))){}var UID=__webpack_require__(5446),defineComponents=__webpack_require__(3962),loadFileUploaderFrom=__webpack_require__(225),localeRegistry=__webpack_require__(7444),ModalManager=__webpack_require__(3076),toKebabCase=__webpack_require__(2402),LitBlock=__webpack_require__(204),unsafe_svg_js_=__webpack_require__(3943),CTX=__webpack_require__(7992);class LitSolutionBlock extends LitBlock.x{static{this.styleAttrs=["uc-wgt-common"]}initCallback(){super.initCallback(),this.a11y?.registerBlock(this),this.clipboardLayer?.registerBlock(this),this.sharedCtx.pub("*solution",this.tagName)}render(){return(0,external_lit_.html)`${(0,unsafe_svg_js_.unsafeSVG)("<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol fill='none' viewBox='0 0 9 6' id='uc-icon-arrow-dropdown' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='m1.5 1.667 3 2.666 3-2.666' opacity='.5'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-aspect-ratio' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='M7.395 22.5H2.454v-5.25m14.824 5.25h4.94v-5.25m0-10.5V1.5h-4.94m-9.883 0H2.454v5.25'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-camera-full' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2 4.667a2 2 0 0 0-2 2V16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6.667a2 2 0 0 0-2-2h-2.667l-2-2.667H6.667l-2 2.667H2Zm8 10a3.667 3.667 0 1 0 0-7.334 3.667 3.667 0 0 0 0 7.334Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0v6.469a4.5 4.5 0 1 1-9 0V4.781Zm4.5-3a3 3 0 0 0-3 3v6.469a3 3 0 1 0 6 0V4.781a3 3 0 0 0-3-3Zm-8.156 8.11a.75.75 0 0 1 .75.75 7.406 7.406 0 1 0 14.812 0 .75.75 0 0 1 1.5 0 8.907 8.907 0 0 1-8.156 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.907 8.907 0 0 1-8.156-8.875.75.75 0 0 1 .75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone-mute' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0V6l3.524-3.524a.75.75 0 1 1 1.061 1.06L5.036 19.585a.75.75 0 0 1-1.06-1.06l1.656-1.657a8.88 8.88 0 0 1-2.538-6.227.75.75 0 0 1 1.5 0c0 2.009.8 3.83 2.1 5.166l1.771-1.772A4.483 4.483 0 0 1 7.5 11.25V4.781Zm2.037 8.182L15 7.5V4.781a3 3 0 1 0-6 0v6.469c0 .637.198 1.227.537 1.713Zm10.62-3.072a.75.75 0 0 1 .75.75 8.907 8.907 0 0 1-8.157 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.855 8.855 0 0 1-3.035-.811.75.75 0 1 1 .638-1.358 7.406 7.406 0 0 0 10.553-6.707.75.75 0 0 1 .75-.75ZM15 10.81a.75.75 0 0 1 1.5 0v.439a4.5 4.5 0 0 1-5 4.473.75.75 0 1 1 .166-1.491A3 3 0 0 0 15 11.25v-.44Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-photo-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-ngdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-pause' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' d='M1 0h2.5v10H1zM6.5 0H9v10H6.5z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-play' xmlns='http://www.w3.org/2000/svg'><path d='m1 0 9 5-9 5V0Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol fill='none' viewBox='0 0 20 20' id='uc-icon-square' xmlns='http://www.w3.org/2000/svg'><rect width='20' height='20' rx='4' fill='#fff'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-video-camera-full' xmlns='http://www.w3.org/2000/svg'><path d='M2 3.333a2 2 0 0 0-2 2v9.334a2 2 0 0 0 2 2h10.938a2 2 0 0 0 2-2v-2.013L20 15.646V4.354l-5.063 3.03v-2.05a2 2 0 0 0-2-2H2Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol></svg>")}`}constructor(...args){super(...args),this.init$=(0,CTX.u8)(this)}}var LitUploaderBlock=__webpack_require__(5544),LitActivityBlock=__webpack_require__(5923),Icon=__webpack_require__(8610),cdn_utils=__webpack_require__(6339),stringToArray=__webpack_require__(2513),template_utils=__webpack_require__(664);let CSS_PREF="--uc-img-",UNRESOLVED_ATTR="unresolved",DEV_MODE=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),ImgTypeEnum=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"});var env=__webpack_require__(5704);let PROPS_MAP=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:"https://ucarecdn.com"},"proxy-cname":{},"secure-delivery-proxy":{},"hi-res-support":{default:1},"ultra-res-support":{},format:{},"cdn-operations":{},progressive:{},quality:{},"is-background-for":{},"is-preview-blur":{default:1}});class ImgConfig extends(0,CssDataMixin.N)((0,RegisterableElementMixin.d)(external_lit_.LitElement)){createRenderRoot(){return this}constructor(){for(let prop in super(),this._state={},this._subscribers=new Map,this._isnObserver=null,this._observed=null,PROPS_MAP){let config=PROPS_MAP[prop];this._state[CSS_PREF+prop]=config?.default||""}}$$(key){return this._state[CSS_PREF+key]}set$$(kvObj){for(let key in kvObj){let fullKey=CSS_PREF+key,val=kvObj[key];this._state[fullKey]=val,this._notify(fullKey,val)}}sub$$(key,kbFn){let fullKey=CSS_PREF+key;this._subscribers.has(fullKey)||this._subscribers.set(fullKey,new Set),this._subscribers.get(fullKey)?.add(kbFn);let currentVal=this._state[fullKey];null!==currentVal&&""!==currentVal&&kbFn(currentVal)}_notify(key,val){this._subscribers.has(key)&&this._subscribers.get(key)?.forEach(cb=>{null!==val&&""!==val&&cb(val)})}analyticsParams(){return`-/@clib/${env.r}/${env.i}/uc-img/`}initAttributes(el){Array.from(this.attributes).forEach(attr=>{PROPS_MAP[attr.name]||el.setAttribute(attr.name,attr.value)})}initIntersection(el,cbkFn){this._isnObserver=new IntersectionObserver(entries=>{entries.forEach(ent=>{ent.isIntersecting&&(cbkFn(),this._isnObserver?.unobserve(el))})},{root:null,rootMargin:"0px"}),this._isnObserver.observe(el),this._observed||(this._observed=new Set),this._observed.add(el)}connectedCallback(){super.connectedCallback(),this._initCssProperties()}_initCssProperties(){for(let prop in PROPS_MAP){let fullKey=CSS_PREF+prop,val=this.getCssData(fullKey,!0);null!=val&&(this._state[fullKey]=val)}}disconnectedCallback(){super.disconnectedCallback(),this._isnObserver&&(this._observed?.forEach(el=>{this._isnObserver?.unobserve(el)}),this._isnObserver=null),this._subscribers.clear()}static get observedAttributes(){return Object.keys(PROPS_MAP)}attributeChangedCallback(name,_oldVal,newVal){window.setTimeout(()=>{let fullKey=CSS_PREF+name;this._state[fullKey]=newVal,this._notify(fullKey,newVal)})}}class ImgBase extends ImgConfig{_fmtAbs(src){return src.includes("//")||DEV_MODE||(src=new URL(src,document.baseURI).href),src}_validateSize(size){if(!size)return;let numericPart=size.match(/\d+/)?.[0],alphabeticPart=size.match(/[a-zA-Z]+/)?.[0];if(!numericPart||!alphabeticPart)return;let bp=parseInt(numericPart,10);return Number(bp)>5e3&&this._hasFormatJPG?5e3+alphabeticPart:Number(bp)>3e3&&!this._hasFormatJPG?3e3+alphabeticPart:size}_getCdnModifiers(size,blur){let params={format:this._getTypedCssValue("format"),quality:this._getTypedCssValue("quality"),resize:this._validateSize(size),blur,"cdn-operations":this._getTypedCssValue("cdn-operations")??void 0,analytics:this.analyticsParams()};return(0,cdn_utils.$z)(...Object.entries(params).filter(([_,value])=>void 0!==value&&""!==value).map(([key,value])=>"cdn-operations"===key||"analytics"===key?value:`${key}/${value}`))}_getTypedCssValue(key){let value=this.$$(key);if(null==value||"string"==typeof value||"number"==typeof value||"boolean"==typeof value)return value}_getUrlBase(size="",blur=""){let src=this.$$("src");if(src.startsWith("data:")||src.startsWith("blob:"))return src;if(DEV_MODE&&src&&!src.includes("//"))return this._proxyUrl(src);let cdnModifiers=this._getCdnModifiers(size,blur),cdnCnameRaw=this.$$("cdn-cname");if(src.startsWith(String(cdnCnameRaw)))return(0,cdn_utils.LN)(src,cdnModifiers);let uuid=this.$$("uuid");if(cdnCnameRaw&&uuid||uuid)return this._proxyUrl((0,cdn_utils.LN)((0,cdn_utils.vo)(cdnCnameRaw,uuid),cdnModifiers));let proxyCname=this.$$("proxy-cname");if(proxyCname)return this._proxyUrl((0,cdn_utils.LN)(proxyCname,cdnModifiers,this._fmtAbs(src)));let pubkey=this.$$("pubkey");if(pubkey)return this._proxyUrl((0,cdn_utils.LN)(`https://${pubkey}.ucr.io/`,cdnModifiers,this._fmtAbs(src)))}_proxyUrl(url){let previewProxy=this.$$("secure-delivery-proxy");return previewProxy?(0,template_utils.x)(previewProxy,{previewUrl:url},{transform:value=>window.encodeURIComponent(value)}):url}_getElSize(el,k=1,wOnly=!0){let rect=el.getBoundingClientRect(),w=k*Math.round(rect.width),h=wOnly?"":k*Math.round(rect.height);return w||h?`${w||""}x${h||""}`:null}_setupEventProxy(img){let proxifyEvent=e=>{e.stopPropagation();let event=new Event(e.type,e);this.dispatchEvent(event)};for(let event of["load","error"])img.addEventListener(event,proxifyEvent)}get img(){return this._hasPreviewImage||(this._setupConfigForImage({elNode:this._img}),this.appendChild(this._img)),this._img}get _currentImg(){return this._hasPreviewImage?{type:ImgTypeEnum.PREVIEW,img:this._imgPreview}:{type:ImgTypeEnum.MAIN,img:this.img}}get _hasPreviewImage(){return this.$$("is-preview-blur")}get _bgSelector(){return this.$$("is-background-for")}get _breakpoints(){let breakpointsValue=this.$$("breakpoints");return breakpointsValue?[...new Set((0,stringToArray.G)(breakpointsValue).map(bp=>parseInt(bp,10)))]:null}get _hasFormatJPG(){return"jpeg"===this.$$("format").toLowerCase()}_renderBg(el){let imgSet=new Set;imgSet.add(`url("${this._getUrlBase(this._getElSize(el))}") 1x`),this.$$("hi-res-support")&&imgSet.add(`url("${this._getUrlBase(this._getElSize(el,2))}") 2x`),this.$$("ultra-res-support")&&imgSet.add(`url("${this._getUrlBase(this._getElSize(el,3))}") 3x`);let iSet=`image-set(${[...imgSet].join(", ")})`;el.style.setProperty("background-image",iSet),el.style.setProperty("background-image",`-webkit-${iSet}`)}_getSrcset(){let srcset=new Set;return this._breakpoints?this._breakpoints.forEach(bp=>{srcset.add(`${this._getUrlBase(`${bp}x`)} ${this._validateSize(`${bp}w`)}`),this.$$("hi-res-support")&&srcset.add(`${this._getUrlBase(`${2*bp}x`)} ${this._validateSize(`${2*bp}w`)}`),this.$$("ultra-res-support")&&srcset.add(`${this._getUrlBase(`${3*bp}x`)} ${this._validateSize(`${3*bp}w`)}`)}):(srcset.add(`${this._getUrlBase(this._getElSize(this._currentImg.img))} 1x`),this.$$("hi-res-support")&&srcset.add(`${this._getUrlBase(this._getElSize(this._currentImg.img,2))} 2x`),this.$$("ultra-res-support")&&srcset.add(`${this._getUrlBase(this._getElSize(this._currentImg.img,3))} 3x`)),[...srcset].join()}_getSrc(){return this._getUrlBase()}get _srcUrlPreview(){return this._getUrlBase("100x","100")}_renderBackground(){let selector=this._bgSelector;[...document.querySelectorAll(selector)].forEach(el=>{this.$$("intersection")?this.initIntersection(el,()=>{this._renderBg(el)}):this._renderBg(el)})}_appendURL({elNode,src,srcset}){src&&(elNode.src=src),srcset&&(elNode.srcset=srcset)}_setupConfigForImage({elNode}){this._setupEventProxy(elNode),this.initAttributes(elNode)}_loaderImage({src,srcset,elNode}){return new Promise((resolve,reject)=>{this._setupConfigForImage({elNode}),elNode.setAttribute(UNRESOLVED_ATTR,""),elNode.addEventListener("load",()=>{elNode.removeAttribute(UNRESOLVED_ATTR),resolve(elNode)}),elNode.addEventListener("error",()=>{reject(!1)}),this._appendURL({elNode,src,srcset})})}async _renderImage(){if(this.$$("intersection")){this._hasPreviewImage&&(this._setupConfigForImage({elNode:this._imgPreview}),this.appendChild(this._imgPreview)),this.initIntersection(this._currentImg.img,async()=>{this._hasPreviewImage&&(this._imgPreview.src=this._srcUrlPreview);try{await this._loaderImage({src:this._getSrc(),srcset:this._getSrcset(),elNode:this._img}),this._hasPreviewImage&&await this._imgPreview.remove(),this.appendChild(this._img)}catch{this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img)}});return}try{this._hasPreviewImage&&(await this._loaderImage({src:this._srcUrlPreview,elNode:this._imgPreview}),this.appendChild(this._imgPreview)),await this._loaderImage({src:this._getSrc(),srcset:this._getSrcset(),elNode:this._img}),this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img)}catch{this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img)}}init(){this._bgSelector?this._renderBackground():this._renderImage()}constructor(...args){super(...args),this._img=new Image,this._imgPreview=new Image}}class Img extends ImgBase{connectedCallback(){super.connectedCallback(),this.sub$$("src",()=>{this.init()}),this.sub$$("uuid",()=>{this.init()}),this.sub$$("lazy",val=>{this.$$("is-background-for")||this.$$("is-preview-blur")||(this.img.loading=val?"lazy":"eager")})}}var EventEmitter=__webpack_require__(9963),decorators_js_=__webpack_require__(8899),ref_js_=__webpack_require__(5337);function _ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}let LAST_ACTIVE_MODAL_ID=null;class Modal extends LitBlock.x{static{this.styleAttrs=[...super.styleAttrs,"uc-modal"]}show(){let dialog=this.dialogEl.value;"function"==typeof dialog.showModal?(this.setAttribute("aria-modal","true"),dialog.showModal()):dialog.setAttribute("open",""),this.cfg.modalScrollLock&&(document.body.style.overflow="hidden")}hide(){let dialog=this.dialogEl.value;dialog&&("function"==typeof dialog.close?(this.setAttribute("aria-modal","false"),dialog.close()):dialog.removeAttribute("open"))}initCallback(){super.initCallback(),this.modalManager?.registerModal(this.id,this),this.subConfigValue("modalBackdropStrokes",val=>{val?this.setAttribute("strokes",""):this.removeAttribute("strokes")}),this.modalManager?.subscribe(ModalManager.D.OPEN,this._handleModalOpen),this.modalManager?.subscribe(ModalManager.D.CLOSE,this._handleModalClose),this.modalManager?.subscribe(ModalManager.D.CLOSE_ALL,this._handleModalCloseAll)}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow="",this._mouseDownTarget=void 0,this.modalManager?.unsubscribe(ModalManager.D.OPEN,this._handleModalOpen),this.modalManager?.unsubscribe(ModalManager.D.CLOSE,this._handleModalClose),this.modalManager?.unsubscribe(ModalManager.D.CLOSE_ALL,this._handleModalCloseAll)}_handleDialogRef(dialog){this.dialogEl={value:dialog},this.dialogEl.value?.addEventListener("close",this._handleDialogClose),this.dialogEl.value?.addEventListener("mousedown",this._handleDialogMouseDown),this.dialogEl.value?.addEventListener("mouseup",this._handleDialogMouseUp)}render(){return(0,external_lit_.html)`<dialog ${(0,ref_js_.ref)(this._handleDialogRef)}> ${this.yield("")} </dialog>`}constructor(...args){super(...args),this.dialogEl=(0,ref_js_.createRef)(),this.strokes=!1,this.blockBodyScrolling=!1,this.closeDialog=()=>{this.modalManager?.close(this.id),this.modalManager?.hasActiveModals||(document.body.style.overflow="",this.$["*currentActivity"]=null)},this._handleDialogClose=()=>{this.closeDialog()},this._handleDialogMouseDown=e=>{this._mouseDownTarget=e.target},this._handleDialogMouseUp=e=>{let target=e.target;target===this.dialogEl.value&&target===this._mouseDownTarget&&this.closeDialog()},this._handleModalOpen=({id})=>{id===this.id?(LAST_ACTIVE_MODAL_ID=id,this.show(),this.emit(EventEmitter.Bx.MODAL_OPEN,{modalId:id},{debounce:!0})):this.hide()},this._handleModalClose=({id})=>{id===this.id&&(this.hide(),this.emit(EventEmitter.Bx.MODAL_CLOSE,{modalId:id,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:!0}))},this._handleModalCloseAll=_data=>{this.hide(),LAST_ACTIVE_MODAL_ID===this.id&&this.emit(EventEmitter.Bx.MODAL_CLOSE,{modalId:LAST_ACTIVE_MODAL_ID,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:!0})}}}_ts_decorate([(0,decorators_js_.property)({type:Boolean,noAccessor:!0})],Modal.prototype,"strokes",void 0),_ts_decorate([(0,decorators_js_.property)({type:Boolean,attribute:"block-body-scrolling",noAccessor:!0})],Modal.prototype,"blockBodyScrolling",void 0);var applyStyles=__webpack_require__(3254);class FormInput extends LitUploaderBlock.z{get _inputName(){return this.nameAttrValue??this.ctxName}_createValidationInput(){let validationInput=document.createElement("input");return validationInput.type="text",validationInput.name=this._inputName,validationInput.required=this.cfg.multipleMin>0,validationInput.tabIndex=-1,(0,applyStyles.Z)(validationInput,{opacity:0,height:0,width:0}),validationInput}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",collectionState=>{if(!collectionState)return;if(!this._dynamicInputsContainer){let dynamicInputsContainer=document.createElement("div");this.appendChild(dynamicInputsContainer),this._dynamicInputsContainer=dynamicInputsContainer}if(!this._validationInputElement){let input=this._createValidationInput();this.appendChild(input),this._validationInputElement=input}if(this._dynamicInputsContainer.innerHTML="","uploading"===collectionState.status||"idle"===collectionState.status){this._validationInputElement.value="",this._validationInputElement.setCustomValidity("");return}if("failed"===collectionState.status){let errorMsg=collectionState.errors[0]?.message;this._validationInputElement.value="",this._validationInputElement.setCustomValidity(errorMsg??"");return}let group=collectionState.group?collectionState.group:null;if(group){this._validationInputElement.value=group.cdnUrl??"",this._validationInputElement.setCustomValidity("");return}let cdnUrls=collectionState.allEntries.map(entry=>entry.cdnUrl).filter(url=>"string"==typeof url);if(!this.cfg.multiple&&1===cdnUrls.length&&cdnUrls[0]){this._validationInputElement.value=cdnUrls[0],this._validationInputElement.setCustomValidity("");return}this._validationInputElement.remove(),this._validationInputElement=null;let fr=new DocumentFragment;for(let value of cdnUrls){let input=document.createElement("input");input.type="hidden",input.name=`${this._inputName}[]`,input.value=value,fr.appendChild(input)}this._dynamicInputsContainer.replaceChildren(fr)},!1)}constructor(...args){super(...args),this._validationInputElement=null,this._dynamicInputsContainer=null}}!function(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);c>3&&r&&Object.defineProperty(target,key,r)}([(0,decorators_js_.property)({type:String,noAccessor:!0,attribute:"name"})],FormInput.prototype,"nameAttrValue",void 0);class Copyright extends LitBlock.x{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",value=>{this.toggleAttribute("hidden",!!value)})}render(){return(0,external_lit_.html)`<a href="https://uploadcare.com/?utm_source=copyright&amp;utm_medium=referral&amp;utm_campaign=v4" target="_blank noopener" class="uc-credits" >Powered by Uploadcare</a >`}}function ProgressBar_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}class ProgressBar extends LitBlock.x{firstUpdated(changedProperties){super.firstUpdated(changedProperties),this._progressValue=this._normalizeProgressValue(this.value),this._updateProgressValueStyle(),this._fakeProgressLineRef.value?.addEventListener("animationiteration",this._handleFakeProgressAnimation)}updated(changedProperties){if(super.updated(changedProperties),changedProperties.has("value")){let normalizedValue=this._normalizeProgressValue(this.value);if(this.visible){let nextValue=Math.max(this._progressValue,normalizedValue);nextValue!==this._progressValue&&(this._progressValue=nextValue,this._updateProgressValueStyle())}else this._progressValue=normalizedValue}changedProperties.has("visible")&&(this.classList.toggle("uc-progress-bar--hidden",!this.visible),this.visible?this._updateProgressValueStyle():this._progressValue=this._normalizeProgressValue(this.value))}disconnectedCallback(){super.disconnectedCallback(),this._fakeProgressLineRef.value?.removeEventListener("animationiteration",this._handleFakeProgressAnimation)}_normalizeProgressValue(value){return Number.isFinite(value)?Math.min(100,Math.max(0,value)):0}_updateProgressValueStyle(){this.visible&&this.style.setProperty("--l-progress-value",this._progressValue.toString())}render(){return(0,external_lit_.html)`<div ${(0,ref_js_.ref)(this._fakeProgressLineRef)} class="uc-fake-progress"></div><div class="uc-progress"></div>`}constructor(...args){super(...args),this.hasFileName=!1,this.value=0,this.visible=!0,this._progressValue=0,this._fakeProgressLineRef=(0,ref_js_.createRef)(),this._handleFakeProgressAnimation=()=>{let fakeProgressLine=this._fakeProgressLineRef.value;if(fakeProgressLine){if(!this.visible)return void fakeProgressLine.classList.add("uc-fake-progress--hidden");this._progressValue>0&&fakeProgressLine.classList.add("uc-fake-progress--hidden")}}}}function ProgressBarCommon_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}ProgressBar_ts_decorate([(0,decorators_js_.property)({type:Boolean,noAccessor:!0})],ProgressBar.prototype,"hasFileName",void 0),ProgressBar_ts_decorate([(0,decorators_js_.property)({type:Number})],ProgressBar.prototype,"value",void 0),ProgressBar_ts_decorate([(0,decorators_js_.property)({type:Boolean,reflect:!0})],ProgressBar.prototype,"visible",void 0);class ProgressBarCommon extends LitUploaderBlock.z{constructor(){super(),this._visible=!1,this._value=0,this.init$={...this.init$,"*commonProgress":0}}initCallback(){super.initCallback(),this._unobserveCollectionCb=this.uploadCollection.observeProperties(()=>{let anyUploading=this.uploadCollection.items().some(id=>{let item=this.uploadCollection.read(id);return item?.getValue("isUploading")??!1});this._visible=anyUploading}),this.sub("*commonProgress",progress=>{this._value=progress})}updated(changedProperties){super.updated(changedProperties),changedProperties.has("visible")&&(this._visible?this.setAttribute("active",""):this.removeAttribute("active"))}disconnectedCallback(){super.disconnectedCallback(),this._unobserveCollectionCb?.(),this._unobserveCollectionCb=void 0}render(){return(0,external_lit_.html)`<uc-progress-bar .value=${this._value} .visible=${this._visible}></uc-progress-bar>`}}function Select_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}ProgressBarCommon_ts_decorate([(0,decorators_js_.state)()],ProgressBarCommon.prototype,"_visible",void 0),ProgressBarCommon_ts_decorate([(0,decorators_js_.state)()],ProgressBarCommon.prototype,"_value",void 0);class Select extends LitBlock.x{render(){return(0,external_lit_.html)` <select @change=${this._handleChange} .value=${this.value} ?disabled=${this.disabled}> ${this.options.map(option=>(0,external_lit_.html)`<option value=${option.value}>${option.text}</option>`)} </select>`}constructor(...args){super(...args),this.value="",this.disabled=!1,this.options=[],this._handleChange=event=>{if(this.disabled){event.preventDefault(),event.stopPropagation();return}event.preventDefault(),event.stopPropagation();let selectEl=event.currentTarget;selectEl&&(this.value=selectEl.value,this.dispatchEvent(new Event("change")))}}}function SourceBtn_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}Select_ts_decorate([(0,decorators_js_.property)({type:String,attribute:!1})],Select.prototype,"value",void 0),Select_ts_decorate([(0,decorators_js_.property)({type:Boolean,reflect:!0})],Select.prototype,"disabled",void 0),Select_ts_decorate([(0,decorators_js_.property)({type:Array,attribute:!1})],Select.prototype,"options",void 0);class SourceBtn extends LitUploaderBlock.z{willUpdate(changedProperties){super.willUpdate(changedProperties),changedProperties.has("source")&&this._applySource(this.source)}_applySource(source){if(!source){this._srcTypeKey="",this._iconName="default";return}let{label,icon,id}=source;this._srcTypeKey=label,this._iconName=icon??id??"default"}activate(){this.source&&this.source.onClick()}render(){return(0,external_lit_.html)`<button type="button" @click=${this.activate}><uc-icon name=${this._iconName}></uc-icon><div class="uc-txt">${this.l10n(this._srcTypeKey)}</div></button>`}constructor(...args){super(...args),this.couldBeCtxOwner=!0,this._iconName="default",this._srcTypeKey=""}}SourceBtn_ts_decorate([(0,decorators_js_.property)({attribute:!1})],SourceBtn.prototype,"source",void 0),SourceBtn_ts_decorate([(0,decorators_js_.state)()],SourceBtn.prototype,"_iconName",void 0),SourceBtn_ts_decorate([(0,decorators_js_.state)()],SourceBtn.prototype,"_srcTypeKey",void 0);var UploadSource=__webpack_require__(5730);function SourceList_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}class SourceList extends LitUploaderBlock.z{initCallback(){super.initCallback(),this.subConfigValue("sourceList",val=>{this._rawSourceList=(0,stringToArray.G)(val),this._updateSources()});let pluginManager=this._sharedInstancesBag.pluginManager;pluginManager?.onPluginsChange&&(this._unsubscribePlugins=pluginManager.onPluginsChange(()=>this._updateSources()))}updated(changedProperties){super.updated(changedProperties),this.cfg.sourceListWrap?this.style.removeProperty("display"):this.style.display="contents"}_updateSources(){let pluginManager=this._sharedInstancesBag.pluginManager,pluginSourceById=new Map((pluginManager?.snapshot().sources??[]).map(source=>[source.id,source])),sources=[];this._rawSourceList.forEach(srcName=>{let expanded=this._expandSource(srcName,pluginSourceById);if(1!==expanded.length||expanded[0]!==srcName){for(let name of expanded){let config=this._makeBuiltInSourceConfig(name);if(config){sources.push(config);continue}let pluginSource=pluginSourceById.get(name);pluginSource&&sources.push(this._makePluginSourceConfig(pluginSource))}return}let builtInConfig=this._makeBuiltInSourceConfig(srcName);if(builtInConfig)return void sources.push(builtInConfig);let pluginSource=pluginSourceById.get(srcName);pluginSource&&sources.push(this._makePluginSourceConfig(pluginSource))}),this._sources=sources}_expandSource(srcName,pluginSourceById){let pluginSource=pluginSourceById.get(srcName);return pluginSource?.expand?pluginSource.expand():[srcName]}_makeBuiltInSourceConfig(type){return type===UploadSource.pc.LOCAL?{id:type,label:`src-type-${type}`,icon:type,onClick:()=>this.api.openSystemDialog()}:null}_makePluginSourceConfig(source){return{id:source.id,label:source.label,icon:source.icon,onClick:()=>source.onSelect()}}render(){return(0,external_lit_.html)`${this._sources.map(source=>(0,external_lit_.html)`<uc-source-btn role="listitem" .source=${source} data-source-id=${source.id}></uc-source-btn>`)}`}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback()}constructor(...args){super(...args),this._rawSourceList=[],this._sources=[],this.wrap=!1}}SourceList_ts_decorate([(0,decorators_js_.state)()],SourceList.prototype,"_sources",void 0),SourceList_ts_decorate([(0,decorators_js_.property)({type:Boolean,attribute:"wrap",noAccessor:!0})],SourceList.prototype,"wrap",void 0);class Spinner extends LitBlock.x{render(){return(0,external_lit_.html)`<div class="uc-spinner"></div>`}}var debounce=__webpack_require__(4441),preloadImage=__webpack_require__(6756);function generateThumb(imgFile,size=40){if("image/svg+xml"===imgFile.type)return URL.createObjectURL(imgFile);let canvas=document.createElement("canvas"),ctx=canvas.getContext("2d");if(!ctx)return Promise.reject(Error("Canvas context not supported"));let img=new Image,promise=new Promise((resolve,reject)=>{img.onload=()=>{let ratio=img.height/img.width;ratio>1?(canvas.width=size,canvas.height=size*ratio):(canvas.height=size,canvas.width=size/ratio),ctx.fillStyle="rgb(240, 240, 240)",ctx.fillRect(0,0,canvas.width,canvas.height),ctx.drawImage(img,0,0,canvas.width,canvas.height),canvas.toBlob(blob=>{blob?resolve(URL.createObjectURL(blob)):reject()})},img.onerror=err=>{reject(err)}});return img.src=URL.createObjectURL(imgFile),promise}class FileItemConfig extends LitUploaderBlock.z{withEntry(fn){return(...args)=>{let entry=this.entry;return entry?fn(entry,...args):void console.warn("No entry found")}}subEntry(prop,handler){this.withEntry((entry,propInner,handlerInner)=>{let sub=entry.subscribe(propInner,value=>{this.isConnected&&handlerInner(value)});this._entrySubs.add(sub)})(prop,handler)}reset(){for(let sub of this._entrySubs)sub();this._entrySubs=new Set,this.entry=null}disconnectedCallback(){super.disconnectedCallback(),this._entrySubs=new Set}constructor(...args){super(...args),this._entrySubs=new Set,this.entry=null}}function fileCssBg(color="hsl(209, 21%, 65%)",width=32,height=32){let blob;return blob=new Blob([`<svg width="${width}" height="${height}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" fill="${color}" d="M9.68848 8.70068C9.68848 8.42454 9.91233 8.20068 10.1885 8.20068H15.0885C15.2211 8.20068 15.3483 8.25336 15.442 8.34713L20.342 13.2471C20.4358 13.3409 20.4885 13.4681 20.4885 13.6007V21.3007C20.4885 21.5768 20.2646 21.8007 19.9885 21.8007H10.1885C9.91233 21.8007 9.68848 21.5768 9.68848 21.3007V8.70068ZM10.6885 9.20068V20.8007H19.4885V14.1007L15.0885 14.1007C14.8123 14.1007 14.5885 13.8768 14.5885 13.6007L14.5885 9.20068H10.6885ZM15.5885 9.90779L18.7814 13.1007L15.5885 13.1007L15.5885 9.90779Z"/></svg>`],{type:"image/svg+xml"}),URL.createObjectURL(blob)}var transparentPixelSrc=__webpack_require__(8608);function Thumb_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}class Thumb extends FileItemConfig{_calculateThumbSize(force=!1){force&&(this._thumbRect=this.getBoundingClientRect());let size=Math.max(parseInt(String(this?._thumbRect?.height||0),10),parseInt(String(this?._thumbRect?.width||0),10),this.cfg.thumbSize);return window.devicePixelRatio>1&&(size*=window.devicePixelRatio),Math.min(size,3e3)}_decodeImage(src,signal){return new Promise((resolve,reject)=>{let image=new Image;image.decoding="async";let cleanup=()=>{image&&(image.onload=null,image.onerror=null,image.src=transparentPixelSrc.d,signal?.removeEventListener("abort",onAbort),image=null)},onAbort=()=>{cleanup(),reject(new DOMException("Aborted","AbortError"))};if(signal){if(signal.aborted)return void onAbort();signal.addEventListener("abort",onAbort,{once:!0})}let resolveSafe=()=>{cleanup(),resolve()},rejectSafe=error=>{cleanup(),reject(error)};if("function"==typeof image.decode){image.src=src,image.decode().then(resolveSafe).catch(rejectSafe);return}image.onload=resolveSafe,image.onerror=rejectSafe,image.src=src})}_cancelPendingThumbUpdate(){this._pendingThumbUpdate?.cancel(),this._pendingThumbUpdate=void 0}_scheduleThumbUpdate(nextThumbUrl){if(this._cancelPendingThumbUpdate(),!nextThumbUrl){this._thumbUrl&&(this._thumbUrl="");return}if(nextThumbUrl===this._thumbUrl)return;let abortController=new AbortController,pending={controller:abortController,cancel:()=>{abortController.abort(),void 0!==pending.rafId&&window.cancelAnimationFrame(pending.rafId)}};this._pendingThumbUpdate=pending,this._decodeImage(nextThumbUrl,abortController.signal).then(()=>{abortController.signal.aborted||(pending.rafId=window.requestAnimationFrame(()=>{abortController.signal.aborted||(this._thumbUrl=nextThumbUrl)}))}).catch(error=>{abortController.signal.aborted||error instanceof DOMException&&"AbortError"===error.name||console.warn("[Thumb] Failed to decode thumbnail image",error)})}_requestThumbGeneration(force=!1){!this.entry||(force?this._generateThumbnail(!0):this._isIntersecting&&this._debouncedGenerateThumb())}firstUpdated(changedProperties){super.firstUpdated(changedProperties),this._bindToEntry()}updated(changedProperties){super.updated(changedProperties),changedProperties.has("uid")&&this._bindToEntry()}_observerCallback(entries){let[entry]=entries;entry&&(this._isIntersecting=entry.isIntersecting,entry.isIntersecting&&(this._thumbRect=entry.boundingClientRect,this._requestThumbGeneration(),this._observer?.disconnect()),0===entry.intersectionRatio&&this._debouncedGenerateThumb.cancel())}reset(){super.reset(),this._debouncedGenerateThumb.cancel(),this._cancelPendingThumbUpdate(),this._thumbUrl&&(this._thumbUrl="")}_bindToEntry(){let id=this.uid?.trim();if(!id){this.entry&&this.reset();return}let entry=this.uploadCollection?.read(id);if(!entry||entry===this.entry)return;this.reset(),this.entry=entry;let requestThumb=()=>{this._requestThumbGeneration()};this.subEntry("fileInfo",fileInfo=>{fileInfo?.isImage&&requestThumb()}),this.subEntry("thumbUrl",thumbUrl=>{this._scheduleThumbUpdate(thumbUrl??void 0)}),this.subEntry("cdnUrlModifiers",requestThumb),this._requestThumbGeneration(!0)}initCallback(){super.initCallback(),this.subConfigValue("filesViewMode",viewMode=>{"grid"!==viewMode||this._renderedGridOnce||("list"===this._firstViewMode&&this._requestThumbGeneration(!0),this._renderedGridOnce=!0)})}connectedCallback(){super.connectedCallback(),this._observer?.disconnect(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:.1}),this._observer.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._debouncedGenerateThumb.cancel(),this._cancelPendingThumbUpdate(),this._observer?.disconnect()}render(){return(0,external_lit_.html)`<div class="uc-thumb"><img class="uc-thumb__img" src=${this._thumbUrl||transparentPixelSrc.d} role="img" alt="Preview of uploaded image" ?hidden=${!this._thumbUrl} draggable="false" /><div class="uc-badge"><uc-icon name=${this.badgeIcon}></uc-icon></div></div>`}constructor(...args){super(...args),this.badgeIcon="",this.uid="",this._thumbUrl="",this._renderedGridOnce=!1,this._thumbRect=null,this._isIntersecting=!1,this._firstViewMode=this.cfg.filesViewMode,this._generateThumbnail=this.withEntry(async(entry,force=!1)=>{let fileInfo=entry.getValue("fileInfo"),isImage=entry.getValue("isImage"),uuid=entry.getValue("uuid"),currentThumbUrl=entry.getValue("thumbUrl"),size=this._calculateThumbSize(force);if(fileInfo&&isImage&&uuid){let thumbUrl=await this.proxyUrl((0,cdn_utils.LN)((0,cdn_utils.vo)(this.cfg.cdnCname,uuid),(0,cdn_utils.$z)(entry.getValue("cdnUrlModifiers"),"stretch/off",`scale_crop/${size}x${size}/center`)));if(currentThumbUrl===thumbUrl)return;let{promise}=(0,preloadImage.N)(thumbUrl);promise.then(()=>{entry.setValue("thumbUrl",thumbUrl),currentThumbUrl?.startsWith("blob:")&&URL.revokeObjectURL(currentThumbUrl)}).catch(async()=>{if(!currentThumbUrl?.startsWith("blob:"))try{let file=entry.getValue("file");if(!file)return;let blobThumbUrl=await generateThumb(file,size);entry.setValue("thumbUrl",blobThumbUrl)}catch(err){this.telemetryManager.sendEventError(err,"thumbnail generation. Failed to generate thumb from file");let color=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");entry.setValue("thumbUrl",fileCssBg(color))}});return}if(entry.getValue("thumbUrl"))return;let file=entry.getValue("file");if(file?.type.includes("image"))try{let thumbUrl=await generateThumb(file,size);entry.setValue("thumbUrl",thumbUrl)}catch(err){this.telemetryManager.sendEventError(err,"thumbnail generation. Failed to generate thumb from file");let color=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");entry.setValue("thumbUrl",fileCssBg(color))}else{let color=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");entry.setValue("thumbUrl",fileCssBg(color))}}),this._debouncedGenerateThumb=(0,debounce.s)(this._generateThumbnail.bind(this),100)}}Thumb_ts_decorate([(0,decorators_js_.property)({type:String})],Thumb.prototype,"badgeIcon",void 0),Thumb_ts_decorate([(0,decorators_js_.property)({attribute:!1})],Thumb.prototype,"uid",void 0),Thumb_ts_decorate([(0,decorators_js_.state)()],Thumb.prototype,"_thumbUrl",void 0);class ActivityHeader extends LitActivityBlock.S{}class StartFrom extends LitActivityBlock.S{initCallback(){super.initCallback(),this.registerActivity(this.activityType??"")}render(){return(0,external_lit_.html)`<div class="uc-content">${this.yield("")}</div>`}constructor(...args){super(...args),this.historyTracked=!0,this.activityType=LitActivityBlock.S.activities.START_FROM}}class UploadCtxProvider extends LitUploaderBlock.z{static{this.styleAttrs=["uc-wgt-common"]}static{this.EventType=EventEmitter.Bx}initCallback(){super.initCallback(),this._unbindEventEmitter=this.eventEmitter.bindTarget(this)}disconnectedCallback(){super.disconnectedCallback(),this._unbindEventEmitter?.()}constructor(...args){super(...args),this._unbindEventEmitter=null}}var throttle=__webpack_require__(3442);function UploadList_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}class UploadList extends LitUploaderBlock.z{get _headerText(){return this._latestSummary?this._getHeaderText(this._latestSummary):""}_updateUploadsState(){let collectionState=this.api.getOutputCollectionState(),summary={total:collectionState.totalCount,succeed:collectionState.successCount,uploading:collectionState.uploadingCount,failed:collectionState.failedCount,validatingBeforeUploading:collectionState.idleEntries.filter(e=>e.isValidationPending).length},fitCountRestrictions=!collectionState.errors.some(err=>"TOO_MANY_FILES"===err.type||"TOO_FEW_FILES"===err.type),tooMany=collectionState.errors.some(err=>"TOO_MANY_FILES"===err.type),exact=collectionState.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),isValidationPending=collectionState.allEntries.some(entry=>entry.isValidationPending),validationOk=0===summary.failed&&0===collectionState.errors.length&&!isValidationPending,uploadBtnVisible=!1,allDone=!1,doneBtnEnabled=!1;if(summary.total-summary.succeed-summary.uploading-summary.failed>0&&fitCountRestrictions&&validationOk&&this.cfg.confirmUpload)uploadBtnVisible=!0;else{allDone=!0;let groupOk=!this.cfg.groupOutput||!!collectionState.group;doneBtnEnabled=summary.total===summary.succeed&&fitCountRestrictions&&validationOk&&groupOk}this._doneBtnVisible=allDone,this._doneBtnEnabled=doneBtnEnabled,this._uploadBtnVisible=uploadBtnVisible,this._addMoreBtnEnabled=0===summary.total||!tooMany&&!exact,this._addMoreBtnVisible=!exact||this.cfg.multiple,this._hasFiles=summary.total>0,this._latestSummary=summary}_getHeaderText(summary){let localizedText=status=>{let count=summary[status];return"uploading"===status&&(count+=summary.validatingBeforeUploading),this.l10n(`header-${status}`,{count:count})};return localizedText(summary.uploading>0||summary.validatingBeforeUploading>0?"uploading":summary.failed>0?"failed":summary.succeed>0?"succeed":"total")}get couldOpenActivity(){return this.cfg.showEmptyList||this.uploadCollection.size>0}initCallback(){super.initCallback(),this.registerActivity(this.activityType),this.subConfigValue("multiple",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMin",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMax",this._throttledHandleCollectionUpdate),this.sub("*groupInfo",groupInfo=>{groupInfo&&this._throttledHandleCollectionUpdate()}),this.subConfigValue("filesViewMode",mode=>{this.setAttribute("mode",mode)}),this.sub("*currentActivity",currentActivity=>{this.couldOpenActivity||currentActivity!==this.activityType||(this.$["*currentActivity"]=this.initActivity)}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.observeCollection(this._throttledHandleCollectionUpdate),this.sub("*collectionErrors",errors=>{let firstError=errors.filter(err=>"SOME_FILES_HAS_ERRORS"!==err.type)[0];if(!firstError){this._commonErrorMessage=null;return}this._commonErrorMessage=firstError.message})}disconnectedCallback(){super.disconnectedCallback(),this.has("*uploadCollection")&&(this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.unobserveCollection(this._throttledHandleCollectionUpdate))}render(){return(0,external_lit_.html)`<uc-activity-header><span aria-live="polite" class="uc-header-text">${this._headerText}</span><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-no-files" ?hidden=${this._hasFiles}> ${this.yield("empty",(0,external_lit_.html)`<span>${this.l10n("no-files")}</span>`)} </div><div class="uc-files"><div class="uc-files-wrapper"> ${(0,__rspack_external_lit_directives_repeat_js_fd3099f6.repeat)(this.$["*uploadList"]??[],({uid})=>uid,({uid})=>(0,external_lit_.html)`<uc-file-item .uid=${uid}></uc-file-item>`)} </div><button type="button" class="uc-add-more-btn uc-secondary-btn" @click=${this._handleAdd} ?disabled=${!this._addMoreBtnEnabled} ?hidden=${!this._addMoreBtnVisible} ><uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span></button></div><div class="uc-common-error" ?hidden=${!this._commonErrorMessage} > ${this._commonErrorMessage??""} </div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel}>${this.l10n("clear")}</button><div class="uc-toolbar-spacer"></div><button type="button" class="uc-add-more-btn uc-secondary-btn" ?hidden=${!this._addMoreBtnVisible} ?disabled=${!this._addMoreBtnEnabled} @click=${this._handleAdd} ><uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span></button><button type="button" class="uc-upload-btn uc-primary-btn" ?hidden=${!this._uploadBtnVisible} @click=${this._handleUpload} >${this.l10n("upload")}</button><button type="button" class="uc-done-btn uc-primary-btn" ?hidden=${!this._doneBtnVisible} ?disabled=${!this._doneBtnEnabled} @click=${this._handleDone} > ${this.l10n("done")} </button></div><uc-drop-area ghost></uc-drop-area>`}constructor(...args){super(...args),this.couldBeCtxOwner=!0,this.historyTracked=!0,this.activityType=LitActivityBlock.S.activities.UPLOAD_LIST,this._doneBtnVisible=!1,this._doneBtnEnabled=!1,this._uploadBtnVisible=!1,this._addMoreBtnVisible=!1,this._addMoreBtnEnabled=!1,this._commonErrorMessage=null,this._hasFiles=!1,this._latestSummary=null,this._handleAdd=()=>{this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{event:"add-more",node:this.tagName}}}),this.api.initFlow(!0)},this._handleUpload=()=>{this.emit(EventEmitter.Bx.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate()},this._handleDone=()=>{this.emit(EventEmitter.Bx.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow()},this._handleCancel=()=>{this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.ACTION_EVENT,payload:{metadata:{event:"clear-all",node:this.tagName}}}),this.uploadCollection.clearAll()},this._throttledHandleCollectionUpdate=(0,throttle.n)(()=>{this.isConnected&&(this._updateUploadsState(),this.couldOpenActivity||this.$["*currentActivity"]!==this.activityType||this.historyBack(),this.cfg.confirmUpload||this.api.uploadAll())},300)}}UploadList_ts_decorate([(0,decorators_js_.state)()],UploadList.prototype,"_doneBtnVisible",void 0),UploadList_ts_decorate([(0,decorators_js_.state)()],UploadList.prototype,"_doneBtnEnabled",void 0),UploadList_ts_decorate([(0,decorators_js_.state)()],UploadList.prototype,"_uploadBtnVisible",void 0),UploadList_ts_decorate([(0,decorators_js_.state)()],UploadList.prototype,"_addMoreBtnVisible",void 0),UploadList_ts_decorate([(0,decorators_js_.state)()],UploadList.prototype,"_addMoreBtnEnabled",void 0),UploadList_ts_decorate([(0,decorators_js_.state)()],UploadList.prototype,"_commonErrorMessage",void 0),UploadList_ts_decorate([(0,decorators_js_.state)()],UploadList.prototype,"_hasFiles",void 0),UploadList_ts_decorate([(0,decorators_js_.state)()],UploadList.prototype,"_latestSummary",void 0);var UrlSource=__webpack_require__(8130),CameraSource=__webpack_require__(4252),Config=__webpack_require__(8183);let DropzoneState=Object.freeze({ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3}),RESET_EVENTS=["focus"],nearnessRegistry=new Map;function addDropzone(desc){let eventCounter=0,body=document.body,switchHandlers=new Set,state=DropzoneState.INACTIVE,setState=newState=>{desc.shouldIgnore()&&newState!==DropzoneState.INACTIVE||(state!==newState&&switchHandlers.forEach(fn=>{fn(newState)}),state=newState)};switchHandlers.add(newState=>desc.onChange(newState));let onResetEvent=()=>{eventCounter=0,setState(DropzoneState.INACTIVE)},onDragEnter=()=>{eventCounter+=1,state===DropzoneState.INACTIVE&&setState(DropzoneState.ACTIVE)},onDragLeave=()=>{(eventCounter-=1)>0||setState(DropzoneState.INACTIVE)},onDrop=event=>{event.preventDefault(),eventCounter=0,setState(DropzoneState.INACTIVE)},onDragOver=event=>{let cx,cy;if(desc.shouldIgnore())return;eventCounter>0||(eventCounter+=1);let dragPoint=[event.x,event.y],targetRect=desc.element.getBoundingClientRect(),nearness=Math.floor((cx=Math.max(Math.min(dragPoint[0],targetRect.x+targetRect.width),targetRect.x),cy=Math.max(Math.min(dragPoint[1],targetRect.y+targetRect.height),targetRect.y),Math.sqrt((dragPoint[0]-cx)*(dragPoint[0]-cx)+(dragPoint[1]-cy)*(dragPoint[1]-cy)))),isNear=nearness<100,isOver=event.composedPath().includes(desc.element);nearnessRegistry.set(desc.element,nearness);let isNearest=Math.min(...nearnessRegistry.values())===nearness;isOver&&isNearest?(event.preventDefault(),setState(DropzoneState.OVER)):isNear&&isNearest?setState(DropzoneState.NEAR):setState(DropzoneState.ACTIVE)},onElementDrop=async event=>{if(desc.shouldIgnore())return;event.preventDefault();let{dataTransfer}=event;if(!dataTransfer)return;let items=await function(dataTransfer){let dropItems=[],promises=[];for(let i=0;i<dataTransfer.items.length;i++){let item=dataTransfer.items[i];if(item)if("file"===item.kind){let itemType=item.type;if("function"==typeof item.webkitGetAsEntry||"function"==typeof item.getAsEntry){let entry="function"==typeof item.webkitGetAsEntry?item.webkitGetAsEntry():item.getAsEntry?.();entry&&promises.push((function(webkitEntry,dataTransferItemType){return new Promise(resolve=>{let reading=0,dropItems=[],readEntry=entry=>{if(!entry){console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),resolve(null);return}entry.isFile?(reading++,entry.file(file=>{reading--;let clonedFile=new File([file],file.name,{type:file.type||dataTransferItemType});dropItems.push({type:"file",file:clonedFile,fullPath:entry.fullPath}),0===reading&&resolve(dropItems)})):entry.isDirectory&&readReaderContent(entry.createReader())},readReaderContent=reader=>{reading++,reader.readEntries(entries=>{for(let entry of(reading--,entries))readEntry(entry);0===reading&&resolve(dropItems)})};readEntry(webkitEntry)})})(entry,itemType).then(items=>{items&&dropItems.push(...items)}));continue}let file=item.getAsFile();file&&promises.push((function(file){return new Promise(resolve=>{"function"!=typeof window.FileReader&&resolve(!1);try{let reader=new FileReader;reader.onerror=()=>{resolve(!0)};let onLoad=event=>{"loadend"!==event.type&&reader.abort(),resolve(!1)};reader.onloadend=onLoad,reader.onprogress=onLoad,reader.readAsDataURL(file)}catch{resolve(!1)}})})(file).then(isDirectory=>{isDirectory||dropItems.push({type:"file",file})}))}else"string"===item.kind&&/^text\/uri-list/.test(item.type)&&promises.push(new Promise(resolve=>{item.getAsString(value=>{dropItems.push({type:"url",url:value}),resolve()})}))}return Promise.all(promises).then(()=>dropItems)}(dataTransfer);desc.onItems(items),setState(DropzoneState.INACTIVE)};return body.addEventListener("drop",onDrop),body.addEventListener("dragleave",onDragLeave),body.addEventListener("dragenter",onDragEnter),body.addEventListener("dragover",onDragOver),desc.element.addEventListener("drop",onElementDrop),RESET_EVENTS.forEach(eventName=>{window.addEventListener(eventName,onResetEvent)}),()=>{nearnessRegistry.delete(desc.element),body.removeEventListener("drop",onDrop),body.removeEventListener("dragleave",onDragLeave),body.removeEventListener("dragenter",onDragEnter),body.removeEventListener("dragover",onDragOver),desc.element.removeEventListener("drop",onElementDrop),RESET_EVENTS.forEach(eventName=>{window.removeEventListener(eventName,onResetEvent)})}}function DropArea_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}let dropAreaRegistry=new Set;class DropArea extends LitUploaderBlock.z{static{this.styleAttrs=[...super.styleAttrs,"uc-drop-area"]}get _localizedText(){let customText=this.text;return"string"==typeof customText&&customText.length>0?this.l10n(customText)||customText:this.l10n("drop-files-here")}isActive(){if(!this._isEnabled)return!1;let bounds=this.getBoundingClientRect(),hasSize=bounds.width>0&&bounds.height>0,isInViewport=bounds.top>=0&&bounds.left>=0&&bounds.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&bounds.right<=(window.innerWidth||document.documentElement.clientWidth),style=window.getComputedStyle(this),visible="hidden"!==style.visibility&&"none"!==style.display;return hasSize&&visible&&isInViewport}initCallback(){super.initCallback(),dropAreaRegistry.add(this),this._updateIsEnabled(),this._updateVisibility(),this._updateClickableListeners(),this._updateDragStateAttribute(DropzoneState.INACTIVE),this._destroyDropzone=addDropzone({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:state=>{this._updateDragStateAttribute(state)},onItems:items=>{items.length&&(items.forEach(item=>{"url"===item.type?this.api.addFileFromUrl(item.url,{source:UploadSource.pc.DROP_AREA}):"file"===item.type&&this.api.addFileFromObject(item.file,{source:UploadSource.pc.DROP_AREA,fullPath:item.fullPath})}),this.uploadCollection.size&&(this.set$({"*currentActivity":LitActivityBlock.S.activities.UPLOAD_LIST}),this.modalManager?.open(LitActivityBlock.S.activities.UPLOAD_LIST)))}}),this.updateComplete.then(()=>this._setupContentWrapperDropzone()),this.subConfigValue("sourceList",value=>{let list=(0,stringToArray.G)(value);this._sourceListAllowsLocal=list.includes(UploadSource.pc.LOCAL),this._updateIsEnabled(),this._updateVisibility()})}willUpdate(changedProperties){super.willUpdate(changedProperties),changedProperties.has("disabled")&&(this._updateIsEnabled(),this._updateVisibility())}updated(changedProperties){super.updated(changedProperties),changedProperties.has("clickable")&&this._updateClickableListeners()}_shouldIgnore(){return!(this._isEnabled&&this._couldHandleFiles())||!!this.fullscreen&&0!==dropAreaRegistry.size&&[...dropAreaRegistry].filter(el=>el!==this).filter(el=>el.isActive()).length>0}_couldHandleFiles(){let isMultiple=this.cfg.multiple,multipleMax=this.cfg.multipleMax,currentFilesCount=this.uploadCollection.size;return(!isMultiple||!multipleMax||!(currentFilesCount>=multipleMax))&&(!!isMultiple||!(currentFilesCount>0))}_updateIsEnabled(){let nextIsEnabled=this._sourceListAllowsLocal&&!this.disabled;this._isEnabled=nextIsEnabled}_updateVisibility(){let shouldBeVisible=this._isEnabled||!this.querySelector("[data-default-slot]");this._isVisible=shouldBeVisible,this.hidden=!shouldBeVisible}_updateDragStateAttribute(state){let stateText=Object.entries(DropzoneState).find(([,value])=>value===state)?.[0].toLowerCase();stateText&&this.setAttribute("drag-state",stateText)}_setupContentWrapperDropzone(){if(this._destroyContentWrapperDropzone)return;let contentWrapperEl=this._contentWrapperRef.value;contentWrapperEl&&(this._destroyContentWrapperDropzone=addDropzone({element:contentWrapperEl,onChange:state=>{let stateText=Object.entries(DropzoneState).find(([,value])=>value===state)?.[0].toLowerCase();stateText&&contentWrapperEl.setAttribute("drag-state",stateText)},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()}))}_updateClickableListeners(){this.clickable&&!this._clickableListenersAttached?(this.addEventListener("keydown",this._handleAreaInteraction),this.addEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=!0):!this.clickable&&this._clickableListenersAttached&&(this.removeEventListener("keydown",this._handleAreaInteraction),this.removeEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=!1)}disconnectedCallback(){super.disconnectedCallback(),dropAreaRegistry.delete(this),this._destroyDropzone?.(),this._destroyContentWrapperDropzone?.(),this._clickableListenersAttached&&(this.removeEventListener("keydown",this._handleAreaInteraction),this.removeEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=!1)}render(){return(0,external_lit_.html)` ${this.yield("",(0,external_lit_.html)`<div data-default-slot hidden></div><div ${(0,ref_js_.ref)(this._contentWrapperRef)} class="uc-content-wrapper" ?hidden=${!this._isVisible}><div class="uc-icon-container" ?hidden=${!this.withIcon}><uc-icon name="default"></uc-icon><uc-icon name="arrow-down"></uc-icon></div><span class="uc-text">${this._localizedText}</span></div>`)} `}constructor(...args){super(...args),this.single=!1,this.ghost=!1,this.disabled=!1,this.clickable=!1,this.withIcon=!1,this.fullscreen=!1,this.initflow=!1,this._isEnabled=!0,this._isVisible=!0,this._destroyDropzone=null,this._destroyContentWrapperDropzone=null,this._contentWrapperRef=(0,ref_js_.createRef)(),this._handleAreaInteraction=event=>{if(event instanceof KeyboardEvent){if("Space"!==event.code&&"Enter"!==event.code)return}else if(!(event instanceof MouseEvent))return;this.initflow?this.api.initFlow():this.api.openSystemDialog()},this._sourceListAllowsLocal=!0,this._clickableListenersAttached=!1}}DropArea_ts_decorate([(0,decorators_js_.property)({type:Boolean,noAccessor:!0})],DropArea.prototype,"single",void 0),DropArea_ts_decorate([(0,decorators_js_.property)({type:Boolean,noAccessor:!0})],DropArea.prototype,"ghost",void 0),DropArea_ts_decorate([(0,decorators_js_.property)({type:Boolean,reflect:!0})],DropArea.prototype,"disabled",void 0),DropArea_ts_decorate([(0,decorators_js_.property)({type:Boolean,reflect:!0})],DropArea.prototype,"clickable",void 0),DropArea_ts_decorate([(0,decorators_js_.property)({type:Boolean,attribute:"with-icon",reflect:!0})],DropArea.prototype,"withIcon",void 0),DropArea_ts_decorate([(0,decorators_js_.property)({type:Boolean,reflect:!0})],DropArea.prototype,"fullscreen",void 0),DropArea_ts_decorate([(0,decorators_js_.property)({type:Boolean,reflect:!0})],DropArea.prototype,"initflow",void 0),DropArea_ts_decorate([(0,decorators_js_.property)({type:String})],DropArea.prototype,"text",void 0),DropArea_ts_decorate([(0,decorators_js_.state)()],DropArea.prototype,"_isEnabled",void 0),DropArea_ts_decorate([(0,decorators_js_.state)()],DropArea.prototype,"_isVisible",void 0);var ExternalSource=__webpack_require__(7860),upload_client_=__webpack_require__(5474);function FileItem_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}let FileItemState=Object.freeze({FINISHED:Symbol("FINISHED"),FAILED:Symbol("FAILED"),UPLOADING:Symbol("UPLOADING"),VALIDATION:Symbol("VALIDATION"),QUEUED_UPLOADING:Symbol("QUEUED-UPLOADING"),QUEUED_VALIDATION:Symbol("QUEUED-VALIDATION"),IDLE:Symbol("IDLE")});class FileItem extends FileItemConfig{_calculateState(){let entry=this.entry;if(!entry)return;let state=FileItemState.IDLE;entry.getValue("errors").length>0?state=FileItemState.FAILED:entry.getValue("isQueuedForUploading")?state=FileItemState.QUEUED_UPLOADING:entry.getValue("isQueuedForValidation")?state=FileItemState.QUEUED_VALIDATION:entry.getValue("isValidationPending")?state=FileItemState.VALIDATION:entry.getValue("isUploading")?state=FileItemState.UPLOADING:entry.getValue("fileInfo")&&(state=FileItemState.FINISHED),this._handleState(entry,state)}_handleState(entry,state){state===FileItemState.FAILED?this._badgeIcon="badge-error":state===FileItemState.FINISHED&&(this._badgeIcon="badge-success"),state===FileItemState.UPLOADING&&(this._isFocused=!1,this.removeAttribute("focused")),this._isFailed=state===FileItemState.FAILED,this._isUploading=state===FileItemState.UPLOADING,this._isFinished=state===FileItemState.FINISHED,this._updateHintAndProgress(state)}reset(){super.reset(),this._debouncedCalculateState.cancel()}_observerCallback(entries){let[entry]=entries;entry&&entry.isIntersecting&&!this._renderedOnce&&(this._pauseRender=!1,this._renderedOnce=!0)}_handleEntryId(id){this.reset();let entry=this.uploadCollection?.read(id);(this.entry=entry,entry)?(this.subEntry("isQueuedForValidation",()=>{this._debouncedCalculateState()}),this.subEntry("isValidationPending",()=>{this._debouncedCalculateState()}),this.subEntry("uploadProgress",()=>{this._debouncedCalculateState()}),this.subEntry("isQueuedForUploading",()=>{this._debouncedCalculateState()}),this.subEntry("fileName",name=>{this._itemName=name||entry.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState()}),this.subEntry("externalUrl",externalUrl=>{this._itemName=entry.getValue("fileName")||externalUrl||this.l10n("file-no-name")}),this.subEntry("fileInfo",()=>{this._debouncedCalculateState()}),this.subEntry("errors",()=>this._debouncedCalculateState()),this.subEntry("isUploading",()=>this._debouncedCalculateState()),this.subEntry("fileSize",()=>this._debouncedCalculateState()),this.subEntry("mimeType",()=>this._debouncedCalculateState()),this.subEntry("isImage",()=>this._debouncedCalculateState()),this.subEntry("fileInfo",()=>this._updatePluginFileActions()),this.subEntry("isUploading",()=>this._updatePluginFileActions()),this.subEntry("errors",()=>this._updatePluginFileActions()),this._calculateState(),this._updatePluginFileActions(),this._applyOnAddHooks(entry)):this._updatePluginFileActions()}async _applyOnAddHooks(entry){let initialFile=entry.getValue("file");if(!initialFile)return;let pluginManager=this._sharedInstancesBag.pluginManager,onAddHooks=(pluginManager?.snapshot().fileHooks??[]).filter(h=>"onAdd"===h.type),file=initialFile,mimeType=entry.getValue("mimeType");for(let hook of onAddHooks)try{({file,mimeType}=await hook.handler({file,mimeType}))}catch(error){this.debugPrint(`File hook "onAdd" from plugin "${hook.pluginId}" failed`,error)}file!==initialFile&&(entry.setValue("file",file),entry.setValue("fileSize",file.size)),mimeType!==entry.getValue("mimeType")&&entry.setValue("mimeType",mimeType)}_updateShowFileNames(value){if("list"===this.cfg.filesViewMode){this._showFileNames=!0;return}this._showFileNames=value}willUpdate(changedProperties){super.willUpdate(changedProperties),changedProperties.has("uid")&&this._handleEntryId(this.uid)}_updatePluginFileActions(){let pluginManager=this._sharedInstancesBag.pluginManager;if(!pluginManager||!this.uid){this._pluginFileActions=[];return}let allFileActions=pluginManager.snapshot().fileActions,outputFileEntry=this.api.getOutputItem(this.uid);if(!outputFileEntry){this._pluginFileActions=[];return}this._pluginFileActions=allFileActions.filter(action=>{try{return action.shouldRender(outputFileEntry)}catch(error){return console.error(`Error in plugin file action shouldRender (${action.id}):`,error),!1}})}_handlePluginFileAction(action){if(!this.uid)return;let outputFileEntry=this.api.getOutputItem(this.uid);if(outputFileEntry)try{action.onClick(outputFileEntry)}catch(error){console.error(`Error in plugin file action onClick (${action.id}):`,error)}}initCallback(){super.initCallback(),this._handleEntryId(this.uid),this.subConfigValue("filesViewMode",mode=>{this._updateShowFileNames(this.cfg.gridShowFileNames),this.setAttribute("mode",mode)}),this.subConfigValue("gridShowFileNames",value=>{this._updateShowFileNames(value)}),this.onclick=()=>{FileItem.activeInstances.forEach(inst=>{inst===this?inst.setAttribute("focused",""):inst.removeAttribute("focused")})},this.sub("*uploadTrigger",itemsToUpload=>{(!this.entry||itemsToUpload.has(this.entry.uid))&&setTimeout(()=>this.isConnected&&this._upload())});let pluginManager=this._sharedInstancesBag.pluginManager;pluginManager?.onPluginsChange&&(this._unsubscribePlugins=pluginManager.onPluginsChange(()=>this._updatePluginFileActions())),this._updatePluginFileActions(),FileItem.activeInstances.add(this)}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this)}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback(),this._observer?.disconnect(),FileItem.activeInstances.delete(this),this.reset()}static{this.activeInstances=new Set}shouldUpdate(changedProperties){return!this._pauseRender&&super.shouldUpdate(changedProperties)}render(){return(0,external_lit_.html)`<div class="uc-inner" ?data-finished=${this._isFinished} ?data-uploading=${this._isUploading} ?data-failed=${this._isFailed} ?data-focused=${this._isFocused} ><uc-thumb .uid=${this.uid} .badgeIcon=${this._badgeIcon}></uc-thumb><div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" aria-label=${this._ariaLabelStatusFile}><span class="uc-file-name" ?hidden=${!this._showFileNames}>${this._itemName}</span><span class="uc-file-error" ?hidden=${!this._errorText}>${this._errorText}</span><span class="uc-file-hint" ?hidden=${!this._hint}>${this._hint}</span></div><div class="uc-file-actions"> ${this._pluginFileActions.map(action=>(0,external_lit_.html)`<button type="button" @click=${()=>this._handlePluginFileAction(action)} title=${action.id} aria-label=${action.id} class="uc-plugin-action-btn uc-mini-btn" data-plugin-action-id=${action.id} ><uc-icon name=${action.icon}></uc-icon></button>`)} <button type="button" @click=${this._handleRemove} title=${this.l10n("file-item-remove-button")} aria-label=${this.l10n("file-item-remove-button")} class="uc-remove-btn uc-mini-btn" ><uc-icon name="remove-file"></uc-icon></button><button type="button" class="uc-upload-btn uc-mini-btn" @click=${this._handleUploadClick}><uc-icon name="upload"></uc-icon></button></div><uc-progress-bar class="uc-progress-bar" .value=${this._progressValue} .visible=${this._progressVisible} ?hasFileName=${this._showFileNames}></uc-progress-bar></div>`}constructor(...args){super(...args),this.couldBeCtxOwner=!0,this._pauseRender=!0,this.uid="",this._itemName="",this._errorText="",this._hint="",this._progressValue=0,this._progressVisible=!1,this._badgeIcon="",this._isFinished=!1,this._isFailed=!1,this._isUploading=!1,this._isFocused=!1,this._showFileNames=!1,this._ariaLabelStatusFile="",this._pluginFileActions=[],this._renderedOnce=!1,this._handleRemove=()=>{this.telemetryManager.sendEvent({payload:{metadata:{event:"remove-file",node:this.tagName}}}),this.uid&&this.uploadCollection.hasItem(this.uid)&&this.uploadCollection.remove(this.uid)},this._handleUploadClick=()=>{this._upload()},this._debouncedCalculateState=(0,debounce.s)(()=>this._calculateState(),100),this._updateHintAndProgress=this.withEntry((0,throttle.n)((entry,state)=>{let errorText=entry.getValue("errors")?.[0]?.message??"",source=entry.getValue("source"),externalUrl=entry.getValue("externalUrl"),isFinished=state===FileItemState.FINISHED,isUploading=state===FileItemState.UPLOADING,isQueuedForUploading=state===FileItemState.QUEUED_UPLOADING,isQueuedForValidation=state===FileItemState.QUEUED_VALIDATION,isValidationPending=state===FileItemState.VALIDATION,fileName=entry.getValue("fileName"),hint="";errorText?hint="":!isFinished&&externalUrl&&source&&Object.values(UploadSource.y5).includes(source)&&(hint=this.l10n("waiting-for",{source:this.l10n(`src-type-${source}`)})),this._hint=hint,this._errorText=errorText,this._progressVisible=isUploading||isQueuedForUploading||isQueuedForValidation||isValidationPending,this._progressValue=isQueuedForValidation||isValidationPending?0:entry.getValue("uploadProgress"),this._ariaLabelStatusFile=fileName?this.l10n("a11y-file-item-status",{fileName,status:this.l10n(state?.description?.toLocaleLowerCase()??"").toLocaleLowerCase()}):""},100)),this._upload=this.withEntry(async entry=>{if(!this.uploadCollection.read(entry.uid)||entry.getValue("fileInfo")||entry.getValue("isUploading")||entry.getValue("errors").length>0||entry.getValue("isValidationPending"))return;let multipleMax=this.cfg.multiple?this.cfg.multipleMax:1;if(!multipleMax||!(this.uploadCollection.size>multipleMax)){entry.setMultipleValues({isUploading:!0,errors:[],isQueuedForUploading:!0}),this._debouncedCalculateState();try{let abortController=new AbortController;entry.setValue("abortController",abortController);let uploadTask=async()=>{entry.setValue("isQueuedForUploading",!1);let file=entry.getValue("file");if(file instanceof File||file instanceof Blob){let pluginManager=this._sharedInstancesBag.pluginManager;for(let hook of(pluginManager?.snapshot().fileHooks??[]).filter(h=>"beforeUpload"===h.type))try{let{file:newFile,mimeType:newMimeType}=await hook.handler({file,mimeType:entry.getValue("mimeType")});file=newFile,newMimeType!==entry.getValue("mimeType")&&entry.setValue("mimeType",newMimeType)}catch(error){this.debugPrint(`File hook "beforeUpload" from plugin "${hook.pluginId}" failed`,error)}}let fileInput=file||entry.getValue("externalUrl")||entry.getValue("uuid");if(!fileInput)throw Error("No file input");let uploadClientOptions={...await this.getUploadClientOptions(),fileName:entry.getValue("fileName")??void 0,source:entry.getValue("source")??void 0,onProgress:progress=>{if(progress.isComputable){let percentage=100*progress.value;entry.setValue("uploadProgress",percentage)}},signal:abortController.signal,metadata:await this.getMetadataFor(entry.uid)};return this.debugPrint("upload options",fileInput,uploadClientOptions),(0,upload_client_.uploadFile)(fileInput,uploadClientOptions)},fileInfo=await this.$["*uploadQueue"].add(uploadTask);entry.setMultipleValues({fileInfo,isQueuedForUploading:!1,isUploading:!1,fileName:fileInfo.originalFilename,fileSize:fileInfo.size,isImage:fileInfo.isImage??!1,mimeType:fileInfo.contentInfo?.mime?.mime??fileInfo.mimeType,uuid:fileInfo.uuid,cdnUrl:entry.getValue("cdnUrl")??fileInfo.cdnUrl,cdnUrlModifiers:entry.getValue("cdnUrlModifiers")??"",uploadProgress:100,source:entry.getValue("source")??null}),entry===this.entry&&this._debouncedCalculateState()}catch(cause){this.telemetryManager.sendEventError(cause,"file upload. Failed to upload file"),cause instanceof upload_client_.CancelError&&cause.isCancel?entry.setMultipleValues({isUploading:!1,uploadProgress:0}):cause instanceof upload_client_.UploadcareError?entry.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:cause}):(console.error("Unknown upload error",cause),entry.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:Error("Something went wrong",{cause})})),entry===this.entry&&this._debouncedCalculateState()}}})}}function SimpleBtn_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_pauseRender",void 0),FileItem_ts_decorate([(0,decorators_js_.property)({attribute:!1})],FileItem.prototype,"uid",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_itemName",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_errorText",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_hint",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_progressValue",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_progressVisible",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_badgeIcon",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_isFinished",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_isFailed",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_isUploading",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_isFocused",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_showFileNames",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_ariaLabelStatusFile",void 0),FileItem_ts_decorate([(0,decorators_js_.state)()],FileItem.prototype,"_pluginFileActions",void 0);class SimpleBtn extends LitUploaderBlock.z{static{this.styleAttrs=[...super.styleAttrs,"uc-simple-btn"]}initCallback(){super.initCallback(),this.subConfigValue("multiple",val=>{this._buttonTextKey=val?"upload-files":"upload-file"})}render(){return(0,external_lit_.html)`<uc-drop-area .disabled=${!this.dropzone}><button type="button" @click=${this._handleClick}><uc-icon name="upload"></uc-icon><span>${this.l10n(this._buttonTextKey)}</span> ${this.yield("")} <div class="uc-visual-drop-area">${this.l10n("drop-files-here")}</div></button></uc-drop-area>`}constructor(...args){super(...args),this.couldBeCtxOwner=!0,this.dropzone=!0,this._buttonTextKey="upload-file",this._handleClick=()=>{this.api.initFlow()}}}function PluginActivityRenderer_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}SimpleBtn_ts_decorate([(0,decorators_js_.property)({attribute:"dropzone",type:Boolean})],SimpleBtn.prototype,"dropzone",void 0),SimpleBtn_ts_decorate([(0,decorators_js_.state)()],SimpleBtn.prototype,"_buttonTextKey",void 0);class PluginActivityHost extends LitActivityBlock.S{initCallback(){this.activityType=this.registration?.id??null,super.initCallback(),this._ensureRegistered()}willUpdate(changedProperties){super.willUpdate(changedProperties),changedProperties.has("registration")&&(this._ensureRegistered(),this.isActivityActive&&(this._disposeActivity(),this._renderActivity()))}_ensureRegistered(){!this.registration||this._isActivityRegistered()||this.registerActivity(this.activityType??"",{onActivate:()=>this._renderActivity(),onDeactivate:()=>this._disposeActivity()})}_renderActivity(){let container=this._containerRef.value;if(!container||!this.registration)return;this._disposeActivity();let activityParams=this.$["*currentActivityParams"];this._dispose=this.registration.render(container,activityParams)??void 0}_disposeActivity(){this._dispose?.(),this._dispose=void 0;let container=this._containerRef.value;container&&container.replaceChildren()}disconnectedCallback(){this._disposeActivity(),super.disconnectedCallback()}render(){return(0,external_lit_.html)`<div style="display: flex; flex-direction: column; width: 100%; min-height: 0;" ${(0,ref_js_.ref)(this._containerRef)} ></div>`}constructor(...args){super(...args),this.activityType=null,this._containerRef=(0,ref_js_.createRef)()}}PluginActivityRenderer_ts_decorate([(0,decorators_js_.property)({attribute:!1})],PluginActivityHost.prototype,"registration",void 0);class PluginActivityRenderer extends LitBlock.x{initCallback(){super.initCallback();let pluginManager=this._sharedInstancesBag.pluginManager;pluginManager?.onPluginsChange&&(this._unsubscribePlugins=pluginManager.onPluginsChange(()=>this._syncActivities())),this._syncActivities()}_syncActivities(){let pluginManager=this._sharedInstancesBag.pluginManager;if(!pluginManager){this._activities=[];return}this._activities=pluginManager.snapshot().activities}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback()}render(){return"inline"===this.mode?(0,external_lit_.html)`${(0,__rspack_external_lit_directives_repeat_js_fd3099f6.repeat)(this._activities,activity=>activity.id,activity=>(0,external_lit_.html)`<uc-plugin-activity-host .registration=${activity}></uc-plugin-activity-host>`)}`:(0,external_lit_.html)`${(0,__rspack_external_lit_directives_repeat_js_fd3099f6.repeat)(this._activities,activity=>activity.id,activity=>(0,external_lit_.html)`<uc-modal id=${activity.id} strokes block-body-scrolling><uc-plugin-activity-host .registration=${activity}></uc-plugin-activity-host></uc-modal>`)}`}constructor(...args){super(...args),this.mode="modal",this._activities=[]}}PluginActivityRenderer_ts_decorate([(0,decorators_js_.property)({type:String})],PluginActivityRenderer.prototype,"mode",void 0),PluginActivityRenderer_ts_decorate([(0,decorators_js_.state)()],PluginActivityRenderer.prototype,"_activities",void 0);class FileUploaderRegular extends LitSolutionBlock{static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-regular"]}constructor(){super(),this.headless=!1,this.init$={...this.init$}}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.INIT_SOLUTION})}render(){return(0,external_lit_.html)`${super.render()} <uc-simple-btn ?hidden=${this.headless}></uc-simple-btn><uc-modal id="start-from" strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]}>${this.l10n("start-from-cancel")}</button><uc-copyright></uc-copyright></uc-start-from></uc-modal><uc-modal id="upload-list" strokes block-body-scrolling><uc-upload-list></uc-upload-list></uc-modal><uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>`}}!function(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);c>3&&r&&Object.defineProperty(target,key,r)}([(0,decorators_js_.property)({type:Boolean})],FileUploaderRegular.prototype,"headless",void 0);class FileUploaderInline extends LitSolutionBlock{static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-inline"]}constructor(){super(),this._couldCancel=!1,this._handleCancel=()=>{if(this._couldHistoryBack){let historyBack=this.$["*historyBack"];historyBack?.();return}this._couldShowList&&(this.$["*currentActivity"]=LitActivityBlock.S.activities.UPLOAD_LIST)},this.init$={...this.init$}}get _couldHistoryBack(){let history=this.$["*history"];return!!history&&!(history.length<=1)&&history[history.length-1]!==LitActivityBlock.S.activities.START_FROM}get _couldShowList(){let uploadList=this.$["*uploadList"];return this.cfg.showEmptyList||Array.isArray(uploadList)&&uploadList.length>0}_getInitActivity(){return this.getCssData("--cfg-init-activity")||LitActivityBlock.S.activities.START_FROM}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.INIT_SOLUTION});let initActivity=this._getInitActivity();this.sub("*currentActivity",val=>{val||(this.$["*currentActivity"]=initActivity)}),this.sub("*uploadList",list=>{Array.isArray(list)&&list.length>0&&this.$["*currentActivity"]===initActivity&&(this.$["*currentActivity"]=LitActivityBlock.S.activities.UPLOAD_LIST)}),this.sub("*history",()=>{this._couldCancel=this._couldHistoryBack||this._couldShowList})}render(){return(0,external_lit_.html)`${super.render()} <uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel} ?hidden=${!this._couldCancel} > ${this.l10n("start-from-cancel")} </button><uc-copyright></uc-copyright></uc-start-from><uc-upload-list></uc-upload-list><uc-plugin-activity-renderer mode="inline"></uc-plugin-activity-renderer>`}}function FileUploaderMinimal_ts_decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}!function(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);c>3&&r&&Object.defineProperty(target,key,r)}([(0,decorators_js_.state)()],FileUploaderInline.prototype,"_couldCancel",void 0);let ACTIVE_CLASS="active";class FileUploaderMinimal extends LitSolutionBlock{static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-minimal"]}_getInitActivity(){return this.getCssData("--cfg-init-activity")||LitActivityBlock.S.activities.START_FROM}constructor(){super(),this._singleUpload=!1,this._isHiddenStartFrom=!1,this._classUploadList="",this._classStartFrom="",this._handleModalOpen=data=>{data.id===LitActivityBlock.S.activities.CLOUD_IMG_EDIT&&(this._classUploadList=ACTIVE_CLASS),this.$["*currentActivity"]===LitActivityBlock.S.activities.UPLOAD_LIST&&(this._classUploadList=ACTIVE_CLASS,this._isHiddenStartFrom=!0);let uploadList=this.$["*uploadList"];(!uploadList||uploadList.length<=0)&&(this._classStartFrom=ACTIVE_CLASS)},this._handleModalClose=data=>{data.id===this.$["*currentActivity"]&&(this.$["*currentActivity"]=LitActivityBlock.S.activities.UPLOAD_LIST,this._isHiddenStartFrom=!1),data.id===LitActivityBlock.S.activities.CLOUD_IMG_EDIT&&(this.$["*currentActivity"]=LitActivityBlock.S.activities.UPLOAD_LIST)},this.init$={...this.init$}}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:EventEmitter.Kc.INIT_SOLUTION});let initActivity=this._getInitActivity();this.sub("*currentActivity",val=>{val===LitActivityBlock.S.activities.UPLOAD_LIST&&this.modalManager?.closeAll(),val||(this.$["*currentActivity"]=initActivity)}),this.sub("*uploadList",list=>{Array.isArray(list)&&list.length>0?(this.$["*currentActivity"]=LitActivityBlock.S.activities.UPLOAD_LIST,this._classStartFrom=""):(this._classUploadList="",this._isHiddenStartFrom=!1,this.$["*currentActivity"]=initActivity)}),this.subConfigValue("confirmUpload",confirmUpload=>{!1!==confirmUpload&&(this.cfg.confirmUpload=!1)}),this.subConfigValue("filesViewMode",mode=>{this.setAttribute("mode",mode),this.subConfigValue("multiple",multiple=>{"grid"===mode?(multiple?this.style.removeProperty("--uc-grid-col"):this.style.setProperty("--uc-grid-col","1"),this._singleUpload=!multiple):(this.style.removeProperty("--uc-grid-col"),this._singleUpload=!1)})}),this.modalManager?.subscribe(ModalManager.D.OPEN,this._handleModalOpen),this.modalManager?.subscribe(ModalManager.D.CLOSE,this._handleModalClose)}disconnectedCallback(){super.disconnectedCallback(),this.modalManager?.unsubscribe(ModalManager.D.OPEN,this._handleModalOpen),this.modalManager?.unsubscribe(ModalManager.D.CLOSE,this._handleModalClose)}render(){return(0,external_lit_.html)`${super.render()} <uc-start-from ?hidden=${this._isHiddenStartFrom} class=${this._classStartFrom}><uc-drop-area ?single=${this._singleUpload} initflow clickable tabindex="0" ><span>${this.l10n("choose-file")}</span></uc-drop-area><uc-copyright></uc-copyright></uc-start-from><uc-upload-list class=${this._classUploadList}></uc-upload-list><uc-modal id="start-from" strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]} >${this.l10n("start-from-cancel")}</button></uc-start-from></uc-modal><uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>`}}FileUploaderMinimal_ts_decorate([(0,decorators_js_.state)()],FileUploaderMinimal.prototype,"_singleUpload",void 0),FileUploaderMinimal_ts_decorate([(0,decorators_js_.state)()],FileUploaderMinimal.prototype,"_isHiddenStartFrom",void 0),FileUploaderMinimal_ts_decorate([(0,decorators_js_.state)()],FileUploaderMinimal.prototype,"_classUploadList",void 0),FileUploaderMinimal_ts_decorate([(0,decorators_js_.state)()],FileUploaderMinimal.prototype,"_classStartFrom",void 0)})();var __webpack_exports__ActivityBlock=__webpack_exports__.hC,__webpack_exports__ActivityHeader=__webpack_exports__.vr,__webpack_exports__BaseComponent=__webpack_exports__.$G,__webpack_exports__Block=__webpack_exports__.eB,__webpack_exports__CameraSource=__webpack_exports__.ru,__webpack_exports__Config=__webpack_exports__.TS,__webpack_exports__Copyright=__webpack_exports__.Y0,__webpack_exports__Data=__webpack_exports__.B_,__webpack_exports__DropArea=__webpack_exports__.JU,__webpack_exports__ExternalSource=__webpack_exports__.Bp,__webpack_exports__ExternalUploadSource=__webpack_exports__.y5,__webpack_exports__FileItem=__webpack_exports__.I3,__webpack_exports__FileUploaderInline=__webpack_exports__.Az,__webpack_exports__FileUploaderMinimal=__webpack_exports__.eK,__webpack_exports__FileUploaderRegular=__webpack_exports__.vY,__webpack_exports__FormInput=__webpack_exports__.ZQ,__webpack_exports__Icon=__webpack_exports__.In,__webpack_exports__Img=__webpack_exports__.E9,__webpack_exports__Modal=__webpack_exports__.aF,__webpack_exports__ModalEvents=__webpack_exports__.Do,__webpack_exports__PACKAGE_NAME=__webpack_exports__.rM,__webpack_exports__PACKAGE_VERSION=__webpack_exports__.i8,__webpack_exports__PluginActivityHost=__webpack_exports__.rt,__webpack_exports__PluginActivityRenderer=__webpack_exports__.wB,__webpack_exports__ProgressBar=__webpack_exports__.z2,__webpack_exports__ProgressBarCommon=__webpack_exports__.qB,__webpack_exports__Select=__webpack_exports__.l6,__webpack_exports__SimpleBtn=__webpack_exports__.jj,__webpack_exports__SolutionBlock=__webpack_exports__.Vd,__webpack_exports__SourceBtn=__webpack_exports__.s9,__webpack_exports__SourceList=__webpack_exports__.Ar,__webpack_exports__Spinner=__webpack_exports__.y$,__webpack_exports__StartFrom=__webpack_exports__.Zz,__webpack_exports__Thumb=__webpack_exports__.zi,__webpack_exports__UID=__webpack_exports__.V0,__webpack_exports__UploadCtxProvider=__webpack_exports__._Q,__webpack_exports__UploadList=__webpack_exports__.cx,__webpack_exports__UploadSource=__webpack_exports__.pc,__webpack_exports__UploaderBlock=__webpack_exports__.iE,__webpack_exports__UrlSource=__webpack_exports__.Ts,__webpack_exports__defineComponents=__webpack_exports__.Yi,__webpack_exports__defineLocale=__webpack_exports__.mO,__webpack_exports__loadFileUploaderFrom=__webpack_exports__.DJ,__webpack_exports__toKebabCase=__webpack_exports__.fX;export{__webpack_exports__ActivityBlock as ActivityBlock,__webpack_exports__ActivityHeader as ActivityHeader,__webpack_exports__BaseComponent as BaseComponent,__webpack_exports__Block as Block,__webpack_exports__CameraSource as CameraSource,__webpack_exports__Config as Config,__webpack_exports__Copyright as Copyright,__webpack_exports__Data as Data,__webpack_exports__DropArea as DropArea,__webpack_exports__ExternalSource as ExternalSource,__webpack_exports__ExternalUploadSource as ExternalUploadSource,__webpack_exports__FileItem as FileItem,__webpack_exports__FileUploaderInline as FileUploaderInline,__webpack_exports__FileUploaderMinimal as FileUploaderMinimal,__webpack_exports__FileUploaderRegular as FileUploaderRegular,__webpack_exports__FormInput as FormInput,__webpack_exports__Icon as Icon,__webpack_exports__Img as Img,__webpack_exports__Modal as Modal,__webpack_exports__ModalEvents as ModalEvents,__webpack_exports__PACKAGE_NAME as PACKAGE_NAME,__webpack_exports__PACKAGE_VERSION as PACKAGE_VERSION,__webpack_exports__PluginActivityHost as PluginActivityHost,__webpack_exports__PluginActivityRenderer as PluginActivityRenderer,__webpack_exports__ProgressBar as ProgressBar,__webpack_exports__ProgressBarCommon as ProgressBarCommon,__webpack_exports__Select as Select,__webpack_exports__SimpleBtn as SimpleBtn,__webpack_exports__SolutionBlock as SolutionBlock,__webpack_exports__SourceBtn as SourceBtn,__webpack_exports__SourceList as SourceList,__webpack_exports__Spinner as Spinner,__webpack_exports__StartFrom as StartFrom,__webpack_exports__Thumb as Thumb,__webpack_exports__UID as UID,__webpack_exports__UploadCtxProvider as UploadCtxProvider,__webpack_exports__UploadList as UploadList,__webpack_exports__UploadSource as UploadSource,__webpack_exports__UploaderBlock as UploaderBlock,__webpack_exports__UrlSource as UrlSource,__webpack_exports__defineComponents as defineComponents,__webpack_exports__defineLocale as defineLocale,__webpack_exports__loadFileUploaderFrom as loadFileUploaderFrom,__webpack_exports__toKebabCase as toKebabCase};