@ailaw/venus 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/ar.js +1522 -0
  2. package/dist/ar2.js +2703 -0
  3. package/dist/ar3.js +897 -0
  4. package/dist/attorney.js +2 -0
  5. package/dist/ben.js +1521 -0
  6. package/dist/ben2.js +2702 -0
  7. package/dist/ben3.js +897 -0
  8. package/dist/ch.js +1647 -0
  9. package/dist/ch2.js +2706 -0
  10. package/dist/ch3.js +897 -0
  11. package/dist/company.js +2 -0
  12. package/dist/en.js +1522 -0
  13. package/dist/en2.js +2707 -0
  14. package/dist/en3.js +924 -0
  15. package/dist/es.js +1647 -0
  16. package/dist/es2.js +2704 -0
  17. package/dist/es3.js +897 -0
  18. package/dist/fa.js +1522 -0
  19. package/dist/fa2.js +2702 -0
  20. package/dist/fa3.js +897 -0
  21. package/dist/fr.js +1522 -0
  22. package/dist/fr2.js +2704 -0
  23. package/dist/fr3.js +897 -0
  24. package/dist/hi.js +1645 -0
  25. package/dist/hi2.js +2704 -0
  26. package/dist/hi3.js +897 -0
  27. package/dist/ht.js +1522 -0
  28. package/dist/ht2.js +2704 -0
  29. package/dist/ht3.js +897 -0
  30. package/dist/hy.js +1522 -0
  31. package/dist/hy2.js +2704 -0
  32. package/dist/hy3.js +897 -0
  33. package/dist/individual.js +2 -0
  34. package/dist/jp.js +1521 -0
  35. package/dist/jp2.js +2702 -0
  36. package/dist/jp3.js +897 -0
  37. package/dist/ko.js +1642 -0
  38. package/dist/ko2.js +2704 -0
  39. package/dist/ko3.js +897 -0
  40. package/dist/nep.js +1521 -0
  41. package/dist/nep2.js +2702 -0
  42. package/dist/nep3.js +897 -0
  43. package/dist/pt.js +1522 -0
  44. package/dist/pt2.js +2704 -0
  45. package/dist/pt3.js +897 -0
  46. package/dist/ru.js +1644 -0
  47. package/dist/ru2.js +2704 -0
  48. package/dist/ru3.js +897 -0
  49. package/dist/style.css +1 -0
  50. package/dist/tr.js +1522 -0
  51. package/dist/tr2.js +2706 -0
  52. package/dist/tr3.js +924 -0
  53. package/dist/venus.es.js +2577 -0
  54. package/package.json +1 -1
