favesalon-embed 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/custom-elements/index.d.ts +36 -0
  2. package/dist/favesalon-embed/{_commonjsHelpers-a4f66ccd.js → _commonjsHelpers-9bc404fc.js} +1 -1
  3. package/dist/favesalon-embed/activate-form.entry.js +10 -3
  4. package/dist/favesalon-embed/buy-giftcard-form.entry.js +998 -0
  5. package/dist/favesalon-embed/buy-giftcard-verification.entry.js +153 -0
  6. package/dist/favesalon-embed/change-password-form.entry.js +10 -3
  7. package/dist/favesalon-embed/chat-box.entry.js +2 -2
  8. package/dist/favesalon-embed/chat-button.entry.js +2 -2
  9. package/dist/favesalon-embed/chat-form.entry.js +2 -2
  10. package/dist/favesalon-embed/chat-messages.entry.js +4 -4
  11. package/dist/favesalon-embed/chat-rooms.entry.js +3 -3
  12. package/dist/favesalon-embed/credit-card-types.entry.js +16 -0
  13. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -1
  14. package/dist/favesalon-embed/{index-00b83e1c.js → index-ac52896a.js} +1 -1
  15. package/dist/favesalon-embed/{lodash-d5526b38.js → lodash-b4fe554a.js} +1 -1
  16. package/dist/favesalon-embed/login-form.entry.js +2 -2
  17. package/dist/favesalon-embed/powered-by-favesalon.entry.js +16 -0
  18. package/dist/favesalon-embed/register-form.entry.js +10 -4
  19. package/dist/favesalon-embed/{relativeTime-268e64b0.js → relativeTime-15477f02.js} +1 -1
  20. package/dist/favesalon-embed/reset-password-form.entry.js +10 -3
  21. package/dist/favesalon-embed/salon-booking.entry.js +2 -2
  22. package/dist/favesalon-embed/salon-gift-card.entry.js +2 -2
  23. package/dist/favesalon-embed/salon-info.entry.js +2 -2
  24. package/dist/favesalon-embed/salon-latest-reviews.entry.js +2 -2
  25. package/dist/favesalon-embed/salon-latest-styles.entry.js +2 -2
  26. package/dist/favesalon-embed/salon-locations.entry.js +2 -2
  27. package/dist/favesalon-embed/salon-lookbook.entry.js +2 -2
  28. package/dist/favesalon-embed/salon-reviews.entry.js +2 -2
  29. package/dist/favesalon-embed/salon-schedules.entry.js +2 -2
  30. package/dist/favesalon-embed/salon-services.entry.js +2 -2
  31. package/dist/favesalon-embed/salon-stylists.entry.js +2 -2
  32. package/dist/favesalon-embed/services-3dd9f820.js +24104 -0
  33. package/dist/favesalon-embed/services-45c0e274.js +24122 -0
  34. package/dist/favesalon-embed/{services-ece4767f.js → services-65861516.js} +333 -167
  35. package/dist/favesalon-embed/services-935ba09f.js +24118 -0
  36. package/dist/favesalon-embed/services-9a686ade.js +24122 -0
  37. package/dist/favesalon-embed/services-baa3f112.js +24123 -0
  38. package/dist/favesalon-embed/style-detail.entry.js +3 -3
  39. package/dist/favesalon-embed/wizard-existing-user.entry.js +146 -0
  40. package/dist/favesalon-embed/wizard-new-user.entry.js +178 -0
  41. package/dist/types/components/buy-giftcard-form/buy-giftcard-form.d.ts +56 -0
  42. package/dist/types/components/buy-giftcard-verification/buy-giftcard-verification.d.ts +21 -0
  43. package/dist/types/components/credit-card-types/credit-card-types.d.ts +4 -0
  44. package/dist/types/components/powered-by-favesalon/powered-by-favesalon.d.ts +4 -0
  45. package/dist/types/components/wizard-existing-user/wizard-existing-user.d.ts +19 -0
  46. package/dist/types/components/wizard-new-user/wizard-new-user.d.ts +23 -0
  47. package/dist/types/components.d.ts +108 -0
  48. package/dist/types/services/services.d.ts +55 -0
  49. package/dist/types/types/giftcard.d.ts +13 -0
  50. package/dist/types/types/salon.d.ts +1 -0
  51. package/package.json +3 -1
