@konnectio/core 4.0.2 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ActionField-138c1747.mjs → ActionField-1b4171c7.mjs} +22 -23
- package/dist/ActionField-1b4171c7.mjs.br +0 -0
- package/dist/ActionField-97c0c682.js +2 -0
- package/dist/ActionField-97c0c682.js.br +0 -0
- package/dist/Clickable-eb931b15.mjs +13899 -0
- package/dist/Clickable-eb931b15.mjs.br +0 -0
- package/dist/Clickable-f57e16ad.js +785 -0
- package/dist/Clickable-f57e16ad.js.br +0 -0
- package/dist/HotelAvailabilityForm-5750665b.js +2 -0
- package/dist/HotelAvailabilityForm-5750665b.js.br +0 -0
- package/dist/{HotelAvailabilityForm-a550be2e.mjs → HotelAvailabilityForm-bab6ef4d.mjs} +21 -22
- package/dist/HotelAvailabilityForm-bab6ef4d.mjs.br +0 -0
- package/dist/{NumberField.vue_vue_type_style_index_0_lang-778e8361.mjs → NumberField.vue_vue_type_style_index_0_lang-737bf674.mjs} +52 -53
- package/dist/NumberField.vue_vue_type_style_index_0_lang-737bf674.mjs.br +0 -0
- package/dist/{NumberField.vue_vue_type_style_index_0_lang-de20cf9f.js → NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js} +20 -20
- package/dist/NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-36454b0f.js +2 -0
- package/dist/ReCaptchaVuePlugin-36454b0f.js.br +0 -0
- package/dist/{ReCaptchaVuePlugin-59863bbf.mjs → ReCaptchaVuePlugin-e4f378b2.mjs} +3 -3
- package/dist/ReCaptchaVuePlugin-e4f378b2.mjs.br +0 -0
- package/dist/{SelectField.vue_vue_type_style_index_0_lang-aa7a93a7.js → SelectField.vue_vue_type_style_index_0_lang-a3371159.js} +27 -27
- package/dist/SelectField.vue_vue_type_style_index_0_lang-a3371159.js.br +0 -0
- package/dist/{SelectField.vue_vue_type_style_index_0_lang-b4fb229d.mjs → SelectField.vue_vue_type_style_index_0_lang-d7f0bf68.mjs} +296 -297
- package/dist/SelectField.vue_vue_type_style_index_0_lang-d7f0bf68.mjs.br +0 -0
- package/dist/ThankYou-23531d13.js +16 -0
- package/dist/ThankYou-23531d13.js.br +0 -0
- package/dist/{ThankYou-95c1eef3.mjs → ThankYou-4299d606.mjs} +265 -266
- package/dist/ThankYou-4299d606.mjs.br +0 -0
- package/dist/_commonjsHelpers-6763f629.js +2 -0
- package/dist/_commonjsHelpers-c5d32002.mjs +31 -0
- package/dist/applyGiftCard-9847fda1.js +2 -0
- package/dist/applyGiftCard-9847fda1.js.br +0 -0
- package/dist/{applyGiftCard-fb6fb8f4.mjs → applyGiftCard-eb7b85ee.mjs} +20 -20
- package/dist/applyGiftCard-eb7b85ee.mjs.br +0 -0
- package/dist/availability.cjs.js +1 -1
- package/dist/availability.cjs.js.br +0 -0
- package/dist/availability.es.js +22 -23
- package/dist/availability.es.js.br +0 -0
- package/dist/{event-d697bdb9.mjs → event-1b888019.mjs} +11 -11
- package/dist/event-1b888019.mjs.br +0 -0
- package/dist/event-e8e0c6a2.js +2 -0
- package/dist/event-e8e0c6a2.js.br +0 -0
- package/dist/event.cjs.js +1 -1
- package/dist/event.cjs.js.br +0 -0
- package/dist/event.es.js +149 -150
- package/dist/event.es.js.br +0 -0
- package/dist/gift-card-validation.cjs.js +1 -1
- package/dist/gift-card-validation.cjs.js.br +0 -0
- package/dist/gift-card-validation.es.js +44 -45
- package/dist/gift-card-validation.es.js.br +0 -0
- package/dist/gift-card.cjs.js +1 -1
- package/dist/gift-card.cjs.js.br +0 -0
- package/dist/gift-card.es.js +192 -193
- package/dist/gift-card.es.js.br +0 -0
- package/dist/hotel.cjs.js +5 -5
- package/dist/hotel.cjs.js.br +0 -0
- package/dist/hotel.es.js +258 -257
- package/dist/hotel.es.js.br +0 -0
- package/dist/{index-76459611.mjs → index-937554a9.mjs} +14 -16
- package/dist/index-937554a9.mjs.br +0 -0
- package/dist/index-aa255eba.js +2 -0
- package/dist/index-aa255eba.js.br +0 -0
- package/dist/navigation.cjs.js +1 -1
- package/dist/navigation.cjs.js.br +0 -0
- package/dist/navigation.es.js +18 -19
- package/dist/navigation.es.js.br +0 -0
- package/dist/payment-3140b25e.js +3 -0
- package/dist/payment-3140b25e.js.br +0 -0
- package/dist/{payment-31263275.mjs → payment-b79997a8.mjs} +3 -3
- package/dist/payment-b79997a8.mjs.br +0 -0
- package/dist/polyfill.cjs.js +2 -2
- package/dist/polyfill.cjs.js.br +0 -0
- package/dist/polyfill.es.js +2 -2
- package/dist/polyfill.es.js.br +0 -0
- package/package.json +1 -1
- package/dist/ActionField-138c1747.mjs.br +0 -0
- package/dist/ActionField-2b6751b4.js +0 -2
- package/dist/ActionField-2b6751b4.js.br +0 -0
- package/dist/Clickable-26efd8d0.mjs +0 -3497
- package/dist/Clickable-26efd8d0.mjs.br +0 -0
- package/dist/Clickable-6b252cca.js +0 -763
- package/dist/Clickable-6b252cca.js.br +0 -0
- package/dist/HotelAvailabilityForm-56badafa.js +0 -2
- package/dist/HotelAvailabilityForm-56badafa.js.br +0 -0
- package/dist/HotelAvailabilityForm-a550be2e.mjs.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-778e8361.mjs.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-de20cf9f.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-59863bbf.mjs.br +0 -0
- package/dist/ReCaptchaVuePlugin-809f1dcc.js +0 -2
- package/dist/ReCaptchaVuePlugin-809f1dcc.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-aa7a93a7.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-b4fb229d.mjs.br +0 -0
- package/dist/ThankYou-103d0395.js +0 -16
- package/dist/ThankYou-103d0395.js.br +0 -0
- package/dist/ThankYou-95c1eef3.mjs.br +0 -0
- package/dist/_commonjsHelpers-10dfc225.mjs +0 -9
- package/dist/_commonjsHelpers-87b0abe8.js +0 -2
- package/dist/applyGiftCard-2eac2416.js +0 -2
- package/dist/applyGiftCard-2eac2416.js.br +0 -0
- package/dist/applyGiftCard-fb6fb8f4.mjs.br +0 -0
- package/dist/event-b7b4870b.js +0 -2
- package/dist/event-b7b4870b.js.br +0 -0
- package/dist/event-d697bdb9.mjs.br +0 -0
- package/dist/index-76459611.mjs.br +0 -0
- package/dist/index-95820cc1.js +0 -2
- package/dist/index-95820cc1.js.br +0 -0
- package/dist/payment-215f120d.js +0 -3
- package/dist/payment-215f120d.js.br +0 -0
- package/dist/payment-31263275.mjs.br +0 -0
package/dist/event.es.js.br
CHANGED
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("
|
|
1
|
+
"use strict";const e=require("./Clickable-f57e16ad.js"),t=require("./NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js"),p=require("./applyGiftCard-9847fda1.js"),h=require("./ActionField-97c0c682.js");require("./SelectField.vue_vue_type_style_index_0_lang-a3371159.js");require("./_commonjsHelpers-6763f629.js");const y=r=>(e.pushScopeId("data-v-64c7a8a4"),r=r(),e.popScopeId(),r),m=["innerHTML"],N={key:0,id:"fresh-booking-gift-card-validation-resume",class:"fresh-booking-panel"},F=y(()=>e.createBaseVNode("span",null,"Loading...",-1)),k=e.defineComponent({__name:"GiftCardValidation",props:{accessToken:{},accentColor:{},buttonBackground:{},buttonBorder:{},buttonBorderRadius:{},buttonColor:{},buttonFontFamily:{},buttonFontSize:{},buttonTextTransform:{},buttonFontWeight:{},fontColor:{},fontFamily:{},fontSize:{},fontWeight:{},grayColor:{},headerColor:{},headerFontSize:{},inputBackground:{},inputBorder:{},inputBorderRadius:{},inputFontColor:{},labelFontWeight:{},labelPadding:{},loadingColor:{},panelBackground:{},panelBorder:{},panelBorderRadius:{},panelPadding:{}},setup(r){const o=r,{t:a}=t.useI18n(),{voucher:s,isValid:f,amount:g,expirationDate:B,productName:b,isLoading:l}=t.storeToRefs(p.useApplyGiftCardStore()),{currency:C}=t.storeToRefs(t.useUtilityStore()),{apply:c}=p.useApplyGiftCardStore(),V={"--accentColor":o.accentColor,"--buttonBackground":o.buttonBackground,"--buttonBorder":o.buttonBorder,"--buttonBorderRadius":o.buttonBorderRadius,"--buttonColor":o.buttonColor,"--buttonFontFamily":o.buttonFontFamily,"--buttonFontSize":o.buttonFontSize,"--buttonTextTransform":o.buttonTextTransform,"--buttonFontWeight":o.buttonFontWeight,"--fontColor":o.fontColor,"--fontFamily":o.fontFamily,"--fontSize":o.fontSize,"--fontWeight":o.fontWeight,"--grayColor":o.grayColor,"--headerColor":o.headerColor,"--headerFontSize":o.headerFontSize,"--inputBackground":o.inputBackground,"--inputBorder":o.inputBorder,"--inputBorderRadius":o.inputBorderRadius,"--inputFontColor":o.inputFontColor,"--labelFontWeight":o.labelFontWeight,"--labelPadding":o.labelPadding,"--loadingColor":o.loadingColor,"--panelBackground":o.panelBackground,"--panelBorder":o.panelBorder,"--panelBorderRadius":o.panelBorderRadius,"--panelPadding":o.panelPadding};return(d,n)=>(e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(t._sfc_main,{id:"fresh-booking-gift-card-validation-module",class:"fresh-booking-app","access-token":d.accessToken,type:"gift-card",style:V},{default:e.withCtx(()=>[e.createBaseVNode("form",{onSubmit:n[3]||(n[3]=e.withModifiers(i=>e.unref(c)(),["prevent"]))},[e.createBaseVNode("h4",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.title")),1)]),e.createBaseVNode("p",{innerHTML:e.unref(a)("giftCardValidation.description")},null,8,m),e.createVNode(h.ActionField,{modelValue:e.unref(s),"onUpdate:modelValue":n[0]||(n[0]=i=>e.isRef(s)?s.value=i:null),icon:"gift-card",label:e.unref(a)("booking.reservation.giftCardCode"),buttonLabel:e.unref(a)("giftCardValidation.submitButton"),placeholder:"XXXXXXXX","is-loading":e.unref(l),"onUpdate:isLoading":n[1]||(n[1]=i=>e.isRef(l)?l.value=i:null),onAction:n[2]||(n[2]=i=>e.unref(c)())},null,8,["modelValue","label","buttonLabel","is-loading"]),!e.unref(l)&&e.unref(f)?(e.openBlock(),e.createElementBlock("table",N,[e.createBaseVNode("thead",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.giftCard")),1),e.createVNode(e.Icon,{icon:"gift-card",type:"fas","icon-color":d.headerColor},null,8,["icon-color"])]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.balance")),1),e.createVNode(e.Icon,{icon:"money-bill",type:"fas","icon-color":d.headerColor},null,8,["icon-color"])]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.expirationDate")),1),e.createVNode(e.Icon,{icon:"timer",type:"fas","icon-color":d.headerColor},null,8,["icon-color"])])])]),e.createBaseVNode("tbody",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(b)),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(t.showPrice)(e.unref(g),e.unref(C))),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(t.showDate)(e.unref(B))),1)])])])])):e.createCommentVNode("",!0)],32)]),_:1},8,["access-token"])]),fallback:e.withCtx(()=>[F]),_:1}))}});const _=e._export_sfc(k,[["__scopeId","data-v-64c7a8a4"]]);process.env.NODE_ENV==="production"&&t.distExports.flare.light("rzAIZ4UzZcOlUo0F0ZcYWETY9Z6JXf82");const u=e.createApp({components:{GiftCardValidation:_}}),S=t.createPinia();u.use(t.distExports$1.flareVue);u.use(S);u.use(t.instance);u.mount("#fresh-booking-gift-card-validation-app");
|
|
2
2
|
//# sourceMappingURL=gift-card-validation.cjs.js.map
|
|
Binary file
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as B } from "./applyGiftCard-
|
|
4
|
-
import { A as
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
|
|
8
|
-
const H = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), O = ["innerHTML"], Y = {
|
|
1
|
+
import { d as v, o as m, h as T, w as f, a as d, b as t, t as i, u as n, i as C, c as z, I as g, k as R, j as W, S as X, p as I, l as P, _ as x, m as L } from "./Clickable-eb931b15.mjs";
|
|
2
|
+
import { u as w, s as h, k as A, j as E, n as N, _ as D, d as U, c as G, a as Z, i as $ } from "./NumberField.vue_vue_type_style_index_0_lang-737bf674.mjs";
|
|
3
|
+
import { u as B } from "./applyGiftCard-eb7b85ee.mjs";
|
|
4
|
+
import { A as M } from "./ActionField-1b4171c7.mjs";
|
|
5
|
+
import "./SelectField.vue_vue_type_style_index_0_lang-d7f0bf68.mjs";
|
|
6
|
+
import "./_commonjsHelpers-c5d32002.mjs";
|
|
7
|
+
const j = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), H = ["innerHTML"], O = {
|
|
9
8
|
key: 0,
|
|
10
9
|
id: "fresh-booking-gift-card-validation-resume",
|
|
11
10
|
class: "fresh-booking-panel"
|
|
12
|
-
},
|
|
11
|
+
}, Y = /* @__PURE__ */ j(() => /* @__PURE__ */ t("span", null, "Loading...", -1)), J = /* @__PURE__ */ v({
|
|
13
12
|
__name: "GiftCardValidation",
|
|
14
13
|
props: {
|
|
15
14
|
accessToken: {},
|
|
@@ -42,14 +41,14 @@ const H = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), O = ["innerHTML"], Y =
|
|
|
42
41
|
panelPadding: {}
|
|
43
42
|
},
|
|
44
43
|
setup(l) {
|
|
45
|
-
const o = l, { t:
|
|
44
|
+
const o = l, { t: e } = w(), {
|
|
46
45
|
voucher: c,
|
|
47
|
-
isValid:
|
|
48
|
-
amount:
|
|
46
|
+
isValid: k,
|
|
47
|
+
amount: F,
|
|
49
48
|
expirationDate: y,
|
|
50
49
|
productName: _,
|
|
51
|
-
isLoading:
|
|
52
|
-
} = h(B()), { currency:
|
|
50
|
+
isLoading: s
|
|
51
|
+
} = h(B()), { currency: S } = h(A()), { apply: b } = B(), V = {
|
|
53
52
|
"--accentColor": o.accentColor,
|
|
54
53
|
"--buttonBackground": o.buttonBackground,
|
|
55
54
|
"--buttonBorder": o.buttonBorder,
|
|
@@ -78,61 +77,61 @@ const H = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), O = ["innerHTML"], Y =
|
|
|
78
77
|
"--panelBorderRadius": o.panelBorderRadius,
|
|
79
78
|
"--panelPadding": o.panelPadding
|
|
80
79
|
};
|
|
81
|
-
return (
|
|
80
|
+
return (u, a) => (m(), T(X, null, {
|
|
82
81
|
default: f(() => [
|
|
83
|
-
d(
|
|
82
|
+
d(D, {
|
|
84
83
|
id: "fresh-booking-gift-card-validation-module",
|
|
85
84
|
class: "fresh-booking-app",
|
|
86
|
-
"access-token":
|
|
85
|
+
"access-token": u.accessToken,
|
|
87
86
|
type: "gift-card",
|
|
88
|
-
style:
|
|
87
|
+
style: V
|
|
89
88
|
}, {
|
|
90
89
|
default: f(() => [
|
|
91
90
|
t("form", {
|
|
92
|
-
onSubmit:
|
|
91
|
+
onSubmit: a[3] || (a[3] = W((r) => n(b)(), ["prevent"]))
|
|
93
92
|
}, [
|
|
94
93
|
t("h4", null, [
|
|
95
|
-
t("span", null, i(n(
|
|
94
|
+
t("span", null, i(n(e)("giftCardValidation.title")), 1)
|
|
96
95
|
]),
|
|
97
96
|
t("p", {
|
|
98
|
-
innerHTML: n(
|
|
99
|
-
}, null, 8,
|
|
100
|
-
d(
|
|
97
|
+
innerHTML: n(e)("giftCardValidation.description")
|
|
98
|
+
}, null, 8, H),
|
|
99
|
+
d(M, {
|
|
101
100
|
modelValue: n(c),
|
|
102
|
-
"onUpdate:modelValue":
|
|
101
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => C(c) ? c.value = r : null),
|
|
103
102
|
icon: "gift-card",
|
|
104
|
-
label: n(
|
|
105
|
-
buttonLabel: n(
|
|
103
|
+
label: n(e)("booking.reservation.giftCardCode"),
|
|
104
|
+
buttonLabel: n(e)("giftCardValidation.submitButton"),
|
|
106
105
|
placeholder: "XXXXXXXX",
|
|
107
|
-
"is-loading": n(
|
|
108
|
-
"onUpdate:isLoading":
|
|
109
|
-
onAction:
|
|
106
|
+
"is-loading": n(s),
|
|
107
|
+
"onUpdate:isLoading": a[1] || (a[1] = (r) => C(s) ? s.value = r : null),
|
|
108
|
+
onAction: a[2] || (a[2] = (r) => n(b)())
|
|
110
109
|
}, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
|
|
111
|
-
!n(
|
|
110
|
+
!n(s) && n(k) ? (m(), z("table", O, [
|
|
112
111
|
t("thead", null, [
|
|
113
112
|
t("tr", null, [
|
|
114
113
|
t("th", null, [
|
|
115
|
-
t("span", null, i(n(
|
|
114
|
+
t("span", null, i(n(e)("giftCardValidation.giftCard")), 1),
|
|
116
115
|
d(g, {
|
|
117
116
|
icon: "gift-card",
|
|
118
117
|
type: "fas",
|
|
119
|
-
"icon-color":
|
|
118
|
+
"icon-color": u.headerColor
|
|
120
119
|
}, null, 8, ["icon-color"])
|
|
121
120
|
]),
|
|
122
121
|
t("th", null, [
|
|
123
|
-
t("span", null, i(n(
|
|
122
|
+
t("span", null, i(n(e)("giftCardValidation.balance")), 1),
|
|
124
123
|
d(g, {
|
|
125
124
|
icon: "money-bill",
|
|
126
125
|
type: "fas",
|
|
127
|
-
"icon-color":
|
|
126
|
+
"icon-color": u.headerColor
|
|
128
127
|
}, null, 8, ["icon-color"])
|
|
129
128
|
]),
|
|
130
129
|
t("th", null, [
|
|
131
|
-
t("span", null, i(n(
|
|
130
|
+
t("span", null, i(n(e)("giftCardValidation.expirationDate")), 1),
|
|
132
131
|
d(g, {
|
|
133
132
|
icon: "timer",
|
|
134
133
|
type: "fas",
|
|
135
|
-
"icon-color":
|
|
134
|
+
"icon-color": u.headerColor
|
|
136
135
|
}, null, 8, ["icon-color"])
|
|
137
136
|
])
|
|
138
137
|
])
|
|
@@ -143,31 +142,31 @@ const H = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), O = ["innerHTML"], Y =
|
|
|
143
142
|
t("span", null, i(n(_)), 1)
|
|
144
143
|
]),
|
|
145
144
|
t("td", null, [
|
|
146
|
-
t("span", null, i(n(
|
|
145
|
+
t("span", null, i(n(E)(n(F), n(S))), 1)
|
|
147
146
|
]),
|
|
148
147
|
t("td", null, [
|
|
149
|
-
t("span", null, i(n(
|
|
148
|
+
t("span", null, i(n(N)(n(y))), 1)
|
|
150
149
|
])
|
|
151
150
|
])
|
|
152
151
|
])
|
|
153
|
-
])) :
|
|
152
|
+
])) : R("", !0)
|
|
154
153
|
], 32)
|
|
155
154
|
]),
|
|
156
155
|
_: 1
|
|
157
156
|
}, 8, ["access-token"])
|
|
158
157
|
]),
|
|
159
158
|
fallback: f(() => [
|
|
160
|
-
|
|
159
|
+
Y
|
|
161
160
|
]),
|
|
162
161
|
_: 1
|
|
163
162
|
}));
|
|
164
163
|
}
|
|
165
164
|
});
|
|
166
|
-
const q = /* @__PURE__ */
|
|
167
|
-
process.env.NODE_ENV === "production" &&
|
|
168
|
-
const p =
|
|
169
|
-
p.use(
|
|
165
|
+
const q = /* @__PURE__ */ x(J, [["__scopeId", "data-v-64c7a8a4"]]);
|
|
166
|
+
process.env.NODE_ENV === "production" && U.flare.light("rzAIZ4UzZcOlUo0F0ZcYWETY9Z6JXf82");
|
|
167
|
+
const p = L({ components: { GiftCardValidation: q } }), K = G();
|
|
168
|
+
p.use(Z.flareVue);
|
|
170
169
|
p.use(K);
|
|
171
|
-
p.use(
|
|
170
|
+
p.use($);
|
|
172
171
|
p.mount("#fresh-booking-gift-card-validation-app");
|
|
173
172
|
//# sourceMappingURL=gift-card-validation.es.js.map
|
|
Binary file
|
package/dist/gift-card.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),o=require("./NumberField.vue_vue_type_style_index_0_lang-de20cf9f.js"),S=require("./index-95820cc1.js"),W=require("./ReCaptchaVuePlugin-809f1dcc.js"),P=require("./SelectField.vue_vue_type_style_index_0_lang-aa7a93a7.js"),C=require("./Clickable-6b252cca.js");require("./_commonjsHelpers-87b0abe8.js");const I=o.defineStore("giftCard",()=>{const{display:p}=o.useAlertStore(),{bearerToken:a,metaData:t}=o.storeToRefs(o.useUtilityStore()),l=e.ref(o.GiftCardModuleState.InitialState),y=o.useStorage("freshBookingName","",void 0,{serializer:o.StorageSerializers.string}),c=o.useStorage("freshBookingEmail","",void 0,{serializer:o.StorageSerializers.string}),f=o.useStorage("freshBookingPhone","",void 0,{serializer:o.StorageSerializers.string}),v=e.ref(""),k=e.ref(1),F=e.ref(!0),N=e.ref(""),g=e.ref({base64:"",type:"",name:""}),r=e.ref(void 0),d=e.ref(0),m=e.ref(!1),V=e.ref(0),h=e.computed(()=>l.value===o.GiftCardModuleState.InitialState||l.value===o.GiftCardModuleState.WaitingForResponse),_=e.computed(()=>l.value===o.GiftCardModuleState.ReadyToPay),R=e.computed(()=>l.value===o.GiftCardModuleState.PaymentSuccess),b=e.computed(()=>{const s={1:{label:o.i18n.t("giftCard.hotelType"),data:[]},2:{label:o.i18n.t("giftCard.restaurantType"),data:[]}},i=t.value.places;return i&&i.forEach(n=>{s[n.placeType].data.push(n)}),Object.fromEntries(Object.entries(s).filter(([,n])=>n.data.length>0))}),T=e.computed(()=>V.value!==0),B=e.computed(()=>{let s;if(T.value)s=b.value[V.value].data[0];else if(d.value!==0){const i=r.value,n=b.value[d.value].data;n.length===1?s=n[0]:i!==void 0&&n.forEach(w=>{String(w.id)===String(i)&&(s=w)})}return s}),z=e.computed(()=>!(!y.value||!c.value||!(f.value.length>=5)||!v.value||B.value===void 0)),M=e.computed(()=>!(l.value===o.GiftCardModuleState.InitialState&&m.value)),U=e.computed(()=>!!(l.value===o.GiftCardModuleState.WaitingForResponse&&m.value));async function G(){l.value=o.GiftCardModuleState.WaitingForResponse,m.value=!0,await o.axios.post("http://localhost:91/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:t.value.currency.id,language:o.getUserLanguage(),amount:v.value,quantity:k.value,freeText:N.value,showPrice:F.value,contactName:y.value,contactEmail:c.value,contactPhone:f.value,imageBase64:o.b2a(g.value.base64),imageName:g.value.name,imageFormat:g.value.type,placeType:B.value?B.value.placeType:void 0,placeID:B.value?B.value.id:void 0},{headers:{Authorization:a.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.1"}}).then(s=>{if(m.value=!1,s.data.easyPayment){l.value=o.GiftCardModuleState.ReadyToPay;const i=new Reepay.EmbeddedCheckout(s.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});i.addEventHandler(o.ReepayEvent.Accept,()=>{l.value=o.GiftCardModuleState.PaymentSuccess,p({message:o.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),i.addEventHandler(o.ReepayEvent.Error,()=>{p({message:o.i18n.t("booking.other.errorMessage"),type:"warning"})})}else l.value=o.GiftCardModuleState.InitialState,p({message:`${o.i18n.t("booking.other.errorMessage")} (HTTP: ${s.status})`,type:"warning"})})}function q(s){V.value=s}return{moduleState:l,name:y,email:c,phone:f,value:v,remark:N,showValue:F,quantity:k,media:g,placeId:r,placeType:d,showFormPage:h,showPaymentPage:_,showConfirmationPage:R,places:b,hasFilledForm:z,hasForcedPlaceType:T,isWaitingForResponse:U,isMetaDataAvailable:M,orderGiftCard:G,initialize:q}}),x={class:"media-selector"},A=["accept"],H={class:"media-selector-wrapper"},O={class:"media-selector-tools"},j={key:0},K={key:1},Y={key:2},J=["src"],Q=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(p,{emit:a}){const t=p,{t:l}=o.useI18n(),{display:y}=o.useAlertStore(),c=e.ref(),f=e.computed(()=>t.modelValue.base64!=="");function v(r){a("update:modelValue",r)}function k(){v({base64:"",name:"",type:""}),c.value&&(c.value.value="")}function F(){c.value&&c.value.click()}function N(r,d){const[m,V]=[r.name,r.type],h=new FileReader;h.onload=function(_){if(_.target){const R=_.target.result;d({base64:R,name:m,type:V})}else y({message:l("imageUploadError"),type:"error"})},h.readAsDataURL(r)}async function g(){let r;(r=c.value.files)instanceof FileList&&N(r[0],v)}return(r,d)=>(e.openBlock(),e.createBlock(o.InputField,{label:r.label,required:r.required,type:"media"},{default:e.withCtx(()=>[e.createElementVNode("div",x,[e.createElementVNode("input",{ref_key:"fileInput",ref:c,type:"file",class:"hidden",accept:r.validation,single:"",onChange:d[0]||(d[0]=m=>g())},null,40,A),e.createElementVNode("div",H,[e.createElementVNode("ul",O,[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(C.Clickable,{label:e.unref(l)("uploadFile"),type:"button",icon:"upload","icon-color":r.iconColor,onClickEvent:d[1]||(d[1]=m=>F())},null,8,["label","icon-color"])])),f.value?(e.openBlock(),e.createElementBlock("li",K,[e.createVNode(C.Clickable,{label:e.unref(l)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":r.iconColor,onClickEvent:d[2]||(d[2]=m=>F())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("li",Y,[e.createVNode(C.Clickable,{label:e.unref(l)("removeFile"),type:"button",icon:"trash-alt","icon-color":r.iconColor,onClickEvent:d[3]||(d[3]=m=>k())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:f.value}])},[r.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.modelValue.base64},null,8,J)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function D(p){const a=p;a.__i18n=a.__i18n||[],a.__i18n.push({locale:"",resource:{da:{uploadFile:t=>{const{normalize:l}=t;return l(["Upload billede"])},removeFile:t=>{const{normalize:l}=t;return l(["Fjern billede"])},replaceFile:t=>{const{normalize:l}=t;return l(["Ersat billede"])},imageUploadError:t=>{const{normalize:l}=t;return l(["Der skete en fejl under billede upload!"])}},en:{uploadFile:t=>{const{normalize:l}=t;return l(["Upload image"])},removeFile:t=>{const{normalize:l}=t;return l(["Remove image"])},replaceFile:t=>{const{normalize:l}=t;return l(["Replace image"])},imageUploadError:t=>{const{normalize:l}=t;return l(["An error occurred under image upload!"])}}}})}typeof D=="function"&&D(Q);const X=p=>(e.pushScopeId("data-v-10b51e8f"),p=p(),e.popScopeId(),p),Z={key:0,id:"fresh-booking-gift-card-wrapper"},ee={id:"fresh-booking-gift-card-title"},oe={id:"fresh-booking-gift-card-content"},te={id:"fresh-booking-gift-card-payment"},ae=["innerHTML"],le={key:0},ne={key:0,id:"fresh-booking-select-place-type"},re={class:e.normalizeClass(["fresh-booking-label","required"])},ie={id:"fresh-booking-select-place-type-input"},de=["innerHTML"],ue={key:0,id:"fresh-booking-gift-card-order"},se={class:"fresh-booking-panel"},ce={key:1,id:"fresh-booking-gift-card-remarks"},pe={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},fe={id:"fresh-booking-gift-card-recaptcha"},me=X(()=>e.createElementVNode("span",null,"Loading...",-1)),ge=e.defineComponent({__name:"GiftCard",props:{accessToken:{},accentColor:{},buttonBackground:{},buttonBorder:{},buttonBorderRadius:{},buttonColor:{},buttonFontFamily:{},buttonFontSize:{},buttonTextTransform:{},buttonFontWeight:{},fontColor:{},fontFamily:{},fontSize:{},fontWeight:{},grayColor:{},headerColor:{},headerFontSize:{},inputBackground:{},inputBorder:{},inputBorderRadius:{},inputFontColor:{},labelFontWeight:{},labelPadding:{},layout:{},loadingColor:{},panelBackground:{},panelBorder:{},panelBorderRadius:{},panelPadding:{},placeType:{},successColor:{}},setup(p){const a=p,{t}=o.useI18n(),{name:l,email:y,phone:c,value:f,remark:v,showValue:k,quantity:F,media:N,placeId:g,placeType:r,showFormPage:d,showPaymentPage:m,showConfirmationPage:V,places:h,hasFilledForm:_,hasForcedPlaceType:R,isWaitingForResponse:b,isMetaDataAvailable:T}=o.storeToRefs(I()),{initialize:B,orderGiftCard:z}=I(),{isRecaptchaEnabled:M,currency:U}=o.storeToRefs(o.useUtilityStore()),{display:G}=o.useAlertStore();async function q(){const i=W.useReCaptcha_1();if(M.value&&i){await i.recaptchaLoaded();const n=await i.executeRecaptcha("create_gift_card");(await o.axios.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${n}`)).data.success?await z():G({message:t("alert.error.robot"),type:"error"})}else await z()}e.watch(r,()=>{g.value=void 0}),e.onMounted(()=>{B(parseInt(a.placeType))});const s={"--accentColor":a.accentColor,"--buttonBackground":a.buttonBackground,"--buttonBorder":a.buttonBorder,"--buttonBorderRadius":a.buttonBorderRadius,"--buttonFontFamily":a.buttonFontFamily,"--buttonColor":a.buttonColor,"--buttonFontSize":a.buttonFontSize,"--buttonTextTransform":a.buttonTextTransform,"--buttonFontWeight":a.buttonFontWeight,"--fontColor":a.fontColor,"--fontFamily":a.fontFamily,"--fontSize":a.fontSize,"--fontWeight":a.fontWeight,"--grayColor":a.grayColor,"--headerColor":a.headerColor,"--headerFontSize":a.headerFontSize,"--inputBackground":a.inputBackground,"--inputBorder":a.inputBorder,"--inputBorderRadius":a.inputBorderRadius,"--inputFontColor":a.inputFontColor,"--labelFontWeight":a.labelFontWeight,"--labelPadding":a.labelPadding,"--loadingColor":a.loadingColor,"--panelBackground":a.panelBackground,"--panelBorder":a.panelBorder,"--panelBorderRadius":a.panelBorderRadius,"--panelPadding":a.panelPadding,"--successColor":a.successColor};return(i,n)=>{const w=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(o._sfc_main,{id:"fresh-booking-gift-card-module",class:"fresh-booking-app",type:"gift-card","access-token":i.accessToken,"data-layout":i.layout,style:s,"sticky-container":""},{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createElementBlock("div",Z,[e.createElementVNode("h4",ee,[e.createElementVNode("span",null,e.toDisplayString(e.unref(t)("giftCard.title")),1)]),e.createElementVNode("div",oe,[e.withDirectives(e.createElementVNode("div",te,null,512),[[e.vShow,e.unref(m)]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(t)("giftCard.description")},null,8,ae),e.createElementVNode("form",null,[e.createVNode(P.TextField,{modelValue:e.unref(l),"onUpdate:modelValue":n[0]||(n[0]=u=>e.isRef(l)?l.value=u:null),type:"text",name:"name",autocomplete:"name",label:e.unref(t)("giftCard.name"),icon:"user-alt","icon-color":i.accentColor,placeholder:e.unref(t)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(P.TextField,{modelValue:e.unref(y),"onUpdate:modelValue":n[1]||(n[1]=u=>e.isRef(y)?y.value=u:null),type:"email",name:"email",autocomplete:"email",label:e.unref(t)("giftCard.email"),icon:"at","icon-color":i.accentColor,placeholder:e.unref(t)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(S.PhoneField,{modelValue:e.unref(c),"onUpdate:modelValue":n[2]||(n[2]=u=>e.isRef(c)?c.value=u:null),icon:"phone-office","icon-color":i.accentColor,label:e.unref(t)("giftCard.phone"),placeholder:e.unref(t)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(R)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",le,[e.unref(h)?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("label",re,[e.createElementVNode("span",null,e.toDisplayString(e.unref(t)("giftCard.selectType")),1)]),e.createElementVNode("div",ie,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(u,$)=>(e.openBlock(),e.createElementBlock("li",{key:$},[e.createVNode(S.Checkbox,{modelValue:e.unref(r),"onUpdate:modelValue":n[3]||(n[3]=L=>e.isRef(r)?r.value=L:null),type:"radio",name:"placeType",val:$,label:u.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(h)[e.unref(r)]&&e.unref(h)[e.unref(r)].data.length>1?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,modelValue:e.unref(g),"onUpdate:modelValue":n[4]||(n[4]=u=>e.isRef(g)?g.value=u:null),placeholder:e.unref(t)("giftCard.selectPlacePlaceholder"),options:e.unref(h)[e.unref(r)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(C.Loading,{key:1,color:i.loadingColor},null,8,["color"]))])),e.createVNode(P.TextField,{modelValue:e.unref(f),"onUpdate:modelValue":n[5]||(n[5]=u=>e.isRef(f)?f.value=u:null),type:"number",name:"value",label:e.unref(t)("giftCard.value"),icon:"money-bill","icon-color":i.accentColor,placeholder:e.unref(t)("giftCard.valuePlaceholder"),suffix:e.unref(U),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(S.Checkbox,{modelValue:e.unref(k),"onUpdate:modelValue":n[6]||(n[6]=u=>e.isRef(k)?k.value=u:null),type:"checkbox",name:"showValue",label:e.unref(t)("giftCard.showValue"),checked:e.unref(k)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(d)]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",{innerHTML:e.unref(t)("giftCard.thankYou")},null,8,de)],512),[[e.vShow,e.unref(V)]])]),i.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",se,[e.createVNode(C.Clickable,{label:e.unref(t)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(_),"is-loading":e.unref(b),"onUpdate:isLoading":n[9]||(n[9]=u=>e.isRef(b)?b.value=u:null),onClickEvent:q},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(P.TextField,{modelValue:e.unref(v),"onUpdate:modelValue":n[10]||(n[10]=u=>e.isRef(v)?v.value=u:null),type:"textarea",name:"remark",label:e.unref(t)("giftCard.remark"),icon:"info-circle","icon-color":i.accentColor,placeholder:e.unref(t)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","icon-color","placeholder"])])):e.createCommentVNode("",!0),e.unref(d)?e.withDirectives((e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(C.Clickable,{label:e.unref(t)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(_),"data-test":"orderGiftCard","is-loading":e.unref(b),"onUpdate:isLoading":n[11]||(n[11]=u=>e.isRef(b)?b.value=u:null),onClickEvent:q},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createElementVNode("div",fe,[e.createVNode(S._sfc_main)],512),[[e.vShow,e.unref(M)]])])),[[w]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(C.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[me]),_:1})}}});const ve=C._export_sfc(ge,[["__scopeId","data-v-10b51e8f"]]);process.env.NODE_ENV==="production"&&o.distExports.flare.light();const he=o.createPinia(),E=e.createApp({components:{GiftCard:ve}});E.use(o.distExports$1.flareVue);E.use(he);E.use(o.instance);E.use(S.StickyPlugin);E.use(S.install,{bootstrap:!1});E.mount("#fresh-booking-gift-card-app");
|
|
1
|
+
"use strict";const e=require("./Clickable-f57e16ad.js"),o=require("./NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js"),F=require("./index-aa255eba.js"),x=require("./ReCaptchaVuePlugin-36454b0f.js"),P=require("./SelectField.vue_vue_type_style_index_0_lang-a3371159.js");require("./_commonjsHelpers-6763f629.js");const G=o.defineStore("giftCard",()=>{const{display:p}=o.useAlertStore(),{bearerToken:t,metaData:a}=o.storeToRefs(o.useUtilityStore()),l=e.ref(o.GiftCardModuleState.InitialState),k=o.useStorage("freshBookingName","",void 0,{serializer:o.StorageSerializers.string}),s=o.useStorage("freshBookingEmail","",void 0,{serializer:o.StorageSerializers.string}),f=o.useStorage("freshBookingPhone","",void 0,{serializer:o.StorageSerializers.string}),v=e.ref(""),y=e.ref(1),_=e.ref(!0),N=e.ref(""),g=e.ref({base64:"",type:"",name:""}),r=e.ref(void 0),d=e.ref(0),m=e.ref(!1),C=e.ref(0),b=e.computed(()=>l.value===o.GiftCardModuleState.InitialState||l.value===o.GiftCardModuleState.WaitingForResponse),B=e.computed(()=>l.value===o.GiftCardModuleState.ReadyToPay),R=e.computed(()=>l.value===o.GiftCardModuleState.PaymentSuccess),h=e.computed(()=>{const u={1:{label:o.i18n.t("giftCard.hotelType"),data:[]},2:{label:o.i18n.t("giftCard.restaurantType"),data:[]}},i=a.value.places;return i&&i.forEach(n=>{u[n.placeType].data.push(n)}),Object.fromEntries(Object.entries(u).filter(([,n])=>n.data.length>0))}),T=e.computed(()=>C.value!==0),V=e.computed(()=>{let u;if(T.value)u=h.value[C.value].data[0];else if(d.value!==0){const i=r.value,n=h.value[d.value].data;n.length===1?u=n[0]:i!==void 0&&n.forEach(w=>{String(w.id)===String(i)&&(u=w)})}return u}),z=e.computed(()=>!(!k.value||!s.value||!(f.value.length>=5)||!v.value||V.value===void 0)),E=e.computed(()=>!(l.value===o.GiftCardModuleState.InitialState&&m.value)),q=e.computed(()=>!!(l.value===o.GiftCardModuleState.WaitingForResponse&&m.value));async function U(){l.value=o.GiftCardModuleState.WaitingForResponse,m.value=!0,await o.axios.post("http://localhost:91/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:a.value.currency.id,language:o.getUserLanguage(),amount:v.value,quantity:y.value,freeText:N.value,showPrice:_.value,contactName:k.value,contactEmail:s.value,contactPhone:f.value,imageBase64:o.b2a(g.value.base64),imageName:g.value.name,imageFormat:g.value.type,placeType:V.value?V.value.placeType:void 0,placeID:V.value?V.value.id:void 0},{headers:{Authorization:t.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.3"}}).then(u=>{if(m.value=!1,u.data.easyPayment){l.value=o.GiftCardModuleState.ReadyToPay;const i=new Reepay.EmbeddedCheckout(u.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});i.addEventHandler(o.ReepayEvent.Accept,()=>{l.value=o.GiftCardModuleState.PaymentSuccess,p({message:o.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),i.addEventHandler(o.ReepayEvent.Error,()=>{p({message:o.i18n.t("booking.other.errorMessage"),type:"warning"})})}else l.value=o.GiftCardModuleState.InitialState,p({message:`${o.i18n.t("booking.other.errorMessage")} (HTTP: ${u.status})`,type:"warning"})})}function M(u){C.value=u}return{moduleState:l,name:k,email:s,phone:f,value:v,remark:N,showValue:_,quantity:y,media:g,placeId:r,placeType:d,showFormPage:b,showPaymentPage:B,showConfirmationPage:R,places:h,hasFilledForm:z,hasForcedPlaceType:T,isWaitingForResponse:q,isMetaDataAvailable:E,orderGiftCard:U,initialize:M}}),L={class:"media-selector"},W=["accept"],A={class:"media-selector-wrapper"},H={class:"media-selector-tools"},O={key:0},j={key:1},K={key:2},Y=["src"],J=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(p,{emit:t}){const a=p,{t:l}=o.useI18n(),{display:k}=o.useAlertStore(),s=e.ref(),f=e.computed(()=>a.modelValue.base64!=="");function v(r){t("update:modelValue",r)}function y(){v({base64:"",name:"",type:""}),s.value&&(s.value.value="")}function _(){s.value&&s.value.click()}function N(r,d){const[m,C]=[r.name,r.type],b=new FileReader;b.onload=function(B){if(B.target){const R=B.target.result;d({base64:R,name:m,type:C})}else k({message:l("imageUploadError"),type:"error"})},b.readAsDataURL(r)}async function g(){let r;(r=s.value.files)instanceof FileList&&N(r[0],v)}return(r,d)=>(e.openBlock(),e.createBlock(o.InputField,{label:r.label,required:r.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",L,[e.createBaseVNode("input",{ref_key:"fileInput",ref:s,type:"file",class:"hidden",accept:r.validation,single:"",onChange:d[0]||(d[0]=m=>g())},null,40,W),e.createBaseVNode("div",A,[e.createBaseVNode("ul",H,[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",O,[e.createVNode(e.Clickable,{label:e.unref(l)("uploadFile"),type:"button",icon:"upload","icon-color":r.iconColor,onClickEvent:d[1]||(d[1]=m=>_())},null,8,["label","icon-color"])])),f.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(l)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":r.iconColor,onClickEvent:d[2]||(d[2]=m=>_())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("li",K,[e.createVNode(e.Clickable,{label:e.unref(l)("removeFile"),type:"button",icon:"trash-alt","icon-color":r.iconColor,onClickEvent:d[3]||(d[3]=m=>y())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:f.value}])},[r.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.modelValue.base64},null,8,Y)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function I(p){const t=p;t.__i18n=t.__i18n||[],t.__i18n.push({locale:"",resource:{da:{uploadFile:a=>{const{normalize:l}=a;return l(["Upload billede"])},removeFile:a=>{const{normalize:l}=a;return l(["Fjern billede"])},replaceFile:a=>{const{normalize:l}=a;return l(["Ersat billede"])},imageUploadError:a=>{const{normalize:l}=a;return l(["Der skete en fejl under billede upload!"])}},en:{uploadFile:a=>{const{normalize:l}=a;return l(["Upload image"])},removeFile:a=>{const{normalize:l}=a;return l(["Remove image"])},replaceFile:a=>{const{normalize:l}=a;return l(["Replace image"])},imageUploadError:a=>{const{normalize:l}=a;return l(["An error occurred under image upload!"])}}}})}typeof I=="function"&&I(J);const Q=p=>(e.pushScopeId("data-v-10b51e8f"),p=p(),e.popScopeId(),p),X={key:0,id:"fresh-booking-gift-card-wrapper"},Z={id:"fresh-booking-gift-card-title"},ee={id:"fresh-booking-gift-card-content"},oe={id:"fresh-booking-gift-card-payment"},ae=["innerHTML"],te={key:0},le={key:0,id:"fresh-booking-select-place-type"},ne={class:e.normalizeClass(["fresh-booking-label","required"])},re={id:"fresh-booking-select-place-type-input"},ie=["innerHTML"],ce={key:0,id:"fresh-booking-gift-card-order"},de={class:"fresh-booking-panel"},ue={key:1,id:"fresh-booking-gift-card-remarks"},se={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},pe={id:"fresh-booking-gift-card-recaptcha"},fe=Q(()=>e.createBaseVNode("span",null,"Loading...",-1)),me=e.defineComponent({__name:"GiftCard",props:{accessToken:{},accentColor:{},buttonBackground:{},buttonBorder:{},buttonBorderRadius:{},buttonColor:{},buttonFontFamily:{},buttonFontSize:{},buttonTextTransform:{},buttonFontWeight:{},fontColor:{},fontFamily:{},fontSize:{},fontWeight:{},grayColor:{},headerColor:{},headerFontSize:{},inputBackground:{},inputBorder:{},inputBorderRadius:{},inputFontColor:{},labelFontWeight:{},labelPadding:{},layout:{},loadingColor:{},panelBackground:{},panelBorder:{},panelBorderRadius:{},panelPadding:{},placeType:{},successColor:{}},setup(p){const t=p,{t:a}=o.useI18n(),{name:l,email:k,phone:s,value:f,remark:v,showValue:y,quantity:_,media:N,placeId:g,placeType:r,showFormPage:d,showPaymentPage:m,showConfirmationPage:C,places:b,hasFilledForm:B,hasForcedPlaceType:R,isWaitingForResponse:h,isMetaDataAvailable:T}=o.storeToRefs(G()),{initialize:V,orderGiftCard:z}=G(),{isRecaptchaEnabled:E,currency:q}=o.storeToRefs(o.useUtilityStore()),{display:U}=o.useAlertStore();async function M(){const i=x.useReCaptcha_1();if(E.value&&i){await i.recaptchaLoaded();const n=await i.executeRecaptcha("create_gift_card");(await o.axios.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${n}`)).data.success?await z():U({message:a("alert.error.robot"),type:"error"})}else await z()}e.watch(r,()=>{g.value=void 0}),e.onMounted(()=>{V(parseInt(t.placeType))});const u={"--accentColor":t.accentColor,"--buttonBackground":t.buttonBackground,"--buttonBorder":t.buttonBorder,"--buttonBorderRadius":t.buttonBorderRadius,"--buttonFontFamily":t.buttonFontFamily,"--buttonColor":t.buttonColor,"--buttonFontSize":t.buttonFontSize,"--buttonTextTransform":t.buttonTextTransform,"--buttonFontWeight":t.buttonFontWeight,"--fontColor":t.fontColor,"--fontFamily":t.fontFamily,"--fontSize":t.fontSize,"--fontWeight":t.fontWeight,"--grayColor":t.grayColor,"--headerColor":t.headerColor,"--headerFontSize":t.headerFontSize,"--inputBackground":t.inputBackground,"--inputBorder":t.inputBorder,"--inputBorderRadius":t.inputBorderRadius,"--inputFontColor":t.inputFontColor,"--labelFontWeight":t.labelFontWeight,"--labelPadding":t.labelPadding,"--loadingColor":t.loadingColor,"--panelBackground":t.panelBackground,"--panelBorder":t.panelBorder,"--panelBorderRadius":t.panelBorderRadius,"--panelPadding":t.panelPadding,"--successColor":t.successColor};return(i,n)=>{const w=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(o._sfc_main,{id:"fresh-booking-gift-card-module",class:"fresh-booking-app",type:"gift-card","access-token":i.accessToken,"data-layout":i.layout,style:u,"sticky-container":""},{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createElementBlock("div",X,[e.createBaseVNode("h4",Z,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.title")),1)]),e.createBaseVNode("div",ee,[e.withDirectives(e.createBaseVNode("div",oe,null,512),[[e.vShow,e.unref(m)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(a)("giftCard.description")},null,8,ae),e.createBaseVNode("form",null,[e.createVNode(P.TextField,{modelValue:e.unref(l),"onUpdate:modelValue":n[0]||(n[0]=c=>e.isRef(l)?l.value=c:null),type:"text",name:"name",autocomplete:"name",label:e.unref(a)("giftCard.name"),icon:"user-alt","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(P.TextField,{modelValue:e.unref(k),"onUpdate:modelValue":n[1]||(n[1]=c=>e.isRef(k)?k.value=c:null),type:"email",name:"email",autocomplete:"email",label:e.unref(a)("giftCard.email"),icon:"at","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(F.PhoneField,{modelValue:e.unref(s),"onUpdate:modelValue":n[2]||(n[2]=c=>e.isRef(s)?s.value=c:null),icon:"phone-office","icon-color":i.accentColor,label:e.unref(a)("giftCard.phone"),placeholder:e.unref(a)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(R)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",te,[e.unref(b)?(e.openBlock(),e.createElementBlock("div",le,[e.createBaseVNode("label",ne,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.selectType")),1)]),e.createBaseVNode("div",re,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(c,$)=>(e.openBlock(),e.createElementBlock("li",{key:$},[e.createVNode(F.Checkbox,{modelValue:e.unref(r),"onUpdate:modelValue":n[3]||(n[3]=D=>e.isRef(r)?r.value=D:null),type:"radio",name:"placeType",val:$,label:c.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(b)[e.unref(r)]&&e.unref(b)[e.unref(r)].data.length>1?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,modelValue:e.unref(g),"onUpdate:modelValue":n[4]||(n[4]=c=>e.isRef(g)?g.value=c:null),placeholder:e.unref(a)("giftCard.selectPlacePlaceholder"),options:e.unref(b)[e.unref(r)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1,color:i.loadingColor},null,8,["color"]))])),e.createVNode(P.TextField,{modelValue:e.unref(f),"onUpdate:modelValue":n[5]||(n[5]=c=>e.isRef(f)?f.value=c:null),type:"number",name:"value",label:e.unref(a)("giftCard.value"),icon:"money-bill","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.valuePlaceholder"),suffix:e.unref(q),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(F.Checkbox,{modelValue:e.unref(y),"onUpdate:modelValue":n[6]||(n[6]=c=>e.isRef(y)?y.value=c:null),type:"checkbox",name:"showValue",label:e.unref(a)("giftCard.showValue"),checked:e.unref(y)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(d)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",{innerHTML:e.unref(a)("giftCard.thankYou")},null,8,ie)],512),[[e.vShow,e.unref(C)]])]),i.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ce,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(B),"is-loading":e.unref(h),"onUpdate:isLoading":n[9]||(n[9]=c=>e.isRef(h)?h.value=c:null),onClickEvent:M},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(P.TextField,{modelValue:e.unref(v),"onUpdate:modelValue":n[10]||(n[10]=c=>e.isRef(v)?v.value=c:null),type:"textarea",name:"remark",label:e.unref(a)("giftCard.remark"),icon:"info-circle","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","icon-color","placeholder"])])):e.createCommentVNode("",!0),e.unref(d)?e.withDirectives((e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(B),"data-test":"orderGiftCard","is-loading":e.unref(h),"onUpdate:isLoading":n[11]||(n[11]=c=>e.isRef(h)?h.value=c:null),onClickEvent:M},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",pe,[e.createVNode(F._sfc_main)],512),[[e.vShow,e.unref(E)]])])),[[w]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[fe]),_:1})}}});const ge=e._export_sfc(me,[["__scopeId","data-v-10b51e8f"]]);process.env.NODE_ENV==="production"&&o.distExports.flare.light();const ve=o.createPinia(),S=e.createApp({components:{GiftCard:ge}});S.use(o.distExports$1.flareVue);S.use(ve);S.use(o.instance);S.use(F.StickyPlugin);S.use(F.install,{bootstrap:!1});S.mount("#fresh-booking-gift-card-app");
|
|
2
2
|
//# sourceMappingURL=gift-card.cjs.js.map
|
package/dist/gift-card.cjs.js.br
CHANGED
|
Binary file
|