@verdocs/web-sdk 1.5.1 → 1.5.5
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.
- package/dist/cjs/{VerdocsEndpoint-5e6dd8ef.js → VerdocsEndpoint-2c7ecda8.js} +7 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +3 -7
- package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +1 -1
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +2 -24
- package/dist/components/VerdocsEndpoint.js +7 -0
- package/dist/components/verdocs-sign.js +1 -1
- package/dist/components/verdocs-view2.js +2 -7
- package/dist/custom-elements.json +826 -0
- package/dist/docs.json +1 -18
- package/dist/esm/{VerdocsEndpoint-30e1b6ec.js → VerdocsEndpoint-1dbbd8e2.js} +7 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-dropdown_12.entry.js +3 -7
- package/dist/esm/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm/verdocs-search-activity_2.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +2 -2
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{VerdocsEndpoint-30e1b6ec.js → VerdocsEndpoint-1dbbd8e2.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_12.entry.js +2 -2
- package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +0 -5
- package/dist/types/components.d.ts +0 -8
- package/dist/verdocs-web-sdk/{p-d522de7d.entry.js → p-4cfc0f04.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f6a53928.system.entry.js → p-4e98796c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1b4e04b7.system.entry.js → p-5bd83ddc.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c29c2cf8.entry.js → p-6b8bc6f4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4d80d044.system.js → p-6fd6ae35.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-16d62a51.system.entry.js → p-7adcb52c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-8276345a.entry.js → p-9e3a842c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-aa9fc574.entry.js → p-a55ed8ce.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-06f38046.js → p-c34360d3.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9139a76d.system.entry.js → p-cc12ccaa.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-30cc8818.entry.js → p-e3229752.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1ea3b9d3.entry.js → p-f74862f7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c4d03ff9.system.entry.js → p-f76721d3.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a87069d5.system.entry.js → p-fdf34ca6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var n=[],r=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,o=t.length;e<o;++e)n[e]=t[e],r[t.charCodeAt(e)]=e;r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63}function u(t,r,e){for(var i,o=[],u=r;u<e;u+=3)o.push(n[(i=(t[u]<<16)+(t[u+1]<<8)+t[u+2])>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}function f(t,n,r,e,i){var o,u,f=8*i-e-1,s=(1<<f)-1,a=s>>1,c=-7,h=r?i-1:0,l=r?-1:1,d=t[n+h];for(h+=l,o=d&(1<<-c)-1,d>>=-c,c+=f;c>0;o=256*o+t[n+h],h+=l,c-=8);for(u=o&(1<<-c)-1,o>>=-c,c+=e;c>0;u=256*u+t[n+h],h+=l,c-=8);if(0===o)o=1-a;else{if(o===s)return u?NaN:1/0*(d?-1:1);u+=Math.pow(2,e),o-=a}return(d?-1:1)*u*Math.pow(2,o-e)}function s(t,n,r,e,i,o){var u,f,s,a=8*o-i-1,c=(1<<a)-1,h=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=e?0:o-1,v=e?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(f=isNaN(n)?1:0,u=c):(u=Math.floor(Math.log(n)/Math.LN2),n*(s=Math.pow(2,-u))<1&&(u--,s*=2),(n+=u+h>=1?l/s:l*Math.pow(2,1-h))*s>=2&&(u++,s/=2),u+h>=c?(f=0,u=c):u+h>=1?(f=(n*s-1)*Math.pow(2,i),u+=h):(f=n*Math.pow(2,h-1)*Math.pow(2,i),u=0));i>=8;t[r+d]=255&f,d+=v,f/=256,i-=8);for(u=u<<i|f,a+=i;a>0;t[r+d]=255&u,d+=v,u/=256,a-=8);t[r+d-v]|=128*p}var a={}.toString,c=Array.isArray||function(t){return"[object Array]"==a.call(t)};function h(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(t,n){if(h()<n)throw new RangeError("Invalid typed array length");return d.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(n)).__proto__=d.prototype:(null===t&&(t=new d(n)),t.length=n),t}function d(t,n,r){if(!(d.TYPED_ARRAY_SUPPORT||this instanceof d))return new d(t,n,r);if("number"==typeof t){if("string"==typeof n)throw new Error("If encoding is specified then the first argument must be a string");return m(this,t)}return v(this,t,n,r)}function v(t,n,r,e){if("number"==typeof n)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer?function(t,n,r,e){if(r<0||n.byteLength<r)throw new RangeError("'offset' is out of bounds");if(n.byteLength<r+(e||0))throw new RangeError("'length' is out of bounds");return n=void 0===r&&void 0===e?new Uint8Array(n):void 0===e?new Uint8Array(n,r):new Uint8Array(n,r,e),d.TYPED_ARRAY_SUPPORT?(t=n).__proto__=d.prototype:t=w(t,n),t}(t,n,r,e):"string"==typeof n?function(t,n,r){if("string"==typeof r&&""!==r||(r="utf8"),!d.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var e=0|b(n,r),i=(t=l(t,e)).write(n,r);return i!==e&&(t=t.slice(0,i)),t}(t,n,r):function(t,n){if(g(n)){var r=0|y(n.length);return 0===(t=l(t,r)).length||n.copy(t,0,0,r),t}if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||(e=n.length)!=e?l(t,0):w(t,n);if("Buffer"===n.type&&c(n.data))return w(t,n.data)}var e;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,n)}function p(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function m(t,n){if(p(n),t=l(t,n<0?0:0|y(n)),!d.TYPED_ARRAY_SUPPORT)for(var r=0;r<n;++r)t[r]=0;return t}function w(t,n){var r=n.length<0?0:0|y(n.length);t=l(t,r);for(var e=0;e<r;e+=1)t[e]=255&n[e];return t}function y(t){if(t>=h())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h().toString(16)+" bytes");return 0|t}function g(t){return!(null==t||!t._isBuffer)}function b(t,n){if(g(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var e=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(e)return X(t).length;n=(""+n).toLowerCase(),e=!0}}function E(t,n,r){var e=!1;if((void 0===n||n<0)&&(n=0),n>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(n>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,n,r);case"utf8":case"utf-8":return M(this,n,r);case"ascii":return k(this,n,r);case"latin1":case"binary":return D(this,n,r);case"base64":return N(this,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,n,r);default:if(e)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),e=!0}}function _(t,n,r){var e=t[n];t[n]=t[r],t[r]=e}function A(t,n,r,e,i){if(0===t.length)return-1;if("string"==typeof r?(e=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof n&&(n=d.from(n,e)),g(n))return 0===n.length?-1:R(t,n,r,e,i);if("number"==typeof n)return n&=255,d.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,n,r):Uint8Array.prototype.lastIndexOf.call(t,n,r):R(t,[n],r,e,i);throw new TypeError("val must be string, number or Buffer")}function R(t,n,r,e,i){var o,u=1,f=t.length,s=n.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(t.length<2||n.length<2)return-1;u=2,f/=2,s/=2,r/=2}function a(t,n){return 1===u?t[n]:t.readUInt16BE(n*u)}if(i){var c=-1;for(o=r;o<f;o++)if(a(t,o)===a(n,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===s)return c*u}else-1!==c&&(o-=o-c),c=-1}else for(r+s>f&&(r=f-s),o=r;o>=0;o--){for(var h=!0,l=0;l<s;l++)if(a(t,o+l)!==a(n,l)){h=!1;break}if(h)return o}return-1}function O(t,n,r,e){r=Number(r)||0;var i=t.length-r;e?(e=Number(e))>i&&(e=i):e=i;var o=n.length;if(o%2!=0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var u=0;u<e;++u){var f=parseInt(n.substr(2*u,2),16);if(isNaN(f))return u;t[r+u]=f}return u}function S(t,n,r,e){return W(X(n,t.length-r),t,r,e)}function j(t,n,r,e){return W(function(t){for(var n=[],r=0;r<t.length;++r)n.push(255&t.charCodeAt(r));return n}(n),t,r,e)}function T(t,n,r,e){return j(t,n,r,e)}function B(t,n,r,e){return W(K(n),t,r,e)}function x(t,n,r,e){return W(function(t,n){for(var r,e,i=[],o=0;o<t.length&&!((n-=2)<0);++o)e=(r=t.charCodeAt(o))>>8,i.push(r%256),i.push(e);return i}(n,t.length-r),t,r,e)}function N(t,r,e){return function(t){var r;i||o();for(var e=t.length,f=e%3,s="",a=[],c=16383,h=0,l=e-f;h<l;h+=c)a.push(u(t,h,h+c>l?l:h+c));return 1===f?(s+=n[(r=t[e-1])>>2],s+=n[r<<4&63],s+="=="):2===f&&(s+=n[(r=(t[e-2]<<8)+t[e-1])>>10],s+=n[r>>4&63],s+=n[r<<2&63],s+="="),a.push(s),a.join("")}(0===r&&e===t.length?t:t.slice(r,e))}function M(t,n,r){r=Math.min(t.length,r);for(var e=[],i=n;i<r;){var o,u,f,s,a=t[i],c=null,h=a>239?4:a>223?3:a>191?2:1;if(i+h<=r)switch(h){case 1:a<128&&(c=a);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&a)<<6|63&o)>127&&(c=s);break;case 3:u=t[i+2],128==(192&(o=t[i+1]))&&128==(192&u)&&(s=(15&a)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:u=t[i+2],f=t[i+3],128==(192&(o=t[i+1]))&&128==(192&u)&&128==(192&f)&&(s=(15&a)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(c=s)}null===c?(c=65533,h=1):c>65535&&(e.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),e.push(c),i+=h}return function(t){var n=t.length;if(n<=4096)return String.fromCharCode.apply(String,t);for(var r="",e=0;e<n;)r+=String.fromCharCode.apply(String,t.slice(e,e+=4096));return r}(e)}function k(t,n,r){var e="";r=Math.min(t.length,r);for(var i=n;i<r;++i)e+=String.fromCharCode(127&t[i]);return e}function D(t,n,r){var e="";r=Math.min(t.length,r);for(var i=n;i<r;++i)e+=String.fromCharCode(t[i]);return e}function U(t,n,r){var e,i=t.length;(!n||n<0)&&(n=0),(!r||r<0||r>i)&&(r=i);for(var o="",u=n;u<r;++u)o+=(e=t[u])<16?"0"+e.toString(16):e.toString(16);return o}function F(t,n,r){for(var e=t.slice(n,r),i="",o=0;o<e.length;o+=2)i+=String.fromCharCode(e[o]+256*e[o+1]);return i}function C(t,n,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+n>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,n,r,e,i,o){if(!g(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>i||n<o)throw new RangeError('"value" argument is out of bounds');if(r+e>t.length)throw new RangeError("Index out of range")}function I(t,n,r,e){n<0&&(n=65535+n+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(n&255<<8*(e?i:1-i))>>>8*(e?i:1-i)}function z(t,n,r,e){n<0&&(n=4294967295+n+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=n>>>8*(e?i:3-i)&255}function L(t,n,r,e){if(r+e>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function J(t,n,r,e,i){return i||L(t,0,r,4),s(t,n,r,e,23,4),r+4}function q(t,n,r,e,i){return i||L(t,0,r,8),s(t,n,r,e,52,8),r+8}d.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,d.poolSize=8192,d._augment=function(t){return t.__proto__=d.prototype,t},d.from=function(t,n,r){return v(null,t,n,r)},d.TYPED_ARRAY_SUPPORT&&(d.prototype.__proto__=Uint8Array.prototype,d.__proto__=Uint8Array),d.alloc=function(t,n,r){return function(t,n,r,e){return p(n),n<=0?l(t,n):void 0!==r?"string"==typeof e?l(t,n).fill(r,e):l(t,n).fill(r):l(t,n)}(null,t,n,r)},d.allocUnsafe=function(t){return m(null,t)},d.allocUnsafeSlow=function(t){return m(null,t)},d.isBuffer=function(t){return null!=t&&(!!t._isBuffer||Z(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Z(t.slice(0,0))}(t))},d.compare=function(t,n){if(!g(t)||!g(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var r=t.length,e=n.length,i=0,o=Math.min(r,e);i<o;++i)if(t[i]!==n[i]){r=t[i],e=n[i];break}return r<e?-1:e<r?1:0},d.isEncoding=function(t){switch(String(t).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}},d.concat=function(t,n){if(!c(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return d.alloc(0);var r;if(void 0===n)for(n=0,r=0;r<t.length;++r)n+=t[r].length;var e=d.allocUnsafe(n),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!g(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(e,i),i+=o.length}return e},d.byteLength=b,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)_(this,n,n+1);return this},d.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)_(this,n,n+3),_(this,n+1,n+2);return this},d.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)_(this,n,n+7),_(this,n+1,n+6),_(this,n+2,n+5),_(this,n+3,n+4);return this},d.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?M(this,0,t):E.apply(this,arguments)},d.prototype.equals=function(t){if(!g(t))throw new TypeError("Argument must be a Buffer");return this===t||0===d.compare(this,t)},d.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},d.prototype.compare=function(t,n,r,e,i){if(!g(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=t?t.length:0),void 0===e&&(e=0),void 0===i&&(i=this.length),n<0||r>t.length||e<0||i>this.length)throw new RangeError("out of range index");if(e>=i&&n>=r)return 0;if(e>=i)return-1;if(n>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(e>>>=0),u=(r>>>=0)-(n>>>=0),f=Math.min(o,u),s=this.slice(e,i),a=t.slice(n,r),c=0;c<f;++c)if(s[c]!==a[c]){o=s[c],u=a[c];break}return o<u?-1:u<o?1:0},d.prototype.includes=function(t,n,r){return-1!==this.indexOf(t,n,r)},d.prototype.indexOf=function(t,n,r){return A(this,t,n,r,!0)},d.prototype.lastIndexOf=function(t,n,r){return A(this,t,n,r,!1)},d.prototype.write=function(t,n,r,e){if(void 0===n)e="utf8",r=this.length,n=0;else if(void 0===r&&"string"==typeof n)e=n,r=this.length,n=0;else{if(!isFinite(n))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");n|=0,isFinite(r)?(r|=0,void 0===e&&(e="utf8")):(e=r,r=void 0)}var i=this.length-n;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var o=!1;;)switch(e){case"hex":return O(this,t,n,r);case"utf8":case"utf-8":return S(this,t,n,r);case"ascii":return j(this,t,n,r);case"latin1":case"binary":return T(this,t,n,r);case"base64":return B(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},d.prototype.slice=function(t,n){var r,e=this.length;if((t=~~t)<0?(t+=e)<0&&(t=0):t>e&&(t=e),(n=void 0===n?e:~~n)<0?(n+=e)<0&&(n=0):n>e&&(n=e),n<t&&(n=t),d.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,n)).__proto__=d.prototype;else{var i=n-t;r=new d(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},d.prototype.readUIntLE=function(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var e=this[t],i=1,o=0;++o<n&&(i*=256);)e+=this[t+o]*i;return e},d.prototype.readUIntBE=function(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var e=this[t+--n],i=1;n>0&&(i*=256);)e+=this[t+--n]*i;return e},d.prototype.readUInt8=function(t,n){return n||C(t,1,this.length),this[t]},d.prototype.readUInt16LE=function(t,n){return n||C(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUInt16BE=function(t,n){return n||C(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUInt32LE=function(t,n){return n||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUInt32BE=function(t,n){return n||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readIntLE=function(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var e=this[t],i=1,o=0;++o<n&&(i*=256);)e+=this[t+o]*i;return e>=(i*=128)&&(e-=Math.pow(2,8*n)),e},d.prototype.readIntBE=function(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var e=n,i=1,o=this[t+--e];e>0&&(i*=256);)o+=this[t+--e]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*n)),o},d.prototype.readInt8=function(t,n){return n||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,n){n||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(t,n){n||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(t,n){return n||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,n){return n||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readFloatLE=function(t,n){return n||C(t,4,this.length),f(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,n){return n||C(t,4,this.length),f(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,n){return n||C(t,8,this.length),f(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,n){return n||C(t,8,this.length),f(this,t,!1,52,8)},d.prototype.writeUIntLE=function(t,n,r,e){t=+t,n|=0,r|=0,e||P(this,t,n,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[n]=255&t;++o<r&&(i*=256);)this[n+o]=t/i&255;return n+r},d.prototype.writeUIntBE=function(t,n,r,e){t=+t,n|=0,r|=0,e||P(this,t,n,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[n+i]=255&t;--i>=0&&(o*=256);)this[n+i]=t/o&255;return n+r},d.prototype.writeUInt8=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,1,255,0),d.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=255&t,n+1},d.prototype.writeUInt16LE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):I(this,t,n,!0),n+2},d.prototype.writeUInt16BE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):I(this,t,n,!1),n+2},d.prototype.writeUInt32LE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=255&t):z(this,t,n,!0),n+4},d.prototype.writeUInt32BE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):z(this,t,n,!1),n+4},d.prototype.writeIntLE=function(t,n,r,e){if(t=+t,n|=0,!e){var i=Math.pow(2,8*r-1);P(this,t,n,r,i-1,-i)}var o=0,u=1,f=0;for(this[n]=255&t;++o<r&&(u*=256);)t<0&&0===f&&0!==this[n+o-1]&&(f=1),this[n+o]=(t/u>>0)-f&255;return n+r},d.prototype.writeIntBE=function(t,n,r,e){if(t=+t,n|=0,!e){var i=Math.pow(2,8*r-1);P(this,t,n,r,i-1,-i)}var o=r-1,u=1,f=0;for(this[n+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[n+o+1]&&(f=1),this[n+o]=(t/u>>0)-f&255;return n+r},d.prototype.writeInt8=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,1,127,-128),d.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=255&t,n+1},d.prototype.writeInt16LE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):I(this,t,n,!0),n+2},d.prototype.writeInt16BE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):I(this,t,n,!1),n+2},d.prototype.writeInt32LE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):z(this,t,n,!0),n+4},d.prototype.writeInt32BE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),d.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):z(this,t,n,!1),n+4},d.prototype.writeFloatLE=function(t,n,r){return J(this,t,n,!0,r)},d.prototype.writeFloatBE=function(t,n,r){return J(this,t,n,!1,r)},d.prototype.writeDoubleLE=function(t,n,r){return q(this,t,n,!0,r)},d.prototype.writeDoubleBE=function(t,n,r){return q(this,t,n,!1,r)},d.prototype.copy=function(t,n,r,e){if(r||(r=0),e||0===e||(e=this.length),n>=t.length&&(n=t.length),n||(n=0),e>0&&e<r&&(e=r),e===r)return 0;if(0===t.length||0===this.length)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),t.length-n<e-r&&(e=t.length-n+r);var i,o=e-r;if(this===t&&r<n&&n<e)for(i=o-1;i>=0;--i)t[i+n]=this[i+r];else if(o<1e3||!d.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+n]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),n);return o},d.prototype.fill=function(t,n,r,e){if("string"==typeof t){if("string"==typeof n?(e=n,n=0,r=this.length):"string"==typeof r&&(e=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==e&&"string"!=typeof e)throw new TypeError("encoding must be a string");if("string"==typeof e&&!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e)}else"number"==typeof t&&(t&=255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;var o;if(n>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=n;o<r;++o)this[o]=t;else{var u=g(t)?t:X(new d(t,e).toString()),f=u.length;for(o=0;o<r-n;++o)this[o+n]=u[o%f]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function X(t,n){var r;n=n||1/0;for(var e=t.length,i=null,o=[],u=0;u<e;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!i){if(r>56319){(n-=3)>-1&&o.push(239,191,189);continue}if(u+1===e){(n-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(n-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(n-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((n-=1)<0)break;o.push(r)}else if(r<2048){if((n-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((n-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((n-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(t){return function(t){var n,u,f,s,a,c;i||o();var h=t.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");c=new e(3*h/4-(a="="===t[h-2]?2:"="===t[h-1]?1:0)),f=a>0?h-4:h;var l=0;for(n=0,u=0;n<f;n+=4,u+=3)s=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],c[l++]=s>>16&255,c[l++]=s>>8&255,c[l++]=255&s;return 2===a?(s=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,c[l++]=255&s):1===a&&(s=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,c[l++]=s>>8&255,c[l++]=255&s),c}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,n,r,e){for(var i=0;i<e&&!(i+r>=n.length||i>=t.length);++i)n[i+r]=t[i];return i}function Z(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",V=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,G=function(t){var n;try{if(null===(n=function(t){return JSON.parse(function(t){if(t=String(t).replace(/[\t\n\f\r ]+/g,""),!V.test(t))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var n;t+="==".slice(2-(3&t.length));for(var r,e,i="",o=0;o<t.length;)n=$.indexOf(t.charAt(o++))<<18|$.indexOf(t.charAt(o++))<<12|(r=$.indexOf(t.charAt(o++)))<<6|(e=$.indexOf(t.charAt(o++))),i+=64===r?String.fromCharCode(n>>16&255):64===e?String.fromCharCode(n>>16&255,n>>8&255):String.fromCharCode(n>>16&255,n>>8&255,255&n);return i}((t||"").split(".")[1]||""))}(t)))return null}catch(t){return null}return Object.keys(n).forEach((function(t){"string"==typeof t&&t.startsWith("https://verdocs.com/")&&(n[t.replace("https://verdocs.com/","")]=n[t],delete n[t])})),n},Q=function(t,n,r,e){return new(r||(r=Promise))((function(i,o){function u(t){try{s(e.next(t))}catch(t){o(t)}}function f(t){try{s(e.throw(t))}catch(t){o(t)}}function s(t){var n;t.done?i(t.value):(n=t.value,n instanceof r?n:new r((function(t){t(n)}))).then(u,f)}s((e=e.apply(t,n||[])).next())}))},Y=function(t,n){var r,e,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function f(o){return function(f){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,e&&(i=2&o[0]?e.return:o[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,o[1])).done)return i;switch(e=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,e=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=n.call(t,u)}catch(t){o=[6,t],e=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,f])}}},tt=function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.get("/documents/".concat(n.documentId,"/recipients/").concat(encodeURIComponent(n.roleId),"/invitation/").concat(n.inviteCode)).then((function(n){var r,e,i=(null===(r=n.headers)||void 0===r?void 0:r.signer_token)||"",o=G(i);return t.setToken(null===(e=n.headers)||void 0===e?void 0:e.signer_token),{recipient:n.data,session:o,signerToken:i}}))]}))}))},nt=function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.get("/documents/".concat(n)).then((function(t){return t.data}))]}))}))},rt=function(t,n,r){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.get("/documents/".concat(n,"/envelope_documents/").concat(r,"?file=true"),{responseType:"arraybuffer"}).then((function(t){return d.from(t.data,"binary").toString("base64")}))]}))}))},et=function(t,n,r,e){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.put("/documents/".concat(n,"/fields/").concat(r),e).then((function(t){return t.data}))]}))}))},it=function(){return(it=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++)for(var i in n=arguments[r])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)},ot=function(t,n,r,e,i){return o=void 0,u=void 0,s=function(){return function(t,n){var r,e,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function f(o){return function(f){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,e&&(i=2&o[0]?e.return:o[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,o[1])).done)return i;switch(e=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,e=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=n.call(t,u)}catch(t){o=[6,t],e=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,f])}}}(this,(function(){return[2,t.api.put("/documents/".concat(n,"/recipients/").concat(r),it({role_name:r,action:e},i||{})).then((function(t){return t.data}))]}))},new((f=void 0)||(f=Promise))((function(t,n){function r(t){try{i(s.next(t))}catch(t){n(t)}}function e(t){try{i(s.throw(t))}catch(t){n(t)}}function i(n){var i;n.done?t(n.value):(i=n.value,i instanceof f?i:new f((function(t){t(i)}))).then(r,e)}i((s=s.apply(o,u||[])).next())}));var o,u,f,s};const ut=Object.freeze({__proto__:null,Documents:Object.freeze({__proto__:null,getSummary:function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.post("/documents/summary",{page:n}).then((function(t){return t.data}))]}))}))},searchDocuments:function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.post("/documents/search",n).then((function(t){return t.data}))]}))}))},getSigningSession:tt,getDocumentRecipients:function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.get("/documents/".concat(n,"/recipients")).then((function(t){return t.data}))]}))}))},getDocument:nt,getDocumentFile:rt,updateDocumentField:et,updateDocumentFieldSignature:function(t,n,r,e){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.put("/documents/".concat(n,"/fields/").concat(r,"/signature/").concat(e)).then((function(t){return t.data}))]}))}))}}),Recipients:Object.freeze({__proto__:null,updateRecipientStatus:ot}),Signatures:Object.freeze({__proto__:null,createSignature:function(t,n,r){var e=new FormData;return e.append("signature",r,n),t.api.post("/signatures",e).then((function(t){return t.data}))},getSignatures:function(t){return t.api.get("/signatures").then((function(t){return t.data}))},getSignature:function(t,n){return t.api.get("/signatures/".concat(n)).then((function(t){return t.data}))},deleteSignature:function(t,n){return t.api.delete("/signatures/".concat(n)).then((function(t){return t.data}))}}),Initials:Object.freeze({__proto__:null,createInitials:function(t,n,r){var e=new FormData;return e.append("initial",r,n),t.api.post("/initials",e).then((function(t){return t.data}))}}),Types:Object.freeze({__proto__:null})});var ft,st,at,ct;!function(t){t.TEMPLATE_CREATOR_CREATE_PUBLIC="template:creator:create:public",t.TEMPLATE_CREATOR_CREATE_ORG="template:creator:create:org",t.TEMPLATE_CREATOR_CREATE_PERSONAL="template:creator:create:personal",t.TEMPLATE_CREATOR_DELETE="template:creator:delete",t.TEMPLATE_CREATOR_VISIBILITY="template:creator:visibility",t.TEMPLATE_MEMBER_READ="template:member:read",t.TEMPLATE_MEMBER_WRITE="template:member:write",t.TEMPLATE_MEMBER_DELETE="template:member:delete",t.TEMPLATE_MEMBER_VISIBILITY="template:member:visibility"}(ft||(ft={})),function(t){t.CREATOR="creator",t.ORGANIZATION_MEMBER="organization_member",t.ORGANIZATION_MEMBER_AS_CREATOR="organization_member_as_creator",t.EVERYONE="everyone",t.EVERYONE_AS_CREATOR="everyone_as_creator"}(st||(st={})),function(t){t.CREATE_PERSONAL="create_personal",t.CREATE_ORG="create_org",t.CREATE_PUBLIC="create_public",t.READ="read",t.WRITE="write",t.DELETE="delete",t.CHANGE_VISIBILITY_PERSONAL="change_visibility_personal",t.CHANGE_VISIBILITY_ORG="change_visibility_org",t.CHANGE_VISIBILITY_PUBLIC="change_visibility_public"}(at||(at={})),function(t){t.CREATED_AT="created_at",t.UPDATED_AT="updated_at",t.NAME="name",t.LAST_USED_AT="last_used_at",t.COUNTER="counter",t.STAR_COUNTER="star_counter"}(ct||(ct={}));var ht,lt=function(t,n){return function(){for(var r=new Array(arguments.length),e=0;e<r.length;e++)r[e]=arguments[e];return t.apply(n,r)}},dt=Object.prototype.toString,vt=(ht=Object.create(null),function(t){var n=dt.call(t);return ht[n]||(ht[n]=n.slice(8,-1).toLowerCase())});function pt(t){return t=t.toLowerCase(),function(n){return vt(n)===t}}function mt(t){return Array.isArray(t)}function wt(t){return void 0===t}var yt=pt("ArrayBuffer");function gt(t){return null!==t&&"object"==typeof t}function bt(t){if("object"!==vt(t))return!1;var n=Object.getPrototypeOf(t);return null===n||n===Object.prototype}var Et=pt("Date"),_t=pt("File"),At=pt("Blob"),Rt=pt("FileList");function Ot(t){return"[object Function]"===dt.call(t)}var St=pt("URLSearchParams");function jt(t,n){if(null!=t)if("object"!=typeof t&&(t=[t]),mt(t))for(var r=0,e=t.length;r<e;r++)n.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.call(null,t[i],i,t)}var Tt,Bt=(Tt="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return Tt&&t instanceof Tt}),xt={isArray:mt,isArrayBuffer:yt,isBuffer:function(t){return null!==t&&!wt(t)&&null!==t.constructor&&!wt(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var n="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||dt.call(t)===n||Ot(t.toString)&&t.toString()===n)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&yt(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:gt,isPlainObject:bt,isUndefined:wt,isDate:Et,isFile:_t,isBlob:At,isFunction:Ot,isStream:function(t){return gt(t)&&Ot(t.pipe)},isURLSearchParams:St,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:jt,merge:function t(){var n={};function r(r,e){n[e]=bt(n[e])&&bt(r)?t(n[e],r):bt(r)?t({},r):mt(r)?r.slice():r}for(var e=0,i=arguments.length;e<i;e++)jt(arguments[e],r);return n},extend:function(t,n,r){return jt(n,(function(n,e){t[e]=r&&"function"==typeof n?lt(n,r):n})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,n,r,e){t.prototype=Object.create(n.prototype,e),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)},toFlatObject:function(t,n,r){var e,i,o,u={};n=n||{};do{for(i=(e=Object.getOwnPropertyNames(t)).length;i-- >0;)u[o=e[i]]||(n[o]=t[o],u[o]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,n))&&t!==Object.prototype);return n},kindOf:vt,kindOfTest:pt,endsWith:function(t,n,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length);var e=t.indexOf(n,r-=n.length);return-1!==e&&e===r},toArray:function(t){if(!t)return null;var n=t.length;if(wt(n))return null;for(var r=new Array(n);n-- >0;)r[n]=t[n];return r},isTypedArray:Bt,isFileList:Rt};function Nt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Mt=function(t,n,r){if(!n)return t;var e;if(r)e=r(n);else if(xt.isURLSearchParams(n))e=n.toString();else{var i=[];xt.forEach(n,(function(t,n){null!=t&&(xt.isArray(t)?n+="[]":t=[t],xt.forEach(t,(function(t){xt.isDate(t)?t=t.toISOString():xt.isObject(t)&&(t=JSON.stringify(t)),i.push(Nt(n)+"="+Nt(t))})))})),e=i.join("&")}if(e){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+e}return t};function kt(){this.handlers=[]}kt.prototype.use=function(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},kt.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},kt.prototype.forEach=function(t){xt.forEach(this.handlers,(function(n){null!==n&&t(n)}))};var Dt=kt,Ut="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ct(t,n,r){return t(r={path:n,exports:{},require:function(){return It()}},r.exports),r.exports}function Pt(t){if(t.__esModule)return t;var n=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var e=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,e.get?e:{enumerable:!0,get:function(){return t[r]}})})),n}function It(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var zt=Ut.process,Lt=function(t,n){xt.forEach(t,(function(r,e){e!==n&&e.toUpperCase()===n.toUpperCase()&&(t[n]=r,delete t[e])}))};function Jt(t,n,r,e,i){Error.call(this),this.message=t,this.name="AxiosError",n&&(this.code=n),r&&(this.config=r),e&&(this.request=e),i&&(this.response=i)}xt.inherits(Jt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var qt=Jt.prototype,Ht={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(t){Ht[t]={value:t}})),Object.defineProperties(Jt,Ht),Object.defineProperty(qt,"isAxiosError",{value:!0}),Jt.from=function(t,n,r,e,i,o){var u=Object.create(qt);return xt.toFlatObject(t,u,(function(t){return t!==Error.prototype})),Jt.call(u,t.message,n,r,e,i),u.name=t.name,o&&Object.assign(u,o),u};var Xt=Jt,Kt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wt=function(t,n){n=n||new FormData;var r=[];function e(t){return null===t?"":xt.isDate(t)?t.toISOString():xt.isArrayBuffer(t)||xt.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):d.from(t):t}return function t(i,o){if(xt.isPlainObject(i)||xt.isArray(i)){if(-1!==r.indexOf(i))throw Error("Circular reference detected in "+o);r.push(i),xt.forEach(i,(function(r,i){if(!xt.isUndefined(r)){var u,f=o?o+"."+i:i;if(r&&!o&&"object"==typeof r)if(xt.endsWith(i,"{}"))r=JSON.stringify(r);else if(xt.endsWith(i,"[]")&&(u=xt.toArray(r)))return void u.forEach((function(t){!xt.isUndefined(t)&&n.append(f,e(t))}));t(r,f)}})),r.pop()}else n.append(o,e(i))}(t),n},Zt=xt.isStandardBrowserEnv()?{write:function(t,n,r,e,i,o){var u=[];u.push(t+"="+encodeURIComponent(n)),xt.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),xt.isString(e)&&u.push("path="+e),xt.isString(i)&&u.push("domain="+i),!0===o&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},$t=function(t,n){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)?function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t}(t,n):n},Vt=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Gt=xt.isStandardBrowserEnv()?function(){var t,n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function e(t){var e=t;return n&&(r.setAttribute("href",e),e=r.href),r.setAttribute("href",e),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=e(window.location.href),function(n){var r=xt.isString(n)?e(n):n;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function Qt(t){Xt.call(this,null==t?"canceled":t,Xt.ERR_CANCELED),this.name="CanceledError"}xt.inherits(Qt,Xt,{__CANCEL__:!0});var Yt=Qt,tn={"Content-Type":"application/x-www-form-urlencoded"};function nn(t,n){!xt.isUndefined(t)&&xt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=n)}var rn,en={transitional:Kt,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==zt&&"[object process]"===Object.prototype.toString.call(zt))&&(rn=function(t){return new Promise((function(n,r){var e,i=t.data,o=t.headers,u=t.responseType;function f(){t.cancelToken&&t.cancelToken.unsubscribe(e),t.signal&&t.signal.removeEventListener("abort",e)}xt.isFormData(i)&&xt.isStandardBrowserEnv()&&delete o["Content-Type"];var s=new XMLHttpRequest;if(t.auth){var a=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+c)}var h=$t(t.baseURL,t.url);function l(){if(s){var e,i,o,a,c,h="getAllResponseHeaders"in s?(e=s.getAllResponseHeaders(),c={},e?(xt.forEach(e.split("\n"),(function(t){if(a=t.indexOf(":"),i=xt.trim(t.substr(0,a)).toLowerCase(),o=xt.trim(t.substr(a+1)),i){if(c[i]&&Vt.indexOf(i)>=0)return;c[i]="set-cookie"===i?(c[i]?c[i]:[]).concat([o]):c[i]?c[i]+", "+o:o}})),c):c):null;!function(t,n,r){var e=r.config.validateStatus;r.status&&e&&!e(r.status)?n(new Xt("Request failed with status code "+r.status,[Xt.ERR_BAD_REQUEST,Xt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}((function(t){n(t),f()}),(function(t){r(t),f()}),{data:u&&"text"!==u&&"json"!==u?s.response:s.responseText,status:s.status,statusText:s.statusText,headers:h,config:t,request:s}),s=null}}if(s.open(t.method.toUpperCase(),Mt(h,t.params,t.paramsSerializer),!0),s.timeout=t.timeout,"onloadend"in s?s.onloadend=l:s.onreadystatechange=function(){s&&4===s.readyState&&(0!==s.status||s.responseURL&&0===s.responseURL.indexOf("file:"))&&setTimeout(l)},s.onabort=function(){s&&(r(new Xt("Request aborted",Xt.ECONNABORTED,t,s)),s=null)},s.onerror=function(){r(new Xt("Network Error",Xt.ERR_NETWORK,t,s,s)),s=null},s.ontimeout=function(){var n=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";t.timeoutErrorMessage&&(n=t.timeoutErrorMessage),r(new Xt(n,(t.transitional||Kt).clarifyTimeoutError?Xt.ETIMEDOUT:Xt.ECONNABORTED,t,s)),s=null},xt.isStandardBrowserEnv()){var d=(t.withCredentials||Gt(h))&&t.xsrfCookieName?Zt.read(t.xsrfCookieName):void 0;d&&(o[t.xsrfHeaderName]=d)}"setRequestHeader"in s&&xt.forEach(o,(function(t,n){void 0===i&&"content-type"===n.toLowerCase()?delete o[n]:s.setRequestHeader(n,t)})),xt.isUndefined(t.withCredentials)||(s.withCredentials=!!t.withCredentials),u&&"json"!==u&&(s.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&s.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&s.upload&&s.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(e=function(t){s&&(r(!t||t&&t.type?new Yt:t),s.abort(),s=null)},t.cancelToken&&t.cancelToken.subscribe(e),t.signal&&(t.signal.aborted?e():t.signal.addEventListener("abort",e))),i||(i=null);var v,p=(v=/^([-+\w]{1,25})(:?\/\/|:)/.exec(h))&&v[1]||"";p&&-1===["http","https","file"].indexOf(p)?r(new Xt("Unsupported protocol "+p+":",Xt.ERR_BAD_REQUEST,t)):s.send(i)}))}),rn),transformRequest:[function(t,n){if(Lt(n,"Accept"),Lt(n,"Content-Type"),xt.isFormData(t)||xt.isArrayBuffer(t)||xt.isBuffer(t)||xt.isStream(t)||xt.isFile(t)||xt.isBlob(t))return t;if(xt.isArrayBufferView(t))return t.buffer;if(xt.isURLSearchParams(t))return nn(n,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var r,e=xt.isObject(t),i=n&&n["Content-Type"];if((r=xt.isFileList(t))||e&&"multipart/form-data"===i){var o=this.env&&this.env.FormData;return Wt(r?{"files[]":t}:t,o&&new o)}return e||"application/json"===i?(nn(n,"application/json"),function(t){if(xt.isString(t))try{return(0,JSON.parse)(t),xt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var n=this.transitional||en.transitional,r=!(n&&n.silentJSONParsing)&&"json"===this.responseType;if(r||n&&n.forcedJSONParsing&&xt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw Xt.from(t,Xt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};xt.forEach(["delete","get","head"],(function(t){en.headers[t]={}})),xt.forEach(["post","put","patch"],(function(t){en.headers[t]=xt.merge(tn)}));var on=en,un=function(t,n,r){var e=this||on;return xt.forEach(r,(function(r){t=r.call(e,t,n)})),t},fn=function(t){return!(!t||!t.__CANCEL__)};function sn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Yt}var an=function(t){return sn(t),t.headers=t.headers||{},t.data=un.call(t,t.data,t.headers,t.transformRequest),t.headers=xt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),xt.forEach(["delete","get","head","post","put","patch","common"],(function(n){delete t.headers[n]})),(t.adapter||on.adapter)(t).then((function(n){return sn(t),n.data=un.call(t,n.data,n.headers,t.transformResponse),n}),(function(n){return fn(n)||(sn(t),n&&n.response&&(n.response.data=un.call(t,n.response.data,n.response.headers,t.transformResponse))),Promise.reject(n)}))},cn=function(t,n){n=n||{};var r={};function e(t,n){return xt.isPlainObject(t)&&xt.isPlainObject(n)?xt.merge(t,n):xt.isPlainObject(n)?xt.merge({},n):xt.isArray(n)?n.slice():n}function i(r){return xt.isUndefined(n[r])?xt.isUndefined(t[r])?void 0:e(void 0,t[r]):e(t[r],n[r])}function o(t){if(!xt.isUndefined(n[t]))return e(void 0,n[t])}function u(r){return xt.isUndefined(n[r])?xt.isUndefined(t[r])?void 0:e(void 0,t[r]):e(void 0,n[r])}function f(r){return r in n?e(t[r],n[r]):r in t?e(void 0,t[r]):void 0}var s={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:f};return xt.forEach(Object.keys(t).concat(Object.keys(n)),(function(t){var n=s[t]||i,e=n(t);xt.isUndefined(e)&&n!==f||(r[t]=e)})),r},hn={};["object","boolean","number","function","string","symbol"].forEach((function(t,n){hn[t]=function(r){return typeof r===t||"a"+(n<1?"n ":" ")+t}}));var ln={};hn.transitional=function(t,n,r){function e(t,n){return"[Axios v0.27.2] Transitional option '"+t+"'"+n+(r?". "+r:"")}return function(r,i,o){if(!1===t)throw new Xt(e(i," has been removed"+(n?" in "+n:"")),Xt.ERR_DEPRECATED);return n&&!ln[i]&&(ln[i]=!0,console.warn(e(i," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(r,i,o)}};var dn={assertOptions:function(t,n,r){if("object"!=typeof t)throw new Xt("options must be an object",Xt.ERR_BAD_OPTION_VALUE);for(var e=Object.keys(t),i=e.length;i-- >0;){var o=e[i],u=n[o];if(u){var f=t[o],s=void 0===f||u(f,o,t);if(!0!==s)throw new Xt("option "+o+" must be "+s,Xt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Xt("Unknown option "+o,Xt.ERR_BAD_OPTION)}},validators:hn},vn=dn.validators;function pn(t){this.defaults=t,this.interceptors={request:new Dt,response:new Dt}}pn.prototype.request=function(t,n){"string"==typeof t?(n=n||{}).url=t:n=t||{},(n=cn(this.defaults,n)).method=n.method?n.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var r=n.transitional;void 0!==r&&dn.assertOptions(r,{silentJSONParsing:vn.transitional(vn.boolean),forcedJSONParsing:vn.transitional(vn.boolean),clarifyTimeoutError:vn.transitional(vn.boolean)},!1);var e=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(n)||(i=i&&t.synchronous,e.unshift(t.fulfilled,t.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!i){var f=[an,void 0];for(Array.prototype.unshift.apply(f,e),f=f.concat(u),o=Promise.resolve(n);f.length;)o=o.then(f.shift(),f.shift());return o}for(var s=n;e.length;){var a=e.shift(),c=e.shift();try{s=a(s)}catch(t){c(t);break}}try{o=an(s)}catch(t){return Promise.reject(t)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},pn.prototype.getUri=function(t){t=cn(this.defaults,t);var n=$t(t.baseURL,t.url);return Mt(n,t.params,t.paramsSerializer)},xt.forEach(["delete","get","head","options"],(function(t){pn.prototype[t]=function(n,r){return this.request(cn(r||{},{method:t,url:n,data:(r||{}).data}))}})),xt.forEach(["post","put","patch"],(function(t){function n(n){return function(r,e,i){return this.request(cn(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:e}))}}pn.prototype[t]=n(),pn.prototype[t+"Form"]=n(!0)}));var mn=pn;function wn(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var r=this;this.promise.then((function(t){if(r._listeners){var n,e=r._listeners.length;for(n=0;n<e;n++)r._listeners[n](t);r._listeners=null}})),this.promise.then=function(t){var n,e=new Promise((function(t){r.subscribe(t),n=t})).then(t);return e.cancel=function(){r.unsubscribe(n)},e},t((function(t){r.reason||(r.reason=new Yt(t),n(r.reason))}))}wn.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},wn.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},wn.prototype.unsubscribe=function(t){if(this._listeners){var n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}},wn.source=function(){var t;return{token:new wn((function(n){t=n})),cancel:t}};var yn=wn,gn=function t(n){var r=new mn(n),e=lt(mn.prototype.request,r);return xt.extend(e,mn.prototype,r),xt.extend(e,r),e.create=function(r){return t(cn(n,r))},e}(on);gn.Axios=mn,gn.CanceledError=Yt,gn.CancelToken=yn,gn.isCancel=fn,gn.VERSION="0.27.2",gn.toFormData=Wt,gn.AxiosError=Xt,gn.Cancel=gn.CanceledError,gn.all=function(t){return Promise.all(t)},gn.spread=function(t){return function(n){return t.apply(null,n)}},gn.isAxiosError=function(t){return xt.isObject(t)&&!0===t.isAxiosError};var bn=gn;bn.default=gn;var En=bn,_n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")},An=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return _n()}try{return __global__||_n()}finally{delete Object.prototype.__global__}}(),Rn=function(t){return console.debug("[JS-SDK] ".concat(t.method.toUpperCase()," ").concat(t.baseURL).concat(t.url),t.data?JSON.stringify(t.data):""),t},On=function(){function t(t){this.environment="verdocs",this.sessionType="user",this.baseURL="https://api.verdocs.com",this.clientID="not-set",this.timeout=3e3,this.token=null,this.nextListenerId=0,this.sessionListeners=new Map,this.requestLoggerId=null,this.session=null,this.Documents=ut,this.baseURL=(null==t?void 0:t.baseURL)||"https://api.verdocs.com",this.timeout=(null==t?void 0:t.timeout)||3e3,this.environment=(null==t?void 0:t.environment)||"verdocs",this.sessionType=(null==t?void 0:t.sessionType)||"user",this.clientID=(null==t?void 0:t.clientID)||"not-set",this.api=En.create({baseURL:this.baseURL,timeout:this.timeout})}return t.prototype.setDefault=function(){An[Sn]=this},t.getDefault=function(){return An[Sn]},t.prototype.getEnvironment=function(){return this.environment},t.prototype.getSessionType=function(){return this.sessionType},t.prototype.getBaseURL=function(){return this.baseURL},t.prototype.getClientID=function(){return this.clientID},t.prototype.getTimeout=function(){return this.timeout},t.prototype.getSession=function(){return this.session},t.prototype.setEnvironment=function(t){return this.environment=t,this},t.prototype.setSessionType=function(t){return this.sessionType=t,this},t.prototype.setBaseURL=function(t){return this.api.defaults.baseURL=t,this},t.prototype.setClientID=function(t){return this.clientID=t,this.api.defaults.headers.common["X-Client-ID"]=t,this},t.prototype.setTimeout=function(t){return this.timeout=t,this.api.defaults.timeout=t,this},t.prototype.logRequests=function(t){return t&&null===this.requestLoggerId?this.requestLoggerId=this.api.interceptors.request.use(Rn):t||null===this.requestLoggerId||this.api.interceptors.request.eject(this.requestLoggerId),this},t.prototype.setToken=function(t){if(!t)return this.clearSession();var n=G(t);return null===n||n.exp&&1e3*n.exp<(new Date).getTime()?this.clearSession():(this.token=t,this.session=n,this.api.defaults.headers.common.Authorization="Bearer ".concat(t),localStorage.setItem(this.sessionStorageKey(),t),this.notifySessionListeners(),this)},t.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())},t.prototype.clearSession=function(){return localStorage.removeItem(this.sessionStorageKey()),delete this.api.defaults.headers.common.Authorization,this.session=null,this.token=null,this.notifySessionListeners(),this},t.prototype.notifySessionListeners=function(){var t=this;this.sessionListeners.forEach((function(n){try{n(t,t.session)}catch(t){}}))},t.prototype.onSessionChanged=function(t){var n=this;this.nextListenerId++;var r=Symbol.for(""+this.nextListenerId);return this.sessionListeners.set(r,t),function(){n.sessionListeners.delete(r)}},t.prototype.loadSession=function(){var t=localStorage.getItem(this.sessionStorageKey());return t?this.setToken(t):this.clearSession()},t}(),Sn=Symbol.for("verdocs-default-endpoint");An[Sn]||(An[Sn]=new On);export{d as B,On as V,nt as a,rt as b,et as c,Pt as d,Ct as e,Ft as f,tt as g,Ut as h,It as i,zt as p,ot as u}
|
|
1
|
+
const t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var n=[],r=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,o=t.length;e<o;++e)n[e]=t[e],r[t.charCodeAt(e)]=e;r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63}function u(t,r,e){for(var i,o=[],u=r;u<e;u+=3)o.push(n[(i=(t[u]<<16)+(t[u+1]<<8)+t[u+2])>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}function f(t,n,r,e,i){var o,u,f=8*i-e-1,s=(1<<f)-1,a=s>>1,c=-7,h=r?i-1:0,l=r?-1:1,d=t[n+h];for(h+=l,o=d&(1<<-c)-1,d>>=-c,c+=f;c>0;o=256*o+t[n+h],h+=l,c-=8);for(u=o&(1<<-c)-1,o>>=-c,c+=e;c>0;u=256*u+t[n+h],h+=l,c-=8);if(0===o)o=1-a;else{if(o===s)return u?NaN:1/0*(d?-1:1);u+=Math.pow(2,e),o-=a}return(d?-1:1)*u*Math.pow(2,o-e)}function s(t,n,r,e,i,o){var u,f,s,a=8*o-i-1,c=(1<<a)-1,h=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=e?0:o-1,v=e?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(f=isNaN(n)?1:0,u=c):(u=Math.floor(Math.log(n)/Math.LN2),n*(s=Math.pow(2,-u))<1&&(u--,s*=2),(n+=u+h>=1?l/s:l*Math.pow(2,1-h))*s>=2&&(u++,s/=2),u+h>=c?(f=0,u=c):u+h>=1?(f=(n*s-1)*Math.pow(2,i),u+=h):(f=n*Math.pow(2,h-1)*Math.pow(2,i),u=0));i>=8;t[r+d]=255&f,d+=v,f/=256,i-=8);for(u=u<<i|f,a+=i;a>0;t[r+d]=255&u,d+=v,u/=256,a-=8);t[r+d-v]|=128*p}var a={}.toString,c=Array.isArray||function(t){return"[object Array]"==a.call(t)};function h(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(t,n){if(h()<n)throw new RangeError("Invalid typed array length");return d.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(n)).__proto__=d.prototype:(null===t&&(t=new d(n)),t.length=n),t}function d(t,n,r){if(!(d.TYPED_ARRAY_SUPPORT||this instanceof d))return new d(t,n,r);if("number"==typeof t){if("string"==typeof n)throw new Error("If encoding is specified then the first argument must be a string");return m(this,t)}return v(this,t,n,r)}function v(t,n,r,e){if("number"==typeof n)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer?function(t,n,r,e){if(r<0||n.byteLength<r)throw new RangeError("'offset' is out of bounds");if(n.byteLength<r+(e||0))throw new RangeError("'length' is out of bounds");return n=void 0===r&&void 0===e?new Uint8Array(n):void 0===e?new Uint8Array(n,r):new Uint8Array(n,r,e),d.TYPED_ARRAY_SUPPORT?(t=n).__proto__=d.prototype:t=w(t,n),t}(t,n,r,e):"string"==typeof n?function(t,n,r){if("string"==typeof r&&""!==r||(r="utf8"),!d.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var e=0|b(n,r),i=(t=l(t,e)).write(n,r);return i!==e&&(t=t.slice(0,i)),t}(t,n,r):function(t,n){if(g(n)){var r=0|y(n.length);return 0===(t=l(t,r)).length||n.copy(t,0,0,r),t}if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||(e=n.length)!=e?l(t,0):w(t,n);if("Buffer"===n.type&&c(n.data))return w(t,n.data)}var e;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,n)}function p(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function m(t,n){if(p(n),t=l(t,n<0?0:0|y(n)),!d.TYPED_ARRAY_SUPPORT)for(var r=0;r<n;++r)t[r]=0;return t}function w(t,n){var r=n.length<0?0:0|y(n.length);t=l(t,r);for(var e=0;e<r;e+=1)t[e]=255&n[e];return t}function y(t){if(t>=h())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h().toString(16)+" bytes");return 0|t}function g(t){return!(null==t||!t._isBuffer)}function b(t,n){if(g(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var e=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(e)return X(t).length;n=(""+n).toLowerCase(),e=!0}}function E(t,n,r){var e=!1;if((void 0===n||n<0)&&(n=0),n>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(n>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,n,r);case"utf8":case"utf-8":return M(this,n,r);case"ascii":return k(this,n,r);case"latin1":case"binary":return D(this,n,r);case"base64":return N(this,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,n,r);default:if(e)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),e=!0}}function _(t,n,r){var e=t[n];t[n]=t[r],t[r]=e}function A(t,n,r,e,i){if(0===t.length)return-1;if("string"==typeof r?(e=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof n&&(n=d.from(n,e)),g(n))return 0===n.length?-1:R(t,n,r,e,i);if("number"==typeof n)return n&=255,d.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,n,r):Uint8Array.prototype.lastIndexOf.call(t,n,r):R(t,[n],r,e,i);throw new TypeError("val must be string, number or Buffer")}function R(t,n,r,e,i){var o,u=1,f=t.length,s=n.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(t.length<2||n.length<2)return-1;u=2,f/=2,s/=2,r/=2}function a(t,n){return 1===u?t[n]:t.readUInt16BE(n*u)}if(i){var c=-1;for(o=r;o<f;o++)if(a(t,o)===a(n,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===s)return c*u}else-1!==c&&(o-=o-c),c=-1}else for(r+s>f&&(r=f-s),o=r;o>=0;o--){for(var h=!0,l=0;l<s;l++)if(a(t,o+l)!==a(n,l)){h=!1;break}if(h)return o}return-1}function O(t,n,r,e){r=Number(r)||0;var i=t.length-r;e?(e=Number(e))>i&&(e=i):e=i;var o=n.length;if(o%2!=0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var u=0;u<e;++u){var f=parseInt(n.substr(2*u,2),16);if(isNaN(f))return u;t[r+u]=f}return u}function S(t,n,r,e){return W(X(n,t.length-r),t,r,e)}function j(t,n,r,e){return W(function(t){for(var n=[],r=0;r<t.length;++r)n.push(255&t.charCodeAt(r));return n}(n),t,r,e)}function T(t,n,r,e){return j(t,n,r,e)}function B(t,n,r,e){return W(K(n),t,r,e)}function x(t,n,r,e){return W(function(t,n){for(var r,e,i=[],o=0;o<t.length&&!((n-=2)<0);++o)e=(r=t.charCodeAt(o))>>8,i.push(r%256),i.push(e);return i}(n,t.length-r),t,r,e)}function N(t,r,e){return function(t){var r;i||o();for(var e=t.length,f=e%3,s="",a=[],c=16383,h=0,l=e-f;h<l;h+=c)a.push(u(t,h,h+c>l?l:h+c));return 1===f?(s+=n[(r=t[e-1])>>2],s+=n[r<<4&63],s+="=="):2===f&&(s+=n[(r=(t[e-2]<<8)+t[e-1])>>10],s+=n[r>>4&63],s+=n[r<<2&63],s+="="),a.push(s),a.join("")}(0===r&&e===t.length?t:t.slice(r,e))}function M(t,n,r){r=Math.min(t.length,r);for(var e=[],i=n;i<r;){var o,u,f,s,a=t[i],c=null,h=a>239?4:a>223?3:a>191?2:1;if(i+h<=r)switch(h){case 1:a<128&&(c=a);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&a)<<6|63&o)>127&&(c=s);break;case 3:u=t[i+2],128==(192&(o=t[i+1]))&&128==(192&u)&&(s=(15&a)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:u=t[i+2],f=t[i+3],128==(192&(o=t[i+1]))&&128==(192&u)&&128==(192&f)&&(s=(15&a)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(c=s)}null===c?(c=65533,h=1):c>65535&&(e.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),e.push(c),i+=h}return function(t){var n=t.length;if(n<=4096)return String.fromCharCode.apply(String,t);for(var r="",e=0;e<n;)r+=String.fromCharCode.apply(String,t.slice(e,e+=4096));return r}(e)}function k(t,n,r){var e="";r=Math.min(t.length,r);for(var i=n;i<r;++i)e+=String.fromCharCode(127&t[i]);return e}function D(t,n,r){var e="";r=Math.min(t.length,r);for(var i=n;i<r;++i)e+=String.fromCharCode(t[i]);return e}function U(t,n,r){var e,i=t.length;(!n||n<0)&&(n=0),(!r||r<0||r>i)&&(r=i);for(var o="",u=n;u<r;++u)o+=(e=t[u])<16?"0"+e.toString(16):e.toString(16);return o}function F(t,n,r){for(var e=t.slice(n,r),i="",o=0;o<e.length;o+=2)i+=String.fromCharCode(e[o]+256*e[o+1]);return i}function C(t,n,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+n>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,n,r,e,i,o){if(!g(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>i||n<o)throw new RangeError('"value" argument is out of bounds');if(r+e>t.length)throw new RangeError("Index out of range")}function I(t,n,r,e){n<0&&(n=65535+n+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(n&255<<8*(e?i:1-i))>>>8*(e?i:1-i)}function z(t,n,r,e){n<0&&(n=4294967295+n+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=n>>>8*(e?i:3-i)&255}function L(t,n,r,e){if(r+e>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function J(t,n,r,e,i){return i||L(t,0,r,4),s(t,n,r,e,23,4),r+4}function q(t,n,r,e,i){return i||L(t,0,r,8),s(t,n,r,e,52,8),r+8}d.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,d.poolSize=8192,d._augment=function(t){return t.__proto__=d.prototype,t},d.from=function(t,n,r){return v(null,t,n,r)},d.TYPED_ARRAY_SUPPORT&&(d.prototype.__proto__=Uint8Array.prototype,d.__proto__=Uint8Array),d.alloc=function(t,n,r){return function(t,n,r,e){return p(n),n<=0?l(t,n):void 0!==r?"string"==typeof e?l(t,n).fill(r,e):l(t,n).fill(r):l(t,n)}(null,t,n,r)},d.allocUnsafe=function(t){return m(null,t)},d.allocUnsafeSlow=function(t){return m(null,t)},d.isBuffer=function(t){return null!=t&&(!!t._isBuffer||Z(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Z(t.slice(0,0))}(t))},d.compare=function(t,n){if(!g(t)||!g(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var r=t.length,e=n.length,i=0,o=Math.min(r,e);i<o;++i)if(t[i]!==n[i]){r=t[i],e=n[i];break}return r<e?-1:e<r?1:0},d.isEncoding=function(t){switch(String(t).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}},d.concat=function(t,n){if(!c(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return d.alloc(0);var r;if(void 0===n)for(n=0,r=0;r<t.length;++r)n+=t[r].length;var e=d.allocUnsafe(n),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!g(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(e,i),i+=o.length}return e},d.byteLength=b,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)_(this,n,n+1);return this},d.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)_(this,n,n+3),_(this,n+1,n+2);return this},d.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)_(this,n,n+7),_(this,n+1,n+6),_(this,n+2,n+5),_(this,n+3,n+4);return this},d.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?M(this,0,t):E.apply(this,arguments)},d.prototype.equals=function(t){if(!g(t))throw new TypeError("Argument must be a Buffer");return this===t||0===d.compare(this,t)},d.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},d.prototype.compare=function(t,n,r,e,i){if(!g(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=t?t.length:0),void 0===e&&(e=0),void 0===i&&(i=this.length),n<0||r>t.length||e<0||i>this.length)throw new RangeError("out of range index");if(e>=i&&n>=r)return 0;if(e>=i)return-1;if(n>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(e>>>=0),u=(r>>>=0)-(n>>>=0),f=Math.min(o,u),s=this.slice(e,i),a=t.slice(n,r),c=0;c<f;++c)if(s[c]!==a[c]){o=s[c],u=a[c];break}return o<u?-1:u<o?1:0},d.prototype.includes=function(t,n,r){return-1!==this.indexOf(t,n,r)},d.prototype.indexOf=function(t,n,r){return A(this,t,n,r,!0)},d.prototype.lastIndexOf=function(t,n,r){return A(this,t,n,r,!1)},d.prototype.write=function(t,n,r,e){if(void 0===n)e="utf8",r=this.length,n=0;else if(void 0===r&&"string"==typeof n)e=n,r=this.length,n=0;else{if(!isFinite(n))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");n|=0,isFinite(r)?(r|=0,void 0===e&&(e="utf8")):(e=r,r=void 0)}var i=this.length-n;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var o=!1;;)switch(e){case"hex":return O(this,t,n,r);case"utf8":case"utf-8":return S(this,t,n,r);case"ascii":return j(this,t,n,r);case"latin1":case"binary":return T(this,t,n,r);case"base64":return B(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},d.prototype.slice=function(t,n){var r,e=this.length;if((t=~~t)<0?(t+=e)<0&&(t=0):t>e&&(t=e),(n=void 0===n?e:~~n)<0?(n+=e)<0&&(n=0):n>e&&(n=e),n<t&&(n=t),d.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,n)).__proto__=d.prototype;else{var i=n-t;r=new d(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},d.prototype.readUIntLE=function(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var e=this[t],i=1,o=0;++o<n&&(i*=256);)e+=this[t+o]*i;return e},d.prototype.readUIntBE=function(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var e=this[t+--n],i=1;n>0&&(i*=256);)e+=this[t+--n]*i;return e},d.prototype.readUInt8=function(t,n){return n||C(t,1,this.length),this[t]},d.prototype.readUInt16LE=function(t,n){return n||C(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUInt16BE=function(t,n){return n||C(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUInt32LE=function(t,n){return n||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUInt32BE=function(t,n){return n||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readIntLE=function(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var e=this[t],i=1,o=0;++o<n&&(i*=256);)e+=this[t+o]*i;return e>=(i*=128)&&(e-=Math.pow(2,8*n)),e},d.prototype.readIntBE=function(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var e=n,i=1,o=this[t+--e];e>0&&(i*=256);)o+=this[t+--e]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*n)),o},d.prototype.readInt8=function(t,n){return n||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,n){n||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(t,n){n||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(t,n){return n||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,n){return n||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readFloatLE=function(t,n){return n||C(t,4,this.length),f(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,n){return n||C(t,4,this.length),f(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,n){return n||C(t,8,this.length),f(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,n){return n||C(t,8,this.length),f(this,t,!1,52,8)},d.prototype.writeUIntLE=function(t,n,r,e){t=+t,n|=0,r|=0,e||P(this,t,n,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[n]=255&t;++o<r&&(i*=256);)this[n+o]=t/i&255;return n+r},d.prototype.writeUIntBE=function(t,n,r,e){t=+t,n|=0,r|=0,e||P(this,t,n,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[n+i]=255&t;--i>=0&&(o*=256);)this[n+i]=t/o&255;return n+r},d.prototype.writeUInt8=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,1,255,0),d.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=255&t,n+1},d.prototype.writeUInt16LE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):I(this,t,n,!0),n+2},d.prototype.writeUInt16BE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):I(this,t,n,!1),n+2},d.prototype.writeUInt32LE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=255&t):z(this,t,n,!0),n+4},d.prototype.writeUInt32BE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):z(this,t,n,!1),n+4},d.prototype.writeIntLE=function(t,n,r,e){if(t=+t,n|=0,!e){var i=Math.pow(2,8*r-1);P(this,t,n,r,i-1,-i)}var o=0,u=1,f=0;for(this[n]=255&t;++o<r&&(u*=256);)t<0&&0===f&&0!==this[n+o-1]&&(f=1),this[n+o]=(t/u>>0)-f&255;return n+r},d.prototype.writeIntBE=function(t,n,r,e){if(t=+t,n|=0,!e){var i=Math.pow(2,8*r-1);P(this,t,n,r,i-1,-i)}var o=r-1,u=1,f=0;for(this[n+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[n+o+1]&&(f=1),this[n+o]=(t/u>>0)-f&255;return n+r},d.prototype.writeInt8=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,1,127,-128),d.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=255&t,n+1},d.prototype.writeInt16LE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):I(this,t,n,!0),n+2},d.prototype.writeInt16BE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):I(this,t,n,!1),n+2},d.prototype.writeInt32LE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):z(this,t,n,!0),n+4},d.prototype.writeInt32BE=function(t,n,r){return t=+t,n|=0,r||P(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),d.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):z(this,t,n,!1),n+4},d.prototype.writeFloatLE=function(t,n,r){return J(this,t,n,!0,r)},d.prototype.writeFloatBE=function(t,n,r){return J(this,t,n,!1,r)},d.prototype.writeDoubleLE=function(t,n,r){return q(this,t,n,!0,r)},d.prototype.writeDoubleBE=function(t,n,r){return q(this,t,n,!1,r)},d.prototype.copy=function(t,n,r,e){if(r||(r=0),e||0===e||(e=this.length),n>=t.length&&(n=t.length),n||(n=0),e>0&&e<r&&(e=r),e===r)return 0;if(0===t.length||0===this.length)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),t.length-n<e-r&&(e=t.length-n+r);var i,o=e-r;if(this===t&&r<n&&n<e)for(i=o-1;i>=0;--i)t[i+n]=this[i+r];else if(o<1e3||!d.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+n]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),n);return o},d.prototype.fill=function(t,n,r,e){if("string"==typeof t){if("string"==typeof n?(e=n,n=0,r=this.length):"string"==typeof r&&(e=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==e&&"string"!=typeof e)throw new TypeError("encoding must be a string");if("string"==typeof e&&!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e)}else"number"==typeof t&&(t&=255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;var o;if(n>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=n;o<r;++o)this[o]=t;else{var u=g(t)?t:X(new d(t,e).toString()),f=u.length;for(o=0;o<r-n;++o)this[o+n]=u[o%f]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function X(t,n){var r;n=n||1/0;for(var e=t.length,i=null,o=[],u=0;u<e;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!i){if(r>56319){(n-=3)>-1&&o.push(239,191,189);continue}if(u+1===e){(n-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(n-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(n-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((n-=1)<0)break;o.push(r)}else if(r<2048){if((n-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((n-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((n-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(t){return function(t){var n,u,f,s,a,c;i||o();var h=t.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");c=new e(3*h/4-(a="="===t[h-2]?2:"="===t[h-1]?1:0)),f=a>0?h-4:h;var l=0;for(n=0,u=0;n<f;n+=4,u+=3)s=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],c[l++]=s>>16&255,c[l++]=s>>8&255,c[l++]=255&s;return 2===a?(s=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,c[l++]=255&s):1===a&&(s=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,c[l++]=s>>8&255,c[l++]=255&s),c}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,n,r,e){for(var i=0;i<e&&!(i+r>=n.length||i>=t.length);++i)n[i+r]=t[i];return i}function Z(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",V=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,G=function(t){var n;try{if(null===(n=function(t){return JSON.parse(function(t){if(t=String(t).replace(/[\t\n\f\r ]+/g,""),!V.test(t))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var n;t+="==".slice(2-(3&t.length));for(var r,e,i="",o=0;o<t.length;)n=$.indexOf(t.charAt(o++))<<18|$.indexOf(t.charAt(o++))<<12|(r=$.indexOf(t.charAt(o++)))<<6|(e=$.indexOf(t.charAt(o++))),i+=64===r?String.fromCharCode(n>>16&255):64===e?String.fromCharCode(n>>16&255,n>>8&255):String.fromCharCode(n>>16&255,n>>8&255,255&n);return i}((t||"").split(".")[1]||""))}(t)))return null}catch(t){return null}return Object.keys(n).forEach((function(t){"string"==typeof t&&t.startsWith("https://verdocs.com/")&&(n[t.replace("https://verdocs.com/","")]=n[t],delete n[t])})),n},Q=function(t,n,r,e){return new(r||(r=Promise))((function(i,o){function u(t){try{s(e.next(t))}catch(t){o(t)}}function f(t){try{s(e.throw(t))}catch(t){o(t)}}function s(t){var n;t.done?i(t.value):(n=t.value,n instanceof r?n:new r((function(t){t(n)}))).then(u,f)}s((e=e.apply(t,n||[])).next())}))},Y=function(t,n){var r,e,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function f(o){return function(f){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,e&&(i=2&o[0]?e.return:o[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,o[1])).done)return i;switch(e=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,e=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=n.call(t,u)}catch(t){o=[6,t],e=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,f])}}},tt=function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.get("/documents/".concat(n.documentId,"/recipients/").concat(encodeURIComponent(n.roleId),"/invitation/").concat(n.inviteCode)).then((function(n){var r,e,i=(null===(r=n.headers)||void 0===r?void 0:r.signer_token)||"",o=G(i);return t.setToken(null===(e=n.headers)||void 0===e?void 0:e.signer_token),{recipient:n.data,session:o,signerToken:i}}))]}))}))},nt=function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.get("/documents/".concat(n)).then((function(t){return t.data}))]}))}))},rt=function(t,n,r){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.get("/documents/".concat(n,"/envelope_documents/").concat(r,"?file=true"),{responseType:"arraybuffer"}).then((function(t){return d.from(t.data,"binary").toString("base64")}))]}))}))},et=function(t,n,r,e){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.put("/documents/".concat(n,"/fields/").concat(r),e).then((function(t){return t.data}))]}))}))},it=function(){return(it=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++)for(var i in n=arguments[r])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)},ot=function(t,n,r,e,i){return o=void 0,u=void 0,s=function(){return function(t,n){var r,e,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function f(o){return function(f){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,e&&(i=2&o[0]?e.return:o[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,o[1])).done)return i;switch(e=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,e=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=n.call(t,u)}catch(t){o=[6,t],e=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,f])}}}(this,(function(){return[2,t.api.put("/documents/".concat(n,"/recipients/").concat(r),it({role_name:r,action:e},i||{})).then((function(t){return t.data}))]}))},new((f=void 0)||(f=Promise))((function(t,n){function r(t){try{i(s.next(t))}catch(t){n(t)}}function e(t){try{i(s.throw(t))}catch(t){n(t)}}function i(n){var i;n.done?t(n.value):(i=n.value,i instanceof f?i:new f((function(t){t(i)}))).then(r,e)}i((s=s.apply(o,u||[])).next())}));var o,u,f,s};const ut=Object.freeze({__proto__:null,Documents:Object.freeze({__proto__:null,getSummary:function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.post("/documents/summary",{page:n}).then((function(t){return t.data}))]}))}))},searchDocuments:function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.post("/documents/search",n).then((function(t){return t.data}))]}))}))},getSigningSession:tt,getDocumentRecipients:function(t,n){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.get("/documents/".concat(n,"/recipients")).then((function(t){return t.data}))]}))}))},getDocument:nt,getDocumentFile:rt,updateDocumentField:et,updateDocumentFieldSignature:function(t,n,r,e){return Q(void 0,void 0,void 0,(function(){return Y(this,(function(){return[2,t.api.put("/documents/".concat(n,"/fields/").concat(r,"/signature/").concat(e)).then((function(t){return t.data}))]}))}))}}),Recipients:Object.freeze({__proto__:null,updateRecipientStatus:ot}),Signatures:Object.freeze({__proto__:null,createSignature:function(t,n,r){var e=new FormData;return e.append("signature",r,n),t.api.post("/signatures",e).then((function(t){return t.data}))},getSignatures:function(t){return t.api.get("/signatures").then((function(t){return t.data}))},getSignature:function(t,n){return t.api.get("/signatures/".concat(n)).then((function(t){return t.data}))},deleteSignature:function(t,n){return t.api.delete("/signatures/".concat(n)).then((function(t){return t.data}))}}),Initials:Object.freeze({__proto__:null,createInitials:function(t,n,r){var e=new FormData;return e.append("initial",r,n),t.api.post("/initials",e).then((function(t){return t.data}))}}),Types:Object.freeze({__proto__:null})});var ft,st,at,ct;!function(t){t.TEMPLATE_CREATOR_CREATE_PUBLIC="template:creator:create:public",t.TEMPLATE_CREATOR_CREATE_ORG="template:creator:create:org",t.TEMPLATE_CREATOR_CREATE_PERSONAL="template:creator:create:personal",t.TEMPLATE_CREATOR_DELETE="template:creator:delete",t.TEMPLATE_CREATOR_VISIBILITY="template:creator:visibility",t.TEMPLATE_MEMBER_READ="template:member:read",t.TEMPLATE_MEMBER_WRITE="template:member:write",t.TEMPLATE_MEMBER_DELETE="template:member:delete",t.TEMPLATE_MEMBER_VISIBILITY="template:member:visibility"}(ft||(ft={})),function(t){t.CREATOR="creator",t.ORGANIZATION_MEMBER="organization_member",t.ORGANIZATION_MEMBER_AS_CREATOR="organization_member_as_creator",t.EVERYONE="everyone",t.EVERYONE_AS_CREATOR="everyone_as_creator"}(st||(st={})),function(t){t.CREATE_PERSONAL="create_personal",t.CREATE_ORG="create_org",t.CREATE_PUBLIC="create_public",t.READ="read",t.WRITE="write",t.DELETE="delete",t.CHANGE_VISIBILITY_PERSONAL="change_visibility_personal",t.CHANGE_VISIBILITY_ORG="change_visibility_org",t.CHANGE_VISIBILITY_PUBLIC="change_visibility_public"}(at||(at={})),function(t){t.CREATED_AT="created_at",t.UPDATED_AT="updated_at",t.NAME="name",t.LAST_USED_AT="last_used_at",t.COUNTER="counter",t.STAR_COUNTER="star_counter"}(ct||(ct={}));var ht,lt=function(t,n){return function(){for(var r=new Array(arguments.length),e=0;e<r.length;e++)r[e]=arguments[e];return t.apply(n,r)}},dt=Object.prototype.toString,vt=(ht=Object.create(null),function(t){var n=dt.call(t);return ht[n]||(ht[n]=n.slice(8,-1).toLowerCase())});function pt(t){return t=t.toLowerCase(),function(n){return vt(n)===t}}function mt(t){return Array.isArray(t)}function wt(t){return void 0===t}var yt=pt("ArrayBuffer");function gt(t){return null!==t&&"object"==typeof t}function bt(t){if("object"!==vt(t))return!1;var n=Object.getPrototypeOf(t);return null===n||n===Object.prototype}var Et=pt("Date"),_t=pt("File"),At=pt("Blob"),Rt=pt("FileList");function Ot(t){return"[object Function]"===dt.call(t)}var St=pt("URLSearchParams");function jt(t,n){if(null!=t)if("object"!=typeof t&&(t=[t]),mt(t))for(var r=0,e=t.length;r<e;r++)n.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.call(null,t[i],i,t)}var Tt,Bt=(Tt="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return Tt&&t instanceof Tt}),xt={isArray:mt,isArrayBuffer:yt,isBuffer:function(t){return null!==t&&!wt(t)&&null!==t.constructor&&!wt(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var n="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||dt.call(t)===n||Ot(t.toString)&&t.toString()===n)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&yt(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:gt,isPlainObject:bt,isUndefined:wt,isDate:Et,isFile:_t,isBlob:At,isFunction:Ot,isStream:function(t){return gt(t)&&Ot(t.pipe)},isURLSearchParams:St,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:jt,merge:function t(){var n={};function r(r,e){n[e]=bt(n[e])&&bt(r)?t(n[e],r):bt(r)?t({},r):mt(r)?r.slice():r}for(var e=0,i=arguments.length;e<i;e++)jt(arguments[e],r);return n},extend:function(t,n,r){return jt(n,(function(n,e){t[e]=r&&"function"==typeof n?lt(n,r):n})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,n,r,e){t.prototype=Object.create(n.prototype,e),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)},toFlatObject:function(t,n,r){var e,i,o,u={};n=n||{};do{for(i=(e=Object.getOwnPropertyNames(t)).length;i-- >0;)u[o=e[i]]||(n[o]=t[o],u[o]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,n))&&t!==Object.prototype);return n},kindOf:vt,kindOfTest:pt,endsWith:function(t,n,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length);var e=t.indexOf(n,r-=n.length);return-1!==e&&e===r},toArray:function(t){if(!t)return null;var n=t.length;if(wt(n))return null;for(var r=new Array(n);n-- >0;)r[n]=t[n];return r},isTypedArray:Bt,isFileList:Rt};function Nt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Mt=function(t,n,r){if(!n)return t;var e;if(r)e=r(n);else if(xt.isURLSearchParams(n))e=n.toString();else{var i=[];xt.forEach(n,(function(t,n){null!=t&&(xt.isArray(t)?n+="[]":t=[t],xt.forEach(t,(function(t){xt.isDate(t)?t=t.toISOString():xt.isObject(t)&&(t=JSON.stringify(t)),i.push(Nt(n)+"="+Nt(t))})))})),e=i.join("&")}if(e){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+e}return t};function kt(){this.handlers=[]}kt.prototype.use=function(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},kt.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},kt.prototype.forEach=function(t){xt.forEach(this.handlers,(function(n){null!==n&&t(n)}))};var Dt=kt,Ut="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ct(t,n,r){return t(r={path:n,exports:{},require:function(){return It()}},r.exports),r.exports}function Pt(t){if(t.__esModule)return t;var n=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var e=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,e.get?e:{enumerable:!0,get:function(){return t[r]}})})),n}function It(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var zt=Ut.process,Lt=function(t,n){xt.forEach(t,(function(r,e){e!==n&&e.toUpperCase()===n.toUpperCase()&&(t[n]=r,delete t[e])}))};function Jt(t,n,r,e,i){Error.call(this),this.message=t,this.name="AxiosError",n&&(this.code=n),r&&(this.config=r),e&&(this.request=e),i&&(this.response=i)}xt.inherits(Jt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var qt=Jt.prototype,Ht={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(t){Ht[t]={value:t}})),Object.defineProperties(Jt,Ht),Object.defineProperty(qt,"isAxiosError",{value:!0}),Jt.from=function(t,n,r,e,i,o){var u=Object.create(qt);return xt.toFlatObject(t,u,(function(t){return t!==Error.prototype})),Jt.call(u,t.message,n,r,e,i),u.name=t.name,o&&Object.assign(u,o),u};var Xt=Jt,Kt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wt=function(t,n){n=n||new FormData;var r=[];function e(t){return null===t?"":xt.isDate(t)?t.toISOString():xt.isArrayBuffer(t)||xt.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):d.from(t):t}return function t(i,o){if(xt.isPlainObject(i)||xt.isArray(i)){if(-1!==r.indexOf(i))throw Error("Circular reference detected in "+o);r.push(i),xt.forEach(i,(function(r,i){if(!xt.isUndefined(r)){var u,f=o?o+"."+i:i;if(r&&!o&&"object"==typeof r)if(xt.endsWith(i,"{}"))r=JSON.stringify(r);else if(xt.endsWith(i,"[]")&&(u=xt.toArray(r)))return void u.forEach((function(t){!xt.isUndefined(t)&&n.append(f,e(t))}));t(r,f)}})),r.pop()}else n.append(o,e(i))}(t),n},Zt=xt.isStandardBrowserEnv()?{write:function(t,n,r,e,i,o){var u=[];u.push(t+"="+encodeURIComponent(n)),xt.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),xt.isString(e)&&u.push("path="+e),xt.isString(i)&&u.push("domain="+i),!0===o&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},$t=function(t,n){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)?function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t}(t,n):n},Vt=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Gt=xt.isStandardBrowserEnv()?function(){var t,n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function e(t){var e=t;return n&&(r.setAttribute("href",e),e=r.href),r.setAttribute("href",e),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=e(window.location.href),function(n){var r=xt.isString(n)?e(n):n;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function Qt(t){Xt.call(this,null==t?"canceled":t,Xt.ERR_CANCELED),this.name="CanceledError"}xt.inherits(Qt,Xt,{__CANCEL__:!0});var Yt=Qt,tn={"Content-Type":"application/x-www-form-urlencoded"};function nn(t,n){!xt.isUndefined(t)&&xt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=n)}var rn,en={transitional:Kt,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==zt&&"[object process]"===Object.prototype.toString.call(zt))&&(rn=function(t){return new Promise((function(n,r){var e,i=t.data,o=t.headers,u=t.responseType;function f(){t.cancelToken&&t.cancelToken.unsubscribe(e),t.signal&&t.signal.removeEventListener("abort",e)}xt.isFormData(i)&&xt.isStandardBrowserEnv()&&delete o["Content-Type"];var s=new XMLHttpRequest;if(t.auth){var a=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+c)}var h=$t(t.baseURL,t.url);function l(){if(s){var e,i,o,a,c,h="getAllResponseHeaders"in s?(e=s.getAllResponseHeaders(),c={},e?(xt.forEach(e.split("\n"),(function(t){if(a=t.indexOf(":"),i=xt.trim(t.substr(0,a)).toLowerCase(),o=xt.trim(t.substr(a+1)),i){if(c[i]&&Vt.indexOf(i)>=0)return;c[i]="set-cookie"===i?(c[i]?c[i]:[]).concat([o]):c[i]?c[i]+", "+o:o}})),c):c):null;!function(t,n,r){var e=r.config.validateStatus;r.status&&e&&!e(r.status)?n(new Xt("Request failed with status code "+r.status,[Xt.ERR_BAD_REQUEST,Xt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}((function(t){n(t),f()}),(function(t){r(t),f()}),{data:u&&"text"!==u&&"json"!==u?s.response:s.responseText,status:s.status,statusText:s.statusText,headers:h,config:t,request:s}),s=null}}if(s.open(t.method.toUpperCase(),Mt(h,t.params,t.paramsSerializer),!0),s.timeout=t.timeout,"onloadend"in s?s.onloadend=l:s.onreadystatechange=function(){s&&4===s.readyState&&(0!==s.status||s.responseURL&&0===s.responseURL.indexOf("file:"))&&setTimeout(l)},s.onabort=function(){s&&(r(new Xt("Request aborted",Xt.ECONNABORTED,t,s)),s=null)},s.onerror=function(){r(new Xt("Network Error",Xt.ERR_NETWORK,t,s,s)),s=null},s.ontimeout=function(){var n=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";t.timeoutErrorMessage&&(n=t.timeoutErrorMessage),r(new Xt(n,(t.transitional||Kt).clarifyTimeoutError?Xt.ETIMEDOUT:Xt.ECONNABORTED,t,s)),s=null},xt.isStandardBrowserEnv()){var d=(t.withCredentials||Gt(h))&&t.xsrfCookieName?Zt.read(t.xsrfCookieName):void 0;d&&(o[t.xsrfHeaderName]=d)}"setRequestHeader"in s&&xt.forEach(o,(function(t,n){void 0===i&&"content-type"===n.toLowerCase()?delete o[n]:s.setRequestHeader(n,t)})),xt.isUndefined(t.withCredentials)||(s.withCredentials=!!t.withCredentials),u&&"json"!==u&&(s.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&s.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&s.upload&&s.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(e=function(t){s&&(r(!t||t&&t.type?new Yt:t),s.abort(),s=null)},t.cancelToken&&t.cancelToken.subscribe(e),t.signal&&(t.signal.aborted?e():t.signal.addEventListener("abort",e))),i||(i=null);var v,p=(v=/^([-+\w]{1,25})(:?\/\/|:)/.exec(h))&&v[1]||"";p&&-1===["http","https","file"].indexOf(p)?r(new Xt("Unsupported protocol "+p+":",Xt.ERR_BAD_REQUEST,t)):s.send(i)}))}),rn),transformRequest:[function(t,n){if(Lt(n,"Accept"),Lt(n,"Content-Type"),xt.isFormData(t)||xt.isArrayBuffer(t)||xt.isBuffer(t)||xt.isStream(t)||xt.isFile(t)||xt.isBlob(t))return t;if(xt.isArrayBufferView(t))return t.buffer;if(xt.isURLSearchParams(t))return nn(n,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var r,e=xt.isObject(t),i=n&&n["Content-Type"];if((r=xt.isFileList(t))||e&&"multipart/form-data"===i){var o=this.env&&this.env.FormData;return Wt(r?{"files[]":t}:t,o&&new o)}return e||"application/json"===i?(nn(n,"application/json"),function(t){if(xt.isString(t))try{return(0,JSON.parse)(t),xt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var n=this.transitional||en.transitional,r=!(n&&n.silentJSONParsing)&&"json"===this.responseType;if(r||n&&n.forcedJSONParsing&&xt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw Xt.from(t,Xt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};xt.forEach(["delete","get","head"],(function(t){en.headers[t]={}})),xt.forEach(["post","put","patch"],(function(t){en.headers[t]=xt.merge(tn)}));var on=en,un=function(t,n,r){var e=this||on;return xt.forEach(r,(function(r){t=r.call(e,t,n)})),t},fn=function(t){return!(!t||!t.__CANCEL__)};function sn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Yt}var an=function(t){return sn(t),t.headers=t.headers||{},t.data=un.call(t,t.data,t.headers,t.transformRequest),t.headers=xt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),xt.forEach(["delete","get","head","post","put","patch","common"],(function(n){delete t.headers[n]})),(t.adapter||on.adapter)(t).then((function(n){return sn(t),n.data=un.call(t,n.data,n.headers,t.transformResponse),n}),(function(n){return fn(n)||(sn(t),n&&n.response&&(n.response.data=un.call(t,n.response.data,n.response.headers,t.transformResponse))),Promise.reject(n)}))},cn=function(t,n){n=n||{};var r={};function e(t,n){return xt.isPlainObject(t)&&xt.isPlainObject(n)?xt.merge(t,n):xt.isPlainObject(n)?xt.merge({},n):xt.isArray(n)?n.slice():n}function i(r){return xt.isUndefined(n[r])?xt.isUndefined(t[r])?void 0:e(void 0,t[r]):e(t[r],n[r])}function o(t){if(!xt.isUndefined(n[t]))return e(void 0,n[t])}function u(r){return xt.isUndefined(n[r])?xt.isUndefined(t[r])?void 0:e(void 0,t[r]):e(void 0,n[r])}function f(r){return r in n?e(t[r],n[r]):r in t?e(void 0,t[r]):void 0}var s={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:f};return xt.forEach(Object.keys(t).concat(Object.keys(n)),(function(t){var n=s[t]||i,e=n(t);xt.isUndefined(e)&&n!==f||(r[t]=e)})),r},hn={};["object","boolean","number","function","string","symbol"].forEach((function(t,n){hn[t]=function(r){return typeof r===t||"a"+(n<1?"n ":" ")+t}}));var ln={};hn.transitional=function(t,n,r){function e(t,n){return"[Axios v0.27.2] Transitional option '"+t+"'"+n+(r?". "+r:"")}return function(r,i,o){if(!1===t)throw new Xt(e(i," has been removed"+(n?" in "+n:"")),Xt.ERR_DEPRECATED);return n&&!ln[i]&&(ln[i]=!0,console.warn(e(i," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(r,i,o)}};var dn={assertOptions:function(t,n,r){if("object"!=typeof t)throw new Xt("options must be an object",Xt.ERR_BAD_OPTION_VALUE);for(var e=Object.keys(t),i=e.length;i-- >0;){var o=e[i],u=n[o];if(u){var f=t[o],s=void 0===f||u(f,o,t);if(!0!==s)throw new Xt("option "+o+" must be "+s,Xt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Xt("Unknown option "+o,Xt.ERR_BAD_OPTION)}},validators:hn},vn=dn.validators;function pn(t){this.defaults=t,this.interceptors={request:new Dt,response:new Dt}}pn.prototype.request=function(t,n){"string"==typeof t?(n=n||{}).url=t:n=t||{},(n=cn(this.defaults,n)).method=n.method?n.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var r=n.transitional;void 0!==r&&dn.assertOptions(r,{silentJSONParsing:vn.transitional(vn.boolean),forcedJSONParsing:vn.transitional(vn.boolean),clarifyTimeoutError:vn.transitional(vn.boolean)},!1);var e=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(n)||(i=i&&t.synchronous,e.unshift(t.fulfilled,t.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!i){var f=[an,void 0];for(Array.prototype.unshift.apply(f,e),f=f.concat(u),o=Promise.resolve(n);f.length;)o=o.then(f.shift(),f.shift());return o}for(var s=n;e.length;){var a=e.shift(),c=e.shift();try{s=a(s)}catch(t){c(t);break}}try{o=an(s)}catch(t){return Promise.reject(t)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},pn.prototype.getUri=function(t){t=cn(this.defaults,t);var n=$t(t.baseURL,t.url);return Mt(n,t.params,t.paramsSerializer)},xt.forEach(["delete","get","head","options"],(function(t){pn.prototype[t]=function(n,r){return this.request(cn(r||{},{method:t,url:n,data:(r||{}).data}))}})),xt.forEach(["post","put","patch"],(function(t){function n(n){return function(r,e,i){return this.request(cn(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:e}))}}pn.prototype[t]=n(),pn.prototype[t+"Form"]=n(!0)}));var mn=pn;function wn(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var r=this;this.promise.then((function(t){if(r._listeners){var n,e=r._listeners.length;for(n=0;n<e;n++)r._listeners[n](t);r._listeners=null}})),this.promise.then=function(t){var n,e=new Promise((function(t){r.subscribe(t),n=t})).then(t);return e.cancel=function(){r.unsubscribe(n)},e},t((function(t){r.reason||(r.reason=new Yt(t),n(r.reason))}))}wn.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},wn.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},wn.prototype.unsubscribe=function(t){if(this._listeners){var n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}},wn.source=function(){var t;return{token:new wn((function(n){t=n})),cancel:t}};var yn=wn,gn=function t(n){var r=new mn(n),e=lt(mn.prototype.request,r);return xt.extend(e,mn.prototype,r),xt.extend(e,r),e.create=function(r){return t(cn(n,r))},e}(on);gn.Axios=mn,gn.CanceledError=Yt,gn.CancelToken=yn,gn.isCancel=fn,gn.VERSION="0.27.2",gn.toFormData=Wt,gn.AxiosError=Xt,gn.Cancel=gn.CanceledError,gn.all=function(t){return Promise.all(t)},gn.spread=function(t){return function(n){return t.apply(null,n)}},gn.isAxiosError=function(t){return xt.isObject(t)&&!0===t.isAxiosError};var bn=gn;bn.default=gn;var En=bn,_n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")},An=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return _n()}try{return __global__||_n()}finally{delete Object.prototype.__global__}}(),Rn=function(t){return console.debug("[JS-SDK] ".concat(t.method.toUpperCase()," ").concat(t.baseURL).concat(t.url),t.data?JSON.stringify(t.data):""),t},On=function(){function t(t){this.environment="verdocs",this.sessionType="user",this.baseURL="https://api.verdocs.com",this.clientID="not-set",this.timeout=3e3,this.token=null,this.nextListenerId=0,this.sessionListeners=new Map,this.requestLoggerId=null,this.session=null,this.Documents=ut,this.baseURL=(null==t?void 0:t.baseURL)||"https://api.verdocs.com",this.timeout=(null==t?void 0:t.timeout)||3e3,this.environment=(null==t?void 0:t.environment)||"verdocs",this.sessionType=(null==t?void 0:t.sessionType)||"user",this.clientID=(null==t?void 0:t.clientID)||"not-set",this.api=En.create({baseURL:this.baseURL,timeout:this.timeout})}return t.prototype.setDefault=function(){An[Sn]=this},t.getDefault=function(){return An[Sn]},t.prototype.getEnvironment=function(){return this.environment},t.prototype.getSessionType=function(){return this.sessionType},t.prototype.getBaseURL=function(){return this.baseURL},t.prototype.getClientID=function(){return this.clientID},t.prototype.getTimeout=function(){return this.timeout},t.prototype.getSession=function(){return this.session},t.prototype.setEnvironment=function(t){return this.environment=t,this},t.prototype.setSessionType=function(t){return this.sessionType=t,this},t.prototype.setBaseURL=function(t){return this.api.defaults.baseURL=t,this},t.prototype.setClientID=function(t){return this.clientID=t,this.api.defaults.headers.common["X-Client-ID"]=t,this},t.prototype.setTimeout=function(t){return this.timeout=t,this.api.defaults.timeout=t,this},t.prototype.logRequests=function(t){return t&&null===this.requestLoggerId?this.requestLoggerId=this.api.interceptors.request.use(Rn):t||null===this.requestLoggerId||this.api.interceptors.request.eject(this.requestLoggerId),this},t.prototype.setToken=function(t){if(!t)return this.clearSession();var n=G(t);return null===n||n.exp&&1e3*n.exp<(new Date).getTime()?this.clearSession():(this.token=t,this.session=n,this.api.defaults.headers.common.Authorization="Bearer ".concat(t),localStorage.setItem(this.sessionStorageKey(),t),this.notifySessionListeners(),this)},t.prototype.getToken=function(){return this.token},t.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())},t.prototype.clearSession=function(){return localStorage.removeItem(this.sessionStorageKey()),delete this.api.defaults.headers.common.Authorization,this.session=null,this.token=null,this.notifySessionListeners(),this},t.prototype.notifySessionListeners=function(){var t=this;this.sessionListeners.forEach((function(n){try{n(t,t.session)}catch(t){}}))},t.prototype.onSessionChanged=function(t){var n=this;this.nextListenerId++;var r=Symbol.for(""+this.nextListenerId);return this.sessionListeners.set(r,t),function(){n.sessionListeners.delete(r)}},t.prototype.loadSession=function(){var t=localStorage.getItem(this.sessionStorageKey());return t?this.setToken(t):this.clearSession()},t}(),Sn=Symbol.for("verdocs-default-endpoint");An[Sn]||(An[Sn]=new On);export{d as B,On as V,nt as a,rt as b,et as c,Pt as d,Ct as e,Ft as f,tt as g,Ut as h,It as i,zt as p,ot as u}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-caed7818.system.js","./p-
|
|
1
|
+
System.register(["./p-caed7818.system.js","./p-6fd6ae35.system.js"],(function(e){"use strict";var t,n,i,o;return{setters:[function(e){t=e.r;n=e.c;i=e.h},function(e){o=e.V}],execute:function(){var r='<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>';var c='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var s='verdocs-quick-functions{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:var(--verdocs-background-dark);text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#50be50}verdocs-quick-functions button svg{fill:#ffffff}';var a=e("verdocs_quick_functions",function(){function e(e){t(this,e);this.createTemplate=n(this,"createTemplate",7);this.createDocument=n(this,"createDocument",7);this.endpoint=o.getDefault()}e.prototype.handleCreateTemplate=function(){this.createTemplate.emit()};e.prototype.handleCreateDocument=function(){this.createDocument.emit()};e.prototype.render=function(){var e=this;return i("div",{class:"container"},i("p",{class:"title"},"Quick Create"),i("button",{onClick:function(){return e.handleCreateTemplate()},innerHTML:r},"Template"),i("button",{onClick:function(){return e.handleCreateDocument()},innerHTML:c},"Document"))};return e}());a.style=s}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as o,H as i}from"./p-2bc58746.js";import{V as t,g as s,a as r,u as n,b as a,c as l}from"./p-06f38046.js";var d=new RegExp(/\+[1-9]\d{6,14}/g),c=/^(([^<>()\[\]\\.,;:\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,}))$/;function u(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 h(e,o){return e*o}const p=class{constructor(o){e(this,o),this.endpoint=t.getDefault(),this.documentid=null,this.roleid=null,this.invitecode=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=""}async componentDidLoad(){try{console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);const{session:e,recipient:o,signerToken:i}=await s(this.endpoint,{documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode});console.log("[SIGN] Got signing session",e),console.log("[SIGN] Recipient",o),this.recipient=o,this.signerToken=i,this.endpoint.setToken(i),this.recipient.agreed&&(this.nextButtonLabel="Next");const t=await r(this.endpoint,this.documentid);this.document=t,console.log("[SIGN] Document",t),this.pdfUrl=`${this.endpoint.getBaseURL()}/documents/${this.documentid}/envelope_documents/${t.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)}}handleClickAgree(){console.log("agree clicked"),n(this.endpoint,this.documentid,this.roleid,"update",{agreed:!0}).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`,o=await a(this.endpoint,this.documentid,this.document.envelope_document_id);let i=new XMLHttpRequest;i.responseType="blob",i.onload=function(){let o=document.createElement("a");o.href=window.URL.createObjectURL(i.response),o.download=e,o.style.display="none",document.body.appendChild(o),o.click(),o.remove()};const t=`data:application/pdf;base64,${o}`;console.log("url",t.length,t),i.open("GET",`data:application/pdf;base64,${o}`),i.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,o,i){switch(console.log("fieldChange",e,o.detail),e.type){case"textbox":l(this.endpoint,this.documentid,e.name,{prepared:!1,value:o.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"checkbox_group":l(this.endpoint,this.documentid,e.name,{prepared:!1,value:{options:[{id:i,checked:o.detail}]}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"radio_button_group":const t=e.settings.options.map((e=>({id:e.id,selected:i===e.id})));l(this.endpoint,this.documentid,e.name,{prepared:!1,value:{options:t}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"dropdown":l(this.endpoint,this.documentid,e.name,{prepared:!1,value:o.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"initial":console.log("Got initial",o.detail);break;case"signature":console.log("Got signature",o.detail)}}renderCheckboxGroupOption(e,i,t,s){const r={left:`${h(e.xRatio,t.x)}px`,bottom:`${h(e.yRatio,t.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:u(this.recipientIndex)};return o("verdocs-field-checkbox",{style:r,order:s,value:t.checked,onFieldChange:e=>this.handleFieldChange(i,e,t.id)})}renderRadioGroupOption(e,i,t,s){const r={left:`${h(e.xRatio,t.x)}px`,bottom:`${h(e.yRatio,t.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:u(this.recipientIndex)};return o("verdocs-field-radio-button",{style:r,order:s,value:t.id,name:i.name,checked:t.selected,onFieldChange:e=>this.handleFieldChange(i,e,t.id)})}renderField(e,i){const{required:t=!1,settings:s={}}=e,{x:r=0,y:n=0,base64:a="",placeholder:l="",options:d=[],value:c="",result:p=""}=s,g=this.pdfPageInfo.pages.find((o=>o.pageNumber===e.page));if(!g)return console.log("Unable to render invalid field",e),o("div",{class:"invalid-field"},"Invalid field.");const x={left:`${h(g.xRatio,r)}px`,bottom:`${h(g.yRatio,n)}px`,position:"absolute",transform:`scale(${g.xRatio}, ${g.yRatio})`,backgroundColor:e.settings.rgba||u(this.recipientIndex)};e.settings.height&&(x.height=`${e.settings.height}px`),e.settings.width&&(x.width=`${e.settings.width}px`),console.log("rendering field",e.type,e);const b=`field-${e.name}`;switch(e.type){case"signature":return o("verdocs-field-signature",{style:x,value:a,required:t,id:b});case"initial":return o("verdocs-field-initial",{style:x,required:t,id:b});case"textbox":return o("verdocs-field-textbox",{style:x,order:i,value:p||"",placeholder:l,id:b,onFieldChange:o=>this.handleFieldChange(e,o)});case"textarea":return o("verdocs-field-textarea",{style:x,placeholder:l||"",id:b});case"date":return o("verdocs-field-date",{style:x,order:i,value:p||"",placeholder:l,required:t,id:b});case"dropdown":return o("verdocs-field-dropdown",{style:x,options:d,value:c,required:t,id:b,onFieldChange:o=>this.handleFieldChange(e,o)});case"checkbox":return o("verdocs-field-checkbox",{style:x,value:p||"",id:b});case"checkbox_group":return e.settings.options.map(((o,i)=>this.renderCheckboxGroupOption(g,e,o,i)));case"radio_button_group":return e.settings.options.map(((o,i)=>this.renderRadioGroupOption(g,e,o,i)));case"attachment":return o("verdocs-field-attachment",{style:x,value:p||"",id:b});case"payment":return o("verdocs-field-payment",{style:x,field:e,id:b});default:console.log("[SIGN] Skipping unsupported field type",e)}return o("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')}isFieldValid(e){var o,i,t,s,r,n,a,l,u,h,p,g,x;switch(e.type){case"textbox":switch((null===(o=e.settings)||void 0===o?void 0:o.validator)||""){case"email":return x=(null===(i=e.settings)||void 0===i?void 0:i.result)||"",c.test(x);case"phone":return function(e){return null!==(o=e)&&o.length<16&&o.length>6&&d.test(o)||""===o||null===o;var o}((null===(t=e.settings)||void 0===t?void 0:t.result)||"");default:return!!(null===(s=e.settings)||void 0===s?void 0:s.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===(n=e.settings)||void 0===n?void 0:n.value);case"checkbox_group":const b=((null===(l=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===l?void 0:l.filter((e=>e.checked)))||[]).length;return b>=((null===(u=e.settings)||void 0===u?void 0:u.minimum_checked)||0)&&b<=((null===(h=e.settings)||void 0===h?void 0:h.maximum_checked)||999);case"radio_button_group":return((null===(g=null===(p=e.settings)||void 0===p?void 0:p.options)||void 0===g?void 0:g.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 o=e.findIndex((e=>e.name===this.focusedField));console.log("focused Index",o);let i=o+1;i>=e.length&&(i=0);const t=e[i];if(console.log("next required fielod",t),t){const e=document.getElementById(`field-${t.name}`);null==e||e.focusField(),this.focusedField=t.name}}render(){var e,t,s,r,n;return o(i,{class:{storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV),agreed:null===(e=this.recipient)||void 0===e?void 0:e.agreed}},o("div",{class:"header"},o("div",{class:"intro"},"Please review and act on these documents."),o("div",{class:"toolbar"},o("div",{class:"tools"},o("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===(t=this.recipient)||void 0===t?void 0:t.agreed)?o("div",{style:{flex:"1"}}):o("div",{class:"agree"},o("div",{class:"agree-checkbox"},o("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:()=>this.handleClickAgree()}),o("label",{htmlFor:"agree-checkbox-element"})),o("span",null,"I agree to use electronic records and signatures.")),o("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!(null===(s=this.recipient)||void 0===s?void 0:s.agreed),onClick:()=>this.handleNext()})))),(null===(r=this.recipient)||void 0===r?void 0:r.agreed)?o("div",{style:{display:"none"}}):o("div",{class:"cover"}),o("div",{class:"document"},this.pdfUrl?o("verdocs-view",{source:this.pdfUrl,token:this.signerToken,onDocumentRendered:e=>this.handleDocumentRendered(e)}):o("verdocs-loader",null),((null===(n=this.pdfPageInfo)||void 0===n?void 0:n.pages)||[]).map((e=>{var i;return o("div",{class:"page-controls",style:{height:`${e.height}px`,width:`${e.width}px`,top:`${e.canvasTop}px`,margin:"0 auto"}},(null===(i=this.pdfPageInfo)||void 0===i?void 0:i.numRendered)>0?this.fields.filter((o=>o.page===e.pageNumber)).map(((e,o)=>this.renderField(e,o))):o("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))}};p.style='verdocs-sign{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", 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 14px;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{-ms-flex:1;flex:1;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-right:10px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree .agree-checkbox{background:#ccc;-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;position:relative;margin:0 10px 0 14px}verdocs-sign .agree .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign .agree .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 .agree-checkbox label .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree .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 .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';export{p as verdocs_sign}
|
|
1
|
+
import{r as e,h as o,H as i}from"./p-2bc58746.js";import{V as t,g as s,a as r,u as n,b as a,c as l}from"./p-c34360d3.js";var d=new RegExp(/\+[1-9]\d{6,14}/g),c=/^(([^<>()\[\]\\.,;:\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,}))$/;function u(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 h(e,o){return e*o}const p=class{constructor(o){e(this,o),this.endpoint=t.getDefault(),this.documentid=null,this.roleid=null,this.invitecode=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=""}async componentDidLoad(){try{console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);const{session:e,recipient:o,signerToken:i}=await s(this.endpoint,{documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode});console.log("[SIGN] Got signing session",e),console.log("[SIGN] Recipient",o),this.recipient=o,this.signerToken=i,this.endpoint.setToken(i),this.recipient.agreed&&(this.nextButtonLabel="Next");const t=await r(this.endpoint,this.documentid);this.document=t,console.log("[SIGN] Document",t),this.pdfUrl=`${this.endpoint.getBaseURL()}/documents/${this.documentid}/envelope_documents/${t.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)}}handleClickAgree(){console.log("agree clicked"),n(this.endpoint,this.documentid,this.roleid,"update",{agreed:!0}).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`,o=await a(this.endpoint,this.documentid,this.document.envelope_document_id);let i=new XMLHttpRequest;i.responseType="blob",i.onload=function(){let o=document.createElement("a");o.href=window.URL.createObjectURL(i.response),o.download=e,o.style.display="none",document.body.appendChild(o),o.click(),o.remove()};const t=`data:application/pdf;base64,${o}`;console.log("url",t.length,t),i.open("GET",`data:application/pdf;base64,${o}`),i.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,o,i){switch(console.log("fieldChange",e,o.detail),e.type){case"textbox":l(this.endpoint,this.documentid,e.name,{prepared:!1,value:o.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"checkbox_group":l(this.endpoint,this.documentid,e.name,{prepared:!1,value:{options:[{id:i,checked:o.detail}]}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"radio_button_group":const t=e.settings.options.map((e=>({id:e.id,selected:i===e.id})));l(this.endpoint,this.documentid,e.name,{prepared:!1,value:{options:t}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"dropdown":l(this.endpoint,this.documentid,e.name,{prepared:!1,value:o.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"initial":console.log("Got initial",o.detail);break;case"signature":console.log("Got signature",o.detail)}}renderCheckboxGroupOption(e,i,t,s){const r={left:`${h(e.xRatio,t.x)}px`,bottom:`${h(e.yRatio,t.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:u(this.recipientIndex)};return o("verdocs-field-checkbox",{style:r,order:s,value:t.checked,onFieldChange:e=>this.handleFieldChange(i,e,t.id)})}renderRadioGroupOption(e,i,t,s){const r={left:`${h(e.xRatio,t.x)}px`,bottom:`${h(e.yRatio,t.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:u(this.recipientIndex)};return o("verdocs-field-radio-button",{style:r,order:s,value:t.id,name:i.name,checked:t.selected,onFieldChange:e=>this.handleFieldChange(i,e,t.id)})}renderField(e,i){const{required:t=!1,settings:s={}}=e,{x:r=0,y:n=0,base64:a="",placeholder:l="",options:d=[],value:c="",result:p=""}=s,g=this.pdfPageInfo.pages.find((o=>o.pageNumber===e.page));if(!g)return console.log("Unable to render invalid field",e),o("div",{class:"invalid-field"},"Invalid field.");const x={left:`${h(g.xRatio,r)}px`,bottom:`${h(g.yRatio,n)}px`,position:"absolute",transform:`scale(${g.xRatio}, ${g.yRatio})`,backgroundColor:e.settings.rgba||u(this.recipientIndex)};e.settings.height&&(x.height=`${e.settings.height}px`),e.settings.width&&(x.width=`${e.settings.width}px`),console.log("rendering field",e.type,e);const b=`field-${e.name}`;switch(e.type){case"signature":return o("verdocs-field-signature",{style:x,value:a,required:t,id:b});case"initial":return o("verdocs-field-initial",{style:x,required:t,id:b});case"textbox":return o("verdocs-field-textbox",{style:x,order:i,value:p||"",placeholder:l,id:b,onFieldChange:o=>this.handleFieldChange(e,o)});case"textarea":return o("verdocs-field-textarea",{style:x,placeholder:l||"",id:b});case"date":return o("verdocs-field-date",{style:x,order:i,value:p||"",placeholder:l,required:t,id:b});case"dropdown":return o("verdocs-field-dropdown",{style:x,options:d,value:c,required:t,id:b,onFieldChange:o=>this.handleFieldChange(e,o)});case"checkbox":return o("verdocs-field-checkbox",{style:x,value:p||"",id:b});case"checkbox_group":return e.settings.options.map(((o,i)=>this.renderCheckboxGroupOption(g,e,o,i)));case"radio_button_group":return e.settings.options.map(((o,i)=>this.renderRadioGroupOption(g,e,o,i)));case"attachment":return o("verdocs-field-attachment",{style:x,value:p||"",id:b});case"payment":return o("verdocs-field-payment",{style:x,field:e,id:b});default:console.log("[SIGN] Skipping unsupported field type",e)}return o("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')}isFieldValid(e){var o,i,t,s,r,n,a,l,u,h,p,g,x;switch(e.type){case"textbox":switch((null===(o=e.settings)||void 0===o?void 0:o.validator)||""){case"email":return x=(null===(i=e.settings)||void 0===i?void 0:i.result)||"",c.test(x);case"phone":return function(e){return null!==(o=e)&&o.length<16&&o.length>6&&d.test(o)||""===o||null===o;var o}((null===(t=e.settings)||void 0===t?void 0:t.result)||"");default:return!!(null===(s=e.settings)||void 0===s?void 0:s.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===(n=e.settings)||void 0===n?void 0:n.value);case"checkbox_group":const b=((null===(l=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===l?void 0:l.filter((e=>e.checked)))||[]).length;return b>=((null===(u=e.settings)||void 0===u?void 0:u.minimum_checked)||0)&&b<=((null===(h=e.settings)||void 0===h?void 0:h.maximum_checked)||999);case"radio_button_group":return((null===(g=null===(p=e.settings)||void 0===p?void 0:p.options)||void 0===g?void 0:g.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 o=e.findIndex((e=>e.name===this.focusedField));console.log("focused Index",o);let i=o+1;i>=e.length&&(i=0);const t=e[i];if(console.log("next required fielod",t),t){const e=document.getElementById(`field-${t.name}`);null==e||e.focusField(),this.focusedField=t.name}}render(){var e,t,s,r,n;return o(i,{class:{storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV),agreed:null===(e=this.recipient)||void 0===e?void 0:e.agreed}},o("div",{class:"header"},o("div",{class:"intro"},"Please review and act on these documents."),o("div",{class:"toolbar"},o("div",{class:"tools"},o("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===(t=this.recipient)||void 0===t?void 0:t.agreed)?o("div",{style:{flex:"1"}}):o("div",{class:"agree"},o("div",{class:"agree-checkbox"},o("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:()=>this.handleClickAgree()}),o("label",{htmlFor:"agree-checkbox-element"})),o("span",null,"I agree to use electronic records and signatures.")),o("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!(null===(s=this.recipient)||void 0===s?void 0:s.agreed),onClick:()=>this.handleNext()})))),(null===(r=this.recipient)||void 0===r?void 0:r.agreed)?o("div",{style:{display:"none"}}):o("div",{class:"cover"}),o("div",{class:"document"},this.pdfUrl?o("verdocs-view",{source:this.pdfUrl,endpoint:this.endpoint,onDocumentRendered:e=>this.handleDocumentRendered(e)}):o("verdocs-loader",null),((null===(n=this.pdfPageInfo)||void 0===n?void 0:n.pages)||[]).map((e=>{var i;return o("div",{class:"page-controls",style:{height:`${e.height}px`,width:`${e.width}px`,top:`${e.canvasTop}px`,margin:"0 auto"}},(null===(i=this.pdfPageInfo)||void 0===i?void 0:i.numRendered)>0?this.fields.filter((o=>o.page===e.pageNumber)).map(((e,o)=>this.renderField(e,o))):o("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))}};p.style='verdocs-sign{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", 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 14px;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{-ms-flex:1;flex:1;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-right:10px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree .agree-checkbox{background:#ccc;-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;position:relative;margin:0 10px 0 14px}verdocs-sign .agree .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign .agree .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 .agree-checkbox label .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree .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 .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';export{p as verdocs_sign}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-2bc58746.js";import{V as i}from"./p-
|
|
1
|
+
import{r as t,c as s,h as e}from"./p-2bc58746.js";import{V as i}from"./p-c34360d3.js";const o=class{constructor(e){t(this,e),this.authenticated=s(this,"authenticated",7),this.endpoint=i.getDefault(),this.visible=!0,this.logo="https://verdocs.com/assets/blue-logo.svg",this.debug=!1,this.isAuthenticated=!1,this.displayMode="login",this.username="",this.password="",this.loggingIn=!1,this.activeSession=null,this.loginError=null}componentDidLoad(){this.endpoint.loadSession(),null!==this.endpoint.session?(this.isAuthenticated=!0,this.activeSession=this.endpoint.session,this.authenticated.emit({authenticated:!0,session:this.endpoint.session})):this.authenticated.emit({authenticated:!1,session:null})}handleLogin(){var t,s;this.loggingIn=!0,(t=this.endpoint,s={username:this.username,password:this.password},t.api.post("/authentication/login",s).then((function(t){return t.data}))).then((t=>{this.loggingIn=!1,this.endpoint.setToken(t.accessToken),this.activeSession=this.endpoint.session,this.isAuthenticated=!0,this.authenticated.emit({authenticated:!0,session:this.endpoint.session})})).catch((t=>{var s;console.log("[VERDOCS] Login error",t.response,JSON.stringify(t)),this.loggingIn=!1,this.activeSession=null,this.authenticated.emit({authenticated:!1,session:null}),403===(null===(s=null==t?void 0:t.response)||void 0===s?void 0:s.status)&&(this.loginError="Please check your username and password and try again.")}))}handleLogout(){this.endpoint.clearSession(),this.isAuthenticated=!1,this.authenticated.emit({authenticated:!1,session:null})}handleClearError(){this.loginError=null}render(){return this.visible?this.isAuthenticated?this.debug?e("div",{class:"status-result debug"},e("verdocs-button",{label:"Logout",disabled:this.loggingIn,onPress:()=>this.handleLogout()})):e("div",{class:"status-result"},"Authenticated"):"signup"===this.displayMode?e("div",{class:"signup-form"},e("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),e("h3",null,"Sign up for an account"),e("h4",null,"Already have an account?",e("verdocs-button",{label:"Log In",variant:"text",onClick:()=>this.displayMode="login",disabled:this.loggingIn})),e("form",{onSubmit:()=>this.handleLogin()},e("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:t=>this.username=t.detail,disabled:this.loggingIn}),e("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:t=>this.password=t.detail,disabled:this.loggingIn}),e("verdocs-button",{label:"Signup",disabled:this.loggingIn,onPress:()=>this.handleLogin(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))):e("div",{class:"login-form"},e("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),e("h3",null,"Log in to your account"),e("h4",null,"Don't have an account?",e("verdocs-button",{label:"Sign Up",variant:"text",onClick:()=>this.displayMode="signup",disabled:this.loggingIn})),e("form",{onSubmit:()=>this.handleLogin()},e("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:t=>this.username=t.detail,disabled:this.loggingIn}),e("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:t=>this.password=t.detail,disabled:this.loggingIn}),e("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:()=>this.displayMode="signup",disabled:this.loggingIn,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),e("verdocs-button",{label:"Login",disabled:this.loggingIn,onPress:()=>this.handleLogin(),style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})),this.loginError?e("verdocs-ok-dialog",{open:!0,heading:"Login Error",message:this.loginError,onClosed:()=>this.handleClearError()}):e("div",null)):e("div",{style:{display:"none"}},"Verdocs Auth Placeholder")}};o.style='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .login-form,verdocs-auth .signup-form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}';export{o as verdocs_auth}
|