@konnectio/core 4.0.6 → 4.0.9
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-b87d2fd7.cjs +1 -0
- package/dist/{ActionField-5ecfc9dc.js → ActionField-f3d5b218.js} +4 -4
- package/dist/ActionField-f3d5b218.js.br +0 -0
- package/dist/AvailabilitySkeleton-019ec202.js +150 -0
- package/dist/AvailabilitySkeleton-019ec202.js.br +0 -0
- package/dist/AvailabilitySkeleton-e288f5be.cjs +1 -0
- package/dist/Field-21bb32d7.cjs +1 -0
- package/dist/Field-6bfeedce.js +59 -0
- package/dist/Field-6bfeedce.js.br +0 -0
- package/dist/{NumberField.vue_vue_type_style_index_0_lang-ab747739.js → SelectField.vue_vue_type_style_index_0_lang-701aecad.js} +7743 -6953
- package/dist/SelectField.vue_vue_type_style_index_0_lang-701aecad.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-a370e66d.cjs +797 -0
- package/dist/TextField-99e69631.cjs +54 -0
- package/dist/TextField-b8f4462a.js +9343 -0
- package/dist/TextField-b8f4462a.js.br +0 -0
- package/dist/ThankYou-add684c1.cjs +66 -0
- package/dist/ThankYou-edbf753b.js +14279 -0
- package/dist/ThankYou-edbf753b.js.br +0 -0
- package/dist/{_commonjsHelpers-aeeeeb92.js → _commonjsHelpers-c5d32002.js} +2 -2
- package/dist/{applyGiftCard-d9ab3dcf.cjs → applyGiftCard-c21f13ac.cjs} +1 -1
- package/dist/{applyGiftCard-c5e4aaad.js → applyGiftCard-dea77ba6.js} +7 -7
- package/dist/applyGiftCard-dea77ba6.js.br +0 -0
- package/dist/availability.cjs +2 -0
- package/dist/availability.js +236 -0
- package/dist/availability.js.br +0 -0
- package/dist/components/ErrorMessage.vue.d.ts +5 -0
- package/dist/components/ErrorMessage.vue.d.ts.map +1 -0
- package/dist/components/Icon.vue.d.ts +1 -1
- package/dist/components/forms/EventAvailabilityForm.vue.d.ts +1 -1
- 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/forms/ReservationFormTest.vue.d.ts +5 -0
- package/dist/components/forms/ReservationFormTest.vue.d.ts.map +1 -0
- package/dist/components/inputs/grouped/CountryField.vue.d.ts +1 -1
- package/dist/components/listings/Base.vue.d.ts +1 -1
- package/dist/components/listings/Test.vue.d.ts +1 -1
- package/dist/components/side-panels/Base.vue.d.ts +1 -1
- package/dist/components/side-panels/Hotel.vue.d.ts +3 -2
- package/dist/components/side-panels/Hotel.vue.d.ts.map +1 -1
- package/dist/components/skeletons/AvailabilitySkeleton.vue.d.ts +5 -0
- package/dist/components/skeletons/AvailabilitySkeleton.vue.d.ts.map +1 -0
- package/dist/components/skeletons/Field.vue.d.ts +5 -0
- package/dist/components/skeletons/Field.vue.d.ts.map +1 -0
- package/dist/components/skeletons/GiftCardSkeleton.vue.d.ts +5 -0
- package/dist/components/skeletons/GiftCardSkeleton.vue.d.ts.map +1 -0
- package/dist/components/skeletons/HotelSkeleton.vue.d.ts +5 -0
- package/dist/components/skeletons/HotelSkeleton.vue.d.ts.map +1 -0
- package/dist/components/skeletons/Listing.vue.d.ts +5 -0
- package/dist/components/skeletons/Listing.vue.d.ts.map +1 -0
- package/dist/components/skeletons/_.vue.d.ts +5 -0
- package/dist/components/skeletons/_.vue.d.ts.map +1 -0
- package/dist/entries/availability.d.ts +3 -2
- package/dist/entries/gift-card.d.ts +1 -2
- package/dist/entries/hotel.d.ts +0 -2
- package/dist/event-2c6a2138.cjs +1 -0
- package/dist/{event-a70cffeb.js → event-a9067cf5.js} +91 -91
- package/dist/event-a9067cf5.js.br +0 -0
- package/dist/event.cjs +2 -0
- package/dist/event.js +867 -0
- package/dist/event.js.br +0 -0
- package/dist/gift-card-validation.cjs +1 -0
- package/dist/{gift-card-validation.es.js → gift-card-validation.js} +42 -42
- package/dist/gift-card-validation.js.br +0 -0
- package/dist/gift-card.cjs +1 -0
- package/dist/gift-card.d.ts +0 -2
- package/dist/gift-card.js +590 -0
- package/dist/gift-card.js.br +0 -0
- package/dist/hotel.cjs +19 -0
- package/dist/hotel.d.ts +0 -2
- package/dist/hotel.js +2981 -0
- package/dist/hotel.js.br +0 -0
- package/dist/{index-00262c16.js → index-d080b5a0.js} +5 -7
- package/dist/index-d080b5a0.js.br +0 -0
- package/dist/index-ec04c269.cjs +1 -0
- package/dist/layouts/Availability.vue.d.ts +42 -217
- package/dist/layouts/GiftCard.vue.d.ts +130 -99
- package/dist/layouts/Hotel.vue.d.ts +162 -57
- package/dist/{payment-fbffaa6d.cjs → payment-95b2392a.cjs} +2 -2
- package/dist/{payment-9e219e9b.js → payment-cce506b8.js} +930 -929
- package/dist/payment-cce506b8.js.br +0 -0
- package/dist/polyfill.cjs +4 -0
- package/dist/polyfill.js +6815 -0
- package/dist/polyfill.js.br +0 -0
- package/dist/store/availability.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/style.css.br +0 -0
- package/package.json +11 -21
- package/dist/ActionField-5ecfc9dc.js.br +0 -0
- package/dist/ActionField-ae9b1adf.cjs +0 -1
- package/dist/HotelAvailabilityForm-0cd1abda.cjs +0 -1
- package/dist/HotelAvailabilityForm-a7b6f17e.js +0 -97
- package/dist/HotelAvailabilityForm-a7b6f17e.js.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-0b6d48f1.cjs +0 -793
- package/dist/NumberField.vue_vue_type_style_index_0_lang-ab747739.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-05b8ec39.js +0 -376
- package/dist/ReCaptchaVuePlugin-05b8ec39.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-08ee5d62.cjs +0 -1
- package/dist/SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js +0 -10107
- package/dist/SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-5f1087dc.cjs +0 -56
- package/dist/ThankYou-1866d8db.js +0 -8547
- package/dist/ThankYou-1866d8db.js.br +0 -0
- package/dist/ThankYou-5741bcb6.cjs +0 -15
- package/dist/applyGiftCard-c5e4aaad.js.br +0 -0
- package/dist/availability.cjs.js +0 -1
- package/dist/availability.cjs.js.br +0 -0
- package/dist/availability.es.js +0 -183
- package/dist/availability.es.js.br +0 -0
- package/dist/components/LoadingBlock.vue.d.ts +0 -4
- package/dist/components/LoadingBlock.vue.d.ts.map +0 -1
- package/dist/event-39706438.cjs +0 -1
- package/dist/event-a70cffeb.js.br +0 -0
- package/dist/event.cjs.js +0 -1
- package/dist/event.cjs.js.br +0 -0
- package/dist/event.es.js +0 -645
- package/dist/event.es.js.br +0 -0
- package/dist/gift-card-validation.cjs.js +0 -1
- package/dist/gift-card-validation.cjs.js.br +0 -0
- package/dist/gift-card-validation.es.js.br +0 -0
- package/dist/gift-card.cjs.js +0 -1
- package/dist/gift-card.cjs.js.br +0 -0
- package/dist/gift-card.es.js +0 -584
- package/dist/gift-card.es.js.br +0 -0
- package/dist/hotel.cjs.js +0 -19
- package/dist/hotel.cjs.js.br +0 -0
- package/dist/hotel.es.js +0 -2394
- package/dist/hotel.es.js.br +0 -0
- package/dist/index-00262c16.js.br +0 -0
- package/dist/index-58f3b0cc.cjs +0 -1
- package/dist/payment-9e219e9b.js.br +0 -0
- package/dist/polyfill.cjs.js +0 -4
- package/dist/polyfill.cjs.js.br +0 -0
- package/dist/polyfill.es.js +0 -6764
- package/dist/polyfill.es.js.br +0 -0
- /package/dist/{navigation.cjs.js → navigation.cjs} +0 -0
- /package/dist/{navigation.es.js → navigation.js} +0 -0
package/dist/gift-card.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./NumberField.vue_vue_type_style_index_0_lang-0b6d48f1.cjs"),V=require("./index-58f3b0cc.cjs"),I=require("./ReCaptchaVuePlugin-08ee5d62.cjs"),w=require("./SelectField.vue_vue_type_style_index_0_lang-5f1087dc.cjs");require("./_commonjsHelpers-6763f629.cjs");const U=e.defineStore("giftCard",()=>{const{display:c}=e.useAlertStore(),{bearerToken:t,metaData:o}=e.storeToRefs(e.useUtilityStore()),a=e.ref(e.GiftCardModuleState.InitialState),y=e.useStorage("freshBookingName","",void 0,{serializer:e.StorageSerializers.string}),s=e.useStorage("freshBookingEmail","",void 0,{serializer:e.StorageSerializers.string}),p=e.useStorage("freshBookingPhone","",void 0,{serializer:e.StorageSerializers.string}),g=e.ref(""),b=e.ref(1),B=e.ref(!0),S=e.ref(""),m=e.ref({base64:"",type:"",name:""}),n=e.ref(void 0),d=e.ref(0),f=e.ref(!1),h=e.ref(0),v=e.computed(()=>a.value===e.GiftCardModuleState.InitialState||a.value===e.GiftCardModuleState.WaitingForResponse),k=e.computed(()=>a.value===e.GiftCardModuleState.ReadyToPay),N=e.computed(()=>a.value===e.GiftCardModuleState.PaymentSuccess),_=e.computed(()=>{const u={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},r=o.value.places;return r&&r.forEach(l=>{u[l.placeType].data.push(l)}),Object.fromEntries(Object.entries(u).filter(([,l])=>l.data.length>0))}),P=e.computed(()=>h.value!==0),C=e.computed(()=>{let u;if(P.value)u=_.value[h.value].data[0];else if(d.value!==0){const r=n.value,l=_.value[d.value].data;l.length===1?u=l[0]:r!==void 0&&l.forEach(R=>{String(R.id)===String(r)&&(u=R)})}return u}),T=e.computed(()=>!(!y.value||!s.value||!(p.value.length>=5)||!g.value||C.value===void 0)),z=e.computed(()=>!(a.value===e.GiftCardModuleState.InitialState&&f.value)),M=e.computed(()=>!!(a.value===e.GiftCardModuleState.WaitingForResponse&&f.value));async function x(){a.value=e.GiftCardModuleState.WaitingForResponse,f.value=!0,await e.axios.post("http://localhost:91/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:o.value.currency.id,language:e.getUserLanguage(),amount:g.value,quantity:b.value,freeText:S.value,showPrice:B.value,contactName:y.value,contactEmail:s.value,contactPhone:p.value,imageBase64:e.b2a(m.value.base64),imageName:m.value.name,imageFormat:m.value.type,placeType:C.value?C.value.placeType:void 0,placeID:C.value?C.value.id:void 0},{headers:{Authorization:t.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.6"}}).then(u=>{if(f.value=!1,u.data.easyPayment){a.value=e.GiftCardModuleState.ReadyToPay;const r=new Reepay.EmbeddedCheckout(u.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});r.addEventHandler(e.ReepayEvent.Accept,()=>{a.value=e.GiftCardModuleState.PaymentSuccess,c({message:e.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),r.addEventHandler(e.ReepayEvent.Error,()=>{c({message:e.i18n.t("booking.other.errorMessage"),type:"warning"})})}else a.value=e.GiftCardModuleState.InitialState,c({message:`${e.i18n.t("booking.other.errorMessage")} (HTTP: ${u.status})`,type:"warning"})})}function E(u){h.value=u}return{moduleState:a,name:y,email:s,phone:p,value:g,remark:S,showValue:B,quantity:b,media:m,placeId:n,placeType:d,showFormPage:v,showPaymentPage:k,showConfirmationPage:N,places:_,hasFilledForm:T,hasForcedPlaceType:P,isWaitingForResponse:M,isMetaDataAvailable:z,orderGiftCard:x,initialize:E}}),D={class:"media-selector"},L=["accept"],W={class:"media-selector-wrapper"},A={class:"media-selector-tools"},H={key:0},j={key:1},O={key:2},K=["src"],Y=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(c,{emit:t}){const o=c,{t:a}=e.useI18n(),{display:y}=e.useAlertStore(),s=e.ref(),p=e.computed(()=>o.modelValue.base64!=="");function g(n){t("update:modelValue",n)}function b(){g({base64:"",name:"",type:""}),s.value&&(s.value.value="")}function B(){s.value&&s.value.click()}function S(n,d){const[f,h]=[n.name,n.type],v=new FileReader;v.onload=function(k){if(k.target){const N=k.target.result;d({base64:N,name:f,type:h})}else y({message:a("imageUploadError"),type:"error"})},v.readAsDataURL(n)}async function m(){let n;(n=s.value.files)instanceof FileList&&S(n[0],g)}return(n,d)=>(e.openBlock(),e.createBlock(e.InputField,{label:n.label,required:n.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",D,[e.createBaseVNode("input",{ref_key:"fileInput",ref:s,type:"file",class:"hidden",accept:n.validation,single:"",onChange:d[0]||(d[0]=f=>m())},null,40,L),e.createBaseVNode("div",W,[e.createBaseVNode("ul",A,[p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",H,[e.createVNode(e.Clickable,{label:e.unref(a)("uploadFile"),type:"button",icon:"upload","icon-color":n.iconColor,onClickEvent:d[1]||(d[1]=f=>B())},null,8,["label","icon-color"])])),p.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(a)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":n.iconColor,onClickEvent:d[2]||(d[2]=f=>B())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("li",O,[e.createVNode(e.Clickable,{label:e.unref(a)("removeFile"),type:"button",icon:"trash-alt","icon-color":n.iconColor,onClickEvent:d[3]||(d[3]=f=>b())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:p.value}])},[n.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.modelValue.base64},null,8,K)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function $(c){const t=c;t.__i18n=t.__i18n||[],t.__i18n.push({locale:"",resource:{da:{uploadFile:o=>{const{normalize:a}=o;return a(["Upload billede"])},removeFile:o=>{const{normalize:a}=o;return a(["Fjern billede"])},replaceFile:o=>{const{normalize:a}=o;return a(["Ersat billede"])},imageUploadError:o=>{const{normalize:a}=o;return a(["Der skete en fejl under billede upload!"])}},en:{uploadFile:o=>{const{normalize:a}=o;return a(["Upload image"])},removeFile:o=>{const{normalize:a}=o;return a(["Remove image"])},replaceFile:o=>{const{normalize:a}=o;return a(["Replace image"])},imageUploadError:o=>{const{normalize:a}=o;return a(["An error occurred under image upload!"])}}}})}typeof $=="function"&&$(Y);const J=c=>(e.pushScopeId("data-v-259a8073"),c=c(),e.popScopeId(),c),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"},oe=["innerHTML"],te={key:0},ae={key:0,id:"fresh-booking-select-place-type"},le={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"},ue={key:1,id:"fresh-booking-gift-card-remarks"},se={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},ce={id:"fresh-booking-gift-card-recaptcha"},pe=J(()=>e.createBaseVNode("span",null,"Loading...",-1)),fe=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(c){const t=c,{t:o}=e.useI18n(),{name:a,email:y,phone:s,value:p,remark:g,showValue:b,quantity:B,media:S,placeId:m,placeType:n,showFormPage:d,showPaymentPage:f,showConfirmationPage:h,places:v,hasFilledForm:k,hasForcedPlaceType:N,isWaitingForResponse:_,isMetaDataAvailable:P}=e.storeToRefs(U()),{initialize:C,orderGiftCard:T}=U(),{isRecaptchaEnabled:z,currency:M}=e.storeToRefs(e.useUtilityStore()),{display:x}=e.useAlertStore();async function E(){const r=I.useReCaptcha_1();if(z.value&&r){await r.recaptchaLoaded();const l=await r.executeRecaptcha("create_gift_card");(await e.axios.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${l}`)).data.success?await T():x({message:o("alert.error.robot"),type:"error"})}else await T()}e.watch(n,()=>{m.value=void 0}),e.onMounted(()=>{C(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(r,l)=>{const R=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main,{id:"fresh-booking-gift-card-module",class:"fresh-booking-app",type:"gift-card","access-token":r.accessToken,"data-layout":r.layout,style:u,"sticky-container":""},{default:e.withCtx(()=>[e.unref(P)?(e.openBlock(),e.createElementBlock("div",Q,[e.createBaseVNode("h4",X,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(o)("giftCard.title")),1)]),e.createBaseVNode("div",Z,[e.withDirectives(e.createBaseVNode("div",ee,null,512),[[e.vShow,e.unref(f)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(o)("giftCard.description")},null,8,oe),e.createBaseVNode("form",null,[e.createVNode(w.TextField,{modelValue:e.unref(a),"onUpdate:modelValue":l[0]||(l[0]=i=>e.isRef(a)?a.value=i:null),type:"text",name:"name",autocomplete:"name",label:e.unref(o)("giftCard.name"),icon:"user-alt","icon-color":r.accentColor,placeholder:e.unref(o)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(w.TextField,{modelValue:e.unref(y),"onUpdate:modelValue":l[1]||(l[1]=i=>e.isRef(y)?y.value=i:null),type:"email",name:"email",autocomplete:"email",label:e.unref(o)("giftCard.email"),icon:"at","icon-color":r.accentColor,placeholder:e.unref(o)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(V.PhoneField,{modelValue:e.unref(s),"onUpdate:modelValue":l[2]||(l[2]=i=>e.isRef(s)?s.value=i:null),icon:"phone-office","icon-color":r.accentColor,label:e.unref(o)("giftCard.phone"),placeholder:e.unref(o)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(N)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",te,[e.unref(v)?(e.openBlock(),e.createElementBlock("div",ae,[e.createBaseVNode("label",le,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(o)("giftCard.selectType")),1)]),e.createBaseVNode("div",ne,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(i,q)=>(e.openBlock(),e.createElementBlock("li",{key:q},[e.createVNode(V.Checkbox,{modelValue:e.unref(n),"onUpdate:modelValue":l[3]||(l[3]=G=>e.isRef(n)?n.value=G:null),type:"radio",name:"placeType",val:q,label:i.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(v)[e.unref(n)]&&e.unref(v)[e.unref(n)].data.length>1?(e.openBlock(),e.createBlock(w._sfc_main,{key:0,modelValue:e.unref(m),"onUpdate:modelValue":l[4]||(l[4]=i=>e.isRef(m)?m.value=i:null),placeholder:e.unref(o)("giftCard.selectPlacePlaceholder"),options:e.unref(v)[e.unref(n)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1,color:r.loadingColor},null,8,["color"]))])),e.createVNode(w.TextField,{modelValue:e.unref(p),"onUpdate:modelValue":l[5]||(l[5]=i=>e.isRef(p)?p.value=i:null),type:"number",name:"value",label:e.unref(o)("giftCard.value"),icon:"money-bill","icon-color":r.accentColor,placeholder:e.unref(o)("giftCard.valuePlaceholder"),suffix:e.unref(M),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(V.Checkbox,{modelValue:e.unref(b),"onUpdate:modelValue":l[6]||(l[6]=i=>e.isRef(b)?b.value=i:null),type:"checkbox",name:"showValue",label:e.unref(o)("giftCard.showValue"),checked:e.unref(b)},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(o)("giftCard.thankYou")},null,8,re)],512),[[e.vShow,e.unref(h)]])]),r.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ie,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(o)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:r.successColor}),"full-width":!0,disabled:!e.unref(k),"is-loading":e.unref(_),"onUpdate:isLoading":l[9]||(l[9]=i=>e.isRef(_)?_.value=i:null),onClickEvent:E},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w.TextField,{modelValue:e.unref(g),"onUpdate:modelValue":l[10]||(l[10]=i=>e.isRef(g)?g.value=i:null),type:"textarea",name:"remark",label:e.unref(o)("giftCard.remark"),icon:"info-circle","icon-color":r.accentColor,placeholder:e.unref(o)("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(o)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:r.successColor}),"full-width":!0,disabled:!e.unref(k),"data-test":"orderGiftCard","is-loading":e.unref(_),"onUpdate:isLoading":l[11]||(l[11]=i=>e.isRef(_)?_.value=i:null),onClickEvent:E},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",ce,[e.createVNode(V._sfc_main)],512),[[e.vShow,e.unref(z)]])])),[[R]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[pe]),_:1})}}});const me=e._export_sfc(fe,[["__scopeId","data-v-259a8073"]]),ge=e.createPinia(),F=e.createApp({components:{GiftCard:me}});F.use(ge);F.use(e.instance);F.use(V.StickyPlugin);F.use(V.install,{bootstrap:!1});F.mount("#fresh-booking-gift-card-app");module.exports=F;
|
package/dist/gift-card.cjs.js.br
DELETED
|
Binary file
|
package/dist/gift-card.es.js
DELETED
|
@@ -1,584 +0,0 @@
|
|
|
1
|
-
import { d as fe, u as X, s as Z, a as se, r as k, a5 as y, b as J, c as P, i as I, S as Q, e as de, f as ge, a6 as ve, a7 as ae, h as ue, q as ce, k as u, l as L, w as O, x as s, v as b, m, n as e, C as W, y as C, A as pe, I as be, t as he, o as ye, a8 as ke, B as oe, a9 as M, aa as j, z as B, Y as Ce, Z as _e, $ as le, ab as te, J as Fe, K as Ve, L as Be, M as Pe, _ as Se, P as ze, N as Te, Q as we } from "./NumberField.vue_vue_type_style_index_0_lang-ab747739.js";
|
|
2
|
-
import { P as Re, C as ne, _ as $e, S as Ue, i as Ee } from "./index-00262c16.js";
|
|
3
|
-
import { u as qe } from "./ReCaptchaVuePlugin-05b8ec39.js";
|
|
4
|
-
import { T as x, _ as Ie } from "./SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js";
|
|
5
|
-
import "./_commonjsHelpers-aeeeeb92.js";
|
|
6
|
-
const re = fe("giftCard", () => {
|
|
7
|
-
const { display: f } = X(), { bearerToken: o, metaData: a } = Z(se()), l = k(y.InitialState), S = J("freshBookingName", "", void 0, { serializer: Q.string }), p = J("freshBookingEmail", "", void 0, { serializer: Q.string }), g = J("freshBookingPhone", "", void 0, { serializer: Q.string }), _ = k(""), z = k(1), $ = k(!0), U = k(""), h = k({
|
|
8
|
-
base64: "",
|
|
9
|
-
type: "",
|
|
10
|
-
name: ""
|
|
11
|
-
}), n = k(void 0), d = k(0), v = k(!1), T = k(0), F = P(() => l.value === y.InitialState || l.value === y.WaitingForResponse), w = P(() => l.value === y.ReadyToPay), E = P(() => l.value === y.PaymentSuccess), V = P(() => {
|
|
12
|
-
const c = {
|
|
13
|
-
1: {
|
|
14
|
-
label: I.t("giftCard.hotelType"),
|
|
15
|
-
data: []
|
|
16
|
-
},
|
|
17
|
-
2: {
|
|
18
|
-
label: I.t("giftCard.restaurantType"),
|
|
19
|
-
data: []
|
|
20
|
-
}
|
|
21
|
-
}, r = a.value.places;
|
|
22
|
-
return r && r.forEach((t) => {
|
|
23
|
-
c[t.placeType].data.push(t);
|
|
24
|
-
}), Object.fromEntries(
|
|
25
|
-
Object.entries(c).filter(([, t]) => t.data.length > 0)
|
|
26
|
-
);
|
|
27
|
-
}), A = P(() => T.value !== 0), R = P(() => {
|
|
28
|
-
let c;
|
|
29
|
-
if (A.value)
|
|
30
|
-
c = V.value[T.value].data[0];
|
|
31
|
-
else if (d.value !== 0) {
|
|
32
|
-
const r = n.value, t = V.value[d.value].data;
|
|
33
|
-
t.length === 1 ? c = t[0] : r !== void 0 && t.forEach((q) => {
|
|
34
|
-
String(q.id) === String(r) && (c = q);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return c;
|
|
38
|
-
}), G = P(() => !(!S.value || !p.value || !(g.value.length >= 5) || !_.value || R.value === void 0)), N = P(() => !(l.value === y.InitialState && v.value)), K = P(() => !!(l.value === y.WaitingForResponse && v.value));
|
|
39
|
-
async function Y() {
|
|
40
|
-
l.value = y.WaitingForResponse, v.value = !0, await de.post("http://localhost:91/api/gift-card/create", {
|
|
41
|
-
termsOfserviceURL: "https://freshbooking.dk",
|
|
42
|
-
checkoutUrl: "https://freshbooking.dk",
|
|
43
|
-
currencyID: a.value.currency.id,
|
|
44
|
-
language: ge(),
|
|
45
|
-
amount: _.value,
|
|
46
|
-
quantity: z.value,
|
|
47
|
-
freeText: U.value,
|
|
48
|
-
showPrice: $.value,
|
|
49
|
-
contactName: S.value,
|
|
50
|
-
contactEmail: p.value,
|
|
51
|
-
contactPhone: g.value,
|
|
52
|
-
imageBase64: ve(h.value.base64),
|
|
53
|
-
imageName: h.value.name,
|
|
54
|
-
imageFormat: h.value.type,
|
|
55
|
-
placeType: R.value ? R.value.placeType : void 0,
|
|
56
|
-
placeID: R.value ? R.value.id : void 0
|
|
57
|
-
}, {
|
|
58
|
-
headers: {
|
|
59
|
-
Authorization: o.value,
|
|
60
|
-
Accept: "application/json",
|
|
61
|
-
"Fresh-Booking-Ver": "4.0.6"
|
|
62
|
-
}
|
|
63
|
-
}).then((c) => {
|
|
64
|
-
if (v.value = !1, c.data.easyPayment) {
|
|
65
|
-
l.value = y.ReadyToPay;
|
|
66
|
-
const r = new Reepay.EmbeddedCheckout(
|
|
67
|
-
c.data.easyPayment.paymentID,
|
|
68
|
-
{ html_element: "fresh-booking-gift-card-payment" }
|
|
69
|
-
);
|
|
70
|
-
r.addEventHandler(ae.Accept, () => {
|
|
71
|
-
l.value = y.PaymentSuccess, f({
|
|
72
|
-
message: I.t("alert.success.giftCardOrdered"),
|
|
73
|
-
type: "success"
|
|
74
|
-
});
|
|
75
|
-
}), r.addEventHandler(ae.Error, () => {
|
|
76
|
-
f({
|
|
77
|
-
message: I.t("booking.other.errorMessage"),
|
|
78
|
-
type: "warning"
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
} else
|
|
82
|
-
l.value = y.InitialState, f({
|
|
83
|
-
message: `${I.t("booking.other.errorMessage")} (HTTP: ${c.status})`,
|
|
84
|
-
type: "warning"
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
function H(c) {
|
|
89
|
-
T.value = c;
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
moduleState: l,
|
|
93
|
-
name: S,
|
|
94
|
-
email: p,
|
|
95
|
-
phone: g,
|
|
96
|
-
value: _,
|
|
97
|
-
remark: U,
|
|
98
|
-
showValue: $,
|
|
99
|
-
quantity: z,
|
|
100
|
-
media: h,
|
|
101
|
-
placeId: n,
|
|
102
|
-
placeType: d,
|
|
103
|
-
showFormPage: F,
|
|
104
|
-
showPaymentPage: w,
|
|
105
|
-
showConfirmationPage: E,
|
|
106
|
-
places: V,
|
|
107
|
-
hasFilledForm: G,
|
|
108
|
-
hasForcedPlaceType: A,
|
|
109
|
-
isWaitingForResponse: K,
|
|
110
|
-
isMetaDataAvailable: N,
|
|
111
|
-
orderGiftCard: Y,
|
|
112
|
-
initialize: H
|
|
113
|
-
};
|
|
114
|
-
}), Me = { class: "media-selector" }, Le = ["accept"], We = { class: "media-selector-wrapper" }, De = { class: "media-selector-tools" }, Ae = { key: 0 }, Ge = { key: 1 }, Ne = { key: 2 }, He = ["src"], je = /* @__PURE__ */ ue({
|
|
115
|
-
__name: "MediaSelector",
|
|
116
|
-
props: {
|
|
117
|
-
modelValue: {},
|
|
118
|
-
validation: { default: "image/*" },
|
|
119
|
-
iconColor: { default: "#000" },
|
|
120
|
-
label: {},
|
|
121
|
-
required: { type: Boolean, default: !1 }
|
|
122
|
-
},
|
|
123
|
-
emits: ["update:modelValue"],
|
|
124
|
-
setup(f, { emit: o }) {
|
|
125
|
-
const a = f, { t: l } = ce(), { display: S } = X(), p = k(), g = P(() => a.modelValue.base64 !== "");
|
|
126
|
-
function _(n) {
|
|
127
|
-
o("update:modelValue", n);
|
|
128
|
-
}
|
|
129
|
-
function z() {
|
|
130
|
-
_({
|
|
131
|
-
base64: "",
|
|
132
|
-
name: "",
|
|
133
|
-
type: ""
|
|
134
|
-
}), p.value && (p.value.value = "");
|
|
135
|
-
}
|
|
136
|
-
function $() {
|
|
137
|
-
p.value && p.value.click();
|
|
138
|
-
}
|
|
139
|
-
function U(n, d) {
|
|
140
|
-
const [v, T] = [n.name, n.type], F = new FileReader();
|
|
141
|
-
F.onload = function(w) {
|
|
142
|
-
if (w.target) {
|
|
143
|
-
const E = w.target.result;
|
|
144
|
-
d({ base64: E, name: v, type: T });
|
|
145
|
-
} else
|
|
146
|
-
S({
|
|
147
|
-
message: l("imageUploadError"),
|
|
148
|
-
type: "error"
|
|
149
|
-
});
|
|
150
|
-
}, F.readAsDataURL(n);
|
|
151
|
-
}
|
|
152
|
-
async function h() {
|
|
153
|
-
let n;
|
|
154
|
-
(n = p.value.files) instanceof FileList && U(n[0], _);
|
|
155
|
-
}
|
|
156
|
-
return (n, d) => (u(), L(be, {
|
|
157
|
-
label: n.label,
|
|
158
|
-
required: n.required,
|
|
159
|
-
type: "media"
|
|
160
|
-
}, {
|
|
161
|
-
default: O(() => [
|
|
162
|
-
s("div", Me, [
|
|
163
|
-
s("input", {
|
|
164
|
-
ref_key: "fileInput",
|
|
165
|
-
ref: p,
|
|
166
|
-
type: "file",
|
|
167
|
-
class: "hidden",
|
|
168
|
-
accept: n.validation,
|
|
169
|
-
single: "",
|
|
170
|
-
onChange: d[0] || (d[0] = (v) => h())
|
|
171
|
-
}, null, 40, Le),
|
|
172
|
-
s("div", We, [
|
|
173
|
-
s("ul", De, [
|
|
174
|
-
g.value ? C("", !0) : (u(), b("li", Ae, [
|
|
175
|
-
m(W, {
|
|
176
|
-
label: e(l)("uploadFile"),
|
|
177
|
-
type: "button",
|
|
178
|
-
icon: "upload",
|
|
179
|
-
"icon-color": n.iconColor,
|
|
180
|
-
onClickEvent: d[1] || (d[1] = (v) => $())
|
|
181
|
-
}, null, 8, ["label", "icon-color"])
|
|
182
|
-
])),
|
|
183
|
-
g.value ? (u(), b("li", Ge, [
|
|
184
|
-
m(W, {
|
|
185
|
-
label: e(l)("replaceFile"),
|
|
186
|
-
type: "button",
|
|
187
|
-
icon: "repeat-alt",
|
|
188
|
-
"icon-color": n.iconColor,
|
|
189
|
-
onClickEvent: d[2] || (d[2] = (v) => $())
|
|
190
|
-
}, null, 8, ["label", "icon-color"])
|
|
191
|
-
])) : C("", !0),
|
|
192
|
-
g.value ? (u(), b("li", Ne, [
|
|
193
|
-
m(W, {
|
|
194
|
-
label: e(l)("removeFile"),
|
|
195
|
-
type: "button",
|
|
196
|
-
icon: "trash-alt",
|
|
197
|
-
"icon-color": n.iconColor,
|
|
198
|
-
onClickEvent: d[3] || (d[3] = (v) => z())
|
|
199
|
-
}, null, 8, ["label", "icon-color"])
|
|
200
|
-
])) : C("", !0)
|
|
201
|
-
]),
|
|
202
|
-
s("div", {
|
|
203
|
-
class: pe([
|
|
204
|
-
"media-selector-previewer",
|
|
205
|
-
{ opened: g.value }
|
|
206
|
-
])
|
|
207
|
-
}, [
|
|
208
|
-
n.modelValue ? (u(), b("img", {
|
|
209
|
-
key: 0,
|
|
210
|
-
src: n.modelValue.base64
|
|
211
|
-
}, null, 8, He)) : C("", !0)
|
|
212
|
-
], 2)
|
|
213
|
-
])
|
|
214
|
-
])
|
|
215
|
-
]),
|
|
216
|
-
_: 1
|
|
217
|
-
}, 8, ["label", "required"]));
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
function ie(f) {
|
|
221
|
-
const o = f;
|
|
222
|
-
o.__i18n = o.__i18n || [], o.__i18n.push({
|
|
223
|
-
locale: "",
|
|
224
|
-
resource: {
|
|
225
|
-
da: {
|
|
226
|
-
uploadFile: (a) => {
|
|
227
|
-
const { normalize: l } = a;
|
|
228
|
-
return l(["Upload billede"]);
|
|
229
|
-
},
|
|
230
|
-
removeFile: (a) => {
|
|
231
|
-
const { normalize: l } = a;
|
|
232
|
-
return l(["Fjern billede"]);
|
|
233
|
-
},
|
|
234
|
-
replaceFile: (a) => {
|
|
235
|
-
const { normalize: l } = a;
|
|
236
|
-
return l(["Ersat billede"]);
|
|
237
|
-
},
|
|
238
|
-
imageUploadError: (a) => {
|
|
239
|
-
const { normalize: l } = a;
|
|
240
|
-
return l(["Der skete en fejl under billede upload!"]);
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
en: {
|
|
244
|
-
uploadFile: (a) => {
|
|
245
|
-
const { normalize: l } = a;
|
|
246
|
-
return l(["Upload image"]);
|
|
247
|
-
},
|
|
248
|
-
removeFile: (a) => {
|
|
249
|
-
const { normalize: l } = a;
|
|
250
|
-
return l(["Remove image"]);
|
|
251
|
-
},
|
|
252
|
-
replaceFile: (a) => {
|
|
253
|
-
const { normalize: l } = a;
|
|
254
|
-
return l(["Replace image"]);
|
|
255
|
-
},
|
|
256
|
-
imageUploadError: (a) => {
|
|
257
|
-
const { normalize: l } = a;
|
|
258
|
-
return l(["An error occurred under image upload!"]);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
typeof ie == "function" && ie(je);
|
|
265
|
-
const xe = (f) => (Be("data-v-259a8073"), f = f(), Pe(), f), Oe = {
|
|
266
|
-
key: 0,
|
|
267
|
-
id: "fresh-booking-gift-card-wrapper"
|
|
268
|
-
}, Ke = { id: "fresh-booking-gift-card-title" }, Ye = { id: "fresh-booking-gift-card-content" }, Je = { id: "fresh-booking-gift-card-payment" }, Qe = ["innerHTML"], Ze = { key: 0 }, Xe = {
|
|
269
|
-
key: 0,
|
|
270
|
-
id: "fresh-booking-select-place-type"
|
|
271
|
-
}, ea = {
|
|
272
|
-
class: /* @__PURE__ */ pe(["fresh-booking-label", "required"])
|
|
273
|
-
}, aa = { id: "fresh-booking-select-place-type-input" }, oa = ["innerHTML"], la = {
|
|
274
|
-
key: 0,
|
|
275
|
-
id: "fresh-booking-gift-card-order"
|
|
276
|
-
}, ta = { class: "fresh-booking-panel" }, na = {
|
|
277
|
-
key: 1,
|
|
278
|
-
id: "fresh-booking-gift-card-remarks"
|
|
279
|
-
}, ra = {
|
|
280
|
-
key: 2,
|
|
281
|
-
id: "fresh-booking-gift-card-order-minimal",
|
|
282
|
-
"sticky-side": "bottom"
|
|
283
|
-
}, ia = { id: "fresh-booking-gift-card-recaptcha" }, sa = /* @__PURE__ */ xe(() => /* @__PURE__ */ s("span", null, "Loading...", -1)), da = /* @__PURE__ */ ue({
|
|
284
|
-
__name: "GiftCard",
|
|
285
|
-
props: {
|
|
286
|
-
accessToken: {},
|
|
287
|
-
accentColor: {},
|
|
288
|
-
buttonBackground: {},
|
|
289
|
-
buttonBorder: {},
|
|
290
|
-
buttonBorderRadius: {},
|
|
291
|
-
buttonColor: {},
|
|
292
|
-
buttonFontFamily: {},
|
|
293
|
-
buttonFontSize: {},
|
|
294
|
-
buttonTextTransform: {},
|
|
295
|
-
buttonFontWeight: {},
|
|
296
|
-
fontColor: {},
|
|
297
|
-
fontFamily: {},
|
|
298
|
-
fontSize: {},
|
|
299
|
-
fontWeight: {},
|
|
300
|
-
grayColor: {},
|
|
301
|
-
headerColor: {},
|
|
302
|
-
headerFontSize: {},
|
|
303
|
-
inputBackground: {},
|
|
304
|
-
inputBorder: {},
|
|
305
|
-
inputBorderRadius: {},
|
|
306
|
-
inputFontColor: {},
|
|
307
|
-
labelFontWeight: {},
|
|
308
|
-
labelPadding: {},
|
|
309
|
-
layout: {},
|
|
310
|
-
loadingColor: {},
|
|
311
|
-
panelBackground: {},
|
|
312
|
-
panelBorder: {},
|
|
313
|
-
panelBorderRadius: {},
|
|
314
|
-
panelPadding: {},
|
|
315
|
-
placeType: {},
|
|
316
|
-
successColor: {}
|
|
317
|
-
},
|
|
318
|
-
setup(f) {
|
|
319
|
-
const o = f, { t: a } = ce(), {
|
|
320
|
-
name: l,
|
|
321
|
-
email: S,
|
|
322
|
-
phone: p,
|
|
323
|
-
value: g,
|
|
324
|
-
remark: _,
|
|
325
|
-
showValue: z,
|
|
326
|
-
quantity: $,
|
|
327
|
-
media: U,
|
|
328
|
-
placeId: h,
|
|
329
|
-
placeType: n,
|
|
330
|
-
showFormPage: d,
|
|
331
|
-
showPaymentPage: v,
|
|
332
|
-
showConfirmationPage: T,
|
|
333
|
-
places: F,
|
|
334
|
-
hasFilledForm: w,
|
|
335
|
-
hasForcedPlaceType: E,
|
|
336
|
-
isWaitingForResponse: V,
|
|
337
|
-
isMetaDataAvailable: A
|
|
338
|
-
} = Z(re()), { initialize: R, orderGiftCard: G } = re(), { isRecaptchaEnabled: N, currency: K } = Z(se()), { display: Y } = X();
|
|
339
|
-
async function H() {
|
|
340
|
-
const r = qe();
|
|
341
|
-
if (N.value && r) {
|
|
342
|
-
await r.recaptchaLoaded();
|
|
343
|
-
const t = await r.executeRecaptcha("create_gift_card");
|
|
344
|
-
(await de.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${t}`)).data.success ? await G() : Y({
|
|
345
|
-
message: a("alert.error.robot"),
|
|
346
|
-
type: "error"
|
|
347
|
-
});
|
|
348
|
-
} else
|
|
349
|
-
await G();
|
|
350
|
-
}
|
|
351
|
-
he(n, () => {
|
|
352
|
-
h.value = void 0;
|
|
353
|
-
}), ye(() => {
|
|
354
|
-
R(parseInt(o.placeType));
|
|
355
|
-
});
|
|
356
|
-
const c = {
|
|
357
|
-
"--accentColor": o.accentColor,
|
|
358
|
-
"--buttonBackground": o.buttonBackground,
|
|
359
|
-
"--buttonBorder": o.buttonBorder,
|
|
360
|
-
"--buttonBorderRadius": o.buttonBorderRadius,
|
|
361
|
-
"--buttonFontFamily": o.buttonFontFamily,
|
|
362
|
-
"--buttonColor": o.buttonColor,
|
|
363
|
-
"--buttonFontSize": o.buttonFontSize,
|
|
364
|
-
"--buttonTextTransform": o.buttonTextTransform,
|
|
365
|
-
"--buttonFontWeight": o.buttonFontWeight,
|
|
366
|
-
"--fontColor": o.fontColor,
|
|
367
|
-
"--fontFamily": o.fontFamily,
|
|
368
|
-
"--fontSize": o.fontSize,
|
|
369
|
-
"--fontWeight": o.fontWeight,
|
|
370
|
-
"--grayColor": o.grayColor,
|
|
371
|
-
"--headerColor": o.headerColor,
|
|
372
|
-
"--headerFontSize": o.headerFontSize,
|
|
373
|
-
"--inputBackground": o.inputBackground,
|
|
374
|
-
"--inputBorder": o.inputBorder,
|
|
375
|
-
"--inputBorderRadius": o.inputBorderRadius,
|
|
376
|
-
"--inputFontColor": o.inputFontColor,
|
|
377
|
-
"--labelFontWeight": o.labelFontWeight,
|
|
378
|
-
"--labelPadding": o.labelPadding,
|
|
379
|
-
"--loadingColor": o.loadingColor,
|
|
380
|
-
"--panelBackground": o.panelBackground,
|
|
381
|
-
"--panelBorder": o.panelBorder,
|
|
382
|
-
"--panelBorderRadius": o.panelBorderRadius,
|
|
383
|
-
"--panelPadding": o.panelPadding,
|
|
384
|
-
"--successColor": o.successColor
|
|
385
|
-
};
|
|
386
|
-
return (r, t) => {
|
|
387
|
-
const q = ke("sticky");
|
|
388
|
-
return u(), L(Ve, null, {
|
|
389
|
-
default: O(() => [
|
|
390
|
-
m(Fe, {
|
|
391
|
-
id: "fresh-booking-gift-card-module",
|
|
392
|
-
class: "fresh-booking-app",
|
|
393
|
-
type: "gift-card",
|
|
394
|
-
"access-token": r.accessToken,
|
|
395
|
-
"data-layout": r.layout,
|
|
396
|
-
style: c,
|
|
397
|
-
"sticky-container": ""
|
|
398
|
-
}, {
|
|
399
|
-
default: O(() => [
|
|
400
|
-
e(A) ? (u(), b("div", Oe, [
|
|
401
|
-
s("h4", Ke, [
|
|
402
|
-
s("span", null, oe(e(a)("giftCard.title")), 1)
|
|
403
|
-
]),
|
|
404
|
-
s("div", Ye, [
|
|
405
|
-
M(s("div", Je, null, 512), [
|
|
406
|
-
[j, e(v)]
|
|
407
|
-
]),
|
|
408
|
-
M(s("div", null, [
|
|
409
|
-
s("p", {
|
|
410
|
-
id: "fresh-booking-gift-card-description",
|
|
411
|
-
innerHTML: e(a)("giftCard.description")
|
|
412
|
-
}, null, 8, Qe),
|
|
413
|
-
s("form", null, [
|
|
414
|
-
m(x, {
|
|
415
|
-
modelValue: e(l),
|
|
416
|
-
"onUpdate:modelValue": t[0] || (t[0] = (i) => B(l) ? l.value = i : null),
|
|
417
|
-
type: "text",
|
|
418
|
-
name: "name",
|
|
419
|
-
autocomplete: "name",
|
|
420
|
-
label: e(a)("giftCard.name"),
|
|
421
|
-
icon: "user-alt",
|
|
422
|
-
"icon-color": r.accentColor,
|
|
423
|
-
placeholder: e(a)("giftCard.namePlaceholder"),
|
|
424
|
-
required: ""
|
|
425
|
-
}, null, 8, ["modelValue", "label", "icon-color", "placeholder"]),
|
|
426
|
-
m(x, {
|
|
427
|
-
modelValue: e(S),
|
|
428
|
-
"onUpdate:modelValue": t[1] || (t[1] = (i) => B(S) ? S.value = i : null),
|
|
429
|
-
type: "email",
|
|
430
|
-
name: "email",
|
|
431
|
-
autocomplete: "email",
|
|
432
|
-
label: e(a)("giftCard.email"),
|
|
433
|
-
icon: "at",
|
|
434
|
-
"icon-color": r.accentColor,
|
|
435
|
-
placeholder: e(a)("giftCard.emailPlaceholder"),
|
|
436
|
-
required: ""
|
|
437
|
-
}, null, 8, ["modelValue", "label", "icon-color", "placeholder"]),
|
|
438
|
-
m(Re, {
|
|
439
|
-
modelValue: e(p),
|
|
440
|
-
"onUpdate:modelValue": t[2] || (t[2] = (i) => B(p) ? p.value = i : null),
|
|
441
|
-
icon: "phone-office",
|
|
442
|
-
"icon-color": r.accentColor,
|
|
443
|
-
label: e(a)("giftCard.phone"),
|
|
444
|
-
placeholder: e(a)("giftCard.phonePlaceholder"),
|
|
445
|
-
required: ""
|
|
446
|
-
}, null, 8, ["modelValue", "icon-color", "label", "placeholder"]),
|
|
447
|
-
e(E) ? C("", !0) : (u(), b("div", Ze, [
|
|
448
|
-
e(F) ? (u(), b("div", Xe, [
|
|
449
|
-
s("label", ea, [
|
|
450
|
-
s("span", null, oe(e(a)("giftCard.selectType")), 1)
|
|
451
|
-
]),
|
|
452
|
-
s("div", aa, [
|
|
453
|
-
s("ul", null, [
|
|
454
|
-
(u(!0), b(Ce, null, _e(e(F), (i, ee) => (u(), b("li", { key: ee }, [
|
|
455
|
-
m(ne, {
|
|
456
|
-
modelValue: e(n),
|
|
457
|
-
"onUpdate:modelValue": t[3] || (t[3] = (me) => B(n) ? n.value = me : null),
|
|
458
|
-
type: "radio",
|
|
459
|
-
name: "placeType",
|
|
460
|
-
val: ee,
|
|
461
|
-
label: i.label
|
|
462
|
-
}, null, 8, ["modelValue", "val", "label"])
|
|
463
|
-
]))), 128))
|
|
464
|
-
]),
|
|
465
|
-
e(F)[e(n)] && e(F)[e(n)].data.length > 1 ? (u(), L(Ie, {
|
|
466
|
-
key: 0,
|
|
467
|
-
modelValue: e(h),
|
|
468
|
-
"onUpdate:modelValue": t[4] || (t[4] = (i) => B(h) ? h.value = i : null),
|
|
469
|
-
placeholder: e(a)("giftCard.selectPlacePlaceholder"),
|
|
470
|
-
options: e(F)[e(n)].data,
|
|
471
|
-
labelKey: "name",
|
|
472
|
-
valueKey: "id",
|
|
473
|
-
required: ""
|
|
474
|
-
}, null, 8, ["modelValue", "placeholder", "options"])) : C("", !0)
|
|
475
|
-
])
|
|
476
|
-
])) : (u(), L(le, {
|
|
477
|
-
key: 1,
|
|
478
|
-
color: r.loadingColor
|
|
479
|
-
}, null, 8, ["color"]))
|
|
480
|
-
])),
|
|
481
|
-
m(x, {
|
|
482
|
-
modelValue: e(g),
|
|
483
|
-
"onUpdate:modelValue": t[5] || (t[5] = (i) => B(g) ? g.value = i : null),
|
|
484
|
-
type: "number",
|
|
485
|
-
name: "value",
|
|
486
|
-
label: e(a)("giftCard.value"),
|
|
487
|
-
icon: "money-bill",
|
|
488
|
-
"icon-color": r.accentColor,
|
|
489
|
-
placeholder: e(a)("giftCard.valuePlaceholder"),
|
|
490
|
-
suffix: e(K),
|
|
491
|
-
required: ""
|
|
492
|
-
}, null, 8, ["modelValue", "label", "icon-color", "placeholder", "suffix"]),
|
|
493
|
-
m(ne, {
|
|
494
|
-
modelValue: e(z),
|
|
495
|
-
"onUpdate:modelValue": t[6] || (t[6] = (i) => B(z) ? z.value = i : null),
|
|
496
|
-
type: "checkbox",
|
|
497
|
-
name: "showValue",
|
|
498
|
-
label: e(a)("giftCard.showValue"),
|
|
499
|
-
checked: e(z)
|
|
500
|
-
}, null, 8, ["modelValue", "label", "checked"]),
|
|
501
|
-
C("", !0),
|
|
502
|
-
C("", !0)
|
|
503
|
-
])
|
|
504
|
-
], 512), [
|
|
505
|
-
[j, e(d)]
|
|
506
|
-
]),
|
|
507
|
-
M(s("div", null, [
|
|
508
|
-
s("div", {
|
|
509
|
-
innerHTML: e(a)("giftCard.thankYou")
|
|
510
|
-
}, null, 8, oa)
|
|
511
|
-
], 512), [
|
|
512
|
-
[j, e(T)]
|
|
513
|
-
])
|
|
514
|
-
]),
|
|
515
|
-
r.layout !== "minimal" && e(d) ? (u(), b("div", la, [
|
|
516
|
-
s("div", ta, [
|
|
517
|
-
m(W, {
|
|
518
|
-
label: e(a)("giftCard.orderGiftCard"),
|
|
519
|
-
style: te({
|
|
520
|
-
background: r.successColor
|
|
521
|
-
}),
|
|
522
|
-
"full-width": !0,
|
|
523
|
-
disabled: !e(w),
|
|
524
|
-
"is-loading": e(V),
|
|
525
|
-
"onUpdate:isLoading": t[9] || (t[9] = (i) => B(V) ? V.value = i : null),
|
|
526
|
-
onClickEvent: H
|
|
527
|
-
}, null, 8, ["label", "style", "disabled", "is-loading"])
|
|
528
|
-
])
|
|
529
|
-
])) : C("", !0),
|
|
530
|
-
e(d) ? (u(), b("div", na, [
|
|
531
|
-
m(x, {
|
|
532
|
-
modelValue: e(_),
|
|
533
|
-
"onUpdate:modelValue": t[10] || (t[10] = (i) => B(_) ? _.value = i : null),
|
|
534
|
-
type: "textarea",
|
|
535
|
-
name: "remark",
|
|
536
|
-
label: e(a)("giftCard.remark"),
|
|
537
|
-
icon: "info-circle",
|
|
538
|
-
"icon-color": r.accentColor,
|
|
539
|
-
placeholder: e(a)("giftCard.remarkPlaceholder")
|
|
540
|
-
}, null, 8, ["modelValue", "label", "icon-color", "placeholder"])
|
|
541
|
-
])) : C("", !0),
|
|
542
|
-
e(d) ? M((u(), b("div", ra, [
|
|
543
|
-
m(W, {
|
|
544
|
-
label: e(a)("giftCard.orderGiftCard"),
|
|
545
|
-
style: te({
|
|
546
|
-
background: r.successColor
|
|
547
|
-
}),
|
|
548
|
-
"full-width": !0,
|
|
549
|
-
disabled: !e(w),
|
|
550
|
-
"data-test": "orderGiftCard",
|
|
551
|
-
"is-loading": e(V),
|
|
552
|
-
"onUpdate:isLoading": t[11] || (t[11] = (i) => B(V) ? V.value = i : null),
|
|
553
|
-
onClickEvent: H
|
|
554
|
-
}, null, 8, ["label", "style", "disabled", "is-loading"]),
|
|
555
|
-
M(s("div", ia, [
|
|
556
|
-
m($e)
|
|
557
|
-
], 512), [
|
|
558
|
-
[j, e(N)]
|
|
559
|
-
])
|
|
560
|
-
])), [
|
|
561
|
-
[q]
|
|
562
|
-
]) : C("", !0)
|
|
563
|
-
])) : (u(), L(le, { key: 1 }))
|
|
564
|
-
]),
|
|
565
|
-
_: 1
|
|
566
|
-
}, 8, ["access-token", "data-layout"])
|
|
567
|
-
]),
|
|
568
|
-
fallback: O(() => [
|
|
569
|
-
sa
|
|
570
|
-
]),
|
|
571
|
-
_: 1
|
|
572
|
-
});
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
|
-
const ua = /* @__PURE__ */ Se(da, [["__scopeId", "data-v-259a8073"]]), ca = ze(), D = Te({ components: { GiftCard: ua } });
|
|
577
|
-
D.use(ca);
|
|
578
|
-
D.use(we);
|
|
579
|
-
D.use(Ue);
|
|
580
|
-
D.use(Ee, { bootstrap: !1 });
|
|
581
|
-
D.mount("#fresh-booking-gift-card-app");
|
|
582
|
-
export {
|
|
583
|
-
D as default
|
|
584
|
-
};
|
package/dist/gift-card.es.js.br
DELETED
|
Binary file
|