@verdocs/web-sdk 1.9.10 → 1.9.15

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 (641) hide show
  1. package/dist/cjs/{Envelopes-22a0c02f.js → Envelopes-eacee000.js} +72 -16
  2. package/dist/cjs/Envelopes-eacee000.js.map +1 -0
  3. package/dist/cjs/{Templates-399073ea.js → Templates-acde16f2.js} +2 -2
  4. package/dist/cjs/{Templates-399073ea.js.map → Templates-acde16f2.js.map} +1 -1
  5. package/dist/cjs/VerdocsEndpoint-8c408e5b.js +3569 -0
  6. package/dist/cjs/VerdocsEndpoint-8c408e5b.js.map +1 -0
  7. package/dist/cjs/{templateStore-92828c3c.js → index-eb130f52.js} +2 -41
  8. package/dist/cjs/index-eb130f52.js.map +1 -0
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/templateStore-42a49905.js +46 -0
  11. package/dist/cjs/templateStore-42a49905.js.map +1 -0
  12. package/dist/cjs/{utils-84236321.js → utils-beee79a1.js} +29 -13
  13. package/dist/cjs/utils-beee79a1.js.map +1 -0
  14. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-build.cjs.entry.js +5 -4
  16. package/dist/cjs/verdocs-build.cjs.entry.js.map +1 -1
  17. package/dist/cjs/verdocs-checkbox.cjs.entry.js +4 -2
  18. package/dist/cjs/verdocs-checkbox.cjs.entry.js.map +1 -1
  19. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-document-page_2.cjs.entry.js +94 -0
  21. package/dist/cjs/verdocs-document-page_2.cjs.entry.js.map +1 -0
  22. package/dist/cjs/verdocs-dropdown.cjs.entry.js +91 -0
  23. package/dist/cjs/verdocs-dropdown.cjs.entry.js.map +1 -0
  24. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +4 -2
  25. package/dist/cjs/verdocs-field-attachment.cjs.entry.js.map +1 -1
  26. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +32 -0
  27. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js.map +1 -0
  28. package/dist/cjs/verdocs-field-date.cjs.entry.js +10 -13
  29. package/dist/cjs/verdocs-field-date.cjs.entry.js.map +1 -1
  30. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +5 -16
  31. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js.map +1 -1
  32. package/dist/cjs/verdocs-field-initial.cjs.entry.js +4 -5
  33. package/dist/cjs/verdocs-field-initial.cjs.entry.js.map +1 -1
  34. package/dist/cjs/verdocs-field-payment.cjs.entry.js +5 -3
  35. package/dist/cjs/verdocs-field-payment.cjs.entry.js.map +1 -1
  36. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +36 -0
  37. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js.map +1 -0
  38. package/dist/cjs/verdocs-field-signature_3.cjs.entry.js +5 -7
  39. package/dist/cjs/verdocs-field-signature_3.cjs.entry.js.map +1 -1
  40. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +2 -24
  41. package/dist/cjs/verdocs-field-textarea.cjs.entry.js.map +1 -1
  42. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +11 -28
  43. package/dist/cjs/verdocs-field-textbox.cjs.entry.js.map +1 -1
  44. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -25
  45. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js.map +1 -1
  46. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +10 -13
  47. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js.map +1 -1
  48. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  49. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js.map +1 -1
  50. package/dist/cjs/verdocs-preview.cjs.entry.js +19 -13
  51. package/dist/cjs/verdocs-preview.cjs.entry.js.map +1 -1
  52. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
  53. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  54. package/dist/cjs/verdocs-send.cjs.entry.js +2 -2
  55. package/dist/cjs/verdocs-sign.cjs.entry.js +159 -118
  56. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  57. package/dist/cjs/verdocs-template-create_4.cjs.entry.js +54 -41
  58. package/dist/cjs/verdocs-template-create_4.cjs.entry.js.map +1 -1
  59. package/dist/cjs/verdocs-view.cjs.entry.js +276 -0
  60. package/dist/cjs/verdocs-view.cjs.entry.js.map +1 -0
  61. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  62. package/dist/collection/collection-manifest.json +2 -4
  63. package/dist/collection/components/controls/verdocs-button/verdocs-button.stories.js +3 -3
  64. package/dist/collection/components/controls/verdocs-button/verdocs-button.stories.js.map +1 -1
  65. package/dist/collection/components/controls/verdocs-checkbox/verdocs-checkbox.css +32 -18
  66. package/dist/collection/components/controls/verdocs-checkbox/verdocs-checkbox.js +40 -2
  67. package/dist/collection/components/controls/verdocs-checkbox/verdocs-checkbox.js.map +1 -1
  68. package/dist/collection/components/controls/verdocs-checkbox/verdocs-checkbox.stories.js +6 -4
  69. package/dist/collection/components/controls/verdocs-checkbox/verdocs-checkbox.stories.js.map +1 -1
  70. package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js +22 -12
  71. package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js.map +1 -1
  72. package/dist/collection/components/controls/verdocs-radio-button/verdocs-radio-button.stories.js +2 -2
  73. package/dist/collection/components/controls/verdocs-radio-button/verdocs-radio-button.stories.js.map +1 -1
  74. package/dist/collection/components/controls/verdocs-select-input/verdocs-select-input.stories.js +2 -2
  75. package/dist/collection/components/controls/verdocs-select-input/verdocs-select-input.stories.js.map +1 -1
  76. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.stories.js +2 -2
  77. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.stories.js.map +1 -1
  78. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.css +1 -7
  79. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +9 -12
  80. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js.map +1 -1
  81. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +1 -1
  82. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.css +2 -2
  83. package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js +1 -4
  84. package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js.map +1 -1
  85. package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.js +21 -21
  86. package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.js.map +1 -1
  87. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.css +0 -1
  88. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.js +22 -22
  89. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.js.map +1 -1
  90. package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.js +9 -33
  91. package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.js.map +1 -1
  92. package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.js +21 -67
  93. package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.js.map +1 -1
  94. package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.js +5 -26
  95. package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.js.map +1 -1
  96. package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.js +22 -22
  97. package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.js.map +1 -1
  98. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.css +0 -1
  99. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.js +22 -22
  100. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.js.map +1 -1
  101. package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.js +4 -26
  102. package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.js.map +1 -1
  103. package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.js +2 -108
  104. package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.js.map +1 -1
  105. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.js +9 -108
  106. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.js.map +1 -1
  107. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.stories.js +7 -2
  108. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.stories.js.map +1 -1
  109. package/dist/collection/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.js +1 -122
  110. package/dist/collection/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.js.map +1 -1
  111. package/dist/collection/components/elements/verdocs-template-fields/verdocs-template-fields.css +14 -1
  112. package/dist/collection/components/elements/verdocs-template-fields/verdocs-template-fields.js +19 -35
  113. package/dist/collection/components/elements/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
  114. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.css +15 -0
  115. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +16 -9
  116. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js.map +1 -1
  117. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +6 -45
  118. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +183 -147
  119. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  120. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +2 -2
  121. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js.map +1 -1
  122. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +120 -175
  123. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js.map +1 -1
  124. package/dist/collection/components/embeds/verdocs-view/verdocs-view.stories.js +2 -3
  125. package/dist/collection/components/embeds/verdocs-view/verdocs-view.stories.js.map +1 -1
  126. package/dist/collection/utils/Envelopes.js +31 -0
  127. package/dist/collection/utils/Envelopes.js.map +1 -0
  128. package/dist/collection/utils/envelopeStore.js +28 -0
  129. package/dist/collection/utils/envelopeStore.js.map +1 -0
  130. package/dist/collection/utils/utils.js +27 -10
  131. package/dist/collection/utils/utils.js.map +1 -1
  132. package/dist/{esm/Envelopes-df05b3c7.js → components/Envelopes.js} +70 -15
  133. package/dist/components/Envelopes.js.map +1 -0
  134. package/dist/components/VerdocsEndpoint.js +2185 -1051
  135. package/dist/components/VerdocsEndpoint.js.map +1 -1
  136. package/dist/components/index.d.ts +0 -2
  137. package/dist/components/index.js +0 -2
  138. package/dist/components/index.js.map +1 -1
  139. package/dist/components/index2.js +196 -0
  140. package/dist/components/index2.js.map +1 -0
  141. package/dist/components/templateStore.js +1 -192
  142. package/dist/components/templateStore.js.map +1 -1
  143. package/dist/components/utils.js +28 -11
  144. package/dist/components/utils.js.map +1 -1
  145. package/dist/components/verdocs-build.js +34 -52
  146. package/dist/components/verdocs-build.js.map +1 -1
  147. package/dist/components/verdocs-checkbox2.js +6 -2
  148. package/dist/components/verdocs-checkbox2.js.map +1 -1
  149. package/dist/components/verdocs-document-page2.js +1 -4
  150. package/dist/components/verdocs-document-page2.js.map +1 -1
  151. package/dist/components/verdocs-dropdown2.js +21 -11
  152. package/dist/components/verdocs-dropdown2.js.map +1 -1
  153. package/dist/components/verdocs-field-attachment.js +5 -3
  154. package/dist/components/verdocs-field-attachment.js.map +1 -1
  155. package/dist/components/verdocs-field-checkbox.js +44 -1
  156. package/dist/components/verdocs-field-checkbox.js.map +1 -1
  157. package/dist/components/verdocs-field-date.js +9 -14
  158. package/dist/components/verdocs-field-date.js.map +1 -1
  159. package/dist/components/verdocs-field-dropdown.js +5 -17
  160. package/dist/components/verdocs-field-dropdown.js.map +1 -1
  161. package/dist/components/verdocs-field-initial.js +4 -6
  162. package/dist/components/verdocs-field-initial.js.map +1 -1
  163. package/dist/components/verdocs-field-payment.js +5 -3
  164. package/dist/components/verdocs-field-payment.js.map +1 -1
  165. package/dist/components/verdocs-field-radio-button.js +48 -1
  166. package/dist/components/verdocs-field-radio-button.js.map +1 -1
  167. package/dist/components/verdocs-field-signature2.js +4 -7
  168. package/dist/components/verdocs-field-signature2.js.map +1 -1
  169. package/dist/components/verdocs-field-textarea.js +3 -27
  170. package/dist/components/verdocs-field-textarea.js.map +1 -1
  171. package/dist/components/verdocs-field-textbox.js +9 -29
  172. package/dist/components/verdocs-field-textbox.js.map +1 -1
  173. package/dist/components/verdocs-field-timestamp.js +2 -27
  174. package/dist/components/verdocs-field-timestamp.js.map +1 -1
  175. package/dist/components/verdocs-initial-dialog2.js +10 -13
  176. package/dist/components/verdocs-initial-dialog2.js.map +1 -1
  177. package/dist/components/verdocs-ok-dialog2.js +1 -1
  178. package/dist/components/verdocs-ok-dialog2.js.map +1 -1
  179. package/dist/components/verdocs-preview.js +18 -31
  180. package/dist/components/verdocs-preview.js.map +1 -1
  181. package/dist/components/verdocs-sign.js +173 -153
  182. package/dist/components/verdocs-sign.js.map +1 -1
  183. package/dist/components/verdocs-signature-dialog2.js +1 -1
  184. package/dist/components/verdocs-signature-dialog2.js.map +1 -1
  185. package/dist/components/verdocs-template-create2.js +29 -1
  186. package/dist/components/verdocs-template-create2.js.map +1 -1
  187. package/dist/components/verdocs-template-fields2.js +38 -72
  188. package/dist/components/verdocs-template-fields2.js.map +1 -1
  189. package/dist/components/verdocs-view.js +297 -1
  190. package/dist/components/verdocs-view.js.map +1 -1
  191. package/dist/docs.json +145 -848
  192. package/dist/esm/Envelopes-19ca610d.js +158 -0
  193. package/dist/esm/Envelopes-19ca610d.js.map +1 -0
  194. package/dist/esm/{Templates-91922342.js → Templates-7a534fd1.js} +2 -2
  195. package/dist/esm/{Templates-91922342.js.map → Templates-7a534fd1.js.map} +1 -1
  196. package/dist/esm/VerdocsEndpoint-dac04424.js +3566 -0
  197. package/dist/esm/VerdocsEndpoint-dac04424.js.map +1 -0
  198. package/dist/esm/{templateStore-3b26e38d.js → index-fd7b8a34.js} +2 -41
  199. package/dist/esm/index-fd7b8a34.js.map +1 -0
  200. package/dist/esm/loader.js +1 -1
  201. package/dist/esm/templateStore-b8512d36.js +44 -0
  202. package/dist/esm/templateStore-b8512d36.js.map +1 -0
  203. package/dist/esm/{utils-3f23facc.js → utils-2e6beff8.js} +29 -12
  204. package/dist/esm/utils-2e6beff8.js.map +1 -0
  205. package/dist/esm/verdocs-auth.entry.js +1 -1
  206. package/dist/esm/verdocs-build.entry.js +5 -4
  207. package/dist/esm/verdocs-build.entry.js.map +1 -1
  208. package/dist/esm/verdocs-checkbox.entry.js +4 -2
  209. package/dist/esm/verdocs-checkbox.entry.js.map +1 -1
  210. package/dist/esm/verdocs-contact-picker.entry.js +1 -1
  211. package/dist/esm/verdocs-document-page_2.entry.js +89 -0
  212. package/dist/esm/verdocs-document-page_2.entry.js.map +1 -0
  213. package/dist/esm/verdocs-dropdown.entry.js +87 -0
  214. package/dist/esm/verdocs-dropdown.entry.js.map +1 -0
  215. package/dist/esm/verdocs-field-attachment.entry.js +4 -2
  216. package/dist/esm/verdocs-field-attachment.entry.js.map +1 -1
  217. package/dist/esm/verdocs-field-checkbox.entry.js +28 -0
  218. package/dist/esm/verdocs-field-checkbox.entry.js.map +1 -0
  219. package/dist/esm/verdocs-field-date.entry.js +10 -13
  220. package/dist/esm/verdocs-field-date.entry.js.map +1 -1
  221. package/dist/esm/verdocs-field-dropdown.entry.js +5 -16
  222. package/dist/esm/verdocs-field-dropdown.entry.js.map +1 -1
  223. package/dist/esm/verdocs-field-initial.entry.js +4 -5
  224. package/dist/esm/verdocs-field-initial.entry.js.map +1 -1
  225. package/dist/esm/verdocs-field-payment.entry.js +5 -3
  226. package/dist/esm/verdocs-field-payment.entry.js.map +1 -1
  227. package/dist/esm/verdocs-field-radio-button.entry.js +32 -0
  228. package/dist/esm/verdocs-field-radio-button.entry.js.map +1 -0
  229. package/dist/esm/verdocs-field-signature_3.entry.js +5 -7
  230. package/dist/esm/verdocs-field-signature_3.entry.js.map +1 -1
  231. package/dist/esm/verdocs-field-textarea.entry.js +3 -25
  232. package/dist/esm/verdocs-field-textarea.entry.js.map +1 -1
  233. package/dist/esm/verdocs-field-textbox.entry.js +11 -28
  234. package/dist/esm/verdocs-field-textbox.entry.js.map +1 -1
  235. package/dist/esm/verdocs-field-timestamp.entry.js +3 -26
  236. package/dist/esm/verdocs-field-timestamp.entry.js.map +1 -1
  237. package/dist/esm/verdocs-initial-dialog.entry.js +10 -13
  238. package/dist/esm/verdocs-initial-dialog.entry.js.map +1 -1
  239. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  240. package/dist/esm/verdocs-ok-dialog.entry.js.map +1 -1
  241. package/dist/esm/verdocs-preview.entry.js +19 -13
  242. package/dist/esm/verdocs-preview.entry.js.map +1 -1
  243. package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
  244. package/dist/esm/verdocs-search.entry.js +1 -1
  245. package/dist/esm/verdocs-send.entry.js +2 -2
  246. package/dist/esm/verdocs-sign.entry.js +160 -119
  247. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  248. package/dist/esm/verdocs-template-create_4.entry.js +52 -39
  249. package/dist/esm/verdocs-template-create_4.entry.js.map +1 -1
  250. package/dist/esm/verdocs-view.entry.js +272 -0
  251. package/dist/esm/verdocs-view.entry.js.map +1 -0
  252. package/dist/esm/verdocs-web-sdk.js +1 -1
  253. package/dist/esm-es5/Envelopes-19ca610d.js +2 -0
  254. package/dist/esm-es5/Envelopes-19ca610d.js.map +1 -0
  255. package/dist/esm-es5/{Templates-91922342.js → Templates-7a534fd1.js} +2 -2
  256. package/dist/esm-es5/{Templates-91922342.js.map → Templates-7a534fd1.js.map} +0 -0
  257. package/dist/esm-es5/VerdocsEndpoint-dac04424.js +2 -0
  258. package/dist/esm-es5/VerdocsEndpoint-dac04424.js.map +1 -0
  259. package/dist/esm-es5/index-fd7b8a34.js +2 -0
  260. package/dist/esm-es5/index-fd7b8a34.js.map +1 -0
  261. package/dist/esm-es5/loader.js +1 -1
  262. package/dist/esm-es5/loader.js.map +1 -1
  263. package/dist/esm-es5/templateStore-b8512d36.js +2 -0
  264. package/dist/esm-es5/templateStore-b8512d36.js.map +1 -0
  265. package/dist/esm-es5/utils-2e6beff8.js +2 -0
  266. package/dist/esm-es5/utils-2e6beff8.js.map +1 -0
  267. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  268. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  269. package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
  270. package/dist/esm-es5/verdocs-checkbox.entry.js +1 -1
  271. package/dist/esm-es5/verdocs-checkbox.entry.js.map +1 -1
  272. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  273. package/dist/esm-es5/verdocs-document-page_2.entry.js +2 -0
  274. package/dist/esm-es5/verdocs-document-page_2.entry.js.map +1 -0
  275. package/dist/esm-es5/verdocs-dropdown.entry.js +2 -0
  276. package/dist/esm-es5/verdocs-dropdown.entry.js.map +1 -0
  277. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  278. package/dist/esm-es5/verdocs-field-attachment.entry.js.map +1 -1
  279. package/dist/esm-es5/verdocs-field-checkbox.entry.js +2 -0
  280. package/dist/esm-es5/verdocs-field-checkbox.entry.js.map +1 -0
  281. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  282. package/dist/esm-es5/verdocs-field-date.entry.js.map +1 -1
  283. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  284. package/dist/esm-es5/verdocs-field-dropdown.entry.js.map +1 -1
  285. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  286. package/dist/esm-es5/verdocs-field-initial.entry.js.map +1 -1
  287. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  288. package/dist/esm-es5/verdocs-field-payment.entry.js.map +1 -1
  289. package/dist/esm-es5/verdocs-field-radio-button.entry.js +2 -0
  290. package/dist/esm-es5/verdocs-field-radio-button.entry.js.map +1 -0
  291. package/dist/esm-es5/verdocs-field-signature_3.entry.js +1 -1
  292. package/dist/esm-es5/verdocs-field-signature_3.entry.js.map +1 -1
  293. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  294. package/dist/esm-es5/verdocs-field-textarea.entry.js.map +1 -1
  295. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  296. package/dist/esm-es5/verdocs-field-textbox.entry.js.map +1 -1
  297. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  298. package/dist/esm-es5/verdocs-field-timestamp.entry.js.map +1 -1
  299. package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
  300. package/dist/esm-es5/verdocs-initial-dialog.entry.js.map +1 -1
  301. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  302. package/dist/esm-es5/verdocs-ok-dialog.entry.js.map +1 -1
  303. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  304. package/dist/esm-es5/verdocs-preview.entry.js.map +1 -1
  305. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  306. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  307. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  308. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  309. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  310. package/dist/esm-es5/verdocs-template-create_4.entry.js +1 -1
  311. package/dist/esm-es5/verdocs-template-create_4.entry.js.map +1 -1
  312. package/dist/esm-es5/verdocs-view.entry.js +2 -0
  313. package/dist/esm-es5/verdocs-view.entry.js.map +1 -0
  314. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  315. package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
  316. package/dist/types/components/controls/verdocs-button/verdocs-button.stories.d.ts +2 -2
  317. package/dist/types/components/controls/verdocs-checkbox/verdocs-checkbox.d.ts +12 -1
  318. package/dist/types/components/controls/verdocs-checkbox/verdocs-checkbox.stories.d.ts +4 -2
  319. package/dist/types/components/controls/verdocs-dropdown/verdocs-dropdown.d.ts +6 -9
  320. package/dist/types/components/controls/verdocs-radio-button/verdocs-radio-button.stories.d.ts +2 -2
  321. package/dist/types/components/controls/verdocs-select-input/verdocs-select-input.stories.d.ts +2 -2
  322. package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.stories.d.ts +2 -2
  323. package/dist/types/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.d.ts +2 -3
  324. package/dist/types/components/elements/verdocs-field-attachment/verdocs-field-attachment.d.ts +5 -5
  325. package/dist/types/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.d.ts +5 -5
  326. package/dist/types/components/elements/verdocs-field-date/verdocs-field-date.d.ts +1 -8
  327. package/dist/types/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.d.ts +3 -14
  328. package/dist/types/components/elements/verdocs-field-initial/verdocs-field-initial.d.ts +1 -5
  329. package/dist/types/components/elements/verdocs-field-payment/verdocs-field-payment.d.ts +5 -5
  330. package/dist/types/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.d.ts +5 -5
  331. package/dist/types/components/elements/verdocs-field-signature/verdocs-field-signature.d.ts +1 -5
  332. package/dist/types/components/elements/verdocs-field-textarea/verdocs-field-textarea.d.ts +1 -29
  333. package/dist/types/components/elements/verdocs-field-textbox/verdocs-field-textbox.d.ts +1 -28
  334. package/dist/types/components/elements/verdocs-field-textbox/verdocs-field-textbox.stories.d.ts +2 -1
  335. package/dist/types/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.d.ts +1 -33
  336. package/dist/types/components/embeds/verdocs-preview/verdocs-preview.d.ts +3 -1
  337. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +29 -16
  338. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +4 -49
  339. package/dist/types/components/embeds/verdocs-view/verdocs-view.stories.d.ts +1 -2
  340. package/dist/types/components.d.ts +49 -362
  341. package/dist/types/utils/Envelopes.d.ts +2 -0
  342. package/dist/types/utils/envelopeStore.d.ts +10 -0
  343. package/dist/types/utils/utils.d.ts +16 -2
  344. package/dist/verdocs-web-sdk/p-00dec610.system.js +2 -0
  345. package/dist/verdocs-web-sdk/p-00dec610.system.js.map +1 -0
  346. package/dist/verdocs-web-sdk/p-05433ef8.entry.js +2 -0
  347. package/dist/verdocs-web-sdk/p-05433ef8.entry.js.map +1 -0
  348. package/dist/verdocs-web-sdk/p-0f6da8c7.system.js +2 -0
  349. package/dist/verdocs-web-sdk/p-0f6da8c7.system.js.map +1 -0
  350. package/dist/verdocs-web-sdk/{p-b2dea632.entry.js → p-11fbd83d.entry.js} +2 -2
  351. package/dist/verdocs-web-sdk/p-11fbd83d.entry.js.map +1 -0
  352. package/dist/verdocs-web-sdk/p-1cd2f7dc.system.js +2 -0
  353. package/dist/verdocs-web-sdk/p-1cd2f7dc.system.js.map +1 -0
  354. package/dist/verdocs-web-sdk/p-2467a244.entry.js +2 -0
  355. package/dist/verdocs-web-sdk/p-2467a244.entry.js.map +1 -0
  356. package/dist/verdocs-web-sdk/p-26dc355e.entry.js +2 -0
  357. package/dist/verdocs-web-sdk/p-26dc355e.entry.js.map +1 -0
  358. package/dist/verdocs-web-sdk/p-27707de4.system.entry.js +2 -0
  359. package/dist/verdocs-web-sdk/p-27707de4.system.entry.js.map +1 -0
  360. package/dist/verdocs-web-sdk/p-2a153dae.system.entry.js +2 -0
  361. package/dist/verdocs-web-sdk/p-2a153dae.system.entry.js.map +1 -0
  362. package/dist/verdocs-web-sdk/{p-f11b14a1.entry.js → p-2fe5b678.entry.js} +2 -2
  363. package/dist/verdocs-web-sdk/{p-f11b14a1.entry.js.map → p-2fe5b678.entry.js.map} +0 -0
  364. package/dist/verdocs-web-sdk/p-305e3fb9.system.entry.js +2 -0
  365. package/dist/verdocs-web-sdk/p-305e3fb9.system.entry.js.map +1 -0
  366. package/dist/verdocs-web-sdk/p-339c7685.system.entry.js +2 -0
  367. package/dist/verdocs-web-sdk/p-339c7685.system.entry.js.map +1 -0
  368. package/dist/verdocs-web-sdk/p-3bc9be49.entry.js +2 -0
  369. package/dist/verdocs-web-sdk/p-3bc9be49.entry.js.map +1 -0
  370. package/dist/verdocs-web-sdk/p-3c2550a8.system.entry.js +2 -0
  371. package/dist/verdocs-web-sdk/p-3c2550a8.system.entry.js.map +1 -0
  372. package/dist/verdocs-web-sdk/p-40565c66.system.entry.js +2 -0
  373. package/dist/verdocs-web-sdk/p-40565c66.system.entry.js.map +1 -0
  374. package/dist/verdocs-web-sdk/p-4125b8e7.system.entry.js +2 -0
  375. package/dist/verdocs-web-sdk/p-4125b8e7.system.entry.js.map +1 -0
  376. package/dist/verdocs-web-sdk/p-4318e931.entry.js +2 -0
  377. package/dist/verdocs-web-sdk/p-4318e931.entry.js.map +1 -0
  378. package/dist/verdocs-web-sdk/p-4a2a1525.entry.js +2 -0
  379. package/dist/verdocs-web-sdk/{p-f06218ed.entry.js.map → p-4a2a1525.entry.js.map} +1 -1
  380. package/dist/verdocs-web-sdk/p-4a332358.system.entry.js +2 -0
  381. package/dist/verdocs-web-sdk/p-4a332358.system.entry.js.map +1 -0
  382. package/dist/verdocs-web-sdk/p-524017b8.entry.js +2 -0
  383. package/dist/verdocs-web-sdk/p-524017b8.entry.js.map +1 -0
  384. package/dist/verdocs-web-sdk/p-529a754e.system.entry.js +2 -0
  385. package/dist/verdocs-web-sdk/p-529a754e.system.entry.js.map +1 -0
  386. package/dist/verdocs-web-sdk/p-5a323cf3.system.js +2 -0
  387. package/dist/verdocs-web-sdk/p-5a323cf3.system.js.map +1 -0
  388. package/dist/verdocs-web-sdk/p-5ea05a1d.js +2 -0
  389. package/dist/verdocs-web-sdk/p-5ea05a1d.js.map +1 -0
  390. package/dist/verdocs-web-sdk/p-620ac97f.entry.js +2 -0
  391. package/dist/verdocs-web-sdk/p-620ac97f.entry.js.map +1 -0
  392. package/dist/verdocs-web-sdk/p-68ffd4bf.entry.js +2 -0
  393. package/dist/verdocs-web-sdk/p-68ffd4bf.entry.js.map +1 -0
  394. package/dist/verdocs-web-sdk/{p-dee9037d.system.entry.js → p-6a8ac53e.system.entry.js} +2 -2
  395. package/dist/verdocs-web-sdk/{p-dee9037d.system.entry.js.map → p-6a8ac53e.system.entry.js.map} +0 -0
  396. package/dist/verdocs-web-sdk/{p-473165ae.system.entry.js → p-6c7a70c0.system.entry.js} +2 -2
  397. package/dist/verdocs-web-sdk/{p-473165ae.system.entry.js.map → p-6c7a70c0.system.entry.js.map} +0 -0
  398. package/dist/verdocs-web-sdk/{p-2bb98709.system.entry.js → p-78ec7db1.system.entry.js} +2 -2
  399. package/dist/verdocs-web-sdk/{p-2bb98709.system.entry.js.map → p-78ec7db1.system.entry.js.map} +0 -0
  400. package/dist/verdocs-web-sdk/p-81343fb3.js +2 -0
  401. package/dist/verdocs-web-sdk/p-81343fb3.js.map +1 -0
  402. package/dist/verdocs-web-sdk/{p-0b2290c6.system.entry.js → p-8cce81ff.system.entry.js} +2 -2
  403. package/dist/verdocs-web-sdk/p-8cce81ff.system.entry.js.map +1 -0
  404. package/dist/verdocs-web-sdk/{p-63d01d16.system.js → p-9650cab5.system.js} +2 -2
  405. package/dist/verdocs-web-sdk/{p-63d01d16.system.js.map → p-9650cab5.system.js.map} +0 -0
  406. package/dist/verdocs-web-sdk/p-a15b9bc8.entry.js +2 -0
  407. package/dist/verdocs-web-sdk/p-a15b9bc8.entry.js.map +1 -0
  408. package/dist/verdocs-web-sdk/{p-d6390915.entry.js → p-a59f1f82.entry.js} +2 -2
  409. package/dist/verdocs-web-sdk/{p-d6390915.entry.js.map → p-a59f1f82.entry.js.map} +0 -0
  410. package/dist/verdocs-web-sdk/p-a5ce60d9.entry.js +2 -0
  411. package/dist/verdocs-web-sdk/p-a5ce60d9.entry.js.map +1 -0
  412. package/dist/verdocs-web-sdk/{p-0d12be64.system.entry.js → p-aa2d9932.system.entry.js} +2 -2
  413. package/dist/verdocs-web-sdk/{p-0d12be64.system.entry.js.map → p-aa2d9932.system.entry.js.map} +0 -0
  414. package/dist/verdocs-web-sdk/{p-8574c48b.system.entry.js → p-b3ee5dd5.system.entry.js} +2 -2
  415. package/dist/verdocs-web-sdk/p-b3ee5dd5.system.entry.js.map +1 -0
  416. package/dist/verdocs-web-sdk/p-b4de55c1.entry.js +2 -0
  417. package/dist/verdocs-web-sdk/p-b4de55c1.entry.js.map +1 -0
  418. package/dist/verdocs-web-sdk/p-b57effa2.system.entry.js +2 -0
  419. package/dist/verdocs-web-sdk/p-b57effa2.system.entry.js.map +1 -0
  420. package/dist/verdocs-web-sdk/{p-cf8ecaaf.system.entry.js → p-b5882803.system.entry.js} +2 -2
  421. package/dist/verdocs-web-sdk/{p-cf8ecaaf.system.entry.js.map → p-b5882803.system.entry.js.map} +0 -0
  422. package/dist/verdocs-web-sdk/p-b87bda66.js +2 -0
  423. package/dist/verdocs-web-sdk/{p-36700fe4.js.map → p-b87bda66.js.map} +0 -0
  424. package/dist/verdocs-web-sdk/{p-2da21c85.entry.js → p-baa985a4.entry.js} +2 -2
  425. package/dist/verdocs-web-sdk/{p-2da21c85.entry.js.map → p-baa985a4.entry.js.map} +0 -0
  426. package/dist/verdocs-web-sdk/p-becd8d7e.js +2 -0
  427. package/dist/verdocs-web-sdk/p-becd8d7e.js.map +1 -0
  428. package/dist/verdocs-web-sdk/p-bf6e28ea.system.entry.js +2 -0
  429. package/dist/verdocs-web-sdk/p-bf6e28ea.system.entry.js.map +1 -0
  430. package/dist/verdocs-web-sdk/p-c132d66e.entry.js +2 -0
  431. package/dist/verdocs-web-sdk/p-c132d66e.entry.js.map +1 -0
  432. package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
  433. package/dist/verdocs-web-sdk/p-c16b6ca4.system.js.map +1 -1
  434. package/dist/verdocs-web-sdk/p-c4357387.entry.js +2 -0
  435. package/dist/verdocs-web-sdk/p-c4357387.entry.js.map +1 -0
  436. package/dist/verdocs-web-sdk/p-c5794e33.entry.js +2 -0
  437. package/dist/verdocs-web-sdk/p-c5794e33.entry.js.map +1 -0
  438. package/dist/verdocs-web-sdk/p-c6ef13bd.system.entry.js +2 -0
  439. package/dist/verdocs-web-sdk/{p-508192bb.system.entry.js.map → p-c6ef13bd.system.entry.js.map} +1 -1
  440. package/dist/verdocs-web-sdk/p-d1f922c2.js +2 -0
  441. package/dist/verdocs-web-sdk/p-d1f922c2.js.map +1 -0
  442. package/dist/verdocs-web-sdk/p-d48d78a2.entry.js +2 -0
  443. package/dist/verdocs-web-sdk/p-d48d78a2.entry.js.map +1 -0
  444. package/dist/verdocs-web-sdk/p-d52297bc.system.entry.js +2 -0
  445. package/dist/verdocs-web-sdk/p-d52297bc.system.entry.js.map +1 -0
  446. package/dist/verdocs-web-sdk/p-d7c712e8.system.js +2 -0
  447. package/dist/verdocs-web-sdk/p-d7c712e8.system.js.map +1 -0
  448. package/dist/verdocs-web-sdk/p-d8e182fb.system.entry.js +2 -0
  449. package/dist/verdocs-web-sdk/p-d8e182fb.system.entry.js.map +1 -0
  450. package/dist/verdocs-web-sdk/p-d942510c.system.entry.js +2 -0
  451. package/dist/verdocs-web-sdk/p-d942510c.system.entry.js.map +1 -0
  452. package/dist/verdocs-web-sdk/{p-ab23a9d1.entry.js → p-deb5b86b.entry.js} +2 -2
  453. package/dist/verdocs-web-sdk/p-deb5b86b.entry.js.map +1 -0
  454. package/dist/verdocs-web-sdk/p-df877830.entry.js +2 -0
  455. package/dist/verdocs-web-sdk/p-df877830.entry.js.map +1 -0
  456. package/dist/verdocs-web-sdk/p-e4569806.system.entry.js +2 -0
  457. package/dist/verdocs-web-sdk/p-e4569806.system.entry.js.map +1 -0
  458. package/dist/verdocs-web-sdk/p-e6f928eb.js +2 -0
  459. package/dist/verdocs-web-sdk/p-e6f928eb.js.map +1 -0
  460. package/dist/verdocs-web-sdk/p-e918e13e.entry.js +2 -0
  461. package/dist/verdocs-web-sdk/p-e918e13e.entry.js.map +1 -0
  462. package/dist/verdocs-web-sdk/p-ed55daf4.system.entry.js +2 -0
  463. package/dist/verdocs-web-sdk/p-ed55daf4.system.entry.js.map +1 -0
  464. package/dist/verdocs-web-sdk/p-edc2802d.system.entry.js +2 -0
  465. package/dist/verdocs-web-sdk/p-edc2802d.system.entry.js.map +1 -0
  466. package/dist/verdocs-web-sdk/p-f8526821.system.entry.js +2 -0
  467. package/dist/verdocs-web-sdk/p-f8526821.system.entry.js.map +1 -0
  468. package/dist/verdocs-web-sdk/{p-259fd8de.entry.js → p-fac05414.entry.js} +2 -2
  469. package/dist/verdocs-web-sdk/{p-259fd8de.entry.js.map → p-fac05414.entry.js.map} +0 -0
  470. package/dist/verdocs-web-sdk/p-fb391ca5.entry.js +2 -0
  471. package/dist/verdocs-web-sdk/p-fb391ca5.entry.js.map +1 -0
  472. package/dist/verdocs-web-sdk/{p-932571a1.entry.js → p-fd99a113.entry.js} +2 -2
  473. package/dist/verdocs-web-sdk/{p-932571a1.entry.js.map → p-fd99a113.entry.js.map} +0 -0
  474. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  475. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
  476. package/package.json +2 -2
  477. package/dist/cjs/Envelopes-22a0c02f.js.map +0 -1
  478. package/dist/cjs/TemplateDocuments-01c6e570.js +0 -45
  479. package/dist/cjs/TemplateDocuments-01c6e570.js.map +0 -1
  480. package/dist/cjs/VerdocsEndpoint-db38e942.js +0 -2435
  481. package/dist/cjs/VerdocsEndpoint-db38e942.js.map +0 -1
  482. package/dist/cjs/templateStore-92828c3c.js.map +0 -1
  483. package/dist/cjs/utils-84236321.js.map +0 -1
  484. package/dist/cjs/verdocs-document-page.cjs.entry.js +0 -84
  485. package/dist/cjs/verdocs-document-page.cjs.entry.js.map +0 -1
  486. package/dist/cjs/verdocs-dropdown_3.cjs.entry.js +0 -128
  487. package/dist/cjs/verdocs-dropdown_3.cjs.entry.js.map +0 -1
  488. package/dist/cjs/verdocs-loader_4.cjs.entry.js +0 -553
  489. package/dist/cjs/verdocs-loader_4.cjs.entry.js.map +0 -1
  490. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.css +0 -16
  491. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.js +0 -390
  492. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.js.map +0 -1
  493. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.stories.js +0 -15
  494. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.stories.js.map +0 -1
  495. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.css +0 -16
  496. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.js +0 -388
  497. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.js.map +0 -1
  498. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.stories.js +0 -15
  499. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.stories.js.map +0 -1
  500. package/dist/components/TemplateDocuments.js +0 -42
  501. package/dist/components/TemplateDocuments.js.map +0 -1
  502. package/dist/components/verdocs-field-checkbox2.js +0 -46
  503. package/dist/components/verdocs-field-checkbox2.js.map +0 -1
  504. package/dist/components/verdocs-field-radio-button2.js +0 -50
  505. package/dist/components/verdocs-field-radio-button2.js.map +0 -1
  506. package/dist/components/verdocs-view-envelope-document.d.ts +0 -11
  507. package/dist/components/verdocs-view-envelope-document.js +0 -8
  508. package/dist/components/verdocs-view-envelope-document.js.map +0 -1
  509. package/dist/components/verdocs-view-envelope-document2.js +0 -306
  510. package/dist/components/verdocs-view-envelope-document2.js.map +0 -1
  511. package/dist/components/verdocs-view-template-document.d.ts +0 -11
  512. package/dist/components/verdocs-view-template-document.js +0 -8
  513. package/dist/components/verdocs-view-template-document.js.map +0 -1
  514. package/dist/components/verdocs-view-template-document2.js +0 -209
  515. package/dist/components/verdocs-view-template-document2.js.map +0 -1
  516. package/dist/components/verdocs-view2.js +0 -229
  517. package/dist/components/verdocs-view2.js.map +0 -1
  518. package/dist/esm/Envelopes-df05b3c7.js.map +0 -1
  519. package/dist/esm/TemplateDocuments-89ba2276.js +0 -42
  520. package/dist/esm/TemplateDocuments-89ba2276.js.map +0 -1
  521. package/dist/esm/VerdocsEndpoint-82f4600d.js +0 -2432
  522. package/dist/esm/VerdocsEndpoint-82f4600d.js.map +0 -1
  523. package/dist/esm/templateStore-3b26e38d.js.map +0 -1
  524. package/dist/esm/utils-3f23facc.js.map +0 -1
  525. package/dist/esm/verdocs-document-page.entry.js +0 -80
  526. package/dist/esm/verdocs-document-page.entry.js.map +0 -1
  527. package/dist/esm/verdocs-dropdown_3.entry.js +0 -122
  528. package/dist/esm/verdocs-dropdown_3.entry.js.map +0 -1
  529. package/dist/esm/verdocs-loader_4.entry.js +0 -546
  530. package/dist/esm/verdocs-loader_4.entry.js.map +0 -1
  531. package/dist/esm-es5/Envelopes-df05b3c7.js +0 -2
  532. package/dist/esm-es5/Envelopes-df05b3c7.js.map +0 -1
  533. package/dist/esm-es5/TemplateDocuments-89ba2276.js +0 -2
  534. package/dist/esm-es5/TemplateDocuments-89ba2276.js.map +0 -1
  535. package/dist/esm-es5/VerdocsEndpoint-82f4600d.js +0 -2
  536. package/dist/esm-es5/VerdocsEndpoint-82f4600d.js.map +0 -1
  537. package/dist/esm-es5/templateStore-3b26e38d.js +0 -2
  538. package/dist/esm-es5/templateStore-3b26e38d.js.map +0 -1
  539. package/dist/esm-es5/utils-3f23facc.js +0 -2
  540. package/dist/esm-es5/utils-3f23facc.js.map +0 -1
  541. package/dist/esm-es5/verdocs-document-page.entry.js +0 -2
  542. package/dist/esm-es5/verdocs-document-page.entry.js.map +0 -1
  543. package/dist/esm-es5/verdocs-dropdown_3.entry.js +0 -2
  544. package/dist/esm-es5/verdocs-dropdown_3.entry.js.map +0 -1
  545. package/dist/esm-es5/verdocs-loader_4.entry.js +0 -2
  546. package/dist/esm-es5/verdocs-loader_4.entry.js.map +0 -1
  547. package/dist/types/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.d.ts +0 -79
  548. package/dist/types/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.stories.d.ts +0 -7
  549. package/dist/types/components/elements/verdocs-view-template-document/verdocs-view-template-document.d.ts +0 -77
  550. package/dist/types/components/elements/verdocs-view-template-document/verdocs-view-template-document.stories.d.ts +0 -7
  551. package/dist/verdocs-web-sdk/p-036fc9f9.entry.js +0 -2
  552. package/dist/verdocs-web-sdk/p-036fc9f9.entry.js.map +0 -1
  553. package/dist/verdocs-web-sdk/p-04708900.system.entry.js +0 -2
  554. package/dist/verdocs-web-sdk/p-04708900.system.entry.js.map +0 -1
  555. package/dist/verdocs-web-sdk/p-0b2290c6.system.entry.js.map +0 -1
  556. package/dist/verdocs-web-sdk/p-142295dd.system.entry.js +0 -2
  557. package/dist/verdocs-web-sdk/p-142295dd.system.entry.js.map +0 -1
  558. package/dist/verdocs-web-sdk/p-15584ecb.entry.js +0 -2
  559. package/dist/verdocs-web-sdk/p-15584ecb.entry.js.map +0 -1
  560. package/dist/verdocs-web-sdk/p-2510c268.entry.js +0 -2
  561. package/dist/verdocs-web-sdk/p-2510c268.entry.js.map +0 -1
  562. package/dist/verdocs-web-sdk/p-2fbd4e25.entry.js +0 -2
  563. package/dist/verdocs-web-sdk/p-2fbd4e25.entry.js.map +0 -1
  564. package/dist/verdocs-web-sdk/p-3035b6c5.system.js +0 -2
  565. package/dist/verdocs-web-sdk/p-3035b6c5.system.js.map +0 -1
  566. package/dist/verdocs-web-sdk/p-36700fe4.js +0 -2
  567. package/dist/verdocs-web-sdk/p-3a4126d5.system.entry.js +0 -2
  568. package/dist/verdocs-web-sdk/p-3a4126d5.system.entry.js.map +0 -1
  569. package/dist/verdocs-web-sdk/p-48d9e0d6.entry.js +0 -2
  570. package/dist/verdocs-web-sdk/p-48d9e0d6.entry.js.map +0 -1
  571. package/dist/verdocs-web-sdk/p-508192bb.system.entry.js +0 -2
  572. package/dist/verdocs-web-sdk/p-629237fc.js +0 -2
  573. package/dist/verdocs-web-sdk/p-629237fc.js.map +0 -1
  574. package/dist/verdocs-web-sdk/p-650e0b71.entry.js +0 -2
  575. package/dist/verdocs-web-sdk/p-650e0b71.entry.js.map +0 -1
  576. package/dist/verdocs-web-sdk/p-68319ca5.system.entry.js +0 -2
  577. package/dist/verdocs-web-sdk/p-68319ca5.system.entry.js.map +0 -1
  578. package/dist/verdocs-web-sdk/p-6e1ada33.system.js +0 -2
  579. package/dist/verdocs-web-sdk/p-6e1ada33.system.js.map +0 -1
  580. package/dist/verdocs-web-sdk/p-6f1440dd.js +0 -2
  581. package/dist/verdocs-web-sdk/p-6f1440dd.js.map +0 -1
  582. package/dist/verdocs-web-sdk/p-6f938ce3.entry.js +0 -2
  583. package/dist/verdocs-web-sdk/p-6f938ce3.entry.js.map +0 -1
  584. package/dist/verdocs-web-sdk/p-70c732b7.js +0 -2
  585. package/dist/verdocs-web-sdk/p-70c732b7.js.map +0 -1
  586. package/dist/verdocs-web-sdk/p-7ce27ce2.js +0 -2
  587. package/dist/verdocs-web-sdk/p-7ce27ce2.js.map +0 -1
  588. package/dist/verdocs-web-sdk/p-8574c48b.system.entry.js.map +0 -1
  589. package/dist/verdocs-web-sdk/p-8c549b7f.entry.js +0 -2
  590. package/dist/verdocs-web-sdk/p-8c549b7f.entry.js.map +0 -1
  591. package/dist/verdocs-web-sdk/p-8fd9dc5a.js +0 -2
  592. package/dist/verdocs-web-sdk/p-8fd9dc5a.js.map +0 -1
  593. package/dist/verdocs-web-sdk/p-a4041773.system.js +0 -2
  594. package/dist/verdocs-web-sdk/p-a4041773.system.js.map +0 -1
  595. package/dist/verdocs-web-sdk/p-ab23a9d1.entry.js.map +0 -1
  596. package/dist/verdocs-web-sdk/p-acfdfb92.system.entry.js +0 -2
  597. package/dist/verdocs-web-sdk/p-acfdfb92.system.entry.js.map +0 -1
  598. package/dist/verdocs-web-sdk/p-b2dea632.entry.js.map +0 -1
  599. package/dist/verdocs-web-sdk/p-b348e0ee.entry.js +0 -2
  600. package/dist/verdocs-web-sdk/p-b348e0ee.entry.js.map +0 -1
  601. package/dist/verdocs-web-sdk/p-b95cb372.entry.js +0 -2
  602. package/dist/verdocs-web-sdk/p-b95cb372.entry.js.map +0 -1
  603. package/dist/verdocs-web-sdk/p-b9cdae44.system.entry.js +0 -2
  604. package/dist/verdocs-web-sdk/p-b9cdae44.system.entry.js.map +0 -1
  605. package/dist/verdocs-web-sdk/p-bcae2278.entry.js +0 -2
  606. package/dist/verdocs-web-sdk/p-bcae2278.entry.js.map +0 -1
  607. package/dist/verdocs-web-sdk/p-c37ea778.system.entry.js +0 -2
  608. package/dist/verdocs-web-sdk/p-c37ea778.system.entry.js.map +0 -1
  609. package/dist/verdocs-web-sdk/p-c827cc19.system.js +0 -2
  610. package/dist/verdocs-web-sdk/p-c827cc19.system.js.map +0 -1
  611. package/dist/verdocs-web-sdk/p-ca6a1398.system.entry.js +0 -2
  612. package/dist/verdocs-web-sdk/p-ca6a1398.system.entry.js.map +0 -1
  613. package/dist/verdocs-web-sdk/p-ccf983c7.system.entry.js +0 -2
  614. package/dist/verdocs-web-sdk/p-ccf983c7.system.entry.js.map +0 -1
  615. package/dist/verdocs-web-sdk/p-cf2d7761.system.entry.js +0 -2
  616. package/dist/verdocs-web-sdk/p-cf2d7761.system.entry.js.map +0 -1
  617. package/dist/verdocs-web-sdk/p-d2d3b56d.system.entry.js +0 -2
  618. package/dist/verdocs-web-sdk/p-d2d3b56d.system.entry.js.map +0 -1
  619. package/dist/verdocs-web-sdk/p-df44cc61.system.entry.js +0 -2
  620. package/dist/verdocs-web-sdk/p-df44cc61.system.entry.js.map +0 -1
  621. package/dist/verdocs-web-sdk/p-e47e3154.entry.js +0 -2
  622. package/dist/verdocs-web-sdk/p-e47e3154.entry.js.map +0 -1
  623. package/dist/verdocs-web-sdk/p-e96a04c2.entry.js +0 -2
  624. package/dist/verdocs-web-sdk/p-e96a04c2.entry.js.map +0 -1
  625. package/dist/verdocs-web-sdk/p-ed71080a.entry.js +0 -2
  626. package/dist/verdocs-web-sdk/p-ed71080a.entry.js.map +0 -1
  627. package/dist/verdocs-web-sdk/p-ed8e3256.system.entry.js +0 -2
  628. package/dist/verdocs-web-sdk/p-ed8e3256.system.entry.js.map +0 -1
  629. package/dist/verdocs-web-sdk/p-f06218ed.entry.js +0 -2
  630. package/dist/verdocs-web-sdk/p-f5eb353f.system.entry.js +0 -2
  631. package/dist/verdocs-web-sdk/p-f5eb353f.system.entry.js.map +0 -1
  632. package/dist/verdocs-web-sdk/p-f9901184.system.js +0 -2
  633. package/dist/verdocs-web-sdk/p-f9901184.system.js.map +0 -1
  634. package/dist/verdocs-web-sdk/p-fc3a0e2d.system.entry.js +0 -2
  635. package/dist/verdocs-web-sdk/p-fc3a0e2d.system.entry.js.map +0 -1
  636. package/dist/verdocs-web-sdk/p-fe512c19.entry.js +0 -2
  637. package/dist/verdocs-web-sdk/p-fe512c19.entry.js.map +0 -1
  638. package/dist/verdocs-web-sdk/p-ff4840d2.system.entry.js +0 -2
  639. package/dist/verdocs-web-sdk/p-ff4840d2.system.entry.js.map +0 -1
  640. package/dist/verdocs-web-sdk/p-ffff808d.entry.js +0 -2
  641. package/dist/verdocs-web-sdk/p-ffff808d.entry.js.map +0 -1