@@ -0,0 +1,2577 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop2 in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop2))
11
+ __defNormalProp(a, prop2, b[prop2]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop2 of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop2))
15
+ __defNormalProp(a, prop2, b[prop2]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, ref, watch, toRefs, reactive, computed, getCurrentScope, shallowRef } from "vue-demi";
21
+ import { Select, Modal, FormModel, Input, Checkbox, Divider, Button, Upload, Tag, Icon, Tooltip, Form, Row, Col, Radio, Popconfirm, Table, Badge, Card, message } from "ant-design-vue";
22
+ import { useQuery, useResult, useMutation, useApolloClient } from "@vue/apollo-composable";
23
+ import gql from "graphql-tag";
24
+ import { path, uniqBy, prop, sort } from "ramda";
25
+ var index$5 = "";
26
+ function __variableDynamicImportRuntime0__$1(path2) {
27
+ switch (path2) {
28
+ case "./icons/attorney.svg":
29
+ return import("./attorney.js");
30
+ case "./icons/company.svg":
31
+ return import("./company.js");
32
+ case "./icons/individual.svg":
33
+ return import("./individual.js");
34
+ default:
35
+ return new Promise(function(resolve, reject) {
36
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path2)));
37
+ });
38
+ }
39
+ }
40
+ var __vue2_script$k = defineComponent({
41
+ props: {
42
+ type: {
43
+ type: String,
44
+ required: true
45
+ }
46
+ },
47
+ setup(props) {
48
+ const iconUrl = ref();
49
+ watch(() => props.type, (value) => {
50
+ let iconName = "";
51
+ switch (value) {
52
+ case "USERPROFILE":
53
+ iconName = "individual";
54
+ break;
55
+ case "CLIENTPROFILE":
56
+ iconName = "company";
57
+ break;
58
+ default:
59
+ iconName = "attorney";
60
+ break;
61
+ }
62
+ __variableDynamicImportRuntime0__$1(`./icons/${iconName}.svg`).then((result) => iconUrl.value = result.default);
63
+ }, { immediate: true });
64
+ return { iconUrl };
65
+ }
66
+ });
67
+ var render$k = function() {
68
+ var _vm = this;
69
+ var _h = _vm.$createElement;
70
+ var _c = _vm._self._c || _h;
71
+ return _c("img", { staticClass: "w-6 h-6", attrs: { "src": _vm.iconUrl, "alt": _vm.type } });
72
+ };
73
+ var staticRenderFns$k = [];
74
+ function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
75
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
76
+ if (render2) {
77
+ options.render = render2;
78
+ options.staticRenderFns = staticRenderFns2;
79
+ options._compiled = true;
80
+ }
81
+ if (functionalTemplate) {
82
+ options.functional = true;
83
+ }
84
+ if (scopeId) {
85
+ options._scopeId = "data-v-" + scopeId;
86
+ }
87
+ var hook;
88
+ if (moduleIdentifier) {
89
+ hook = function(context) {
90
+ context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
91
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
92
+ context = __VUE_SSR_CONTEXT__;
93
+ }
94
+ if (injectStyles) {
95
+ injectStyles.call(this, context);
96
+ }
97
+ if (context && context._registeredComponents) {
98
+ context._registeredComponents.add(moduleIdentifier);
99
+ }
100
+ };
101
+ options._ssrRegister = hook;
102
+ } else if (injectStyles) {
103
+ hook = shadowMode ? function() {
104
+ injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
105
+ } : injectStyles;
106
+ }
107
+ if (hook) {
108
+ if (options.functional) {
109
+ options._injectStyles = hook;
110
+ var originalRender = options.render;
111
+ options.render = function renderWithStyleInjection(h, context) {
112
+ hook.call(context);
113
+ return originalRender(h, context);
114
+ };
115
+ } else {
116
+ var existing = options.beforeCreate;
117
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
118
+ }
119
+ }
120
+ return {
121
+ exports: scriptExports,
122
+ options
123
+ };
124
+ }
125
+ const __cssModules$k = {};
126
+ var __component__$k = /* @__PURE__ */ normalizeComponent(__vue2_script$k, render$k, staticRenderFns$k, false, __vue2_injectStyles$k, null, null, null);
127
+ function __vue2_injectStyles$k(context) {
128
+ for (let o in __cssModules$k) {
129
+ this[o] = __cssModules$k[o];
130
+ }
131
+ }
132
+ var ProfileTypeIcon = /* @__PURE__ */ function() {
133
+ return __component__$k.exports;
134
+ }();
135
+ var __vue2_script$j = defineComponent({
136
+ props: {
137
+ source: {
138
+ type: Object,
139
+ required: true
140
+ }
141
+ },
142
+ components: { ProfileTypeIcon }
143
+ });
144
+ var render$j = function() {
145
+ var _vm = this;
146
+ var _h = _vm.$createElement;
147
+ var _c = _vm._self._c || _h;
148
+ return _c("div", { staticClass: "flex space-x-1 items-center" }, [_c("ProfileTypeIcon", { attrs: { "type": _vm.source.profileType } }), _c("div", { staticClass: "text-secondary" }, [_vm._v(_vm._s(_vm.source.profileName))])], 1);
149
+ };
150
+ var staticRenderFns$j = [];
151
+ const __cssModules$j = {};
152
+ var __component__$j = /* @__PURE__ */ normalizeComponent(__vue2_script$j, render$j, staticRenderFns$j, false, __vue2_injectStyles$j, null, null, null);
153
+ function __vue2_injectStyles$j(context) {
154
+ for (let o in __cssModules$j) {
155
+ this[o] = __cssModules$j[o];
156
+ }
157
+ }
158
+ var ProfileSelectItem = /* @__PURE__ */ function() {
159
+ return __component__$j.exports;
160
+ }();
161
+ const meQuery = gql`
162
+ query Me {
163
+ me {
164
+ id
165
+ lawFirmId
166
+ }
167
+ }
168
+ `;
169
+ function useMe() {
170
+ const { result } = useQuery(meQuery, void 0, {
171
+ fetchPolicy: "cache-first"
172
+ });
173
+ return useResult(result);
174
+ }
175
+ const profilesQuery = gql`
176
+ query ProfileSearch(
177
+ $lawFirmId: Int!
178
+ $keywords: String
179
+ $profileType: String
180
+ $profileTypeInt: [Int!]
181
+ $profileIds: [Int!]
182
+ $isDisabled: Int
183
+ ) {
184
+ profileSearch(
185
+ query: {
186
+ lawFirmId: $lawFirmId
187
+ keywords: $keywords
188
+ profileType: $profileType
189
+ profileTypeInt: $profileTypeInt
190
+ profileId: $profileIds
191
+ isDisabled: $isDisabled
192
+ }
193
+ ) {
194
+ numResult
195
+ profileList(startIndex: 0, endIndex: 99) {
196
+ id
197
+ profileType
198
+ profileName
199
+ accountList {
200
+ id
201
+ email
202
+ }
203
+ }
204
+ }
205
+ }
206
+ `;
207
+ const addProfileUserMutation = gql`
208
+ mutation AddProfileUser(
209
+ $lawFirmId: Int!
210
+ $name: String!
211
+ $profileType: ProfileType
212
+ $email: String!
213
+ $sendEmail: Boolean!
214
+ ) {
215
+ addProfileUser(
216
+ selfLawFirmId: $lawFirmId
217
+ name: $name
218
+ profileType: $profileType
219
+ email: $email
220
+ sendEmail: $sendEmail
221
+ ) {
222
+ profile {
223
+ id
224
+ profileName
225
+ profileType
226
+ accountList {
227
+ id
228
+ email
229
+ }
230
+ }
231
+ }
232
+ }
233
+ `;
234
+ function useCreateProfile() {
235
+ const me = useMe();
236
+ const { mutate, loading } = useMutation(addProfileUserMutation);
237
+ const createProfile = async (variables) => {
238
+ var _a;
239
+ const result = await mutate(__spreadProps(__spreadValues({}, variables), {
240
+ lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId
241
+ }));
242
+ return path(["data", "addProfileUser", "profile"], result);
243
+ };
244
+ return { createProfile, loading };
245
+ }
246
+ const profileTypes = {
247
+ USERPROFILE: "Individual",
248
+ CLIENTPROFILE: "Company",
249
+ PREPARERPROFILE: "Attorney"
250
+ };
251
+ var __vue2_script$i = defineComponent({
252
+ props: {
253
+ value: {
254
+ type: String
255
+ },
256
+ enabledTypes: {
257
+ type: Array,
258
+ default: ["USERPROFILE", "CLIENTPROFILE", "PREPARERPROFILE"]
259
+ }
260
+ },
261
+ components: {
262
+ Select,
263
+ Option: Select.Option,
264
+ ProfileTypeIcon
265
+ },
266
+ setup(_, { emit }) {
267
+ const handleChange = (value) => emit("input", value);
268
+ return { profileTypes, handleChange };
269
+ }
270
+ });
271
+ var render$i = function() {
272
+ var _vm = this;
273
+ var _h = _vm.$createElement;
274
+ var _c = _vm._self._c || _h;
275
+ return _c("Select", { attrs: { "value": _vm.value }, on: { "change": _vm.handleChange } }, _vm._l(_vm.enabledTypes, function(key) {
276
+ return _c("Option", { key, attrs: { "value": key } }, [_c("div", { staticClass: "flex items-center space-x-1" }, [_c("ProfileTypeIcon", { attrs: { "type": key } }), _c("div", { staticClass: "text-secondary" }, [_vm._v(_vm._s(_vm.profileTypes[key]))])], 1)]);
277
+ }), 1);
278
+ };
279
+ var staticRenderFns$i = [];
280
+ const __cssModules$i = {};
281
+ var __component__$i = /* @__PURE__ */ normalizeComponent(__vue2_script$i, render$i, staticRenderFns$i, false, __vue2_injectStyles$i, null, null, null);
282
+ function __vue2_injectStyles$i(context) {
283
+ for (let o in __cssModules$i) {
284
+ this[o] = __cssModules$i[o];
285
+ }
286
+ }
287
+ var ProfileTypeSelect = /* @__PURE__ */ function() {
288
+ return __component__$i.exports;
289
+ }();
290
+ var __vue2_script$h = defineComponent({
291
+ props: {
292
+ enabledTypes: {
293
+ type: Array,
294
+ default: () => ["USERPROFILE", "CLIENTPROFILE"]
295
+ },
296
+ simpleCreate: {
297
+ type: Boolean,
298
+ default: false
299
+ },
300
+ profileType: {
301
+ type: String
302
+ }
303
+ },
304
+ components: {
305
+ Modal,
306
+ Form: FormModel,
307
+ FormItem: FormModel.Item,
308
+ ProfileTypeSelect,
309
+ Input,
310
+ Checkbox
311
+ },
312
+ setup(props, { emit }) {
313
+ const { simpleCreate, profileType } = toRefs(props);
314
+ const value = reactive({
315
+ profileType: simpleCreate.value ? profileType == null ? void 0 : profileType.value : void 0,
316
+ name: "",
317
+ email: "",
318
+ sendEmail: false
319
+ });
320
+ const hasValidationError = ref(false);
321
+ const canSubmit = computed(() => {
322
+ if (simpleCreate.value && value.name)
323
+ return true;
324
+ return !(value.name === "" || value.profileType == null || hasValidationError.value);
325
+ });
326
+ const rules = {
327
+ profileType: { required: true },
328
+ name: { required: true },
329
+ email: { type: "email" }
330
+ };
331
+ const handleValidate = (_, result) => {
332
+ hasValidationError.value = !result;
333
+ };
334
+ const clearValue = () => Object.assign(value, {});
335
+ const { createProfile, loading } = useCreateProfile();
336
+ const hide = () => emit("cancel");
337
+ const handleSubmit = async () => {
338
+ const profile = await createProfile(value);
339
+ hide();
340
+ emit("profile-created", profile);
341
+ };
342
+ return {
343
+ value,
344
+ rules,
345
+ clearValue,
346
+ loading,
347
+ canSubmit,
348
+ handleSubmit,
349
+ handleValidate
350
+ };
351
+ }
352
+ });
353
+ var render$h = function() {
354
+ var _vm = this;
355
+ var _h = _vm.$createElement;
356
+ var _c = _vm._self._c || _h;
357
+ return _c("modal", _vm._g(_vm._b({ attrs: { "closable": false, "ok-text": "Create", "width": 320, "okButtonProps": { props: { disabled: !_vm.canSubmit, loading: _vm.loading } } }, on: { "cancel": _vm.clearValue, "ok": _vm.handleSubmit } }, "modal", _vm.$attrs, false), _vm.$listeners), [_c("Form", { attrs: { "layout": "vertical", "validate-trigger": "blur", "model": _vm.value, "rules": _vm.rules }, on: { "validate": _vm.handleValidate } }, [!_vm.simpleCreate ? _c("form-item", { attrs: { "label": "Profile type", "prop": "profileType" } }, [_c("profile-type-select", { attrs: { "enabledTypes": _vm.enabledTypes }, model: { value: _vm.value.profileType, callback: function($$v) {
358
+ _vm.$set(_vm.value, "profileType", $$v);
359
+ }, expression: "value.profileType" } })], 1) : _vm._e(), _c("form-item", { class: { "mb-0": _vm.simpleCreate }, attrs: { "label": "Name", "prop": "name" } }, [_c("Input", { model: { value: _vm.value.name, callback: function($$v) {
360
+ _vm.$set(_vm.value, "name", $$v);
361
+ }, expression: "value.name" } })], 1), !_vm.simpleCreate ? _c("form-item", { attrs: { "label": "Email", "prop": "email" } }, [_c("Input", { model: { value: _vm.value.email, callback: function($$v) {
362
+ _vm.$set(_vm.value, "email", $$v);
363
+ }, expression: "value.email" } })], 1) : _vm._e(), !_vm.simpleCreate ? _c("form-item", [_c("checkbox", { model: { value: _vm.value.sendEmail, callback: function($$v) {
364
+ _vm.$set(_vm.value, "sendEmail", $$v);
365
+ }, expression: "value.sendEmail" } }, [_vm._v("Send client portal login password (System will email client a login password)")])], 1) : _vm._e()], 1)], 1);
366
+ };
367
+ var staticRenderFns$h = [];
368
+ const __cssModules$h = {};
369
+ var __component__$h = /* @__PURE__ */ normalizeComponent(__vue2_script$h, render$h, staticRenderFns$h, false, __vue2_injectStyles$h, null, null, null);
370
+ function __vue2_injectStyles$h(context) {
371
+ for (let o in __cssModules$h) {
372
+ this[o] = __cssModules$h[o];
373
+ }
374
+ }
375
+ var ProfileCreateModal = /* @__PURE__ */ function() {
376
+ return __component__$h.exports;
377
+ }();
378
+ var __vue2_script$g = defineComponent({
379
+ props: {
380
+ value: {
381
+ type: Object
382
+ },
383
+ source: {
384
+ type: Array,
385
+ required: true
386
+ },
387
+ creatable: {
388
+ type: Boolean,
389
+ default: false
390
+ }
391
+ },
392
+ components: {
393
+ Select,
394
+ Option: Select.Option,
395
+ Divider,
396
+ Button,
397
+ ProfileSelectItem,
398
+ ProfileCreateModal
399
+ },
400
+ setup(props, { emit }) {
401
+ const selectedId = computed(() => {
402
+ var _a;
403
+ return (_a = props.value) == null ? void 0 : _a.id;
404
+ });
405
+ const handleChange = (value) => emit("input", props.source.find((v) => String(v.id) == value));
406
+ const handleProfileCreate = () => emit("create-profile");
407
+ const filterOption = (val, option) => {
408
+ if (!option.data.attrs.name)
409
+ return true;
410
+ return option.data.attrs.name === "create-btn" || option.data.attrs.name.toUpperCase().includes(val.toUpperCase());
411
+ };
412
+ return {
413
+ filterOption,
414
+ selectedId,
415
+ handleChange,
416
+ handleProfileCreate,
417
+ menu: {}
418
+ };
419
+ }
420
+ });
421
+ var render$g = function() {
422
+ var _vm = this;
423
+ var _h = _vm.$createElement;
424
+ var _c = _vm._self._c || _h;
425
+ return _c("Select", _vm._g(_vm._b({ staticClass: "w-72", attrs: { "allowClear": "", "showSearch": "", "optionFilterProp": "name", "value": _vm.selectedId, "filterOption": _vm.filterOption }, on: { "change": _vm.handleChange } }, "Select", _vm.$attrs, false), _vm.$listeners), [_c("Option", { key: "create-btn", attrs: { "value": "create-btn", "disabled": "", "name": "create-btn" } }, [_c("Button", { staticStyle: { "width": "100%" }, on: { "click": _vm.handleProfileCreate } }, [_vm._v("Create new profile ")]), _vm.creatable ? _c("Divider", { staticClass: "btn-divider" }) : _vm._e()], 1), _vm._l(_vm.source, function(v) {
426
+ return _c("Option", { key: v.id, attrs: { "value": v.id, "name": v.profileName } }, [_c("ProfileSelectItem", { attrs: { "source": v } })], 1);
427
+ })], 2);
428
+ };
429
+ var staticRenderFns$g = [];
430
+ var profileSelector_vue_vue_type_style_index_0_scoped_true_lang = "";
431
+ const __cssModules$g = {};
432
+ var __component__$g = /* @__PURE__ */ normalizeComponent(__vue2_script$g, render$g, staticRenderFns$g, false, __vue2_injectStyles$g, "599bdbb2", null, null);
433
+ function __vue2_injectStyles$g(context) {
434
+ for (let o in __cssModules$g) {
435
+ this[o] = __cssModules$g[o];
436
+ }
437
+ }
438
+ var ProfileSelector = /* @__PURE__ */ function() {
439
+ return __component__$g.exports;
440
+ }();
441
+ function useProfiles(keywords, onlyRole, roleTypes, profileIds, disabledProfile) {
442
+ const me = useMe();
443
+ const isDisabled = computed(() => {
444
+ if (disabledProfile.value === true) {
445
+ return 1;
446
+ } else if (disabledProfile.value === false) {
447
+ return 0;
448
+ } else {
449
+ return void 0;
450
+ }
451
+ });
452
+ const { result, loading } = useQuery(profilesQuery, () => {
453
+ var _a;
454
+ return {
455
+ lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId,
456
+ keywords: keywords.value,
457
+ profileType: onlyRole.value,
458
+ profileTypeInt: roleTypes.value,
459
+ profileIds: profileIds.value,
460
+ isDisabled: isDisabled.value
461
+ };
462
+ }, () => ({
463
+ enabled: me.value != null
464
+ }));
465
+ const profiles = useResult(result, [], (data) => data.profileSearch.profileList);
466
+ return { profiles, loading };
467
+ }
468
+ var __vue2_script$f = defineComponent({
469
+ components: { ProfileSelector, ProfileCreateModal },
470
+ props: {
471
+ value: {
472
+ type: Object
473
+ },
474
+ creatable: {
475
+ type: Boolean,
476
+ default: false
477
+ },
478
+ onlyRole: {
479
+ type: String
480
+ },
481
+ roleTypes: {
482
+ type: Array,
483
+ required: true
484
+ },
485
+ preLoaded: {
486
+ type: Array,
487
+ default: () => []
488
+ },
489
+ profileIds: {
490
+ type: Array
491
+ },
492
+ simpleCreate: {
493
+ type: Boolean,
494
+ default: false
495
+ },
496
+ disabledProfile: {
497
+ type: Boolean,
498
+ default: void 0
499
+ }
500
+ },
501
+ setup(props, { emit }) {
502
+ const keywords = ref("");
503
+ const handleSearch = (value) => keywords.value = value;
504
+ const { onlyRole, roleTypes, profileIds, disabledProfile } = toRefs(props);
505
+ const { profiles: rawProfiles } = useProfiles(keywords, onlyRole, roleTypes, profileIds, disabledProfile);
506
+ const createdProfile = ref();
507
+ const profiles = computed(() => {
508
+ const list = [
509
+ ...props.preLoaded,
510
+ ...createdProfile.value ? [createdProfile.value, ...rawProfiles.value] : rawProfiles.value
511
+ ];
512
+ return uniqBy(prop("id"), list);
513
+ });
514
+ const enabledTypes = computed(() => (onlyRole == null ? void 0 : onlyRole.value) ? [onlyRole.value] : void 0);
515
+ const isModalVisible = ref(false);
516
+ const toggleModal = (value) => isModalVisible.value = value;
517
+ const updateValue = (value) => emit("input", value);
518
+ const handleProfileCreated = (profile) => {
519
+ createdProfile.value = profile;
520
+ updateValue(profile);
521
+ };
522
+ return {
523
+ profiles,
524
+ isModalVisible,
525
+ toggleModal,
526
+ enabledTypes,
527
+ updateValue,
528
+ handleProfileCreated,
529
+ keywords,
530
+ handleSearch
531
+ };
532
+ }
533
+ });
534
+ var render$f = function() {
535
+ var _vm = this;
536
+ var _h = _vm.$createElement;
537
+ var _c = _vm._self._c || _h;
538
+ return _c("div", [_c("profile-selector", _vm._g(_vm._b({ attrs: { "source": _vm.profiles, "value": _vm.value, "creatable": _vm.creatable }, on: { "search": _vm.handleSearch, "create-profile": function($event) {
539
+ return _vm.toggleModal(true);
540
+ }, "input": _vm.updateValue } }, "profile-selector", _vm.$attrs, false), _vm.$listeners)), _vm.creatable ? _c("profile-create-modal", { attrs: { "visible": _vm.isModalVisible, "enabledTypes": _vm.enabledTypes, "simpleCreate": _vm.simpleCreate, "profileType": _vm.simpleCreate ? _vm.onlyRole : void 0 }, on: { "cancel": function($event) {
541
+ return _vm.toggleModal(false);
542
+ }, "profile-created": _vm.handleProfileCreated } }) : _vm._e()], 1);
543
+ };
544
+ var staticRenderFns$f = [];
545
+ const __cssModules$f = {};
546
+ var __component__$f = /* @__PURE__ */ normalizeComponent(__vue2_script$f, render$f, staticRenderFns$f, false, __vue2_injectStyles$f, null, null, null);
547
+ function __vue2_injectStyles$f(context) {
548
+ for (let o in __cssModules$f) {
549
+ this[o] = __cssModules$f[o];
550
+ }
551
+ }
552
+ var index$4 = /* @__PURE__ */ function() {
553
+ return __component__$f.exports;
554
+ }();
555
+ const queryAllCaseTemplates = gql`
556
+ query AllCaseTemplates($lawFirmId: Int!) {
557
+ gallery: galleryCaseTemplateList(selfLawFirmId: $lawFirmId) {
558
+ id
559
+ isSmart
560
+ templateName
561
+ isCompanyRelated
562
+ isIndividualRelated
563
+ }
564
+
565
+ custom: customCaseTemplateList(selfLawFirmId: $lawFirmId) {
566
+ id
567
+ isSmart
568
+ templateName
569
+ isCompanyRelated
570
+ isIndividualRelated
571
+ }
572
+ }
573
+ `;
574
+ const compare = (a, b) => {
575
+ if (a.templateName === b.templateName) {
576
+ if (a.isSmart && b.isSmart)
577
+ return 0;
578
+ return a.isSmart ? 1 : -1;
579
+ }
580
+ return a.templateName > b.templateName ? 1 : -1;
581
+ };
582
+ function useCaseTemplates() {
583
+ const me = useMe();
584
+ const { result, loading } = useQuery(queryAllCaseTemplates, () => {
585
+ var _a;
586
+ return {
587
+ lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId
588
+ };
589
+ }, () => ({
590
+ enabled: me.value != null
591
+ }));
592
+ const templates = useResult(result, {
593
+ gallery: [],
594
+ custom: []
595
+ }, (data) => ({
596
+ gallery: sort(compare, data.gallery),
597
+ custom: sort(compare, data.custom)
598
+ }));
599
+ return { templates, loading };
600
+ }
601
+ var __vue2_script$e = defineComponent({
602
+ props: {
603
+ isSmart: {
604
+ type: Boolean
605
+ }
606
+ },
607
+ setup() {
608
+ }
609
+ });
610
+ var render$e = function() {
611
+ var _vm = this;
612
+ var _h = _vm.$createElement;
613
+ var _c = _vm._self._c || _h;
614
+ return _c("div", { staticClass: "border border-solid rounded px-2 leading-5", class: {
615
+ "text-smart bg-purple border-light-purple": _vm.isSmart,
616
+ "text-classic bg-blue border-light-blue": !_vm.isSmart
617
+ } }, [_vm._v(" " + _vm._s(_vm.isSmart ? _vm.$t("message.smart") : _vm.$t("message.classic")) + " ")]);
618
+ };
619
+ var staticRenderFns$e = [];
620
+ const __cssModules$e = {};
621
+ var __component__$e = /* @__PURE__ */ normalizeComponent(__vue2_script$e, render$e, staticRenderFns$e, false, __vue2_injectStyles$e, null, null, null);
622
+ function __vue2_injectStyles$e(context) {
623
+ for (let o in __cssModules$e) {
624
+ this[o] = __cssModules$e[o];
625
+ }
626
+ }
627
+ var CaseTemplateTypeBadge = /* @__PURE__ */ function() {
628
+ return __component__$e.exports;
629
+ }();
630
+ var __vue2_script$d = defineComponent({
631
+ props: {
632
+ source: {
633
+ type: Object,
634
+ required: true
635
+ }
636
+ },
637
+ components: { CaseTemplateTypeBadge },
638
+ setup() {
639
+ const isShowBeta = (source) => [467, 468, 469, 470, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826].includes(source.id);
640
+ return {
641
+ isShowBeta
642
+ };
643
+ }
644
+ });
645
+ var render$d = function() {
646
+ var _vm = this;
647
+ var _h = _vm.$createElement;
648
+ var _c = _vm._self._c || _h;
649
+ return _c("div", { staticClass: "flex space-x-2 items-center" }, [_c("span", [_vm._v(_vm._s(_vm.source.templateName))]), _c("case-template-type-badge", { attrs: { "isSmart": _vm.source.isSmart } }), _vm.isShowBeta(_vm.source) ? _c("span", { staticClass: "beta" }, [_vm._v("Beta")]) : _vm._e()], 1);
650
+ };
651
+ var staticRenderFns$d = [];
652
+ var caseTemplateOption_vue_vue_type_style_index_0_scoped_true_lang = "";
653
+ const __cssModules$d = {};
654
+ var __component__$d = /* @__PURE__ */ normalizeComponent(__vue2_script$d, render$d, staticRenderFns$d, false, __vue2_injectStyles$d, "bf8611b6", null, null);
655
+ function __vue2_injectStyles$d(context) {
656
+ for (let o in __cssModules$d) {
657
+ this[o] = __cssModules$d[o];
658
+ }
659
+ }
660
+ var CaseTemplateOption = /* @__PURE__ */ function() {
661
+ return __component__$d.exports;
662
+ }();
663
+ var __vue2_script$c = defineComponent({
664
+ props: ["value"],
665
+ components: {
666
+ ASelect: Select,
667
+ AOption: Select.Option,
668
+ AOptionGroup: Select.OptGroup,
669
+ CaseTemplateOption
670
+ },
671
+ setup(props, { emit }) {
672
+ const { templates } = useCaseTemplates();
673
+ const customTemplates = computed(() => {
674
+ var _a, _b;
675
+ return (_b = (_a = templates.value) == null ? void 0 : _a.custom) != null ? _b : [];
676
+ });
677
+ const galleryTemplates = computed(() => {
678
+ var _a, _b;
679
+ return (_b = (_a = templates.value) == null ? void 0 : _a.gallery) != null ? _b : [];
680
+ });
681
+ const allTemplates = computed(() => [
682
+ ...customTemplates.value,
683
+ ...galleryTemplates.value
684
+ ]);
685
+ const isMultiple = computed(() => Array.isArray(props.value));
686
+ const innerValue = computed(() => {
687
+ var _a, _b;
688
+ return isMultiple.value ? (_a = props.value) == null ? void 0 : _a.map(prop("id")) : (_b = props.value) == null ? void 0 : _b.id;
689
+ });
690
+ const onChange = (value) => {
691
+ if (Array.isArray(value)) {
692
+ const result2 = allTemplates.value.filter((v) => value.includes(v.id));
693
+ return emit("update:value", result2);
694
+ }
695
+ const result = allTemplates.value.find((v) => v.id === value);
696
+ emit("update:value", result);
697
+ };
698
+ const onFilter = (keywords, node) => {
699
+ var _a, _b, _c, _d;
700
+ return (_d = (_c = (_b = (_a = node.data) == null ? void 0 : _a.attrs) == null ? void 0 : _b.name) == null ? void 0 : _c.toLowerCase()) == null ? void 0 : _d.includes(keywords.toLowerCase());
701
+ };
702
+ return {
703
+ customTemplates,
704
+ galleryTemplates,
705
+ isMultiple,
706
+ innerValue,
707
+ onChange,
708
+ onFilter
709
+ };
710
+ }
711
+ });
712
+ var render$c = function() {
713
+ var _vm = this;
714
+ var _h = _vm.$createElement;
715
+ var _c = _vm._self._c || _h;
716
+ return _c("a-select", _vm._b({ staticClass: "min-w-80", attrs: { "allowClear": "", "showSearch": "", "mode": _vm.isMultiple ? "multiple" : "default", "filter-option": _vm.onFilter, "value": _vm.innerValue }, on: { "change": _vm.onChange } }, "a-select", _vm.$attrs, false), [_c("a-option-group", { attrs: { "label": [_vm.$t("message.custom"), _vm.$t("message.templates")].join(" ") } }, _vm._l(_vm.customTemplates, function(v) {
717
+ return _c("a-option", { key: v.id, attrs: { "value": v.id, "name": v.templateName } }, [_c("CaseTemplateOption", { attrs: { "source": v } })], 1);
718
+ }), 1), _c("a-option-group", { attrs: { "label": [_vm.$t("message.gallery"), _vm.$t("message.templates")].join(" ") } }, _vm._l(_vm.galleryTemplates, function(v) {
719
+ return _c("a-option", { key: v.id, attrs: { "value": v.id, "name": v.templateName } }, [_c("CaseTemplateOption", { attrs: { "source": v } })], 1);
720
+ }), 1)], 1);
721
+ };
722
+ var staticRenderFns$c = [];
723
+ var index_vue_vue_type_style_index_0_scoped_true_lang$7 = "";
724
+ const __cssModules$c = {};
725
+ var __component__$c = /* @__PURE__ */ normalizeComponent(__vue2_script$c, render$c, staticRenderFns$c, false, __vue2_injectStyles$c, "149d121e", null, null);
726
+ function __vue2_injectStyles$c(context) {
727
+ for (let o in __cssModules$c) {
728
+ this[o] = __cssModules$c[o];
729
+ }
730
+ }
731
+ var index$3 = /* @__PURE__ */ function() {
732
+ return __component__$c.exports;
733
+ }();
734
+ function __variableDynamicImportRuntime0__(path2) {
735
+ switch (path2) {
736
+ case "../languages/ar.ts":
737
+ return import("./ar.js");
738
+ case "../languages/ar2.ts":
739
+ return import("./ar2.js");
740
+ case "../languages/ar3.ts":
741
+ return import("./ar3.js");
742
+ case "../languages/ben.ts":
743
+ return import("./ben.js");
744
+ case "../languages/ben2.ts":
745
+ return import("./ben2.js");
746
+ case "../languages/ben3.ts":
747
+ return import("./ben3.js");
748
+ case "../languages/ch.ts":
749
+ return import("./ch.js");
750
+ case "../languages/ch2.ts":
751
+ return import("./ch2.js");
752
+ case "../languages/ch3.ts":
753
+ return import("./ch3.js");
754
+ case "../languages/en.ts":
755
+ return import("./en.js");
756
+ case "../languages/en2.ts":
757
+ return import("./en2.js");
758
+ case "../languages/en3.ts":
759
+ return import("./en3.js");
760
+ case "../languages/es.ts":
761
+ return import("./es.js");
762
+ case "../languages/es2.ts":
763
+ return import("./es2.js");
764
+ case "../languages/es3.ts":
765
+ return import("./es3.js");
766
+ case "../languages/fa.ts":
767
+ return import("./fa.js");
768
+ case "../languages/fa2.ts":
769
+ return import("./fa2.js");
770
+ case "../languages/fa3.ts":
771
+ return import("./fa3.js");
772
+ case "../languages/fr.ts":
773
+ return import("./fr.js");
774
+ case "../languages/fr2.ts":
775
+ return import("./fr2.js");
776
+ case "../languages/fr3.ts":
777
+ return import("./fr3.js");
778
+ case "../languages/hi.ts":
779
+ return import("./hi.js");
780
+ case "../languages/hi2.ts":
781
+ return import("./hi2.js");
782
+ case "../languages/hi3.ts":
783
+ return import("./hi3.js");
784
+ case "../languages/ht.ts":
785
+ return import("./ht.js");
786
+ case "../languages/ht2.ts":
787
+ return import("./ht2.js");
788
+ case "../languages/ht3.ts":
789
+ return import("./ht3.js");
790
+ case "../languages/hy.ts":
791
+ return import("./hy.js");
792
+ case "../languages/hy2.ts":
793
+ return import("./hy2.js");
794
+ case "../languages/hy3.ts":
795
+ return import("./hy3.js");
796
+ case "../languages/jp.ts":
797
+ return import("./jp.js");
798
+ case "../languages/jp2.ts":
799
+ return import("./jp2.js");
800
+ case "../languages/jp3.ts":
801
+ return import("./jp3.js");
802
+ case "../languages/ko.ts":
803
+ return import("./ko.js");
804
+ case "../languages/ko2.ts":
805
+ return import("./ko2.js");
806
+ case "../languages/ko3.ts":
807
+ return import("./ko3.js");
808
+ case "../languages/nep.ts":
809
+ return import("./nep.js");
810
+ case "../languages/nep2.ts":
811
+ return import("./nep2.js");
812
+ case "../languages/nep3.ts":
813
+ return import("./nep3.js");
814
+ case "../languages/pt.ts":
815
+ return import("./pt.js");
816
+ case "../languages/pt2.ts":
817
+ return import("./pt2.js");
818
+ case "../languages/pt3.ts":
819
+ return import("./pt3.js");
820
+ case "../languages/ru.ts":
821
+ return import("./ru.js");
822
+ case "../languages/ru2.ts":
823
+ return import("./ru2.js");
824
+ case "../languages/ru3.ts":
825
+ return import("./ru3.js");
826
+ case "../languages/tr.ts":
827
+ return import("./tr.js");
828
+ case "../languages/tr2.ts":
829
+ return import("./tr2.js");
830
+ case "../languages/tr3.ts":
831
+ return import("./tr3.js");
832
+ default:
833
+ return new Promise(function(resolve, reject) {
834
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path2)));
835
+ });
836
+ }
837
+ }
838
+ const loaded = new Map();
839
+ async function getLanguageMessage(lang) {
840
+ if (!loaded.has(lang)) {
841
+ const { default: message2 } = await __variableDynamicImportRuntime0__(`../languages/${lang}.ts`);
842
+ loaded.set(lang, message2);
843
+ }
844
+ return loaded.get(lang);
845
+ }
846
+ const createForm = (form) => form;
847
+ var GlueRoleType;
848
+ (function(GlueRoleType2) {
849
+ GlueRoleType2[GlueRoleType2["USERPROFILE"] = 0] = "USERPROFILE";
850
+ GlueRoleType2[GlueRoleType2["CLIENTPROFILE"] = 1] = "CLIENTPROFILE";
851
+ GlueRoleType2[GlueRoleType2["PREPARERPROFILE"] = 2] = "PREPARERPROFILE";
852
+ })(GlueRoleType || (GlueRoleType = {}));
853
+ var g28Company = createForm({
854
+ displayName: "G-28-Company",
855
+ roles: {
856
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
857
+ Beneficiary: [GlueRoleType.USERPROFILE],
858
+ Preparer: [GlueRoleType.PREPARERPROFILE]
859
+ }
860
+ });
861
+ var g28Person = createForm({
862
+ displayName: "G-28-Person",
863
+ roles: {
864
+ Petitioner: [GlueRoleType.USERPROFILE],
865
+ Beneficiary: [GlueRoleType.USERPROFILE],
866
+ Preparer: [GlueRoleType.PREPARERPROFILE]
867
+ }
868
+ });
869
+ var g325A = createForm({
870
+ displayName: "G-325A",
871
+ roles: {
872
+ Beneficiary: [GlueRoleType.USERPROFILE]
873
+ }
874
+ });
875
+ var g639 = createForm({
876
+ displayName: "G-639",
877
+ roles: {
878
+ Beneficiary: [GlueRoleType.USERPROFILE],
879
+ Preparer: [GlueRoleType.PREPARERPROFILE]
880
+ }
881
+ });
882
+ var g1145 = createForm({
883
+ displayName: "G-1145",
884
+ roles: {
885
+ Petitioner: [GlueRoleType.USERPROFILE],
886
+ Beneficiary: [GlueRoleType.USERPROFILE],
887
+ Preparer: [GlueRoleType.PREPARERPROFILE]
888
+ }
889
+ });
890
+ var g1450 = createForm({
891
+ displayName: "G-1450",
892
+ roles: {
893
+ Beneficiary: [GlueRoleType.USERPROFILE]
894
+ }
895
+ });
896
+ var i129Attachment = createForm({
897
+ displayName: "I-129 Attachment",
898
+ roles: {
899
+ Beneficiary: [GlueRoleType.USERPROFILE]
900
+ }
901
+ });
902
+ var i129TAS = createForm({
903
+ displayName: "I-129 Trade Agreement Supplement",
904
+ roles: {
905
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
906
+ Beneficiary: [GlueRoleType.USERPROFILE],
907
+ Preparer: [GlueRoleType.PREPARERPROFILE]
908
+ }
909
+ });
910
+ var i129HS = createForm({
911
+ displayName: "I-129 with H Supplement-Company Petitioner",
912
+ roles: {
913
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
914
+ Beneficiary: [GlueRoleType.USERPROFILE],
915
+ Preparer: [GlueRoleType.PREPARERPROFILE]
916
+ }
917
+ });
918
+ var i130 = createForm({
919
+ displayName: "I-130",
920
+ roles: {
921
+ Petitioner: [GlueRoleType.USERPROFILE],
922
+ Beneficiary: [GlueRoleType.USERPROFILE],
923
+ Preparer: [GlueRoleType.PREPARERPROFILE]
924
+ }
925
+ });
926
+ var i130A = createForm({
927
+ displayName: "I-130A",
928
+ roles: {
929
+ Beneficiary: [GlueRoleType.USERPROFILE],
930
+ Preparer: [GlueRoleType.PREPARERPROFILE]
931
+ }
932
+ });
933
+ var i131 = createForm({
934
+ displayName: "I-131",
935
+ roles: {
936
+ Beneficiary: [GlueRoleType.USERPROFILE],
937
+ Preparer: [GlueRoleType.PREPARERPROFILE]
938
+ }
939
+ });
940
+ var i134 = createForm({
941
+ displayName: "I-134",
942
+ roles: {
943
+ Beneficiary: [GlueRoleType.USERPROFILE],
944
+ Petitioner: [GlueRoleType.USERPROFILE],
945
+ Preparer: [GlueRoleType.PREPARERPROFILE]
946
+ }
947
+ });
948
+ var i192 = createForm({
949
+ displayName: "I-192",
950
+ roles: {
951
+ Beneficiary: [GlueRoleType.USERPROFILE],
952
+ Preparer: [GlueRoleType.PREPARERPROFILE]
953
+ }
954
+ });
955
+ var i360 = createForm({
956
+ displayName: "I-360",
957
+ roles: {
958
+ Beneficiary: [GlueRoleType.USERPROFILE],
959
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
960
+ Preparer: [GlueRoleType.PREPARERPROFILE]
961
+ }
962
+ });
963
+ var i485 = createForm({
964
+ displayName: "I-485",
965
+ roles: {
966
+ Beneficiary: [GlueRoleType.USERPROFILE],
967
+ Preparer: [GlueRoleType.PREPARERPROFILE]
968
+ }
969
+ });
970
+ var i485A = createForm({
971
+ displayName: "I-485A",
972
+ roles: {
973
+ Beneficiary: [GlueRoleType.USERPROFILE],
974
+ Preparer: [GlueRoleType.PREPARERPROFILE]
975
+ }
976
+ });
977
+ var i485J = createForm({
978
+ displayName: "I-485J",
979
+ roles: {
980
+ Beneficiary: [GlueRoleType.USERPROFILE],
981
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
982
+ Preparer: [GlueRoleType.PREPARERPROFILE]
983
+ }
984
+ });
985
+ var i508 = createForm({
986
+ displayName: "I-508",
987
+ roles: {
988
+ Beneficiary: [GlueRoleType.USERPROFILE],
989
+ Preparer: [GlueRoleType.PREPARERPROFILE]
990
+ }
991
+ });
992
+ var i539 = createForm({
993
+ displayName: "I-539",
994
+ roles: {
995
+ Beneficiary: [GlueRoleType.USERPROFILE],
996
+ Preparer: [GlueRoleType.PREPARERPROFILE]
997
+ }
998
+ });
999
+ var i539A = createForm({
1000
+ displayName: "I-539A",
1001
+ roles: {
1002
+ Beneficiary: [GlueRoleType.USERPROFILE],
1003
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1004
+ }
1005
+ });
1006
+ var i589 = createForm({
1007
+ displayName: "I-589",
1008
+ roles: {
1009
+ Beneficiary: [GlueRoleType.USERPROFILE],
1010
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1011
+ }
1012
+ });
1013
+ var i601A = createForm({
1014
+ displayName: "I-601A",
1015
+ roles: {
1016
+ Beneficiary: [GlueRoleType.USERPROFILE],
1017
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1018
+ }
1019
+ });
1020
+ var i765 = createForm({
1021
+ displayName: "I-765",
1022
+ roles: {
1023
+ Beneficiary: [GlueRoleType.USERPROFILE],
1024
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1025
+ }
1026
+ });
1027
+ var i864 = createForm({
1028
+ displayName: "I-864",
1029
+ roles: {
1030
+ Petitioner: [GlueRoleType.USERPROFILE],
1031
+ Beneficiary: [GlueRoleType.USERPROFILE],
1032
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1033
+ }
1034
+ });
1035
+ var i864A = createForm({
1036
+ displayName: "I-864A",
1037
+ roles: {
1038
+ Petitioner: [GlueRoleType.USERPROFILE],
1039
+ Beneficiary: [GlueRoleType.USERPROFILE],
1040
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1041
+ }
1042
+ });
1043
+ var i864EZ = createForm({
1044
+ displayName: "I-864EZ",
1045
+ roles: {
1046
+ Petitioner: [GlueRoleType.USERPROFILE],
1047
+ Beneficiary: [GlueRoleType.USERPROFILE],
1048
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1049
+ }
1050
+ });
1051
+ var i864W = createForm({
1052
+ displayName: "I-864W",
1053
+ roles: {
1054
+ Beneficiary: [GlueRoleType.USERPROFILE],
1055
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1056
+ }
1057
+ });
1058
+ var i907 = createForm({
1059
+ displayName: "I-907",
1060
+ roles: {
1061
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
1062
+ Beneficiary: [GlueRoleType.USERPROFILE],
1063
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1064
+ }
1065
+ });
1066
+ var i918 = createForm({
1067
+ displayName: "I-918",
1068
+ roles: {
1069
+ Beneficiary: [GlueRoleType.USERPROFILE],
1070
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1071
+ }
1072
+ });
1073
+ var i918A = createForm({
1074
+ displayName: "I-918A",
1075
+ roles: {
1076
+ Petitioner: [GlueRoleType.USERPROFILE],
1077
+ Beneficiary: [GlueRoleType.USERPROFILE],
1078
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1079
+ }
1080
+ });
1081
+ var i918B = createForm({
1082
+ displayName: "I-918B",
1083
+ roles: {
1084
+ Beneficiary: [GlueRoleType.USERPROFILE]
1085
+ }
1086
+ });
1087
+ const formRecords = {
1088
+ g28Company,
1089
+ g28Person,
1090
+ g325A,
1091
+ g639,
1092
+ g1145,
1093
+ g1450,
1094
+ i129Attachment,
1095
+ i129TAS,
1096
+ i129HS,
1097
+ i130,
1098
+ i130A,
1099
+ i131,
1100
+ i134,
1101
+ i192,
1102
+ i360,
1103
+ i485,
1104
+ i485A,
1105
+ i485J,
1106
+ i508,
1107
+ i539,
1108
+ i539A,
1109
+ i589,
1110
+ i601A,
1111
+ i765,
1112
+ i864,
1113
+ i864A,
1114
+ i864EZ,
1115
+ i864W,
1116
+ i907,
1117
+ i918,
1118
+ i918A,
1119
+ i918B
1120
+ };
1121
+ var index$2 = Object.values(formRecords);
1122
+ const acceptableFormats = [
1123
+ ".rar",
1124
+ ".zip",
1125
+ ".doc",
1126
+ ".pdf",
1127
+ ".docx",
1128
+ ".jpg",
1129
+ ".jpeg",
1130
+ ".png"
1131
+ ];
1132
+ var __vue2_script$b = defineComponent({
1133
+ name: "aFileUploader",
1134
+ components: { AntUpload: Upload, AntTag: Tag, AntModal: Modal, AntIcon: Icon },
1135
+ props: {
1136
+ value: {
1137
+ type: Array,
1138
+ default: () => []
1139
+ },
1140
+ uploadFilesFunc: {
1141
+ type: Function,
1142
+ required: true
1143
+ },
1144
+ disabled: {
1145
+ type: Boolean
1146
+ },
1147
+ previewMode: {
1148
+ type: Boolean,
1149
+ default: false
1150
+ },
1151
+ multipleLineMode: {
1152
+ type: Boolean,
1153
+ default: false
1154
+ }
1155
+ },
1156
+ setup(props, { emit }) {
1157
+ const me = useMe();
1158
+ const loading = ref(false);
1159
+ const changeVal = (k, v) => {
1160
+ emit("change", __spreadProps(__spreadValues({}, props.value), {
1161
+ [k]: v
1162
+ }));
1163
+ };
1164
+ const remove = (id) => {
1165
+ emit("change", props.value.filter((v) => v.id !== id));
1166
+ };
1167
+ const beforeUpload = (file, files) => {
1168
+ var _a, _b;
1169
+ if (loading.value)
1170
+ return false;
1171
+ loading.value = true;
1172
+ props.uploadFilesFunc(files, {
1173
+ office_id: (_a = me.value) == null ? void 0 : _a.lawFirmId,
1174
+ user_id: (_b = me.value) == null ? void 0 : _b.id
1175
+ }).then((res) => {
1176
+ emit("change", [
1177
+ ...props.value,
1178
+ ...res.map(({ status, value }) => {
1179
+ if (status === "fulfilled") {
1180
+ return value;
1181
+ }
1182
+ }).filter((v) => v)
1183
+ ]);
1184
+ }).finally(() => {
1185
+ loading.value = false;
1186
+ });
1187
+ return false;
1188
+ };
1189
+ const previewImage = ref();
1190
+ const typeOf = (filename) => {
1191
+ if (/\.(gif|jpe?g|png)$/i.test(filename)) {
1192
+ return "img";
1193
+ } else if (/\.docx?$/i.test(filename)) {
1194
+ return "doc";
1195
+ } else if (/\.pdf$/i.test(filename)) {
1196
+ return "pdf";
1197
+ }
1198
+ return "other";
1199
+ };
1200
+ const icons = {
1201
+ img: "picture",
1202
+ pdf: "file-pdf",
1203
+ doc: "file-word",
1204
+ other: "download"
1205
+ };
1206
+ const isImage = (file) => typeOf(file.name) === "img";
1207
+ const iconOf = (fileName) => icons[typeOf(fileName)];
1208
+ const clickItem = (item, event) => {
1209
+ if (!isImage(item)) {
1210
+ return;
1211
+ }
1212
+ event.preventDefault();
1213
+ previewImage.value = item.link;
1214
+ };
1215
+ return {
1216
+ iconOf,
1217
+ previewImage,
1218
+ clickItem,
1219
+ changeVal,
1220
+ remove,
1221
+ beforeUpload,
1222
+ loading,
1223
+ acceptableFormats
1224
+ };
1225
+ }
1226
+ });
1227
+ var render$b = function() {
1228
+ var _vm = this;
1229
+ var _h = _vm.$createElement;
1230
+ var _c = _vm._self._c || _h;
1231
+ return _c("div", { class: { container: !_vm.previewMode && !_vm.multipleLineMode } }, [_c("ant-modal", { attrs: { "visible": !!_vm.previewImage, "footer": null }, on: { "cancel": function($event) {
1232
+ _vm.previewImage = null;
1233
+ } } }, [_c("img", { staticStyle: { "width": "100%" }, attrs: { "src": _vm.previewImage } })]), _c("ant-upload", { staticStyle: { "display": "inline" }, attrs: { "multiple": "", "before-upload": _vm.beforeUpload, "disabled": _vm.disabled || _vm.loading, "action": "javascript:;", "fileList": [], "accept": _vm.acceptableFormats.join(",") } }, [!_vm.previewMode ? _c("ant-tag", [_vm._v(" " + _vm._s(_vm.$t("message.selectFile")) + " ")]) : _vm._e(), _vm.value.length ? [_vm.multipleLineMode ? _c("div", _vm._l(_vm.value, function(file) {
1234
+ return _c("div", { key: file.id, staticStyle: { "margin-top": "3px" } }, [_c("a", { staticStyle: { "color": "#2D8CF0" }, attrs: { "href": file.link, "target": "_blank" }, on: { "click": function($event) {
1235
+ $event.stopPropagation();
1236
+ return _vm.clickItem(file, $event);
1237
+ } } }, [_vm._v(" " + _vm._s(file.name) + " "), _c("a-icon", { attrs: { "type": _vm.iconOf(file.name) } })], 1), !_vm.disabled ? _c("a-icon", { attrs: { "type": "close" }, on: { "click": function($event) {
1238
+ $event.stopPropagation();
1239
+ return _vm.remove(file.id);
1240
+ } } }) : _vm._e()], 1);
1241
+ }), 0) : _c("div", { staticStyle: { "display": "inline-block" } }, _vm._l(_vm.value, function(file) {
1242
+ return _c("ant-tag", { key: file.id, attrs: { "closable": !_vm.previewMode && !_vm.disabled }, on: { "close": function($event) {
1243
+ return _vm.remove(file.id);
1244
+ } } }, [_c("a", { staticStyle: { "color": "#111" }, attrs: { "href": file.link, "target": "_blank" }, on: { "click": function($event) {
1245
+ $event.stopPropagation();
1246
+ return _vm.clickItem(file, $event);
1247
+ } } }, [_vm._v(" " + _vm._s(file.name) + " ")])]);
1248
+ }), 1)] : !_vm.previewMode ? _c("span", { class: { block: _vm.multipleLineMode }, staticStyle: { "color": "#ccc" } }, [_vm._v(_vm._s(_vm.acceptableFormats.join(" ")))]) : _vm._e()], 2)], 1);
1249
+ };
1250
+ var staticRenderFns$b = [];
1251
+ var index_vue_vue_type_style_index_0_scoped_true_lang$6 = "";
1252
+ const __cssModules$b = {};
1253
+ var __component__$b = /* @__PURE__ */ normalizeComponent(__vue2_script$b, render$b, staticRenderFns$b, false, __vue2_injectStyles$b, "1c53738a", null, null);
1254
+ function __vue2_injectStyles$b(context) {
1255
+ for (let o in __cssModules$b) {
1256
+ this[o] = __cssModules$b[o];
1257
+ }
1258
+ }
1259
+ var AFileUploader = /* @__PURE__ */ function() {
1260
+ return __component__$b.exports;
1261
+ }();
1262
+ var AssigneeTypes;
1263
+ (function(AssigneeTypes2) {
1264
+ AssigneeTypes2[AssigneeTypes2["EMPTY_DEFAULT"] = 4] = "EMPTY_DEFAULT";
1265
+ AssigneeTypes2[AssigneeTypes2["BENEFICIARY"] = 1] = "BENEFICIARY";
1266
+ AssigneeTypes2[AssigneeTypes2["PETITIONER"] = 2] = "PETITIONER";
1267
+ AssigneeTypes2[AssigneeTypes2["ATTORNEY"] = 3] = "ATTORNEY";
1268
+ })(AssigneeTypes || (AssigneeTypes = {}));
1269
+ var AssigneeTypesText;
1270
+ (function(AssigneeTypesText2) {
1271
+ AssigneeTypesText2["EMPTY_DEFAULT"] = "message.none";
1272
+ AssigneeTypesText2["BENEFICIARY"] = "message.beneficiary";
1273
+ AssigneeTypesText2["PETITIONER"] = "message.petitioner";
1274
+ AssigneeTypesText2["ATTORNEY"] = "message.attorney";
1275
+ })(AssigneeTypesText || (AssigneeTypesText = {}));
1276
+ var SortOrder;
1277
+ (function(SortOrder2) {
1278
+ SortOrder2["default"] = "DEFAULT";
1279
+ SortOrder2["desc"] = "DESC";
1280
+ SortOrder2["asc"] = "ASC";
1281
+ })(SortOrder || (SortOrder = {}));
1282
+ var ResponseCode;
1283
+ (function(ResponseCode2) {
1284
+ ResponseCode2["success"] = "SUCCESS";
1285
+ ResponseCode2["failed"] = "FAILED";
1286
+ })(ResponseCode || (ResponseCode = {}));
1287
+ var __vue2_script$a = defineComponent({
1288
+ components: {
1289
+ AntTag: Tag
1290
+ },
1291
+ props: {
1292
+ assigneeType: {
1293
+ type: String
1294
+ }
1295
+ },
1296
+ setup() {
1297
+ const tagColor = (key) => ["cyan", "orange", "blue", "purple"][AssigneeTypes[key]];
1298
+ return {
1299
+ AssigneeTypesText,
1300
+ tagColor
1301
+ };
1302
+ }
1303
+ });
1304
+ var render$a = function() {
1305
+ var _vm = this;
1306
+ var _h = _vm.$createElement;
1307
+ var _c = _vm._self._c || _h;
1308
+ return _c("ant-tag", { attrs: { "color": _vm.tagColor(_vm.assigneeType || "EMPTY_DEFAULT") } }, [_vm._v(" " + _vm._s(_vm.$t(_vm.AssigneeTypesText[_vm.assigneeType])) + " ")]);
1309
+ };
1310
+ var staticRenderFns$a = [];
1311
+ var index_vue_vue_type_style_index_0_scoped_true_lang$5 = "";
1312
+ const __cssModules$a = {};
1313
+ var __component__$a = /* @__PURE__ */ normalizeComponent(__vue2_script$a, render$a, staticRenderFns$a, false, __vue2_injectStyles$a, "3f69c61c", null, null);
1314
+ function __vue2_injectStyles$a(context) {
1315
+ for (let o in __cssModules$a) {
1316
+ this[o] = __cssModules$a[o];
1317
+ }
1318
+ }
1319
+ var AssigneeTag = /* @__PURE__ */ function() {
1320
+ return __component__$a.exports;
1321
+ }();
1322
+ var __vue2_script$9 = defineComponent({
1323
+ name: "index",
1324
+ components: {
1325
+ AntTooltip: Tooltip
1326
+ },
1327
+ props: {
1328
+ placement: {
1329
+ type: String,
1330
+ default: "left"
1331
+ },
1332
+ tags: {
1333
+ type: Array
1334
+ },
1335
+ maxWidth: {
1336
+ type: Number,
1337
+ default: 100
1338
+ }
1339
+ }
1340
+ });
1341
+ var render$9 = function() {
1342
+ var _vm = this;
1343
+ var _h = _vm.$createElement;
1344
+ var _c = _vm._self._c || _h;
1345
+ return _c("ant-tooltip", { attrs: { "placement": _vm.placement, "title": _vm.tags ? _vm.tags.join(", ") : "-" } }, [_c("div", { staticClass: "tags-container", style: "max-width:" + _vm.maxWidth + "px" }, [_c("span", [_vm._v(_vm._s(_vm.tags ? _vm.tags.join(", ") : "-"))])])]);
1346
+ };
1347
+ var staticRenderFns$9 = [];
1348
+ var index_vue_vue_type_style_index_0_scoped_true_lang$4 = "";
1349
+ const __cssModules$9 = {};
1350
+ var __component__$9 = /* @__PURE__ */ normalizeComponent(__vue2_script$9, render$9, staticRenderFns$9, false, __vue2_injectStyles$9, "18554545", null, null);
1351
+ function __vue2_injectStyles$9(context) {
1352
+ for (let o in __cssModules$9) {
1353
+ this[o] = __cssModules$9[o];
1354
+ }
1355
+ }
1356
+ var TagsWithTooltip = /* @__PURE__ */ function() {
1357
+ return __component__$9.exports;
1358
+ }();
1359
+ var TaskTypes;
1360
+ (function(TaskTypes2) {
1361
+ TaskTypes2["clientUpload"] = "Client Upload";
1362
+ TaskTypes2["clientReview"] = "For Client Review";
1363
+ TaskTypes2["worksheet"] = "Worksheet";
1364
+ })(TaskTypes || (TaskTypes = {}));
1365
+ var StepType;
1366
+ (function(StepType2) {
1367
+ StepType2["worksheetForEmployeeEmployer"] = "WORKSHEET_FOR_EMPLOYEE_EMPLOYER";
1368
+ StepType2["beneficiary"] = "BENEFICIARY";
1369
+ StepType2["petitioner"] = "PETITIONER";
1370
+ StepType2["billing"] = "BILLING";
1371
+ StepType2["overseas"] = "OVERSEAS";
1372
+ StepType2["supplement"] = "SUPPLEMENT";
1373
+ StepType2["worksheetForAttorney"] = "WORKSHEET_FOR_ATTORNEY";
1374
+ StepType2["counterReviewAndSign"] = "COUNTER_REVIEW_AND_SIGN";
1375
+ StepType2["attorney"] = "ATTORNEY";
1376
+ })(StepType || (StepType = {}));
1377
+ var TaskTemplateSortBy;
1378
+ (function(TaskTemplateSortBy2) {
1379
+ TaskTemplateSortBy2["default"] = "DEFAULT";
1380
+ TaskTemplateSortBy2["id"] = "TASKTEMPLATEID";
1381
+ TaskTemplateSortBy2["name"] = "TASKNAME";
1382
+ TaskTemplateSortBy2["type"] = "TASKTYPE";
1383
+ TaskTemplateSortBy2["isEmployee"] = "ISEMPLOYEE";
1384
+ })(TaskTemplateSortBy || (TaskTemplateSortBy = {}));
1385
+ var useChangeVal = (props, emit) => (k, v) => {
1386
+ console.log(k, v);
1387
+ emit("update:value", __spreadProps(__spreadValues({}, props.value), {
1388
+ [k]: v
1389
+ }));
1390
+ };
1391
+ var refactorParams = (record) => {
1392
+ var _a;
1393
+ return {
1394
+ id: record.id,
1395
+ sampleDocList: ((_a = record.sampleDocs) == null ? void 0 : _a.map(({ id }) => id)) || [],
1396
+ taskName: record.taskName,
1397
+ isEmployee: record.isEmployee || AssigneeTypes[AssigneeTypes.EMPTY_DEFAULT],
1398
+ generalTaskType: record.generalTaskType,
1399
+ descriptions: record.descriptions,
1400
+ tagList: record.tagList
1401
+ };
1402
+ };
1403
+ const roles = [
1404
+ {
1405
+ id: AssigneeTypes.BENEFICIARY,
1406
+ key: "BENEFICIARY",
1407
+ i18nKey: "beneficiary"
1408
+ },
1409
+ {
1410
+ id: AssigneeTypes.PETITIONER,
1411
+ key: "PETITIONER",
1412
+ i18nKey: "petitioner"
1413
+ },
1414
+ {
1415
+ id: AssigneeTypes.ATTORNEY,
1416
+ key: "ATTORNEY",
1417
+ i18nKey: "attorney"
1418
+ },
1419
+ {
1420
+ id: AssigneeTypes.EMPTY_DEFAULT,
1421
+ key: "EMPTY_DEFAULT",
1422
+ i18nKey: "none",
1423
+ hide: true
1424
+ }
1425
+ ];
1426
+ var __vue2_script$8 = defineComponent({
1427
+ name: "index",
1428
+ components: {
1429
+ AntForm: Form,
1430
+ AntFormItem: Form.Item,
1431
+ AntRow: Row,
1432
+ AntCol: Col,
1433
+ AntSelect: Select,
1434
+ AntSelectOption: Select.Option,
1435
+ AntRadioGroup: Radio.Group,
1436
+ AntRadio: Radio,
1437
+ AntTextarea: Input.TextArea,
1438
+ AntInput: Input,
1439
+ AFileUploader
1440
+ },
1441
+ props: {
1442
+ value: {
1443
+ type: Object,
1444
+ required: true
1445
+ },
1446
+ uploadFilesFunc: {
1447
+ type: Function,
1448
+ required: true
1449
+ },
1450
+ disabled: {
1451
+ type: Boolean
1452
+ }
1453
+ },
1454
+ setup(props, { emit }) {
1455
+ const nameError = ref(false);
1456
+ const typeError = ref(false);
1457
+ const nameErrorContent = ref("message.required");
1458
+ const changeVal = useChangeVal(props, emit);
1459
+ const validFields = (callback) => {
1460
+ var _a;
1461
+ const data = refactorParams(props.value);
1462
+ if (!data.taskName) {
1463
+ nameError.value = true;
1464
+ nameErrorContent.value = "message.required";
1465
+ } else if (((_a = data.taskName) == null ? void 0 : _a.length) > 150) {
1466
+ nameError.value = true;
1467
+ nameErrorContent.value = "message.moreThan150";
1468
+ }
1469
+ typeError.value = !data.generalTaskType;
1470
+ callback(!nameError.value && !typeError.value, data, {
1471
+ nameError,
1472
+ typeError
1473
+ });
1474
+ };
1475
+ watch(() => props.value.taskName, (val) => {
1476
+ nameError.value = !val;
1477
+ });
1478
+ const isAttorneySelected = computed(() => props.value.isEmployee === AssigneeTypes[AssigneeTypes.ATTORNEY]);
1479
+ watch(() => isAttorneySelected.value, (selected) => {
1480
+ if (selected) {
1481
+ if (props.value.generalTaskType !== TaskTypes.worksheet) {
1482
+ changeVal("generalTaskType", TaskTypes.clientUpload);
1483
+ }
1484
+ }
1485
+ });
1486
+ return {
1487
+ typeError,
1488
+ nameError,
1489
+ changeVal,
1490
+ validFields,
1491
+ TaskTypes,
1492
+ roles,
1493
+ isAttorneySelected,
1494
+ nameErrorContent
1495
+ };
1496
+ }
1497
+ });
1498
+ var render$8 = function() {
1499
+ var _vm = this;
1500
+ var _h = _vm.$createElement;
1501
+ var _c = _vm._self._c || _h;
1502
+ return _c("ant-form", { staticClass: "add-edit-task-modal", on: { "submit": function(e) {
1503
+ return e.preventDefault();
1504
+ } } }, [_c("ant-row", { attrs: { "gutter": 20 } }, [_c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "required": "", "name": "taskName", "label": _vm.$t("message.taskName"), "help": _vm.nameError ? _vm.$t(_vm.nameErrorContent) : void 0, "validate-status": _vm.nameError ? "error" : void 0 } }, [_c("ant-input", { attrs: { "disabled": _vm.disabled, "value": _vm.value.taskName }, on: { "input": function($event) {
1505
+ return _vm.changeVal("taskName", $event.target.value);
1506
+ } } })], 1)], 1), _c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.assignee") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-select", { staticStyle: { "min-width": "170px" }, attrs: { "disabled": _vm.disabled, "value": _vm.value.isEmployee, "allowClear": true }, on: { "change": function($event) {
1507
+ return _vm.changeVal("isEmployee", $event);
1508
+ } } }, _vm._l(_vm.roles, function(role) {
1509
+ return _c("ant-select-option", { key: role.id, attrs: { "value": role.key } }, [_c("span", { staticStyle: { "text-transform": "capitalize" } }, [_vm._v(" " + _vm._s(_vm.$t("message." + role.i18nKey)) + " ")])]);
1510
+ }), 1)], 1)], 1)], 1), _c("ant-form-item", { attrs: { "required": "", "label": _vm.$t("message.type"), "help": _vm.typeError ? _vm.$t("message.required") : void 0, "validate-status": _vm.typeError ? "error" : void 0 } }, [_vm.value.generalTaskType !== _vm.TaskTypes.worksheet ? _c("ant-radio-group", { attrs: { "disabled": _vm.disabled, "value": _vm.value.generalTaskType }, on: { "change": function($event) {
1511
+ return _vm.changeVal("generalTaskType", $event.target.value);
1512
+ } } }, [_c("ant-radio", { attrs: { "value": _vm.TaskTypes.clientUpload } }, [_vm._v(" " + _vm._s(_vm.$t("message.clientUpload")) + " ")]), _c("ant-radio", { attrs: { "value": _vm.TaskTypes.clientReview, "disabled": _vm.isAttorneySelected } }, [_vm._v(" " + _vm._s(_vm.$t("message.clientReview")) + " ")])], 1) : _c("div", [_vm._v(_vm._s(_vm.$t("message.worksheet")))])], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.descriptions") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-textarea", { attrs: { "disabled": _vm.disabled, "value": _vm.value.descriptions }, on: { "input": function($event) {
1513
+ return _vm.changeVal("descriptions", $event.target.value);
1514
+ } } })], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.attachment") + " (" + _vm.$t("message.optional") + ")" } }, [_c("a-file-uploader", { attrs: { "disabled": _vm.disabled, "value": _vm.value.sampleDocs, "uploadFilesFunc": _vm.uploadFilesFunc }, on: { "change": function($event) {
1515
+ return _vm.changeVal("sampleDocs", $event);
1516
+ } } })], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.tags") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-select", { attrs: { "disabled": _vm.disabled, "mode": "tags", "value": _vm.value.tagList || [], "options": [] }, on: { "change": function($event) {
1517
+ return _vm.changeVal("tagList", $event);
1518
+ } } })], 1)], 1);
1519
+ };
1520
+ var staticRenderFns$8 = [];
1521
+ var index_vue_vue_type_style_index_0_scoped_true_lang$3 = "";
1522
+ const __cssModules$8 = {};
1523
+ var __component__$8 = /* @__PURE__ */ normalizeComponent(__vue2_script$8, render$8, staticRenderFns$8, false, __vue2_injectStyles$8, "55282ee4", null, null);
1524
+ function __vue2_injectStyles$8(context) {
1525
+ for (let o in __cssModules$8) {
1526
+ this[o] = __cssModules$8[o];
1527
+ }
1528
+ }
1529
+ var TaskForm = /* @__PURE__ */ function() {
1530
+ return __component__$8.exports;
1531
+ }();
1532
+ var __vue2_script$7 = defineComponent({
1533
+ name: "NewTask",
1534
+ components: {
1535
+ AFileUploader,
1536
+ TaskForm,
1537
+ AntModal: Modal,
1538
+ AntCheckbox: Checkbox,
1539
+ AntButton: Button,
1540
+ AntPopconfirm: Popconfirm
1541
+ },
1542
+ props: {
1543
+ visible: {
1544
+ type: Boolean,
1545
+ default: false
1546
+ },
1547
+ value: {
1548
+ type: Object,
1549
+ required: true
1550
+ },
1551
+ showSendEmail: {
1552
+ type: Boolean,
1553
+ default: false
1554
+ },
1555
+ showAddToList: {
1556
+ type: Boolean,
1557
+ default: false
1558
+ },
1559
+ uploadFilesFunc: {
1560
+ type: Function,
1561
+ required: true
1562
+ },
1563
+ userId: {
1564
+ type: String,
1565
+ required: true
1566
+ },
1567
+ lawFirmId: {
1568
+ type: Number,
1569
+ required: true
1570
+ },
1571
+ loading: {
1572
+ type: Boolean,
1573
+ default: false
1574
+ },
1575
+ hasDoubleConfirm: {
1576
+ type: Boolean,
1577
+ default: true
1578
+ }
1579
+ },
1580
+ setup(props, { emit }) {
1581
+ const taskForm = ref();
1582
+ const changeVisible = (visible) => {
1583
+ emit("update:visible", visible);
1584
+ };
1585
+ const nameError = ref(false);
1586
+ const typeError = ref(false);
1587
+ const changeVal = useChangeVal(props, emit);
1588
+ const submit2 = () => {
1589
+ taskForm.value.validFields((passed, ts) => {
1590
+ if (passed) {
1591
+ const data = {
1592
+ taskTemplateObj: __spreadProps(__spreadValues({}, ts), {
1593
+ taskType: props.value.taskTemplateObj.taskType,
1594
+ tagList: ts.tagList || [],
1595
+ descriptions: ts.descriptions || ""
1596
+ }),
1597
+ selfUserId: props.userId,
1598
+ selfLawFirmId: props.lawFirmId,
1599
+ taskTemplateId: ts.id,
1600
+ isAddedToTask: props.value.isAddedToTask || false,
1601
+ isNotified: props.value.isNotified || false
1602
+ };
1603
+ emit("submit", data);
1604
+ }
1605
+ });
1606
+ };
1607
+ const updateFormValue = (record) => {
1608
+ const data = {
1609
+ taskTemplateId: record.id,
1610
+ selfUserId: props.userId,
1611
+ selfLawFirmId: props.lawFirmId,
1612
+ isAddedToTask: props.value.isAddedToTask,
1613
+ isNotified: props.value.isNotified,
1614
+ taskTemplateObj: __spreadProps(__spreadValues({}, record), {
1615
+ isEmployee: record.isEmployee
1616
+ })
1617
+ };
1618
+ emit("update:value", data);
1619
+ };
1620
+ return {
1621
+ submit: submit2,
1622
+ taskForm,
1623
+ changeVisible,
1624
+ changeVal,
1625
+ AFileUploader,
1626
+ TaskTypes,
1627
+ nameError,
1628
+ typeError,
1629
+ updateFormValue
1630
+ };
1631
+ }
1632
+ });
1633
+ var render$7 = function() {
1634
+ var _vm = this;
1635
+ var _h = _vm.$createElement;
1636
+ var _c = _vm._self._c || _h;
1637
+ return _c("ant-modal", { attrs: { "id": "venus-component-new-task", "visible": _vm.visible, "title": _vm.value.taskTemplateObj.id ? _vm.$t("message.editTask") : _vm.$t("message.newTask"), "width": "700px" }, on: { "cancel": function($event) {
1638
+ return _vm.changeVisible(false);
1639
+ } }, scopedSlots: _vm._u([{ key: "footer", fn: function() {
1640
+ return [_c("div", { staticClass: "footer" }, [_vm.showSendEmail ? _c("div", { staticStyle: { "float": "left", "padding-top": "5px", "padding-left": "10px" } }, [_c("ant-checkbox", { attrs: { "checked": _vm.value.isNotified }, on: { "change": function($event) {
1641
+ return _vm.changeVal("isNotified", $event.target.checked);
1642
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.sendTaskEmail")) + " ")])], 1) : _vm._e(), _c("div", [_vm.hasDoubleConfirm ? _c("ant-popconfirm", { attrs: { "title": _vm.$t("message.updateTaskConfirm"), "placement": "top" }, on: { "confirm": _vm.submit } }, [_c("ant-button", { attrs: { "loading": _vm.loading, "type": "primary" } }, [_vm._v(_vm._s(_vm.$t("message.submit")) + " ")])], 1) : _c("ant-button", { attrs: { "loading": _vm.loading, "type": "primary" }, on: { "click": _vm.submit } }, [_vm._v(_vm._s(_vm.$t("message.submit")) + " ")]), _c("ant-button", { on: { "click": function($event) {
1643
+ return _vm.changeVisible(false);
1644
+ } } }, [_vm._v(_vm._s(_vm.$t("message.cancel")) + " ")])], 1)])];
1645
+ }, proxy: true }]) }, [_c("task-form", { ref: "taskForm", attrs: { "upload-files-func": _vm.uploadFilesFunc, "law-firm-id": _vm.lawFirmId, "user-id": _vm.userId, "value": _vm.value.taskTemplateObj }, on: { "update:value": _vm.updateFormValue } }), _vm.showAddToList ? _c("ant-checkbox", { attrs: { "checked": _vm.value.isAddedToTask }, on: { "change": function($event) {
1646
+ return _vm.changeVal("isAddedToTask", $event.target.checked);
1647
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.addToTaskList")) + " ")]) : _vm._e()], 1);
1648
+ };
1649
+ var staticRenderFns$7 = [];
1650
+ var index_vue_vue_type_style_index_0_scoped_true_lang$2 = "";
1651
+ const __cssModules$7 = {};
1652
+ var __component__$7 = /* @__PURE__ */ normalizeComponent(__vue2_script$7, render$7, staticRenderFns$7, false, __vue2_injectStyles$7, "554f679c", null, null);
1653
+ function __vue2_injectStyles$7(context) {
1654
+ for (let o in __cssModules$7) {
1655
+ this[o] = __cssModules$7[o];
1656
+ }
1657
+ }
1658
+ var NewTask = /* @__PURE__ */ function() {
1659
+ return __component__$7.exports;
1660
+ }();
1661
+ var __vue2_script$6 = defineComponent({
1662
+ name: "taskTemplateFilter",
1663
+ components: {
1664
+ AntInput: Input,
1665
+ AntButton: Button,
1666
+ AntCheckbox: Checkbox,
1667
+ AntCheckboxGroup: Checkbox.Group
1668
+ },
1669
+ props: {
1670
+ conditions: {
1671
+ type: Object,
1672
+ required: true
1673
+ },
1674
+ showTaskSettingLink: {
1675
+ type: Boolean,
1676
+ default: true
1677
+ },
1678
+ inline: {
1679
+ type: Boolean,
1680
+ default: false
1681
+ },
1682
+ width: {
1683
+ type: Number,
1684
+ default: 300
1685
+ },
1686
+ showNewBtn: {
1687
+ type: Boolean,
1688
+ default: true
1689
+ }
1690
+ },
1691
+ setup(props, { emit }) {
1692
+ const changeVal = (key, val) => {
1693
+ const data = __spreadProps(__spreadValues({}, props.conditions), {
1694
+ [key]: val
1695
+ });
1696
+ if (key === "isEmployee" && val.length === 0) {
1697
+ data.isEmployee = [AssigneeTypes.EMPTY_DEFAULT];
1698
+ }
1699
+ emit("update:conditions", data);
1700
+ };
1701
+ return {
1702
+ AssigneeTypes,
1703
+ changeVal
1704
+ };
1705
+ }
1706
+ });
1707
+ var render$6 = function() {
1708
+ var _vm = this;
1709
+ var _h = _vm.$createElement;
1710
+ var _c = _vm._self._c || _h;
1711
+ return _c("div", { staticClass: "filter mb-5" }, [_c("ant-input", { style: "width:" + _vm.width + "px", attrs: { "value": _vm.conditions.keywords, "placeholder": _vm.$t("message.searchTaskPlaceholder") }, on: { "input": function($event) {
1712
+ return _vm.changeVal("keywords", $event.target.value);
1713
+ } }, scopedSlots: _vm._u([{ key: "suffix", fn: function() {
1714
+ return void 0;
1715
+ }, proxy: true }]) }), _vm.showNewBtn ? _c("ant-button", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "margin-left": "20px", "float": "right" }, on: { "click": function($event) {
1716
+ return _vm.$emit("update:newTaskVisible", true);
1717
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.newTask")) + " ")]) : _vm._e(), _vm.showTaskSettingLink ? _c("a", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "float": "right", "margin-top": "5px", "color": "dodgerblue !important" }, attrs: { "href": "/task-templates", "target": "_blank" } }, [_vm._v(" " + _vm._s(_vm.$t("message.taskSetting")) + " ")]) : _vm._e(), _c("div", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "margin-top": "20px" } }, [_c("ant-checkbox-group", { attrs: { "value": _vm.conditions.isEmployee }, on: { "change": function($event) {
1718
+ return _vm.changeVal("isEmployee", $event);
1719
+ } } }, [_c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.ATTORNEY } }, [_vm._v(_vm._s(_vm.$t("message.attorney")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.BENEFICIARY } }, [_vm._v(_vm._s(_vm.$t("message.beneficiary")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.PETITIONER } }, [_vm._v(_vm._s(_vm.$t("message.petitioner")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.EMPTY_DEFAULT } }, [_vm._v(_vm._s(_vm.$t("message.none")) + " ")])], 1)], 1)], 1);
1720
+ };
1721
+ var staticRenderFns$6 = [];
1722
+ var index_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
1723
+ const __cssModules$6 = {};
1724
+ var __component__$6 = /* @__PURE__ */ normalizeComponent(__vue2_script$6, render$6, staticRenderFns$6, false, __vue2_injectStyles$6, "c5d917d8", null, null);
1725
+ function __vue2_injectStyles$6(context) {
1726
+ for (let o in __cssModules$6) {
1727
+ this[o] = __cssModules$6[o];
1728
+ }
1729
+ }
1730
+ var TaskTemplateFilter = /* @__PURE__ */ function() {
1731
+ return __component__$6.exports;
1732
+ }();
1733
+ function useVm() {
1734
+ const scope = getCurrentScope();
1735
+ return scope.vm;
1736
+ }
1737
+ function useT() {
1738
+ const vm = useVm();
1739
+ return (key) => vm.$i18n.t(key);
1740
+ }
1741
+ var __vue2_script$5 = defineComponent({
1742
+ name: "TaskTablePure",
1743
+ components: {
1744
+ AntTable: Table,
1745
+ AntButton: Button,
1746
+ AssigneeTag,
1747
+ TagsWithTooltip
1748
+ },
1749
+ props: {
1750
+ addedTasks: {
1751
+ type: Array,
1752
+ required: true
1753
+ },
1754
+ dataSource: {
1755
+ type: Array,
1756
+ required: true
1757
+ },
1758
+ loading: {
1759
+ type: Boolean,
1760
+ default: false
1761
+ },
1762
+ pagination: {
1763
+ type: Object,
1764
+ required: true
1765
+ },
1766
+ noEdit: {
1767
+ type: Boolean,
1768
+ default: false
1769
+ },
1770
+ showEdit: {
1771
+ type: Boolean,
1772
+ default: true
1773
+ }
1774
+ },
1775
+ setup(props) {
1776
+ const { addedTasks } = toRefs(props);
1777
+ const t = useT();
1778
+ const columns = [
1779
+ {
1780
+ title: t("message.taskName"),
1781
+ dataIndex: "taskName",
1782
+ key: "taskName",
1783
+ scopedSlots: { customRender: "taskName" }
1784
+ },
1785
+ {
1786
+ title: t("message.assignee"),
1787
+ dataIndex: "isEmployee",
1788
+ key: "isEmployee",
1789
+ width: 120,
1790
+ scopedSlots: { customRender: "isEmployee" }
1791
+ },
1792
+ {
1793
+ title: t("message.tag"),
1794
+ dataIndex: "tagList",
1795
+ key: "tagList",
1796
+ width: 120,
1797
+ scopedSlots: { customRender: "tagList" }
1798
+ },
1799
+ {
1800
+ title: "Operation",
1801
+ dataIndex: "id",
1802
+ key: "id",
1803
+ width: 210,
1804
+ scopedSlots: { customRender: "operation" }
1805
+ }
1806
+ ];
1807
+ const isTemplateAdded = (record) => addedTasks.value.some((added) => added.id === record.id);
1808
+ return {
1809
+ isTemplateAdded,
1810
+ columns
1811
+ };
1812
+ }
1813
+ });
1814
+ var render$5 = function() {
1815
+ var _vm = this;
1816
+ var _h = _vm.$createElement;
1817
+ var _c = _vm._self._c || _h;
1818
+ return _c("div", [_c("ant-table", { attrs: { "size": "middle", "dataSource": _vm.dataSource, "rowKey": "id", "columns": _vm.columns, "pagination": _vm.pagination, "loading": _vm.loading }, on: { "change": function($event) {
1819
+ return _vm.$emit("changePagination", $event);
1820
+ } }, scopedSlots: _vm._u([{ key: "isEmployee", fn: function(isEmployee) {
1821
+ return _c("span", {}, [_c("assignee-tag", { attrs: { "assignee-type": isEmployee } })], 1);
1822
+ } }, { key: "taskName", fn: function(taskName) {
1823
+ return _c("span", {}, [_c("span", { staticStyle: { "word-break": "break-word" } }, [_vm._v(_vm._s(taskName))])]);
1824
+ } }, { key: "tagList", fn: function(tags) {
1825
+ return [_c("tags-with-tooltip", { attrs: { "tags": tags } })];
1826
+ } }, { key: "operation", fn: function(_, record) {
1827
+ return [record.isGallery ? _c("span", { staticStyle: { "width": "82px", "display": "inline-block", "color": "#999" } }, [_vm._v(" Preset ")]) : _vm.showEdit ? _c("ant-button", { staticClass: "mr-2", attrs: { "disabled": _vm.isTemplateAdded(record), "size": "small" }, on: { "click": function($event) {
1828
+ return _vm.$emit("editTask", record);
1829
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.editTask")) + " ")]) : _vm._e(), _vm.isTemplateAdded(record) ? _c("ant-button", { staticStyle: { "width": "70px" }, attrs: { "size": "small", "type": "danger" }, on: { "click": function($event) {
1830
+ return _vm.$emit("removeTask", record);
1831
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.remove")) + " ")]) : _c("ant-button", { staticStyle: { "width": "70px" }, attrs: { "size": "small", "type": "primary" }, on: { "click": function($event) {
1832
+ return _vm.$emit("addTask", record);
1833
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.add")) + " ")])];
1834
+ } }]) })], 1);
1835
+ };
1836
+ var staticRenderFns$5 = [];
1837
+ var TaskTablePure_vue_vue_type_style_index_0_scoped_true_lang = "";
1838
+ const __cssModules$5 = {};
1839
+ var __component__$5 = /* @__PURE__ */ normalizeComponent(__vue2_script$5, render$5, staticRenderFns$5, false, __vue2_injectStyles$5, "3272d34e", null, null);
1840
+ function __vue2_injectStyles$5(context) {
1841
+ for (let o in __cssModules$5) {
1842
+ this[o] = __cssModules$5[o];
1843
+ }
1844
+ }
1845
+ var TaskTablePure = /* @__PURE__ */ function() {
1846
+ return __component__$5.exports;
1847
+ }();
1848
+ var useSearchTaskTemplates = (pagination, conditions = ref({}), lawFirmId, withGallery = true) => {
1849
+ const startIndex = computed(() => (pagination.value.current - 1) * pagination.value.pageSize);
1850
+ const endIndex = computed(() => startIndex.value + pagination.value.pageSize);
1851
+ watch(() => conditions.value, () => {
1852
+ pagination.value.current = 1;
1853
+ pagination.value.total = 0;
1854
+ });
1855
+ return useQuery(SearchTaskTemplatesQuery, () => ({
1856
+ query: {
1857
+ includeGallery: withGallery,
1858
+ keywords: conditions.value.keywords || "",
1859
+ isEmployee: conditions.value.isEmployee,
1860
+ taskTemplateId: conditions.value.taskTemplateId,
1861
+ sortBy: TaskTemplateSortBy.name,
1862
+ sortOrder: SortOrder.asc
1863
+ },
1864
+ startIndex: startIndex.value,
1865
+ endIndex: endIndex.value,
1866
+ lawFirmId
1867
+ }));
1868
+ };
1869
+ const taskTemplateFragment = gql`
1870
+ fragment taskTemplate on TaskTemplate {
1871
+ id
1872
+ taskName
1873
+ tagList
1874
+ isEmployee
1875
+ taskType
1876
+ generalTaskType
1877
+ descriptions
1878
+ sampleDocs {
1879
+ id
1880
+ name
1881
+ link
1882
+ }
1883
+ sampleDocList
1884
+ updatedUser{
1885
+ id
1886
+ name
1887
+ }
1888
+ updatedOn
1889
+ }
1890
+ `;
1891
+ const SearchTaskTemplatesQuery = gql`
1892
+ query taskTemplateSearch(
1893
+ $query: TaskTemplateFilterInput!
1894
+ $startIndex: Int
1895
+ $endIndex: Int
1896
+ $lawFirmId: Int!
1897
+ ) {
1898
+ taskTemplateSearch(query: $query) {
1899
+ numResult
1900
+ taskTemplateList(startIndex: $startIndex, endIndex: $endIndex) {
1901
+ ...taskTemplate
1902
+ isGallery(selfLawFirmId: $lawFirmId)
1903
+ }
1904
+ }
1905
+ }
1906
+ ${taskTemplateFragment}
1907
+ `;
1908
+ var useTaskActions = (addedTasks, emit) => {
1909
+ const addTask = (record) => emit("update:addedTasks", [...addedTasks.value, record]);
1910
+ const editTask = (record) => {
1911
+ const taskToAdd = {
1912
+ taskTemplateObj: record
1913
+ };
1914
+ emit("editTask", taskToAdd);
1915
+ };
1916
+ const removeTask = (record) => emit("update:addedTasks", addedTasks.value.filter(({ id }) => id !== record.id));
1917
+ return {
1918
+ addTask,
1919
+ editTask,
1920
+ removeTask
1921
+ };
1922
+ };
1923
+ var useSearchTaskConditions = () => ref({
1924
+ keywords: "",
1925
+ isEmployee: [
1926
+ AssigneeTypes.ATTORNEY,
1927
+ AssigneeTypes.PETITIONER,
1928
+ AssigneeTypes.BENEFICIARY,
1929
+ AssigneeTypes.EMPTY_DEFAULT
1930
+ ]
1931
+ });
1932
+ var useTaskTemplateTableData = (props, emit) => {
1933
+ const initialPagination = ref({
1934
+ current: 1,
1935
+ pageSize: props.pageSize || 10,
1936
+ total: 0
1937
+ });
1938
+ const { conditions = useSearchTaskConditions(), addedTasks = ref([]) } = toRefs(props);
1939
+ const { result, loading, variables } = useSearchTaskTemplates(initialPagination, conditions, props.lawFirmId, props.withGallery);
1940
+ const dataSource = computed(() => {
1941
+ var _a;
1942
+ return ((_a = result.value) == null ? void 0 : _a.taskTemplateSearch.taskTemplateList) || [];
1943
+ });
1944
+ const total = computed(() => {
1945
+ var _a;
1946
+ return ((_a = result.value) == null ? void 0 : _a.taskTemplateSearch.numResult) || 0;
1947
+ });
1948
+ const pagination = computed(() => __spreadProps(__spreadValues({}, initialPagination.value), {
1949
+ total: total.value
1950
+ }));
1951
+ const changePagination = (pagination2) => {
1952
+ initialPagination.value = __spreadValues({}, pagination2);
1953
+ };
1954
+ const { addTask, editTask, removeTask } = useTaskActions(addedTasks, emit);
1955
+ return {
1956
+ addTask,
1957
+ editTask,
1958
+ removeTask,
1959
+ changePagination,
1960
+ pagination,
1961
+ dataSource,
1962
+ result,
1963
+ loading,
1964
+ conditions,
1965
+ addedTasks,
1966
+ variables
1967
+ };
1968
+ };
1969
+ var __vue2_script$4 = defineComponent({
1970
+ name: "TaskTable",
1971
+ components: {
1972
+ TaskTablePure
1973
+ },
1974
+ props: {
1975
+ conditions: {
1976
+ type: Object,
1977
+ required: true
1978
+ },
1979
+ addedTasks: {
1980
+ type: Array,
1981
+ default: () => []
1982
+ },
1983
+ lawFirmId: {
1984
+ type: Number,
1985
+ required: true
1986
+ },
1987
+ pageSize: {
1988
+ type: Number
1989
+ },
1990
+ withGallery: {
1991
+ type: Boolean,
1992
+ default: true
1993
+ }
1994
+ },
1995
+ setup(props, { emit }) {
1996
+ const {
1997
+ loading,
1998
+ dataSource,
1999
+ pagination,
2000
+ variables,
2001
+ changePagination,
2002
+ addTask,
2003
+ editTask,
2004
+ removeTask
2005
+ } = useTaskTemplateTableData(props, emit);
2006
+ return {
2007
+ loading,
2008
+ dataSource,
2009
+ pagination,
2010
+ AssigneeTypesText,
2011
+ changePagination,
2012
+ addTask,
2013
+ editTask,
2014
+ removeTask,
2015
+ variables
2016
+ };
2017
+ }
2018
+ });
2019
+ var render$4 = function() {
2020
+ var _vm = this;
2021
+ var _h = _vm.$createElement;
2022
+ var _c = _vm._self._c || _h;
2023
+ return _c("div", [_vm._t("default", function() {
2024
+ return [_c("task-table-pure", { attrs: { "loading": _vm.loading, "data-source": _vm.dataSource, "pagination": _vm.pagination, "added-tasks": _vm.addedTasks }, on: { "editTask": _vm.editTask, "addTask": _vm.addTask, "removeTask": _vm.removeTask, "changePagination": _vm.changePagination } })];
2025
+ }, { "loading": _vm.loading, "dataSource": _vm.dataSource, "pagination": _vm.pagination, "AssigneeTypesText": _vm.AssigneeTypesText, "changePagination": _vm.changePagination })], 2);
2026
+ };
2027
+ var staticRenderFns$4 = [];
2028
+ var TaskTable_vue_vue_type_style_index_0_scoped_true_lang = "";
2029
+ const __cssModules$4 = {};
2030
+ var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$4, staticRenderFns$4, false, __vue2_injectStyles$4, "6662fabb", null, null);
2031
+ function __vue2_injectStyles$4(context) {
2032
+ for (let o in __cssModules$4) {
2033
+ this[o] = __cssModules$4[o];
2034
+ }
2035
+ }
2036
+ var TaskTable = /* @__PURE__ */ function() {
2037
+ return __component__$4.exports;
2038
+ }();
2039
+ var __vue2_script$3 = defineComponent({
2040
+ name: "MainModal",
2041
+ components: {
2042
+ TaskTable,
2043
+ TaskTemplateFilter,
2044
+ AntButton: Button,
2045
+ AntBadge: Badge
2046
+ },
2047
+ props: {
2048
+ visible: {
2049
+ type: Boolean,
2050
+ default: false
2051
+ },
2052
+ addedTasks: {
2053
+ type: Array
2054
+ },
2055
+ lawFirmId: {
2056
+ type: Number,
2057
+ required: true
2058
+ },
2059
+ showTaskSettingLink: {
2060
+ type: Boolean,
2061
+ default: true
2062
+ },
2063
+ showPage: {
2064
+ type: Boolean,
2065
+ default: false
2066
+ },
2067
+ pageSize: {
2068
+ type: Number
2069
+ },
2070
+ openReviewButtonText: {
2071
+ type: String,
2072
+ default: "Review and add to template"
2073
+ },
2074
+ withGallery: {
2075
+ type: Boolean,
2076
+ default: true
2077
+ },
2078
+ showNewBtn: {
2079
+ type: Boolean,
2080
+ default: true
2081
+ }
2082
+ },
2083
+ setup(props, { emit }) {
2084
+ const taskTable = ref();
2085
+ const conditions = useSearchTaskConditions();
2086
+ const currentComponent = shallowRef(props.showPage ? Card : Modal);
2087
+ const editAction = (record) => {
2088
+ emit("editTask", record);
2089
+ };
2090
+ const getVariables = () => taskTable.value.variables;
2091
+ return {
2092
+ editAction,
2093
+ getVariables,
2094
+ taskTable,
2095
+ conditions,
2096
+ AssigneeTypes,
2097
+ currentComponent
2098
+ };
2099
+ }
2100
+ });
2101
+ var render$3 = function() {
2102
+ var _vm = this;
2103
+ var _h = _vm.$createElement;
2104
+ var _c = _vm._self._c || _h;
2105
+ return _c(_vm.currentComponent, { tag: "component", staticClass: "task-cart-main-modal", attrs: { "zIndex": 800, "width": 900, "visible": _vm.visible, "title": _vm.showPage ? _vm.$t("message.tasks") : _vm.$t("message.addTask") }, on: { "cancel": function($event) {
2106
+ return _vm.$emit("update:visible", false);
2107
+ } }, scopedSlots: _vm._u([{ key: "footer", fn: function() {
2108
+ return [_c("ant-button", { staticStyle: { "margin-right": "20px" }, on: { "click": function($event) {
2109
+ return _vm.$emit("update:visible", false);
2110
+ } } }, [_vm._v("Cancel ")]), _c("ant-badge", { attrs: { "count": _vm.addedTasks.length } }, [_c("ant-button", { attrs: { "disabled": _vm.addedTasks.length === 0, "type": "primary" }, on: { "click": function($event) {
2111
+ return _vm.$emit("update:reviewModalVisible", true);
2112
+ } } }, [_vm._v(" " + _vm._s(_vm.openReviewButtonText) + " ")])], 1)];
2113
+ }, proxy: true }]) }, [_c("task-template-filter", { attrs: { "show-task-home-page-link": true, "show-task-setting-link": _vm.showTaskSettingLink, "conditions": _vm.conditions, "inline": !!_vm.showPage, "show-new-btn": _vm.showNewBtn }, on: { "update:conditions": function($event) {
2114
+ _vm.conditions = $event;
2115
+ }, "update:newTaskVisible": function($event) {
2116
+ return _vm.$emit("update:newTaskVisible", true);
2117
+ } } }), _c("task-table", { ref: "taskTable", attrs: { "conditions": _vm.conditions, "added-tasks": _vm.addedTasks, "law-firm-id": _vm.lawFirmId, "page-size": _vm.pageSize, "with-gallery": _vm.withGallery }, on: { "update:addedTasks": function($event) {
2118
+ return _vm.$emit("update:addedTasks", $event);
2119
+ }, "editTask": function($event) {
2120
+ return _vm.$emit("editTask", $event);
2121
+ } }, scopedSlots: _vm._u([{ key: "default", fn: function(ref2) {
2122
+ var loading = ref2.loading;
2123
+ var dataSource = ref2.dataSource;
2124
+ var pagination = ref2.pagination;
2125
+ var changePagination = ref2.changePagination;
2126
+ return [_vm._t("default", null, { "editAction": _vm.editAction, "loading": loading, "dataSource": dataSource, "pagination": pagination, "changePagination": changePagination })];
2127
+ } }], null, true) })], 1);
2128
+ };
2129
+ var staticRenderFns$3 = [];
2130
+ var MainModal_vue_vue_type_style_index_0_scoped_true_lang = "";
2131
+ const __cssModules$3 = {};
2132
+ var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, render$3, staticRenderFns$3, false, __vue2_injectStyles$3, "68bc0589", null, null);
2133
+ function __vue2_injectStyles$3(context) {
2134
+ for (let o in __cssModules$3) {
2135
+ this[o] = __cssModules$3[o];
2136
+ }
2137
+ }
2138
+ var MainModal = /* @__PURE__ */ function() {
2139
+ return __component__$3.exports;
2140
+ }();
2141
+ var __vue2_script$2 = defineComponent({
2142
+ name: "ReviewModal",
2143
+ components: {
2144
+ TaskTablePure,
2145
+ AntModal: Modal,
2146
+ AntCheckbox: Checkbox,
2147
+ AntButton: Button
2148
+ },
2149
+ props: {
2150
+ visible: {
2151
+ type: Boolean,
2152
+ default: false
2153
+ },
2154
+ addedTasks: {
2155
+ type: Array,
2156
+ default: () => []
2157
+ },
2158
+ reviewText: {
2159
+ type: String,
2160
+ required: true
2161
+ },
2162
+ sendEmail: {
2163
+ type: Boolean,
2164
+ default: false
2165
+ },
2166
+ showSendEmail: {
2167
+ type: Boolean,
2168
+ default: false
2169
+ },
2170
+ allowClear: {
2171
+ type: Boolean,
2172
+ default: false
2173
+ },
2174
+ adding: {
2175
+ type: Boolean,
2176
+ default: false
2177
+ }
2178
+ },
2179
+ setup(props, { emit }) {
2180
+ const { addedTasks } = toRefs(props);
2181
+ const pagination = ref({
2182
+ total: addedTasks.value.length,
2183
+ current: 1,
2184
+ pageSize: 10
2185
+ });
2186
+ const changePagination = (newPagination) => {
2187
+ pagination.value = newPagination;
2188
+ };
2189
+ const { addTask, editTask, removeTask } = useTaskActions(addedTasks, emit);
2190
+ return {
2191
+ addTask,
2192
+ editTask,
2193
+ removeTask,
2194
+ pagination,
2195
+ changePagination
2196
+ };
2197
+ }
2198
+ });
2199
+ var render$2 = function() {
2200
+ var _vm = this;
2201
+ var _h = _vm.$createElement;
2202
+ var _c = _vm._self._c || _h;
2203
+ return _c("ant-modal", { attrs: { "zIndex": 900, "width": "900px", "visible": _vm.visible, "title": _vm.$t("message.reviewTasksTitle") }, on: { "cancel": function($event) {
2204
+ return _vm.$emit("update:visible", false);
2205
+ } } }, [_c("task-table-pure", { attrs: { "show-edit": false, "loading": false, "no-edit": true, "data-source": _vm.addedTasks, "pagination": _vm.pagination, "added-tasks": _vm.addedTasks }, on: { "removeTask": _vm.removeTask, "changePagination": _vm.changePagination } }), _c("div", { attrs: { "slot": "footer" }, slot: "footer" }, [_vm.showSendEmail ? _c("ant-checkbox", { staticStyle: { "float": "left" }, attrs: { "checked": _vm.sendEmail }, on: { "change": function($event) {
2206
+ return _vm.$emit("update:sendEmail", $event.target.checked);
2207
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.sendTaskEmail")) + " ")]) : _vm._e(), _c("ant-button", { on: { "click": function($event) {
2208
+ return _vm.$emit("update:visible", false);
2209
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.cancel")) + " ")]), _c("ant-button", { attrs: { "loading": _vm.adding, "type": "primary", "disabled": !_vm.addedTasks.length }, on: { "click": function($event) {
2210
+ _vm.$emit("submit", {
2211
+ addedTasks: _vm.addedTasks,
2212
+ addedTaskIds: _vm.addedTasks.map(function(ref2) {
2213
+ var id = ref2.id;
2214
+ return id;
2215
+ }),
2216
+ sendEmail: _vm.sendEmail
2217
+ });
2218
+ } } }, [_vm._v(" " + _vm._s(_vm.reviewText + "(" + _vm.addedTasks.length + ")") + " ")])], 1)], 1);
2219
+ };
2220
+ var staticRenderFns$2 = [];
2221
+ var ReviewModal_vue_vue_type_style_index_0_scoped_true_lang = "";
2222
+ const __cssModules$2 = {};
2223
+ var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, "315dcb1d", null, null);
2224
+ function __vue2_injectStyles$2(context) {
2225
+ for (let o in __cssModules$2) {
2226
+ this[o] = __cssModules$2[o];
2227
+ }
2228
+ }
2229
+ var ReviewModal = /* @__PURE__ */ function() {
2230
+ return __component__$2.exports;
2231
+ }();
2232
+ const useMutateTaskTemplate = () => useMutation(UpdateTaskTemplateMutation);
2233
+ const useCreateTaskTemplate = () => useMutation(CreateTaskTemplateMutation);
2234
+ const submit = async (record, updateTemplate, createTemplate) => {
2235
+ var _a, _b, _c, _d;
2236
+ let newRecord = {};
2237
+ let res;
2238
+ let success;
2239
+ const isUpdate = !!record.taskTemplateId;
2240
+ if (isUpdate) {
2241
+ res = await updateTemplate.mutate(record);
2242
+ newRecord = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.updateTaskTemplate.updatedTaskTemplate) || {};
2243
+ success = ((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.updateTaskTemplate.code) === ResponseCode.success;
2244
+ } else {
2245
+ res = await createTemplate.mutate(record);
2246
+ newRecord = ((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.createTaskTemplate.newTaskTemplate) || {};
2247
+ success = ((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.createTaskTemplate.code) === ResponseCode.success;
2248
+ }
2249
+ if (success) {
2250
+ message.success("Success!");
2251
+ } else {
2252
+ message.error("Failed!");
2253
+ }
2254
+ return {
2255
+ isUpdate,
2256
+ newRecord,
2257
+ success
2258
+ };
2259
+ };
2260
+ const UpdateTaskTemplateMutation = gql`
2261
+ mutation updateTaskTemplate(
2262
+ $selfUserId: Int!
2263
+ $selfLawFirmId: Int!
2264
+ $taskTemplateObj: TaskTemplateInput!
2265
+ $taskTemplateId: Int!
2266
+ ) {
2267
+ updateTaskTemplate(
2268
+ selfUserId: $selfUserId
2269
+ selfLawFirmId: $selfLawFirmId
2270
+ taskTemplateObj: $taskTemplateObj
2271
+ taskTemplateId: $taskTemplateId
2272
+ ) {
2273
+ code
2274
+ message
2275
+ updatedTaskTemplate {
2276
+ ...taskTemplate
2277
+ }
2278
+ }
2279
+ }
2280
+ ${taskTemplateFragment}
2281
+ `;
2282
+ const CreateTaskTemplateMutation = gql`
2283
+ mutation createTaskTemplate(
2284
+ $selfUserId: Int!
2285
+ $selfLawFirmId: Int!
2286
+ $taskTemplateObj: TaskTemplateInput!
2287
+ ) {
2288
+ createTaskTemplate(
2289
+ selfUserId: $selfUserId
2290
+ selfLawFirmId: $selfLawFirmId
2291
+ taskTemplateObj: $taskTemplateObj
2292
+ ) {
2293
+ code
2294
+ message
2295
+ newTaskTemplate {
2296
+ ...taskTemplate
2297
+ }
2298
+ }
2299
+ }
2300
+ ${taskTemplateFragment}
2301
+ `;
2302
+ const defaultTaskTemplate = {
2303
+ taskTemplateObj: {
2304
+ generalTaskType: TaskTypes.clientUpload
2305
+ },
2306
+ isAddedToTask: false,
2307
+ isNotified: false
2308
+ };
2309
+ var __vue2_script$1 = defineComponent({
2310
+ name: "index",
2311
+ components: {
2312
+ NewTask,
2313
+ MainModal,
2314
+ ReviewModal
2315
+ },
2316
+ props: {
2317
+ uploadFilesFunc: {
2318
+ type: Function,
2319
+ required: true
2320
+ },
2321
+ visible: {
2322
+ type: Boolean,
2323
+ default: false
2324
+ },
2325
+ value: {
2326
+ type: Array,
2327
+ default: () => []
2328
+ },
2329
+ reviewText: {
2330
+ type: String,
2331
+ default: "Add"
2332
+ },
2333
+ openReviewButtonText: {
2334
+ type: String,
2335
+ default: "Review and add to template"
2336
+ },
2337
+ showSendEmail: {
2338
+ type: Boolean,
2339
+ default: false
2340
+ },
2341
+ sendEmail: {
2342
+ type: Boolean,
2343
+ default: false
2344
+ },
2345
+ showTaskSettingLink: {
2346
+ type: Boolean,
2347
+ default: true
2348
+ },
2349
+ allowClear: {
2350
+ type: Boolean,
2351
+ default: false
2352
+ },
2353
+ pageMode: {
2354
+ type: Boolean,
2355
+ default: false
2356
+ },
2357
+ pageSize: {
2358
+ type: Number
2359
+ },
2360
+ closeAfterAdd: {
2361
+ type: Boolean,
2362
+ default: true
2363
+ },
2364
+ adding: {
2365
+ type: Boolean,
2366
+ default: false
2367
+ },
2368
+ withGallery: {
2369
+ type: Boolean,
2370
+ default: true
2371
+ },
2372
+ showNewBtn: {
2373
+ type: Boolean,
2374
+ default: true
2375
+ }
2376
+ },
2377
+ setup(props, { emit }) {
2378
+ const { client } = useApolloClient();
2379
+ const mainModal = ref();
2380
+ const reviewModal = ref();
2381
+ const newTaskVisible = ref(false);
2382
+ const reviewModalVisible = ref(false);
2383
+ const tempTask = ref(defaultTaskTemplate);
2384
+ const updateTemplate = useMutateTaskTemplate();
2385
+ const createTemplate = useCreateTaskTemplate();
2386
+ const addedTasks = ref([]);
2387
+ const me = useMe();
2388
+ const userId = computed(() => {
2389
+ var _a;
2390
+ return (_a = me.value) == null ? void 0 : _a.id;
2391
+ });
2392
+ const lawFirmId = computed(() => {
2393
+ var _a;
2394
+ return (_a = me.value) == null ? void 0 : _a.lawFirmId;
2395
+ });
2396
+ watch(() => newTaskVisible.value, (visible) => {
2397
+ if (!visible) {
2398
+ tempTask.value = defaultTaskTemplate;
2399
+ }
2400
+ });
2401
+ watch(() => props.visible, (visible) => {
2402
+ if (!visible) {
2403
+ addedTasks.value = [];
2404
+ emit("update:value", []);
2405
+ }
2406
+ });
2407
+ const updateReviewModalContent = (record, newRecord) => {
2408
+ if (addedTasks.value.some(({ id }) => id === newRecord.id)) {
2409
+ const newValue = addedTasks.value.map((originTask) => {
2410
+ if (originTask.id === record.taskTemplateId) {
2411
+ return newRecord;
2412
+ }
2413
+ return originTask;
2414
+ });
2415
+ emit("update:value", newValue.map(({ id }) => id));
2416
+ } else {
2417
+ newRecord.id !== record.taskTemplateId && addedTasks.value.push(newRecord);
2418
+ emit("update:value", [...addedTasks.value.map(({ id }) => id), newRecord.id]);
2419
+ }
2420
+ };
2421
+ const writeQuery = (id, newRecord, isUpdate = true) => {
2422
+ const variables = mainModal.value.getVariables();
2423
+ const existed = client.readQuery({
2424
+ query: SearchTaskTemplatesQuery,
2425
+ variables
2426
+ });
2427
+ const newTasks = isUpdate ? existed.taskTemplateSearch.taskTemplateList.map((record) => {
2428
+ if (record.id === id) {
2429
+ return newRecord && __spreadProps(__spreadValues({}, newRecord), {
2430
+ isGallery: record.isGallery
2431
+ });
2432
+ }
2433
+ return record;
2434
+ }).filter((record) => !!record) : [
2435
+ __spreadProps(__spreadValues({}, newRecord), { isGallery: false }),
2436
+ ...existed.taskTemplateSearch.taskTemplateList
2437
+ ];
2438
+ client.writeQuery({
2439
+ query: SearchTaskTemplatesQuery,
2440
+ data: {
2441
+ taskTemplateSearch: __spreadProps(__spreadValues({}, existed.taskTemplateSearch), {
2442
+ taskTemplateList: newTasks
2443
+ })
2444
+ },
2445
+ variables
2446
+ });
2447
+ };
2448
+ const _submit = async (record) => {
2449
+ const { newRecord, success, isUpdate } = await submit(record, updateTemplate, createTemplate);
2450
+ if (success) {
2451
+ writeQuery(record.taskTemplateId, newRecord, isUpdate);
2452
+ newTaskVisible.value = false;
2453
+ updateReviewModalContent(record, newRecord);
2454
+ emit("task-added", newRecord);
2455
+ }
2456
+ };
2457
+ const submitting = computed(() => updateTemplate.loading.value || createTemplate.loading.value);
2458
+ const endReviewing = (result) => {
2459
+ emit("submit", result);
2460
+ if (props.closeAfterAdd) {
2461
+ reviewModalVisible.value = false;
2462
+ newTaskVisible.value = false;
2463
+ }
2464
+ };
2465
+ const editTask = (record) => {
2466
+ newTaskVisible.value = true;
2467
+ tempTask.value = __spreadValues({}, record);
2468
+ };
2469
+ return {
2470
+ mainModal,
2471
+ reviewModal,
2472
+ newTaskVisible,
2473
+ tempTask,
2474
+ reviewModalVisible,
2475
+ submitting,
2476
+ addedTasks,
2477
+ userId,
2478
+ lawFirmId,
2479
+ writeQuery,
2480
+ editTask,
2481
+ _submit,
2482
+ endReviewing
2483
+ };
2484
+ }
2485
+ });
2486
+ var render$1 = function() {
2487
+ var _vm = this;
2488
+ var _h = _vm.$createElement;
2489
+ var _c = _vm._self._c || _h;
2490
+ return _vm.lawFirmId != null ? _c("div", { attrs: { "id": "venus-component-task-cart" } }, [_c("main-modal", { ref: "mainModal", attrs: { "visible": _vm.visible, "show-page": _vm.pageMode, "page-size": _vm.pageSize, "law-firm-id": _vm.lawFirmId, "tempTask": _vm.tempTask, "show-new-btn": _vm.showNewBtn, "with-gallery": _vm.withGallery, "added-tasks": _vm.addedTasks, "newTaskVisible": _vm.newTaskVisible, "show-task-setting-link": _vm.showTaskSettingLink, "reviewModalVisible": _vm.reviewModalVisible, "open-review-button-text": _vm.openReviewButtonText }, on: { "update:tempTask": function($event) {
2491
+ _vm.tempTask = $event;
2492
+ }, "update:temp-task": function($event) {
2493
+ _vm.tempTask = $event;
2494
+ }, "update:addedTasks": function($event) {
2495
+ _vm.addedTasks = $event;
2496
+ }, "update:added-tasks": function($event) {
2497
+ _vm.addedTasks = $event;
2498
+ }, "update:newTaskVisible": function($event) {
2499
+ _vm.newTaskVisible = $event;
2500
+ }, "update:new-task-visible": function($event) {
2501
+ _vm.newTaskVisible = $event;
2502
+ }, "update:reviewModalVisible": function($event) {
2503
+ _vm.reviewModalVisible = $event;
2504
+ }, "update:review-modal-visible": function($event) {
2505
+ _vm.reviewModalVisible = $event;
2506
+ }, "editTask": _vm.editTask, "update:visible": function($event) {
2507
+ return _vm.$emit("update:visible", $event);
2508
+ } }, scopedSlots: _vm._u([{ key: "default", fn: function(ref2) {
2509
+ var loading = ref2.loading;
2510
+ var dataSource = ref2.dataSource;
2511
+ var pagination = ref2.pagination;
2512
+ var changePagination = ref2.changePagination;
2513
+ return [_vm._t("table", null, { "loading": loading, "dataSource": dataSource, "pagination": pagination, "changePagination": changePagination })];
2514
+ } }], null, true) }), _c("review-modal", { ref: "reviewModal", attrs: { "adding": _vm.adding, "sendEmail": _vm.sendEmail, "allow-clear": _vm.allowClear, "tempTask": _vm.tempTask, "review-text": _vm.reviewText, "added-tasks": _vm.addedTasks, "showSendEmail": _vm.showSendEmail, "visible": _vm.reviewModalVisible, "newTaskVisible": _vm.newTaskVisible }, on: { "update:tempTask": function($event) {
2515
+ _vm.tempTask = $event;
2516
+ }, "update:temp-task": function($event) {
2517
+ _vm.tempTask = $event;
2518
+ }, "update:addedTasks": function($event) {
2519
+ _vm.addedTasks = $event;
2520
+ }, "update:added-tasks": function($event) {
2521
+ _vm.addedTasks = $event;
2522
+ }, "update:visible": function($event) {
2523
+ _vm.reviewModalVisible = $event;
2524
+ }, "update:newTaskVisible": function($event) {
2525
+ _vm.newTaskVisible = $event;
2526
+ }, "update:new-task-visible": function($event) {
2527
+ _vm.newTaskVisible = $event;
2528
+ }, "submit": _vm.endReviewing, "update:sendEmail": function($event) {
2529
+ return _vm.$emit("update:sendEmail", $event);
2530
+ } } }), _c("new-task", { attrs: { "user-id": _vm.userId, "loading": _vm.submitting, "value": _vm.tempTask, "law-firm-id": _vm.lawFirmId, "visible": _vm.newTaskVisible, "upload-files-func": _vm.uploadFilesFunc, "has-double-confirm": !!_vm.tempTask.taskTemplateObj.id }, on: { "update:value": function($event) {
2531
+ _vm.tempTask = $event;
2532
+ }, "update:visible": function($event) {
2533
+ _vm.newTaskVisible = $event;
2534
+ }, "submit": _vm._submit } })], 1) : _vm._e();
2535
+ };
2536
+ var staticRenderFns$1 = [];
2537
+ var index_vue_vue_type_style_index_0_scoped_true_lang = "";
2538
+ const __cssModules$1 = {};
2539
+ var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, "466cfa4a", null, null);
2540
+ function __vue2_injectStyles$1(context) {
2541
+ for (let o in __cssModules$1) {
2542
+ this[o] = __cssModules$1[o];
2543
+ }
2544
+ }
2545
+ var index$1 = /* @__PURE__ */ function() {
2546
+ return __component__$1.exports;
2547
+ }();
2548
+ var __vue2_script = defineComponent({
2549
+ setup() {
2550
+ const notBoolean = ref(123);
2551
+ const test = ref(false);
2552
+ const isDisabled = computed(() => test.value);
2553
+ return {
2554
+ isDisabled,
2555
+ notBoolean,
2556
+ test
2557
+ };
2558
+ }
2559
+ });
2560
+ var render = function() {
2561
+ var _vm = this;
2562
+ var _h = _vm.$createElement;
2563
+ var _c = _vm._self._c || _h;
2564
+ return _c("div", [_c("a-radio", { attrs: { "disabled": _vm.isDisabled } }), _c("h1", [_vm._v(_vm._s(_vm.isDisabled))]), _c("h1", [_vm._v(_vm._s(_vm.test))]), _c("h1", [_vm._v(_vm._s(_vm.notBoolean))])], 1);
2565
+ };
2566
+ var staticRenderFns = [];
2567
+ const __cssModules = {};
2568
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
2569
+ function __vue2_injectStyles(context) {
2570
+ for (let o in __cssModules) {
2571
+ this[o] = __cssModules[o];
2572
+ }
2573
+ }
2574
+ var index = /* @__PURE__ */ function() {
2575
+ return __component__.exports;
2576
+ }();
2577
+ export { AFileUploader, AssigneeTag, index$3 as CaseTemplateSelect, CaseTemplateTypeBadge, GlueRoleType, NewTask, index$4 as ProfileSelect, TagsWithTooltip, index$1 as TaskCart, TaskForm, TaskTable, TaskTemplateFilter, index as TestComponent, formRecords, index$2 as forms, getLanguageMessage, refactorParams as refactorTaskTemplateParams, submit as submitTaskTemplate, useCreateTaskTemplate, useMutateTaskTemplate, useSearchTaskConditions, useSearchTaskTemplates };