@@ -0,0 +1,998 @@
1
+ import { r as registerInstance, h } from './index-888e99e3.js';
2
+ import { _ as _root, i as isSymbol_1, a as isObject_1, H as HttpService, d as dayjs_min, b as dateFormat, g as get_1, s as shortDateFormat, c as getSalonImage, e as getSalonAddress } from './services-9a686ade.js';
3
+ import { c as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-9bc404fc.js';
4
+ import { C as Colors } from './colors-ea36347a.js';
5
+
6
+ var teConnect = createCommonjsModule(function (module, exports) {
7
+ !function(e,t){"object"=='object'&&"object"=='object'?module.exports=t():"function"==typeof undefined&&undefined.amd?undefined([],t):"object"=='object'?exports["te-connect"]=t():e["te-connect"]=t();}(self,(()=>(()=>{var t={506:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};},926:e=>{function t(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value;}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o);}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,a){var i=e.apply(n,r);function s(e){t(i,o,a,s,c,"next",e);}function c(e){t(i,o,a,s,c,"throw",e);}s(void 0);}))}};},575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};},226:e=>{e.exports=function(e,t){var n=t.get(e);if(!n)throw new TypeError("attempted to get private field on non-instance");return n.get?n.get.call(e):n.value};},962:e=>{e.exports=function(e,t,n){var r=t.get(e);if(!r)throw new TypeError("attempted to set private field on non-instance");if(r.set)r.set.call(e,n);else {if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=n;}return n};},913:e=>{function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e};},713:e=>{e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};},754:e=>{function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t;},205:(e,t,n)=>{var r=n(489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t);};},479:(e,t,n)=>{var r=n(316);e.exports=function(e,t){if(null==e)return {};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);}return a};},316:e=>{e.exports=function(e,t){if(null==e)return {};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o};},585:(e,t,n)=>{var r=n(8),o=n(506);e.exports=function(e,t){return !t||"object"!==r(t)&&"function"!=typeof t?o(e):t};},489:e=>{function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t;},8:e=>{function t(n){return "function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t;},553:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"");}catch(e){c=function(e,t,n){return e[t]=n};}function u(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),i=new j(r||[]);return a._invoke=function(e,t,n){var r=p;return function(o,a){if(r===y)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw a;return S()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=M(i,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=d,n.arg;n.dispatchException(n.arg);}else "return"===n.method&&n.abrupt("return",n.arg);r=y;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?d:f,c.arg===h)continue;return {value:c.arg,done:n.done}}"throw"===c.type&&(r=d,n.method="throw",n.arg=c.arg);}}}(e,n,i),a}function l(e,t,n){try{return {type:"normal",arg:e.call(t,n)}}catch(e){return {type:"throw",arg:e}}}e.wrap=u;var p="suspendedStart",f="suspendedYield",y="executing",d="completed",h={};function m(){}function v(){}function g(){}var w={};w[a]=function(){return this};var b=Object.getPrototypeOf,P=b&&b(b(R([])));P&&P!==n&&r.call(P,a)&&(w=P);var E=g.prototype=m.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}));}));}function C(e,t){function n(o,a,i,s){var c=l(e[o],e,a);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,i,s);}),(function(e){n("throw",e,i,s);})):t.resolve(p).then((function(e){u.value=e,i(u);}),(function(e){return n("throw",e,i,s)}))}s(c.arg);}var o;this._invoke=function(e,r){function a(){return new t((function(t,o){n(e,r,t,o);}))}return o=o?o.then(a,a):a()};}function M(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method");}return h}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t);}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t;}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0);}function R(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return {next:S}}function S(){return {value:t,done:!0}}return v.prototype=E.constructor=g,g.constructor=v,v.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return !!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return {__await:e}},k(C.prototype),C.prototype[i]=function(){return this},e.AsyncIterator=C,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(E),c(E,s,"Generator"),E[a]=function(){return this},E.toString=function(){return "[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=R,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t);},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else {if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return "break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n);}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t;}catch(e){Function("r","regeneratorRuntime = r")(t);}},757:(e,t,n)=>{e.exports=n(553);}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]});},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});};var o={};return (()=>{"use strict";r.r(o),r.d(o,{createTEConnect:()=>$e});var t=r(479),n=r.n(t),a=r(926),i=r.n(a),s=r(757),c=r.n(s),u="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),l=new Uint8Array(16);function p(){if(!u)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return u(l)}const f=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,y=function(e){return "string"==typeof e&&f.test(e)};for(var d=[],h=0;h<256;++h)d.push((h+256).toString(16).substr(1));const m=function(e,t,n){var r=(e=e||{}).random||(e.rng||p)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(d[e[t+0]]+d[e[t+1]]+d[e[t+2]]+d[e[t+3]]+"-"+d[e[t+4]]+d[e[t+5]]+"-"+d[e[t+6]]+d[e[t+7]]+"-"+d[e[t+8]]+d[e[t+9]]+"-"+d[e[t+10]]+d[e[t+11]]+d[e[t+12]]+d[e[t+13]]+d[e[t+14]]+d[e[t+15]]).toLowerCase();if(!y(n))throw TypeError("Stringified UUID is invalid");return n}(r)};var v="https://svc4.magensa.net",g="".concat(v,"/TEConnect"),w="_tec-payment-evt-ele",b="hideZip",P="tecPaymentRequest",E={passive:!0},k=["total","currencyCode","countryCode","merchantCapabilities","supportedNetworks","storeDisplayName"],C=["allowedCardNetworks","transactionInfo","merchantName","gatewayId"],M=["apiVersion","apiVersionMinor","callbackIntents","offerInfo","emailRequired","shippingAddressRequired","shippingAddressParameters","shippingOptionRequired","shippingOptionParameters"],L=[].concat(M,["allowedPaymentMethods","existingPaymentMethodRequired","environment","paymentDataCallbacks","prefetchGooglePaymentData"]),O=["appleMerchantId","googleMerchantId"],j=["buttonColor","buttonType","buttonLocale","buttonSizeMode","buttonRootNode"],R="tec-payment-request-complete",S="tec-payment-method-selected",x="tec-payment-request-cancel",I="tec-payment-shipping-contact",T="tec-payment-shipping-method",_={baseRequest:{apiVersion:2,apiVersionMinor:0},allowedCardAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],baseCardPaymentMethod:{type:"CARD",parameters:{allowedAuthMethods:null,allowedCardNetworks:null}},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:null},merchantInfo:null,transactionInfo:null,environment:"TEST"},q=r(713),A=r.n(q),N=r(8),D=r.n(N),U="'te-connect' is designed for use within web applications.",F="DOM element provided is not the expected node.",G="Unable to recognize provided node",W="Node info object provided is not in recognized format.",z="Response from server has been altered. Refused response, please try again",V="Timeout: Response not received from TEConnect",B="'instanceDetails' object supplied to 'createPaymentToken' function is missing a required property:",Y="to the 'listenFor' function",K="Please supply a Payment Request object",J="Failed to locate TecPR event element. Please make sure TEConnect Payment Request button is mounted, and TEConnect elements are unaltered on the DOM.";function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r);}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){A()(e,t,n[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t));}));}return e}function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return "Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return {s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return {s:function(){n=n.call(e);},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e;},f:function(){try{i||null==n.return||n.return();}finally{if(s)throw a}}}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var X=function(e){return "string"==typeof e&&""!==e},ee=function(e,t){return e?"string"!=typeof e.nodeName?new Error(G):"IFRAME"!==e.nodeName?new Error(F):!0!==t?te(e,"__teConnectSecureFrame","__te-connect-secure-window"):te(e,"__tecPrFrameName","__tec-pr-window"):new Error(G)},te=function(e,t,n){var r=e.name,o=e.id;return "string"==typeof r&&"string"==typeof o&&r===t&&o===n||new Error(F)},ne=function(e){return e?y(e)?void 0:new Error("formId is not valid"):new Error("formId not found")},re=function(e){if(!e)return {error:"Node info object not provided in 'createPayment' call."};if("object"!==D()(e))return {error:W};if(void 0===e.elements||void 0===e.formId)return {error:W};var t=ee(e.elements);if(t instanceof Error)return {error:t.message};var n=ne(e.formId);return n instanceof Error?{error:n.message}:e},oe=function(e){if("object"!==D()(e)||null===e)return {error:"'createPaymentToken' function requires an 'instanceDetails' object as a parameter"};var t=e.instanceId,n=e.formId,r=e.controllerRef;if(!X(t))return {error:"".concat(B," 'instanceId'")};if(!X(n))return {error:"".concat(B," 'formId'")};var o=ne(n);if(o instanceof Error)return {error:o.message};var a=ee(r,!0);return a instanceof Error?{error:a.message}:e},ae=function(e,t){if("object"!==D()(e))throw new Error(K);var n,r=H(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(void 0===e[o])throw new Error("'".concat(o,"' is a required property for a Payment Request object, but was found to be 'undefined'"))}}catch(e){r.e(e);}finally{r.f();}},ie=function(e,t){var n=_;n.merchantInfo={merchantName:e.merchantName,merchantId:t},n.baseCardPaymentMethod.parameters={allowedAuthMethods:e.allowedAuthMethods||n.allowedCardAuthMethods,allowedCardNetworks:e.allowedCardNetworks},n.transactionInfo=e.transactionInfo,n.tokenizationSpecification.parameters={gateway:"magensa",gatewayMerchantId:e.gatewayId};var r,o=H(L);try{for(o.s();!(r=o.n()).done;){var a=r.value;void 0!==e[a]&&(n[a]=e[a]);}}catch(e){o.e(e);}finally{o.f();}return n},se=function(e){var t=e.baseCardPaymentMethod,n=e.tokenizationSpecification,r=e.allowedPaymentMethods,o=[$($({},t),{},{tokenizationSpecification:n})];if(r&&r.length>0){var a,i=H(r);try{for(i.s();!(a=i.n()).done;){var s=a.value;o.push($($({},s),{},{tokenizationSpecification:n}));}}catch(e){i.e(e);}finally{i.f();}}return o},ce=function(e){var t,n=e.baseRequest,r=e.merchantInfo,o=e.transactionInfo,a=$($({},n),{},{allowedPaymentMethods:se(e),transactionInfo:o,merchantInfo:r}),i=H(M);try{for(i.s();!(t=i.n()).done;){var s=t.value;void 0!==e[s]&&(a[s]=e[s]);}}catch(e){i.e(e);}finally{i.f();}return a},ue=function(e,t){if("object"!==D()(e))throw new Error(K);var n={},r=t.appleMerchantId,o=t.googleMerchantId;return r&&(e.applePay?(ae(e.applePay,k),n.applePay=e.applePay):(ae(e,k),n.applePay=e)),o&&(e.googlePay?(ae(e.googlePay,C),n.googlePay=ie(e.googlePay,o)):(ae(e,C),n.googlePay=ie(e,o))),n},le=function(e){if(e){var t=e.closest("div");if(t)return t;var n=document.getElementsByClassName(w);if(n&&n.length>0)return n[0]}throw new Error(J)},pe=function(e){return function(t,n){var r=new CustomEvent(t,{detail:n});e.dispatchEvent(r);}},fe=function(e){if(e&&"object"===D()(e)){var t=e.errorType;if("string"==typeof t)switch(t){case"failure":return {error:"unknown",message:e.message};case"addressInvalid":return {error:"addressUnserviceable",message:e.message};default:return}}return {error:"unknown",message:""}},ye=function(e){var t,n=[],r=H(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o instanceof window.ApplePayError)n.push(o);else {var a=fe(o);void 0!==a&&n.push(new window.ApplePayError(a.error,"countryCode",a.message));}}}catch(o){r.e(o);}finally{r.f();}return n},de=function(e){if(e){if("string"==typeof e)return {status:"success"===e.toLowerCase()?ApplePaySession.STATUS_SUCCESS:ApplePaySession.STATUS_FAILURE};if(e&&"number"==typeof e.status){if(e.errors&&e.errors.length>0){var t=ye(e.errors);e.errors=t;}return e}}return console.error("[Token Exchange Connect Error]: Unrecognized completion result. Completing payment with failure."),{status:ApplePaySession.STATUS_FAILURE}},he=r(913),me=r.n(he),ve=r(575),ge=r.n(ve),we=r(506),be=r.n(we),Pe=r(205),Ee=r.n(Pe),ke=r(585),Ce=r.n(ke),Me=r(754),Le=r.n(Me),Oe=r(962),je=r.n(Oe),Re=r(226),Se=r.n(Re);function xe(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n);}var Ie=new WeakMap,Te=new WeakMap,_e=new WeakMap,qe=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,De=new WeakMap,Ue=new WeakMap,Fe=new WeakMap,Ge=new WeakMap,We=function(){function e(t,n){var r=this;ge()(this,e),xe(this,Ie,{writable:!0,value:void 0}),xe(this,Te,{writable:!0,value:void 0}),xe(this,_e,{writable:!0,value:void 0}),xe(this,qe,{writable:!0,value:void 0}),xe(this,Ae,{writable:!0,value:void 0}),xe(this,Ne,{writable:!0,value:void 0}),xe(this,De,{writable:!0,value:void 0}),xe(this,Ue,{writable:!0,value:void 0}),xe(this,Fe,{writable:!0,value:void 0}),xe(this,Ge,{writable:!0,value:void 0}),A()(this,"getGooglePayCanMakePayments",(function(e){!function(e){var t=document.getElementById("_google-pay-api");if(t)t.removeEventListener("load",e,E),t.addEventListener("load",e,E);else {var n=document.createElement("script");n.src="https://pay.google.com/gp/p/js/pay.js",n.async=!0,n.id="_google-pay-api",n.addEventListener("load",e,E),document.body.appendChild(n);}}((function(){if(!window.google)throw new Error("Google Pay API was loaded, but `window.google` is unavailable");var t,n,o;r.googlePayClient||(r.googlePayClient=new google.payments.api.PaymentsClient((o={environment:(t=e).environment,merchantInfo:t.merchantInfo},(n=t.paymentDataCallbacks)&&(o.paymentDataCallbacks=n),o))),r.googlePayClient.isReadyToPay(function(e){var t=e.baseRequest,n=e.baseCardPaymentMethod,r=e.allowedPaymentMethods,o=e.existingPaymentMethodRequired,a=[n];if(r&&r.length>0){var i,s=H(r);try{for(s.s();!(i=s.n()).done;){var c=i.value;a.push(c);}}catch(e){s.e(e);}finally{s.f();}}var u=$($({},t),{},{allowedPaymentMethods:a});return !0===o&&(u.existingPaymentMethodRequired=o),u}(e)).then((function(e){r.googleCanMakePaymentsResult=void 0!==e.paymentMethodPresent?e:e.result;})).catch((function(e){console.error(e),r.googleCanMakePaymentsResult=!1;}));}));})),A()(this,"applePayCanMakePayments",(function(e){window.ApplePaySession&&window.ApplePaySession.canMakePayments()?ApplePaySession.canMakePaymentsWithActiveCard(e).then((function(e){r.appleCanMakePaymentsResult=e;})).catch((function(e){console.error(e),r.appleCanMakePaymentsResult=!1;})):r.appleCanMakePaymentsResult=!1;})),je()(this,Ie,t),je()(this,Te,n);var o=n.appleMerchantId;n.googleMerchantId&&this.getGooglePayCanMakePayments(t.googlePay),o&&this.applePayCanMakePayments(o);}return me()(e,[{key:"paymentRequestObj",get:function(){return Se()(this,Ie)},set:function(e){je()(this,Ie,e);}},{key:"paymentRequestIds",get:function(){return Se()(this,Te)},set:function(e){je()(this,Te,e);}},{key:"googlePayClient",get:function(){return Se()(this,_e)},set:function(e){je()(this,_e,e);}},{key:"customerPaymentListener",get:function(){return Se()(this,qe)},set:function(e){je()(this,qe,e);}},{key:"customerCancelListener",get:function(){return Se()(this,Ae)},set:function(e){je()(this,Ae,e);}},{key:"paymentMethodListener",get:function(){return Se()(this,Ne)},set:function(e){je()(this,Ne,e);}},{key:"shippingContactListener",get:function(){return Se()(this,De)},set:function(e){je()(this,De,e);}},{key:"shippingMethodListener",get:function(){return Se()(this,Ue)},set:function(e){je()(this,Ue,e);}},{key:"googleCanMakePaymentsResult",get:function(){return Se()(this,Fe)},set:function(e){je()(this,Fe,e);}},{key:"appleCanMakePaymentsResult",get:function(){return Se()(this,Ge)},set:function(e){je()(this,Ge,e);}}]),e}(),ze=["tokenizationData"];function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r);}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){A()(e,t,n[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t));}));}return e}var Ye=function(t){Ee()(s,t);var r,o,a=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return !1}}(),function(){var e,t=Le()(r);if(o){var n=Le()(this).constructor;e=Reflect.construct(t,arguments,n);}else e=t.apply(this,arguments);return Ce()(this,e)});function s(t,r){var o;return ge()(this,s),o=a.call(this,t,r),A()(be()(o),"updatePaymentRequest",(function(e){var t=ue(e,o.paymentRequestIds);o.paymentRequestObj=t;})),A()(be()(o),"appleCanMakePayments",(function(){return new Promise((function(e){if("boolean"==typeof o.appleCanMakePaymentsResult)return e({applePay:o.appleCanMakePaymentsResult});var t=setTimeout((function(){void 0===o.appleCanMakePaymentsResult&&(o.appleCanMakePaymentsResult=!1);}),2e4);return e(function e(n){return new Promise((function(n){if("boolean"==typeof o.appleCanMakePaymentsResult)return clearTimeout(t),n({applePay:o.appleCanMakePaymentsResult});setTimeout((function(){return n(e())}),200);}))}())}))})),A()(be()(o),"googleCanMakePayments",(function(){return new Promise((function(e){if(void 0!==o.googleCanMakePaymentsResult)return e({googlePay:o.googleCanMakePaymentsResult});var t=setTimeout((function(){void 0===o.googleCanMakePaymentsResult&&(o.googleCanMakePaymentsResult=!1);}),2e4);return e(function e(n){return new Promise((function(n){void 0!==o.googleCanMakePaymentsResult?(clearTimeout(t),n({googlePay:o.googleCanMakePaymentsResult})):setTimeout((function(){return n(e())}),200);}))}())}))})),A()(be()(o),"canMakePayments",(function(e){return new Promise((function(e){var t=o.paymentRequestIds,n=t.appleMerchantId,r=t.googleMerchantId;if(n&&r){var a={};return o.appleCanMakePayments().then((function(e){return Object.assign(a,e)})).then((function(t){return o.googleCanMakePayments().then((function(n){return Object.assign(a,n),e(!1===t.applePay&&!1===n.googlePay?null:a)}))}))}return n?o.appleCanMakePayments().then((function(t){return e(!1===t.applePay?null:t)})):r?o.googleCanMakePayments().then((function(t){return e(!1===t.googlePay?null:t)})):void 0}))})),A()(be()(o),"listenFor",(function(t,n){var r=function(e,t){if("function"!=typeof t)throw new Error("Please supply a function as the listener argument ".concat(Y));if("string"!=typeof e)throw new Error("Please specify the event ".concat(Y));return {eventToLower:e.toLowerCase(),suppliedListener:t}}(t,n),a=r.eventToLower,i=r.suppliedListener,s=function(t){var n=t.detail;return n?i(n):e};switch(a){case"confirm-token":o.customerPaymentListener=s;break;case"cancel-transaction":o.customerCancelListener=s;break;case"payment-method-selection":o.paymentMethodListener=s;break;case"shipping-contact-update":o.shippingContactListener=s;break;case"shipping-method-update":o.shippingMethodListener=s;break;default:return}})),A()(be()(o),"createPaymentRequestToken",function(){var e=i()(c().mark((function e(t){var n,r,a,i,s,u,l,p,f,y,d,h,w,b,P,k,C;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.paymentRequestObj.applePay&&"number"==typeof o.paymentRequestObj.applePay.applePayVersion?o.paymentRequestObj.applePay.applePayVersion:3,r=new ApplePaySession(n,o.paymentRequestObj.applePay),a=o.paymentRequestObj.applePay.storeDisplayName,i=oe(t),s=i.instanceId,u=i.formId,l=i.controllerRef,p=i.error,f=le(l),y=pe(f),!p){e.next=8;break}return e.abrupt("return",y(R,{error:p}));case 8:return d=o.paymentRequestIds.appleMerchantId,h=m(),w=null,b=null,P=function(e){var t=e.validationURL;X(t)&&l.contentWindow.postMessage(JSON.stringify({type:"_create_payment_request_session",vUrl:t,iid:s,sessionSignature:h,prFormId:u,storeDisplayName:a,appleMerchantId:d}),g);},r.onvalidatemerchant=P,"function"==typeof o.customerCancelListener&&(f.removeEventListener(x,o.customerCancelListener,E),f.addEventListener(x,o.customerCancelListener,E)),r.oncancel=function(e){var t=e.sessionError;y(x,{sessionError:t}),f.removeEventListener(S,o.paymentMethodListener,E),f.removeEventListener(I,o.shippingContactListener,E),f.removeEventListener(T,o.shippingMethodListener,E),f.removeEventListener(x,o.customerCancelListener,E);},"function"==typeof o.paymentMethodListener&&(f.removeEventListener(S,o.paymentMethodListener,E),f.addEventListener(S,o.paymentMethodListener,E),r.onpaymentmethodselected=function(e){var t=e.paymentMethod;y(S,{paymentMethod:t,completePaymentMethodSelection:function(e){r.completePaymentMethodSelection(e);}});}),"function"==typeof o.shippingContactListener&&(f.removeEventListener(I,o.shippingContactListener,E),f.addEventListener(I,o.shippingContactListener,E),r.onshippingcontactselected=function(e){var t=e.shippingContact;y(I,{shippingContact:t,completeShippingContactSelection:function(e){if(!e)throw new Error("Please provide a 'shippingContactUpdate' object");if(e.errors&&e.errors.length>0){var t=e.errors,n=ye(t);e.errors=n;}r.completeShippingContactSelection(e);}});}),"function"==typeof o.shippingMethodListener&&(f.removeEventListener(T,o.shippingMethodListener,E),f.addEventListener(T,o.shippingMethodListener,E),r.onshippingmethodselected=function(e){var t=e.shippingMethod;y(T,{shippingMethod:t,completeShippingMethodSelection:function(e){r.completeShippingMethodSelection(e);}});}),k=function e(t){if(v===t.origin){var n=t.data;if(X(n)){var a=JSON.parse(n),i=a.type,c=a.sessionNonce,u=a.sessionObj,l=a.iid,p=a.error;if("_payment-requests-session-resp"===i&&l===s){if(c===h){if(clearTimeout(b),p&&(w={error:p},window.removeEventListener("message",e,E),"function"==typeof r.abort))return r.abort();r.completeMerchantValidation(u),r.onpaymentauthorized=function(e){f.removeEventListener(R,o.customerPaymentListener,E),f.addEventListener(R,o.customerPaymentListener,E),w={tokenDetails:{type:"applePay",token:e.payment.token},completePayment:function(e){var t=de(e);r.completePayment(t),f.removeEventListener(R,o.customerPaymentListener,E);}},f.removeEventListener(x,o.customerCancelListener,E),f.removeEventListener(S,o.paymentMethodListener,E),f.removeEventListener(I,o.shippingContactListener,E),f.removeEventListener(T,o.shippingMethodListener,E);};}else w={error:z};window.removeEventListener("message",e,E);}}}},b=setTimeout((function(){w||(w={error:V},window.removeEventListener("message",k,E));}),61e3),window.addEventListener("message",k,E),C=function e(t){return new Promise((function(t){return w?t(y(R,w)):setTimeout((function(){return t(e())}),400)}))},r.begin(),e.next=27,C();case 27:return e.abrupt("return",e.sent);case 28:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),A()(be()(o),"mountGoogleButton",(function(e,t){var r=t.eventRef,a=t.googlePayOptions,i=function(e){if(e&&e.className===w)return e;throw new Error(J)}(r),s=pe(i),c=document.getElementById(e);if(!c)throw new Error("Could not locate specified node. Please ensure the node is present on the DOM, and the id supplied is accurate and unique.");if(o.googlePayClient){var u=function(){return i.removeEventListener(R,o.customerPaymentListener,E),i.addEventListener(R,o.customerPaymentListener,E),o.googlePayClient.loadPaymentData(ce(o.paymentRequestObj.googlePay)).then((function(e){if(e&&e.paymentMethodData){var t=e.paymentMethodData,r=t.tokenizationData,a=n()(t,ze);"object"===D()(r)&&(s(R,{tokenDetails:{type:"googlePay",token:r.token,additionalData:Be(Be({},a),{},{tokenizationDataType:r.type})}}),i.removeEventListener(R,o.customerPaymentListener,E));}})).catch((function(e){s(R,{error:e.message||e.statusCode}),console.error(e),i.removeEventListener(R,o.customerPaymentListener,E);}))},l={allowedPaymentMethods:se(o.paymentRequestObj.googlePay)};if(a){var p=function(e){var t,n={},r=H(j);try{for(r.s();!(t=r.n()).done;){var o=t.value;e[o]&&(n[o]=e[o]);}}catch(e){r.e(e);}finally{r.f();}return n}(a);"function"==typeof a.preClick?l.onClick=function(){return a.preClick(),u()}:l.onClick=u,Object.assign(l,p);}else l.onClick=u;var f=o.googlePayClient.createButton(l);if(c.appendChild(f),!0===o.paymentRequestObj.googlePay.prefetchGooglePaymentData){var y=ce(o.paymentRequestObj.googlePay),d=y.transactionInfo&&y.transactionInfo.currencyCode||"USD";y.transactionInfo={totalPriceStatus:"NOT_CURRENTLY_KNOWN",currencyCode:d},o.googlePayClient.prefetchPaymentData();}}})),o}return me()(s)}(We);const Ke=Ye;var Je=me()((function e(t,n){ge()(this,e);var r=new Ke(t,n);this.createPaymentRequestToken=r.createPaymentRequestToken,this.canMakePayments=r.canMakePayments,this.listenFor=r.listenFor,this.updatePaymentRequest=r.updatePaymentRequest,this.mountGoogleButton=r.mountGoogleButton;})),Ze=["nonce","type"],$e=function(e,t){var r=function(e){var t={};if("object"===D()(e)){"boolean"==typeof e[b]&&(t[b]=e[b]);var n=e[P];if(n&&"object"===D()(n)){var r,o={},a=H(O);try{for(a.s();!(r=a.n()).done;){var i=r.value,s=n[i];X(s)&&(o[i]="".concat(s));}}catch(e){a.e(e);}finally{a.f();}var c=function(e){var t,n=0,r=H(O);try{for(r.s();!(t=r.n()).done;){var o=e[t.value];X(o)&&n++;}}catch(e){r.e(e);}finally{r.f();}if(0===n)throw new Error("'tecPaymentRequest' object was supplied, but was found to be empty. Please supply the id(s) for the desired payment request platform(s).");return e}(o);t[P]=c;}}return t}(t),o=r.hideZip,a=r.tecPaymentRequest,s=function(e){if(!e)throw new Error("".concat("Please provide a"," public key (pubKey) ").concat("to the 'createTEConnect' function"));if("string"!=typeof e)throw new Error("'pubKey' should be a string, but was found to be ".concat(D()(e)));return e}(e),u=m(),l=function(){if(!window)throw new Error("Unable to locate Window Interface. ".concat(U));if(!window.location)throw new Error("Unable to read 'location' property of Window Interface. ".concat(U));var e=window.location.origin;if(e)return e;throw new Error("Unable to read client's origin. ".concat(U))}(),p={};p.requestClient={instanceId:u,pubKey:s,requestOrigin:l};var f="".concat(g,"/?instanceId=").concat(u,"&pubKey=").concat(s,"&requestOrigin=").concat(btoa(l));return p.frameUrl="".concat(f,"&hideZip=").concat(!0===o?"true":"false"),a&&(p.prFrameUrl="".concat(f,"&enableTecPR=true"),p.paymentsRequestInterface=function(e){return function(t){var n=ue(t,e);return new Je(n,e)}}(a)),p.createPayment=function(){var e=i()(c().mark((function e(t,r){var o,a,i,s,u,l,p,f,y;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=re(t),a=o.elements,i=o.formId,!(s=o.error)){e.next=3;break}return e.abrupt("return",{error:s});case 3:return u=m(),l=null,p=null,f=function e(t){if(t.origin===v){var r=JSON.parse(t.data);if(r&&"token_exchange_response"===r.type){if(clearTimeout(p),void 0!==r.nonce){var o=r.nonce,a=(r.type,n()(r,Ze));l=o===u?a:{error:z};}else l=void 0!==r.error?{error:r.error}:{error:z};window.removeEventListener("message",e,E);}}},p=setTimeout((function(){l||(l={error:V},window.removeEventListener("message",f,E));}),61e3),window.addEventListener("message",f,E),a.contentWindow.postMessage(JSON.stringify({type:"create_card_payment",formId:i,nonce:u,billingZip:r||null}),g),y=function e(t){return new Promise((function(t){return l?t(l):setTimeout((function(){return t(e())}),400)}))},e.next=14,y();case 14:return e.abrupt("return",e.sent);case 15:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),p};})(),o})()));
8
+ });
9
+
10
+ const teConnect$1 = /*@__PURE__*/getDefaultExportFromCjs(teConnect);
11
+
12
+ /**
13
+ * Gets the timestamp of the number of milliseconds that have elapsed since
14
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
15
+ *
16
+ * @static
17
+ * @memberOf _
18
+ * @since 2.4.0
19
+ * @category Date
20
+ * @returns {number} Returns the timestamp.
21
+ * @example
22
+ *
23
+ * _.defer(function(stamp) {
24
+ * console.log(_.now() - stamp);
25
+ * }, _.now());
26
+ * // => Logs the number of milliseconds it took for the deferred invocation.
27
+ */
28
+ var now = function() {
29
+ return _root.Date.now();
30
+ };
31
+
32
+ var now_1 = now;
33
+
34
+ /** Used to match a single whitespace character. */
35
+ var reWhitespace = /\s/;
36
+
37
+ /**
38
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
39
+ * character of `string`.
40
+ *
41
+ * @private
42
+ * @param {string} string The string to inspect.
43
+ * @returns {number} Returns the index of the last non-whitespace character.
44
+ */
45
+ function trimmedEndIndex(string) {
46
+ var index = string.length;
47
+
48
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
49
+ return index;
50
+ }
51
+
52
+ var _trimmedEndIndex = trimmedEndIndex;
53
+
54
+ /** Used to match leading whitespace. */
55
+ var reTrimStart = /^\s+/;
56
+
57
+ /**
58
+ * The base implementation of `_.trim`.
59
+ *
60
+ * @private
61
+ * @param {string} string The string to trim.
62
+ * @returns {string} Returns the trimmed string.
63
+ */
64
+ function baseTrim(string) {
65
+ return string
66
+ ? string.slice(0, _trimmedEndIndex(string) + 1).replace(reTrimStart, '')
67
+ : string;
68
+ }
69
+
70
+ var _baseTrim = baseTrim;
71
+
72
+ /** Used as references for various `Number` constants. */
73
+ var NAN = 0 / 0;
74
+
75
+ /** Used to detect bad signed hexadecimal string values. */
76
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
77
+
78
+ /** Used to detect binary string values. */
79
+ var reIsBinary = /^0b[01]+$/i;
80
+
81
+ /** Used to detect octal string values. */
82
+ var reIsOctal = /^0o[0-7]+$/i;
83
+
84
+ /** Built-in method references without a dependency on `root`. */
85
+ var freeParseInt = parseInt;
86
+
87
+ /**
88
+ * Converts `value` to a number.
89
+ *
90
+ * @static
91
+ * @memberOf _
92
+ * @since 4.0.0
93
+ * @category Lang
94
+ * @param {*} value The value to process.
95
+ * @returns {number} Returns the number.
96
+ * @example
97
+ *
98
+ * _.toNumber(3.2);
99
+ * // => 3.2
100
+ *
101
+ * _.toNumber(Number.MIN_VALUE);
102
+ * // => 5e-324
103
+ *
104
+ * _.toNumber(Infinity);
105
+ * // => Infinity
106
+ *
107
+ * _.toNumber('3.2');
108
+ * // => 3.2
109
+ */
110
+ function toNumber(value) {
111
+ if (typeof value == 'number') {
112
+ return value;
113
+ }
114
+ if (isSymbol_1(value)) {
115
+ return NAN;
116
+ }
117
+ if (isObject_1(value)) {
118
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
119
+ value = isObject_1(other) ? (other + '') : other;
120
+ }
121
+ if (typeof value != 'string') {
122
+ return value === 0 ? value : +value;
123
+ }
124
+ value = _baseTrim(value);
125
+ var isBinary = reIsBinary.test(value);
126
+ return (isBinary || reIsOctal.test(value))
127
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
128
+ : (reIsBadHex.test(value) ? NAN : +value);
129
+ }
130
+
131
+ var toNumber_1 = toNumber;
132
+
133
+ /** Error message constants. */
134
+ var FUNC_ERROR_TEXT = 'Expected a function';
135
+
136
+ /* Built-in method references for those with the same name as other `lodash` methods. */
137
+ var nativeMax = Math.max,
138
+ nativeMin = Math.min;
139
+
140
+ /**
141
+ * Creates a debounced function that delays invoking `func` until after `wait`
142
+ * milliseconds have elapsed since the last time the debounced function was
143
+ * invoked. The debounced function comes with a `cancel` method to cancel
144
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
145
+ * Provide `options` to indicate whether `func` should be invoked on the
146
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
147
+ * with the last arguments provided to the debounced function. Subsequent
148
+ * calls to the debounced function return the result of the last `func`
149
+ * invocation.
150
+ *
151
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
152
+ * invoked on the trailing edge of the timeout only if the debounced function
153
+ * is invoked more than once during the `wait` timeout.
154
+ *
155
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
156
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
157
+ *
158
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
159
+ * for details over the differences between `_.debounce` and `_.throttle`.
160
+ *
161
+ * @static
162
+ * @memberOf _
163
+ * @since 0.1.0
164
+ * @category Function
165
+ * @param {Function} func The function to debounce.
166
+ * @param {number} [wait=0] The number of milliseconds to delay.
167
+ * @param {Object} [options={}] The options object.
168
+ * @param {boolean} [options.leading=false]
169
+ * Specify invoking on the leading edge of the timeout.
170
+ * @param {number} [options.maxWait]
171
+ * The maximum time `func` is allowed to be delayed before it's invoked.
172
+ * @param {boolean} [options.trailing=true]
173
+ * Specify invoking on the trailing edge of the timeout.
174
+ * @returns {Function} Returns the new debounced function.
175
+ * @example
176
+ *
177
+ * // Avoid costly calculations while the window size is in flux.
178
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
179
+ *
180
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
181
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
182
+ * 'leading': true,
183
+ * 'trailing': false
184
+ * }));
185
+ *
186
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
187
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
188
+ * var source = new EventSource('/stream');
189
+ * jQuery(source).on('message', debounced);
190
+ *
191
+ * // Cancel the trailing debounced invocation.
192
+ * jQuery(window).on('popstate', debounced.cancel);
193
+ */
194
+ function debounce(func, wait, options) {
195
+ var lastArgs,
196
+ lastThis,
197
+ maxWait,
198
+ result,
199
+ timerId,
200
+ lastCallTime,
201
+ lastInvokeTime = 0,
202
+ leading = false,
203
+ maxing = false,
204
+ trailing = true;
205
+
206
+ if (typeof func != 'function') {
207
+ throw new TypeError(FUNC_ERROR_TEXT);
208
+ }
209
+ wait = toNumber_1(wait) || 0;
210
+ if (isObject_1(options)) {
211
+ leading = !!options.leading;
212
+ maxing = 'maxWait' in options;
213
+ maxWait = maxing ? nativeMax(toNumber_1(options.maxWait) || 0, wait) : maxWait;
214
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
215
+ }
216
+
217
+ function invokeFunc(time) {
218
+ var args = lastArgs,
219
+ thisArg = lastThis;
220
+
221
+ lastArgs = lastThis = undefined;
222
+ lastInvokeTime = time;
223
+ result = func.apply(thisArg, args);
224
+ return result;
225
+ }
226
+
227
+ function leadingEdge(time) {
228
+ // Reset any `maxWait` timer.
229
+ lastInvokeTime = time;
230
+ // Start the timer for the trailing edge.
231
+ timerId = setTimeout(timerExpired, wait);
232
+ // Invoke the leading edge.
233
+ return leading ? invokeFunc(time) : result;
234
+ }
235
+
236
+ function remainingWait(time) {
237
+ var timeSinceLastCall = time - lastCallTime,
238
+ timeSinceLastInvoke = time - lastInvokeTime,
239
+ timeWaiting = wait - timeSinceLastCall;
240
+
241
+ return maxing
242
+ ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
243
+ : timeWaiting;
244
+ }
245
+
246
+ function shouldInvoke(time) {
247
+ var timeSinceLastCall = time - lastCallTime,
248
+ timeSinceLastInvoke = time - lastInvokeTime;
249
+
250
+ // Either this is the first call, activity has stopped and we're at the
251
+ // trailing edge, the system time has gone backwards and we're treating
252
+ // it as the trailing edge, or we've hit the `maxWait` limit.
253
+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
254
+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
255
+ }
256
+
257
+ function timerExpired() {
258
+ var time = now_1();
259
+ if (shouldInvoke(time)) {
260
+ return trailingEdge(time);
261
+ }
262
+ // Restart the timer.
263
+ timerId = setTimeout(timerExpired, remainingWait(time));
264
+ }
265
+
266
+ function trailingEdge(time) {
267
+ timerId = undefined;
268
+
269
+ // Only invoke if we have `lastArgs` which means `func` has been
270
+ // debounced at least once.
271
+ if (trailing && lastArgs) {
272
+ return invokeFunc(time);
273
+ }
274
+ lastArgs = lastThis = undefined;
275
+ return result;
276
+ }
277
+
278
+ function cancel() {
279
+ if (timerId !== undefined) {
280
+ clearTimeout(timerId);
281
+ }
282
+ lastInvokeTime = 0;
283
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
284
+ }
285
+
286
+ function flush() {
287
+ return timerId === undefined ? result : trailingEdge(now_1());
288
+ }
289
+
290
+ function debounced() {
291
+ var time = now_1(),
292
+ isInvoking = shouldInvoke(time);
293
+
294
+ lastArgs = arguments;
295
+ lastThis = this;
296
+ lastCallTime = time;
297
+
298
+ if (isInvoking) {
299
+ if (timerId === undefined) {
300
+ return leadingEdge(lastCallTime);
301
+ }
302
+ if (maxing) {
303
+ // Handle invocations in a tight loop.
304
+ clearTimeout(timerId);
305
+ timerId = setTimeout(timerExpired, wait);
306
+ return invokeFunc(lastCallTime);
307
+ }
308
+ }
309
+ if (timerId === undefined) {
310
+ timerId = setTimeout(timerExpired, wait);
311
+ }
312
+ return result;
313
+ }
314
+ debounced.cancel = cancel;
315
+ debounced.flush = flush;
316
+ return debounced;
317
+ }
318
+
319
+ var debounce_1 = debounce;
320
+
321
+ var teConnectJs = createCommonjsModule(function (module, exports) {
322
+ !function(t,e){"object"=='object'&&"object"=='object'?module.exports=e():"function"==typeof undefined&&undefined.amd?undefined([],e):"object"=='object'?exports["te-connect-js"]=e():t["te-connect-js"]=e();}(self,(()=>(()=>{var t={713:t=>{t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]});},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});};var o={};return (()=>{"use strict";n.r(o),n.d(o,{TeConnectJs:()=>b});var t=n(713),e=n.n(t);const r="https://svc4.magensa.net",s=`${r}/TEConnect`,i=["instanceId","pubKey","requestOrigin"],a="This usually means TEConnect was not loaded properly - or is unable to resolve the TEConnect URL.",c=`Reference to Card Entry element was not found. ${a}.`,l=`Id for TEConnect inputs was not found. ${a}.`,p="Error in 'mountTecPrButton'. Payment Request interface not found.",u="__te-connect-secure-window",d="__tec-pr-window",h={passive:!0},y={border:"none !important",margin:"0px !important",padding:"0px !important",width:"1px !important",minWidth:"100% !important",overflow:"hidden !important",display:"block !important",userSelect:"none !important",transform:"translateZ(0px) !important",height:"100%"},m={buttonLanguage:"en",buttonType:"plain",buttonStyle:"black"};function f(t,e){var n=document.createElement("iframe");return n.id=!0!==e?u:d,n.title=!0!==e?"TEConnect Secure Frame":"TEConnect Payment Requests Frame",n.name=!0!==e?"__teConnectSecureFrame":"__tecPrFrameName",n.width="100%",n.loading="lazy",n.allowPaymentRequest=!0,n.frameBorder="0",n.scrolling="no",n.setAttribute("allowtransparency","true"),n.src=t,!0!==e?function(t){for(var e=Object.keys(y),n=0;n<e.length;n++){var o=e[n];t.style[o]=y[o];}}(n):(n.width="0",n.height="0",n.style.position="absolute",n.style.left="-9000px",n.style.overflow="hidden",n.style.visibility="hidden"),n}function w(t){const e=document.getElementById(t);if(!e)throw new Error("Could not locate specified node. Please ensure the node is present on the DOM, and the id supplied is accurate and unique.");return e}class g{get clientStyles(){return this._clientStyles}set clientStyles(t){JSON.stringify(this.clientStyles)!==JSON.stringify(t)&&this.sendStyles(t),this._clientStyles=t;}get formId(){return this._formId}set formId(t){""!==t&&"object"==typeof this.clientStyles&&this.sendStyles(this.clientStyles),this._formId=t;}constructor(t){e()(this,"teConnect",void 0),e()(this,"listenerOptionsSupported",void 0),e()(this,"createTecPrTokenMethod",void 0),e()(this,"applePayBtnOptions",void 0),e()(this,"canMakePaymentsResult",void 0),e()(this,"mountGoogleBtnMethod",void 0),e()(this,"_clientStyles",void 0),e()(this,"_formId",void 0),e()(this,"sendStyles",(t=>{const e=document.getElementById(u);e&&e.contentWindow&&e.contentWindow.postMessage(JSON.stringify({type:"client_style_sheet",styles:t}),s);})),e()(this,"setStyles",(t=>{const e=function(t){if(t&&"object"==typeof t&&"function"==typeof t.hasOwnProperty&&(t.hasOwnProperty("boxes")||t.hasOwnProperty("base")))return t;throw new Error("Styles object provided is not in recognized format. Please refer to the Styles API docs for guidance on how to construct your custom styles object.")}(t);this.clientStyles=e;})),e()(this,"mountCardEntry",((t,e)=>{const n=w(t);e&&this.setStyles(e),this.attachTeFormListener();const o=f(this.teConnect.frameUrl);n.appendChild(o);})),e()(this,"createPayment",(async t=>{const e=document.getElementById(u);if(!e)throw new Error("Could not locate 'Card Entry'. Please ensure the node is present on the DOM ('mountCardEntry' was called prior to this call).");const n=(o=e,r=this.formId,o?r&&"string"==typeof r?"":l:c);var o,r;if(""!==n)return {error:n};const s={elements:e,formId:this.formId};return await this.teConnect.createPayment(s,t)})),e()(this,"createPaymentRequestToken",(async()=>{if("function"==typeof this.createTecPrTokenMethod){const t=document.getElementById(d);if(!t)throw new Error("Could not locate TEConnect Payment Request. Please ensure the nodes are present on the DOM.");if("string"!=typeof this.prFormId||this.prFormId.length<5)throw new Error(`[TEConnect Session Error]: ${l}`);try{await this.createTecPrTokenMethod({instanceId:this.teConnect.requestClient.instanceId,formId:this.prFormId,controllerRef:t});}catch(t){console.error("[TEConnect Session Error]: ",t);}}})),e()(this,"mountTecPrButton",((t,e)=>{if(this.canMakePaymentsResult){const{applePay:n,googlePay:o}=this.canMakePaymentsResult,r=function(){const t=document.createElement("div");return t.className="_tec-payment-evt-ele",t}();if(n){if(this.applePayBtnOptions=(t=>{if(t){const{applePayOptions:e}=t;if(e&&"object"==typeof e){const{buttonLanguage:t,buttonType:n,buttonStyle:o}=e,r=(t=>{if("string"!=typeof t)return "black";switch(t.toLowerCase()){case"black":default:return "black";case"white":return "white";case"white-outline":return "white-with-line"}})(o);return {buttonLanguage:t&&"string"==typeof t?`${t}`:m.buttonLanguage,buttonType:n&&"string"==typeof n?`${n}`:m.buttonType,buttonStyle:r}}}return m})(e||this.applePayBtnOptions),"function"!=typeof this.createTecPrTokenMethod||"string"!=typeof this.teConnect.prFrameUrl)throw new Error(p);{const e=w("string"==typeof t?t:t.applePayNode);this.attachTeFormListener();const n=function(t){const e=document.createElement("style");return e.innerHTML=`\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: ${t};\n }\n .apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n .apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n .apple-pay-button-white-with-line {\n -apple-pay-button-style: white-outline;\n }\n `,e}(this.applePayBtnOptions.buttonType);e.appendChild(n);const o=f(this.teConnect.prFrameUrl,!0);r.appendChild(o),e.appendChild(r);const s=function(t){let{buttonStyle:e,buttonLanguage:n}=t;const o=document.createElement("div");return o.id="te-connect-apple-pay-btn",o.classList.add("apple-pay-button","apple-pay-button-"+e),o.lang=n,o}(this.applePayBtnOptions);s.onclick=this.createPaymentRequestToken,e.appendChild(s),this.prFormId||(o.src=o.src);}}if(o){if("function"!=typeof this.mountGoogleBtnMethod)throw new Error(p);{const o="string"==typeof t?t:t.googlePayNode,s=w(o);n||s.appendChild(r);const i={instanceId:this.teConnect.requestClient.instanceId,eventRef:r};e&&e.googlePayOptions&&(i.googlePayOptions=e.googlePayOptions),this.mountGoogleBtnMethod(o,i);}}}})),e()(this,"canMakePayments",(t=>()=>new Promise((e=>t().then((t=>{this.canMakePaymentsResult=t,e(t);})))))),e()(this,"createTecPaymentRequest",(t=>{if("function"==typeof this.teConnect.paymentsRequestInterface){const{createPaymentRequestToken:e,canMakePayments:n,mountGoogleButton:o,...r}=this.teConnect.paymentsRequestInterface(t);return this.createTecPrTokenMethod=e,this.mountGoogleBtnMethod=o,{...r,canMakePayments:this.canMakePayments(n),mountTecPrButton:this.mountTecPrButton}}throw new Error("Please provide 'tecPaymentRequest' options to the 'createTEConnect' method, prior to creating a prInterface")})),this.teConnect=function(t){if(!t)throw new Error(NO_INSTANCE);if("object"!=typeof t.requestClient)throw new Error(INCOMPLETE_INSTANCE);const{requestClient:e}=t;if("function"!=typeof e.hasOwnProperty)throw new Error(INCOMPLETE_INSTANCE);for(const t of i)if(!e.hasOwnProperty(t))throw new Error(INCOMPLETE_INSTANCE);return t}(t),this.listenerOptionsSupported=function(){var t=!1;try{var e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e);}catch{t=!1;}return t}(),this.formIdListener=this.formIdListener.bind(this),this.attachTeFormListener=this.attachTeFormListener.bind(this),this.mountCardEntry=this.mountCardEntry.bind(this);}formIdListener(t){if(t.origin===r&&t.data&&"string"==typeof t.data){const{formId:e,prFormId:n}=JSON.parse(t.data);"string"==typeof e&&e.length>5&&(this.formId=e),"string"==typeof n&&n.length>5&&(this.prFormId=n);}}attachTeFormListener(){window.addEventListener("message",this.formIdListener,!this.listenerOptionsSupported||h),window.addEventListener("unload",(function(){window.removeEventListener("message",this.formIdListener,!this.listenerOptionsSupported||h);}),!this.listenerOptionsSupported||h);}}class b{constructor(t){const e=new g(t);this.createPayment=e.createPayment,this.setStyles=e.setStyles,this.mountCardEntry=e.mountCardEntry,this.createTecPaymentRequest=e.createTecPaymentRequest;}}})(),o})()));
323
+ //# sourceMappingURL=te-connect-js.map
324
+ });
325
+
326
+ const teConnectJs$1 = /*@__PURE__*/getDefaultExportFromCjs(teConnectJs);
327
+
328
+ const buyGiftcardFormCss = "buy-giftcard-form{display:block;width:100%}.buy-giftcard-form *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}";
329
+
330
+ var DeliveryType;
331
+ (function (DeliveryType) {
332
+ DeliveryType[DeliveryType["Email"] = 0] = "Email";
333
+ DeliveryType[DeliveryType["SMS"] = 1] = "SMS";
334
+ })(DeliveryType || (DeliveryType = {}));
335
+ var FormStep;
336
+ (function (FormStep) {
337
+ FormStep["GiftCardInfo"] = "Gift Card Info";
338
+ FormStep["PaymentInfo"] = "Payment Info";
339
+ FormStep["PaymentSucceed"] = "Payment Succeed";
340
+ })(FormStep || (FormStep = {}));
341
+ const customStyles = {
342
+ base: {
343
+ backgroundColor: 'rgba(255, 255, 255, 0)',
344
+ wrapper: {
345
+ backgroundColor: 'rgba(255, 255, 255, 0)',
346
+ direction: 'column',
347
+ margin: '0 -8px',
348
+ padding: 0,
349
+ },
350
+ variants: {
351
+ inputType: 'outlined',
352
+ inputMargin: 'dense',
353
+ },
354
+ },
355
+ boxes: {
356
+ borderRadius: 4,
357
+ textColor: Colors.TextColor,
358
+ errorColor: Colors.Error03,
359
+ width: '100%',
360
+ },
361
+ };
362
+ const BuyGiftcardForm = class {
363
+ constructor(hostRef) {
364
+ registerInstance(this, hostRef);
365
+ this.onChangeEmail = debounce_1((recipientEmail) => {
366
+ this.recipientEmail = recipientEmail;
367
+ if (this.recipientEmailConfirm) {
368
+ if (this.deliveryType === DeliveryType.Email) {
369
+ this.isInvalidEmails = recipientEmail !== this.recipientEmailConfirm;
370
+ }
371
+ else {
372
+ this.isInvalidPhones = recipientEmail !== this.recipientEmailConfirm;
373
+ }
374
+ }
375
+ else {
376
+ this.isInvalidEmails = false;
377
+ this.isInvalidPhones = false;
378
+ }
379
+ }, 300);
380
+ this.onChangeConfirmEmail = debounce_1((recipientEmailConfirm) => {
381
+ this.recipientEmailConfirm = recipientEmailConfirm;
382
+ if (this.recipientEmail) {
383
+ if (this.deliveryType === DeliveryType.Email) {
384
+ this.isInvalidEmails = recipientEmailConfirm !== this.recipientEmail;
385
+ }
386
+ else {
387
+ this.isInvalidPhones = recipientEmailConfirm !== this.recipientEmail;
388
+ }
389
+ }
390
+ else {
391
+ this.isInvalidEmails = false;
392
+ this.isInvalidPhones = false;
393
+ }
394
+ }, 300);
395
+ this.onSubmitGiftCardForm = async () => {
396
+ const recipientEmailStr = String(this.recipientEmail).replaceAll(' ', '');
397
+ const isInvalidEmailFormats = this.deliveryType === DeliveryType.Email && recipientEmailStr.indexOf('@') === -1;
398
+ if (this.deliveryType === DeliveryType.Email && (!recipientEmailStr || isInvalidEmailFormats || this.isInvalidEmails)) {
399
+ this.errorMessage = !recipientEmailStr || isInvalidEmailFormats
400
+ ? 'Inputted emails are invalid'
401
+ : 'Inputted emails are not matched';
402
+ }
403
+ else if (this.deliveryType === DeliveryType.SMS && (!recipientEmailStr || this.isInvalidPhones)) {
404
+ this.errorMessage = !recipientEmailStr
405
+ ? 'Inputted phones are invalid'
406
+ : 'Inputted phones are not matched';
407
+ }
408
+ else if (this.customAmount || this.selectedAmount) {
409
+ this.step = FormStep.PaymentInfo;
410
+ setTimeout(() => this.initMagensaPayment(), 350);
411
+ }
412
+ };
413
+ this.salonId = undefined;
414
+ this.teConnect = undefined;
415
+ this.isLoading = true;
416
+ this.isSubmitting = undefined;
417
+ this.errorMessage = undefined;
418
+ this.userInfo = undefined;
419
+ this.salonInfo = undefined;
420
+ this.giftCardSettings = undefined;
421
+ this.magensaCredentials = undefined;
422
+ this.step = FormStep.GiftCardInfo;
423
+ this.selectedAmount = undefined;
424
+ this.customAmount = undefined;
425
+ this.deliveryType = DeliveryType.Email;
426
+ this.deliveryDate = undefined;
427
+ this.recipientFirstName = undefined;
428
+ this.recipientLastName = undefined;
429
+ this.recipientEmail = undefined;
430
+ this.recipientEmailConfirm = undefined;
431
+ this.recipientMessage = undefined;
432
+ this.isInvalidEmails = undefined;
433
+ this.isInvalidPhones = undefined;
434
+ this.selectedStyleId = undefined;
435
+ }
436
+ async componentDidLoad() {
437
+ const promises = [
438
+ this.fetchSalonInfo(),
439
+ this.fetchGiftCardSettings(),
440
+ this.fetchMagensaCredentials(),
441
+ ];
442
+ await Promise.all(promises);
443
+ this.isLoading = false;
444
+ }
445
+ async fetchMagensaCredentials() {
446
+ try {
447
+ this.magensaCredentials = await HttpService().fetchMagensaCredentials(Number(this.salonId));
448
+ }
449
+ catch (e) { }
450
+ }
451
+ async fetchSalonInfo() {
452
+ try {
453
+ this.salonInfo = await HttpService().fetchSalonInfo(Number(this.salonId));
454
+ }
455
+ catch (e) { }
456
+ }
457
+ async fetchGiftCardSettings() {
458
+ try {
459
+ this.giftCardSettings = await HttpService().fetchGiftCardSettings(Number(this.salonId));
460
+ }
461
+ catch (e) { }
462
+ }
463
+ initMagensaPayment() {
464
+ const teInstance = teConnect.createTEConnect(this.magensaCredentials.token, { hideZip: true });
465
+ this.teConnect = new teConnectJs.TeConnectJs(teInstance);
466
+ this.teConnect.mountCardEntry('buy-giftcard--payment', customStyles);
467
+ }
468
+ renderPaymentOnlineDisabled() {
469
+ return (h("div", { style: { paddingTop: '24px', textAlign: 'center' } }, h("div", { style: { fontSize: '24px', fontWeight: '700', lineHeight: '1.4' } }, "Online Gift Card is not available"), h("div", { style: { marginTop: '12px' } }, "Please call us for assistance or visit salon. Thanks!"), h("div", { style: { marginTop: '12px' } }, h("a", { rel: "noopener noreferrer", href: `tel:${this.salonInfo.businessPhone}` }, h("button", { type: "button", style: {
470
+ background: Colors.Secondary,
471
+ border: `1px solid ${Colors.Secondary}`,
472
+ borderRadius: '8px',
473
+ color: Colors.White,
474
+ cursor: 'pointer',
475
+ fontSize: '16px',
476
+ fontWeight: '700',
477
+ paddingLeft: '24px',
478
+ paddingRight: '24px',
479
+ height: '44px',
480
+ } }, this.salonInfo.businessPhone)))));
481
+ }
482
+ renderUserVerificationForm() {
483
+ return (h("div", null, h("buy-giftcard-verification", { "salon-id": Number(this.salonId), onSuccess: (user) => this.userInfo = user })));
484
+ }
485
+ renderGiftCardForm() {
486
+ const { recommendAmounts, acceptCustomAmount, giftCardStyles, } = this.giftCardSettings || {};
487
+ const totalAmount = (recommendAmounts || []).length;
488
+ const isDeliveryEmail = this.deliveryType === DeliveryType.Email;
489
+ return (h("div", { class: "buy-giftcard-form" }, h("div", { style: { fontSize: '18px' } }, "Select Gift Card amount"), h("div", { style: {
490
+ display: 'flex',
491
+ justifyContent: 'space-between',
492
+ marginTop: '12px',
493
+ } }, totalAmount > 0 && (h("div", null, h("div", { style: { display: 'flex' } }, recommendAmounts.map((recommendValue, idx) => {
494
+ const isSelected = this.selectedAmount === recommendValue;
495
+ return (h("button", { type: "button", key: `gc--recommend-amount--${recommendValue}`, value: recommendValue, onClick: () => this.selectedAmount = recommendValue, style: {
496
+ border: `1px solid ${Colors.Gray02}`,
497
+ backgroundColor: Colors.White,
498
+ color: Colors.TextColor,
499
+ borderRadius: '0px',
500
+ cursor: 'pointer',
501
+ height: '48px',
502
+ minWidth: '64px',
503
+ display: 'flex',
504
+ justifyContent: 'center',
505
+ alignItems: 'center',
506
+ fontSize: '18px',
507
+ padding: '8px 12px',
508
+ ...idx === 0 ? { borderRadius: '8px 0 0 8px', } : {},
509
+ ...idx === (totalAmount - 1) ? { borderRadius: '0 8px 8px 0' } : {},
510
+ ...isSelected ? { backgroundColor: Colors.Gray01, fontWeight: '600' } : {},
511
+ } }, "$", recommendValue));
512
+ })))), acceptCustomAmount && (h("div", { style: { position: 'relative', marginLeft: '16px', maxWith: '160px' } }, h("span", { style: {
513
+ position: 'absolute',
514
+ left: '14px',
515
+ top: '50%',
516
+ fontSize: '18px',
517
+ transform: 'translate(0, -50%)',
518
+ } }, "$"), h("input", { type: "number", value: this.customAmount, onInput: (evt) => this.customAmount = evt.target.value, style: {
519
+ border: `1px solid ${Colors.Gray02}`,
520
+ backgroundColor: Colors.White,
521
+ color: Colors.TextColor,
522
+ borderRadius: '8px',
523
+ padding: '8px 16px 8px 32px',
524
+ height: '48px',
525
+ width: '100%',
526
+ fontSize: '18px',
527
+ fontWeight: '600',
528
+ } })))), h("div", { style: {
529
+ borderTop: `1px solid ${Colors.Gray02}`,
530
+ marginTop: '24px',
531
+ paddingTop: '16px',
532
+ } }, h("div", { style: { fontSize: '18px' } }, "Recipient name"), h("div", { style: { display: 'flex', alignItems: 'center', marginTop: '12px' } }, h("div", { style: { width: '48%' } }, h("input", { placeholder: "First name", type: "text", value: this.recipientFirstName, onInput: (evt) => {
533
+ this.recipientFirstName = evt.target.value.trim();
534
+ }, style: {
535
+ border: `1px solid ${Colors.Gray02}`,
536
+ backgroundColor: Colors.White,
537
+ color: Colors.TextColor,
538
+ borderRadius: '8px',
539
+ padding: '8px 16px',
540
+ height: '48px',
541
+ width: '100%',
542
+ } })), h("div", { style: { width: '48%', marginLeft: '4%' } }, h("input", { placeholder: "Last name", type: "text", value: this.recipientLastName, onInput: (evt) => {
543
+ this.recipientLastName = evt.target.value.trim();
544
+ }, style: {
545
+ border: `1px solid ${Colors.Gray02}`,
546
+ backgroundColor: Colors.White,
547
+ color: Colors.TextColor,
548
+ borderRadius: '8px',
549
+ padding: '8px 16px',
550
+ height: '48px',
551
+ width: '100%',
552
+ } })))), h("div", { style: { marginTop: '24px' } }, h("div", { style: { fontSize: '18px' } }, "Delivery method?"), h("div", { style: { display: 'flex', marginTop: '12px' } }, h("div", { style: {
553
+ cursor: 'pointer',
554
+ display: 'flex',
555
+ alignItems: 'center',
556
+ }, onClick: () => {
557
+ this.recipientEmail = null;
558
+ this.recipientEmailConfirm = null;
559
+ this.deliveryType = DeliveryType.Email;
560
+ } }, h("span", { style: {
561
+ border: `1px solid ${Colors.Gray02}`,
562
+ backgroundClip: 'content-box',
563
+ borderRadius: '50%',
564
+ height: '16px',
565
+ width: '16px',
566
+ padding: '4px',
567
+ ...isDeliveryEmail ? {
568
+ border: `1px solid ${Colors.Secondary}`,
569
+ backgroundColor: Colors.Secondary,
570
+ } : {},
571
+ } }), h("span", { style: { marginLeft: '12px' } }, "EMAIL")), h("div", { style: {
572
+ cursor: 'pointer',
573
+ display: 'flex',
574
+ alignItems: 'center',
575
+ marginLeft: '32px',
576
+ }, onClick: () => {
577
+ this.recipientEmail = null;
578
+ this.recipientEmailConfirm = null;
579
+ this.deliveryType = DeliveryType.SMS;
580
+ } }, h("span", { style: {
581
+ border: `1px solid ${Colors.Gray02}`,
582
+ backgroundClip: 'content-box',
583
+ borderRadius: '50%',
584
+ height: '16px',
585
+ width: '16px',
586
+ padding: '4px',
587
+ ...!isDeliveryEmail ? {
588
+ border: `1px solid ${Colors.Secondary}`,
589
+ backgroundColor: Colors.Secondary,
590
+ } : {},
591
+ } }), h("span", { style: { marginLeft: '12px' } }, "TEXT"))), h("div", { style: {
592
+ display: 'flex',
593
+ alignItems: 'center',
594
+ marginTop: '24px',
595
+ } }, h("div", { style: { width: '48%' } }, h("input", { placeholder: isDeliveryEmail ? 'Enter email' : 'Enter phone', type: "text", value: this.recipientEmail, onInput: (evt) => this.onChangeEmail(evt.target.value.trim()), style: {
596
+ border: `1px solid ${Colors.Gray02}`,
597
+ backgroundColor: Colors.White,
598
+ color: Colors.TextColor,
599
+ borderRadius: '8px',
600
+ padding: '8px 16px',
601
+ height: '48px',
602
+ width: '100%',
603
+ } })), h("div", { style: { width: '48%', marginLeft: '4%' } }, h("input", { placeholder: isDeliveryEmail ? 'Re-enter email' : 'Re-enter phone', type: "text", value: this.recipientEmailConfirm, onInput: (evt) => this.onChangeConfirmEmail(evt.target.value.trim()), style: {
604
+ border: `1px solid ${Colors.Gray02}`,
605
+ backgroundColor: Colors.White,
606
+ color: Colors.TextColor,
607
+ borderRadius: '8px',
608
+ padding: '8px 16px',
609
+ height: '48px',
610
+ width: '100%',
611
+ } }))), this.isInvalidEmails && (h("div", { style: {
612
+ color: Colors.Red03,
613
+ fontSize: '90%',
614
+ marginTop: '16px',
615
+ } }, "Inputted emails are not matched")), this.isInvalidPhones && (h("div", { style: {
616
+ color: Colors.Red03,
617
+ fontSize: '90%',
618
+ marginTop: '16px',
619
+ } }, "Inputted phones are not matched")), h("div", { style: {
620
+ border: `1px solid ${Colors.Info02}`,
621
+ backgroundColor: Colors.Info01,
622
+ marginTop: '16px',
623
+ padding: '16px',
624
+ } }, "Gift card info will send to your email once it cannot delivery to recipient")), giftCardStyles.length > 0 && (h("div", { style: {
625
+ borderTop: `1px solid ${Colors.Gray02}`,
626
+ marginTop: '24px',
627
+ paddingTop: '16px',
628
+ } }, h("div", { style: { fontSize: '18px' } }, "Select Gift Card style"), h("div", { style: { marginTop: '12px' } }, giftCardStyles.map((giftCardStyle, idx) => {
629
+ const isSelected = this.selectedStyleId === giftCardStyle.id;
630
+ return (h("div", { class: "gift-card-style-option", key: `form--buy-gift-card--id-${giftCardStyle.id}`, style: {
631
+ display: 'inline-block',
632
+ verticalAlign: 'top',
633
+ height: 'auto',
634
+ padding: '0',
635
+ width: '33%',
636
+ marginBottom: '24px',
637
+ paddingRight: '24px',
638
+ } }, h("div", { style: {
639
+ border: `1px solid ${Colors.Gray02}`,
640
+ borderRadius: '8px',
641
+ cursor: 'pointer',
642
+ display: 'flex',
643
+ position: 'relative',
644
+ justifyContent: 'center',
645
+ flexDirection: 'column',
646
+ alignItems: 'center',
647
+ overflow: 'hidden',
648
+ }, onClick: () => this.selectedStyleId = giftCardStyle.id }, isSelected && (h("div", null, h("div", { style: {
649
+ backgroundColor: 'rgba(0, 0, 0, 0.25)',
650
+ borderRadius: '8px',
651
+ position: 'absolute',
652
+ inset: '0',
653
+ zIndex: '3',
654
+ } }), h("i", { class: "ri-checkbox-circle-fill", style: {
655
+ position: 'absolute',
656
+ left: '50%',
657
+ top: '50%',
658
+ transform: 'translate(-50%, -50%)',
659
+ fontSize: '32px',
660
+ zIndex: '5',
661
+ } }))), h("img", { src: giftCardStyle.imageUrl, alt: `Style ${idx + 1}`, style: { position: 'relative', maxHeight: '100%', maxWidth: '100%', zIndex: '2' } }))));
662
+ })))), h("div", { style: {
663
+ borderTop: `1px solid ${Colors.Gray02}`,
664
+ marginTop: '24px',
665
+ paddingTop: '16px',
666
+ } }, h("div", { style: { fontSize: '18px' } }, "Delivery date"), h("div", { style: { marginTop: '12px', maxWidth: '50%' } }, h("input", { type: "date", placeholder: "Today", onInput: (evt) => {
667
+ this.deliveryDate = evt.target.value.trim();
668
+ }, style: {
669
+ backgroundColor: Colors.White,
670
+ border: `1px solid ${Colors.Gray02}`,
671
+ color: Colors.TextColor,
672
+ borderRadius: '8px',
673
+ padding: '8px 16px',
674
+ height: '48px',
675
+ width: '100%',
676
+ fontSize: '18px',
677
+ } })), h("div", { style: { marginTop: '16px' } }, h("textarea", { rows: 4, placeholder: "Include a message...", onInput: (evt) => {
678
+ this.recipientMessage = evt.target.value.trim();
679
+ }, style: {
680
+ border: `1px solid ${Colors.Gray02}`,
681
+ background: Colors.White,
682
+ color: Colors.TextColor,
683
+ padding: '16px',
684
+ resize: 'none',
685
+ fontSize: '16px',
686
+ borderRadius: '8px',
687
+ width: '100%',
688
+ } }))), h("div", { style: {
689
+ marginTop: '24px',
690
+ textAlign: 'right',
691
+ } }, h("button", { type: "button", style: {
692
+ background: Colors.Secondary,
693
+ border: `1px solid ${Colors.Secondary}`,
694
+ borderRadius: '8px',
695
+ cursor: 'pointer',
696
+ color: Colors.White,
697
+ fontSize: '16px',
698
+ fontWeight: '700',
699
+ paddingLeft: '24px',
700
+ paddingRight: '24px',
701
+ height: '48px',
702
+ }, onClick: () => this.onSubmitGiftCardForm() }, "Next")), this.errorMessage && (h("div", { style: {
703
+ backgroundColor: Colors.Red01,
704
+ border: `1px solid ${Colors.Red02}`,
705
+ marginBottom: '24px',
706
+ padding: '16px',
707
+ } }, this.errorMessage))));
708
+ }
709
+ renderPaymentSucceed() {
710
+ return (h("div", { style: { paddingTop: '24px', textAlign: 'center' } }, h("div", { style: { fontSize: '24px', fontWeight: '700', lineHeight: '1.4' } }, "Thank you!"), h("div", { style: { marginTop: '12px' } }, "Your gift card has been purchased successfully")));
711
+ }
712
+ async createCardPayment() {
713
+ try {
714
+ const { error, token } = await this.teConnect.createPayment();
715
+ if (!error && token) {
716
+ return Promise.resolve({ token });
717
+ }
718
+ return Promise.reject({ message: error });
719
+ }
720
+ catch (res) {
721
+ return Promise.reject({ message: res.error || 'Something went wrong when processing your card' });
722
+ }
723
+ }
724
+ async processCardToken(Token) {
725
+ const defaultErrorMessage = 'Something went wrong when creating payment transaction';
726
+ try {
727
+ const { MPPGv4WSFault, TransactionOutput } = await HttpService().magensaProcessToken({
728
+ raw_data: [{
729
+ Token,
730
+ Authentication: {
731
+ CustomerCode: this.magensaCredentials.customerCode,
732
+ Username: this.magensaCredentials.username,
733
+ Password: this.magensaCredentials.password,
734
+ },
735
+ TransactionInput: {
736
+ TransactionType: 1,
737
+ ProcessorName: this.magensaCredentials.processorName,
738
+ Amount: this.customAmount || this.selectedAmount || 1,
739
+ },
740
+ }],
741
+ });
742
+ if (!MPPGv4WSFault && TransactionOutput && TransactionOutput.TransactionID) {
743
+ return Promise.resolve({ transactionID: TransactionOutput.TransactionID });
744
+ }
745
+ let message = MPPGv4WSFault && MPPGv4WSFault.FaultReason;
746
+ if (!message && TransactionOutput && TransactionOutput.TransactionMessage) {
747
+ message = TransactionOutput.TransactionMessage;
748
+ }
749
+ return Promise.reject({ message: message || defaultErrorMessage });
750
+ }
751
+ catch (res) {
752
+ return Promise.reject({ message: res.error || defaultErrorMessage });
753
+ }
754
+ }
755
+ async voidPaymentRequest(ReferenceTransactionID) {
756
+ const defaultErrorMessage = 'Something went wrong when updating payment transaction status';
757
+ try {
758
+ const { MPPGv4WSFault, TransactionOutput } = await HttpService().magensaConfirmTransaction({
759
+ raw_data: [{
760
+ Authentication: {
761
+ CustomerCode: this.magensaCredentials.customerCode,
762
+ Username: this.magensaCredentials.username,
763
+ Password: this.magensaCredentials.password,
764
+ },
765
+ TransactionInput: {
766
+ ReferenceTransactionID,
767
+ TransactionType: 4,
768
+ ProcessorName: this.magensaCredentials.processorName,
769
+ Amount: this.customAmount || this.selectedAmount || 1,
770
+ },
771
+ }],
772
+ });
773
+ if (!MPPGv4WSFault && TransactionOutput && TransactionOutput.TransactionID) {
774
+ return Promise.resolve({ transactionID: TransactionOutput.TransactionID });
775
+ }
776
+ let message = MPPGv4WSFault && MPPGv4WSFault.FaultReason;
777
+ if (!message && TransactionOutput && TransactionOutput.TransactionMessage) {
778
+ message = TransactionOutput.TransactionMessage;
779
+ }
780
+ return Promise.reject({ message: message || defaultErrorMessage });
781
+ }
782
+ catch (res) {
783
+ return Promise.reject({ message: res.error || defaultErrorMessage });
784
+ }
785
+ }
786
+ async onSubmitPaymentForm() {
787
+ this.isSubmitting = true;
788
+ this.errorMessage = null;
789
+ if (this.recipientFirstName && this.recipientLastName && this.recipientEmail) {
790
+ try {
791
+ const { token } = await this.createCardPayment();
792
+ const { transactionID } = await this.processCardToken(token);
793
+ await this.voidPaymentRequest(transactionID);
794
+ if (token) {
795
+ const { giftCardStyles } = this.giftCardSettings || {};
796
+ const selectedGiftCardStyle = this.selectedStyleId
797
+ ? ((giftCardStyles || []).find(style => style.id === this.selectedStyleId) || {}).imageUrl : '';
798
+ const recipientUserEmail = (this.recipientEmail || '').indexOf('@') > -1 ? this.recipientEmail : '';
799
+ const recipientUserPhone = (this.recipientEmail || '').indexOf('@') === -1 ? this.recipientEmail : '';
800
+ await HttpService().onBuyGiftCard(this.salonInfo.id, {
801
+ source: token,
802
+ amount: this.customAmount || this.selectedAmount || '',
803
+ gift_card_style: selectedGiftCardStyle || '',
804
+ delivery_date: this.deliveryDate ? dayjs_min(this.deliveryDate).format(dateFormat) : dayjs_min().format(dateFormat),
805
+ promotion_code: '',
806
+ p_email: this.userInfo.email || '',
807
+ p_first_name: this.userInfo.firstName || '',
808
+ p_last_name: this.userInfo.lastName || '',
809
+ p_phone: this.userInfo.mobilePhone || '',
810
+ r_first_name: this.recipientFirstName || this.userInfo.firstName || '',
811
+ r_last_name: this.recipientLastName || this.userInfo.lastName || '',
812
+ r_email: recipientUserEmail || recipientUserPhone || this.userInfo.email || this.userInfo.mobilePhone || '',
813
+ r_message: this.recipientMessage || '',
814
+ billing_street: '',
815
+ billing_city: '',
816
+ billing_state: '',
817
+ billing_zip: '',
818
+ payment_valid: {
819
+ type: 'magensa',
820
+ magensa_transaction_id: transactionID,
821
+ magensa_user: this.magensaCredentials.username,
822
+ magensa_password: this.magensaCredentials.password,
823
+ magensa_customer_code: this.magensaCredentials.customerCode,
824
+ },
825
+ });
826
+ this.step = FormStep.PaymentSucceed;
827
+ }
828
+ else {
829
+ this.errorMessage = `Something went wrong with your credit card`;
830
+ }
831
+ }
832
+ catch (error) {
833
+ this.errorMessage = error.message || (error.error && error.error.message) || get_1(error, 'response.data.message') || `Something went wrong when purchasing your gift card`;
834
+ }
835
+ }
836
+ this.isSubmitting = false;
837
+ }
838
+ renderPaymentForm() {
839
+ return (h("div", null, h("div", { style: { fontSize: '16px' } }, "Amount: ", h("b", { style: {
840
+ fontSize: '18px',
841
+ fontWeight: '700',
842
+ marginLeft: '6px',
843
+ } }, "$", this.customAmount || this.selectedAmount)), h("div", { style: { fontSize: '16px', marginTop: '8px' } }, "Delivery to: ", h("b", { style: {
844
+ fontSize: '18px',
845
+ fontWeight: '700',
846
+ marginLeft: '6px',
847
+ } }, this.recipientFirstName, " ", this.recipientLastName, " (", this.recipientEmail, ")")), h("div", { style: { fontSize: '16px', marginTop: '8px' } }, "When: ", h("b", { style: {
848
+ fontSize: '18px',
849
+ fontWeight: '700',
850
+ marginLeft: '6px',
851
+ } }, this.deliveryDate ? dayjs_min(this.deliveryDate).format(shortDateFormat) : 'Today')), h("div", { style: { fontSize: '18px', marginTop: '24px' } }, "Payment"), h("div", { style: { marginTop: '8px', marginLeft: '-6px' } }, h("credit-card-types", null)), h("div", { id: "buy-giftcard--payment", style: { height: '300px', maxWidth: '400px', marginTop: '24px' } }), h("button", { type: "button", disabled: this.isSubmitting, style: {
852
+ border: `1px solid ${Colors.Secondary}`,
853
+ background: Colors.Secondary,
854
+ color: Colors.White,
855
+ borderRadius: '8px',
856
+ cursor: 'pointer',
857
+ fontSize: '16px',
858
+ fontWeight: '700',
859
+ paddingLeft: '24px',
860
+ paddingRight: '24px',
861
+ height: '44px',
862
+ width: '100%',
863
+ }, onClick: () => this.onSubmitPaymentForm() }, "Submit")));
864
+ }
865
+ renderSalonInfo() {
866
+ const salonImageUrl = getSalonImage(this.salonInfo);
867
+ return (h("div", { style: {
868
+ backgroundColor: Colors.White,
869
+ border: `1px solid ${Colors.Gray02}`,
870
+ borderRadius: '8px',
871
+ padding: '24px',
872
+ } }, h("div", { style: { display: 'flex' } }, salonImageUrl && (h("div", { style: { marginRight: '24px' } }, h("img", { src: salonImageUrl, alt: this.salonInfo.businessName, style: { maxWidth: '84px' } }))), h("div", { style: { flexGrow: '1', flexShrink: '1' } }, h("div", { style: {
873
+ fontSize: '24px',
874
+ lineHeight: '1.3',
875
+ } }, this.salonInfo.businessName), h("div", { style: {
876
+ color: Colors.Gray05,
877
+ display: 'flex',
878
+ marginTop: '4px',
879
+ } }, h("i", { class: "ri-map-pin-line", style: {
880
+ marginRight: '4px',
881
+ fontSize: '20px',
882
+ } }), h("div", { style: {
883
+ flexGrow: '1',
884
+ flexShrink: '1',
885
+ overflow: 'hidden',
886
+ fontSize: '16px',
887
+ } }, getSalonAddress(this.salonInfo))), h("div", { style: {
888
+ display: 'flex',
889
+ alignItems: 'center',
890
+ color: Colors.Gray05,
891
+ marginTop: '4px',
892
+ } }, h("i", { class: "ri-phone-line", style: {
893
+ marginRight: '4px',
894
+ fontSize: '20px',
895
+ } }), h("div", { style: {
896
+ flexGrow: '1',
897
+ flexShrink: '1',
898
+ overflow: 'hidden',
899
+ fontSize: '16px',
900
+ } }, "Phone: ", this.salonInfo.businessPhone))))));
901
+ }
902
+ renderSkeletons() {
903
+ return (h("div", null, h("div", { style: {
904
+ backgroundColor: Colors.Gray02,
905
+ height: '20px',
906
+ width: '160px',
907
+ } }), h("div", { style: { paddingTop: '24px' } }, h("div", { style: {
908
+ backgroundColor: Colors.Gray02,
909
+ height: '16px',
910
+ width: '160px',
911
+ } }), h("div", { style: {
912
+ display: 'flex',
913
+ flexDirection: 'row',
914
+ marginTop: '12px',
915
+ } }, h("div", { style: {
916
+ backgroundColor: Colors.Gray01,
917
+ marginRight: '8px',
918
+ height: '32px',
919
+ width: '100px',
920
+ } }), h("div", { style: {
921
+ backgroundColor: Colors.Gray01,
922
+ marginRight: '8px',
923
+ height: '32px',
924
+ width: '100px',
925
+ } }), h("div", { style: {
926
+ backgroundColor: Colors.Gray01,
927
+ height: '32px',
928
+ width: '100px',
929
+ } }))), h("div", { style: { paddingTop: '24px' } }, h("div", { style: {
930
+ backgroundColor: Colors.Gray02,
931
+ height: '16px',
932
+ width: '160px',
933
+ } }), h("div", { style: {
934
+ overflow: 'hidden',
935
+ marginBottom: '-16px',
936
+ marginTop: '12px',
937
+ } }, [1, 2, 3, 4].map((fakeId) => {
938
+ return (h("div", { key: `form--buy-gift-card--id-${fakeId}`, style: {
939
+ float: 'left',
940
+ width: '47%',
941
+ marginRight: '3%',
942
+ marginBottom: '16px',
943
+ } }, h("div", { style: {
944
+ backgroundColor: Colors.Gray01,
945
+ borderRadius: '8px',
946
+ height: '90px',
947
+ } })));
948
+ }))), h("div", { style: { paddingTop: '24px', marginBottom: '-16px' } }, h("div", { style: {
949
+ backgroundColor: Colors.Gray02,
950
+ height: '16px',
951
+ width: '160px',
952
+ } }), h("div", { style: {
953
+ overflow: 'hidden',
954
+ marginBottom: '-16px',
955
+ marginTop: '12px',
956
+ } }, [1, 2, 3, 4].map((fakeId) => {
957
+ return (h("div", { key: `form--buy-gift-card--id-${fakeId}`, style: {
958
+ float: 'left',
959
+ width: '47%',
960
+ marginRight: '3%',
961
+ marginBottom: '16px',
962
+ } }, h("div", { style: {
963
+ backgroundColor: Colors.Gray01,
964
+ borderRadius: '8px',
965
+ height: '40px',
966
+ } })));
967
+ })), h("div", { style: { marginBottom: '16px', paddingTop: '24px' } }, h("div", { style: {
968
+ backgroundColor: Colors.Gray01,
969
+ height: '84px',
970
+ } }))), h("div", { style: { paddingTop: '32px' } }, h("div", { style: {
971
+ backgroundColor: Colors.Gray02,
972
+ height: '40px',
973
+ } }))));
974
+ }
975
+ render() {
976
+ if (this.isLoading) {
977
+ return (h("div", { style: {
978
+ width: '90%',
979
+ maxWidth: '600px',
980
+ margin: 'auto',
981
+ paddingBottom: '32px',
982
+ } }, this.renderSkeletons()));
983
+ }
984
+ const { acceptPaymentOnline, } = this.giftCardSettings || {};
985
+ return (h("div", { class: "buy-giftcard--wrapper", style: { paddingBottom: '32px' } }, h("div", { style: { marginBottom: '32px' } }, h("div", { style: { backgroundColor: Colors.Secondary, height: '120px' } }), h("div", { style: {
986
+ width: '90%',
987
+ maxWidth: '600px',
988
+ margin: '-60px auto 0',
989
+ } }, this.renderSalonInfo())), h("div", { style: {
990
+ width: '90%',
991
+ maxWidth: '600px',
992
+ margin: 'auto',
993
+ } }, !acceptPaymentOnline && this.renderPaymentOnlineDisabled(), acceptPaymentOnline && (h("div", null, !this.userInfo && this.renderUserVerificationForm(), this.userInfo && (h("div", null, this.step === FormStep.GiftCardInfo && this.renderGiftCardForm(), this.step === FormStep.PaymentInfo && this.renderPaymentForm(), this.step === FormStep.PaymentSucceed && this.renderPaymentSucceed())))))));
994
+ }
995
+ };
996
+ BuyGiftcardForm.style = buyGiftcardFormCss;
997
+
998
+ export { BuyGiftcardForm as buy_giftcard_form };