@verdocs/web-sdk 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/cjs/Profiles-244e8254.js +95 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/verdocs-auth.cjs.entry.js +27 -54
  4. package/dist/cjs/verdocs-button_2.cjs.entry.js +65 -0
  5. package/dist/cjs/{verdocs-checkbox_5.cjs.entry.js → verdocs-checkbox_4.cjs.entry.js} +0 -38
  6. package/dist/cjs/verdocs-settings-organization_2.cjs.entry.js +4383 -0
  7. package/dist/cjs/verdocs-settings.cjs.entry.js +42 -0
  8. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  9. package/dist/collection/collection-manifest.json +3 -0
  10. package/dist/collection/components/controls/verdocs-help-icon/verdocs-help-icon.css +0 -3
  11. package/dist/collection/components/controls/verdocs-help-icon/verdocs-help-icon.js +24 -5
  12. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +7 -0
  13. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +26 -11
  14. package/dist/collection/components/embeds/verdocs-settings/verdocs-settings.css +29 -0
  15. package/dist/collection/components/embeds/verdocs-settings/verdocs-settings.js +98 -0
  16. package/dist/collection/components/embeds/verdocs-settings/verdocs-settings.stories.js +10 -0
  17. package/dist/collection/components/settings/verdocs-settings-organization/TimeZones.js +144 -0
  18. package/dist/collection/components/settings/verdocs-settings-organization/verdocs-settings-organization.css +33 -0
  19. package/dist/collection/components/settings/verdocs-settings-organization/verdocs-settings-organization.js +226 -0
  20. package/dist/collection/components/settings/verdocs-settings-organization/verdocs-settings-organization.stories.js +13 -0
  21. package/dist/collection/components/settings/verdocs-settings-profile/verdocs-settings-profile.css +33 -0
  22. package/dist/collection/components/settings/verdocs-settings-profile/verdocs-settings-profile.js +187 -0
  23. package/dist/collection/components/settings/verdocs-settings-profile/verdocs-settings-profile.stories.js +13 -0
  24. package/dist/components/EnvelopeStore.js +1 -1
  25. package/dist/components/Organizations.js +32 -0
  26. package/dist/components/Profiles.js +57 -0
  27. package/dist/components/TemplateStore.js +1 -1
  28. package/dist/components/index.d.ts +3 -0
  29. package/dist/components/index.js +3 -0
  30. package/dist/components/index3.js +3979 -168
  31. package/dist/components/index4.js +194 -0
  32. package/dist/components/verdocs-auth.js +41 -60
  33. package/dist/components/verdocs-help-icon2.js +8 -6
  34. package/dist/components/verdocs-settings-organization.d.ts +11 -0
  35. package/dist/components/verdocs-settings-organization.js +6 -0
  36. package/dist/components/verdocs-settings-organization2.js +331 -0
  37. package/dist/components/verdocs-settings-profile.d.ts +11 -0
  38. package/dist/components/verdocs-settings-profile.js +6 -0
  39. package/dist/components/verdocs-settings-profile2.js +142 -0
  40. package/dist/components/verdocs-settings.d.ts +11 -0
  41. package/dist/components/verdocs-settings.js +101 -0
  42. package/dist/custom-elements.json +1975 -0
  43. package/dist/docs.json +263 -1
  44. package/dist/esm/Profiles-7645e6f1.js +88 -0
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/verdocs-auth.entry.js +26 -53
  47. package/dist/esm/verdocs-button_2.entry.js +60 -0
  48. package/dist/esm/{verdocs-checkbox_5.entry.js → verdocs-checkbox_4.entry.js} +1 -38
  49. package/dist/esm/verdocs-settings-organization_2.entry.js +4378 -0
  50. package/dist/esm/verdocs-settings.entry.js +38 -0
  51. package/dist/esm/verdocs-web-sdk.js +1 -1
  52. package/dist/esm-es5/Profiles-7645e6f1.js +1 -0
  53. package/dist/esm-es5/loader.js +1 -1
  54. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  55. package/dist/esm-es5/verdocs-button_2.entry.js +1 -0
  56. package/dist/esm-es5/verdocs-checkbox_4.entry.js +1 -0
  57. package/dist/esm-es5/verdocs-settings-organization_2.entry.js +1 -0
  58. package/dist/esm-es5/verdocs-settings.entry.js +1 -0
  59. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  60. package/dist/types/components/controls/verdocs-help-icon/verdocs-help-icon.d.ts +6 -2
  61. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +2 -1
  62. package/dist/types/components/embeds/verdocs-settings/verdocs-settings.d.ts +22 -0
  63. package/dist/types/components/embeds/verdocs-settings/verdocs-settings.stories.d.ts +4 -0
  64. package/dist/types/components/settings/verdocs-settings-organization/TimeZones.d.ts +1 -0
  65. package/dist/types/components/settings/verdocs-settings-organization/verdocs-settings-organization.d.ts +42 -0
  66. package/dist/types/components/settings/verdocs-settings-organization/verdocs-settings-organization.stories.d.ts +6 -0
  67. package/dist/types/components/settings/verdocs-settings-profile/verdocs-settings-profile.d.ts +38 -0
  68. package/dist/types/components/settings/verdocs-settings-profile/verdocs-settings-profile.stories.d.ts +6 -0
  69. package/dist/types/components.d.ts +104 -0
  70. package/dist/types/utils/utils.d.ts +1 -1
  71. package/dist/verdocs-web-sdk/p-075dc36d.js +1 -0
  72. package/dist/verdocs-web-sdk/p-0fecb805.entry.js +1 -0
  73. package/dist/verdocs-web-sdk/p-144d4ed1.system.entry.js +1 -0
  74. package/dist/verdocs-web-sdk/p-229a6849.entry.js +1 -0
  75. package/dist/verdocs-web-sdk/p-40361f22.entry.js +1 -0
  76. package/dist/verdocs-web-sdk/p-4821f318.system.entry.js +1 -0
  77. package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
  78. package/dist/verdocs-web-sdk/p-888adbc2.system.entry.js +1 -0
  79. package/dist/verdocs-web-sdk/p-cbebc039.system.js +1 -0
  80. package/dist/verdocs-web-sdk/p-ce22913a.entry.js +1 -0
  81. package/dist/verdocs-web-sdk/p-de192808.system.entry.js +1 -0
  82. package/dist/verdocs-web-sdk/p-e9d2b68a.entry.js +1 -0
  83. package/dist/verdocs-web-sdk/p-febebe69.system.entry.js +1 -0
  84. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  85. package/package.json +4 -3
  86. package/dist/cjs/verdocs-button.cjs.entry.js +0 -26
  87. package/dist/esm/verdocs-button.entry.js +0 -22
  88. package/dist/esm-es5/verdocs-button.entry.js +0 -1
  89. package/dist/esm-es5/verdocs-checkbox_5.entry.js +0 -1
  90. package/dist/verdocs-web-sdk/p-28b22c54.system.entry.js +0 -1
  91. package/dist/verdocs-web-sdk/p-450d6648.system.entry.js +0 -1
  92. package/dist/verdocs-web-sdk/p-606e0405.entry.js +0 -1
  93. package/dist/verdocs-web-sdk/p-9964cc5e.entry.js +0 -1
  94. package/dist/verdocs-web-sdk/p-c391fa41.entry.js +0 -1
  95. package/dist/verdocs-web-sdk/p-fbabbcea.system.entry.js +0 -1
