@verdocs/web-sdk 2.2.40 → 2.2.43
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/{TemplateStore-42c35573.js → TemplateStore-d9936a68.js} +1 -1
- package/dist/cjs/{VerdocsEndpoint-ae3a69d6.js → VerdocsEndpoint-2d85658d.js} +85 -0
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +6 -3
- package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
- package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.js +6 -2
- package/dist/components/TemplateStore.js +1 -1
- package/dist/components/VerdocsEndpoint.js +85 -1
- package/dist/components/verdocs-template-create2.js +1 -1
- package/dist/components/verdocs-template-role-properties2.js +1 -1
- package/dist/components/verdocs-template-roles2.js +1 -1
- package/dist/components/verdocs-template-sender2.js +1 -1
- package/dist/components/verdocs-templates-list.js +6 -3
- package/dist/docs.json +1 -1
- package/dist/esm/{TemplateStore-1dfaf509.js → TemplateStore-018fc1db.js} +1 -1
- package/dist/esm/{VerdocsEndpoint-f58fcb3c.js → VerdocsEndpoint-b011af25.js} +85 -1
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/verdocs-button-panel_2.entry.js +2 -2
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_8.entry.js +2 -2
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-template-fields_4.entry.js +2 -2
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-templates-list.entry.js +6 -3
- package/dist/esm/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/{TemplateStore-1dfaf509.js → TemplateStore-018fc1db.js} +1 -1
- package/dist/esm-es5/VerdocsEndpoint-b011af25.js +1 -0
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/types/components/templates/verdocs-templates-list/verdocs-templates-list.d.ts +1 -1
- package/dist/verdocs-web-sdk/{p-4248ef54.system.entry.js → p-01166179.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ce804092.entry.js → p-0ad1fd33.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e48418fd.system.entry.js → p-0e5449d1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7c013c13.system.entry.js → p-10af7aec.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-081df4a1.system.entry.js → p-126ba5d2.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-69c0f441.system.entry.js → p-15cb963a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2184a570.entry.js → p-17d0e5f4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bb8d6bdb.entry.js → p-23be436b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-70df50d0.system.entry.js → p-261d376e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-61ad8441.system.entry.js → p-2f04fb38.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-30b4bd45.js +1 -0
- package/dist/verdocs-web-sdk/{p-0d35d591.system.entry.js → p-30ce4358.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-16043ac0.system.entry.js → p-343672f5.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d5a46144.system.entry.js → p-37187046.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7e558e92.entry.js → p-39cbfe15.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2f7236a5.entry.js → p-3abfff14.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c6cc7015.system.entry.js → p-4a94ee00.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f1c4035f.entry.js → p-4f439363.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5fa7fcf7.system.entry.js → p-50ac71f3.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-90ff8b2c.system.entry.js → p-5c50a778.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-691fa663.system.entry.js → p-5df0fa7a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2bc8c83c.system.entry.js → p-609c7fab.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3fd978ad.entry.js → p-6307e6ae.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-95259770.entry.js → p-66d66e2b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-32d4b31e.entry.js → p-6bda7dce.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-6e901911.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-6d1150ae.entry.js → p-76907130.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-34d2f66c.entry.js → p-7805f0e0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7549ad05.entry.js → p-79dc4f76.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-7b63017c.js +1 -0
- package/dist/verdocs-web-sdk/{p-53648483.system.entry.js → p-89aa696c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-35acc57f.entry.js → p-8da1555a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2ae9baa3.entry.js → p-961708ac.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-56c0cc86.system.entry.js → p-9934f3ec.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2a185ea9.entry.js → p-9b07a2a7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e6037224.system.entry.js → p-a0b02d83.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3ba65022.entry.js → p-a310f65b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d37aac3a.entry.js → p-a5425a9b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9b25404e.entry.js → p-b17a20b8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-01f875d4.system.entry.js → p-bb2c866b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-eaa5f223.system.entry.js → p-bd0bc3dd.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-79557fd0.entry.js → p-bfcf8ad2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-cbbf849f.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-6a795d03.system.entry.js → p-df6a373e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-eafc8bf7.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-9fa916b5.system.js → p-eb595245.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-23a92204.system.entry.js → p-ecf04564.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6823dd3e.entry.js → p-ee195e5e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3807b541.entry.js → p-eef694e8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-f2249009.system.entry.js → p-f1257cd0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-44fa9fba.entry.js → p-f8718b03.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-271c989f.entry.js → p-fde6b724.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/VerdocsEndpoint-f58fcb3c.js +0 -1
- package/dist/verdocs-web-sdk/p-4d4da6ef.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-53b991de.system.js +0 -1
- package/dist/verdocs-web-sdk/p-56f2a8ac.js +0 -1
- package/dist/verdocs-web-sdk/p-9c7093ab.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-c7757545.js +0 -1
@@ -20,6 +20,90 @@ var TemplatePermissions;
|
|
20
20
|
TemplatePermissions["TEMPLATE_MEMBER_DELETE"] = "template:member:delete";
|
21
21
|
TemplatePermissions["TEMPLATE_MEMBER_VISIBILITY"] = "template:member:visibility";
|
22
22
|
})(TemplatePermissions || (TemplatePermissions = {}));
|
23
|
+
var canPerformTemplateAction = function (session, action, template) {
|
24
|
+
var _a, _b;
|
25
|
+
if (!template && !action.includes('create')) {
|
26
|
+
return { canPerform: false, message: 'Missing required template object' };
|
27
|
+
}
|
28
|
+
// We use BOGUS here to force the option-chain in things like template?.profile_id to NOT match profile?.profile_id because if both
|
29
|
+
// were undefined, they would actually match.
|
30
|
+
var profile_id = (session === null || session === void 0 ? void 0 : session.profile_id) || 'BOGUS';
|
31
|
+
var organization_id = (session === null || session === void 0 ? void 0 : session.organization_id) || 'BOGUS';
|
32
|
+
if (!profile_id) {
|
33
|
+
return { canPerform: false, message: 'Active session required' };
|
34
|
+
}
|
35
|
+
var isCreator = (template === null || template === void 0 ? void 0 : template.profile_id) === profile_id;
|
36
|
+
var isSameOrg = (template === null || template === void 0 ? void 0 : template.organization_id) === organization_id;
|
37
|
+
var isPersonal = (_a = template === null || template === void 0 ? void 0 : template.is_personal) !== null && _a !== void 0 ? _a : false;
|
38
|
+
var isPublic = (_b = template === null || template === void 0 ? void 0 : template.is_public) !== null && _b !== void 0 ? _b : false;
|
39
|
+
var permissionsRequired = [];
|
40
|
+
switch (action) {
|
41
|
+
case 'create_personal':
|
42
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PERSONAL);
|
43
|
+
break;
|
44
|
+
case 'create_org':
|
45
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_ORG);
|
46
|
+
break;
|
47
|
+
case 'create_public':
|
48
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PUBLIC);
|
49
|
+
break;
|
50
|
+
case 'read':
|
51
|
+
if (!isCreator) {
|
52
|
+
if ((!isPersonal && isSameOrg) || !isPublic) {
|
53
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_MEMBER_READ);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
break;
|
57
|
+
case 'write':
|
58
|
+
if (!isCreator) {
|
59
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_MEMBER_READ);
|
60
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_MEMBER_WRITE);
|
61
|
+
}
|
62
|
+
break;
|
63
|
+
case 'change_visibility_personal':
|
64
|
+
if (isCreator) {
|
65
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PERSONAL);
|
66
|
+
}
|
67
|
+
else {
|
68
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY);
|
69
|
+
}
|
70
|
+
break;
|
71
|
+
case 'change_visibility_org':
|
72
|
+
if (isCreator) {
|
73
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_ORG);
|
74
|
+
}
|
75
|
+
else {
|
76
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY);
|
77
|
+
}
|
78
|
+
break;
|
79
|
+
case 'change_visibility_public':
|
80
|
+
if (isCreator) {
|
81
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PUBLIC);
|
82
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_CREATOR_VISIBILITY);
|
83
|
+
}
|
84
|
+
else {
|
85
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY);
|
86
|
+
}
|
87
|
+
break;
|
88
|
+
case 'delete':
|
89
|
+
if (isCreator) {
|
90
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_CREATOR_DELETE);
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
permissionsRequired.push(TemplatePermissions.TEMPLATE_MEMBER_DELETE);
|
94
|
+
}
|
95
|
+
break;
|
96
|
+
default:
|
97
|
+
return { canPerform: false, message: 'Action is not defined' };
|
98
|
+
}
|
99
|
+
if (hasRequiredPermissions(session, permissionsRequired)) {
|
100
|
+
return { canPerform: true, message: '' };
|
101
|
+
}
|
102
|
+
return { canPerform: false, message: "Insufficient access to perform '".concat(action, "'. Needed permissions: ").concat(permissionsRequired.toString()) };
|
103
|
+
};
|
104
|
+
var hasRequiredPermissions = function (session, permissions) {
|
105
|
+
return permissions.every(function (perm) { return ((session === null || session === void 0 ? void 0 : session.permissions) || []).includes(perm); });
|
106
|
+
};
|
23
107
|
|
24
108
|
/**
|
25
109
|
* A Template defines how a Verdocs signing flow will be performed, including attachments, signing fields, and
|
@@ -4226,4 +4310,4 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
4226
4310
|
return VerdocsEndpoint;
|
4227
4311
|
}());
|
4228
4312
|
|
4229
|
-
export { TemplateSenderTypes as T, VerdocsEndpoint as V, TemplateActions as a,
|
4313
|
+
export { TemplateSenderTypes as T, VerdocsEndpoint as V, TemplateActions as a, createTemplate as b, canPerformTemplateAction as c, deleteTemplate as d, getTemplates as e, getTemplate as g, listTemplates as l, updateTemplate as u };
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
-
import { g as getTemplateStore } from './TemplateStore-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
4
|
+
import { g as getTemplateStore } from './TemplateStore-018fc1db.js';
|
5
5
|
import './index-4439b0d1.js';
|
6
6
|
|
7
7
|
const ipcTestCss = "ipc-test{max-width:800px;display:block}";
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import { g as getSummary } from './Envelopes-21ffb899.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
5
5
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-172625c5.js';
|
2
2
|
import { d as decodeAccessTokenBody } from './Types-5f31149e.js';
|
3
3
|
import { c as createBusinessAccount, i as isOrgAvailable } from './Profiles-4cc942ef.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
5
5
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
-
import { g as getTemplateStore } from './TemplateStore-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
4
|
+
import { g as getTemplateStore } from './TemplateStore-018fc1db.js';
|
5
5
|
import { S as SDKError } from './errors-9b5498c8.js';
|
6
6
|
import './index-4439b0d1.js';
|
7
7
|
|
@@ -2,9 +2,9 @@ import { r as registerInstance, h, H as Host, c as createEvent, a as getElement
|
|
2
2
|
import { c as createPopper } from './popper-15e448b4.js';
|
3
3
|
import { a as commonjsGlobal } from './_commonjsHelpers-5ec8f9b7.js';
|
4
4
|
import './Types-5f31149e.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
6
6
|
import { u as updateField, d as deleteField } from './Fields-c82e6df3.js';
|
7
|
-
import { g as getTemplateStore } from './TemplateStore-
|
7
|
+
import { g as getTemplateStore } from './TemplateStore-018fc1db.js';
|
8
8
|
import { S as SDKError } from './errors-9b5498c8.js';
|
9
9
|
import './index-4439b0d1.js';
|
10
10
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
import { d as convertToE164 } from './utils-d269cea3.js';
|
5
5
|
import './_commonjsHelpers-5ec8f9b7.js';
|
6
6
|
import './Envelopes-21ffb899.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import { m as getEnvelopeDocumentPageDisplayUri } from './Envelopes-21ffb899.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
5
5
|
import { t as throttle } from './utils-d269cea3.js';
|
6
6
|
import './_commonjsHelpers-5ec8f9b7.js';
|
7
7
|
import './Files-70a192df.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
3
|
import { g as getInPersonLink } from './Recipients-4ec2138c.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
5
5
|
import { g as getEnvelopeStore } from './EnvelopeStore-15cc99ef.js';
|
6
6
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
7
7
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -3,7 +3,7 @@ import { c as cancelEnvelope } from './Envelopes-21ffb899.js';
|
|
3
3
|
import { u as userIsEnvelopeOwner } from './Permissions-f2eb0421.js';
|
4
4
|
import { r as resendInvitation } from './Recipients-4ec2138c.js';
|
5
5
|
import './Types-5f31149e.js';
|
6
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
6
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
7
7
|
import { g as getEnvelopeStore } from './EnvelopeStore-15cc99ef.js';
|
8
8
|
import { F as FORMAT_TIMESTAMP } from './Types-de18e225.js';
|
9
9
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host } from './index-1
|
|
2
2
|
import { l as listEnvelopes, c as cancelEnvelope } from './Envelopes-21ffb899.js';
|
3
3
|
import { g as getRecipientsWithActions, a as userCanAct, b as userCanCancelEnvelope } from './Permissions-f2eb0421.js';
|
4
4
|
import './Types-5f31149e.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { s as saveEnvelopesAsZip } from './utils-d269cea3.js';
|
8
8
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import { i as interact } from './interact.min-cf83fa88.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
5
5
|
import { u as updateField } from './Fields-c82e6df3.js';
|
6
6
|
import { g as getRGBA } from './Colors-1b298092.js';
|
7
7
|
import { g as getFieldSettings } from './utils-d269cea3.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import { i as interact } from './interact.min-cf83fa88.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
5
5
|
import { u as updateField } from './Fields-c82e6df3.js';
|
6
6
|
import { g as getRGBA } from './Colors-1b298092.js';
|
7
7
|
import { g as getFieldSettings } from './utils-d269cea3.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
import { u as unicodeNBSP } from './Icons-c29eb0fa.js';
|
5
5
|
|
6
6
|
const verdocsFileChooserCss = "verdocs-file-chooser{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-file-chooser .upload-box{text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 15px;color:rgba(0, 0, 0, 0.54)}verdocs-file-chooser .upload-box svg{width:64px;height:64px;fill:#5c6575}verdocs-file-chooser .selected-filename{font-size:20px;font-weight:bold;overflow-wrap:anywhere}verdocs-file-chooser .or-prefer{height:20px;margin:20px 0;font-size:16px}";
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint,
|
3
|
+
import { V as VerdocsEndpoint, b as createTemplate, u as updateTemplate } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
import { r as renderDocumentField, b as getRoleIndex } from './utils-d269cea3.js';
|
5
|
-
import { g as getTemplateStore, a as getRoleNames } from './TemplateStore-
|
5
|
+
import { g as getTemplateStore, a as getRoleNames } from './TemplateStore-018fc1db.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
7
7
|
import { j as createEnvelope } from './Envelopes-21ffb899.js';
|
8
8
|
import { a as isValidEmail, i as isValidPhone } from './Validators-16a2a43b.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint,
|
3
|
+
import { V as VerdocsEndpoint, e as getTemplates } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
|
5
5
|
/**
|
6
6
|
* Verdocs provides a range of search functions to help find and retrieve content. This module provides generic functions intended
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
|
5
5
|
const verdocsSearchCss = "verdocs-search{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:-ms-flexbox;display:flex;background-color:#1e2031}verdocs-search search-box{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:20px 10px}verdocs-search .boxes{-ms-flex-wrap:wrap;flex-wrap:wrap;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin:20px 0}verdocs-search search-recent,verdocs-search search-saved,verdocs-search search-quick-functions,verdocs-search search-starred{display:-ms-flexbox;display:flex;margin:0 20px 20px 0}";
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
import { a as formatFullName, c as capitalize, b as formatInitials } from './Primitives-8fe93caf.js';
|
5
5
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
import { S as SDKError } from './errors-9b5498c8.js';
|
5
5
|
|
6
6
|
const verdocsSettingsCss = "verdocs-settings{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-settings .tabs{gap:4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;border-bottom:1px solid #654dcb}verdocs-settings .tabs .tab{cursor:pointer;padding:5px 10px;color:#ffffff;background-color:#777777}verdocs-settings .tabs .tab.active{color:#ffffff;background-color:#654dcb}";
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment }
|
|
2
2
|
import { e as getSigningSession, t as throttledGetEnvelope, u as updateEnvelopeField, f as updateEnvelopeFieldSignature, h as updateEnvelopeFieldInitials, i as uploadEnvelopeFieldAttachment } from './Envelopes-21ffb899.js';
|
3
3
|
import { R as RecipientStates } from './Types-5f31149e.js';
|
4
4
|
import { e as envelopeRecipientAgree, a as envelopeRecipientDecline, b as envelopeRecipientSubmit } from './Recipients-4ec2138c.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
6
6
|
import { i as isValidPhone, a as isValidEmail } from './Validators-16a2a43b.js';
|
7
7
|
import { f as fullNameToInitials, i as integerSequence } from './Primitives-8fe93caf.js';
|
8
8
|
import { a as saveAttachment, u as updateDocumentFieldValue, b as getRoleIndex, r as renderDocumentField, c as getFieldId } from './utils-d269cea3.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
import { g as getTemplateDocumentPageDisplayUri } from './TemplateDocuments-6fd2f4e2.js';
|
5
5
|
import { t as throttle } from './utils-d269cea3.js';
|
6
6
|
import { c as createPopper } from './popper-15e448b4.js';
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment, a as getElement } from './index-172625c5.js';
|
2
2
|
import { i as interact } from './interact.min-cf83fa88.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint, T as TemplateSenderTypes, u as updateTemplate } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint, T as TemplateSenderTypes, u as updateTemplate } from './VerdocsEndpoint-b011af25.js';
|
5
5
|
import { u as updateField, c as createField } from './Fields-c82e6df3.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { b as getRoleIndex, r as renderDocumentField, f as updateCssTransform, h as defaultWidth, i as defaultHeight } from './utils-d269cea3.js';
|
8
|
-
import { g as getTemplateStore, a as getRoleNames } from './TemplateStore-
|
8
|
+
import { g as getTemplateStore, a as getRoleNames } from './TemplateStore-018fc1db.js';
|
9
9
|
import { S as SDKError } from './errors-9b5498c8.js';
|
10
10
|
import { g as getRGBA } from './Colors-1b298092.js';
|
11
11
|
import './_commonjsHelpers-5ec8f9b7.js';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
2
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
4
|
|
5
5
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint, l as listTemplates, d as deleteTemplate, a as TemplateActions } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint, l as listTemplates, d as deleteTemplate, c as canPerformTemplateAction, a as TemplateActions } from './VerdocsEndpoint-b011af25.js';
|
4
4
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
5
5
|
import { S as SDKError } from './errors-9b5498c8.js';
|
6
6
|
import { f as format } from './index-914ed6f7.js';
|
@@ -188,8 +188,11 @@ const VerdocsTemplatesList = class {
|
|
188
188
|
// serverless/src/functions/getTemplates.ts: canPerformTemplateAction(request.session, 'change_visibility_personal', record) && record.allowed_operations.push('change_visibility_personal');
|
189
189
|
// serverless/src/functions/getTemplates.ts: canPerformTemplateAction(request.session, 'change_visibility_org', record) && record.allowed_operations.push('change_visibility_org');
|
190
190
|
// serverless/src/functions/getTemplates.ts: canPerformTemplateAction(request.session, 'change_visibility_public', record) && record.allowed_operations.push('change_visibility_public');
|
191
|
-
if (
|
192
|
-
MENU_OPTIONS.push({ label: 'Preview / Send', id: 'send', disabled: !
|
191
|
+
if (this.allowedActions.includes('send')) {
|
192
|
+
MENU_OPTIONS.push({ label: 'Preview / Send', id: 'send', disabled: !canPerformTemplateAction(this.endpoint.session, 'read', template) });
|
193
|
+
}
|
194
|
+
if (canPerformTemplateAction(this.endpoint.session, 'read', template)) {
|
195
|
+
MENU_OPTIONS.push({ label: 'Preview / Send', id: 'send', disabled: !canPerformTemplateAction(this.endpoint.session, 'read', template) });
|
193
196
|
}
|
194
197
|
// if (this.allowedActions.includes('createlink')) {
|
195
198
|
// MENU_OPTIONS.push({label: 'Create Link', id: 'createlink', disabled: true});
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment, a
|
|
2
2
|
import { t as throttledGetEnvelope, k as getDocumentDownloadLink, c as cancelEnvelope } from './Envelopes-21ffb899.js';
|
3
3
|
import { b as userCanCancelEnvelope } from './Permissions-f2eb0421.js';
|
4
4
|
import './Types-5f31149e.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-b011af25.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { s as saveEnvelopesAsZip } from './utils-d269cea3.js';
|
8
8
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{l(a.next(e))}catch(e){o(e)}}function i(e){try{l(a["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):n(e.value).then(s,i)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,n,o,s;return s={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function i(e){return function(t){return l([e,t])}}function l(s){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{c as createStore}from"./index-4439b0d1.js";import{g as getTemplate,T as TemplateSenderTypes}from"./VerdocsEndpoint-
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{l(a.next(e))}catch(e){o(e)}}function i(e){try{l(a["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):n(e.value).then(s,i)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,n,o,s;return s={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function i(e){return function(t){return l([e,t])}}function l(s){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{c as createStore}from"./index-4439b0d1.js";import{g as getTemplate,T as TemplateSenderTypes}from"./VerdocsEndpoint-b011af25.js";var createTemplateStore=function(e){var t=(new Date).toISOString();return createStore({isLoading:true,isLoaded:false,isError:false,error:null,updateCount:0,roleNames:[],id:e,name:"",description:"",sender:TemplateSenderTypes.CREATOR,profile_id:"",organization_id:"",counter:0,star_counter:0,is_sendable:false,is_personal:true,is_public:false,created_at:t,updated_at:t,last_used_at:t,token:"",reminder_id:"",reminder:undefined,processed:false,organization:undefined,roles:[],pages:[],template_document:undefined,template_documents:[]})};var templateStores={};var getTemplateStore=function(e,t,r){if(r===void 0){r=false}return __awaiter(void 0,void 0,void 0,(function(){var a,n,o,s;return __generator(this,(function(i){switch(i.label){case 0:a=false;if(!templateStores[t]){console.debug("[TEMPLATES] No template store found for ID, creating",t);templateStores[t]=createTemplateStore(t);a=true}n=templateStores[t];n.use({reset:function(){return console.debug("[TEMPLATES] Store got reset")},dispose:function(){return console.debug("[TEMPLATES] Store got disposed")}});if(!(a||r))return[3,5];console.debug("[TEMPLATES] Reloading template",{templateId:t,created:a,forceReload:r});n.state.isLoading=true;n.state.isLoaded=false;n.state.isError=false;n.state.error=undefined;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,getTemplate(e,t)];case 2:o=i.sent();console.debug("[TEMPLATES] Got template",o);Object.assign(n.state,o);n.state.isLoaded=true;n.state.isError=false;n.state.error=undefined;return[3,4];case 3:s=i.sent();console.error("[TEMPLATES] Error loading template",s);n.state.isLoaded=false;n.state.isError=true;n.state.error=s;throw s;case 4:n.state.isLoading=false;n.state.updateCount++;i.label=5;case 5:return[2,n]}}))}))};var getRoleNames=function(e){var t;return(((t=e===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.roles)||[]).map((function(e){return e.name}))};export{getRoleNames as a,getTemplateStore as g};
|
@@ -0,0 +1 @@
|
|
1
|
+
var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return u([e,t])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};import{d as decodeAccessTokenBody}from"./Types-5f31149e.js";var TemplateSenderTypes$1;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(TemplateSenderTypes$1||(TemplateSenderTypes$1={}));var TemplatePermissions;(function(e){e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(TemplatePermissions||(TemplatePermissions={}));var canPerformTemplateAction=function(e,t,r){var n,i;if(!r&&!t.includes("create")){return{canPerform:false,message:"Missing required template object"}}var o=(e===null||e===void 0?void 0:e.profile_id)||"BOGUS";var s=(e===null||e===void 0?void 0:e.organization_id)||"BOGUS";if(!o){return{canPerform:false,message:"Active session required"}}var a=(r===null||r===void 0?void 0:r.profile_id)===o;var u=(r===null||r===void 0?void 0:r.organization_id)===s;var l=(n=r===null||r===void 0?void 0:r.is_personal)!==null&&n!==void 0?n:false;var c=(i=r===null||r===void 0?void 0:r.is_public)!==null&&i!==void 0?i:false;var f=[];switch(t){case"create_personal":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PERSONAL);break;case"create_org":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_ORG);break;case"create_public":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PUBLIC);break;case"read":if(!a){if(!l&&u||!c){f.push(TemplatePermissions.TEMPLATE_MEMBER_READ)}}break;case"write":if(!a){f.push(TemplatePermissions.TEMPLATE_MEMBER_READ);f.push(TemplatePermissions.TEMPLATE_MEMBER_WRITE)}break;case"change_visibility_personal":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PERSONAL)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_org":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_ORG)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_public":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PUBLIC);f.push(TemplatePermissions.TEMPLATE_CREATOR_VISIBILITY)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"delete":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_DELETE)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_DELETE)}break;default:return{canPerform:false,message:"Action is not defined"}}if(hasRequiredPermissions(e,f)){return{canPerform:true,message:""}}return{canPerform:false,message:"Insufficient access to perform '".concat(t,"'. Needed permissions: ").concat(f.toString())}};var hasRequiredPermissions=function(e,t){return t.every((function(t){return((e===null||e===void 0?void 0:e.permissions)||[]).includes(t)}))};var __awaiter=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n["throw"](e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(s,a)}u((n=n.apply(e,t||[])).next())}))};var __generator=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(r=0)),r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var getTemplates=function(e,t){return e.api.post("/templates",{params:t}).then((function(e){return e.data}))};var getTemplate=function(e,t){return e.api.get("/templates/".concat(t)).then((function(e){return e.data}))};var ALLOWED_CREATE_FIELDS=["name","is_personal","is_public","sender","description","roles","fields"];var createTemplate=function(e,t,r){var n={timeout:12e4,onUploadProgress:function(e){var t=e.total||1;var n=e.loaded||0;r===null||r===void 0?void 0:r(Math.floor(n*100/(t||1)),n,t||1)}};if(t.documents&&t.documents[0]instanceof File){if(t.documents.length>10){throw new Error("createTemplate() has a maximum of 10 documents that can be attached.")}var i=new FormData;ALLOWED_CREATE_FIELDS.forEach((function(e){if(t[e]!==undefined){i.append(e,t[e])}}));t.documents.forEach((function(e){i.append("documents",e,e.name)}));return e.api.post("/templates",i,n).then((function(e){return e.data}))}else{return e.api.post("/templates",t,n).then((function(e){return e.data}))}};var updateTemplate=function(e,t,r){return e.api.put("/templates/".concat(t),r).then((function(e){return e.data}))};var deleteTemplate=function(e,t){return e.api.delete("/templates/".concat(t)).then((function(e){return e.data}))};var SortOptions$1;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(SortOptions$1||(SortOptions$1={}));var listTemplates=function(e,t){if(t===void 0){t={}}return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,e.api.post("/templates/list",t).then((function(e){return e.data}))]}))}))};var TemplateSenderTypes;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(TemplateSenderTypes||(TemplateSenderTypes={}));var TemplateActions;(function(e){e["CREATE_PERSONAL"]="create_personal";e["CREATE_ORG"]="create_org";e["CREATE_PUBLIC"]="create_public";e["READ"]="read";e["WRITE"]="write";e["DELETE"]="delete";e["CHANGE_VISIBILITY_PERSONAL"]="change_visibility_personal";e["CHANGE_VISIBILITY_ORG"]="change_visibility_org";e["CHANGE_VISIBILITY_PUBLIC"]="change_visibility_public"})(TemplateActions||(TemplateActions={}));var SortOptions;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(SortOptions||(SortOptions={}));var Permissions;(function(e){e["RCOMMON"]="rcommon:access";e["RFORM_ACCESS"]="rform:access";e["ORG_CREATE"]="org:create";e["ORG_VIEW"]="org:view";e["ORG_UPDATE"]="org:update";e["ORG_DELETE"]="org:delete";e["ORG_TRANSFER"]="org:transfer";e["ORG_LIST"]="org:list";e["OWNER_ADD"]="owner:add";e["OWNER_REMOVE"]="owner:remove";e["ADMIN_ADD"]="admin:add";e["ADMIN_REMOVE"]="admin:remove";e["MEMBER_VIEW"]="member:view";e["MEMBER_ADD"]="member:add";e["MEMBER_REMOVE"]="member:remove";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(Permissions||(Permissions={}));var Plans;(function(e){e["ENV_ESSENTIAL"]="env:essential";e["ORG_STANDARD"]="org:standard"})(Plans||(Plans={}));var Roles;(function(e){e["OWNER"]="owner";e["BASIC_USER"]="basic_user";e["MEMBER"]="member"})(Roles||(Roles={}));var denyList=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var isRetryAllowed=function(e){return!denyList.has(e&&e.code)};function asyncGeneratorStep(e,t,r,n,i,o,s){try{var a=e[o](s);var u=a.value}catch(e){r(e);return}if(a.done){t(u)}else{Promise.resolve(u).then(n,i)}}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){asyncGeneratorStep(o,n,i,s,a,"next",e)}function a(e){asyncGeneratorStep(o,n,i,s,a,"throw",e)}s(undefined)}))}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))}r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};if(t%2){ownKeys(Object(r),true).forEach((function(t){_defineProperty(e,t,r[t])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}}return e}function _defineProperty(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}var namespace="axios-retry";function isNetworkError(e){return!e.response&&Boolean(e.code)&&e.code!=="ECONNABORTED"&&isRetryAllowed(e)}var SAFE_HTTP_METHODS=["get","head","options"];var IDEMPOTENT_HTTP_METHODS=SAFE_HTTP_METHODS.concat(["put","delete"]);function isRetryableError(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function isSafeRequestError(e){if(!e.config){return false}return isRetryableError(e)&&SAFE_HTTP_METHODS.indexOf(e.config.method)!==-1}function isIdempotentRequestError(e){if(!e.config){return false}return isRetryableError(e)&&IDEMPOTENT_HTTP_METHODS.indexOf(e.config.method)!==-1}function isNetworkOrIdempotentRequestError(e){return isNetworkError(e)||isIdempotentRequestError(e)}function noDelay(){return 0}function exponentialDelay(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=Math.pow(2,e)*100;var r=t*.2*Math.random();return t+r}function getCurrentState(e){var t=e[namespace]||{};t.retryCount=t.retryCount||0;e[namespace]=t;return t}function getRequestOptions(e,t){return _objectSpread(_objectSpread({},t),e[namespace])}function fixConfig(e,t){if(e.defaults.agent===t.agent){delete t.agent}if(e.defaults.httpAgent===t.httpAgent){delete t.httpAgent}if(e.defaults.httpsAgent===t.httpsAgent){delete t.httpsAgent}}function shouldRetry(e,t,r,n){return _shouldRetry.apply(this,arguments)}function _shouldRetry(){_shouldRetry=_asyncToGenerator((function(e,t,r,n){var i,o,s;return __generator(this,(function(a){switch(a.label){case 0:i=r.retryCount<e&&t(n);if(!(typeof i==="object"))return[3,4];a.label=1;case 1:a.trys.push([1,3,,4]);return[4,i];case 2:o=a.sent();return[2,o!==false];case 3:s=a.sent();return[2,false];case 4:return[2,i]}}))}));return _shouldRetry.apply(this,arguments)}function axiosRetry(e,t){e.interceptors.request.use((function(e){var t=getCurrentState(e);t.lastRequestTime=Date.now();return e}));e.interceptors.response.use(null,function(){var r=_asyncToGenerator((function(r){var n,i,o,s,a,u,l,c,f,d,p,h,E,m,v,T;return __generator(this,(function(y){switch(y.label){case 0:n=r.config;if(!n){return[2,Promise.reject(r)]}i=getRequestOptions(n,t),o=i.retries,s=o===void 0?3:o,a=i.retryCondition,u=a===void 0?isNetworkOrIdempotentRequestError:a,l=i.retryDelay,c=l===void 0?noDelay:l,f=i.shouldResetTimeout,d=f===void 0?false:f,p=i.onRetry,h=p===void 0?function(){}:p;E=getCurrentState(n);return[4,shouldRetry(s,u,E,r)];case 1:if(y.sent()){E.retryCount+=1;m=c(E.retryCount,r);fixConfig(e,n);if(!d&&n.timeout&&E.lastRequestTime){v=Date.now()-E.lastRequestTime;T=n.timeout-v-m;if(T<=0){return[2,Promise.reject(r)]}n.timeout=T}n.transformRequest=[function(e){return e}];h(E.retryCount,r,n);return[2,new Promise((function(t){return setTimeout((function(){return t(e(n))}),m)}))]}return[2,Promise.reject(r)]}}))}));return function(e){return r.apply(this,arguments)}}())}axiosRetry.isNetworkError=isNetworkError;axiosRetry.isSafeRequestError=isSafeRequestError;axiosRetry.isIdempotentRequestError=isIdempotentRequestError;axiosRetry.isNetworkOrIdempotentRequestError=isNetworkOrIdempotentRequestError;axiosRetry.exponentialDelay=exponentialDelay;axiosRetry.isRetryableError=isRetryableError;function bind(e,t){return function r(){return e.apply(t,arguments)}}var toString=Object.prototype.toString;var getPrototypeOf=Object.getPrototypeOf;var kindOf=function(e){return function(t){var r=toString.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));var kindOfTest=function(e){e=e.toLowerCase();return function(t){return kindOf(t)===e}};var typeOfTest=function(e){return function(t){return typeof t===e}};var isArray=Array.isArray;var isUndefined=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){var t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&isArrayBuffer(e.buffer)}return t}var isString=typeOfTest("string");var isFunction=typeOfTest("function");var isNumber=typeOfTest("number");var isObject=function(e){return e!==null&&typeof e==="object"};var isBoolean=function(e){return e===true||e===false};var isPlainObject=function(e){if(kindOf(e)!=="object"){return false}var t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var isDate=kindOfTest("Date");var isFile=kindOfTest("File");var isBlob=kindOfTest("Blob");var isFileList=kindOfTest("FileList");var isStream=function(e){return isObject(e)&&isFunction(e.pipe)};var isFormData=function(e){var t;return e&&(typeof FormData==="function"&&e instanceof FormData||isFunction(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction(e.toString)&&e.toString()==="[object FormData]"))};var isURLSearchParams=kindOfTest("URLSearchParams");var trim=function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function forEach(e,t,r){var n=r===void 0?{}:r,i=n.allOwnKeys,o=i===void 0?false:i;if(e===null||typeof e==="undefined"){return}var s;var a;if(typeof e!=="object"){e=[e]}if(isArray(e)){for(s=0,a=e.length;s<a;s++){t.call(null,e[s],s,e)}}else{var u=o?Object.getOwnPropertyNames(e):Object.keys(e);var l=u.length;var c=void 0;for(s=0;s<l;s++){c=u[s];t.call(null,e[c],c,e)}}}function findKey(e,t){t=t.toLowerCase();var r=Object.keys(e);var n=r.length;var i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}var _global=function(){if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global}();var isContextDefined=function(e){return!isUndefined(e)&&e!==_global};function merge(){var e=(isContextDefined(this)&&this||{}).caseless;var t={};var r=function(r,n){var i=e&&findKey(t,n)||n;if(isPlainObject(t[i])&&isPlainObject(r)){t[i]=merge(t[i],r)}else if(isPlainObject(r)){t[i]=merge({},r)}else if(isArray(r)){t[i]=r.slice()}else{t[i]=r}};for(var n=0,i=arguments.length;n<i;n++){arguments[n]&&forEach(arguments[n],r)}return t}var extend=function(e,t,r,n){var i=n===void 0?{}:n,o=i.allOwnKeys;forEach(t,(function(t,n){if(r&&isFunction(t)){e[n]=bind(t,r)}else{e[n]=t}}),{allOwnKeys:o});return e};var stripBOM=function(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};var inherits=function(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)};var toFlatObject=function(e,t,r,n){var i;var o;var s;var a={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);o=i.length;while(o-- >0){s=i[o];if((!n||n(s,e,t))&&!a[s]){t[s]=e[s];a[s]=true}}e=r!==false&&getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t};var endsWith=function(e,t,r){e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r};var toArray=function(e){if(!e)return null;if(isArray(e))return e;var t=e.length;if(!isNumber(t))return null;var r=new Array(t);while(t-- >0){r[t]=e[t]}return r};var isTypedArray=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!=="undefined"&&getPrototypeOf(Uint8Array));var forEachEntry=function(e,t){var r=e&&e[Symbol.iterator];var n=r.call(e);var i;while((i=n.next())&&!i.done){var o=i.value;t.call(e,o[0],o[1])}};var matchAll=function(e,t){var r;var n=[];while((r=e.exec(t))!==null){n.push(r)}return n};var isHTMLForm=kindOfTest("HTMLFormElement");var toCamelCase=function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function e(t,r,n){return r.toUpperCase()+n}))};var hasOwnProperty=function(e){var t=e.hasOwnProperty;return function(e,r){return t.call(e,r)}}(Object.prototype);var isRegExp=kindOfTest("RegExp");var reduceDescriptors=function(e,t){var r=Object.getOwnPropertyDescriptors(e);var n={};forEach(r,(function(r,i){var o;if((o=t(r,i,e))!==false){n[i]=o||r}}));Object.defineProperties(e,n)};var freezeMethods=function(e){reduceDescriptors(e,(function(t,r){if(isFunction(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}var n=e[r];if(!isFunction(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}}}))};var toObjectSet=function(e,t){var r={};var n=function(e){e.forEach((function(e){r[e]=true}))};isArray(e)?n(e):n(String(e).split(t));return r};var noop=function(){};var toFiniteNumber=function(e,t){e=+e;return Number.isFinite(e)?e:t};var ALPHA="abcdefghijklmnopqrstuvwxyz";var DIGIT="0123456789";var ALPHABET={DIGIT:DIGIT,ALPHA:ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT};var generateString=function(e,t){if(e===void 0){e=16}if(t===void 0){t=ALPHABET.ALPHA_DIGIT}var r="";var n=t.length;while(e--){r+=t[Math.random()*n|0]}return r};function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var toJSONObject=function(e){var t=new Array(10);var r=function(e,n){if(isObject(e)){if(t.indexOf(e)>=0){return}if(!("toJSON"in e)){t[n]=e;var i=isArray(e)?[]:{};forEach(e,(function(e,t){var o=r(e,n+1);!isUndefined(o)&&(i[t]=o)}));t[n]=undefined;return i}}return e};return r(e,0)};var isAsyncFn=kindOfTest("AsyncFunction");var isThenable=function(e){return e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch)};var utils={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isBoolean:isBoolean,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isRegExp:isRegExp,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isTypedArray:isTypedArray,isFileList:isFileList,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,forEachEntry:forEachEntry,matchAll:matchAll,isHTMLForm:isHTMLForm,hasOwnProperty:hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors:reduceDescriptors,freezeMethods:freezeMethods,toObjectSet:toObjectSet,toCamelCase:toCamelCase,noop:noop,toFiniteNumber:toFiniteNumber,findKey:findKey,global:_global,isContextDefined:isContextDefined,ALPHABET:ALPHABET,generateString:generateString,isSpecCompliantForm:isSpecCompliantForm,toJSONObject:toJSONObject,isAsyncFn:isAsyncFn,isThenable:isThenable};function AxiosError(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}utils.inherits(AxiosError,Error,{toJSON:function e(){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:utils.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype$1=AxiosError.prototype;var descriptors={};["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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){descriptors[e]={value:e}}));Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:true});AxiosError.from=function(e,t,r,n,i,o){var s=Object.create(prototype$1);utils.toFlatObject(e,s,(function e(t){return t!==Error.prototype}),(function(e){return e!=="isAxiosError"}));AxiosError.call(s,e.message,t,r,n,i);s.cause=e;s.name=e.name;o&&Object.assign(s,o);return s};var httpAdapter=null;function isVisitable(e){return utils.isPlainObject(e)||utils.isArray(e)}function removeBrackets(e){return utils.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,r){if(!e)return t;return e.concat(t).map((function e(t,n){t=removeBrackets(t);return!r&&n?"["+t+"]":t})).join(r?".":"")}function isFlatArray(e){return utils.isArray(e)&&!e.some(isVisitable)}var predicates=utils.toFlatObject(utils,{},null,(function e(t){return/^is[A-Z]/.test(t)}));function toFormData(e,t,r){if(!utils.isObject(e)){throw new TypeError("target must be an object")}t=t||new FormData;r=utils.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,(function e(t,r){return!utils.isUndefined(r[t])}));var n=r.metaTokens;var i=r.visitor||c;var o=r.dots;var s=r.indexes;var a=r.Blob||typeof Blob!=="undefined"&&Blob;var u=a&&utils.isSpecCompliantForm(t);if(!utils.isFunction(i)){throw new TypeError("visitor must be a function")}function l(e){if(e===null)return"";if(utils.isDate(e)){return e.toISOString()}if(!u&&utils.isBlob(e)){throw new AxiosError("Blob is not supported. Use a Buffer instead.")}if(utils.isArrayBuffer(e)||utils.isTypedArray(e)){return u&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function c(e,r,i){var a=e;if(e&&!i&&typeof e==="object"){if(utils.endsWith(r,"{}")){r=n?r:r.slice(0,-2);e=JSON.stringify(e)}else if(utils.isArray(e)&&isFlatArray(e)||(utils.isFileList(e)||utils.endsWith(r,"[]"))&&(a=utils.toArray(e))){r=removeBrackets(r);a.forEach((function e(n,i){!(utils.isUndefined(n)||n===null)&&t.append(s===true?renderKey([r],i,o):s===null?r:r+"[]",l(n))}));return false}}if(isVisitable(e)){return true}t.append(renderKey(i,r,o),l(e));return false}var f=[];var d=Object.assign(predicates,{defaultVisitor:c,convertValue:l,isVisitable:isVisitable});function p(e,r){if(utils.isUndefined(e))return;if(f.indexOf(e)!==-1){throw Error("Circular reference detected in "+r.join("."))}f.push(e);utils.forEach(e,(function e(n,o){var s=!(utils.isUndefined(n)||n===null)&&i.call(t,n,utils.isString(o)?o.trim():o,r,d);if(s===true){p(n,r?r.concat(o):[o])}}));f.pop()}if(!utils.isObject(e)){throw new TypeError("data must be an object")}p(e);return t}function encode$1(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function e(r){return t[r]}))}function AxiosURLSearchParams(e,t){this._pairs=[];e&&toFormData(e,this,t)}var prototype=AxiosURLSearchParams.prototype;prototype.append=function e(t,r){this._pairs.push([t,r])};prototype.toString=function e(t){var r=t?function(e){return t.call(this,e,encode$1)}:encode$1;return this._pairs.map((function e(t){return r(t[0])+"="+r(t[1])}),"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,r){if(!t){return e}var n=r&&r.encode||encode;var i=r&&r.serialize;var o;if(i){o=i(t,r)}else{o=utils.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,r).toString(n)}if(o){var s=e.indexOf("#");if(s!==-1){e=e.slice(0,s)}e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var InterceptorManager=function(){function e(){this.handlers=[]}e.prototype.use=function(e,t,r){this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null});return this.handlers.length-1};e.prototype.eject=function(e){if(this.handlers[e]){this.handlers[e]=null}};e.prototype.clear=function(){if(this.handlers){this.handlers=[]}};e.prototype.forEach=function(e){utils.forEach(this.handlers,(function t(r){if(r!==null){e(r)}}))};return e}();var transitionalDefaults={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var URLSearchParams$1=typeof URLSearchParams!=="undefined"?URLSearchParams:AxiosURLSearchParams;var FormData$1=typeof FormData!=="undefined"?FormData:null;var Blob$1=typeof Blob!=="undefined"?Blob:null;var isStandardBrowserEnv=function(){var e;if(typeof navigator!=="undefined"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")){return false}return typeof window!=="undefined"&&typeof document!=="undefined"}();var isStandardBrowserWebWorkerEnv=function(){return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"}();var platform={isBrowser:true,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},isStandardBrowserEnv:isStandardBrowserEnv,isStandardBrowserWebWorkerEnv:isStandardBrowserWebWorkerEnv,protocols:["http","https","file","blob","url","data"]};function toURLEncodedForm(e,t){return toFormData(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return n.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return e[0]==="[]"?"":e[1]||e[0]}))}function arrayToObject(e){var t={};var r=Object.keys(e);var n;var i=r.length;var o;for(n=0;n<i;n++){o=r[n];t[o]=e[o]}return t}function formDataToJSON(e){function t(e,r,n,i){var o=e[i++];var s=Number.isFinite(+o);var a=i>=e.length;o=!o&&utils.isArray(n)?n.length:o;if(a){if(utils.hasOwnProp(n,o)){n[o]=[n[o],r]}else{n[o]=r}return!s}if(!n[o]||!utils.isObject(n[o])){n[o]=[]}var u=t(e,r,n[o],i);if(u&&utils.isArray(n[o])){n[o]=arrayToObject(n[o])}return!s}if(utils.isFormData(e)&&utils.isFunction(e.entries)){var r={};utils.forEachEntry(e,(function(e,n){t(parsePropPath(e),n,r,0)}));return r}return null}function stringifySafely(e,t,r){if(utils.isString(e)){try{(t||JSON.parse)(e);return utils.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var defaults={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function e(t,r){var n=r.getContentType()||"";var i=n.indexOf("application/json")>-1;var o=utils.isObject(t);if(o&&utils.isHTMLForm(t)){t=new FormData(t)}var s=utils.isFormData(t);if(s){if(!i){return t}return i?JSON.stringify(formDataToJSON(t)):t}if(utils.isArrayBuffer(t)||utils.isBuffer(t)||utils.isStream(t)||utils.isFile(t)||utils.isBlob(t)){return t}if(utils.isArrayBufferView(t)){return t.buffer}if(utils.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}var a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1){return toURLEncodedForm(t,this.formSerializer).toString()}if((a=utils.isFileList(t))||n.indexOf("multipart/form-data")>-1){var u=this.env&&this.env.FormData;return toFormData(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}if(o||i){r.setContentType("application/json",false);return stringifySafely(t)}return t}],transformResponse:[function e(t){var r=this.transitional||defaults.transitional;var n=r&&r.forcedJSONParsing;var i=this.responseType==="json";if(t&&utils.isString(t)&&(n&&!this.responseType||i)){var o=r&&r.silentJSONParsing;var s=!o&&i;try{return JSON.parse(t)}catch(e){if(s){if(e.name==="SyntaxError"){throw AxiosError.from(e,AxiosError.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};utils.forEach(["delete","get","head","post","put","patch"],(function(e){defaults.headers[e]={}}));var ignoreDuplicateOf=utils.toObjectSet(["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"]);var parseHeaders=function(e){var t={};var r;var n;var i;e&&e.split("\n").forEach((function e(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&ignoreDuplicateOf[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}}));return t};var $internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){if(e===false||e==null){return e}return utils.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){var t=Object.create(null);var r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;var n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}var isValidHeaderName=function(e){return/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())};function matchHeaderValue(e,t,r,n,i){if(utils.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!utils.isString(t))return;if(utils.isString(n)){return t.indexOf(n)!==-1}if(utils.isRegExp(n)){return n.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}function buildAccessors(e,t){var r=utils.toCamelCase(" "+t);["get","set","has"].forEach((function(n){Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:true})}))}var AxiosHeaders=function(){function e(e){e&&this.set(e)}e.prototype.set=function(e,t,r){var n=this;function i(e,t,r){var i=normalizeHeader(t);if(!i){throw new Error("header name must be a non-empty string")}var o=utils.findKey(n,i);if(!o||n[o]===undefined||r===true||r===undefined&&n[o]!==false){n[o||t]=normalizeValue(e)}}var o=function(e,t){return utils.forEach(e,(function(e,r){return i(e,r,t)}))};if(utils.isPlainObject(e)||e instanceof this.constructor){o(e,t)}else if(utils.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)){o(parseHeaders(e),t)}else{e!=null&&i(t,e,r)}return this};e.prototype.get=function(e,t){e=normalizeHeader(e);if(e){var r=utils.findKey(this,e);if(r){var n=this[r];if(!t){return n}if(t===true){return parseTokens(n)}if(utils.isFunction(t)){return t.call(this,n,r)}if(utils.isRegExp(t)){return t.exec(n)}throw new TypeError("parser must be boolean|regexp|function")}}};e.prototype.has=function(e,t){e=normalizeHeader(e);if(e){var r=utils.findKey(this,e);return!!(r&&this[r]!==undefined&&(!t||matchHeaderValue(this,this[r],r,t)))}return false};e.prototype.delete=function(e,t){var r=this;var n=false;function i(e){e=normalizeHeader(e);if(e){var i=utils.findKey(r,e);if(i&&(!t||matchHeaderValue(r,r[i],i,t))){delete r[i];n=true}}}if(utils.isArray(e)){e.forEach(i)}else{i(e)}return n};e.prototype.clear=function(e){var t=Object.keys(this);var r=t.length;var n=false;while(r--){var i=t[r];if(!e||matchHeaderValue(this,this[i],i,e,true)){delete this[i];n=true}}return n};e.prototype.normalize=function(e){var t=this;var r={};utils.forEach(this,(function(n,i){var o=utils.findKey(r,i);if(o){t[o]=normalizeValue(n);delete t[i];return}var s=e?formatHeader(i):String(i).trim();if(s!==i){delete t[i]}t[s]=normalizeValue(n);r[s]=true}));return this};e.prototype.concat=function(){var e;var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}return(e=this.constructor).concat.apply(e,__spreadArray([this],t,false))};e.prototype.toJSON=function(e){var t=Object.create(null);utils.forEach(this,(function(r,n){r!=null&&r!==false&&(t[n]=e&&utils.isArray(r)?r.join(", "):r)}));return t};e.prototype[Symbol.iterator]=function(){return Object.entries(this.toJSON())[Symbol.iterator]()};e.prototype.toString=function(){return Object.entries(this.toJSON()).map((function(e){var t=e[0],r=e[1];return t+": "+r})).join("\n")};Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"AxiosHeaders"},enumerable:false,configurable:true});e.from=function(e){return e instanceof this?e:new this(e)};e.concat=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}var n=new this(e);t.forEach((function(e){return n.set(e)}));return n};e.accessor=function(e){var t=this[$internals]=this[$internals]={accessors:{}};var r=t.accessors;var n=this.prototype;function i(e){var t=normalizeHeader(e);if(!r[t]){buildAccessors(n,e);r[t]=true}}utils.isArray(e)?e.forEach(i):i(e);return this};return e}();AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils.reduceDescriptors(AxiosHeaders.prototype,(function(e,t){var r=e.value;var n=t[0].toUpperCase()+t.slice(1);return{get:function(){return r},set:function(e){this[n]=e}}}));utils.freezeMethods(AxiosHeaders);function transformData(e,t){var r=this||defaults;var n=t||r;var i=AxiosHeaders.from(n.headers);var o=n.data;utils.forEach(e,(function e(n){o=n.call(r,o,i.normalize(),t?t.status:undefined)}));i.normalize();return o}function isCancel(e){return!!(e&&e.__CANCEL__)}function CanceledError(e,t,r){AxiosError.call(this,e==null?"canceled":e,AxiosError.ERR_CANCELED,t,r);this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:true});function settle(e,t,r){var n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new AxiosError("Request failed with status code "+r.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}var cookies=platform.isStandardBrowserEnv?function e(){return{write:function e(t,r,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(r));if(utils.isNumber(n)){a.push("expires="+new Date(n).toGMTString())}if(utils.isString(i)){a.push("path="+i)}if(utils.isString(o)){a.push("domain="+o)}if(s===true){a.push("secure")}document.cookie=a.join("; ")},read:function e(t){var r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function e(t){this.write(t,"",Date.now()-864e5)}}}():function e(){return{write:function e(){},read:function e(){return null},remove:function e(){}}}();function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t){if(e&&!isAbsoluteURL(t)){return combineURLs(e,t)}return t}var isURLSameOrigin=platform.isStandardBrowserEnv?function e(){var t=/(msie|trident)/i.test(navigator.userAgent);var r=document.createElement("a");var n;function i(e){var n=e;if(t){r.setAttribute("href",n);n=r.href}r.setAttribute("href",n);return{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}}n=i(window.location.href);return function e(t){var r=utils.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function parseProtocol(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;var r=new Array(e);var n=new Array(e);var i=0;var o=0;var s;t=t!==undefined?t:1e3;return function a(u){var l=Date.now();var c=n[o];if(!s){s=l}r[i]=u;n[i]=l;var f=o;var d=0;while(f!==i){d+=r[f++];f=f%e}i=(i+1)%e;if(i===o){o=(o+1)%e}if(l-s<t){return}var p=c&&l-c;return p?Math.round(d*1e3/p):undefined}}function progressEventReducer(e,t){var r=0;var n=speedometer(50,250);return function(i){var o=i.loaded;var s=i.lengthComputable?i.total:undefined;var a=o-r;var u=n(a);var l=o<=s;r=o;var c={loaded:o,total:s,progress:s?o/s:undefined,bytes:a,rate:u?u:undefined,estimated:u&&s&&l?(s-o)/u:undefined,event:i};c[t?"download":"upload"]=true;e(c)}}var isXHRAdapterSupported=typeof XMLHttpRequest!=="undefined";var xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise((function t(r,n){var i=e.data;var o=AxiosHeaders.from(e.headers).normalize();var s=e.responseType;var a;function u(){if(e.cancelToken){e.cancelToken.unsubscribe(a)}if(e.signal){e.signal.removeEventListener("abort",a)}}var l;if(utils.isFormData(i)){if(platform.isStandardBrowserEnv||platform.isStandardBrowserWebWorkerEnv){o.setContentType(false)}else if(!o.getContentType(/^\s*multipart\/form-data/)){o.setContentType("multipart/form-data")}else if(utils.isString(l=o.getContentType())){o.setContentType(l.replace(/^\s*(multipart\/form-data);+/,"$1"))}}var c=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"";var d=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(f+":"+d))}var p=buildFullPath(e.baseURL,e.url);c.open(e.method.toUpperCase(),buildURL(p,e.params,e.paramsSerializer),true);c.timeout=e.timeout;function h(){if(!c){return}var t=AxiosHeaders.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());var i=!s||s==="text"||s==="json"?c.responseText:c.response;var o={data:i,status:c.status,statusText:c.statusText,headers:t,config:e,request:c};settle((function e(t){r(t);u()}),(function e(t){n(t);u()}),o);c=null}if("onloadend"in c){c.onloadend=h}else{c.onreadystatechange=function e(){if(!c||c.readyState!==4){return}if(c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)){return}setTimeout(h)}}c.onabort=function t(){if(!c){return}n(new AxiosError("Request aborted",AxiosError.ECONNABORTED,e,c));c=null};c.onerror=function t(){n(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,c));c=null};c.ontimeout=function t(){var r=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";var i=e.transitional||transitionalDefaults;if(e.timeoutErrorMessage){r=e.timeoutErrorMessage}n(new AxiosError(r,i.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,c));c=null};if(platform.isStandardBrowserEnv){var E=(e.withCredentials||isURLSameOrigin(p))&&e.xsrfCookieName&&cookies.read(e.xsrfCookieName);if(E){o.set(e.xsrfHeaderName,E)}}i===undefined&&o.setContentType(null);if("setRequestHeader"in c){utils.forEach(o.toJSON(),(function e(t,r){c.setRequestHeader(r,t)}))}if(!utils.isUndefined(e.withCredentials)){c.withCredentials=!!e.withCredentials}if(s&&s!=="json"){c.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){c.addEventListener("progress",progressEventReducer(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&c.upload){c.upload.addEventListener("progress",progressEventReducer(e.onUploadProgress))}if(e.cancelToken||e.signal){a=function(t){if(!c){return}n(!t||t.type?new CanceledError(null,e,c):t);c.abort();c=null};e.cancelToken&&e.cancelToken.subscribe(a);if(e.signal){e.signal.aborted?a():e.signal.addEventListener("abort",a)}}var m=parseProtocol(p);if(m&&platform.protocols.indexOf(m)===-1){n(new AxiosError("Unsupported protocol "+m+":",AxiosError.ERR_BAD_REQUEST,e));return}c.send(i||null)}))};var knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils.forEach(knownAdapters,(function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var renderReason=function(e){return"- ".concat(e)};var isResolvedHandle=function(e){return utils.isFunction(e)||e===null||e===false};var adapters={getAdapter:function(e){e=utils.isArray(e)?e:[e];var t=e.length;var r;var n;var i={};for(var o=0;o<t;o++){r=e[o];var s=void 0;n=r;if(!isResolvedHandle(r)){n=knownAdapters[(s=String(r)).toLowerCase()];if(n===undefined){throw new AxiosError("Unknown adapter '".concat(s,"'"))}}if(n){break}i[s||"#"+o]=n}if(!n){var a=Object.entries(i).map((function(e){var t=e[0],r=e[1];return"adapter ".concat(t," ")+(r===false?"is not supported by the environment":"is not available in the build")}));var u=t?a.length>1?"since :\n"+a.map(renderReason).join("\n"):" "+renderReason(a[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return n},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new CanceledError(null,e)}}function dispatchRequest(e){throwIfCancellationRequested(e);e.headers=AxiosHeaders.from(e.headers);e.data=transformData.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}var t=adapters.getAdapter(e.adapter||defaults.adapter);return t(e).then((function t(r){throwIfCancellationRequested(e);r.data=transformData.call(e,e.transformResponse,r);r.headers=AxiosHeaders.from(r.headers);return r}),(function t(r){if(!isCancel(r)){throwIfCancellationRequested(e);if(r&&r.response){r.response.data=transformData.call(e,e.transformResponse,r.response);r.response.headers=AxiosHeaders.from(r.response.headers)}}return Promise.reject(r)}))}var headersToObject=function(e){return e instanceof AxiosHeaders?e.toJSON():e};function mergeConfig(e,t){t=t||{};var r={};function n(e,t,r){if(utils.isPlainObject(e)&&utils.isPlainObject(t)){return utils.merge.call({caseless:r},e,t)}else if(utils.isPlainObject(t)){return utils.merge({},t)}else if(utils.isArray(t)){return t.slice()}return t}function i(e,t,r){if(!utils.isUndefined(t)){return n(e,t,r)}else if(!utils.isUndefined(e)){return n(undefined,e,r)}}function o(e,t){if(!utils.isUndefined(t)){return n(undefined,t)}}function s(e,t){if(!utils.isUndefined(t)){return n(undefined,t)}else if(!utils.isUndefined(e)){return n(undefined,e)}}function a(r,i,o){if(o in t){return n(r,i)}else if(o in e){return n(undefined,r)}}var u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:function(e,t){return i(headersToObject(e),headersToObject(t),true)}};utils.forEach(Object.keys(Object.assign({},e,t)),(function n(o){var s=u[o]||i;var l=s(e[o],t[o],o);utils.isUndefined(l)&&s!==a||(r[o]=l)}));return r}var VERSION="1.5.1";var validators$1={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){validators$1[e]=function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var deprecatedWarnings={};validators$1.transitional=function e(t,r,n){function i(e,t){return"[Axios v"+VERSION+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,n,o){if(t===false){throw new AxiosError(i(n," has been removed"+(r?" in "+r:"")),AxiosError.ERR_DEPRECATED)}if(r&&!deprecatedWarnings[n]){deprecatedWarnings[n]=true;console.warn(i(n," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(e,n,o):true}};function assertOptions(e,t,r){if(typeof e!=="object"){throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE)}var n=Object.keys(e);var i=n.length;while(i-- >0){var o=n[i];var s=t[o];if(s){var a=e[o];var u=a===undefined||s(a,o,e);if(u!==true){throw new AxiosError("option "+o+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new AxiosError("Unknown option "+o,AxiosError.ERR_BAD_OPTION)}}}var validator={assertOptions:assertOptions,validators:validators$1};var validators=validator.validators;var Axios=function(){function e(e){this.defaults=e;this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}e.prototype.request=function(e,t){if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=mergeConfig(this.defaults,t);var r=t.transitional,n=t.paramsSerializer,i=t.headers;if(r!==undefined){validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},false)}if(n!=null){if(utils.isFunction(n)){t.paramsSerializer={serialize:n}}else{validator.assertOptions(n,{encode:validators.function,serialize:validators.function},true)}}t.method=(t.method||this.defaults.method||"get").toLowerCase();var o=i&&utils.merge(i.common,i[t.method]);i&&utils.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]}));t.headers=AxiosHeaders.concat(o,i);var s=[];var a=true;this.interceptors.request.forEach((function e(r){if(typeof r.runWhen==="function"&&r.runWhen(t)===false){return}a=a&&r.synchronous;s.unshift(r.fulfilled,r.rejected)}));var u=[];this.interceptors.response.forEach((function e(t){u.push(t.fulfilled,t.rejected)}));var l;var c=0;var f;if(!a){var d=[dispatchRequest.bind(this),undefined];d.unshift.apply(d,s);d.push.apply(d,u);f=d.length;l=Promise.resolve(t);while(c<f){l=l.then(d[c++],d[c++])}return l}f=s.length;var p=t;c=0;while(c<f){var h=s[c++];var E=s[c++];try{p=h(p)}catch(e){E.call(this,e);break}}try{l=dispatchRequest.call(this,p)}catch(e){return Promise.reject(e)}c=0;f=u.length;while(c<f){l=l.then(u[c++],u[c++])}return l};e.prototype.getUri=function(e){e=mergeConfig(this.defaults,e);var t=buildFullPath(e.baseURL,e.url);return buildURL(t,e.params,e.paramsSerializer)};return e}();utils.forEach(["delete","get","head","options"],(function e(t){Axios.prototype[t]=function(e,r){return this.request(mergeConfig(r||{},{method:t,url:e,data:(r||{}).data}))}}));utils.forEach(["post","put","patch"],(function e(t){function r(e){return function r(n,i,o){return this.request(mergeConfig(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Axios.prototype[t]=r();Axios.prototype[t+"Form"]=r(true)}));var CancelToken=function(){function e(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}var t;this.promise=new Promise((function e(r){t=r}));var r=this;this.promise.then((function(e){if(!r._listeners)return;var t=r._listeners.length;while(t-- >0){r._listeners[t](e)}r._listeners=null}));this.promise.then=function(e){var t;var n=new Promise((function(e){r.subscribe(e);t=e})).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e((function e(n,i,o){if(r.reason){return}r.reason=new CanceledError(n,i,o);t(r.reason)}))}e.prototype.throwIfRequested=function(){if(this.reason){throw this.reason}};e.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}};e.prototype.unsubscribe=function(e){if(!this._listeners){return}var t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}};e.source=function(){var t;var r=new e((function e(r){t=r}));return{token:r,cancel:t}};return e}();function spread(e){return function t(r){return e.apply(null,r)}}function isAxiosError(e){return utils.isObject(e)&&e.isAxiosError===true}var HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach((function(e){var t=e[0],r=e[1];HttpStatusCode[r]=t}));function createInstance(e){var t=new Axios(e);var r=bind(Axios.prototype.request,t);utils.extend(r,Axios.prototype,t,{allOwnKeys:true});utils.extend(r,t,null,{allOwnKeys:true});r.create=function t(r){return createInstance(mergeConfig(e,r))};return r}var axios=createInstance(defaults);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function e(t){return Promise.all(t)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=function(e){return formDataToJSON(utils.isHTMLForm(e)?new FormData(e):e)};axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;var naiveFallback=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};var globalThis_1=function(){if(this)return this;if(typeof globalThis==="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return naiveFallback()}try{if(!__global__)return naiveFallback();return __global__}finally{delete Object.prototype.__global__}}();var ENDPOINT_KEY=Symbol.for("verdocs-default-endpoint");var requestLogger=function(e){console.debug("[JS-SDK] ".concat(e.method.toUpperCase()," ").concat(e.baseURL).concat(e.url),e.data?JSON.stringify(e.data):"");return e};var VerdocsEndpoint=function(){function e(e){this.environment="verdocs";this.sessionType="user";this.baseURL="https://api.verdocs.com";this.baseURLv2="https://api-v2.verdocs.com";this.clientID="not-set";this.timeout=6e4;this.token=null;this.nextListenerId=0;this.sessionListeners=new Map;this.requestLoggerId=null;this.session=null;this.baseURL=(e===null||e===void 0?void 0:e.baseURL)||"https://api.verdocs.com";this.baseURLv2=(e===null||e===void 0?void 0:e.baseURLv2)||"https://api-v2.verdocs.com";this.timeout=(e===null||e===void 0?void 0:e.timeout)||6e4;this.environment=(e===null||e===void 0?void 0:e.environment)||"verdocs";this.sessionType=(e===null||e===void 0?void 0:e.sessionType)||"user";this.clientID=(e===null||e===void 0?void 0:e.clientID)||"not-set";this.api=axios.create({baseURL:this.baseURL,timeout:this.timeout});axiosRetry(this.api,{retries:0,retryDelay:axiosRetry.exponentialDelay,onRetry:function(e,t,r){window.console.debug("[JS_SDK] Retrying request (".concat(e,")"),t.message,r.url)}})}e.prototype.setDefault=function(){globalThis_1[ENDPOINT_KEY]=this};e.getDefault=function(){if(!globalThis_1[ENDPOINT_KEY]){globalThis_1[ENDPOINT_KEY]=new e;window.console.debug("[JS_SDK] Created default endpoint",globalThis_1[ENDPOINT_KEY])}return globalThis_1[ENDPOINT_KEY]};e.prototype.getEnvironment=function(){return this.environment};e.prototype.getSessionType=function(){return this.sessionType};e.prototype.getBaseURL=function(){return this.baseURL};e.prototype.getBaseURLv2=function(){return this.baseURLv2};e.prototype.getClientID=function(){return this.clientID};e.prototype.getTimeout=function(){return this.timeout};e.prototype.getSession=function(){return this.session};e.prototype.setEnvironment=function(e){this.environment=e;return this};e.prototype.setSessionType=function(e){this.sessionType=e;return this};e.prototype.setBaseURL=function(e){this.baseURL=e;this.api.defaults.baseURL=e;return this};e.prototype.setBaseURLv2=function(e){this.baseURLv2=e;return this};e.prototype.setClientID=function(e){this.clientID=e;this.api.defaults.headers.common["X-Client-ID"]=e;return this};e.prototype.setTimeout=function(e){this.timeout=e;this.api.defaults.timeout=e;return this};e.prototype.logRequests=function(e){if(e&&this.requestLoggerId===null){this.requestLoggerId=this.api.interceptors.request.use(requestLogger)}else if(!e&&this.requestLoggerId!==null){this.api.interceptors.request.eject(this.requestLoggerId)}return this};e.prototype.setToken=function(e){if(!e){return this.clearSession()}var t=decodeAccessTokenBody(e);if(t===null||t.exp&&t.exp*1e3<(new Date).getTime()){window.console.warn("[JS_SDK] Ignoring attempt to use expired session token");return this.clearSession()}this.token=e;this.session=t;if(this.sessionType==="user"){this.api.defaults.headers.common.Authorization="Bearer ".concat(e)}else{this.api.defaults.headers.common.signer="Bearer ".concat(e)}localStorage.setItem(this.sessionStorageKey(),e);this.notifySessionListeners();return this};e.prototype.getToken=function(){return this.token};e.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())};e.prototype.clearSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;delete this.api.defaults.headers.common.signer;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.clearSignerSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.notifySessionListeners=function(){var e=this;this.sessionListeners.forEach((function(t){try{t(e,e.session)}catch(e){}}))};e.prototype.onSessionChanged=function(e){var t=this;this.nextListenerId++;var r=Symbol.for(""+this.nextListenerId);this.sessionListeners.set(r,e);return function(){t.sessionListeners.delete(r)}};e.prototype.loadSession=function(){var e=localStorage.getItem(this.sessionStorageKey());if(!e){return this.clearSession()}return this.setToken(e)};return e}();export{TemplateSenderTypes as T,VerdocsEndpoint as V,TemplateActions as a,createTemplate as b,canPerformTemplateAction as c,deleteTemplate as d,getTemplates as e,getTemplate as g,listTemplates as l,updateTemplate as u};
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r["throw"](t))}catch(t){i(t)}}function l(t){t.done?n(t.value):o(t.value).then(s,a)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return l([t,e])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=e.call(t,n)}catch(t){s=[6,t];o=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-172625c5.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r["throw"](t))}catch(t){i(t)}}function l(t){t.done?n(t.value):o(t.value).then(s,a)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return l([t,e])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=e.call(t,n)}catch(t){s=[6,t];o=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-172625c5.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-b011af25.js";import{g as getTemplateStore}from"./TemplateStore-018fc1db.js";import"./index-4439b0d1.js";var ipcTestCss="ipc-test{max-width:800px;display:block}";var IpcTest=function(){function t(t){registerInstance(this,t);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="e997b94c-9d1b-4c85-8552-dedd24e35550"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();t=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:t.store=n.sent();return[3,3];case 2:e=n.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",e);return[3,3];case 3:return[2]}}))}))};t.prototype.render=function(){console.log("[IPC] Rendering");return h(Host,null,h("div",null,h("pre",null,h("code",null,JSON.stringify(this.store.state,null,2)))),h("verdocs-template-roles",{templateId:this.templateId}),h("verdocs-template-fields",{templateId:this.templateId}))};return t}();IpcTest.style=ipcTestCss;export{IpcTest as ipc_test};
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,i,o){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):n(t.value).then(a,s)}l((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,n&&(r=a[0]&2?n["return"]:a[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;if(n=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];n=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-172625c5.js";import{g as getSummary}from"./Envelopes-21ffb899.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,i,o){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):n(t.value).then(a,s)}l((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,n&&(r=a[0]&2?n["return"]:a[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;if(n=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];n=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-172625c5.js";import{g as getSummary}from"./Envelopes-21ffb899.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-b011af25.js";import{i as integerSequence}from"./Primitives-8fe93caf.js";import{S as SDKError}from"./errors-9b5498c8.js";var YEAR=365*24*60*60;var WEEK=7*24*60*60;var DAY=24*60*60;var HOUR=60*60;var MINUTE=60;var formatShortTimeAgo=function(t){if(t===undefined||t===null){return""}var e;if(typeof t==="string"||typeof t==="number"){e=new Date(t)}else if(typeof t==="object"){e=t}else{return""}var i=Math.floor(((new Date).getTime()-e.getTime())/1e3);if(i>=YEAR){return Math.floor(i/YEAR)+"Y"}if(i>=WEEK){return Math.floor(i/WEEK)+"W"}if(i>=DAY){return Math.floor(i/DAY)+"D"}if(i>=HOUR){return Math.floor(i/HOUR)+"H"}if(i>=MINUTE){return Math.floor(i/MINUTE)+"M"}return"".concat(i,"S")};var verdocsActivityBoxCss='verdocs-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';var EmptyImage="https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png";var VerdocsActivityBox=function(){function t(t){registerInstance(this,t);this.sdkError=createEvent(this,"sdkError",7);this.viewEnvelope=createEvent(this,"viewEnvelope",7);this.viewAll=createEvent(this,"viewAll",7);this.endpoint=VerdocsEndpoint.getDefault();this.items=5;this.view=undefined;this.header=undefined;this.title="";this.count=0;this.loading=true;this.entries=[]}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[ACTIVITIES] Must be authenticated");return[2]}this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(o.message,(e=o.response)===null||e===void 0?void 0:e.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};t.prototype.handleItemsUpdated=function(){return this.loadActivity()};t.prototype.handleViewUpdated=function(){return this.loadActivity()};t.prototype.loadActivity=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:this.loading=true;return[4,getSummary(this.endpoint,0)];case 1:t=i.sent();if(this.view==="action"){e="Action Required";this.entries=t.action_required.result;this.count=t.action_required.total}else if(this.view==="waiting"){e="Waiting on Others";this.entries=t.waiting_others.result;this.count=t.waiting_others.total}else if(this.view==="completed"){e="Completed";this.entries=t.completed.result;this.count=t.completed.total}this.title=this.header!==undefined?this.header:e;this.loading=false;return[2]}}))}))};t.prototype.render=function(){var t=this;if(this.loading){return h(Host,{style:{minHeight:"300px"}},this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(0)")),integerSequence(0,this.items).map((function(){return h("div",{class:"loading-placeholder"},h("div",{class:"loading-placeholder-bg"}))})))}return h(Host,null,this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(",this.count,")"),h("div",{class:"spacer"}),h("verdocs-button",{label:"View All",size:"small",onClick:function(){var e;return(e=t.viewAll)===null||e===void 0?void 0:e.emit({endpoint:t.endpoint,view:t.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((function(e){return h("div",{class:"activity-entry",onClick:function(){var i;(i=t.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:t.endpoint,entry:e})}},h("div",{class:"title"},e.name,h("br",null)," ",h("strong",null,e.recipient.name)),h("div",{class:"time-ago"},formatShortTimeAgo(e.updated_at)))})):h("img",{src:EmptyImage,alt:"No documents to show",style:{width:"190px",margin:"0 auto"}}))};Object.defineProperty(t,"watchers",{get:function(){return{items:["handleItemsUpdated"],view:["handleViewUpdated"]}},enumerable:false,configurable:true});return t}();VerdocsActivityBox.style=verdocsActivityBoxCss;export{VerdocsActivityBox as verdocs_activity_box};
|