@paynext/sdk 0.0.55 → 0.0.56

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/index.umd.js CHANGED
@@ -1,11 +1,11 @@
1
- (function(re,ne){typeof exports=="object"&&typeof module!="undefined"?ne(exports):typeof define=="function"&&define.amd?define(["exports"],ne):(re=typeof globalThis!="undefined"?globalThis:re||self,ne(re["PayNext TS SDK"]={}))})(this,function(re){"use strict";var Ac=Object.defineProperty,Tc=Object.defineProperties;var Ic=Object.getOwnPropertyDescriptors;var At=Object.getOwnPropertySymbols;var Ui=Object.prototype.hasOwnProperty,Bi=Object.prototype.propertyIsEnumerable;var Er=(re,ne,ie)=>ne in re?Ac(re,ne,{enumerable:!0,configurable:!0,writable:!0,value:ie}):re[ne]=ie,j=(re,ne)=>{for(var ie in ne||(ne={}))Ui.call(ne,ie)&&Er(re,ie,ne[ie]);if(At)for(var ie of At(ne))Bi.call(ne,ie)&&Er(re,ie,ne[ie]);return re},X=(re,ne)=>Tc(re,Ic(ne));var Ce=(re,ne)=>{var ie={};for(var be in re)Ui.call(re,be)&&ne.indexOf(be)<0&&(ie[be]=re[be]);if(re!=null&&At)for(var be of At(re))ne.indexOf(be)<0&&Bi.call(re,be)&&(ie[be]=re[be]);return ie};var y=(re,ne,ie)=>Er(re,typeof ne!="symbol"?ne+"":ne,ie);var z=(re,ne,ie)=>new Promise((be,We)=>{var Tt=se=>{try{Ge(ie.next(se))}catch(Ye){We(Ye)}},It=se=>{try{Ge(ie.throw(se))}catch(Ye){We(Ye)}},Ge=se=>se.done?be(se.value):Promise.resolve(se.value).then(Tt,It);Ge((ie=ie.apply(re,ne)).next())});var ne=document.createElement("style");ne.textContent=`._spinner_1waxg_1{height:100%;width:100%}@keyframes _spin_1waxg_1{to{transform:rotate(360deg)}}._spinner_1waxg_1{animation:_spin_1waxg_1 1s linear infinite;fill:#9ca3af;--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}._spinner_1waxg_1:is(._dark_1waxg_1 *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}._spinnerContainer_1waxg_5{height:40px;width:40px}._success_1waxg_9{position:absolute;top:50%;left:50%;width:1.5rem;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));fill:#16a34a}._successContainer_1waxg_13{position:relative;display:grid;height:2.25rem;width:2.25rem;flex:none;place-items:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(232 250 240 / var(--tw-bg-opacity, 1))}._successContainer_1waxg_13:is(._dark_1waxg_1 *){--tw-bg-opacity: 1;background-color:rgb(209 244 224 / var(--tw-bg-opacity, 1))}._container_1waxg_17{width:30px;height:20px;display:flex;margin:0 1px;align-items:center;justify-content:center}._card_1waxg_26{width:28px;height:19px;display:flex;margin:0 1px;align-items:center;justify-content:center}._warning_1waxg_35{width:16px;height:16px;display:flex;align-items:center;justify-content:center}._svg_1waxg_43{width:100%;height:100%}._srOnly_1waxg_48{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}._loader_nwq3e_1{position:absolute;height:100%;top:0;left:0;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:1000;display:flex;width:100%;align-items:center;justify-content:center;border-radius:10px}._checkout_5sq3n_1{overflow:hidden;z-index:0;position:relative;height:auto;min-height:40px;width:100%;max-width:640px}._hidden_5sq3n_7{display:none!important}._formInitial_5sq3n_11{opacity:0;transform:translateY(100px)}._btnsInitial_5sq3n_16{opacity:0;transform:translateY(-100px)}._buttons_1i8cu_1{display:grid;gap:.5rem}._hidden_1i8cu_5{display:none!important}._applePay_1y98r_1:hover{filter:contrast(.575) brightness(1.2)}._hidden_1y98r_22,._hidden_1xmjo_17{display:none!important}._hidden_7twkb_8{display:none}._button_1br9w_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:1rem;line-height:1.5rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_1br9w_1{transition-property:none}}._button_1br9w_1 span{margin-left:.25rem}._button_1br9w_1:hover{opacity:.7}._press_1br9w_21{transform:scale(.95)}._venmo_w4oaz_1{display:block;justify-items:center;align-content:center;overflow:hidden;border-radius:12px;height:40px;background-color:#0088f7;width:100%;color:#fff;font-size:16px;text-align:center;cursor:pointer;transition:background-color .3s ease;svg{height:40%}&:hover{background-color:#5683c1}}._hidden_w4oaz_26{display:none}._button_125my_1{cursor:pointer}._button_rx9be_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_rx9be_1{transition-property:none}}._button_rx9be_1 span{margin-left:.25rem}._disabled_rx9be_17,._button_rx9be_1:hover{opacity:.7}._press_rx9be_22{transform:scale(.95)}._hidden_rx9be_26{display:none!important}._spinner_rx9be_30{width:24px;height:24px}._cardForm_isqbi_1{display:grid;gap:.75rem;padding-top:0}._hidden_isqbi_5{display:none!important}._wrapper_4knhb_1{position:relative}._inputContainer_4knhb_5{background-color:transparent;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;padding-right:.75rem}._inputContainer_4knhb_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_4knhb_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_4knhb_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_4knhb_5{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){._inputContainer_4knhb_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_4knhb_10,._inputContainer_4knhb_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._input_4knhb_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_4knhb_20{display:flex}._errorInput_4knhb_24{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_4knhb_24:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_4knhb_24:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._label_4knhb_28{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_4knhb_32{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_4knhb_36{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_4knhb_40{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_4knhb_47{display:none!important}._wrapper_j8wuo_1{position:relative}._inputContainer_j8wuo_5{background-color:transparent;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;padding-right:.75rem}._inputContainer_j8wuo_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_j8wuo_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_j8wuo_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_j8wuo_5{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){._inputContainer_j8wuo_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_j8wuo_10,._inputContainer_j8wuo_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._input_j8wuo_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_j8wuo_20{display:flex}._errorInput_j8wuo_24{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_j8wuo_24:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_j8wuo_24:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_j8wuo_24{margin-top:.25rem;margin-bottom:0;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_j8wuo_32{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_j8wuo_36{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_j8wuo_40{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_j8wuo_44{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_j8wuo_51{display:none!important}._wrapper_1xdj3_1{position:relative}._inputContainer_1xdj3_5{background-color:transparent;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;padding-right:.75rem}._inputContainer_1xdj3_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1xdj3_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1xdj3_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1xdj3_5{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){._inputContainer_1xdj3_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_1xdj3_10,._inputContainer_1xdj3_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._input_1xdj3_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_1xdj3_20{display:flex;align-items:center;justify-content:center}._errorInput_1xdj3_24{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_1xdj3_24:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_1xdj3_24:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_1xdj3_24{margin-top:.25rem;margin-bottom:0;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_1xdj3_32{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_1xdj3_36{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_1xdj3_40{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_1xdj3_44{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_1xdj3_51{display:none!important}._securityContent_1xdj3_55{display:grid;grid-column-gap:5px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,auto))}._container_94v1h_1{display:flex;width:100%;flex-grow:1;flex-direction:row;align-items:center;justify-content:flex-start;-moz-column-gap:.25rem;column-gap:.25rem;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(254 231 239 / var(--tw-bg-opacity, 1));padding:.75rem 1rem}._container_94v1h_1:is(._dark_94v1h_1 *){background-color:#fee7ef80;--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}._container_94v1h_1 svg{width:16px;height:16px}._title_94v1h_10{padding:0;padding-left:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:300;--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}._title_94v1h_10:is(._dark_94v1h_1 *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}._container_hoha1_1{display:flex;width:100%;flex-direction:column;align-items:center;justify-content:center}._title_hoha1_5{margin-top:.5rem;font-weight:300}
1
+ (function(re,ne){typeof exports=="object"&&typeof module!="undefined"?ne(exports):typeof define=="function"&&define.amd?define(["exports"],ne):(re=typeof globalThis!="undefined"?globalThis:re||self,ne(re["PayNext TS SDK"]={}))})(this,function(re){"use strict";var Ac=Object.defineProperty,Tc=Object.defineProperties;var Ic=Object.getOwnPropertyDescriptors;var At=Object.getOwnPropertySymbols;var Ui=Object.prototype.hasOwnProperty,Bi=Object.prototype.propertyIsEnumerable;var Er=(re,ne,ie)=>ne in re?Ac(re,ne,{enumerable:!0,configurable:!0,writable:!0,value:ie}):re[ne]=ie,j=(re,ne)=>{for(var ie in ne||(ne={}))Ui.call(ne,ie)&&Er(re,ie,ne[ie]);if(At)for(var ie of At(ne))Bi.call(ne,ie)&&Er(re,ie,ne[ie]);return re},X=(re,ne)=>Tc(re,Ic(ne));var Ce=(re,ne)=>{var ie={};for(var be in re)Ui.call(re,be)&&ne.indexOf(be)<0&&(ie[be]=re[be]);if(re!=null&&At)for(var be of At(re))ne.indexOf(be)<0&&Bi.call(re,be)&&(ie[be]=re[be]);return ie};var y=(re,ne,ie)=>Er(re,typeof ne!="symbol"?ne+"":ne,ie);var z=(re,ne,ie)=>new Promise((be,We)=>{var Tt=se=>{try{Ge(ie.next(se))}catch(Ye){We(Ye)}},It=se=>{try{Ge(ie.throw(se))}catch(Ye){We(Ye)}},Ge=se=>se.done?be(se.value):Promise.resolve(se.value).then(Tt,It);Ge((ie=ie.apply(re,ne)).next())});var ne=document.createElement("style");ne.textContent=`._spinner_1waxg_1{height:100%;width:100%}@keyframes _spin_1waxg_1{to{transform:rotate(360deg)}}._spinner_1waxg_1{animation:_spin_1waxg_1 1s linear infinite;fill:#9ca3af;--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}._spinner_1waxg_1:is(._dark_1waxg_1 *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}._spinnerContainer_1waxg_5{height:40px;width:40px}._success_1waxg_9{position:absolute;top:50%;left:50%;width:1.5rem;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));fill:#16a34a}._successContainer_1waxg_13{position:relative;display:grid;height:2.25rem;width:2.25rem;flex:none;place-items:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(232 250 240 / var(--tw-bg-opacity, 1))}._successContainer_1waxg_13:is(._dark_1waxg_1 *){--tw-bg-opacity: 1;background-color:rgb(209 244 224 / var(--tw-bg-opacity, 1))}._container_1waxg_17{width:30px;height:20px;display:flex;margin:0 1px;align-items:center;justify-content:center}._card_1waxg_26{width:28px;height:19px;display:flex;margin:0 1px;align-items:center;justify-content:center}._warning_1waxg_35{width:16px;height:16px;display:flex;align-items:center;justify-content:center}._svg_1waxg_43{width:100%;height:100%}._srOnly_1waxg_48{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}._loader_nwq3e_1{position:absolute;height:100%;top:0;left:0;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:1000;display:flex;width:100%;align-items:center;justify-content:center;border-radius:10px}._checkout_5sq3n_1{overflow:hidden;z-index:0;position:relative;height:auto;min-height:40px;width:100%;max-width:640px}._hidden_5sq3n_7{display:none!important}._formInitial_5sq3n_11{opacity:0;transform:translateY(100px)}._btnsInitial_5sq3n_16{opacity:0;transform:translateY(-100px)}._buttons_1i8cu_1{display:grid;gap:.5rem}._hidden_1i8cu_5{display:none!important}._applePay_1g5vd_1{display:flex}._applePay_1g5vd_1:hover{filter:contrast(.575) brightness(1.2)}._hidden_1g5vd_24,._hidden_1xmjo_17{display:none!important}._paypal_2zo1j_1{display:flex}._hidden_2zo1j_10{display:none}._button_1br9w_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:1rem;line-height:1.5rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_1br9w_1{transition-property:none}}._button_1br9w_1 span{margin-left:.25rem}._button_1br9w_1:hover{opacity:.7}._press_1br9w_21{transform:scale(.95)}._venmo_1ihvb_1{display:flex;justify-content:center;align-items:center;overflow:hidden;border-radius:12px;height:40px;background-color:#0088f7;width:100%;color:#fff;font-size:16px;text-align:center;cursor:pointer;transition:background-color .3s ease;svg{height:40%}&:hover{background-color:#5683c1}}._hidden_1ihvb_26{display:none}._button_125my_1{cursor:pointer}._button_rx9be_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_rx9be_1{transition-property:none}}._button_rx9be_1 span{margin-left:.25rem}._disabled_rx9be_17,._button_rx9be_1:hover{opacity:.7}._press_rx9be_22{transform:scale(.95)}._hidden_rx9be_26{display:none!important}._spinner_rx9be_30{width:24px;height:24px}._cardForm_isqbi_1{display:grid;gap:.75rem;padding-top:0}._hidden_isqbi_5{display:none!important}._wrapper_4knhb_1{position:relative}._inputContainer_4knhb_5{background-color:transparent;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;padding-right:.75rem}._inputContainer_4knhb_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_4knhb_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_4knhb_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_4knhb_5{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){._inputContainer_4knhb_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_4knhb_10,._inputContainer_4knhb_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._input_4knhb_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_4knhb_20{display:flex}._errorInput_4knhb_24{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_4knhb_24:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_4knhb_24:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._label_4knhb_28{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_4knhb_32{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_4knhb_36{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_4knhb_40{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_4knhb_47{display:none!important}._wrapper_j8wuo_1{position:relative}._inputContainer_j8wuo_5{background-color:transparent;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;padding-right:.75rem}._inputContainer_j8wuo_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_j8wuo_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_j8wuo_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_j8wuo_5{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){._inputContainer_j8wuo_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_j8wuo_10,._inputContainer_j8wuo_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._input_j8wuo_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_j8wuo_20{display:flex}._errorInput_j8wuo_24{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_j8wuo_24:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_j8wuo_24:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_j8wuo_24{margin-top:.25rem;margin-bottom:0;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_j8wuo_32{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_j8wuo_36{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_j8wuo_40{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_j8wuo_44{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_j8wuo_51{display:none!important}._wrapper_1xdj3_1{position:relative}._inputContainer_1xdj3_5{background-color:transparent;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;padding-right:.75rem}._inputContainer_1xdj3_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1xdj3_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1xdj3_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1xdj3_5{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){._inputContainer_1xdj3_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_1xdj3_10,._inputContainer_1xdj3_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._input_1xdj3_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_1xdj3_20{display:flex;align-items:center;justify-content:center}._errorInput_1xdj3_24{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_1xdj3_24:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_1xdj3_24:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_1xdj3_24{margin-top:.25rem;margin-bottom:0;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_1xdj3_32{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_1xdj3_36{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_1xdj3_40{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_1xdj3_44{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_1xdj3_51{display:none!important}._securityContent_1xdj3_55{display:grid;grid-column-gap:5px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,auto))}._container_94v1h_1{display:flex;width:100%;flex-grow:1;flex-direction:row;align-items:center;justify-content:flex-start;-moz-column-gap:.25rem;column-gap:.25rem;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(254 231 239 / var(--tw-bg-opacity, 1));padding:.75rem 1rem}._container_94v1h_1:is(._dark_94v1h_1 *){background-color:#fee7ef80;--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}._container_94v1h_1 svg{width:16px;height:16px}._title_94v1h_10{padding:0;padding-left:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:300;--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}._title_94v1h_10:is(._dark_94v1h_1 *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}._container_hoha1_1{display:flex;width:100%;flex-direction:column;align-items:center;justify-content:center}._title_hoha1_5{margin-top:.5rem;font-weight:300}
2
2
  /*$vite$:1*/`,document.head.appendChild(ne);let ie=null;function be(){return z(this,null,function*(){return ie||(ie=new Promise((r,t)=>{const e=document.createElement("script");if(e.src="https://js.evervault.com/v2",e.onload=()=>r(),e.onerror=()=>{ie=null,t()},!document.head)throw new Error("Expected document.head not to be null. Evervault.js requires a <head> element.");document.head.appendChild(e)}),ie)})}function We(){return z(this,null,function*(){if(window.Evervault)return window.Evervault;try{return yield be(),window.Evervault}catch(r){throw new Error("Failed to load Evervault.js")}})}function Tt(r,t,e){return z(this,null,function*(){const n=yield We();return new n(r,t,e)})}Promise.resolve().then(()=>{We()});let It=class{constructor(t){y(this,"apple",null);y(this,"isAvailable",!1);y(this,"onReady");this.ev=t}init(c,d){return z(this,arguments,function*({transaction:t,locale:e,supportedCardTypes:n,onReady:i,onError:a,onSuccess:s,onCancel:o},l){const u=this.ev.transactions.create(t);this.apple=this.ev.ui.applePay(u,X(j({locale:e,borderRadius:12,size:{width:"100%",height:"40px"}},l==null?void 0:l.styles),{allowedCardNetworks:n,requestBillingAddress:!0,requestPayerDetails:["name","email","phone"],process:(f,v)=>z(this,[f,v],function*(p,{fail:m}){try{s==null||s(p)}catch(b){console.error(b),m({message:"Cannot pay with payment credentials"})}})}));const h=yield this.apple.availability();this.isAvailable=!0,console.log("Apple Pay availability",h),this.isAvailable||console.error("Apple Pay is not available",h),a&&this.apple.on("error",a),o&&this.apple.on("cancel",o),this.onReady=i})}render(t){return z(this,null,function*(){var e;!this.apple||!this.isAvailable||(t.innerHTML="",yield this.apple.mount(t),(e=this.onReady)==null||e.call(this))})}},Ge=class{constructor(t){y(this,"google",null);this.ev=t}init(l,c){return z(this,arguments,function*({transaction:t,locale:e,onReady:n,onError:i,onSuccess:a,onCancel:s},o){const d=this.ev.transactions.create(t);this.google=this.ev.ui.googlePay(d,X(j({locale:e,size:{width:"100%",height:"42px"},borderRadius:12,billingAddress:{phoneNumber:!0}},o==null?void 0:o.styles),{process:(p,m)=>z(this,[p,m],function*(u,{fail:h}){try{a==null||a(u)}catch(f){console.error(f),h({message:"Cannot pay with payment credentials"})}})})),s&&this.google.on("cancel",s),n&&this.google.on("ready",n),i&&this.google.on("error",i)})}render(t){return z(this,null,function*(){this.google&&(t.innerHTML="",this.google.mount(t))})}};class se{constructor(){y(this,"listeners",[])}removeListener(t){this.listeners=this.listeners.filter(e=>e!==t)}addListener(t){return this.listeners.push(t),()=>this.removeListener(t)}emit(t){for(const e of this.listeners)e(t)}clear(){this.listeners=[]}}class Ye{constructor(t){y(this,"threeDs",null);this.ev=t}init(a){return z(this,arguments,function*({threeDsId:t,onReady:e,onSuccess:n,onError:i}){this.threeDs=this.ev.ui.threeDSecure(t),this.threeDs.on("ready",()=>e==null?void 0:e()),this.threeDs.on("success",()=>n==null?void 0:n()),this.threeDs.on("failure",()=>i==null?void 0:i()),this.threeDs.on("error",()=>i==null?void 0:i())})}render(t){return z(this,null,function*(){this.threeDs&&this.threeDs.mount(t)})}}class ji{constructor(){y(this,"isReady",!1);y(this,"ev",null);y(this,"apple",null);y(this,"google",null);y(this,"threeDs",null);y(this,"events",{ready:new se})}isShouldLoad({teamId:t,appId:e}){var n,i;return((n=this.ev)==null?void 0:n.config.appId)!==e||((i=this.ev)==null?void 0:i.config.teamId)!==t}initEv(t){return z(this,null,function*(){this.isShouldLoad(t)&&(this.isReady=!1,this.ev=yield Tt(t.teamId,t.appId),this.apple=new It(this.ev),this.google=new Ge(this.ev),this.events.ready.emit(),this.isReady=!0)})}initThreeDs(t){return z(this,null,function*(){if(!this.ev)throw new Error("Evervault should be init before using Three DS Secure");this.threeDs=new Ye(this.ev),yield this.threeDs.init(t),yield this.threeDs.render()})}initApple(t,e){return z(this,null,function*(){if(!this.apple)throw new Error("Evervault should be init before using Apple Pay");yield this.apple.init(t,e)})}initGoogle(t,e){return z(this,null,function*(){if(!this.google)throw new Error("Evervault should be init before using Google Pay");yield this.google.init(t,e)})}isAppleAvailable(){var t;return!!((t=this.apple)!=null&&t.isAvailable)}addEventListener(t,e){return this.events[t].addListener(e)}renderApple(t){return z(this,null,function*(){var e;return yield(e=this.apple)==null?void 0:e.render(t)})}renderGoogle(t){return z(this,null,function*(){var e;return yield(e=this.google)==null?void 0:e.render(t)})}getEv(){if(!this.ev)throw new Error("Evervault should be init before getting instance");return this.ev}}function xt(r){return typeof r=="object"&&!Array.isArray(r)}function zi(r,t,e){var n;if(r instanceof EventTarget)return[r];if(typeof r=="string"){let i=document;const a=(n=e==null?void 0:e[r])!=null?n:i.querySelectorAll(r);return a?Array.from(a):[]}return Array.from(r)}function Cr(r,t,e,n){return typeof r=="string"&&xt(t)?zi(r,e,n):r instanceof NodeList?Array.from(r):Array.isArray(r)?r:[r]}function Ki(r,t,e){return r*(t+1)}function wr(r,t,e,n){var i;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,r+parseFloat(t)):t==="<"?e:(i=n.get(t))!=null?i:r}const $e=(r,t,e)=>r+(t-r)*e,qi=(r,t,e)=>{const n=t-r;return((e-r)%n+n)%n+r},Ar=r=>Array.isArray(r)&&typeof r[0]!="number";function Tr(r,t){return Ar(r)?r[qi(0,r.length,t)]:r}function Hi(r,t){r.indexOf(t)===-1&&r.push(t)}function Ir(r,t){const e=r.indexOf(t);e>-1&&r.splice(e,1)}function Wi(r,t,e){for(let n=0;n<r.length;n++){const i=r[n];i.at>t&&i.at<e&&(Ir(r,i),n--)}}function Gi(r,t,e,n,i,a){Wi(r,i,a);for(let s=0;s<t.length;s++)r.push({value:t[s],at:$e(i,a,n[s]),easing:Tr(e,s)})}function Yi(r,t){for(let e=0;e<r.length;e++)r[e]=r[e]/(t+1)}function $i(r,t){return r.at===t.at?r.value===null?1:t.value===null?-1:0:r.at-t.at}const ve=r=>!!(r&&r.getVelocity),Ot=(r,t,e)=>{const n=t-r;return n===0?1:(e-r)/n};function xr(r,t){const e=r[r.length-1];for(let n=1;n<=t;n++){const i=Ot(0,t,n);r.push($e(e,1,i))}}function Or(r){const t=[0];return xr(t,r.length-1),t}function Nt(r){return typeof r=="function"&&"applyToOptions"in r}const pt=2e4;function Lt(r){let t=0;const e=50;let n=r.next(t);for(;!n.done&&t<pt;)t+=e,n=r.next(t);return t>=pt?1/0:t}const Ee=r=>r*1e3,Te=r=>r/1e3;function Nr(r,t=100,e){const n=e(X(j({},r),{keyframes:[0,t]})),i=Math.min(Lt(n),pt);return{type:"keyframes",ease:a=>n.next(i*a).value/t,duration:Te(i)}}let Qe=()=>{},Ie=()=>{};process.env.NODE_ENV!=="production"&&(Qe=(r,t)=>{!r&&typeof console!="undefined"&&console.warn(t)},Ie=(r,t)=>{if(!r)throw new Error(t)});const Qi="easeInOut",Zi=20;function Xi(r,a={},n,i){var s=a,{defaultTransition:t={}}=s,e=Ce(s,["defaultTransition"]);const o=t.duration||.3,l=new Map,c=new Map,d={},u=new Map;let h=0,p=0,m=0;for(let f=0;f<r.length;f++){const v=r[f];if(typeof v=="string"){u.set(v,p);continue}else if(!Array.isArray(v)){u.set(v.name,wr(p,v.at,h,u));continue}let[b,A,T={}]=v;T.at!==void 0&&(p=wr(p,T.at,h,u));let L=0;const C=(I,x,P,U=0,H=0)=>{const W=Ji(I),V=x,{delay:S=0,times:F=Or(W),type:q="keyframes",repeat:ee,repeatType:M,repeatDelay:$=0}=V,K=Ce(V,["delay","times","type","repeat","repeatType","repeatDelay"]);let{ease:g=t.ease||"easeOut",duration:_}=x;const R=typeof S=="function"?S(U,H):S,B=W.length,E=Nt(q)?q:i==null?void 0:i[q];if(B<=2&&E){let N=100;if(B===2&&ra(W)){const de=W[1]-W[0];N=Math.abs(de)}const G=j({},K);_!==void 0&&(G.duration=Ee(_));const J=Nr(G,N,E);g=J.ease,_=J.duration}_!=null||(_=o);const O=p+R;F.length===1&&F[0]===0&&(F[1]=1);const w=F.length-W.length;if(w>0&&xr(F,w),W.length===1&&W.unshift(null),ee){Ie(ee<Zi,"Repeat count too high, must be less than 20"),_=Ki(_,ee);const N=[...W],G=[...F];g=Array.isArray(g)?[...g]:[g];const J=[...g];for(let de=0;de<ee;de++){W.push(...N);for(let D=0;D<N.length;D++)F.push(G[D]+(de+1)),g.push(D===0?"linear":Tr(J,D-1))}Yi(F,ee)}const k=O+_;Gi(P,W,g,F,O,k),L=Math.max(R+_,L),m=Math.max(k,m)};if(ve(b)){const I=Lr(b,c);C(A,T,kr("default",I))}else{const I=Cr(b,A,n,d),x=I.length;for(let P=0;P<x;P++){A=A,T=T;const U=I[P],H=Lr(U,c);for(const W in A)C(A[W],ea(T,W),kr(W,H),P,x)}}h=p,p+=L}return c.forEach((f,v)=>{for(const b in f){const A=f[b];A.sort($i);const T=[],L=[],C=[];for(let x=0;x<A.length;x++){const{at:P,value:U,easing:H}=A[x];T.push(U),L.push(Ot(0,m,P)),C.push(H||"easeOut")}L[0]!==0&&(L.unshift(0),T.unshift(T[0]),C.unshift(Qi)),L[L.length-1]!==1&&(L.push(1),T.push(null)),l.has(v)||l.set(v,{keyframes:{},transition:{}});const I=l.get(v);I.keyframes[b]=T,I.transition[b]=j(X(j({},t),{duration:m,ease:C,times:L}),e)}}),l}function Lr(r,t){return!t.has(r)&&t.set(r,{}),t.get(r)}function kr(r,t){return t[r]||(t[r]=[]),t[r]}function Ji(r){return Array.isArray(r)?r:[r]}function ea(r,t){return r&&r[t]?j(j({},r),r[t]):j({},r)}const ta=r=>typeof r=="number",ra=r=>r.every(ta),Ze=new WeakMap,na=r=>Array.isArray(r);function Pr(r){const t=[{},{}];return r==null||r.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Rr(r,t,e,n){if(typeof t=="function"){const[i,a]=Pr(n);t=t(e!==void 0?e:r.custom,i,a)}if(typeof t=="string"&&(t=r.variants&&r.variants[t]),typeof t=="function"){const[i,a]=Pr(n);t=t(e!==void 0?e:r.custom,i,a)}return t}function ia(r,t,e){const n=r.getProps();return Rr(n,t,n.custom,r)}const ht=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function aa(r,t){let e=new Set,n=new Set,i=!1,a=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){s.has(d)&&(c.schedule(d),r()),d(o)}const c={schedule:(d,u=!1,h=!1)=>{const m=h&&i?e:n;return u&&s.add(d),m.has(d)||m.add(d),d},cancel:d=>{n.delete(d),s.delete(d)},process:d=>{if(o=d,i){a=!0;return}i=!0,[e,n]=[n,e],e.forEach(l),e.clear(),i=!1,a&&(a=!1,c.process(d))}};return c}const xe={},sa=40;function oa(r,t){let e=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>e=!0,s=ht.reduce((T,L)=>(T[L]=aa(a),T),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:h,render:p,postRender:m}=s,f=()=>{const T=xe.useManualTiming?i.timestamp:performance.now();e=!1,xe.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(T-i.timestamp,sa),1)),i.timestamp=T,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),d.process(i),u.process(i),h.process(i),p.process(i),m.process(i),i.isProcessing=!1,e&&t&&(n=!1,r(f))},v=()=>{e=!0,n=!0,i.isProcessing||r(f)};return{schedule:ht.reduce((T,L)=>{const C=s[L];return T[L]=(I,x=!1,P=!1)=>(e||v(),C.schedule(I,x,P)),T},{}),cancel:T=>{for(let L=0;L<ht.length;L++)s[ht[L]].cancel(T)},state:i,steps:s}}const De=r=>r,{schedule:Oe,cancel:kt,state:mt}=oa(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:De,!0);let ft;function la(){ft=void 0}const ye={now:()=>(ft===void 0&&ye.set(mt.isProcessing||xe.useManualTiming?mt.timestamp:performance.now()),ft),set:r=>{ft=r,queueMicrotask(la)}},Mr=new Set;function Sr(r,t,e){r||Mr.has(t)||(console.warn(t),Mr.add(t))}class Dr{constructor(){this.subscriptions=[]}add(t){return Hi(this.subscriptions,t),()=>Ir(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,e,n);else for(let a=0;a<i;a++){const s=this.subscriptions[a];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Vr(r,t){return t?r*(1e3/t):0}const Fr=30,ca=r=>!isNaN(parseFloat(r));class da{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{var s,o;const a=ye.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty();i&&((o=this.events.renderRequest)==null||o.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=ye.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ca(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Sr(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Dr);const n=this.events[t].add(e);return t==="change"?()=>{n(),Oe.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){!e||!this.passiveEffect?this.updateAndNotify(t,e):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ye.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Fr)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,Fr);return Vr(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,e;(t=this.dependents)==null||t.clear(),(e=this.events.destroy)==null||e.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Xe(r,t){return new da(r,t)}function ua(r,t,e){r.hasValue(t)?r.getValue(t).set(e):r.addValue(t,Xe(e))}function pa(r){return na(r)?r[r.length-1]||0:r}function ha(r,t){let s=ia(r,t)||{},{transitionEnd:n={},transition:i={}}=s,a=Ce(s,["transitionEnd","transition"]);a=j(j({},a),n);for(const o in a){const l=pa(a[o]);ua(r,o,l)}}function ma(r){return!!(ve(r)&&r.add)}function fa(r,t){const e=r.getValue("willChange");if(ma(e))return e.add(t);if(!e&&xe.WillChange){const n=new xe.WillChange("auto");r.addValue("willChange",n),n.add(t)}}const Pt=r=>r.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),va="data-"+Pt("framerAppearId");function ga(r){return r.props[va]}const ba=r=>r!==null;function ya(r,{repeat:t,repeatType:e="loop"},n){const i=r.filter(ba),a=t&&e!=="loop"&&t%2===1?0:i.length-1;return i[a]}const Ve=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Fe=new Set(Ve),_a={type:"spring",stiffness:500,damping:25,restSpeed:10},Ea=r=>({type:"spring",stiffness:550,damping:r===0?2*Math.sqrt(550):30,restSpeed:10}),Ca={type:"keyframes",duration:.8},wa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Aa=(r,{keyframes:t})=>t.length>2?Ca:Fe.has(r)?r.startsWith("scale")?Ea(t[1]):_a:wa;function Ta(u){var h=u,{when:r,delay:t,delayChildren:e,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:l,elapsed:c}=h,d=Ce(h,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(d).length}function Ur(r,t){var e,n;return(n=(e=r==null?void 0:r[t])!=null?e:r==null?void 0:r.default)!=null?n:r}const Br=r=>t=>typeof t=="string"&&t.startsWith(r),jr=Br("--"),Ia=Br("var(--"),Rt=r=>Ia(r)?xa.test(r.split("/*")[0].trim()):!1,xa=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ke=(r,t,e)=>e>t?t:e<r?r:e,Ue={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Je=X(j({},Ue),{transform:r=>ke(0,1,r)}),vt=X(j({},Ue),{default:1}),et=r=>Math.round(r*1e5)/1e5,Mt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Oa(r){return r==null}const Na=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,St=(r,t)=>e=>!!(typeof e=="string"&&Na.test(e)&&e.startsWith(r)||t&&!Oa(e)&&Object.prototype.hasOwnProperty.call(e,t)),zr=(r,t,e)=>n=>{if(typeof n!="string")return n;const[i,a,s,o]=n.match(Mt);return{[r]:parseFloat(i),[t]:parseFloat(a),[e]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},La=r=>ke(0,255,r),Dt=X(j({},Ue),{transform:r=>Math.round(La(r))}),Pe={test:St("rgb","red"),parse:zr("red","green","blue"),transform:({red:r,green:t,blue:e,alpha:n=1})=>"rgba("+Dt.transform(r)+", "+Dt.transform(t)+", "+Dt.transform(e)+", "+et(Je.transform(n))+")"};function ka(r){let t="",e="",n="",i="";return r.length>5?(t=r.substring(1,3),e=r.substring(3,5),n=r.substring(5,7),i=r.substring(7,9)):(t=r.substring(1,2),e=r.substring(2,3),n=r.substring(3,4),i=r.substring(4,5),t+=t,e+=e,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(e,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Vt={test:St("#"),parse:ka,transform:Pe.transform},tt=r=>({test:t=>typeof t=="string"&&t.endsWith(r)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${r}`}),Ne=tt("deg"),Be=tt("%"),Q=tt("px"),Pa=tt("vh"),Ra=tt("vw"),Kr=X(j({},Be),{parse:r=>Be.parse(r)/100,transform:r=>Be.transform(r*100)}),je={test:St("hsl","hue"),parse:zr("hue","saturation","lightness"),transform:({hue:r,saturation:t,lightness:e,alpha:n=1})=>"hsla("+Math.round(r)+", "+Be.transform(et(t))+", "+Be.transform(et(e))+", "+et(Je.transform(n))+")"},me={test:r=>Pe.test(r)||Vt.test(r)||je.test(r),parse:r=>Pe.test(r)?Pe.parse(r):je.test(r)?je.parse(r):Vt.parse(r),transform:r=>typeof r=="string"?r:r.hasOwnProperty("red")?Pe.transform(r):je.transform(r)},Ma=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Sa(r){var t,e;return isNaN(r)&&typeof r=="string"&&(((t=r.match(Mt))==null?void 0:t.length)||0)+(((e=r.match(Ma))==null?void 0:e.length)||0)>0}const qr="number",Hr="color",Da="var",Va="var(",Wr="${}",Fa=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function rt(r){const t=r.toString(),e=[],n={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(Fa,l=>(me.test(l)?(n.color.push(a),i.push(Hr),e.push(me.parse(l))):l.startsWith(Va)?(n.var.push(a),i.push(Da),e.push(l)):(n.number.push(a),i.push(qr),e.push(parseFloat(l))),++a,Wr)).split(Wr);return{values:e,split:o,indexes:n,types:i}}function Gr(r){return rt(r).values}function Yr(r){const{split:t,types:e}=rt(r),n=t.length;return i=>{let a="";for(let s=0;s<n;s++)if(a+=t[s],i[s]!==void 0){const o=e[s];o===qr?a+=et(i[s]):o===Hr?a+=me.transform(i[s]):a+=i[s]}return a}}const Ua=r=>typeof r=="number"?0:r;function Ba(r){const t=Gr(r);return Yr(r)(t.map(Ua))}const ze={test:Sa,parse:Gr,createTransformer:Yr,getAnimatableNone:Ba};function Ft(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*(2/3-e)*6:r}function ja({hue:r,saturation:t,lightness:e,alpha:n}){r/=360,t/=100,e/=100;let i=0,a=0,s=0;if(!t)i=a=s=e;else{const o=e<.5?e*(1+t):e+t-e*t,l=2*e-o;i=Ft(l,o,r+1/3),a=Ft(l,o,r),s=Ft(l,o,r-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:n}}function gt(r,t){return e=>e>0?t:r}const Ut=(r,t,e)=>{const n=r*r,i=e*(t*t-n)+n;return i<0?0:Math.sqrt(i)},za=[Vt,Pe,je],Ka=r=>za.find(t=>t.test(r));function $r(r){const t=Ka(r);if(Qe(!!t,`'${r}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let e=t.parse(r);return t===je&&(e=ja(e)),e}const Qr=(r,t)=>{const e=$r(r),n=$r(t);if(!e||!n)return gt(r,t);const i=j({},e);return a=>(i.red=Ut(e.red,n.red,a),i.green=Ut(e.green,n.green,a),i.blue=Ut(e.blue,n.blue,a),i.alpha=$e(e.alpha,n.alpha,a),Pe.transform(i))},Bt=new Set(["none","hidden"]);function qa(r,t){return Bt.has(r)?e=>e<=0?r:t:e=>e>=1?t:r}const Ha=(r,t)=>e=>t(r(e)),jt=(...r)=>r.reduce(Ha);function Wa(r,t){return e=>$e(r,t,e)}function zt(r){return typeof r=="number"?Wa:typeof r=="string"?Rt(r)?gt:me.test(r)?Qr:$a:Array.isArray(r)?Zr:typeof r=="object"?me.test(r)?Qr:Ga:gt}function Zr(r,t){const e=[...r],n=e.length,i=r.map((a,s)=>zt(a)(a,t[s]));return a=>{for(let s=0;s<n;s++)e[s]=i[s](a);return e}}function Ga(r,t){const e=j(j({},r),t),n={};for(const i in e)r[i]!==void 0&&t[i]!==void 0&&(n[i]=zt(r[i])(r[i],t[i]));return i=>{for(const a in n)e[a]=n[a](i);return e}}function Ya(r,t){var i;const e=[],n={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const s=t.types[a],o=r.indexes[s][n[s]],l=(i=r.values[o])!=null?i:0;e[a]=l,n[s]++}return e}const $a=(r,t)=>{const e=ze.createTransformer(t),n=rt(r),i=rt(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Bt.has(r)&&!i.values.length||Bt.has(t)&&!n.values.length?qa(r,t):jt(Zr(Ya(n,i),i.values),e):(Qe(!0,`Complex values '${r}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),gt(r,t))};function Xr(r,t,e){return typeof r=="number"&&typeof t=="number"&&typeof e=="number"?$e(r,t,e):zt(r)(r,t)}const Qa=r=>{const t=({timestamp:e})=>r(e);return{start:(e=!0)=>Oe.update(t,e),stop:()=>kt(t),now:()=>mt.isProcessing?mt.timestamp:ye.now()}},Jr=(r,t,e=10)=>{let n="";const i=Math.max(Math.round(t/e),2);for(let a=0;a<i;a++)n+=r(a/(i-1))+", ";return`linear(${n.substring(0,n.length-2)})`},Za=5;function en(r,t,e){const n=Math.max(t-Za,0);return Vr(e-r(n),t-n)}const le={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},tn=.001;function Xa({duration:r=le.duration,bounce:t=le.bounce,velocity:e=le.velocity,mass:n=le.mass}){let i,a;Qe(r<=Ee(le.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ke(le.minDamping,le.maxDamping,s),r=ke(le.minDuration,le.maxDuration,Te(r)),s<1?(i=c=>{const d=c*s,u=d*r,h=d-e,p=Kt(c,s),m=Math.exp(-u);return tn-h/p*m},a=c=>{const u=c*s*r,h=u*e+e,p=Math.pow(s,2)*Math.pow(c,2)*r,m=Math.exp(-u),f=Kt(Math.pow(c,2),s);return(-i(c)+tn>0?-1:1)*((h-p)*m)/f}):(i=c=>{const d=Math.exp(-c*r),u=(c-e)*r+1;return-.001+d*u},a=c=>{const d=Math.exp(-c*r),u=(e-c)*(r*r);return d*u});const o=5/r,l=es(i,a,o);if(r=Ee(r),isNaN(l))return{stiffness:le.stiffness,damping:le.damping,duration:r};{const c=Math.pow(l,2)*n;return{stiffness:c,damping:s*2*Math.sqrt(n*c),duration:r}}}const Ja=12;function es(r,t,e){let n=e;for(let i=1;i<Ja;i++)n=n-r(n)/t(n);return n}function Kt(r,t){return r*Math.sqrt(1-t*t)}const ts=["duration","bounce"],rs=["stiffness","damping","mass"];function rn(r,t){return t.some(e=>r[e]!==void 0)}function ns(r){let t=j({velocity:le.velocity,stiffness:le.stiffness,damping:le.damping,mass:le.mass,isResolvedFromDuration:!1},r);if(!rn(r,rs)&&rn(r,ts))if(r.visualDuration){const e=r.visualDuration,n=2*Math.PI/(e*1.2),i=n*n,a=2*ke(.05,1,1-(r.bounce||0))*Math.sqrt(i);t=X(j({},t),{mass:le.mass,stiffness:i,damping:a})}else{const e=Xa(r);t=X(j(j({},t),e),{mass:le.mass}),t.isResolvedFromDuration=!0}return t}function nt(r=le.visualDuration,t=le.bounce){const e=typeof r!="object"?{visualDuration:r,keyframes:[0,1],bounce:t}:r;let{restSpeed:n,restDelta:i}=e;const a=e.keyframes[0],s=e.keyframes[e.keyframes.length-1],o={done:!1,value:a},{stiffness:l,damping:c,mass:d,duration:u,velocity:h,isResolvedFromDuration:p}=ns(X(j({},e),{velocity:-Te(e.velocity||0)})),m=h||0,f=c/(2*Math.sqrt(l*d)),v=s-a,b=Te(Math.sqrt(l/d)),A=Math.abs(v)<5;n||(n=A?le.restSpeed.granular:le.restSpeed.default),i||(i=A?le.restDelta.granular:le.restDelta.default);let T;if(f<1){const C=Kt(b,f);T=I=>{const x=Math.exp(-f*b*I);return s-x*((m+f*b*v)/C*Math.sin(C*I)+v*Math.cos(C*I))}}else if(f===1)T=C=>s-Math.exp(-b*C)*(v+(m+b*v)*C);else{const C=b*Math.sqrt(f*f-1);T=I=>{const x=Math.exp(-f*b*I),P=Math.min(C*I,300);return s-x*((m+f*b*v)*Math.sinh(P)+C*v*Math.cosh(P))/C}}const L={calculatedDuration:p&&u||null,next:C=>{const I=T(C);if(p)o.done=C>=u;else{let x=C===0?m:0;f<1&&(x=C===0?Ee(m):en(T,C,I));const P=Math.abs(x)<=n,U=Math.abs(s-I)<=i;o.done=P&&U}return o.value=o.done?s:I,o},toString:()=>{const C=Math.min(Lt(L),pt),I=Jr(x=>L.next(C*x).value,C,30);return C+"ms "+I},toTransition:()=>{}};return L}nt.applyToOptions=r=>{const t=Nr(r,100,nt);return r.ease=t.ease,r.duration=Ee(t.duration),r.type="keyframes",r};function qt({keyframes:r,velocity:t=0,power:e=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:l,restDelta:c=.5,restSpeed:d}){const u=r[0],h={done:!1,value:u},p=P=>o!==void 0&&P<o||l!==void 0&&P>l,m=P=>o===void 0?l:l===void 0||Math.abs(o-P)<Math.abs(l-P)?o:l;let f=e*t;const v=u+f,b=s===void 0?v:s(v);b!==v&&(f=b-u);const A=P=>-f*Math.exp(-P/n),T=P=>b+A(P),L=P=>{const U=A(P),H=T(P);h.done=Math.abs(U)<=c,h.value=h.done?b:H};let C,I;const x=P=>{p(h.value)&&(C=P,I=nt({keyframes:[h.value,m(h.value)],velocity:en(T,P,h.value),damping:i,stiffness:a,restDelta:c,restSpeed:d}))};return x(0),{calculatedDuration:null,next:P=>{let U=!1;return!I&&C===void 0&&(U=!0,L(P),x(P)),C!==void 0&&P>=C?I.next(P-C):(!U&&L(P),h)}}}function is(r,t,e){const n=[],i=e||xe.mix||Xr,a=r.length-1;for(let s=0;s<a;s++){let o=i(r[s],r[s+1]);if(t){const l=Array.isArray(t)?t[s]||De:t;o=jt(l,o)}n.push(o)}return n}function as(r,t,{clamp:e=!0,ease:n,mixer:i}={}){const a=r.length;if(Ie(a===t.length,"Both input and output ranges must be the same length"),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const s=r[0]===r[1];r[0]>r[a-1]&&(r=[...r].reverse(),t=[...t].reverse());const o=is(t,n,i),l=o.length,c=d=>{if(s&&d<r[0])return t[0];let u=0;if(l>1)for(;u<r.length-2&&!(d<r[u+1]);u++);const h=Ot(r[u],r[u+1],d);return o[u](h)};return e?d=>c(ke(r[0],r[a-1],d)):c}function ss(r,t){return r.map(e=>e*t)}const nn=(r,t,e)=>(((1-3*e+3*t)*r+(3*e-6*t))*r+3*t)*r,os=1e-7,ls=12;function cs(r,t,e,n,i){let a,s,o=0;do s=t+(e-t)/2,a=nn(s,n,i)-r,a>0?e=s:t=s;while(Math.abs(a)>os&&++o<ls);return s}function it(r,t,e,n){if(r===t&&e===n)return De;const i=a=>cs(a,0,1,r,e);return a=>a===0||a===1?a:nn(i(a),t,n)}const ds=it(.42,0,1,1),us=it(0,0,.58,1),an=it(.42,0,.58,1),sn=r=>t=>t<=.5?r(2*t)/2:(2-r(2*(1-t)))/2,on=r=>t=>1-r(1-t),ln=it(.33,1.53,.69,.99),Ht=on(ln),cn=sn(Ht),dn=r=>(r*=2)<1?.5*Ht(r):.5*(2-Math.pow(2,-10*(r-1))),Wt=r=>1-Math.sin(Math.acos(r)),ps=on(Wt),un=sn(Wt),pn=r=>Array.isArray(r)&&typeof r[0]=="number",hn={linear:De,easeIn:ds,easeInOut:an,easeOut:us,circIn:Wt,circInOut:un,circOut:ps,backIn:Ht,backInOut:cn,backOut:ln,anticipate:dn},hs=r=>typeof r=="string",mn=r=>{if(pn(r)){Ie(r.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,e,n,i]=r;return it(t,e,n,i)}else if(hs(r))return Ie(hn[r]!==void 0,`Invalid easing type '${r}'`),hn[r];return r};function ms(r,t){return r.map(()=>t||an).splice(0,r.length-1)}function Ke({duration:r=300,keyframes:t,times:e,ease:n="easeInOut"}){const i=Ar(n)?n.map(mn):mn(n),a={done:!1,value:t[0]},s=ss(e&&e.length===t.length?e:Or(t),r),o=as(s,t,{ease:Array.isArray(i)?i:ms(t,i)});return{calculatedDuration:r,next:l=>(a.value=o(l),a.done=l>=r,a)}}const fs=r=>r!==null;function Gt(r,{repeat:t,repeatType:e="loop"},n,i=1){const a=r.filter(fs),o=i<0||t&&e!=="loop"&&t%2===1?0:a.length-1;return!o||n===void 0?a[o]:n}const vs={decay:qt,inertia:qt,tween:Ke,keyframes:Ke,spring:nt};function fn(r){typeof r.type=="string"&&(r.type=vs[r.type])}class Yt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const gs=r=>r/100;class $t extends Yt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:e}=this.options;e&&e.updatedAt!==ye.now()&&this.tick(ye.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;fn(t);const{type:e=Ke,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=t;let{keyframes:o}=t;const l=e||Ke;process.env.NODE_ENV!=="production"&&l!==Ke&&Ie(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`),l!==Ke&&typeof o[0]!="number"&&(this.mixKeyframes=jt(gs,Xr(o[0],o[1])),o=[0,100]);const c=l(X(j({},t),{keyframes:o}));a==="mirror"&&(this.mirroredGenerator=l(X(j({},t),{keyframes:[...o].reverse(),velocity:-s}))),c.calculatedDuration===null&&(c.calculatedDuration=Lt(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:d,repeat:u,repeatType:h,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const b=this.currentTime-c*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let T=this.currentTime,L=n;if(u){const P=Math.min(this.currentTime,i)/o;let U=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&U--,U=Math.min(U,u+1),!!(U%2)&&(h==="reverse"?(H=1-H,p&&(H-=p/o)):h==="mirror"&&(L=s)),T=ke(0,1,H)*o}const C=A?{done:!1,value:d[0]}:L.next(T);a&&(C.value=a(C.value));let{done:I}=C;!A&&l!==null&&(I=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const x=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return x&&m!==qt&&(C.value=Gt(d,this.options,v,this.speed)),f&&f(C.value),x&&this.finish(),C}then(t,e){return this.finished.then(t,e)}get duration(){return Te(this.calculatedDuration)}get time(){return Te(this.currentTime)}set time(t){var e;t=Ee(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(e=this.driver)==null||e.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ye.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=Te(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:t=Qa,startTime:e}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(a=(i=this.options).onPlay)==null||a.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e!=null?e:n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ye.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,e;this.notifyFinished(),this.teardown(),this.state="finished",(e=(t=this.options).onComplete)==null||e.call(t)}cancel(){var t,e;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(e=(t=this.options).onCancel)==null||e.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var e;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(e=this.driver)==null||e.stop(),t.observe(this)}}function bs(r){var t;for(let e=1;e<r.length;e++)(t=r[e])!=null||(r[e]=r[e-1])}const Re=r=>r*180/Math.PI,Qt=r=>{const t=Re(Math.atan2(r[1],r[0]));return Zt(t)},ys={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r=>(Math.abs(r[0])+Math.abs(r[3]))/2,rotate:Qt,rotateZ:Qt,skewX:r=>Re(Math.atan(r[1])),skewY:r=>Re(Math.atan(r[2])),skew:r=>(Math.abs(r[1])+Math.abs(r[2]))/2},Zt=r=>(r=r%360,r<0&&(r+=360),r),vn=Qt,gn=r=>Math.sqrt(r[0]*r[0]+r[1]*r[1]),bn=r=>Math.sqrt(r[4]*r[4]+r[5]*r[5]),_s={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gn,scaleY:bn,scale:r=>(gn(r)+bn(r))/2,rotateX:r=>Zt(Re(Math.atan2(r[6],r[5]))),rotateY:r=>Zt(Re(Math.atan2(-r[2],r[0]))),rotateZ:vn,rotate:vn,skewX:r=>Re(Math.atan(r[4])),skewY:r=>Re(Math.atan(r[1])),skew:r=>(Math.abs(r[1])+Math.abs(r[4]))/2};function Xt(r){return r.includes("scale")?1:0}function Jt(r,t){if(!r||r==="none")return Xt(t);const e=r.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(e)n=_s,i=e;else{const o=r.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ys,i=o}if(!i)return Xt(t);const a=n[t],s=i[1].split(",").map(Cs);return typeof a=="function"?a(s):s[a]}const Es=(r,t)=>{const{transform:e="none"}=getComputedStyle(r);return Jt(e,t)};function Cs(r){return parseFloat(r.trim())}const yn=r=>r===Ue||r===Q,ws=new Set(["x","y","z"]),As=Ve.filter(r=>!ws.has(r));function Ts(r){const t=[];return As.forEach(e=>{const n=r.getValue(e);n!==void 0&&(t.push([e,n.get()]),n.set(e.startsWith("scale")?1:0))}),t}const Me={width:({x:r},{paddingLeft:t="0",paddingRight:e="0"})=>r.max-r.min-parseFloat(t)-parseFloat(e),height:({y:r},{paddingTop:t="0",paddingBottom:e="0"})=>r.max-r.min-parseFloat(t)-parseFloat(e),top:(r,{top:t})=>parseFloat(t),left:(r,{left:t})=>parseFloat(t),bottom:({y:r},{top:t})=>parseFloat(t)+(r.max-r.min),right:({x:r},{left:t})=>parseFloat(t)+(r.max-r.min),x:(r,{transform:t})=>Jt(t,"x"),y:(r,{transform:t})=>Jt(t,"y")};Me.translateX=Me.x,Me.translateY=Me.y;const Se=new Set;let er=!1,tr=!1,rr=!1;function _n(){if(tr){const r=Array.from(Se).filter(n=>n.needsMeasurement),t=new Set(r.map(n=>n.element)),e=new Map;t.forEach(n=>{const i=Ts(n);i.length&&(e.set(n,i),n.render())}),r.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=e.get(n);i&&i.forEach(([a,s])=>{var o;(o=n.getValue(a))==null||o.set(s)})}),r.forEach(n=>n.measureEndState()),r.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}tr=!1,er=!1,Se.forEach(r=>r.complete(rr)),Se.clear()}function En(){Se.forEach(r=>{r.readKeyframes(),r.needsMeasurement&&(tr=!0)})}function Is(){rr=!0,En(),_n(),rr=!1}class nr{constructor(t,e,n,i,a,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=a,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Se.add(this),er||(er=!0,Oe.read(En),Oe.resolveKeyframes(_n))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(t[0]===null){const a=i==null?void 0:i.get(),s=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&e){const o=n.readValue(e,s);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=s),i&&a===void 0&&i.set(t[0])}bs(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Se.delete(this)}cancel(){this.state==="scheduled"&&(Se.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const xs=r=>r.startsWith("--");function Os(r,t,e){xs(t)?r.style.setProperty(t,e):r.style[t]=e}function ir(r){let t;return()=>(t===void 0&&(t=r()),t)}const Ns=ir(()=>window.ScrollTimeline!==void 0),Ls={};function ks(r,t){const e=ir(r);return()=>{var n;return(n=Ls[t])!=null?n:e()}}const Cn=ks(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(r){return!1}return!0},"linearEasing"),at=([r,t,e,n])=>`cubic-bezier(${r}, ${t}, ${e}, ${n})`,wn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:at([0,.65,.55,1]),circOut:at([.55,0,1,.45]),backIn:at([.31,.01,.66,-.59]),backOut:at([.33,1.53,.69,.99])};function An(r,t){if(r)return typeof r=="function"?Cn()?Jr(r,t):"ease-out":pn(r)?at(r):Array.isArray(r)?r.map(e=>An(e,t)||wn.easeOut):wn[r]}function Ps(r,t,e,{delay:n=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeOut",times:l}={},c=void 0){const d={[t]:e};l&&(d.offset=l);const u=An(o,i);Array.isArray(u)&&(d.easing=u);const h={delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),r.animate(d,h)}function Rs(e){var n=e,{type:r}=n,t=Ce(n,["type"]);var i,a;return Nt(r)&&Cn()?r.applyToOptions(t):((i=t.duration)!=null||(t.duration=300),(a=t.ease)!=null||(t.ease="easeOut"),t)}class Ms extends Yt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:a,allowFlatten:s=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=s,this.options=t,Ie(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const c=Rs(t);this.animation=Ps(e,n,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=Gt(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(d):Os(e,n,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,e;(e=(t=this.animation).finish)==null||e.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,e;this.isPseudoElement||(e=(t=this.animation).commitStyles)==null||e.call(t)}get duration(){var e,n;const t=((n=(e=this.animation.effect)==null?void 0:e.getComputedTiming)==null?void 0:n.call(e).duration)||0;return Te(Number(t))}get time(){return Te(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ee(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Ns()?(this.animation.timeline=t,De):e(this)}}const Tn={anticipate:dn,backInOut:cn,circInOut:un};function Ss(r){return r in Tn}function Ds(r){typeof r.ease=="string"&&Ss(r.ease)&&(r.ease=Tn[r.ease])}const In=10;class Vs extends Ms{constructor(t){Ds(t),fn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){var d;const c=this.options,{motionValue:e,onUpdate:n,onComplete:i,element:a}=c,s=Ce(c,["motionValue","onUpdate","onComplete","element"]);if(!e)return;if(t!==void 0){e.set(t);return}const o=new $t(X(j({},s),{autoplay:!1})),l=Ee((d=this.finishedTime)!=null?d:this.time);e.setWithVelocity(o.sample(l-In).value,o.sample(l).value,In),o.stop()}}const xn=(r,t)=>t==="zIndex"?!1:!!(typeof r=="number"||Array.isArray(r)||typeof r=="string"&&(ze.test(r)||r==="0")&&!r.startsWith("url("));function Fs(r){const t=r[0];if(r.length===1)return!0;for(let e=0;e<r.length;e++)if(r[e]!==t)return!0}function Us(r,t,e,n){const i=r[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=r[r.length-1],s=xn(i,t),o=xn(a,t);return Qe(s===o,`You are trying to animate ${t} from "${i}" to "${a}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${a} via the \`style\` property.`),!s||!o?!1:Fs(r)||(e==="spring"||Nt(e))&&n}function On(r){return typeof r=="object"&&r!==null}function Bs(r){return On(r)&&"offsetHeight"in r}const js=new Set(["opacity","clipPath","filter","transform"]),zs=ir(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ks(r){var c;const{motionValue:t,name:e,repeatDelay:n,repeatType:i,damping:a,type:s}=r;if(!Bs((c=t==null?void 0:t.owner)==null?void 0:c.current))return!1;const{onUpdate:o,transformTemplate:l}=t.owner.getProps();return zs()&&e&&js.has(e)&&(e!=="transform"||!l)&&!o&&!n&&i!=="mirror"&&a!==0&&s!=="inertia"}const qs=40;class Hs extends Yt{constructor(h){var p=h,{autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",keyframes:o,name:l,motionValue:c,element:d}=p,u=Ce(p,["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"]);var v;super(),this.stop=()=>{var b,A;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(A=this.keyframeResolver)==null||A.cancel()},this.createdAt=ye.now();const m=j({autoplay:t,delay:e,type:n,repeat:i,repeatDelay:a,repeatType:s,name:l,motionValue:c,element:d},u),f=(d==null?void 0:d.KeyframeResolver)||nr;this.keyframeResolver=new f(o,(b,A,T)=>this.onKeyframesResolved(b,A,m,!T),l,c,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:s,velocity:o,delay:l,isHandoff:c,onUpdate:d}=n;this.resolvedAt=ye.now(),Us(t,a,s,o)||((xe.instantAnimations||!l)&&(d==null||d(Gt(t,n,e))),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const u=i?this.resolvedAt?this.resolvedAt-this.createdAt>qs?this.resolvedAt:this.createdAt:this.createdAt:void 0,h=X(j({startTime:u,finalKeyframe:e},n),{keyframes:t}),p=!c&&Ks(h)?new Vs(X(j({},h),{element:h.motionValue.owner.current})):new $t(h);p.finished.then(()=>this.notifyFinished()).catch(De),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Is()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Nn=(r,t,e,n={},i,a)=>s=>{const o=Ur(n,r)||{},l=o.delay||n.delay||0;let{elapsed:c=0}=n;c=c-Ee(l);const d=X(j({keyframes:Array.isArray(e)?e:[null,e],ease:"easeOut",velocity:t.getVelocity()},o),{delay:-c,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:r,motionValue:t,element:a?void 0:i});Ta(o)||Object.assign(d,Aa(r,d)),d.duration&&(d.duration=Ee(d.duration)),d.repeatDelay&&(d.repeatDelay=Ee(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),(xe.instantAnimations||xe.skipAnimations)&&(u=!0,d.duration=0,d.delay=0),d.allowFlatten=!o.type&&!o.ease,u&&!a&&t.get()!==void 0){const h=ya(d.keyframes,o);if(h!==void 0){Oe.update(()=>{d.onUpdate(h),d.onComplete()});return}}return o.isSync?new $t(d):new Hs(d)},Ln=new Set(["width","height","top","left","right","bottom",...Ve]);function Ws({protectedKeys:r,needsAnimating:t},e){const n=r.hasOwnProperty(e)&&t[e]!==!0;return t[e]=!1,n}function Gs(r,t,{delay:e=0,transitionOverride:n,type:i}={}){var u;let d=t,{transition:a=r.getDefaultTransition(),transitionEnd:s}=d,o=Ce(d,["transition","transitionEnd"]);n&&(a=n);const l=[],c=i&&r.animationState&&r.animationState.getState()[i];for(const h in o){const p=r.getValue(h,(u=r.latestValues[h])!=null?u:null),m=o[h];if(m===void 0||c&&Ws(c,h))continue;const f=j({delay:e},Ur(a||{},h)),v=p.get();if(v!==void 0&&!p.isAnimating&&!Array.isArray(m)&&m===v&&!f.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const T=ga(r);if(T){const L=window.MotionHandoffAnimation(T,h,Oe);L!==null&&(f.startTime=L,b=!0)}}fa(r,h),p.start(Nn(h,p,m,r.shouldReduceMotion&&Ln.has(h)?{type:!1}:f,r,b));const A=p.animation;A&&l.push(A)}return s&&Promise.all(l).then(()=>{Oe.update(()=>{s&&ha(r,s)})}),l}function Ys({top:r,left:t,right:e,bottom:n}){return{x:{min:t,max:e},y:{min:r,max:n}}}function $s(r,t){if(!t)return r;const e=t({x:r.left,y:r.top}),n=t({x:r.right,y:r.bottom});return{top:e.y,left:e.x,bottom:n.y,right:n.x}}function Qs(r,t){return Ys($s(r.getBoundingClientRect(),t))}const kn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ar={};for(const r in kn)ar[r]={isEnabled:t=>kn[r].some(e=>!!t[e])};const Pn=()=>({min:0,max:0}),sr=()=>({x:Pn(),y:Pn()}),Zs=typeof window!="undefined",or={current:null},Rn={current:!1};function Xs(){if(Rn.current=!0,!!Zs)if(window.matchMedia){const r=window.matchMedia("(prefers-reduced-motion)"),t=()=>or.current=r.matches;r.addListener(t),t()}else or.current=!1}function Js(r){return r!==null&&typeof r=="object"&&typeof r.start=="function"}function eo(r){return typeof r=="string"||Array.isArray(r)}const to=["initial",...["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"]];function Mn(r){return Js(r.animate)||to.some(t=>eo(r[t]))}function ro(r){return!!(Mn(r)||r.variants)}function no(r,t,e){for(const n in t){const i=t[n],a=e[n];if(ve(i))r.addValue(n,i);else if(ve(a))r.addValue(n,Xe(i,{owner:r}));else if(a!==i)if(r.hasValue(n)){const s=r.getValue(n);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=r.getStaticValue(n);r.addValue(n,Xe(s!==void 0?s:i,{owner:r}))}}for(const n in e)t[n]===void 0&&r.removeValue(n);return t}const Sn=r=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r),Dn=r=>/^0[^.\s]+$/u.test(r),io={test:r=>r==="auto",parse:r=>r},Vn=r=>t=>t.test(r),Fn=[Ue,Q,Be,Ne,Ra,Pa,io],Un=r=>Fn.find(Vn(r)),ao=[...Fn,me,ze],so=r=>ao.find(Vn(r)),oo=new Set(["brightness","contrast","saturate","opacity"]);function lo(r){const[t,e]=r.slice(0,-1).split("(");if(t==="drop-shadow")return r;const[n]=e.match(Mt)||[];if(!n)return r;const i=e.replace(n,"");let a=oo.has(t)?1:0;return n!==e&&(a*=100),t+"("+a+i+")"}const co=/\b([a-z-]*)\(.*?\)/gu,lr=X(j({},ze),{getAnimatableNone:r=>{const t=r.match(co);return t?t.map(lo).join(" "):r}}),Bn=X(j({},Ue),{transform:Math.round}),cr=X(j({borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,backgroundPositionX:Q,backgroundPositionY:Q},{rotate:Ne,rotateX:Ne,rotateY:Ne,rotateZ:Ne,scale:vt,scaleX:vt,scaleY:vt,scaleZ:vt,skew:Ne,skewX:Ne,skewY:Ne,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:Je,originX:Kr,originY:Kr,originZ:Q}),{zIndex:Bn,fillOpacity:Je,strokeOpacity:Je,numOctaves:Bn}),uo=X(j({},cr),{color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:lr,WebkitFilter:lr}),jn=r=>uo[r];function zn(r,t){let e=jn(r);return e!==lr&&(e=ze),e.getAnimatableNone?e.getAnimatableNone(t):void 0}const Kn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class qn{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:a,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=nr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=ye.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Oe.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget=j({},l),this.initialValues=e.initial?j({},l):{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!a,this.isControllingVariants=Mn(e),this.isVariantNode=ro(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const h=this.scrapeMotionValuesFromProps(e,{},this),{willChange:d}=h,u=Ce(h,["willChange"]);for(const p in u){const m=u[p];l[p]!==void 0&&ve(m)&&m.set(l[p],!1)}}mount(t){this.current=t,Ze.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,n)=>this.bindToMotionValue(n,e)),Rn.current||Xs(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:or.current,process.env.NODE_ENV!=="production"&&Sr(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),kt(this.notifyUpdate),kt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Fe.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Oe.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),a=e.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),a(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ar){const e=ar[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sr()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let n=0;n<Kn.length;n++){const i=Kn[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,s=t[a];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=no(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&e!==void 0&&(n=Xe(e===null?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var i;let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!=null?i:this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(Sn(n)||Dn(n))?n=parseFloat(n):!so(n)&&ze.test(e)&&(n=zn(t,e)),this.setBaseTarget(t,ve(n)?n.get():n)),ve(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var a;const{initial:e}=this.props;let n;if(typeof e=="string"||typeof e=="object"){const s=Rr(this.props,e,(a=this.presenceContext)==null?void 0:a.custom);s&&(n=s[t])}if(e&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ve(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,e){return this.events[t]||(this.events[t]=new Dr),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}const po=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ho(r){const t=po.exec(r);if(!t)return[,];const[,e,n,i]=t;return[`--${e!=null?e:n}`,i]}const mo=4;function Hn(r,t,e=1){Ie(e<=mo,`Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`);const[n,i]=ho(r);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const s=a.trim();return Sn(s)?parseFloat(s):s}return Rt(i)?Hn(i,t,e+1):i}function fo(r){return typeof r=="number"?r===0:r!==null?r==="none"||r==="0"||Dn(r):!0}const vo=new Set(["auto","none","0"]);function go(r,t,e){let n=0,i;for(;n<r.length&&!i;){const a=r[n];typeof a=="string"&&!vo.has(a)&&rt(a).values.length&&(i=r[n]),n++}if(i&&e)for(const a of t)r[a]=zn(e,i)}class bo extends nr{constructor(t,e,n,i,a){super(t,e,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Rt(c))){const d=Hn(c,e.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ln.has(n)||t.length!==2)return;const[i,a]=t,s=Un(i),o=Un(a);if(s!==o)if(yn(s)&&yn(o))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else Me[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||fo(t[i]))&&n.push(i);n.length&&go(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Me[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var o;const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const a=n.length-1,s=n[a];n[a]=Me[e](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}class Wn extends qn{constructor(){super(...arguments),this.KeyframeResolver=bo}sortInstanceNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ve(t)&&(this.childSubscription=t.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}const Gn=(r,t)=>t&&typeof r=="number"?t.transform(r):r,yo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_o=Ve.length;function Eo(r,t,e){let n="",i=!0;for(let a=0;a<_o;a++){const s=Ve[a],o=r[s];if(o===void 0)continue;let l=!0;if(typeof o=="number"?l=o===(s.startsWith("scale")?1:0):l=parseFloat(o)===0,!l||e){const c=Gn(o,cr[s]);if(!l){i=!1;const d=yo[s]||s;n+=`${d}(${c}) `}e&&(t[s]=c)}}return n=n.trim(),e?n=e(t,i?"":n):i&&(n="none"),n}function Yn(r,t,e){const{style:n,vars:i,transformOrigin:a}=r;let s=!1,o=!1;for(const l in t){const c=t[l];if(Fe.has(l)){s=!0;continue}else if(jr(l)){i[l]=c;continue}else{const d=Gn(c,cr[l]);l.startsWith("origin")?(o=!0,a[l]=d):n[l]=d}}if(t.transform||(s||e?n.transform=Eo(t,r.transform,e):n.transform&&(n.transform="none")),o){const{originX:l="50%",originY:c="50%",originZ:d=0}=a;n.transformOrigin=`${l} ${c} ${d}`}}function $n(r,{style:t,vars:e},n,i){Object.assign(r.style,t,i&&i.getProjectionStyles(n));for(const a in e)r.style.setProperty(a,e[a])}const Co={};function wo(r,{layout:t,layoutId:e}){return Fe.has(r)||r.startsWith("origin")||(t||e!==void 0)&&(!!Co[r]||r==="opacity")}function Qn(r,t,e){var a;const{style:n}=r,i={};for(const s in n)(ve(n[s])||t.style&&ve(t.style[s])||wo(s,r)||((a=e==null?void 0:e.getValue(s))==null?void 0:a.liveStyle)!==void 0)&&(i[s]=n[s]);return i}function Ao(r){return window.getComputedStyle(r)}class To extends Wn{constructor(){super(...arguments),this.type="html",this.renderInstance=$n}readValueFromInstance(t,e){var n;if(Fe.has(e))return(n=this.projection)!=null&&n.isProjecting?Xt(e):Es(t,e);{const i=Ao(t),a=(jr(e)?i.getPropertyValue(e):i[e])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:e}){return Qs(t,e)}build(t,e,n){Yn(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Qn(t,e,n)}}function Io(r,t){return r in t}class xo extends qn{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(Io(e,t)){const n=t[e];if(typeof n=="string"||typeof n=="number")return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return sr()}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Oo={offset:"stroke-dashoffset",array:"stroke-dasharray"},No={offset:"strokeDashoffset",array:"strokeDasharray"};function Lo(r,t,e=1,n=0,i=!0){r.pathLength=1;const a=i?Oo:No;r[a.offset]=Q.transform(-n);const s=Q.transform(t),o=Q.transform(e);r[a.array]=`${s} ${o}`}function ko(r,u,l,c,d){var h=u,{attrX:t,attrY:e,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:s=0}=h,o=Ce(h,["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"]);var f,v;if(Yn(r,o,c),l){r.style.viewBox&&(r.attrs.viewBox=r.style.viewBox);return}r.attrs=r.style,r.style={};const{attrs:p,style:m}=r;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=(f=p.transformOrigin)!=null?f:"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(v=d==null?void 0:d.transformBox)!=null?v:"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),e!==void 0&&(p.y=e),n!==void 0&&(p.scale=n),i!==void 0&&Lo(p,i,a,s,!1)}const Zn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Po=r=>typeof r=="string"&&r.toLowerCase()==="svg";function Ro(r,t,e,n){$n(r,t,void 0,n);for(const i in t.attrs)r.setAttribute(Zn.has(i)?i:Pt(i),t.attrs[i])}function Mo(r,t,e){const n=Qn(r,t,e);for(const i in r)if(ve(r[i])||ve(t[i])){const a=Ve.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=r[i]}return n}class So extends Wn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sr}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Fe.has(e)){const n=jn(e);return n&&n.default||0}return e=Zn.has(e)?e:Pt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Mo(t,e,n)}build(t,e,n){ko(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Ro(t,e,n,i)}mount(t){this.isSVGTag=Po(t.tagName),super.mount(t)}}function Xn(r){return On(r)&&"ownerSVGElement"in r}function Do(r){return Xn(r)&&r.tagName==="svg"}function Vo(r){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},e=Xn(r)&&!Do(r)?new So(t):new To(t);e.mount(r),Ze.set(r,e)}function Fo(r){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},e=new xo(t);e.mount(r),Ze.set(r,e)}function Uo(r,t,e){const n=ve(r)?r:Xe(r);return n.start(Nn("",n,t,e)),n.animation}function Bo(r,t){return ve(r)||typeof r=="number"||typeof r=="string"&&!xt(t)}function Jn(r,t,e,n){const i=[];if(Bo(r,t))i.push(Uo(r,xt(t)&&t.default||t,e&&(e.default||e)));else{const a=Cr(r,t,n),s=a.length;Ie(!!s,"No valid elements provided.");for(let o=0;o<s;o++){const l=a[o],c=l instanceof Element?Vo:Fo;Ze.has(l)||c(l);const d=Ze.get(l),u=j({},e);"delay"in u&&typeof u.delay=="function"&&(u.delay=u.delay(o,s)),i.push(...Gs(d,X(j({},t),{transition:u}),{}))}}return i}function jo(r,t,e){const n=[];return Xi(r,t,e,{spring:nt}).forEach(({keyframes:a,transition:s},o)=>{n.push(...Jn(o,a,s))}),n}class zo{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(n=>n.attachTimeline(t));return()=>{e.forEach((n,i)=>{n&&n(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Ko extends zo{then(t,e){return this.finished.finally(t).then(()=>{})}}function qo(r){return Array.isArray(r)&&r.some(Array.isArray)}function Ho(r){function t(e,n,i){let a=[];return qo(e)?a=jo(e,n,r):a=Jn(e,n,i,r),new Ko(a)}return t}const ue=Ho(),Z={spinner:"_spinner_1waxg_1",spinnerContainer:"_spinnerContainer_1waxg_5",success:"_success_1waxg_9",successContainer:"_successContainer_1waxg_13",container:"_container_1waxg_17",card:"_card_1waxg_26",warning:"_warning_1waxg_35",svg:"_svg_1waxg_43",srOnly:"_srOnly_1waxg_48"};class ei{constructor(){y(this,"template",`
3
3
  <svg aria-hidden="true" class="${Z.spinner}" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
5
5
  <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
6
6
  </svg>
7
7
  <span class="${Z.srOnly}">Loading...</span>
8
- `);y(this,"spinner",document.createElement("div"));this.spinner.setAttribute("role","status"),this.spinner.classList.add(Z.spinnerContainer),this.spinner.innerHTML=this.template}addClass(t){this.spinner.classList.add(t)}removeClass(t){this.spinner.classList.remove(t)}render(){return this.spinner}}const ti={loader:"_loader_nwq3e_1"};class Wo{constructor(){y(this,"loader");this.loader=document.createElement("div"),this.loader.classList.add(ti.loader),this.loader.appendChild(new ei().render())}setClassName(t){t?this.loader.classList.add(t):this.loader.className=ti.loader}render(){return this.loader}}const he={checkout:"_checkout_5sq3n_1",hidden:"_hidden_5sq3n_7",formInitial:"_formInitial_5sq3n_11",btnsInitial:"_btnsInitial_5sq3n_16"},dr={buttons:"_buttons_1i8cu_1",hidden:"_hidden_1i8cu_5"},ur={applePay:"_applePay_1y98r_1",hidden:"_hidden_1y98r_22"};function ri(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var pr,ni;function Go(){if(ni)return pr;ni=1;var r={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[62207,62209],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292,810,[8110,8131],[8132,8151],[8152,8163],[8164,8171]],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,504174],[504176,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,63737423,63743358,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}};return pr=r,pr}var st={},ot={},ii;function ai(){if(ii)return ot;ii=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.clone=void 0;function r(t){return t?JSON.parse(JSON.stringify(t)):null}return ot.clone=r,ot}var lt={},si;function Yo(){if(si)return lt;si=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.matches=void 0;function r(n,i,a){var s=String(i).length,o=n.substr(0,s),l=parseInt(o,10);return i=parseInt(String(i).substr(0,o.length),10),a=parseInt(String(a).substr(0,o.length),10),l>=i&&l<=a}function t(n,i){return i=String(i),i.substring(0,n.length)===n.substring(0,i.length)}function e(n,i){return Array.isArray(i)?r(n,i[0],i[1]):t(n,i)}return lt.matches=e,lt}var oi;function $o(){if(oi)return st;oi=1,Object.defineProperty(st,"__esModule",{value:!0}),st.addMatchingCardsToResults=void 0;var r=ai(),t=Yo();function e(n,i,a){var s,o;for(s=0;s<i.patterns.length;s++){var l=i.patterns[s];if((0,t.matches)(n,l)){var c=(0,r.clone)(i);Array.isArray(l)?o=String(l[0]).length:o=String(l).length,n.length>=o&&(c.matchStrength=o),a.push(c);break}}}return st.addMatchingCardsToResults=e,st}var ct={},li;function Qo(){if(li)return ct;li=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.isValidInputType=void 0;function r(t){return typeof t=="string"||t instanceof String}return ct.isValidInputType=r,ct}var dt={},ci;function Zo(){if(ci)return dt;ci=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.findBestMatch=void 0;function r(e){var n=e.filter(function(i){return i.matchStrength}).length;return n>0&&n===e.length}function t(e){return r(e)?e.reduce(function(n,i){return!n||Number(n.matchStrength)<Number(i.matchStrength)?i:n}):null}return dt.findBestMatch=t,dt}var ut,di;function Xo(){if(di)return ut;di=1;var r=ut&&ut.__assign||function(){return r=Object.assign||function(m){for(var f,v=1,b=arguments.length;v<b;v++){f=arguments[v];for(var A in f)Object.prototype.hasOwnProperty.call(f,A)&&(m[A]=f[A])}return m},r.apply(this,arguments)},t=Go(),e=$o(),n=Qo(),i=Zo(),a=ai(),s={},o={VISA:"visa",MASTERCARD:"mastercard",AMERICAN_EXPRESS:"american-express",DINERS_CLUB:"diners-club",DISCOVER:"discover",JCB:"jcb",UNIONPAY:"unionpay",MAESTRO:"maestro",ELO:"elo",MIR:"mir",HIPER:"hiper",HIPERCARD:"hipercard"},l=[o.VISA,o.MASTERCARD,o.AMERICAN_EXPRESS,o.DINERS_CLUB,o.DISCOVER,o.JCB,o.UNIONPAY,o.MAESTRO,o.ELO,o.MIR,o.HIPER,o.HIPERCARD],c=(0,a.clone)(l);function d(m){return s[m]||t[m]}function u(){return c.map(function(m){return(0,a.clone)(d(m))})}function h(m,f){f===void 0&&(f=!1);var v=c.indexOf(m);if(!f&&v===-1)throw new Error('"'+m+'" is not a supported card type.');return v}function p(m){var f=[];if(!(0,n.isValidInputType)(m))return f;if(m.length===0)return u();c.forEach(function(b){var A=d(b);(0,e.addMatchingCardsToResults)(m,A,f)});var v=(0,i.findBestMatch)(f);return v?[v]:f}return p.getTypeInfo=function(m){return(0,a.clone)(d(m))},p.removeCard=function(m){var f=h(m);c.splice(f,1)},p.addCard=function(m){var f=h(m.type,!0);s[m.type]=m,f===-1&&c.push(m.type)},p.updateCard=function(m,f){var v=s[m]||t[m];if(!v)throw new Error('"'.concat(m,"\" is not a recognized type. Use `addCard` instead.'"));if(f.type&&v.type!==f.type)throw new Error("Cannot overwrite type parameter.");var b=(0,a.clone)(v);b=r(r({},b),f),s[b.type]=b},p.changeOrder=function(m,f){var v=h(m);c.splice(v,1),c.splice(f,0,m)},p.resetModifications=function(){c=(0,a.clone)(l),s={}},p.types=o,ut=p,ut}var qe=Xo();qe.updateCard("visa",{lengths:[16]}),qe.updateCard("unionpay",{gaps:[4,8,12,16]});const Jo=(r,t)=>{const e=qe.getTypeInfo(t),n=r.replace(/\D/g,""),i=(e==null?void 0:e.gaps)||[4,8,12],a=e?Math.max(...e.lengths)+i.length:19,s=[0].concat(i,n.length),o=[];for(let l=0;s[l]<n.length;l++){const c=s[l],d=Math.min(s[l+1],n.length);o.push(n.slice(c,d))}return o.join(" ").slice(0,a)},el=(r,t)=>{const e=qe.getTypeInfo(t),n=(e==null?void 0:e.code.size)||4;return r.replace(/\D/g,"").slice(0,n)},tl=(r,t)=>{const e=r.replace(/\D/g,"");let n=e.slice(0,2);if(!n)return"";const i=Number(n);if(n!=="01"){if(Number.isNaN(i))return"0";if(i===0||i===1)return`${i}`;if(i>12)return"1";n=i>9?`${i}`:`0${i}`}if(r.length<t.length){const s=Number(r[r.length-1]);if(Number.isNaN(s))return n}const a=e.slice(2,4);return`${n} / ${a}`};var pe=(r=>(r.Invalid="invalid",r.Empty="empty",r.Incomplete="incomplete",r.Unsupported="unsupported",r.Expired="expired",r))(pe||{}),ge=(r=>(r.Visa="visa",r.Mastercard="mastercard",r.AmericanExpress="american-express",r.Discover="discover",r.JCB="jcb",r.DinersClub="diners-club",r.UnionPay="unionpay",r.Maestro="maestro",r))(ge||{});const bt=[{name:"Visa",type:"visa",pattern:/^4/,minLength:16,maxLength:16},{name:"MasterCard",type:"mastercard",pattern:/^5[1-5]/,minLength:16,maxLength:16},{name:"American Express",type:"american-express",pattern:/^3[47]/,minLength:15,maxLength:15},{name:"Discover",type:"discover",pattern:/^6(?:011|5[0-9]{2})/,minLength:16,maxLength:16},{name:"JCB",type:"jcb",pattern:/^(?:2131|1800|35\d{3})/,minLength:15,maxLength:16},{name:"Diners Club",type:"diners-club",pattern:/^3(?:0[0-5]|[68][0-9])/,minLength:14,maxLength:16},{name:"Union Pay",type:"unionpay",pattern:/^62[^7]+/,minLength:16,maxLength:19},{name:"Maestro",type:"maestro",pattern:/^(50[^69]|5[68]|5018|5020|5038|627|6304|6759|6761|6763|6[3][^6]+)/,minLength:12,maxLength:19}],ui=r=>bt.find(t=>t.pattern.test(r))||null,pi=r=>bt.filter(t=>t.pattern.test(r)),rl=r=>{let t=0,e=!1;for(let n=r.length-1;n>=0;n--){let i=parseInt(r[n]);e&&(i*=2,i>9&&(i-=9)),t+=i,e=!e}return t%10===0},hi=(r,t)=>{const e=r.replace(/\D/g,"");if(!e)return{isValid:!1,cardType:null,error:pe.Empty};if(!/^\d+$/.test(e))return{isValid:!1,cardType:null,error:pe.Invalid};const n=ui(e);if(n){if(e.length<n.minLength||e.length>n.maxLength)return{isValid:!1,cardType:n.name,error:pe.Incomplete}}else if(e.length<16)return{isValid:!1,cardType:null,error:pe.Incomplete};return n&&t&&!t.includes(n.type)?{isValid:!1,cardType:n.name,error:"unsupported"}:rl(e)?{isValid:!0,cardType:(n==null?void 0:n.name)||null,error:null}:{isValid:!1,cardType:(n==null?void 0:n.name)||null,error:pe.Invalid}},nl=r=>{var t;return!r||typeof r.amount!="number"||!r.currency||!r.country||!r.merchant_id||r.checkout_config&&!((t=r.checkout_config)==null?void 0:t.find(({is_active:n,type:i})=>n&&i==="google-pay"))?null:{amount:r.amount,currency:r.currency,country:r.country,merchantId:r.merchant_id,lineItems:[]}},il=r=>{var t,e;return!r||typeof r.amount!="number"||!r.currency||!r.country||!r.merchant_id||r.checkout_config&&!((t=r.checkout_config)==null?void 0:t.find(({is_active:i,type:a})=>i&&a==="apple-pay"))?null:{amount:r.amount,currency:r.currency,country:r.country,merchantId:r.merchant_id,lineItems:((e=r.apple_pay_info)==null?void 0:e.line_items)||[]}},al=(r=[])=>r.reduce((t,e)=>{switch(e){case ge.Visa:return t.push("visa"),t;case ge.Mastercard:return t.push("masterCard"),t;case ge.AmericanExpress:return t.push("amex"),t;case ge.Discover:return t.push("discover"),t;case ge.JCB:return t.push("jcb"),t;case ge.UnionPay:return t.push("chinaUnionPay"),t;default:return t}},[]),sl=r=>({ar:"ar-AB",en:"en-GB",cs:"cs-CZ",da:"da-DK",de:"de-DE",el:"el-GR",es:"es-ES",fi:"fi-FI",fr:"fr-FR",hr:"hr-HR",hu:"hu-HU",id:"id-ID",it:"it-IT",ja:"ja-JP",ko:"ko-KR",ms:"ms-MY",ru:"ru-RU",nb:"nb-NO",no:"nb-NO",nl:"nl-NL",pl:"pl-PL",pt:"pt-PT",ro:"ro-RO",ua:"uk-UA",sk:"sk-SK",sv:"sv-SE",th:"th-TH",tr:"tr-TR",vi:"vi-VN",zh:"zh-CN"})[r]||"en-US",ol=r=>({en:"en",ar:"ar",cs:"cs",da:"da",de:"de",el:"el",es:"es",fi:"fi",fr:"fr",hr:"hr",id:"id",it:"it",ja:"ja",ko:"ko",ms:"ms",ru:"ru",nl:"nl",pl:"pl",pt:"pt",sv:"sv",th:"th",tr:"tr",zh:"zh"})[r]||"en";class ll{constructor(t){y(this,"element");y(this,"events",{ready:new se});y(this,"ev");y(this,"customButtonStyles");this.config=t;const e=this.config.state.styles.getState().ApplePayButton;this.ev=this.config.service.ev,this.customButtonStyles=e,this.element=document.createElement("div"),this.element.classList.add(ur.applePay,ur.hidden)}init(t){return z(this,null,function*(){if(!this.config)return;const e=this.config.state.transaction.getState(),{locale:n,supportedCardTypes:i}=this.config.state.checkout.getState(),a=il(e);a&&(yield this.ev.initApple(X(j({},t),{transaction:a,supportedCardTypes:al(i),locale:sl(n||"en")}),this.customButtonStyles),this.ev.isAppleAvailable()&&(yield this.ev.renderApple(this.element),this.element.classList.remove(ur.hidden),this.events.ready.emit()))})}addEventListener(t,e){return this.events[t].addListener(e)}render(){return this.element}}var te=(r=>(r.PAYPAL="paypal",r.APPLE_PAY="apple-pay",r.GOOGLE_PAY="google-pay",r.CARD="card",r.VENMO="venmo",r))(te||{});const hr=(r="sandbox")=>({develop:"https://api-dev.paynext.com",sandbox:"https://api-sandbox.paynext.com",staging:"https://api-staging.paynext.com",production:"https://api.paynext.com"})[r],cl=[{type:te.PAYPAL,order:1,is_active:!0},{type:te.APPLE_PAY,order:2,is_active:!0},{type:te.GOOGLE_PAY,order:3,is_active:!0},{type:te.CARD,order:4,is_active:!0}],dl={[te.GOOGLE_PAY]:"GPAY",[te.APPLE_PAY]:"APPLEPAY",[te.PAYPAL]:"PAYPAL",[te.CARD]:"CARD",[te.VENMO]:"VENMO"},ul=r=>r.googlePay?te.GOOGLE_PAY:r.applePay?te.APPLE_PAY:r.paypal?te.PAYPAL:r.braintree?te.VENMO:te.CARD,pl=r=>dl[r],hl=r=>{const t=r.card;if(t)return{bin:t.firstSixDigits,bin_data:{brand:t.cardBrand,country:t.country,currency_code:t.currency,funding:t.funding,issuer:t.issuer,type:t.type},cvc:t.cvc,exp_month:Number(t.expMonth),exp_year:Number(t.expYear),last4:t.lastFourDigits,number:t.number}},ml=r=>{var e;const t=r.paypal;if((e=t==null?void 0:t.billing_agreement_token)!=null&&e.paypalId)return{billing_agreement_token:t.billing_agreement_token.paypalId}},fl=r=>{var e,n;const t=r.googlePay;if(t!=null&&t.token)return{cryptogram:t.cryptogram,eci:t.eci,exp_month:(e=t.card)!=null&&e.expiry.month||t.token.expiry.month?Number(t.card.expiry.month||t.token.expiry.month):void 0,exp_year:(n=t.card)!=null&&n.expiry.year||t.token.expiry.year?Number(t.card.expiry.year||t.token.expiry.year):void 0,token:t.token.number,token_service_provider:t.token.tokenServiceProvider}},vl=r=>{var e,n,i,a,s,o;const t=r.applePay;if(t)return{cryptogram:t.cryptogram,eci:t.eci,exp_month:(n=(e=t.networkToken)==null?void 0:e.expiry)!=null&&n.month?Number(t.networkToken.expiry.month):void 0,exp_year:(a=(i=t.networkToken)==null?void 0:i.expiry)!=null&&a.year?Number(t.networkToken.expiry.year):void 0,token:(s=t.networkToken)==null?void 0:s.number,token_service_provider:(o=t.networkToken)==null?void 0:o.tokenServiceProvider}},gl=r=>{const t=r.braintree;if(t)return{payment_method_nonce:t.nonce}},mi=r=>{var n,i,a,s,o,l,c,d,u,h,p,m,f,v;const{applePay:t,googlePay:e}=r;if(!(!t&&!e))return{city:((n=t==null?void 0:t.billingContact)==null?void 0:n.locality)||((i=e==null?void 0:e.billingAddress)==null?void 0:i.locality)||void 0,country:((a=t==null?void 0:t.billingContact)==null?void 0:a.countryCode)||((s=e==null?void 0:e.billingAddress)==null?void 0:s.countryCode)||void 0,line1:((l=(o=t==null?void 0:t.billingContact)==null?void 0:o.addressLines)==null?void 0:l.at(0))||((c=e==null?void 0:e.billingAddress)==null?void 0:c.address1)||void 0,line2:((u=(d=t==null?void 0:t.billingContact)==null?void 0:d.addressLines)==null?void 0:u.at(1))||((h=e==null?void 0:e.billingAddress)==null?void 0:h.address2)||void 0,postal_code:((p=t==null?void 0:t.billingContact)==null?void 0:p.postalCode)||((m=e==null?void 0:e.billingAddress)==null?void 0:m.postalCode)||void 0,state:((f=t==null?void 0:t.billingContact)==null?void 0:f.administrativeArea)||((v=e==null?void 0:e.billingAddress)==null?void 0:v.administrativeArea)||void 0}},fi=r=>{var i,a,s,o,l,c,d,u,h,p,m,f,v,b,A,T,L,C,I;const{card:t,googlePay:e,applePay:n}=r;if(!(!t&&!(e!=null&&e.card)&&!(n!=null&&n.card)))return{bin:t==null?void 0:t.firstSixDigits,bin_data:{brand:(t==null?void 0:t.cardBrand)||((i=e==null?void 0:e.card)==null?void 0:i.brand)||((a=n==null?void 0:n.card)==null?void 0:a.brand),country:(t==null?void 0:t.country)||((s=e==null?void 0:e.card)==null?void 0:s.country)||((o=n==null?void 0:n.card)==null?void 0:o.country),currency_code:(t==null?void 0:t.currency)||((l=e==null?void 0:e.card)==null?void 0:l.currency)||((c=n==null?void 0:n.card)==null?void 0:c.currency),funding:(t==null?void 0:t.funding)||((d=e==null?void 0:e.card)==null?void 0:d.funding)||((u=n==null?void 0:n.card)==null?void 0:u.funding),issuer:(t==null?void 0:t.issuer)||((h=e==null?void 0:e.card)==null?void 0:h.issuer)||((p=n==null?void 0:n.card)==null?void 0:p.issuer),type:(t==null?void 0:t.type)||((m=e==null?void 0:e.card)==null?void 0:m.segment)||((f=n==null?void 0:n.card)==null?void 0:f.segment)},cvc:t==null?void 0:t.cvc,exp_month:t!=null&&t.expMonth||(v=e==null?void 0:e.card)!=null&&v.expiry.month?Number((t==null?void 0:t.expMonth)||((b=e==null?void 0:e.card)==null?void 0:b.expiry.month)):void 0,exp_year:t!=null&&t.expYear||(A=e==null?void 0:e.card)!=null&&A.expiry.year?Number((t==null?void 0:t.expYear)||((T=e==null?void 0:e.card)==null?void 0:T.expiry.year)):void 0,last4:(t==null?void 0:t.lastFourDigits)||((L=e==null?void 0:e.card)==null?void 0:L.lastFour)||((C=n==null?void 0:n.card)==null?void 0:C.lastFour),number:(t==null?void 0:t.number)||((I=e==null?void 0:e.card)==null?void 0:I.number)}},vi=r=>{var n,i;const{applePay:t,card:e}=r;return(n=t==null?void 0:t.billingContact)!=null&&n.givenName?`${t.billingContact.givenName} ${t.billingContact.familyName||""}`.trim():(i=e==null?void 0:e.metadata)==null?void 0:i.name},bl=r=>{var i,a;const t=ul(r),e=pl(t),n={client_session:r.clientSession,three_ds_session_id:r.threeDsSessionId,type:e};switch(t){case te.CARD:return X(j({},n),{name:vi(r),card:hl(r)});case te.PAYPAL:return X(j({},n),{paypal:ml(r)});case te.GOOGLE_PAY:return X(j({},n),{card:fi(r),google_pay:fl(r),billing_address:mi(r)});case te.APPLE_PAY:return X(j({},n),{name:vi(r),card:fi(r),apple_pay:vl(r),phone:(a=(i=r.applePay)==null?void 0:i.shippingContact)==null?void 0:a.phoneNumber,billing_address:mi(r)});case te.VENMO:return X(j({},n),{venmo:gl(r)});default:throw new Error(`Unsupported payment method: ${t}`)}},yl=(r,t,e,n)=>z(this,null,function*(){const i=`${hr(t)}/internal/payments/create`,a=new Headers;a.append("Content-Type","application/json"),a.append("X-API-Version",e);const s=bl(r);return yield(yield fetch(i,{method:"POST",headers:a,body:JSON.stringify(X(j({},s),{use_workflows:n||void 0}))})).json()}),_l=(r,t,e)=>z(this,null,function*(){const n=`${hr(t)}/internal/payments/create/billing/agreement`,i=new Headers;return i.append("Content-Type","application/json"),i.append("X-API-Version",e),(yield(yield fetch(n,{method:"POST",headers:i,body:JSON.stringify({client_session:r})})).json()).paypal_agreement_token_response.token_id||""}),El=(r,t,e)=>z(this,null,function*(){const n=`${hr(t)}/internal/payments/config?client_session_id=${r}`,i=new Headers;i.append("X-API-Version",e);const s=yield(yield fetch(n,{headers:i})).json();return s.checkout_config||(s.checkout_config=cl),s}),Cl=[{type:te.PAYPAL,is_active:!0,order:1},{type:te.APPLE_PAY,is_active:!0,order:2},{type:te.GOOGLE_PAY,is_active:!0,order:3},{type:te.VENMO,is_active:!0,order:4},{type:te.CARD,is_active:!0,order:5}],He={open:{y:0,opacity:1},close:{y:100,opacity:0},transition:{duration:.5,type:"spring",bounce:0}},yt={open:{y:0,opacity:1},close:{y:-100,opacity:0},transition:{duration:.5,type:"spring",bounce:0}},fe={open:{y:0,opacity:1},close:{y:15,opacity:0},transition:{duration:.5,type:"spring",bounce:0}},_e={open:{y:0,opacity:1,height:"auto"},close:{y:-15,opacity:0,height:0},transition:{duration:.5,type:"spring",bounce:0}},mr={googlePay:"_googlePay_1xmjo_1",hidden:"_hidden_1xmjo_17"};class wl{constructor(t){y(this,"element");y(this,"events",{ready:new se});y(this,"ev");y(this,"customButtonStyles");this.config=t,this.ev=this.config.service.ev,this.customButtonStyles=this.config.state.styles.getState().GooglePayButton,this.element=document.createElement("div"),this.element.classList.add(mr.googlePay,mr.hidden)}isIOS(){if(typeof navigator=="undefined")return!1;const t=navigator.userAgent||"";return/iPad|iPhone|iPod/.test(t)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1}init(t){return z(this,null,function*(){if(!this.config||this.isIOS())return;const e=this.config.state.transaction.getState(),{locale:n}=this.config.state.checkout.getState(),i=nl(e);i&&(yield this.ev.initGoogle(X(j({},t),{transaction:i,locale:ol(n||"en")}),this.customButtonStyles),yield this.ev.renderGoogle(this.element),this.element.classList.remove(mr.hidden),this.events.ready.emit())})}addEventListener(t,e){return this.events[t].addListener(e)}render(){return this.element}}const fr={paypal:"_paypal_7twkb_1",hidden:"_hidden_7twkb_8"};class Al{constructor(t){y(this,"element");y(this,"events",{ready:new se});y(this,"paypal");y(this,"customButtonStyles");this.config=t,this.paypal=this.config.service.paypal,this.customButtonStyles=this.config.state.styles.getState().PayPalButton,this.element=document.createElement("div"),this.element.classList.add(fr.paypal,fr.hidden)}init(t){return z(this,null,function*(){var a,s,o;if(!this.config)return;const e=this.config.state.transaction.getState(),n=this.config.state.checkout.getState(),i=()=>z(this,null,function*(){return yield _l(n.clientToken,n.environment,n.apiVersion)});e&&(yield this.paypal.init({clientId:((a=e==null?void 0:e.paypal_info)==null?void 0:a.client_id)||"",environment:((s=e==null?void 0:e.paypal_info)==null?void 0:s.environment)||"sandbox",vault:!0}),yield this.paypal.render(this.element,X(j({},t),{createBillingAgreement:i,onApprove:c=>z(this,[c],function*({billingToken:l}){var d;(d=t==null?void 0:t.onSuccess)==null||d.call(t,l||"")}),style:(o=this.customButtonStyles)==null?void 0:o.styles,onCancel:t==null?void 0:t.onCancel,onError:t==null?void 0:t.onError})),this.element.classList.remove(fr.hidden),this.events.ready.emit())})}addEventListener(t,e){return this.events[t].addListener(e)}render(){return this.element}}class Tl{constructor(){y(this,"template",`
8
+ `);y(this,"spinner",document.createElement("div"));this.spinner.setAttribute("role","status"),this.spinner.classList.add(Z.spinnerContainer),this.spinner.innerHTML=this.template}addClass(t){this.spinner.classList.add(t)}removeClass(t){this.spinner.classList.remove(t)}render(){return this.spinner}}const ti={loader:"_loader_nwq3e_1"};class Wo{constructor(){y(this,"loader");this.loader=document.createElement("div"),this.loader.classList.add(ti.loader),this.loader.appendChild(new ei().render())}setClassName(t){t?this.loader.classList.add(t):this.loader.className=ti.loader}render(){return this.loader}}const he={checkout:"_checkout_5sq3n_1",hidden:"_hidden_5sq3n_7",formInitial:"_formInitial_5sq3n_11",btnsInitial:"_btnsInitial_5sq3n_16"},dr={buttons:"_buttons_1i8cu_1",hidden:"_hidden_1i8cu_5"},ur={applePay:"_applePay_1g5vd_1",hidden:"_hidden_1g5vd_24"};function ri(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var pr,ni;function Go(){if(ni)return pr;ni=1;var r={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[62207,62209],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292,810,[8110,8131],[8132,8151],[8152,8163],[8164,8171]],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,504174],[504176,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,63737423,63743358,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}};return pr=r,pr}var st={},ot={},ii;function ai(){if(ii)return ot;ii=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.clone=void 0;function r(t){return t?JSON.parse(JSON.stringify(t)):null}return ot.clone=r,ot}var lt={},si;function Yo(){if(si)return lt;si=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.matches=void 0;function r(n,i,a){var s=String(i).length,o=n.substr(0,s),l=parseInt(o,10);return i=parseInt(String(i).substr(0,o.length),10),a=parseInt(String(a).substr(0,o.length),10),l>=i&&l<=a}function t(n,i){return i=String(i),i.substring(0,n.length)===n.substring(0,i.length)}function e(n,i){return Array.isArray(i)?r(n,i[0],i[1]):t(n,i)}return lt.matches=e,lt}var oi;function $o(){if(oi)return st;oi=1,Object.defineProperty(st,"__esModule",{value:!0}),st.addMatchingCardsToResults=void 0;var r=ai(),t=Yo();function e(n,i,a){var s,o;for(s=0;s<i.patterns.length;s++){var l=i.patterns[s];if((0,t.matches)(n,l)){var c=(0,r.clone)(i);Array.isArray(l)?o=String(l[0]).length:o=String(l).length,n.length>=o&&(c.matchStrength=o),a.push(c);break}}}return st.addMatchingCardsToResults=e,st}var ct={},li;function Qo(){if(li)return ct;li=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.isValidInputType=void 0;function r(t){return typeof t=="string"||t instanceof String}return ct.isValidInputType=r,ct}var dt={},ci;function Zo(){if(ci)return dt;ci=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.findBestMatch=void 0;function r(e){var n=e.filter(function(i){return i.matchStrength}).length;return n>0&&n===e.length}function t(e){return r(e)?e.reduce(function(n,i){return!n||Number(n.matchStrength)<Number(i.matchStrength)?i:n}):null}return dt.findBestMatch=t,dt}var ut,di;function Xo(){if(di)return ut;di=1;var r=ut&&ut.__assign||function(){return r=Object.assign||function(m){for(var f,v=1,b=arguments.length;v<b;v++){f=arguments[v];for(var A in f)Object.prototype.hasOwnProperty.call(f,A)&&(m[A]=f[A])}return m},r.apply(this,arguments)},t=Go(),e=$o(),n=Qo(),i=Zo(),a=ai(),s={},o={VISA:"visa",MASTERCARD:"mastercard",AMERICAN_EXPRESS:"american-express",DINERS_CLUB:"diners-club",DISCOVER:"discover",JCB:"jcb",UNIONPAY:"unionpay",MAESTRO:"maestro",ELO:"elo",MIR:"mir",HIPER:"hiper",HIPERCARD:"hipercard"},l=[o.VISA,o.MASTERCARD,o.AMERICAN_EXPRESS,o.DINERS_CLUB,o.DISCOVER,o.JCB,o.UNIONPAY,o.MAESTRO,o.ELO,o.MIR,o.HIPER,o.HIPERCARD],c=(0,a.clone)(l);function d(m){return s[m]||t[m]}function u(){return c.map(function(m){return(0,a.clone)(d(m))})}function h(m,f){f===void 0&&(f=!1);var v=c.indexOf(m);if(!f&&v===-1)throw new Error('"'+m+'" is not a supported card type.');return v}function p(m){var f=[];if(!(0,n.isValidInputType)(m))return f;if(m.length===0)return u();c.forEach(function(b){var A=d(b);(0,e.addMatchingCardsToResults)(m,A,f)});var v=(0,i.findBestMatch)(f);return v?[v]:f}return p.getTypeInfo=function(m){return(0,a.clone)(d(m))},p.removeCard=function(m){var f=h(m);c.splice(f,1)},p.addCard=function(m){var f=h(m.type,!0);s[m.type]=m,f===-1&&c.push(m.type)},p.updateCard=function(m,f){var v=s[m]||t[m];if(!v)throw new Error('"'.concat(m,"\" is not a recognized type. Use `addCard` instead.'"));if(f.type&&v.type!==f.type)throw new Error("Cannot overwrite type parameter.");var b=(0,a.clone)(v);b=r(r({},b),f),s[b.type]=b},p.changeOrder=function(m,f){var v=h(m);c.splice(v,1),c.splice(f,0,m)},p.resetModifications=function(){c=(0,a.clone)(l),s={}},p.types=o,ut=p,ut}var qe=Xo();qe.updateCard("visa",{lengths:[16]}),qe.updateCard("unionpay",{gaps:[4,8,12,16]});const Jo=(r,t)=>{const e=qe.getTypeInfo(t),n=r.replace(/\D/g,""),i=(e==null?void 0:e.gaps)||[4,8,12],a=e?Math.max(...e.lengths)+i.length:19,s=[0].concat(i,n.length),o=[];for(let l=0;s[l]<n.length;l++){const c=s[l],d=Math.min(s[l+1],n.length);o.push(n.slice(c,d))}return o.join(" ").slice(0,a)},el=(r,t)=>{const e=qe.getTypeInfo(t),n=(e==null?void 0:e.code.size)||4;return r.replace(/\D/g,"").slice(0,n)},tl=(r,t)=>{const e=r.replace(/\D/g,"");let n=e.slice(0,2);if(!n)return"";const i=Number(n);if(n!=="01"){if(Number.isNaN(i))return"0";if(i===0||i===1)return`${i}`;if(i>12)return"1";n=i>9?`${i}`:`0${i}`}if(r.length<t.length){const s=Number(r[r.length-1]);if(Number.isNaN(s))return n}const a=e.slice(2,4);return`${n} / ${a}`};var pe=(r=>(r.Invalid="invalid",r.Empty="empty",r.Incomplete="incomplete",r.Unsupported="unsupported",r.Expired="expired",r))(pe||{}),ge=(r=>(r.Visa="visa",r.Mastercard="mastercard",r.AmericanExpress="american-express",r.Discover="discover",r.JCB="jcb",r.DinersClub="diners-club",r.UnionPay="unionpay",r.Maestro="maestro",r))(ge||{});const bt=[{name:"Visa",type:"visa",pattern:/^4/,minLength:16,maxLength:16},{name:"MasterCard",type:"mastercard",pattern:/^5[1-5]/,minLength:16,maxLength:16},{name:"American Express",type:"american-express",pattern:/^3[47]/,minLength:15,maxLength:15},{name:"Discover",type:"discover",pattern:/^6(?:011|5[0-9]{2})/,minLength:16,maxLength:16},{name:"JCB",type:"jcb",pattern:/^(?:2131|1800|35\d{3})/,minLength:15,maxLength:16},{name:"Diners Club",type:"diners-club",pattern:/^3(?:0[0-5]|[68][0-9])/,minLength:14,maxLength:16},{name:"Union Pay",type:"unionpay",pattern:/^62[^7]+/,minLength:16,maxLength:19},{name:"Maestro",type:"maestro",pattern:/^(50[^69]|5[68]|5018|5020|5038|627|6304|6759|6761|6763|6[3][^6]+)/,minLength:12,maxLength:19}],ui=r=>bt.find(t=>t.pattern.test(r))||null,pi=r=>bt.filter(t=>t.pattern.test(r)),rl=r=>{let t=0,e=!1;for(let n=r.length-1;n>=0;n--){let i=parseInt(r[n]);e&&(i*=2,i>9&&(i-=9)),t+=i,e=!e}return t%10===0},hi=(r,t)=>{const e=r.replace(/\D/g,"");if(!e)return{isValid:!1,cardType:null,error:pe.Empty};if(!/^\d+$/.test(e))return{isValid:!1,cardType:null,error:pe.Invalid};const n=ui(e);if(n){if(e.length<n.minLength||e.length>n.maxLength)return{isValid:!1,cardType:n.name,error:pe.Incomplete}}else if(e.length<16)return{isValid:!1,cardType:null,error:pe.Incomplete};return n&&t&&!t.includes(n.type)?{isValid:!1,cardType:n.name,error:"unsupported"}:rl(e)?{isValid:!0,cardType:(n==null?void 0:n.name)||null,error:null}:{isValid:!1,cardType:(n==null?void 0:n.name)||null,error:pe.Invalid}},nl=r=>{var t;return!r||typeof r.amount!="number"||!r.currency||!r.country||!r.merchant_id||r.checkout_config&&!((t=r.checkout_config)==null?void 0:t.find(({is_active:n,type:i})=>n&&i==="google-pay"))?null:{amount:r.amount,currency:r.currency,country:r.country,merchantId:r.merchant_id,lineItems:[]}},il=r=>{var t,e;return!r||typeof r.amount!="number"||!r.currency||!r.country||!r.merchant_id||r.checkout_config&&!((t=r.checkout_config)==null?void 0:t.find(({is_active:i,type:a})=>i&&a==="apple-pay"))?null:{amount:r.amount,currency:r.currency,country:r.country,merchantId:r.merchant_id,lineItems:((e=r.apple_pay_info)==null?void 0:e.line_items)||[]}},al=(r=[])=>r.reduce((t,e)=>{switch(e){case ge.Visa:return t.push("visa"),t;case ge.Mastercard:return t.push("masterCard"),t;case ge.AmericanExpress:return t.push("amex"),t;case ge.Discover:return t.push("discover"),t;case ge.JCB:return t.push("jcb"),t;case ge.UnionPay:return t.push("chinaUnionPay"),t;default:return t}},[]),sl=r=>({ar:"ar-AB",en:"en-GB",cs:"cs-CZ",da:"da-DK",de:"de-DE",el:"el-GR",es:"es-ES",fi:"fi-FI",fr:"fr-FR",hr:"hr-HR",hu:"hu-HU",id:"id-ID",it:"it-IT",ja:"ja-JP",ko:"ko-KR",ms:"ms-MY",ru:"ru-RU",nb:"nb-NO",no:"nb-NO",nl:"nl-NL",pl:"pl-PL",pt:"pt-PT",ro:"ro-RO",ua:"uk-UA",sk:"sk-SK",sv:"sv-SE",th:"th-TH",tr:"tr-TR",vi:"vi-VN",zh:"zh-CN"})[r]||"en-US",ol=r=>({en:"en",ar:"ar",cs:"cs",da:"da",de:"de",el:"el",es:"es",fi:"fi",fr:"fr",hr:"hr",id:"id",it:"it",ja:"ja",ko:"ko",ms:"ms",ru:"ru",nl:"nl",pl:"pl",pt:"pt",sv:"sv",th:"th",tr:"tr",zh:"zh"})[r]||"en";class ll{constructor(t){y(this,"element");y(this,"events",{ready:new se});y(this,"ev");y(this,"customButtonStyles");this.config=t;const e=this.config.state.styles.getState().ApplePayButton;this.ev=this.config.service.ev,this.customButtonStyles=e,this.element=document.createElement("div"),this.element.classList.add(ur.applePay,ur.hidden)}init(t){return z(this,null,function*(){if(!this.config)return;const e=this.config.state.transaction.getState();if(!e||Object.keys(e).length===0)return;const{locale:n,supportedCardTypes:i}=this.config.state.checkout.getState(),a=il(e);a&&(yield this.ev.initApple(X(j({},t),{transaction:a,supportedCardTypes:al(i),locale:sl(n||"en")}),this.customButtonStyles),this.ev.isAppleAvailable()&&(yield this.ev.renderApple(this.element),this.element.classList.remove(ur.hidden),this.events.ready.emit()))})}addEventListener(t,e){return this.events[t].addListener(e)}render(){return this.element}}var te=(r=>(r.PAYPAL="paypal",r.APPLE_PAY="apple-pay",r.GOOGLE_PAY="google-pay",r.CARD="card",r.VENMO="venmo",r))(te||{});const hr=(r="sandbox")=>({develop:"https://api-dev.paynext.com",sandbox:"https://api-sandbox.paynext.com",staging:"https://api-staging.paynext.com",production:"https://api.paynext.com"})[r],cl=[{type:te.PAYPAL,order:1,is_active:!0},{type:te.APPLE_PAY,order:2,is_active:!0},{type:te.GOOGLE_PAY,order:3,is_active:!0},{type:te.CARD,order:4,is_active:!0}],dl={[te.GOOGLE_PAY]:"GPAY",[te.APPLE_PAY]:"APPLEPAY",[te.PAYPAL]:"PAYPAL",[te.CARD]:"CARD",[te.VENMO]:"VENMO"},ul=r=>r.googlePay?te.GOOGLE_PAY:r.applePay?te.APPLE_PAY:r.paypal?te.PAYPAL:r.braintree?te.VENMO:te.CARD,pl=r=>dl[r],hl=r=>{const t=r.card;if(t)return{bin:t.firstSixDigits,bin_data:{brand:t.cardBrand,country:t.country,currency_code:t.currency,funding:t.funding,issuer:t.issuer,type:t.type},cvc:t.cvc,exp_month:Number(t.expMonth),exp_year:Number(t.expYear),last4:t.lastFourDigits,number:t.number}},ml=r=>{var e;const t=r.paypal;if((e=t==null?void 0:t.billing_agreement_token)!=null&&e.paypalId)return{billing_agreement_token:t.billing_agreement_token.paypalId}},fl=r=>{var e,n;const t=r.googlePay;if(t!=null&&t.token)return{cryptogram:t.cryptogram,eci:t.eci,exp_month:(e=t.card)!=null&&e.expiry.month||t.token.expiry.month?Number(t.card.expiry.month||t.token.expiry.month):void 0,exp_year:(n=t.card)!=null&&n.expiry.year||t.token.expiry.year?Number(t.card.expiry.year||t.token.expiry.year):void 0,token:t.token.number,token_service_provider:t.token.tokenServiceProvider}},vl=r=>{var e,n,i,a,s,o;const t=r.applePay;if(t)return{cryptogram:t.cryptogram,eci:t.eci,exp_month:(n=(e=t.networkToken)==null?void 0:e.expiry)!=null&&n.month?Number(t.networkToken.expiry.month):void 0,exp_year:(a=(i=t.networkToken)==null?void 0:i.expiry)!=null&&a.year?Number(t.networkToken.expiry.year):void 0,token:(s=t.networkToken)==null?void 0:s.number,token_service_provider:(o=t.networkToken)==null?void 0:o.tokenServiceProvider}},gl=r=>{const t=r.braintree;if(t)return{payment_method_nonce:t.nonce}},mi=r=>{var n,i,a,s,o,l,c,d,u,h,p,m,f,v;const{applePay:t,googlePay:e}=r;if(!(!t&&!e))return{city:((n=t==null?void 0:t.billingContact)==null?void 0:n.locality)||((i=e==null?void 0:e.billingAddress)==null?void 0:i.locality)||void 0,country:((a=t==null?void 0:t.billingContact)==null?void 0:a.countryCode)||((s=e==null?void 0:e.billingAddress)==null?void 0:s.countryCode)||void 0,line1:((l=(o=t==null?void 0:t.billingContact)==null?void 0:o.addressLines)==null?void 0:l.at(0))||((c=e==null?void 0:e.billingAddress)==null?void 0:c.address1)||void 0,line2:((u=(d=t==null?void 0:t.billingContact)==null?void 0:d.addressLines)==null?void 0:u.at(1))||((h=e==null?void 0:e.billingAddress)==null?void 0:h.address2)||void 0,postal_code:((p=t==null?void 0:t.billingContact)==null?void 0:p.postalCode)||((m=e==null?void 0:e.billingAddress)==null?void 0:m.postalCode)||void 0,state:((f=t==null?void 0:t.billingContact)==null?void 0:f.administrativeArea)||((v=e==null?void 0:e.billingAddress)==null?void 0:v.administrativeArea)||void 0}},fi=r=>{var i,a,s,o,l,c,d,u,h,p,m,f,v,b,A,T,L,C,I;const{card:t,googlePay:e,applePay:n}=r;if(!(!t&&!(e!=null&&e.card)&&!(n!=null&&n.card)))return{bin:t==null?void 0:t.firstSixDigits,bin_data:{brand:(t==null?void 0:t.cardBrand)||((i=e==null?void 0:e.card)==null?void 0:i.brand)||((a=n==null?void 0:n.card)==null?void 0:a.brand),country:(t==null?void 0:t.country)||((s=e==null?void 0:e.card)==null?void 0:s.country)||((o=n==null?void 0:n.card)==null?void 0:o.country),currency_code:(t==null?void 0:t.currency)||((l=e==null?void 0:e.card)==null?void 0:l.currency)||((c=n==null?void 0:n.card)==null?void 0:c.currency),funding:(t==null?void 0:t.funding)||((d=e==null?void 0:e.card)==null?void 0:d.funding)||((u=n==null?void 0:n.card)==null?void 0:u.funding),issuer:(t==null?void 0:t.issuer)||((h=e==null?void 0:e.card)==null?void 0:h.issuer)||((p=n==null?void 0:n.card)==null?void 0:p.issuer),type:(t==null?void 0:t.type)||((m=e==null?void 0:e.card)==null?void 0:m.segment)||((f=n==null?void 0:n.card)==null?void 0:f.segment)},cvc:t==null?void 0:t.cvc,exp_month:t!=null&&t.expMonth||(v=e==null?void 0:e.card)!=null&&v.expiry.month?Number((t==null?void 0:t.expMonth)||((b=e==null?void 0:e.card)==null?void 0:b.expiry.month)):void 0,exp_year:t!=null&&t.expYear||(A=e==null?void 0:e.card)!=null&&A.expiry.year?Number((t==null?void 0:t.expYear)||((T=e==null?void 0:e.card)==null?void 0:T.expiry.year)):void 0,last4:(t==null?void 0:t.lastFourDigits)||((L=e==null?void 0:e.card)==null?void 0:L.lastFour)||((C=n==null?void 0:n.card)==null?void 0:C.lastFour),number:(t==null?void 0:t.number)||((I=e==null?void 0:e.card)==null?void 0:I.number)}},vi=r=>{var n,i;const{applePay:t,card:e}=r;return(n=t==null?void 0:t.billingContact)!=null&&n.givenName?`${t.billingContact.givenName} ${t.billingContact.familyName||""}`.trim():(i=e==null?void 0:e.metadata)==null?void 0:i.name},bl=r=>{var i,a;const t=ul(r),e=pl(t),n={client_session:r.clientSession,three_ds_session_id:r.threeDsSessionId,type:e};switch(t){case te.CARD:return X(j({},n),{name:vi(r),card:hl(r)});case te.PAYPAL:return X(j({},n),{paypal:ml(r)});case te.GOOGLE_PAY:return X(j({},n),{card:fi(r),google_pay:fl(r),billing_address:mi(r)});case te.APPLE_PAY:return X(j({},n),{name:vi(r),card:fi(r),apple_pay:vl(r),phone:(a=(i=r.applePay)==null?void 0:i.shippingContact)==null?void 0:a.phoneNumber,billing_address:mi(r)});case te.VENMO:return X(j({},n),{venmo:gl(r)});default:throw new Error(`Unsupported payment method: ${t}`)}},yl=(r,t,e,n)=>z(this,null,function*(){const i=`${hr(t)}/internal/payments/create`,a=new Headers;a.append("Content-Type","application/json"),a.append("X-API-Version",e);const s=bl(r);return yield(yield fetch(i,{method:"POST",headers:a,body:JSON.stringify(X(j({},s),{use_workflows:n||void 0}))})).json()}),_l=(r,t,e)=>z(this,null,function*(){const n=`${hr(t)}/internal/payments/create/billing/agreement`,i=new Headers;return i.append("Content-Type","application/json"),i.append("X-API-Version",e),(yield(yield fetch(n,{method:"POST",headers:i,body:JSON.stringify({client_session:r})})).json()).paypal_agreement_token_response.token_id||""}),El=(r,t,e)=>z(this,null,function*(){const n=`${hr(t)}/internal/payments/config?client_session_id=${r}`,i=new Headers;i.append("X-API-Version",e);const s=yield(yield fetch(n,{headers:i})).json();return s.checkout_config||(s.checkout_config=cl),s}),Cl=[{type:te.PAYPAL,is_active:!0,order:1},{type:te.APPLE_PAY,is_active:!0,order:2},{type:te.GOOGLE_PAY,is_active:!0,order:3},{type:te.VENMO,is_active:!0,order:4},{type:te.CARD,is_active:!0,order:5}],He={open:{y:0,opacity:1},close:{y:100,opacity:0},transition:{duration:.5,type:"spring",bounce:0}},yt={open:{y:0,opacity:1},close:{y:-100,opacity:0},transition:{duration:.5,type:"spring",bounce:0}},fe={open:{y:0,opacity:1},close:{y:15,opacity:0},transition:{duration:.5,type:"spring",bounce:0}},_e={open:{y:0,opacity:1,height:"auto"},close:{y:-15,opacity:0,height:0},transition:{duration:.5,type:"spring",bounce:0}},mr={googlePay:"_googlePay_1xmjo_1",hidden:"_hidden_1xmjo_17"};class wl{constructor(t){y(this,"element");y(this,"events",{ready:new se});y(this,"ev");y(this,"customButtonStyles");this.config=t,this.ev=this.config.service.ev,this.customButtonStyles=this.config.state.styles.getState().GooglePayButton,this.element=document.createElement("div"),this.element.classList.add(mr.googlePay,mr.hidden)}isIOS(){if(typeof navigator=="undefined")return!1;const t=navigator.userAgent||"";return/iPad|iPhone|iPod/.test(t)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1}isMacOS(){return typeof navigator=="undefined"?!1:navigator.platform.toLowerCase().includes("mac")}isSafari(){if(typeof navigator=="undefined")return!1;const t=navigator.userAgent||"";return t.includes("Safari")&&!t.includes("Chrome")&&!t.includes("CriOS")&&!t.includes("FxiOS")&&!t.includes("Edg")&&!t.includes("OPR")}init(t){return z(this,null,function*(){if(!this.config||this.isIOS()||this.isSafari()||this.isMacOS())return;const e=this.config.state.transaction.getState();if(!e||Object.keys(e).length===0)return;const{locale:n}=this.config.state.checkout.getState(),i=nl(e);i&&(yield this.ev.initGoogle(X(j({},t),{transaction:i,locale:ol(n||"en")}),this.customButtonStyles),yield this.ev.renderGoogle(this.element),this.element.classList.remove(mr.hidden),this.events.ready.emit())})}addEventListener(t,e){return this.events[t].addListener(e)}render(){return this.element}}const fr={paypal:"_paypal_2zo1j_1",hidden:"_hidden_2zo1j_10"};class Al{constructor(t){y(this,"element");y(this,"events",{ready:new se});y(this,"paypal");y(this,"customButtonStyles");this.config=t,this.paypal=this.config.service.paypal,this.customButtonStyles=this.config.state.styles.getState().PayPalButton,this.element=document.createElement("div"),this.element.classList.add(fr.paypal,fr.hidden)}init(t){return z(this,null,function*(){var a,s,o;if(!this.config)return;const e=this.config.state.transaction.getState(),n=this.config.state.checkout.getState(),i=()=>z(this,null,function*(){return yield _l(n.clientToken,n.environment,n.apiVersion)});!e||Object.keys(e).length===0||(yield this.paypal.init({clientId:((a=e==null?void 0:e.paypal_info)==null?void 0:a.client_id)||"",environment:((s=e==null?void 0:e.paypal_info)==null?void 0:s.environment)||"sandbox",vault:!0}),yield this.paypal.render(this.element,X(j({},t),{createBillingAgreement:i,onApprove:c=>z(this,[c],function*({billingToken:l}){var d;(d=t==null?void 0:t.onSuccess)==null||d.call(t,l||"")}),style:(o=this.customButtonStyles)==null?void 0:o.styles,onCancel:t==null?void 0:t.onCancel,onError:t==null?void 0:t.onError})),this.element.classList.remove(fr.hidden),this.events.ready.emit())})}addEventListener(t,e){return this.events[t].addListener(e)}render(){return this.element}}class Tl{constructor(){y(this,"template",`
9
9
  <svg
10
10
  xmlns='http://www.w3.org/2000/svg'
11
11
  fill='none'
@@ -20,10 +20,10 @@
20
20
  <line x1='1' y1='8' x2='27' y2='8'></line>
21
21
  </svg>
22
22
  <span class="${Z.srOnly}">Pay with</span>
23
- `);y(this,"element",document.createElement("div"));this.element.classList.add(Z.card),this.element.innerHTML=this.template}render(){return this.element}}const _t={button:"_button_1br9w_1",press:"_press_1br9w_21"};class Il{constructor(t){y(this,"element");y(this,"icon",new Tl);this.config=t;const e=this.config.state.styles.getState().WalletButton,n=this.config.state.translate;this.element=document.createElement("button"),this.element.classList.add(_t.button),e!=null&&e.className&&this.element.classList.add(e.className),e!=null&&e.styles&&Object.assign(this.element.style,e.styles);const i=document.createElement("span");i.textContent=n.getState().messages.card.compact.button,this.element.append(this.icon.render(),i),this.element.addEventListener("mousedown",()=>this.element.classList.add(_t.press)),this.element.addEventListener("mouseup",()=>this.element.classList.remove(_t.press)),this.element.addEventListener("mouseout",()=>this.element.classList.remove(_t.press)),n.subscribe(({messages:a})=>{i.textContent=a.card.compact.button})}addEventListener(t){return this.element.addEventListener("click",t)}render(){return this.element}}const xl=(r,t,e)=>t.concat(r.filter(n=>t.every(i=>!e(n,i)))),vr={venmo:"_venmo_w4oaz_1",hidden:"_hidden_w4oaz_26"},Ol={display:"block",height:40,borderRadius:12},Nl=`<svg viewBox="2.3 484.3 611.9 117.80000000000001" xmlns="http://www.w3.org/2000/svg">
23
+ `);y(this,"element",document.createElement("div"));this.element.classList.add(Z.card),this.element.innerHTML=this.template}render(){return this.element}}const _t={button:"_button_1br9w_1",press:"_press_1br9w_21"};class Il{constructor(t){y(this,"element");y(this,"icon",new Tl);this.config=t;const e=this.config.state.styles.getState().WalletButton,n=this.config.state.translate;this.element=document.createElement("button"),this.element.classList.add(_t.button),e!=null&&e.className&&this.element.classList.add(e.className),e!=null&&e.styles&&Object.assign(this.element.style,e.styles);const i=document.createElement("span");i.textContent=n.getState().messages.card.compact.button,this.element.append(this.icon.render(),i),this.element.addEventListener("mousedown",()=>this.element.classList.add(_t.press)),this.element.addEventListener("mouseup",()=>this.element.classList.remove(_t.press)),this.element.addEventListener("mouseout",()=>this.element.classList.remove(_t.press)),n.subscribe(({messages:a})=>{i.textContent=a.card.compact.button})}addEventListener(t){return this.element.addEventListener("click",t)}render(){return this.element}}const xl=(r,t,e)=>t.concat(r.filter(n=>t.every(i=>!e(n,i)))),vr={venmo:"_venmo_1ihvb_1",hidden:"_hidden_1ihvb_26"},Ol={display:"flex",height:40,borderRadius:12},Nl=`<svg viewBox="2.3 484.3 611.9 117.80000000000001" xmlns="http://www.w3.org/2000/svg">
24
24
  <path d="M103.1 485.8c4.2 7 5.7 14 5.7 22.4 0 28-23.8 65.9-43.4 91.1H20.5L2.3 491.5l40.6-2.8 9.8 77.1c8.4-14 19.7-37.9 19.7-53.2 0-8.4-1.4-14-4.2-19.7zm51.8 47.7c7 0 25.2-2.8 25.2-14 0-5.7-2.8-7-7-7-8.3 0-18.2 8.4-18.2 21zm-1.3 21c0 12.7 7 18.2 16.8 18.2s19.7-2.8 32.2-8.4l-5.7 30.8c-8.4 4.2-22.4 7-36.4 7-33.5 0-46.2-21-46.2-46.2 0-33.5 19.7-68.6 60.2-68.6 22.4 0 35 12.7 35 30.8 1.5 26.6-35 36.4-55.9 36.4zM324.4 511c0 4.2 0 9.8-1.4 14l-11.2 74.2H274l11.2-68.6c0-1.4 1.4-5.7 1.4-7 0-5.7-2.8-5.7-7-5.7-5.7 0-9.8 2.8-12.7 4.2l-14 77.1H215l16.8-112.1h33.5v8.4c8.4-5.7 18.2-11.2 32.2-11.2 19.9 3 26.9 12.7 26.9 26.7zm113.4-12.5c11.2-8.4 21-12.7 35-12.7 19.7 0 26.7 9.8 26.7 25.2 0 4.2 0 9.8-1.4 14L487 599.3h-37.9l11.2-70v-5.7c0-5.7-2.8-7-7-7s-9.8 1.4-12.7 4.2L428 599.2h-37.9l11.2-70v-5.7c0-5.7-2.8-7-7-7-5.7 0-9.8 2.8-12.7 4.2L369 599h-37.9L348 487h32.2l1.4 9.8c7-5.7 18.2-11.2 32.2-11.2 11.4 1.7 19.7 5.9 24 12.9zM575 532.1c0-9.8-2.8-15.4-9.8-15.4-15.4 0-18.2 26.7-18.2 40.6 0 9.8 2.8 16.8 9.8 16.8 15.5-1.4 18.2-29.4 18.2-42zm-65.8 22.4c0-35 18.2-68.6 61.6-68.6 32.2 0 43.4 19.7 43.4 44.9 0 35-18.2 70-61.6 70-32.2 1.3-43.4-19.7-43.4-46.3z"
25
25
  fill="currentColor"/>
26
- </svg>`;class Ll{constructor(t){y(this,"isProcessing",!1);y(this,"venmoButton");y(this,"events",{ready:new se});y(this,"braintree");this.config=t,this.braintree=this.config.service.braintree;const e=this.config.state.styles.getState().BraintreeButton;this.venmoButton=document.createElement("button"),this.venmoButton.classList.add(vr.venmo,vr.hidden),e!=null&&e.className&&this.venmoButton.classList.add(e.className),e!=null&&e.styles&&Object.assign(this.venmoButton.style,e.styles),this.venmoButton.setAttribute("aria-label","Venmo"),this.venmoButton.innerHTML=Nl}init(t){return z(this,null,function*(){var n;if(!this.config)return;console.log("Initializing Braintree Venmo with config:",t);const e=this.config.state.transaction.getState();if(console.log("----- init braintree venmo: ",e),!!e)try{if(yield this.braintree.init({authorization:((n=e==null?void 0:e.brain_tree_info)==null?void 0:n.client_token)||""}),yield this.braintree.createVenmo({}),!this.braintree.isBrowserSupported()){console.log("Browser does not support Venmo"),this.handleVenmoError(new Error("Browser does not support Venmo"));return}if(this.displayVenmoButton(t),this.braintree.hasTokenizationResult()){yield this.handleExistingTokenization(t);return}this.venmoButton.classList.remove(vr.hidden),this.events.ready.emit()}catch(i){console.error("Error initializing Venmo:",i),this.handleVenmoError(i)}})}displayVenmoButton(t){Object.assign(this.venmoButton.style,Ol),this.venmoButton.addEventListener("click",()=>z(this,null,function*(){if(!this.isProcessing){this.isProcessing=!0,this.venmoButton.disabled=!0;try{const e=yield this.braintree.tokenize();this.handleVenmoSuccess(e,t)}catch(e){this.handleVenmoError(e,t)}finally{this.isProcessing=!1,this.venmoButton.disabled=!1}}}))}handleExistingTokenization(t){return z(this,null,function*(){try{const e=yield this.braintree.tokenize();this.handleVenmoSuccess(e,t)}catch(e){this.handleVenmoError(e,t)}})}handleVenmoSuccess(t,e){var n;console.log("Venmo payment successful:",t),(n=e.onSuccess)==null||n.call(e,t)}handleVenmoError(t,e){var n;console.error("Venmo error:",t),(n=e==null?void 0:e.onError)==null||n.call(e,t)}addEventListener(t,e){return this.events[t].addListener(e)}render(){return this.venmoButton}}class kl{constructor(t){y(this,"isAppleReady",!0);y(this,"isGoogleReady",!0);y(this,"isPayPalReady",!0);y(this,"isBraintreeReady",!0);y(this,"buttons");y(this,"applePay");y(this,"googlePay");y(this,"paypal");y(this,"card");y(this,"braintree");y(this,"events",{ready:new se,open:new se,error:new se,cancel:new se,success:new se});this.config=t,this.applePay=new ll(t),this.paypal=new Al(t),this.googlePay=new wl(t),this.braintree=new Ll(t),this.card=new Il(t),this.buttons=document.createElement("div"),this.buttons.classList.add(dr.buttons,dr.hidden)}init(){return z(this,null,function*(){this.config.state.transaction.subscribe(()=>{this.config.service.ev.isReady&&this.initPaymentMethods().catch(console.error)}),this.config.state.checkout.subscribe(()=>{this.config.service.ev.isReady&&this.initPaymentMethods().catch(console.error)}),this.config.service.ev.addEventListener("ready",()=>{this.initPaymentMethods().catch(console.error)}),this.card.addEventListener(()=>this.events.open.emit())})}initApple(){return z(this,null,function*(){this.isAppleReady=!1,this.buttons.appendChild(this.applePay.render());try{yield this.applePay.init({onError:()=>this.events.error.emit(),onCancel:()=>this.events.cancel.emit(),onSuccess:t=>this.events.success.emit(X(j({},t),{type:"apple"}))})}catch(t){console.error(t)}finally{this.isAppleReady=!0}})}initGoogle(){return z(this,null,function*(){this.isGoogleReady=!1,this.buttons.appendChild(this.googlePay.render());try{yield this.googlePay.init({onError:()=>this.events.error.emit(),onCancel:()=>this.events.cancel.emit(),onSuccess:t=>this.events.success.emit(X(j({},t),{type:"google"}))})}catch(t){console.error(t)}finally{this.isGoogleReady=!0}})}initPayPal(){return z(this,null,function*(){this.isPayPalReady=!1,this.buttons.appendChild(this.paypal.render());try{yield this.paypal.init({onError:()=>this.events.error.emit(),onCancel:()=>this.events.cancel.emit(),onSuccess:t=>this.events.success.emit({paypalId:t,type:"paypal"})})}catch(t){console.error(t)}finally{this.isPayPalReady=!0}})}initBraintreeVenmo(){return z(this,null,function*(){this.isBraintreeReady=!1,this.buttons.appendChild(this.braintree.render());try{yield this.braintree.init({onError:()=>this.events.error.emit(),onCancel:()=>this.events.cancel.emit(),onSuccess:t=>this.events.success.emit({nonce:t==null?void 0:t.nonce,type:"venmo"})})}catch(t){console.error(t)}finally{this.isBraintreeReady=!0}})}initCard(){return z(this,null,function*(){this.buttons.appendChild(this.card.render())})}initPaymentMethods(){return z(this,null,function*(){const t=this.config.state.transaction.getState(),n=xl(Cl,(t==null?void 0:t.checkout_config)||[],(i,a)=>i.type===a.type).filter(({is_active:i})=>i).sort((i,a)=>i.order-a.order).map(({type:i})=>{switch(i){case te.APPLE_PAY:return this.initApple();case te.GOOGLE_PAY:return this.initGoogle();case te.PAYPAL:return this.initPayPal();case te.VENMO:return this.initBraintreeVenmo();case te.CARD:return this.initCard();default:throw new Error("Unknown button type")}});yield Promise.all(n),this.handleReady()})}handleReady(){this.isAppleReady&&this.isGoogleReady&&this.isPayPalReady&&this.isBraintreeReady&&this.events.ready.emit()}addEventListener(t,e){return this.events[t].addListener(e)}showButton(){this.buttons.classList.remove(dr.hidden)}render(){return this.buttons}}class Pl{constructor(){y(this,"template",`
26
+ </svg>`;class Ll{constructor(t){y(this,"isProcessing",!1);y(this,"venmoButton");y(this,"events",{ready:new se});y(this,"braintree");this.config=t,this.braintree=this.config.service.braintree;const e=this.config.state.styles.getState().BraintreeButton;this.venmoButton=document.createElement("button"),this.venmoButton.classList.add(vr.venmo,vr.hidden),e!=null&&e.className&&this.venmoButton.classList.add(e.className),e!=null&&e.styles&&Object.assign(this.venmoButton.style,e.styles),this.venmoButton.setAttribute("aria-label","Venmo"),this.venmoButton.innerHTML=Nl}init(t){return z(this,null,function*(){var n;if(!this.config)return;console.log("Initializing Braintree Venmo with config:",t);const e=this.config.state.transaction.getState();if(console.log("----- init braintree venmo: ",e),!(!e||Object.keys(e).length===0))try{if(yield this.braintree.init({authorization:((n=e==null?void 0:e.brain_tree_info)==null?void 0:n.client_token)||""}),yield this.braintree.createVenmo({}),!this.braintree.isBrowserSupported()){console.log("Browser does not support Venmo"),this.handleVenmoError(new Error("Browser does not support Venmo"));return}if(this.displayVenmoButton(t),this.braintree.hasTokenizationResult()){yield this.handleExistingTokenization(t);return}this.venmoButton.classList.remove(vr.hidden),this.events.ready.emit()}catch(i){console.error("Error initializing Venmo:",i),this.handleVenmoError(i)}})}displayVenmoButton(t){Object.assign(this.venmoButton.style,Ol),this.venmoButton.addEventListener("click",()=>z(this,null,function*(){if(!this.isProcessing){this.isProcessing=!0,this.venmoButton.disabled=!0;try{const e=yield this.braintree.tokenize();this.handleVenmoSuccess(e,t)}catch(e){this.handleVenmoError(e,t)}finally{this.isProcessing=!1,this.venmoButton.disabled=!1}}}))}handleExistingTokenization(t){return z(this,null,function*(){try{const e=yield this.braintree.tokenize();this.handleVenmoSuccess(e,t)}catch(e){this.handleVenmoError(e,t)}})}handleVenmoSuccess(t,e){var n;console.log("Venmo payment successful:",t),(n=e.onSuccess)==null||n.call(e,t)}handleVenmoError(t,e){var n;console.error("Venmo error:",t),(n=e==null?void 0:e.onError)==null||n.call(e,t)}addEventListener(t,e){return this.events[t].addListener(e)}render(){return this.venmoButton}}class kl{constructor(t){y(this,"isAppleReady",!0);y(this,"isGoogleReady",!0);y(this,"isPayPalReady",!0);y(this,"isBraintreeReady",!0);y(this,"buttons");y(this,"applePay");y(this,"googlePay");y(this,"paypal");y(this,"card");y(this,"braintree");y(this,"events",{ready:new se,open:new se,error:new se,cancel:new se,success:new se});this.config=t,this.applePay=new ll(t),this.paypal=new Al(t),this.googlePay=new wl(t),this.braintree=new Ll(t),this.card=new Il(t),this.buttons=document.createElement("div"),this.buttons.classList.add(dr.buttons,dr.hidden)}init(){return z(this,null,function*(){this.config.state.transaction.subscribe(()=>{this.config.service.ev.isReady&&this.initPaymentMethods().catch(console.error)}),this.config.state.checkout.subscribe(()=>{this.config.service.ev.isReady&&this.initPaymentMethods().catch(console.error)}),this.config.service.ev.addEventListener("ready",()=>{this.initPaymentMethods().catch(console.error)}),this.card.addEventListener(()=>this.events.open.emit())})}initApple(){return z(this,null,function*(){this.isAppleReady=!1,this.buttons.appendChild(this.applePay.render());try{yield this.applePay.init({onError:()=>this.events.error.emit(),onCancel:()=>this.events.cancel.emit(),onSuccess:t=>this.events.success.emit(X(j({},t),{type:"apple"}))})}catch(t){console.error(t)}finally{this.isAppleReady=!0}})}initGoogle(){return z(this,null,function*(){this.isGoogleReady=!1,this.buttons.appendChild(this.googlePay.render());try{yield this.googlePay.init({onError:()=>this.events.error.emit(),onCancel:()=>this.events.cancel.emit(),onSuccess:t=>this.events.success.emit(X(j({},t),{type:"google"}))})}catch(t){console.error(t)}finally{this.isGoogleReady=!0}})}initPayPal(){return z(this,null,function*(){this.isPayPalReady=!1,this.buttons.appendChild(this.paypal.render());try{yield this.paypal.init({onError:()=>this.events.error.emit(),onCancel:()=>this.events.cancel.emit(),onSuccess:t=>this.events.success.emit({paypalId:t,type:"paypal"})})}catch(t){console.error(t)}finally{this.isPayPalReady=!0}})}initBraintreeVenmo(){return z(this,null,function*(){this.isBraintreeReady=!1,this.buttons.appendChild(this.braintree.render());try{yield this.braintree.init({onError:()=>this.events.error.emit(),onCancel:()=>this.events.cancel.emit(),onSuccess:t=>this.events.success.emit({nonce:t==null?void 0:t.nonce,type:"venmo"})})}catch(t){console.error(t)}finally{this.isBraintreeReady=!0}})}initCard(){return z(this,null,function*(){this.buttons.appendChild(this.card.render())})}initPaymentMethods(){return z(this,null,function*(){const t=this.config.state.transaction.getState(),n=xl(Cl,(t==null?void 0:t.checkout_config)||[],(i,a)=>i.type===a.type).filter(({is_active:i})=>i).sort((i,a)=>i.order-a.order).map(({type:i})=>{switch(i){case te.APPLE_PAY:return this.initApple();case te.GOOGLE_PAY:return this.initGoogle();case te.PAYPAL:return this.initPayPal();case te.VENMO:return this.initBraintreeVenmo();case te.CARD:return this.initCard();default:throw new Error("Unknown button type")}});yield Promise.all(n),this.handleReady()})}handleReady(){this.isAppleReady&&this.isGoogleReady&&this.isPayPalReady&&this.isBraintreeReady&&this.events.ready.emit()}addEventListener(t,e){return this.events[t].addListener(e)}showButton(){this.buttons.classList.remove(dr.hidden)}render(){return this.buttons}}class Pl{constructor(){y(this,"template",`
27
27
  <svg
28
28
  xmlns='http://www.w3.org/2000/svg'
29
29
  width='24'