@@ -0,0 +1,3566 @@
1
+ /* tslint:disable:no-bitwise */
2
+ var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
3
+ // Regular expression to check formal correctness of base64 encoded strings
4
+ var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
5
+ /**
6
+ * Simplified, Node/Browser-safe alternative to atob() for base64 decoding.
7
+ * Modified from https://github.com/MaxArt2501/base64-js/blob/master/base64.js
8
+ */
9
+ var AtoB = function (str) {
10
+ // atob can work with strings with whitespaces, even inside the encoded part,
11
+ // but only \t, \n, \f, \r and ' ', which can be stripped.
12
+ str = String(str).replace(/[\t\n\f\r ]+/g, '');
13
+ if (!b64re.test(str))
14
+ throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
15
+ // Adding the padding if missing, for semplicity
16
+ str += '=='.slice(2 - (str.length & 3));
17
+ var bitmap;
18
+ var result = '';
19
+ var r1;
20
+ var r2;
21
+ var i = 0;
22
+ for (; i < str.length;) {
23
+ bitmap =
24
+ (b64.indexOf(str.charAt(i++)) << 18) |
25
+ (b64.indexOf(str.charAt(i++)) << 12) |
26
+ ((r1 = b64.indexOf(str.charAt(i++))) << 6) |
27
+ (r2 = b64.indexOf(str.charAt(i++)));
28
+ result +=
29
+ r1 === 64
30
+ ? String.fromCharCode((bitmap >> 16) & 255)
31
+ : r2 === 64
32
+ ? String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255)
33
+ : String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255, bitmap & 255);
34
+ }
35
+ return result;
36
+ };
37
+ /**
38
+ * Decode the body of a JWT. This helper may allow front-end applications to avoid a dependency on `jsonwebtoken` in
39
+ * many cases. Note that this should only be used for true JWTs. Opaque tokens will cause this to throw.
40
+ */
41
+ var decodeJWTBody = function (token) { return JSON.parse(AtoB((token || '').split('.')[1] || '')); };
42
+ /**
43
+ * Decode the body of an Verdocs access token. Note that raw tokens contain namespaced fields, e.g.
44
+ * `https://verdocs.com/profile_id`. To make these tokens easier to use in front-end code, this name-spacing
45
+ * will be removed. Note that user and signing sessions have different access token formats. The calling
46
+ * application should distinguish between the two based on the context of the authenticated session, or by
47
+ * the presence of the `document_id` field, which will only be present for signing sessions.
48
+ */
49
+ var decodeAccessTokenBody = function (token) {
50
+ var decoded;
51
+ try {
52
+ decoded = decodeJWTBody(token);
53
+ if (decoded === null) {
54
+ return null;
55
+ }
56
+ }
57
+ catch (e) {
58
+ return null;
59
+ }
60
+ Object.keys(decoded).forEach(function (key) {
61
+ if (typeof key === 'string' && key.startsWith('https://verdocs.com/')) {
62
+ decoded[key.replace('https://verdocs.com/', '')] = decoded[key];
63
+ delete decoded[key];
64
+ }
65
+ });
66
+ return decoded;
67
+ };
68
+
69
+ function bind(fn, thisArg) {
70
+ return function wrap() {
71
+ return fn.apply(thisArg, arguments);
72
+ };
73
+ }
74
+
75
+ // utils is a library of generic helper functions non-specific to axios
76
+
77
+ const {toString} = Object.prototype;
78
+ const {getPrototypeOf} = Object;
79
+
80
+ const kindOf = (cache => thing => {
81
+ const str = toString.call(thing);
82
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
83
+ })(Object.create(null));
84
+
85
+ const kindOfTest = (type) => {
86
+ type = type.toLowerCase();
87
+ return (thing) => kindOf(thing) === type
88
+ };
89
+
90
+ const typeOfTest = type => thing => typeof thing === type;
91
+
92
+ /**
93
+ * Determine if a value is an Array
94
+ *
95
+ * @param {Object} val The value to test
96
+ *
97
+ * @returns {boolean} True if value is an Array, otherwise false
98
+ */
99
+ const {isArray} = Array;
100
+
101
+ /**
102
+ * Determine if a value is undefined
103
+ *
104
+ * @param {*} val The value to test
105
+ *
106
+ * @returns {boolean} True if the value is undefined, otherwise false
107
+ */
108
+ const isUndefined = typeOfTest('undefined');
109
+
110
+ /**
111
+ * Determine if a value is a Buffer
112
+ *
113
+ * @param {*} val The value to test
114
+ *
115
+ * @returns {boolean} True if value is a Buffer, otherwise false
116
+ */
117
+ function isBuffer(val) {
118
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
119
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
120
+ }
121
+
122
+ /**
123
+ * Determine if a value is an ArrayBuffer
124
+ *
125
+ * @param {*} val The value to test
126
+ *
127
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
128
+ */
129
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
130
+
131
+
132
+ /**
133
+ * Determine if a value is a view on an ArrayBuffer
134
+ *
135
+ * @param {*} val The value to test
136
+ *
137
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
138
+ */
139
+ function isArrayBufferView(val) {
140
+ let result;
141
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
142
+ result = ArrayBuffer.isView(val);
143
+ } else {
144
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
145
+ }
146
+ return result;
147
+ }
148
+
149
+ /**
150
+ * Determine if a value is a String
151
+ *
152
+ * @param {*} val The value to test
153
+ *
154
+ * @returns {boolean} True if value is a String, otherwise false
155
+ */
156
+ const isString = typeOfTest('string');
157
+
158
+ /**
159
+ * Determine if a value is a Function
160
+ *
161
+ * @param {*} val The value to test
162
+ * @returns {boolean} True if value is a Function, otherwise false
163
+ */
164
+ const isFunction = typeOfTest('function');
165
+
166
+ /**
167
+ * Determine if a value is a Number
168
+ *
169
+ * @param {*} val The value to test
170
+ *
171
+ * @returns {boolean} True if value is a Number, otherwise false
172
+ */
173
+ const isNumber = typeOfTest('number');
174
+
175
+ /**
176
+ * Determine if a value is an Object
177
+ *
178
+ * @param {*} thing The value to test
179
+ *
180
+ * @returns {boolean} True if value is an Object, otherwise false
181
+ */
182
+ const isObject = (thing) => thing !== null && typeof thing === 'object';
183
+
184
+ /**
185
+ * Determine if a value is a Boolean
186
+ *
187
+ * @param {*} thing The value to test
188
+ * @returns {boolean} True if value is a Boolean, otherwise false
189
+ */
190
+ const isBoolean = thing => thing === true || thing === false;
191
+
192
+ /**
193
+ * Determine if a value is a plain Object
194
+ *
195
+ * @param {*} val The value to test
196
+ *
197
+ * @returns {boolean} True if value is a plain Object, otherwise false
198
+ */
199
+ const isPlainObject = (val) => {
200
+ if (kindOf(val) !== 'object') {
201
+ return false;
202
+ }
203
+
204
+ const prototype = getPrototypeOf(val);
205
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
206
+ };
207
+
208
+ /**
209
+ * Determine if a value is a Date
210
+ *
211
+ * @param {*} val The value to test
212
+ *
213
+ * @returns {boolean} True if value is a Date, otherwise false
214
+ */
215
+ const isDate = kindOfTest('Date');
216
+
217
+ /**
218
+ * Determine if a value is a File
219
+ *
220
+ * @param {*} val The value to test
221
+ *
222
+ * @returns {boolean} True if value is a File, otherwise false
223
+ */
224
+ const isFile = kindOfTest('File');
225
+
226
+ /**
227
+ * Determine if a value is a Blob
228
+ *
229
+ * @param {*} val The value to test
230
+ *
231
+ * @returns {boolean} True if value is a Blob, otherwise false
232
+ */
233
+ const isBlob = kindOfTest('Blob');
234
+
235
+ /**
236
+ * Determine if a value is a FileList
237
+ *
238
+ * @param {*} val The value to test
239
+ *
240
+ * @returns {boolean} True if value is a File, otherwise false
241
+ */
242
+ const isFileList = kindOfTest('FileList');
243
+
244
+ /**
245
+ * Determine if a value is a Stream
246
+ *
247
+ * @param {*} val The value to test
248
+ *
249
+ * @returns {boolean} True if value is a Stream, otherwise false
250
+ */
251
+ const isStream = (val) => isObject(val) && isFunction(val.pipe);
252
+
253
+ /**
254
+ * Determine if a value is a FormData
255
+ *
256
+ * @param {*} thing The value to test
257
+ *
258
+ * @returns {boolean} True if value is an FormData, otherwise false
259
+ */
260
+ const isFormData = (thing) => {
261
+ const pattern = '[object FormData]';
262
+ return thing && (
263
+ (typeof FormData === 'function' && thing instanceof FormData) ||
264
+ toString.call(thing) === pattern ||
265
+ (isFunction(thing.toString) && thing.toString() === pattern)
266
+ );
267
+ };
268
+
269
+ /**
270
+ * Determine if a value is a URLSearchParams object
271
+ *
272
+ * @param {*} val The value to test
273
+ *
274
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
275
+ */
276
+ const isURLSearchParams = kindOfTest('URLSearchParams');
277
+
278
+ /**
279
+ * Trim excess whitespace off the beginning and end of a string
280
+ *
281
+ * @param {String} str The String to trim
282
+ *
283
+ * @returns {String} The String freed of excess whitespace
284
+ */
285
+ const trim = (str) => str.trim ?
286
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
287
+
288
+ /**
289
+ * Iterate over an Array or an Object invoking a function for each item.
290
+ *
291
+ * If `obj` is an Array callback will be called passing
292
+ * the value, index, and complete array for each item.
293
+ *
294
+ * If 'obj' is an Object callback will be called passing
295
+ * the value, key, and complete object for each property.
296
+ *
297
+ * @param {Object|Array} obj The object to iterate
298
+ * @param {Function} fn The callback to invoke for each item
299
+ *
300
+ * @param {Boolean} [allOwnKeys = false]
301
+ * @returns {any}
302
+ */
303
+ function forEach(obj, fn, {allOwnKeys = false} = {}) {
304
+ // Don't bother if no value provided
305
+ if (obj === null || typeof obj === 'undefined') {
306
+ return;
307
+ }
308
+
309
+ let i;
310
+ let l;
311
+
312
+ // Force an array if not already something iterable
313
+ if (typeof obj !== 'object') {
314
+ /*eslint no-param-reassign:0*/
315
+ obj = [obj];
316
+ }
317
+
318
+ if (isArray(obj)) {
319
+ // Iterate over array values
320
+ for (i = 0, l = obj.length; i < l; i++) {
321
+ fn.call(null, obj[i], i, obj);
322
+ }
323
+ } else {
324
+ // Iterate over object keys
325
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
326
+ const len = keys.length;
327
+ let key;
328
+
329
+ for (i = 0; i < len; i++) {
330
+ key = keys[i];
331
+ fn.call(null, obj[key], key, obj);
332
+ }
333
+ }
334
+ }
335
+
336
+ function findKey(obj, key) {
337
+ key = key.toLowerCase();
338
+ const keys = Object.keys(obj);
339
+ let i = keys.length;
340
+ let _key;
341
+ while (i-- > 0) {
342
+ _key = keys[i];
343
+ if (key === _key.toLowerCase()) {
344
+ return _key;
345
+ }
346
+ }
347
+ return null;
348
+ }
349
+
350
+ const _global = (() => {
351
+ /*eslint no-undef:0*/
352
+ if (typeof globalThis !== "undefined") return globalThis;
353
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
354
+ })();
355
+
356
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
357
+
358
+ /**
359
+ * Accepts varargs expecting each argument to be an object, then
360
+ * immutably merges the properties of each object and returns result.
361
+ *
362
+ * When multiple objects contain the same key the later object in
363
+ * the arguments list will take precedence.
364
+ *
365
+ * Example:
366
+ *
367
+ * ```js
368
+ * var result = merge({foo: 123}, {foo: 456});
369
+ * console.log(result.foo); // outputs 456
370
+ * ```
371
+ *
372
+ * @param {Object} obj1 Object to merge
373
+ *
374
+ * @returns {Object} Result of all merge properties
375
+ */
376
+ function merge(/* obj1, obj2, obj3, ... */) {
377
+ const {caseless} = isContextDefined(this) && this || {};
378
+ const result = {};
379
+ const assignValue = (val, key) => {
380
+ const targetKey = caseless && findKey(result, key) || key;
381
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
382
+ result[targetKey] = merge(result[targetKey], val);
383
+ } else if (isPlainObject(val)) {
384
+ result[targetKey] = merge({}, val);
385
+ } else if (isArray(val)) {
386
+ result[targetKey] = val.slice();
387
+ } else {
388
+ result[targetKey] = val;
389
+ }
390
+ };
391
+
392
+ for (let i = 0, l = arguments.length; i < l; i++) {
393
+ arguments[i] && forEach(arguments[i], assignValue);
394
+ }
395
+ return result;
396
+ }
397
+
398
+ /**
399
+ * Extends object a by mutably adding to it the properties of object b.
400
+ *
401
+ * @param {Object} a The object to be extended
402
+ * @param {Object} b The object to copy properties from
403
+ * @param {Object} thisArg The object to bind function to
404
+ *
405
+ * @param {Boolean} [allOwnKeys]
406
+ * @returns {Object} The resulting value of object a
407
+ */
408
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
409
+ forEach(b, (val, key) => {
410
+ if (thisArg && isFunction(val)) {
411
+ a[key] = bind(val, thisArg);
412
+ } else {
413
+ a[key] = val;
414
+ }
415
+ }, {allOwnKeys});
416
+ return a;
417
+ };
418
+
419
+ /**
420
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
421
+ *
422
+ * @param {string} content with BOM
423
+ *
424
+ * @returns {string} content value without BOM
425
+ */
426
+ const stripBOM = (content) => {
427
+ if (content.charCodeAt(0) === 0xFEFF) {
428
+ content = content.slice(1);
429
+ }
430
+ return content;
431
+ };
432
+
433
+ /**
434
+ * Inherit the prototype methods from one constructor into another
435
+ * @param {function} constructor
436
+ * @param {function} superConstructor
437
+ * @param {object} [props]
438
+ * @param {object} [descriptors]
439
+ *
440
+ * @returns {void}
441
+ */
442
+ const inherits = (constructor, superConstructor, props, descriptors) => {
443
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
444
+ constructor.prototype.constructor = constructor;
445
+ Object.defineProperty(constructor, 'super', {
446
+ value: superConstructor.prototype
447
+ });
448
+ props && Object.assign(constructor.prototype, props);
449
+ };
450
+
451
+ /**
452
+ * Resolve object with deep prototype chain to a flat object
453
+ * @param {Object} sourceObj source object
454
+ * @param {Object} [destObj]
455
+ * @param {Function|Boolean} [filter]
456
+ * @param {Function} [propFilter]
457
+ *
458
+ * @returns {Object}
459
+ */
460
+ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
461
+ let props;
462
+ let i;
463
+ let prop;
464
+ const merged = {};
465
+
466
+ destObj = destObj || {};
467
+ // eslint-disable-next-line no-eq-null,eqeqeq
468
+ if (sourceObj == null) return destObj;
469
+
470
+ do {
471
+ props = Object.getOwnPropertyNames(sourceObj);
472
+ i = props.length;
473
+ while (i-- > 0) {
474
+ prop = props[i];
475
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
476
+ destObj[prop] = sourceObj[prop];
477
+ merged[prop] = true;
478
+ }
479
+ }
480
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
481
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
482
+
483
+ return destObj;
484
+ };
485
+
486
+ /**
487
+ * Determines whether a string ends with the characters of a specified string
488
+ *
489
+ * @param {String} str
490
+ * @param {String} searchString
491
+ * @param {Number} [position= 0]
492
+ *
493
+ * @returns {boolean}
494
+ */
495
+ const endsWith = (str, searchString, position) => {
496
+ str = String(str);
497
+ if (position === undefined || position > str.length) {
498
+ position = str.length;
499
+ }
500
+ position -= searchString.length;
501
+ const lastIndex = str.indexOf(searchString, position);
502
+ return lastIndex !== -1 && lastIndex === position;
503
+ };
504
+
505
+
506
+ /**
507
+ * Returns new array from array like object or null if failed
508
+ *
509
+ * @param {*} [thing]
510
+ *
511
+ * @returns {?Array}
512
+ */
513
+ const toArray = (thing) => {
514
+ if (!thing) return null;
515
+ if (isArray(thing)) return thing;
516
+ let i = thing.length;
517
+ if (!isNumber(i)) return null;
518
+ const arr = new Array(i);
519
+ while (i-- > 0) {
520
+ arr[i] = thing[i];
521
+ }
522
+ return arr;
523
+ };
524
+
525
+ /**
526
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
527
+ * thing passed in is an instance of Uint8Array
528
+ *
529
+ * @param {TypedArray}
530
+ *
531
+ * @returns {Array}
532
+ */
533
+ // eslint-disable-next-line func-names
534
+ const isTypedArray = (TypedArray => {
535
+ // eslint-disable-next-line func-names
536
+ return thing => {
537
+ return TypedArray && thing instanceof TypedArray;
538
+ };
539
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
540
+
541
+ /**
542
+ * For each entry in the object, call the function with the key and value.
543
+ *
544
+ * @param {Object<any, any>} obj - The object to iterate over.
545
+ * @param {Function} fn - The function to call for each entry.
546
+ *
547
+ * @returns {void}
548
+ */
549
+ const forEachEntry = (obj, fn) => {
550
+ const generator = obj && obj[Symbol.iterator];
551
+
552
+ const iterator = generator.call(obj);
553
+
554
+ let result;
555
+
556
+ while ((result = iterator.next()) && !result.done) {
557
+ const pair = result.value;
558
+ fn.call(obj, pair[0], pair[1]);
559
+ }
560
+ };
561
+
562
+ /**
563
+ * It takes a regular expression and a string, and returns an array of all the matches
564
+ *
565
+ * @param {string} regExp - The regular expression to match against.
566
+ * @param {string} str - The string to search.
567
+ *
568
+ * @returns {Array<boolean>}
569
+ */
570
+ const matchAll = (regExp, str) => {
571
+ let matches;
572
+ const arr = [];
573
+
574
+ while ((matches = regExp.exec(str)) !== null) {
575
+ arr.push(matches);
576
+ }
577
+
578
+ return arr;
579
+ };
580
+
581
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
582
+ const isHTMLForm = kindOfTest('HTMLFormElement');
583
+
584
+ const toCamelCase = str => {
585
+ return str.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,
586
+ function replacer(m, p1, p2) {
587
+ return p1.toUpperCase() + p2;
588
+ }
589
+ );
590
+ };
591
+
592
+ /* Creating a function that will check if an object has a property. */
593
+ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
594
+
595
+ /**
596
+ * Determine if a value is a RegExp object
597
+ *
598
+ * @param {*} val The value to test
599
+ *
600
+ * @returns {boolean} True if value is a RegExp object, otherwise false
601
+ */
602
+ const isRegExp = kindOfTest('RegExp');
603
+
604
+ const reduceDescriptors = (obj, reducer) => {
605
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
606
+ const reducedDescriptors = {};
607
+
608
+ forEach(descriptors, (descriptor, name) => {
609
+ if (reducer(descriptor, name, obj) !== false) {
610
+ reducedDescriptors[name] = descriptor;
611
+ }
612
+ });
613
+
614
+ Object.defineProperties(obj, reducedDescriptors);
615
+ };
616
+
617
+ /**
618
+ * Makes all methods read-only
619
+ * @param {Object} obj
620
+ */
621
+
622
+ const freezeMethods = (obj) => {
623
+ reduceDescriptors(obj, (descriptor, name) => {
624
+ // skip restricted props in strict mode
625
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
626
+ return false;
627
+ }
628
+
629
+ const value = obj[name];
630
+
631
+ if (!isFunction(value)) return;
632
+
633
+ descriptor.enumerable = false;
634
+
635
+ if ('writable' in descriptor) {
636
+ descriptor.writable = false;
637
+ return;
638
+ }
639
+
640
+ if (!descriptor.set) {
641
+ descriptor.set = () => {
642
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
643
+ };
644
+ }
645
+ });
646
+ };
647
+
648
+ const toObjectSet = (arrayOrString, delimiter) => {
649
+ const obj = {};
650
+
651
+ const define = (arr) => {
652
+ arr.forEach(value => {
653
+ obj[value] = true;
654
+ });
655
+ };
656
+
657
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
658
+
659
+ return obj;
660
+ };
661
+
662
+ const noop = () => {};
663
+
664
+ const toFiniteNumber = (value, defaultValue) => {
665
+ value = +value;
666
+ return Number.isFinite(value) ? value : defaultValue;
667
+ };
668
+
669
+ const toJSONObject = (obj) => {
670
+ const stack = new Array(10);
671
+
672
+ const visit = (source, i) => {
673
+
674
+ if (isObject(source)) {
675
+ if (stack.indexOf(source) >= 0) {
676
+ return;
677
+ }
678
+
679
+ if(!('toJSON' in source)) {
680
+ stack[i] = source;
681
+ const target = isArray(source) ? [] : {};
682
+
683
+ forEach(source, (value, key) => {
684
+ const reducedValue = visit(value, i + 1);
685
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
686
+ });
687
+
688
+ stack[i] = undefined;
689
+
690
+ return target;
691
+ }
692
+ }
693
+
694
+ return source;
695
+ };
696
+
697
+ return visit(obj, 0);
698
+ };
699
+
700
+ const utils = {
701
+ isArray,
702
+ isArrayBuffer,
703
+ isBuffer,
704
+ isFormData,
705
+ isArrayBufferView,
706
+ isString,
707
+ isNumber,
708
+ isBoolean,
709
+ isObject,
710
+ isPlainObject,
711
+ isUndefined,
712
+ isDate,
713
+ isFile,
714
+ isBlob,
715
+ isRegExp,
716
+ isFunction,
717
+ isStream,
718
+ isURLSearchParams,
719
+ isTypedArray,
720
+ isFileList,
721
+ forEach,
722
+ merge,
723
+ extend,
724
+ trim,
725
+ stripBOM,
726
+ inherits,
727
+ toFlatObject,
728
+ kindOf,
729
+ kindOfTest,
730
+ endsWith,
731
+ toArray,
732
+ forEachEntry,
733
+ matchAll,
734
+ isHTMLForm,
735
+ hasOwnProperty,
736
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
737
+ reduceDescriptors,
738
+ freezeMethods,
739
+ toObjectSet,
740
+ toCamelCase,
741
+ noop,
742
+ toFiniteNumber,
743
+ findKey,
744
+ global: _global,
745
+ isContextDefined,
746
+ toJSONObject
747
+ };
748
+
749
+ /**
750
+ * Create an Error with the specified message, config, error code, request and response.
751
+ *
752
+ * @param {string} message The error message.
753
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
754
+ * @param {Object} [config] The config.
755
+ * @param {Object} [request] The request.
756
+ * @param {Object} [response] The response.
757
+ *
758
+ * @returns {Error} The created error.
759
+ */
760
+ function AxiosError(message, code, config, request, response) {
761
+ Error.call(this);
762
+
763
+ if (Error.captureStackTrace) {
764
+ Error.captureStackTrace(this, this.constructor);
765
+ } else {
766
+ this.stack = (new Error()).stack;
767
+ }
768
+
769
+ this.message = message;
770
+ this.name = 'AxiosError';
771
+ code && (this.code = code);
772
+ config && (this.config = config);
773
+ request && (this.request = request);
774
+ response && (this.response = response);
775
+ }
776
+
777
+ utils.inherits(AxiosError, Error, {
778
+ toJSON: function toJSON() {
779
+ return {
780
+ // Standard
781
+ message: this.message,
782
+ name: this.name,
783
+ // Microsoft
784
+ description: this.description,
785
+ number: this.number,
786
+ // Mozilla
787
+ fileName: this.fileName,
788
+ lineNumber: this.lineNumber,
789
+ columnNumber: this.columnNumber,
790
+ stack: this.stack,
791
+ // Axios
792
+ config: utils.toJSONObject(this.config),
793
+ code: this.code,
794
+ status: this.response && this.response.status ? this.response.status : null
795
+ };
796
+ }
797
+ });
798
+
799
+ const prototype$1 = AxiosError.prototype;
800
+ const descriptors = {};
801
+
802
+ [
803
+ 'ERR_BAD_OPTION_VALUE',
804
+ 'ERR_BAD_OPTION',
805
+ 'ECONNABORTED',
806
+ 'ETIMEDOUT',
807
+ 'ERR_NETWORK',
808
+ 'ERR_FR_TOO_MANY_REDIRECTS',
809
+ 'ERR_DEPRECATED',
810
+ 'ERR_BAD_RESPONSE',
811
+ 'ERR_BAD_REQUEST',
812
+ 'ERR_CANCELED',
813
+ 'ERR_NOT_SUPPORT',
814
+ 'ERR_INVALID_URL'
815
+ // eslint-disable-next-line func-names
816
+ ].forEach(code => {
817
+ descriptors[code] = {value: code};
818
+ });
819
+
820
+ Object.defineProperties(AxiosError, descriptors);
821
+ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
822
+
823
+ // eslint-disable-next-line func-names
824
+ AxiosError.from = (error, code, config, request, response, customProps) => {
825
+ const axiosError = Object.create(prototype$1);
826
+
827
+ utils.toFlatObject(error, axiosError, function filter(obj) {
828
+ return obj !== Error.prototype;
829
+ }, prop => {
830
+ return prop !== 'isAxiosError';
831
+ });
832
+
833
+ AxiosError.call(axiosError, error.message, code, config, request, response);
834
+
835
+ axiosError.cause = error;
836
+
837
+ axiosError.name = error.name;
838
+
839
+ customProps && Object.assign(axiosError, customProps);
840
+
841
+ return axiosError;
842
+ };
843
+
844
+ /* eslint-env browser */
845
+ var browser = typeof self == 'object' ? self.FormData : window.FormData;
846
+
847
+ /**
848
+ * Determines if the given thing is a array or js object.
849
+ *
850
+ * @param {string} thing - The object or array to be visited.
851
+ *
852
+ * @returns {boolean}
853
+ */
854
+ function isVisitable(thing) {
855
+ return utils.isPlainObject(thing) || utils.isArray(thing);
856
+ }
857
+
858
+ /**
859
+ * It removes the brackets from the end of a string
860
+ *
861
+ * @param {string} key - The key of the parameter.
862
+ *
863
+ * @returns {string} the key without the brackets.
864
+ */
865
+ function removeBrackets(key) {
866
+ return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
867
+ }
868
+
869
+ /**
870
+ * It takes a path, a key, and a boolean, and returns a string
871
+ *
872
+ * @param {string} path - The path to the current key.
873
+ * @param {string} key - The key of the current object being iterated over.
874
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
875
+ *
876
+ * @returns {string} The path to the current key.
877
+ */
878
+ function renderKey(path, key, dots) {
879
+ if (!path) return key;
880
+ return path.concat(key).map(function each(token, i) {
881
+ // eslint-disable-next-line no-param-reassign
882
+ token = removeBrackets(token);
883
+ return !dots && i ? '[' + token + ']' : token;
884
+ }).join(dots ? '.' : '');
885
+ }
886
+
887
+ /**
888
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
889
+ *
890
+ * @param {Array<any>} arr - The array to check
891
+ *
892
+ * @returns {boolean}
893
+ */
894
+ function isFlatArray(arr) {
895
+ return utils.isArray(arr) && !arr.some(isVisitable);
896
+ }
897
+
898
+ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
899
+ return /^is[A-Z]/.test(prop);
900
+ });
901
+
902
+ /**
903
+ * If the thing is a FormData object, return true, otherwise return false.
904
+ *
905
+ * @param {unknown} thing - The thing to check.
906
+ *
907
+ * @returns {boolean}
908
+ */
909
+ function isSpecCompliant(thing) {
910
+ return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];
911
+ }
912
+
913
+ /**
914
+ * Convert a data object to FormData
915
+ *
916
+ * @param {Object} obj
917
+ * @param {?Object} [formData]
918
+ * @param {?Object} [options]
919
+ * @param {Function} [options.visitor]
920
+ * @param {Boolean} [options.metaTokens = true]
921
+ * @param {Boolean} [options.dots = false]
922
+ * @param {?Boolean} [options.indexes = false]
923
+ *
924
+ * @returns {Object}
925
+ **/
926
+
927
+ /**
928
+ * It converts an object into a FormData object
929
+ *
930
+ * @param {Object<any, any>} obj - The object to convert to form data.
931
+ * @param {string} formData - The FormData object to append to.
932
+ * @param {Object<string, any>} options
933
+ *
934
+ * @returns
935
+ */
936
+ function toFormData(obj, formData, options) {
937
+ if (!utils.isObject(obj)) {
938
+ throw new TypeError('target must be an object');
939
+ }
940
+
941
+ // eslint-disable-next-line no-param-reassign
942
+ formData = formData || new (browser || FormData)();
943
+
944
+ // eslint-disable-next-line no-param-reassign
945
+ options = utils.toFlatObject(options, {
946
+ metaTokens: true,
947
+ dots: false,
948
+ indexes: false
949
+ }, false, function defined(option, source) {
950
+ // eslint-disable-next-line no-eq-null,eqeqeq
951
+ return !utils.isUndefined(source[option]);
952
+ });
953
+
954
+ const metaTokens = options.metaTokens;
955
+ // eslint-disable-next-line no-use-before-define
956
+ const visitor = options.visitor || defaultVisitor;
957
+ const dots = options.dots;
958
+ const indexes = options.indexes;
959
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
960
+ const useBlob = _Blob && isSpecCompliant(formData);
961
+
962
+ if (!utils.isFunction(visitor)) {
963
+ throw new TypeError('visitor must be a function');
964
+ }
965
+
966
+ function convertValue(value) {
967
+ if (value === null) return '';
968
+
969
+ if (utils.isDate(value)) {
970
+ return value.toISOString();
971
+ }
972
+
973
+ if (!useBlob && utils.isBlob(value)) {
974
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
975
+ }
976
+
977
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
978
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
979
+ }
980
+
981
+ return value;
982
+ }
983
+
984
+ /**
985
+ * Default visitor.
986
+ *
987
+ * @param {*} value
988
+ * @param {String|Number} key
989
+ * @param {Array<String|Number>} path
990
+ * @this {FormData}
991
+ *
992
+ * @returns {boolean} return true to visit the each prop of the value recursively
993
+ */
994
+ function defaultVisitor(value, key, path) {
995
+ let arr = value;
996
+
997
+ if (value && !path && typeof value === 'object') {
998
+ if (utils.endsWith(key, '{}')) {
999
+ // eslint-disable-next-line no-param-reassign
1000
+ key = metaTokens ? key : key.slice(0, -2);
1001
+ // eslint-disable-next-line no-param-reassign
1002
+ value = JSON.stringify(value);
1003
+ } else if (
1004
+ (utils.isArray(value) && isFlatArray(value)) ||
1005
+ (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))
1006
+ )) {
1007
+ // eslint-disable-next-line no-param-reassign
1008
+ key = removeBrackets(key);
1009
+
1010
+ arr.forEach(function each(el, index) {
1011
+ !(utils.isUndefined(el) || el === null) && formData.append(
1012
+ // eslint-disable-next-line no-nested-ternary
1013
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
1014
+ convertValue(el)
1015
+ );
1016
+ });
1017
+ return false;
1018
+ }
1019
+ }
1020
+
1021
+ if (isVisitable(value)) {
1022
+ return true;
1023
+ }
1024
+
1025
+ formData.append(renderKey(path, key, dots), convertValue(value));
1026
+
1027
+ return false;
1028
+ }
1029
+
1030
+ const stack = [];
1031
+
1032
+ const exposedHelpers = Object.assign(predicates, {
1033
+ defaultVisitor,
1034
+ convertValue,
1035
+ isVisitable
1036
+ });
1037
+
1038
+ function build(value, path) {
1039
+ if (utils.isUndefined(value)) return;
1040
+
1041
+ if (stack.indexOf(value) !== -1) {
1042
+ throw Error('Circular reference detected in ' + path.join('.'));
1043
+ }
1044
+
1045
+ stack.push(value);
1046
+
1047
+ utils.forEach(value, function each(el, key) {
1048
+ const result = !(utils.isUndefined(el) || el === null) && visitor.call(
1049
+ formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
1050
+ );
1051
+
1052
+ if (result === true) {
1053
+ build(el, path ? path.concat(key) : [key]);
1054
+ }
1055
+ });
1056
+
1057
+ stack.pop();
1058
+ }
1059
+
1060
+ if (!utils.isObject(obj)) {
1061
+ throw new TypeError('data must be an object');
1062
+ }
1063
+
1064
+ build(obj);
1065
+
1066
+ return formData;
1067
+ }
1068
+
1069
+ /**
1070
+ * It encodes a string by replacing all characters that are not in the unreserved set with
1071
+ * their percent-encoded equivalents
1072
+ *
1073
+ * @param {string} str - The string to encode.
1074
+ *
1075
+ * @returns {string} The encoded string.
1076
+ */
1077
+ function encode$1(str) {
1078
+ const charMap = {
1079
+ '!': '%21',
1080
+ "'": '%27',
1081
+ '(': '%28',
1082
+ ')': '%29',
1083
+ '~': '%7E',
1084
+ '%20': '+',
1085
+ '%00': '\x00'
1086
+ };
1087
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1088
+ return charMap[match];
1089
+ });
1090
+ }
1091
+
1092
+ /**
1093
+ * It takes a params object and converts it to a FormData object
1094
+ *
1095
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1096
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1097
+ *
1098
+ * @returns {void}
1099
+ */
1100
+ function AxiosURLSearchParams(params, options) {
1101
+ this._pairs = [];
1102
+
1103
+ params && toFormData(params, this, options);
1104
+ }
1105
+
1106
+ const prototype = AxiosURLSearchParams.prototype;
1107
+
1108
+ prototype.append = function append(name, value) {
1109
+ this._pairs.push([name, value]);
1110
+ };
1111
+
1112
+ prototype.toString = function toString(encoder) {
1113
+ const _encode = encoder ? function(value) {
1114
+ return encoder.call(this, value, encode$1);
1115
+ } : encode$1;
1116
+
1117
+ return this._pairs.map(function each(pair) {
1118
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
1119
+ }, '').join('&');
1120
+ };
1121
+
1122
+ /**
1123
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
1124
+ * URI encoded counterparts
1125
+ *
1126
+ * @param {string} val The value to be encoded.
1127
+ *
1128
+ * @returns {string} The encoded value.
1129
+ */
1130
+ function encode(val) {
1131
+ return encodeURIComponent(val).
1132
+ replace(/%3A/gi, ':').
1133
+ replace(/%24/g, '$').
1134
+ replace(/%2C/gi, ',').
1135
+ replace(/%20/g, '+').
1136
+ replace(/%5B/gi, '[').
1137
+ replace(/%5D/gi, ']');
1138
+ }
1139
+
1140
+ /**
1141
+ * Build a URL by appending params to the end
1142
+ *
1143
+ * @param {string} url The base of the url (e.g., http://www.google.com)
1144
+ * @param {object} [params] The params to be appended
1145
+ * @param {?object} options
1146
+ *
1147
+ * @returns {string} The formatted url
1148
+ */
1149
+ function buildURL(url, params, options) {
1150
+ /*eslint no-param-reassign:0*/
1151
+ if (!params) {
1152
+ return url;
1153
+ }
1154
+
1155
+ const _encode = options && options.encode || encode;
1156
+
1157
+ const serializeFn = options && options.serialize;
1158
+
1159
+ let serializedParams;
1160
+
1161
+ if (serializeFn) {
1162
+ serializedParams = serializeFn(params, options);
1163
+ } else {
1164
+ serializedParams = utils.isURLSearchParams(params) ?
1165
+ params.toString() :
1166
+ new AxiosURLSearchParams(params, options).toString(_encode);
1167
+ }
1168
+
1169
+ if (serializedParams) {
1170
+ const hashmarkIndex = url.indexOf("#");
1171
+
1172
+ if (hashmarkIndex !== -1) {
1173
+ url = url.slice(0, hashmarkIndex);
1174
+ }
1175
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1176
+ }
1177
+
1178
+ return url;
1179
+ }
1180
+
1181
+ class InterceptorManager {
1182
+ constructor() {
1183
+ this.handlers = [];
1184
+ }
1185
+
1186
+ /**
1187
+ * Add a new interceptor to the stack
1188
+ *
1189
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1190
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1191
+ *
1192
+ * @return {Number} An ID used to remove interceptor later
1193
+ */
1194
+ use(fulfilled, rejected, options) {
1195
+ this.handlers.push({
1196
+ fulfilled,
1197
+ rejected,
1198
+ synchronous: options ? options.synchronous : false,
1199
+ runWhen: options ? options.runWhen : null
1200
+ });
1201
+ return this.handlers.length - 1;
1202
+ }
1203
+
1204
+ /**
1205
+ * Remove an interceptor from the stack
1206
+ *
1207
+ * @param {Number} id The ID that was returned by `use`
1208
+ *
1209
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1210
+ */
1211
+ eject(id) {
1212
+ if (this.handlers[id]) {
1213
+ this.handlers[id] = null;
1214
+ }
1215
+ }
1216
+
1217
+ /**
1218
+ * Clear all interceptors from the stack
1219
+ *
1220
+ * @returns {void}
1221
+ */
1222
+ clear() {
1223
+ if (this.handlers) {
1224
+ this.handlers = [];
1225
+ }
1226
+ }
1227
+
1228
+ /**
1229
+ * Iterate over all the registered interceptors
1230
+ *
1231
+ * This method is particularly useful for skipping over any
1232
+ * interceptors that may have become `null` calling `eject`.
1233
+ *
1234
+ * @param {Function} fn The function to call for each interceptor
1235
+ *
1236
+ * @returns {void}
1237
+ */
1238
+ forEach(fn) {
1239
+ utils.forEach(this.handlers, function forEachHandler(h) {
1240
+ if (h !== null) {
1241
+ fn(h);
1242
+ }
1243
+ });
1244
+ }
1245
+ }
1246
+
1247
+ const transitionalDefaults = {
1248
+ silentJSONParsing: true,
1249
+ forcedJSONParsing: true,
1250
+ clarifyTimeoutError: false
1251
+ };
1252
+
1253
+ const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1254
+
1255
+ const FormData$1 = FormData;
1256
+
1257
+ /**
1258
+ * Determine if we're running in a standard browser environment
1259
+ *
1260
+ * This allows axios to run in a web worker, and react-native.
1261
+ * Both environments support XMLHttpRequest, but not fully standard globals.
1262
+ *
1263
+ * web workers:
1264
+ * typeof window -> undefined
1265
+ * typeof document -> undefined
1266
+ *
1267
+ * react-native:
1268
+ * navigator.product -> 'ReactNative'
1269
+ * nativescript
1270
+ * navigator.product -> 'NativeScript' or 'NS'
1271
+ *
1272
+ * @returns {boolean}
1273
+ */
1274
+ const isStandardBrowserEnv = (() => {
1275
+ let product;
1276
+ if (typeof navigator !== 'undefined' && (
1277
+ (product = navigator.product) === 'ReactNative' ||
1278
+ product === 'NativeScript' ||
1279
+ product === 'NS')
1280
+ ) {
1281
+ return false;
1282
+ }
1283
+
1284
+ return typeof window !== 'undefined' && typeof document !== 'undefined';
1285
+ })();
1286
+
1287
+ /**
1288
+ * Determine if we're running in a standard browser webWorker environment
1289
+ *
1290
+ * Although the `isStandardBrowserEnv` method indicates that
1291
+ * `allows axios to run in a web worker`, the WebWorker will still be
1292
+ * filtered out due to its judgment standard
1293
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1294
+ * This leads to a problem when axios post `FormData` in webWorker
1295
+ */
1296
+ const isStandardBrowserWebWorkerEnv = (() => {
1297
+ return (
1298
+ typeof WorkerGlobalScope !== 'undefined' &&
1299
+ // eslint-disable-next-line no-undef
1300
+ self instanceof WorkerGlobalScope &&
1301
+ typeof self.importScripts === 'function'
1302
+ );
1303
+ })();
1304
+
1305
+
1306
+ const platform = {
1307
+ isBrowser: true,
1308
+ classes: {
1309
+ URLSearchParams: URLSearchParams$1,
1310
+ FormData: FormData$1,
1311
+ Blob
1312
+ },
1313
+ isStandardBrowserEnv,
1314
+ isStandardBrowserWebWorkerEnv,
1315
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1316
+ };
1317
+
1318
+ function toURLEncodedForm(data, options) {
1319
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
1320
+ visitor: function(value, key, path, helpers) {
1321
+
1322
+ return helpers.defaultVisitor.apply(this, arguments);
1323
+ }
1324
+ }, options));
1325
+ }
1326
+
1327
+ /**
1328
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1329
+ *
1330
+ * @param {string} name - The name of the property to get.
1331
+ *
1332
+ * @returns An array of strings.
1333
+ */
1334
+ function parsePropPath(name) {
1335
+ // foo[x][y][z]
1336
+ // foo.x.y.z
1337
+ // foo-x-y-z
1338
+ // foo x y z
1339
+ return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1340
+ return match[0] === '[]' ? '' : match[1] || match[0];
1341
+ });
1342
+ }
1343
+
1344
+ /**
1345
+ * Convert an array to an object.
1346
+ *
1347
+ * @param {Array<any>} arr - The array to convert to an object.
1348
+ *
1349
+ * @returns An object with the same keys and values as the array.
1350
+ */
1351
+ function arrayToObject(arr) {
1352
+ const obj = {};
1353
+ const keys = Object.keys(arr);
1354
+ let i;
1355
+ const len = keys.length;
1356
+ let key;
1357
+ for (i = 0; i < len; i++) {
1358
+ key = keys[i];
1359
+ obj[key] = arr[key];
1360
+ }
1361
+ return obj;
1362
+ }
1363
+
1364
+ /**
1365
+ * It takes a FormData object and returns a JavaScript object
1366
+ *
1367
+ * @param {string} formData The FormData object to convert to JSON.
1368
+ *
1369
+ * @returns {Object<string, any> | null} The converted object.
1370
+ */
1371
+ function formDataToJSON(formData) {
1372
+ function buildPath(path, value, target, index) {
1373
+ let name = path[index++];
1374
+ const isNumericKey = Number.isFinite(+name);
1375
+ const isLast = index >= path.length;
1376
+ name = !name && utils.isArray(target) ? target.length : name;
1377
+
1378
+ if (isLast) {
1379
+ if (utils.hasOwnProp(target, name)) {
1380
+ target[name] = [target[name], value];
1381
+ } else {
1382
+ target[name] = value;
1383
+ }
1384
+
1385
+ return !isNumericKey;
1386
+ }
1387
+
1388
+ if (!target[name] || !utils.isObject(target[name])) {
1389
+ target[name] = [];
1390
+ }
1391
+
1392
+ const result = buildPath(path, value, target[name], index);
1393
+
1394
+ if (result && utils.isArray(target[name])) {
1395
+ target[name] = arrayToObject(target[name]);
1396
+ }
1397
+
1398
+ return !isNumericKey;
1399
+ }
1400
+
1401
+ if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
1402
+ const obj = {};
1403
+
1404
+ utils.forEachEntry(formData, (name, value) => {
1405
+ buildPath(parsePropPath(name), value, obj, 0);
1406
+ });
1407
+
1408
+ return obj;
1409
+ }
1410
+
1411
+ return null;
1412
+ }
1413
+
1414
+ const DEFAULT_CONTENT_TYPE = {
1415
+ 'Content-Type': undefined
1416
+ };
1417
+
1418
+ /**
1419
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1420
+ * of the input
1421
+ *
1422
+ * @param {any} rawValue - The value to be stringified.
1423
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
1424
+ * @param {Function} encoder - A function that takes a value and returns a string.
1425
+ *
1426
+ * @returns {string} A stringified version of the rawValue.
1427
+ */
1428
+ function stringifySafely(rawValue, parser, encoder) {
1429
+ if (utils.isString(rawValue)) {
1430
+ try {
1431
+ (parser || JSON.parse)(rawValue);
1432
+ return utils.trim(rawValue);
1433
+ } catch (e) {
1434
+ if (e.name !== 'SyntaxError') {
1435
+ throw e;
1436
+ }
1437
+ }
1438
+ }
1439
+
1440
+ return (encoder || JSON.stringify)(rawValue);
1441
+ }
1442
+
1443
+ const defaults = {
1444
+
1445
+ transitional: transitionalDefaults,
1446
+
1447
+ adapter: ['xhr', 'http'],
1448
+
1449
+ transformRequest: [function transformRequest(data, headers) {
1450
+ const contentType = headers.getContentType() || '';
1451
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
1452
+ const isObjectPayload = utils.isObject(data);
1453
+
1454
+ if (isObjectPayload && utils.isHTMLForm(data)) {
1455
+ data = new FormData(data);
1456
+ }
1457
+
1458
+ const isFormData = utils.isFormData(data);
1459
+
1460
+ if (isFormData) {
1461
+ if (!hasJSONContentType) {
1462
+ return data;
1463
+ }
1464
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1465
+ }
1466
+
1467
+ if (utils.isArrayBuffer(data) ||
1468
+ utils.isBuffer(data) ||
1469
+ utils.isStream(data) ||
1470
+ utils.isFile(data) ||
1471
+ utils.isBlob(data)
1472
+ ) {
1473
+ return data;
1474
+ }
1475
+ if (utils.isArrayBufferView(data)) {
1476
+ return data.buffer;
1477
+ }
1478
+ if (utils.isURLSearchParams(data)) {
1479
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1480
+ return data.toString();
1481
+ }
1482
+
1483
+ let isFileList;
1484
+
1485
+ if (isObjectPayload) {
1486
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1487
+ return toURLEncodedForm(data, this.formSerializer).toString();
1488
+ }
1489
+
1490
+ if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1491
+ const _FormData = this.env && this.env.FormData;
1492
+
1493
+ return toFormData(
1494
+ isFileList ? {'files[]': data} : data,
1495
+ _FormData && new _FormData(),
1496
+ this.formSerializer
1497
+ );
1498
+ }
1499
+ }
1500
+
1501
+ if (isObjectPayload || hasJSONContentType ) {
1502
+ headers.setContentType('application/json', false);
1503
+ return stringifySafely(data);
1504
+ }
1505
+
1506
+ return data;
1507
+ }],
1508
+
1509
+ transformResponse: [function transformResponse(data) {
1510
+ const transitional = this.transitional || defaults.transitional;
1511
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1512
+ const JSONRequested = this.responseType === 'json';
1513
+
1514
+ if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1515
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
1516
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
1517
+
1518
+ try {
1519
+ return JSON.parse(data);
1520
+ } catch (e) {
1521
+ if (strictJSONParsing) {
1522
+ if (e.name === 'SyntaxError') {
1523
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
1524
+ }
1525
+ throw e;
1526
+ }
1527
+ }
1528
+ }
1529
+
1530
+ return data;
1531
+ }],
1532
+
1533
+ /**
1534
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
1535
+ * timeout is not created.
1536
+ */
1537
+ timeout: 0,
1538
+
1539
+ xsrfCookieName: 'XSRF-TOKEN',
1540
+ xsrfHeaderName: 'X-XSRF-TOKEN',
1541
+
1542
+ maxContentLength: -1,
1543
+ maxBodyLength: -1,
1544
+
1545
+ env: {
1546
+ FormData: platform.classes.FormData,
1547
+ Blob: platform.classes.Blob
1548
+ },
1549
+
1550
+ validateStatus: function validateStatus(status) {
1551
+ return status >= 200 && status < 300;
1552
+ },
1553
+
1554
+ headers: {
1555
+ common: {
1556
+ 'Accept': 'application/json, text/plain, */*'
1557
+ }
1558
+ }
1559
+ };
1560
+
1561
+ utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
1562
+ defaults.headers[method] = {};
1563
+ });
1564
+
1565
+ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
1566
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
1567
+ });
1568
+
1569
+ // RawAxiosHeaders whose duplicates are ignored by node
1570
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
1571
+ const ignoreDuplicateOf = utils.toObjectSet([
1572
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
1573
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1574
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1575
+ 'referer', 'retry-after', 'user-agent'
1576
+ ]);
1577
+
1578
+ /**
1579
+ * Parse headers into an object
1580
+ *
1581
+ * ```
1582
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
1583
+ * Content-Type: application/json
1584
+ * Connection: keep-alive
1585
+ * Transfer-Encoding: chunked
1586
+ * ```
1587
+ *
1588
+ * @param {String} rawHeaders Headers needing to be parsed
1589
+ *
1590
+ * @returns {Object} Headers parsed into an object
1591
+ */
1592
+ const parseHeaders = rawHeaders => {
1593
+ const parsed = {};
1594
+ let key;
1595
+ let val;
1596
+ let i;
1597
+
1598
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
1599
+ i = line.indexOf(':');
1600
+ key = line.substring(0, i).trim().toLowerCase();
1601
+ val = line.substring(i + 1).trim();
1602
+
1603
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
1604
+ return;
1605
+ }
1606
+
1607
+ if (key === 'set-cookie') {
1608
+ if (parsed[key]) {
1609
+ parsed[key].push(val);
1610
+ } else {
1611
+ parsed[key] = [val];
1612
+ }
1613
+ } else {
1614
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1615
+ }
1616
+ });
1617
+
1618
+ return parsed;
1619
+ };
1620
+
1621
+ const $internals = Symbol('internals');
1622
+
1623
+ function normalizeHeader(header) {
1624
+ return header && String(header).trim().toLowerCase();
1625
+ }
1626
+
1627
+ function normalizeValue(value) {
1628
+ if (value === false || value == null) {
1629
+ return value;
1630
+ }
1631
+
1632
+ return utils.isArray(value) ? value.map(normalizeValue) : String(value);
1633
+ }
1634
+
1635
+ function parseTokens(str) {
1636
+ const tokens = Object.create(null);
1637
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1638
+ let match;
1639
+
1640
+ while ((match = tokensRE.exec(str))) {
1641
+ tokens[match[1]] = match[2];
1642
+ }
1643
+
1644
+ return tokens;
1645
+ }
1646
+
1647
+ function isValidHeaderName(str) {
1648
+ return /^[-_a-zA-Z]+$/.test(str.trim());
1649
+ }
1650
+
1651
+ function matchHeaderValue(context, value, header, filter) {
1652
+ if (utils.isFunction(filter)) {
1653
+ return filter.call(this, value, header);
1654
+ }
1655
+
1656
+ if (!utils.isString(value)) return;
1657
+
1658
+ if (utils.isString(filter)) {
1659
+ return value.indexOf(filter) !== -1;
1660
+ }
1661
+
1662
+ if (utils.isRegExp(filter)) {
1663
+ return filter.test(value);
1664
+ }
1665
+ }
1666
+
1667
+ function formatHeader(header) {
1668
+ return header.trim()
1669
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1670
+ return char.toUpperCase() + str;
1671
+ });
1672
+ }
1673
+
1674
+ function buildAccessors(obj, header) {
1675
+ const accessorName = utils.toCamelCase(' ' + header);
1676
+
1677
+ ['get', 'set', 'has'].forEach(methodName => {
1678
+ Object.defineProperty(obj, methodName + accessorName, {
1679
+ value: function(arg1, arg2, arg3) {
1680
+ return this[methodName].call(this, header, arg1, arg2, arg3);
1681
+ },
1682
+ configurable: true
1683
+ });
1684
+ });
1685
+ }
1686
+
1687
+ class AxiosHeaders {
1688
+ constructor(headers) {
1689
+ headers && this.set(headers);
1690
+ }
1691
+
1692
+ set(header, valueOrRewrite, rewrite) {
1693
+ const self = this;
1694
+
1695
+ function setHeader(_value, _header, _rewrite) {
1696
+ const lHeader = normalizeHeader(_header);
1697
+
1698
+ if (!lHeader) {
1699
+ throw new Error('header name must be a non-empty string');
1700
+ }
1701
+
1702
+ const key = utils.findKey(self, lHeader);
1703
+
1704
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
1705
+ self[key || _header] = normalizeValue(_value);
1706
+ }
1707
+ }
1708
+
1709
+ const setHeaders = (headers, _rewrite) =>
1710
+ utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1711
+
1712
+ if (utils.isPlainObject(header) || header instanceof this.constructor) {
1713
+ setHeaders(header, valueOrRewrite);
1714
+ } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1715
+ setHeaders(parseHeaders(header), valueOrRewrite);
1716
+ } else {
1717
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1718
+ }
1719
+
1720
+ return this;
1721
+ }
1722
+
1723
+ get(header, parser) {
1724
+ header = normalizeHeader(header);
1725
+
1726
+ if (header) {
1727
+ const key = utils.findKey(this, header);
1728
+
1729
+ if (key) {
1730
+ const value = this[key];
1731
+
1732
+ if (!parser) {
1733
+ return value;
1734
+ }
1735
+
1736
+ if (parser === true) {
1737
+ return parseTokens(value);
1738
+ }
1739
+
1740
+ if (utils.isFunction(parser)) {
1741
+ return parser.call(this, value, key);
1742
+ }
1743
+
1744
+ if (utils.isRegExp(parser)) {
1745
+ return parser.exec(value);
1746
+ }
1747
+
1748
+ throw new TypeError('parser must be boolean|regexp|function');
1749
+ }
1750
+ }
1751
+ }
1752
+
1753
+ has(header, matcher) {
1754
+ header = normalizeHeader(header);
1755
+
1756
+ if (header) {
1757
+ const key = utils.findKey(this, header);
1758
+
1759
+ return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1760
+ }
1761
+
1762
+ return false;
1763
+ }
1764
+
1765
+ delete(header, matcher) {
1766
+ const self = this;
1767
+ let deleted = false;
1768
+
1769
+ function deleteHeader(_header) {
1770
+ _header = normalizeHeader(_header);
1771
+
1772
+ if (_header) {
1773
+ const key = utils.findKey(self, _header);
1774
+
1775
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1776
+ delete self[key];
1777
+
1778
+ deleted = true;
1779
+ }
1780
+ }
1781
+ }
1782
+
1783
+ if (utils.isArray(header)) {
1784
+ header.forEach(deleteHeader);
1785
+ } else {
1786
+ deleteHeader(header);
1787
+ }
1788
+
1789
+ return deleted;
1790
+ }
1791
+
1792
+ clear() {
1793
+ return Object.keys(this).forEach(this.delete.bind(this));
1794
+ }
1795
+
1796
+ normalize(format) {
1797
+ const self = this;
1798
+ const headers = {};
1799
+
1800
+ utils.forEach(this, (value, header) => {
1801
+ const key = utils.findKey(headers, header);
1802
+
1803
+ if (key) {
1804
+ self[key] = normalizeValue(value);
1805
+ delete self[header];
1806
+ return;
1807
+ }
1808
+
1809
+ const normalized = format ? formatHeader(header) : String(header).trim();
1810
+
1811
+ if (normalized !== header) {
1812
+ delete self[header];
1813
+ }
1814
+
1815
+ self[normalized] = normalizeValue(value);
1816
+
1817
+ headers[normalized] = true;
1818
+ });
1819
+
1820
+ return this;
1821
+ }
1822
+
1823
+ concat(...targets) {
1824
+ return this.constructor.concat(this, ...targets);
1825
+ }
1826
+
1827
+ toJSON(asStrings) {
1828
+ const obj = Object.create(null);
1829
+
1830
+ utils.forEach(this, (value, header) => {
1831
+ value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
1832
+ });
1833
+
1834
+ return obj;
1835
+ }
1836
+
1837
+ [Symbol.iterator]() {
1838
+ return Object.entries(this.toJSON())[Symbol.iterator]();
1839
+ }
1840
+
1841
+ toString() {
1842
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
1843
+ }
1844
+
1845
+ get [Symbol.toStringTag]() {
1846
+ return 'AxiosHeaders';
1847
+ }
1848
+
1849
+ static from(thing) {
1850
+ return thing instanceof this ? thing : new this(thing);
1851
+ }
1852
+
1853
+ static concat(first, ...targets) {
1854
+ const computed = new this(first);
1855
+
1856
+ targets.forEach((target) => computed.set(target));
1857
+
1858
+ return computed;
1859
+ }
1860
+
1861
+ static accessor(header) {
1862
+ const internals = this[$internals] = (this[$internals] = {
1863
+ accessors: {}
1864
+ });
1865
+
1866
+ const accessors = internals.accessors;
1867
+ const prototype = this.prototype;
1868
+
1869
+ function defineAccessor(_header) {
1870
+ const lHeader = normalizeHeader(_header);
1871
+
1872
+ if (!accessors[lHeader]) {
1873
+ buildAccessors(prototype, _header);
1874
+ accessors[lHeader] = true;
1875
+ }
1876
+ }
1877
+
1878
+ utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1879
+
1880
+ return this;
1881
+ }
1882
+ }
1883
+
1884
+ AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']);
1885
+
1886
+ utils.freezeMethods(AxiosHeaders.prototype);
1887
+ utils.freezeMethods(AxiosHeaders);
1888
+
1889
+ /**
1890
+ * Transform the data for a request or a response
1891
+ *
1892
+ * @param {Array|Function} fns A single function or Array of functions
1893
+ * @param {?Object} response The response object
1894
+ *
1895
+ * @returns {*} The resulting transformed data
1896
+ */
1897
+ function transformData(fns, response) {
1898
+ const config = this || defaults;
1899
+ const context = response || config;
1900
+ const headers = AxiosHeaders.from(context.headers);
1901
+ let data = context.data;
1902
+
1903
+ utils.forEach(fns, function transform(fn) {
1904
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
1905
+ });
1906
+
1907
+ headers.normalize();
1908
+
1909
+ return data;
1910
+ }
1911
+
1912
+ function isCancel(value) {
1913
+ return !!(value && value.__CANCEL__);
1914
+ }
1915
+
1916
+ /**
1917
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1918
+ *
1919
+ * @param {string=} message The message.
1920
+ * @param {Object=} config The config.
1921
+ * @param {Object=} request The request.
1922
+ *
1923
+ * @returns {CanceledError} The created error.
1924
+ */
1925
+ function CanceledError(message, config, request) {
1926
+ // eslint-disable-next-line no-eq-null,eqeqeq
1927
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
1928
+ this.name = 'CanceledError';
1929
+ }
1930
+
1931
+ utils.inherits(CanceledError, AxiosError, {
1932
+ __CANCEL__: true
1933
+ });
1934
+
1935
+ // eslint-disable-next-line strict
1936
+ const httpAdapter = null;
1937
+
1938
+ /**
1939
+ * Resolve or reject a Promise based on response status.
1940
+ *
1941
+ * @param {Function} resolve A function that resolves the promise.
1942
+ * @param {Function} reject A function that rejects the promise.
1943
+ * @param {object} response The response.
1944
+ *
1945
+ * @returns {object} The response.
1946
+ */
1947
+ function settle(resolve, reject, response) {
1948
+ const validateStatus = response.config.validateStatus;
1949
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
1950
+ resolve(response);
1951
+ } else {
1952
+ reject(new AxiosError(
1953
+ 'Request failed with status code ' + response.status,
1954
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1955
+ response.config,
1956
+ response.request,
1957
+ response
1958
+ ));
1959
+ }
1960
+ }
1961
+
1962
+ const cookies = platform.isStandardBrowserEnv ?
1963
+
1964
+ // Standard browser envs support document.cookie
1965
+ (function standardBrowserEnv() {
1966
+ return {
1967
+ write: function write(name, value, expires, path, domain, secure) {
1968
+ const cookie = [];
1969
+ cookie.push(name + '=' + encodeURIComponent(value));
1970
+
1971
+ if (utils.isNumber(expires)) {
1972
+ cookie.push('expires=' + new Date(expires).toGMTString());
1973
+ }
1974
+
1975
+ if (utils.isString(path)) {
1976
+ cookie.push('path=' + path);
1977
+ }
1978
+
1979
+ if (utils.isString(domain)) {
1980
+ cookie.push('domain=' + domain);
1981
+ }
1982
+
1983
+ if (secure === true) {
1984
+ cookie.push('secure');
1985
+ }
1986
+
1987
+ document.cookie = cookie.join('; ');
1988
+ },
1989
+
1990
+ read: function read(name) {
1991
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
1992
+ return (match ? decodeURIComponent(match[3]) : null);
1993
+ },
1994
+
1995
+ remove: function remove(name) {
1996
+ this.write(name, '', Date.now() - 86400000);
1997
+ }
1998
+ };
1999
+ })() :
2000
+
2001
+ // Non standard browser env (web workers, react-native) lack needed support.
2002
+ (function nonStandardBrowserEnv() {
2003
+ return {
2004
+ write: function write() {},
2005
+ read: function read() { return null; },
2006
+ remove: function remove() {}
2007
+ };
2008
+ })();
2009
+
2010
+ /**
2011
+ * Determines whether the specified URL is absolute
2012
+ *
2013
+ * @param {string} url The URL to test
2014
+ *
2015
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
2016
+ */
2017
+ function isAbsoluteURL(url) {
2018
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2019
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2020
+ // by any combination of letters, digits, plus, period, or hyphen.
2021
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2022
+ }
2023
+
2024
+ /**
2025
+ * Creates a new URL by combining the specified URLs
2026
+ *
2027
+ * @param {string} baseURL The base URL
2028
+ * @param {string} relativeURL The relative URL
2029
+ *
2030
+ * @returns {string} The combined URL
2031
+ */
2032
+ function combineURLs(baseURL, relativeURL) {
2033
+ return relativeURL
2034
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2035
+ : baseURL;
2036
+ }
2037
+
2038
+ /**
2039
+ * Creates a new URL by combining the baseURL with the requestedURL,
2040
+ * only when the requestedURL is not already an absolute URL.
2041
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
2042
+ *
2043
+ * @param {string} baseURL The base URL
2044
+ * @param {string} requestedURL Absolute or relative URL to combine
2045
+ *
2046
+ * @returns {string} The combined full path
2047
+ */
2048
+ function buildFullPath(baseURL, requestedURL) {
2049
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
2050
+ return combineURLs(baseURL, requestedURL);
2051
+ }
2052
+ return requestedURL;
2053
+ }
2054
+
2055
+ const isURLSameOrigin = platform.isStandardBrowserEnv ?
2056
+
2057
+ // Standard browser envs have full support of the APIs needed to test
2058
+ // whether the request URL is of the same origin as current location.
2059
+ (function standardBrowserEnv() {
2060
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
2061
+ const urlParsingNode = document.createElement('a');
2062
+ let originURL;
2063
+
2064
+ /**
2065
+ * Parse a URL to discover it's components
2066
+ *
2067
+ * @param {String} url The URL to be parsed
2068
+ * @returns {Object}
2069
+ */
2070
+ function resolveURL(url) {
2071
+ let href = url;
2072
+
2073
+ if (msie) {
2074
+ // IE needs attribute set twice to normalize properties
2075
+ urlParsingNode.setAttribute('href', href);
2076
+ href = urlParsingNode.href;
2077
+ }
2078
+
2079
+ urlParsingNode.setAttribute('href', href);
2080
+
2081
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
2082
+ return {
2083
+ href: urlParsingNode.href,
2084
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
2085
+ host: urlParsingNode.host,
2086
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
2087
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
2088
+ hostname: urlParsingNode.hostname,
2089
+ port: urlParsingNode.port,
2090
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
2091
+ urlParsingNode.pathname :
2092
+ '/' + urlParsingNode.pathname
2093
+ };
2094
+ }
2095
+
2096
+ originURL = resolveURL(window.location.href);
2097
+
2098
+ /**
2099
+ * Determine if a URL shares the same origin as the current location
2100
+ *
2101
+ * @param {String} requestURL The URL to test
2102
+ * @returns {boolean} True if URL shares the same origin, otherwise false
2103
+ */
2104
+ return function isURLSameOrigin(requestURL) {
2105
+ const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2106
+ return (parsed.protocol === originURL.protocol &&
2107
+ parsed.host === originURL.host);
2108
+ };
2109
+ })() :
2110
+
2111
+ // Non standard browser envs (web workers, react-native) lack needed support.
2112
+ (function nonStandardBrowserEnv() {
2113
+ return function isURLSameOrigin() {
2114
+ return true;
2115
+ };
2116
+ })();
2117
+
2118
+ function parseProtocol(url) {
2119
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2120
+ return match && match[1] || '';
2121
+ }
2122
+
2123
+ /**
2124
+ * Calculate data maxRate
2125
+ * @param {Number} [samplesCount= 10]
2126
+ * @param {Number} [min= 1000]
2127
+ * @returns {Function}
2128
+ */
2129
+ function speedometer(samplesCount, min) {
2130
+ samplesCount = samplesCount || 10;
2131
+ const bytes = new Array(samplesCount);
2132
+ const timestamps = new Array(samplesCount);
2133
+ let head = 0;
2134
+ let tail = 0;
2135
+ let firstSampleTS;
2136
+
2137
+ min = min !== undefined ? min : 1000;
2138
+
2139
+ return function push(chunkLength) {
2140
+ const now = Date.now();
2141
+
2142
+ const startedAt = timestamps[tail];
2143
+
2144
+ if (!firstSampleTS) {
2145
+ firstSampleTS = now;
2146
+ }
2147
+
2148
+ bytes[head] = chunkLength;
2149
+ timestamps[head] = now;
2150
+
2151
+ let i = tail;
2152
+ let bytesCount = 0;
2153
+
2154
+ while (i !== head) {
2155
+ bytesCount += bytes[i++];
2156
+ i = i % samplesCount;
2157
+ }
2158
+
2159
+ head = (head + 1) % samplesCount;
2160
+
2161
+ if (head === tail) {
2162
+ tail = (tail + 1) % samplesCount;
2163
+ }
2164
+
2165
+ if (now - firstSampleTS < min) {
2166
+ return;
2167
+ }
2168
+
2169
+ const passed = startedAt && now - startedAt;
2170
+
2171
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2172
+ };
2173
+ }
2174
+
2175
+ function progressEventReducer(listener, isDownloadStream) {
2176
+ let bytesNotified = 0;
2177
+ const _speedometer = speedometer(50, 250);
2178
+
2179
+ return e => {
2180
+ const loaded = e.loaded;
2181
+ const total = e.lengthComputable ? e.total : undefined;
2182
+ const progressBytes = loaded - bytesNotified;
2183
+ const rate = _speedometer(progressBytes);
2184
+ const inRange = loaded <= total;
2185
+
2186
+ bytesNotified = loaded;
2187
+
2188
+ const data = {
2189
+ loaded,
2190
+ total,
2191
+ progress: total ? (loaded / total) : undefined,
2192
+ bytes: progressBytes,
2193
+ rate: rate ? rate : undefined,
2194
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2195
+ event: e
2196
+ };
2197
+
2198
+ data[isDownloadStream ? 'download' : 'upload'] = true;
2199
+
2200
+ listener(data);
2201
+ };
2202
+ }
2203
+
2204
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2205
+
2206
+ const xhrAdapter = isXHRAdapterSupported && function (config) {
2207
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
2208
+ let requestData = config.data;
2209
+ const requestHeaders = AxiosHeaders.from(config.headers).normalize();
2210
+ const responseType = config.responseType;
2211
+ let onCanceled;
2212
+ function done() {
2213
+ if (config.cancelToken) {
2214
+ config.cancelToken.unsubscribe(onCanceled);
2215
+ }
2216
+
2217
+ if (config.signal) {
2218
+ config.signal.removeEventListener('abort', onCanceled);
2219
+ }
2220
+ }
2221
+
2222
+ if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
2223
+ requestHeaders.setContentType(false); // Let the browser set it
2224
+ }
2225
+
2226
+ let request = new XMLHttpRequest();
2227
+
2228
+ // HTTP basic authentication
2229
+ if (config.auth) {
2230
+ const username = config.auth.username || '';
2231
+ const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
2232
+ requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
2233
+ }
2234
+
2235
+ const fullPath = buildFullPath(config.baseURL, config.url);
2236
+
2237
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
2238
+
2239
+ // Set the request timeout in MS
2240
+ request.timeout = config.timeout;
2241
+
2242
+ function onloadend() {
2243
+ if (!request) {
2244
+ return;
2245
+ }
2246
+ // Prepare the response
2247
+ const responseHeaders = AxiosHeaders.from(
2248
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2249
+ );
2250
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
2251
+ request.responseText : request.response;
2252
+ const response = {
2253
+ data: responseData,
2254
+ status: request.status,
2255
+ statusText: request.statusText,
2256
+ headers: responseHeaders,
2257
+ config,
2258
+ request
2259
+ };
2260
+
2261
+ settle(function _resolve(value) {
2262
+ resolve(value);
2263
+ done();
2264
+ }, function _reject(err) {
2265
+ reject(err);
2266
+ done();
2267
+ }, response);
2268
+
2269
+ // Clean up request
2270
+ request = null;
2271
+ }
2272
+
2273
+ if ('onloadend' in request) {
2274
+ // Use onloadend if available
2275
+ request.onloadend = onloadend;
2276
+ } else {
2277
+ // Listen for ready state to emulate onloadend
2278
+ request.onreadystatechange = function handleLoad() {
2279
+ if (!request || request.readyState !== 4) {
2280
+ return;
2281
+ }
2282
+
2283
+ // The request errored out and we didn't get a response, this will be
2284
+ // handled by onerror instead
2285
+ // With one exception: request that using file: protocol, most browsers
2286
+ // will return status as 0 even though it's a successful request
2287
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
2288
+ return;
2289
+ }
2290
+ // readystate handler is calling before onerror or ontimeout handlers,
2291
+ // so we should call onloadend on the next 'tick'
2292
+ setTimeout(onloadend);
2293
+ };
2294
+ }
2295
+
2296
+ // Handle browser request cancellation (as opposed to a manual cancellation)
2297
+ request.onabort = function handleAbort() {
2298
+ if (!request) {
2299
+ return;
2300
+ }
2301
+
2302
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
2303
+
2304
+ // Clean up request
2305
+ request = null;
2306
+ };
2307
+
2308
+ // Handle low level network errors
2309
+ request.onerror = function handleError() {
2310
+ // Real errors are hidden from us by the browser
2311
+ // onerror should only fire if it's a network error
2312
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
2313
+
2314
+ // Clean up request
2315
+ request = null;
2316
+ };
2317
+
2318
+ // Handle timeout
2319
+ request.ontimeout = function handleTimeout() {
2320
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
2321
+ const transitional = config.transitional || transitionalDefaults;
2322
+ if (config.timeoutErrorMessage) {
2323
+ timeoutErrorMessage = config.timeoutErrorMessage;
2324
+ }
2325
+ reject(new AxiosError(
2326
+ timeoutErrorMessage,
2327
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
2328
+ config,
2329
+ request));
2330
+
2331
+ // Clean up request
2332
+ request = null;
2333
+ };
2334
+
2335
+ // Add xsrf header
2336
+ // This is only done if running in a standard browser environment.
2337
+ // Specifically not if we're in a web worker, or react-native.
2338
+ if (platform.isStandardBrowserEnv) {
2339
+ // Add xsrf header
2340
+ const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
2341
+ && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
2342
+
2343
+ if (xsrfValue) {
2344
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
2345
+ }
2346
+ }
2347
+
2348
+ // Remove Content-Type if data is undefined
2349
+ requestData === undefined && requestHeaders.setContentType(null);
2350
+
2351
+ // Add headers to the request
2352
+ if ('setRequestHeader' in request) {
2353
+ utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2354
+ request.setRequestHeader(key, val);
2355
+ });
2356
+ }
2357
+
2358
+ // Add withCredentials to request if needed
2359
+ if (!utils.isUndefined(config.withCredentials)) {
2360
+ request.withCredentials = !!config.withCredentials;
2361
+ }
2362
+
2363
+ // Add responseType to request if needed
2364
+ if (responseType && responseType !== 'json') {
2365
+ request.responseType = config.responseType;
2366
+ }
2367
+
2368
+ // Handle progress if needed
2369
+ if (typeof config.onDownloadProgress === 'function') {
2370
+ request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
2371
+ }
2372
+
2373
+ // Not all browsers support upload events
2374
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
2375
+ request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
2376
+ }
2377
+
2378
+ if (config.cancelToken || config.signal) {
2379
+ // Handle cancellation
2380
+ // eslint-disable-next-line func-names
2381
+ onCanceled = cancel => {
2382
+ if (!request) {
2383
+ return;
2384
+ }
2385
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
2386
+ request.abort();
2387
+ request = null;
2388
+ };
2389
+
2390
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
2391
+ if (config.signal) {
2392
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
2393
+ }
2394
+ }
2395
+
2396
+ const protocol = parseProtocol(fullPath);
2397
+
2398
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
2399
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
2400
+ return;
2401
+ }
2402
+
2403
+
2404
+ // Send the request
2405
+ request.send(requestData || null);
2406
+ });
2407
+ };
2408
+
2409
+ const knownAdapters = {
2410
+ http: httpAdapter,
2411
+ xhr: xhrAdapter
2412
+ };
2413
+
2414
+ utils.forEach(knownAdapters, (fn, value) => {
2415
+ if(fn) {
2416
+ try {
2417
+ Object.defineProperty(fn, 'name', {value});
2418
+ } catch (e) {
2419
+ // eslint-disable-next-line no-empty
2420
+ }
2421
+ Object.defineProperty(fn, 'adapterName', {value});
2422
+ }
2423
+ });
2424
+
2425
+ const adapters = {
2426
+ getAdapter: (adapters) => {
2427
+ adapters = utils.isArray(adapters) ? adapters : [adapters];
2428
+
2429
+ const {length} = adapters;
2430
+ let nameOrAdapter;
2431
+ let adapter;
2432
+
2433
+ for (let i = 0; i < length; i++) {
2434
+ nameOrAdapter = adapters[i];
2435
+ if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {
2436
+ break;
2437
+ }
2438
+ }
2439
+
2440
+ if (!adapter) {
2441
+ if (adapter === false) {
2442
+ throw new AxiosError(
2443
+ `Adapter ${nameOrAdapter} is not supported by the environment`,
2444
+ 'ERR_NOT_SUPPORT'
2445
+ );
2446
+ }
2447
+
2448
+ throw new Error(
2449
+ utils.hasOwnProp(knownAdapters, nameOrAdapter) ?
2450
+ `Adapter '${nameOrAdapter}' is not available in the build` :
2451
+ `Unknown adapter '${nameOrAdapter}'`
2452
+ );
2453
+ }
2454
+
2455
+ if (!utils.isFunction(adapter)) {
2456
+ throw new TypeError('adapter is not a function');
2457
+ }
2458
+
2459
+ return adapter;
2460
+ },
2461
+ adapters: knownAdapters
2462
+ };
2463
+
2464
+ /**
2465
+ * Throws a `CanceledError` if cancellation has been requested.
2466
+ *
2467
+ * @param {Object} config The config that is to be used for the request
2468
+ *
2469
+ * @returns {void}
2470
+ */
2471
+ function throwIfCancellationRequested(config) {
2472
+ if (config.cancelToken) {
2473
+ config.cancelToken.throwIfRequested();
2474
+ }
2475
+
2476
+ if (config.signal && config.signal.aborted) {
2477
+ throw new CanceledError(null, config);
2478
+ }
2479
+ }
2480
+
2481
+ /**
2482
+ * Dispatch a request to the server using the configured adapter.
2483
+ *
2484
+ * @param {object} config The config that is to be used for the request
2485
+ *
2486
+ * @returns {Promise} The Promise to be fulfilled
2487
+ */
2488
+ function dispatchRequest(config) {
2489
+ throwIfCancellationRequested(config);
2490
+
2491
+ config.headers = AxiosHeaders.from(config.headers);
2492
+
2493
+ // Transform request data
2494
+ config.data = transformData.call(
2495
+ config,
2496
+ config.transformRequest
2497
+ );
2498
+
2499
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
2500
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
2501
+ }
2502
+
2503
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
2504
+
2505
+ return adapter(config).then(function onAdapterResolution(response) {
2506
+ throwIfCancellationRequested(config);
2507
+
2508
+ // Transform response data
2509
+ response.data = transformData.call(
2510
+ config,
2511
+ config.transformResponse,
2512
+ response
2513
+ );
2514
+
2515
+ response.headers = AxiosHeaders.from(response.headers);
2516
+
2517
+ return response;
2518
+ }, function onAdapterRejection(reason) {
2519
+ if (!isCancel(reason)) {
2520
+ throwIfCancellationRequested(config);
2521
+
2522
+ // Transform response data
2523
+ if (reason && reason.response) {
2524
+ reason.response.data = transformData.call(
2525
+ config,
2526
+ config.transformResponse,
2527
+ reason.response
2528
+ );
2529
+ reason.response.headers = AxiosHeaders.from(reason.response.headers);
2530
+ }
2531
+ }
2532
+
2533
+ return Promise.reject(reason);
2534
+ });
2535
+ }
2536
+
2537
+ const headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;
2538
+
2539
+ /**
2540
+ * Config-specific merge-function which creates a new config-object
2541
+ * by merging two configuration objects together.
2542
+ *
2543
+ * @param {Object} config1
2544
+ * @param {Object} config2
2545
+ *
2546
+ * @returns {Object} New object resulting from merging config2 to config1
2547
+ */
2548
+ function mergeConfig(config1, config2) {
2549
+ // eslint-disable-next-line no-param-reassign
2550
+ config2 = config2 || {};
2551
+ const config = {};
2552
+
2553
+ function getMergedValue(target, source, caseless) {
2554
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
2555
+ return utils.merge.call({caseless}, target, source);
2556
+ } else if (utils.isPlainObject(source)) {
2557
+ return utils.merge({}, source);
2558
+ } else if (utils.isArray(source)) {
2559
+ return source.slice();
2560
+ }
2561
+ return source;
2562
+ }
2563
+
2564
+ // eslint-disable-next-line consistent-return
2565
+ function mergeDeepProperties(a, b, caseless) {
2566
+ if (!utils.isUndefined(b)) {
2567
+ return getMergedValue(a, b, caseless);
2568
+ } else if (!utils.isUndefined(a)) {
2569
+ return getMergedValue(undefined, a, caseless);
2570
+ }
2571
+ }
2572
+
2573
+ // eslint-disable-next-line consistent-return
2574
+ function valueFromConfig2(a, b) {
2575
+ if (!utils.isUndefined(b)) {
2576
+ return getMergedValue(undefined, b);
2577
+ }
2578
+ }
2579
+
2580
+ // eslint-disable-next-line consistent-return
2581
+ function defaultToConfig2(a, b) {
2582
+ if (!utils.isUndefined(b)) {
2583
+ return getMergedValue(undefined, b);
2584
+ } else if (!utils.isUndefined(a)) {
2585
+ return getMergedValue(undefined, a);
2586
+ }
2587
+ }
2588
+
2589
+ // eslint-disable-next-line consistent-return
2590
+ function mergeDirectKeys(a, b, prop) {
2591
+ if (prop in config2) {
2592
+ return getMergedValue(a, b);
2593
+ } else if (prop in config1) {
2594
+ return getMergedValue(undefined, a);
2595
+ }
2596
+ }
2597
+
2598
+ const mergeMap = {
2599
+ url: valueFromConfig2,
2600
+ method: valueFromConfig2,
2601
+ data: valueFromConfig2,
2602
+ baseURL: defaultToConfig2,
2603
+ transformRequest: defaultToConfig2,
2604
+ transformResponse: defaultToConfig2,
2605
+ paramsSerializer: defaultToConfig2,
2606
+ timeout: defaultToConfig2,
2607
+ timeoutMessage: defaultToConfig2,
2608
+ withCredentials: defaultToConfig2,
2609
+ adapter: defaultToConfig2,
2610
+ responseType: defaultToConfig2,
2611
+ xsrfCookieName: defaultToConfig2,
2612
+ xsrfHeaderName: defaultToConfig2,
2613
+ onUploadProgress: defaultToConfig2,
2614
+ onDownloadProgress: defaultToConfig2,
2615
+ decompress: defaultToConfig2,
2616
+ maxContentLength: defaultToConfig2,
2617
+ maxBodyLength: defaultToConfig2,
2618
+ beforeRedirect: defaultToConfig2,
2619
+ transport: defaultToConfig2,
2620
+ httpAgent: defaultToConfig2,
2621
+ httpsAgent: defaultToConfig2,
2622
+ cancelToken: defaultToConfig2,
2623
+ socketPath: defaultToConfig2,
2624
+ responseEncoding: defaultToConfig2,
2625
+ validateStatus: mergeDirectKeys,
2626
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2627
+ };
2628
+
2629
+ utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
2630
+ const merge = mergeMap[prop] || mergeDeepProperties;
2631
+ const configValue = merge(config1[prop], config2[prop], prop);
2632
+ (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2633
+ });
2634
+
2635
+ return config;
2636
+ }
2637
+
2638
+ const VERSION = "1.2.2";
2639
+
2640
+ const validators$1 = {};
2641
+
2642
+ // eslint-disable-next-line func-names
2643
+ ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
2644
+ validators$1[type] = function validator(thing) {
2645
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
2646
+ };
2647
+ });
2648
+
2649
+ const deprecatedWarnings = {};
2650
+
2651
+ /**
2652
+ * Transitional option validator
2653
+ *
2654
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
2655
+ * @param {string?} version - deprecated version / removed since version
2656
+ * @param {string?} message - some message with additional info
2657
+ *
2658
+ * @returns {function}
2659
+ */
2660
+ validators$1.transitional = function transitional(validator, version, message) {
2661
+ function formatMessage(opt, desc) {
2662
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
2663
+ }
2664
+
2665
+ // eslint-disable-next-line func-names
2666
+ return (value, opt, opts) => {
2667
+ if (validator === false) {
2668
+ throw new AxiosError(
2669
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
2670
+ AxiosError.ERR_DEPRECATED
2671
+ );
2672
+ }
2673
+
2674
+ if (version && !deprecatedWarnings[opt]) {
2675
+ deprecatedWarnings[opt] = true;
2676
+ // eslint-disable-next-line no-console
2677
+ console.warn(
2678
+ formatMessage(
2679
+ opt,
2680
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
2681
+ )
2682
+ );
2683
+ }
2684
+
2685
+ return validator ? validator(value, opt, opts) : true;
2686
+ };
2687
+ };
2688
+
2689
+ /**
2690
+ * Assert object's properties type
2691
+ *
2692
+ * @param {object} options
2693
+ * @param {object} schema
2694
+ * @param {boolean?} allowUnknown
2695
+ *
2696
+ * @returns {object}
2697
+ */
2698
+
2699
+ function assertOptions(options, schema, allowUnknown) {
2700
+ if (typeof options !== 'object') {
2701
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
2702
+ }
2703
+ const keys = Object.keys(options);
2704
+ let i = keys.length;
2705
+ while (i-- > 0) {
2706
+ const opt = keys[i];
2707
+ const validator = schema[opt];
2708
+ if (validator) {
2709
+ const value = options[opt];
2710
+ const result = value === undefined || validator(value, opt, options);
2711
+ if (result !== true) {
2712
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
2713
+ }
2714
+ continue;
2715
+ }
2716
+ if (allowUnknown !== true) {
2717
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
2718
+ }
2719
+ }
2720
+ }
2721
+
2722
+ const validator = {
2723
+ assertOptions,
2724
+ validators: validators$1
2725
+ };
2726
+
2727
+ const validators = validator.validators;
2728
+
2729
+ /**
2730
+ * Create a new instance of Axios
2731
+ *
2732
+ * @param {Object} instanceConfig The default config for the instance
2733
+ *
2734
+ * @return {Axios} A new instance of Axios
2735
+ */
2736
+ class Axios {
2737
+ constructor(instanceConfig) {
2738
+ this.defaults = instanceConfig;
2739
+ this.interceptors = {
2740
+ request: new InterceptorManager(),
2741
+ response: new InterceptorManager()
2742
+ };
2743
+ }
2744
+
2745
+ /**
2746
+ * Dispatch a request
2747
+ *
2748
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2749
+ * @param {?Object} config
2750
+ *
2751
+ * @returns {Promise} The Promise to be fulfilled
2752
+ */
2753
+ request(configOrUrl, config) {
2754
+ /*eslint no-param-reassign:0*/
2755
+ // Allow for axios('example/url'[, config]) a la fetch API
2756
+ if (typeof configOrUrl === 'string') {
2757
+ config = config || {};
2758
+ config.url = configOrUrl;
2759
+ } else {
2760
+ config = configOrUrl || {};
2761
+ }
2762
+
2763
+ config = mergeConfig(this.defaults, config);
2764
+
2765
+ const {transitional, paramsSerializer, headers} = config;
2766
+
2767
+ if (transitional !== undefined) {
2768
+ validator.assertOptions(transitional, {
2769
+ silentJSONParsing: validators.transitional(validators.boolean),
2770
+ forcedJSONParsing: validators.transitional(validators.boolean),
2771
+ clarifyTimeoutError: validators.transitional(validators.boolean)
2772
+ }, false);
2773
+ }
2774
+
2775
+ if (paramsSerializer !== undefined) {
2776
+ validator.assertOptions(paramsSerializer, {
2777
+ encode: validators.function,
2778
+ serialize: validators.function
2779
+ }, true);
2780
+ }
2781
+
2782
+ // Set config.method
2783
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
2784
+
2785
+ let contextHeaders;
2786
+
2787
+ // Flatten headers
2788
+ contextHeaders = headers && utils.merge(
2789
+ headers.common,
2790
+ headers[config.method]
2791
+ );
2792
+
2793
+ contextHeaders && utils.forEach(
2794
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
2795
+ (method) => {
2796
+ delete headers[method];
2797
+ }
2798
+ );
2799
+
2800
+ config.headers = AxiosHeaders.concat(contextHeaders, headers);
2801
+
2802
+ // filter out skipped interceptors
2803
+ const requestInterceptorChain = [];
2804
+ let synchronousRequestInterceptors = true;
2805
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2806
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
2807
+ return;
2808
+ }
2809
+
2810
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2811
+
2812
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2813
+ });
2814
+
2815
+ const responseInterceptorChain = [];
2816
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
2817
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2818
+ });
2819
+
2820
+ let promise;
2821
+ let i = 0;
2822
+ let len;
2823
+
2824
+ if (!synchronousRequestInterceptors) {
2825
+ const chain = [dispatchRequest.bind(this), undefined];
2826
+ chain.unshift.apply(chain, requestInterceptorChain);
2827
+ chain.push.apply(chain, responseInterceptorChain);
2828
+ len = chain.length;
2829
+
2830
+ promise = Promise.resolve(config);
2831
+
2832
+ while (i < len) {
2833
+ promise = promise.then(chain[i++], chain[i++]);
2834
+ }
2835
+
2836
+ return promise;
2837
+ }
2838
+
2839
+ len = requestInterceptorChain.length;
2840
+
2841
+ let newConfig = config;
2842
+
2843
+ i = 0;
2844
+
2845
+ while (i < len) {
2846
+ const onFulfilled = requestInterceptorChain[i++];
2847
+ const onRejected = requestInterceptorChain[i++];
2848
+ try {
2849
+ newConfig = onFulfilled(newConfig);
2850
+ } catch (error) {
2851
+ onRejected.call(this, error);
2852
+ break;
2853
+ }
2854
+ }
2855
+
2856
+ try {
2857
+ promise = dispatchRequest.call(this, newConfig);
2858
+ } catch (error) {
2859
+ return Promise.reject(error);
2860
+ }
2861
+
2862
+ i = 0;
2863
+ len = responseInterceptorChain.length;
2864
+
2865
+ while (i < len) {
2866
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
2867
+ }
2868
+
2869
+ return promise;
2870
+ }
2871
+
2872
+ getUri(config) {
2873
+ config = mergeConfig(this.defaults, config);
2874
+ const fullPath = buildFullPath(config.baseURL, config.url);
2875
+ return buildURL(fullPath, config.params, config.paramsSerializer);
2876
+ }
2877
+ }
2878
+
2879
+ // Provide aliases for supported request methods
2880
+ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
2881
+ /*eslint func-names:0*/
2882
+ Axios.prototype[method] = function(url, config) {
2883
+ return this.request(mergeConfig(config || {}, {
2884
+ method,
2885
+ url,
2886
+ data: (config || {}).data
2887
+ }));
2888
+ };
2889
+ });
2890
+
2891
+ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
2892
+ /*eslint func-names:0*/
2893
+
2894
+ function generateHTTPMethod(isForm) {
2895
+ return function httpMethod(url, data, config) {
2896
+ return this.request(mergeConfig(config || {}, {
2897
+ method,
2898
+ headers: isForm ? {
2899
+ 'Content-Type': 'multipart/form-data'
2900
+ } : {},
2901
+ url,
2902
+ data
2903
+ }));
2904
+ };
2905
+ }
2906
+
2907
+ Axios.prototype[method] = generateHTTPMethod();
2908
+
2909
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
2910
+ });
2911
+
2912
+ /**
2913
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
2914
+ *
2915
+ * @param {Function} executor The executor function.
2916
+ *
2917
+ * @returns {CancelToken}
2918
+ */
2919
+ class CancelToken {
2920
+ constructor(executor) {
2921
+ if (typeof executor !== 'function') {
2922
+ throw new TypeError('executor must be a function.');
2923
+ }
2924
+
2925
+ let resolvePromise;
2926
+
2927
+ this.promise = new Promise(function promiseExecutor(resolve) {
2928
+ resolvePromise = resolve;
2929
+ });
2930
+
2931
+ const token = this;
2932
+
2933
+ // eslint-disable-next-line func-names
2934
+ this.promise.then(cancel => {
2935
+ if (!token._listeners) return;
2936
+
2937
+ let i = token._listeners.length;
2938
+
2939
+ while (i-- > 0) {
2940
+ token._listeners[i](cancel);
2941
+ }
2942
+ token._listeners = null;
2943
+ });
2944
+
2945
+ // eslint-disable-next-line func-names
2946
+ this.promise.then = onfulfilled => {
2947
+ let _resolve;
2948
+ // eslint-disable-next-line func-names
2949
+ const promise = new Promise(resolve => {
2950
+ token.subscribe(resolve);
2951
+ _resolve = resolve;
2952
+ }).then(onfulfilled);
2953
+
2954
+ promise.cancel = function reject() {
2955
+ token.unsubscribe(_resolve);
2956
+ };
2957
+
2958
+ return promise;
2959
+ };
2960
+
2961
+ executor(function cancel(message, config, request) {
2962
+ if (token.reason) {
2963
+ // Cancellation has already been requested
2964
+ return;
2965
+ }
2966
+
2967
+ token.reason = new CanceledError(message, config, request);
2968
+ resolvePromise(token.reason);
2969
+ });
2970
+ }
2971
+
2972
+ /**
2973
+ * Throws a `CanceledError` if cancellation has been requested.
2974
+ */
2975
+ throwIfRequested() {
2976
+ if (this.reason) {
2977
+ throw this.reason;
2978
+ }
2979
+ }
2980
+
2981
+ /**
2982
+ * Subscribe to the cancel signal
2983
+ */
2984
+
2985
+ subscribe(listener) {
2986
+ if (this.reason) {
2987
+ listener(this.reason);
2988
+ return;
2989
+ }
2990
+
2991
+ if (this._listeners) {
2992
+ this._listeners.push(listener);
2993
+ } else {
2994
+ this._listeners = [listener];
2995
+ }
2996
+ }
2997
+
2998
+ /**
2999
+ * Unsubscribe from the cancel signal
3000
+ */
3001
+
3002
+ unsubscribe(listener) {
3003
+ if (!this._listeners) {
3004
+ return;
3005
+ }
3006
+ const index = this._listeners.indexOf(listener);
3007
+ if (index !== -1) {
3008
+ this._listeners.splice(index, 1);
3009
+ }
3010
+ }
3011
+
3012
+ /**
3013
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
3014
+ * cancels the `CancelToken`.
3015
+ */
3016
+ static source() {
3017
+ let cancel;
3018
+ const token = new CancelToken(function executor(c) {
3019
+ cancel = c;
3020
+ });
3021
+ return {
3022
+ token,
3023
+ cancel
3024
+ };
3025
+ }
3026
+ }
3027
+
3028
+ /**
3029
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
3030
+ *
3031
+ * Common use case would be to use `Function.prototype.apply`.
3032
+ *
3033
+ * ```js
3034
+ * function f(x, y, z) {}
3035
+ * var args = [1, 2, 3];
3036
+ * f.apply(null, args);
3037
+ * ```
3038
+ *
3039
+ * With `spread` this example can be re-written.
3040
+ *
3041
+ * ```js
3042
+ * spread(function(x, y, z) {})([1, 2, 3]);
3043
+ * ```
3044
+ *
3045
+ * @param {Function} callback
3046
+ *
3047
+ * @returns {Function}
3048
+ */
3049
+ function spread(callback) {
3050
+ return function wrap(arr) {
3051
+ return callback.apply(null, arr);
3052
+ };
3053
+ }
3054
+
3055
+ /**
3056
+ * Determines whether the payload is an error thrown by Axios
3057
+ *
3058
+ * @param {*} payload The value to test
3059
+ *
3060
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3061
+ */
3062
+ function isAxiosError(payload) {
3063
+ return utils.isObject(payload) && (payload.isAxiosError === true);
3064
+ }
3065
+
3066
+ const HttpStatusCode = {
3067
+ Continue: 100,
3068
+ SwitchingProtocols: 101,
3069
+ Processing: 102,
3070
+ EarlyHints: 103,
3071
+ Ok: 200,
3072
+ Created: 201,
3073
+ Accepted: 202,
3074
+ NonAuthoritativeInformation: 203,
3075
+ NoContent: 204,
3076
+ ResetContent: 205,
3077
+ PartialContent: 206,
3078
+ MultiStatus: 207,
3079
+ AlreadyReported: 208,
3080
+ ImUsed: 226,
3081
+ MultipleChoices: 300,
3082
+ MovedPermanently: 301,
3083
+ Found: 302,
3084
+ SeeOther: 303,
3085
+ NotModified: 304,
3086
+ UseProxy: 305,
3087
+ Unused: 306,
3088
+ TemporaryRedirect: 307,
3089
+ PermanentRedirect: 308,
3090
+ BadRequest: 400,
3091
+ Unauthorized: 401,
3092
+ PaymentRequired: 402,
3093
+ Forbidden: 403,
3094
+ NotFound: 404,
3095
+ MethodNotAllowed: 405,
3096
+ NotAcceptable: 406,
3097
+ ProxyAuthenticationRequired: 407,
3098
+ RequestTimeout: 408,
3099
+ Conflict: 409,
3100
+ Gone: 410,
3101
+ LengthRequired: 411,
3102
+ PreconditionFailed: 412,
3103
+ PayloadTooLarge: 413,
3104
+ UriTooLong: 414,
3105
+ UnsupportedMediaType: 415,
3106
+ RangeNotSatisfiable: 416,
3107
+ ExpectationFailed: 417,
3108
+ ImATeapot: 418,
3109
+ MisdirectedRequest: 421,
3110
+ UnprocessableEntity: 422,
3111
+ Locked: 423,
3112
+ FailedDependency: 424,
3113
+ TooEarly: 425,
3114
+ UpgradeRequired: 426,
3115
+ PreconditionRequired: 428,
3116
+ TooManyRequests: 429,
3117
+ RequestHeaderFieldsTooLarge: 431,
3118
+ UnavailableForLegalReasons: 451,
3119
+ InternalServerError: 500,
3120
+ NotImplemented: 501,
3121
+ BadGateway: 502,
3122
+ ServiceUnavailable: 503,
3123
+ GatewayTimeout: 504,
3124
+ HttpVersionNotSupported: 505,
3125
+ VariantAlsoNegotiates: 506,
3126
+ InsufficientStorage: 507,
3127
+ LoopDetected: 508,
3128
+ NotExtended: 510,
3129
+ NetworkAuthenticationRequired: 511,
3130
+ };
3131
+
3132
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
3133
+ HttpStatusCode[value] = key;
3134
+ });
3135
+
3136
+ /**
3137
+ * Create an instance of Axios
3138
+ *
3139
+ * @param {Object} defaultConfig The default config for the instance
3140
+ *
3141
+ * @returns {Axios} A new instance of Axios
3142
+ */
3143
+ function createInstance(defaultConfig) {
3144
+ const context = new Axios(defaultConfig);
3145
+ const instance = bind(Axios.prototype.request, context);
3146
+
3147
+ // Copy axios.prototype to instance
3148
+ utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
3149
+
3150
+ // Copy context to instance
3151
+ utils.extend(instance, context, null, {allOwnKeys: true});
3152
+
3153
+ // Factory for creating new instances
3154
+ instance.create = function create(instanceConfig) {
3155
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
3156
+ };
3157
+
3158
+ return instance;
3159
+ }
3160
+
3161
+ // Create the default instance to be exported
3162
+ const axios = createInstance(defaults);
3163
+
3164
+ // Expose Axios class to allow class inheritance
3165
+ axios.Axios = Axios;
3166
+
3167
+ // Expose Cancel & CancelToken
3168
+ axios.CanceledError = CanceledError;
3169
+ axios.CancelToken = CancelToken;
3170
+ axios.isCancel = isCancel;
3171
+ axios.VERSION = VERSION;
3172
+ axios.toFormData = toFormData;
3173
+
3174
+ // Expose AxiosError class
3175
+ axios.AxiosError = AxiosError;
3176
+
3177
+ // alias for CanceledError for backward compatibility
3178
+ axios.Cancel = axios.CanceledError;
3179
+
3180
+ // Expose all/spread
3181
+ axios.all = function all(promises) {
3182
+ return Promise.all(promises);
3183
+ };
3184
+
3185
+ axios.spread = spread;
3186
+
3187
+ // Expose isAxiosError
3188
+ axios.isAxiosError = isAxiosError;
3189
+
3190
+ // Expose mergeConfig
3191
+ axios.mergeConfig = mergeConfig;
3192
+
3193
+ axios.AxiosHeaders = AxiosHeaders;
3194
+
3195
+ axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
3196
+
3197
+ axios.HttpStatusCode = HttpStatusCode;
3198
+
3199
+ axios.default = axios;
3200
+
3201
+ // This file provides a polyfill for managing globals in both NodeJS and browser environments. This is
3202
+ // an anti-pattern we'd hoped to avoid, but we have several projects dependending on one common library
3203
+ // (this js-sdk) and we want that library to provide a common endpoint to all callers (so authentication
3204
+ // tokens only need to be tracked in one place). The trouble is, one of those libraries is based on
3205
+ // StencilJS and is compiling its modules into Web Components. Because of how module resolution works,
3206
+ // when those Components load js-sdk they get a separate instance. Without messy options like having to
3207
+ // pass raw data from the caller to each Component, or pass around references to a common Endpoint, they
3208
+ // have no way to access authenticated sessions unless we make the Endpoint a true global.
3209
+ //
3210
+ // @credit https://github.com/medikoo/es5-ext/blob/master/global.js
3211
+ // @credit https://mathiasbynens.be/notes/globalthis
3212
+ var naiveFallback = function () {
3213
+ if (typeof self === 'object' && self)
3214
+ return self;
3215
+ if (typeof window === 'object' && window)
3216
+ return window;
3217
+ throw new Error('Unable to resolve global `this`');
3218
+ };
3219
+ var globalThis_1 = (function () {
3220
+ if (this)
3221
+ return this;
3222
+ // Unexpected strict mode (may happen if e.g. bundled into ESM module)
3223
+ // Fallback to standard globalThis if available
3224
+ if (typeof globalThis === 'object' && globalThis)
3225
+ return globalThis;
3226
+ // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
3227
+ // In all ES5+ engines global object inherits from Object.prototype
3228
+ // (if you approached one that doesn't please report)
3229
+ try {
3230
+ Object.defineProperty(Object.prototype, '__global__', {
3231
+ get: function () {
3232
+ return this;
3233
+ },
3234
+ configurable: true,
3235
+ });
3236
+ }
3237
+ catch (error) {
3238
+ // Unfortunate case of updates to Object.prototype being restricted
3239
+ // via preventExtensions, seal or freeze
3240
+ return naiveFallback();
3241
+ }
3242
+ try {
3243
+ // Safari case (window.__global__ works, but __global__ does not)
3244
+ if (!__global__)
3245
+ return naiveFallback();
3246
+ return __global__;
3247
+ }
3248
+ finally {
3249
+ delete Object.prototype.__global__;
3250
+ }
3251
+ })();
3252
+
3253
+ // @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/
3254
+ // Also see globalThis for comments about why we're doing this in the first place.
3255
+ var ENDPOINT_KEY = Symbol.for('verdocs-default-endpoint');
3256
+ var requestLogger = function (r) {
3257
+ // tslint:disable-next-line
3258
+ console.debug("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
3259
+ return r;
3260
+ };
3261
+ /**
3262
+ * VerdocsEndpoint is a class wrapper for a specific connection and authorization context for calling the Verdocs APIs.
3263
+ * Endpoints can be used for isolated session tasks.
3264
+ *
3265
+ * For instance, ephemeral signing sessions may be created independently of a caller's status as an authenticated user.
3266
+ * In that case, an Endpoint can be created and authenticated, used for calls related to signing operations, then
3267
+ * discarded once signing is complete.
3268
+ *
3269
+ * Note that endpoint configuration functions return the instance, so they can be chained, e.g.
3270
+ *
3271
+ * ```typescript
3272
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3273
+ *
3274
+ * const endpoint = new VerdocsEndpoint();
3275
+ * endpoint
3276
+ * .setSessionType('signing')
3277
+ * .logRequests(true)
3278
+ * .setClientID('1234)
3279
+ * .setTimeout(5000);
3280
+ * ```
3281
+ */
3282
+ var VerdocsEndpoint = /** @class */ (function () {
3283
+ /**
3284
+ * Create a new VerdocsEndpoint to call Verdocs platform services.
3285
+ *
3286
+ * ```typescript
3287
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3288
+ * const endpoint = new VerdocsEndpoint();
3289
+ * ```
3290
+ */
3291
+ function VerdocsEndpoint(options) {
3292
+ this.environment = 'verdocs';
3293
+ this.sessionType = 'user';
3294
+ this.baseURL = 'https://api.verdocs.com';
3295
+ this.clientID = 'not-set';
3296
+ this.timeout = 3000;
3297
+ this.token = null;
3298
+ this.nextListenerId = 0;
3299
+ this.sessionListeners = new Map();
3300
+ this.requestLoggerId = null;
3301
+ /**
3302
+ * The current user session, or null if not authenticated. May be either a User or Signing session. If set, the
3303
+ * presence of the `document_id` field can be used to differentiate the types. Only signing sessions are associated
3304
+ * with Envelopes.
3305
+ */
3306
+ this.session = null;
3307
+ this.baseURL = (options === null || options === void 0 ? void 0 : options.baseURL) || 'https://api.verdocs.com';
3308
+ this.timeout = (options === null || options === void 0 ? void 0 : options.timeout) || 3000;
3309
+ this.environment = (options === null || options === void 0 ? void 0 : options.environment) || 'verdocs';
3310
+ this.sessionType = (options === null || options === void 0 ? void 0 : options.sessionType) || 'user';
3311
+ this.clientID = (options === null || options === void 0 ? void 0 : options.clientID) || 'not-set';
3312
+ this.api = axios.create({ baseURL: this.baseURL, timeout: this.timeout });
3313
+ }
3314
+ VerdocsEndpoint.prototype.setDefault = function () {
3315
+ globalThis_1[ENDPOINT_KEY] = this;
3316
+ };
3317
+ VerdocsEndpoint.getDefault = function () {
3318
+ if (!globalThis_1[ENDPOINT_KEY]) {
3319
+ globalThis_1[ENDPOINT_KEY] = new VerdocsEndpoint();
3320
+ window.console.debug('[JS_SDK] Created default endpoint', globalThis_1[ENDPOINT_KEY]);
3321
+ }
3322
+ return globalThis_1[ENDPOINT_KEY];
3323
+ };
3324
+ /**
3325
+ * Get the current environment.
3326
+ */
3327
+ VerdocsEndpoint.prototype.getEnvironment = function () {
3328
+ return this.environment;
3329
+ };
3330
+ /**
3331
+ * Get the current session type.
3332
+ */
3333
+ VerdocsEndpoint.prototype.getSessionType = function () {
3334
+ return this.sessionType;
3335
+ };
3336
+ /**
3337
+ * Get the current base URL. This should rarely be anything other than 'https://api.verdocs.com'.
3338
+ */
3339
+ VerdocsEndpoint.prototype.getBaseURL = function () {
3340
+ return this.baseURL;
3341
+ };
3342
+ /**
3343
+ * Get the current client ID, if set.
3344
+ */
3345
+ VerdocsEndpoint.prototype.getClientID = function () {
3346
+ return this.clientID;
3347
+ };
3348
+ /**
3349
+ * Get the current timeout.
3350
+ */
3351
+ VerdocsEndpoint.prototype.getTimeout = function () {
3352
+ return this.timeout;
3353
+ };
3354
+ /**
3355
+ * Get the current session, if any.
3356
+ */
3357
+ VerdocsEndpoint.prototype.getSession = function () {
3358
+ return this.session;
3359
+ };
3360
+ /**
3361
+ * Set the operating environment. This should rarely be anything other than 'verdocs'.
3362
+ *
3363
+ * ```typescript
3364
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3365
+ *
3366
+ * const endpoint = new VerdocsEndpoint();
3367
+ * endpoint.setEnvironment('verdocs-stage');
3368
+ * ```
3369
+ */
3370
+ VerdocsEndpoint.prototype.setEnvironment = function (environment) {
3371
+ this.environment = environment;
3372
+ return this;
3373
+ };
3374
+ /**
3375
+ * Set the session type. In general this should be done immediately when the endpoint is created. Changing the
3376
+ * session type may be done at any time, but may have unintended consequences if the endpoint is shared between
3377
+ * multiple widgets.
3378
+ *
3379
+ * Changing the session type will clear/reload the action session. This may trigger notifications to session state
3380
+ * observers. Apps that use observers to trigger UI updates such as logging the user out should be prepared to
3381
+ * handle this event.
3382
+ *
3383
+ * ```typescript
3384
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3385
+ *
3386
+ * const endpoint = new VerdocsEndpoint();
3387
+ * endpoint.setEnvironment('verdocs-stage');
3388
+ * ```
3389
+ */
3390
+ VerdocsEndpoint.prototype.setSessionType = function (sessionType) {
3391
+ this.sessionType = sessionType;
3392
+ return this;
3393
+ };
3394
+ /**
3395
+ * Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.
3396
+ *
3397
+ * ```typescript
3398
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3399
+ *
3400
+ * const endpoint = new VerdocsEndpoint();
3401
+ * endpoint.setBaseURL('https://api.verdocs.com');
3402
+ * ```
3403
+ */
3404
+ VerdocsEndpoint.prototype.setBaseURL = function (url) {
3405
+ this.api.defaults.baseURL = url;
3406
+ return this;
3407
+ };
3408
+ /**
3409
+ * Set the Client ID for Verdocs API calls.
3410
+ *
3411
+ * ```typescript
3412
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3413
+ *
3414
+ * const endpoint = new VerdocsEndpoint();
3415
+ * endpoint.setClientID('1234);
3416
+ * ```
3417
+ */
3418
+ VerdocsEndpoint.prototype.setClientID = function (clientID) {
3419
+ this.clientID = clientID;
3420
+ this.api.defaults.headers.common['X-Client-ID'] = clientID;
3421
+ return this;
3422
+ };
3423
+ /**
3424
+ * Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
3425
+ *
3426
+ * ```typescript
3427
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3428
+ *
3429
+ * const endpoint = new VerdocsEndpoint();
3430
+ * endpoint.setTimeout(3000);
3431
+ * ```
3432
+ */
3433
+ VerdocsEndpoint.prototype.setTimeout = function (timeout) {
3434
+ this.timeout = timeout;
3435
+ this.api.defaults.timeout = timeout;
3436
+ return this;
3437
+ };
3438
+ /**
3439
+ * Enable or disable request logging. This may expose sensitive data in the console log, so it should only be used for debugging.
3440
+ *
3441
+ * ```typescript
3442
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3443
+ *
3444
+ * const endpoint = new VerdocsEndpoint();
3445
+ * endpoint.logRequests(true);
3446
+ * ```
3447
+ */
3448
+ VerdocsEndpoint.prototype.logRequests = function (enable) {
3449
+ if (enable && this.requestLoggerId === null) {
3450
+ this.requestLoggerId = this.api.interceptors.request.use(requestLogger);
3451
+ }
3452
+ else if (!enable && this.requestLoggerId !== null) {
3453
+ this.api.interceptors.request.eject(this.requestLoggerId);
3454
+ }
3455
+ return this;
3456
+ };
3457
+ /**
3458
+ * Set the authorization token that will be used for Verdocs API calls. This will also set the session metadata
3459
+ * and notify any listeners of the new data.
3460
+ *
3461
+ * If this Endpoint will be used for non-default purposes (e.g. signing, or in an alternate environment) those
3462
+ * settings should be made before calling this. Sessions are persisted to localStorage, and the environment and
3463
+ * type become part of the storage key.
3464
+ *
3465
+ * ```typescript
3466
+ * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
3467
+ *
3468
+ * const endpoint = new VerdocsEndpoint();
3469
+ * endpoint.setToken(accessToken);
3470
+ * ```
3471
+ */
3472
+ VerdocsEndpoint.prototype.setToken = function (token) {
3473
+ if (!token) {
3474
+ return this.clearSession();
3475
+ }
3476
+ var session = decodeAccessTokenBody(token);
3477
+ if (session === null || (session.exp && session.exp * 1000 < new Date().getTime())) {
3478
+ window.console.warn('[JS_SDK] Ignoring attempt to use expired session token');
3479
+ return this.clearSession();
3480
+ }
3481
+ this.token = token;
3482
+ this.session = session;
3483
+ if (this.sessionType === 'user') {
3484
+ this.api.defaults.headers.common.Authorization = "Bearer ".concat(token);
3485
+ }
3486
+ else {
3487
+ this.api.defaults.headers.common.signer = "Bearer ".concat(token);
3488
+ }
3489
+ localStorage.setItem(this.sessionStorageKey(), token);
3490
+ this.notifySessionListeners();
3491
+ return this;
3492
+ };
3493
+ /**
3494
+ * Retrieves the current session token, if any. Tokens should rarely be used for direct actions, but this is
3495
+ * required by the `<VerdocsView>` and other components to authorize requests to raw PDF files.
3496
+ */
3497
+ VerdocsEndpoint.prototype.getToken = function () {
3498
+ return this.token;
3499
+ };
3500
+ VerdocsEndpoint.prototype.sessionStorageKey = function () {
3501
+ return "verdocs-session-".concat(this.getSessionType(), "-").concat(this.getEnvironment());
3502
+ };
3503
+ /**
3504
+ * Clear the active session.
3505
+ */
3506
+ VerdocsEndpoint.prototype.clearSession = function () {
3507
+ localStorage.removeItem(this.sessionStorageKey());
3508
+ delete this.api.defaults.headers.common.Authorization;
3509
+ delete this.api.defaults.headers.common.signer;
3510
+ this.session = null;
3511
+ this.token = null;
3512
+ this.notifySessionListeners();
3513
+ return this;
3514
+ };
3515
+ /**
3516
+ * Clear the active signing session.
3517
+ */
3518
+ VerdocsEndpoint.prototype.clearSignerSession = function () {
3519
+ localStorage.removeItem(this.sessionStorageKey());
3520
+ delete this.api.defaults.headers.common.Authorization;
3521
+ this.session = null;
3522
+ this.token = null;
3523
+ this.notifySessionListeners();
3524
+ return this;
3525
+ };
3526
+ VerdocsEndpoint.prototype.notifySessionListeners = function () {
3527
+ var _this = this;
3528
+ this.sessionListeners.forEach(function (listener) {
3529
+ try {
3530
+ listener(_this, _this.session);
3531
+ }
3532
+ catch (e) {
3533
+ // NOOP
3534
+ }
3535
+ });
3536
+ };
3537
+ /**
3538
+ * Subscribe to session state change events.
3539
+ */
3540
+ VerdocsEndpoint.prototype.onSessionChanged = function (listener) {
3541
+ var _this = this;
3542
+ // There's no value in randomizing this, a simple counter is fine
3543
+ this.nextListenerId++;
3544
+ var listenerSymbol = Symbol.for('' + this.nextListenerId);
3545
+ this.sessionListeners.set(listenerSymbol, listener);
3546
+ return function () {
3547
+ _this.sessionListeners.delete(listenerSymbol);
3548
+ };
3549
+ };
3550
+ /**
3551
+ * Load a persisted session from localStorage. Typically called once after the endpoint is configured when the app
3552
+ * or component starts.
3553
+ */
3554
+ VerdocsEndpoint.prototype.loadSession = function () {
3555
+ var token = localStorage.getItem(this.sessionStorageKey());
3556
+ if (!token) {
3557
+ return this.clearSession();
3558
+ }
3559
+ return this.setToken(token);
3560
+ };
3561
+ return VerdocsEndpoint;
3562
+ }());
3563
+
3564
+ export { VerdocsEndpoint as V, decodeAccessTokenBody as d };
3565
+
3566
+ //# sourceMappingURL=VerdocsEndpoint-dac04424.js.map