@verdocs/web-sdk 1.4.2 → 1.5.0

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 (158) hide show
  1. package/dist/cjs/VerdocsEndpoint-5e6dd8ef.js +4780 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/verdocs-auth.cjs.entry.js +33 -24
  4. package/dist/cjs/verdocs-button_2.cjs.entry.js +1 -2
  5. package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +26 -22
  6. package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +6 -1
  9. package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +42 -37
  10. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-search.cjs.entry.js +7 -2
  12. package/dist/cjs/verdocs-sign.cjs.entry.js +26 -161
  13. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  14. package/dist/collection/components/controls/verdocs-button/verdocs-button.css +1 -1
  15. package/dist/collection/components/controls/verdocs-button/verdocs-button.js +0 -1
  16. package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.css +1 -1
  17. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +1 -1
  18. package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.css +1 -1
  19. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.css +1 -1
  20. package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.css +1 -1
  21. package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.css +1 -1
  22. package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.css +1 -1
  23. package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.css +1 -1
  24. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.css +1 -1
  25. package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.css +1 -1
  26. package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.css +1 -1
  27. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.css +1 -1
  28. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.css +1 -1
  29. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +31 -1
  30. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.css +1 -1
  31. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +30 -6
  32. package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.css +1 -1
  33. package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.js +26 -0
  34. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.css +1 -1
  35. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +2 -5
  36. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +40 -24
  37. package/dist/collection/components/embeds/verdocs-search/verdocs-search.css +1 -1
  38. package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +36 -6
  39. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +28 -27
  40. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +40 -23
  41. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +2 -2
  42. package/dist/collection/components/embeds/verdocs-view/verdocs-view.css +1 -1
  43. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +26 -0
  44. package/dist/components/VerdocsEndpoint.js +4766 -0
  45. package/dist/components/verdocs-auth.js +34 -23
  46. package/dist/components/verdocs-button2.js +1 -2
  47. package/dist/components/verdocs-field-attachment2.js +1 -1
  48. package/dist/components/verdocs-field-checkbox2.js +1 -1
  49. package/dist/components/verdocs-field-date2.js +1 -1
  50. package/dist/components/verdocs-field-dropdown2.js +1 -1
  51. package/dist/components/verdocs-field-initial2.js +1 -1
  52. package/dist/components/verdocs-field-payment2.js +1 -1
  53. package/dist/components/verdocs-field-radio-button2.js +1 -1
  54. package/dist/components/verdocs-field-signature2.js +1 -1
  55. package/dist/components/verdocs-field-textarea2.js +1 -1
  56. package/dist/components/verdocs-field-textbox2.js +1 -1
  57. package/dist/components/verdocs-kba-dialog.js +1 -1
  58. package/dist/components/verdocs-ok-dialog2.js +1 -1
  59. package/dist/components/verdocs-quick-functions.js +9 -2
  60. package/dist/components/verdocs-search-activity2.js +38 -35
  61. package/dist/components/verdocs-search-box2.js +7 -1
  62. package/dist/components/verdocs-search-tabs.js +1 -1
  63. package/dist/components/verdocs-search.js +10 -3
  64. package/dist/components/verdocs-sign.js +27 -162
  65. package/dist/components/verdocs-view2.js +7 -2
  66. package/dist/custom-elements.json +830 -0
  67. package/dist/docs.json +118 -4
  68. package/dist/esm/VerdocsEndpoint-30e1b6ec.js +4766 -0
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/esm/verdocs-auth.entry.js +33 -24
  71. package/dist/esm/verdocs-button_2.entry.js +1 -2
  72. package/dist/esm/verdocs-dropdown_12.entry.js +16 -12
  73. package/dist/esm/verdocs-kba-dialog.entry.js +1 -1
  74. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  75. package/dist/esm/verdocs-quick-functions.entry.js +6 -1
  76. package/dist/esm/verdocs-search-activity_2.entry.js +42 -37
  77. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  78. package/dist/esm/verdocs-search.entry.js +7 -2
  79. package/dist/esm/verdocs-sign.entry.js +26 -161
  80. package/dist/esm/verdocs-web-sdk.js +1 -1
  81. package/dist/esm-es5/VerdocsEndpoint-30e1b6ec.js +7 -0
  82. package/dist/esm-es5/loader.js +1 -1
  83. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  84. package/dist/esm-es5/verdocs-button_2.entry.js +1 -1
  85. package/dist/esm-es5/verdocs-dropdown_12.entry.js +2 -2
  86. package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
  87. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  91. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  92. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  94. package/dist/types/components/elements/verdocs-quick-functions/verdocs-quick-functions.d.ts +5 -0
  95. package/dist/types/components/elements/verdocs-search-activity/verdocs-search-activity.d.ts +5 -0
  96. package/dist/types/components/elements/verdocs-search-box/verdocs-search-box.d.ts +5 -0
  97. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +11 -6
  98. package/dist/types/components/embeds/verdocs-search/verdocs-search.d.ts +5 -0
  99. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +6 -3
  100. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +5 -0
  101. package/dist/types/components.d.ts +57 -0
  102. package/dist/verdocs-web-sdk/{p-ed5baeb4.entry.js → p-064453c3.entry.js} +1 -1
  103. package/dist/verdocs-web-sdk/p-06f38046.js +1 -0
  104. package/dist/verdocs-web-sdk/p-16d62a51.system.entry.js +1 -0
  105. package/dist/verdocs-web-sdk/p-1b4e04b7.system.entry.js +1 -0
  106. package/dist/verdocs-web-sdk/p-1ea3b9d3.entry.js +1 -0
  107. package/dist/verdocs-web-sdk/p-30cc8818.entry.js +1 -0
  108. package/dist/verdocs-web-sdk/{p-0353c423.entry.js → p-32ad1014.entry.js} +1 -1
  109. package/dist/verdocs-web-sdk/p-4d80d044.system.js +7 -0
  110. package/dist/verdocs-web-sdk/{p-432c3151.system.entry.js → p-81fc0196.system.entry.js} +1 -1
  111. package/dist/verdocs-web-sdk/p-8276345a.entry.js +1 -0
  112. package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -1
  113. package/dist/verdocs-web-sdk/p-9139a76d.system.entry.js +1 -0
  114. package/dist/verdocs-web-sdk/p-9d8d8c78.entry.js +1 -0
  115. package/dist/verdocs-web-sdk/p-a87069d5.system.entry.js +1 -0
  116. package/dist/verdocs-web-sdk/p-aa9fc574.entry.js +1 -0
  117. package/dist/verdocs-web-sdk/p-c29c2cf8.entry.js +1 -0
  118. package/dist/verdocs-web-sdk/{p-98d72550.system.entry.js → p-c4d03ff9.system.entry.js} +2 -2
  119. package/dist/verdocs-web-sdk/p-cd6a2c40.system.entry.js +1 -0
  120. package/dist/verdocs-web-sdk/p-d14a6057.system.entry.js +1 -0
  121. package/dist/verdocs-web-sdk/{p-a1fcf0c4.entry.js → p-d522de7d.entry.js} +2 -2
  122. package/dist/verdocs-web-sdk/{p-e2e643c5.system.entry.js → p-e4ba14dc.system.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/p-f4219236.entry.js +1 -0
  124. package/dist/verdocs-web-sdk/p-f6a53928.system.entry.js +1 -0
  125. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  126. package/package.json +2 -2
  127. package/dist/cjs/Auth-adc80bd4.js +0 -68
  128. package/dist/cjs/Token-1ec62bd3.js +0 -2330
  129. package/dist/cjs/buffer-es6-bc8199b1.js +0 -2018
  130. package/dist/components/Auth.js +0 -64
  131. package/dist/components/Token.js +0 -2325
  132. package/dist/components/buffer-es6.js +0 -2010
  133. package/dist/esm/Auth-ff6040be.js +0 -64
  134. package/dist/esm/Token-a587e3ad.js +0 -2325
  135. package/dist/esm/buffer-es6-136673c8.js +0 -2010
  136. package/dist/esm-es5/Auth-ff6040be.js +0 -1
  137. package/dist/esm-es5/Token-a587e3ad.js +0 -1
  138. package/dist/esm-es5/buffer-es6-136673c8.js +0 -7
  139. package/dist/verdocs-web-sdk/p-11bc03a5.js +0 -1
  140. package/dist/verdocs-web-sdk/p-34bb9854.system.entry.js +0 -1
  141. package/dist/verdocs-web-sdk/p-3d1eb63d.system.entry.js +0 -1
  142. package/dist/verdocs-web-sdk/p-3f437456.system.entry.js +0 -1
  143. package/dist/verdocs-web-sdk/p-466cf9bf.system.entry.js +0 -1
  144. package/dist/verdocs-web-sdk/p-5dfd73f9.system.js +0 -7
  145. package/dist/verdocs-web-sdk/p-6348272c.js +0 -1
  146. package/dist/verdocs-web-sdk/p-6ac9e6f8.entry.js +0 -1
  147. package/dist/verdocs-web-sdk/p-6d65d54e.system.entry.js +0 -1
  148. package/dist/verdocs-web-sdk/p-8795dbe8.entry.js +0 -1
  149. package/dist/verdocs-web-sdk/p-8c6db319.entry.js +0 -1
  150. package/dist/verdocs-web-sdk/p-8c6e29a5.entry.js +0 -1
  151. package/dist/verdocs-web-sdk/p-92632d8e.system.entry.js +0 -1
  152. package/dist/verdocs-web-sdk/p-9fbb3fc2.entry.js +0 -1
  153. package/dist/verdocs-web-sdk/p-b1cd24f7.entry.js +0 -1
  154. package/dist/verdocs-web-sdk/p-cd6d1fe5.system.entry.js +0 -1
  155. package/dist/verdocs-web-sdk/p-e3659c64.system.js +0 -1
  156. package/dist/verdocs-web-sdk/p-e609b2ee.system.js +0 -1
  157. package/dist/verdocs-web-sdk/p-ef932a87.js +0 -1
  158. package/dist/verdocs-web-sdk/p-f9d431ef.entry.js +0 -1
@@ -1 +0,0 @@
1
- var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function n(r,t,n){return r(n={path:t,exports:{},require:function(){return e()}},n.exports),n.exports}function i(r){if(r.__esModule)return r;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(r).forEach((function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})})),t}function e(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var u=r.process;const f="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var o=[],s=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,h=!1;function c(){h=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=r.length;t<n;++t)o[t]=r[t],s[r.charCodeAt(t)]=t;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63}function v(r,t,n){for(var i,e=[],u=t;u<n;u+=3)e.push(o[(i=(r[u]<<16)+(r[u+1]<<8)+r[u+2])>>18&63]+o[i>>12&63]+o[i>>6&63]+o[63&i]);return e.join("")}function w(r,t,n,i,e){var u,f,o=8*e-i-1,s=(1<<o)-1,a=s>>1,h=-7,c=n?e-1:0,v=n?-1:1,w=r[t+c];for(c+=v,u=w&(1<<-h)-1,w>>=-h,h+=o;h>0;u=256*u+r[t+c],c+=v,h-=8);for(f=u&(1<<-h)-1,u>>=-h,h+=i;h>0;f=256*f+r[t+c],c+=v,h-=8);if(0===u)u=1-a;else{if(u===s)return f?NaN:1/0*(w?-1:1);f+=Math.pow(2,i),u-=a}return(w?-1:1)*f*Math.pow(2,u-i)}function l(r,t,n,i,e,u){var f,o,s,a=8*u-e-1,h=(1<<a)-1,c=h>>1,v=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,w=i?0:u-1,l=i?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,f=h):(f=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-f))<1&&(f--,s*=2),(t+=f+c>=1?v/s:v*Math.pow(2,1-c))*s>=2&&(f++,s/=2),f+c>=h?(o=0,f=h):f+c>=1?(o=(t*s-1)*Math.pow(2,e),f+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,e),f=0));e>=8;r[n+w]=255&o,w+=l,o/=256,e-=8);for(f=f<<e|o,a+=e;a>0;r[n+w]=255&f,w+=l,f/=256,a-=8);r[n+w-l]|=128*g}var g={}.toString,y=Array.isArray||function(r){return"[object Array]"==g.call(r)};function d(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function b(r,t){if(d()<t)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t)).__proto__=p.prototype:(null===r&&(r=new p(t)),r.length=t),r}function p(r,t,n){if(!(p.TYPED_ARRAY_SUPPORT||this instanceof p))return new p(r,t,n);if("number"==typeof r){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return A(this,r)}return m(this,r,t,n)}function m(r,t,n,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(r,t,n,i){if(n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i),p.TYPED_ARRAY_SUPPORT?(r=t).__proto__=p.prototype:r=M(r,t),r}(r,t,n,i):"string"==typeof t?function(r,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!p.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|T(t,n),e=(r=b(r,i)).write(t,n);return e!==i&&(r=r.slice(0,e)),r}(r,t,n):function(r,t){if(R(t)){var n=0|B(t.length);return 0===(r=b(r,n)).length||t.copy(r,0,0,n),r}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?b(r,0):M(r,t);if("Buffer"===t.type&&y(t.data))return M(r,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(r,t)}function E(r){if("number"!=typeof r)throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function A(r,t){if(E(t),r=b(r,t<0?0:0|B(t)),!p.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)r[n]=0;return r}function M(r,t){var n=t.length<0?0:0|B(t.length);r=b(r,n);for(var i=0;i<n;i+=1)r[i]=255&t[i];return r}function B(r){if(r>=d())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d().toString(16)+" bytes");return 0|r}function R(r){return!(null==r||!r._isBuffer)}function T(r,t){if(R(r))return r.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;"string"!=typeof r&&(r=""+r);var n=r.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return X(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(r).length;default:if(i)return X(r).length;t=(""+t).toLowerCase(),i=!0}}function x(r,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return Z(this,t,n);case"utf8":case"utf-8":return q(this,t,n);case"ascii":return D(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}function U(r,t,n){var i=r[t];r[t]=r[n],r[n]=i}function k(r,t,n,i,e){if(0===r.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=e?0:r.length-1),n<0&&(n=r.length+n),n>=r.length){if(e)return-1;n=r.length-1}else if(n<0){if(!e)return-1;n=0}if("string"==typeof t&&(t=p.from(t,i)),R(t))return 0===t.length?-1:N(r,t,n,i,e);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(r,t,n):Uint8Array.prototype.lastIndexOf.call(r,t,n):N(r,[t],n,i,e);throw new TypeError("val must be string, number or Buffer")}function N(r,t,n,i,e){var u,f=1,o=r.length,s=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(r.length<2||t.length<2)return-1;f=2,o/=2,s/=2,n/=2}function a(r,t){return 1===f?r[t]:r.readUInt16BE(t*f)}if(e){var h=-1;for(u=n;u<o;u++)if(a(r,u)===a(t,-1===h?0:u-h)){if(-1===h&&(h=u),u-h+1===s)return h*f}else-1!==h&&(u-=u-h),h=-1}else for(n+s>o&&(n=o-s),u=n;u>=0;u--){for(var c=!0,v=0;v<s;v++)if(a(r,u+v)!==a(t,v)){c=!1;break}if(c)return u}return-1}function S(r,t,n,i){n=Number(n)||0;var e=r.length-n;i?(i=Number(i))>e&&(i=e):i=e;var u=t.length;if(u%2!=0)throw new TypeError("Invalid hex string");i>u/2&&(i=u/2);for(var f=0;f<i;++f){var o=parseInt(t.substr(2*f,2),16);if(isNaN(o))return f;r[n+f]=o}return f}function I(r,t,n,i){return $(X(t,r.length-n),r,n,i)}function j(r,t,n,i){return $(function(r){for(var t=[],n=0;n<r.length;++n)t.push(255&r.charCodeAt(n));return t}(t),r,n,i)}function z(r,t,n,i){return j(r,t,n,i)}function O(r,t,n,i){return $(Y(t),r,n,i)}function F(r,t,n,i){return $(function(r,t){for(var n,i,e=[],u=0;u<r.length&&!((t-=2)<0);++u)i=(n=r.charCodeAt(u))>>8,e.push(n%256),e.push(i);return e}(t,r.length-n),r,n,i)}function _(r,t,n){return function(r){var t;h||c();for(var n=r.length,i=n%3,e="",u=[],f=16383,s=0,a=n-i;s<a;s+=f)u.push(v(r,s,s+f>a?a:s+f));return 1===i?(e+=o[(t=r[n-1])>>2],e+=o[t<<4&63],e+="=="):2===i&&(e+=o[(t=(r[n-2]<<8)+r[n-1])>>10],e+=o[t>>4&63],e+=o[t<<2&63],e+="="),u.push(e),u.join("")}(0===t&&n===r.length?r:r.slice(t,n))}function q(r,t,n){n=Math.min(r.length,n);for(var i=[],e=t;e<n;){var u,f,o,s,a=r[e],h=null,c=a>239?4:a>223?3:a>191?2:1;if(e+c<=n)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(u=r[e+1]))&&(s=(31&a)<<6|63&u)>127&&(h=s);break;case 3:f=r[e+2],128==(192&(u=r[e+1]))&&128==(192&f)&&(s=(15&a)<<12|(63&u)<<6|63&f)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:f=r[e+2],o=r[e+3],128==(192&(u=r[e+1]))&&128==(192&f)&&128==(192&o)&&(s=(15&a)<<18|(63&u)<<12|(63&f)<<6|63&o)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(i.push((h-=65536)>>>10&1023|55296),h=56320|1023&h),i.push(h),e+=c}return function(r){var t=r.length;if(t<=4096)return String.fromCharCode.apply(String,r);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,r.slice(i,i+=4096));return n}(i)}function D(r,t,n){var i="";n=Math.min(r.length,n);for(var e=t;e<n;++e)i+=String.fromCharCode(127&r[e]);return i}function L(r,t,n){var i="";n=Math.min(r.length,n);for(var e=t;e<n;++e)i+=String.fromCharCode(r[e]);return i}function Z(r,t,n){var i,e=r.length;(!t||t<0)&&(t=0),(!n||n<0||n>e)&&(n=e);for(var u="",f=t;f<n;++f)u+=(i=r[f])<16?"0"+i.toString(16):i.toString(16);return u}function C(r,t,n){for(var i=r.slice(t,n),e="",u=0;u<i.length;u+=2)e+=String.fromCharCode(i[u]+256*i[u+1]);return e}function G(r,t,n){if(r%1!=0||r<0)throw new RangeError("offset is not uint");if(r+t>n)throw new RangeError("Trying to access beyond buffer length")}function H(r,t,n,i,e,u){if(!R(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>e||t<u)throw new RangeError('"value" argument is out of bounds');if(n+i>r.length)throw new RangeError("Index out of range")}function J(r,t,n,i){t<0&&(t=65535+t+1);for(var e=0,u=Math.min(r.length-n,2);e<u;++e)r[n+e]=(t&255<<8*(i?e:1-e))>>>8*(i?e:1-e)}function K(r,t,n,i){t<0&&(t=4294967295+t+1);for(var e=0,u=Math.min(r.length-n,4);e<u;++e)r[n+e]=t>>>8*(i?e:3-e)&255}function P(r,t,n,i){if(n+i>r.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Q(r,t,n,i,e){return e||P(r,0,n,4),l(r,t,n,i,23,4),n+4}function V(r,t,n,i,e){return e||P(r,0,n,8),l(r,t,n,i,52,8),n+8}p.TYPED_ARRAY_SUPPORT=void 0===f.TYPED_ARRAY_SUPPORT||f.TYPED_ARRAY_SUPPORT,p.poolSize=8192,p._augment=function(r){return r.__proto__=p.prototype,r},p.from=function(r,t,n){return m(null,r,t,n)},p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array),p.alloc=function(r,t,n){return function(r,t,n,i){return E(t),t<=0?b(r,t):void 0!==n?"string"==typeof i?b(r,t).fill(n,i):b(r,t).fill(n):b(r,t)}(null,r,t,n)},p.allocUnsafe=function(r){return A(null,r)},p.allocUnsafeSlow=function(r){return A(null,r)},p.isBuffer=function(r){return null!=r&&(!!r._isBuffer||rr(r)||function(r){return"function"==typeof r.readFloatLE&&"function"==typeof r.slice&&rr(r.slice(0,0))}(r))},p.compare=function(r,t){if(!R(r)||!R(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var n=r.length,i=t.length,e=0,u=Math.min(n,i);e<u;++e)if(r[e]!==t[e]){n=r[e],i=t[e];break}return n<i?-1:i<n?1:0},p.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(r,t){if(!y(r))throw new TypeError('"list" argument must be an Array of Buffers');if(0===r.length)return p.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<r.length;++n)t+=r[n].length;var i=p.allocUnsafe(t),e=0;for(n=0;n<r.length;++n){var u=r[n];if(!R(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,e),e+=u.length}return i},p.byteLength=T,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var r=this.length;if(r%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)U(this,t,t+1);return this},p.prototype.swap32=function(){var r=this.length;if(r%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)U(this,t,t+3),U(this,t+1,t+2);return this},p.prototype.swap64=function(){var r=this.length;if(r%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)U(this,t,t+7),U(this,t+1,t+6),U(this,t+2,t+5),U(this,t+3,t+4);return this},p.prototype.toString=function(){var r=0|this.length;return 0===r?"":0===arguments.length?q(this,0,r):x.apply(this,arguments)},p.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r||0===p.compare(this,r)},p.prototype.inspect=function(){var r="";return this.length>0&&(r=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(r+=" ... ")),"<Buffer "+r+">"},p.prototype.compare=function(r,t,n,i,e){if(!R(r))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=r?r.length:0),void 0===i&&(i=0),void 0===e&&(e=this.length),t<0||n>r.length||i<0||e>this.length)throw new RangeError("out of range index");if(i>=e&&t>=n)return 0;if(i>=e)return-1;if(t>=n)return 1;if(this===r)return 0;for(var u=(e>>>=0)-(i>>>=0),f=(n>>>=0)-(t>>>=0),o=Math.min(u,f),s=this.slice(i,e),a=r.slice(t,n),h=0;h<o;++h)if(s[h]!==a[h]){u=s[h],f=a[h];break}return u<f?-1:f<u?1:0},p.prototype.includes=function(r,t,n){return-1!==this.indexOf(r,t,n)},p.prototype.indexOf=function(r,t,n){return k(this,r,t,n,!0)},p.prototype.lastIndexOf=function(r,t,n){return k(this,r,t,n,!1)},p.prototype.write=function(r,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var e=this.length-t;if((void 0===n||n>e)&&(n=e),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var u=!1;;)switch(i){case"hex":return S(this,r,t,n);case"utf8":case"utf-8":return I(this,r,t,n);case"ascii":return j(this,r,t,n);case"latin1":case"binary":return z(this,r,t,n);case"base64":return O(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,r,t,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.slice=function(r,t){var n,i=this.length;if((r=~~r)<0?(r+=i)<0&&(r=0):r>i&&(r=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<r&&(t=r),p.TYPED_ARRAY_SUPPORT)(n=this.subarray(r,t)).__proto__=p.prototype;else{var e=t-r;n=new p(e,void 0);for(var u=0;u<e;++u)n[u]=this[u+r]}return n},p.prototype.readUIntLE=function(r,t,n){r|=0,t|=0,n||G(r,t,this.length);for(var i=this[r],e=1,u=0;++u<t&&(e*=256);)i+=this[r+u]*e;return i},p.prototype.readUIntBE=function(r,t,n){r|=0,t|=0,n||G(r,t,this.length);for(var i=this[r+--t],e=1;t>0&&(e*=256);)i+=this[r+--t]*e;return i},p.prototype.readUInt8=function(r,t){return t||G(r,1,this.length),this[r]},p.prototype.readUInt16LE=function(r,t){return t||G(r,2,this.length),this[r]|this[r+1]<<8},p.prototype.readUInt16BE=function(r,t){return t||G(r,2,this.length),this[r]<<8|this[r+1]},p.prototype.readUInt32LE=function(r,t){return t||G(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},p.prototype.readUInt32BE=function(r,t){return t||G(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},p.prototype.readIntLE=function(r,t,n){r|=0,t|=0,n||G(r,t,this.length);for(var i=this[r],e=1,u=0;++u<t&&(e*=256);)i+=this[r+u]*e;return i>=(e*=128)&&(i-=Math.pow(2,8*t)),i},p.prototype.readIntBE=function(r,t,n){r|=0,t|=0,n||G(r,t,this.length);for(var i=t,e=1,u=this[r+--i];i>0&&(e*=256);)u+=this[r+--i]*e;return u>=(e*=128)&&(u-=Math.pow(2,8*t)),u},p.prototype.readInt8=function(r,t){return t||G(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},p.prototype.readInt16LE=function(r,t){t||G(r,2,this.length);var n=this[r]|this[r+1]<<8;return 32768&n?4294901760|n:n},p.prototype.readInt16BE=function(r,t){t||G(r,2,this.length);var n=this[r+1]|this[r]<<8;return 32768&n?4294901760|n:n},p.prototype.readInt32LE=function(r,t){return t||G(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},p.prototype.readInt32BE=function(r,t){return t||G(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},p.prototype.readFloatLE=function(r,t){return t||G(r,4,this.length),w(this,r,!0,23,4)},p.prototype.readFloatBE=function(r,t){return t||G(r,4,this.length),w(this,r,!1,23,4)},p.prototype.readDoubleLE=function(r,t){return t||G(r,8,this.length),w(this,r,!0,52,8)},p.prototype.readDoubleBE=function(r,t){return t||G(r,8,this.length),w(this,r,!1,52,8)},p.prototype.writeUIntLE=function(r,t,n,i){r=+r,t|=0,n|=0,i||H(this,r,t,n,Math.pow(2,8*n)-1,0);var e=1,u=0;for(this[t]=255&r;++u<n&&(e*=256);)this[t+u]=r/e&255;return t+n},p.prototype.writeUIntBE=function(r,t,n,i){r=+r,t|=0,n|=0,i||H(this,r,t,n,Math.pow(2,8*n)-1,0);var e=n-1,u=1;for(this[t+e]=255&r;--e>=0&&(u*=256);)this[t+e]=r/u&255;return t+n},p.prototype.writeUInt8=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,1,255,0),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=255&r,t+1},p.prototype.writeUInt16LE=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=255&r,this[t+1]=r>>>8):J(this,r,t,!0),t+2},p.prototype.writeUInt16BE=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=255&r):J(this,r,t,!1),t+2},p.prototype.writeUInt32LE=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=255&r):K(this,r,t,!0),t+4},p.prototype.writeUInt32BE=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=255&r):K(this,r,t,!1),t+4},p.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t|=0,!i){var e=Math.pow(2,8*n-1);H(this,r,t,n,e-1,-e)}var u=0,f=1,o=0;for(this[t]=255&r;++u<n&&(f*=256);)r<0&&0===o&&0!==this[t+u-1]&&(o=1),this[t+u]=(r/f>>0)-o&255;return t+n},p.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t|=0,!i){var e=Math.pow(2,8*n-1);H(this,r,t,n,e-1,-e)}var u=n-1,f=1,o=0;for(this[t+u]=255&r;--u>=0&&(f*=256);)r<0&&0===o&&0!==this[t+u+1]&&(o=1),this[t+u]=(r/f>>0)-o&255;return t+n},p.prototype.writeInt8=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=255&r,t+1},p.prototype.writeInt16LE=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&r,this[t+1]=r>>>8):J(this,r,t,!0),t+2},p.prototype.writeInt16BE=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=255&r):J(this,r,t,!1),t+2},p.prototype.writeInt32LE=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&r,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):K(this,r,t,!0),t+4},p.prototype.writeInt32BE=function(r,t,n){return r=+r,t|=0,n||H(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),p.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=255&r):K(this,r,t,!1),t+4},p.prototype.writeFloatLE=function(r,t,n){return Q(this,r,t,!0,n)},p.prototype.writeFloatBE=function(r,t,n){return Q(this,r,t,!1,n)},p.prototype.writeDoubleLE=function(r,t,n){return V(this,r,t,!0,n)},p.prototype.writeDoubleBE=function(r,t,n){return V(this,r,t,!1,n)},p.prototype.copy=function(r,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===r.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t<i-n&&(i=r.length-t+n);var e,u=i-n;if(this===r&&n<t&&t<i)for(e=u-1;e>=0;--e)r[e+t]=this[e+n];else if(u<1e3||!p.TYPED_ARRAY_SUPPORT)for(e=0;e<u;++e)r[e+t]=this[e+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+u),t);return u},p.prototype.fill=function(r,t,n,i){if("string"==typeof r){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===r.length){var e=r.charCodeAt(0);e<256&&(r=e)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!p.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof r&&(r&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var u;if(t>>>=0,n=void 0===n?this.length:n>>>0,r||(r=0),"number"==typeof r)for(u=t;u<n;++u)this[u]=r;else{var f=R(r)?r:X(new p(r,i).toString()),o=f.length;for(u=0;u<n-t;++u)this[u+t]=f[u%o]}return this};var W=/[^+\/0-9A-Za-z-_]/g;function X(r,t){var n;t=t||1/0;for(var i=r.length,e=null,u=[],f=0;f<i;++f){if((n=r.charCodeAt(f))>55295&&n<57344){if(!e){if(n>56319){(t-=3)>-1&&u.push(239,191,189);continue}if(f+1===i){(t-=3)>-1&&u.push(239,191,189);continue}e=n;continue}if(n<56320){(t-=3)>-1&&u.push(239,191,189),e=n;continue}n=65536+(e-55296<<10|n-56320)}else e&&(t-=3)>-1&&u.push(239,191,189);if(e=null,n<128){if((t-=1)<0)break;u.push(n)}else if(n<2048){if((t-=2)<0)break;u.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;u.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;u.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return u}function Y(r){return function(r){var t,n,i,e,u,f;h||c();var o=r.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=new a(3*o/4-(u="="===r[o-2]?2:"="===r[o-1]?1:0)),i=u>0?o-4:o;var v=0;for(t=0,n=0;t<i;t+=4,n+=3)e=s[r.charCodeAt(t)]<<18|s[r.charCodeAt(t+1)]<<12|s[r.charCodeAt(t+2)]<<6|s[r.charCodeAt(t+3)],f[v++]=e>>16&255,f[v++]=e>>8&255,f[v++]=255&e;return 2===u?(e=s[r.charCodeAt(t)]<<2|s[r.charCodeAt(t+1)]>>4,f[v++]=255&e):1===u&&(e=s[r.charCodeAt(t)]<<10|s[r.charCodeAt(t+1)]<<4|s[r.charCodeAt(t+2)]>>2,f[v++]=e>>8&255,f[v++]=255&e),f}(function(r){if((r=function(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}(r).replace(W,"")).length<2)return"";for(;r.length%4!=0;)r+="=";return r}(r))}function $(r,t,n,i){for(var e=0;e<i&&!(e+n>=t.length||e>=r.length);++e)t[e+n]=r[e];return e}function rr(r){return!!r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r)}export{p as B,t as a,r as b,n as c,e as d,i as g,u as p}
@@ -1 +0,0 @@
1
- import{r as e,h as t,H as o}from"./p-2bc58746.js";import{g as i,d as n,V as r,s}from"./p-6348272c.js";import{B as a}from"./p-ef932a87.js";function c(e){switch(e%10){case 0:return 0===e?"rgba(255, 193, 7, 0.4)":"rgba(134, 134, 134, 0.3)";case 1:return"rgba(156, 39, 176, .4)";case 2:return"rgba(33, 150, 243, .4)";case 3:return"rgba(220, 231, 117, 0.3)";case 4:return"rgba(121, 134, 203, 0.3)";case 5:return"rgba(77, 182, 172, 0.3)";case 6:return"rgba(255, 202, 165, 0.3)";case 7:return"rgba(2, 247, 190, 0.3)";case 8:return"rgba(255, 138, 101, 0.3)";case 9:return"rgba(82, 255, 79, 0.3)";default:return"rgba(229, 115, 155, 0.3)"}}function l(e,t){return e*t}var d=function(){return(d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},u=new RegExp(/\+[1-9]\d{6,14}/g),h=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,p=function(e,t,o,i){return new(o||(o=Promise))((function(n,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))},f=function(e,t){var o,i,n,r,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},v=function(e,t,o){return p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.put("/documents/".concat(e,"/fields/").concat(t),o).then((function(e){return e.data}))]}))}))};const b="https://stage-api.verdocs.com",g=class{constructor(t){e(this,t),this.documentid=null,this.roleid=null,this.invitecode=null,this.endpoint=null,this.recipient=null,this.signerToken=null,this.pdfUrl=null,this.recipientIndex=-1,this.document=null,this.fields=[],this.hasSignature=!1,this.nextButtonLabel="Start",this.focusedField=""}componentWillLoad(){const e=(new r).setBaseURL(b);s(e)}async componentDidLoad(){try{console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);const{session:o,recipient:r,signerToken:s}=await(t={documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode},p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(t.documentId,"/recipients/").concat(encodeURIComponent(t.roleId),"/invitation/").concat(t.inviteCode)).then((function(e){var t,o,r=(null===(t=e.headers)||void 0===t?void 0:t.signer_token)||"",s=n(r);return i().setAuthorization(null===(o=e.headers)||void 0===o?void 0:o.signer_token),{recipient:e.data,session:s,signerToken:r}}))]}))})));console.log("[SIGN] Got signing session",o),console.log("[SIGN] Recipient",r),this.recipient=r,this.signerToken=s,i().setSigningAuthorization(s),this.recipient.agreed&&(this.nextButtonLabel="Next");const a=await(e=this.documentid,p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(e)).then((function(e){return e.data}))]}))})));this.document=a,console.log("[SIGN] Document",a),this.pdfUrl=`${b}/documents/${this.documentid}/envelope_documents/${a.envelope_document_id}?file=true`,this.recipientIndex=this.document.recipients.findIndex((e=>e.role_name==this.roleid)),this.recipientIndex>-1&&console.log("Found recipient",this.document.recipients[this.recipientIndex]),this.fields=this.document.fields.filter((e=>e.recipient_role===this.roleid)),console.log("Loaded fields",this.fields)}catch(e){console.log("Error with signing session",e)}var e,t}handleClickAgree(){var e,t,o,n,r,s,a;console.log("agree clicked"),(e=this.documentid,t=this.roleid,"update",o={agreed:!0},n=void 0,r=void 0,s=void 0,a=function(){return function(e,t){var o,i,n,r,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}(this,(function(){return[2,i().api.put("/documents/".concat(e,"/recipients/").concat(t),d({role_name:t,action:"update"},o||{})).then((function(e){return e.data}))]}))},new(s||(s=Promise))((function(e,t){function o(e){try{c(a.next(e))}catch(e){t(e)}}function i(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(o,i)}c((a=a.apply(n,r||[])).next())}))).then((e=>{console.log("update result",e),this.nextButtonLabel="Next",this.recipient=e})).catch((e=>{console.log("update failure",e)}))}async savePDF(){const e=`${this.document.name} - ${this.document.updated_at.split("T")[0]}.pdf`,t=await(o=this.documentid,n=this.document.envelope_document_id,p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(o,"/envelope_documents/").concat(n,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return a.from(e.data,"binary").toString("base64")}))]}))})));var o,n;let r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){let t=document.createElement("a");t.href=window.URL.createObjectURL(r.response),t.download=e,t.style.display="none",document.body.appendChild(t),t.click(),t.remove()};const s=`data:application/pdf;base64,${t}`;console.log("url",s.length,s),r.open("GET",`data:application/pdf;base64,${t}`),r.send()}async handleOptionSelected(e){switch(e.detail.id){case"later":(null===window||void 0===window?void 0:window.STORYBOOK_ENV)||window.alert("User intends to sign later.");break;case"claim":case"decline":case"print":break;case"download":this.savePDF().catch((()=>{}))}}async handleFieldChange(e,t,o){switch(console.log("fieldChange",e,t.detail),e.type){case"textbox":v(this.documentid,e.name,{prepared:!1,value:t.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"checkbox_group":v(this.documentid,e.name,{prepared:!1,value:{options:[{id:o,checked:t.detail}]}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"radio_button_group":const i=e.settings.options.map((e=>({id:e.id,selected:o===e.id})));v(this.documentid,e.name,{prepared:!1,value:{options:i}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"dropdown":v(this.documentid,e.name,{prepared:!1,value:t.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"initial":console.log("Got initial",t.detail);break;case"signature":console.log("Got signature",t.detail)}}renderCheckboxGroupOption(e,o,i,n){const r={left:`${l(e.xRatio,i.x)}px`,bottom:`${l(e.yRatio,i.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:c(this.recipientIndex)};return t("verdocs-field-checkbox",{style:r,order:n,value:i.checked,onFieldChange:e=>this.handleFieldChange(o,e,i.id)})}renderRadioGroupOption(e,o,i,n){const r={left:`${l(e.xRatio,i.x)}px`,bottom:`${l(e.yRatio,i.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:c(this.recipientIndex)};return t("verdocs-field-radio-button",{style:r,order:n,value:i.id,name:o.name,checked:i.selected,onFieldChange:e=>this.handleFieldChange(o,e,i.id)})}renderField(e,o){const{required:i=!1,settings:n={}}=e,{x:r=0,y:s=0,base64:a="",placeholder:d="",options:u=[],value:h="",result:p=""}=n,f=this.pdfPageInfo.pages.find((t=>t.pageNumber===e.page));if(!f)return console.log("Unable to render invalid field",e),t("div",{class:"invalid-field"},"Invalid field.");const v={left:`${l(f.xRatio,r)}px`,bottom:`${l(f.yRatio,s)}px`,position:"absolute",transform:`scale(${f.xRatio}, ${f.yRatio})`,backgroundColor:e.settings.rgba||c(this.recipientIndex)};e.settings.height&&(v.height=`${e.settings.height}px`),e.settings.width&&(v.width=`${e.settings.width}px`),console.log("rendering field",e.type,e);const b=`field-${e.name}`;switch(e.type){case"signature":return t("verdocs-field-signature",{style:v,value:a,required:i,id:b});case"initial":return t("verdocs-field-initial",{style:v,required:i,id:b});case"textbox":return t("verdocs-field-textbox",{style:v,order:o,value:p||"",placeholder:d,id:b,onFieldChange:t=>this.handleFieldChange(e,t)});case"textarea":return t("verdocs-field-textarea",{style:v,placeholder:d||"",id:b});case"date":return t("verdocs-field-date",{style:v,order:o,value:p||"",placeholder:d,required:i,id:b});case"dropdown":return t("verdocs-field-dropdown",{style:v,options:u,value:h,required:i,id:b,onFieldChange:t=>this.handleFieldChange(e,t)});case"checkbox":return t("verdocs-field-checkbox",{style:v,value:p||"",id:b});case"checkbox_group":return e.settings.options.map(((t,o)=>this.renderCheckboxGroupOption(f,e,t,o)));case"radio_button_group":return e.settings.options.map(((t,o)=>this.renderRadioGroupOption(f,e,t,o)));case"attachment":return t("verdocs-field-attachment",{style:v,value:p||"",id:b});case"payment":return t("verdocs-field-payment",{style:v,field:e,id:b});default:console.log("[SIGN] Skipping unsupported field type",e)}return t("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')}isFieldValid(e){var t,o,i,n,r,s,a,c,l,d,p,f,v;switch(e.type){case"textbox":switch((null===(t=e.settings)||void 0===t?void 0:t.validator)||""){case"email":return v=(null===(o=e.settings)||void 0===o?void 0:o.result)||"",h.test(v);case"phone":return function(e){return null!==(t=e)&&t.length<16&&t.length>6&&u.test(t)||""===t||null===t;var t}((null===(i=e.settings)||void 0===i?void 0:i.result)||"");default:return!!(null===(n=e.settings)||void 0===n?void 0:n.result)}case"signature":case"initial":case"textarea":case"date":case"attachment":return!!(null===(r=e.settings)||void 0===r?void 0:r.result);case"dropdown":return!!(null===(s=e.settings)||void 0===s?void 0:s.value);case"checkbox_group":const b=((null===(c=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===c?void 0:c.filter((e=>e.checked)))||[]).length;return b>=((null===(l=e.settings)||void 0===l?void 0:l.minimum_checked)||0)&&b<=((null===(d=e.settings)||void 0===d?void 0:d.maximum_checked)||999);case"radio_button_group":return((null===(f=null===(p=e.settings)||void 0===p?void 0:p.options)||void 0===f?void 0:f.filter((e=>e.selected)))||[]).length>0;default:return!1}}handleDocumentRendered(e){console.log("[SIGN] Document rendered",e.detail),this.pdfPageInfo=e.detail}handleNext(){const e=this.fields.filter((e=>e.required));console.log("required Fields",e);const t=e.findIndex((e=>e.name===this.focusedField));console.log("focused Index",t);let o=t+1;o>=e.length&&(o=0);const i=e[o];if(console.log("next required fielod",i),i){const e=document.getElementById(`field-${i.name}`);null==e||e.focusField(),this.focusedField=i.name}}render(){var e,i,n,r,s;return t(o,{class:{storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV),agreed:null===(e=this.recipient)||void 0===e?void 0:e.agreed}},t("div",{class:"header"},t("div",{class:"intro"},"Please review and act on these documents."),t("div",{class:"toolbar"},t("div",{class:"tools"},t("verdocs-dropdown",{options:[{id:"later",label:"Finish Later"},{id:"claim",label:"Claim the Document",disabled:!0},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],onOptionSelected:e=>this.handleOptionSelected(e)}),(null===(i=this.recipient)||void 0===i?void 0:i.agreed)?t("div",{style:{flex:"1"}}):t("div",{style:{flex:"1",flexDirection:"row",display:"flex",alignItems:"center"}},t("div",{class:"agree-checkbox"},t("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:()=>this.handleClickAgree()}),t("label",{htmlFor:"agree-checkbox-element"})),"I agree to use electronic records and signatures."),t("verdocs-button",{label:this.nextButtonLabel,disabled:!(null===(n=this.recipient)||void 0===n?void 0:n.agreed),onClick:()=>this.handleNext()})))),(null===(r=this.recipient)||void 0===r?void 0:r.agreed)?t("div",{style:{display:"none"}}):t("div",{class:"cover"}),t("div",{class:"document"},this.pdfUrl?t("verdocs-view",{source:this.pdfUrl,token:this.signerToken,onDocumentRendered:e=>this.handleDocumentRendered(e)}):t("verdocs-loader",null),((null===(s=this.pdfPageInfo)||void 0===s?void 0:s.pages)||[]).map((e=>{var o;return t("div",{class:"page-controls",style:{height:`${e.height}px`,width:`${e.width}px`,top:`${e.canvasTop}px`,margin:"0 auto"}},(null===(o=this.pdfPageInfo)||void 0===o?void 0:o.numRendered)>0?this.fields.filter((t=>t.page===e.pageNumber)).map(((e,t)=>this.renderField(e,t))):t("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))}};g.style='verdocs-sign{font-family:"Barlow", sans-serif;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:600px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}verdocs-sign.storybook{max-height:600px}verdocs-sign div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign .header{-ms-flex:0 0 115px;flex:0 0 115px;z-index:1000;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);-webkit-transition:all 0.25s;transition:all 0.25s}verdocs-sign .intro{background-color:#ffffff;width:100%;margin:0 auto;padding:20px;max-width:1028px;color:rgba(0, 0, 0, 0.87)}verdocs-sign .toolbar{width:100%;margin:0 auto;padding:0 20px;max-width:1028px;position:relative}verdocs-sign .tools{width:100%;color:#fff;height:56px;padding:4px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;position:relative;overflow-y:scroll}verdocs-sign .agree-checkbox{-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;background:#ffffff;position:relative;margin:0 10px 0 30px}verdocs-sign .agree-checkbox label{left:2px;top:2px;width:16px;height:16px;cursor:pointer;position:absolute;background:#33354c;-webkit-box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8);box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8)}verdocs-sign .agree-checkbox label:after{top:2px;left:3px;width:8px;opacity:0;height:5px;content:"";position:absolute;background:transparent;filter:alpha(opacity=0);-webkit-transform:rotate(-45deg);transform:rotate(-45deg);border:2px solid #fcfff4;border-top:none;border-right:none}verdocs-sign .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign.agreed .intro{display:none}verdocs-sign.agreed .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign.agreed .agree-checkbox{background:#ccc}verdocs-sign.agreed .agree-checkbox label{cursor:default}verdocs-sign .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';export{g as verdocs_sign}