pcm-agents 0.6.11 → 0.6.13

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 (292) hide show
  1. package/dist/cjs/error-event-J_ZWIqWF.js +33 -0
  2. package/dist/cjs/error-event-J_ZWIqWF.js.map +1 -0
  3. package/dist/cjs/{index-CvEfNyEj.js → index-CRlt8Nv6.js} +53 -3
  4. package/dist/cjs/index-CRlt8Nv6.js.map +1 -0
  5. package/dist/cjs/index-WNdOTXnX.js +11068 -0
  6. package/dist/cjs/index-WNdOTXnX.js.map +1 -0
  7. package/dist/cjs/index.cjs.js +2 -2
  8. package/dist/cjs/loader.cjs.js +3 -5
  9. package/dist/cjs/loader.cjs.js.map +1 -1
  10. package/dist/cjs/message.service-DGUsA-FY.js +135 -0
  11. package/dist/cjs/message.service-DGUsA-FY.js.map +1 -0
  12. package/dist/cjs/{pcm-1zhanshi-mnms-modal_17.cjs.entry.js → pcm-1zhanshi-mnms-modal_21.cjs.entry.js} +3276 -216
  13. package/dist/cjs/pcm-1zhanshi-mnms-modal_21.cjs.entry.js.map +1 -0
  14. package/dist/cjs/pcm-agents.cjs.js +4 -6
  15. package/dist/cjs/pcm-agents.cjs.js.map +1 -1
  16. package/dist/cjs/pcm-message.cjs.entry.js +3 -3
  17. package/dist/cjs/pcm-message.cjs.entry.js.map +1 -1
  18. package/dist/cjs/pcm-message.entry.cjs.js.map +1 -1
  19. package/dist/cjs/pcm-mnms-video-modal.cjs.entry.js +8 -8
  20. package/dist/cjs/pcm-mnms-video-modal.cjs.entry.js.map +1 -1
  21. package/dist/cjs/pcm-mnms-video-modal.entry.cjs.js.map +1 -1
  22. package/dist/cjs/pcm-mnms-zp-modal.cjs.entry.js +29 -86
  23. package/dist/cjs/pcm-mnms-zp-modal.cjs.entry.js.map +1 -1
  24. package/dist/cjs/pcm-mnms-zp-modal.entry.cjs.js.map +1 -1
  25. package/dist/cjs/{sentry-reporter-BWFtw_aT.js → sentry-reporter-tpI4WdkE.js} +12 -40
  26. package/dist/cjs/sentry-reporter-tpI4WdkE.js.map +1 -0
  27. package/dist/collection/collection-manifest.json +5 -1
  28. package/dist/collection/components/pcm-1zhanshi-mnms-modal/pcm-1zhanshi-mnms-modal.js.map +1 -1
  29. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +986 -986
  30. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +7 -9
  31. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
  32. package/dist/collection/components/pcm-button/pcm-button.css +199 -199
  33. package/dist/collection/components/pcm-button/pcm-button.js +6 -6
  34. package/dist/collection/components/pcm-button/pcm-button.js.map +1 -1
  35. package/dist/collection/components/pcm-card/pcm-card.css +259 -259
  36. package/dist/collection/components/pcm-card/pcm-card.js +1 -1
  37. package/dist/collection/components/pcm-card/pcm-card.js.map +1 -1
  38. package/dist/collection/components/pcm-chat-message/pcm-chat-message.css +554 -554
  39. package/dist/collection/components/pcm-chat-message/pcm-chat-message.js +3 -3
  40. package/dist/collection/components/pcm-chat-message/pcm-chat-message.js.map +1 -1
  41. package/dist/collection/components/pcm-drawer/pcm-drawer.css +102 -102
  42. package/dist/collection/components/pcm-drawer/pcm-drawer.js +1 -1
  43. package/dist/collection/components/pcm-drawer/pcm-drawer.js.map +1 -1
  44. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.css +854 -854
  45. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +5 -7
  46. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
  47. package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.css +95 -95
  48. package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.js +1 -1
  49. package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.js.map +1 -1
  50. package/dist/collection/components/pcm-hyzj-modal/pcm-hyzj-modal.js +2 -2
  51. package/dist/collection/components/pcm-hyzj-modal/pcm-hyzj-modal.js.map +1 -1
  52. package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.css +312 -312
  53. package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.js +1 -1
  54. package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.js.map +1 -1
  55. package/dist/collection/components/pcm-jlpp-modal/pcm-jlpp-modal.js +2 -2
  56. package/dist/collection/components/pcm-jlpp-modal/pcm-jlpp-modal.js.map +1 -1
  57. package/dist/collection/components/pcm-message/pcm-message.css +64 -64
  58. package/dist/collection/components/pcm-message/pcm-message.js +2 -2
  59. package/dist/collection/components/pcm-message/pcm-message.js.map +1 -1
  60. package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.css +1 -1
  61. package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.js +2 -2
  62. package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.js.map +1 -1
  63. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +67 -84
  64. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
  65. package/dist/collection/components/pcm-mnms-video-modal/pcm-mnms-video-modal.js +2 -2
  66. package/dist/collection/components/pcm-mnms-video-modal/pcm-mnms-video-modal.js.map +1 -1
  67. package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js +67 -84
  68. package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js.map +1 -1
  69. package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.css +140 -0
  70. package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.js +307 -0
  71. package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.js.map +1 -0
  72. package/dist/collection/components/pcm-mobile-input-btn/uploadNumberSDK.js +25 -0
  73. package/dist/collection/components/pcm-mobile-input-btn/uploadNumberSDK.js.map +1 -0
  74. package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.css +127 -0
  75. package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.js +350 -0
  76. package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.js.map +1 -0
  77. package/dist/collection/components/pcm-mobile-upload-btn/uploadNumberSDK.js +25 -0
  78. package/dist/collection/components/pcm-mobile-upload-btn/uploadNumberSDK.js.map +1 -0
  79. package/dist/collection/components/pcm-msbg-modal/pcm-msbg-modal.js +2 -2
  80. package/dist/collection/components/pcm-msbg-modal/pcm-msbg-modal.js.map +1 -1
  81. package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.css +1 -1
  82. package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.js +2 -2
  83. package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.js.map +1 -1
  84. package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.css +0 -0
  85. package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.js +106 -0
  86. package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.js.map +1 -0
  87. package/dist/collection/components/pcm-upload/pcm-upload.css +0 -0
  88. package/dist/collection/components/pcm-upload/pcm-upload.js +408 -0
  89. package/dist/collection/components/pcm-upload/pcm-upload.js.map +1 -0
  90. package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.css +969 -969
  91. package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.js +3 -5
  92. package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.js.map +1 -1
  93. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.css +68 -68
  94. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js +4 -4
  95. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js.map +1 -1
  96. package/dist/collection/global/global.css +401 -398
  97. package/dist/collection/global/markdown.css +1233 -1233
  98. package/dist/collection/global/message.js.map +1 -1
  99. package/dist/collection/index.js.map +1 -1
  100. package/dist/collection/interfaces/chat.js.map +1 -1
  101. package/dist/collection/interfaces/events.js.map +1 -1
  102. package/dist/collection/services/message.service.js.map +1 -1
  103. package/dist/collection/utils/env.js +3 -0
  104. package/dist/collection/utils/env.js.map +1 -1
  105. package/dist/collection/utils/error-event.js.map +1 -1
  106. package/dist/collection/utils/init.js.map +1 -1
  107. package/dist/collection/utils/sentry-reporter.js.map +1 -1
  108. package/dist/collection/utils/utils.js +48 -24
  109. package/dist/collection/utils/utils.js.map +1 -1
  110. package/dist/components/index.js +3 -5482
  111. package/dist/components/index.js.map +1 -1
  112. package/dist/components/{p-AYWZDCn8.js → p-B0WOTw9J.js} +51 -4
  113. package/dist/components/p-B0WOTw9J.js.map +1 -0
  114. package/dist/components/{p-DUQ46MUh.js → p-BGXbWUJg.js} +3 -3
  115. package/dist/components/{p-DUQ46MUh.js.map → p-BGXbWUJg.js.map} +1 -1
  116. package/dist/{esm/sentry-reporter-BFBS363a.js → components/p-BW3r6Lrf.js} +5 -32
  117. package/dist/components/p-BW3r6Lrf.js.map +1 -0
  118. package/dist/{esm/app-globals-Chti62re.js → components/p-BdiUKin5.js} +9619 -4296
  119. package/dist/components/p-BdiUKin5.js.map +1 -0
  120. package/dist/components/{p-FjtoYPVY.js → p-BywzltXy.js} +10 -9
  121. package/dist/components/p-BywzltXy.js.map +1 -0
  122. package/dist/components/p-C2OsjtRx.js +208 -0
  123. package/dist/components/p-C2OsjtRx.js.map +1 -0
  124. package/dist/components/{p-D2Z8casl.js → p-CuIvbaWY.js} +5 -5
  125. package/dist/components/p-CuIvbaWY.js.map +1 -0
  126. package/dist/components/p-D0ZMoyH8.js +251 -0
  127. package/dist/components/p-D0ZMoyH8.js.map +1 -0
  128. package/dist/components/{p-CjbFHLT7.js → p-De3VHEUn.js} +7 -71
  129. package/dist/components/p-De3VHEUn.js.map +1 -0
  130. package/dist/components/p-Dv8qvK0w.js +2646 -0
  131. package/dist/components/p-Dv8qvK0w.js.map +1 -0
  132. package/dist/components/p-RD3mwuBX.js +226 -0
  133. package/dist/components/p-RD3mwuBX.js.map +1 -0
  134. package/dist/components/p-njngFX_n.js +80 -0
  135. package/dist/components/p-njngFX_n.js.map +1 -0
  136. package/dist/components/pcm-1zhanshi-mnms-modal.js +7 -7
  137. package/dist/components/pcm-1zhanshi-mnms-modal.js.map +1 -1
  138. package/dist/components/pcm-app-chat-modal.js +1 -1
  139. package/dist/components/pcm-button.js +2 -2
  140. package/dist/components/pcm-button.js.map +1 -1
  141. package/dist/components/pcm-card.js +3 -3
  142. package/dist/components/pcm-card.js.map +1 -1
  143. package/dist/components/pcm-chat-message.js +1 -1
  144. package/dist/components/pcm-drawer.js +1 -1
  145. package/dist/components/pcm-hr-chat-modal.js +5 -4
  146. package/dist/components/pcm-hr-chat-modal.js.map +1 -1
  147. package/dist/components/pcm-htws-modal.js +8 -7
  148. package/dist/components/pcm-htws-modal.js.map +1 -1
  149. package/dist/components/pcm-hyzj-modal.js +8 -7
  150. package/dist/components/pcm-hyzj-modal.js.map +1 -1
  151. package/dist/components/pcm-jd-modal.js +8 -7
  152. package/dist/components/pcm-jd-modal.js.map +1 -1
  153. package/dist/components/pcm-jlpp-modal.js +8 -7
  154. package/dist/components/pcm-jlpp-modal.js.map +1 -1
  155. package/dist/components/pcm-message.js +3 -3
  156. package/dist/components/pcm-message.js.map +1 -1
  157. package/dist/components/pcm-mnct-modal.js +8 -7
  158. package/dist/components/pcm-mnct-modal.js.map +1 -1
  159. package/dist/components/pcm-mnms-modal.js +60 -90
  160. package/dist/components/pcm-mnms-modal.js.map +1 -1
  161. package/dist/components/pcm-mnms-video-modal.js +8 -7
  162. package/dist/components/pcm-mnms-video-modal.js.map +1 -1
  163. package/dist/components/pcm-mnms-zp-modal.js +60 -90
  164. package/dist/components/pcm-mnms-zp-modal.js.map +1 -1
  165. package/dist/components/pcm-mobile-input-btn.d.ts +11 -0
  166. package/dist/components/pcm-mobile-input-btn.js +9 -0
  167. package/dist/components/pcm-mobile-input-btn.js.map +1 -0
  168. package/dist/components/pcm-mobile-upload-btn.d.ts +11 -0
  169. package/dist/components/pcm-mobile-upload-btn.js +9 -0
  170. package/dist/components/pcm-mobile-upload-btn.js.map +1 -0
  171. package/dist/components/pcm-msbg-modal.js +8 -7
  172. package/dist/components/pcm-msbg-modal.js.map +1 -1
  173. package/dist/components/pcm-qgqjl-modal.js +8 -7
  174. package/dist/components/pcm-qgqjl-modal.js.map +1 -1
  175. package/dist/components/pcm-time-count-down.d.ts +11 -0
  176. package/dist/components/pcm-time-count-down.js +9 -0
  177. package/dist/components/pcm-time-count-down.js.map +1 -0
  178. package/dist/components/pcm-upload.d.ts +11 -0
  179. package/dist/components/pcm-upload.js +9 -0
  180. package/dist/components/pcm-upload.js.map +1 -0
  181. package/dist/components/pcm-zsk-chat-modal.js +4 -4
  182. package/dist/components/pcm-zsk-chat-modal.js.map +1 -1
  183. package/dist/components/pcm-zygh-modal.js +8 -7
  184. package/dist/components/pcm-zygh-modal.js.map +1 -1
  185. package/dist/esm/error-event-C0FYX2-Z.js +31 -0
  186. package/dist/esm/error-event-C0FYX2-Z.js.map +1 -0
  187. package/dist/esm/{index-GyOE8SlD.js → index-BnNqOUZf.js} +51 -4
  188. package/dist/esm/index-BnNqOUZf.js.map +1 -0
  189. package/dist/esm/index-BuVfV0zo.js +11035 -0
  190. package/dist/esm/index-BuVfV0zo.js.map +1 -0
  191. package/dist/esm/index.js +2 -2
  192. package/dist/esm/loader.js +3 -5
  193. package/dist/esm/loader.js.map +1 -1
  194. package/dist/esm/message.service-DXVhHj6-.js +133 -0
  195. package/dist/esm/message.service-DXVhHj6-.js.map +1 -0
  196. package/dist/esm/{pcm-1zhanshi-mnms-modal_17.entry.js → pcm-1zhanshi-mnms-modal_21.entry.js} +3225 -169
  197. package/dist/esm/pcm-1zhanshi-mnms-modal_21.entry.js.map +1 -0
  198. package/dist/esm/pcm-agents.js +4 -6
  199. package/dist/esm/pcm-agents.js.map +1 -1
  200. package/dist/esm/pcm-message.entry.js +3 -3
  201. package/dist/esm/pcm-message.entry.js.map +1 -1
  202. package/dist/esm/pcm-mnms-video-modal.entry.js +5 -5
  203. package/dist/esm/pcm-mnms-video-modal.entry.js.map +1 -1
  204. package/dist/esm/pcm-mnms-zp-modal.entry.js +28 -85
  205. package/dist/esm/pcm-mnms-zp-modal.entry.js.map +1 -1
  206. package/dist/esm/sentry-reporter-CYzy4_8O.js +70 -0
  207. package/dist/esm/sentry-reporter-CYzy4_8O.js.map +1 -0
  208. package/dist/pcm-agents/index.esm.js +1 -1
  209. package/dist/pcm-agents/loader.esm.js.map +1 -1
  210. package/dist/pcm-agents/p-18a06873.entry.js +2 -0
  211. package/dist/pcm-agents/p-18a06873.entry.js.map +1 -0
  212. package/dist/pcm-agents/p-47e2e1d0.entry.js +2 -0
  213. package/dist/pcm-agents/p-47e2e1d0.entry.js.map +1 -0
  214. package/dist/pcm-agents/{p-3608c0c6.entry.js → p-7a582f00.entry.js} +2 -2
  215. package/dist/pcm-agents/p-7a582f00.entry.js.map +1 -0
  216. package/dist/pcm-agents/p-BhFnI70g.js +2 -0
  217. package/dist/pcm-agents/p-BhFnI70g.js.map +1 -0
  218. package/dist/pcm-agents/p-BuVfV0zo.js +3 -0
  219. package/dist/pcm-agents/p-BuVfV0zo.js.map +1 -0
  220. package/dist/pcm-agents/p-C0FYX2-Z.js +2 -0
  221. package/dist/pcm-agents/p-C0FYX2-Z.js.map +1 -0
  222. package/dist/pcm-agents/p-DXVhHj6-.js +2 -0
  223. package/dist/pcm-agents/p-DXVhHj6-.js.map +1 -0
  224. package/dist/pcm-agents/p-DkeaAFic.js +2 -0
  225. package/dist/pcm-agents/p-DkeaAFic.js.map +1 -0
  226. package/dist/pcm-agents/p-f5f96853.entry.js +245 -0
  227. package/dist/pcm-agents/p-f5f96853.entry.js.map +1 -0
  228. package/dist/pcm-agents/pcm-agents.esm.js +1 -1
  229. package/dist/pcm-agents/pcm-agents.esm.js.map +1 -1
  230. package/dist/pcm-agents/pcm-message.entry.esm.js.map +1 -1
  231. package/dist/pcm-agents/pcm-mnms-video-modal.entry.esm.js.map +1 -1
  232. package/dist/pcm-agents/pcm-mnms-zp-modal.entry.esm.js.map +1 -1
  233. package/dist/store/auth.store.js.map +1 -1
  234. package/dist/store/config.store.js.map +1 -1
  235. package/dist/types/components/pcm-mnms-modal/pcm-mnms-modal.d.ts +9 -4
  236. package/dist/types/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.d.ts +9 -4
  237. package/dist/types/components/pcm-mobile-input-btn/pcm-mobile-input-btn.d.ts +36 -0
  238. package/dist/types/components/pcm-mobile-input-btn/uploadNumberSDK.d.ts +9 -0
  239. package/dist/types/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.d.ts +44 -0
  240. package/dist/types/components/pcm-mobile-upload-btn/uploadNumberSDK.d.ts +9 -0
  241. package/dist/types/components/pcm-time-count-down/pcm-time-count-down.d.ts +15 -0
  242. package/dist/types/components/pcm-upload/pcm-upload.d.ts +54 -0
  243. package/dist/types/components/pcm-upload/type.d.ts +4 -0
  244. package/dist/types/components.d.ts +798 -30
  245. package/dist/types/stencil-public-runtime.d.ts +1 -1
  246. package/dist/types/utils/env.d.ts +2 -0
  247. package/dist/types/utils/utils.d.ts +30 -12
  248. package/package.json +70 -69
  249. package/dist/cjs/app-globals-BIO4q6tX.js +0 -5487
  250. package/dist/cjs/app-globals-BIO4q6tX.js.map +0 -1
  251. package/dist/cjs/exports-Dc-pQh4A.js +0 -4087
  252. package/dist/cjs/exports-Dc-pQh4A.js.map +0 -1
  253. package/dist/cjs/index-C_qhED9Z.js +0 -1538
  254. package/dist/cjs/index-C_qhED9Z.js.map +0 -1
  255. package/dist/cjs/index-CvEfNyEj.js.map +0 -1
  256. package/dist/cjs/pcm-1zhanshi-mnms-modal_17.cjs.entry.js.map +0 -1
  257. package/dist/cjs/sentry-reporter-BWFtw_aT.js.map +0 -1
  258. package/dist/components/p-75J0r72D.js +0 -4017
  259. package/dist/components/p-75J0r72D.js.map +0 -1
  260. package/dist/components/p-AYWZDCn8.js.map +0 -1
  261. package/dist/components/p-CR7WLzmM.js +0 -1303
  262. package/dist/components/p-CR7WLzmM.js.map +0 -1
  263. package/dist/components/p-CjbFHLT7.js.map +0 -1
  264. package/dist/components/p-D2Z8casl.js.map +0 -1
  265. package/dist/components/p-FjtoYPVY.js.map +0 -1
  266. package/dist/esm/app-globals-Chti62re.js.map +0 -1
  267. package/dist/esm/exports-Bs-zO1WZ.js +0 -4017
  268. package/dist/esm/exports-Bs-zO1WZ.js.map +0 -1
  269. package/dist/esm/index-Bq0K-WqZ.js +0 -1528
  270. package/dist/esm/index-Bq0K-WqZ.js.map +0 -1
  271. package/dist/esm/index-GyOE8SlD.js.map +0 -1
  272. package/dist/esm/pcm-1zhanshi-mnms-modal_17.entry.js.map +0 -1
  273. package/dist/esm/sentry-reporter-BFBS363a.js.map +0 -1
  274. package/dist/pcm-agents/p-2Gpw8rvH.js +0 -2
  275. package/dist/pcm-agents/p-2Gpw8rvH.js.map +0 -1
  276. package/dist/pcm-agents/p-3608c0c6.entry.js.map +0 -1
  277. package/dist/pcm-agents/p-60d7a0b0.entry.js +0 -2
  278. package/dist/pcm-agents/p-60d7a0b0.entry.js.map +0 -1
  279. package/dist/pcm-agents/p-9e6efc2d.entry.js +0 -2
  280. package/dist/pcm-agents/p-9e6efc2d.entry.js.map +0 -1
  281. package/dist/pcm-agents/p-BUV0S8Cc.js +0 -2
  282. package/dist/pcm-agents/p-BUV0S8Cc.js.map +0 -1
  283. package/dist/pcm-agents/p-Bq0K-WqZ.js +0 -3
  284. package/dist/pcm-agents/p-Bq0K-WqZ.js.map +0 -1
  285. package/dist/pcm-agents/p-Bs-zO1WZ.js +0 -2
  286. package/dist/pcm-agents/p-Bs-zO1WZ.js.map +0 -1
  287. package/dist/pcm-agents/p-CeRTfvY9.js +0 -2
  288. package/dist/pcm-agents/p-CeRTfvY9.js.map +0 -1
  289. package/dist/pcm-agents/p-e6c87a78.entry.js +0 -2
  290. package/dist/pcm-agents/p-e6c87a78.entry.js.map +0 -1
  291. /package/dist/types/{code/agents-sdk → Users/debugksir/Documents/pcm/sdk}/packages/pcm-agents/.stencil/store/auth.store.d.ts +0 -0
  292. /package/dist/types/{code/agents-sdk → Users/debugksir/Documents/pcm/sdk}/packages/pcm-agents/.stencil/store/config.store.d.ts +0 -0
