@verdocs/web-sdk 1.9.22 → 1.9.23

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 (202) hide show
  1. package/dist/cjs/{Envelopes-647724d8.js → Envelopes-a9646e09.js} +2 -2
  2. package/dist/cjs/{Envelopes-647724d8.js.map → Envelopes-a9646e09.js.map} +1 -1
  3. package/dist/cjs/{Templates-c0b4453e.js → Templates-805e8ffa.js} +2 -2
  4. package/dist/cjs/{Templates-c0b4453e.js.map → Templates-805e8ffa.js.map} +1 -1
  5. package/dist/cjs/{templateStore-86cc0f59.js → templateStore-a1ccccdb.js} +2 -2
  6. package/dist/cjs/{templateStore-86cc0f59.js.map → templateStore-a1ccccdb.js.map} +1 -1
  7. package/dist/cjs/{utils-fae54b93.js → utils-aa1285cc.js} +12 -1
  8. package/dist/cjs/utils-aa1285cc.js.map +1 -0
  9. package/dist/cjs/verdocs-build.cjs.entry.js +3 -3
  10. package/dist/cjs/verdocs-document-page_2.cjs.entry.js +15 -5
  11. package/dist/cjs/verdocs-document-page_2.cjs.entry.js.map +1 -1
  12. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-field-initial.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
  18. package/dist/cjs/verdocs-field-signature_3.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +2 -2
  21. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-preview.cjs.entry.js +3 -3
  23. package/dist/cjs/verdocs-send.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-sign.cjs.entry.js +3 -5
  25. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  26. package/dist/cjs/verdocs-template-create_4.cjs.entry.js +3 -3
  27. package/dist/cjs/verdocs-view.cjs.entry.js +2 -2
  28. package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js +14 -5
  29. package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js.map +1 -1
  30. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +1 -3
  31. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  32. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +2 -4
  33. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js.map +1 -1
  34. package/dist/collection/utils/Types.js.map +1 -1
  35. package/dist/collection/utils/utils.js +10 -0
  36. package/dist/collection/utils/utils.js.map +1 -1
  37. package/dist/components/utils.js +11 -1
  38. package/dist/components/utils.js.map +1 -1
  39. package/dist/components/verdocs-document-page2.js +14 -5
  40. package/dist/components/verdocs-document-page2.js.map +1 -1
  41. package/dist/components/verdocs-sign.js +1 -3
  42. package/dist/components/verdocs-sign.js.map +1 -1
  43. package/dist/docs.json +1 -1
  44. package/dist/esm/{Envelopes-bae41b1e.js → Envelopes-bd915f3e.js} +2 -2
  45. package/dist/esm/{Envelopes-bae41b1e.js.map → Envelopes-bd915f3e.js.map} +1 -1
  46. package/dist/esm/{Templates-a5ba3f59.js → Templates-653648bb.js} +2 -2
  47. package/dist/esm/{Templates-a5ba3f59.js.map → Templates-653648bb.js.map} +1 -1
  48. package/dist/esm/{templateStore-dd69f2f3.js → templateStore-8585145f.js} +2 -2
  49. package/dist/esm/{templateStore-dd69f2f3.js.map → templateStore-8585145f.js.map} +1 -1
  50. package/dist/esm/{utils-f2bdefaa.js → utils-c666adcf.js} +12 -2
  51. package/dist/esm/utils-c666adcf.js.map +1 -0
  52. package/dist/esm/verdocs-build.entry.js +3 -3
  53. package/dist/esm/verdocs-document-page_2.entry.js +15 -5
  54. package/dist/esm/verdocs-document-page_2.entry.js.map +1 -1
  55. package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
  56. package/dist/esm/verdocs-field-date.entry.js +1 -1
  57. package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
  58. package/dist/esm/verdocs-field-initial.entry.js +1 -1
  59. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  60. package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
  61. package/dist/esm/verdocs-field-signature_3.entry.js +1 -1
  62. package/dist/esm/verdocs-field-textarea.entry.js +1 -1
  63. package/dist/esm/verdocs-field-textbox.entry.js +2 -2
  64. package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
  65. package/dist/esm/verdocs-preview.entry.js +3 -3
  66. package/dist/esm/verdocs-send.entry.js +1 -1
  67. package/dist/esm/verdocs-sign.entry.js +3 -5
  68. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  69. package/dist/esm/verdocs-template-create_4.entry.js +3 -3
  70. package/dist/esm/verdocs-view.entry.js +2 -2
  71. package/dist/esm-es5/{Envelopes-bae41b1e.js → Envelopes-bd915f3e.js} +2 -2
  72. package/dist/esm-es5/{Envelopes-bae41b1e.js.map → Envelopes-bd915f3e.js.map} +0 -0
  73. package/dist/esm-es5/{Templates-a5ba3f59.js → Templates-653648bb.js} +2 -2
  74. package/dist/esm-es5/{Templates-a5ba3f59.js.map → Templates-653648bb.js.map} +0 -0
  75. package/dist/esm-es5/{templateStore-dd69f2f3.js → templateStore-8585145f.js} +2 -2
  76. package/dist/esm-es5/{templateStore-dd69f2f3.js.map → templateStore-8585145f.js.map} +0 -0
  77. package/dist/esm-es5/{utils-f2bdefaa.js → utils-c666adcf.js} +2 -2
  78. package/dist/esm-es5/utils-c666adcf.js.map +1 -0
  79. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  80. package/dist/esm-es5/verdocs-document-page_2.entry.js +1 -1
  81. package/dist/esm-es5/verdocs-document-page_2.entry.js.map +1 -1
  82. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  83. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  84. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  85. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  86. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  87. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-field-signature_3.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  91. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  92. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  95. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  96. package/dist/esm-es5/verdocs-template-create_4.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  98. package/dist/types/utils/Types.d.ts +1 -0
  99. package/dist/types/utils/utils.d.ts +4 -0
  100. package/dist/typings.d.ts +4 -0
  101. package/dist/verdocs-web-sdk/{p-70bf612f.entry.js → p-0126c601.entry.js} +2 -2
  102. package/dist/verdocs-web-sdk/{p-70bf612f.entry.js.map → p-0126c601.entry.js.map} +0 -0
  103. package/dist/verdocs-web-sdk/{p-e0e6e79d.system.js → p-075025ab.system.js} +2 -2
  104. package/dist/verdocs-web-sdk/{p-e0e6e79d.system.js.map → p-075025ab.system.js.map} +0 -0
  105. package/dist/verdocs-web-sdk/{p-b84401ed.entry.js → p-08110f98.entry.js} +2 -2
  106. package/dist/verdocs-web-sdk/{p-b84401ed.entry.js.map → p-08110f98.entry.js.map} +0 -0
  107. package/dist/verdocs-web-sdk/{p-fed9fd2b.system.entry.js → p-0d775f91.system.entry.js} +2 -2
  108. package/dist/verdocs-web-sdk/p-0d775f91.system.entry.js.map +1 -0
  109. package/dist/verdocs-web-sdk/{p-0b771a2e.entry.js → p-19435eaf.entry.js} +2 -2
  110. package/dist/verdocs-web-sdk/{p-0b771a2e.entry.js.map → p-19435eaf.entry.js.map} +0 -0
  111. package/dist/verdocs-web-sdk/{p-1f2c70da.system.entry.js → p-2557ce63.system.entry.js} +2 -2
  112. package/dist/verdocs-web-sdk/{p-1f2c70da.system.entry.js.map → p-2557ce63.system.entry.js.map} +0 -0
  113. package/dist/verdocs-web-sdk/{p-f9915732.system.js → p-2bc68d06.system.js} +2 -2
  114. package/dist/verdocs-web-sdk/{p-f9915732.system.js.map → p-2bc68d06.system.js.map} +0 -0
  115. package/dist/verdocs-web-sdk/{p-7ccd5b2b.entry.js → p-3622cb3c.entry.js} +2 -2
  116. package/dist/verdocs-web-sdk/{p-7ccd5b2b.entry.js.map → p-3622cb3c.entry.js.map} +0 -0
  117. package/dist/verdocs-web-sdk/{p-656387e4.entry.js → p-38d5bc9e.entry.js} +2 -2
  118. package/dist/verdocs-web-sdk/{p-656387e4.entry.js.map → p-38d5bc9e.entry.js.map} +0 -0
  119. package/dist/verdocs-web-sdk/{p-92580c34.system.entry.js → p-474155b8.system.entry.js} +2 -2
  120. package/dist/verdocs-web-sdk/{p-92580c34.system.entry.js.map → p-474155b8.system.entry.js.map} +0 -0
  121. package/dist/verdocs-web-sdk/p-48c467a2.system.entry.js +2 -0
  122. package/dist/verdocs-web-sdk/p-48c467a2.system.entry.js.map +1 -0
  123. package/dist/verdocs-web-sdk/{p-f563a7c8.entry.js → p-4e1fc08d.entry.js} +2 -2
  124. package/dist/verdocs-web-sdk/{p-f563a7c8.entry.js.map → p-4e1fc08d.entry.js.map} +0 -0
  125. package/dist/verdocs-web-sdk/{p-7e9dc6ea.entry.js → p-4e775928.entry.js} +2 -2
  126. package/dist/verdocs-web-sdk/{p-7e9dc6ea.entry.js.map → p-4e775928.entry.js.map} +0 -0
  127. package/dist/verdocs-web-sdk/{p-45e74078.entry.js → p-4f3b1c7c.entry.js} +2 -2
  128. package/dist/verdocs-web-sdk/{p-45e74078.entry.js.map → p-4f3b1c7c.entry.js.map} +0 -0
  129. package/dist/verdocs-web-sdk/{p-0012a455.js → p-5b7a5deb.js} +2 -2
  130. package/dist/verdocs-web-sdk/{p-0012a455.js.map → p-5b7a5deb.js.map} +0 -0
  131. package/dist/verdocs-web-sdk/{p-de90c405.system.entry.js → p-61e0f6dd.system.entry.js} +2 -2
  132. package/dist/verdocs-web-sdk/{p-de90c405.system.entry.js.map → p-61e0f6dd.system.entry.js.map} +0 -0
  133. package/dist/verdocs-web-sdk/{p-0cbee9ee.entry.js → p-6524809d.entry.js} +2 -2
  134. package/dist/verdocs-web-sdk/{p-0cbee9ee.entry.js.map → p-6524809d.entry.js.map} +0 -0
  135. package/dist/verdocs-web-sdk/{p-c70b6871.entry.js → p-7421e32e.entry.js} +2 -2
  136. package/dist/verdocs-web-sdk/{p-c70b6871.entry.js.map → p-7421e32e.entry.js.map} +0 -0
  137. package/dist/verdocs-web-sdk/{p-ce949e78.system.entry.js → p-75f6a179.system.entry.js} +2 -2
  138. package/dist/verdocs-web-sdk/{p-ce949e78.system.entry.js.map → p-75f6a179.system.entry.js.map} +0 -0
  139. package/dist/verdocs-web-sdk/{p-b00c8e00.system.js → p-78f5c8ad.system.js} +2 -2
  140. package/dist/verdocs-web-sdk/p-78f5c8ad.system.js.map +1 -0
  141. package/dist/verdocs-web-sdk/{p-2c986881.system.entry.js → p-7937a240.system.entry.js} +2 -2
  142. package/dist/verdocs-web-sdk/{p-2c986881.system.entry.js.map → p-7937a240.system.entry.js.map} +0 -0
  143. package/dist/verdocs-web-sdk/{p-435153a4.system.entry.js → p-7e140c6b.system.entry.js} +2 -2
  144. package/dist/verdocs-web-sdk/{p-435153a4.system.entry.js.map → p-7e140c6b.system.entry.js.map} +0 -0
  145. package/dist/verdocs-web-sdk/{p-7bccd90d.entry.js → p-7ffe3227.entry.js} +2 -2
  146. package/dist/verdocs-web-sdk/p-7ffe3227.entry.js.map +1 -0
  147. package/dist/verdocs-web-sdk/{p-112b3e2c.system.js → p-89641895.system.js} +2 -2
  148. package/dist/verdocs-web-sdk/{p-112b3e2c.system.js.map → p-89641895.system.js.map} +0 -0
  149. package/dist/verdocs-web-sdk/{p-103d61f1.system.entry.js → p-92e526a0.system.entry.js} +2 -2
  150. package/dist/verdocs-web-sdk/{p-103d61f1.system.entry.js.map → p-92e526a0.system.entry.js.map} +0 -0
  151. package/dist/verdocs-web-sdk/{p-a21c0320.entry.js → p-958a833f.entry.js} +2 -2
  152. package/dist/verdocs-web-sdk/{p-a21c0320.entry.js.map → p-958a833f.entry.js.map} +0 -0
  153. package/dist/verdocs-web-sdk/{p-89c64ec1.system.entry.js → p-9e5fcf92.system.entry.js} +2 -2
  154. package/dist/verdocs-web-sdk/{p-89c64ec1.system.entry.js.map → p-9e5fcf92.system.entry.js.map} +0 -0
  155. package/dist/verdocs-web-sdk/p-a51bb6bf.js +2 -0
  156. package/dist/verdocs-web-sdk/{p-f2d637b8.js.map → p-a51bb6bf.js.map} +0 -0
  157. package/dist/verdocs-web-sdk/{p-69f813f6.system.entry.js → p-a526fa66.system.entry.js} +2 -2
  158. package/dist/verdocs-web-sdk/{p-69f813f6.system.entry.js.map → p-a526fa66.system.entry.js.map} +0 -0
  159. package/dist/verdocs-web-sdk/{p-936c9fa5.system.entry.js → p-a6781789.system.entry.js} +2 -2
  160. package/dist/verdocs-web-sdk/{p-936c9fa5.system.entry.js.map → p-a6781789.system.entry.js.map} +0 -0
  161. package/dist/verdocs-web-sdk/{p-89864e7a.system.entry.js → p-be67bcbf.system.entry.js} +2 -2
  162. package/dist/verdocs-web-sdk/{p-89864e7a.system.entry.js.map → p-be67bcbf.system.entry.js.map} +0 -0
  163. package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
  164. package/dist/verdocs-web-sdk/{p-e5338826.system.entry.js → p-c7a22e57.system.entry.js} +2 -2
  165. package/dist/verdocs-web-sdk/{p-e5338826.system.entry.js.map → p-c7a22e57.system.entry.js.map} +0 -0
  166. package/dist/verdocs-web-sdk/p-d4afe7a5.entry.js +2 -0
  167. package/dist/verdocs-web-sdk/{p-6787c11e.entry.js.map → p-d4afe7a5.entry.js.map} +1 -1
  168. package/dist/verdocs-web-sdk/{p-1d976e5e.entry.js → p-d5af4c62.entry.js} +2 -2
  169. package/dist/verdocs-web-sdk/{p-1d976e5e.entry.js.map → p-d5af4c62.entry.js.map} +0 -0
  170. package/dist/verdocs-web-sdk/{p-5648a6a6.entry.js → p-d5c00a37.entry.js} +2 -2
  171. package/dist/verdocs-web-sdk/{p-5648a6a6.entry.js.map → p-d5c00a37.entry.js.map} +0 -0
  172. package/dist/verdocs-web-sdk/{p-2b98b182.system.entry.js → p-d86dc6d1.system.entry.js} +2 -2
  173. package/dist/verdocs-web-sdk/{p-2b98b182.system.entry.js.map → p-d86dc6d1.system.entry.js.map} +0 -0
  174. package/dist/verdocs-web-sdk/{p-4fce2fbf.system.entry.js → p-da9f0046.system.entry.js} +2 -2
  175. package/dist/verdocs-web-sdk/{p-4fce2fbf.system.entry.js.map → p-da9f0046.system.entry.js.map} +0 -0
  176. package/dist/verdocs-web-sdk/{p-96eb4665.js → p-dbb4398c.js} +2 -2
  177. package/dist/verdocs-web-sdk/{p-96eb4665.js.map → p-dbb4398c.js.map} +0 -0
  178. package/dist/verdocs-web-sdk/{p-352d2017.system.entry.js → p-e7295a17.system.entry.js} +2 -2
  179. package/dist/verdocs-web-sdk/{p-352d2017.system.entry.js.map → p-e7295a17.system.entry.js.map} +0 -0
  180. package/dist/verdocs-web-sdk/p-e76b4d24.entry.js +2 -0
  181. package/dist/verdocs-web-sdk/p-e76b4d24.entry.js.map +1 -0
  182. package/dist/verdocs-web-sdk/{p-ee3deda1.entry.js → p-fa25cd77.entry.js} +2 -2
  183. package/dist/verdocs-web-sdk/{p-ee3deda1.entry.js.map → p-fa25cd77.entry.js.map} +0 -0
  184. package/dist/verdocs-web-sdk/p-fcc3041d.js +2 -0
  185. package/dist/verdocs-web-sdk/p-fcc3041d.js.map +1 -0
  186. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  187. package/package.json +15 -17
  188. package/dist/cjs/utils-fae54b93.js.map +0 -1
  189. package/dist/custom-elements.json +0 -1123
  190. package/dist/esm/utils-f2bdefaa.js.map +0 -1
  191. package/dist/esm-es5/utils-f2bdefaa.js.map +0 -1
  192. package/dist/verdocs-web-sdk/p-2fe18d0b.entry.js +0 -2
  193. package/dist/verdocs-web-sdk/p-2fe18d0b.entry.js.map +0 -1
  194. package/dist/verdocs-web-sdk/p-40554b1a.system.entry.js +0 -2
  195. package/dist/verdocs-web-sdk/p-40554b1a.system.entry.js.map +0 -1
  196. package/dist/verdocs-web-sdk/p-6787c11e.entry.js +0 -2
  197. package/dist/verdocs-web-sdk/p-7bccd90d.entry.js.map +0 -1
  198. package/dist/verdocs-web-sdk/p-80e95049.js +0 -2
  199. package/dist/verdocs-web-sdk/p-80e95049.js.map +0 -1
  200. package/dist/verdocs-web-sdk/p-b00c8e00.system.js.map +0 -1
  201. package/dist/verdocs-web-sdk/p-f2d637b8.js +0 -2
  202. package/dist/verdocs-web-sdk/p-fed9fd2b.system.entry.js.map +0 -1
