@verdocs/web-sdk 6.10.5 → 6.10.7

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 (197) hide show
  1. package/dist/cjs/Environment-C3P2cz0J.js +14 -0
  2. package/dist/cjs/Environment-C3P2cz0J.js.map +1 -0
  3. package/dist/cjs/{interact.min-CGi6ndGs.js → interact.min-CPZxI9Hv.js} +4 -4
  4. package/dist/cjs/interact.min-CPZxI9Hv.js.map +1 -0
  5. package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +16 -11
  7. package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
  8. package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-preview_6.cjs.entry.js +2 -2
  11. package/dist/cjs/verdocs-sign.cjs.entry.js +5 -0
  12. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  13. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +135 -85
  14. package/dist/cjs/verdocs-status-indicator.cjs.entry.js.map +1 -1
  15. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js.map +1 -1
  17. package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.css +2 -1
  18. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +5 -0
  19. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  20. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +16 -11
  21. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
  22. package/dist/collection/utils/Environment.js +5 -1
  23. package/dist/collection/utils/Environment.js.map +1 -1
  24. package/dist/components/p-6RWROB9R.js +2 -0
  25. package/dist/components/p-6RWROB9R.js.map +1 -0
  26. package/dist/components/{p-B3UP88BP.js → p-B1UVXqFA.js} +2 -2
  27. package/dist/components/{p-v9WkIq1Z.js → p-B6aUlIQe.js} +2 -2
  28. package/dist/components/{p-BUKCOnKs.js → p-BELGzhZw.js} +2 -2
  29. package/dist/components/{p-C1VW_3fv.js → p-BQUZjuoP.js} +2 -2
  30. package/dist/components/{p-CC7jlZnx.js → p-BYVQkYYg.js} +2 -2
  31. package/dist/components/p-C1iHkDUH.js +2 -0
  32. package/dist/components/p-C1iHkDUH.js.map +1 -0
  33. package/dist/components/{p-C4ygd3v_.js → p-COaijEV0.js} +2 -2
  34. package/dist/components/p-COaijEV0.js.map +1 -0
  35. package/dist/components/{p-DEhaAbKn.js → p-CYvB5bYX.js} +2 -2
  36. package/dist/components/{p-DnqXAqmP.js → p-Ck4pdoyc.js} +2 -2
  37. package/dist/components/{p-BA3SxsdQ.js → p-CsF979IT.js} +2 -2
  38. package/dist/components/{p-Bi94seCl.js → p-D-TexkaT.js} +2 -2
  39. package/dist/components/{p-DP_N7u8w.js → p-D1cSgqut.js} +2 -2
  40. package/dist/components/{p-B3nCB2u5.js → p-D7oMWhqM.js} +2 -2
  41. package/dist/components/{p-RvR1j0oO.js → p-DJMr11ue.js} +2 -2
  42. package/dist/components/{p-CHzNcBIz.js → p-DKKsPZnz.js} +2 -2
  43. package/dist/components/p-DavVixMP.js +2 -0
  44. package/dist/components/p-DavVixMP.js.map +1 -0
  45. package/dist/components/{p-CqVkL8_m.js → p-DfIxVX8-.js} +2 -2
  46. package/dist/components/{p-C_mtaGHG.js → p-DiYuPnJJ.js} +2 -2
  47. package/dist/components/{p-5fVPVL_Z.js → p-K_PKw6bs.js} +2 -2
  48. package/dist/components/p-b2u0_wDk.js +2 -0
  49. package/dist/components/p-b2u0_wDk.js.map +1 -0
  50. package/dist/components/{p-ohuuh9ZE.js → p-bPe0_Dsn.js} +2 -2
  51. package/dist/components/verdocs-build.js +1 -1
  52. package/dist/components/verdocs-contact-picker.js +1 -1
  53. package/dist/components/verdocs-delegate-dialog.js +1 -1
  54. package/dist/components/verdocs-envelopes-list.js +1 -1
  55. package/dist/components/verdocs-field-attachment.js +1 -1
  56. package/dist/components/verdocs-field-checkbox.js +1 -1
  57. package/dist/components/verdocs-field-date.js +1 -1
  58. package/dist/components/verdocs-field-dropdown.js +1 -1
  59. package/dist/components/verdocs-field-initial.js +1 -1
  60. package/dist/components/verdocs-field-payment.js +1 -1
  61. package/dist/components/verdocs-field-radio.js +1 -1
  62. package/dist/components/verdocs-field-signature.js +1 -1
  63. package/dist/components/verdocs-field-textarea.js +1 -1
  64. package/dist/components/verdocs-field-textbox.js +1 -1
  65. package/dist/components/verdocs-field-timestamp.js +1 -1
  66. package/dist/components/verdocs-otp-dialog.js +1 -1
  67. package/dist/components/verdocs-passcode-dialog.js +1 -1
  68. package/dist/components/verdocs-preview.js +1 -1
  69. package/dist/components/verdocs-send.js +1 -1
  70. package/dist/components/verdocs-sign.js +1 -1
  71. package/dist/components/verdocs-sign.js.map +1 -1
  72. package/dist/components/verdocs-status-indicator.js +1 -1
  73. package/dist/components/verdocs-template-document-page.js +1 -1
  74. package/dist/components/verdocs-template-fields.js +1 -1
  75. package/dist/components/verdocs-toolbar-icon.js +1 -1
  76. package/dist/esm/Environment-b2u0_wDk.js +12 -0
  77. package/dist/esm/Environment-b2u0_wDk.js.map +1 -0
  78. package/dist/esm/{interact.min-BO_a_7pQ.js → interact.min-Bf1WXbdg.js} +4 -4
  79. package/dist/esm/interact.min-Bf1WXbdg.js.map +1 -0
  80. package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +1 -1
  81. package/dist/esm/verdocs-contact-picker.entry.js +16 -11
  82. package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
  83. package/dist/esm/verdocs-field-attachment_11.entry.js +1 -1
  84. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  85. package/dist/esm/verdocs-preview_6.entry.js +2 -2
  86. package/dist/esm/verdocs-sign.entry.js +5 -0
  87. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  88. package/dist/esm/verdocs-status-indicator.entry.js +135 -85
  89. package/dist/esm/verdocs-status-indicator.entry.js.map +1 -1
  90. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  91. package/dist/esm/verdocs-template-document-page_2.entry.js.map +1 -1
  92. package/dist/esm-es5/Environment-b2u0_wDk.js +2 -0
  93. package/dist/esm-es5/Environment-b2u0_wDk.js.map +1 -0
  94. package/dist/esm-es5/{interact.min-BO_a_7pQ.js → interact.min-Bf1WXbdg.js} +2 -2
  95. package/dist/esm-es5/interact.min-Bf1WXbdg.js.map +1 -0
  96. package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
  99. package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  104. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-status-indicator.entry.js.map +1 -1
  106. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-template-document-page_2.entry.js.map +1 -1
  108. package/dist/verdocs-web-sdk/{p-addd303e.system.entry.js → p-006f051b.system.entry.js} +2 -2
  109. package/dist/verdocs-web-sdk/p-006f051b.system.entry.js.map +1 -0
  110. package/dist/verdocs-web-sdk/{p-9c481477.entry.js → p-10d47bbd.entry.js} +2 -2
  111. package/dist/verdocs-web-sdk/p-39c54b65.system.entry.js +2 -0
  112. package/dist/verdocs-web-sdk/p-39c54b65.system.entry.js.map +1 -0
  113. package/dist/verdocs-web-sdk/p-4e0788f9.entry.js +2 -0
  114. package/dist/verdocs-web-sdk/p-4e0788f9.entry.js.map +1 -0
  115. package/dist/verdocs-web-sdk/{p-d06d9cfd.entry.js → p-4e091415.entry.js} +2 -2
  116. package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js → p-4ea0632f.entry.js} +2 -2
  117. package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js.map → p-4ea0632f.entry.js.map} +1 -1
  118. package/dist/verdocs-web-sdk/p-5f58b4cd.entry.js +2 -0
  119. package/dist/verdocs-web-sdk/p-5f58b4cd.entry.js.map +1 -0
  120. package/dist/verdocs-web-sdk/{p-b3ac740e.system.entry.js → p-62464041.system.entry.js} +2 -2
  121. package/dist/verdocs-web-sdk/{p-4f9bd0bd.system.entry.js → p-6e8ce989.system.entry.js} +2 -2
  122. package/dist/verdocs-web-sdk/{p-ef1083c6.entry.js → p-734c8a8b.entry.js} +2 -2
  123. package/dist/verdocs-web-sdk/{p-ef1083c6.entry.js.map → p-734c8a8b.entry.js.map} +1 -1
  124. package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
  125. package/dist/verdocs-web-sdk/p-COHG5J4h.system.js +2 -0
  126. package/dist/verdocs-web-sdk/p-COHG5J4h.system.js.map +1 -0
  127. package/dist/verdocs-web-sdk/{p-C4ygd3v_.js → p-COaijEV0.js} +2 -2
  128. package/dist/verdocs-web-sdk/p-COaijEV0.js.map +1 -0
  129. package/dist/verdocs-web-sdk/{p-DQMNv-mt.system.js → p-CQwimGbQ.system.js} +2 -2
  130. package/dist/{cjs/interact.min-CGi6ndGs.js.map → verdocs-web-sdk/p-CQwimGbQ.system.js.map} +1 -1
  131. package/dist/verdocs-web-sdk/p-b2u0_wDk.js +2 -0
  132. package/dist/verdocs-web-sdk/p-b2u0_wDk.js.map +1 -0
  133. package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js → p-ba0d4ff5.system.entry.js} +2 -2
  134. package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js.map → p-ba0d4ff5.system.entry.js.map} +1 -1
  135. package/dist/verdocs-web-sdk/{p-18ce7226.system.entry.js → p-c86111fd.system.entry.js} +2 -2
  136. package/dist/verdocs-web-sdk/{p-18ce7226.system.entry.js.map → p-c86111fd.system.entry.js.map} +1 -1
  137. package/dist/verdocs-web-sdk/{p-1273627b.system.entry.js → p-ceda04bc.system.entry.js} +2 -2
  138. package/dist/verdocs-web-sdk/{p-5c2025ca.entry.js → p-d95705c6.entry.js} +2 -2
  139. package/dist/verdocs-web-sdk/{p-4471c1b4.entry.js → p-ee92c074.entry.js} +2 -2
  140. package/dist/verdocs-web-sdk/{p-6af0110a.system.entry.js → p-fad90cf9.system.entry.js} +3 -3
  141. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  142. package/package.json +4 -4
  143. package/dist/cjs/Environment-CP-XG6Lt.js +0 -13
  144. package/dist/cjs/Environment-CP-XG6Lt.js.map +0 -1
  145. package/dist/components/p-29evahil.js +0 -2
  146. package/dist/components/p-29evahil.js.map +0 -1
  147. package/dist/components/p-C4ygd3v_.js.map +0 -1
  148. package/dist/components/p-CA8hWmuL.js +0 -2
  149. package/dist/components/p-CA8hWmuL.js.map +0 -1
  150. package/dist/components/p-CYqVJ_kJ.js +0 -2
  151. package/dist/components/p-CYqVJ_kJ.js.map +0 -1
  152. package/dist/components/p-DtHLJ-XO.js +0 -2
  153. package/dist/components/p-DtHLJ-XO.js.map +0 -1
  154. package/dist/esm/Environment-29evahil.js +0 -11
  155. package/dist/esm/Environment-29evahil.js.map +0 -1
  156. package/dist/esm/interact.min-BO_a_7pQ.js.map +0 -1
  157. package/dist/esm-es5/Environment-29evahil.js +0 -2
  158. package/dist/esm-es5/Environment-29evahil.js.map +0 -1
  159. package/dist/esm-es5/interact.min-BO_a_7pQ.js.map +0 -1
  160. package/dist/verdocs-web-sdk/p-0eaeb487.system.entry.js +0 -2
  161. package/dist/verdocs-web-sdk/p-0eaeb487.system.entry.js.map +0 -1
  162. package/dist/verdocs-web-sdk/p-1a06dffb.entry.js +0 -2
  163. package/dist/verdocs-web-sdk/p-1a06dffb.entry.js.map +0 -1
  164. package/dist/verdocs-web-sdk/p-2636ac4d.entry.js +0 -2
  165. package/dist/verdocs-web-sdk/p-2636ac4d.entry.js.map +0 -1
  166. package/dist/verdocs-web-sdk/p-29evahil.js +0 -2
  167. package/dist/verdocs-web-sdk/p-29evahil.js.map +0 -1
  168. package/dist/verdocs-web-sdk/p-C4ygd3v_.js.map +0 -1
  169. package/dist/verdocs-web-sdk/p-CHg64SCg.system.js +0 -2
  170. package/dist/verdocs-web-sdk/p-CHg64SCg.system.js.map +0 -1
  171. package/dist/verdocs-web-sdk/p-DQMNv-mt.system.js.map +0 -1
  172. package/dist/verdocs-web-sdk/p-addd303e.system.entry.js.map +0 -1
  173. /package/dist/components/{p-B3UP88BP.js.map → p-B1UVXqFA.js.map} +0 -0
  174. /package/dist/components/{p-v9WkIq1Z.js.map → p-B6aUlIQe.js.map} +0 -0
  175. /package/dist/components/{p-BUKCOnKs.js.map → p-BELGzhZw.js.map} +0 -0
  176. /package/dist/components/{p-C1VW_3fv.js.map → p-BQUZjuoP.js.map} +0 -0
  177. /package/dist/components/{p-CC7jlZnx.js.map → p-BYVQkYYg.js.map} +0 -0
  178. /package/dist/components/{p-DEhaAbKn.js.map → p-CYvB5bYX.js.map} +0 -0
  179. /package/dist/components/{p-DnqXAqmP.js.map → p-Ck4pdoyc.js.map} +0 -0
  180. /package/dist/components/{p-BA3SxsdQ.js.map → p-CsF979IT.js.map} +0 -0
  181. /package/dist/components/{p-Bi94seCl.js.map → p-D-TexkaT.js.map} +0 -0
  182. /package/dist/components/{p-DP_N7u8w.js.map → p-D1cSgqut.js.map} +0 -0
  183. /package/dist/components/{p-B3nCB2u5.js.map → p-D7oMWhqM.js.map} +0 -0
  184. /package/dist/components/{p-RvR1j0oO.js.map → p-DJMr11ue.js.map} +0 -0
  185. /package/dist/components/{p-CHzNcBIz.js.map → p-DKKsPZnz.js.map} +0 -0
  186. /package/dist/components/{p-CqVkL8_m.js.map → p-DfIxVX8-.js.map} +0 -0
  187. /package/dist/components/{p-C_mtaGHG.js.map → p-DiYuPnJJ.js.map} +0 -0
  188. /package/dist/components/{p-5fVPVL_Z.js.map → p-K_PKw6bs.js.map} +0 -0
  189. /package/dist/components/{p-ohuuh9ZE.js.map → p-bPe0_Dsn.js.map} +0 -0
  190. /package/dist/verdocs-web-sdk/{p-9c481477.entry.js.map → p-10d47bbd.entry.js.map} +0 -0
  191. /package/dist/verdocs-web-sdk/{p-d06d9cfd.entry.js.map → p-4e091415.entry.js.map} +0 -0
  192. /package/dist/verdocs-web-sdk/{p-b3ac740e.system.entry.js.map → p-62464041.system.entry.js.map} +0 -0
  193. /package/dist/verdocs-web-sdk/{p-4f9bd0bd.system.entry.js.map → p-6e8ce989.system.entry.js.map} +0 -0
  194. /package/dist/verdocs-web-sdk/{p-1273627b.system.entry.js.map → p-ceda04bc.system.entry.js.map} +0 -0
  195. /package/dist/verdocs-web-sdk/{p-5c2025ca.entry.js.map → p-d95705c6.entry.js.map} +0 -0
  196. /package/dist/verdocs-web-sdk/{p-4471c1b4.entry.js.map → p-ee92c074.entry.js.map} +0 -0
  197. /package/dist/verdocs-web-sdk/{p-6af0110a.system.entry.js.map → p-fad90cf9.system.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function a(e){try{l(o.next(e))}catch(e){s(e)}}function n(e){try{l(o["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):r(e.value).then(a,n)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,r,s,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=n(0),a["throw"]=n(1),a["return"]=n(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function n(e){return function(t){return l([e,t])}}function l(n){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,n[0]&&(i=0)),i)try{if(o=1,r&&(s=n[0]&2?r["return"]:n[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,n[1])).done)return s;if(r=0,s)n=[n[0]&2,s.value];switch(n[0]){case 0:case 1:s=n;break;case 4:i.label++;return{value:n[1],done:false};case 5:i.label++;r=n[1];n=[0];continue;case 7:n=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(n[0]===6||n[0]===2)){i=0;continue}if(n[0]===3&&(!s||n[1]>s[0]&&n[1]<s[3])){i.label=n[1];break}if(n[0]===6&&i.label<s[1]){i.label=s[1];s=n;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(n);break}if(s[2])i.ops.pop();i.trys.pop();continue}n=t.call(e,i)}catch(e){n=[6,e];r=0}finally{o=s=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-CjTHbolG.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri,getTemplate}from"@verdocs/js-sdk";import{t as throttle,f as getControlStyles,g as getFieldId}from"./utils-Bh3zb1Xs.js";import{S as Store}from"./Datastore-C7hFgM52.js";import{c as createPopper}from"./popper-BfP9ezJQ.js";import"./index-BglCURB-.js";import"./Types-CIxfEdV7.js";var verdocsTemplateDocumentPageCss=function(){return"verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}"};var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered");this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";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;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var i=0,o=t;i<o.length;i++){var r=o[i];var s=r.contentRect.width;e.renderedWidth=s;e.renderedHeight=e.virtualHeight*(s/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){var o;return i.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}},i.name==="controls"&&(((o=e.template)===null||o===void 0?void 0:o.fields)||[]).filter((function(t){return t&&t.document_id===e.documentId&&t.page===e.pageNumber})).map((function(t){var i,o;var r=getFieldId(t);var s=t.name,a=t.type,n=t.multiline;var l=e,c=l.xScale,d=l.yScale,u=l.templateId,p=l.editable,f=l.disabled,m=l.done,v=l.pageNumber;if(((i=t["setting"])===null||i===void 0?void 0:i.leading)>0||((o=t["settings"])===null||o===void 0?void 0:o.leading)>0){a="textarea";n=true}switch(a){case"textbox":return h("verdocs-field-textbox",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,multiline:n,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});case"textarea":return h("verdocs-field-textarea",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});case"date":return h("verdocs-field-date",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});case"attachment":return h("verdocs-field-attachment",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});case"dropdown":return h("verdocs-field-dropdown",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});case"initial":return h("verdocs-field-initial",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});case"signature":return h("verdocs-field-signature",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});case"checkbox":return h("verdocs-field-checkbox",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});case"radio":return h("verdocs-field-radio",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:v,isPreview:true,style:getControlStyles(t,c,d)});default:return h(Fragment,null,s)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(i.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=verdocsTemplateDocumentPageCss();var verdocsToolbarIconCss=function(){return'verdocs-toolbar-icon{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}'};var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"56dd7cebb5a2761547a5e24ec76652f7052906b2",class:{}},h("div",{key:"8d2f5e8578bdf5b25db200406460d9e2724c168e","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"371c80cf2be530cf3fd8ddb7308fd30f65f3b3f4",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"39b43e589f2b52f1658562e79a3d6388478bdcbe","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=verdocsToolbarIconCss();export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,i){function r(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function a(e){try{l(i.next(e))}catch(e){s(e)}}function n(e){try{l(i["throw"](e))}catch(e){s(e)}}function l(e){e.done?o(e.value):r(e.value).then(a,n)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=n(0),a["throw"]=n(1),a["return"]=n(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function n(e){return function(t){return l([e,t])}}function l(n){if(i)throw new TypeError("Generator is already executing.");while(a&&(a=0,n[0]&&(o=0)),o)try{if(i=1,r&&(s=n[0]&2?r["return"]:n[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,n[1])).done)return s;if(r=0,s)n=[n[0]&2,s.value];switch(n[0]){case 0:case 1:s=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;r=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(n[0]===6&&o.label<s[1]){o.label=s[1];s=n;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(n);break}if(s[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];r=0}finally{i=s=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-CjTHbolG.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri,getTemplate}from"@verdocs/js-sdk";import{t as throttle,f as getControlStyles,g as getFieldId}from"./utils-Bh3zb1Xs.js";import{S as Store}from"./Datastore-C7hFgM52.js";import{c as createPopper}from"./popper-BfP9ezJQ.js";import"./index-BglCURB-.js";import"./Types-CIxfEdV7.js";var verdocsTemplateDocumentPageCss=function(){return"verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}"};var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered");this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";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;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,i=t;o<i.length;o++){var r=i[o];var s=r.contentRect.width;e.renderedWidth=s;e.renderedHeight=e.virtualHeight*(s/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){var i;return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&(((i=e.template)===null||i===void 0?void 0:i.fields)||[]).filter((function(t){return t&&t.document_id===e.documentId&&t.page===e.pageNumber})).map((function(t){var o,i;var r=getFieldId(t);var s=t.name,a=t.type,n=t.multiline;var l=e,c=l.xScale,d=l.yScale,u=l.templateId,p=l.editable,f=l.disabled,m=l.done,b=l.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((i=t["settings"])===null||i===void 0?void 0:i.leading)>0){a="textarea";n=true}switch(a){case"textbox":return h("verdocs-field-textbox",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,multiline:n,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});case"textarea":return h("verdocs-field-textarea",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});case"date":return h("verdocs-field-date",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});case"attachment":return h("verdocs-field-attachment",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});case"dropdown":return h("verdocs-field-dropdown",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});case"initial":return h("verdocs-field-initial",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});case"signature":return h("verdocs-field-signature",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});case"checkbox":return h("verdocs-field-checkbox",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});case"radio":return h("verdocs-field-radio",{id:r,fieldname:s,source:"template",sourceid:u,editable:p,disabled:f,done:m,xscale:c,yscale:d,pagenumber:b,isPreview:true,style:getControlStyles(t,c,d)});default:return h(Fragment,null,s)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=verdocsTemplateDocumentPageCss();var verdocsToolbarIconCss=function(){return'verdocs-toolbar-icon{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:absolute;pointer-events:none;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}'};var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"56dd7cebb5a2761547a5e24ec76652f7052906b2",class:{}},h("div",{key:"8d2f5e8578bdf5b25db200406460d9e2724c168e","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"371c80cf2be530cf3fd8ddb7308fd30f65f3b3f4",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"39b43e589f2b52f1658562e79a3d6388478bdcbe","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=verdocsToolbarIconCss();export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
2
2
  //# sourceMappingURL=verdocs-template-document-page_2.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPage","class_1","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","concat","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","prototype","componentWillLoad","_c","getTemplateDocumentPageDisplayUri","_d","sent","listenToTemplate","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","document_id","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","isPreview","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-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 width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\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-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop({reflect: true}) templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop({reflect: true}) documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop({reflect: true}) 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({mutable: true}) 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 @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 @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(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 }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\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 const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\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 aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.document_id === this.documentId && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"49DAAA,IAAMA,+BAAiC,WAAM,gkB,ICmBhCC,4BAA2B,WALxC,SAAAC,EAAAC,G,4EAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,gBAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKQP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMpCV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAAC,OAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC/ErB,KAAAsB,cAAwBtB,KAAKW,aAC7BX,KAAAuB,eAAyBvB,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,KAAKgB,YAAagH,KAAK,UAAUzD,MAAM,UAAS,wBAAwBvE,KAAKyG,UAAWqB,IAAK,SAAAC,GAAE,OAAKtF,EAAKoE,QAAUkB,CAApB,GACrG/H,KAAKuG,KACNnC,EAAA,OAAAoD,IAAA,+DAAuB,OAAOjD,MAAM,W,WAxEf,G","ignoreList":[]}
1
+ {"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPage","class_1","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","concat","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","prototype","componentWillLoad","_c","getTemplateDocumentPageDisplayUri","_d","sent","listenToTemplate","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","document_id","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","isPreview","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-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 width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\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-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop({reflect: true}) templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop({reflect: true}) documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop({reflect: true}) 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({mutable: true}) 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 @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 @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(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 }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\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 const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\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 aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.document_id === this.documentId && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n // MUST be absolute. Popper positions the tooltip with inline transforms and assumes it is out\n // of the normal flow. With position:relative the tooltip instead occupies space inside the\n // flex container when shown, which widens the toolbar and shifts the icon out from under the\n // pointer. That fires mouseleave -> hide -> layout collapses -> mouseenter -> show, an endless\n // flicker where the icon can never be clicked. It only bites where the toolbar has no slack to\n // absorb the width change (e.g. the Teams tab), which is why it looked fine in the web app.\n position: absolute;\n // The tooltip is decoration; never let it capture the hover it was triggered by.\n pointer-events: none;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"49DAAA,IAAMA,+BAAiC,WAAM,gkB,ICmBhCC,4BAA2B,WALxC,SAAAC,EAAAC,G,4EAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,gBAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKQP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMpCV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAAC,OAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC/ErB,KAAAsB,cAAwBtB,KAAKW,aAC7BX,KAAAuB,eAAyBvB,KAAKY,cAC9BZ,KAAAwB,aAAuBxB,KAAKW,aAC5BX,KAAAyB,cAAwBzB,KAAKY,cAC7BZ,KAAA0B,YAAsB1B,KAAKW,aAAeX,KAAKY,cAC/CZ,KAAA2B,sBAAwB,KACxB3B,KAAA4B,eAAiB,GACjB5B,KAAA6B,OAAS,EACT7B,KAAA8B,OAAS,EAET9B,KAAA+B,QAAU,KACV/B,KAAAgC,SAA6B,IAmUvC,CAjUOlC,EAAAmC,UAAAC,kBAAN,W,kHACEC,EAAAnC,KAAsB,SAAMoC,kCAAkCpC,KAAKE,SAAUF,KAAKS,WAAYT,KAAKU,a,OAAnGyB,EAAKP,eAAiBS,EAAAC,OACtBtC,KAAKuC,mB,kBAGPzC,EAA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