@@ -0,0 +1,331 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { z } from './index3.js';
3
+ import './Types.js';
4
+ import { g as getOrganization, u as updateOrganization } from './Organizations.js';
5
+ import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
6
+ import { d as convertToE164 } from './utils.js';
7
+ import { V as VerdocsToast } from './Toast.js';
8
+ import { d as defineCustomElement$4 } from './verdocs-button2.js';
9
+ import { d as defineCustomElement$3 } from './verdocs-help-icon2.js';
10
+ import { d as defineCustomElement$2 } from './verdocs-select-input2.js';
11
+ import { d as defineCustomElement$1 } from './verdocs-text-input2.js';
12
+
13
+ const TimeZones = [
14
+ ['International Date Line West', 'GMT-11:00', '(GMT-11:00) International Date Line West'],
15
+ ['Midway Island', 'GMT-11:00', '(GMT-11:00) Midway Island'],
16
+ ['Samoa', 'GMT-11:00', '(GMT-11:00) Samoa'],
17
+ ['Hawaii', 'GMT-10:00', '(GMT-10:00) Hawaii'],
18
+ ['Alaska', 'GMT-09:00', '(GMT-09:00) Alaska'],
19
+ ['Pacific Time (US & Canada)', 'GMT-08:00', '(GMT-08:00) Pacific Time (US & Canada)'],
20
+ ['Tijuana', 'GMT-08:00', '(GMT-08:00) Tijuana'],
21
+ ['Arizona', 'GMT-07:00', '(GMT-07:00) Arizona'],
22
+ ['Chihuahua', 'GMT-07:00', '(GMT-07:00) Chihuahua'],
23
+ ['Mazatlan', 'GMT-07:00', '(GMT-07:00) Mazatlan'],
24
+ ['Mountain Time (US & Canada)', 'GMT-07:00', '(GMT-07:00) Mountain Time (US & Canada)'],
25
+ ['Central America', 'GMT-06:00', '(GMT-06:00) Central America'],
26
+ ['Central Time (US & Canada)', 'GMT-06:00', '(GMT-06:00) Central Time (US & Canada)'],
27
+ ['Guadalajara', 'GMT-06:00', '(GMT-06:00) Guadalajara'],
28
+ ['Mexico City', 'GMT-06:00', '(GMT-06:00) Mexico City'],
29
+ ['Monterrey', 'GMT-06:00', '(GMT-06:00) Monterrey'],
30
+ ['Saskatchewan', 'GMT-06:00', '(GMT-06:00) Saskatchewan'],
31
+ ['Bogota', 'GMT-05:00', '(GMT-05:00) Bogota'],
32
+ ['Eastern Time (US & Canada)', 'GMT-05:00', '(GMT-05:00) Eastern Time (US & Canada)'],
33
+ ['Indiana (East)', 'GMT-05:00', '(GMT-05:00) Indiana (East)'],
34
+ ['Lima', 'GMT-05:00', '(GMT-05:00) Lima'],
35
+ ['Quito', 'GMT-05:00', '(GMT-05:00) Quito'],
36
+ ['Caracas', 'GMT-04:30', '(GMT-04:30) Caracas'],
37
+ ['Atlantic Time (Canada)', 'GMT-04:00', '(GMT-04:00) Atlantic Time (Canada)'],
38
+ ['Georgetown', 'GMT-04:00', '(GMT-04:00) Georgetown'],
39
+ ['La Paz', 'GMT-04:00', '(GMT-04:00) La Paz'],
40
+ ['Santiago', 'GMT-04:00', '(GMT-04:00) Santiago'],
41
+ ['Newfoundland', 'GMT-03:30', '(GMT-03:30) Newfoundland'],
42
+ ['Brasilia', 'GMT-03:00', '(GMT-03:00) Brasilia'],
43
+ ['Buenos Aires', 'GMT-03:00', '(GMT-03:00) Buenos Aires'],
44
+ ['Greenland', 'GMT-03:00', '(GMT-03:00) Greenland'],
45
+ ['Mid-Atlantic', 'GMT-02:00', '(GMT-02:00) Mid-Atlantic'],
46
+ ['Azores', 'GMT-01:00', '(GMT-01:00) Azores'],
47
+ ['Cape Verde Is.', 'GMT-01:00', '(GMT-01:00) Cape Verde Is.'],
48
+ ['Casablanca', 'GMT+00:00', '(GMT+00:00) Casablanca'],
49
+ ['Dublin', 'GMT+00:00', '(GMT+00:00) Dublin'],
50
+ ['Edinburgh', 'GMT+00:00', '(GMT+00:00) Edinburgh'],
51
+ ['Lisbon', 'GMT+00:00', '(GMT+00:00) Lisbon'],
52
+ ['London', 'GMT+00:00', '(GMT+00:00) London'],
53
+ ['Monrovia', 'GMT+00:00', '(GMT+00:00) Monrovia'],
54
+ ['UTC', 'GMT+00:00', '(GMT+00:00) UTC'],
55
+ ['Amsterdam', 'GMT+01:00', '(GMT+01:00) Amsterdam'],
56
+ ['Belgrade', 'GMT+01:00', '(GMT+01:00) Belgrade'],
57
+ ['Berlin', 'GMT+01:00', '(GMT+01:00) Berlin'],
58
+ ['Bern', 'GMT+01:00', '(GMT+01:00) Bern'],
59
+ ['Bratislava', 'GMT+01:00', '(GMT+01:00) Bratislava'],
60
+ ['Brussels', 'GMT+01:00', '(GMT+01:00) Brussels'],
61
+ ['Budapest', 'GMT+01:00', '(GMT+01:00) Budapest'],
62
+ ['Copenhagen', 'GMT+01:00', '(GMT+01:00) Copenhagen'],
63
+ ['Ljubljana', 'GMT+01:00', '(GMT+01:00) Ljubljana'],
64
+ ['Madrid', 'GMT+01:00', '(GMT+01:00) Madrid'],
65
+ ['Paris', 'GMT+01:00', '(GMT+01:00) Paris'],
66
+ ['Prague', 'GMT+01:00', '(GMT+01:00) Prague'],
67
+ ['Rome', 'GMT+01:00', '(GMT+01:00) Rome'],
68
+ ['Sarajevo', 'GMT+01:00', '(GMT+01:00) Sarajevo'],
69
+ ['Skopje', 'GMT+01:00', '(GMT+01:00) Skopje'],
70
+ ['Stockholm', 'GMT+01:00', '(GMT+01:00) Stockholm'],
71
+ ['Vienna', 'GMT+01:00', '(GMT+01:00) Vienna'],
72
+ ['Warsaw', 'GMT+01:00', '(GMT+01:00) Warsaw'],
73
+ ['West Central Africa', '(GMT+01:00', '(GMT+01:00) West Central Africa'],
74
+ ['Zagreb', 'GMT+01:00', '(GMT+01:00) Zagreb'],
75
+ ['Athens', 'GMT+02:00', '(GMT+02:00) Athens'],
76
+ ['Bucharest', 'GMT+02:00', '(GMT+02:00) Bucharest'],
77
+ ['Cairo', 'GMT+02:00', '(GMT+02:00) Cairo'],
78
+ ['Harare', 'GMT+02:00', '(GMT+02:00) Harare'],
79
+ ['Helsinki', 'GMT+02:00', '(GMT+02:00) Helsinki'],
80
+ ['Istanbul', 'GMT+02:00', '(GMT+02:00) Istanbul'],
81
+ ['Jerusalem', 'GMT+02:00', '(GMT+02:00) Jerusalem'],
82
+ ['Kyiv', 'GMT+02:00', '(GMT+02:00) Kyiv'],
83
+ ['Minsk', 'GMT+02:00', '(GMT+02:00) Minsk'],
84
+ ['Pretoria', 'GMT+02:00', '(GMT+02:00) Pretoria'],
85
+ ['Riga', 'GMT+02:00', '(GMT+02:00) Riga'],
86
+ ['Sofia', 'GMT+02:00', '(GMT+02:00) Sofia'],
87
+ ['Tallinn', 'GMT+02:00', '(GMT+02:00) Tallinn'],
88
+ ['Vilnius', 'GMT+02:00', '(GMT+02:00) Vilnius'],
89
+ ['Baghdad', 'GMT+03:00', '(GMT+03:00) Baghdad'],
90
+ ['Kuwait', 'GMT+03:00', '(GMT+03:00) Kuwait'],
91
+ ['Moscow', 'GMT+03:00', '(GMT+03:00) Moscow'],
92
+ ['Nairobi', 'GMT+03:00', '(GMT+03:00) Nairobi'],
93
+ ['Riyadh', 'GMT+03:00', '(GMT+03:00) Riyadh'],
94
+ ['St. Petersburg', 'GMT+03:00', '(GMT+03:00) St. Petersburg'],
95
+ ['Volgograd', 'GMT+03:00', '(GMT+03:00) Volgograd'],
96
+ ['Tehran', 'GMT+03:30', '(GMT+03:30) Tehran'],
97
+ ['Abu Dhabi', 'GMT+04:00', '(GMT+04:00) Abu Dhabi'],
98
+ ['Baku', 'GMT+04:00', '(GMT+04:00) Baku'],
99
+ ['Muscat', 'GMT+04:00', '(GMT+04:00) Muscat'],
100
+ ['Tbilisi', 'GMT+04:00', '(GMT+04:00) Tbilisi'],
101
+ ['Yerevan', 'GMT+04:00', '(GMT+04:00) Yerevan'],
102
+ ['Kabul', 'GMT+04:30', '(GMT+04:30) Kabul'],
103
+ ['Ekaterinburg', 'GMT+05:00', '(GMT+05:00) Ekaterinburg'],
104
+ ['Islamabad', 'GMT+05:00', '(GMT+05:00) Islamabad'],
105
+ ['Karachi', 'GMT+05:00', '(GMT+05:00) Karachi'],
106
+ ['Tashkent', 'GMT+05:00', '(GMT+05:00) Tashkent'],
107
+ ['Chennai', 'GMT+05:30', '(GMT+05:30) Chennai'],
108
+ ['Kolkata', 'GMT+05:30', '(GMT+05:30) Kolkata'],
109
+ ['Mumbai', 'GMT+05:30', '(GMT+05:30) Mumbai'],
110
+ ['New Delhi', 'GMT+05:30', '(GMT+05:30) New Delhi'],
111
+ ['Sri Jayawardenepura', 'GMT+05:30', '(GMT+05:30) Sri Jayawardenepura'],
112
+ ['Kathmandu', 'GMT+05:45', '(GMT+05:45) Kathmandu'],
113
+ ['Almaty', 'GMT+06:00', '(GMT+06:00) Almaty'],
114
+ ['Astana', 'GMT+06:00', '(GMT+06:00) Astana'],
115
+ ['Dhaka', 'GMT+06:00', '(GMT+06:00) Dhaka'],
116
+ ['Novosibirsk', 'GMT+06:00', '(GMT+06:00) Novosibirsk'],
117
+ ['Rangoon', 'GMT+06:30', '(GMT+06:30) Rangoon'],
118
+ ['Bangkok', 'GMT+07:00', '(GMT+07:00) Bangkok'],
119
+ ['Hanoi', 'GMT+07:00', '(GMT+07:00) Hanoi'],
120
+ ['Jakarta', 'GMT+07:00', '(GMT+07:00) Jakarta'],
121
+ ['Krasnoyarsk', 'GMT+07:00', '(GMT+07:00) Krasnoyarsk'],
122
+ ['Beijing', 'GMT+08:00', '(GMT+08:00) Beijing'],
123
+ ['Chongqing', 'GMT+08:00', '(GMT+08:00) Chongqing'],
124
+ ['Hong Kong', 'GMT+08:00', '(GMT+08:00) Hong Kong'],
125
+ ['Irkutsk', 'GMT+08:00', '(GMT+08:00) Irkutsk'],
126
+ ['Kuala Lumpur', 'GMT+08:00', '(GMT+08:00) Kuala Lumpur'],
127
+ ['Perth', 'GMT+08:00', '(GMT+08:00) Perth'],
128
+ ['Singapore', 'GMT+08:00', '(GMT+08:00) Singapore'],
129
+ ['Taipei', 'GMT+08:00', '(GMT+08:00) Taipei'],
130
+ ['Ulaan Bataar', 'GMT+08:00', '(GMT+08:00) Ulaan Bataar'],
131
+ ['Urumqi', 'GMT+08:00', '(GMT+08:00) Urumqi'],
132
+ ['Osaka', 'GMT+09:00', '(GMT+09:00) Osaka'],
133
+ ['Sapporo', 'GMT+09:00', '(GMT+09:00) Sapporo'],
134
+ ['Seoul', 'GMT+09:00', '(GMT+09:00) Seoul'],
135
+ ['Tokyo', 'GMT+09:00', '(GMT+09:00) Tokyo'],
136
+ ['Yakutsk', 'GMT+09:00', '(GMT+09:00) Yakutsk'],
137
+ ['Adelaide', 'GMT+09:30', '(GMT+09:30) Adelaide'],
138
+ ['Darwin', 'GMT+09:30', '(GMT+09:30) Darwin'],
139
+ ['Brisbane', 'GMT+10:00', '(GMT+10:00) Brisbane'],
140
+ ['Canberra', 'GMT+10:00', '(GMT+10:00) Canberra'],
141
+ ['Guam', 'GMT+10:00', '(GMT+10:00) Guam'],
142
+ ['Hobart', 'GMT+10:00', '(GMT+10:00) Hobart'],
143
+ ['Melbourne', 'GMT+10:00', '(GMT+10:00) Melbourne'],
144
+ ['Port Moresby', 'GMT+10:00', '(GMT+10:00) Port Moresby'],
145
+ ['Sydney', 'GMT+10:00', '(GMT+10:00) Sydney'],
146
+ ['Vladivostok', 'GMT+10:00', '(GMT+10:00) Vladivostok'],
147
+ ['Kamchatka', 'GMT+11:00', '(GMT+11:00) Kamchatka'],
148
+ ['Magadan', 'GMT+11:00', '(GMT+11:00) Magadan'],
149
+ ['New Caledonia', 'GMT+11:00', '(GMT+11:00) New Caledonia'],
150
+ ['Solomon Is.', 'GMT+11:00', '(GMT+11:00) Solomon Is.'],
151
+ ['Auckland', 'GMT+12:00', '(GMT+12:00) Auckland'],
152
+ ['Fiji', 'GMT+12:00', '(GMT+12:00) Fiji'],
153
+ ['Marshall Is.', 'GMT+12:00', '(GMT+12:00) Marshall Is.'],
154
+ ['Wellington', 'GMT+12:00', '(GMT+12:00) Wellington'],
155
+ ["Nuku'alofa", 'GMT+13:00', "(GMT+13:00) Nuku'alofa"],
156
+ ];
157
+
158
+ const verdocsSettingsOrganizationCss = "verdocs-settings-organization{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-organization .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-organization .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-organization verdocs-text-input{margin:10px 0}verdocs-settings-organization verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-organization .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}";
159
+
160
+ const timeZoneOptions = TimeZones.map(tz => ({ value: tz[2], label: tz[2] }));
161
+ const schema = z.object({
162
+ name: z.string().trim().min(1, 'Name is required').max(30),
163
+ business_name: z.string().trim().max(30).optional(),
164
+ contact_email: z.string().trim().email('Invalid email').optional().or(z.literal('')),
165
+ phone: z.preprocess(val => convertToE164(String(val).trim()), z.string().optional()),
166
+ address: z.string().trim().max(30).optional(),
167
+ address2: z.string().trim().max(30).optional(),
168
+ timezone: z.string().trim().optional(),
169
+ url: z.string().trim().optional(),
170
+ });
171
+ const VerdocsSettingsOrganization = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
172
+ constructor() {
173
+ super();
174
+ this.__registerHost();
175
+ this.sdkError = createEvent(this, "sdkError", 7);
176
+ this.organizationUpdated = createEvent(this, "organizationUpdated", 7);
177
+ this.endpoint = VerdocsEndpoint.getDefault();
178
+ this.valid = false;
179
+ this.dirty = false;
180
+ this.submitting = false;
181
+ this.name = '';
182
+ this.business_name = '';
183
+ this.contact_email = '';
184
+ this.phone = '';
185
+ this.address = '';
186
+ this.address2 = '';
187
+ this.timezone = '';
188
+ this.url = '';
189
+ }
190
+ componentWillLoad() {
191
+ this.endpoint.loadSession();
192
+ if (!this.endpoint.session) {
193
+ console.log('[SETTINGS] Must be authenticated');
194
+ return;
195
+ }
196
+ }
197
+ async componentDidLoad() {
198
+ const organization = await getOrganization(this.endpoint, this.endpoint.session.organization_id);
199
+ console.log('[SETTINGS] Loaded organization', organization);
200
+ this.resetForm(organization);
201
+ }
202
+ resetForm(organization) {
203
+ this.name = organization.name;
204
+ this.business_name = organization.business_name;
205
+ this.contact_email = organization.contact_email;
206
+ this.phone = organization.phone;
207
+ this.address = organization.address;
208
+ this.address2 = organization.address2;
209
+ this.timezone = organization.timezone;
210
+ this.url = organization.url;
211
+ this.dirty = false;
212
+ this.valid = true;
213
+ }
214
+ handleSubmit(e) {
215
+ e.preventDefault();
216
+ e.stopPropagation();
217
+ updateOrganization(VerdocsEndpoint.getDefault(), this.endpoint.session.organization_id, {
218
+ name: this.name,
219
+ business_name: this.business_name,
220
+ contact_email: this.contact_email,
221
+ phone: this.phone,
222
+ address: this.address,
223
+ address2: this.address2,
224
+ timezone: this.timezone,
225
+ url: this.url,
226
+ })
227
+ .then(newOrganization => {
228
+ var _a;
229
+ console.log('[SETTINGS] Update result', newOrganization);
230
+ (_a = this.organizationUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, organization: newOrganization });
231
+ this.resetForm(newOrganization);
232
+ })
233
+ .catch(e => VerdocsToast(`Error updating organization: ${e.message}`, { style: 'error' }));
234
+ }
235
+ processFields() {
236
+ const validation = schema.safeParse({
237
+ name: this.name,
238
+ business_name: this.business_name,
239
+ contact_email: this.contact_email,
240
+ phone: this.phone,
241
+ address: this.address,
242
+ address2: this.address2,
243
+ timezone: this.timezone,
244
+ url: this.url,
245
+ });
246
+ console.log('[SETTINGS] Validation result', validation);
247
+ this.valid = validation.success;
248
+ this.dirty = true;
249
+ }
250
+ render() {
251
+ if (!this.endpoint.session) {
252
+ console.log('[SETTINGS] Must be authenticated');
253
+ return h(Host, { class: "authentication-required" }, "Must be authenticated");
254
+ }
255
+ return (h(Host, null, h("h1", null, "Organization Profile"), h("form", { onSubmit: e => this.handleSubmit(e) }, h("div", { class: "columns" }, h("div", { class: "column" }, h("verdocs-text-input", { id: "verdocs-organization-name", value: this.name, autocomplete: "off", label: "Name", required: true, placeholder: "Enter your organization's name...", onInput: (e) => (this.name = e.target.value), onFocusout: (e) => {
256
+ this.name = e.target.value.trim();
257
+ this.processFields();
258
+ } }), h("verdocs-text-input", { id: "verdocs-organization-business-name", value: this.business_name, autocomplete: "off", label: "d/b/a", placeholder: "Enter your d/b/a, if any...", onInput: (e) => (this.business_name = e.target.value), onFocusout: (e) => {
259
+ this.business_name = e.target.value.trim();
260
+ this.processFields();
261
+ } }), h("verdocs-text-input", { id: "verdocs-organization-url", value: this.url, autocomplete: "off", label: "Web URL", placeholder: "Enter your Web URL...", onInput: (e) => (this.url = e.target.value), onFocusout: (e) => {
262
+ this.url = e.target.value.trim();
263
+ this.processFields();
264
+ } }), h("verdocs-text-input", { id: "verdocs-organization-phone", value: this.phone, autocomplete: "off", label: "Phone Number", placeholder: "Enter your phone number...", onInput: (e) => (this.phone = e.target.value), onFocusout: (e) => {
265
+ this.phone = e.target.value.trim();
266
+ this.processFields();
267
+ } })), h("div", { class: "column" }, h("verdocs-text-input", { id: "verdocs-organization-address", value: this.address, autocomplete: "off", label: "Address", required: true, placeholder: "Enter your address...", onInput: (e) => (this.address = e.target.value), onFocusout: (e) => {
268
+ this.address = e.target.value.trim();
269
+ this.processFields();
270
+ } }), h("verdocs-text-input", { id: "verdocs-organization-address", value: this.address2, autocomplete: "off", label: "Address 2", required: true, placeholder: "Address line 2...", onInput: (e) => (this.address2 = e.target.value), onFocusout: (e) => {
271
+ this.address2 = e.target.value.trim();
272
+ this.processFields();
273
+ } }), h("verdocs-text-input", { id: "verdocs-organization-address2", value: this.address2, clearable: true, autocomplete: "off", label: "Address 2", placeholder: "Enter your address...", onInput: (e) => (this.address2 = e.target.value), onFocusout: (e) => {
274
+ this.address2 = e.target.value.trim();
275
+ this.processFields();
276
+ } }), h("verdocs-text-input", { id: "verdocs-organization-email", value: this.contact_email, clearable: true, autocomplete: "off", label: "Contact Email", placeholder: "Enter your contact email address...", onInput: (e) => (this.contact_email = e.target.value), onFocusout: (e) => {
277
+ this.contact_email = e.target.value.trim();
278
+ this.processFields();
279
+ } }), h("verdocs-select-input", { options: timeZoneOptions, value: this.timezone, label: "Time Zone" }))), h("verdocs-button", { type: "submit", label: "Save", size: "normal", disabled: this.submitting || !this.dirty }))));
280
+ }
281
+ static get style() { return verdocsSettingsOrganizationCss; }
282
+ }, [0, "verdocs-settings-organization", {
283
+ "endpoint": [16],
284
+ "valid": [32],
285
+ "dirty": [32],
286
+ "submitting": [32],
287
+ "name": [32],
288
+ "business_name": [32],
289
+ "contact_email": [32],
290
+ "phone": [32],
291
+ "address": [32],
292
+ "address2": [32],
293
+ "timezone": [32],
294
+ "url": [32]
295
+ }]);
296
+ function defineCustomElement() {
297
+ if (typeof customElements === "undefined") {
298
+ return;
299
+ }
300
+ const components = ["verdocs-settings-organization", "verdocs-button", "verdocs-help-icon", "verdocs-select-input", "verdocs-text-input"];
301
+ components.forEach(tagName => { switch (tagName) {
302
+ case "verdocs-settings-organization":
303
+ if (!customElements.get(tagName)) {
304
+ customElements.define(tagName, VerdocsSettingsOrganization);
305
+ }
306
+ break;
307
+ case "verdocs-button":
308
+ if (!customElements.get(tagName)) {
309
+ defineCustomElement$4();
310
+ }
311
+ break;
312
+ case "verdocs-help-icon":
313
+ if (!customElements.get(tagName)) {
314
+ defineCustomElement$3();
315
+ }
316
+ break;
317
+ case "verdocs-select-input":
318
+ if (!customElements.get(tagName)) {
319
+ defineCustomElement$2();
320
+ }
321
+ break;
322
+ case "verdocs-text-input":
323
+ if (!customElements.get(tagName)) {
324
+ defineCustomElement$1();
325
+ }
326
+ break;
327
+ } });
328
+ }
329
+ defineCustomElement();
330
+
331
+ export { VerdocsSettingsOrganization as V, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VerdocsSettingsProfile extends Components.VerdocsSettingsProfile, HTMLElement {}
4
+ export const VerdocsSettingsProfile: {
5
+ prototype: VerdocsSettingsProfile;
6
+ new (): VerdocsSettingsProfile;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { V as VerdocsSettingsProfile$1, d as defineCustomElement$1 } from './verdocs-settings-profile2.js';
2
+
3
+ const VerdocsSettingsProfile = VerdocsSettingsProfile$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { VerdocsSettingsProfile, defineCustomElement };
@@ -0,0 +1,142 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { z } from './index3.js';
3
+ import { g as getCurrentProfile, u as updateProfile } from './Profiles.js';
4
+ import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
5
+ import './Types.js';
6
+ import { d as convertToE164 } from './utils.js';
7
+ import { V as VerdocsToast } from './Toast.js';
8
+ import { d as defineCustomElement$3 } from './verdocs-button2.js';
9
+ import { d as defineCustomElement$2 } from './verdocs-help-icon2.js';
10
+ import { d as defineCustomElement$1 } from './verdocs-text-input2.js';
11
+
12
+ const verdocsSettingsProfileCss = "verdocs-settings-profile{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-profile .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-profile .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-profile verdocs-text-input{margin:10px 0}verdocs-settings-profile verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-profile .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}";
13
+
14
+ const schema = z.object({
15
+ first_name: z.string().trim().min(1, 'First name is required').max(30),
16
+ last_name: z.string().trim().min(1, 'Last name is required').max(30),
17
+ email: z.string().trim().email('Invalid email').min(1, 'Email is required'),
18
+ phone: z.preprocess(val => convertToE164(String(val).trim()), z.string()),
19
+ });
20
+ const VerdocsSettingsProfile = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
21
+ constructor() {
22
+ super();
23
+ this.__registerHost();
24
+ this.sdkError = createEvent(this, "sdkError", 7);
25
+ this.profileUpdated = createEvent(this, "profileUpdated", 7);
26
+ this.endpoint = VerdocsEndpoint.getDefault();
27
+ this.valid = false;
28
+ this.dirty = false;
29
+ this.submitting = false;
30
+ this.first_name = '';
31
+ this.last_name = '';
32
+ this.email = '';
33
+ this.phone = '';
34
+ }
35
+ componentWillLoad() {
36
+ this.endpoint.loadSession();
37
+ if (!this.endpoint.session) {
38
+ console.log('[SETTINGS] Must be authenticated');
39
+ return;
40
+ }
41
+ }
42
+ async componentDidLoad() {
43
+ const profile = await getCurrentProfile(this.endpoint);
44
+ console.log('[SETTINGS] Loaded profile', profile);
45
+ this.resetForm(profile);
46
+ }
47
+ resetForm(profile) {
48
+ this.first_name = profile.first_name;
49
+ this.last_name = profile.last_name;
50
+ this.email = profile.email;
51
+ this.phone = profile.phone;
52
+ this.dirty = false;
53
+ this.valid = true;
54
+ }
55
+ handleSubmit(e) {
56
+ e.preventDefault();
57
+ e.stopPropagation();
58
+ updateProfile(VerdocsEndpoint.getDefault(), this.endpoint.session.profile_id, {
59
+ first_name: this.first_name,
60
+ last_name: this.last_name,
61
+ phone: this.phone,
62
+ })
63
+ .then(newProfile => {
64
+ var _a;
65
+ console.log('[SETTINGS] Update result', newProfile);
66
+ (_a = this.profileUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, profile: newProfile });
67
+ this.resetForm(newProfile);
68
+ })
69
+ .catch(e => VerdocsToast(`Error updating profile: ${e.message}`, { style: 'error' }));
70
+ }
71
+ processFields() {
72
+ const validation = schema.safeParse({
73
+ first_name: this.first_name,
74
+ last_name: this.last_name,
75
+ email: this.email,
76
+ phone: this.phone,
77
+ });
78
+ console.log('[SETTINGS] Validation result', validation);
79
+ this.valid = validation.success;
80
+ this.dirty = true;
81
+ }
82
+ render() {
83
+ if (!this.endpoint.session) {
84
+ console.log('[SETTINGS] Must be authenticated');
85
+ return h(Host, { class: "authentication-required" }, "Must be authenticated");
86
+ }
87
+ return (h(Host, null, h("h1", null, "My Profile"), h("form", { onSubmit: e => this.handleSubmit(e) }, h("div", { class: "columns" }, h("div", { class: "column" }, h("verdocs-text-input", { id: "verdocs-profile-first-name", value: this.first_name, autocomplete: "off", label: "First Name", required: true, placeholder: "Enter your first name...", onInput: (e) => (this.first_name = e.target.value), onFocusout: (e) => {
88
+ this.first_name = e.target.value.trim();
89
+ this.processFields();
90
+ } }), h("verdocs-text-input", { id: "verdocs-profile-last-name", value: this.last_name, autocomplete: "off", label: "Last Name", required: true, placeholder: "Enter your last name...", onInput: (e) => (this.last_name = e.target.value), onFocusout: (e) => {
91
+ this.last_name = e.target.value.trim();
92
+ this.processFields();
93
+ } })), h("div", { class: "column" }, h("verdocs-text-input", { id: "verdocs-profile-email", value: this.email, autocomplete: "off", label: "Email Address", required: true, disabled: true, placeholder: "Enter your email address...", onInput: (e) => (this.email = e.target.value), onFocusout: (e) => {
94
+ this.email = e.target.value.trim();
95
+ this.processFields();
96
+ } }), h("verdocs-text-input", { id: "verdocs-profile-phone", value: this.phone, clearable: true, autocomplete: "off", label: "Phone Number", placeholder: "Enter your phone number...", onInput: (e) => (this.phone = e.target.value), onFocusout: (e) => {
97
+ this.phone = e.target.value.trim();
98
+ this.processFields();
99
+ } }))), h("verdocs-button", { type: "submit", label: "Save", size: "normal", disabled: this.submitting || !this.dirty }))));
100
+ }
101
+ static get style() { return verdocsSettingsProfileCss; }
102
+ }, [0, "verdocs-settings-profile", {
103
+ "endpoint": [16],
104
+ "valid": [32],
105
+ "dirty": [32],
106
+ "submitting": [32],
107
+ "first_name": [32],
108
+ "last_name": [32],
109
+ "email": [32],
110
+ "phone": [32]
111
+ }]);
112
+ function defineCustomElement() {
113
+ if (typeof customElements === "undefined") {
114
+ return;
115
+ }
116
+ const components = ["verdocs-settings-profile", "verdocs-button", "verdocs-help-icon", "verdocs-text-input"];
117
+ components.forEach(tagName => { switch (tagName) {
118
+ case "verdocs-settings-profile":
119
+ if (!customElements.get(tagName)) {
120
+ customElements.define(tagName, VerdocsSettingsProfile);
121
+ }
122
+ break;
123
+ case "verdocs-button":
124
+ if (!customElements.get(tagName)) {
125
+ defineCustomElement$3();
126
+ }
127
+ break;
128
+ case "verdocs-help-icon":
129
+ if (!customElements.get(tagName)) {
130
+ defineCustomElement$2();
131
+ }
132
+ break;
133
+ case "verdocs-text-input":
134
+ if (!customElements.get(tagName)) {
135
+ defineCustomElement$1();
136
+ }
137
+ break;
138
+ } });
139
+ }
140
+ defineCustomElement();
141
+
142
+ export { VerdocsSettingsProfile as V, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VerdocsSettings extends Components.VerdocsSettings, HTMLElement {}
4
+ export const VerdocsSettings: {
5
+ prototype: VerdocsSettings;
6
+ new (): VerdocsSettings;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,101 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import './Types.js';
3
+ import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
4
+ import { S as SDKError } from './errors.js';
5
+ import { d as defineCustomElement$8 } from './verdocs-button2.js';
6
+ import { d as defineCustomElement$7 } from './verdocs-help-icon2.js';
7
+ import { d as defineCustomElement$6 } from './verdocs-loader2.js';
8
+ import { d as defineCustomElement$5 } from './verdocs-select-input2.js';
9
+ import { d as defineCustomElement$4 } from './verdocs-settings-organization2.js';
10
+ import { d as defineCustomElement$3 } from './verdocs-settings-profile2.js';
11
+ import { d as defineCustomElement$2 } from './verdocs-text-input2.js';
12
+
13
+ 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}";
14
+
15
+ const VerdocsSettings$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
16
+ constructor() {
17
+ super();
18
+ this.__registerHost();
19
+ this.sdkError = createEvent(this, "sdkError", 7);
20
+ this.endpoint = VerdocsEndpoint.getDefault();
21
+ this.tab = 'profile';
22
+ }
23
+ async componentWillLoad() {
24
+ var _a, _b, _c;
25
+ try {
26
+ this.endpoint.loadSession();
27
+ if (!this.endpoint.session) {
28
+ console.log('[SETTINGS] Unable to start session, must be authenticated');
29
+ return;
30
+ }
31
+ }
32
+ catch (e) {
33
+ console.log('[SETTINGS] Error with session', e);
34
+ (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
35
+ }
36
+ }
37
+ render() {
38
+ if (!this.endpoint.session) {
39
+ return (h(Host, null, h("verdocs-loader", null)));
40
+ }
41
+ return (h(Host, null, h("div", { class: "tabs" }, h("div", { class: `tab ${this.tab === 'profile' ? 'active' : ''}`, onClick: () => (this.tab = 'profile') }, "Profile"), h("div", { class: `tab ${this.tab === 'organization' ? 'active' : ''}`, onClick: () => (this.tab = 'organization') }, "Organization")), this.tab === 'profile' && h("verdocs-settings-profile", { endpoint: this.endpoint }), this.tab === 'organization' && h("verdocs-settings-organization", { endpoint: this.endpoint })));
42
+ }
43
+ static get style() { return verdocsSettingsCss; }
44
+ }, [0, "verdocs-settings", {
45
+ "endpoint": [16],
46
+ "tab": [32]
47
+ }]);
48
+ function defineCustomElement$1() {
49
+ if (typeof customElements === "undefined") {
50
+ return;
51
+ }
52
+ const components = ["verdocs-settings", "verdocs-button", "verdocs-help-icon", "verdocs-loader", "verdocs-select-input", "verdocs-settings-organization", "verdocs-settings-profile", "verdocs-text-input"];
53
+ components.forEach(tagName => { switch (tagName) {
54
+ case "verdocs-settings":
55
+ if (!customElements.get(tagName)) {
56
+ customElements.define(tagName, VerdocsSettings$1);
57
+ }
58
+ break;
59
+ case "verdocs-button":
60
+ if (!customElements.get(tagName)) {
61
+ defineCustomElement$8();
62
+ }
63
+ break;
64
+ case "verdocs-help-icon":
65
+ if (!customElements.get(tagName)) {
66
+ defineCustomElement$7();
67
+ }
68
+ break;
69
+ case "verdocs-loader":
70
+ if (!customElements.get(tagName)) {
71
+ defineCustomElement$6();
72
+ }
73
+ break;
74
+ case "verdocs-select-input":
75
+ if (!customElements.get(tagName)) {
76
+ defineCustomElement$5();
77
+ }
78
+ break;
79
+ case "verdocs-settings-organization":
80
+ if (!customElements.get(tagName)) {
81
+ defineCustomElement$4();
82
+ }
83
+ break;
84
+ case "verdocs-settings-profile":
85
+ if (!customElements.get(tagName)) {
86
+ defineCustomElement$3();
87
+ }
88
+ break;
89
+ case "verdocs-text-input":
90
+ if (!customElements.get(tagName)) {
91
+ defineCustomElement$2();
92
+ }
93
+ break;
94
+ } });
95
+ }
96
+ defineCustomElement$1();
97
+
98
+ const VerdocsSettings = VerdocsSettings$1;
99
+ const defineCustomElement = defineCustomElement$1;
100
+
101
+ export { VerdocsSettings, defineCustomElement };