@wisemen/wise-crm-web 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1037 -0
- package/dist/BusinessDetailSidebarProvider-BQMRbGHQ.js +2083 -0
- package/dist/{BusinessDetailView-DvhFfuGg.js → BusinessDetailView-BxGxWOme.js} +5 -5
- package/dist/{CrmDetailHeaderCard-e5332OkQ.js → CrmDetailHeaderCard-CCNJpMAK.js} +68 -67
- package/dist/{CrmDetailView-C-lsAhtD.js → CrmDetailView-ozCpuaX2.js} +14 -14
- package/dist/{DealCommunicationTabView-e7NkRy9r.js → DealCommunicationTabView-Df5EeolN.js} +2 -2
- package/dist/{DealDetailView-BDCbOBoo.js → DealDetailView-DdWHqaBr.js} +163 -163
- package/dist/{DealExternalAttachment-D1PznE3V.js → DealExternalAttachment-qHdh4yMI.js} +1 -1
- package/dist/{DealSendMailDialog-DVE2iYQC.js → DealSendMailDialog-BaYcWZP-.js} +65 -69
- package/dist/Error-BArv9rNb.js +12650 -0
- package/dist/IndividualDetailSidebarProvider-BXZH951l.js +608 -0
- package/dist/{IndividualDetailView-B7dX3hZ8.js → IndividualDetailView-DfYS31-e.js} +5 -5
- package/dist/LinkBrokenIcon-CTlqmapl.js +17 -0
- package/dist/api/mutations/deal/dealCreate.mutation.d.ts +1 -1
- package/dist/api/mutations/deal/dealUpdate.mutation.d.ts +3 -3
- package/dist/api/mutations/mail-template/mailTemplateUpdate.mutation.d.ts +1 -1
- package/dist/client/apiErrorCode.gen.d.ts +2 -2
- package/dist/client/sdk.gen.d.ts +20 -17
- package/dist/client/types.gen.d.ts +1057 -1376
- package/dist/client/zod.gen.d.ts +15453 -17750
- package/dist/{client-BP13IBbl.js → client-pCaNxE3C.js} +748 -1047
- package/dist/components/app/dialog/AppConfirmDialog.vue.d.ts +2 -2
- package/dist/components/crm-detail/CrmDetailHeaderCard.vue.d.ts +2 -0
- package/dist/components/crm-detail/CrmDetailSidebarAccordionContactPersonInfo.vue.d.ts +2 -2
- package/dist/components/crm-detail/CrmDetailSidebarAccordionGenericContactPersonInfo.vue.d.ts +2 -2
- package/dist/components/notes/NoteList.vue.d.ts +2 -2
- package/dist/deal/components/DealSendMailForm.vue.d.ts +2 -2
- package/dist/deal/components/DealSendMailFormFooter.vue.d.ts +1 -1
- package/dist/deal/components/DealSettingsDialogMailTemplateForm.vue.d.ts +2 -2
- package/dist/deal/components/DealSettingsDialogMailTemplateFormFields.vue.d.ts +2 -2
- package/dist/dialogs/contact-create/ContactCreateDialog.vue.d.ts +1 -1
- package/dist/dialogs/contact-create/components/ContactCreateDialogBusinessContactPersonSearch.vue.d.ts +2 -2
- package/dist/dialogs/contact-create/components/ContactCreateDialogBusinessGeneralInfo.vue.d.ts +2 -2
- package/dist/dialogs/contact-create/components/ContactCreateDialogFooter.vue.d.ts +2 -2
- package/dist/dialogs/contact-create/components/ContactCreateDialogFormSection.vue.d.ts +2 -2
- package/dist/dialogs/note/CrmDetailSidebarNotesView.vue.d.ts +2 -2
- package/dist/icons/LinkBrokenIcon.vue.d.ts +3 -0
- package/dist/icons/icon.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +448 -453
- package/dist/models/brand-colors/brandColor.model.d.ts +14 -0
- package/dist/models/brand-colors/brandColor.transformer.d.ts +5 -0
- package/dist/models/conent-locale/contentLocaleEnum.model.d.ts +3 -3
- package/dist/models/deal/create/dealCreateForm.model.d.ts +2 -2
- package/dist/models/deal/detail/dealDetail.model.d.ts +2 -2
- package/dist/models/deal/index/dealIndex.model.d.ts +2 -2
- package/dist/models/deal/update/dealUpdateForm.model.d.ts +2 -2
- package/dist/models/mail-template/detail/mailTemplateDetail.model.d.ts +2 -2
- package/dist/models/mail-template/update/mailTemplateUpdateForm.model.d.ts +3 -3
- package/dist/models/phone-number/phoneNumberForm.model.d.ts +3 -0
- package/dist/models/tenant-config/tenantConfig.model.d.ts +3 -0
- package/dist/plugins/i18n.plugin.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/testing/factories/business.factory.d.ts +2 -1
- package/dist/testing.js +23 -2
- package/package.json +2 -1
- package/dist/BusinessDetailSidebarProvider-D11bjWFa.js +0 -2081
- package/dist/BusinessDetailSidebarProvider-DYY-Uzvx.js +0 -2081
- package/dist/BusinessDetailSidebarProvider-ZYGQoNHh.js +0 -2081
- package/dist/BusinessDetailView-BOCy7G-w.js +0 -24
- package/dist/BusinessDetailView-WaATSNQS.js +0 -24
- package/dist/CrmDetailHeaderCard-C-JNdi7s.js +0 -2515
- package/dist/CrmDetailHeaderCard-qkNK-2wR.js +0 -2515
- package/dist/CrmDetailView-C6Xm1Lp6.js +0 -65
- package/dist/CrmDetailView-DQehs8Fb.js +0 -65
- package/dist/DealDetailView-BfkDNvK4.js +0 -1021
- package/dist/DealDetailView-Cs5TDhih.js +0 -1021
- package/dist/DealSendMailDialog-D5Voyhhc.js +0 -1556
- package/dist/DealSendMailDialog-OAn6xjLq.js +0 -1556
- package/dist/Error-5vt6UD4m.js +0 -3708
- package/dist/Error-B4TwHEhb.js +0 -3706
- package/dist/Error-BPxDpKcI.js +0 -3706
- package/dist/IndividualDetailSidebarProvider-CvZQdjzp.js +0 -606
- package/dist/IndividualDetailSidebarProvider-DBITt-9W.js +0 -606
- package/dist/IndividualDetailSidebarProvider-vIu7Hv8O.js +0 -606
- package/dist/IndividualDetailView-B1vbJXGc.js +0 -24
- package/dist/IndividualDetailView-BKEs0XS5.js +0 -24
- /package/dist/{LinkExternalIcon-B9Qg55Oa.js → LinkExternalIcon-LOVtSqBT.js} +0 -0
- /package/dist/{LinkIcon-DCW5zjbQ.js → LinkIcon-DqBbVrvs.js} +0 -0
- /package/dist/{LocationPinIcon-DBc-wt2e.js → LocationPinIcon-Cp-wRgk2.js} +0 -0
- /package/dist/{MailIcon-Do4a7S2W.js → MailIcon-CnTrB1k3.js} +0 -0
- /package/dist/{MobilePhoneIcon-DSXyKwjd.js → MobilePhoneIcon-B747hmpS.js} +0 -0
- /package/dist/{NumberedListIcon-DUaSJSYu.js → NumberedListIcon-amJxDaaD.js} +0 -0
- /package/dist/{PhoneIcon-C8Cv1IiW.js → PhoneIcon-94MYVL85.js} +0 -0
- /package/dist/{RefreshIcon-CKZgHIZU.js → RefreshIcon-DRe3coBc.js} +0 -0
- /package/dist/{SendIcon-B-sQkQ3W.js → SendIcon-MYItp1xI.js} +0 -0
- /package/dist/{SettingsIcon-DzP-IQS5.js → SettingsIcon-C0qTAv0w.js} +0 -0
- /package/dist/{StarOutlineIcon-c0VfXRdQ.js → StarOutlineIcon-CiFLgepk.js} +0 -0
- /package/dist/{StarYellowIcon-CH0CnlSU.js → StarYellowIcon-C0v_XGwI.js} +0 -0
- /package/dist/{ThreeDotsIcon-C6PCFq5J.js → ThreeDotsIcon-lujOTU3G.js} +0 -0
- /package/dist/{TimeLineMarkerIcon-6B6SbwTN.js → TimeLineMarkerIcon-C4LfErbc.js} +0 -0
- /package/dist/{TrashIcon-BTPSVviz.js → TrashIcon-v4L9SEK_.js} +0 -0
- /package/dist/{UploadCloudIcon-1aMW5OJq.js → UploadCloudIcon-j1-1Rvqb.js} +0 -0
- /package/dist/{UserCircleIcon-D-19dc-2.js → UserCircleIcon-BjUt_2C4.js} +0 -0
- /package/dist/{UserIcon-D1H8TGlg.js → UserIcon-Cb2jFKLr.js} +0 -0
- /package/dist/{VerticalDotsIcon-DmPza4Jd.js → VerticalDotsIcon-Y3m6tlQ2.js} +0 -0
- /package/dist/{WalletIcon-BlI3D3v-.js → WalletIcon-pPsKbzmh.js} +0 -0
|
@@ -1,2515 +0,0 @@
|
|
|
1
|
-
import { $ as AppInfiniteScroll_default, B as AppForm_default, D as useGoogleMapsApiKey, M as AppSidebarFormSubmitButton_default, N as AppSidebarFormFooter_default, V as i18nPlugin, a as AppOpenEntityButton_default, b as AppGlobalFormError_default, d as ContactPersonFormNameField_default, et as AppEmptyState_default, f as ContactPersonFormContactField_default, g as IndividualAutocomplete_default, l as AppIconLabelPair_default, o as CrmDetailSidebarCard_default, p as AppUnstyledButton_default, q as useApiErrorToast, tt as AppGrid_default, u as individualItemSchema, v as IndividualService, z as toFormField } from "./Error-B4TwHEhb.js";
|
|
2
|
-
import { a as AppGroup_default, n as useDateTimeFormat, r as DateUtil } from "./AppSkeletonLoader-BAhoOmFD.js";
|
|
3
|
-
import { gt as EntityType } from "./client-BP13IBbl.js";
|
|
4
|
-
import z$1, { z } from "zod";
|
|
5
|
-
import { Comment, Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, inject, markRaw, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRef, unref, watch, withCtx } from "vue";
|
|
6
|
-
import { useI18n } from "vue-i18n";
|
|
7
|
-
import { VcBadge, VcButton, VcDropdownMenu, VcDropdownMenuItem, VcIcon, VcIconButton, VcTextField, VcTooltip, VcTooltipTrigger } from "@wisemen/vue-core-components";
|
|
8
|
-
import { RouterLink } from "vue-router";
|
|
9
|
-
import { useClipboard } from "@vueuse/core";
|
|
10
|
-
import { useForm } from "formango";
|
|
11
|
-
import { Motion } from "motion-v";
|
|
12
|
-
function assert(e, m) {
|
|
13
|
-
if (!e) throw Error(m);
|
|
14
|
-
}
|
|
15
|
-
var _hoisted_1$7 = { class: "gap-xs flex flex-wrap items-center" }, _hoisted_2$6 = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "text-primary shrink-0 text-sm"
|
|
18
|
-
}, _hoisted_3$5 = { class: "gap-md flex flex-wrap items-center text-sm" }, _hoisted_4$5 = { class: "text-brand text-xs" }, ActivityListItemMessage_default = /* @__PURE__ */ defineComponent({
|
|
19
|
-
__name: "ActivityListItemMessage",
|
|
20
|
-
props: { activity: {} },
|
|
21
|
-
setup(e) {
|
|
22
|
-
let m = e, h = computed(() => m.activity.message.split(" ").map((e) => e === "[note]" ? {
|
|
23
|
-
text: m.activity.content?.note?.name ?? "",
|
|
24
|
-
type: "text"
|
|
25
|
-
} : e === "[contactPerson]" ? {
|
|
26
|
-
route: { query: { individualUuid: m.activity.content?.contactPerson?.uuid } },
|
|
27
|
-
text: m.activity.content?.contactPerson?.name ?? "",
|
|
28
|
-
type: "link"
|
|
29
|
-
} : {
|
|
30
|
-
text: e,
|
|
31
|
-
type: "text"
|
|
32
|
-
}));
|
|
33
|
-
return (e, g) => (openBlock(), createElementBlock("div", _hoisted_1$7, [(openBlock(!0), createElementBlock(Fragment, null, renderList(h.value, (e) => (openBlock(), createElementBlock(Fragment, { key: e }, [e.type === "text" ? (openBlock(), createElementBlock("span", _hoisted_2$6, toDisplayString(e.text), 1)) : createCommentVNode("", !0), e.type === "link" && e.route !== void 0 ? (openBlock(), createBlock(unref(RouterLink), {
|
|
34
|
-
key: 1,
|
|
35
|
-
to: e.route,
|
|
36
|
-
class: "hover:text-brand hover:underline text-primary text-sm font-medium"
|
|
37
|
-
}, {
|
|
38
|
-
default: withCtx(() => [createTextVNode(toDisplayString(e.text), 1)]),
|
|
39
|
-
_: 2
|
|
40
|
-
}, 1032, ["to"])) : createCommentVNode("", !0)], 64))), 128)), m.activity.changes.length > 0 ? (openBlock(), createBlock(unref(VcTooltip), {
|
|
41
|
-
key: 0,
|
|
42
|
-
"class-config": {
|
|
43
|
-
arrow: "bg-primary border-primary",
|
|
44
|
-
innerContent: "max-w-80 bg-primary border-primary p-lg"
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
trigger: withCtx(() => [createVNode(unref(VcIcon), {
|
|
48
|
-
icon: "infoCircle",
|
|
49
|
-
class: "text-tertiary size-3"
|
|
50
|
-
})]),
|
|
51
|
-
content: withCtx(() => [createVNode(AppGrid_default, { cols: 1 }, {
|
|
52
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(m.activity.changes, (e) => (openBlock(), createElementBlock("div", {
|
|
53
|
-
key: JSON.stringify(e),
|
|
54
|
-
class: "gap-sm flex flex-col"
|
|
55
|
-
}, [createElementVNode("div", _hoisted_3$5, [
|
|
56
|
-
createElementVNode("p", _hoisted_4$5, toDisplayString(e.key) + ": ", 1),
|
|
57
|
-
e.oldValue === null ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(VcBadge), {
|
|
58
|
-
key: 0,
|
|
59
|
-
"class-config": { root: "rounded-sm border-none whitespace-pre-wrap" },
|
|
60
|
-
size: "sm",
|
|
61
|
-
variant: "translucent",
|
|
62
|
-
color: "error"
|
|
63
|
-
}, {
|
|
64
|
-
default: withCtx(() => [createTextVNode(toDisplayString(e.oldValue), 1)]),
|
|
65
|
-
_: 2
|
|
66
|
-
}, 1024)),
|
|
67
|
-
e.oldValue !== null && e.value !== null ? (openBlock(), createBlock(unref(VcIcon), {
|
|
68
|
-
key: 1,
|
|
69
|
-
class: "size-3",
|
|
70
|
-
icon: "arrowRight"
|
|
71
|
-
})) : createCommentVNode("", !0),
|
|
72
|
-
createVNode(unref(VcBadge), {
|
|
73
|
-
"class-config": { root: "rounded-sm border-none whitespace-pre-wrap" },
|
|
74
|
-
size: "sm",
|
|
75
|
-
variant: "translucent",
|
|
76
|
-
color: "success"
|
|
77
|
-
}, {
|
|
78
|
-
default: withCtx(() => [createTextVNode(toDisplayString(e.value), 1)]),
|
|
79
|
-
_: 2
|
|
80
|
-
}, 1024)
|
|
81
|
-
])]))), 128))]),
|
|
82
|
-
_: 1
|
|
83
|
-
})]),
|
|
84
|
-
_: 1
|
|
85
|
-
})) : createCommentVNode("", !0)]));
|
|
86
|
-
}
|
|
87
|
-
}), _hoisted_1$6 = { class: "flex flex-col items-center justify-center" }, _hoisted_2$5 = { class: "bg-tertiary p-md flex items-center justify-center rounded-md" }, _hoisted_3$4 = {
|
|
88
|
-
key: 0,
|
|
89
|
-
class: "my-md bg-tertiary h-8 w-0.5 rounded-full"
|
|
90
|
-
}, _hoisted_4$4 = { class: "text-quaternary text-xs" }, _hoisted_5$2 = { class: "text-quaternary text-xs" }, ActivityListItem_default = /* @__PURE__ */ defineComponent({
|
|
91
|
-
__name: "ActivityListItem",
|
|
92
|
-
props: {
|
|
93
|
-
isLast: { type: Boolean },
|
|
94
|
-
activity: {}
|
|
95
|
-
},
|
|
96
|
-
setup(e) {
|
|
97
|
-
let m = e;
|
|
98
|
-
function h(e) {
|
|
99
|
-
return DateUtil.isToday(e) ? useDateTimeFormat().fromNow(e.toInstant()) : useDateTimeFormat().toDate(e.toPlainDate());
|
|
100
|
-
}
|
|
101
|
-
return (e, g) => (openBlock(), createBlock(AppGroup_default, {
|
|
102
|
-
gap: "lg",
|
|
103
|
-
align: "start"
|
|
104
|
-
}, {
|
|
105
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_1$6, [createElementVNode("div", _hoisted_2$5, [createVNode(unref(VcIcon), {
|
|
106
|
-
icon: "infoCircle",
|
|
107
|
-
class: "text-quaternary size-3"
|
|
108
|
-
})]), m.isLast ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_3$4))]), createElementVNode("div", null, [createVNode(ActivityListItemMessage_default, { activity: m.activity }, null, 8, ["activity"]), createVNode(AppGroup_default, null, {
|
|
109
|
-
default: withCtx(() => [
|
|
110
|
-
createElementVNode("p", _hoisted_4$4, toDisplayString(h(m.activity.createdAt)), 1),
|
|
111
|
-
g[0] ||= createElementVNode("div", { class: "bg-quaternary size-1 rounded-full" }, null, -1),
|
|
112
|
-
createElementVNode("p", _hoisted_5$2, toDisplayString(m.activity.changedBy), 1)
|
|
113
|
-
]),
|
|
114
|
-
_: 1
|
|
115
|
-
})])]),
|
|
116
|
-
_: 1
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
}), ActivityList_default = /* @__PURE__ */ defineComponent({
|
|
120
|
-
__name: "ActivityList",
|
|
121
|
-
props: {
|
|
122
|
-
isLoading: { type: Boolean },
|
|
123
|
-
activities: {},
|
|
124
|
-
onNext: { type: Function }
|
|
125
|
-
},
|
|
126
|
-
setup(m) {
|
|
127
|
-
let h = m, g = useI18n(), v = computed(() => !h.isLoading && h.activities.length === 0);
|
|
128
|
-
async function y() {
|
|
129
|
-
await h.onNext();
|
|
130
|
-
}
|
|
131
|
-
return (h, b) => (openBlock(), createBlock(AppInfiniteScroll_default, {
|
|
132
|
-
"on-next": y,
|
|
133
|
-
class: "h-full"
|
|
134
|
-
}, {
|
|
135
|
-
default: withCtx(() => [createVNode(AppGroup_default, {
|
|
136
|
-
direction: "col",
|
|
137
|
-
justify: "start",
|
|
138
|
-
align: "start",
|
|
139
|
-
gap: "none"
|
|
140
|
-
}, {
|
|
141
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(m.activities, (e, h) => (openBlock(), createBlock(ActivityListItem_default, {
|
|
142
|
-
key: JSON.stringify(e),
|
|
143
|
-
"is-last": h === m.activities.length - 1,
|
|
144
|
-
activity: e
|
|
145
|
-
}, null, 8, ["is-last", "activity"]))), 128))]),
|
|
146
|
-
_: 1
|
|
147
|
-
}), v.value ? (openBlock(), createBlock(AppEmptyState_default, {
|
|
148
|
-
key: 0,
|
|
149
|
-
title: unref(g).t("wise_crm.info_dialog.activity.empty_state.title"),
|
|
150
|
-
description: unref(g).t("wise_crm.info_dialog.activity.empty_state.description"),
|
|
151
|
-
icon: "activity"
|
|
152
|
-
}, null, 8, ["title", "description"])) : createCommentVNode("", !0)]),
|
|
153
|
-
_: 1
|
|
154
|
-
}));
|
|
155
|
-
}
|
|
156
|
-
}), AddressUtil = class {
|
|
157
|
-
static format(e) {
|
|
158
|
-
return `${e.street} ${e.streetNumber}, ${e.postalCode} ${e.city}, ${e.country}`;
|
|
159
|
-
}
|
|
160
|
-
static formatShort(e) {
|
|
161
|
-
return `${e.street} ${e.streetNumber}, ${e.postalCode} ${e.city}`;
|
|
162
|
-
}
|
|
163
|
-
}, _hoisted_1$5 = { class: "col-span-2 flex flex-col items-center" }, ContactPersonCreateExisitngForm_default = /* @__PURE__ */ defineComponent({
|
|
164
|
-
__name: "ContactPersonCreateExisitngForm",
|
|
165
|
-
props: { form: {} },
|
|
166
|
-
emits: ["createNewContactPerson"],
|
|
167
|
-
setup(e, { emit: h }) {
|
|
168
|
-
let y = e, b = h, S = useI18n(), C = useApiErrorToast(), w = y.form.register("position"), O = y.form.register("email"), k = y.form.register("phone"), B = y.form.register("mobile"), G = y.form.register("existingContactPerson");
|
|
169
|
-
function K() {
|
|
170
|
-
b("createNewContactPerson");
|
|
171
|
-
}
|
|
172
|
-
async function q(e) {
|
|
173
|
-
if (e !== null) try {
|
|
174
|
-
let m = await IndividualService.getByUuid(e.value);
|
|
175
|
-
O.setValue(m.email), k.setValue(m.phone), B.setValue(m.mobilePhone);
|
|
176
|
-
} catch (e) {
|
|
177
|
-
C.show(e);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return (e, h) => (openBlock(), createBlock(AppForm_default, {
|
|
181
|
-
"can-exit-when-dirty": !0,
|
|
182
|
-
form: y.form,
|
|
183
|
-
class: "flex h-full flex-1 flex-col justify-between"
|
|
184
|
-
}, {
|
|
185
|
-
default: withCtx(() => [createVNode(AppGrid_default, { cols: 2 }, {
|
|
186
|
-
default: withCtx(() => [
|
|
187
|
-
createElementVNode("div", _hoisted_1$5, [createVNode(IndividualAutocomplete_default, mergeProps(unref(toFormField)(unref(G)), {
|
|
188
|
-
label: unref(S).t("wise_crm.contact.create_dialog.form.fields.contact_person"),
|
|
189
|
-
"onUpdate:modelValue": q,
|
|
190
|
-
onCreateNew: K
|
|
191
|
-
}), null, 16, ["label"]), createVNode(AppUnstyledButton_default, {
|
|
192
|
-
class: "text-placeholder mt-sm text-xs underline",
|
|
193
|
-
onClick: K
|
|
194
|
-
}, {
|
|
195
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(S).t("wise_crm.contact.create_dialog.form.create_new_contact_person")), 1)]),
|
|
196
|
-
_: 1
|
|
197
|
-
})]),
|
|
198
|
-
createVNode(unref(VcTextField), mergeProps(unref(toFormField)(unref(w)), {
|
|
199
|
-
label: unref(S).t("wise_crm.contact.create_dialog.form.fields.position"),
|
|
200
|
-
placeholder: unref(S).t("wise_crm.contact.create_dialog.form.fields.position"),
|
|
201
|
-
class: "col-span-2"
|
|
202
|
-
}), null, 16, ["label", "placeholder"]),
|
|
203
|
-
createVNode(ContactPersonFormContactField_default, {
|
|
204
|
-
email: unref(O),
|
|
205
|
-
"mobile-phone": unref(B),
|
|
206
|
-
phone: unref(k)
|
|
207
|
-
}, null, 8, [
|
|
208
|
-
"email",
|
|
209
|
-
"mobile-phone",
|
|
210
|
-
"phone"
|
|
211
|
-
])
|
|
212
|
-
]),
|
|
213
|
-
_: 1
|
|
214
|
-
}), createVNode(AppSidebarFormFooter_default, null, {
|
|
215
|
-
default: withCtx(() => [createVNode(AppSidebarFormSubmitButton_default, {
|
|
216
|
-
"is-loading": y.form.isSubmitting.value,
|
|
217
|
-
label: unref(S).t("wise_crm.shared.add"),
|
|
218
|
-
class: "col-span-2"
|
|
219
|
-
}, null, 8, ["is-loading", "label"])]),
|
|
220
|
-
_: 1
|
|
221
|
-
})]),
|
|
222
|
-
_: 1
|
|
223
|
-
}, 8, ["form"]));
|
|
224
|
-
}
|
|
225
|
-
}), ContactPersonCreateNewForm_default = /* @__PURE__ */ defineComponent({
|
|
226
|
-
__name: "ContactPersonCreateNewForm",
|
|
227
|
-
props: { form: {} },
|
|
228
|
-
setup(e) {
|
|
229
|
-
let h = e, g = useI18n(), v = h.form.register("firstName"), y = h.form.register("lastName"), b = h.form.register("email"), w = h.form.register("mobilePhone"), E = h.form.register("position"), O = h.form.register("phone");
|
|
230
|
-
return (e, k) => (openBlock(), createBlock(AppForm_default, {
|
|
231
|
-
"can-exit-when-dirty": !0,
|
|
232
|
-
form: h.form,
|
|
233
|
-
class: "flex h-full flex-col justify-between"
|
|
234
|
-
}, {
|
|
235
|
-
default: withCtx(() => [createVNode(AppGrid_default, { cols: 2 }, {
|
|
236
|
-
default: withCtx(() => [
|
|
237
|
-
createVNode(ContactPersonFormNameField_default, {
|
|
238
|
-
"first-name": unref(v),
|
|
239
|
-
"last-name": unref(y)
|
|
240
|
-
}, null, 8, ["first-name", "last-name"]),
|
|
241
|
-
createVNode(unref(VcTextField), mergeProps(unref(toFormField)(unref(E)), {
|
|
242
|
-
label: unref(g).t("wise_crm.contact.create_dialog.form.fields.position"),
|
|
243
|
-
placeholder: unref(g).t("wise_crm.contact.create_dialog.form.fields.position"),
|
|
244
|
-
class: "col-span-2"
|
|
245
|
-
}), null, 16, ["label", "placeholder"]),
|
|
246
|
-
createVNode(ContactPersonFormContactField_default, {
|
|
247
|
-
email: unref(b),
|
|
248
|
-
"mobile-phone": unref(w),
|
|
249
|
-
phone: unref(O)
|
|
250
|
-
}, null, 8, [
|
|
251
|
-
"email",
|
|
252
|
-
"mobile-phone",
|
|
253
|
-
"phone"
|
|
254
|
-
]),
|
|
255
|
-
createVNode(AppGlobalFormError_default, { form: h.form }, null, 8, ["form"])
|
|
256
|
-
]),
|
|
257
|
-
_: 1
|
|
258
|
-
}), renderSlot(e.$slots, "actions")]),
|
|
259
|
-
_: 3
|
|
260
|
-
}, 8, ["form"]));
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
const contactPersonCreateExistingFormSchema = z$1.object({
|
|
264
|
-
email: z$1.literal("").or(z$1.email()).nullable(),
|
|
265
|
-
existingContactPerson: individualItemSchema,
|
|
266
|
-
mobile: z$1.string().nullable(),
|
|
267
|
-
phone: z$1.string().nullable(),
|
|
268
|
-
position: z$1.string()
|
|
269
|
-
}), contactPersonCreateFormSchema = z.object({
|
|
270
|
-
email: z.literal("").or(z.email()).nullable(),
|
|
271
|
-
firstName: z.string().min(1),
|
|
272
|
-
lastName: z.string().min(1),
|
|
273
|
-
mobilePhone: z.string().min(1).nullable(),
|
|
274
|
-
phone: z.string().min(1).nullable(),
|
|
275
|
-
position: z.string().min(1).nullable()
|
|
276
|
-
}).superRefine((e, m) => {
|
|
277
|
-
e.email !== null && e.email !== "" || e.mobilePhone !== null && e.mobilePhone !== "" || e.phone !== null && e.phone !== "" || m.addIssue({
|
|
278
|
-
code: z.ZodIssueCode.custom,
|
|
279
|
-
message: i18nPlugin.global.t("wise_crm.form.errors.at_least_one")
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
var ContactPersonCreateForm_default = /* @__PURE__ */ defineComponent({
|
|
283
|
-
__name: "ContactPersonCreateForm",
|
|
284
|
-
props: {
|
|
285
|
-
isCreatingNewContactPerson: {
|
|
286
|
-
type: Boolean,
|
|
287
|
-
default: !1
|
|
288
|
-
},
|
|
289
|
-
onLinkContactPerson: {},
|
|
290
|
-
onSubmit: {}
|
|
291
|
-
},
|
|
292
|
-
setup(e) {
|
|
293
|
-
let m = e, h = useI18n(), y = ref(m.isCreatingNewContactPerson), b = useForm({
|
|
294
|
-
schema: contactPersonCreateFormSchema,
|
|
295
|
-
onSubmit: async (e) => {
|
|
296
|
-
await m.onSubmit(e);
|
|
297
|
-
}
|
|
298
|
-
}), S = useForm({
|
|
299
|
-
schema: contactPersonCreateExistingFormSchema,
|
|
300
|
-
onSubmit: async (e) => {
|
|
301
|
-
await C(e.existingContactPerson.value, {
|
|
302
|
-
email: e.email,
|
|
303
|
-
mobilePhone: e.mobile,
|
|
304
|
-
phone: e.phone
|
|
305
|
-
}, e.position);
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
async function C(e, h, g) {
|
|
309
|
-
e !== null && await m.onLinkContactPerson(e, h, g);
|
|
310
|
-
}
|
|
311
|
-
function w() {
|
|
312
|
-
y.value = !0;
|
|
313
|
-
}
|
|
314
|
-
function T() {
|
|
315
|
-
y.value = !1;
|
|
316
|
-
}
|
|
317
|
-
return (e, m) => (openBlock(), createBlock(unref(Motion), {
|
|
318
|
-
key: y.value ? "new" : "existing",
|
|
319
|
-
initial: { opacity: 0 },
|
|
320
|
-
animate: { opacity: 1 },
|
|
321
|
-
exit: { opacity: 0 },
|
|
322
|
-
transition: { duration: .2 }
|
|
323
|
-
}, {
|
|
324
|
-
default: withCtx(() => [y.value ? (openBlock(), createBlock(ContactPersonCreateNewForm_default, {
|
|
325
|
-
key: 0,
|
|
326
|
-
form: unref(b)
|
|
327
|
-
}, {
|
|
328
|
-
actions: withCtx(() => [createVNode(AppGroup_default, { justify: "end" }, {
|
|
329
|
-
default: withCtx(() => [createVNode(AppSidebarFormFooter_default, null, {
|
|
330
|
-
default: withCtx(() => [createVNode(unref(VcButton), {
|
|
331
|
-
size: "lg",
|
|
332
|
-
variant: "secondary",
|
|
333
|
-
onClick: T
|
|
334
|
-
}, {
|
|
335
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(h).t("wise_crm.contact.create_dialog.form.back")), 1)]),
|
|
336
|
-
_: 1
|
|
337
|
-
}), createVNode(AppSidebarFormSubmitButton_default, {
|
|
338
|
-
"is-loading": unref(b).isSubmitting.value,
|
|
339
|
-
label: unref(h).t("wise_crm.shared.create")
|
|
340
|
-
}, null, 8, ["is-loading", "label"])]),
|
|
341
|
-
_: 1
|
|
342
|
-
})]),
|
|
343
|
-
_: 1
|
|
344
|
-
})]),
|
|
345
|
-
_: 1
|
|
346
|
-
}, 8, ["form"])) : (openBlock(), createBlock(ContactPersonCreateExisitngForm_default, {
|
|
347
|
-
key: 1,
|
|
348
|
-
form: unref(S),
|
|
349
|
-
onCreateNewContactPerson: w
|
|
350
|
-
}, null, 8, ["form"]))]),
|
|
351
|
-
_: 1
|
|
352
|
-
}));
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
const contactPersonUpdateFormSchema = z.object({
|
|
356
|
-
email: z.literal("").or(z.email()).nullable(),
|
|
357
|
-
firstName: z.string().min(1),
|
|
358
|
-
lastName: z.string().min(1),
|
|
359
|
-
mobilePhone: z.string().nullable(),
|
|
360
|
-
phone: z.string().nullable(),
|
|
361
|
-
position: z.string().nullable()
|
|
362
|
-
}).superRefine((e, m) => {
|
|
363
|
-
e.email !== null && e.email !== "" || e.mobilePhone !== null && e.mobilePhone !== "" || e.phone !== null && e.phone !== "" || m.addIssue({
|
|
364
|
-
code: z.ZodIssueCode.custom,
|
|
365
|
-
message: i18nPlugin.global.t("wise_crm.form.errors.at_least_one")
|
|
366
|
-
});
|
|
367
|
-
});
|
|
368
|
-
(function() {
|
|
369
|
-
try {
|
|
370
|
-
if (typeof document < "u") {
|
|
371
|
-
var e = document.createElement("style");
|
|
372
|
-
e.appendChild(document.createTextNode(".mapdiv[data-v-289550ca]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-135889a7]{display:none}.mapdiv .info-window-wrapper[data-v-135889a7]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")), document.head.appendChild(e);
|
|
373
|
-
}
|
|
374
|
-
} catch (e) {
|
|
375
|
-
console.error("vite-plugin-css-injected-by-js", e);
|
|
376
|
-
}
|
|
377
|
-
})();
|
|
378
|
-
var it = Object.defineProperty, at = (e, m, h) => m in e ? it(e, m, {
|
|
379
|
-
enumerable: !0,
|
|
380
|
-
configurable: !0,
|
|
381
|
-
writable: !0,
|
|
382
|
-
value: h
|
|
383
|
-
}) : e[m] = h, pe = (e, m, h) => (at(e, typeof m == "symbol" ? m : m + "", h), h), D = Symbol("map"), Z = Symbol("api"), _e = Symbol("marker"), ke = Symbol("markerCluster"), ue = Symbol("CustomMarker"), Xe = Symbol("mapTilesLoaded"), H = [
|
|
384
|
-
"click",
|
|
385
|
-
"dblclick",
|
|
386
|
-
"drag",
|
|
387
|
-
"dragend",
|
|
388
|
-
"dragstart",
|
|
389
|
-
"mousedown",
|
|
390
|
-
"mousemove",
|
|
391
|
-
"mouseout",
|
|
392
|
-
"mouseover",
|
|
393
|
-
"mouseup",
|
|
394
|
-
"rightclick"
|
|
395
|
-
];
|
|
396
|
-
function dt(e, m, h, g) {
|
|
397
|
-
function v(e) {
|
|
398
|
-
return e instanceof h ? e : new h(function(m) {
|
|
399
|
-
m(e);
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
return new (h ||= Promise)(function(h, y) {
|
|
403
|
-
function b(e) {
|
|
404
|
-
try {
|
|
405
|
-
C(g.next(e));
|
|
406
|
-
} catch (e) {
|
|
407
|
-
y(e);
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
function S(e) {
|
|
411
|
-
try {
|
|
412
|
-
C(g.throw(e));
|
|
413
|
-
} catch (e) {
|
|
414
|
-
y(e);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
function C(e) {
|
|
418
|
-
e.done ? h(e.value) : v(e.value).then(b, S);
|
|
419
|
-
}
|
|
420
|
-
C((g = g.apply(e, m || [])).next());
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
function pt(e) {
|
|
424
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
425
|
-
}
|
|
426
|
-
var fe, Pe;
|
|
427
|
-
function ft() {
|
|
428
|
-
return Pe || (Pe = 1, fe = function e(m, h) {
|
|
429
|
-
if (m === h) return !0;
|
|
430
|
-
if (m && h && typeof m == "object" && typeof h == "object") {
|
|
431
|
-
if (m.constructor !== h.constructor) return !1;
|
|
432
|
-
var g, v, y;
|
|
433
|
-
if (Array.isArray(m)) {
|
|
434
|
-
if (g = m.length, g != h.length) return !1;
|
|
435
|
-
for (v = g; v-- !== 0;) if (!e(m[v], h[v])) return !1;
|
|
436
|
-
return !0;
|
|
437
|
-
}
|
|
438
|
-
if (m.constructor === RegExp) return m.source === h.source && m.flags === h.flags;
|
|
439
|
-
if (m.valueOf !== Object.prototype.valueOf) return m.valueOf() === h.valueOf();
|
|
440
|
-
if (m.toString !== Object.prototype.toString) return m.toString() === h.toString();
|
|
441
|
-
if (y = Object.keys(m), g = y.length, g !== Object.keys(h).length) return !1;
|
|
442
|
-
for (v = g; v-- !== 0;) if (!Object.prototype.hasOwnProperty.call(h, y[v])) return !1;
|
|
443
|
-
for (v = g; v-- !== 0;) {
|
|
444
|
-
var b = y[v];
|
|
445
|
-
if (!e(m[b], h[b])) return !1;
|
|
446
|
-
}
|
|
447
|
-
return !0;
|
|
448
|
-
}
|
|
449
|
-
return m !== m && h !== h;
|
|
450
|
-
}), fe;
|
|
451
|
-
}
|
|
452
|
-
var mt = /* @__PURE__ */ pt(ft()), qe = "__googleMapsScriptId", U;
|
|
453
|
-
(function(e) {
|
|
454
|
-
e[e.INITIALIZED = 0] = "INITIALIZED", e[e.LOADING = 1] = "LOADING", e[e.SUCCESS = 2] = "SUCCESS", e[e.FAILURE = 3] = "FAILURE";
|
|
455
|
-
})(U ||= {});
|
|
456
|
-
var N = class e {
|
|
457
|
-
constructor({ apiKey: m, authReferrerPolicy: h, channel: g, client: v, id: y = qe, language: b, libraries: S = [], mapIds: C, nonce: w, region: T, retries: E = 3, url: O = "https://maps.googleapis.com/maps/api/js", version: k }) {
|
|
458
|
-
if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = m, this.authReferrerPolicy = h, this.channel = g, this.client = v, this.id = y || qe, this.language = b, this.libraries = S, this.mapIds = C, this.nonce = w, this.region = T, this.retries = E, this.url = O, this.version = k, e.instance) {
|
|
459
|
-
if (!mt(this.options, e.instance.options)) throw Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(e.instance.options)}`);
|
|
460
|
-
return e.instance;
|
|
461
|
-
}
|
|
462
|
-
e.instance = this;
|
|
463
|
-
}
|
|
464
|
-
get options() {
|
|
465
|
-
return {
|
|
466
|
-
version: this.version,
|
|
467
|
-
apiKey: this.apiKey,
|
|
468
|
-
channel: this.channel,
|
|
469
|
-
client: this.client,
|
|
470
|
-
id: this.id,
|
|
471
|
-
libraries: this.libraries,
|
|
472
|
-
language: this.language,
|
|
473
|
-
region: this.region,
|
|
474
|
-
mapIds: this.mapIds,
|
|
475
|
-
nonce: this.nonce,
|
|
476
|
-
url: this.url,
|
|
477
|
-
authReferrerPolicy: this.authReferrerPolicy
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
get status() {
|
|
481
|
-
return this.errors.length ? U.FAILURE : this.done ? U.SUCCESS : this.loading ? U.LOADING : U.INITIALIZED;
|
|
482
|
-
}
|
|
483
|
-
get failed() {
|
|
484
|
-
return this.done && !this.loading && this.errors.length >= this.retries + 1;
|
|
485
|
-
}
|
|
486
|
-
createUrl() {
|
|
487
|
-
let e = this.url;
|
|
488
|
-
return e += "?callback=__googleMapsCallback&loading=async", this.apiKey && (e += `&key=${this.apiKey}`), this.channel && (e += `&channel=${this.channel}`), this.client && (e += `&client=${this.client}`), this.libraries.length > 0 && (e += `&libraries=${this.libraries.join(",")}`), this.language && (e += `&language=${this.language}`), this.region && (e += `®ion=${this.region}`), this.version && (e += `&v=${this.version}`), this.mapIds && (e += `&map_ids=${this.mapIds.join(",")}`), this.authReferrerPolicy && (e += `&auth_referrer_policy=${this.authReferrerPolicy}`), e;
|
|
489
|
-
}
|
|
490
|
-
deleteScript() {
|
|
491
|
-
let e = document.getElementById(this.id);
|
|
492
|
-
e && e.remove();
|
|
493
|
-
}
|
|
494
|
-
load() {
|
|
495
|
-
return this.loadPromise();
|
|
496
|
-
}
|
|
497
|
-
loadPromise() {
|
|
498
|
-
return new Promise((e, m) => {
|
|
499
|
-
this.loadCallback((h) => {
|
|
500
|
-
h ? m(h.error) : e(window.google);
|
|
501
|
-
});
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
importLibrary(e) {
|
|
505
|
-
return this.execute(), google.maps.importLibrary(e);
|
|
506
|
-
}
|
|
507
|
-
loadCallback(e) {
|
|
508
|
-
this.callbacks.push(e), this.execute();
|
|
509
|
-
}
|
|
510
|
-
setScript() {
|
|
511
|
-
var e;
|
|
512
|
-
if (document.getElementById(this.id)) {
|
|
513
|
-
this.callback();
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
let m = {
|
|
517
|
-
key: this.apiKey,
|
|
518
|
-
channel: this.channel,
|
|
519
|
-
client: this.client,
|
|
520
|
-
libraries: this.libraries.length && this.libraries,
|
|
521
|
-
v: this.version,
|
|
522
|
-
mapIds: this.mapIds,
|
|
523
|
-
language: this.language,
|
|
524
|
-
region: this.region,
|
|
525
|
-
authReferrerPolicy: this.authReferrerPolicy
|
|
526
|
-
};
|
|
527
|
-
Object.keys(m).forEach((e) => !m[e] && delete m[e]), (e = (window == null ? void 0 : window.google)?.maps) != null && e.importLibrary || ((e) => {
|
|
528
|
-
let m, h, g, v = "The Google Maps JavaScript API", y = "google", b = "importLibrary", S = document, C = window;
|
|
529
|
-
C = C[y] || (C[y] = {});
|
|
530
|
-
let w = C.maps ||= {}, T = /* @__PURE__ */ new Set(), E = new URLSearchParams(), O = () => m ||= new Promise((b, C) => dt(this, void 0, void 0, function* () {
|
|
531
|
-
for (g in yield h = S.createElement("script"), h.id = this.id, E.set("libraries", [...T] + ""), e) E.set(g.replace(/[A-Z]/g, (e) => "_" + e[0].toLowerCase()), e[g]);
|
|
532
|
-
E.set("callback", y + ".maps.__ib__"), h.src = this.url + "?" + E, w.__ib__ = b, h.onerror = () => m = C(Error(v + " could not load.")), h.nonce = this.nonce || S.querySelector("script[nonce]")?.nonce || "", S.head.append(h);
|
|
533
|
-
}));
|
|
534
|
-
w[b] ? console.warn(v + " only loads once. Ignoring:", e) : w[b] = (e, ...m) => T.add(e) && O().then(() => w[b](e, ...m));
|
|
535
|
-
})(m);
|
|
536
|
-
let h = this.libraries.map((e) => this.importLibrary(e));
|
|
537
|
-
h.length || h.push(this.importLibrary("core")), Promise.all(h).then(() => this.callback(), (e) => {
|
|
538
|
-
let m = new ErrorEvent("error", { error: e });
|
|
539
|
-
this.loadErrorCallback(m);
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
reset() {
|
|
543
|
-
this.deleteScript(), this.done = !1, this.loading = !1, this.errors = [], this.onerrorEvent = null;
|
|
544
|
-
}
|
|
545
|
-
resetIfRetryingFailed() {
|
|
546
|
-
this.failed && this.reset();
|
|
547
|
-
}
|
|
548
|
-
loadErrorCallback(e) {
|
|
549
|
-
if (this.errors.push(e), this.errors.length <= this.retries) {
|
|
550
|
-
let e = this.errors.length * 2 ** this.errors.length;
|
|
551
|
-
console.error(`Failed to load Google Maps script, retrying in ${e} ms.`), setTimeout(() => {
|
|
552
|
-
this.deleteScript(), this.setScript();
|
|
553
|
-
}, e);
|
|
554
|
-
} else this.onerrorEvent = e, this.callback();
|
|
555
|
-
}
|
|
556
|
-
callback() {
|
|
557
|
-
this.done = !0, this.loading = !1, this.callbacks.forEach((e) => {
|
|
558
|
-
e(this.onerrorEvent);
|
|
559
|
-
}), this.callbacks = [];
|
|
560
|
-
}
|
|
561
|
-
execute() {
|
|
562
|
-
if (this.resetIfRetryingFailed(), !this.loading) if (this.done) this.callback();
|
|
563
|
-
else {
|
|
564
|
-
if (window.google && window.google.maps && window.google.maps.version) {
|
|
565
|
-
console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."), this.callback();
|
|
566
|
-
return;
|
|
567
|
-
}
|
|
568
|
-
this.loading = !0, this.setScript();
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
function gt(e) {
|
|
573
|
-
return class extends e.OverlayView {
|
|
574
|
-
constructor(e) {
|
|
575
|
-
super(), pe(this, "element"), pe(this, "opts");
|
|
576
|
-
let { element: m, ...h } = e;
|
|
577
|
-
this.element = m, this.opts = h, this.opts.map && this.setMap(this.opts.map);
|
|
578
|
-
}
|
|
579
|
-
getPosition() {
|
|
580
|
-
return this.opts.position ? this.opts.position instanceof e.LatLng ? this.opts.position : new e.LatLng(this.opts.position) : null;
|
|
581
|
-
}
|
|
582
|
-
getVisible() {
|
|
583
|
-
if (!this.element) return !1;
|
|
584
|
-
let e = this.element;
|
|
585
|
-
return e.style.display !== "none" && e.style.visibility !== "hidden" && (e.style.opacity === "" || Number(e.style.opacity) > .01);
|
|
586
|
-
}
|
|
587
|
-
onAdd() {
|
|
588
|
-
if (!this.element) return;
|
|
589
|
-
let e = this.getPanes();
|
|
590
|
-
e && e.overlayMouseTarget.appendChild(this.element);
|
|
591
|
-
}
|
|
592
|
-
draw() {
|
|
593
|
-
if (!this.element) return;
|
|
594
|
-
let e = this.getProjection()?.fromLatLngToDivPixel(this.getPosition());
|
|
595
|
-
if (e) {
|
|
596
|
-
this.element.style.position = "absolute";
|
|
597
|
-
let m, h;
|
|
598
|
-
switch (this.opts.anchorPoint) {
|
|
599
|
-
case "TOP_CENTER":
|
|
600
|
-
m = "-50%", h = "-100%";
|
|
601
|
-
break;
|
|
602
|
-
case "BOTTOM_CENTER":
|
|
603
|
-
m = "-50%", h = "0";
|
|
604
|
-
break;
|
|
605
|
-
case "LEFT_CENTER":
|
|
606
|
-
m = "-100%", h = "-50%";
|
|
607
|
-
break;
|
|
608
|
-
case "RIGHT_CENTER":
|
|
609
|
-
m = "0", h = "-50%";
|
|
610
|
-
break;
|
|
611
|
-
case "TOP_LEFT":
|
|
612
|
-
m = "-100%", h = "-100%";
|
|
613
|
-
break;
|
|
614
|
-
case "TOP_RIGHT":
|
|
615
|
-
m = "0", h = "-100%";
|
|
616
|
-
break;
|
|
617
|
-
case "BOTTOM_LEFT":
|
|
618
|
-
m = "-100%", h = "0";
|
|
619
|
-
break;
|
|
620
|
-
case "BOTTOM_RIGHT":
|
|
621
|
-
m = "0", h = "0";
|
|
622
|
-
break;
|
|
623
|
-
default: m = "-50%", h = "-50%";
|
|
624
|
-
}
|
|
625
|
-
let g = e.x + (this.opts.offsetX || 0) + "px", v = e.y + (this.opts.offsetY || 0) + "px";
|
|
626
|
-
this.element.style.transform = `translateX(${m}) translateX(${g}) translateY(${h}) translateY(${v})`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString());
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
onRemove() {
|
|
630
|
-
this.element && this.element.remove();
|
|
631
|
-
}
|
|
632
|
-
setOptions(e) {
|
|
633
|
-
let { element: m, ...h } = e;
|
|
634
|
-
this.element = m, this.opts = h, this.draw();
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
var Se, Ae = [
|
|
639
|
-
"bounds_changed",
|
|
640
|
-
"center_changed",
|
|
641
|
-
"click",
|
|
642
|
-
"contextmenu",
|
|
643
|
-
"dblclick",
|
|
644
|
-
"drag",
|
|
645
|
-
"dragend",
|
|
646
|
-
"dragstart",
|
|
647
|
-
"heading_changed",
|
|
648
|
-
"idle",
|
|
649
|
-
"isfractionalzoomenabled_changed",
|
|
650
|
-
"mapcapabilities_changed",
|
|
651
|
-
"maptypeid_changed",
|
|
652
|
-
"mousemove",
|
|
653
|
-
"mouseout",
|
|
654
|
-
"mouseover",
|
|
655
|
-
"projection_changed",
|
|
656
|
-
"renderingtype_changed",
|
|
657
|
-
"rightclick",
|
|
658
|
-
"tilesloaded",
|
|
659
|
-
"tilt_changed",
|
|
660
|
-
"zoom_changed"
|
|
661
|
-
], vt = defineComponent({
|
|
662
|
-
props: {
|
|
663
|
-
apiPromise: { type: Promise },
|
|
664
|
-
apiKey: {
|
|
665
|
-
type: String,
|
|
666
|
-
default: ""
|
|
667
|
-
},
|
|
668
|
-
version: {
|
|
669
|
-
type: String,
|
|
670
|
-
default: "weekly"
|
|
671
|
-
},
|
|
672
|
-
libraries: {
|
|
673
|
-
type: Array,
|
|
674
|
-
default: () => ["places", "marker"]
|
|
675
|
-
},
|
|
676
|
-
region: {
|
|
677
|
-
type: String,
|
|
678
|
-
required: !1
|
|
679
|
-
},
|
|
680
|
-
language: {
|
|
681
|
-
type: String,
|
|
682
|
-
required: !1
|
|
683
|
-
},
|
|
684
|
-
backgroundColor: {
|
|
685
|
-
type: String,
|
|
686
|
-
required: !1
|
|
687
|
-
},
|
|
688
|
-
center: {
|
|
689
|
-
type: Object,
|
|
690
|
-
default: () => ({
|
|
691
|
-
lat: 0,
|
|
692
|
-
lng: 0
|
|
693
|
-
})
|
|
694
|
-
},
|
|
695
|
-
clickableIcons: {
|
|
696
|
-
type: Boolean,
|
|
697
|
-
required: !1,
|
|
698
|
-
default: void 0
|
|
699
|
-
},
|
|
700
|
-
colorScheme: {
|
|
701
|
-
type: String,
|
|
702
|
-
required: !1
|
|
703
|
-
},
|
|
704
|
-
controlSize: {
|
|
705
|
-
type: Number,
|
|
706
|
-
required: !1
|
|
707
|
-
},
|
|
708
|
-
disableDefaultUi: {
|
|
709
|
-
type: Boolean,
|
|
710
|
-
required: !1,
|
|
711
|
-
default: void 0
|
|
712
|
-
},
|
|
713
|
-
disableDoubleClickZoom: {
|
|
714
|
-
type: Boolean,
|
|
715
|
-
required: !1,
|
|
716
|
-
default: void 0
|
|
717
|
-
},
|
|
718
|
-
draggable: {
|
|
719
|
-
type: Boolean,
|
|
720
|
-
required: !1,
|
|
721
|
-
default: void 0
|
|
722
|
-
},
|
|
723
|
-
draggableCursor: {
|
|
724
|
-
type: String,
|
|
725
|
-
required: !1
|
|
726
|
-
},
|
|
727
|
-
draggingCursor: {
|
|
728
|
-
type: String,
|
|
729
|
-
required: !1
|
|
730
|
-
},
|
|
731
|
-
fullscreenControl: {
|
|
732
|
-
type: Boolean,
|
|
733
|
-
required: !1,
|
|
734
|
-
default: void 0
|
|
735
|
-
},
|
|
736
|
-
fullscreenControlPosition: {
|
|
737
|
-
type: String,
|
|
738
|
-
required: !1
|
|
739
|
-
},
|
|
740
|
-
gestureHandling: {
|
|
741
|
-
type: String,
|
|
742
|
-
required: !1
|
|
743
|
-
},
|
|
744
|
-
heading: {
|
|
745
|
-
type: Number,
|
|
746
|
-
required: !1
|
|
747
|
-
},
|
|
748
|
-
isFractionalZoomEnabled: {
|
|
749
|
-
type: Boolean,
|
|
750
|
-
required: !1,
|
|
751
|
-
default: void 0
|
|
752
|
-
},
|
|
753
|
-
keyboardShortcuts: {
|
|
754
|
-
type: Boolean,
|
|
755
|
-
required: !1,
|
|
756
|
-
default: void 0
|
|
757
|
-
},
|
|
758
|
-
mapTypeControl: {
|
|
759
|
-
type: Boolean,
|
|
760
|
-
required: !1,
|
|
761
|
-
default: void 0
|
|
762
|
-
},
|
|
763
|
-
mapTypeControlOptions: {
|
|
764
|
-
type: Object,
|
|
765
|
-
required: !1
|
|
766
|
-
},
|
|
767
|
-
mapTypeId: {
|
|
768
|
-
type: [Number, String],
|
|
769
|
-
required: !1
|
|
770
|
-
},
|
|
771
|
-
mapId: {
|
|
772
|
-
type: String,
|
|
773
|
-
required: !1
|
|
774
|
-
},
|
|
775
|
-
maxZoom: {
|
|
776
|
-
type: Number,
|
|
777
|
-
required: !1
|
|
778
|
-
},
|
|
779
|
-
minZoom: {
|
|
780
|
-
type: Number,
|
|
781
|
-
required: !1
|
|
782
|
-
},
|
|
783
|
-
noClear: {
|
|
784
|
-
type: Boolean,
|
|
785
|
-
required: !1,
|
|
786
|
-
default: void 0
|
|
787
|
-
},
|
|
788
|
-
panControl: {
|
|
789
|
-
type: Boolean,
|
|
790
|
-
required: !1,
|
|
791
|
-
default: void 0
|
|
792
|
-
},
|
|
793
|
-
panControlPosition: {
|
|
794
|
-
type: String,
|
|
795
|
-
required: !1
|
|
796
|
-
},
|
|
797
|
-
restriction: {
|
|
798
|
-
type: Object,
|
|
799
|
-
required: !1
|
|
800
|
-
},
|
|
801
|
-
rotateControl: {
|
|
802
|
-
type: Boolean,
|
|
803
|
-
required: !1,
|
|
804
|
-
default: void 0
|
|
805
|
-
},
|
|
806
|
-
rotateControlPosition: {
|
|
807
|
-
type: String,
|
|
808
|
-
required: !1
|
|
809
|
-
},
|
|
810
|
-
scaleControl: {
|
|
811
|
-
type: Boolean,
|
|
812
|
-
required: !1,
|
|
813
|
-
default: void 0
|
|
814
|
-
},
|
|
815
|
-
scaleControlStyle: {
|
|
816
|
-
type: Number,
|
|
817
|
-
required: !1
|
|
818
|
-
},
|
|
819
|
-
scrollwheel: {
|
|
820
|
-
type: Boolean,
|
|
821
|
-
required: !1,
|
|
822
|
-
default: void 0
|
|
823
|
-
},
|
|
824
|
-
streetView: {
|
|
825
|
-
type: Object,
|
|
826
|
-
required: !1
|
|
827
|
-
},
|
|
828
|
-
streetViewControl: {
|
|
829
|
-
type: Boolean,
|
|
830
|
-
required: !1,
|
|
831
|
-
default: void 0
|
|
832
|
-
},
|
|
833
|
-
streetViewControlPosition: {
|
|
834
|
-
type: String,
|
|
835
|
-
required: !1
|
|
836
|
-
},
|
|
837
|
-
styles: {
|
|
838
|
-
type: Array,
|
|
839
|
-
required: !1
|
|
840
|
-
},
|
|
841
|
-
tilt: {
|
|
842
|
-
type: Number,
|
|
843
|
-
required: !1
|
|
844
|
-
},
|
|
845
|
-
zoom: {
|
|
846
|
-
type: Number,
|
|
847
|
-
required: !1
|
|
848
|
-
},
|
|
849
|
-
zoomControl: {
|
|
850
|
-
type: Boolean,
|
|
851
|
-
required: !1,
|
|
852
|
-
default: void 0
|
|
853
|
-
},
|
|
854
|
-
zoomControlPosition: {
|
|
855
|
-
type: String,
|
|
856
|
-
required: !1
|
|
857
|
-
},
|
|
858
|
-
cameraControl: {
|
|
859
|
-
type: Boolean,
|
|
860
|
-
required: !1,
|
|
861
|
-
default: void 0
|
|
862
|
-
},
|
|
863
|
-
cameraControlPosition: {
|
|
864
|
-
type: String,
|
|
865
|
-
required: !1
|
|
866
|
-
},
|
|
867
|
-
nonce: {
|
|
868
|
-
type: String,
|
|
869
|
-
default: ""
|
|
870
|
-
}
|
|
871
|
-
},
|
|
872
|
-
emits: Ae,
|
|
873
|
-
setup(e, { emit: m }) {
|
|
874
|
-
let h = ref(), g = ref(!1), v = ref(), y = ref(), b = ref(!1);
|
|
875
|
-
provide(D, v), provide(Z, y), provide(Xe, b);
|
|
876
|
-
let S = () => {
|
|
877
|
-
let m = { ...e };
|
|
878
|
-
Object.keys(m).forEach((e) => {
|
|
879
|
-
m[e] === void 0 && delete m[e];
|
|
880
|
-
});
|
|
881
|
-
let h = (e) => e ? { position: y.value?.ControlPosition[e] } : {}, g = {
|
|
882
|
-
scaleControlOptions: e.scaleControlStyle ? { style: e.scaleControlStyle } : {},
|
|
883
|
-
panControlOptions: h(e.panControlPosition),
|
|
884
|
-
zoomControlOptions: h(e.zoomControlPosition),
|
|
885
|
-
rotateControlOptions: h(e.rotateControlPosition),
|
|
886
|
-
streetViewControlOptions: h(e.streetViewControlPosition),
|
|
887
|
-
fullscreenControlOptions: h(e.fullscreenControlPosition),
|
|
888
|
-
cameraControlOptions: h(e.cameraControlPosition),
|
|
889
|
-
disableDefaultUI: e.disableDefaultUi
|
|
890
|
-
};
|
|
891
|
-
return {
|
|
892
|
-
...m,
|
|
893
|
-
...g
|
|
894
|
-
};
|
|
895
|
-
}, C = watch([y, v], ([e, m]) => {
|
|
896
|
-
let h = e, g = m;
|
|
897
|
-
h && g && (h.event.addListenerOnce(g, "tilesloaded", () => {
|
|
898
|
-
b.value = !0;
|
|
899
|
-
}), setTimeout(C, 0));
|
|
900
|
-
}, { immediate: !0 }), w = () => {
|
|
901
|
-
try {
|
|
902
|
-
let { apiKey: m, region: h, version: g, language: v, libraries: y, nonce: b } = e;
|
|
903
|
-
Se = new N({
|
|
904
|
-
apiKey: m,
|
|
905
|
-
region: h,
|
|
906
|
-
version: g,
|
|
907
|
-
language: v,
|
|
908
|
-
libraries: y,
|
|
909
|
-
nonce: b
|
|
910
|
-
});
|
|
911
|
-
} catch (e) {
|
|
912
|
-
console.error(e);
|
|
913
|
-
}
|
|
914
|
-
}, T = (b) => {
|
|
915
|
-
y.value = markRaw(b.maps), v.value = markRaw(new b.maps.Map(h.value, S()));
|
|
916
|
-
let C = gt(y.value);
|
|
917
|
-
y.value[ue] = C, Ae.forEach((e) => {
|
|
918
|
-
var h;
|
|
919
|
-
(h = v.value) == null || h.addListener(e, (h) => m(e, h));
|
|
920
|
-
}), g.value = !0, watch([
|
|
921
|
-
() => e.center,
|
|
922
|
-
() => e.zoom,
|
|
923
|
-
...Object.keys(e).filter((e) => ![
|
|
924
|
-
"apiPromise",
|
|
925
|
-
"apiKey",
|
|
926
|
-
"version",
|
|
927
|
-
"libraries",
|
|
928
|
-
"region",
|
|
929
|
-
"language",
|
|
930
|
-
"center",
|
|
931
|
-
"zoom",
|
|
932
|
-
"nonce"
|
|
933
|
-
].includes(e)).map((m) => toRef(e, m))
|
|
934
|
-
], ([e, m], [h, g]) => {
|
|
935
|
-
var y, b, C;
|
|
936
|
-
let { center: w, zoom: T, ...E } = S();
|
|
937
|
-
(y = v.value) == null || y.setOptions(E), m !== void 0 && m !== g && ((b = v.value) == null || b.setZoom(m));
|
|
938
|
-
let O = !h || e.lng !== h.lng || e.lat !== h.lat;
|
|
939
|
-
e && O && ((C = v.value) == null || C.panTo(e));
|
|
940
|
-
});
|
|
941
|
-
};
|
|
942
|
-
return onMounted(() => {
|
|
943
|
-
e.apiPromise && e.apiPromise instanceof Promise ? e.apiPromise.then(T) : (w(), Se.load().then(T));
|
|
944
|
-
}), onBeforeUnmount(() => {
|
|
945
|
-
var e;
|
|
946
|
-
b.value = !1, v.value && ((e = y.value) == null || e.event.clearInstanceListeners(v.value));
|
|
947
|
-
}), {
|
|
948
|
-
mapRef: h,
|
|
949
|
-
ready: g,
|
|
950
|
-
map: v,
|
|
951
|
-
api: y,
|
|
952
|
-
mapTilesLoaded: b
|
|
953
|
-
};
|
|
954
|
-
}
|
|
955
|
-
}), re = (e, m) => {
|
|
956
|
-
let h = e.__vccOpts || e;
|
|
957
|
-
for (let [e, g] of m) h[e] = g;
|
|
958
|
-
return h;
|
|
959
|
-
}, yt = {
|
|
960
|
-
ref: "mapRef",
|
|
961
|
-
class: "mapdiv"
|
|
962
|
-
};
|
|
963
|
-
function wt(e, m, h, g, v, y) {
|
|
964
|
-
return openBlock(), createElementBlock("div", null, [createElementVNode("div", yt, null, 512), renderSlot(e.$slots, "default", normalizeProps(guardReactiveProps({
|
|
965
|
-
ready: e.ready,
|
|
966
|
-
map: e.map,
|
|
967
|
-
api: e.api,
|
|
968
|
-
mapTilesLoaded: e.mapTilesLoaded
|
|
969
|
-
})), void 0, !0)]);
|
|
970
|
-
}
|
|
971
|
-
var Ir = /* @__PURE__ */ re(vt, [["render", wt], ["__scopeId", "data-v-289550ca"]]);
|
|
972
|
-
function Et(e) {
|
|
973
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
974
|
-
}
|
|
975
|
-
var ee = /* @__PURE__ */ Et(function e(m, h) {
|
|
976
|
-
if (m === h) return !0;
|
|
977
|
-
if (m && h && typeof m == "object" && typeof h == "object") {
|
|
978
|
-
if (m.constructor !== h.constructor) return !1;
|
|
979
|
-
var g, v, y;
|
|
980
|
-
if (Array.isArray(m)) {
|
|
981
|
-
if (g = m.length, g != h.length) return !1;
|
|
982
|
-
for (v = g; v-- !== 0;) if (!e(m[v], h[v])) return !1;
|
|
983
|
-
return !0;
|
|
984
|
-
}
|
|
985
|
-
if (m.constructor === RegExp) return m.source === h.source && m.flags === h.flags;
|
|
986
|
-
if (m.valueOf !== Object.prototype.valueOf) return m.valueOf() === h.valueOf();
|
|
987
|
-
if (m.toString !== Object.prototype.toString) return m.toString() === h.toString();
|
|
988
|
-
if (y = Object.keys(m), g = y.length, g !== Object.keys(h).length) return !1;
|
|
989
|
-
for (v = g; v-- !== 0;) if (!Object.prototype.hasOwnProperty.call(h, y[v])) return !1;
|
|
990
|
-
for (v = g; v-- !== 0;) {
|
|
991
|
-
var b = y[v];
|
|
992
|
-
if (!e(m[b], h[b])) return !1;
|
|
993
|
-
}
|
|
994
|
-
return !0;
|
|
995
|
-
}
|
|
996
|
-
return m !== m && h !== h;
|
|
997
|
-
}), Te = [
|
|
998
|
-
"click",
|
|
999
|
-
"drag",
|
|
1000
|
-
"dragend",
|
|
1001
|
-
"dragstart",
|
|
1002
|
-
"gmp-click"
|
|
1003
|
-
];
|
|
1004
|
-
defineComponent({
|
|
1005
|
-
name: "AdvancedMarker",
|
|
1006
|
-
props: {
|
|
1007
|
-
options: {
|
|
1008
|
-
type: Object,
|
|
1009
|
-
required: !0
|
|
1010
|
-
},
|
|
1011
|
-
pinOptions: {
|
|
1012
|
-
type: Object,
|
|
1013
|
-
required: !1
|
|
1014
|
-
}
|
|
1015
|
-
},
|
|
1016
|
-
emits: Te,
|
|
1017
|
-
setup(e, { emit: m, expose: h, slots: g }) {
|
|
1018
|
-
let v = ref(), y = computed(() => g.content?.call(g).some((e) => e.type !== Comment)), b = toRef(e, "options"), S = toRef(e, "pinOptions"), C = ref(), w = inject(D, ref()), T = inject(Z, ref()), E = inject(ke, ref()), O = computed(() => !!(E.value && T.value && C.value instanceof google.maps.marker.AdvancedMarkerElement));
|
|
1019
|
-
return watch([
|
|
1020
|
-
w,
|
|
1021
|
-
b,
|
|
1022
|
-
S,
|
|
1023
|
-
v
|
|
1024
|
-
], async (e, [h, g, k, j]) => {
|
|
1025
|
-
var M, P, B;
|
|
1026
|
-
let V = !ee(b.value, g) || !ee(S.value, k), W = v.value !== j, G = V || W || w.value !== h;
|
|
1027
|
-
if (!w.value || !T.value || !G || y.value && !v.value) return;
|
|
1028
|
-
let { AdvancedMarkerElement: K, PinElement: q } = T.value.marker;
|
|
1029
|
-
if (C.value) {
|
|
1030
|
-
let { map: e, content: m, ...h } = b.value;
|
|
1031
|
-
Object.assign(C.value, {
|
|
1032
|
-
content: y.value ? v.value : S.value ? new q(S.value).element : m,
|
|
1033
|
-
...h
|
|
1034
|
-
}), O.value && ((M = E.value) == null || M.removeMarker(C.value), (P = E.value) == null || P.addMarker(C.value));
|
|
1035
|
-
} else y.value ? b.value.content = v.value : S.value && (b.value.content = new q(S.value).element), C.value = markRaw(new K(b.value)), O.value ? (B = E.value) == null || B.addMarker(C.value) : C.value.map = w.value, Te.forEach((e) => {
|
|
1036
|
-
var h;
|
|
1037
|
-
(h = C.value) == null || h.addListener(e, (h) => m(e, h));
|
|
1038
|
-
});
|
|
1039
|
-
}, {
|
|
1040
|
-
immediate: !0,
|
|
1041
|
-
flush: "post"
|
|
1042
|
-
}), onBeforeUnmount(() => {
|
|
1043
|
-
var e, m;
|
|
1044
|
-
C.value && ((e = T.value) == null || e.event.clearInstanceListeners(C.value), O.value ? (m = E.value) == null || m.removeMarker(C.value) : C.value.map = null);
|
|
1045
|
-
}), provide(_e, C), h({ marker: C }), {
|
|
1046
|
-
hasCustomSlotContent: y,
|
|
1047
|
-
markerRef: v
|
|
1048
|
-
};
|
|
1049
|
-
}
|
|
1050
|
-
});
|
|
1051
|
-
var Le = (e) => e === "Marker", xe = (e) => e === ue, J = (e, m, h, g) => {
|
|
1052
|
-
let v = ref(), y = inject(D, ref()), b = inject(Z, ref()), S = inject(ke, ref()), C = computed(() => !!(S.value && b.value && (v.value instanceof b.value.Marker || v.value instanceof b.value[ue])));
|
|
1053
|
-
return watch([y, h], (w, [T, E]) => {
|
|
1054
|
-
var O, k, j;
|
|
1055
|
-
let M = !ee(h.value, E) || y.value !== T;
|
|
1056
|
-
if (!(!y.value || !b.value || !M)) if (v.value) v.value.setOptions(h.value), C.value && ((O = S.value) == null || O.removeMarker(v.value), (k = S.value) == null || k.addMarker(v.value));
|
|
1057
|
-
else {
|
|
1058
|
-
if (Le(e)) v.value = markRaw(new b.value[e](h.value));
|
|
1059
|
-
else if (xe(e)) {
|
|
1060
|
-
let m = h.value;
|
|
1061
|
-
m.element && (v.value = markRaw(new b.value[e](m)));
|
|
1062
|
-
} else v.value = markRaw(new b.value[e]({
|
|
1063
|
-
...h.value,
|
|
1064
|
-
map: y.value
|
|
1065
|
-
}));
|
|
1066
|
-
v.value && (C.value ? (j = S.value) == null || j.addMarker(v.value) : (Le(e) || xe(e)) && v.value.setMap(y.value)), m.forEach((e) => {
|
|
1067
|
-
var m;
|
|
1068
|
-
(m = v.value) == null || m.addListener(e, (m) => g(e, m));
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
}, {
|
|
1072
|
-
immediate: !0,
|
|
1073
|
-
flush: "post"
|
|
1074
|
-
}), onBeforeUnmount(() => {
|
|
1075
|
-
var e, m;
|
|
1076
|
-
v.value && ((e = b.value) == null || e.event.clearInstanceListeners(v.value), C.value ? (m = S.value) == null || m.removeMarker(v.value) : v.value.setMap(null));
|
|
1077
|
-
}), v;
|
|
1078
|
-
}, Ie = [
|
|
1079
|
-
"animation_changed",
|
|
1080
|
-
"click",
|
|
1081
|
-
"dblclick",
|
|
1082
|
-
"rightclick",
|
|
1083
|
-
"dragstart",
|
|
1084
|
-
"dragend",
|
|
1085
|
-
"drag",
|
|
1086
|
-
"mouseover",
|
|
1087
|
-
"mousedown",
|
|
1088
|
-
"mouseout",
|
|
1089
|
-
"mouseup",
|
|
1090
|
-
"draggable_changed",
|
|
1091
|
-
"clickable_changed",
|
|
1092
|
-
"contextmenu",
|
|
1093
|
-
"cursor_changed",
|
|
1094
|
-
"flat_changed",
|
|
1095
|
-
"zindex_changed",
|
|
1096
|
-
"icon_changed",
|
|
1097
|
-
"position_changed",
|
|
1098
|
-
"shape_changed",
|
|
1099
|
-
"title_changed",
|
|
1100
|
-
"visible_changed"
|
|
1101
|
-
];
|
|
1102
|
-
defineComponent({
|
|
1103
|
-
name: "Marker",
|
|
1104
|
-
props: { options: {
|
|
1105
|
-
type: Object,
|
|
1106
|
-
required: !0
|
|
1107
|
-
} },
|
|
1108
|
-
emits: Ie,
|
|
1109
|
-
setup(e, { emit: m, expose: h, slots: g }) {
|
|
1110
|
-
let v = J("Marker", Ie, toRef(e, "options"), m);
|
|
1111
|
-
return provide(_e, v), h({ marker: v }), () => g.default?.call(g);
|
|
1112
|
-
}
|
|
1113
|
-
}), defineComponent({
|
|
1114
|
-
name: "Polyline",
|
|
1115
|
-
props: { options: {
|
|
1116
|
-
type: Object,
|
|
1117
|
-
required: !0
|
|
1118
|
-
} },
|
|
1119
|
-
emits: H,
|
|
1120
|
-
setup(e, { emit: m }) {
|
|
1121
|
-
return { polyline: J("Polyline", H, toRef(e, "options"), m) };
|
|
1122
|
-
},
|
|
1123
|
-
render: () => null
|
|
1124
|
-
}), defineComponent({
|
|
1125
|
-
name: "Polygon",
|
|
1126
|
-
props: { options: {
|
|
1127
|
-
type: Object,
|
|
1128
|
-
required: !0
|
|
1129
|
-
} },
|
|
1130
|
-
emits: H,
|
|
1131
|
-
setup(e, { emit: m }) {
|
|
1132
|
-
return { polygon: J("Polygon", H, toRef(e, "options"), m) };
|
|
1133
|
-
},
|
|
1134
|
-
render: () => null
|
|
1135
|
-
});
|
|
1136
|
-
var je = H.concat(["bounds_changed"]);
|
|
1137
|
-
defineComponent({
|
|
1138
|
-
name: "Rectangle",
|
|
1139
|
-
props: { options: {
|
|
1140
|
-
type: Object,
|
|
1141
|
-
required: !0
|
|
1142
|
-
} },
|
|
1143
|
-
emits: je,
|
|
1144
|
-
setup(e, { emit: m }) {
|
|
1145
|
-
return { rectangle: J("Rectangle", je, toRef(e, "options"), m) };
|
|
1146
|
-
},
|
|
1147
|
-
render: () => null
|
|
1148
|
-
});
|
|
1149
|
-
var Re = H.concat(["center_changed", "radius_changed"]);
|
|
1150
|
-
defineComponent({
|
|
1151
|
-
name: "Circle",
|
|
1152
|
-
props: { options: {
|
|
1153
|
-
type: Object,
|
|
1154
|
-
required: !0
|
|
1155
|
-
} },
|
|
1156
|
-
emits: Re,
|
|
1157
|
-
setup(e, { emit: m }) {
|
|
1158
|
-
return { circle: J("Circle", Re, toRef(e, "options"), m) };
|
|
1159
|
-
},
|
|
1160
|
-
render: () => null
|
|
1161
|
-
}), defineComponent({
|
|
1162
|
-
props: {
|
|
1163
|
-
position: {
|
|
1164
|
-
type: String,
|
|
1165
|
-
required: !0
|
|
1166
|
-
},
|
|
1167
|
-
index: {
|
|
1168
|
-
type: Number,
|
|
1169
|
-
default: 1
|
|
1170
|
-
}
|
|
1171
|
-
},
|
|
1172
|
-
emits: ["content:loaded"],
|
|
1173
|
-
setup(e, { emit: m }) {
|
|
1174
|
-
let h = ref(null), g = inject(D, ref()), v = inject(Z, ref()), y = watch([
|
|
1175
|
-
inject(Xe, ref(!1)),
|
|
1176
|
-
v,
|
|
1177
|
-
h
|
|
1178
|
-
], ([h, g, v]) => {
|
|
1179
|
-
g && h && v && (b(e.position), m("content:loaded"), setTimeout(y, 0));
|
|
1180
|
-
}, { immediate: !0 }), b = (m) => {
|
|
1181
|
-
if (g.value && v.value && h.value) {
|
|
1182
|
-
let y = v.value.ControlPosition[m];
|
|
1183
|
-
h.value.index = e.index, g.value.controls[y].push(h.value);
|
|
1184
|
-
}
|
|
1185
|
-
}, S = (e) => {
|
|
1186
|
-
if (g.value && v.value) {
|
|
1187
|
-
let m = null, y = v.value.ControlPosition[e];
|
|
1188
|
-
g.value.controls[y].forEach((e, g) => {
|
|
1189
|
-
e === h.value && (m = g);
|
|
1190
|
-
}), m !== null && g.value.controls[y].removeAt(m);
|
|
1191
|
-
}
|
|
1192
|
-
};
|
|
1193
|
-
return onBeforeUnmount(() => S(e.position)), watch(() => e.position, (e, m) => {
|
|
1194
|
-
S(m), b(e);
|
|
1195
|
-
}), watch(() => e.index, (e) => {
|
|
1196
|
-
h.value && (h.value.index = e);
|
|
1197
|
-
}), { controlRef: h };
|
|
1198
|
-
}
|
|
1199
|
-
});
|
|
1200
|
-
var $e = [
|
|
1201
|
-
"closeclick",
|
|
1202
|
-
"content_changed",
|
|
1203
|
-
"domready",
|
|
1204
|
-
"position_changed",
|
|
1205
|
-
"visible",
|
|
1206
|
-
"zindex_changed"
|
|
1207
|
-
];
|
|
1208
|
-
defineComponent({
|
|
1209
|
-
inheritAttrs: !1,
|
|
1210
|
-
props: {
|
|
1211
|
-
options: {
|
|
1212
|
-
type: Object,
|
|
1213
|
-
default: () => ({})
|
|
1214
|
-
},
|
|
1215
|
-
modelValue: { type: Boolean }
|
|
1216
|
-
},
|
|
1217
|
-
emits: [...$e, "update:modelValue"],
|
|
1218
|
-
setup(e, { slots: m, emit: h, expose: g }) {
|
|
1219
|
-
let v = ref(), y = ref(), b = inject(D, ref()), S = inject(Z, ref()), C = inject(_e, ref()), w, T = e.modelValue, E = computed(() => m.default?.call(m).some((e) => e.type !== Comment)), O = (e) => {
|
|
1220
|
-
T = e, h("update:modelValue", e);
|
|
1221
|
-
}, k = (e) => {
|
|
1222
|
-
v.value && (v.value.open({
|
|
1223
|
-
map: b.value,
|
|
1224
|
-
anchor: C.value,
|
|
1225
|
-
...e
|
|
1226
|
-
}), O(!0));
|
|
1227
|
-
}, j = () => {
|
|
1228
|
-
v.value && (v.value.close(), O(!1));
|
|
1229
|
-
};
|
|
1230
|
-
return onMounted(() => {
|
|
1231
|
-
watch([b, () => e.options], ([e, m], [g, j]) => {
|
|
1232
|
-
var M;
|
|
1233
|
-
let P = !ee(m, j) || b.value !== g;
|
|
1234
|
-
b.value && S.value && P && (v.value ? (v.value.setOptions({
|
|
1235
|
-
...m,
|
|
1236
|
-
content: E.value ? y.value : m.content
|
|
1237
|
-
}), C.value || k()) : (v.value = markRaw(new S.value.InfoWindow({
|
|
1238
|
-
...m,
|
|
1239
|
-
content: E.value ? y.value : m.content
|
|
1240
|
-
})), C.value && (w = C.value.addListener("click", () => {
|
|
1241
|
-
k();
|
|
1242
|
-
})), (!C.value || T) && k(), $e.forEach((e) => {
|
|
1243
|
-
var m;
|
|
1244
|
-
(m = v.value) == null || m.addListener(e, (m) => h(e, m));
|
|
1245
|
-
}), (M = v.value) == null || M.addListener("closeclick", () => O(!1))));
|
|
1246
|
-
}, {
|
|
1247
|
-
immediate: !0,
|
|
1248
|
-
flush: "post"
|
|
1249
|
-
}), watch(() => e.modelValue, (e) => {
|
|
1250
|
-
e !== T && (e ? k() : j());
|
|
1251
|
-
});
|
|
1252
|
-
}), onBeforeUnmount(() => {
|
|
1253
|
-
var e;
|
|
1254
|
-
w && w.remove(), v.value && ((e = S.value) == null || e.event.clearInstanceListeners(v.value), j());
|
|
1255
|
-
}), g({
|
|
1256
|
-
infoWindow: v,
|
|
1257
|
-
open: k,
|
|
1258
|
-
close: j
|
|
1259
|
-
}), {
|
|
1260
|
-
infoWindow: v,
|
|
1261
|
-
infoWindowRef: y,
|
|
1262
|
-
hasSlotContent: E,
|
|
1263
|
-
open: k,
|
|
1264
|
-
close: j
|
|
1265
|
-
};
|
|
1266
|
-
}
|
|
1267
|
-
});
|
|
1268
|
-
var Tt = Object.getOwnPropertyNames, Lt = Object.getOwnPropertySymbols, xt = Object.prototype.hasOwnProperty;
|
|
1269
|
-
function Ne(e, m) {
|
|
1270
|
-
return function(h, g, v) {
|
|
1271
|
-
return e(h, g, v) && m(h, g, v);
|
|
1272
|
-
};
|
|
1273
|
-
}
|
|
1274
|
-
function se(e) {
|
|
1275
|
-
return function(m, h, g) {
|
|
1276
|
-
if (!m || !h || typeof m != "object" || typeof h != "object") return e(m, h, g);
|
|
1277
|
-
var v = g.cache, y = v.get(m), b = v.get(h);
|
|
1278
|
-
if (y && b) return y === h && b === m;
|
|
1279
|
-
v.set(m, h), v.set(h, m);
|
|
1280
|
-
var S = e(m, h, g);
|
|
1281
|
-
return v.delete(m), v.delete(h), S;
|
|
1282
|
-
};
|
|
1283
|
-
}
|
|
1284
|
-
function Be(e) {
|
|
1285
|
-
return Tt(e).concat(Lt(e));
|
|
1286
|
-
}
|
|
1287
|
-
var It = Object.hasOwn || function(e, m) {
|
|
1288
|
-
return xt.call(e, m);
|
|
1289
|
-
};
|
|
1290
|
-
function F(e, m) {
|
|
1291
|
-
return e === m || !e && !m && e !== e && m !== m;
|
|
1292
|
-
}
|
|
1293
|
-
var jt = "__v", Rt = "__o", $t = "_owner", De = Object.getOwnPropertyDescriptor, Ze = Object.keys;
|
|
1294
|
-
function Nt(e, m, h) {
|
|
1295
|
-
var g = e.length;
|
|
1296
|
-
if (m.length !== g) return !1;
|
|
1297
|
-
for (; g-- > 0;) if (!h.equals(e[g], m[g], g, g, e, m, h)) return !1;
|
|
1298
|
-
return !0;
|
|
1299
|
-
}
|
|
1300
|
-
function Bt(e, m) {
|
|
1301
|
-
return F(e.getTime(), m.getTime());
|
|
1302
|
-
}
|
|
1303
|
-
function Dt(e, m) {
|
|
1304
|
-
return e.name === m.name && e.message === m.message && e.cause === m.cause && e.stack === m.stack;
|
|
1305
|
-
}
|
|
1306
|
-
function Zt(e, m) {
|
|
1307
|
-
return e === m;
|
|
1308
|
-
}
|
|
1309
|
-
function Fe(e, m, h) {
|
|
1310
|
-
var g = e.size;
|
|
1311
|
-
if (g !== m.size) return !1;
|
|
1312
|
-
if (!g) return !0;
|
|
1313
|
-
for (var v = Array(g), y = e.entries(), b, S, C = 0; (b = y.next()) && !b.done;) {
|
|
1314
|
-
for (var w = m.entries(), T = !1, E = 0; (S = w.next()) && !S.done;) {
|
|
1315
|
-
if (v[E]) {
|
|
1316
|
-
E++;
|
|
1317
|
-
continue;
|
|
1318
|
-
}
|
|
1319
|
-
var O = b.value, k = S.value;
|
|
1320
|
-
if (h.equals(O[0], k[0], C, E, e, m, h) && h.equals(O[1], k[1], O[0], k[0], e, m, h)) {
|
|
1321
|
-
T = v[E] = !0;
|
|
1322
|
-
break;
|
|
1323
|
-
}
|
|
1324
|
-
E++;
|
|
1325
|
-
}
|
|
1326
|
-
if (!T) return !1;
|
|
1327
|
-
C++;
|
|
1328
|
-
}
|
|
1329
|
-
return !0;
|
|
1330
|
-
}
|
|
1331
|
-
var Ft = F;
|
|
1332
|
-
function Ut(e, m, h) {
|
|
1333
|
-
var g = Ze(e), v = g.length;
|
|
1334
|
-
if (Ze(m).length !== v) return !1;
|
|
1335
|
-
for (; v-- > 0;) if (!Qe(e, m, h, g[v])) return !1;
|
|
1336
|
-
return !0;
|
|
1337
|
-
}
|
|
1338
|
-
function Y(e, m, h) {
|
|
1339
|
-
var g = Be(e), v = g.length;
|
|
1340
|
-
if (Be(m).length !== v) return !1;
|
|
1341
|
-
for (var y, b, S; v-- > 0;) if (y = g[v], !Qe(e, m, h, y) || (b = De(e, y), S = De(m, y), (b || S) && (!b || !S || b.configurable !== S.configurable || b.enumerable !== S.enumerable || b.writable !== S.writable))) return !1;
|
|
1342
|
-
return !0;
|
|
1343
|
-
}
|
|
1344
|
-
function Gt(e, m) {
|
|
1345
|
-
return F(e.valueOf(), m.valueOf());
|
|
1346
|
-
}
|
|
1347
|
-
function Vt(e, m) {
|
|
1348
|
-
return e.source === m.source && e.flags === m.flags;
|
|
1349
|
-
}
|
|
1350
|
-
function Ue(e, m, h) {
|
|
1351
|
-
var g = e.size;
|
|
1352
|
-
if (g !== m.size) return !1;
|
|
1353
|
-
if (!g) return !0;
|
|
1354
|
-
for (var v = Array(g), y = e.values(), b, S; (b = y.next()) && !b.done;) {
|
|
1355
|
-
for (var C = m.values(), w = !1, T = 0; (S = C.next()) && !S.done;) {
|
|
1356
|
-
if (!v[T] && h.equals(b.value, S.value, b.value, S.value, e, m, h)) {
|
|
1357
|
-
w = v[T] = !0;
|
|
1358
|
-
break;
|
|
1359
|
-
}
|
|
1360
|
-
T++;
|
|
1361
|
-
}
|
|
1362
|
-
if (!w) return !1;
|
|
1363
|
-
}
|
|
1364
|
-
return !0;
|
|
1365
|
-
}
|
|
1366
|
-
function zt(e, m) {
|
|
1367
|
-
var h = e.length;
|
|
1368
|
-
if (m.length !== h) return !1;
|
|
1369
|
-
for (; h-- > 0;) if (e[h] !== m[h]) return !1;
|
|
1370
|
-
return !0;
|
|
1371
|
-
}
|
|
1372
|
-
function Wt(e, m) {
|
|
1373
|
-
return e.hostname === m.hostname && e.pathname === m.pathname && e.protocol === m.protocol && e.port === m.port && e.hash === m.hash && e.username === m.username && e.password === m.password;
|
|
1374
|
-
}
|
|
1375
|
-
function Qe(e, m, h, g) {
|
|
1376
|
-
return (g === $t || g === Rt || g === jt) && (e.$$typeof || m.$$typeof) ? !0 : It(m, g) && h.equals(e[g], m[g], g, g, e, m, h);
|
|
1377
|
-
}
|
|
1378
|
-
var Kt = "[object Arguments]", Ht = "[object Boolean]", Jt = "[object Date]", Yt = "[object Error]", Xt = "[object Map]", Qt = "[object Number]", er = "[object Object]", tr = "[object RegExp]", rr = "[object Set]", nr = "[object String]", sr = "[object URL]", or = Array.isArray, Ge = typeof ArrayBuffer == "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null, Ve = Object.assign, ir = Object.prototype.toString.call.bind(Object.prototype.toString);
|
|
1379
|
-
function ar(e) {
|
|
1380
|
-
var m = e.areArraysEqual, h = e.areDatesEqual, g = e.areErrorsEqual, v = e.areFunctionsEqual, y = e.areMapsEqual, b = e.areNumbersEqual, S = e.areObjectsEqual, C = e.arePrimitiveWrappersEqual, w = e.areRegExpsEqual, T = e.areSetsEqual, E = e.areTypedArraysEqual, O = e.areUrlsEqual;
|
|
1381
|
-
return function(e, k, j) {
|
|
1382
|
-
if (e === k) return !0;
|
|
1383
|
-
if (e == null || k == null) return !1;
|
|
1384
|
-
var M = typeof e;
|
|
1385
|
-
if (M !== typeof k) return !1;
|
|
1386
|
-
if (M !== "object") return M === "number" ? b(e, k, j) : M === "function" ? v(e, k, j) : !1;
|
|
1387
|
-
var P = e.constructor;
|
|
1388
|
-
if (P !== k.constructor) return !1;
|
|
1389
|
-
if (P === Object) return S(e, k, j);
|
|
1390
|
-
if (or(e)) return m(e, k, j);
|
|
1391
|
-
if (Ge != null && Ge(e)) return E(e, k, j);
|
|
1392
|
-
if (P === Date) return h(e, k, j);
|
|
1393
|
-
if (P === RegExp) return w(e, k, j);
|
|
1394
|
-
if (P === Map) return y(e, k, j);
|
|
1395
|
-
if (P === Set) return T(e, k, j);
|
|
1396
|
-
var B = ir(e);
|
|
1397
|
-
return B === Jt ? h(e, k, j) : B === tr ? w(e, k, j) : B === Xt ? y(e, k, j) : B === rr ? T(e, k, j) : B === er ? typeof e.then != "function" && typeof k.then != "function" && S(e, k, j) : B === sr ? O(e, k, j) : B === Yt ? g(e, k, j) : B === Kt ? S(e, k, j) : B === Ht || B === Qt || B === nr ? C(e, k, j) : !1;
|
|
1398
|
-
};
|
|
1399
|
-
}
|
|
1400
|
-
function lr(e) {
|
|
1401
|
-
var m = e.circular, h = e.createCustomConfig, g = e.strict, v = {
|
|
1402
|
-
areArraysEqual: g ? Y : Nt,
|
|
1403
|
-
areDatesEqual: Bt,
|
|
1404
|
-
areErrorsEqual: Dt,
|
|
1405
|
-
areFunctionsEqual: Zt,
|
|
1406
|
-
areMapsEqual: g ? Ne(Fe, Y) : Fe,
|
|
1407
|
-
areNumbersEqual: Ft,
|
|
1408
|
-
areObjectsEqual: g ? Y : Ut,
|
|
1409
|
-
arePrimitiveWrappersEqual: Gt,
|
|
1410
|
-
areRegExpsEqual: Vt,
|
|
1411
|
-
areSetsEqual: g ? Ne(Ue, Y) : Ue,
|
|
1412
|
-
areTypedArraysEqual: g ? Y : zt,
|
|
1413
|
-
areUrlsEqual: Wt
|
|
1414
|
-
};
|
|
1415
|
-
if (h && (v = Ve({}, v, h(v))), m) {
|
|
1416
|
-
var y = se(v.areArraysEqual), b = se(v.areMapsEqual), S = se(v.areObjectsEqual), C = se(v.areSetsEqual);
|
|
1417
|
-
v = Ve({}, v, {
|
|
1418
|
-
areArraysEqual: y,
|
|
1419
|
-
areMapsEqual: b,
|
|
1420
|
-
areObjectsEqual: S,
|
|
1421
|
-
areSetsEqual: C
|
|
1422
|
-
});
|
|
1423
|
-
}
|
|
1424
|
-
return v;
|
|
1425
|
-
}
|
|
1426
|
-
function ur(e) {
|
|
1427
|
-
return function(m, h, g, v, y, b, S) {
|
|
1428
|
-
return e(m, h, S);
|
|
1429
|
-
};
|
|
1430
|
-
}
|
|
1431
|
-
function cr(e) {
|
|
1432
|
-
var m = e.circular, h = e.comparator, g = e.createState, v = e.equals, y = e.strict;
|
|
1433
|
-
if (g) return function(e, b) {
|
|
1434
|
-
var S = g(), C = S.cache, w = C === void 0 ? m ? /* @__PURE__ */ new WeakMap() : void 0 : C, T = S.meta;
|
|
1435
|
-
return h(e, b, {
|
|
1436
|
-
cache: w,
|
|
1437
|
-
equals: v,
|
|
1438
|
-
meta: T,
|
|
1439
|
-
strict: y
|
|
1440
|
-
});
|
|
1441
|
-
};
|
|
1442
|
-
if (m) return function(e, m) {
|
|
1443
|
-
return h(e, m, {
|
|
1444
|
-
cache: /* @__PURE__ */ new WeakMap(),
|
|
1445
|
-
equals: v,
|
|
1446
|
-
meta: void 0,
|
|
1447
|
-
strict: y
|
|
1448
|
-
});
|
|
1449
|
-
};
|
|
1450
|
-
var b = {
|
|
1451
|
-
cache: void 0,
|
|
1452
|
-
equals: v,
|
|
1453
|
-
meta: void 0,
|
|
1454
|
-
strict: y
|
|
1455
|
-
};
|
|
1456
|
-
return function(e, m) {
|
|
1457
|
-
return h(e, m, b);
|
|
1458
|
-
};
|
|
1459
|
-
}
|
|
1460
|
-
var ae = R();
|
|
1461
|
-
R({ strict: !0 }), R({ circular: !0 }), R({
|
|
1462
|
-
circular: !0,
|
|
1463
|
-
strict: !0
|
|
1464
|
-
}), R({ createInternalComparator: function() {
|
|
1465
|
-
return F;
|
|
1466
|
-
} }), R({
|
|
1467
|
-
strict: !0,
|
|
1468
|
-
createInternalComparator: function() {
|
|
1469
|
-
return F;
|
|
1470
|
-
}
|
|
1471
|
-
}), R({
|
|
1472
|
-
circular: !0,
|
|
1473
|
-
createInternalComparator: function() {
|
|
1474
|
-
return F;
|
|
1475
|
-
}
|
|
1476
|
-
}), R({
|
|
1477
|
-
circular: !0,
|
|
1478
|
-
createInternalComparator: function() {
|
|
1479
|
-
return F;
|
|
1480
|
-
},
|
|
1481
|
-
strict: !0
|
|
1482
|
-
});
|
|
1483
|
-
function R(e) {
|
|
1484
|
-
e === void 0 && (e = {});
|
|
1485
|
-
var m = e.circular, h = m === void 0 ? !1 : m, g = e.createInternalComparator, v = e.createState, y = e.strict, b = y === void 0 ? !1 : y, S = ar(lr(e));
|
|
1486
|
-
return cr({
|
|
1487
|
-
circular: h,
|
|
1488
|
-
comparator: S,
|
|
1489
|
-
createState: v,
|
|
1490
|
-
equals: g ? g(S) : ur(S),
|
|
1491
|
-
strict: b
|
|
1492
|
-
});
|
|
1493
|
-
}
|
|
1494
|
-
var ze = [
|
|
1495
|
-
Int8Array,
|
|
1496
|
-
Uint8Array,
|
|
1497
|
-
Uint8ClampedArray,
|
|
1498
|
-
Int16Array,
|
|
1499
|
-
Uint16Array,
|
|
1500
|
-
Int32Array,
|
|
1501
|
-
Uint32Array,
|
|
1502
|
-
Float32Array,
|
|
1503
|
-
Float64Array
|
|
1504
|
-
], he = 1, X = 8, Ce = class e {
|
|
1505
|
-
static from(m) {
|
|
1506
|
-
if (!(m instanceof ArrayBuffer)) throw Error("Data must be an instance of ArrayBuffer.");
|
|
1507
|
-
let [h, g] = new Uint8Array(m, 0, 2);
|
|
1508
|
-
if (h !== 219) throw Error("Data does not appear to be in a KDBush format.");
|
|
1509
|
-
let v = g >> 4;
|
|
1510
|
-
if (v !== he) throw Error(`Got v${v} data when expected v${he}.`);
|
|
1511
|
-
let y = ze[g & 15];
|
|
1512
|
-
if (!y) throw Error("Unrecognized array type.");
|
|
1513
|
-
let [b] = new Uint16Array(m, 2, 1), [S] = new Uint32Array(m, 4, 1);
|
|
1514
|
-
return new e(S, b, y, m);
|
|
1515
|
-
}
|
|
1516
|
-
constructor(e, m = 64, h = Float64Array, g) {
|
|
1517
|
-
if (isNaN(e) || e < 0) throw Error(`Unpexpected numItems value: ${e}.`);
|
|
1518
|
-
this.numItems = +e, this.nodeSize = Math.min(Math.max(+m, 2), 65535), this.ArrayType = h, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
|
|
1519
|
-
let v = ze.indexOf(this.ArrayType), y = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, b = e * this.IndexArrayType.BYTES_PER_ELEMENT, S = (8 - b % 8) % 8;
|
|
1520
|
-
if (v < 0) throw Error(`Unexpected typed array class: ${h}.`);
|
|
1521
|
-
g && g instanceof ArrayBuffer ? (this.data = g, this.ids = new this.IndexArrayType(this.data, X, e), this.coords = new this.ArrayType(this.data, X + b + S, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(X + y + b + S), this.ids = new this.IndexArrayType(this.data, X, e), this.coords = new this.ArrayType(this.data, X + b + S, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (he << 4) + v]), new Uint16Array(this.data, 2, 1)[0] = m, new Uint32Array(this.data, 4, 1)[0] = e);
|
|
1522
|
-
}
|
|
1523
|
-
add(e, m) {
|
|
1524
|
-
let h = this._pos >> 1;
|
|
1525
|
-
return this.ids[h] = h, this.coords[this._pos++] = e, this.coords[this._pos++] = m, h;
|
|
1526
|
-
}
|
|
1527
|
-
finish() {
|
|
1528
|
-
let e = this._pos >> 1;
|
|
1529
|
-
if (e !== this.numItems) throw Error(`Added ${e} items when expected ${this.numItems}.`);
|
|
1530
|
-
return ve(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
|
|
1531
|
-
}
|
|
1532
|
-
range(e, m, h, g) {
|
|
1533
|
-
if (!this._finished) throw Error("Data not yet indexed - call index.finish().");
|
|
1534
|
-
let { ids: v, coords: y, nodeSize: b } = this, S = [
|
|
1535
|
-
0,
|
|
1536
|
-
v.length - 1,
|
|
1537
|
-
0
|
|
1538
|
-
], C = [];
|
|
1539
|
-
for (; S.length;) {
|
|
1540
|
-
let w = S.pop() || 0, T = S.pop() || 0, E = S.pop() || 0;
|
|
1541
|
-
if (T - E <= b) {
|
|
1542
|
-
for (let b = E; b <= T; b++) {
|
|
1543
|
-
let S = y[2 * b], w = y[2 * b + 1];
|
|
1544
|
-
S >= e && S <= h && w >= m && w <= g && C.push(v[b]);
|
|
1545
|
-
}
|
|
1546
|
-
continue;
|
|
1547
|
-
}
|
|
1548
|
-
let O = E + T >> 1, k = y[2 * O], j = y[2 * O + 1];
|
|
1549
|
-
k >= e && k <= h && j >= m && j <= g && C.push(v[O]), (w === 0 ? e <= k : m <= j) && (S.push(E), S.push(O - 1), S.push(1 - w)), (w === 0 ? h >= k : g >= j) && (S.push(O + 1), S.push(T), S.push(1 - w));
|
|
1550
|
-
}
|
|
1551
|
-
return C;
|
|
1552
|
-
}
|
|
1553
|
-
within(e, m, h) {
|
|
1554
|
-
if (!this._finished) throw Error("Data not yet indexed - call index.finish().");
|
|
1555
|
-
let { ids: g, coords: v, nodeSize: y } = this, b = [
|
|
1556
|
-
0,
|
|
1557
|
-
g.length - 1,
|
|
1558
|
-
0
|
|
1559
|
-
], S = [], C = h * h;
|
|
1560
|
-
for (; b.length;) {
|
|
1561
|
-
let w = b.pop() || 0, T = b.pop() || 0, E = b.pop() || 0;
|
|
1562
|
-
if (T - E <= y) {
|
|
1563
|
-
for (let h = E; h <= T; h++) We(v[2 * h], v[2 * h + 1], e, m) <= C && S.push(g[h]);
|
|
1564
|
-
continue;
|
|
1565
|
-
}
|
|
1566
|
-
let O = E + T >> 1, k = v[2 * O], j = v[2 * O + 1];
|
|
1567
|
-
We(k, j, e, m) <= C && S.push(g[O]), (w === 0 ? e - h <= k : m - h <= j) && (b.push(E), b.push(O - 1), b.push(1 - w)), (w === 0 ? e + h >= k : m + h >= j) && (b.push(O + 1), b.push(T), b.push(1 - w));
|
|
1568
|
-
}
|
|
1569
|
-
return S;
|
|
1570
|
-
}
|
|
1571
|
-
};
|
|
1572
|
-
function ve(e, m, h, g, v, y) {
|
|
1573
|
-
if (v - g <= h) return;
|
|
1574
|
-
let b = g + v >> 1;
|
|
1575
|
-
et(e, m, b, g, v, y), ve(e, m, h, g, b - 1, 1 - y), ve(e, m, h, b + 1, v, 1 - y);
|
|
1576
|
-
}
|
|
1577
|
-
function et(e, m, h, g, v, y) {
|
|
1578
|
-
for (; v > g;) {
|
|
1579
|
-
if (v - g > 600) {
|
|
1580
|
-
let b = v - g + 1, S = h - g + 1, C = Math.log(b), w = .5 * Math.exp(2 * C / 3), T = .5 * Math.sqrt(C * w * (b - w) / b) * (S - b / 2 < 0 ? -1 : 1);
|
|
1581
|
-
et(e, m, h, Math.max(g, Math.floor(h - S * w / b + T)), Math.min(v, Math.floor(h + (b - S) * w / b + T)), y);
|
|
1582
|
-
}
|
|
1583
|
-
let b = m[2 * h + y], S = g, C = v;
|
|
1584
|
-
for (Q(e, m, g, h), m[2 * v + y] > b && Q(e, m, g, v); S < C;) {
|
|
1585
|
-
for (Q(e, m, S, C), S++, C--; m[2 * S + y] < b;) S++;
|
|
1586
|
-
for (; m[2 * C + y] > b;) C--;
|
|
1587
|
-
}
|
|
1588
|
-
m[2 * g + y] === b ? Q(e, m, g, C) : (C++, Q(e, m, C, v)), C <= h && (g = C + 1), h <= C && (v = C - 1);
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
function Q(e, m, h, g) {
|
|
1592
|
-
me(e, h, g), me(m, 2 * h, 2 * g), me(m, 2 * h + 1, 2 * g + 1);
|
|
1593
|
-
}
|
|
1594
|
-
function me(e, m, h) {
|
|
1595
|
-
let g = e[m];
|
|
1596
|
-
e[m] = e[h], e[h] = g;
|
|
1597
|
-
}
|
|
1598
|
-
function We(e, m, h, g) {
|
|
1599
|
-
let v = e - h, y = m - g;
|
|
1600
|
-
return v * v + y * y;
|
|
1601
|
-
}
|
|
1602
|
-
var dr = {
|
|
1603
|
-
minZoom: 0,
|
|
1604
|
-
maxZoom: 16,
|
|
1605
|
-
minPoints: 2,
|
|
1606
|
-
radius: 40,
|
|
1607
|
-
extent: 512,
|
|
1608
|
-
nodeSize: 64,
|
|
1609
|
-
log: !1,
|
|
1610
|
-
generateId: !1,
|
|
1611
|
-
reduce: null,
|
|
1612
|
-
map: (e) => e
|
|
1613
|
-
}, Ke = Math.fround || ((e) => (m) => (e[0] = +m, e[0]))(new Float32Array(1)), $ = 2, x = 3, ge = 4, L = 5, tt = 6, rt = class {
|
|
1614
|
-
constructor(e) {
|
|
1615
|
-
this.options = Object.assign(Object.create(dr), e), this.trees = Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
|
|
1616
|
-
}
|
|
1617
|
-
load(e) {
|
|
1618
|
-
let { log: m, minZoom: h, maxZoom: g } = this.options;
|
|
1619
|
-
m && console.time("total time");
|
|
1620
|
-
let v = `prepare ${e.length} points`;
|
|
1621
|
-
m && console.time(v), this.points = e;
|
|
1622
|
-
let y = [];
|
|
1623
|
-
for (let m = 0; m < e.length; m++) {
|
|
1624
|
-
let h = e[m];
|
|
1625
|
-
if (!h.geometry) continue;
|
|
1626
|
-
let [g, v] = h.geometry.coordinates, b = Ke(oe(g)), S = Ke(ie(v));
|
|
1627
|
-
y.push(b, S, Infinity, m, -1, 1), this.options.reduce && y.push(0);
|
|
1628
|
-
}
|
|
1629
|
-
let b = this.trees[g + 1] = this._createTree(y);
|
|
1630
|
-
m && console.timeEnd(v);
|
|
1631
|
-
for (let e = g; e >= h; e--) {
|
|
1632
|
-
let h = +Date.now();
|
|
1633
|
-
b = this.trees[e] = this._createTree(this._cluster(b, e)), m && console.log("z%d: %d clusters in %dms", e, b.numItems, +Date.now() - h);
|
|
1634
|
-
}
|
|
1635
|
-
return m && console.timeEnd("total time"), this;
|
|
1636
|
-
}
|
|
1637
|
-
getClusters(e, m) {
|
|
1638
|
-
let h = ((e[0] + 180) % 360 + 360) % 360 - 180, g = Math.max(-90, Math.min(90, e[1])), v = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180, y = Math.max(-90, Math.min(90, e[3]));
|
|
1639
|
-
if (e[2] - e[0] >= 360) h = -180, v = 180;
|
|
1640
|
-
else if (h > v) {
|
|
1641
|
-
let e = this.getClusters([
|
|
1642
|
-
h,
|
|
1643
|
-
g,
|
|
1644
|
-
180,
|
|
1645
|
-
y
|
|
1646
|
-
], m), b = this.getClusters([
|
|
1647
|
-
-180,
|
|
1648
|
-
g,
|
|
1649
|
-
v,
|
|
1650
|
-
y
|
|
1651
|
-
], m);
|
|
1652
|
-
return e.concat(b);
|
|
1653
|
-
}
|
|
1654
|
-
let b = this.trees[this._limitZoom(m)], S = b.range(oe(h), ie(y), oe(v), ie(g)), C = b.data, w = [];
|
|
1655
|
-
for (let e of S) {
|
|
1656
|
-
let m = this.stride * e;
|
|
1657
|
-
w.push(C[m + L] > 1 ? He(C, m, this.clusterProps) : this.points[C[m + x]]);
|
|
1658
|
-
}
|
|
1659
|
-
return w;
|
|
1660
|
-
}
|
|
1661
|
-
getChildren(e) {
|
|
1662
|
-
let m = this._getOriginId(e), h = this._getOriginZoom(e), g = "No cluster with the specified id.", v = this.trees[h];
|
|
1663
|
-
if (!v) throw Error(g);
|
|
1664
|
-
let y = v.data;
|
|
1665
|
-
if (m * this.stride >= y.length) throw Error(g);
|
|
1666
|
-
let b = this.options.radius / (this.options.extent * 2 ** (h - 1)), S = y[m * this.stride], C = y[m * this.stride + 1], w = v.within(S, C, b), T = [];
|
|
1667
|
-
for (let m of w) {
|
|
1668
|
-
let h = m * this.stride;
|
|
1669
|
-
y[h + ge] === e && T.push(y[h + L] > 1 ? He(y, h, this.clusterProps) : this.points[y[h + x]]);
|
|
1670
|
-
}
|
|
1671
|
-
if (T.length === 0) throw Error(g);
|
|
1672
|
-
return T;
|
|
1673
|
-
}
|
|
1674
|
-
getLeaves(e, m, h) {
|
|
1675
|
-
m ||= 10, h ||= 0;
|
|
1676
|
-
let g = [];
|
|
1677
|
-
return this._appendLeaves(g, e, m, h, 0), g;
|
|
1678
|
-
}
|
|
1679
|
-
getTile(e, m, h) {
|
|
1680
|
-
let g = this.trees[this._limitZoom(e)], v = 2 ** e, { extent: y, radius: b } = this.options, S = b / y, C = (h - S) / v, w = (h + 1 + S) / v, T = { features: [] };
|
|
1681
|
-
return this._addTileFeatures(g.range((m - S) / v, C, (m + 1 + S) / v, w), g.data, m, h, v, T), m === 0 && this._addTileFeatures(g.range(1 - S / v, C, 1, w), g.data, v, h, v, T), m === v - 1 && this._addTileFeatures(g.range(0, C, S / v, w), g.data, -1, h, v, T), T.features.length ? T : null;
|
|
1682
|
-
}
|
|
1683
|
-
getClusterExpansionZoom(e) {
|
|
1684
|
-
let m = this._getOriginZoom(e) - 1;
|
|
1685
|
-
for (; m <= this.options.maxZoom;) {
|
|
1686
|
-
let h = this.getChildren(e);
|
|
1687
|
-
if (m++, h.length !== 1) break;
|
|
1688
|
-
e = h[0].properties.cluster_id;
|
|
1689
|
-
}
|
|
1690
|
-
return m;
|
|
1691
|
-
}
|
|
1692
|
-
_appendLeaves(e, m, h, g, v) {
|
|
1693
|
-
let y = this.getChildren(m);
|
|
1694
|
-
for (let m of y) {
|
|
1695
|
-
let y = m.properties;
|
|
1696
|
-
if (y && y.cluster ? v + y.point_count <= g ? v += y.point_count : v = this._appendLeaves(e, y.cluster_id, h, g, v) : v < g ? v++ : e.push(m), e.length === h) break;
|
|
1697
|
-
}
|
|
1698
|
-
return v;
|
|
1699
|
-
}
|
|
1700
|
-
_createTree(e) {
|
|
1701
|
-
let m = new Ce(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
|
|
1702
|
-
for (let h = 0; h < e.length; h += this.stride) m.add(e[h], e[h + 1]);
|
|
1703
|
-
return m.finish(), m.data = e, m;
|
|
1704
|
-
}
|
|
1705
|
-
_addTileFeatures(e, m, h, g, v, y) {
|
|
1706
|
-
for (let b of e) {
|
|
1707
|
-
let e = b * this.stride, S = m[e + L] > 1, C, w, T;
|
|
1708
|
-
if (S) C = nt(m, e, this.clusterProps), w = m[e], T = m[e + 1];
|
|
1709
|
-
else {
|
|
1710
|
-
let h = this.points[m[e + x]];
|
|
1711
|
-
C = h.properties;
|
|
1712
|
-
let [g, v] = h.geometry.coordinates;
|
|
1713
|
-
w = oe(g), T = ie(v);
|
|
1714
|
-
}
|
|
1715
|
-
let E = {
|
|
1716
|
-
type: 1,
|
|
1717
|
-
geometry: [[Math.round(this.options.extent * (w * v - h)), Math.round(this.options.extent * (T * v - g))]],
|
|
1718
|
-
tags: C
|
|
1719
|
-
}, O;
|
|
1720
|
-
O = S || this.options.generateId ? m[e + x] : this.points[m[e + x]].id, O !== void 0 && (E.id = O), y.features.push(E);
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
_limitZoom(e) {
|
|
1724
|
-
return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
|
|
1725
|
-
}
|
|
1726
|
-
_cluster(e, m) {
|
|
1727
|
-
let { radius: h, extent: g, reduce: v, minPoints: y } = this.options, b = h / (g * 2 ** m), S = e.data, C = [], w = this.stride;
|
|
1728
|
-
for (let h = 0; h < S.length; h += w) {
|
|
1729
|
-
if (S[h + $] <= m) continue;
|
|
1730
|
-
S[h + $] = m;
|
|
1731
|
-
let g = S[h], T = S[h + 1], E = e.within(S[h], S[h + 1], b), O = S[h + L], k = O;
|
|
1732
|
-
for (let e of E) {
|
|
1733
|
-
let h = e * w;
|
|
1734
|
-
S[h + $] > m && (k += S[h + L]);
|
|
1735
|
-
}
|
|
1736
|
-
if (k > O && k >= y) {
|
|
1737
|
-
let e = g * O, y = T * O, b, j = -1, M = ((h / w | 0) << 5) + (m + 1) + this.points.length;
|
|
1738
|
-
for (let g of E) {
|
|
1739
|
-
let C = g * w;
|
|
1740
|
-
if (S[C + $] <= m) continue;
|
|
1741
|
-
S[C + $] = m;
|
|
1742
|
-
let T = S[C + L];
|
|
1743
|
-
e += S[C] * T, y += S[C + 1] * T, S[C + ge] = M, v && (b || (b = this._map(S, h, !0), j = this.clusterProps.length, this.clusterProps.push(b)), v(b, this._map(S, C)));
|
|
1744
|
-
}
|
|
1745
|
-
S[h + ge] = M, C.push(e / k, y / k, Infinity, M, -1, k), v && C.push(j);
|
|
1746
|
-
} else {
|
|
1747
|
-
for (let e = 0; e < w; e++) C.push(S[h + e]);
|
|
1748
|
-
if (k > 1) for (let e of E) {
|
|
1749
|
-
let h = e * w;
|
|
1750
|
-
if (!(S[h + $] <= m)) {
|
|
1751
|
-
S[h + $] = m;
|
|
1752
|
-
for (let e = 0; e < w; e++) C.push(S[h + e]);
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
return C;
|
|
1758
|
-
}
|
|
1759
|
-
_getOriginId(e) {
|
|
1760
|
-
return e - this.points.length >> 5;
|
|
1761
|
-
}
|
|
1762
|
-
_getOriginZoom(e) {
|
|
1763
|
-
return (e - this.points.length) % 32;
|
|
1764
|
-
}
|
|
1765
|
-
_map(e, m, h) {
|
|
1766
|
-
if (e[m + L] > 1) {
|
|
1767
|
-
let g = this.clusterProps[e[m + tt]];
|
|
1768
|
-
return h ? Object.assign({}, g) : g;
|
|
1769
|
-
}
|
|
1770
|
-
let g = this.points[e[m + x]].properties, v = this.options.map(g);
|
|
1771
|
-
return h && v === g ? Object.assign({}, v) : v;
|
|
1772
|
-
}
|
|
1773
|
-
};
|
|
1774
|
-
function He(e, m, h) {
|
|
1775
|
-
return {
|
|
1776
|
-
type: "Feature",
|
|
1777
|
-
id: e[m + x],
|
|
1778
|
-
properties: nt(e, m, h),
|
|
1779
|
-
geometry: {
|
|
1780
|
-
type: "Point",
|
|
1781
|
-
coordinates: [pr(e[m]), fr(e[m + 1])]
|
|
1782
|
-
}
|
|
1783
|
-
};
|
|
1784
|
-
}
|
|
1785
|
-
function nt(e, m, h) {
|
|
1786
|
-
let g = e[m + L], v = g >= 1e4 ? `${Math.round(g / 1e3)}k` : g >= 1e3 ? `${Math.round(g / 100) / 10}k` : g, y = e[m + tt], b = y === -1 ? {} : Object.assign({}, h[y]);
|
|
1787
|
-
return Object.assign(b, {
|
|
1788
|
-
cluster: !0,
|
|
1789
|
-
cluster_id: e[m + x],
|
|
1790
|
-
point_count: g,
|
|
1791
|
-
point_count_abbreviated: v
|
|
1792
|
-
});
|
|
1793
|
-
}
|
|
1794
|
-
function oe(e) {
|
|
1795
|
-
return e / 360 + .5;
|
|
1796
|
-
}
|
|
1797
|
-
function ie(e) {
|
|
1798
|
-
let m = Math.sin(e * Math.PI / 180), h = .5 - .25 * Math.log((1 + m) / (1 - m)) / Math.PI;
|
|
1799
|
-
return h < 0 ? 0 : h > 1 ? 1 : h;
|
|
1800
|
-
}
|
|
1801
|
-
function pr(e) {
|
|
1802
|
-
return (e - .5) * 360;
|
|
1803
|
-
}
|
|
1804
|
-
function fr(e) {
|
|
1805
|
-
let m = (180 - e * 360) * Math.PI / 180;
|
|
1806
|
-
return 360 * Math.atan(Math.exp(m)) / Math.PI - 90;
|
|
1807
|
-
}
|
|
1808
|
-
function Oe(e, m) {
|
|
1809
|
-
var h = {};
|
|
1810
|
-
for (var g in e) Object.prototype.hasOwnProperty.call(e, g) && m.indexOf(g) < 0 && (h[g] = e[g]);
|
|
1811
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var v = 0, g = Object.getOwnPropertySymbols(e); v < g.length; v++) m.indexOf(g[v]) < 0 && Object.prototype.propertyIsEnumerable.call(e, g[v]) && (h[g[v]] = e[g[v]]);
|
|
1812
|
-
return h;
|
|
1813
|
-
}
|
|
1814
|
-
var _ = class {
|
|
1815
|
-
static isAdvancedMarkerAvailable(e) {
|
|
1816
|
-
return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
|
|
1817
|
-
}
|
|
1818
|
-
static isAdvancedMarker(e) {
|
|
1819
|
-
return google.maps.marker && e instanceof google.maps.marker.AdvancedMarkerElement;
|
|
1820
|
-
}
|
|
1821
|
-
static setMap(e, m) {
|
|
1822
|
-
this.isAdvancedMarker(e) ? e.map = m : e.setMap(m);
|
|
1823
|
-
}
|
|
1824
|
-
static getPosition(e) {
|
|
1825
|
-
if (this.isAdvancedMarker(e)) {
|
|
1826
|
-
if (e.position) {
|
|
1827
|
-
if (e.position instanceof google.maps.LatLng) return e.position;
|
|
1828
|
-
if (Number.isFinite(e.position.lat) && Number.isFinite(e.position.lng)) return new google.maps.LatLng(e.position.lat, e.position.lng);
|
|
1829
|
-
}
|
|
1830
|
-
return new google.maps.LatLng(null);
|
|
1831
|
-
}
|
|
1832
|
-
return e.getPosition();
|
|
1833
|
-
}
|
|
1834
|
-
static getVisible(e) {
|
|
1835
|
-
return this.isAdvancedMarker(e) ? !0 : e.getVisible();
|
|
1836
|
-
}
|
|
1837
|
-
}, te = class {
|
|
1838
|
-
constructor({ markers: e, position: m }) {
|
|
1839
|
-
this.markers = [], e && (this.markers = e), m && (m instanceof google.maps.LatLng ? this._position = m : this._position = new google.maps.LatLng(m));
|
|
1840
|
-
}
|
|
1841
|
-
get bounds() {
|
|
1842
|
-
if (this.markers.length === 0 && !this._position) return;
|
|
1843
|
-
let e = new google.maps.LatLngBounds(this._position, this._position);
|
|
1844
|
-
for (let m of this.markers) e.extend(_.getPosition(m));
|
|
1845
|
-
return e;
|
|
1846
|
-
}
|
|
1847
|
-
get position() {
|
|
1848
|
-
return this._position || this.bounds.getCenter();
|
|
1849
|
-
}
|
|
1850
|
-
get count() {
|
|
1851
|
-
return this.markers.filter((e) => _.getVisible(e)).length;
|
|
1852
|
-
}
|
|
1853
|
-
push(e) {
|
|
1854
|
-
this.markers.push(e);
|
|
1855
|
-
}
|
|
1856
|
-
delete() {
|
|
1857
|
-
this.marker &&= (_.setMap(this.marker, null), void 0), this.markers.length = 0;
|
|
1858
|
-
}
|
|
1859
|
-
};
|
|
1860
|
-
function A(e, m = "assertion failed") {
|
|
1861
|
-
if (e == null) throw Error(m);
|
|
1862
|
-
}
|
|
1863
|
-
var hr = (e, m, h, g) => {
|
|
1864
|
-
let v = e.getBounds();
|
|
1865
|
-
A(v);
|
|
1866
|
-
let y = st(v, m, g);
|
|
1867
|
-
return h.filter((e) => y.contains(_.getPosition(e)));
|
|
1868
|
-
}, st = (e, m, h) => {
|
|
1869
|
-
let { northEast: g, southWest: v } = gr(e, m);
|
|
1870
|
-
return yr(vr({
|
|
1871
|
-
northEast: g,
|
|
1872
|
-
southWest: v
|
|
1873
|
-
}, h), m);
|
|
1874
|
-
}, mr = (e, m, h) => {
|
|
1875
|
-
let g = st(e, m, h), v = g.getNorthEast(), y = g.getSouthWest();
|
|
1876
|
-
return [
|
|
1877
|
-
y.lng(),
|
|
1878
|
-
y.lat(),
|
|
1879
|
-
v.lng(),
|
|
1880
|
-
v.lat()
|
|
1881
|
-
];
|
|
1882
|
-
}, gr = (e, m) => {
|
|
1883
|
-
let h = m.fromLatLngToDivPixel(e.getNorthEast()), g = m.fromLatLngToDivPixel(e.getSouthWest());
|
|
1884
|
-
return A(h), A(g), {
|
|
1885
|
-
northEast: h,
|
|
1886
|
-
southWest: g
|
|
1887
|
-
};
|
|
1888
|
-
}, vr = ({ northEast: e, southWest: m }, h) => (e.x += h, e.y -= h, m.x -= h, m.y += h, {
|
|
1889
|
-
northEast: e,
|
|
1890
|
-
southWest: m
|
|
1891
|
-
}), yr = ({ northEast: e, southWest: m }, h) => {
|
|
1892
|
-
let g = h.fromDivPixelToLatLng(m), v = h.fromDivPixelToLatLng(e);
|
|
1893
|
-
return new google.maps.LatLngBounds(g, v);
|
|
1894
|
-
}, ot = class {
|
|
1895
|
-
constructor({ maxZoom: e = 16 }) {
|
|
1896
|
-
this.maxZoom = e;
|
|
1897
|
-
}
|
|
1898
|
-
noop({ markers: e }) {
|
|
1899
|
-
return Er(e);
|
|
1900
|
-
}
|
|
1901
|
-
}, wr = class extends ot {
|
|
1902
|
-
constructor(e) {
|
|
1903
|
-
var { viewportPadding: m = 60 } = e, h = Oe(e, ["viewportPadding"]);
|
|
1904
|
-
super(h), this.viewportPadding = 60, this.viewportPadding = m;
|
|
1905
|
-
}
|
|
1906
|
-
calculate({ markers: e, map: m, mapCanvasProjection: h }) {
|
|
1907
|
-
let g = m.getZoom();
|
|
1908
|
-
return A(g), g >= this.maxZoom ? {
|
|
1909
|
-
clusters: this.noop({ markers: e }),
|
|
1910
|
-
changed: !1
|
|
1911
|
-
} : { clusters: this.cluster({
|
|
1912
|
-
markers: hr(m, h, e, this.viewportPadding),
|
|
1913
|
-
map: m,
|
|
1914
|
-
mapCanvasProjection: h
|
|
1915
|
-
}) };
|
|
1916
|
-
}
|
|
1917
|
-
}, Er = (e) => e.map((e) => new te({
|
|
1918
|
-
position: _.getPosition(e),
|
|
1919
|
-
markers: [e]
|
|
1920
|
-
})), _r = class extends ot {
|
|
1921
|
-
constructor(e) {
|
|
1922
|
-
var { maxZoom: m, radius: h = 60 } = e, g = Oe(e, ["maxZoom", "radius"]);
|
|
1923
|
-
super({ maxZoom: m }), this.markers = [], this.clusters = [], this.state = { zoom: -1 }, this.superCluster = new rt(Object.assign({
|
|
1924
|
-
maxZoom: this.maxZoom,
|
|
1925
|
-
radius: h
|
|
1926
|
-
}, g));
|
|
1927
|
-
}
|
|
1928
|
-
calculate(e) {
|
|
1929
|
-
let m = !1, h = e.map.getZoom();
|
|
1930
|
-
A(h), h = Math.round(h);
|
|
1931
|
-
let g = { zoom: h };
|
|
1932
|
-
if (!ae(e.markers, this.markers)) {
|
|
1933
|
-
m = !0, this.markers = [...e.markers];
|
|
1934
|
-
let h = this.markers.map((e) => {
|
|
1935
|
-
let m = _.getPosition(e);
|
|
1936
|
-
return {
|
|
1937
|
-
type: "Feature",
|
|
1938
|
-
geometry: {
|
|
1939
|
-
type: "Point",
|
|
1940
|
-
coordinates: [m.lng(), m.lat()]
|
|
1941
|
-
},
|
|
1942
|
-
properties: { marker: e }
|
|
1943
|
-
};
|
|
1944
|
-
});
|
|
1945
|
-
this.superCluster.load(h);
|
|
1946
|
-
}
|
|
1947
|
-
return m || (this.state.zoom <= this.maxZoom || g.zoom <= this.maxZoom) && (m = !ae(this.state, g)), this.state = g, e.markers.length === 0 ? (this.clusters = [], {
|
|
1948
|
-
clusters: this.clusters,
|
|
1949
|
-
changed: m
|
|
1950
|
-
}) : (m && (this.clusters = this.cluster(e)), {
|
|
1951
|
-
clusters: this.clusters,
|
|
1952
|
-
changed: m
|
|
1953
|
-
});
|
|
1954
|
-
}
|
|
1955
|
-
cluster({ map: e }) {
|
|
1956
|
-
let m = e.getZoom();
|
|
1957
|
-
return A(m), this.superCluster.getClusters([
|
|
1958
|
-
-180,
|
|
1959
|
-
-90,
|
|
1960
|
-
180,
|
|
1961
|
-
90
|
|
1962
|
-
], Math.round(m)).map((e) => this.transformCluster(e));
|
|
1963
|
-
}
|
|
1964
|
-
transformCluster({ geometry: { coordinates: [e, m] }, properties: h }) {
|
|
1965
|
-
if (h.cluster) return new te({
|
|
1966
|
-
markers: this.superCluster.getLeaves(h.cluster_id, Infinity).map((e) => e.properties.marker),
|
|
1967
|
-
position: {
|
|
1968
|
-
lat: m,
|
|
1969
|
-
lng: e
|
|
1970
|
-
}
|
|
1971
|
-
});
|
|
1972
|
-
let g = h.marker;
|
|
1973
|
-
return new te({
|
|
1974
|
-
markers: [g],
|
|
1975
|
-
position: _.getPosition(g)
|
|
1976
|
-
});
|
|
1977
|
-
}
|
|
1978
|
-
}, kr = class extends wr {
|
|
1979
|
-
constructor(e) {
|
|
1980
|
-
var { maxZoom: m, radius: h = 60, viewportPadding: g = 60 } = e, v = Oe(e, [
|
|
1981
|
-
"maxZoom",
|
|
1982
|
-
"radius",
|
|
1983
|
-
"viewportPadding"
|
|
1984
|
-
]);
|
|
1985
|
-
super({
|
|
1986
|
-
maxZoom: m,
|
|
1987
|
-
viewportPadding: g
|
|
1988
|
-
}), this.markers = [], this.clusters = [], this.superCluster = new rt(Object.assign({
|
|
1989
|
-
maxZoom: this.maxZoom,
|
|
1990
|
-
radius: h
|
|
1991
|
-
}, v)), this.state = {
|
|
1992
|
-
zoom: -1,
|
|
1993
|
-
view: [
|
|
1994
|
-
0,
|
|
1995
|
-
0,
|
|
1996
|
-
0,
|
|
1997
|
-
0
|
|
1998
|
-
]
|
|
1999
|
-
};
|
|
2000
|
-
}
|
|
2001
|
-
calculate(e) {
|
|
2002
|
-
let m = this.getViewportState(e), h = !ae(this.state, m);
|
|
2003
|
-
if (!ae(e.markers, this.markers)) {
|
|
2004
|
-
h = !0, this.markers = [...e.markers];
|
|
2005
|
-
let m = this.markers.map((e) => {
|
|
2006
|
-
let m = _.getPosition(e);
|
|
2007
|
-
return {
|
|
2008
|
-
type: "Feature",
|
|
2009
|
-
geometry: {
|
|
2010
|
-
type: "Point",
|
|
2011
|
-
coordinates: [m.lng(), m.lat()]
|
|
2012
|
-
},
|
|
2013
|
-
properties: { marker: e }
|
|
2014
|
-
};
|
|
2015
|
-
});
|
|
2016
|
-
this.superCluster.load(m);
|
|
2017
|
-
}
|
|
2018
|
-
return h && (this.clusters = this.cluster(e), this.state = m), {
|
|
2019
|
-
clusters: this.clusters,
|
|
2020
|
-
changed: h
|
|
2021
|
-
};
|
|
2022
|
-
}
|
|
2023
|
-
cluster(e) {
|
|
2024
|
-
let m = this.getViewportState(e);
|
|
2025
|
-
return this.superCluster.getClusters(m.view, m.zoom).map((e) => this.transformCluster(e));
|
|
2026
|
-
}
|
|
2027
|
-
transformCluster({ geometry: { coordinates: [e, m] }, properties: h }) {
|
|
2028
|
-
if (h.cluster) return new te({
|
|
2029
|
-
markers: this.superCluster.getLeaves(h.cluster_id, Infinity).map((e) => e.properties.marker),
|
|
2030
|
-
position: {
|
|
2031
|
-
lat: m,
|
|
2032
|
-
lng: e
|
|
2033
|
-
}
|
|
2034
|
-
});
|
|
2035
|
-
let g = h.marker;
|
|
2036
|
-
return new te({
|
|
2037
|
-
markers: [g],
|
|
2038
|
-
position: _.getPosition(g)
|
|
2039
|
-
});
|
|
2040
|
-
}
|
|
2041
|
-
getViewportState(e) {
|
|
2042
|
-
let m = e.map.getZoom(), h = e.map.getBounds();
|
|
2043
|
-
return A(m), A(h), {
|
|
2044
|
-
zoom: Math.round(m),
|
|
2045
|
-
view: mr(h, e.mapCanvasProjection, this.viewportPadding)
|
|
2046
|
-
};
|
|
2047
|
-
}
|
|
2048
|
-
}, Cr = class {
|
|
2049
|
-
constructor(e, m) {
|
|
2050
|
-
this.markers = { sum: e.length };
|
|
2051
|
-
let h = m.map((e) => e.count), g = h.reduce((e, m) => e + m, 0);
|
|
2052
|
-
this.clusters = {
|
|
2053
|
-
count: m.length,
|
|
2054
|
-
markers: {
|
|
2055
|
-
mean: g / m.length,
|
|
2056
|
-
sum: g,
|
|
2057
|
-
min: Math.min(...h),
|
|
2058
|
-
max: Math.max(...h)
|
|
2059
|
-
}
|
|
2060
|
-
};
|
|
2061
|
-
}
|
|
2062
|
-
}, Or = class {
|
|
2063
|
-
render({ count: e, position: m }, h, g) {
|
|
2064
|
-
let v = `<svg fill="${e > Math.max(10, h.clusters.markers.mean) ? "#ff0000" : "#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
2065
|
-
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
2066
|
-
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
2067
|
-
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
2068
|
-
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
|
|
2069
|
-
</svg>`, y = `Cluster of ${e} markers`, b = Number(google.maps.Marker.MAX_ZINDEX) + e;
|
|
2070
|
-
if (_.isAdvancedMarkerAvailable(g)) {
|
|
2071
|
-
let e = new DOMParser().parseFromString(v, "image/svg+xml").documentElement;
|
|
2072
|
-
e.setAttribute("transform", "translate(0 25)");
|
|
2073
|
-
let h = {
|
|
2074
|
-
map: g,
|
|
2075
|
-
position: m,
|
|
2076
|
-
zIndex: b,
|
|
2077
|
-
title: y,
|
|
2078
|
-
content: e
|
|
2079
|
-
};
|
|
2080
|
-
return new google.maps.marker.AdvancedMarkerElement(h);
|
|
2081
|
-
}
|
|
2082
|
-
let S = {
|
|
2083
|
-
position: m,
|
|
2084
|
-
zIndex: b,
|
|
2085
|
-
title: y,
|
|
2086
|
-
icon: {
|
|
2087
|
-
url: `data:image/svg+xml;base64,${btoa(v)}`,
|
|
2088
|
-
anchor: new google.maps.Point(25, 25)
|
|
2089
|
-
}
|
|
2090
|
-
};
|
|
2091
|
-
return new google.maps.Marker(S);
|
|
2092
|
-
}
|
|
2093
|
-
};
|
|
2094
|
-
function Mr(e, m) {
|
|
2095
|
-
for (let h in m.prototype) e.prototype[h] = m.prototype[h];
|
|
2096
|
-
}
|
|
2097
|
-
var Me = class e {
|
|
2098
|
-
constructor() {
|
|
2099
|
-
Mr(e, google.maps.OverlayView);
|
|
2100
|
-
}
|
|
2101
|
-
}, I;
|
|
2102
|
-
(function(e) {
|
|
2103
|
-
e.CLUSTERING_BEGIN = "clusteringbegin", e.CLUSTERING_END = "clusteringend", e.CLUSTER_CLICK = "click", e.GMP_CLICK = "gmp-click";
|
|
2104
|
-
})(I ||= {});
|
|
2105
|
-
var br = (e, m, h) => {
|
|
2106
|
-
m.bounds && h.fitBounds(m.bounds);
|
|
2107
|
-
}, Pr = class extends Me {
|
|
2108
|
-
constructor({ map: e, markers: m = [], algorithmOptions: h = {}, algorithm: g = new _r(h), renderer: v = new Or(), onClusterClick: y = br }) {
|
|
2109
|
-
super(), this.map = null, this.idleListener = null, this.markers = [...m], this.clusters = [], this.algorithm = g, this.renderer = v, this.onClusterClick = y, e && this.setMap(e);
|
|
2110
|
-
}
|
|
2111
|
-
addMarker(e, m) {
|
|
2112
|
-
this.markers.includes(e) || (this.markers.push(e), m || this.render());
|
|
2113
|
-
}
|
|
2114
|
-
addMarkers(e, m) {
|
|
2115
|
-
e.forEach((e) => {
|
|
2116
|
-
this.addMarker(e, !0);
|
|
2117
|
-
}), m || this.render();
|
|
2118
|
-
}
|
|
2119
|
-
removeMarker(e, m) {
|
|
2120
|
-
let h = this.markers.indexOf(e);
|
|
2121
|
-
return h === -1 ? !1 : (_.setMap(e, null), this.markers.splice(h, 1), m || this.render(), !0);
|
|
2122
|
-
}
|
|
2123
|
-
removeMarkers(e, m) {
|
|
2124
|
-
let h = !1;
|
|
2125
|
-
return e.forEach((e) => {
|
|
2126
|
-
h = this.removeMarker(e, !0) || h;
|
|
2127
|
-
}), h && !m && this.render(), h;
|
|
2128
|
-
}
|
|
2129
|
-
clearMarkers(e) {
|
|
2130
|
-
this.markers.length = 0, e || this.render();
|
|
2131
|
-
}
|
|
2132
|
-
render() {
|
|
2133
|
-
let e = this.getMap();
|
|
2134
|
-
if (e instanceof google.maps.Map && e.getProjection()) {
|
|
2135
|
-
google.maps.event.trigger(this, I.CLUSTERING_BEGIN, this);
|
|
2136
|
-
let { clusters: m, changed: h } = this.algorithm.calculate({
|
|
2137
|
-
markers: this.markers,
|
|
2138
|
-
map: e,
|
|
2139
|
-
mapCanvasProjection: this.getProjection()
|
|
2140
|
-
});
|
|
2141
|
-
if (h || h == null) {
|
|
2142
|
-
let e = /* @__PURE__ */ new Set();
|
|
2143
|
-
for (let h of m) h.markers.length == 1 && e.add(h.markers[0]);
|
|
2144
|
-
let h = [];
|
|
2145
|
-
for (let m of this.clusters) m.marker != null && (m.markers.length == 1 ? e.has(m.marker) || _.setMap(m.marker, null) : h.push(m.marker));
|
|
2146
|
-
this.clusters = m, this.renderClusters(), requestAnimationFrame(() => h.forEach((e) => _.setMap(e, null)));
|
|
2147
|
-
}
|
|
2148
|
-
google.maps.event.trigger(this, I.CLUSTERING_END, this);
|
|
2149
|
-
}
|
|
2150
|
-
}
|
|
2151
|
-
onAdd() {
|
|
2152
|
-
let e = this.getMap();
|
|
2153
|
-
A(e), this.idleListener = e.addListener("idle", this.render.bind(this)), this.render();
|
|
2154
|
-
}
|
|
2155
|
-
onRemove() {
|
|
2156
|
-
this.idleListener && google.maps.event.removeListener(this.idleListener), this.reset();
|
|
2157
|
-
}
|
|
2158
|
-
reset() {
|
|
2159
|
-
this.markers.forEach((e) => _.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
|
|
2160
|
-
}
|
|
2161
|
-
renderClusters() {
|
|
2162
|
-
let e = new Cr(this.markers, this.clusters), m = this.getMap();
|
|
2163
|
-
this.clusters.forEach((h) => {
|
|
2164
|
-
if (h.markers.length === 1) h.marker = h.markers[0];
|
|
2165
|
-
else if (h.marker = this.renderer.render(h, e, m), h.markers.forEach((e) => _.setMap(e, null)), this.onClusterClick) {
|
|
2166
|
-
let e = _.isAdvancedMarker(h.marker) ? I.GMP_CLICK : I.CLUSTER_CLICK;
|
|
2167
|
-
h.marker.addListener(
|
|
2168
|
-
e,
|
|
2169
|
-
/* istanbul ignore next */
|
|
2170
|
-
(e) => {
|
|
2171
|
-
google.maps.event.trigger(this, I.CLUSTER_CLICK, h), this.onClusterClick(e, h, m);
|
|
2172
|
-
}
|
|
2173
|
-
);
|
|
2174
|
-
}
|
|
2175
|
-
_.setMap(h.marker, m);
|
|
2176
|
-
});
|
|
2177
|
-
}
|
|
2178
|
-
}, Je = Object.values(I);
|
|
2179
|
-
defineComponent({
|
|
2180
|
-
name: "MarkerCluster",
|
|
2181
|
-
props: { options: {
|
|
2182
|
-
type: Object,
|
|
2183
|
-
default: () => ({})
|
|
2184
|
-
} },
|
|
2185
|
-
emits: Je,
|
|
2186
|
-
setup(e, { emit: m, expose: h, slots: g }) {
|
|
2187
|
-
let v = ref(), y = inject(D, ref()), b = inject(Z, ref());
|
|
2188
|
-
return provide(ke, v), watch(y, () => {
|
|
2189
|
-
y.value && (v.value = markRaw(new Pr({
|
|
2190
|
-
map: y.value,
|
|
2191
|
-
algorithm: new kr(e.options.algorithmOptions ?? {}),
|
|
2192
|
-
...e.options
|
|
2193
|
-
})), Je.forEach((e) => {
|
|
2194
|
-
var h;
|
|
2195
|
-
(h = v.value) == null || h.addListener(e, (h) => m(e, h));
|
|
2196
|
-
}));
|
|
2197
|
-
}, { immediate: !0 }), onBeforeUnmount(() => {
|
|
2198
|
-
var e;
|
|
2199
|
-
v.value && ((e = b.value) == null || e.event.clearInstanceListeners(v.value), v.value.clearMarkers(), v.value.setMap(null));
|
|
2200
|
-
}), h({ markerCluster: v }), () => g.default?.call(g);
|
|
2201
|
-
}
|
|
2202
|
-
}), defineComponent({
|
|
2203
|
-
inheritAttrs: !1,
|
|
2204
|
-
props: { options: {
|
|
2205
|
-
type: Object,
|
|
2206
|
-
required: !0
|
|
2207
|
-
} },
|
|
2208
|
-
setup(e, { slots: m, emit: h, expose: g }) {
|
|
2209
|
-
let v = ref(), y = computed(() => m.default?.call(m).some((e) => e.type !== Comment)), b = J(ue, [], computed(() => ({
|
|
2210
|
-
...e.options,
|
|
2211
|
-
element: v.value
|
|
2212
|
-
})), h);
|
|
2213
|
-
return g({ customMarker: b }), {
|
|
2214
|
-
customMarkerRef: v,
|
|
2215
|
-
customMarker: b,
|
|
2216
|
-
hasSlotContent: y
|
|
2217
|
-
};
|
|
2218
|
-
}
|
|
2219
|
-
}), defineComponent({
|
|
2220
|
-
name: "HeatmapLayer",
|
|
2221
|
-
props: { options: {
|
|
2222
|
-
type: Object,
|
|
2223
|
-
default: () => ({})
|
|
2224
|
-
} },
|
|
2225
|
-
setup(e) {
|
|
2226
|
-
let m = ref(), h = inject(D, ref()), g = inject(Z, ref());
|
|
2227
|
-
return watch([h, () => e.options], ([e, v], [y, b]) => {
|
|
2228
|
-
let S = !ee(v, b) || h.value !== y;
|
|
2229
|
-
if (h.value && g.value && S) {
|
|
2230
|
-
let e;
|
|
2231
|
-
if (v.data && !(v.data instanceof g.value.MVCArray)) {
|
|
2232
|
-
let m = g.value.LatLng, h = v.data.map((e) => e instanceof m || "location" in e && (e.location instanceof m || e.location === null) ? e : "location" in e ? {
|
|
2233
|
-
...e,
|
|
2234
|
-
location: new m(e.location)
|
|
2235
|
-
} : new m(e));
|
|
2236
|
-
e = {
|
|
2237
|
-
...v,
|
|
2238
|
-
data: h
|
|
2239
|
-
};
|
|
2240
|
-
} else e = v;
|
|
2241
|
-
m.value ? m.value.setOptions(e) : m.value = markRaw(new g.value.visualization.HeatmapLayer({
|
|
2242
|
-
...e,
|
|
2243
|
-
map: h.value
|
|
2244
|
-
}));
|
|
2245
|
-
}
|
|
2246
|
-
}, { immediate: !0 }), onBeforeUnmount(() => {
|
|
2247
|
-
m.value && m.value.setMap(null);
|
|
2248
|
-
}), { heatmapLayer: m };
|
|
2249
|
-
},
|
|
2250
|
-
render: () => null
|
|
2251
|
-
});
|
|
2252
|
-
var AppGoogleMaps_default = /* @__PURE__ */ defineComponent({
|
|
2253
|
-
__name: "AppGoogleMaps",
|
|
2254
|
-
props: {
|
|
2255
|
-
center: {},
|
|
2256
|
-
zoom: {}
|
|
2257
|
-
},
|
|
2258
|
-
setup(e) {
|
|
2259
|
-
let m = e, g = useGoogleMapsApiKey();
|
|
2260
|
-
return (e, h) => unref(g).googleMapsApiKey.value ? (openBlock(), createBlock(unref(Ir), {
|
|
2261
|
-
key: 0,
|
|
2262
|
-
"api-key": unref(g).googleMapsApiKey.value,
|
|
2263
|
-
zoom: m.zoom,
|
|
2264
|
-
center: {
|
|
2265
|
-
lat: m.center.lat,
|
|
2266
|
-
lng: m.center.lng
|
|
2267
|
-
},
|
|
2268
|
-
"disable-default-ui": !0
|
|
2269
|
-
}, null, 8, [
|
|
2270
|
-
"api-key",
|
|
2271
|
-
"zoom",
|
|
2272
|
-
"center"
|
|
2273
|
-
])) : createCommentVNode("", !0);
|
|
2274
|
-
}
|
|
2275
|
-
}), _hoisted_1$4 = { class: "bg-brand-500 px-md py-xxs absolute top-3 left-3 z-2 rounded-full text-white" }, _hoisted_2$4 = { class: "absolute inset-0 z-1 flex flex-col items-center justify-center bg-gradient-to-t from-white from-10% to-transparent" }, _hoisted_3$3 = { class: "gap-md flex flex-col items-center" }, _hoisted_4$3 = { class: "bg-primary size-fit rounded-full border-1 border-white" }, _hoisted_5$1 = { class: "text-center" }, _hoisted_6 = { class: "font-semibold" }, CrmDetailSidebarMapCard_default = /* @__PURE__ */ defineComponent({
|
|
2276
|
-
__name: "CrmDetailSidebarMapCard",
|
|
2277
|
-
props: { address: {} },
|
|
2278
|
-
setup(e) {
|
|
2279
|
-
let m = e, h = useI18n();
|
|
2280
|
-
return (e, g) => m.address === null ? createCommentVNode("", !0) : (openBlock(), createBlock(CrmDetailSidebarCard_default, {
|
|
2281
|
-
key: 0,
|
|
2282
|
-
class: "relative overflow-hidden !p-0"
|
|
2283
|
-
}, {
|
|
2284
|
-
default: withCtx(() => [
|
|
2285
|
-
createElementVNode("div", _hoisted_1$4, [createElementVNode("p", null, toDisplayString(unref(h).t("wise_crm.shared.home_address")), 1)]),
|
|
2286
|
-
createElementVNode("div", _hoisted_2$4, [createElementVNode("div", _hoisted_3$3, [createElementVNode("div", _hoisted_4$3, [createVNode(unref(VcIcon), {
|
|
2287
|
-
class: "text-brand-500",
|
|
2288
|
-
icon: "homeFilled"
|
|
2289
|
-
})]), createElementVNode("div", _hoisted_5$1, [createElementVNode("p", _hoisted_6, toDisplayString(m.address?.street) + " " + toDisplayString(m.address?.streetNumber), 1), createElementVNode("p", null, toDisplayString(m.address?.postalCode) + " " + toDisplayString(m.address?.city), 1)])])]),
|
|
2290
|
-
createVNode(AppGoogleMaps_default, {
|
|
2291
|
-
center: {
|
|
2292
|
-
lat: m.address?.coordinates.lat ?? 0,
|
|
2293
|
-
lng: m.address?.coordinates.lng ?? 0
|
|
2294
|
-
},
|
|
2295
|
-
zoom: 14,
|
|
2296
|
-
class: "h-30 w-full rounded-2xl"
|
|
2297
|
-
}, null, 8, ["center"])
|
|
2298
|
-
]),
|
|
2299
|
-
_: 1
|
|
2300
|
-
}));
|
|
2301
|
-
}
|
|
2302
|
-
}), _hoisted_1$3 = { class: "text-primary font-semibold" }, _hoisted_2$3 = { class: "gap-sm flex flex-col" }, CrmDetailSidebarAccordionBillingInformation_default = /* @__PURE__ */ defineComponent({
|
|
2303
|
-
__name: "CrmDetailSidebarAccordionBillingInformation",
|
|
2304
|
-
props: {
|
|
2305
|
-
invoiceAddress: {},
|
|
2306
|
-
invoiceEmail: {}
|
|
2307
|
-
},
|
|
2308
|
-
setup(e) {
|
|
2309
|
-
let m = e;
|
|
2310
|
-
return (e, h) => (openBlock(), createBlock(CrmDetailSidebarCard_default, { class: "gap-md flex flex-col" }, {
|
|
2311
|
-
default: withCtx(() => [createElementVNode("p", _hoisted_1$3, toDisplayString(m.invoiceEmail), 1), createElementVNode("div", _hoisted_2$3, [createVNode(AppIconLabelPair_default, {
|
|
2312
|
-
label: m.invoiceAddress === null ? "-" : unref(AddressUtil).formatShort(m.invoiceAddress),
|
|
2313
|
-
icon: "locationPin"
|
|
2314
|
-
}, null, 8, ["label"])])]),
|
|
2315
|
-
_: 1
|
|
2316
|
-
}));
|
|
2317
|
-
}
|
|
2318
|
-
}), _hoisted_1$2 = { class: "flex items-start justify-between" }, _hoisted_2$2 = { class: "flex flex-col items-start" }, _hoisted_3$2 = { class: "text-brand-700" }, _hoisted_4$2 = { class: "-mt-2 -mr-2 flex items-center justify-end" }, _hoisted_5 = { class: "gap-lg grid" }, CrmDetailSidebarAccordionContactPersonInfo_default = /* @__PURE__ */ defineComponent({
|
|
2319
|
-
__name: "CrmDetailSidebarAccordionContactPersonInfo",
|
|
2320
|
-
props: {
|
|
2321
|
-
contactPerson: {},
|
|
2322
|
-
onToggleIsPrimary: { type: Function }
|
|
2323
|
-
},
|
|
2324
|
-
emits: ["delete", "update"],
|
|
2325
|
-
setup(e, { emit: m }) {
|
|
2326
|
-
let h = e, g = m, v = useI18n();
|
|
2327
|
-
function y() {
|
|
2328
|
-
g("update");
|
|
2329
|
-
}
|
|
2330
|
-
function S() {
|
|
2331
|
-
g("delete");
|
|
2332
|
-
}
|
|
2333
|
-
function C() {
|
|
2334
|
-
h.onToggleIsPrimary();
|
|
2335
|
-
}
|
|
2336
|
-
return (e, m) => (openBlock(), createBlock(CrmDetailSidebarCard_default, { class: "gap-lg flex flex-col" }, {
|
|
2337
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_1$2, [createElementVNode("div", _hoisted_2$2, [createVNode(AppOpenEntityButton_default, {
|
|
2338
|
-
"class-config": { root: "bg-transparent border-none text-primary shadow-none h-auto w-auto hover:underline p-0 font-semibold" },
|
|
2339
|
-
"entity-type": unref(EntityType).INDIVIDUAL,
|
|
2340
|
-
uuid: h.contactPerson.uuid
|
|
2341
|
-
}, {
|
|
2342
|
-
default: withCtx(() => [createTextVNode(toDisplayString(h.contactPerson.firstName) + " " + toDisplayString(h.contactPerson.lastName), 1)]),
|
|
2343
|
-
_: 1
|
|
2344
|
-
}, 8, ["entity-type", "uuid"]), createElementVNode("p", _hoisted_3$2, toDisplayString(h.contactPerson.position), 1)]), createElementVNode("div", _hoisted_4$2, [createVNode(unref(VcIconButton), {
|
|
2345
|
-
icon: h.contactPerson.isPrimary ? "starYellow" : "starOutline",
|
|
2346
|
-
label: unref(v).t("wise_crm.info_dialog.sidebar.overview.contact_person_primary"),
|
|
2347
|
-
variant: "tertiary",
|
|
2348
|
-
size: "sm",
|
|
2349
|
-
onClick: C
|
|
2350
|
-
}, null, 8, ["icon", "label"]), createVNode(unref(VcDropdownMenu), {
|
|
2351
|
-
"class-config": { content: "min-w-fit p-sm" },
|
|
2352
|
-
"popover-align": "end"
|
|
2353
|
-
}, {
|
|
2354
|
-
trigger: withCtx(() => [createVNode(unref(VcIconButton), {
|
|
2355
|
-
variant: "tertiary",
|
|
2356
|
-
size: "sm",
|
|
2357
|
-
label: "actionMenu",
|
|
2358
|
-
icon: "threeDots"
|
|
2359
|
-
})]),
|
|
2360
|
-
content: withCtx(() => [createVNode(unref(VcDropdownMenuItem), {
|
|
2361
|
-
label: unref(v).t("wise_crm.info_dialog.sidebar.overview.update_contact_person"),
|
|
2362
|
-
icon: "editWithLine",
|
|
2363
|
-
onSelect: y
|
|
2364
|
-
}, null, 8, ["label"]), createVNode(unref(VcDropdownMenuItem), {
|
|
2365
|
-
"is-destructive": !0,
|
|
2366
|
-
"is-disabled": h.contactPerson.isPrimary,
|
|
2367
|
-
label: unref(v).t("wise_crm.shared.delete"),
|
|
2368
|
-
icon: "trash",
|
|
2369
|
-
onSelect: S
|
|
2370
|
-
}, null, 8, ["is-disabled", "label"])]),
|
|
2371
|
-
_: 1
|
|
2372
|
-
})])]), createElementVNode("div", _hoisted_5, [
|
|
2373
|
-
h.contactPerson.email === null ? createCommentVNode("", !0) : (openBlock(), createBlock(AppIconLabelPair_default, {
|
|
2374
|
-
key: 0,
|
|
2375
|
-
label: h.contactPerson.email,
|
|
2376
|
-
icon: "mail"
|
|
2377
|
-
}, null, 8, ["label"])),
|
|
2378
|
-
h.contactPerson.mobilePhone === null ? createCommentVNode("", !0) : (openBlock(), createBlock(AppIconLabelPair_default, {
|
|
2379
|
-
key: 1,
|
|
2380
|
-
label: h.contactPerson.mobilePhone,
|
|
2381
|
-
icon: "mobilePhone"
|
|
2382
|
-
}, null, 8, ["label"])),
|
|
2383
|
-
h.contactPerson.phone === null ? createCommentVNode("", !0) : (openBlock(), createBlock(AppIconLabelPair_default, {
|
|
2384
|
-
key: 2,
|
|
2385
|
-
label: h.contactPerson.phone,
|
|
2386
|
-
icon: "phone"
|
|
2387
|
-
}, null, 8, ["label"]))
|
|
2388
|
-
])]),
|
|
2389
|
-
_: 1
|
|
2390
|
-
}));
|
|
2391
|
-
}
|
|
2392
|
-
}), _hoisted_1$1 = { class: "gap-sm text-brand-500 flex items-center" }, _hoisted_2$1 = ["href"], _hoisted_3$1 = ["href"], _hoisted_4$1 = { key: 2 }, CrmDetailHeaderContactTooltip_default = /* @__PURE__ */ defineComponent({
|
|
2393
|
-
__name: "CrmDetailHeaderContactTooltip",
|
|
2394
|
-
props: {
|
|
2395
|
-
type: {},
|
|
2396
|
-
value: {}
|
|
2397
|
-
},
|
|
2398
|
-
setup(e) {
|
|
2399
|
-
let m = e, h = useI18n(), g = computed(() => {
|
|
2400
|
-
switch (m.type) {
|
|
2401
|
-
case "address": return "locationPin";
|
|
2402
|
-
case "email": return "mail";
|
|
2403
|
-
case "phone": return "phone";
|
|
2404
|
-
default: return "phone";
|
|
2405
|
-
}
|
|
2406
|
-
}), v = computed(() => {
|
|
2407
|
-
switch (m.type) {
|
|
2408
|
-
case "email": return `mailto:${m.value}`;
|
|
2409
|
-
case "phone": return `tel:${m.value}`;
|
|
2410
|
-
case "address": return `https://maps.google.com/?q=${encodeURIComponent(m.value)}`;
|
|
2411
|
-
default: return null;
|
|
2412
|
-
}
|
|
2413
|
-
}), y = computed(() => {
|
|
2414
|
-
switch (m.type) {
|
|
2415
|
-
case "email": return h.t("component.contact_tooltip.aria_label.email", { value: m.value });
|
|
2416
|
-
case "phone": return h.t("component.contact_tooltip.aria_label.phone", { value: m.value });
|
|
2417
|
-
case "address": return h.t("component.contact_tooltip.aria_label.address", { value: m.value });
|
|
2418
|
-
default: return m.value;
|
|
2419
|
-
}
|
|
2420
|
-
}), b = useClipboard({ source: m.value });
|
|
2421
|
-
function S() {
|
|
2422
|
-
b.copy(m.value);
|
|
2423
|
-
}
|
|
2424
|
-
return (b, C) => (openBlock(), createBlock(unref(VcTooltip), {
|
|
2425
|
-
"is-popover-arrow-hidden": !0,
|
|
2426
|
-
"class-config": { innerContent: "bg-primary border-secondary p-sm px-md" }
|
|
2427
|
-
}, {
|
|
2428
|
-
trigger: withCtx(() => [createVNode(unref(VcTooltipTrigger), null, {
|
|
2429
|
-
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(v.value ? "a" : "div"), {
|
|
2430
|
-
href: v.value,
|
|
2431
|
-
"aria-label": y.value,
|
|
2432
|
-
target: e.type === "address" ? "_blank" : void 0,
|
|
2433
|
-
rel: e.type === "address" ? "noopener noreferrer" : void 0,
|
|
2434
|
-
class: "dark:bg-brand-950 p-xs ring-brand-500 flex aspect-square size-8 items-center justify-center rounded-full border-none bg-gray-50/50 ring-offset-2 duration-300 outline-none focus-visible:ring-2 data-[loading=false]:not-disabled:hover:bg-gray-50/30"
|
|
2435
|
-
}, {
|
|
2436
|
-
default: withCtx(() => [createVNode(unref(VcIcon), {
|
|
2437
|
-
icon: g.value,
|
|
2438
|
-
class: "text-brand-700 size-4 shrink-0 dark:text-brand-200"
|
|
2439
|
-
}, null, 8, ["icon"])]),
|
|
2440
|
-
_: 1
|
|
2441
|
-
}, 8, [
|
|
2442
|
-
"href",
|
|
2443
|
-
"aria-label",
|
|
2444
|
-
"target",
|
|
2445
|
-
"rel"
|
|
2446
|
-
]))]),
|
|
2447
|
-
_: 1
|
|
2448
|
-
})]),
|
|
2449
|
-
content: withCtx(() => [createElementVNode("div", _hoisted_1$1, [
|
|
2450
|
-
createVNode(unref(VcIcon), {
|
|
2451
|
-
icon: g.value,
|
|
2452
|
-
class: "size-4"
|
|
2453
|
-
}, null, 8, ["icon"]),
|
|
2454
|
-
e.type === "email" ? (openBlock(), createElementBlock("a", {
|
|
2455
|
-
key: 0,
|
|
2456
|
-
href: `mailto:${m.value}`,
|
|
2457
|
-
class: "ring-brand-500 underline ring-offset-1 duration-200 outline-none focus-visible:ring-2"
|
|
2458
|
-
}, toDisplayString(m.value), 9, _hoisted_2$1)) : e.type === "phone" ? (openBlock(), createElementBlock("a", {
|
|
2459
|
-
key: 1,
|
|
2460
|
-
href: `tel:${m.value}`,
|
|
2461
|
-
class: "ring-brand-500 underline ring-offset-1 duration-200 outline-none focus-visible:ring-2"
|
|
2462
|
-
}, toDisplayString(m.value), 9, _hoisted_3$1)) : (openBlock(), createElementBlock("p", _hoisted_4$1, toDisplayString(m.value), 1)),
|
|
2463
|
-
createVNode(unref(VcIconButton), {
|
|
2464
|
-
"class-config": {
|
|
2465
|
-
root: "bg-transparent border-none shadow-none p-0 w-auto h-auto rounded-sm p-xs data-[loading=false]:not-disabled:hover:bg-secondary",
|
|
2466
|
-
icon: "text-primary size-4"
|
|
2467
|
-
},
|
|
2468
|
-
label: unref(h).t("wise_crm.info_dialog.copy_to_clipboard"),
|
|
2469
|
-
icon: "copy",
|
|
2470
|
-
onClick: S
|
|
2471
|
-
}, null, 8, ["label"])
|
|
2472
|
-
])]),
|
|
2473
|
-
_: 1
|
|
2474
|
-
}));
|
|
2475
|
-
}
|
|
2476
|
-
}), _hoisted_1 = { class: "gap-xl border-brand-300 from-brand-50 to-brand-200 p-xl flex flex-col rounded-2xl border bg-linear-to-r shadow-[0px_8px_12px_0px_rgba(104,186,246,0.12)] dark:from-brand-800 dark:to-brand-900" }, _hoisted_2 = { class: "flex justify-between" }, _hoisted_3 = { class: "text-primary max-w-55 text-xl font-bold" }, _hoisted_4 = { class: "gap-sm flex h-fit" }, CrmDetailHeaderCard_default = /* @__PURE__ */ defineComponent({
|
|
2477
|
-
__name: "CrmDetailHeaderCard",
|
|
2478
|
-
props: {
|
|
2479
|
-
name: {},
|
|
2480
|
-
address: {},
|
|
2481
|
-
email: {},
|
|
2482
|
-
entityName: {},
|
|
2483
|
-
mobilePhone: {},
|
|
2484
|
-
phone: {}
|
|
2485
|
-
},
|
|
2486
|
-
setup(e) {
|
|
2487
|
-
let m = e;
|
|
2488
|
-
return (e, h) => (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("h2", _hoisted_3, toDisplayString(m.name), 1), createElementVNode("div", _hoisted_4, [
|
|
2489
|
-
renderSlot(e.$slots, "actions"),
|
|
2490
|
-
m.email === null ? createCommentVNode("", !0) : (openBlock(), createBlock(CrmDetailHeaderContactTooltip_default, {
|
|
2491
|
-
key: 0,
|
|
2492
|
-
value: m.email,
|
|
2493
|
-
type: "email"
|
|
2494
|
-
}, null, 8, ["value"])),
|
|
2495
|
-
m.mobilePhone !== null || m.phone !== null ? (openBlock(), createBlock(CrmDetailHeaderContactTooltip_default, {
|
|
2496
|
-
key: 1,
|
|
2497
|
-
value: m.mobilePhone ?? m.phone ?? "",
|
|
2498
|
-
type: "phone"
|
|
2499
|
-
}, null, 8, ["value"])) : createCommentVNode("", !0),
|
|
2500
|
-
m.address === null ? createCommentVNode("", !0) : (openBlock(), createBlock(CrmDetailHeaderContactTooltip_default, {
|
|
2501
|
-
key: 2,
|
|
2502
|
-
value: unref(AddressUtil).format(m.address),
|
|
2503
|
-
type: "address"
|
|
2504
|
-
}, null, 8, ["value"]))
|
|
2505
|
-
])]), createElementVNode("div", null, [createVNode(unref(VcBadge), {
|
|
2506
|
-
variant: "translucent",
|
|
2507
|
-
color: "brand",
|
|
2508
|
-
icon: "user"
|
|
2509
|
-
}, {
|
|
2510
|
-
default: withCtx(() => [createTextVNode(toDisplayString(m.entityName ?? "-"), 1)]),
|
|
2511
|
-
_: 1
|
|
2512
|
-
})])]));
|
|
2513
|
-
}
|
|
2514
|
-
});
|
|
2515
|
-
export { contactPersonUpdateFormSchema as a, AddressUtil as c, CrmDetailSidebarMapCard_default as i, ActivityList_default as l, CrmDetailSidebarAccordionContactPersonInfo_default as n, ContactPersonCreateForm_default as o, CrmDetailSidebarAccordionBillingInformation_default as r, ContactPersonCreateNewForm_default as s, CrmDetailHeaderCard_default as t, assert as u };
|