@@ -0,0 +1,408 @@
1
+ import { h } from "@stencil/core";
2
+ import { FileUploadState, formatFileSize, uploadFileToBackend } from "../../utils/utils";
3
+ import { Message } from "../../services/message.service";
4
+ import { SentryReporter } from "../../utils/sentry-reporter";
5
+ export class PcmUpload {
6
+ /**
7
+ * 是否支持多文件上传
8
+ */
9
+ multiple = false;
10
+ /**
11
+ * 是否开启移动端上传(仅PC端生效)
12
+ */
13
+ mobileUploadAble = false;
14
+ /**
15
+ * label内容
16
+ */
17
+ labelText = '上传文件';
18
+ /**
19
+ * 支持的文件后缀列表(需要带上小数点.)
20
+ */
21
+ acceptFileSuffixList = [];
22
+ /**
23
+ * 最大文件数
24
+ */
25
+ maxFileCount = Infinity;
26
+ /**
27
+ * 最大文件大小
28
+ */
29
+ maxFileSize = Infinity;
30
+ /**
31
+ * 上传请求头
32
+ */
33
+ uploadHeaders;
34
+ /**
35
+ * 上传请求参数
36
+ */
37
+ uploadParams;
38
+ /**
39
+ * 上传失败监听
40
+ */
41
+ uploadFailed;
42
+ /**
43
+ * 上传文件变化监听
44
+ */
45
+ uploadChange;
46
+ hostElement;
47
+ selectedFiles = null;
48
+ async getIsUploading() {
49
+ return !!this.selectedFiles?.some(item => item.state === FileUploadState.Uploading);
50
+ }
51
+ handleUploadClick = () => {
52
+ const fileInput = this.hostElement.shadowRoot?.querySelector('.file-input');
53
+ fileInput?.click();
54
+ };
55
+ clearSelectedFile = () => {
56
+ const fileInput = this.hostElement.shadowRoot?.querySelector('.file-input');
57
+ if (fileInput) {
58
+ fileInput.value = '';
59
+ }
60
+ };
61
+ async uploadFile(file) {
62
+ try {
63
+ const result = await uploadFileToBackend(file, this.uploadHeaders || {}, this.uploadParams || {});
64
+ return {
65
+ ...result,
66
+ file,
67
+ file_name: file.name,
68
+ file_size: file.size,
69
+ state: FileUploadState.Success,
70
+ };
71
+ }
72
+ catch (error) {
73
+ this.clearSelectedFile();
74
+ SentryReporter.captureError(error, {
75
+ action: 'uploadFile',
76
+ component: 'pcm-mnms-modal',
77
+ title: '文件上传失败'
78
+ });
79
+ this.uploadFailed.emit({
80
+ error: error,
81
+ message: '文件上传失败,请重试'
82
+ });
83
+ return {
84
+ file,
85
+ error,
86
+ state: FileUploadState.Failed,
87
+ };
88
+ }
89
+ }
90
+ handleFileChange = async (event) => {
91
+ const input = event.target;
92
+ if (this.multiple) {
93
+ // 多选
94
+ }
95
+ else {
96
+ // 单选
97
+ const file = input.files?.[0];
98
+ if (!file)
99
+ return;
100
+ // 检测文件是否符合后缀名
101
+ if (this.acceptFileSuffixList?.length) {
102
+ const suffix = '.' + file.name.split('.').pop()?.toLowerCase();
103
+ if (!this.acceptFileSuffixList.includes(suffix)) {
104
+ Message.info(`请上传 ${this.acceptFileSuffixList.join('、')} 格式的文件`);
105
+ return;
106
+ }
107
+ }
108
+ // 检测文件大小是否超出限制
109
+ if (this.maxFileSize < file.size) {
110
+ Message.info(`文件大小不能超过 ${formatFileSize(this.maxFileSize) ?? '-'}`);
111
+ return;
112
+ }
113
+ this.selectedFiles = [{
114
+ file,
115
+ file_name: file.name,
116
+ file_size: file.size,
117
+ state: FileUploadState.Uploading,
118
+ cos_key: '',
119
+ error: undefined,
120
+ }];
121
+ const uploadResult = await this.uploadFile(file);
122
+ this.selectedFiles = [uploadResult];
123
+ this.clearSelectedFile();
124
+ this.emitUploadChange();
125
+ }
126
+ };
127
+ emitUploadChange = () => {
128
+ this.uploadChange.emit(this.selectedFiles?.map?.(item => ({
129
+ cos_key: item.cos_key,
130
+ file_name: item.file_name,
131
+ file_size: item.file_size,
132
+ ext: item.ext,
133
+ })));
134
+ };
135
+ uploadBtn() {
136
+ return h("div", null, !!this.mobileUploadAble && h("pcm-mobile-upload-btn", { multiple: this.multiple, acceptFileSuffixList: this.acceptFileSuffixList, maxFileCount: this.maxFileCount, maxFileSize: this.maxFileSize, uploadHeaders: this.uploadHeaders, uploadParams: this.uploadParams, onOk: e => {
137
+ this.selectedFiles = [
138
+ ...(this.selectedFiles ?? []),
139
+ ...(e.detail ?? []).map(item => ({
140
+ ...item,
141
+ state: FileUploadState.Success,
142
+ }))
143
+ ];
144
+ this.emitUploadChange();
145
+ } }), h("div", { class: "upload-placeholder", onClick: this.handleUploadClick }, h("img", { src: 'https://pub.pincaimao.com/static/web/images/home/i_upload.png' }), h("p", { class: 'upload-text' }, "\u70B9\u51FB\u4E0A\u4F20\u7B80\u5386"), h("p", { class: "upload-hint" }, !!this.acceptFileSuffixList?.length && h("p", null, "\u652F\u6301 ", this.acceptFileSuffixList.join('、'), " \u683C\u5F0F\u3002"), !!this.maxFileSize && this.maxFileSize !== Infinity && h("p", null, "\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 ", formatFileSize(this.maxFileSize) ?? '', "\u3002"), !!this.maxFileCount && this.maxFileCount !== Infinity && h("p", null, "\u6700\u591A\u4E0A\u4F20 ", this.maxFileCount, " \u4E2A\u6587\u4EF6\u3002"))));
146
+ }
147
+ render() {
148
+ return (h("div", { key: 'faec753d60f8c6bfb1e3996b67552f8a12155c07' }, h("div", { key: '55e1e83f962dc17c033885869d8cb7e73b65bb95', class: "resume-upload-section" }, h("label", { key: '80cb959d043a015267bfb55c20bae44afd509ebd' }, this.labelText), h("div", { key: 'e7aa8c65761f945287de858ea7b3ad036fb4cb6d', class: "upload-area" }, h("div", { key: '48bef805f845bdd6e6a542bccbc1d2b8d30b4a02' }, this.selectedFiles?.map?.((item, index) => {
149
+ return h("div", { class: "file-item" }, h("div", { class: "file-item-content" }, h("span", { class: "file-icon" }, "\uD83D\uDCDD"), h("span", { class: "file-name", style: item.state === FileUploadState.Failed ? { color: 'red', textDecoration: 'line-through' } : undefined }, item?.file_name), item.state === FileUploadState.Failed && h("span", { style: { color: 'red', marginLeft: '4px' } }, "(", item.error?.message ?? '上传失败', ")")), h("button", { class: "remove-file", onClick: (e) => {
150
+ e.stopPropagation();
151
+ this.selectedFiles = this.selectedFiles?.filter((_, itemIndex) => index !== itemIndex);
152
+ } }, "\u00D7"));
153
+ })), this.multiple ? h("div", null, (this.selectedFiles?.length ?? 0) < this.maxFileCount && this.uploadBtn()) : h("div", null, !this.selectedFiles?.length && this.uploadBtn()))), h("input", { key: '480b2f35655d4cdb5a99c058e4b894baf0e4c6a8', type: "file", class: "file-input", onChange: this.handleFileChange })));
154
+ }
155
+ static get is() { return "pcm-upload"; }
156
+ static get encapsulation() { return "shadow"; }
157
+ static get originalStyleUrls() {
158
+ return {
159
+ "$": ["pcm-upload.css", "../../global/global.css"]
160
+ };
161
+ }
162
+ static get styleUrls() {
163
+ return {
164
+ "$": ["pcm-upload.css", "../../global/global.css"]
165
+ };
166
+ }
167
+ static get properties() {
168
+ return {
169
+ "multiple": {
170
+ "type": "boolean",
171
+ "attribute": "multiple",
172
+ "mutable": false,
173
+ "complexType": {
174
+ "original": "boolean",
175
+ "resolved": "boolean",
176
+ "references": {}
177
+ },
178
+ "required": false,
179
+ "optional": false,
180
+ "docs": {
181
+ "tags": [],
182
+ "text": "\u662F\u5426\u652F\u6301\u591A\u6587\u4EF6\u4E0A\u4F20"
183
+ },
184
+ "getter": false,
185
+ "setter": false,
186
+ "reflect": false,
187
+ "defaultValue": "false"
188
+ },
189
+ "mobileUploadAble": {
190
+ "type": "boolean",
191
+ "attribute": "mobile-upload-able",
192
+ "mutable": false,
193
+ "complexType": {
194
+ "original": "boolean",
195
+ "resolved": "boolean",
196
+ "references": {}
197
+ },
198
+ "required": false,
199
+ "optional": false,
200
+ "docs": {
201
+ "tags": [],
202
+ "text": "\u662F\u5426\u5F00\u542F\u79FB\u52A8\u7AEF\u4E0A\u4F20\uFF08\u4EC5PC\u7AEF\u751F\u6548\uFF09"
203
+ },
204
+ "getter": false,
205
+ "setter": false,
206
+ "reflect": false,
207
+ "defaultValue": "false"
208
+ },
209
+ "labelText": {
210
+ "type": "string",
211
+ "attribute": "label-text",
212
+ "mutable": false,
213
+ "complexType": {
214
+ "original": "string",
215
+ "resolved": "string",
216
+ "references": {}
217
+ },
218
+ "required": false,
219
+ "optional": false,
220
+ "docs": {
221
+ "tags": [],
222
+ "text": "label\u5185\u5BB9"
223
+ },
224
+ "getter": false,
225
+ "setter": false,
226
+ "reflect": false,
227
+ "defaultValue": "'\u4E0A\u4F20\u6587\u4EF6'"
228
+ },
229
+ "acceptFileSuffixList": {
230
+ "type": "unknown",
231
+ "attribute": "accept-file-suffix-list",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "string[]",
235
+ "resolved": "string[]",
236
+ "references": {}
237
+ },
238
+ "required": false,
239
+ "optional": false,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": "\u652F\u6301\u7684\u6587\u4EF6\u540E\u7F00\u5217\u8868\uFF08\u9700\u8981\u5E26\u4E0A\u5C0F\u6570\u70B9.\uFF09"
243
+ },
244
+ "getter": false,
245
+ "setter": false,
246
+ "defaultValue": "[]"
247
+ },
248
+ "maxFileCount": {
249
+ "type": "number",
250
+ "attribute": "max-file-count",
251
+ "mutable": false,
252
+ "complexType": {
253
+ "original": "number",
254
+ "resolved": "number",
255
+ "references": {}
256
+ },
257
+ "required": false,
258
+ "optional": false,
259
+ "docs": {
260
+ "tags": [],
261
+ "text": "\u6700\u5927\u6587\u4EF6\u6570"
262
+ },
263
+ "getter": false,
264
+ "setter": false,
265
+ "reflect": false,
266
+ "defaultValue": "Infinity"
267
+ },
268
+ "maxFileSize": {
269
+ "type": "number",
270
+ "attribute": "max-file-size",
271
+ "mutable": false,
272
+ "complexType": {
273
+ "original": "number",
274
+ "resolved": "number",
275
+ "references": {}
276
+ },
277
+ "required": false,
278
+ "optional": false,
279
+ "docs": {
280
+ "tags": [],
281
+ "text": "\u6700\u5927\u6587\u4EF6\u5927\u5C0F"
282
+ },
283
+ "getter": false,
284
+ "setter": false,
285
+ "reflect": false,
286
+ "defaultValue": "Infinity"
287
+ },
288
+ "uploadHeaders": {
289
+ "type": "unknown",
290
+ "attribute": "upload-headers",
291
+ "mutable": false,
292
+ "complexType": {
293
+ "original": "Record<string, any>",
294
+ "resolved": "{ [x: string]: any; }",
295
+ "references": {
296
+ "Record": {
297
+ "location": "global",
298
+ "id": "global::Record"
299
+ }
300
+ }
301
+ },
302
+ "required": false,
303
+ "optional": true,
304
+ "docs": {
305
+ "tags": [],
306
+ "text": "\u4E0A\u4F20\u8BF7\u6C42\u5934"
307
+ },
308
+ "getter": false,
309
+ "setter": false
310
+ },
311
+ "uploadParams": {
312
+ "type": "unknown",
313
+ "attribute": "upload-params",
314
+ "mutable": false,
315
+ "complexType": {
316
+ "original": "Record<string, any>",
317
+ "resolved": "{ [x: string]: any; }",
318
+ "references": {
319
+ "Record": {
320
+ "location": "global",
321
+ "id": "global::Record"
322
+ }
323
+ }
324
+ },
325
+ "required": false,
326
+ "optional": true,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": "\u4E0A\u4F20\u8BF7\u6C42\u53C2\u6570"
330
+ },
331
+ "getter": false,
332
+ "setter": false
333
+ }
334
+ };
335
+ }
336
+ static get states() {
337
+ return {
338
+ "selectedFiles": {}
339
+ };
340
+ }
341
+ static get events() {
342
+ return [{
343
+ "method": "uploadFailed",
344
+ "name": "uploadFailed",
345
+ "bubbles": true,
346
+ "cancelable": true,
347
+ "composed": true,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": "\u4E0A\u4F20\u5931\u8D25\u76D1\u542C"
351
+ },
352
+ "complexType": {
353
+ "original": "UploadFailedEvent",
354
+ "resolved": "{ error: Error; message: string; }",
355
+ "references": {
356
+ "UploadFailedEvent": {
357
+ "location": "global",
358
+ "id": "global::UploadFailedEvent"
359
+ }
360
+ }
361
+ }
362
+ }, {
363
+ "method": "uploadChange",
364
+ "name": "uploadChange",
365
+ "bubbles": true,
366
+ "cancelable": true,
367
+ "composed": true,
368
+ "docs": {
369
+ "tags": [],
370
+ "text": "\u4E0A\u4F20\u6587\u4EF6\u53D8\u5316\u76D1\u542C"
371
+ },
372
+ "complexType": {
373
+ "original": "FileUploadResponse[]",
374
+ "resolved": "FileUploadResponse[]",
375
+ "references": {
376
+ "FileUploadResponse": {
377
+ "location": "import",
378
+ "path": "../../utils/utils",
379
+ "id": "src/utils/utils.ts::FileUploadResponse"
380
+ }
381
+ }
382
+ }
383
+ }];
384
+ }
385
+ static get methods() {
386
+ return {
387
+ "getIsUploading": {
388
+ "complexType": {
389
+ "signature": "() => Promise<boolean>",
390
+ "parameters": [],
391
+ "references": {
392
+ "Promise": {
393
+ "location": "global",
394
+ "id": "global::Promise"
395
+ }
396
+ },
397
+ "return": "Promise<boolean>"
398
+ },
399
+ "docs": {
400
+ "text": "",
401
+ "tags": []
402
+ }
403
+ }
404
+ };
405
+ }
406
+ static get elementRef() { return "hostElement"; }
407
+ }
408
+ //# sourceMappingURL=pcm-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pcm-upload.js","sourceRoot":"","sources":["../../../../src/components/pcm-upload/pcm-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAmD,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC1I,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAQ7D,MAAM,OAAO,SAAS;IAClB;;OAEG;IACK,QAAQ,GAAY,KAAK,CAAC;IAClC;;OAEG;IACK,gBAAgB,GAAY,KAAK,CAAC;IAC1C;;OAEG;IACK,SAAS,GAAW,MAAM,CAAA;IAClC;;OAEG;IACK,oBAAoB,GA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, State, Element, Prop, Event, EventEmitter, Method } from \"@stencil/core\";\nimport { FileUploadResponse, FileUploadResponseWithState, FileUploadState, formatFileSize, uploadFileToBackend } from \"../../utils/utils\";\nimport { Message } from \"../../services/message.service\";\nimport { SentryReporter } from \"../../utils/sentry-reporter\";\n\n\n@Component({\n tag: 'pcm-upload',\n styleUrls: ['pcm-upload.css', '../../global/global.css'],\n shadow: true,\n})\nexport class PcmUpload {\n /**\n * 是否支持多文件上传\n */\n @Prop() multiple: boolean = false;\n /**\n * 是否开启移动端上传(仅PC端生效)\n */\n @Prop() mobileUploadAble: boolean = false;\n /**\n * label内容\n */\n @Prop() labelText: string = '上传文件'\n /**\n * 支持的文件后缀列表(需要带上小数点.)\n */\n @Prop() acceptFileSuffixList: string[] = [];\n /**\n * 最大文件数\n */\n @Prop() maxFileCount: number = Infinity;\n /**\n * 最大文件大小\n */\n @Prop() maxFileSize: number = Infinity;\n /**\n * 上传请求头\n */\n @Prop() uploadHeaders?: Record<string, any>;\n /**\n * 上传请求参数\n */\n @Prop() uploadParams?: Record<string, any>;\n /**\n * 上传失败监听\n */\n @Event() uploadFailed: EventEmitter<UploadFailedEvent>;\n /**\n * 上传文件变化监听\n */\n @Event() uploadChange: EventEmitter<FileUploadResponse[]>;\n\n\n @Element() hostElement: HTMLElement;\n @State() selectedFiles: FileUploadResponseWithState[] | null = null;\n\n @Method()\n async getIsUploading() {\n return !!this.selectedFiles?.some(item => item.state === FileUploadState.Uploading);\n }\n\n private handleUploadClick = () => {\n const fileInput = this.hostElement.shadowRoot?.querySelector('.file-input') as HTMLInputElement;\n fileInput?.click();\n };\n\n private clearSelectedFile = () => {\n const fileInput = this.hostElement.shadowRoot?.querySelector('.file-input') as HTMLInputElement;\n if (fileInput) {\n fileInput.value = '';\n }\n };\n\n private async uploadFile(file: File): Promise<FileUploadResponseWithState> {\n try {\n const result = await uploadFileToBackend(file, this.uploadHeaders || {}, this.uploadParams || {});\n return {\n ...result,\n file,\n file_name: file.name,\n file_size: file.size,\n state: FileUploadState.Success,\n }\n } catch (error) {\n this.clearSelectedFile();\n SentryReporter.captureError(error, {\n action: 'uploadFile',\n component: 'pcm-mnms-modal',\n title: '文件上传失败'\n });\n this.uploadFailed.emit({\n error: error,\n message: '文件上传失败,请重试'\n });\n return {\n file,\n error,\n state: FileUploadState.Failed,\n }\n }\n }\n\n private handleFileChange = async (event: Event) => {\n const input = event.target as HTMLInputElement;\n\n if (this.multiple) {\n // 多选\n } else {\n // 单选\n const file = input.files?.[0];\n if (!file) return;\n // 检测文件是否符合后缀名\n if (this.acceptFileSuffixList?.length) {\n const suffix = '.' + file.name.split('.').pop()?.toLowerCase();\n if (!this.acceptFileSuffixList.includes(suffix)) {\n Message.info(`请上传 ${this.acceptFileSuffixList.join('、')} 格式的文件`);\n return;\n }\n }\n // 检测文件大小是否超出限制\n if (this.maxFileSize < file.size) {\n Message.info(`文件大小不能超过 ${formatFileSize(this.maxFileSize) ?? '-'}`);\n return;\n }\n this.selectedFiles = [{\n file,\n file_name: file.name,\n file_size: file.size,\n state: FileUploadState.Uploading,\n cos_key: '',\n error: undefined,\n }];\n const uploadResult = await this.uploadFile(file);\n this.selectedFiles = [uploadResult];\n this.clearSelectedFile();\n this.emitUploadChange();\n }\n };\n\n private emitUploadChange = () => {\n this.uploadChange.emit(this.selectedFiles?.map?.(item => ({\n cos_key: item.cos_key,\n file_name: item.file_name,\n file_size: item.file_size,\n ext: item.ext,\n })));\n }\n\n private uploadBtn() {\n return <div>\n {\n !!this.mobileUploadAble && <pcm-mobile-upload-btn\n multiple={this.multiple}\n acceptFileSuffixList={this.acceptFileSuffixList}\n maxFileCount={this.maxFileCount}\n maxFileSize={this.maxFileSize}\n uploadHeaders={this.uploadHeaders}\n uploadParams={this.uploadParams}\n onOk={e => {\n this.selectedFiles = [\n ...(this.selectedFiles ?? []),\n ...(e.detail ?? []).map(item => ({\n ...item,\n state: FileUploadState.Success,\n }))\n ]\n this.emitUploadChange();\n }}\n />\n }\n <div class=\"upload-placeholder\" onClick={this.handleUploadClick}>\n <img src='https://pub.pincaimao.com/static/web/images/home/i_upload.png'></img>\n <p class='upload-text'>点击上传简历</p>\n <p class=\"upload-hint\">\n {\n !!this.acceptFileSuffixList?.length && <p>支持 {this.acceptFileSuffixList.join('、')} 格式。</p>\n }\n {\n !!this.maxFileSize && this.maxFileSize !== Infinity && <p>文件大小不能超过 {formatFileSize(this.maxFileSize) ?? ''}。</p>\n }\n {\n !!this.maxFileCount && this.maxFileCount !== Infinity && <p>最多上传 {this.maxFileCount} 个文件。</p>\n }\n </p>\n </div>\n </div>\n }\n\n render() {\n return (\n <div>\n <div class=\"resume-upload-section\">\n <label >{this.labelText}</label>\n <div class=\"upload-area\">\n <div>\n {\n this.selectedFiles?.map?.((item, index) => {\n return <div class=\"file-item\">\n <div class=\"file-item-content\">\n <span class=\"file-icon\">📝</span>\n <span class=\"file-name\" style={item.state === FileUploadState.Failed ? { color: 'red', textDecoration: 'line-through' } : undefined}>{item?.file_name}</span>\n {\n item.state === FileUploadState.Failed && <span style={{ color: 'red', marginLeft: '4px' }}>({item.error?.message ?? '上传失败'})</span>\n }\n </div>\n <button class=\"remove-file\" onClick={(e) => {\n e.stopPropagation();\n this.selectedFiles = this.selectedFiles?.filter((_, itemIndex) => index !== itemIndex);\n }}>×</button>\n </div>\n })\n }\n </div>\n {\n this.multiple ? <div>\n {\n (this.selectedFiles?.length ?? 0) < this.maxFileCount && this.uploadBtn()\n }\n </div> : <div>\n {\n !this.selectedFiles?.length && this.uploadBtn()\n }\n </div>\n }\n </div>\n </div>\n <input\n type=\"file\"\n class=\"file-input\"\n onChange={this.handleFileChange}\n />\n </div>\n )\n }\n}"]}