@@ -1 +0,0 @@
1
- {"file":"utils-f2bdefaa.js","mappings":";;AAAA,IAAI,SAAS,GAAG,CAACA,SAAI,IAAIA,SAAI,CAAC,SAAS,KAAK,UAAU,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AACzF,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AAChH,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;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AAC,CAAC;IACpC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACtB,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,MAAM,EAAE,CAAC;GACZ,CAAC;EAEF,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,+BAA+B,IAAI,EAAE,CAAC,CAAC;EACvD,GAAG,CAAC,IAAI,EAAE,CAAC;AACb;;;;","names":["this","Envelopes.getEnvelopeFile"],"sources":["./node_modules/@verdocs/js-sdk/Envelopes/Envelopes.js","./node_modules/@verdocs/js-sdk/Utils/Fields.js","./src/utils/utils.ts"],"sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { decodeAccessTokenBody } from '../Utils/Token';\n/**\n * Create an envelope\n *\n * ```typescript\n * import {Envelopes, ICreateEnvelopeRole, ICreateEnvelopeRequest} from '@verdocs/js-sdk/Envelopes';\n *\n * const role1: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Seller',\n * full_name: 'Paige Turner',\n * email: 'paige.turner@nomail.com',\n * phone: '',\n * sequence: 1,\n * delegator: false,\n * message: '',\n * };\n *\n * const role2: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Buyer',\n * full_name: 'Will Power',\n * email: 'will.power@nomail.com',\n * phone: '',\n * sequence: 2,\n * delegator: false,\n * message: '',\n * };\n *\n * const request: ICreateEnvelopeRequest = {template_id: 'd2338742-f3a1-465b-8592-806587413cc1', name: 'Bill of Sale', roles: [role1, role2]};\n * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);\n * ```\n */\nexport var createEnvelope = function (endpoint, request) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes', request)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a summary of currently active envelopes.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {action_required, completed, waiting_on_others} = await Envelopes.getSummary(VerdocsEndpoint.getDefault());\n * ```\n */\nexport var getSummary = function (endpoint, page) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/summary', { page: page })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Search for envelopes matching various criteria.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport var searchEnvelopes = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/search', params)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a signing session for an Envelope.\n */\nexport var getSigningSession = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(params.envelopeId, \"/recipients/\").concat(encodeURIComponent(params.roleId), \"/invitation/\").concat(params.inviteCode))\n .then(function (r) {\n var _a;\n // Avoiding a jsonwebtoken dependency here - we don't actually need the whole library\n var signerToken = ((_a = r.headers) === null || _a === void 0 ? void 0 : _a.signer_token) || '';\n var session = decodeAccessTokenBody(signerToken);\n endpoint.setToken(signerToken);\n return { recipient: r.data, session: session, signerToken: signerToken };\n })];\n });\n}); };\n/**\n * Get the list of recipients for an Envelope.\n */\nexport var getEnvelopeRecipients = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients\"))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelope = function (endpoint, envelopeId, ssr) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId) + (ssr ? '?ssr=true' : ''))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelopeDocument = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Cancel an Envelope.\n */\nexport var cancelEnvelope = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId), { action: 'cancel' })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).\n */\nexport var recipientHasAction = function (recipient) { return !['submitted', 'canceled', 'declined'].includes(recipient.status); };\n/**\n * Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).\n */\nexport var getRecipientsWithActions = function (envelope) { return ((envelope === null || envelope === void 0 ? void 0 : envelope.recipients) || []).filter(recipientHasAction); };\n/**\n * Returns true if the recipient can act.\n */\nexport var recipientCanAct = function (recipient, recipientsWithActions) { var _a; return recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence); };\n/**\n * Returns true if the user can act.\n */\nexport var userCanAct = function (email, recipientsWithActions) {\n var _a;\n var recipient = recipientsWithActions.find(function (r) { return r.email === email; });\n return recipient && recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence);\n};\n/**\n * Get (binary download) a file attached to an Envelope. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getEnvelopeFile = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId, \"?file=true\"), {\n responseType: 'arraybuffer',\n })\n .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];\n });\n}); };\n/**\n * Update a Document field. Typically called during the signing process as a Recipient fills in fields.\n */\nexport var updateEnvelopeField = function (endpoint, envelopeId, fieldName, value) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName), value)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldSignature = function (endpoint, envelopeId, fieldName, signatureId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/signature/\").concat(signatureId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldInitials = function (endpoint, envelopeId, fieldName, initialId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/initial/\").concat(initialId))\n .then(function (r) { return r.data; })];\n });\n}); };\n","export function getRTop(y, fieldHeight, iTextHeight, yRatio) {\n return iTextHeight - (y + fieldHeight) * yRatio;\n}\nexport function getRLeft(x, ratio) {\n return x * ratio;\n}\nexport function getRValue(y, ratio) {\n return y * ratio;\n}\nexport function blobToBase64(image) {\n var fileReader = new FileReader();\n return new Promise(function (resolve, reject) {\n fileReader.onerror = function () {\n reject(new DOMException('Problem reading blob.'));\n };\n fileReader.onload = function () {\n resolve(fileReader.result);\n };\n fileReader.readAsDataURL(image);\n });\n}\nexport function rescale(r, n) {\n return r * n;\n}\n","// These should probably all move to JS-SDK\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {rescale} from '@verdocs/js-sdk/Utils/Fields';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField, IEnvelope} from '@verdocs/js-sdk/Envelopes/Types';\nimport {IDocumentPageInfo} from './Types';\n\nexport const integerSequence = (start: number, count: number): number[] =>\n Array(count)\n .fill(1)\n .map((_, index) => index + start);\n\nexport const fullNameToInitials = (name: string) =>\n name\n .split(' ')\n .map(word => word[0])\n .join('');\n\nexport const defaultWidth = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 82;\n }\n\n return 150;\n};\n\nexport const defaultHeight = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 41;\n }\n\n return 50;\n};\n\nexport const setControlStyles = (el: HTMLElement, field: ITemplateField | IDocumentField, xScale: number, yScale: number, option?: number) => {\n const settings = (field as ITemplateField).setting || (field as IDocumentField).settings;\n let {x = 0, y = 0, width = defaultWidth(field), height = defaultHeight(field)} = settings;\n\n const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;\n if (optionSettings) {\n x = optionSettings.x ?? x;\n y = optionSettings.y ?? y;\n width = optionSettings.width ?? width;\n height = optionSettings.height ?? height;\n }\n\n el.style.width = `${width}px`;\n el.style.height = `${height}px`;\n el.style.position = 'absolute';\n el.style.left = `${rescale(xScale, x)}px`;\n el.style.bottom = `${rescale(yScale, y)}px`;\n el.style.transform = `scale(${xScale}, ${yScale})`;\n // el.style.backgroundColor = field['rgba'] || getRGBA(roleIndex);\n};\n\nexport const getFieldId = (field: ITemplateField | IDocumentField) => {\n return `verdocs-doc-fld-${field.name}`;\n};\n\nexport const getFieldOptionId = (field: ITemplateField | IDocumentField, index: number) => {\n return `verdocs-doc-fld-${field.name}-${index}`;\n};\n\ninterface IFieldOptions {\n disabled?: boolean;\n editable?: boolean;\n draggable?: boolean;\n done?: boolean;\n}\n\nexport const renderDocumentField = (field: ITemplateField | IDocumentField, docPage: IDocumentPageInfo, roleIndex: number, fieldOptions: IFieldOptions) => {\n const {disabled = false, editable = false, draggable = false, done = false} = fieldOptions;\n const controlsDiv = document.getElementById(docPage.containerId + '-controls');\n if (!controlsDiv) {\n console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);\n return;\n }\n\n switch (field.type) {\n case 'attachment':\n case 'date':\n case 'dropdown':\n case 'initial':\n case 'payment':\n case 'signature':\n case 'timestamp':\n case 'textarea':\n case 'textbox': {\n const id = getFieldId(field);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const el: any = document.createElement(`verdocs-field-${field.type}`);\n el.field = field;\n el.setAttribute('id', id);\n el.setAttribute('roleIndex', roleIndex);\n\n if (disabled) {\n el.setAttribute('tabindex', -1);\n el.setAttribute('disabled', true);\n } else {\n el.setAttribute('tabIndex', 1);\n }\n\n if (editable) {\n el.setAttribute('editable', true);\n }\n\n if (draggable) {\n el.setAttribute('draggable', true);\n }\n\n if (done) {\n el.setAttribute('done', true);\n }\n\n setControlStyles(el, field, docPage.xScale, docPage.yScale);\n controlsDiv.appendChild(el);\n\n return el;\n }\n\n case 'checkbox_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, checkboxIndex) => {\n const id = getFieldOptionId(field, checkboxIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const cbEl: any = document.createElement(`verdocs-field-checkbox`);\n cbEl.field = field;\n cbEl.setAttribute('id', id);\n cbEl.setAttribute('roleIndex', roleIndex);\n cbEl.setAttribute('option', checkboxIndex);\n if (disabled) {\n cbEl.setAttribute('disabled', true);\n }\n if (done) {\n cbEl.setAttribute('done', true);\n }\n setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, checkboxIndex);\n controlsDiv.appendChild(cbEl);\n\n return cbEl;\n });\n\n case 'radio_button_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, buttonIndex) => {\n const id = getFieldOptionId(field, buttonIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const radioEl: any = document.createElement(`verdocs-field-radio-button`);\n radioEl.field = field;\n radioEl.setAttribute('id', id);\n radioEl.setAttribute('roleIndex', roleIndex);\n radioEl.setAttribute('option', buttonIndex);\n if (disabled) {\n radioEl.setAttribute('disabled', true);\n }\n if (done) {\n radioEl.setAttribute('done', true);\n }\n setControlStyles(radioEl, field, docPage.xScale, docPage.yScale, buttonIndex);\n controlsDiv.appendChild(radioEl);\n\n return radioEl;\n });\n\n // case 'attachment':\n // el = document.createElement('verdocs-field-attachment');\n // el.setAttribute('value', result || '');\n // break;\n // case 'payment':\n // el = document.createElement('verdocs-field-payment');\n // break;\n default:\n console.log('[PREVIEW] Skipping unsupported field type', field);\n return null;\n }\n};\n\nexport const getRoleIndex = (roles: string[], role: string) => roles.indexOf(role) || 0;\n\n// TODO: We can clean this up a lot if we alter the API to emit both setting and settings regardless of the source type,\n// but then merge the SDK types to encourage developers to use just `settings`.\nexport const getFieldSettings = (field: ITemplateField | IDocumentField) => {\n if ((field as ITemplateField).setting) {\n return (field as ITemplateField).setting;\n }\n\n if ((field as IDocumentField).settings) {\n return (field as IDocumentField).settings;\n }\n\n return {x: 0, y: 0, required: false, disabled: false, result: '', value: ''};\n};\n\n/**\n * Helper function to safely set/update components in a CSS transform attribute. Transform is normally set as a string of\n * `operation1(param) operation2(param) ...` components, which makes updating them a bit of a pain. This will remove the\n * specified component if it's already set and replace it with the new value, without touching the other components that\n * may already be set. Note that this operation moves the component to the end of the transform chain so it's not meant\n * to be used for order-sensitive components e.g. translate-then-rotate.\n */\nexport const updateCssTransform = (el: HTMLElement, key: string, value: string) => {\n // e.g. 'scale(1.87908, 1.87908) translate(0px, 0px);'\n const currentTransform = el.style.transform;\n // e.g. ['scale(1.87908, 1.87908)', 'scale', '1.87908, 1.87908', ...], [ 'translate(0px, 0px)', 'translate', '0px, 0px']]\n const components = [...currentTransform.matchAll(/(\\w+)\\(([^)]*)\\)/gi)];\n el.style.transform = [\n components //\n .filter(component => component[1] !== key) // Remove the entry if it's already set\n .map(component => component[0]), // Convert back the remaining entries\n `${key}(${value})`,\n ].join(' ');\n};\n\nexport const savePDF = async (endpoint: VerdocsEndpoint, envelope: IEnvelope, documentId: string) => {\n const fileName = `${envelope.name} - ${envelope.updated_at.split('T')[0]}.pdf`;\n const data = await Envelopes.getEnvelopeFile(endpoint, envelope.id, documentId);\n\n // This is better in React than doing window.href= or similar to trigger a download. For a description of the technique\n // see https://stackoverflow.com/questions/8126623/downloading-canvas-element-to-an-image\n let xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function () {\n let a = document.createElement('a');\n a.href = window.URL.createObjectURL(xhr.response);\n a.download = fileName;\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n a.remove();\n };\n\n xhr.open('GET', `data:application/pdf;base64,${data}`);\n xhr.send();\n};\n"],"version":3}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["node_modules/@verdocs/js-sdk/Envelopes/Envelopes.js","node_modules/@verdocs/js-sdk/Utils/Fields.js","src/utils/utils.ts"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","getSigningSession","endpoint","params","_a","api","get","concat","envelopeId","encodeURIComponent","roleId","inviteCode","r","signerToken","headers","signer_token","session","decodeAccessTokenBody","setToken","recipient","data","getEnvelope","ssr","getEnvelopeFile","documentId","responseType","Buffer","from","toString","updateEnvelopeField","fieldName","put","updateEnvelopeFieldSignature","signatureId","updateEnvelopeFieldInitials","initialId","rescale","integerSequence","start","count","Array","fill","map","index","fullNameToInitials","name","split","word","join","defaultWidth","field","type","defaultHeight","setControlStyles","el","xScale","yScale","option","settings","setting","_e","x","_f","_g","width","_h","height","optionSettings","undefined","options","_b","_c","_d","style","position","left","bottom","transform","getFieldId","getFieldOptionId","renderDocumentField","docPage","roleIndex","fieldOptions","disabled","editable","draggable","controlsDiv","document","getElementById","containerId","console","log","id","existingField","createElement","setAttribute","appendChild","checkboxIndex","cbEl","buttonIndex","radioEl","getRoleIndex","roles","role","indexOf","getFieldSettings","required","updateCssTransform","key","currentTransform","components","__spreadArray","matchAll","filter","component","savePDF","envelope","fileName","updated_at","Envelopes.getEnvelopeFile","xhr","XMLHttpRequest","onload","a","href","window","URL","createObjectURL","response","download","display","click","remove","open","send"],"mappings":"uuDAAA,IAAIA,UAAaC,WAAQA,UAAKD,WAAc,SAAUE,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,MAC/F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AAyBS,QAAS,CACrC,OAAQT,EAAyBS,QAGnC,GAAKT,EAAyBQ,SAAU,CACtC,OAAQR,EAAyBQ,SAGnC,MAAO,CAACG,EAAG,EAAG3E,EAAG,EAAGyH,SAAU,MAAOvB,SAAU,MAAO/G,OAAQ,GAAIT,MAAO,SAU9DgJ,mBAAqB,SAACtD,EAAiBuD,EAAajJ,GAE/D,IAAMkJ,EAAmBxD,EAAGmB,MAAMI,UAElC,IAAMkC,EAAUC,cAAA,GAAOF,EAAiBG,SAAS,sBAAqB,MACtE3D,EAAGmB,MAAMI,UAAY,CACnBkC,EACGG,QAAO,SAAAC,GAAa,OAAAA,EAAU,KAAON,KACrCnE,KAAI,SAAAyE,GAAa,OAAAA,EAAU,MAC9B,GAAA5G,OAAGsG,EAAG,KAAAtG,OAAI3C,EAAK,MACfoF,KAAK,UAGIoE,QAAU,SAAOlH,EAA2BmH,EAAqB7F,GAAkB,OAAAnE,eAAA,OAAA,OAAA,GAAA,iFACxFiK,EAAW,GAAA/G,OAAG8G,EAASxE,KAAI,OAAAtC,OAAM8G,EAASE,WAAWzE,MAAM,KAAK,GAAE,QAC3D,MAAA,CAAA,EAAM0E,gBAA0BtH,EAAUmH,EAASxB,GAAIrE,WAA9DJ,EAAOwC,EAAA/E,OAIT4I,EAAM,IAAIC,eACdD,EAAIhG,aAAe,OACnBgG,EAAIE,OAAS,WACX,IAAIC,EAAIpC,SAASO,cAAc,KAC/B6B,EAAEC,KAAOC,OAAOC,IAAIC,gBAAgBP,EAAIQ,UACxCL,EAAEM,SAAWZ,EACbM,EAAEnD,MAAM0D,QAAU,OAClB3C,SAAS9G,KAAKuH,YAAY2B,GAC1BA,EAAEQ,QACFR,EAAES,UAGJZ,EAAIa,KAAK,MAAO,+BAAA/H,OAA+Ba,IAC/CqG,EAAIc","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { decodeAccessTokenBody } from '../Utils/Token';\n/**\n * Create an envelope\n *\n * ```typescript\n * import {Envelopes, ICreateEnvelopeRole, ICreateEnvelopeRequest} from '@verdocs/js-sdk/Envelopes';\n *\n * const role1: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Seller',\n * full_name: 'Paige Turner',\n * email: 'paige.turner@nomail.com',\n * phone: '',\n * sequence: 1,\n * delegator: false,\n * message: '',\n * };\n *\n * const role2: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Buyer',\n * full_name: 'Will Power',\n * email: 'will.power@nomail.com',\n * phone: '',\n * sequence: 2,\n * delegator: false,\n * message: '',\n * };\n *\n * const request: ICreateEnvelopeRequest = {template_id: 'd2338742-f3a1-465b-8592-806587413cc1', name: 'Bill of Sale', roles: [role1, role2]};\n * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);\n * ```\n */\nexport var createEnvelope = function (endpoint, request) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes', request)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a summary of currently active envelopes.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {action_required, completed, waiting_on_others} = await Envelopes.getSummary(VerdocsEndpoint.getDefault());\n * ```\n */\nexport var getSummary = function (endpoint, page) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/summary', { page: page })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Search for envelopes matching various criteria.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport var searchEnvelopes = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/search', params)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a signing session for an Envelope.\n */\nexport var getSigningSession = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(params.envelopeId, \"/recipients/\").concat(encodeURIComponent(params.roleId), \"/invitation/\").concat(params.inviteCode))\n .then(function (r) {\n var _a;\n // Avoiding a jsonwebtoken dependency here - we don't actually need the whole library\n var signerToken = ((_a = r.headers) === null || _a === void 0 ? void 0 : _a.signer_token) || '';\n var session = decodeAccessTokenBody(signerToken);\n endpoint.setToken(signerToken);\n return { recipient: r.data, session: session, signerToken: signerToken };\n })];\n });\n}); };\n/**\n * Get the list of recipients for an Envelope.\n */\nexport var getEnvelopeRecipients = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients\"))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelope = function (endpoint, envelopeId, ssr) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId) + (ssr ? '?ssr=true' : ''))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelopeDocument = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Cancel an Envelope.\n */\nexport var cancelEnvelope = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId), { action: 'cancel' })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).\n */\nexport var recipientHasAction = function (recipient) { return !['submitted', 'canceled', 'declined'].includes(recipient.status); };\n/**\n * Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).\n */\nexport var getRecipientsWithActions = function (envelope) { return ((envelope === null || envelope === void 0 ? void 0 : envelope.recipients) || []).filter(recipientHasAction); };\n/**\n * Returns true if the recipient can act.\n */\nexport var recipientCanAct = function (recipient, recipientsWithActions) { var _a; return recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence); };\n/**\n * Returns true if the user can act.\n */\nexport var userCanAct = function (email, recipientsWithActions) {\n var _a;\n var recipient = recipientsWithActions.find(function (r) { return r.email === email; });\n return recipient && recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence);\n};\n/**\n * Get (binary download) a file attached to an Envelope. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getEnvelopeFile = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId, \"?file=true\"), {\n responseType: 'arraybuffer',\n })\n .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];\n });\n}); };\n/**\n * Update a Document field. Typically called during the signing process as a Recipient fills in fields.\n */\nexport var updateEnvelopeField = function (endpoint, envelopeId, fieldName, value) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName), value)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldSignature = function (endpoint, envelopeId, fieldName, signatureId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/signature/\").concat(signatureId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldInitials = function (endpoint, envelopeId, fieldName, initialId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/initial/\").concat(initialId))\n .then(function (r) { return r.data; })];\n });\n}); };\n","export function getRTop(y, fieldHeight, iTextHeight, yRatio) {\n return iTextHeight - (y + fieldHeight) * yRatio;\n}\nexport function getRLeft(x, ratio) {\n return x * ratio;\n}\nexport function getRValue(y, ratio) {\n return y * ratio;\n}\nexport function blobToBase64(image) {\n var fileReader = new FileReader();\n return new Promise(function (resolve, reject) {\n fileReader.onerror = function () {\n reject(new DOMException('Problem reading blob.'));\n };\n fileReader.onload = function () {\n resolve(fileReader.result);\n };\n fileReader.readAsDataURL(image);\n });\n}\nexport function rescale(r, n) {\n return r * n;\n}\n","// These should probably all move to JS-SDK\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {rescale} from '@verdocs/js-sdk/Utils/Fields';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField, IEnvelope} from '@verdocs/js-sdk/Envelopes/Types';\nimport {IDocumentPageInfo} from './Types';\n\nexport const integerSequence = (start: number, count: number): number[] =>\n Array(count)\n .fill(1)\n .map((_, index) => index + start);\n\nexport const fullNameToInitials = (name: string) =>\n name\n .split(' ')\n .map(word => word[0])\n .join('');\n\nexport const defaultWidth = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 82;\n }\n\n return 150;\n};\n\nexport const defaultHeight = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 41;\n }\n\n return 50;\n};\n\nexport const setControlStyles = (el: HTMLElement, field: ITemplateField | IDocumentField, xScale: number, yScale: number, option?: number) => {\n const settings = (field as ITemplateField).setting || (field as IDocumentField).settings;\n let {x = 0, y = 0, width = defaultWidth(field), height = defaultHeight(field)} = settings;\n\n const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;\n if (optionSettings) {\n x = optionSettings.x ?? x;\n y = optionSettings.y ?? y;\n width = optionSettings.width ?? width;\n height = optionSettings.height ?? height;\n }\n\n el.style.width = `${width}px`;\n el.style.height = `${height}px`;\n el.style.position = 'absolute';\n el.style.left = `${rescale(xScale, x)}px`;\n el.style.bottom = `${rescale(yScale, y)}px`;\n el.style.transform = `scale(${xScale}, ${yScale})`;\n // el.style.backgroundColor = field['rgba'] || getRGBA(roleIndex);\n};\n\nexport const getFieldId = (field: ITemplateField | IDocumentField) => {\n return `verdocs-doc-fld-${field.name}`;\n};\n\nexport const getFieldOptionId = (field: ITemplateField | IDocumentField, index: number) => {\n return `verdocs-doc-fld-${field.name}-${index}`;\n};\n\ninterface IFieldOptions {\n disabled?: boolean;\n editable?: boolean;\n draggable?: boolean;\n done?: boolean;\n}\n\nexport const renderDocumentField = (field: ITemplateField | IDocumentField, docPage: IDocumentPageInfo, roleIndex: number, fieldOptions: IFieldOptions) => {\n const {disabled = false, editable = false, draggable = false, done = false} = fieldOptions;\n const controlsDiv = document.getElementById(docPage.containerId + '-controls');\n if (!controlsDiv) {\n console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);\n return;\n }\n\n switch (field.type) {\n case 'attachment':\n case 'date':\n case 'dropdown':\n case 'initial':\n case 'payment':\n case 'signature':\n case 'timestamp':\n case 'textarea':\n case 'textbox': {\n const id = getFieldId(field);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const el: any = document.createElement(`verdocs-field-${field.type}`);\n el.field = field;\n el.setAttribute('id', id);\n el.setAttribute('roleIndex', roleIndex);\n\n if (disabled) {\n el.setAttribute('tabindex', -1);\n el.setAttribute('disabled', true);\n } else {\n el.setAttribute('tabIndex', 1);\n }\n\n if (editable) {\n el.setAttribute('editable', true);\n }\n\n if (draggable) {\n el.setAttribute('draggable', true);\n }\n\n if (done) {\n el.setAttribute('done', true);\n }\n\n setControlStyles(el, field, docPage.xScale, docPage.yScale);\n controlsDiv.appendChild(el);\n\n return el;\n }\n\n case 'checkbox_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, checkboxIndex) => {\n const id = getFieldOptionId(field, checkboxIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const cbEl: any = document.createElement(`verdocs-field-checkbox`);\n cbEl.field = field;\n cbEl.setAttribute('id', id);\n cbEl.setAttribute('roleIndex', roleIndex);\n cbEl.setAttribute('option', checkboxIndex);\n if (disabled) {\n cbEl.setAttribute('disabled', true);\n }\n if (done) {\n cbEl.setAttribute('done', true);\n }\n setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, checkboxIndex);\n controlsDiv.appendChild(cbEl);\n\n return cbEl;\n });\n\n case 'radio_button_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, buttonIndex) => {\n const id = getFieldOptionId(field, buttonIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const radioEl: any = document.createElement(`verdocs-field-radio-button`);\n radioEl.field = field;\n radioEl.setAttribute('id', id);\n radioEl.setAttribute('roleIndex', roleIndex);\n radioEl.setAttribute('option', buttonIndex);\n if (disabled) {\n radioEl.setAttribute('disabled', true);\n }\n if (done) {\n radioEl.setAttribute('done', true);\n }\n setControlStyles(radioEl, field, docPage.xScale, docPage.yScale, buttonIndex);\n controlsDiv.appendChild(radioEl);\n\n return radioEl;\n });\n\n // case 'attachment':\n // el = document.createElement('verdocs-field-attachment');\n // el.setAttribute('value', result || '');\n // break;\n // case 'payment':\n // el = document.createElement('verdocs-field-payment');\n // break;\n default:\n console.log('[PREVIEW] Skipping unsupported field type', field);\n return null;\n }\n};\n\nexport const getRoleIndex = (roles: string[], role: string) => roles.indexOf(role) || 0;\n\n// TODO: We can clean this up a lot if we alter the API to emit both setting and settings regardless of the source type,\n// but then merge the SDK types to encourage developers to use just `settings`.\nexport const getFieldSettings = (field: ITemplateField | IDocumentField) => {\n if ((field as ITemplateField).setting) {\n return (field as ITemplateField).setting;\n }\n\n if ((field as IDocumentField).settings) {\n return (field as IDocumentField).settings;\n }\n\n return {x: 0, y: 0, required: false, disabled: false, result: '', value: ''};\n};\n\n/**\n * Helper function to safely set/update components in a CSS transform attribute. Transform is normally set as a string of\n * `operation1(param) operation2(param) ...` components, which makes updating them a bit of a pain. This will remove the\n * specified component if it's already set and replace it with the new value, without touching the other components that\n * may already be set. Note that this operation moves the component to the end of the transform chain so it's not meant\n * to be used for order-sensitive components e.g. translate-then-rotate.\n */\nexport const updateCssTransform = (el: HTMLElement, key: string, value: string) => {\n // e.g. 'scale(1.87908, 1.87908) translate(0px, 0px);'\n const currentTransform = el.style.transform;\n // e.g. ['scale(1.87908, 1.87908)', 'scale', '1.87908, 1.87908', ...], [ 'translate(0px, 0px)', 'translate', '0px, 0px']]\n const components = [...currentTransform.matchAll(/(\\w+)\\(([^)]*)\\)/gi)];\n el.style.transform = [\n components //\n .filter(component => component[1] !== key) // Remove the entry if it's already set\n .map(component => component[0]), // Convert back the remaining entries\n `${key}(${value})`,\n ].join(' ');\n};\n\nexport const savePDF = async (endpoint: VerdocsEndpoint, envelope: IEnvelope, documentId: string) => {\n const fileName = `${envelope.name} - ${envelope.updated_at.split('T')[0]}.pdf`;\n const data = await Envelopes.getEnvelopeFile(endpoint, envelope.id, documentId);\n\n // This is better in React than doing window.href= or similar to trigger a download. For a description of the technique\n // see https://stackoverflow.com/questions/8126623/downloading-canvas-element-to-an-image\n let xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function () {\n let a = document.createElement('a');\n a.href = window.URL.createObjectURL(xhr.response);\n a.download = fileName;\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n a.remove();\n };\n\n xhr.open('GET', `data:application/pdf;base64,${data}`);\n xhr.send();\n};\n"]}
@@ -1,2 +0,0 @@
1
- import{r as e,c as m,h as a,H as r,a as b}from"./p-ff1278ed.js";const g="verdocs-document-page{width:100%;position:relative}verdocs-document-page .verdocs-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-document-page .verdocs-document-page-layer.img{max-width:100%}";const t=class{constructor(a){e(this,a);this.pageRendered=m(this,"pageRendered",7);this.pageImageUri="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true}componentDidLoad(){this.resizeObserver=new ResizeObserver((e=>{for(const m of e){const e=m.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}));this.resizeObserver.observe(this.container)}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}console.log("Notyfing new size");this.pageRendered.emit({container:this.container,containerId:this.containerId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,xScale:this.renderedWidth/this.naturalWidth,yScale:this.renderedHeight/this.naturalHeight})}render(){const e=`${this.renderedHeight}px`;return a(r,{id:`${this.containerId}`,style:{height:e}},this.layers.map((m=>m.type==="div"?a("div",{class:"verdocs-document-page-layer",id:`${this.containerId}-${m.name}`,style:{height:e}}):a("img",{class:"verdocs-document-page-layer img",id:`${this.containerId}-${m.name}`,src:this.pageImageUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight}}))))}get container(){return b(this)}};t.style=g;const s="verdocs-loader{display:block;position:absolute;top:50%;left:50%;margin-left:-20px;margin-top:-20px;font-size:24px;width:24px;height:24px;border-radius:50%;text-indent:-9999em;-webkit-animation:load5 1.1s infinite ease;animation:verdocs-loader-kf 1.1s infinite ease;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}@-webkit-keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}@keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}";const o=class{constructor(m){e(this,m)}render(){return a(r,null)}};o.style=s;export{t as verdocs_document_page,o as verdocs_loader};
2
- //# sourceMappingURL=p-2fe18d0b.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/elements/verdocs-document-page/verdocs-document-page.scss?tag=verdocs-document-page","src/components/elements/verdocs-document-page/verdocs-document-page.tsx","src/components/controls/verdocs-loader/verdocs-loader.scss?tag=verdocs-loader","src/components/controls/verdocs-loader/verdocs-loader.tsx"],"names":["verdocsDocumentPageCss","VerdocsDocumentPage","name","type","Math","random","toString","substring","this","virtualWidth","virtualHeight","[object Object]","resizeObserver","ResizeObserver","entries","entry","renderedWidth","contentRect","width","renderedHeight","notifyRenderedSize","observe","container","_a","disconnect","skipFirstNotification","console","log","pageRendered","emit","containerId","pageNumber","naturalWidth","naturalHeight","xScale","yScale","height","h","Host","id","style","layers","map","layer","class","src","pageImageUri","alt","aria-hidden","onLoad","e","target","aspectRatio","verdocsLoaderCss","VerdocsLoader"],"mappings":"gEAAA,MAAMA,EAAyB,iTCelBC,EAAmB,4FAOC,mBAMF,oBAME,uBAMC,gBAcD,CAAC,CAACC,KAAM,OAAQC,KAAM,4BAO9B,yBAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,yBAEvDC,KAAKC,iCACJD,KAAKE,gCACPF,KAAKC,gCACJD,KAAKE,+BACPF,KAAKC,aAAeD,KAAKE,yCAEvB,KAEjCC,mBACEH,KAAKI,eAAiB,IAAIC,gBAAeC,IACvC,IAAK,MAAMC,KAASD,EAAS,CAC3B,MAAME,EAAgBD,EAAME,YAAYC,MACxCV,KAAKQ,cAAgBA,EACrBR,KAAKW,eAAiBX,KAAKE,eAAiBM,EAAgBR,KAAKC,cAGnED,KAAKY,wBAGPZ,KAAKI,eAAeS,QAAQb,KAAKc,WAGnCX,8BACEY,EAAAf,KAAKI,kBAAc,MAAAW,SAAA,OAAA,EAAAA,EAAEC,aASvBb,qBAGE,GAAIH,KAAKiB,sBAAuB,CAC9BjB,KAAKiB,sBAAwB,MAC7B,OAGFC,QAAQC,IAAI,qBACZnB,KAAKoB,aAAaC,KAAK,CACrBP,UAAWd,KAAKc,UAChBQ,YAAatB,KAAKsB,YAClBC,WAAYvB,KAAKuB,WACjBtB,aAAcD,KAAKC,aACnBC,cAAeF,KAAKE,cACpBM,cAAeR,KAAKQ,cACpBG,eAAgBX,KAAKW,eACrBa,aAAcxB,KAAKwB,aACnBC,cAAezB,KAAKyB,cACpBC,OAAQ1B,KAAKQ,cAAgBR,KAAKwB,aAClCG,OAAQ3B,KAAKW,eAAiBX,KAAKyB,gBAIvCtB,SACE,MAAMyB,EAAS,GAAG5B,KAAKW,mBAEvB,OACEkB,EAACC,EAAI,CAACC,GAAI,GAAG/B,KAAKsB,cAAeU,MAAO,CAACJ,OAAAA,IACtC5B,KAAKiC,OAAOC,KAAIC,GACfA,EAAMxC,OAAS,MACbkC,EAAA,MAAA,CAAKO,MAAM,8BAA8BL,GAAI,GAAG/B,KAAKsB,eAAea,EAAMzC,OAAQsC,MAAO,CAACJ,OAAAA,KAE1FC,EAAA,MAAA,CACEO,MAAM,kCACNL,GAAI,GAAG/B,KAAKsB,eAAea,EAAMzC,OACjC2C,IAAKrC,KAAKsC,aACVC,IAAK,QAAQvC,KAAKuB,aAAYiB,cACjB,KACbC,OAASC,IACP1C,KAAKwB,aAAekB,EAAEC,OAAOnB,aAC7BxB,KAAKyB,cAAgBiB,EAAEC,OAAOlB,cAC9BzB,KAAK4C,YAAc5C,KAAKwB,aAAexB,KAAKyB,+DCzI5D,MAAMoB,EAAmB,kqUCUZC,EAAa,+BACxB3C,SACE,OAAO0B,EAACC,EAAI","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n max-width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-document-page',\n styleUrl: 'verdocs-document-page.scss',\n shadow: false,\n})\nexport class VerdocsDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The URL of the image to render as the page background.\n */\n @Prop() pageImageUri: string = '';\n\n /**\n * The page number being rendered. Not used internally, but included in callbacks/events beacuse page numbers\n * are used everywhere in document handling. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n\n @State() skipFirstNotification = true;\n\n componentDidLoad(): void {\n this.resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n });\n\n this.resizeObserver.observe(this.container);\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n // Left here for documentation purposes in case we find an edge case where this isn't true. But we apparently don't need this.\n // When we add the resize observer it will always be triggered at least once so notifying here as well is just a dupe.\n // componentDidRender() {\n // this.notifyRenderedSize();\n // }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n console.log('Notyfing new size');\n this.pageRendered.emit({\n container: this.container,\n containerId: this.containerId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n xScale: this.renderedWidth / this.naturalWidth,\n yScale: this.renderedHeight / this.naturalHeight,\n });\n }\n\n render() {\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : (\n <img\n class=\"verdocs-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageImageUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n onLoad={(e: any) => {\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n }}\n />\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-loader {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n text-indent: -9999em;\n -webkit-animation: load5 1.1s infinite ease;\n animation: verdocs-loader-kf 1.1s infinite ease;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n@keyframes verdocs-loader-kf {\n 0%,\n 100% {\n box-shadow: 0em -2.6em 0em 0em $verdocs-bg-2, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);\n }\n 12.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em $verdocs-bg-2, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);\n }\n 25% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em $verdocs-bg-2, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 37.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em $verdocs-bg-2,\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 50% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4),\n 0em 2.5em 0 0em $verdocs-bg-2, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 62.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em $verdocs-bg-2, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 75% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em $verdocs-bg-2, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 87.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em $verdocs-bg-2;\n }\n}\n","import {Component, h, Host} from '@stencil/core';\n\n/**\n * Animated loader placeholder. There are currently no configuration options for this control.\n */\n@Component({\n tag: 'verdocs-loader',\n styleUrl: 'verdocs-loader.scss',\n shadow: false,\n})\nexport class VerdocsLoader {\n render() {\n return <Host />;\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- System.register(["./p-97329951.system.js"],(function(e){"use strict";var m,a,r,b,t;return{setters:[function(e){m=e.r;a=e.c;r=e.h;b=e.H;t=e.a}],execute:function(){var g="verdocs-document-page{width:100%;position:relative}verdocs-document-page .verdocs-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-document-page .verdocs-document-page-layer.img{max-width:100%}";var i=e("verdocs_document_page",function(){function e(e){m(this,e);this.pageRendered=a(this,"pageRendered",7);this.pageImageUri="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true}e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver((function(m){for(var a=0,r=m;a<r.length;a++){var b=r[a];var t=b.contentRect.width;e.renderedWidth=t;e.renderedHeight=e.virtualHeight*(t/e.virtualWidth)}e.notifyRenderedSize()}));this.resizeObserver.observe(this.container)};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}console.log("Notyfing new size");this.pageRendered.emit({container:this.container,containerId:this.containerId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,xScale:this.renderedWidth/this.naturalWidth,yScale:this.renderedHeight/this.naturalHeight})};e.prototype.render=function(){var e=this;var m="".concat(this.renderedHeight,"px");return r(b,{id:"".concat(this.containerId),style:{height:m}},this.layers.map((function(a){return a.type==="div"?r("div",{class:"verdocs-document-page-layer",id:"".concat(e.containerId,"-").concat(a.name),style:{height:m}}):r("img",{class:"verdocs-document-page-layer img",id:"".concat(e.containerId,"-").concat(a.name),src:e.pageImageUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,onLoad:function(m){e.naturalWidth=m.target.naturalWidth;e.naturalHeight=m.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight}})})))};Object.defineProperty(e.prototype,"container",{get:function(){return t(this)},enumerable:false,configurable:true});return e}());i.style=g;var o="verdocs-loader{display:block;position:absolute;top:50%;left:50%;margin-left:-20px;margin-top:-20px;font-size:24px;width:24px;height:24px;border-radius:50%;text-indent:-9999em;-webkit-animation:load5 1.1s infinite ease;animation:verdocs-loader-kf 1.1s infinite ease;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}@-webkit-keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}@keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}";var n=e("verdocs_loader",function(){function e(e){m(this,e)}e.prototype.render=function(){return r(b,null)};return e}());n.style=o}}}));
2
- //# sourceMappingURL=p-40554b1a.system.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/elements/verdocs-document-page/verdocs-document-page.scss?tag=verdocs-document-page","src/components/elements/verdocs-document-page/verdocs-document-page.tsx","src/components/controls/verdocs-loader/verdocs-loader.scss?tag=verdocs-loader","src/components/controls/verdocs-loader/verdocs-loader.tsx"],"names":["verdocsDocumentPageCss","VerdocsDocumentPage","exports","name","type","concat","Math","random","toString","substring","this","virtualWidth","virtualHeight","class_1","prototype","componentDidLoad","_this","resizeObserver","ResizeObserver","entries","_i","entries_1","length","entry","renderedWidth","contentRect","width","renderedHeight","notifyRenderedSize","observe","container","disconnectedCallback","_a","disconnect","skipFirstNotification","console","log","pageRendered","emit","containerId","pageNumber","naturalWidth","naturalHeight","xScale","yScale","render","height","h","Host","id","style","layers","map","layer","class","src","pageImageUri","alt","aria-hidden","onLoad","e","target","aspectRatio","verdocsLoaderCss","VerdocsLoader","class_2"],"mapp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AAAN,KACE,IAAMoC,EAAS,GAAAzC,OAAGK,KAAKiB,eAAc,MAErC,OACEoB,EAACC,EAAI,CAACC,GAAI,GAAA5C,OAAGK,KAAK6B,aAAeW,MAAO,CAACJ,OAAMA,IAC5CpC,KAAKyC,OAAOC,KAAI,SAAAC,GACf,OAAAA,EAAMjD,OAAS,MACb2C,EAAA,MAAA,CAAKO,MAAM,8BAA8BL,GAAI,GAAA5C,OAAGW,EAAKuB,YAAW,KAAAlC,OAAIgD,EAAMlD,MAAQ+C,MAAO,CAACJ,OAAMA,KAEhGC,EAAA,MAAA,CACEO,MAAM,kCACNL,GAAI,GAAA5C,OAAGW,EAAKuB,YAAW,KAAAlC,OAAIgD,EAAMlD,MACjCoD,IAAKvC,EAAKwC,aACVC,IAAK,QAAApD,OAAQW,EAAKwB,YAAYkB,cACjB,KACbC,OAAQ,SAACC,GACP5C,EAAKyB,aAAemB,EAAEC,OAAOpB,aAC7BzB,EAAK0B,cAAgBkB,EAAEC,OAAOnB,cAC9B1B,EAAK8C,YAAc9C,EAAKyB,aAAezB,EAAK0B,kJA1H5B,cCfhC,IAAMqB,EAAmB,gqUCUZC,EAAa9D,EAAA,iBAAA,mCACxB+D,EAAAnD,UAAA+B,OAAA,WACE,OAAOE,EAACC,EAAI,gBAFU","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n max-width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-document-page',\n styleUrl: 'verdocs-document-page.scss',\n shadow: false,\n})\nexport class VerdocsDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The URL of the image to render as the page background.\n */\n @Prop() pageImageUri: string = '';\n\n /**\n * The page number being rendered. Not used internally, but included in callbacks/events beacuse page numbers\n * are used everywhere in document handling. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n\n @State() skipFirstNotification = true;\n\n componentDidLoad(): void {\n this.resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n });\n\n this.resizeObserver.observe(this.container);\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n // Left here for documentation purposes in case we find an edge case where this isn't true. But we apparently don't need this.\n // When we add the resize observer it will always be triggered at least once so notifying here as well is just a dupe.\n // componentDidRender() {\n // this.notifyRenderedSize();\n // }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n console.log('Notyfing new size');\n this.pageRendered.emit({\n container: this.container,\n containerId: this.containerId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n xScale: this.renderedWidth / this.naturalWidth,\n yScale: this.renderedHeight / this.naturalHeight,\n });\n }\n\n render() {\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : (\n <img\n class=\"verdocs-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageImageUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n onLoad={(e: any) => {\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n }}\n />\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-loader {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n text-indent: -9999em;\n -webkit-animation: load5 1.1s infinite ease;\n animation: verdocs-loader-kf 1.1s infinite ease;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n@keyframes verdocs-loader-kf {\n 0%,\n 100% {\n box-shadow: 0em -2.6em 0em 0em $verdocs-bg-2, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);\n }\n 12.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em $verdocs-bg-2, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);\n }\n 25% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em $verdocs-bg-2, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 37.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em $verdocs-bg-2,\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 50% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4),\n 0em 2.5em 0 0em $verdocs-bg-2, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 62.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em $verdocs-bg-2, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 75% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em $verdocs-bg-2, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 87.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em $verdocs-bg-2;\n }\n}\n","import {Component, h, Host} from '@stencil/core';\n\n/**\n * Animated loader placeholder. There are currently no configuration options for this control.\n */\n@Component({\n tag: 'verdocs-loader',\n styleUrl: 'verdocs-loader.scss',\n shadow: false,\n})\nexport class VerdocsLoader {\n render() {\n return <Host />;\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- import{r as e,c as i,h as s,H as o}from"./p-ff1278ed.js";import{g as t}from"./p-c2cc4492.js";import"./p-8efc9749.js";import{i as l,a as n}from"./p-e662f81b.js";import{g as d}from"./p-6de76553.js";import{V as a}from"./p-1f1127dd.js";import{a as c}from"./p-80e95049.js";import"./p-21603661.js";const r='verdocs-send{display:-ms-flexbox;display:flex;padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid #97979744}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:#00000089}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';const p='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';const x='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';const h='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';const v='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';const f=class{constructor(s){e(this,s);this.send=i(this,"send",7);this.cancel=i(this,"cancel",7);this.sdkError=i(this,"sdkError",7);this.levels=[];this.endpoint=a.getDefault();this.templateId=null;this.template=null;this.pdfUrl=null;this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`;this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.recipientsAssigned={}}async componentWillLoad(){var e;this.sessionContacts=[];try{const i=await this.endpoint.loadSession();if((e=i.session)===null||e===void 0?void 0:e.profile){this.sessionContacts.push({id:i.session.profile.id,name:`${i.session.profile.first_name} ${i.session.profile.last_name}`,email:i.session.profile.email,phone:i.session.profile.phone})}}catch(e){console.log("Error loading session",e)}}async componentDidLoad(){console.log("[SEND] Showing template",this.templateId);try{console.log(`[SEND] Loading template ${this.templateId}`);const e=await t(this.endpoint,this.templateId);console.log("[SEND] Got template",e);this.template=e;if(e===null||e===void 0?void 0:e.roles){const i={};e.roles.forEach((e=>{const s=e.sequence-1;i[s]||(i[s]=[]);const o=`r-${s}-${i[s].length}`;i[s].push({...e,id:o})}));this.rolesAtLevel=i;this.levels=Object.keys(i).map((e=>+e));this.levels.sort(((e,i)=>e-i))}}catch(e){console.log("[SEND] Error getting template",e)}}getLevelIcon(e){if(e<0){return s("div",{class:"level-icon",innerHTML:x})}else if(e>=this.levels.length){return s("div",{class:"level-icon",innerHTML:v})}else{return s("div",{class:"level-icon",innerHTML:h})}}handleSelectContact(e,i){e.preventDefault();this.recipientsAssigned[i.id]={...i,...e.detail};this.showPickerForId=""}handleClickRole(e,i){e.stopPropagation();this.showPickerForId=i.id}handleSend(e){var i;e.stopPropagation();(i=this.send)===null||i===void 0?void 0:i.emit({recipientsAssigned:Object.values(this.recipientsAssigned)})}handleCancel(e){var i;e.stopPropagation();(i=this.cancel)===null||i===void 0?void 0:i.emit()}render(){var e,i,t;const a=((i=(e=this.template)===null||e===void 0?void 0:e.roles)===null||i===void 0?void 0:i.map((e=>e.name)))||[];const r=Object.values(this.recipientsAssigned).filter((e=>{console.log("valid email",l(e.email),e.email);console.log("valid phone",n(e.phone),e.phone);return l(e.email)||n(e.phone)})).length>=((t=this.template)===null||t===void 0?void 0:t.roles.length);console.log("assigned",r);return s(o,{class:{}},s("div",{class:"recipients"},s("div",{class:"left-line"}),s("div",{class:`level level-start`},this.getLevelIcon(-1),s("div",{class:"complete"},"Send Document")),this.levels.map((e=>s("div",{class:`level level-${e}`},this.getLevelIcon(e),this.rolesAtLevel[e].map((e=>{var i,o,t;return s("div",{class:"recipient",style:{backgroundColor:d(c(a,e.name))},onClick:i=>this.handleClickRole(i,e)},(o=(i=this.recipientsAssigned[e.id])===null||i===void 0?void 0:i.full_name)!==null&&o!==void 0?o:e.name,s("div",{class:"icon",innerHTML:p}),this.showPickerForId===e.id&&s("verdocs-contact-picker",{onCancel:()=>this.showPickerForId="",onNext:i=>this.handleSelectContact(i,e),contactSuggestions:this.sessionContacts,templateRole:(t=this.recipientsAssigned[e.id])!==null&&t!==void 0?t:e,onSearchContacts:e=>console.log("Search",e.detail)}))}))))),s("div",{class:`level level-done`},this.getLevelIcon(this.levels.length),s("div",{class:"complete"},"Document Complete"))),s("div",{class:"buttons"},s("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e)}),s("verdocs-button",{label:"Send",size:"small",disabled:!r,onClick:e=>this.handleSend(e)})))}};f.style=r;export{f as verdocs_send};
2
- //# sourceMappingURL=p-6787c11e.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["node_modules/@verdocs/js-sdk/Envelopes/Recipients.js","node_modules/@verdocs/js-sdk/Envelopes/Signatures.js","node_modules/@verdocs/js-sdk/Envelopes/Initials.js","src/components/embeds/verdocs-sign/verdocs-sign.scss?tag=verdocs-sign","src/components/embeds/verdocs-sign/verdocs-sign.tsx"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","updateRecipient","endpoint","envelopeId","roleName","params","_a","api","put","concat","r","data","envelopeRecipientSubmit","action","envelopeRecipientDecline","envelopeRecipientAgree","agreed","createSignature","name","signature","FormData","append","post","createInitials","initials","verdocsSignCss","PrintIcon","DownloadIcon","VerdocsSign","recipientIndex","fields","[object Object]","VerdocsEndpoint","sessionType","sdkError","emit","SDKError","roleId","_b","inviteCode","_c","console","log","session","recipient","signerToken","Envelopes.getSigningSession","email","profile_id","setToken","nextButtonLabel","getEnvelopeById","EnvelopeStore","envelope","recipients","findIndex","role_name","isDone","includes","status","_d","envelopeLoaded","_e","message","_f","response","_g","envelopeUpdated","event","catch","detail","id","finishLater","showFinishLater","declineResult","window","print","savePDF","envelope_document_id","fieldName","Envelopes.updateEnvelopeField","error","errorMessage","field","target","checked","type","saveFieldChange","prepared","options","settings","map","option","selected","initialsBlob","fetch","blob","newInitials","updateEnvelopeFieldInitials","signatureBlob","newSignature","updateEnvelopeFieldSignature","iso","getAttribute","ts","required","base64","validator","isValidEmail","isValidPhone","checkedCount","filter","minimum_checked","maximum_checked","nextSubmits","showDone","requiredFields","focusedIndex","focusedField","nextFocusedIndex","nextRequiredField","skips","getFieldId","el","document","getElementById","focusField","someFieldsInvalid","isFieldValid","some","fieldValid","pageInfo","roleIndex","addEventListener","handleFieldChange","finally","checkRecipientFields","setAttribute","xScale","yScale","fullNameToInitials","full_name","getRoleIndex","roleNames","recipientFields","page","pageNumber","forEach","renderDocumentField","disabled","editable","draggable","Array","isArray","attachFieldAttributes","otherRecipient","otherRoleIndex","loading","h","Host","menuOptions","class","onOptionSelected","handleOptionSelected","onInput","handleClickAgree","Fragment","src","alt","style","flex","innerHTML","width","height","fill","cursor","onClick","marginLeft","maginRight","size","handleNext","display","documents","envelopeDocument","pages","sort","a","b","sequence","pageImageUri","display_uri","virtualWidth","virtualHeight","onPageRendered","handlePageRendered","layers","heading","onNext"],"mappings":"6XAAA,IAAIA,EAAaC,WAAQA,UAAKD,WAAc,SAAUE,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,MAC/F,OAAO,IAAKH,IAAMA,EAAIK,WAAU,SAAUD,EAASE,GAC/C,SAASC,EAAUJ,GAAS,IAAMK,EAAKP,EAAUQ,KAAKN,IAAW,MAAOO,GAAKJ,EAAOI,IACpF,SAASC,EAASR,GAAS,IAAMK,EAAKP,EAAU,SAASE,IAAW,MAAOO,GAAKJ,EAAOI,IACvF,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOT,OAASD,EAAMU,EAAOT,OAAOW,KAAKP,EAAWI,GAClGH,GAAMP,EAAYA,EAAUc,MAAMjB,EAASC,GAAc,KAAKU,YAGtE,IAAIO,EAAenB,WAAQA,UAAKmB,aAAgB,SAAUlB,EAASmB,GAC/D,IAAIC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAIC,EAAE,GAAK,EAAG,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOC,KAAM,GAAIC,IAAK,IAAMC,EAAGC,EAAGJ,EAAGK,EAC/G,OAAOA,EAAI,CAAEjB,KAAMkB,EAAK,GAAIC,MAASD,EAAK,GAAIE,OAAUF,EAAK,WAAaG,SAAW,aAAeJ,EAAEI,OAAOC,UAAY,WAAa,OAAOlC,OAAU6B,EACvJ,SAASC,EAAKK,GAAK,OAAO,SAAUC,GAAK,OAAOzB,EAAK,CAACwB,EAAGC,KACzD,SAASzB,EAAK0B,GACV,GAAIV,EAAG,MAAM,IAAIW,UAAU,mCAC3B,MAAOjB,MACH,GAAI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KACNkB,EAAM7F,KAAIsD,GACTa,EAAA,wBAAA,CACE+B,aAAc5C,EAAK6C,YACnBC,aAAc,IACdC,cAAe,IACf9C,WAAYD,EAAK2C,SACjBK,eAAgB9N,GAAKb,KAAK4O,mBAAmB/N,GAC7CgO,OAAQ,CACN,CAACjL,KAAM,OAAQoE,KAAM,UACrB,CAACpE,KAAM,WAAYoE,KAAM,iBAStChI,KAAKmH,iBACJqF,EAAA,oBAAA,CACEsC,QAAQ,8CACRrI,QAAQ,4HACRsI,OAAQ,IAAO/O,KAAKmH,gBAAkB,QAIzCnH,KAAK4H,cAAgB4E,EAAA,oBAAA,CAAmBsC,QAAQ,gBAAgBrI,QAASzG,KAAK4H,aAAcmH,OAAQ,IAAO/O,KAAK4H,aAAe,KAC/H5H,KAAK6J,UACJ2C,EAAA,oBAAA,CACEsC,QAAQ,eACRrI,QAAQ,wOACRsI,OAAQ,IAAO/O,KAAK6J,SAAW","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n/**\n * Update a recipient's status block\n */\nexport var updateRecipient = function (endpoint, envelopeId, roleName, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(roleName), params)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Submit an envelope (signing is finished). Note that all fields must be valid/completed for this to succeed.\n */\nexport var envelopeRecipientSubmit = function (endpoint, envelopeId, roleName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'submit' });\n};\n/**\n * Decline to complete an envelope (signing will not terminated).\n */\nexport var envelopeRecipientDecline = function (endpoint, envelopeId, roleName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'decline' });\n};\n/**\n * Claim / change ownership of an envelope. This is a special-case operation only available in certain workflows.\n */\nexport var envelopeRecipientChangeOwner = function (endpoint, envelopeId, roleName, email, fullName) { return updateRecipient(endpoint, envelopeId, roleName, { action: 'owner_update', email: email, full_name: fullName }); };\n/**\n * Agree to electronic signing.\n */\nexport var envelopeRecipientAgree = function (endpoint, envelopeId, roleName, agreed) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', agreed: agreed });\n};\n/**\n * Change a recipient's name.\n */\nexport var envelopeRecipientUpdateName = function (endpoint, envelopeId, roleName, fullName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', new_full_name: fullName });\n};\n/**\n * Change a recipient's name.\n */\nexport var envelopeRecipientPrepare = function (endpoint, envelopeId, roleName, recipients) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'prepare', recipients: recipients });\n};\nexport var getSignerToken = function (endpoint, envelopeId, roleName) {\n return endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(encodeURIComponent(roleName), \"/signer-token\"))\n .then(function (r) { return r.data; });\n};\nexport var getInPersonLink = function (endpoint, envelopeId, roleName) {\n return endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(encodeURIComponent(roleName), \"?in_person_link=true\"))\n .then(function (r) { return r.data; });\n};\n","/**\n * Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * a signature block to be used for all signature fields in the document. Thus, this is typically called one time to\n * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field\n * to be \"stamped\" by the user.\n */\nexport var createSignature = function (endpoint, name, signature) {\n var data = new FormData();\n data.append('signature', signature, name);\n return endpoint.api //\n .post(\"/signatures\", data)\n .then(function (r) { return r.data; });\n};\n/**\n * Get the availbable signatures for a user.\n */\nexport var getSignatures = function (endpoint) {\n return endpoint.api //\n .get('/signatures')\n .then(function (r) { return r.data; });\n};\n/**\n * Get a user's signature by ID.\n */\nexport var getSignature = function (endpoint, signatureId) {\n return endpoint.api //\n .get(\"/signatures/\".concat(signatureId))\n .then(function (r) { return r.data; });\n};\n/**\n * Delete a user's signature.\n */\nexport var deleteSignature = function (endpoint, signatureId) {\n return endpoint.api //\n .delete(\"/signatures/\".concat(signatureId))\n .then(function (r) { return r.data; });\n};\n","/**\n * Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * an initials block to be used for all initials fields in the document. Thus, this is typically called one time to\n * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field\n * to be \"stamped\" by the user.\n */\nexport var createInitials = function (endpoint, name, initials) {\n var data = new FormData();\n data.append('initial', initials, name);\n return endpoint.api //\n .post(\"/initials\", data)\n .then(function (r) { return r.data; });\n};\n","@import '../../../theme.scss';\n\nverdocs-sign {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div {\n display: block;\n box-sizing: border-box;\n }\n\n input {\n vertical-align: top;\n }\n\n .header {\n flex: 0;\n display: flex;\n z-index: 1000;\n align-items: center;\n transition: all 0.25s;\n justify-content: center;\n background-color: $medium-bg;\n box-shadow: 0 4px 4px 0 rgb(0 0 0 / 24%), 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .intro {\n width: 100%;\n height: 60px;\n display: flex;\n background: #ffffff;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n\n .inner {\n width: 100%;\n color: #111111;\n padding: 0 14px;\n font-size: 20px;\n font-weight: 500;\n line-height: 28px;\n max-width: 1024px;\n }\n }\n\n &.agreed {\n .intro {\n //display: none;\n }\n }\n\n .toolbar {\n width: 100%;\n margin: 0 auto;\n padding: 0 14px;\n position: relative;\n }\n\n .tools {\n width: 100%;\n color: #fff;\n height: 56px;\n display: flex;\n font-size: 12px;\n align-items: center;\n flex-direction: row;\n background-color: $medium-bg;\n\n .logo {\n width: 77.5px;\n margin: -6px 0 0 5px;\n }\n\n .title {\n padding-left: 16px;\n font-size: 18px;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n\n .cover {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 999;\n position: absolute;\n background: rgba(0, 0, 0, 0.5);\n }\n\n .document {\n flex: 1;\n height: 100%;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .agree {\n flex: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 15px;\n\n .intro {\n display: none;\n }\n\n .header {\n flex: 0 0 56px;\n }\n }\n}\n\n@media print {\n verdocs-sign .header {\n display: none;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {createInitials} from '@verdocs/js-sdk/Envelopes/Initials';\nimport {createSignature} from '@verdocs/js-sdk/Envelopes/Signatures';\nimport {IDocumentField, IEnvelope, IRecipient} from '@verdocs/js-sdk/Envelopes/Types';\nimport {envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit} from '@verdocs/js-sdk/Envelopes/Recipients';\nimport {isValidEmail, isValidPhone} from '@verdocs/js-sdk/Templates/Validators';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {updateEnvelopeFieldInitials, updateEnvelopeFieldSignature} from '@verdocs/js-sdk/Envelopes/Envelopes';\nimport {fullNameToInitials, getFieldId, getRoleIndex, renderDocumentField, savePDF} from '../../../utils/utils';\nimport {getEnvelopeById} from '../../../utils/Envelopes';\nimport EnvelopeStore from '../../../utils/envelopeStore';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\n\nconst PrintIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"></path></svg>`;\n\nconst DownloadIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"></path></svg>`;\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n endpoint: VerdocsEndpoint = null;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop() envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop() roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop() inviteCode: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n @State() recipient: IRecipient | null = null;\n @State() signerToken = null;\n // @State() envelope: IEnvelope | null = null;\n // @State() fields: IDocumentField[] = [];\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() errorMessage = '';\n @State() focusedField = '';\n @State() isDone = false;\n @State() showDone = false;\n\n @State() finishLater = false;\n @State() showFinishLater = false;\n\n recipientIndex: number = -1;\n fields: IDocumentField[] = [];\n\n componentWillLoad() {\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n const {session, recipient, signerToken} = await Envelopes.getSigningSession(this.endpoint, {\n envelopeId: this.envelopeId,\n roleId: this.roleId,\n inviteCode: this.inviteCode,\n });\n\n console.log(`[SIGN] Loaded signing session ${session.email} / ${session.profile_id}`);\n\n this.recipient = recipient;\n this.signerToken = signerToken;\n this.endpoint.setToken(signerToken);\n\n if (this.recipient.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n await getEnvelopeById(this.endpoint, this.envelopeId);\n // const envelope = await Envelopes.getEnvelope(this.endpoint, this.envelopeId);\n // this.envelope = envelope;\n // console.log('[SIGN] Loaded envelope', envelope);\n\n this.recipientIndex = EnvelopeStore.envelope.recipients.findIndex(recipient => recipient.role_name == this.roleId);\n if (this.recipientIndex > -1) {\n this.recipient = EnvelopeStore.envelope.recipients[this.recipientIndex];\n this.fields = this.recipient.fields;\n }\n\n this.isDone = ['submitted', 'canceled', 'declined'].includes(this.recipient.status);\n console.log('Done', this.isDone);\n\n // TODO: Fix service to allow this?\n // const sigs = await getSignatures();\n // console.log('sigs', sigs);\n\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope});\n } catch (e) {\n console.log('Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleClickAgree() {\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(r => {\n this.nextButtonLabel = 'Next';\n this.recipient = r;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('Update failure', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n // this.router.navigate([`view/sign/${this.envelopeId}/role/${this.roleName}/saved`]);\n // if (!window?.['STORYBOOK_ENV']) {\n // window.alert('User intends to sign later.');\n // }\n break;\n case 'claim':\n break;\n case 'decline':\n {\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('Decline result', declineResult);\n this.isDone = true;\n }\n break;\n case 'print':\n window.print();\n break;\n case 'download':\n savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {});\n break;\n }\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n Envelopes.updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n // TODO: Do we want to improve the instructions here?\n console.log('[SIGN] Signing session expired');\n this.errorMessage = 'Signing session expired.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IDocumentField, e: any) {\n console.log('fieldChange', field, e, e.target.value);\n const {value, checked} = e.target;\n\n switch (field.type) {\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox_group': {\n const options = field.settings.options.map(option => ({id: option.id, checked: e.target.checked}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'radio_button_group': {\n const options = field.settings.options.map(option => ({id: option.id, selected: e.target.value === option.id}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'dropdown':\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(newInitials => {\n console.log('New initials', field.name, newInitials);\n updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n });\n\n case 'signature':\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(newSignature => {\n console.log('New sign', field.name, newSignature);\n updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n });\n\n case 'date':\n const iso = e.target.getAttribute('iso');\n return this.saveFieldChange(field.name, {prepared: false, value: iso});\n\n case 'timestamp':\n console.log('Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldValid(field: IDocumentField) {\n const {required = false} = field;\n const {result = '', value = '', base64 = ''} = field.settings || {};\n switch (field.type) {\n case 'textbox':\n switch (field.settings?.validator || '') {\n case 'email':\n return isValidEmail(result);\n case 'phone':\n return isValidPhone(result);\n default:\n return !required || result !== '';\n }\n\n case 'signature':\n case 'initial':\n return !required || base64 !== '';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'textarea':\n case 'date':\n case 'attachment':\n return !required || result !== '';\n\n case 'dropdown':\n return !required || value !== '';\n\n case 'checkbox_group':\n const checkedCount = (field.settings?.options?.filter(option => option.checked) || []).length;\n return !required || (checkedCount >= (field.settings?.minimum_checked || 0) && checkedCount <= (field.settings?.maximum_checked || 999));\n\n case 'radio_button_group':\n return !required || (field.settings?.options?.filter(option => option.selected) || []).length > 0;\n // TODO\n // case 'checkbox':\n // return <verdocs-field-checkbox style={style} value={result || ''} id={id} />;\n // case 'payment':\n // return <verdocs-field-payment style={style} field={field} id={id} />;\n default:\n return false;\n }\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.showDone = true;\n this.isDone = true;\n // updateRecipientStatus()\n } catch (e) {\n console.log('Error submitting', e);\n }\n return;\n // You're done.\n // You can access the Verdoc at any time by clicking on the link from invitation email.\n //\n // After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.\n //\n // Thank you for using Verdocs.\n // Got it, thanks\n }\n\n // Find and focus the next incomplete required field\n const requiredFields = this.fields.filter(field => field.required);\n const focusedIndex = requiredFields.findIndex(field => field.name === this.focusedField);\n\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = requiredFields[nextFocusedIndex];\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < requiredFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && nextRequiredField.settings?.result === 'signed') {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = requiredFields[nextFocusedIndex];\n }\n\n if (skips >= requiredFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const someFieldsInvalid = this.recipient.fields.map(field => this.isFieldValid(field)).some(fieldValid => !fieldValid);\n console.log({someFieldsInvalid});\n if (!someFieldsInvalid) {\n this.nextButtonLabel = 'Finish';\n this.nextSubmits = true;\n } else {\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, roleIndex, el) {\n el.addEventListener('input', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n el.addEventListener('fieldChange', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n\n el.setAttribute('roleindex', roleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n el.setAttribute('initials', this.recipient ? fullNameToInitials(this.recipient.full_name) : '');\n el.setAttribute('name', this.recipient?.full_name || '');\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n const roleIndex = getRoleIndex(EnvelopeStore.roleNames, this.recipient.role_name);\n const recipientFields = this.recipient.fields.filter(field => field.page === pageInfo.pageNumber);\n console.log('[SIGN] Page rendered, adding fields', {pageInfo, roleIndex, recipientFields});\n\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, roleIndex, {disabled: false, editable: false, draggable: false, done: this.isDone});\n console.log('rendered', el);\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, roleIndex, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, roleIndex, el);\n }\n\n // interact(el).draggable({\n // listeners: {\n // start(event) {\n // console.log('[FIELDS] Drag started', event.type, event.target);\n // },\n // move(event) {\n // const oldX = +(event.target.getAttribute('posX') || 0);\n // const oldY = +(event.target.getAttribute('posY') || 0);\n // const xScale = +(event.target.getAttribute('xScale') || 1);\n // const yScale = +(event.target.getAttribute('yScale') || 1);\n // const newX = event.dx / xScale + oldX;\n // const newY = event.dy / yScale + oldY;\n // event.target.setAttribute('posX', newX);\n // event.target.setAttribute('posy', newY);\n // updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n // },\n // end(event) {\n // console.log('[FIELDS] Drag ended', event);\n // // event.target.setAttribute('posX', 0);\n // // event.target.setAttribute('posy', 0);\n // // updateCssTransform(event.target, 'translate', `${0}px, ${0}px`);\n // },\n // },\n // });\n });\n\n // Render fields for \"the other\" recipients\n EnvelopeStore.envelope.recipients\n .filter(recipient => recipient.role_name !== this.recipient.role_name)\n .map(otherRecipient => {\n const otherRoleIndex = getRoleIndex(EnvelopeStore.roleNames, otherRecipient.role_name);\n const recipientFields = otherRecipient.fields.filter(field => field.page === pageInfo.pageNumber);\n // const fields = this.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, otherRoleIndex, {disabled: true, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n el.setAttribute('roleindex', otherRoleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n });\n });\n\n this.checkRecipientFields();\n }\n\n render() {\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n const menuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing', disabled: true},\n {id: 'download', label: 'Download'},\n ];\n\n return (\n <Host class={{agreed: this.recipient?.agreed}}>\n {!this.isDone && !this.finishLater && (\n <div class=\"intro\">\n <div class=\"inner\">Please review and act on these documents.</div>\n </div>\n )}\n\n <div class=\"header\">\n <div class=\"inner\">\n <div class=\"toolbar\">\n <div class=\"tools\">\n {!this.isDone && !this.finishLater && <verdocs-dropdown options={menuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />}\n\n {!this.recipient?.agreed ? (\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"I agree to use electronic records and signatures.\" onInput={() => this.handleClickAgree()} />\n </div>\n ) : (\n <Fragment>\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{EnvelopeStore.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div innerHTML={PrintIcon} style={{width: '24px', height: '24px', fill: '#ffffff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#ffffff', cursor: 'pointer', marginLeft: '16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n )}\n\n {!this.isDone && !this.finishLater && (\n <verdocs-button size=\"small\" label={this.nextButtonLabel} disabled={!this.recipient?.agreed} onClick={() => this.handleNext()} />\n )}\n </div>\n </div>\n </div>\n </div>\n\n {!this.isDone && !this.recipient?.agreed ? <div class=\"cover\" /> : <div style={{display: 'none'}} />}\n\n <div class=\"document\">\n {(EnvelopeStore.envelope.documents || []).map(envelopeDocument => {\n const pages = [...(envelopeDocument?.pages || [])];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Fragment>\n {pages.map(page => (\n <verdocs-document-page\n pageImageUri={page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n ))}\n </Fragment>\n );\n })}\n </div>\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message=\"To complete the document, use the link in the original email notification inviting you to review and finish the document.\"\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.errorMessage && <verdocs-ok-dialog heading=\"Network Error\" message={this.errorMessage} onNext={() => (this.errorMessage = '')} />}\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message=\"You can access the Verdoc at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.\"\n onNext={() => (this.showDone = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- import{d as n}from"./p-21603661.js";var e=undefined&&undefined.__awaiter||function(n,e,t,r){function o(n){return n instanceof t?n:new t((function(e){e(n)}))}return new(t||(t=Promise))((function(t,i){function u(n){try{s(r.next(n))}catch(n){i(n)}}function c(n){try{s(r["throw"](n))}catch(n){i(n)}}function s(n){n.done?t(n.value):o(n.value).then(u,c)}s((r=r.apply(n,e||[])).next())}))};var t=undefined&&undefined.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(n){return function(e){return s([n,e])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(t)try{if(r=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;o=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){t.label=u[1];break}if(u[0]===6&&t.label<i[1]){t.label=i[1];i=u;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(u);break}if(i[2])t.ops.pop();t.trys.pop();continue}u=e.call(n,t)}catch(n){u=[6,n];o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var r=function(r,o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,r.api.get("/envelopes/".concat(o.envelopeId,"/recipients/").concat(encodeURIComponent(o.roleId),"/invitation/").concat(o.inviteCode)).then((function(e){var t;var o=((t=e.headers)===null||t===void 0?void 0:t.signer_token)||"";var i=n(o);r.setToken(o);return{recipient:e.data,session:i,signerToken:o}}))]}))}))};var o=function(n,r,o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,n.api.get("/envelopes/".concat(r)+(o?"?ssr=true":"")).then((function(n){return n.data}))]}))}))};var i=function(n,r,o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,n.api.get("/envelopes/".concat(r,"/envelope_documents/").concat(o,"?file=true"),{responseType:"arraybuffer"}).then((function(n){return Buffer.from(n.data,"binary").toString("base64")}))]}))}))};var u=function(n,r,o,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,n.api.put("/envelopes/".concat(r,"/fields/").concat(o),i).then((function(n){return n.data}))]}))}))};var c=function(n,r,o,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,n.api.put("/envelopes/".concat(r,"/fields/").concat(o,"/signature/").concat(i)).then((function(n){return n.data}))]}))}))};var s=function(n,r,o,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,n.api.put("/envelopes/".concat(r,"/fields/").concat(o,"/initial/").concat(i)).then((function(n){return n.data}))]}))}))};function a(n,e){return n*e}const d=(n,e)=>Array(e).fill(1).map(((e,t)=>t+n));const f=n=>n.split(" ").map((n=>n[0])).join("");const l=n=>{switch(n.type){case"attachment":case"payment":return 24;case"checkbox":case"checkbox_group":case"radio_button_group":return 14;case"signature":case"initial":return 82}return 150};const v=n=>{switch(n.type){case"attachment":case"payment":return 24;case"checkbox":case"checkbox_group":case"radio_button_group":return 14;case"signature":case"initial":return 41}return 50};const p=(n,e,t,r,o)=>{var i,u,c,s;const d=e.setting||e.settings;let{x:f=0,y:p=0,width:b=l(e),height:h=v(e)}=d;const m=o!==undefined&&d.options[o]?d.options[o]:null;if(m){f=(i=m.x)!==null&&i!==void 0?i:f;p=(u=m.y)!==null&&u!==void 0?u:p;b=(c=m.width)!==null&&c!==void 0?c:b;h=(s=m.height)!==null&&s!==void 0?s:h}n.style.width=`${b}px`;n.style.height=`${h}px`;n.style.position="absolute";n.style.left=`${a(t,f)}px`;n.style.bottom=`${a(r,p)}px`;n.style.transform=`scale(${t}, ${r})`};const b=n=>`verdocs-doc-fld-${n.name}`;const h=(n,e)=>`verdocs-doc-fld-${n.name}-${e}`;const m=(n,e,t,r)=>{const{disabled:o=false,editable:i=false,draggable:u=false,done:c=false}=r;const s=document.getElementById(e.containerId+"-controls");if(!s){console.log("[renderDocumentField] No controls DIV found",e.containerId+"-controls",e);return}switch(n.type){case"attachment":case"date":case"dropdown":case"initial":case"payment":case"signature":case"timestamp":case"textarea":case"textbox":{const r=b(n);const a=document.getElementById(r);if(a){p(a,n,e.xScale,e.yScale);return a}const d=document.createElement(`verdocs-field-${n.type}`);d.field=n;d.setAttribute("id",r);d.setAttribute("roleIndex",t);if(o){d.setAttribute("tabindex",-1);d.setAttribute("disabled",true)}else{d.setAttribute("tabIndex",1)}if(i){d.setAttribute("editable",true)}if(u){d.setAttribute("draggable",true)}if(c){d.setAttribute("done",true)}p(d,n,e.xScale,e.yScale);s.appendChild(d);return d}case"checkbox_group":return(n.settings||n.setting||{}).options.map(((r,i)=>{const u=h(n,i);const a=document.getElementById(u);if(a){p(a,n,e.xScale,e.yScale);return a}const d=document.createElement(`verdocs-field-checkbox`);d.field=n;d.setAttribute("id",u);d.setAttribute("roleIndex",t);d.setAttribute("option",i);if(o){d.setAttribute("disabled",true)}if(c){d.setAttribute("done",true)}p(d,n,e.xScale,e.yScale,i);s.appendChild(d);return d}));case"radio_button_group":return(n.settings||n.setting||{}).options.map(((r,i)=>{const u=h(n,i);const a=document.getElementById(u);if(a){p(a,n,e.xScale,e.yScale);return a}const d=document.createElement(`verdocs-field-radio-button`);d.field=n;d.setAttribute("id",u);d.setAttribute("roleIndex",t);d.setAttribute("option",i);if(o){d.setAttribute("disabled",true)}if(c){d.setAttribute("done",true)}p(d,n,e.xScale,e.yScale,i);s.appendChild(d);return d}));default:console.log("[PREVIEW] Skipping unsupported field type",n);return null}};const x=(n,e)=>n.indexOf(e)||0;const y=n=>{if(n.setting){return n.setting}if(n.settings){return n.settings}return{x:0,y:0,required:false,disabled:false,result:"",value:""}};const g=(n,e,t)=>{const r=n.style.transform;const o=[...r.matchAll(/(\w+)\(([^)]*)\)/gi)];n.style.transform=[o.filter((n=>n[1]!==e)).map((n=>n[0])),`${e}(${t})`].join(" ")};const w=async(n,e,t)=>{const r=`${e.name} - ${e.updated_at.split("T")[0]}.pdf`;const o=await i(n,e.id,t);let u=new XMLHttpRequest;u.responseType="blob";u.onload=function(){let n=document.createElement("a");n.href=window.URL.createObjectURL(u.response);n.download=r;n.style.display="none";document.body.appendChild(n);n.click();n.remove()};u.open("GET",`data:application/pdf;base64,${o}`);u.send()};export{x as a,r as b,c,s as d,b as e,f,y as g,o as h,d as i,g as j,m as r,w as s,u};
2
- //# sourceMappingURL=p-80e95049.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["node_modules/@verdocs/js-sdk/Envelopes/Envelopes.js","node_modules/@verdocs/js-sdk/Utils/Fields.js","src/utils/utils.ts"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","getSigningSession","endpoint","params","_a","api","get","concat","envelopeId","encodeURIComponent","roleId","inviteCode","r","signerToken","headers","signer_token","session","decodeAccessTokenBody","setToken","recipient","data","getEnvelope","ssr","getEnvelopeFile","documentId","responseType","Buffer","from","toString","updateEnvelopeField","fieldName","put","updateEnvelopeFieldSignature","signatureId","updateEnvelopeFieldInitials","initialId","rescale","integerSequence","start","count","Array","fill","map","index","fullNameToInitials","name","split","word","join","defaultWidth","field","type","defaultHeight","setControlStyles","el","xScale","yScale","option","settings","setting","x","width","height","optionSettings","undefined","options","_b","_c","_d","style","position","left","bottom","transform","getFieldId","getFieldOptionId","renderDocumentField","docPage","roleIndex","fieldOptions","disabled","editable","draggable","controlsDiv","document","getElementById","containerId","console","log","id","existingField","createElement","setAttribute","appendChild","checkboxIndex","cbEl","buttonIndex","radioEl","getRoleIndex","roles","role","indexOf","getFieldSettings","required","updateCssTransform","key","currentTransform","components","matchAll","filter","component","savePDF","async","envelope","fileName","updated_at","Envelopes.getEnvelopeFile","xhr","XMLHttpRequest","onload","a","href","window","URL","createObjectURL","response","download","display","click","remove","open","send"],"mappings":"oCAAA,IAAIA,EAAaC,WAAQA,UAAKD,WAAc,SAAUE,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,MAC/F,OAAO,IAAKH,IAAMA,EAAIK,WAAU,SAAUD,EAASE,GAC/C,SAASC,EAAUJ,GAAS,IAAMK,EAAKP,EAAUQ,KAAKN,IAAW,MAAOO,GAAKJ,EAAOI,IACpF,SAASC,EAASR,GAAS,IAAMK,EAAKP,EAAU,SAASE,IAAW,MAAOO,GAAKJ,EAAOI,IACvF,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOT,OAASD,EAAMU,EAAOT,OAAOW,KAAKP,EAAWI,GAClGH,GAAMP,EAAYA,EAAUc,MAAMjB,EAASC,GAAc,KAAKU,YAGtE,IAAIO,EAAenB,WAAQA,UAAKmB,aAAgB,SAAUlB,EAASmB,GAC/D,IAAIC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAIC,EAAE,GAAK,EAAG,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOC,KAAM,GAAIC,IAAK,IAAMC,EAAGC,EAAGJ,EAAGK,EAC/G,OAAOA,EAAI,CAAEjB,KAAMkB,EAAK,GAAIC,MAASD,EAAK,GAAIE,OAAUF,EAAK,WAAaG,SAAW,aAAeJ,EAAEI,OAAOC,UAAY,WAAa,OAAOlC,OAAU6B,EACvJ,SAASC,EAAKK,GAAK,OAAO,SAAUC,GAAK,OAAOzB,EAAK,C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,EAAG,EAAGqH,SAAU,MAAOvB,SAAU,MAAO3G,OAAQ,GAAIT,MAAO,WAU9D4I,EAAqB,CAAClD,EAAiBmD,EAAa7I,KAE/D,MAAM8I,EAAmBpD,EAAGe,MAAMI,UAElC,MAAMkC,EAAa,IAAID,EAAiBE,SAAS,uBACjDtD,EAAGe,MAAMI,UAAY,CACnBkC,EACGE,QAAOC,GAAaA,EAAU,KAAOL,IACrC/D,KAAIoE,GAAaA,EAAU,KAC9B,GAAGL,KAAO7I,MACVoF,KAAK,YAGI+D,EAAUC,MAAO9G,EAA2B+G,EAAqBzF,KAC5E,MAAM0F,EAAW,GAAGD,EAASpE,UAAUoE,EAASE,WAAWrE,MAAM,KAAK,SACtE,MAAM1B,QAAagG,EAA0BlH,EAAU+G,EAASxB,GAAIjE,GAIpE,IAAI6F,EAAM,IAAIC,eACdD,EAAI5F,aAAe,OACnB4F,EAAIE,OAAS,WACX,IAAIC,EAAIpC,SAASO,cAAc,KAC/B6B,EAAEC,KAAOC,OAAOC,IAAIC,gBAAgBP,EAAIQ,UACxCL,EAAEM,SAAWZ,EACbM,EAAEnD,MAAM0D,QAAU,OAClB3C,SAAS1G,KAAKmH,YAAY2B,GAC1BA,EAAEQ,QACFR,EAAES,UAGJZ,EAAIa,KAAK,MAAO,+BAA+B9G,KAC/CiG,EAAIc","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { decodeAccessTokenBody } from '../Utils/Token';\n/**\n * Create an envelope\n *\n * ```typescript\n * import {Envelopes, ICreateEnvelopeRole, ICreateEnvelopeRequest} from '@verdocs/js-sdk/Envelopes';\n *\n * const role1: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Seller',\n * full_name: 'Paige Turner',\n * email: 'paige.turner@nomail.com',\n * phone: '',\n * sequence: 1,\n * delegator: false,\n * message: '',\n * };\n *\n * const role2: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Buyer',\n * full_name: 'Will Power',\n * email: 'will.power@nomail.com',\n * phone: '',\n * sequence: 2,\n * delegator: false,\n * message: '',\n * };\n *\n * const request: ICreateEnvelopeRequest = {template_id: 'd2338742-f3a1-465b-8592-806587413cc1', name: 'Bill of Sale', roles: [role1, role2]};\n * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);\n * ```\n */\nexport var createEnvelope = function (endpoint, request) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes', request)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a summary of currently active envelopes.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {action_required, completed, waiting_on_others} = await Envelopes.getSummary(VerdocsEndpoint.getDefault());\n * ```\n */\nexport var getSummary = function (endpoint, page) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/summary', { page: page })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Search for envelopes matching various criteria.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport var searchEnvelopes = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/search', params)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a signing session for an Envelope.\n */\nexport var getSigningSession = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(params.envelopeId, \"/recipients/\").concat(encodeURIComponent(params.roleId), \"/invitation/\").concat(params.inviteCode))\n .then(function (r) {\n var _a;\n // Avoiding a jsonwebtoken dependency here - we don't actually need the whole library\n var signerToken = ((_a = r.headers) === null || _a === void 0 ? void 0 : _a.signer_token) || '';\n var session = decodeAccessTokenBody(signerToken);\n endpoint.setToken(signerToken);\n return { recipient: r.data, session: session, signerToken: signerToken };\n })];\n });\n}); };\n/**\n * Get the list of recipients for an Envelope.\n */\nexport var getEnvelopeRecipients = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients\"))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelope = function (endpoint, envelopeId, ssr) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId) + (ssr ? '?ssr=true' : ''))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelopeDocument = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Cancel an Envelope.\n */\nexport var cancelEnvelope = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId), { action: 'cancel' })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).\n */\nexport var recipientHasAction = function (recipient) { return !['submitted', 'canceled', 'declined'].includes(recipient.status); };\n/**\n * Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).\n */\nexport var getRecipientsWithActions = function (envelope) { return ((envelope === null || envelope === void 0 ? void 0 : envelope.recipients) || []).filter(recipientHasAction); };\n/**\n * Returns true if the recipient can act.\n */\nexport var recipientCanAct = function (recipient, recipientsWithActions) { var _a; return recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence); };\n/**\n * Returns true if the user can act.\n */\nexport var userCanAct = function (email, recipientsWithActions) {\n var _a;\n var recipient = recipientsWithActions.find(function (r) { return r.email === email; });\n return recipient && recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence);\n};\n/**\n * Get (binary download) a file attached to an Envelope. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getEnvelopeFile = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId, \"?file=true\"), {\n responseType: 'arraybuffer',\n })\n .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];\n });\n}); };\n/**\n * Update a Document field. Typically called during the signing process as a Recipient fills in fields.\n */\nexport var updateEnvelopeField = function (endpoint, envelopeId, fieldName, value) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName), value)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldSignature = function (endpoint, envelopeId, fieldName, signatureId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/signature/\").concat(signatureId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldInitials = function (endpoint, envelopeId, fieldName, initialId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/initial/\").concat(initialId))\n .then(function (r) { return r.data; })];\n });\n}); };\n","export function getRTop(y, fieldHeight, iTextHeight, yRatio) {\n return iTextHeight - (y + fieldHeight) * yRatio;\n}\nexport function getRLeft(x, ratio) {\n return x * ratio;\n}\nexport function getRValue(y, ratio) {\n return y * ratio;\n}\nexport function blobToBase64(image) {\n var fileReader = new FileReader();\n return new Promise(function (resolve, reject) {\n fileReader.onerror = function () {\n reject(new DOMException('Problem reading blob.'));\n };\n fileReader.onload = function () {\n resolve(fileReader.result);\n };\n fileReader.readAsDataURL(image);\n });\n}\nexport function rescale(r, n) {\n return r * n;\n}\n","// These should probably all move to JS-SDK\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {rescale} from '@verdocs/js-sdk/Utils/Fields';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField, IEnvelope} from '@verdocs/js-sdk/Envelopes/Types';\nimport {IDocumentPageInfo} from './Types';\n\nexport const integerSequence = (start: number, count: number): number[] =>\n Array(count)\n .fill(1)\n .map((_, index) => index + start);\n\nexport const fullNameToInitials = (name: string) =>\n name\n .split(' ')\n .map(word => word[0])\n .join('');\n\nexport const defaultWidth = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 82;\n }\n\n return 150;\n};\n\nexport const defaultHeight = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 41;\n }\n\n return 50;\n};\n\nexport const setControlStyles = (el: HTMLElement, field: ITemplateField | IDocumentField, xScale: number, yScale: number, option?: number) => {\n const settings = (field as ITemplateField).setting || (field as IDocumentField).settings;\n let {x = 0, y = 0, width = defaultWidth(field), height = defaultHeight(field)} = settings;\n\n const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;\n if (optionSettings) {\n x = optionSettings.x ?? x;\n y = optionSettings.y ?? y;\n width = optionSettings.width ?? width;\n height = optionSettings.height ?? height;\n }\n\n el.style.width = `${width}px`;\n el.style.height = `${height}px`;\n el.style.position = 'absolute';\n el.style.left = `${rescale(xScale, x)}px`;\n el.style.bottom = `${rescale(yScale, y)}px`;\n el.style.transform = `scale(${xScale}, ${yScale})`;\n // el.style.backgroundColor = field['rgba'] || getRGBA(roleIndex);\n};\n\nexport const getFieldId = (field: ITemplateField | IDocumentField) => {\n return `verdocs-doc-fld-${field.name}`;\n};\n\nexport const getFieldOptionId = (field: ITemplateField | IDocumentField, index: number) => {\n return `verdocs-doc-fld-${field.name}-${index}`;\n};\n\ninterface IFieldOptions {\n disabled?: boolean;\n editable?: boolean;\n draggable?: boolean;\n done?: boolean;\n}\n\nexport const renderDocumentField = (field: ITemplateField | IDocumentField, docPage: IDocumentPageInfo, roleIndex: number, fieldOptions: IFieldOptions) => {\n const {disabled = false, editable = false, draggable = false, done = false} = fieldOptions;\n const controlsDiv = document.getElementById(docPage.containerId + '-controls');\n if (!controlsDiv) {\n console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);\n return;\n }\n\n switch (field.type) {\n case 'attachment':\n case 'date':\n case 'dropdown':\n case 'initial':\n case 'payment':\n case 'signature':\n case 'timestamp':\n case 'textarea':\n case 'textbox': {\n const id = getFieldId(field);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const el: any = document.createElement(`verdocs-field-${field.type}`);\n el.field = field;\n el.setAttribute('id', id);\n el.setAttribute('roleIndex', roleIndex);\n\n if (disabled) {\n el.setAttribute('tabindex', -1);\n el.setAttribute('disabled', true);\n } else {\n el.setAttribute('tabIndex', 1);\n }\n\n if (editable) {\n el.setAttribute('editable', true);\n }\n\n if (draggable) {\n el.setAttribute('draggable', true);\n }\n\n if (done) {\n el.setAttribute('done', true);\n }\n\n setControlStyles(el, field, docPage.xScale, docPage.yScale);\n controlsDiv.appendChild(el);\n\n return el;\n }\n\n case 'checkbox_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, checkboxIndex) => {\n const id = getFieldOptionId(field, checkboxIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const cbEl: any = document.createElement(`verdocs-field-checkbox`);\n cbEl.field = field;\n cbEl.setAttribute('id', id);\n cbEl.setAttribute('roleIndex', roleIndex);\n cbEl.setAttribute('option', checkboxIndex);\n if (disabled) {\n cbEl.setAttribute('disabled', true);\n }\n if (done) {\n cbEl.setAttribute('done', true);\n }\n setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, checkboxIndex);\n controlsDiv.appendChild(cbEl);\n\n return cbEl;\n });\n\n case 'radio_button_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, buttonIndex) => {\n const id = getFieldOptionId(field, buttonIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const radioEl: any = document.createElement(`verdocs-field-radio-button`);\n radioEl.field = field;\n radioEl.setAttribute('id', id);\n radioEl.setAttribute('roleIndex', roleIndex);\n radioEl.setAttribute('option', buttonIndex);\n if (disabled) {\n radioEl.setAttribute('disabled', true);\n }\n if (done) {\n radioEl.setAttribute('done', true);\n }\n setControlStyles(radioEl, field, docPage.xScale, docPage.yScale, buttonIndex);\n controlsDiv.appendChild(radioEl);\n\n return radioEl;\n });\n\n // case 'attachment':\n // el = document.createElement('verdocs-field-attachment');\n // el.setAttribute('value', result || '');\n // break;\n // case 'payment':\n // el = document.createElement('verdocs-field-payment');\n // break;\n default:\n console.log('[PREVIEW] Skipping unsupported field type', field);\n return null;\n }\n};\n\nexport const getRoleIndex = (roles: string[], role: string) => roles.indexOf(role) || 0;\n\n// TODO: We can clean this up a lot if we alter the API to emit both setting and settings regardless of the source type,\n// but then merge the SDK types to encourage developers to use just `settings`.\nexport const getFieldSettings = (field: ITemplateField | IDocumentField) => {\n if ((field as ITemplateField).setting) {\n return (field as ITemplateField).setting;\n }\n\n if ((field as IDocumentField).settings) {\n return (field as IDocumentField).settings;\n }\n\n return {x: 0, y: 0, required: false, disabled: false, result: '', value: ''};\n};\n\n/**\n * Helper function to safely set/update components in a CSS transform attribute. Transform is normally set as a string of\n * `operation1(param) operation2(param) ...` components, which makes updating them a bit of a pain. This will remove the\n * specified component if it's already set and replace it with the new value, without touching the other components that\n * may already be set. Note that this operation moves the component to the end of the transform chain so it's not meant\n * to be used for order-sensitive components e.g. translate-then-rotate.\n */\nexport const updateCssTransform = (el: HTMLElement, key: string, value: string) => {\n // e.g. 'scale(1.87908, 1.87908) translate(0px, 0px);'\n const currentTransform = el.style.transform;\n // e.g. ['scale(1.87908, 1.87908)', 'scale', '1.87908, 1.87908', ...], [ 'translate(0px, 0px)', 'translate', '0px, 0px']]\n const components = [...currentTransform.matchAll(/(\\w+)\\(([^)]*)\\)/gi)];\n el.style.transform = [\n components //\n .filter(component => component[1] !== key) // Remove the entry if it's already set\n .map(component => component[0]), // Convert back the remaining entries\n `${key}(${value})`,\n ].join(' ');\n};\n\nexport const savePDF = async (endpoint: VerdocsEndpoint, envelope: IEnvelope, documentId: string) => {\n const fileName = `${envelope.name} - ${envelope.updated_at.split('T')[0]}.pdf`;\n const data = await Envelopes.getEnvelopeFile(endpoint, envelope.id, documentId);\n\n // This is better in React than doing window.href= or similar to trigger a download. For a description of the technique\n // see https://stackoverflow.com/questions/8126623/downloading-canvas-element-to-an-image\n let xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function () {\n let a = document.createElement('a');\n a.href = window.URL.createObjectURL(xhr.response);\n a.download = fileName;\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n a.remove();\n };\n\n xhr.open('GET', `data:application/pdf;base64,${data}`);\n xhr.send();\n};\n"]}