@konnectio/core 4.0.27 → 4.0.29
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-5a87e270.js → ActionField-1fcb30ea.js} +7 -7
- package/dist/ActionField-1fcb30ea.js.br +0 -0
- package/dist/{ActionField-1d753e66.cjs → ActionField-81384aa7.cjs} +1 -1
- package/dist/{AvailabilitySkeleton-c0729deb.js → AvailabilitySkeleton-e38800f8.js} +38 -38
- package/dist/AvailabilitySkeleton-e38800f8.js.br +0 -0
- package/dist/{AvailabilitySkeleton-4cf5dece.cjs → AvailabilitySkeleton-f371a6ba.cjs} +1 -1
- package/dist/DateField.vue_vue_type_style_index_0_lang-16f1eb52.cjs +2 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-5eb1cfc9.js +8503 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-5eb1cfc9.js.br +0 -0
- package/dist/{Field-2dd44110.cjs → Field-9be15a05.cjs} +1 -1
- package/dist/{Field-1630bef3.js → Field-eb8d429d.js} +2 -2
- package/dist/Field-eb8d429d.js.br +0 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-959c8429.js +67 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-959c8429.js.br +0 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-ae0eb65d.cjs +1 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-6b27dec6.js +30560 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-6b27dec6.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-80ce269e.cjs +860 -0
- package/dist/{ThankYou-d9cb4dcb.js → ThankYou-90871d9e.js} +1391 -1395
- package/dist/ThankYou-90871d9e.js.br +0 -0
- package/dist/{ThankYou-8449e6f1.cjs → ThankYou-db84768c.cjs} +6 -6
- package/dist/_-0041bfd0.cjs +1 -0
- package/dist/_-c47e8eec.js +20 -0
- package/dist/availability.cjs +1 -1
- package/dist/availability.js +7 -7
- package/dist/availability.js.br +0 -0
- package/dist/components/forms/HotelAvailabilityForm.vue.d.ts +1 -1
- package/dist/components/forms/MultiStepForm.vue.d.ts +1 -1
- package/dist/components/forms/ReservationForm.vue.d.ts +1 -1
- package/dist/components/inputs/CheckboxField.vue.d.ts +5 -0
- package/dist/components/inputs/CheckboxField.vue.d.ts.map +1 -0
- package/dist/components/inputs/grouped/RoomConfigField.vue.d.ts +1 -1
- package/dist/components/listings/Base.vue.d.ts +1 -1
- package/dist/components/listings/Hotel.vue.d.ts +1 -1
- package/dist/components/views/TermsOfService.vue.d.ts +1 -1
- package/dist/{event-44910778.js → event-97fce505.js} +11 -13
- package/dist/event-97fce505.js.br +0 -0
- package/dist/event-f7d31cb8.cjs +1 -0
- package/dist/event.cjs +1 -1
- package/dist/event.js +132 -132
- package/dist/event.js.br +0 -0
- package/dist/gift-card-validation.cjs +1 -1
- package/dist/gift-card-validation.js +29 -29
- package/dist/gift-card-validation.js.br +0 -0
- package/dist/gift-card.cjs +1 -1
- package/dist/gift-card.js +262 -286
- package/dist/gift-card.js.br +0 -0
- package/dist/hotel.cjs +5 -5
- package/dist/hotel.js +1183 -1207
- package/dist/hotel.js.br +0 -0
- package/dist/{index-3e49491a.js → index-1f2fa31e.js} +77 -107
- package/dist/index-1f2fa31e.js.br +0 -0
- package/dist/index-2c822f23.cjs +1 -0
- package/dist/polyfill.cjs +1 -1
- package/dist/polyfill.js +1 -1
- package/dist/polyfill.js.br +0 -0
- package/dist/store/applyGiftCard.d.ts +1 -1
- package/dist/store/event.d.ts +3 -3
- package/dist/store/giftCard.d.ts +1 -1
- package/dist/store/hotel.d.ts +7 -4
- package/dist/store/payment.d.ts +1 -1
- package/dist/store/tracking.d.ts +13 -1
- package/dist/store/utilities.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/style.css.br +0 -0
- package/package.json +3 -2
- package/dist/ActionField-5a87e270.js.br +0 -0
- package/dist/AvailabilitySkeleton-c0729deb.js.br +0 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-84a02496.js +0 -8844
- package/dist/DateField.vue_vue_type_style_index_0_lang-84a02496.js.br +0 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-d010fc16.cjs +0 -5
- package/dist/Field-1630bef3.js.br +0 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-1f0ed43e.cjs +0 -1
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-3f313372.js +0 -116
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-3f313372.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-3f482f0a.js +0 -29124
- package/dist/SelectField.vue_vue_type_style_index_0_lang-3f482f0a.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-cc9c833c.cjs +0 -855
- package/dist/ThankYou-d9cb4dcb.js.br +0 -0
- package/dist/_-963a5633.js +0 -82
- package/dist/_-963a5633.js.br +0 -0
- package/dist/_-cf306835.cjs +0 -1
- package/dist/event-44910778.js.br +0 -0
- package/dist/event-8998e0ed.cjs +0 -1
- package/dist/index-072f9f67.cjs +0 -1
- package/dist/index-3e49491a.js.br +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { A as F } from "./ActionField-5a87e270.js";
|
|
1
|
+
import { k as L, D as S, s as m, a as _, c as X, m as y, n as w, w as p, p as l, A as a, F as o, q as t, G as V, v as x, H as u, J as A, K as G, x as I, L as B, M as D, N, P as T, Q as M, _ as U, R as H, U as P, V as R } from "./SelectField.vue_vue_type_style_index_0_lang-6b27dec6.js";
|
|
2
|
+
import { A as $ } from "./ActionField-1fcb30ea.js";
|
|
4
3
|
import "./_commonjsHelpers-aeeeeb92.js";
|
|
5
|
-
|
|
4
|
+
import "./NumberField.vue_vue_type_script_setup_true_lang-959c8429.js";
|
|
5
|
+
const F = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], E = {
|
|
6
6
|
key: 0,
|
|
7
7
|
id: "fresh-booking-gift-card-validation-resume",
|
|
8
8
|
class: "fresh-booking-panel"
|
|
9
|
-
},
|
|
9
|
+
}, J = /* @__PURE__ */ F(() => /* @__PURE__ */ a("span", null, "Loading...", -1)), K = /* @__PURE__ */ L({
|
|
10
10
|
name: "GiftCardValidationLayout",
|
|
11
11
|
__name: "GiftCardValidation",
|
|
12
12
|
props: {
|
|
@@ -16,23 +16,23 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
|
|
|
16
16
|
setup(s) {
|
|
17
17
|
const { t: e } = S(), {
|
|
18
18
|
voucher: r,
|
|
19
|
-
isValid:
|
|
20
|
-
amount:
|
|
19
|
+
isValid: b,
|
|
20
|
+
amount: C,
|
|
21
21
|
expirationDate: h,
|
|
22
22
|
productName: k,
|
|
23
23
|
isLoading: d
|
|
24
|
-
} =
|
|
25
|
-
return (
|
|
26
|
-
default:
|
|
24
|
+
} = m(_()), { currency: v } = m(X()), { apply: f } = _();
|
|
25
|
+
return (g, n) => (y(), w(N, null, {
|
|
26
|
+
default: p(() => [
|
|
27
27
|
l(D, {
|
|
28
28
|
id: "fresh-booking-gift-card-validation-module",
|
|
29
|
-
"access-token":
|
|
29
|
+
"access-token": g.accessToken,
|
|
30
30
|
type: "gift-card",
|
|
31
|
-
styling:
|
|
31
|
+
styling: g.styling
|
|
32
32
|
}, {
|
|
33
|
-
default:
|
|
33
|
+
default: p(() => [
|
|
34
34
|
a("form", {
|
|
35
|
-
onSubmit: n[3] || (n[3] =
|
|
35
|
+
onSubmit: n[3] || (n[3] = B((i) => t(f)(), ["prevent"]))
|
|
36
36
|
}, [
|
|
37
37
|
a("h4", null, [
|
|
38
38
|
a("span", null, o(t(e)("giftCardValidation.title")), 1)
|
|
@@ -40,23 +40,23 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
|
|
|
40
40
|
a("p", {
|
|
41
41
|
innerHTML: t(e)("giftCardValidation.description")
|
|
42
42
|
}, null, 8, q),
|
|
43
|
-
l(
|
|
43
|
+
l($, {
|
|
44
44
|
modelValue: t(r),
|
|
45
|
-
"onUpdate:modelValue": n[0] || (n[0] = (i) =>
|
|
45
|
+
"onUpdate:modelValue": n[0] || (n[0] = (i) => V(r) ? r.value = i : null),
|
|
46
46
|
icon: "gift-card",
|
|
47
47
|
label: t(e)("booking.reservation.giftCardCode"),
|
|
48
48
|
buttonLabel: t(e)("giftCardValidation.submitButton"),
|
|
49
49
|
placeholder: "XXXXXXXX",
|
|
50
50
|
"is-loading": t(d),
|
|
51
|
-
"onUpdate:isLoading": n[1] || (n[1] = (i) =>
|
|
51
|
+
"onUpdate:isLoading": n[1] || (n[1] = (i) => V(d) ? d.value = i : null),
|
|
52
52
|
onAction: n[2] || (n[2] = (i) => t(f)())
|
|
53
53
|
}, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
|
|
54
|
-
!t(d) && t(
|
|
54
|
+
!t(d) && t(b) ? (y(), x("table", E, [
|
|
55
55
|
a("thead", null, [
|
|
56
56
|
a("tr", null, [
|
|
57
57
|
a("th", null, [
|
|
58
58
|
a("span", null, o(t(e)("giftCardValidation.giftCard")), 1),
|
|
59
|
-
l(
|
|
59
|
+
l(u, {
|
|
60
60
|
icon: "gift-card",
|
|
61
61
|
type: "fas",
|
|
62
62
|
color: "header"
|
|
@@ -64,7 +64,7 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
|
|
|
64
64
|
]),
|
|
65
65
|
a("th", null, [
|
|
66
66
|
a("span", null, o(t(e)("giftCardValidation.balance")), 1),
|
|
67
|
-
l(
|
|
67
|
+
l(u, {
|
|
68
68
|
icon: "money-bill",
|
|
69
69
|
type: "fas",
|
|
70
70
|
color: "header"
|
|
@@ -72,7 +72,7 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
|
|
|
72
72
|
]),
|
|
73
73
|
a("th", null, [
|
|
74
74
|
a("span", null, o(t(e)("giftCardValidation.expirationDate")), 1),
|
|
75
|
-
l(
|
|
75
|
+
l(u, {
|
|
76
76
|
icon: "timer",
|
|
77
77
|
type: "fas",
|
|
78
78
|
color: "header"
|
|
@@ -86,29 +86,29 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
|
|
|
86
86
|
a("span", null, o(t(k)), 1)
|
|
87
87
|
]),
|
|
88
88
|
a("td", null, [
|
|
89
|
-
a("span", null, o(t(A)(t(
|
|
89
|
+
a("span", null, o(t(A)(t(C), t(v))), 1)
|
|
90
90
|
]),
|
|
91
91
|
a("td", null, [
|
|
92
|
-
a("span", null, o(t(
|
|
92
|
+
a("span", null, o(t(G)(t(h))), 1)
|
|
93
93
|
])
|
|
94
94
|
])
|
|
95
95
|
])
|
|
96
|
-
])) :
|
|
96
|
+
])) : I("", !0)
|
|
97
97
|
], 32)
|
|
98
98
|
]),
|
|
99
99
|
_: 1
|
|
100
100
|
}, 8, ["access-token", "styling"])
|
|
101
101
|
]),
|
|
102
|
-
fallback:
|
|
103
|
-
|
|
102
|
+
fallback: p(() => [
|
|
103
|
+
J
|
|
104
104
|
]),
|
|
105
105
|
_: 1
|
|
106
106
|
}));
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
const
|
|
110
|
-
c.use(
|
|
111
|
-
c.use(
|
|
109
|
+
const Q = /* @__PURE__ */ U(K, [["__scopeId", "data-v-5d5827dc"]]), c = H({ components: { GiftCardValidation: Q } }), j = P();
|
|
110
|
+
c.use(j);
|
|
111
|
+
c.use(R);
|
|
112
112
|
c.mount("#konnectio-gift-card-validation-app");
|
|
113
113
|
export {
|
|
114
114
|
c as default
|
|
Binary file
|
package/dist/gift-card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-cc9c833c.cjs"),U=require("./_-cf306835.cjs"),N=require("./index-072f9f67.cjs"),R=require("./Field-2dd44110.cjs");require("./_commonjsHelpers-6763f629.cjs");const q=e.defineStore("giftCard",()=>{e.useAlertStore();const{pay:y}=U.usePaymentStore(),{bearerToken:l,metaData:o}=e.storeToRefs(e.useUtilityStore()),t=e.ref(e.GiftCardModuleState.InitialState),p=e.useStorage("konnectio_name","",void 0,{serializer:e.StorageSerializers.string}),g=e.useStorage("konnectio_email","",void 0,{serializer:e.StorageSerializers.string}),c=e.useStorage("konnectio_phone","",void 0,{serializer:e.StorageSerializers.string}),f=e.ref(""),V=e.ref(1),w=e.ref(!0),v=e.ref(""),s=e.ref({base64:"",type:"",name:""}),k=e.ref(void 0),n=e.ref(0),i=e.ref(!1),d=e.ref(0),C=e.computed(()=>t.value===e.GiftCardModuleState.InitialState||t.value===e.GiftCardModuleState.WaitingForResponse),B=e.computed(()=>t.value===e.GiftCardModuleState.ReadyToPay),m=e.computed(()=>t.value===e.GiftCardModuleState.PaymentSuccess),h=e.computed(()=>{const u={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},a=o.value.places;return a&&a.forEach(_=>{u[_.placeType].data.push(_)}),Object.fromEntries(Object.entries(u).filter(([,_])=>_.data.length>0))}),x=e.computed(()=>d.value!==0),b=e.computed(()=>{let u;if(x.value)u=h.value[d.value].data[0];else if(n.value!==0){const a=k.value,_=h.value[n.value].data;_.length===1?u=_[0]:a!==void 0&&_.forEach(P=>{String(P.id)===String(a)&&(u=P)})}return u}),z=e.computed(()=>!(!p.value||!g.value||!(c.value.length>=5)||!f.value||b.value===void 0)),E=e.computed(()=>!(t.value===e.GiftCardModuleState.InitialState&&i.value)),T=e.computed(()=>!!(t.value===e.GiftCardModuleState.WaitingForResponse&&i.value));async function S(){t.value=e.GiftCardModuleState.WaitingForResponse,i.value=!0,await e.axios.post("https://stage.hotel-service.konnectio.dk/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:o.value.currency.id,language:e.getUserLanguage(),amount:f.value,quantity:V.value,freeText:v.value,showPrice:w.value,contactName:p.value,contactEmail:g.value,contactPhone:c.value,imageBase64:e.b2a(s.value.base64),imageName:s.value.name,imageFormat:s.value.type,placeType:b.value?b.value.placeType:void 0,placeID:b.value?b.value.id:void 0},{headers:{Authorization:l.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.27"}}).then(u=>{t.value=e.GiftCardModuleState.ReadyToPay,i.value=!1,y({callback:()=>console.log("Callback!"),response:u.data})})}function r(u){u&&(d.value=u)}return{moduleState:t,name:p,email:g,phone:c,value:f,remark:v,showValue:w,quantity:V,media:s,placeId:k,placeType:n,showFormPage:C,showPaymentPage:B,showConfirmationPage:m,places:h,hasFilledForm:z,hasForcedPlaceType:x,isWaitingForResponse:T,isMetaDataAvailable:E,orderGiftCard:S,initialize:r}}),$={class:"media-selector"},M=["accept"],D={class:"media-selector-wrapper"},I={class:"media-selector-tools"},L={key:0},A={key:1},W={key:2},j=["src"],H=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(y,{emit:l}){const o=l,t=y,{t:p}=e.useI18n(),{display:g}=e.useAlertStore(),c=e.ref(),f=e.computed(()=>t.modelValue.base64!=="");function V(n){o("update:modelValue",n)}function w(){V({base64:"",name:"",type:""}),c.value&&(c.value.value="")}function v(){c.value&&c.value.click()}function s(n,i){const[d,C]=[n.name,n.type],B=new FileReader;B.onload=function(m){if(m.target){const h=m.target.result;i({base64:h,name:d,type:C})}else g({message:p("imageUploadError"),type:"error"})},B.readAsDataURL(n)}async function k(){let n;(n=c.value.files)instanceof FileList&&s(n[0],V)}return(n,i)=>(e.openBlock(),e.createBlock(e.InputField,{label:n.label,required:n.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",$,[e.createBaseVNode("input",{ref_key:"fileInput",ref:c,type:"file",class:"hidden",accept:n.validation,single:"",onChange:i[0]||(i[0]=d=>k())},null,40,M),e.createBaseVNode("div",D,[e.createBaseVNode("ul",I,[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",L,[e.createVNode(e.Clickable,{label:e.unref(p)("uploadFile"),type:"button",icon:"upload","icon-color":n.iconColor,onClickEvent:i[1]||(i[1]=d=>v())},null,8,["label","icon-color"])])),f.value?(e.openBlock(),e.createElementBlock("li",A,[e.createVNode(e.Clickable,{label:e.unref(p)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":n.iconColor,onClickEvent:i[2]||(i[2]=d=>v())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("li",W,[e.createVNode(e.Clickable,{label:e.unref(p)("removeFile"),type:"button",icon:"trash-alt","icon-color":n.iconColor,onClickEvent:i[3]||(i[3]=d=>w())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:f.value}])},[n.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.modelValue.base64},null,8,j)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function G(y){const l=y;l.__i18n=l.__i18n||[],l.__i18n.push({locale:"",resource:{da:{uploadFile:o=>{const{normalize:t}=o;return t(["Upload billede"])},removeFile:o=>{const{normalize:t}=o;return t(["Fjern billede"])},replaceFile:o=>{const{normalize:t}=o;return t(["Ersat billede"])},imageUploadError:o=>{const{normalize:t}=o;return t(["Der skete en fejl under billede upload!"])}},en:{uploadFile:o=>{const{normalize:t}=o;return t(["Upload image"])},removeFile:o=>{const{normalize:t}=o;return t(["Remove image"])},replaceFile:o=>{const{normalize:t}=o;return t(["Replace image"])},imageUploadError:o=>{const{normalize:t}=o;return t(["An error occurred under image upload!"])}}}})}typeof G=="function"&&G(H);const O={class:"gift-card-skeleton"},K={class:"gift-card-skeleton-form"},Y=e.defineComponent({__name:"GiftCardSkeleton",setup(y){return(l,o)=>(e.openBlock(),e.createElementBlock("div",O,[e.createBaseVNode("div",K,[e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field,{"is-text-area":""}),e.createVNode(U.Element,{height:"44px"})])]))}});const J=e._export_sfc(Y,[["__scopeId","data-v-2600a731"]]),Q={key:0,id:"fresh-booking-gift-card-wrapper"},X={id:"fresh-booking-gift-card-title"},Z={id:"fresh-booking-gift-card-content"},ee={id:"fresh-booking-gift-card-payment"},te=["innerHTML"],ae={key:0},le={key:0,id:"fresh-booking-select-place-type"},oe={class:e.normalizeClass(["fresh-booking-label","required"])},ne={id:"fresh-booking-select-place-type-input"},re=["innerHTML"],ie={key:0,id:"fresh-booking-gift-card-order"},de={class:"fresh-booking-panel"},ce={key:1,id:"fresh-booking-gift-card-remarks"},se={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},ue={id:"fresh-booking-gift-card-recaptcha"},fe=e.defineComponent({name:"GiftCardLayout",__name:"GiftCard",props:{accessToken:{},layout:{default:"minimal"},placeType:{},styling:{}},setup(y){const{t:l}=e.useI18n(),{name:o,email:t,phone:p,value:g,remark:c,showValue:f,quantity:V,media:w,placeId:v,placeType:s,showFormPage:k,showPaymentPage:n,showConfirmationPage:i,places:d,hasFilledForm:C,hasForcedPlaceType:B,isWaitingForResponse:m,isMetaDataAvailable:h}=e.storeToRefs(q()),{initialize:x,orderGiftCard:b}=q(),{isRecaptchaEnabled:z,currency:E}=e.storeToRefs(e.useUtilityStore());async function T(){await b()}return e.watch(s,()=>{v.value=void 0}),e.onMounted(()=>{x()}),(S,r)=>{const u=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main$1,{id:"fresh-booking-gift-card-module",type:"gift-card","access-token":S.accessToken,"data-layout":S.layout,styling:S.styling,"sticky-container":""},{default:e.withCtx(()=>[e.unref(h)?(e.openBlock(),e.createElementBlock("div",Q,[e.createBaseVNode("h4",X,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(l)("giftCard.title")),1)]),e.createBaseVNode("div",Z,[e.withDirectives(e.createBaseVNode("div",ee,[e.createVNode(N.CheckoutWindow)],512),[[e.vShow,e.unref(n)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(l)("giftCard.description")},null,8,te),e.createBaseVNode("form",null,[e.createVNode(e.TextField,{modelValue:e.unref(o),"onUpdate:modelValue":r[0]||(r[0]=a=>e.isRef(o)?o.value=a:null),type:"text",name:"name",autocomplete:"name",label:e.unref(l)("giftCard.name"),icon:"user-alt",placeholder:e.unref(l)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(e.TextField,{modelValue:e.unref(t),"onUpdate:modelValue":r[1]||(r[1]=a=>e.isRef(t)?t.value=a:null),type:"email",name:"email",autocomplete:"email",label:e.unref(l)("giftCard.email"),icon:"at",placeholder:e.unref(l)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(N.PhoneField,{modelValue:e.unref(p),"onUpdate:modelValue":r[2]||(r[2]=a=>e.isRef(p)?p.value=a:null),icon:"phone-office",label:e.unref(l)("giftCard.phone"),placeholder:e.unref(l)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.unref(B)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ae,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",le,[e.createBaseVNode("label",oe,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(l)("giftCard.selectType")),1)]),e.createBaseVNode("div",ne,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(a,_)=>(e.openBlock(),e.createElementBlock("li",{key:_},[e.createVNode(N.Checkbox,{modelValue:e.unref(s),"onUpdate:modelValue":r[3]||(r[3]=P=>e.isRef(s)?s.value=P:null),type:"radio",name:"placeType",val:_,label:a.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(d)[e.unref(s)]&&e.unref(d)[e.unref(s)].data.length>1?(e.openBlock(),e.createBlock(e._sfc_main,{key:0,modelValue:e.unref(v),"onUpdate:modelValue":r[4]||(r[4]=a=>e.isRef(v)?v.value=a:null),placeholder:e.unref(l)("giftCard.selectPlacePlaceholder"),options:e.unref(d)[e.unref(s)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))])),e.createVNode(e.TextField,{modelValue:e.unref(g),"onUpdate:modelValue":r[5]||(r[5]=a=>e.isRef(g)?g.value=a:null),type:"number",name:"value",label:e.unref(l)("giftCard.value"),icon:"money-bill",placeholder:e.unref(l)("giftCard.valuePlaceholder"),suffix:e.unref(E),required:""},null,8,["modelValue","label","placeholder","suffix"]),e.createVNode(N.Checkbox,{modelValue:e.unref(f),"onUpdate:modelValue":r[6]||(r[6]=a=>e.isRef(f)?f.value=a:null),type:"checkbox",name:"showValue",label:e.unref(l)("giftCard.showValue"),checked:e.unref(f)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(k)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",{innerHTML:e.unref(l)("giftCard.thankYou")},null,8,re)],512),[[e.vShow,e.unref(i)]])]),S.layout!=="minimal"&&e.unref(k)?(e.openBlock(),e.createElementBlock("div",ie,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(l)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(C),"is-loading":e.unref(m),"onUpdate:isLoading":r[9]||(r[9]=a=>e.isRef(m)?m.value=a:null),onClickEvent:T},null,8,["label","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(k)?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(e.TextField,{modelValue:e.unref(c),"onUpdate:modelValue":r[10]||(r[10]=a=>e.isRef(c)?c.value=a:null),type:"textarea",name:"remark",label:e.unref(l)("giftCard.remark"),icon:"info-circle",placeholder:e.unref(l)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","placeholder"])])):e.createCommentVNode("",!0),e.unref(k)?e.withDirectives((e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.Clickable,{label:e.unref(l)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(C),"data-test":"orderGiftCard","is-loading":e.unref(m),"onUpdate:isLoading":r[11]||(r[11]=a=>e.isRef(m)?m.value=a:null),onClickEvent:T},null,8,["label","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",ue,[e.createVNode(N._sfc_main)],512),[[e.vShow,e.unref(z)]])])),[[u]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout","styling"])]),fallback:e.withCtx(()=>[e.createVNode(J)]),_:1})}}});const pe=e._export_sfc(fe,[["__scopeId","data-v-e4aa1e4c"]]),me=e.createPinia(),_e=e.Go(),F=e.createApp({components:{GiftCard:pe}});F.use(me);F.use(e.instance);F.use(_e);F.use(N.StickyPlugin);F.use(e.install,{bootstrap:!0});F.mount("#konnectio-gift-card-app");
|
|
1
|
+
"use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-80ce269e.cjs"),N=require("./index-2c822f23.cjs"),$=require("./_-0041bfd0.cjs"),R=require("./Field-9be15a05.cjs");require("./_commonjsHelpers-6763f629.cjs");const G=e.defineStore("giftCard",()=>{e.useAlertStore();const{pay:y}=e.usePaymentStore(),{bearerToken:a,metaData:v}=e.storeToRefs(e.useUtilityStore()),i=e.ref(e.GiftCardModuleState.InitialState),f=e.useStorage("konnectio_name","",void 0,{serializer:e.StorageSerializers.string}),g=e.useStorage("konnectio_email","",void 0,{serializer:e.StorageSerializers.string}),d=e.useStorage("konnectio_phone","",void 0,{serializer:e.StorageSerializers.string}),u=e.ref(""),V=e.ref(1),w=e.ref(!0),_=e.ref(""),s=e.ref({base64:"",type:"",name:""}),k=e.ref(void 0),l=e.ref(0),n=e.ref(!1),r=e.ref(0),C=e.computed(()=>i.value===e.GiftCardModuleState.InitialState||i.value===e.GiftCardModuleState.WaitingForResponse),B=e.computed(()=>i.value===e.GiftCardModuleState.ReadyToPay),p=e.computed(()=>i.value===e.GiftCardModuleState.PaymentSuccess),h=e.computed(()=>{const c={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},t=v.value.places;return t&&t.forEach(m=>{c[m.placeType].data.push(m)}),Object.fromEntries(Object.entries(c).filter(([,m])=>m.data.length>0))}),x=e.computed(()=>r.value!==0),b=e.computed(()=>{let c;if(x.value)c=h.value[r.value].data[0];else if(l.value!==0){const t=k.value,m=h.value[l.value].data;m.length===1?c=m[0]:t!==void 0&&m.forEach(P=>{String(P.id)===String(t)&&(c=P)})}return c}),E=e.computed(()=>!(!f.value||!g.value||!(d.value.length>=5)||!u.value||b.value===void 0)),q=e.computed(()=>!(i.value===e.GiftCardModuleState.InitialState&&n.value)),T=e.computed(()=>!!(i.value===e.GiftCardModuleState.WaitingForResponse&&n.value));async function S(){i.value=e.GiftCardModuleState.WaitingForResponse,n.value=!0,await e.axios.post("https://stage.hotel-service.konnectio.dk/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:v.value.currency.id,language:e.getUserLanguage(),amount:u.value,quantity:V.value,freeText:_.value,showPrice:w.value,contactName:f.value,contactEmail:g.value,contactPhone:d.value,imageBase64:e.b2a(s.value.base64),imageName:s.value.name,imageFormat:s.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.29"}}).then(c=>{i.value=e.GiftCardModuleState.ReadyToPay,n.value=!1,y({callback:()=>console.log("Callback!"),response:c.data})})}function o(c){c&&(r.value=c)}return{moduleState:i,name:f,email:g,phone:d,value:u,remark:_,showValue:w,quantity:V,media:s,placeId:k,placeType:l,showFormPage:C,showPaymentPage:B,showConfirmationPage:p,places:h,hasFilledForm:E,hasForcedPlaceType:x,isWaitingForResponse:T,isMetaDataAvailable:q,orderGiftCard:S,initialize:o}}),M={class:"media-selector"},D=["accept"],I={class:"media-selector-wrapper"},L={class:"media-selector-tools"},z={key:0},A={key:1},W={key:2},j=["src"],H=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(y,{emit:a}){const v=a,i=y,{t:f}=e.useI18n(),{display:g}=e.useAlertStore(),d=e.ref(),u=e.computed(()=>i.modelValue.base64!=="");function V(l){v("update:modelValue",l)}function w(){V({base64:"",name:"",type:""}),d.value&&(d.value.value="")}function _(){d.value&&d.value.click()}function s(l,n){const[r,C]=[l.name,l.type],B=new FileReader;B.onload=function(p){if(p.target){const h=p.target.result;n({base64:h,name:r,type:C})}else g({message:f("imageUploadError"),type:"error"})},B.readAsDataURL(l)}async function k(){let l;(l=d.value.files)instanceof FileList&&s(l[0],V)}return(l,n)=>(e.openBlock(),e.createBlock(e.InputField,{label:l.label,required:l.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",M,[e.createBaseVNode("input",{ref_key:"fileInput",ref:d,type:"file",class:"hidden",accept:l.validation,single:"",onChange:n[0]||(n[0]=r=>k())},null,40,D),e.createBaseVNode("div",I,[e.createBaseVNode("ul",L,[u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",z,[e.createVNode(e.Clickable,{label:e.unref(f)("uploadFile"),type:"button",icon:"upload","icon-color":l.iconColor,onClickEvent:n[1]||(n[1]=r=>_())},null,8,["label","icon-color"])])),u.value?(e.openBlock(),e.createElementBlock("li",A,[e.createVNode(e.Clickable,{label:e.unref(f)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":l.iconColor,onClickEvent:n[2]||(n[2]=r=>_())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("li",W,[e.createVNode(e.Clickable,{label:e.unref(f)("removeFile"),type:"button",icon:"trash-alt","icon-color":l.iconColor,onClickEvent:n[3]||(n[3]=r=>w())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:u.value}])},[l.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.modelValue.base64},null,8,j)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function U(y){const a=y;a.__i18n=a.__i18n||[],a.__i18n.push({locale:"",resource:{da:{uploadFile:{t:0,b:{t:2,i:[{t:3}],s:"Upload billede"}},removeFile:{t:0,b:{t:2,i:[{t:3}],s:"Fjern billede"}},replaceFile:{t:0,b:{t:2,i:[{t:3}],s:"Ersat billede"}},imageUploadError:{t:0,b:{t:2,i:[{t:3}],s:"Der skete en fejl under billede upload!"}}},en:{uploadFile:{t:0,b:{t:2,i:[{t:3}],s:"Upload image"}},removeFile:{t:0,b:{t:2,i:[{t:3}],s:"Remove image"}},replaceFile:{t:0,b:{t:2,i:[{t:3}],s:"Replace image"}},imageUploadError:{t:0,b:{t:2,i:[{t:3}],s:"An error occurred under image upload!"}}}}})}typeof U=="function"&&U(H);const O={class:"gift-card-skeleton"},K={class:"gift-card-skeleton-form"},Y=e.defineComponent({__name:"GiftCardSkeleton",setup(y){return(a,v)=>(e.openBlock(),e.createElementBlock("div",O,[e.createBaseVNode("div",K,[e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field,{"is-text-area":""}),e.createVNode($.Element,{height:"44px"})])]))}});const J=e._export_sfc(Y,[["__scopeId","data-v-2600a731"]]),Q={key:0,id:"fresh-booking-gift-card-wrapper"},X={id:"fresh-booking-gift-card-title"},Z={id:"fresh-booking-gift-card-content"},ee={id:"fresh-booking-gift-card-payment"},te=["innerHTML"],ae={key:0},le={key:0,id:"fresh-booking-select-place-type"},oe={class:e.normalizeClass(["fresh-booking-label","required"])},ne={id:"fresh-booking-select-place-type-input"},ie=["innerHTML"],re={key:0,id:"fresh-booking-gift-card-order"},de={class:"fresh-booking-panel"},se={key:1,id:"fresh-booking-gift-card-remarks"},ce={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},ue={id:"fresh-booking-gift-card-recaptcha"},fe=e.defineComponent({name:"GiftCardLayout",__name:"GiftCard",props:{accessToken:{},layout:{default:"minimal"},placeType:{},styling:{}},setup(y){const{t:a}=e.useI18n(),{name:v,email:i,phone:f,value:g,remark:d,showValue:u,quantity:V,media:w,placeId:_,placeType:s,showFormPage:k,showPaymentPage:l,showConfirmationPage:n,places:r,hasFilledForm:C,hasForcedPlaceType:B,isWaitingForResponse:p,isMetaDataAvailable:h}=e.storeToRefs(G()),{initialize:x,orderGiftCard:b}=G(),{isRecaptchaEnabled:E,currency:q}=e.storeToRefs(e.useUtilityStore());async function T(){await b()}return e.watch(s,()=>{_.value=void 0}),e.onMounted(()=>{x()}),(S,o)=>{const c=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main$1,{id:"fresh-booking-gift-card-module",type:"gift-card","access-token":S.accessToken,"data-layout":S.layout,styling:S.styling,"sticky-container":""},{default:e.withCtx(()=>[e.unref(h)?(e.openBlock(),e.createElementBlock("div",Q,[e.createBaseVNode("h4",X,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.title")),1)]),e.createBaseVNode("div",Z,[e.withDirectives(e.createBaseVNode("div",ee,[e.createVNode(N.CheckoutWindow)],512),[[e.vShow,e.unref(l)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(a)("giftCard.description")},null,8,te),e.createBaseVNode("form",null,[e.createVNode(e.TextField,{modelValue:e.unref(v),"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(v)?v.value=t:null),type:"text",name:"name",autocomplete:"name",label:e.unref(a)("giftCard.name"),icon:"user-alt",placeholder:e.unref(a)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(e.TextField,{modelValue:e.unref(i),"onUpdate:modelValue":o[1]||(o[1]=t=>e.isRef(i)?i.value=t:null),type:"email",name:"email",autocomplete:"email",label:e.unref(a)("giftCard.email"),icon:"at",placeholder:e.unref(a)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(N.PhoneField,{modelValue:e.unref(f),"onUpdate:modelValue":o[2]||(o[2]=t=>e.isRef(f)?f.value=t:null),icon:"phone-office",label:e.unref(a)("giftCard.phone"),placeholder:e.unref(a)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.unref(B)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ae,[e.unref(r)?(e.openBlock(),e.createElementBlock("div",le,[e.createBaseVNode("label",oe,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.selectType")),1)]),e.createBaseVNode("div",ne,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(t,m)=>(e.openBlock(),e.createElementBlock("li",{key:m},[e.createVNode(N.Checkbox,{modelValue:e.unref(s),"onUpdate:modelValue":o[3]||(o[3]=P=>e.isRef(s)?s.value=P:null),type:"radio",name:"placeType",val:m,label:t.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(r)[e.unref(s)]&&e.unref(r)[e.unref(s)].data.length>1?(e.openBlock(),e.createBlock(e._sfc_main,{key:0,modelValue:e.unref(_),"onUpdate:modelValue":o[4]||(o[4]=t=>e.isRef(_)?_.value=t:null),placeholder:e.unref(a)("giftCard.selectPlacePlaceholder"),options:e.unref(r)[e.unref(s)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))])),e.createVNode(e.TextField,{modelValue:e.unref(g),"onUpdate:modelValue":o[5]||(o[5]=t=>e.isRef(g)?g.value=t:null),type:"number",name:"value",label:e.unref(a)("giftCard.value"),icon:"money-bill",placeholder:e.unref(a)("giftCard.valuePlaceholder"),suffix:e.unref(q),required:""},null,8,["modelValue","label","placeholder","suffix"]),e.createVNode(N.Checkbox,{modelValue:e.unref(u),"onUpdate:modelValue":o[6]||(o[6]=t=>e.isRef(u)?u.value=t:null),type:"checkbox",name:"showValue",label:e.unref(a)("giftCard.showValue"),checked:e.unref(u)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(k)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",{innerHTML:e.unref(a)("giftCard.thankYou")},null,8,ie)],512),[[e.vShow,e.unref(n)]])]),S.layout!=="minimal"&&e.unref(k)?(e.openBlock(),e.createElementBlock("div",re,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(C),"is-loading":e.unref(p),"onUpdate:isLoading":o[9]||(o[9]=t=>e.isRef(p)?p.value=t:null),onClickEvent:T},null,8,["label","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(k)?(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.TextField,{modelValue:e.unref(d),"onUpdate:modelValue":o[10]||(o[10]=t=>e.isRef(d)?d.value=t:null),type:"textarea",name:"remark",label:e.unref(a)("giftCard.remark"),icon:"info-circle",placeholder:e.unref(a)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","placeholder"])])):e.createCommentVNode("",!0),e.unref(k)?e.withDirectives((e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(C),"data-test":"orderGiftCard","is-loading":e.unref(p),"onUpdate:isLoading":o[11]||(o[11]=t=>e.isRef(p)?p.value=t:null),onClickEvent:T},null,8,["label","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",ue,[e.createVNode(N._sfc_main)],512),[[e.vShow,e.unref(E)]])])),[[c]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout","styling"])]),fallback:e.withCtx(()=>[e.createVNode(J)]),_:1})}}});const pe=e._export_sfc(fe,[["__scopeId","data-v-e4aa1e4c"]]),me=e.createPinia(),_e=e.Go(),F=e.createApp({components:{GiftCard:pe}});F.use(me);F.use(e.instance);F.use(_e);F.use(N.StickyPlugin);F.use(e.install,{bootstrap:!0});F.mount("#konnectio-gift-card-app");
|