@miden-npm/vue 0.1.0 → 1.0.0
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.cjs.js +14 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +9484 -1094
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +14 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -0
- package/dist/types/apis/checkout.api.d.ts +7 -1
- package/dist/types/apis/encrypt.api.d.ts +4 -0
- package/dist/types/apis/index.d.ts +2 -0
- package/dist/types/apis/resources.api.d.ts +4 -0
- package/dist/types/buzapay-checkout/checkout-button.vue.d.ts +3 -1
- package/dist/types/buzapay-checkout/checkout-card.vue.d.ts +8 -10
- package/dist/types/buzapay-checkout/checkout-iframe.vue.d.ts +3 -1
- package/dist/types/components/base/input.vue.d.ts +4 -2
- package/dist/types/components/base/label-info.vue.d.ts +1 -1
- package/dist/types/components/base/select.vue.d.ts +1 -1
- package/dist/types/components/pay-by-card.vue.d.ts +14 -3
- package/dist/types/components/pay-by-stable-coin.vue.d.ts +9 -7
- package/dist/types/components/pay-by-transfer.vue.d.ts +10 -19
- package/dist/types/types/checkout.type.d.ts +99 -0
- package/dist/types/types/resource.type.d.ts +13 -0
- package/dist/types/utils/card-scheme.util.d.ts +23 -0
- package/dist/types/utils/error.util.d.ts +6 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/object.util.d.ts +1 -0
- package/package.json +18 -7
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
(function(_,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(_=typeof globalThis<"u"?globalThis:_||self,e(_.MidenPGVue={},_.Vue))})(this,function(_,e){"use strict";const z=Symbol("MidenPGConfig");function J(o){if(!(o!=null&&o.publishableKey))throw new Error("[@miden-npm/vue] publishableKey is required");return{install(l){l.provide(z,o)}}}function X(){const o=e.inject(z);if(!o)throw new Error("[@miden-npm/vue] Missing provider. Did you forget to app.use(createMidenPG(...))?");return o}const j=o=>o==null||typeof o!="object"?!1:Object.values(o).every(Boolean),Q=o=>o==="sandbox"?"https://sandbox-api.midencards.io/payment-gateway-api":"",v=o=>o==="USD"?"$":o==="NGN"?"₦":o==="EUR"?"€":o==="GBP"?"£":o==="JPY"||o==="CNY"?"¥":o==="USDC"||o==="usdc"?"$⧫":o==="USDT"||o==="usdt"?"₮":"$",S=(o,l)=>{const t=typeof o=="string"?parseFloat(o):o;return isNaN(t)?"0":`${l?v(l):""} ${t==null?void 0:t.toLocaleString("en-US")}`},ee=(o,l)=>o.length<=l?o:o.slice(0,l)+"...",te=o=>{const l=["Backspace","Tab","ArrowLeft","ArrowRight","Delete","Home","End","."];(o.ctrlKey||o.metaKey)&&["a","c","v","x"].includes(o.key.toLowerCase())||(!l.includes(o.key)&&!/^\d$/.test(o.key)&&o.preventDefault(),o.key==="."&&o.target.value.includes(".")&&o.preventDefault())},oe=["width","height"],le=["stroke"],ne=["fill"],F=e.defineComponent({__name:"icon-loader",props:{size:{default:24},color:{default:"currentColor"},className:{default:""}},setup(o){const l=o,t=e.useAttrs(),{size:a,color:n,className:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({class:["animate-spin",e.unref(r)],xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:e.unref(a),height:e.unref(a),role:"img","aria-label":"loading"},e.unref(t)),[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:e.unref(n),"stroke-width":"4"},null,8,le),e.createElementVNode("path",{class:"opacity-75",fill:e.unref(n),d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,8,ne)],16,oe))}}),ae=["disabled"],re={key:1},w=e.defineComponent({__name:"button",props:{label:{default:""},type:{default:"neutral"},size:{default:"de"},paddingClassX:{default:"px-8"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},customClass:{default:""}},emits:["click"],setup(o,{emit:l}){const t=o,a=l,n=e.computed(()=>t.disabled||t.loading);function r(){n.value||a("click")}function c(s,f){if(f)return"bg-gray-200 text-gray-400 cursor-not-allowed border-gray-200";switch(s){case"primary":return"bg-primary text-white hover:bg-primary-black hover:border-primary-black border-primary";case"secondary":return"bg-gray-200 border-gray-200 hover:bg-gray-300 text-heading-text";case"danger":return"bg-red-500 border-red-500 text-white hover:bg-red-600";case"neutral":default:return"bg-off-white border-grey-border hover:bg-gray-100"}}function i(s){switch(s){case"de":return"h-68px rounded-xl";case"md":return"h-42px rounded-lg";case"sm":return"h-32px rounded-md";default:return"h-68px rounded-xl"}}function p(s){switch(s){case"de":case"md":case"sm":return"text-body-2xs font-normal";default:return"text-body-xs font-normal"}}return(s,f)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["flex items-center justify-center gap-2 py-3 border font-normal text-input-grey transition-colors duration-300 ease-in-out",c(s.type,n.value),i(s.size),s.paddingClassX,s.customClass]),type:"button",disabled:n.value,onClick:r},[e.renderSlot(s.$slots,"prefix"),s.loading?(e.openBlock(),e.createBlock(F,{key:0})):(e.openBlock(),e.createElementBlock("div",re,[s.label?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(["mb-0",p(s.size)])},e.toDisplayString(s.label),3)):e.renderSlot(s.$slots,"default",{key:1})])),e.renderSlot(s.$slots,"suffix")],10,ae))}}),se={class:"mb-0 text-body-3xs font-normal text-red-500"},q=e.defineComponent({__name:"input-error",props:{errorMessage:{}},setup(o){return(l,t)=>(e.openBlock(),e.createElementBlock("p",se,e.toDisplayString(l.errorMessage),1))}});async function K(o,l,t){try{const a=Q(l);return await(await fetch(`${a}/api/v1/checkout/generate-payment-link2`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:t},body:JSON.stringify({...o,LinkName:`${Date.now()}-Link`})})).json()}catch{}}const ce={key:0,class:"w-full h-48 flex flex-col justify-center items-center"},R=e.defineComponent({__name:"checkout-iframe",props:{style:{default:()=>({width:"100%",height:"100vh",border:"0",borderRadius:"6px",overflow:"hidden"})},url:{default:void 0},secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""})}},setup(o){const l=o,t=e.computed(()=>({...l.style})),a=e.ref(null),n=e.ref(null),r=e.ref(""),c=e.ref(!1);function i(){n.value&&n.value.parentNode&&n.value.parentNode.removeChild(n.value),n.value=null}function p(f){if(!a.value)return;i();const u=document.createElement("iframe");u.src=f;const m=l.style;m.width&&(u.style.width=m.width),m.height&&(u.style.height=m.height),m.border&&(u.style.border=m.border),m.borderRadius&&(u.style.borderRadius=m.borderRadius),m.overflow&&(u.style.overflow=m.overflow),a.value.appendChild(u),n.value=u}async function s(){if(l.url){p(l.url);return}if(!l.secretKey){r.value="Secret key is required.";return}if(!j(l.paymentObject)){r.value="Kindly ensure you are passing all the required data.";return}c.value=!0,r.value="";try{const f=await K(l.paymentObject,l.environment,l.secretKey);f!=null&&f.isSuccessful&&f.launchUrl?(r.value="Payment link created successfully",p(f.launchUrl)):r.value="Failed to create payment link"}catch(f){r.value=(f==null?void 0:f.message)||"Failed to create payment link"}finally{c.value=!1}}return e.onMounted(()=>{s()}),e.watch(()=>l.url,f=>{f&&p(f)}),e.onBeforeUnmount(()=>{i()}),(f,u)=>c.value?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(F)])):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"containerRef",ref:a,style:e.normalizeStyle(t.value)},null,4))}}),ie={key:1},de=e.defineComponent({__name:"checkout-button",props:{secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""})},mode:{default:"redirect"}},setup(o){const l=o,t=e.ref(""),a=e.ref(""),n=e.ref(!1);async function r(){if(!l.secretKey){t.value="Secret key is required.";return}if(!j(l.paymentObject)){t.value="Kindly ensure you are passing all the required data.";return}n.value=!0,t.value="";try{const s=await K(l.paymentObject,l.environment,l.secretKey);s!=null&&s.isSuccessful&&s.launchUrl?(a.value=s.launchUrl,t.value="Payment link created successfully",l.mode==="redirect"&&window.open(s.launchUrl,"_blank","noopener,noreferrer")):t.value="Failed to create payment link"}catch(s){t.value=(s==null?void 0:s.message)||"Failed to create payment link"}finally{n.value=!1}}const{secretKey:c,environment:i,mode:p}=l;return(s,f)=>a.value&&e.unref(p)==="iframe"?(e.openBlock(),e.createBlock(R,{key:0,url:a.value,secretKey:e.unref(c),environment:e.unref(i)},null,8,["url","secretKey","environment"])):(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(w,{label:"Pay",type:"primary",customClass:"w-full",loading:n.value,onClick:r},null,8,["loading"]),e.createVNode(q,{errorMessage:t.value},null,8,["errorMessage"])]))}}),pe=["width","height"],me=["fill"],fe=e.defineComponent({__name:"icon-chevron-left",props:{width:{default:17},height:{default:17},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M10.5 14.28C10.3734 14.28 10.2467 14.2333 10.1467 14.1333L5.80002 9.78668C5.09335 9.08001 5.09335 7.92001 5.80002 7.21335L10.1467 2.86668C10.34 2.67335 10.66 2.67335 10.8534 2.86668C11.0467 3.06001 11.0467 3.38001 10.8534 3.57335L6.50669 7.92001C6.18669 8.24001 6.18669 8.76001 6.50669 9.08001L10.8534 13.4267C11.0467 13.62 11.0467 13.94 10.8534 14.1333C10.7534 14.2267 10.6267 14.28 10.5 14.28Z",fill:e.unref(r)},null,8,me)],16,pe))}}),ue=e.defineComponent({__name:"back",emits:["back"],setup(o,{emit:l}){return(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 cursor-pointer",onClick:a[0]||(a[0]=n=>t.$emit("back"))},[e.createVNode(fe),a[1]||(a[1]=e.createElementVNode("p",{class:"mb-0 text-body-xs font-normal"},"Back",-1))]))}}),he=["width","height"],ye=["fill"],Ce=e.defineComponent({__name:"icon-buzapay-icon",props:{width:{default:15},height:{default:13},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 15 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M9.97919 0.5C10.8854 0.5 11.6276 0.585938 12.2057 0.757812C12.7891 0.924479 13.2188 1.22396 13.4948 1.65625C13.7761 2.08333 13.9167 2.6901 13.9167 3.47656C13.9167 4.1849 13.7526 4.77083 13.4245 5.23438C13.0964 5.69792 12.5938 5.95312 11.9167 6C12.8021 6.08854 13.4401 6.40625 13.8307 6.95312C14.2214 7.49479 14.4167 8.17708 14.4167 9C14.4167 9.71354 14.3334 10.2995 14.1667 10.7578C14.0052 11.2161 13.7318 11.5729 13.3464 11.8281C12.961 12.0781 12.4375 12.2526 11.7761 12.3516C11.1198 12.4505 10.2995 12.5 9.31512 12.5H0.416687V0.5H9.97919ZM2.91669 7.77344H5.97235V11.167L10.2497 5.22754H7.19501V1.83398L2.91669 7.77344ZM5.97235 6.07617H8.2702L7.19501 7.57324V6.9248H4.89716L5.97235 5.42676V6.07617Z",fill:e.unref(r)},null,8,ye)],16,he))}}),ge={class:"checkout-card w-full h-screen flex flex-col items-center justify-center text-white"},be={class:"flex w-1/2"},_e={class:"flex gap-2 w-full"},ke={class:"flex flex-col gap-8 w-full"},xe={class:"bg-off-white rounded-xl"},Ve={class:"flex items-center gap-2 justify-center"},we=e.defineComponent({__name:"card",props:{showBackButton:{type:Boolean,default:!1}},emits:["back","close"],setup(o,{emit:l}){const t=l;return(a,n)=>(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",be,[a.showBackButton?(e.openBlock(),e.createBlock(ue,{key:0,onBack:n[0]||(n[0]=r=>t("back"))})):e.createCommentVNode("",!0),e.createElementVNode("div",_e,[e.createElementVNode("div",ke,[e.createElementVNode("div",xe,[e.renderSlot(a.$slots,"default")]),e.createElementVNode("div",Ve,[n[2]||(n[2]=e.createElementVNode("p",{class:"text-light-white-100 text-body-2xs font-regular"}," Powered by Buzapay ",-1)),e.createVNode(Ce,{color:"#E8F4FF"})])]),e.createElementVNode("div",{class:"close-icon flex flex-col items-center justify-center self-start cursor-pointer hover:bg-gray-500",onClick:n[1]||(n[1]=r=>t("close")),role:"button","aria-label":"Close"},[...n[3]||(n[3]=[e.createElementVNode("p",{class:"text-white"},"x",-1)])])])])]))}}),Be=["src","height","alt"],V=e.defineComponent({__name:"image",props:{src:{},height:{default:50},width:{default:50},alt:{default:"Image"},customClass:{default:""},isFullWidth:{type:Boolean,default:!1}},emits:["click"],setup(o,{emit:l}){const t=o,a=l,{src:n,height:r,width:c,alt:i,customClass:p,isFullWidth:s}=t;return(f,u)=>(e.openBlock(),e.createElementBlock("img",{src:e.unref(n),height:e.unref(r),alt:e.unref(i),class:e.normalizeClass([e.unref(p),e.unref(s)?"w-full":""]),style:e.normalizeStyle({width:e.unref(s)?"100%":e.unref(c)+"px"}),onClick:u[0]||(u[0]=m=>a("click"))},null,14,Be))}}),Ne=["aria-orientation"],Ee=["aria-checked","onClick"],$e={key:0,class:"bg-white w-2 h-2 rounded-full"},Se={class:"mb-0 text-body-2xs font-medium text-heading-text"},De=e.defineComponent({__name:"radio-group",props:{options:{default:()=>[]},type:{default:"vertical"},modelValue:{default:void 0},defaultValue:{default:void 0},className:{default:""}},emits:["update:modelValue","selectedChange"],setup(o,{emit:l}){const t=o,a=l,n=e.computed(()=>t.modelValue!==void 0),r=e.ref("");e.onMounted(()=>{if(n.value)return;const m=t.defaultValue??(t.options.length?t.options[0].value:"");r.value=m,m&&(a("update:modelValue",m),a("selectedChange",m))}),e.watch(()=>t.modelValue,m=>{n.value&&(r.value=m??"")},{immediate:!0});const c=e.computed(()=>n.value?t.modelValue??"":r.value);function i(m){n.value||(r.value=m),a("update:modelValue",m),a("selectedChange",m)}const p=e.computed(()=>t.type==="horizontal"?"flex-row gap-5":"flex-col gap-6"),{options:s,type:f,className:u}=t;return(m,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex",p.value,e.unref(u)]),role:"radiogroup","aria-orientation":e.unref(f)==="horizontal"?"horizontal":"vertical",tabindex:"0"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),b=>(e.openBlock(),e.createElementBlock("div",{key:b.value,role:"radio","aria-checked":c.value===b.value,tabindex:"-1",onClick:x=>i(b.value),class:"flex items-center gap-2 cursor-pointer transition-colors duration-200"},[e.createElementVNode("div",{class:e.normalizeClass(["w-4 h-4 rounded-full border flex items-center justify-center",c.value===b.value?"bg-orange-500 border-orange-500":"bg-white border-grey-200"])},[c.value===b.value?(e.openBlock(),e.createElementBlock("div",$e)):e.createCommentVNode("",!0)],2),e.createElementVNode("p",Se,e.toDisplayString(b.label),1)],8,Ee))),128))],10,Ne))}}),Le=["width","height"],Te=["fill"],Me=["fill"],Ae=["fill"],Pe=e.defineComponent({__name:"icon-copy-success",props:{width:{default:16},height:{default:17},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M11.4002 1.6875H8.60016C5.9935 1.6875 4.8335 2.8475 4.8335 5.45417V6.1875C4.8335 6.46083 5.06016 6.6875 5.3335 6.6875H7.40016C9.46683 6.6875 10.1668 7.3875 10.1668 9.45417V11.5208C10.1668 11.7942 10.3935 12.0208 10.6668 12.0208H11.4002C14.0068 12.0208 15.1668 10.8608 15.1668 8.25417V5.45417C15.1668 2.8475 14.0068 1.6875 11.4002 1.6875ZM5.8335 5.6875V5.45417C5.8335 3.3875 6.5335 2.6875 8.60016 2.6875H11.4002C13.4668 2.6875 14.1668 3.3875 14.1668 5.45417V8.25417C14.1668 10.3208 13.4668 11.0208 11.4002 11.0208H11.1668V9.45417C11.1668 6.8475 10.0068 5.6875 7.40016 5.6875H5.8335Z",fill:e.unref(r)},null,8,Te),e.createElementVNode("path",{d:"M7.40016 5.6875H4.60016C1.9935 5.6875 0.833496 6.8475 0.833496 9.45417V12.2542C0.833496 14.8608 1.9935 16.0208 4.60016 16.0208H7.40016C10.0068 16.0208 11.1668 14.8608 11.1668 12.2542V9.45417C11.1668 6.8475 10.0068 5.6875 7.40016 5.6875ZM4.60016 15.0208C2.5335 15.0208 1.8335 14.3208 1.8335 12.2542V9.45417C1.8335 7.3875 2.5335 6.6875 4.60016 6.6875H7.40016C9.46683 6.6875 10.1668 7.3875 10.1668 9.45417V12.2542C10.1668 14.3208 9.46683 15.0208 7.40016 15.0208H4.60016Z",fill:e.unref(r)},null,8,Me),e.createElementVNode("path",{d:"M5.35302 12.6542C5.22635 12.6542 5.09969 12.6075 4.99969 12.5075L3.69969 11.2075C3.50635 11.0142 3.50635 10.6942 3.69969 10.5008C3.89302 10.3075 4.21302 10.3075 4.40635 10.5008L5.35302 11.4475L7.59302 9.2075C7.78635 9.01417 8.10635 9.01417 8.29969 9.2075C8.49302 9.40083 8.49302 9.72083 8.29969 9.91417L5.69969 12.5075C5.60635 12.6008 5.47969 12.6542 5.35302 12.6542Z",fill:e.unref(r)},null,8,Ae)],16,Le))}}),N=e.defineComponent({__name:"copy",props:{copyText:{},color:{}},setup(o){const l=o;function t(n){return navigator.clipboard.writeText(n)}function a(){t(l.copyText).then(()=>{}).catch(n=>{console.error("Copy failed:",n)})}return(n,r)=>(e.openBlock(),e.createBlock(Pe,{class:"cursor-pointer",color:n.color,onClick:a},null,8,["color"]))}}),Ie={class:"flex items-center gap-1"},He={key:1,class:"flex items-center justify-between"},Ue={class:"flex items-center gap-1"},E=e.defineComponent({__name:"label-info",props:{type:{default:"vertical"},label:{default:""},labelCustomClass:{default:"text-body-4xs font-medium text-light-copy"},valueImageSrc:{default:""},valueImageCustomClass:{default:""},valueImagePosition:{default:"prefix"},hasValueCopy:{type:Boolean,default:!1},value:{default:""},valueCustomClass:{default:"text-body-2xs font-medium text-sub-copy"},alignRight:{type:Boolean,default:!1}},setup(o){const l=o,t=e.computed(()=>(l.label??"").toUpperCase()),a=e.computed(()=>!!l.valueImageSrc&&l.valueImagePosition==="prefix"),n=e.computed(()=>!!l.valueImageSrc&&l.valueImagePosition==="suffix"),r=e.computed(()=>ee(l.value,40)),{type:c,labelCustomClass:i,valueImageSrc:p,valueImageCustomClass:s,hasValueCopy:f,value:u,valueCustomClass:m,alignRight:B}=l;return(b,x)=>e.unref(c)==="vertical"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex flex-col gap-1",e.unref(B)?"text-right items-end":""])},[e.createElementVNode("p",{class:e.normalizeClass(e.unref(i))},e.toDisplayString(t.value),3),e.createElementVNode("div",Ie,[a.value?(e.openBlock(),e.createBlock(V,{key:0,src:e.unref(p),alt:e.unref(u),width:22,customClass:e.unref(s)},null,8,["src","alt","customClass"])):e.createCommentVNode("",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("p",{key:2,class:e.normalizeClass([e.unref(m),"truncate"])},e.toDisplayString(r.value),3)):(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(m))},e.toDisplayString(e.unref(u)),3)),e.unref(f)?(e.openBlock(),e.createBlock(N,{key:3,copyText:e.unref(u),color:"#9DBFDE"},null,8,["copyText"])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(V,{key:4,src:e.unref(p),alt:e.unref(u),width:22,customClass:e.unref(s)},null,8,["src","alt","customClass"])):e.createCommentVNode("",!0)])],2)):(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("p",{class:e.normalizeClass(e.unref(i))},e.toDisplayString(t.value),3),e.createElementVNode("div",Ue,[a.value?(e.openBlock(),e.createBlock(V,{key:0,src:e.unref(p),alt:e.unref(u),width:22,customClass:e.unref(s)},null,8,["src","alt","customClass"])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:e.normalizeClass(e.unref(m))},e.toDisplayString(e.unref(u)),3),e.unref(f)?(e.openBlock(),e.createBlock(N,{key:1,copyText:e.unref(u),color:"#9DBFDE"},null,8,["copyText"])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(V,{key:2,src:e.unref(p),alt:e.unref(u),width:22,customClass:e.unref(s)},null,8,["src","alt","customClass"])):e.createCommentVNode("",!0)])]))}}),ze=["width","height"],je=["fill"],Fe=e.defineComponent({__name:"icon-check-circle",props:{width:{default:67},height:{default:67},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 67 67",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M33.6705 0.0820312C15.2758 0.0820312 0.36377 14.9941 0.36377 33.3888C0.36377 51.7846 15.2758 66.6956 33.6705 66.6956C52.0663 66.6956 66.9773 51.7846 66.9773 33.3888C66.9773 14.9941 52.0663 0.0820312 33.6705 0.0820312ZM33.6705 62.5978C17.6011 62.5978 4.52712 49.4583 4.52712 33.3887C4.52712 17.3192 17.6011 4.24525 33.6705 4.24525C49.74 4.24525 62.814 17.3193 62.814 33.3887C62.814 49.4581 49.74 62.5978 33.6705 62.5978ZM46.9631 21.2016L27.4213 40.8662L18.621 32.0659C17.8081 31.253 16.4904 31.253 15.6765 32.0659C14.8636 32.8788 14.8636 34.1965 15.6765 35.0094L25.9797 45.3137C26.7926 46.1255 28.1103 46.1255 28.9243 45.3137C29.0179 45.22 29.0981 45.1179 29.171 45.0118L49.9086 24.1461C50.7205 23.3332 50.7205 22.0155 49.9086 21.2016C49.0947 20.3888 47.777 20.3888 46.9631 21.2016Z",fill:e.unref(r)},null,8,je)],16,ze))}}),qe={class:"flex flex-col gap-8 p-16"},Ke={class:"flex flex-col gap-8"},Re={class:"flex flex-col gap-8"},Ze={class:"flex flex-col"},Oe={class:"py-4 border-b border-grey-100"},Ge={class:"py-4"},Ye={class:"mx-auto",style:{width:"80%"}},We=e.defineComponent({__name:"success",setup(o){return(l,t)=>(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",Ke,[e.createElementVNode("div",Re,[e.createVNode(Fe,{color:"#F47A1F",class:"mx-auto"}),t[0]||(t[0]=e.createElementVNode("div",{class:"flex flex-col text-center",style:{gap:"2px"}},[e.createElementVNode("p",{class:"text-heading-text font-medium text-header-2xl"},"₦2,500.00"),e.createElementVNode("p",{class:"text-sub-copy font-regular text-body-3xs"}," Has been paid successfully ")],-1))]),e.createElementVNode("div",Ze,[e.createElementVNode("div",Oe,[e.createVNode(E,{type:"horizontal",label:"Order ID",value:"9900009000-8890-8829hd7"})]),e.createElementVNode("div",Ge,[e.createVNode(E,{type:"horizontal",label:"Payment date",value:"July 24, 2025"})])])]),e.createElementVNode("div",Ye,[e.createVNode(w,{label:"Return to Merchant Website",type:"secondary",customClass:"w-full"})])]))}}),Je={key:0,class:"mb-0 text-body-2xs font-normal text-heading-text"},Xe={key:0,class:"text-orange-required"},Qe=["type","value","disabled","placeholder","inputmode"],ve={key:1,class:"animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"},et={key:1,class:"text-body-3xs text-light-copy"},tt={key:2,class:"text-body-3xs text-red-500"},k=e.defineComponent({__name:"input",props:{label:{default:""},type:{default:"text"},placeholder:{default:void 0},validationError:{default:""},hint:{default:""},mask:{default:""},rules:{default:()=>[]},isAmountInput:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},showCopyIcon:{type:Boolean,default:!1},modelValue:{default:void 0},defaultValue:{default:""},className:{default:""}},emits:["update:modelValue","blur","copied"],setup(o,{emit:l}){const t=o,a=l,n=e.computed(()=>t.modelValue!==void 0),r=e.ref(t.modelValue??t.defaultValue??""),c=e.ref(""),i=e.ref(""),p=e.ref(null);e.watch(()=>t.modelValue,h=>{n.value&&(r.value=h??"")});const s=e.computed(()=>t.isAmountInput?S(r.value.replace(/,/g,"")):r.value);function f(h){const T=h.target.value.replace(/,/g,"");n.value||(r.value=T),a("update:modelValue",T),e.nextTick(()=>{const $=p.value;if($){const M=$.value.length;$.setSelectionRange(M,M)}})}function u(){a("blur",r.value)}function m(h){t.rules.includes("numeric")&&te(h)}const B=e.computed(()=>t.disabled?"bg-grey-50 cursor-not-allowed":"bg-white"),b=e.computed(()=>t.validationError||i.value?"border-red-300 bg-red-50":"border-grey-100");function x(h){return navigator.clipboard.writeText(h)}function H(){x(r.value).then(()=>{i.value="",c.value="Text copied to clipboard",a("copied")}).catch(()=>{c.value="",i.value="Failed to copy text to clipboard"})}return(h,L)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2",h.className])},[h.label?(e.openBlock(),e.createElementBlock("p",Je,[e.createTextVNode(e.toDisplayString(h.label)+" ",1),h.required?(e.openBlock(),e.createElementBlock("span",Xe," *")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["border-c px-3 py-2 flex items-center justify-between rounded-md h-12",B.value,b.value])},[e.renderSlot(h.$slots,"prefix"),e.createElementVNode("input",{ref_key:"inputEl",ref:p,type:h.type,value:s.value,disabled:h.disabled,placeholder:h.placeholder??(h.label?`Enter ${h.label.toLowerCase()}`:void 0),inputmode:h.isAmountInput?"decimal":void 0,class:"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full",onInput:f,onBlur:u,onKeydown:m},null,40,Qe),h.loading?(e.openBlock(),e.createElementBlock("div",ve)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(h.$slots,"suffix"),h.showCopyIcon&&r.value.trim()!==""?(e.openBlock(),e.createBlock(V,{key:0,src:"assets/images/copyIcon.svg",alt:"copy",width:16,height:16,customClass:"cursor-pointer hover:opacity-70 transition-opacity",onClick:H})):e.createCommentVNode("",!0)],64))],2),h.hint||c.value?(e.openBlock(),e.createElementBlock("p",et,e.toDisplayString(c.value||h.hint),1)):e.createCommentVNode("",!0),h.validationError||i.value?(e.openBlock(),e.createElementBlock("p",tt,e.toDisplayString(i.value||h.validationError),1)):e.createCommentVNode("",!0)],2))}}),ot=["width","height"],lt={opacity:"0.6"},nt=["fill"],at=e.defineComponent({__name:"icon-chevron-down",props:{width:{default:24},height:{default:24},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("g",lt,[e.createElementVNode("path",{d:"M16.5813 7.83128L10.3313 14.0813C10.2434 14.1691 10.1242 14.2184 10 14.2184C9.87581 14.2184 9.75667 14.1691 9.66878 14.0813L3.41878 7.83128C3.33598 7.74242 3.2909 7.62489 3.29304 7.50345C3.29518 7.38201 3.34438 7.26615 3.43026 7.18026C3.51615 7.09438 3.63201 7.04518 3.75345 7.04304C3.87489 7.0409 3.99242 7.08598 4.08128 7.16878L10 13.0867L15.9188 7.16878C16.0076 7.08598 16.1252 7.0409 16.2466 7.04304C16.368 7.04518 16.4839 7.09438 16.5698 7.18026C16.6557 7.26615 16.7049 7.38201 16.707 7.50345C16.7092 7.62489 16.6641 7.74242 16.5813 7.83128Z",fill:e.unref(r)},null,8,nt)])],16,ot))}}),rt=["width","height"],st={opacity:"0.7"},ct=["fill"],it=e.defineComponent({__name:"icon-chevron-up",props:{width:{default:24},height:{default:24},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("g",st,[e.createElementVNode("path",{d:"M2.73508 9.73495L7.73508 4.73495C7.80539 4.66473 7.9007 4.62528 8.00008 4.62528C8.09945 4.62528 8.19476 4.66473 8.26508 4.73495L13.2651 9.73495C13.3313 9.80604 13.3674 9.90006 13.3657 9.99722C13.364 10.0944 13.3246 10.1871 13.2559 10.2558C13.1872 10.3245 13.0945 10.3638 12.9973 10.3655C12.9002 10.3673 12.8062 10.3312 12.7351 10.265L8.00008 5.53058L3.26508 10.265C3.19399 10.3312 3.09997 10.3673 3.00282 10.3655C2.90566 10.3638 2.81297 10.3245 2.74427 10.2558C2.67556 10.1871 2.6362 10.0944 2.63449 9.99722C2.63277 9.90006 2.66884 9.80604 2.73508 9.73495Z",fill:e.unref(r)},null,8,ct)])],16,rt))}}),dt={class:"mb-0 text-body-3xs font-medium text-orange-500"},pt=e.defineComponent({__name:"hint",props:{hint:{}},setup(o){return(l,t)=>(e.openBlock(),e.createElementBlock("p",dt,e.toDisplayString(l.hint),1))}}),mt={key:0,class:"mb-0 text-body-2xs font-normal text-heading-text"},ft={key:0,class:"text-orange-required"},ut=["aria-expanded","aria-controls","aria-disabled","aria-activedescendant"],ht={class:"flex items-center gap-2"},yt={class:"flex items-center gap-2"},Ct={key:0,class:"inline-block h-4 w-4 border-2 border-current border-t-transparent rounded-full animate-spin"},gt=["aria-label"],bt={key:0,class:"px-4 pt-2 pb-1"},_t=["placeholder"],kt=["onClick","id","aria-selected"],xt={class:"mb-0 text-body-2xs font-medium"},D=e.defineComponent({__name:"select",props:{options:{default:()=>[]},modelValue:{default:void 0},defaultValue:{default:void 0},className:{default:""},placeholder:{default:"Select an option"},hasSearch:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},validationError:{default:""},label:{default:""},hint:{default:""},required:{type:Boolean,default:!1},itemImageType:{default:null}},emits:["update:modelValue","change"],setup(o,{emit:l}){const t=o,a=l,n=e.ref(!1),r=e.ref(t.defaultValue??t.modelValue??""),c=e.ref([...t.options]),i=e.ref(-1),p=e.ref(null),s=e.ref(null),f=e.ref(null),u=e.computed(()=>t.modelValue!==void 0);e.watch(()=>t.modelValue,d=>{u.value&&(r.value=d??"")}),e.watch(()=>t.options,d=>{c.value=[...d]},{immediate:!0});const m=e.computed(()=>{const d=u.value?t.modelValue:r.value;return t.options.find(y=>y.value===d)??null}),B=e.computed(()=>{var d;return((d=m.value)==null?void 0:d.label)||t.placeholder||(t.label?`Select ${t.label}`:"Select an option")});function b(){if(t.disabled||n.value)return;c.value=[...t.options];const d=m.value?Math.max(0,t.options.findIndex(y=>y.value===m.value.value)):0;i.value=d,n.value=!0,e.nextTick(()=>{t.hasSearch&&f.value&&(f.value.focus(),f.value.select())})}function x(){n.value&&(n.value=!1,i.value=-1)}function H(){t.disabled||(n.value?x():b())}function h(d){if(!n.value)return;const y=d.target,g=p.value,C=s.value;g&&!g.contains(y)&&C&&!C.contains(y)&&x()}e.watch(n,d=>{d?document.addEventListener("mousedown",h):document.removeEventListener("mousedown",h)}),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",h));function L(d){u.value||(r.value=d),a("update:modelValue",d),a("change",d),x()}function T(d){const y=d.target.value.toLowerCase(),g=t.options.filter(C=>C.label.toLowerCase().includes(y));c.value=g,i.value=g.length?0:-1}function $(d){if(!t.disabled)switch(d.key){case"Enter":case" ":case"Spacebar":case"ArrowDown":d.preventDefault(),n.value?A(1):b();break;case"ArrowUp":d.preventDefault(),n.value?A(-1):b();break;case"Escape":n.value&&(d.preventDefault(),x());break}}function M(d){switch(d.key){case"ArrowDown":d.preventDefault(),A(1);break;case"ArrowUp":d.preventDefault(),A(-1);break;case"Home":d.preventDefault(),i.value=c.value.length?0:-1,U(0);break;case"End":d.preventDefault(),i.value=c.value.length-1,U(c.value.length-1);break;case"Enter":if(d.preventDefault(),i.value>=0){const y=c.value[i.value];y&&L(y.value)}break;case"Escape":d.preventDefault(),x();break;case"Tab":x();break}}function A(d){if(!c.value.length)return;const y=c.value.length-1,g=i.value<0?0:Math.min(y,Math.max(0,i.value+d));i.value=g,U(g)}function U(d){var C;const y=s.value;if(!y)return;const g=y.querySelectorAll("[data-option]");d>=0&&d<g.length&&((C=g[d])==null||C.scrollIntoView({block:"nearest"}))}const To=e.computed(()=>t.disabled?"bg-grey-100 cursor-not-allowed":"bg-white"),Mo=e.computed(()=>t.validationError?"border-red-300 bg-red-50":"border-grey-100 bg-white"),{options:zo,placeholder:jo,hasSearch:Ao,disabled:Po,loading:Io,validationError:Z,label:P,hint:O,required:Ho,itemImageType:G,className:Uo}=t;return(d,y)=>{var g;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 relative",e.unref(Uo)])},[e.unref(P)?(e.openBlock(),e.createElementBlock("p",mt,[e.createTextVNode(e.toDisplayString(e.unref(P))+" ",1),e.unref(Ho)?(e.openBlock(),e.createElementBlock("span",ft," *")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerRef",ref:p,class:e.normalizeClass(["border-c rounded-md flex items-center justify-between h-12 cursor-pointer px-3 py-2",To.value,Mo.value]),role:"combobox","aria-haspopup":"listbox","aria-expanded":n.value,"aria-controls":n.value?"select-menu":void 0,"aria-disabled":e.unref(Po)||void 0,"aria-activedescendant":n.value&&i.value>=0?`option-${i.value}`:void 0,tabindex:"0",onClick:H,onKeydown:$},[e.createElementVNode("div",ht,[e.renderSlot(d.$slots,"prefix"),e.createElementVNode("div",yt,[m.value&&e.unref(G)==="country"&&m.value.countryCode?(e.openBlock(),e.createBlock(V,{key:0,src:`https://flagcdn.com/w40/${m.value.countryCode.toLowerCase()}.png`,alt:m.value.countryCode,width:28,customClass:"rounded-lg"},null,8,["src","alt"])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:e.normalizeClass(["text-body-2xs font-normal mb-0",(g=m.value)!=null&&g.label?"text-sub-copy":"text-grey-500"])},e.toDisplayString(B.value),3)])]),e.unref(Io)?(e.openBlock(),e.createElementBlock("span",Ct)):n.value?(e.openBlock(),e.createBlock(it,{key:1,color:"#8FAECA"})):(e.openBlock(),e.createBlock(at,{key:2,color:"#8FAECA"}))],42,ut),n.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"menuRef",ref:s,id:"select-menu",class:"border-c bg-white rounded-md border-grey-border text-body-xs font-normal text-input-grey w-full mt-2 max-h-22rem overflow-y-auto",role:"listbox","aria-label":e.unref(P)||"Options",style:{position:"absolute",top:"100%",zIndex:10},onKeydown:M},[e.unref(Ao)?(e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("input",{ref_key:"searchRef",ref:f,type:"text",placeholder:`Search ${e.unref(P)||"options"}`,class:"bg-transparent outline-none border-b pb-2 w-full focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal",onInput:T},null,40,_t)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(C,Y)=>{var W;return e.openBlock(),e.createElementBlock("div",{key:C.value,onClick:Fo=>L(C.value),id:`option-${Y}`,"data-option":"",role:"option","aria-selected":((W=m.value)==null?void 0:W.value)===C.value,class:e.normalizeClass(["px-4 py-3 first:pt-0 hover:bg-gray-100 flex items-center gap-2 cursor-pointer",Y===i.value?"bg-gray-100":""])},[e.unref(G)==="country"&&C.countryCode?(e.openBlock(),e.createBlock(V,{key:0,src:`https://flagcdn.com/w40/${C.countryCode.toLowerCase()}.png`,alt:C.countryCode,width:28,customClass:"rounded-lg"},null,8,["src","alt"])):e.createCommentVNode("",!0),e.createElementVNode("p",xt,e.toDisplayString(C.label),1)],10,kt)}),128))],40,gt)):e.createCommentVNode("",!0),e.unref(O)?(e.openBlock(),e.createBlock(pt,{key:2,hint:e.unref(O)},null,8,["hint"])):e.createCommentVNode("",!0),e.unref(Z)?(e.openBlock(),e.createBlock(q,{key:3,errorMessage:e.unref(Z)},null,8,["errorMessage"])):e.createCommentVNode("",!0)],2)}}}),Vt={class:"flex flex-col gap-6"},wt={key:0,class:"grid grid-cols-2 gap-6 overflow-y-auto"},Bt={class:"col-span-2"},Nt={key:1,class:"grid grid-cols-2 gap-6 overflow-y-auto",style:{"max-height":"320px"}},Et={class:"col-span-2"},$t={class:"col-span-2"},St=e.defineComponent({__name:"pay-by-card",setup(o){const l=e.ref(0);return(t,a)=>(e.openBlock(),e.createElementBlock("div",Vt,[l.value===0?(e.openBlock(),e.createElementBlock("div",wt,[e.createVNode(k,{label:"First Name",required:!0}),e.createVNode(k,{label:"Last Name",required:!0}),e.createVNode(k,{label:"Email",required:!0}),e.createVNode(k,{label:"Phone Number",required:!0}),e.createVNode(D,{label:"Select Country",required:!0,options:[{label:"United States",value:"US"},{label:"Canada",value:"CA"},{label:"United Kingdom",value:"UK"}]}),e.createVNode(D,{label:"Select State",required:!0,options:[{label:"California",value:"CA"},{label:"Texas",value:"TX"},{label:"New York",value:"NY"}]}),e.createVNode(k,{label:"City",required:!0}),e.createVNode(k,{label:"Postal Code",required:!0}),e.createElementVNode("div",Bt,[e.createVNode(k,{label:"Street Address",required:!0})])])):l.value===1?(e.openBlock(),e.createElementBlock("div",Nt,[e.createElementVNode("div",Et,[e.createVNode(k,{label:"Card Name",required:!0})]),e.createElementVNode("div",$t,[e.createVNode(k,{label:"Card Number",required:!0})]),e.createVNode(k,{label:"Expiry Date",required:!0}),e.createVNode(k,{label:"CVV",required:!0})])):e.createCommentVNode("",!0),e.createVNode(w,{label:l.value===0?"Proceed":"Pay",type:"primary",customClass:"w-full",onClick:a[0]||(a[0]=n=>l.value===0&&(l.value=1))},null,8,["label"])]))}}),Dt={class:"flex flex-col gap-10"},Lt={class:"text-sub-copy text-sm font-semibold text-center"},Tt={class:"bg-[#EFF7FF] p-4 rounded-lg flex flex-col gap-6"},Mt={class:"flex items-center justify-between"},At={class:"flex items-center justify-between"},Pt={class:"w-2/3 mx-auto text-center text-body-2xs font-medium text-sub-copy"},It={class:"text-orange-500"},Ht={class:"flex flex-col gap-4"},Ut=e.defineComponent({__name:"pay-by-transfer",props:{amountDisplay:{default:"NGN 200,500.00"},bankName:{default:"Teerus MFB"},accountNumber:{default:"0001928940"},initialSeconds:{default:30*60}},emits:["confirm","cancel"],setup(o,{emit:l}){const t=o,a=l,n=e.ref(t.initialSeconds),r=e.ref(null),c=e.computed(()=>{const i=Math.max(0,n.value),p=Math.floor(i/60),s=i%60;return`${String(p).padStart(2,"0")}:${String(s).padStart(2,"0")}`});return e.onMounted(()=>{r.value=window.setInterval(()=>{n.value-=1},1e3)}),e.onBeforeUnmount(()=>{r.value&&(clearInterval(r.value),r.value=null)}),e.watch(n,i=>{i<0&&r.value&&(clearInterval(r.value),r.value=null)}),(i,p)=>(e.openBlock(),e.createElementBlock("div",Dt,[e.createElementVNode("p",Lt," Amount to Pay "+e.toDisplayString(i.amountDisplay),1),e.createElementVNode("div",Tt,[e.createVNode(E,{label:"Bank Name",value:i.bankName,type:"horizontal"},null,8,["value"]),e.createElementVNode("div",Mt,[e.createVNode(E,{label:"Account Number",value:i.accountNumber,type:"horizontal"},null,8,["value"]),e.createVNode(N,{color:"#9DBFDE",copyText:i.accountNumber},null,8,["copyText"])]),e.createElementVNode("div",At,[e.createVNode(E,{label:"Amount",value:i.amountDisplay,type:"horizontal"},null,8,["value"]),e.createVNode(N,{color:"#9DBFDE",copyText:i.amountDisplay},null,8,["copyText"])])]),e.createElementVNode("p",Pt,[p[2]||(p[2]=e.createTextVNode(" This account is for this transaction only and expires in ",-1)),e.createElementVNode("span",It,e.toDisplayString(n.value>=0?c.value:"00:00"),1)]),e.createElementVNode("div",Ht,[e.createVNode(w,{label:"I have paid the money",type:"primary",customClass:"w-full",onClick:p[0]||(p[0]=s=>a("confirm"))}),e.createElementVNode("button",{type:"button",onClick:p[1]||(p[1]=s=>a("cancel")),class:"text-heading-text text-body-2xs font-medium text-center py-2 cursor-pointer"}," Cancel Payment ")])]))}}),zt=["width","height"],jt={"clip-path":"url(#clip0_10908_387048)"},Ft=["fill"],qt={id:"clip0_10908_387048"},Kt=["fill"],Rt=e.defineComponent({__name:"icon-usdc",props:{width:{default:28},height:{default:28},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("g",jt,[e.createElementVNode("path",{d:"M14 0C21.7324 0 28 6.26763 28 14C28 21.7324 21.7324 28 14 28C6.26763 28 0 21.7324 0 14C0 6.26763 6.26763 0 14 0ZM16.933 4.865C16.7195 4.76 16.506 4.865 16.4535 5.07762C16.4001 5.131 16.4001 5.18438 16.4001 5.29025V6.034L16.4089 6.125C16.4546 6.30501 16.5652 6.46177 16.7195 6.56512C20.8792 8.05262 23.0125 12.6726 21.4655 16.7615C20.6657 18.9928 18.9061 20.6911 16.7195 21.4883C16.506 21.5941 16.4001 21.7534 16.4001 22.0194V22.7631L16.4045 22.8401C16.4128 22.9241 16.4479 23.0033 16.5047 23.0658C16.5614 23.1284 16.6367 23.171 16.7195 23.1875C16.7729 23.1875 16.8796 23.1875 16.933 23.135C18.1331 22.7602 19.2473 22.1517 20.2113 21.3446C21.1753 20.5375 21.9701 19.5476 22.5499 18.432C23.1298 17.3164 23.4833 16.0972 23.59 14.8444C23.6967 13.5917 23.5546 12.3302 23.1718 11.1326C22.2128 8.10512 19.866 5.8205 16.933 4.865ZM11.2805 4.8125C11.2271 4.8125 11.1204 4.8125 11.067 4.865C9.86688 5.23978 8.75274 5.84826 7.78874 6.6554C6.82475 7.46254 6.02993 8.4524 5.45006 9.56797C4.87019 10.6836 4.51673 11.9028 4.41001 13.1556C4.30329 14.4083 4.44543 15.6698 4.82825 16.8674C5.78725 19.8424 8.08062 22.1261 11.067 23.0816C11.2805 23.1875 11.494 23.0816 11.5465 22.869C11.5999 22.8165 11.5999 22.7622 11.5999 22.6564V21.9126L11.5911 21.8426C11.5544 21.6947 11.417 21.5259 11.2805 21.4349C7.12075 19.9474 4.9875 15.3274 6.5345 11.2385C7.33425 9.00725 9.09388 7.30887 11.2805 6.51175C11.494 6.40587 11.5999 6.24663 11.5999 5.98063V5.23688L11.5955 5.15987C11.5872 5.07585 11.5521 4.99673 11.4954 4.93418C11.4386 4.87163 11.3633 4.82898 11.2805 4.8125ZM14.3736 7.574H13.573L13.496 7.581C13.321 7.616 13.1933 7.7665 13.146 7.99925V9.22075L12.9649 9.24875C11.4704 9.51475 10.5341 10.5464 10.5341 11.823C10.5341 13.5748 11.5999 14.2651 13.8399 14.5311C15.3335 14.7963 15.813 15.1156 15.813 15.9653C15.813 16.814 15.0666 17.3985 14.0534 17.3985C12.6665 17.3985 12.187 16.8149 12.0269 16.0177C11.9744 15.806 11.8134 15.6992 11.6532 15.6992H10.7467L10.6776 15.7054C10.5913 15.7193 10.513 15.7641 10.4572 15.8313C10.4014 15.8985 10.3718 15.9838 10.374 16.0711V16.1236L10.4029 16.2811C10.6566 17.5271 11.5106 18.4187 13.2003 18.6734V19.9483L13.2072 20.0252C13.2422 20.1985 13.3936 20.3263 13.6273 20.3726H14.427L14.504 20.3656C14.679 20.3306 14.8067 20.1801 14.854 19.9483V18.6725L15.0351 18.6375C16.534 18.3207 17.5201 17.2366 17.5201 15.8576C17.5201 13.9991 16.4001 13.3621 14.1601 13.0961C12.5598 12.8835 12.2404 12.4591 12.2404 11.7154C12.2404 10.9716 12.7741 10.4939 13.8399 10.4939C14.7998 10.4939 15.3335 10.8124 15.5995 11.6095C15.6272 11.6866 15.6779 11.7533 15.7447 11.8007C15.8115 11.8481 15.8912 11.8739 15.9731 11.8746H16.8262L16.8954 11.8694C16.982 11.8556 17.0606 11.8108 17.1166 11.7434C17.1726 11.6759 17.2022 11.5904 17.1999 11.5027V11.4503L17.1675 11.2989C17.0361 10.755 16.7366 10.2664 16.3115 9.90255C15.8864 9.53872 15.3574 9.31821 14.7997 9.27238V7.99925L14.7928 7.92225C14.7578 7.74812 14.6073 7.62038 14.3736 7.574Z",fill:e.unref(r)},null,8,Ft)]),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",qt,[e.createElementVNode("rect",{width:"28",height:"28",fill:e.unref(r)},null,8,Kt)])])],16,zt))}}),Zt=["width","height"],Ot={"clip-path":"url(#clip0_10908_387045)"},Gt=["fill"],Yt={id:"clip0_10908_387045"},Wt=["fill"],Jt=e.defineComponent({__name:"icon-usdt",props:{width:{default:28},height:{default:28},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("g",Ot,[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 28C6.26763 28 0 21.7324 0 14C0 6.26763 6.26763 0 14 0C21.7324 0 28 6.26763 28 14C28 21.7324 21.7324 28 14 28ZM15.6818 12.0689V9.99863H20.419V6.84162H7.52063V9.99863H12.2579V12.068C8.40787 12.2447 5.5125 13.0077 5.5125 13.9212C5.5125 14.8347 8.40787 15.5969 12.2579 15.7745V22.4088H15.6818V15.7727C19.5256 15.596 22.414 14.8339 22.414 13.9212C22.414 13.0086 19.5256 12.2465 15.6818 12.0689ZM15.6818 15.2101V15.2084C15.5855 15.2154 15.0894 15.2451 13.9825 15.2451C13.0987 15.2451 12.4766 15.2189 12.2579 15.2084V15.211C8.85587 15.0614 6.31662 14.469 6.31662 13.7602C6.31662 13.0524 8.85587 12.46 12.2579 12.3077V14.6212C12.4801 14.637 13.1171 14.6746 13.9974 14.6746C15.0535 14.6746 15.5829 14.6309 15.6818 14.6221V12.3095C19.0768 12.4609 21.6099 13.0532 21.6099 13.7602C21.6099 14.469 19.0768 15.0596 15.6818 15.2101Z",fill:e.unref(r)},null,8,Gt)]),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Yt,[e.createElementVNode("rect",{width:"28",height:"28",fill:e.unref(r)},null,8,Wt)])])],16,Zt))}}),Xt={key:1,class:"flex items-center gap-1"},I=e.defineComponent({__name:"currency-amount",props:{currency:{},amount:{},textClass:{default:""},iconColorClass:{default:""},iconWidth:{default:16},iconHeight:{default:16}},setup(o){const l=o,t=e.computed(()=>{var a;return(a=l.currency)==null?void 0:a.toUpperCase()});return(a,n)=>t.value!=="USDT"&&t.value!=="USDC"?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(a.textClass)},e.toDisplayString(e.unref(S)(a.amount,t.value)),3)):(e.openBlock(),e.createElementBlock("div",Xt,[t.value==="USDT"?(e.openBlock(),e.createBlock(Jt,{key:0,width:a.iconWidth,height:a.iconHeight,color:a.iconColorClass},null,8,["width","height","color"])):e.createCommentVNode("",!0),t.value==="USDC"?(e.openBlock(),e.createBlock(Rt,{key:1,width:a.iconWidth,height:a.iconHeight,color:a.iconColorClass},null,8,["width","height","color"])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:e.normalizeClass(a.textClass)},e.toDisplayString(e.unref(S)(a.amount)),3)]))}}),Qt=["width","height"],vt=["fill"],eo=["fill"],to=["fill"],oo=["fill"],lo=e.defineComponent({__name:"icon-arrow-swap",props:{width:{default:16},height:{default:17},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M10.3265 14.1948C10.1998 14.1948 10.0731 14.1481 9.97313 14.0481C9.77979 13.8548 9.77979 13.5348 9.97313 13.3414L13.3131 10.0014C13.5065 9.80811 13.8265 9.80811 14.0198 10.0014C14.2131 10.1948 14.2131 10.5148 14.0198 10.7081L10.6798 14.0481C10.5798 14.1414 10.4531 14.1948 10.3265 14.1948Z",fill:e.unref(r)},null,8,vt),e.createElementVNode("path",{d:"M13.6668 10.8477H2.3335C2.06016 10.8477 1.8335 10.621 1.8335 10.3477C1.8335 10.0743 2.06016 9.84766 2.3335 9.84766H13.6668C13.9402 9.84766 14.1668 10.0743 14.1668 10.3477C14.1668 10.621 13.9402 10.8477 13.6668 10.8477Z",fill:e.unref(r)},null,8,eo),e.createElementVNode("path",{d:"M2.33329 6.86079C2.20663 6.86079 2.07996 6.81413 1.97996 6.71413C1.78663 6.52079 1.78663 6.20079 1.97996 6.00746L5.31996 2.66746C5.51329 2.47413 5.83329 2.47413 6.02663 2.66746C6.21996 2.86079 6.21996 3.18079 6.02663 3.37413L2.68663 6.71413C2.59329 6.80746 2.45996 6.86079 2.33329 6.86079Z",fill:e.unref(r)},null,8,to),e.createElementVNode("path",{d:"M13.6668 6.86133H2.3335C2.06016 6.86133 1.8335 6.63466 1.8335 6.36133C1.8335 6.08799 2.06016 5.86133 2.3335 5.86133H13.6668C13.9402 5.86133 14.1668 6.08799 14.1668 6.36133C14.1668 6.63466 13.9402 6.86133 13.6668 6.86133Z",fill:e.unref(r)},null,8,oo)],16,Qt))}}),no={class:"flex flex-col gap-6"},ao={class:"grid grid-cols-1 gap-6"},ro={key:1,class:"flex flex-col gap-6"},so={class:"mx-auto"},co={class:"flex flex-col gap-6 border-c border-grey-100 p-4 rounded-2xl bg-light-white-50"},io={class:"border-b border-grey-border pb-4 flex flex-col gap-2"},po={class:"flex justify-between"},mo={class:"flex flex-col gap-1"},fo={class:"flex items-center gap-2"},uo={class:"pb-4 flex flex-col gap-2"},ho={class:"flex justify-between"},yo={class:"flex flex-col gap-2"},Co={class:"flex items-center justify-between border-b border-grey-border py-3"},go={class:"flex items-center justify-between py-4"},bo={class:"flex flex-col gap-6"},_o=e.defineComponent({__name:"pay-by-stable-coin",emits:["proceed"],setup(o,{emit:l}){const t=l,a=e.ref(0);function n(){a.value=1,t("proceed")}return(r,c)=>(e.openBlock(),e.createElementBlock("div",no,[a.value===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",ao,[e.createVNode(D,{label:"Select Crypto",required:!0,options:[{label:"USDT",value:"USDT"},{label:"USDC",value:"USDC"},{label:"BUSD",value:"BUSD"}]}),e.createVNode(D,{label:"Select Network",required:!0,options:[{label:"Ethereum",value:"ETH"},{label:"Binance Smart Chain",value:"BSC"},{label:"Polygon",value:"MATIC"}]})]),e.createVNode(w,{label:"Pay",type:"primary",customClass:"w-full",onClick:n})],64)):(e.openBlock(),e.createElementBlock("div",ro,[e.createElementVNode("div",so,[e.createVNode(V,{src:"../../../assets/images/stable-coin-qr-code.png",alt:"QR Code",width:122,height:122,customClass:"mb-1"}),c[0]||(c[0]=e.createElementVNode("p",{class:"mb-0 text-body-4xs text-light-copy font-normal text-center"}," USDC ",-1))]),e.createElementVNode("div",co,[e.createElementVNode("div",io,[c[4]||(c[4]=e.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"},"Network",-1)),e.createElementVNode("div",po,[e.createElementVNode("div",mo,[c[3]||(c[3]=e.createElementVNode("p",{class:"mb-0 text-body-2xs font-medium text-sub-copy"}," BNB Smart Chain (BEP20) ",-1)),e.createElementVNode("div",fo,[c[1]||(c[1]=e.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"}," *Est. arrival = 3 mins ",-1)),c[2]||(c[2]=e.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"},"|",-1)),e.createVNode(I,{currency:"USDC",amount:10,textClass:"mb-0 text-body-3xs text-light-copy font-normal",iconColorClass:"#557591",iconWidth:12,iconHeight:12})])]),e.createVNode(lo)])]),e.createElementVNode("div",uo,[c[6]||(c[6]=e.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"}," Deposit Address > ",-1)),e.createElementVNode("div",ho,[c[5]||(c[5]=e.createElementVNode("p",{class:"mb-0 text-body-2xs font-medium text-sub-copy w-2/3 break-words"}," 0j8938ysheeee8333c162883a4d4f5g6t111nhk8uey37777yt6 ",-1)),e.createVNode(N,{copyText:"0j8938ysheeee8333c162883a4d4f5g6t111nhk8uey37777yt6"})])])]),e.createElementVNode("div",yo,[e.createElementVNode("div",Co,[c[7]||(c[7]=e.createElementVNode("p",{class:"mb-0 text-body-2xs font-medium text-primary-black"}," Network fee ",-1)),e.createVNode(I,{currency:"USDC",amount:12,textClass:"mb-0 text-body-2xs font-extrabold text-primary-black",iconColorClass:"#231F20"})]),e.createElementVNode("div",go,[c[8]||(c[8]=e.createElementVNode("p",{class:"mb-0 text-body-lg font-semibold text-primary-black"},"Pay",-1)),e.createVNode(I,{currency:"USDC",amount:15,textClass:"mb-0 text-body-lg font-extrabold text-primary-black",iconColorClass:"#231F20",iconWidth:20,iconHeight:20})])]),e.createElementVNode("div",bo,[e.createVNode(w,{label:"Confirm Payment",type:"primary",customClass:"w-full"})])]))]))}}),ko={class:"grid grid-cols-3"},xo={key:0,class:"bg-[#EFF7FF] px-6 py-8 flex flex-col gap-5 col-span-1 rounded-l-xl"},Vo={class:"col-span-2"},wo={key:0},Bo={key:0,class:"flex items-center justify-between px-12 py-8"},No={key:1,class:"bg-heading-text rounded flex flex-col justify-center",style:{width:"52px",height:"52px"}},Eo={class:"flex flex-col gap-1"},$o={class:"text-body-2xs font-regular text-sub-copy text-right"},So={class:"text-orange-500 font-extrabold"},Do={class:"overflow-y-scroll px-10 pb-10 pt-2"},Lo=e.defineComponent({__name:"checkout-card",props:{secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""})},options:{default:void 0}},setup(o){const l=o,t=e.ref("PAYMENT"),a=e.ref([{label:"Card",value:"CARD"},{label:"Bank Transfer",value:"BANK_TRANSFER"},{label:"Stable Coin",value:"STABLE_COIN"}]),n=e.computed(()=>l.paymentObject.currency==="NGN"?a.value.filter(p=>p.value!=="STABLE_COIN"):a.value.filter(p=>p.value!=="BANK_TRANSFER")),r=e.ref(a.value[0].value);function c(p){r.value=p}const i=e.computed(()=>S(l.paymentObject.amount||0,l.paymentObject.currency||"NGN"));return(p,s)=>(e.openBlock(),e.createBlock(we,{showBackButton:t.value==="STABLE_COIN_PAYMENT",onBack:s[2]||(s[2]=f=>t.value="PAYMENT")},{default:e.withCtx(()=>{var f;return[e.createElementVNode("div",ko,[t.value==="PAYMENT"?(e.openBlock(),e.createElementBlock("div",xo,[s[3]||(s[3]=e.createElementVNode("p",{class:"text-heading-text text-body-xs font-semibold"},"Pay with",-1)),e.createVNode(De,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=u=>r.value=u),options:n.value,onSelectedChange:c},null,8,["modelValue","options"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Vo,[t.value==="PAYMENT"||t.value==="STABLE_COIN_PAYMENT"?(e.openBlock(),e.createElementBlock("div",wo,[t.value==="PAYMENT"?(e.openBlock(),e.createElementBlock("div",Bo,[(f=p.options)!=null&&f.imageUrl?(e.openBlock(),e.createBlock(V,{key:0,src:p.options.imageUrl,alt:"Merchant Logo",width:52,height:52,customClass:"rounded-lg"},null,8,["src"])):(e.openBlock(),e.createElementBlock("div",No,[...s[4]||(s[4]=[e.createElementVNode("p",{class:"text-white text-center text-body-2xs font-medium"}," Logo ",-1)])])),e.createElementVNode("div",Eo,[s[6]||(s[6]=e.createElementVNode("p",{class:"text-body-2xs font-regular text-sub-copy text-right"}," Raymahni Merchant LLC ",-1)),e.createElementVNode("p",$o,[s[5]||(s[5]=e.createTextVNode(" Pay: ",-1)),e.createElementVNode("span",So,e.toDisplayString(i.value),1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",Do,[r.value==="CARD"?(e.openBlock(),e.createBlock(St,{key:0})):r.value==="BANK_TRANSFER"?(e.openBlock(),e.createBlock(Ut,{key:1})):(e.openBlock(),e.createBlock(_o,{key:2,onProceed:s[1]||(s[1]=u=>t.value="STABLE_COIN_PAYMENT")}))])])):t.value==="SUCCESS"?(e.openBlock(),e.createBlock(We,{key:1})):e.createCommentVNode("",!0)])])]}),_:1},8,["showBackButton"]))}});_.BzpCheckoutButton=de,_.BzpCheckoutCard=Lo,_.BzpCheckoutIframe=R,_.createMidenPG=J,_.useMidenPG=X,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(de,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(de=typeof globalThis<"u"?globalThis:de||self,a(de.MidenPGVue={},de.Vue))})(this,function(de,a){"use strict";const qt=Symbol("MidenPGConfig");function rr(o){if(!(o!=null&&o.publishableKey))throw new Error("[@miden-npm/vue] publishableKey is required");return{install(e){e.provide(qt,o)}}}function ar(){const o=a.inject(qt);if(!o)throw new Error("[@miden-npm/vue] Missing provider. Did you forget to app.use(createMidenPG(...))?");return o}const He=o=>o==null||typeof o!="object"?!1:Object.values(o).every(Boolean),tt=o=>{const e={};return new URL(o).searchParams.forEach((r,n)=>{e[n]=r}),e},ve=o=>o==="sandbox"?"https://sandbox-api.buzapay.com/payment-gateway-api":"",nr=o=>o==="USD"?"$":o==="NGN"?"₦":o==="EUR"?"€":o==="GBP"?"£":o==="JPY"||o==="CNY"?"¥":o==="USDC"||o==="usdc"?"$⧫":o==="USDT"||o==="usdt"?"₮":"$",we=(o,e)=>{const t=typeof o=="string"?parseFloat(o):o;return isNaN(t)?"0":`${e?nr(e):""} ${t==null?void 0:t.toLocaleString("en-US")}`},sr=(o,e)=>o.length<=e?o:o.slice(0,e)+"...",ir=o=>{const e=["Backspace","Tab","ArrowLeft","ArrowRight","Delete","Home","End","."];(o.ctrlKey||o.metaKey)&&["a","c","v","x"].includes(o.key.toLowerCase())||(!e.includes(o.key)&&!/^\d$/.test(o.key)&&o.preventDefault(),o.key==="."&&o.target.value.includes(".")&&o.preventDefault())},xe=(o,e)=>e.test(o);function or(o){return o?o.split("|").map(e=>{const[t,r]=e.split(":");return{rule:t,value:r}}):[]}function lr(o,e,t){const r=[],n=or(o),s=(t||"This field").toLowerCase(),u=e??"",l=Number(u),f=!Number.isNaN(l);for(const i of n)switch(i.rule){case"required":u||r.push(`The ${s} field is required`);break;case"alpha":xe(u,/^[a-zA-Z]+$/)||r.push(`The ${s} field must only contain alphabetic characters`);break;case"at_least_one_uppercase":xe(u,/.*[A-Z].*/)||r.push(`The ${s} field must contain at least one uppercase character`);break;case"at_least_one_lowercase":xe(u,/.*[a-z].*/)||r.push(`The ${s} field must contain at least one lowercase character`);break;case"at_least_one_number":xe(u,/.*\d.*/)||r.push(`The ${s} field must contain at least one number`);break;case"alpha_num":xe(u,/^[a-z0-9]+$/i)||r.push(`The ${s} field must only contain alphabetic characters and numbers`);break;case"num_spaces":xe(u,/^[0-9\s]+$/i)||r.push(`The ${s} field must only contain space and numbers`);break;case"alpha_spaces":xe(u,/^[A-Za-z\s]*$/)||r.push(`The ${s} field must only contain alphabetic characters and spaces`);break;case"numeric":xe(u,/^\d+$/)||r.push(`The ${s} field must only contain numbers`);break;case"no_special":xe(u,/[^a-zA-Z0-9\s]/)&&r.push(`The ${s} field must not contain special characters`);break;case"at_least_one_special":xe(u,/[^a-zA-Z0-9\s]/)||r.push(`The ${s} field must contain at least one special character`);break;case"email":xe(u,/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/)||r.push("Please enter a valid email address");break;case"is":i.value!==u&&r.push(`Value entered must be ${i.value}`);break;case"is_not":i.value===u&&r.push(`Value entered must not be ${i.value}`);break;case"char_length":u.length!==Number(i.value)&&r.push(`The ${s} field must be ${i.value} characters long`);break;case"min_char_length":u.length<Number(i.value)&&r.push(`The ${s} field must not be less than ${i.value} characters long`);break;case"max_char_length":u.length>Number(i.value)&&r.push(`The ${s} field must not be greater than ${i.value} characters long`);break;case"age":(!f||l!==Number(i.value))&&r.push(`Age entered must be ${i.value}`);break;case"min_age":(!f||l<Number(i.value))&&r.push(`Age entered must not be less than ${i.value}`);break;case"max_age":(!f||l>Number(i.value))&&r.push(`Age entered must not be greater than ${i.value}`);break;case"num_is":(!f||l!==Number(i.value))&&r.push(`Number entered must be ${i.value}`);break;case"num_is_not":f&&l===Number(i.value)&&r.push(`Number entered must not be ${i.value}`);break;case"min_number":(!f||l<Number(i.value))&&r.push(`Number entered must not be less than ${i.value}`);break;case"max_number":(!f||l>Number(i.value))&&r.push(`Number entered must not be greater than ${i.value}`);break}return r.length>0?r[0]:null}const je=(o,e,t)=>{const r={};for(const[n,s]of Object.entries(e)){if(!s)continue;const u=(t==null?void 0:t[n])??n,l=lr(s,o[n]??"",u);l&&(r[n]=l)}return r};var jt=(o=>(o[o.Visa=1]="Visa",o[o.MasterCard=2]="MasterCard",o[o.Verve=3]="Verve",o[o.MastercardAndVisa=4]="MastercardAndVisa",o[o.AmericanExpress=5]="AmericanExpress",o[o.Discover=6]="Discover",o[o.JCB=7]="JCB",o[o.DinersClub=8]="DinersClub",o[o.Maestro=9]="Maestro",o[o.UnionPay=10]="UnionPay",o[o.UnionPay3DS=11]="UnionPay3DS",o[o.UnionPayNon3DS=12]="UnionPayNon3DS",o[o.UATP=13]="UATP",o[o.PayPak=14]="PayPak",o[o.Jaywan=15]="Jaywan",o[o.Mada=16]="Mada",o[o.MadaVisa=17]="MadaVisa",o[o.MadaMastercard=18]="MadaMastercard",o[o.Unknown=19]="Unknown",o))(jt||{});const Kt=/^4\d{12}(\d{3}){0,2}$/,Wt=/^(?:5[1-5]\d{14}|2(?:2(?:2[1-9]|[3-9]\d)|[3-6]\d{2}|7(?:[01]\d|20))\d{12})(?:\d{0,3})?$/,ur=/^(34|37)\d{13}$/,cr=/^(?:6011|65|64[4-9]|622(?:12[6-9]|1[3-9]\d|[2-8]\d{2}|9(?:0\d|1\d|2[0-5])))\d{12,15}$/,dr=/^(?:35(?:2[8-9]|[3-8]\d))\d{12,15}$/,xr=/^(?:3(?:0[0-5]\d|095|6\d|[89]\d))\d{11,13}$/,hr=/^(?:50|5[6-9]|6[0-9])\d{10,17}$/,rt=/^62\d{14,17}$/,fr=/^1\d{14}$/,pr=[[506099,506198],[650002,650027]],mr=new Set([507865,507866]),vr=new Set([220545,220543]),Cr=new Set([6690109]),gr=new Set([968209,873646]),Er=new Set([422818,486094]),Br=new Set([529741,543357]),_r=new Set([620108]),yr=new Set([621423]);function kr(o){const e=Ar(o);return jt[e]}function Ar(o){if(!o||!o.trim())return 19;const e=o.replace(/\D/g,"");if(e.length<12||e.length>19)return 19;if(e.length>=6){const t=parseInt(e.slice(0,6),10);if(gr.has(t)&&e.length>=16&&e.length<=19)return 16;if(Er.has(t)&&Kt.test(e))return 17;if(Br.has(t)&&Wt.test(e))return 18;if(vr.has(t)&&e.length===16)return 14;if(_r.has(t)&&rt.test(e))return 11;if(yr.has(t)&&rt.test(e))return 12;if(br(t,e.length))return 3}if(e.length>=7){const t=parseInt(e.slice(0,7),10);if(Cr.has(t)&&e.length===16)return 15}return fr.test(e)?13:ur.test(e)?5:cr.test(e)?6:dr.test(e)?7:xr.test(e)?8:Wt.test(e)?2:Kt.test(e)?1:rt.test(e)?10:hr.test(e)?9:19}function br(o,e){return e<16||e>19?!1:pr.some(([r,n])=>o>=r&&o<=n)||mr.has(o)}const Fr=["width","height"],Dr=["stroke"],wr=["fill"],Gt=a.defineComponent({__name:"icon-loader",props:{size:{default:24},color:{default:"currentColor"},className:{default:""}},setup(o){const e=o,t=a.useAttrs(),{size:r,color:n,className:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({class:["animate-spin",a.unref(s)],xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:a.unref(r),height:a.unref(r),role:"img","aria-label":"loading"},a.unref(t)),[a.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:a.unref(n),"stroke-width":"4"},null,8,Dr),a.createElementVNode("path",{class:"opacity-75",fill:a.unref(n),d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,8,wr)],16,Fr))}}),Sr=["disabled"],Vr={key:1},Se=a.defineComponent({__name:"button",props:{label:{default:""},type:{default:"neutral"},size:{default:"de"},paddingClassX:{default:"px-8"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},customClass:{default:""}},emits:["click"],setup(o,{emit:e}){const t=o,r=e,n=a.computed(()=>t.disabled||t.loading);function s(){n.value||r("click")}function u(i,x){if(x)return"bg-gray-200 text-gray-400 cursor-not-allowed border-gray-200";switch(i){case"primary":return"bg-primary text-white hover:bg-primary-black hover:border-primary-black border-primary";case"secondary":return"bg-gray-200 border-gray-200 hover:bg-gray-300 text-heading-text";case"danger":return"bg-red-500 border-red-500 text-white hover:bg-red-600";case"neutral":default:return"bg-off-white border-grey-border hover:bg-gray-100"}}function l(i){switch(i){case"de":return"h-68px rounded-xl";case"md":return"h-42px rounded-lg";case"sm":return"h-32px rounded-md";default:return"h-68px rounded-xl"}}function f(i){switch(i){case"de":case"md":case"sm":return"text-body-2xs font-normal";default:return"text-body-xs font-normal"}}return(i,x)=>(a.openBlock(),a.createElementBlock("button",{class:a.normalizeClass(["flex items-center justify-center gap-2 py-3 border font-normal text-input-grey transition-colors duration-300 ease-in-out",u(i.type,n.value),l(i.size),i.paddingClassX,i.customClass]),type:"button",disabled:n.value,onClick:s},[a.renderSlot(i.$slots,"prefix"),i.loading?(a.openBlock(),a.createBlock(Gt,{key:0})):(a.openBlock(),a.createElementBlock("div",Vr,[i.label?(a.openBlock(),a.createElementBlock("p",{key:0,class:a.normalizeClass(["mb-0",f(i.size)])},a.toDisplayString(i.label),3)):a.renderSlot(i.$slots,"default",{key:1})])),a.renderSlot(i.$slots,"suffix")],10,Sr))}}),Nr={class:"mb-0 text-body-3xs font-normal text-red-500"},Zt=a.defineComponent({__name:"input-error",props:{errorMessage:{}},setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("p",Nr,a.toDisplayString(e.errorMessage),1))}});async function $e(o,e,t){try{const r=ve(e);return await(await fetch(`${r}/api/v1/checkout/generate-payment-link2`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:t},body:JSON.stringify({...o,LinkName:`${Date.now()}-Link`})})).json()}catch{}}async function Rr(o,{merchantId:e,...t}){try{const r=ve(o);return await(await fetch(`${r}/api/v1/checkout/authorize-card-3ds-payment-sdk`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:e},body:JSON.stringify(t)})).json()}catch{}}async function Ir(o,{merchantId:e,...t}){try{const r=ve(o);return await(await fetch(`${r}/api/v1/checkout/generate-payment-account`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:e},body:JSON.stringify(t)})).json()}catch{}}async function Xt(o,e){try{const t=ve(o);return await(await fetch(`${t}/api/v1/checkout/details/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}})).json()}catch{}}async function Tr(o,{merchantId:e,...t}){try{const r=ve(o);return await(await fetch(`${r}/api/v1/checkout/generate-payment-walletaddress`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:e},body:JSON.stringify(t)})).json()}catch{}}const Mr={key:0,class:"absolute inset-0 grid place-items-center bg-white/60"},Yt=a.defineComponent({__name:"checkout-iframe",props:{style:{default:()=>({width:"100%",height:"100vh",border:"0",borderRadius:"6px",overflow:"hidden"})},url:{default:void 0},secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:"https://sandbox-merchant.buzapay.com/account/three-ds-status"})},onError:{type:Function,default:o=>({errorMessage:""})}},setup(o){const e=o,t=a.computed(()=>({...e.style})),r=a.ref(null),n=a.ref(null),s=a.ref(""),u=a.ref(!1);function l(){n.value&&n.value.parentNode&&n.value.parentNode.removeChild(n.value),n.value=null}function f(x){var C;l();const v=document.createElement("iframe");v.src=x;const c=e.style;c.width&&(v.style.width=c.width),c.height&&(v.style.height=c.height),c.border&&(v.style.border=c.border),c.borderRadius&&(v.style.borderRadius=c.borderRadius),c.overflow&&(v.style.overflow=c.overflow),(C=r.value)==null||C.appendChild(v),n.value=v}async function i(){var x;if(e.url){f(e.url);return}if(!e.secretKey){s.value="Secret key is required.";return}if(!He(e.paymentObject)){s.value="Kindly ensure you are passing all the required data.";return}u.value=!0,s.value="";try{const v=await $e(e.paymentObject,e.environment,e.secretKey);v!=null&&v.isSuccessful&&v.launchUrl?(s.value="Payment link created successfully",f(`${v.launchUrl}&merchantId=${btoa(e.secretKey)}`)):s.value="Failed to create payment link"}catch(v){s.value=(v==null?void 0:v.message)||"Failed to create payment link",(x=e.onError)==null||x.call(e,{errorMessage:s.value})}finally{u.value=!1}}return a.onMounted(()=>{r.value&&i()}),a.watch(()=>e.url,x=>{x&&f(x)}),a.onBeforeUnmount(()=>{l()}),(x,v)=>(a.openBlock(),a.createElementBlock("div",{class:"relative",style:a.normalizeStyle(t.value)},[a.createElementVNode("div",{ref_key:"containerRef",ref:r,class:"w-full h-full"},null,512),u.value?(a.openBlock(),a.createElementBlock("div",Mr,[a.createVNode(Gt)])):a.createCommentVNode("",!0)],4))}}),Pr={key:1},Or=a.defineComponent({__name:"checkout-button",props:{secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:"https://sandbox-merchant.buzapay.com/account/three-ds-status"})},mode:{default:"redirect"},onError:{type:Function,default:o=>({errorMessage:""})}},setup(o){const e=o,t=a.ref(""),r=a.ref(""),n=a.ref(""),s=a.ref(!1);async function u(){var x;if(!e.secretKey){t.value="Secret key is required.";return}if(!He(e.paymentObject)){t.value="Kindly ensure you are passing all the required data.";return}s.value=!0,t.value="";try{const v=await $e(e.paymentObject,e.environment,e.secretKey);v!=null&&v.isSuccessful&&v.launchUrl?(r.value=v.launchUrl,n.value=`${v.launchUrl}&merchantId=${btoa(e.secretKey)}`,t.value="Payment link created successfully",e.mode==="redirect"&&window.open(v.launchUrl,"_blank","noopener,noreferrer")):t.value="Failed to create payment link"}catch(v){t.value=(v==null?void 0:v.message)||"Failed to create payment link",(x=e.onError)==null||x.call(e,{errorMessage:t.value})}finally{s.value=!1}}const{secretKey:l,environment:f,mode:i}=e;return(x,v)=>n.value&&a.unref(i)==="iframe"?(a.openBlock(),a.createBlock(Yt,{key:0,url:n.value,secretKey:a.unref(l),environment:a.unref(f)},null,8,["url","secretKey","environment"])):(a.openBlock(),a.createElementBlock("div",Pr,[a.createVNode(Se,{label:"Pay",type:"primary",customClass:"w-full",loading:s.value,onClick:u},null,8,["loading"]),a.createVNode(Zt,{errorMessage:t.value},null,8,["errorMessage"])]))}}),Hr=["width","height"],$r=["fill"],Lr=a.defineComponent({__name:"icon-chevron-left",props:{width:{default:17},height:{default:17},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M10.5 14.28C10.3734 14.28 10.2467 14.2333 10.1467 14.1333L5.80002 9.78668C5.09335 9.08001 5.09335 7.92001 5.80002 7.21335L10.1467 2.86668C10.34 2.67335 10.66 2.67335 10.8534 2.86668C11.0467 3.06001 11.0467 3.38001 10.8534 3.57335L6.50669 7.92001C6.18669 8.24001 6.18669 8.76001 6.50669 9.08001L10.8534 13.4267C11.0467 13.62 11.0467 13.94 10.8534 14.1333C10.7534 14.2267 10.6267 14.28 10.5 14.28Z",fill:a.unref(s)},null,8,$r)],16,Hr))}}),zr=a.defineComponent({__name:"back",emits:["back"],setup(o,{emit:e}){return(t,r)=>(a.openBlock(),a.createElementBlock("div",{class:"flex items-center gap-2 cursor-pointer",onClick:r[0]||(r[0]=n=>t.$emit("back"))},[a.createVNode(Lr),r[1]||(r[1]=a.createElementVNode("p",{class:"mb-0 text-body-xs font-normal"},"Back",-1))]))}}),Ur=["width","height"],qr=["fill"],jr=a.defineComponent({__name:"icon-buzapay-icon",props:{width:{default:15},height:{default:13},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 15 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M9.97919 0.5C10.8854 0.5 11.6276 0.585938 12.2057 0.757812C12.7891 0.924479 13.2188 1.22396 13.4948 1.65625C13.7761 2.08333 13.9167 2.6901 13.9167 3.47656C13.9167 4.1849 13.7526 4.77083 13.4245 5.23438C13.0964 5.69792 12.5938 5.95312 11.9167 6C12.8021 6.08854 13.4401 6.40625 13.8307 6.95312C14.2214 7.49479 14.4167 8.17708 14.4167 9C14.4167 9.71354 14.3334 10.2995 14.1667 10.7578C14.0052 11.2161 13.7318 11.5729 13.3464 11.8281C12.961 12.0781 12.4375 12.2526 11.7761 12.3516C11.1198 12.4505 10.2995 12.5 9.31512 12.5H0.416687V0.5H9.97919ZM2.91669 7.77344H5.97235V11.167L10.2497 5.22754H7.19501V1.83398L2.91669 7.77344ZM5.97235 6.07617H8.2702L7.19501 7.57324V6.9248H4.89716L5.97235 5.42676V6.07617Z",fill:a.unref(s)},null,8,qr)],16,Ur))}}),Kr={class:"checkout-card w-full h-screen flex flex-col items-center justify-center text-white"},Wr={class:"flex w-1/2"},Gr={class:"flex gap-2 w-full"},Zr={class:"flex flex-col gap-8 w-full"},Xr={class:"bg-off-white rounded-xl"},Yr={class:"flex items-center gap-2 justify-center"},Qr=a.defineComponent({__name:"card",props:{showBackButton:{type:Boolean,default:!1}},emits:["back","close"],setup(o,{emit:e}){const t=e;return(r,n)=>(a.openBlock(),a.createElementBlock("div",Kr,[a.createElementVNode("div",Wr,[r.showBackButton?(a.openBlock(),a.createBlock(zr,{key:0,onBack:n[0]||(n[0]=s=>t("back"))})):a.createCommentVNode("",!0),a.createElementVNode("div",Gr,[a.createElementVNode("div",Zr,[a.createElementVNode("div",Xr,[a.renderSlot(r.$slots,"default")]),a.createElementVNode("div",Yr,[n[2]||(n[2]=a.createElementVNode("p",{class:"text-light-white-100 text-body-2xs font-regular"}," Powered by Buzapay ",-1)),a.createVNode(jr,{color:"#E8F4FF"})])]),a.createElementVNode("div",{class:"close-icon flex flex-col items-center justify-center self-start cursor-pointer hover:bg-gray-500",onClick:n[1]||(n[1]=s=>t("close")),role:"button","aria-label":"Close"},[...n[3]||(n[3]=[a.createElementVNode("p",{class:"text-white"},"x",-1)])])])])]))}}),Jr=["aria-orientation"],ea=["aria-checked","onClick"],ta={key:0,class:"bg-white w-2 h-2 rounded-full"},ra={class:"mb-0 text-body-2xs font-medium text-heading-text"},aa=a.defineComponent({__name:"radio-group",props:{options:{default:()=>[]},type:{default:"vertical"},modelValue:{default:void 0},defaultValue:{default:void 0},className:{default:""}},emits:["update:modelValue","selectedChange"],setup(o,{emit:e}){const t=o,r=e,n=a.computed(()=>t.modelValue!==void 0),s=a.ref("");a.onMounted(()=>{if(n.value)return;const c=t.defaultValue??(t.options.length?t.options[0].value:"");s.value=c,c&&(r("update:modelValue",c),r("selectedChange",c))}),a.watch(()=>t.modelValue,c=>{n.value&&(s.value=c??"")},{immediate:!0});const u=a.computed(()=>n.value?t.modelValue??"":s.value);function l(c){n.value||(s.value=c),r("update:modelValue",c),r("selectedChange",c)}const f=a.computed(()=>t.type==="horizontal"?"flex-row gap-5":"flex-col gap-6"),{options:i,type:x,className:v}=t;return(c,C)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["flex",f.value,a.unref(v)]),role:"radiogroup","aria-orientation":a.unref(x)==="horizontal"?"horizontal":"vertical",tabindex:"0"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i),d=>(a.openBlock(),a.createElementBlock("div",{key:d.value,role:"radio","aria-checked":u.value===d.value,tabindex:"-1",onClick:g=>l(d.value),class:"flex items-center gap-2 cursor-pointer transition-colors duration-200"},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 rounded-full border flex items-center justify-center",u.value===d.value?"bg-orange-500 border-orange-500":"bg-white border-grey-200"])},[u.value===d.value?(a.openBlock(),a.createElementBlock("div",ta)):a.createCommentVNode("",!0)],2),a.createElementVNode("p",ra,a.toDisplayString(d.label),1)],8,ea))),128))],10,Jr))}}),na=["src","height","alt"],_e=a.defineComponent({__name:"image",props:{src:{},height:{default:50},width:{default:50},alt:{default:"Image"},customClass:{default:""},isFullWidth:{type:Boolean,default:!1}},emits:["click"],setup(o,{emit:e}){const t=o,r=e,{src:n,height:s,width:u,alt:l,customClass:f,isFullWidth:i}=t;return(x,v)=>(a.openBlock(),a.createElementBlock("img",{src:a.unref(n),height:a.unref(s),alt:a.unref(l),class:a.normalizeClass([a.unref(f),a.unref(i)?"w-full":""]),style:a.normalizeStyle({width:a.unref(i)?"100%":a.unref(u)+"px"}),onClick:v[0]||(v[0]=c=>r("click"))},null,14,na))}});var W=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sa(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function ia(o){if(o.__esModule)return o;var e=o.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(o).forEach(function(r){var n=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return o[r]}})}),t}var Qt={exports:{}};function oa(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var at={exports:{}};const la=ia(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Jt;function G(){return Jt||(Jt=1,function(o,e){(function(t,r){o.exports=r()})(W,function(){var t=t||function(r,n){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof W<"u"&&W.crypto&&(s=W.crypto),!s&&typeof oa=="function")try{s=la}catch{}var u=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function m(){}return function(h){var B;return m.prototype=h,B=new m,m.prototype=null,B}}(),f={},i=f.lib={},x=i.Base=function(){return{extend:function(m){var h=l(this);return m&&h.mixIn(m),(!h.hasOwnProperty("init")||this.init===h.init)&&(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var h in m)m.hasOwnProperty(h)&&(this[h]=m[h]);m.hasOwnProperty("toString")&&(this.toString=m.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),v=i.WordArray=x.extend({init:function(m,h){m=this.words=m||[],h!=n?this.sigBytes=h:this.sigBytes=m.length*4},toString:function(m){return(m||C).stringify(this)},concat:function(m){var h=this.words,B=m.words,F=this.sigBytes,b=m.sigBytes;if(this.clamp(),F%4)for(var D=0;D<b;D++){var V=B[D>>>2]>>>24-D%4*8&255;h[F+D>>>2]|=V<<24-(F+D)%4*8}else for(var M=0;M<b;M+=4)h[F+M>>>2]=B[M>>>2];return this.sigBytes+=b,this},clamp:function(){var m=this.words,h=this.sigBytes;m[h>>>2]&=4294967295<<32-h%4*8,m.length=r.ceil(h/4)},clone:function(){var m=x.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var h=[],B=0;B<m;B+=4)h.push(u());return new v.init(h,m)}}),c=f.enc={},C=c.Hex={stringify:function(m){for(var h=m.words,B=m.sigBytes,F=[],b=0;b<B;b++){var D=h[b>>>2]>>>24-b%4*8&255;F.push((D>>>4).toString(16)),F.push((D&15).toString(16))}return F.join("")},parse:function(m){for(var h=m.length,B=[],F=0;F<h;F+=2)B[F>>>3]|=parseInt(m.substr(F,2),16)<<24-F%8*4;return new v.init(B,h/2)}},d=c.Latin1={stringify:function(m){for(var h=m.words,B=m.sigBytes,F=[],b=0;b<B;b++){var D=h[b>>>2]>>>24-b%4*8&255;F.push(String.fromCharCode(D))}return F.join("")},parse:function(m){for(var h=m.length,B=[],F=0;F<h;F++)B[F>>>2]|=(m.charCodeAt(F)&255)<<24-F%4*8;return new v.init(B,h)}},g=c.Utf8={stringify:function(m){try{return decodeURIComponent(escape(d.stringify(m)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(m){return d.parse(unescape(encodeURIComponent(m)))}},p=i.BufferedBlockAlgorithm=x.extend({reset:function(){this._data=new v.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=g.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var h,B=this._data,F=B.words,b=B.sigBytes,D=this.blockSize,V=D*4,M=b/V;m?M=r.ceil(M):M=r.max((M|0)-this._minBufferSize,0);var A=M*D,w=r.min(A*4,b);if(A){for(var S=0;S<A;S+=D)this._doProcessBlock(F,S);h=F.splice(0,A),B.sigBytes-=w}return new v.init(h,w)},clone:function(){var m=x.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});i.Hasher=p.extend({cfg:x.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var h=this._doFinalize();return h},blockSize:16,_createHelper:function(m){return function(h,B){return new m.init(B).finalize(h)}},_createHmacHelper:function(m){return function(h,B){return new _.HMAC.init(m,B).finalize(h)}}});var _=f.algo={};return f}(Math);return t})}(at)),at.exports}var nt={exports:{}},e0;function Ke(){return e0||(e0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(r){var n=t,s=n.lib,u=s.Base,l=s.WordArray,f=n.x64={};f.Word=u.extend({init:function(i,x){this.high=i,this.low=x}}),f.WordArray=u.extend({init:function(i,x){i=this.words=i||[],x!=r?this.sigBytes=x:this.sigBytes=i.length*8},toX32:function(){for(var i=this.words,x=i.length,v=[],c=0;c<x;c++){var C=i[c];v.push(C.high),v.push(C.low)}return l.create(v,this.sigBytes)},clone:function(){for(var i=u.clone.call(this),x=i.words=this.words.slice(0),v=x.length,c=0;c<v;c++)x[c]=x[c].clone();return i}})}(),t})}(nt)),nt.exports}var st={exports:{}},t0;function ua(){return t0||(t0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){if(typeof ArrayBuffer=="function"){var r=t,n=r.lib,s=n.WordArray,u=s.init,l=s.init=function(f){if(f instanceof ArrayBuffer&&(f=new Uint8Array(f)),(f instanceof Int8Array||typeof Uint8ClampedArray<"u"&&f instanceof Uint8ClampedArray||f instanceof Int16Array||f instanceof Uint16Array||f instanceof Int32Array||f instanceof Uint32Array||f instanceof Float32Array||f instanceof Float64Array)&&(f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength)),f instanceof Uint8Array){for(var i=f.byteLength,x=[],v=0;v<i;v++)x[v>>>2]|=f[v]<<24-v%4*8;u.call(this,x,i)}else u.apply(this,arguments)};l.prototype=s}}(),t.lib.WordArray})}(st)),st.exports}var it={exports:{}},r0;function ca(){return r0||(r0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){var r=t,n=r.lib,s=n.WordArray,u=r.enc;u.Utf16=u.Utf16BE={stringify:function(f){for(var i=f.words,x=f.sigBytes,v=[],c=0;c<x;c+=2){var C=i[c>>>2]>>>16-c%4*8&65535;v.push(String.fromCharCode(C))}return v.join("")},parse:function(f){for(var i=f.length,x=[],v=0;v<i;v++)x[v>>>1]|=f.charCodeAt(v)<<16-v%2*16;return s.create(x,i*2)}},u.Utf16LE={stringify:function(f){for(var i=f.words,x=f.sigBytes,v=[],c=0;c<x;c+=2){var C=l(i[c>>>2]>>>16-c%4*8&65535);v.push(String.fromCharCode(C))}return v.join("")},parse:function(f){for(var i=f.length,x=[],v=0;v<i;v++)x[v>>>1]|=l(f.charCodeAt(v)<<16-v%2*16);return s.create(x,i*2)}};function l(f){return f<<8&4278255360|f>>>8&16711935}}(),t.enc.Utf16})}(it)),it.exports}var ot={exports:{}},a0;function Ve(){return a0||(a0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){var r=t,n=r.lib,s=n.WordArray,u=r.enc;u.Base64={stringify:function(f){var i=f.words,x=f.sigBytes,v=this._map;f.clamp();for(var c=[],C=0;C<x;C+=3)for(var d=i[C>>>2]>>>24-C%4*8&255,g=i[C+1>>>2]>>>24-(C+1)%4*8&255,p=i[C+2>>>2]>>>24-(C+2)%4*8&255,_=d<<16|g<<8|p,m=0;m<4&&C+m*.75<x;m++)c.push(v.charAt(_>>>6*(3-m)&63));var h=v.charAt(64);if(h)for(;c.length%4;)c.push(h);return c.join("")},parse:function(f){var i=f.length,x=this._map,v=this._reverseMap;if(!v){v=this._reverseMap=[];for(var c=0;c<x.length;c++)v[x.charCodeAt(c)]=c}var C=x.charAt(64);if(C){var d=f.indexOf(C);d!==-1&&(i=d)}return l(f,i,v)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(f,i,x){for(var v=[],c=0,C=0;C<i;C++)if(C%4){var d=x[f.charCodeAt(C-1)]<<C%4*2,g=x[f.charCodeAt(C)]>>>6-C%4*2,p=d|g;v[c>>>2]|=p<<24-c%4*8,c++}return s.create(v,c)}}(),t.enc.Base64})}(ot)),ot.exports}var lt={exports:{}},n0;function da(){return n0||(n0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){var r=t,n=r.lib,s=n.WordArray,u=r.enc;u.Base64url={stringify:function(f,i){i===void 0&&(i=!0);var x=f.words,v=f.sigBytes,c=i?this._safe_map:this._map;f.clamp();for(var C=[],d=0;d<v;d+=3)for(var g=x[d>>>2]>>>24-d%4*8&255,p=x[d+1>>>2]>>>24-(d+1)%4*8&255,_=x[d+2>>>2]>>>24-(d+2)%4*8&255,m=g<<16|p<<8|_,h=0;h<4&&d+h*.75<v;h++)C.push(c.charAt(m>>>6*(3-h)&63));var B=c.charAt(64);if(B)for(;C.length%4;)C.push(B);return C.join("")},parse:function(f,i){i===void 0&&(i=!0);var x=f.length,v=i?this._safe_map:this._map,c=this._reverseMap;if(!c){c=this._reverseMap=[];for(var C=0;C<v.length;C++)c[v.charCodeAt(C)]=C}var d=v.charAt(64);if(d){var g=f.indexOf(d);g!==-1&&(x=g)}return l(f,x,c)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function l(f,i,x){for(var v=[],c=0,C=0;C<i;C++)if(C%4){var d=x[f.charCodeAt(C-1)]<<C%4*2,g=x[f.charCodeAt(C)]>>>6-C%4*2,p=d|g;v[c>>>2]|=p<<24-c%4*8,c++}return s.create(v,c)}}(),t.enc.Base64url})}(lt)),lt.exports}var ut={exports:{}},s0;function Ne(){return s0||(s0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(r){var n=t,s=n.lib,u=s.WordArray,l=s.Hasher,f=n.algo,i=[];(function(){for(var g=0;g<64;g++)i[g]=r.abs(r.sin(g+1))*4294967296|0})();var x=f.MD5=l.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(g,p){for(var _=0;_<16;_++){var m=p+_,h=g[m];g[m]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360}var B=this._hash.words,F=g[p+0],b=g[p+1],D=g[p+2],V=g[p+3],M=g[p+4],A=g[p+5],w=g[p+6],S=g[p+7],E=g[p+8],k=g[p+9],T=g[p+10],O=g[p+11],U=g[p+12],H=g[p+13],$=g[p+14],P=g[p+15],y=B[0],R=B[1],I=B[2],N=B[3];y=v(y,R,I,N,F,7,i[0]),N=v(N,y,R,I,b,12,i[1]),I=v(I,N,y,R,D,17,i[2]),R=v(R,I,N,y,V,22,i[3]),y=v(y,R,I,N,M,7,i[4]),N=v(N,y,R,I,A,12,i[5]),I=v(I,N,y,R,w,17,i[6]),R=v(R,I,N,y,S,22,i[7]),y=v(y,R,I,N,E,7,i[8]),N=v(N,y,R,I,k,12,i[9]),I=v(I,N,y,R,T,17,i[10]),R=v(R,I,N,y,O,22,i[11]),y=v(y,R,I,N,U,7,i[12]),N=v(N,y,R,I,H,12,i[13]),I=v(I,N,y,R,$,17,i[14]),R=v(R,I,N,y,P,22,i[15]),y=c(y,R,I,N,b,5,i[16]),N=c(N,y,R,I,w,9,i[17]),I=c(I,N,y,R,O,14,i[18]),R=c(R,I,N,y,F,20,i[19]),y=c(y,R,I,N,A,5,i[20]),N=c(N,y,R,I,T,9,i[21]),I=c(I,N,y,R,P,14,i[22]),R=c(R,I,N,y,M,20,i[23]),y=c(y,R,I,N,k,5,i[24]),N=c(N,y,R,I,$,9,i[25]),I=c(I,N,y,R,V,14,i[26]),R=c(R,I,N,y,E,20,i[27]),y=c(y,R,I,N,H,5,i[28]),N=c(N,y,R,I,D,9,i[29]),I=c(I,N,y,R,S,14,i[30]),R=c(R,I,N,y,U,20,i[31]),y=C(y,R,I,N,A,4,i[32]),N=C(N,y,R,I,E,11,i[33]),I=C(I,N,y,R,O,16,i[34]),R=C(R,I,N,y,$,23,i[35]),y=C(y,R,I,N,b,4,i[36]),N=C(N,y,R,I,M,11,i[37]),I=C(I,N,y,R,S,16,i[38]),R=C(R,I,N,y,T,23,i[39]),y=C(y,R,I,N,H,4,i[40]),N=C(N,y,R,I,F,11,i[41]),I=C(I,N,y,R,V,16,i[42]),R=C(R,I,N,y,w,23,i[43]),y=C(y,R,I,N,k,4,i[44]),N=C(N,y,R,I,U,11,i[45]),I=C(I,N,y,R,P,16,i[46]),R=C(R,I,N,y,D,23,i[47]),y=d(y,R,I,N,F,6,i[48]),N=d(N,y,R,I,S,10,i[49]),I=d(I,N,y,R,$,15,i[50]),R=d(R,I,N,y,A,21,i[51]),y=d(y,R,I,N,U,6,i[52]),N=d(N,y,R,I,V,10,i[53]),I=d(I,N,y,R,T,15,i[54]),R=d(R,I,N,y,b,21,i[55]),y=d(y,R,I,N,E,6,i[56]),N=d(N,y,R,I,P,10,i[57]),I=d(I,N,y,R,w,15,i[58]),R=d(R,I,N,y,H,21,i[59]),y=d(y,R,I,N,M,6,i[60]),N=d(N,y,R,I,O,10,i[61]),I=d(I,N,y,R,D,15,i[62]),R=d(R,I,N,y,k,21,i[63]),B[0]=B[0]+y|0,B[1]=B[1]+R|0,B[2]=B[2]+I|0,B[3]=B[3]+N|0},_doFinalize:function(){var g=this._data,p=g.words,_=this._nDataBytes*8,m=g.sigBytes*8;p[m>>>5]|=128<<24-m%32;var h=r.floor(_/4294967296),B=_;p[(m+64>>>9<<4)+15]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,p[(m+64>>>9<<4)+14]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,g.sigBytes=(p.length+1)*4,this._process();for(var F=this._hash,b=F.words,D=0;D<4;D++){var V=b[D];b[D]=(V<<8|V>>>24)&16711935|(V<<24|V>>>8)&4278255360}return F},clone:function(){var g=l.clone.call(this);return g._hash=this._hash.clone(),g}});function v(g,p,_,m,h,B,F){var b=g+(p&_|~p&m)+h+F;return(b<<B|b>>>32-B)+p}function c(g,p,_,m,h,B,F){var b=g+(p&m|_&~m)+h+F;return(b<<B|b>>>32-B)+p}function C(g,p,_,m,h,B,F){var b=g+(p^_^m)+h+F;return(b<<B|b>>>32-B)+p}function d(g,p,_,m,h,B,F){var b=g+(_^(p|~m))+h+F;return(b<<B|b>>>32-B)+p}n.MD5=l._createHelper(x),n.HmacMD5=l._createHmacHelper(x)}(Math),t.MD5})}(ut)),ut.exports}var ct={exports:{}},i0;function o0(){return i0||(i0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){var r=t,n=r.lib,s=n.WordArray,u=n.Hasher,l=r.algo,f=[],i=l.SHA1=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(x,v){for(var c=this._hash.words,C=c[0],d=c[1],g=c[2],p=c[3],_=c[4],m=0;m<80;m++){if(m<16)f[m]=x[v+m]|0;else{var h=f[m-3]^f[m-8]^f[m-14]^f[m-16];f[m]=h<<1|h>>>31}var B=(C<<5|C>>>27)+_+f[m];m<20?B+=(d&g|~d&p)+1518500249:m<40?B+=(d^g^p)+1859775393:m<60?B+=(d&g|d&p|g&p)-1894007588:B+=(d^g^p)-899497514,_=p,p=g,g=d<<30|d>>>2,d=C,C=B}c[0]=c[0]+C|0,c[1]=c[1]+d|0,c[2]=c[2]+g|0,c[3]=c[3]+p|0,c[4]=c[4]+_|0},_doFinalize:function(){var x=this._data,v=x.words,c=this._nDataBytes*8,C=x.sigBytes*8;return v[C>>>5]|=128<<24-C%32,v[(C+64>>>9<<4)+14]=Math.floor(c/4294967296),v[(C+64>>>9<<4)+15]=c,x.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var x=u.clone.call(this);return x._hash=this._hash.clone(),x}});r.SHA1=u._createHelper(i),r.HmacSHA1=u._createHmacHelper(i)}(),t.SHA1})}(ct)),ct.exports}var dt={exports:{}},l0;function xt(){return l0||(l0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(r){var n=t,s=n.lib,u=s.WordArray,l=s.Hasher,f=n.algo,i=[],x=[];(function(){function C(_){for(var m=r.sqrt(_),h=2;h<=m;h++)if(!(_%h))return!1;return!0}function d(_){return(_-(_|0))*4294967296|0}for(var g=2,p=0;p<64;)C(g)&&(p<8&&(i[p]=d(r.pow(g,1/2))),x[p]=d(r.pow(g,1/3)),p++),g++})();var v=[],c=f.SHA256=l.extend({_doReset:function(){this._hash=new u.init(i.slice(0))},_doProcessBlock:function(C,d){for(var g=this._hash.words,p=g[0],_=g[1],m=g[2],h=g[3],B=g[4],F=g[5],b=g[6],D=g[7],V=0;V<64;V++){if(V<16)v[V]=C[d+V]|0;else{var M=v[V-15],A=(M<<25|M>>>7)^(M<<14|M>>>18)^M>>>3,w=v[V-2],S=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;v[V]=A+v[V-7]+S+v[V-16]}var E=B&F^~B&b,k=p&_^p&m^_&m,T=(p<<30|p>>>2)^(p<<19|p>>>13)^(p<<10|p>>>22),O=(B<<26|B>>>6)^(B<<21|B>>>11)^(B<<7|B>>>25),U=D+O+E+x[V]+v[V],H=T+k;D=b,b=F,F=B,B=h+U|0,h=m,m=_,_=p,p=U+H|0}g[0]=g[0]+p|0,g[1]=g[1]+_|0,g[2]=g[2]+m|0,g[3]=g[3]+h|0,g[4]=g[4]+B|0,g[5]=g[5]+F|0,g[6]=g[6]+b|0,g[7]=g[7]+D|0},_doFinalize:function(){var C=this._data,d=C.words,g=this._nDataBytes*8,p=C.sigBytes*8;return d[p>>>5]|=128<<24-p%32,d[(p+64>>>9<<4)+14]=r.floor(g/4294967296),d[(p+64>>>9<<4)+15]=g,C.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var C=l.clone.call(this);return C._hash=this._hash.clone(),C}});n.SHA256=l._createHelper(c),n.HmacSHA256=l._createHmacHelper(c)}(Math),t.SHA256})}(dt)),dt.exports}var ht={exports:{}},u0;function xa(){return u0||(u0=1,function(o,e){(function(t,r,n){o.exports=r(G(),xt())})(W,function(t){return function(){var r=t,n=r.lib,s=n.WordArray,u=r.algo,l=u.SHA256,f=u.SHA224=l.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var i=l._doFinalize.call(this);return i.sigBytes-=4,i}});r.SHA224=l._createHelper(f),r.HmacSHA224=l._createHmacHelper(f)}(),t.SHA224})}(ht)),ht.exports}var ft={exports:{}},c0;function d0(){return c0||(c0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ke())})(W,function(t){return function(){var r=t,n=r.lib,s=n.Hasher,u=r.x64,l=u.Word,f=u.WordArray,i=r.algo;function x(){return l.create.apply(l,arguments)}var v=[x(1116352408,3609767458),x(1899447441,602891725),x(3049323471,3964484399),x(3921009573,2173295548),x(961987163,4081628472),x(1508970993,3053834265),x(2453635748,2937671579),x(2870763221,3664609560),x(3624381080,2734883394),x(310598401,1164996542),x(607225278,1323610764),x(1426881987,3590304994),x(1925078388,4068182383),x(2162078206,991336113),x(2614888103,633803317),x(3248222580,3479774868),x(3835390401,2666613458),x(4022224774,944711139),x(264347078,2341262773),x(604807628,2007800933),x(770255983,1495990901),x(1249150122,1856431235),x(1555081692,3175218132),x(1996064986,2198950837),x(2554220882,3999719339),x(2821834349,766784016),x(2952996808,2566594879),x(3210313671,3203337956),x(3336571891,1034457026),x(3584528711,2466948901),x(113926993,3758326383),x(338241895,168717936),x(666307205,1188179964),x(773529912,1546045734),x(1294757372,1522805485),x(1396182291,2643833823),x(1695183700,2343527390),x(1986661051,1014477480),x(2177026350,1206759142),x(2456956037,344077627),x(2730485921,1290863460),x(2820302411,3158454273),x(3259730800,3505952657),x(3345764771,106217008),x(3516065817,3606008344),x(3600352804,1432725776),x(4094571909,1467031594),x(275423344,851169720),x(430227734,3100823752),x(506948616,1363258195),x(659060556,3750685593),x(883997877,3785050280),x(958139571,3318307427),x(1322822218,3812723403),x(1537002063,2003034995),x(1747873779,3602036899),x(1955562222,1575990012),x(2024104815,1125592928),x(2227730452,2716904306),x(2361852424,442776044),x(2428436474,593698344),x(2756734187,3733110249),x(3204031479,2999351573),x(3329325298,3815920427),x(3391569614,3928383900),x(3515267271,566280711),x(3940187606,3454069534),x(4118630271,4000239992),x(116418474,1914138554),x(174292421,2731055270),x(289380356,3203993006),x(460393269,320620315),x(685471733,587496836),x(852142971,1086792851),x(1017036298,365543100),x(1126000580,2618297676),x(1288033470,3409855158),x(1501505948,4234509866),x(1607167915,987167468),x(1816402316,1246189591)],c=[];(function(){for(var d=0;d<80;d++)c[d]=x()})();var C=i.SHA512=s.extend({_doReset:function(){this._hash=new f.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(d,g){for(var p=this._hash.words,_=p[0],m=p[1],h=p[2],B=p[3],F=p[4],b=p[5],D=p[6],V=p[7],M=_.high,A=_.low,w=m.high,S=m.low,E=h.high,k=h.low,T=B.high,O=B.low,U=F.high,H=F.low,$=b.high,P=b.low,y=D.high,R=D.low,I=V.high,N=V.low,X=M,Z=A,J=w,j=S,Ae=E,Ee=k,Me=T,be=O,ne=U,ae=H,Ie=$,Fe=P,Te=y,he=R,Y=I,se=N,ee=0;ee<80;ee++){var oe,pe,z=c[ee];if(ee<16)pe=z.high=d[g+ee*2]|0,oe=z.low=d[g+ee*2+1]|0;else{var Pe=c[ee-15],me=Pe.high,Be=Pe.low,ri=(me>>>1|Be<<31)^(me>>>8|Be<<24)^me>>>7,j0=(Be>>>1|me<<31)^(Be>>>8|me<<24)^(Be>>>7|me<<25),K0=c[ee-2],Oe=K0.high,qe=K0.low,ai=(Oe>>>19|qe<<13)^(Oe<<3|qe>>>29)^Oe>>>6,W0=(qe>>>19|Oe<<13)^(qe<<3|Oe>>>29)^(qe>>>6|Oe<<26),G0=c[ee-7],ni=G0.high,si=G0.low,Z0=c[ee-16],ii=Z0.high,X0=Z0.low;oe=j0+si,pe=ri+ni+(oe>>>0<j0>>>0?1:0),oe=oe+W0,pe=pe+ai+(oe>>>0<W0>>>0?1:0),oe=oe+X0,pe=pe+ii+(oe>>>0<X0>>>0?1:0),z.high=pe,z.low=oe}var oi=ne&Ie^~ne&Te,Y0=ae&Fe^~ae&he,li=X&J^X&Ae^J&Ae,ui=Z&j^Z&Ee^j&Ee,ci=(X>>>28|Z<<4)^(X<<30|Z>>>2)^(X<<25|Z>>>7),Q0=(Z>>>28|X<<4)^(Z<<30|X>>>2)^(Z<<25|X>>>7),di=(ne>>>14|ae<<18)^(ne>>>18|ae<<14)^(ne<<23|ae>>>9),xi=(ae>>>14|ne<<18)^(ae>>>18|ne<<14)^(ae<<23|ne>>>9),J0=v[ee],hi=J0.high,er=J0.low,le=se+xi,De=Y+di+(le>>>0<se>>>0?1:0),le=le+Y0,De=De+oi+(le>>>0<Y0>>>0?1:0),le=le+er,De=De+hi+(le>>>0<er>>>0?1:0),le=le+oe,De=De+pe+(le>>>0<oe>>>0?1:0),tr=Q0+ui,fi=ci+li+(tr>>>0<Q0>>>0?1:0);Y=Te,se=he,Te=Ie,he=Fe,Ie=ne,Fe=ae,ae=be+le|0,ne=Me+De+(ae>>>0<be>>>0?1:0)|0,Me=Ae,be=Ee,Ae=J,Ee=j,J=X,j=Z,Z=le+tr|0,X=De+fi+(Z>>>0<le>>>0?1:0)|0}A=_.low=A+Z,_.high=M+X+(A>>>0<Z>>>0?1:0),S=m.low=S+j,m.high=w+J+(S>>>0<j>>>0?1:0),k=h.low=k+Ee,h.high=E+Ae+(k>>>0<Ee>>>0?1:0),O=B.low=O+be,B.high=T+Me+(O>>>0<be>>>0?1:0),H=F.low=H+ae,F.high=U+ne+(H>>>0<ae>>>0?1:0),P=b.low=P+Fe,b.high=$+Ie+(P>>>0<Fe>>>0?1:0),R=D.low=R+he,D.high=y+Te+(R>>>0<he>>>0?1:0),N=V.low=N+se,V.high=I+Y+(N>>>0<se>>>0?1:0)},_doFinalize:function(){var d=this._data,g=d.words,p=this._nDataBytes*8,_=d.sigBytes*8;g[_>>>5]|=128<<24-_%32,g[(_+128>>>10<<5)+30]=Math.floor(p/4294967296),g[(_+128>>>10<<5)+31]=p,d.sigBytes=g.length*4,this._process();var m=this._hash.toX32();return m},clone:function(){var d=s.clone.call(this);return d._hash=this._hash.clone(),d},blockSize:1024/32});r.SHA512=s._createHelper(C),r.HmacSHA512=s._createHmacHelper(C)}(),t.SHA512})}(ft)),ft.exports}var pt={exports:{}},x0;function ha(){return x0||(x0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ke(),d0())})(W,function(t){return function(){var r=t,n=r.x64,s=n.Word,u=n.WordArray,l=r.algo,f=l.SHA512,i=l.SHA384=f.extend({_doReset:function(){this._hash=new u.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var x=f._doFinalize.call(this);return x.sigBytes-=16,x}});r.SHA384=f._createHelper(i),r.HmacSHA384=f._createHmacHelper(i)}(),t.SHA384})}(pt)),pt.exports}var mt={exports:{}},h0;function fa(){return h0||(h0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ke())})(W,function(t){return function(r){var n=t,s=n.lib,u=s.WordArray,l=s.Hasher,f=n.x64,i=f.Word,x=n.algo,v=[],c=[],C=[];(function(){for(var p=1,_=0,m=0;m<24;m++){v[p+5*_]=(m+1)*(m+2)/2%64;var h=_%5,B=(2*p+3*_)%5;p=h,_=B}for(var p=0;p<5;p++)for(var _=0;_<5;_++)c[p+5*_]=_+(2*p+3*_)%5*5;for(var F=1,b=0;b<24;b++){for(var D=0,V=0,M=0;M<7;M++){if(F&1){var A=(1<<M)-1;A<32?V^=1<<A:D^=1<<A-32}F&128?F=F<<1^113:F<<=1}C[b]=i.create(D,V)}})();var d=[];(function(){for(var p=0;p<25;p++)d[p]=i.create()})();var g=x.SHA3=l.extend({cfg:l.cfg.extend({outputLength:512}),_doReset:function(){for(var p=this._state=[],_=0;_<25;_++)p[_]=new i.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(p,_){for(var m=this._state,h=this.blockSize/2,B=0;B<h;B++){var F=p[_+2*B],b=p[_+2*B+1];F=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;var D=m[B];D.high^=b,D.low^=F}for(var V=0;V<24;V++){for(var M=0;M<5;M++){for(var A=0,w=0,S=0;S<5;S++){var D=m[M+5*S];A^=D.high,w^=D.low}var E=d[M];E.high=A,E.low=w}for(var M=0;M<5;M++)for(var k=d[(M+4)%5],T=d[(M+1)%5],O=T.high,U=T.low,A=k.high^(O<<1|U>>>31),w=k.low^(U<<1|O>>>31),S=0;S<5;S++){var D=m[M+5*S];D.high^=A,D.low^=w}for(var H=1;H<25;H++){var A,w,D=m[H],$=D.high,P=D.low,y=v[H];y<32?(A=$<<y|P>>>32-y,w=P<<y|$>>>32-y):(A=P<<y-32|$>>>64-y,w=$<<y-32|P>>>64-y);var R=d[c[H]];R.high=A,R.low=w}var I=d[0],N=m[0];I.high=N.high,I.low=N.low;for(var M=0;M<5;M++)for(var S=0;S<5;S++){var H=M+5*S,D=m[H],X=d[H],Z=d[(M+1)%5+5*S],J=d[(M+2)%5+5*S];D.high=X.high^~Z.high&J.high,D.low=X.low^~Z.low&J.low}var D=m[0],j=C[V];D.high^=j.high,D.low^=j.low}},_doFinalize:function(){var p=this._data,_=p.words;this._nDataBytes*8;var m=p.sigBytes*8,h=this.blockSize*32;_[m>>>5]|=1<<24-m%32,_[(r.ceil((m+1)/h)*h>>>5)-1]|=128,p.sigBytes=_.length*4,this._process();for(var B=this._state,F=this.cfg.outputLength/8,b=F/8,D=[],V=0;V<b;V++){var M=B[V],A=M.high,w=M.low;A=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,D.push(w),D.push(A)}return new u.init(D,F)},clone:function(){for(var p=l.clone.call(this),_=p._state=this._state.slice(0),m=0;m<25;m++)_[m]=_[m].clone();return p}});n.SHA3=l._createHelper(g),n.HmacSHA3=l._createHmacHelper(g)}(Math),t.SHA3})}(mt)),mt.exports}var vt={exports:{}},f0;function pa(){return f0||(f0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){/** @preserve
|
|
2
|
+
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
|
+
|
|
9
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
10
|
+
*/return function(r){var n=t,s=n.lib,u=s.WordArray,l=s.Hasher,f=n.algo,i=u.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),x=u.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),v=u.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=u.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),C=u.create([0,1518500249,1859775393,2400959708,2840853838]),d=u.create([1352829926,1548603684,1836072691,2053994217,0]),g=f.RIPEMD160=l.extend({_doReset:function(){this._hash=u.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(b,D){for(var V=0;V<16;V++){var M=D+V,A=b[M];b[M]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var w=this._hash.words,S=C.words,E=d.words,k=i.words,T=x.words,O=v.words,U=c.words,H,$,P,y,R,I,N,X,Z,J;I=H=w[0],N=$=w[1],X=P=w[2],Z=y=w[3],J=R=w[4];for(var j,V=0;V<80;V+=1)j=H+b[D+k[V]]|0,V<16?j+=p($,P,y)+S[0]:V<32?j+=_($,P,y)+S[1]:V<48?j+=m($,P,y)+S[2]:V<64?j+=h($,P,y)+S[3]:j+=B($,P,y)+S[4],j=j|0,j=F(j,O[V]),j=j+R|0,H=R,R=y,y=F(P,10),P=$,$=j,j=I+b[D+T[V]]|0,V<16?j+=B(N,X,Z)+E[0]:V<32?j+=h(N,X,Z)+E[1]:V<48?j+=m(N,X,Z)+E[2]:V<64?j+=_(N,X,Z)+E[3]:j+=p(N,X,Z)+E[4],j=j|0,j=F(j,U[V]),j=j+J|0,I=J,J=Z,Z=F(X,10),X=N,N=j;j=w[1]+P+Z|0,w[1]=w[2]+y+J|0,w[2]=w[3]+R+I|0,w[3]=w[4]+H+N|0,w[4]=w[0]+$+X|0,w[0]=j},_doFinalize:function(){var b=this._data,D=b.words,V=this._nDataBytes*8,M=b.sigBytes*8;D[M>>>5]|=128<<24-M%32,D[(M+64>>>9<<4)+14]=(V<<8|V>>>24)&16711935|(V<<24|V>>>8)&4278255360,b.sigBytes=(D.length+1)*4,this._process();for(var A=this._hash,w=A.words,S=0;S<5;S++){var E=w[S];w[S]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}return A},clone:function(){var b=l.clone.call(this);return b._hash=this._hash.clone(),b}});function p(b,D,V){return b^D^V}function _(b,D,V){return b&D|~b&V}function m(b,D,V){return(b|~D)^V}function h(b,D,V){return b&V|D&~V}function B(b,D,V){return b^(D|~V)}function F(b,D){return b<<D|b>>>32-D}n.RIPEMD160=l._createHelper(g),n.HmacRIPEMD160=l._createHmacHelper(g)}(),t.RIPEMD160})}(vt)),vt.exports}var Ct={exports:{}},p0;function gt(){return p0||(p0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){(function(){var r=t,n=r.lib,s=n.Base,u=r.enc,l=u.Utf8,f=r.algo;f.HMAC=s.extend({init:function(i,x){i=this._hasher=new i.init,typeof x=="string"&&(x=l.parse(x));var v=i.blockSize,c=v*4;x.sigBytes>c&&(x=i.finalize(x)),x.clamp();for(var C=this._oKey=x.clone(),d=this._iKey=x.clone(),g=C.words,p=d.words,_=0;_<v;_++)g[_]^=1549556828,p[_]^=909522486;C.sigBytes=d.sigBytes=c,this.reset()},reset:function(){var i=this._hasher;i.reset(),i.update(this._iKey)},update:function(i){return this._hasher.update(i),this},finalize:function(i){var x=this._hasher,v=x.finalize(i);x.reset();var c=x.finalize(this._oKey.clone().concat(v));return c}})})()})}(Ct)),Ct.exports}var Et={exports:{}},m0;function ma(){return m0||(m0=1,function(o,e){(function(t,r,n){o.exports=r(G(),xt(),gt())})(W,function(t){return function(){var r=t,n=r.lib,s=n.Base,u=n.WordArray,l=r.algo,f=l.SHA256,i=l.HMAC,x=l.PBKDF2=s.extend({cfg:s.extend({keySize:128/32,hasher:f,iterations:25e4}),init:function(v){this.cfg=this.cfg.extend(v)},compute:function(v,c){for(var C=this.cfg,d=i.create(C.hasher,v),g=u.create(),p=u.create([1]),_=g.words,m=p.words,h=C.keySize,B=C.iterations;_.length<h;){var F=d.update(c).finalize(p);d.reset();for(var b=F.words,D=b.length,V=F,M=1;M<B;M++){V=d.finalize(V),d.reset();for(var A=V.words,w=0;w<D;w++)b[w]^=A[w]}g.concat(F),m[0]++}return g.sigBytes=h*4,g}});r.PBKDF2=function(v,c,C){return x.create(C).compute(v,c)}}(),t.PBKDF2})}(Et)),Et.exports}var Bt={exports:{}},v0;function ye(){return v0||(v0=1,function(o,e){(function(t,r,n){o.exports=r(G(),o0(),gt())})(W,function(t){return function(){var r=t,n=r.lib,s=n.Base,u=n.WordArray,l=r.algo,f=l.MD5,i=l.EvpKDF=s.extend({cfg:s.extend({keySize:128/32,hasher:f,iterations:1}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,v){for(var c,C=this.cfg,d=C.hasher.create(),g=u.create(),p=g.words,_=C.keySize,m=C.iterations;p.length<_;){c&&d.update(c),c=d.update(x).finalize(v),d.reset();for(var h=1;h<m;h++)c=d.finalize(c),d.reset();g.concat(c)}return g.sigBytes=_*4,g}});r.EvpKDF=function(x,v,c){return i.create(c).compute(x,v)}}(),t.EvpKDF})}(Bt)),Bt.exports}var _t={exports:{}},C0;function Q(){return C0||(C0=1,function(o,e){(function(t,r,n){o.exports=r(G(),ye())})(W,function(t){t.lib.Cipher||function(r){var n=t,s=n.lib,u=s.Base,l=s.WordArray,f=s.BufferedBlockAlgorithm,i=n.enc;i.Utf8;var x=i.Base64,v=n.algo,c=v.EvpKDF,C=s.Cipher=f.extend({cfg:u.extend(),createEncryptor:function(A,w){return this.create(this._ENC_XFORM_MODE,A,w)},createDecryptor:function(A,w){return this.create(this._DEC_XFORM_MODE,A,w)},init:function(A,w,S){this.cfg=this.cfg.extend(S),this._xformMode=A,this._key=w,this.reset()},reset:function(){f.reset.call(this),this._doReset()},process:function(A){return this._append(A),this._process()},finalize:function(A){A&&this._append(A);var w=this._doFinalize();return w},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function A(w){return typeof w=="string"?M:b}return function(w){return{encrypt:function(S,E,k){return A(E).encrypt(w,S,E,k)},decrypt:function(S,E,k){return A(E).decrypt(w,S,E,k)}}}}()});s.StreamCipher=C.extend({_doFinalize:function(){var A=this._process(!0);return A},blockSize:1});var d=n.mode={},g=s.BlockCipherMode=u.extend({createEncryptor:function(A,w){return this.Encryptor.create(A,w)},createDecryptor:function(A,w){return this.Decryptor.create(A,w)},init:function(A,w){this._cipher=A,this._iv=w}}),p=d.CBC=function(){var A=g.extend();A.Encryptor=A.extend({processBlock:function(S,E){var k=this._cipher,T=k.blockSize;w.call(this,S,E,T),k.encryptBlock(S,E),this._prevBlock=S.slice(E,E+T)}}),A.Decryptor=A.extend({processBlock:function(S,E){var k=this._cipher,T=k.blockSize,O=S.slice(E,E+T);k.decryptBlock(S,E),w.call(this,S,E,T),this._prevBlock=O}});function w(S,E,k){var T,O=this._iv;O?(T=O,this._iv=r):T=this._prevBlock;for(var U=0;U<k;U++)S[E+U]^=T[U]}return A}(),_=n.pad={},m=_.Pkcs7={pad:function(A,w){for(var S=w*4,E=S-A.sigBytes%S,k=E<<24|E<<16|E<<8|E,T=[],O=0;O<E;O+=4)T.push(k);var U=l.create(T,E);A.concat(U)},unpad:function(A){var w=A.words[A.sigBytes-1>>>2]&255;A.sigBytes-=w}};s.BlockCipher=C.extend({cfg:C.cfg.extend({mode:p,padding:m}),reset:function(){var A;C.reset.call(this);var w=this.cfg,S=w.iv,E=w.mode;this._xformMode==this._ENC_XFORM_MODE?A=E.createEncryptor:(A=E.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==A?this._mode.init(this,S&&S.words):(this._mode=A.call(E,this,S&&S.words),this._mode.__creator=A)},_doProcessBlock:function(A,w){this._mode.processBlock(A,w)},_doFinalize:function(){var A,w=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(w.pad(this._data,this.blockSize),A=this._process(!0)):(A=this._process(!0),w.unpad(A)),A},blockSize:128/32});var h=s.CipherParams=u.extend({init:function(A){this.mixIn(A)},toString:function(A){return(A||this.formatter).stringify(this)}}),B=n.format={},F=B.OpenSSL={stringify:function(A){var w,S=A.ciphertext,E=A.salt;return E?w=l.create([1398893684,1701076831]).concat(E).concat(S):w=S,w.toString(x)},parse:function(A){var w,S=x.parse(A),E=S.words;return E[0]==1398893684&&E[1]==1701076831&&(w=l.create(E.slice(2,4)),E.splice(0,4),S.sigBytes-=16),h.create({ciphertext:S,salt:w})}},b=s.SerializableCipher=u.extend({cfg:u.extend({format:F}),encrypt:function(A,w,S,E){E=this.cfg.extend(E);var k=A.createEncryptor(S,E),T=k.finalize(w),O=k.cfg;return h.create({ciphertext:T,key:S,iv:O.iv,algorithm:A,mode:O.mode,padding:O.padding,blockSize:A.blockSize,formatter:E.format})},decrypt:function(A,w,S,E){E=this.cfg.extend(E),w=this._parse(w,E.format);var k=A.createDecryptor(S,E).finalize(w.ciphertext);return k},_parse:function(A,w){return typeof A=="string"?w.parse(A,this):A}}),D=n.kdf={},V=D.OpenSSL={execute:function(A,w,S,E,k){if(E||(E=l.random(64/8)),k)var T=c.create({keySize:w+S,hasher:k}).compute(A,E);else var T=c.create({keySize:w+S}).compute(A,E);var O=l.create(T.words.slice(w),S*4);return T.sigBytes=w*4,h.create({key:T,iv:O,salt:E})}},M=s.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:V}),encrypt:function(A,w,S,E){E=this.cfg.extend(E);var k=E.kdf.execute(S,A.keySize,A.ivSize,E.salt,E.hasher);E.iv=k.iv;var T=b.encrypt.call(this,A,w,k.key,E);return T.mixIn(k),T},decrypt:function(A,w,S,E){E=this.cfg.extend(E),w=this._parse(w,E.format);var k=E.kdf.execute(S,A.keySize,A.ivSize,w.salt,E.hasher);E.iv=k.iv;var T=b.decrypt.call(this,A,w,k.key,E);return T}})}()})}(_t)),_t.exports}var yt={exports:{}},g0;function va(){return g0||(g0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.mode.CFB=function(){var r=t.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(s,u){var l=this._cipher,f=l.blockSize;n.call(this,s,u,f,l),this._prevBlock=s.slice(u,u+f)}}),r.Decryptor=r.extend({processBlock:function(s,u){var l=this._cipher,f=l.blockSize,i=s.slice(u,u+f);n.call(this,s,u,f,l),this._prevBlock=i}});function n(s,u,l,f){var i,x=this._iv;x?(i=x.slice(0),this._iv=void 0):i=this._prevBlock,f.encryptBlock(i,0);for(var v=0;v<l;v++)s[u+v]^=i[v]}return r}(),t.mode.CFB})}(yt)),yt.exports}var kt={exports:{}},E0;function Ca(){return E0||(E0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.mode.CTR=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(s,u){var l=this._cipher,f=l.blockSize,i=this._iv,x=this._counter;i&&(x=this._counter=i.slice(0),this._iv=void 0);var v=x.slice(0);l.encryptBlock(v,0),x[f-1]=x[f-1]+1|0;for(var c=0;c<f;c++)s[u+c]^=v[c]}});return r.Decryptor=n,r}(),t.mode.CTR})}(kt)),kt.exports}var At={exports:{}},B0;function ga(){return B0||(B0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){/** @preserve
|
|
11
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
12
|
+
* derived from CryptoJS.mode.CTR
|
|
13
|
+
* Jan Hruby jhruby.web@gmail.com
|
|
14
|
+
*/return t.mode.CTRGladman=function(){var r=t.lib.BlockCipherMode.extend();function n(l){if((l>>24&255)===255){var f=l>>16&255,i=l>>8&255,x=l&255;f===255?(f=0,i===255?(i=0,x===255?x=0:++x):++i):++f,l=0,l+=f<<16,l+=i<<8,l+=x}else l+=1<<24;return l}function s(l){return(l[0]=n(l[0]))===0&&(l[1]=n(l[1])),l}var u=r.Encryptor=r.extend({processBlock:function(l,f){var i=this._cipher,x=i.blockSize,v=this._iv,c=this._counter;v&&(c=this._counter=v.slice(0),this._iv=void 0),s(c);var C=c.slice(0);i.encryptBlock(C,0);for(var d=0;d<x;d++)l[f+d]^=C[d]}});return r.Decryptor=u,r}(),t.mode.CTRGladman})}(At)),At.exports}var bt={exports:{}},_0;function Ea(){return _0||(_0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.mode.OFB=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(s,u){var l=this._cipher,f=l.blockSize,i=this._iv,x=this._keystream;i&&(x=this._keystream=i.slice(0),this._iv=void 0),l.encryptBlock(x,0);for(var v=0;v<f;v++)s[u+v]^=x[v]}});return r.Decryptor=n,r}(),t.mode.OFB})}(bt)),bt.exports}var Ft={exports:{}},y0;function Ba(){return y0||(y0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.mode.ECB=function(){var r=t.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(n,s){this._cipher.encryptBlock(n,s)}}),r.Decryptor=r.extend({processBlock:function(n,s){this._cipher.decryptBlock(n,s)}}),r}(),t.mode.ECB})}(Ft)),Ft.exports}var Dt={exports:{}},k0;function _a(){return k0||(k0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.pad.AnsiX923={pad:function(r,n){var s=r.sigBytes,u=n*4,l=u-s%u,f=s+l-1;r.clamp(),r.words[f>>>2]|=l<<24-f%4*8,r.sigBytes+=l},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Ansix923})}(Dt)),Dt.exports}var wt={exports:{}},A0;function ya(){return A0||(A0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.pad.Iso10126={pad:function(r,n){var s=n*4,u=s-r.sigBytes%s;r.concat(t.lib.WordArray.random(u-1)).concat(t.lib.WordArray.create([u<<24],1))},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Iso10126})}(wt)),wt.exports}var St={exports:{}},b0;function ka(){return b0||(b0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.pad.Iso97971={pad:function(r,n){r.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(r,n)},unpad:function(r){t.pad.ZeroPadding.unpad(r),r.sigBytes--}},t.pad.Iso97971})}(St)),St.exports}var Vt={exports:{}},F0;function Aa(){return F0||(F0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.pad.ZeroPadding={pad:function(r,n){var s=n*4;r.clamp(),r.sigBytes+=s-(r.sigBytes%s||s)},unpad:function(r){for(var n=r.words,s=r.sigBytes-1,s=r.sigBytes-1;s>=0;s--)if(n[s>>>2]>>>24-s%4*8&255){r.sigBytes=s+1;break}}},t.pad.ZeroPadding})}(Vt)),Vt.exports}var Nt={exports:{}},D0;function ba(){return D0||(D0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(Nt)),Nt.exports}var Rt={exports:{}},w0;function Fa(){return w0||(w0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Q())})(W,function(t){return function(r){var n=t,s=n.lib,u=s.CipherParams,l=n.enc,f=l.Hex,i=n.format;i.Hex={stringify:function(x){return x.ciphertext.toString(f)},parse:function(x){var v=f.parse(x);return u.create({ciphertext:v})}}}(),t.format.Hex})}(Rt)),Rt.exports}var It={exports:{}},S0;function Da(){return S0||(S0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),ye(),Q())})(W,function(t){return function(){var r=t,n=r.lib,s=n.BlockCipher,u=r.algo,l=[],f=[],i=[],x=[],v=[],c=[],C=[],d=[],g=[],p=[];(function(){for(var h=[],B=0;B<256;B++)B<128?h[B]=B<<1:h[B]=B<<1^283;for(var F=0,b=0,B=0;B<256;B++){var D=b^b<<1^b<<2^b<<3^b<<4;D=D>>>8^D&255^99,l[F]=D,f[D]=F;var V=h[F],M=h[V],A=h[M],w=h[D]*257^D*16843008;i[F]=w<<24|w>>>8,x[F]=w<<16|w>>>16,v[F]=w<<8|w>>>24,c[F]=w;var w=A*16843009^M*65537^V*257^F*16843008;C[D]=w<<24|w>>>8,d[D]=w<<16|w>>>16,g[D]=w<<8|w>>>24,p[D]=w,F?(F=V^h[h[h[A^V]]],b^=h[h[b]]):F=b=1}})();var _=[0,1,2,4,8,16,32,64,128,27,54],m=u.AES=s.extend({_doReset:function(){var h;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var B=this._keyPriorReset=this._key,F=B.words,b=B.sigBytes/4,D=this._nRounds=b+6,V=(D+1)*4,M=this._keySchedule=[],A=0;A<V;A++)A<b?M[A]=F[A]:(h=M[A-1],A%b?b>6&&A%b==4&&(h=l[h>>>24]<<24|l[h>>>16&255]<<16|l[h>>>8&255]<<8|l[h&255]):(h=h<<8|h>>>24,h=l[h>>>24]<<24|l[h>>>16&255]<<16|l[h>>>8&255]<<8|l[h&255],h^=_[A/b|0]<<24),M[A]=M[A-b]^h);for(var w=this._invKeySchedule=[],S=0;S<V;S++){var A=V-S;if(S%4)var h=M[A];else var h=M[A-4];S<4||A<=4?w[S]=h:w[S]=C[l[h>>>24]]^d[l[h>>>16&255]]^g[l[h>>>8&255]]^p[l[h&255]]}}},encryptBlock:function(h,B){this._doCryptBlock(h,B,this._keySchedule,i,x,v,c,l)},decryptBlock:function(h,B){var F=h[B+1];h[B+1]=h[B+3],h[B+3]=F,this._doCryptBlock(h,B,this._invKeySchedule,C,d,g,p,f);var F=h[B+1];h[B+1]=h[B+3],h[B+3]=F},_doCryptBlock:function(h,B,F,b,D,V,M,A){for(var w=this._nRounds,S=h[B]^F[0],E=h[B+1]^F[1],k=h[B+2]^F[2],T=h[B+3]^F[3],O=4,U=1;U<w;U++){var H=b[S>>>24]^D[E>>>16&255]^V[k>>>8&255]^M[T&255]^F[O++],$=b[E>>>24]^D[k>>>16&255]^V[T>>>8&255]^M[S&255]^F[O++],P=b[k>>>24]^D[T>>>16&255]^V[S>>>8&255]^M[E&255]^F[O++],y=b[T>>>24]^D[S>>>16&255]^V[E>>>8&255]^M[k&255]^F[O++];S=H,E=$,k=P,T=y}var H=(A[S>>>24]<<24|A[E>>>16&255]<<16|A[k>>>8&255]<<8|A[T&255])^F[O++],$=(A[E>>>24]<<24|A[k>>>16&255]<<16|A[T>>>8&255]<<8|A[S&255])^F[O++],P=(A[k>>>24]<<24|A[T>>>16&255]<<16|A[S>>>8&255]<<8|A[E&255])^F[O++],y=(A[T>>>24]<<24|A[S>>>16&255]<<16|A[E>>>8&255]<<8|A[k&255])^F[O++];h[B]=H,h[B+1]=$,h[B+2]=P,h[B+3]=y},keySize:256/32});r.AES=s._createHelper(m)}(),t.AES})}(It)),It.exports}var Tt={exports:{}},V0;function wa(){return V0||(V0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),ye(),Q())})(W,function(t){return function(){var r=t,n=r.lib,s=n.WordArray,u=n.BlockCipher,l=r.algo,f=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],i=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],x=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],v=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],C=l.DES=u.extend({_doReset:function(){for(var _=this._key,m=_.words,h=[],B=0;B<56;B++){var F=f[B]-1;h[B]=m[F>>>5]>>>31-F%32&1}for(var b=this._subKeys=[],D=0;D<16;D++){for(var V=b[D]=[],M=x[D],B=0;B<24;B++)V[B/6|0]|=h[(i[B]-1+M)%28]<<31-B%6,V[4+(B/6|0)]|=h[28+(i[B+24]-1+M)%28]<<31-B%6;V[0]=V[0]<<1|V[0]>>>31;for(var B=1;B<7;B++)V[B]=V[B]>>>(B-1)*4+3;V[7]=V[7]<<5|V[7]>>>27}for(var A=this._invSubKeys=[],B=0;B<16;B++)A[B]=b[15-B]},encryptBlock:function(_,m){this._doCryptBlock(_,m,this._subKeys)},decryptBlock:function(_,m){this._doCryptBlock(_,m,this._invSubKeys)},_doCryptBlock:function(_,m,h){this._lBlock=_[m],this._rBlock=_[m+1],d.call(this,4,252645135),d.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),d.call(this,1,1431655765);for(var B=0;B<16;B++){for(var F=h[B],b=this._lBlock,D=this._rBlock,V=0,M=0;M<8;M++)V|=v[M][((D^F[M])&c[M])>>>0];this._lBlock=D,this._rBlock=b^V}var A=this._lBlock;this._lBlock=this._rBlock,this._rBlock=A,d.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),_[m]=this._lBlock,_[m+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function d(_,m){var h=(this._lBlock>>>_^this._rBlock)&m;this._rBlock^=h,this._lBlock^=h<<_}function g(_,m){var h=(this._rBlock>>>_^this._lBlock)&m;this._lBlock^=h,this._rBlock^=h<<_}r.DES=u._createHelper(C);var p=l.TripleDES=u.extend({_doReset:function(){var _=this._key,m=_.words;if(m.length!==2&&m.length!==4&&m.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var h=m.slice(0,2),B=m.length<4?m.slice(0,2):m.slice(2,4),F=m.length<6?m.slice(0,2):m.slice(4,6);this._des1=C.createEncryptor(s.create(h)),this._des2=C.createEncryptor(s.create(B)),this._des3=C.createEncryptor(s.create(F))},encryptBlock:function(_,m){this._des1.encryptBlock(_,m),this._des2.decryptBlock(_,m),this._des3.encryptBlock(_,m)},decryptBlock:function(_,m){this._des3.decryptBlock(_,m),this._des2.encryptBlock(_,m),this._des1.decryptBlock(_,m)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=u._createHelper(p)}(),t.TripleDES})}(Tt)),Tt.exports}var Mt={exports:{}},N0;function Sa(){return N0||(N0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),ye(),Q())})(W,function(t){return function(){var r=t,n=r.lib,s=n.StreamCipher,u=r.algo,l=u.RC4=s.extend({_doReset:function(){for(var x=this._key,v=x.words,c=x.sigBytes,C=this._S=[],d=0;d<256;d++)C[d]=d;for(var d=0,g=0;d<256;d++){var p=d%c,_=v[p>>>2]>>>24-p%4*8&255;g=(g+C[d]+_)%256;var m=C[d];C[d]=C[g],C[g]=m}this._i=this._j=0},_doProcessBlock:function(x,v){x[v]^=f.call(this)},keySize:256/32,ivSize:0});function f(){for(var x=this._S,v=this._i,c=this._j,C=0,d=0;d<4;d++){v=(v+1)%256,c=(c+x[v])%256;var g=x[v];x[v]=x[c],x[c]=g,C|=x[(x[v]+x[c])%256]<<24-d*8}return this._i=v,this._j=c,C}r.RC4=s._createHelper(l);var i=u.RC4Drop=l.extend({cfg:l.cfg.extend({drop:192}),_doReset:function(){l._doReset.call(this);for(var x=this.cfg.drop;x>0;x--)f.call(this)}});r.RC4Drop=s._createHelper(i)}(),t.RC4})}(Mt)),Mt.exports}var Pt={exports:{}},R0;function Va(){return R0||(R0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),ye(),Q())})(W,function(t){return function(){var r=t,n=r.lib,s=n.StreamCipher,u=r.algo,l=[],f=[],i=[],x=u.Rabbit=s.extend({_doReset:function(){for(var c=this._key.words,C=this.cfg.iv,d=0;d<4;d++)c[d]=(c[d]<<8|c[d]>>>24)&16711935|(c[d]<<24|c[d]>>>8)&4278255360;var g=this._X=[c[0],c[3]<<16|c[2]>>>16,c[1],c[0]<<16|c[3]>>>16,c[2],c[1]<<16|c[0]>>>16,c[3],c[2]<<16|c[1]>>>16],p=this._C=[c[2]<<16|c[2]>>>16,c[0]&4294901760|c[1]&65535,c[3]<<16|c[3]>>>16,c[1]&4294901760|c[2]&65535,c[0]<<16|c[0]>>>16,c[2]&4294901760|c[3]&65535,c[1]<<16|c[1]>>>16,c[3]&4294901760|c[0]&65535];this._b=0;for(var d=0;d<4;d++)v.call(this);for(var d=0;d<8;d++)p[d]^=g[d+4&7];if(C){var _=C.words,m=_[0],h=_[1],B=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,F=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,b=B>>>16|F&4294901760,D=F<<16|B&65535;p[0]^=B,p[1]^=b,p[2]^=F,p[3]^=D,p[4]^=B,p[5]^=b,p[6]^=F,p[7]^=D;for(var d=0;d<4;d++)v.call(this)}},_doProcessBlock:function(c,C){var d=this._X;v.call(this),l[0]=d[0]^d[5]>>>16^d[3]<<16,l[1]=d[2]^d[7]>>>16^d[5]<<16,l[2]=d[4]^d[1]>>>16^d[7]<<16,l[3]=d[6]^d[3]>>>16^d[1]<<16;for(var g=0;g<4;g++)l[g]=(l[g]<<8|l[g]>>>24)&16711935|(l[g]<<24|l[g]>>>8)&4278255360,c[C+g]^=l[g]},blockSize:128/32,ivSize:64/32});function v(){for(var c=this._X,C=this._C,d=0;d<8;d++)f[d]=C[d];C[0]=C[0]+1295307597+this._b|0,C[1]=C[1]+3545052371+(C[0]>>>0<f[0]>>>0?1:0)|0,C[2]=C[2]+886263092+(C[1]>>>0<f[1]>>>0?1:0)|0,C[3]=C[3]+1295307597+(C[2]>>>0<f[2]>>>0?1:0)|0,C[4]=C[4]+3545052371+(C[3]>>>0<f[3]>>>0?1:0)|0,C[5]=C[5]+886263092+(C[4]>>>0<f[4]>>>0?1:0)|0,C[6]=C[6]+1295307597+(C[5]>>>0<f[5]>>>0?1:0)|0,C[7]=C[7]+3545052371+(C[6]>>>0<f[6]>>>0?1:0)|0,this._b=C[7]>>>0<f[7]>>>0?1:0;for(var d=0;d<8;d++){var g=c[d]+C[d],p=g&65535,_=g>>>16,m=((p*p>>>17)+p*_>>>15)+_*_,h=((g&4294901760)*g|0)+((g&65535)*g|0);i[d]=m^h}c[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,c[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,c[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,c[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,c[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,c[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,c[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,c[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}r.Rabbit=s._createHelper(x)}(),t.Rabbit})}(Pt)),Pt.exports}var Ot={exports:{}},I0;function Na(){return I0||(I0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),ye(),Q())})(W,function(t){return function(){var r=t,n=r.lib,s=n.StreamCipher,u=r.algo,l=[],f=[],i=[],x=u.RabbitLegacy=s.extend({_doReset:function(){var c=this._key.words,C=this.cfg.iv,d=this._X=[c[0],c[3]<<16|c[2]>>>16,c[1],c[0]<<16|c[3]>>>16,c[2],c[1]<<16|c[0]>>>16,c[3],c[2]<<16|c[1]>>>16],g=this._C=[c[2]<<16|c[2]>>>16,c[0]&4294901760|c[1]&65535,c[3]<<16|c[3]>>>16,c[1]&4294901760|c[2]&65535,c[0]<<16|c[0]>>>16,c[2]&4294901760|c[3]&65535,c[1]<<16|c[1]>>>16,c[3]&4294901760|c[0]&65535];this._b=0;for(var p=0;p<4;p++)v.call(this);for(var p=0;p<8;p++)g[p]^=d[p+4&7];if(C){var _=C.words,m=_[0],h=_[1],B=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,F=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,b=B>>>16|F&4294901760,D=F<<16|B&65535;g[0]^=B,g[1]^=b,g[2]^=F,g[3]^=D,g[4]^=B,g[5]^=b,g[6]^=F,g[7]^=D;for(var p=0;p<4;p++)v.call(this)}},_doProcessBlock:function(c,C){var d=this._X;v.call(this),l[0]=d[0]^d[5]>>>16^d[3]<<16,l[1]=d[2]^d[7]>>>16^d[5]<<16,l[2]=d[4]^d[1]>>>16^d[7]<<16,l[3]=d[6]^d[3]>>>16^d[1]<<16;for(var g=0;g<4;g++)l[g]=(l[g]<<8|l[g]>>>24)&16711935|(l[g]<<24|l[g]>>>8)&4278255360,c[C+g]^=l[g]},blockSize:128/32,ivSize:64/32});function v(){for(var c=this._X,C=this._C,d=0;d<8;d++)f[d]=C[d];C[0]=C[0]+1295307597+this._b|0,C[1]=C[1]+3545052371+(C[0]>>>0<f[0]>>>0?1:0)|0,C[2]=C[2]+886263092+(C[1]>>>0<f[1]>>>0?1:0)|0,C[3]=C[3]+1295307597+(C[2]>>>0<f[2]>>>0?1:0)|0,C[4]=C[4]+3545052371+(C[3]>>>0<f[3]>>>0?1:0)|0,C[5]=C[5]+886263092+(C[4]>>>0<f[4]>>>0?1:0)|0,C[6]=C[6]+1295307597+(C[5]>>>0<f[5]>>>0?1:0)|0,C[7]=C[7]+3545052371+(C[6]>>>0<f[6]>>>0?1:0)|0,this._b=C[7]>>>0<f[7]>>>0?1:0;for(var d=0;d<8;d++){var g=c[d]+C[d],p=g&65535,_=g>>>16,m=((p*p>>>17)+p*_>>>15)+_*_,h=((g&4294901760)*g|0)+((g&65535)*g|0);i[d]=m^h}c[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,c[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,c[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,c[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,c[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,c[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,c[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,c[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}r.RabbitLegacy=s._createHelper(x)}(),t.RabbitLegacy})}(Ot)),Ot.exports}var Ht={exports:{}},T0;function Ra(){return T0||(T0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),ye(),Q())})(W,function(t){return function(){var r=t,n=r.lib,s=n.BlockCipher,u=r.algo;const l=16,f=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],i=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var x={pbox:[],sbox:[]};function v(p,_){let m=_>>24&255,h=_>>16&255,B=_>>8&255,F=_&255,b=p.sbox[0][m]+p.sbox[1][h];return b=b^p.sbox[2][B],b=b+p.sbox[3][F],b}function c(p,_,m){let h=_,B=m,F;for(let b=0;b<l;++b)h=h^p.pbox[b],B=v(p,h)^B,F=h,h=B,B=F;return F=h,h=B,B=F,B=B^p.pbox[l],h=h^p.pbox[l+1],{left:h,right:B}}function C(p,_,m){let h=_,B=m,F;for(let b=l+1;b>1;--b)h=h^p.pbox[b],B=v(p,h)^B,F=h,h=B,B=F;return F=h,h=B,B=F,B=B^p.pbox[1],h=h^p.pbox[0],{left:h,right:B}}function d(p,_,m){for(let D=0;D<4;D++){p.sbox[D]=[];for(let V=0;V<256;V++)p.sbox[D][V]=i[D][V]}let h=0;for(let D=0;D<l+2;D++)p.pbox[D]=f[D]^_[h],h++,h>=m&&(h=0);let B=0,F=0,b=0;for(let D=0;D<l+2;D+=2)b=c(p,B,F),B=b.left,F=b.right,p.pbox[D]=B,p.pbox[D+1]=F;for(let D=0;D<4;D++)for(let V=0;V<256;V+=2)b=c(p,B,F),B=b.left,F=b.right,p.sbox[D][V]=B,p.sbox[D][V+1]=F;return!0}var g=u.Blowfish=s.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var p=this._keyPriorReset=this._key,_=p.words,m=p.sigBytes/4;d(x,_,m)}},encryptBlock:function(p,_){var m=c(x,p[_],p[_+1]);p[_]=m.left,p[_+1]=m.right},decryptBlock:function(p,_){var m=C(x,p[_],p[_+1]);p[_]=m.left,p[_+1]=m.right},blockSize:64/32,keySize:128/32,ivSize:64/32});r.Blowfish=s._createHelper(g)}(),t.Blowfish})}(Ht)),Ht.exports}(function(o,e){(function(t,r,n){o.exports=r(G(),Ke(),ua(),ca(),Ve(),da(),Ne(),o0(),xt(),xa(),d0(),ha(),fa(),pa(),gt(),ma(),ye(),Q(),va(),Ca(),ga(),Ea(),Ba(),_a(),ya(),ka(),Aa(),ba(),Fa(),Da(),wa(),Sa(),Va(),Na(),Ra())})(W,function(t){return t})})(Qt);var Ia=Qt.exports;const ue=sa(Ia);function Ta(o,e={}){const t=o.replace(/-/g,""),r=t.slice(0,16),n=t.slice(-16),s=ue.enc.Utf8.parse(r),u=ue.enc.Utf8.parse(n),l=JSON.stringify(e);return{requestParam:ue.AES.encrypt(ue.enc.Utf8.parse(l),s,{keySize:128/8,iv:u,mode:ue.mode.CBC,padding:ue.pad.Pkcs7}).toString()}}function M0(o,e){const t=o.replace(/-/g,""),r=t.slice(0,16),n=t.slice(-16),s=ue.enc.Utf8.parse(r),u=ue.enc.Utf8.parse(n),f=ue.AES.decrypt(e,s,{keySize:128/8,iv:u,mode:ue.mode.CBC,padding:ue.pad.Pkcs7}).toString(ue.enc.Utf8);return JSON.parse(f)}async function Ma(o,e){try{const t=ve(o);return await(await fetch(`${t}/api/v1/countries-iso`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:e}})).json()}catch{}}async function Pa(o,e,t){try{const r=ve(e);return await(await fetch(`${r}/api/v1/state-by-country/${o}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:t}})).json()}catch{}}async function Oa(o){try{const e=ve(o);return await(await fetch(`${e}/api/v1/checkout/stable-coin`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}})).json()}catch{}}async function Ha(o,e){try{const t=ve(o);return await(await fetch(`${t}/api/v1/checkout/networks/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}})).json()}catch{}}function ke(o){return typeof o=="string"||o instanceof String}function P0(o){var e;return typeof o=="object"&&o!=null&&(o==null||(e=o.constructor)==null?void 0:e.name)==="Object"}function O0(o,e){return Array.isArray(e)?O0(o,(t,r)=>e.includes(r)):Object.entries(o).reduce((t,r)=>{let[n,s]=r;return e(s,n)&&(t[n]=s),t},{})}const L={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function $a(o){switch(o){case L.LEFT:return L.FORCE_LEFT;case L.RIGHT:return L.FORCE_RIGHT;default:return o}}function $t(o){return o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function We(o,e){if(e===o)return!0;const t=Array.isArray(e),r=Array.isArray(o);let n;if(t&&r){if(e.length!=o.length)return!1;for(n=0;n<e.length;n++)if(!We(e[n],o[n]))return!1;return!0}if(t!=r)return!1;if(e&&o&&typeof e=="object"&&typeof o=="object"){const s=e instanceof Date,u=o instanceof Date;if(s&&u)return e.getTime()==o.getTime();if(s!=u)return!1;const l=e instanceof RegExp,f=o instanceof RegExp;if(l&&f)return e.toString()==o.toString();if(l!=f)return!1;const i=Object.keys(e);for(n=0;n<i.length;n++)if(!Object.prototype.hasOwnProperty.call(o,i[n]))return!1;for(n=0;n<i.length;n++)if(!We(o[i[n]],e[i[n]]))return!1;return!0}else if(e&&o&&typeof e=="function"&&typeof o=="function")return e.toString()===o.toString();return!1}class La{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?L.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?L.RIGHT:L.LEFT}}function q(o,e){return new q.InputMask(o,e)}function H0(o){if(o==null)throw new Error("mask property should be defined");return o instanceof RegExp?q.MaskedRegExp:ke(o)?q.MaskedPattern:o===Date?q.MaskedDate:o===Number?q.MaskedNumber:Array.isArray(o)||o===Array?q.MaskedDynamic:q.Masked&&o.prototype instanceof q.Masked?o:q.Masked&&o instanceof q.Masked?o.constructor:o instanceof Function?q.MaskedFunction:(console.warn("Mask not found for mask",o),q.Masked)}function Le(o){if(!o)throw new Error("Options in not defined");if(q.Masked){if(o.prototype instanceof q.Masked)return{mask:o};const{mask:e=void 0,...t}=o instanceof q.Masked?{mask:o}:P0(o)&&o.mask instanceof q.Masked?o:{};if(e){const r=e.mask;return{...O0(e,(n,s)=>!s.startsWith("_")),mask:e.constructor,_mask:r,...t}}}return P0(o)?{...o}:{mask:o}}function Ce(o){if(q.Masked&&o instanceof q.Masked)return o;const e=Le(o),t=H0(e.mask);if(!t)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===t&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new t(e)}q.createMask=Ce;class Lt{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}q.MaskElement=Lt;const $0=90,za=89;class Ge extends Lt{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,r;return(e=(t=(r=this.input).getRootNode)==null?void 0:t.call(r))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===$0&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===za&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===$0&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}q.HTMLMaskElement=Ge;class Ua extends Ge{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}q.HTMLMaskElement=Ge;class L0 extends Ge{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),r=t&&t.anchorOffset,n=t&&t.focusOffset;return n==null||r==null||r<n?r:n}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),r=t&&t.anchorOffset,n=t&&t.focusOffset;return n==null||r==null||r>n?r:n}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,e),r.setEnd(this.input.lastChild||this.input,t);const n=this.rootElement,s=n.getSelection&&n.getSelection();s&&(s.removeAllRanges(),s.addRange(r))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}q.HTMLContenteditableMaskElement=L0;class Ze{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>Ze.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Ze.MAX_LENGTH=100;class qa{constructor(e,t){this.el=e instanceof Lt?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new L0(e):new Ua(e),this.masked=Ce(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Ze,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return e==null||((t=this.masked)==null?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof q.Masked)&&this.masked.constructor===H0(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof q.Masked?e:Ce({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const r=this._listeners[e];r&&r.forEach(n=>n(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,r=this.masked.value,n=this.masked.rawInputValue,s=this.displayValue,u=this.unmaskedValue!==t||this.value!==r||this._rawInputValue!==n;this._unmaskedValue=t,this._value=r,this._rawInputValue=n,this.el.value!==s&&(this.el.value=s),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),u&&this._fireChangeEvents(),!this._historyChanging&&(u||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...r}=e,n=!this.maskEquals(t),s=this.masked.optionsIsChanged(r);n&&(this.mask=t),s&&this.masked.updateOptions(r),(n||s)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,L.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const r=this._listeners[e].indexOf(t);return r>=0&&this._listeners[e].splice(r,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new La({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,n=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,s=r===this.masked.rawInputValue?t.removeDirection:L.NONE;let u=this.masked.nearestInputPos(t.startChangePos+n,s);s!==L.NONE&&(u=this.masked.nearestInputPos(u,L.NONE)),this.updateControl(u),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}q.InputMask=qa;class K{static normalize(e){return Array.isArray(e)?e:[e,new K]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}q.ChangeDetails=K;class fe{constructor(e,t,r){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=r}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class te{constructor(e){this._value="",this._update({...te.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new fe(this.extractInput(e,t),e)}appendTail(e){return ke(e)&&(e=new fe(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new K({inserted:e,rawInserted:e})):new K}_appendChar(e,t,r){t===void 0&&(t={});const n=this.state;let s;if([e,s]=this.doPrepareChar(e,t),e&&(s=s.aggregate(this._appendCharRaw(e,t)),!s.rawInserted&&this.autofix==="pad")){const u=this.state;this.state=n;let l=this.pad(t);const f=this._appendCharRaw(e,t);l=l.aggregate(f),f.rawInserted||l.equals(s)?s=l:this.state=u}if(s.inserted){let u,l=this.doValidate(t)!==!1;if(l&&r!=null){const f=this.state;if(this.overwrite===!0){u=r.state;for(let x=0;x<s.rawInserted.length;++x)r.unshift(this.displayValue.length-s.tailShift)}let i=this.appendTail(r);if(l=i.rawInserted.length===r.toString().length,!(l&&i.inserted)&&this.overwrite==="shift"){this.state=f,u=r.state;for(let x=0;x<s.rawInserted.length;++x)r.shift();i=this.appendTail(r),l=i.rawInserted.length===r.toString().length}l&&i.inserted&&(this.state=f)}l||(s=new K,this.state=n,r&&u&&(r.state=u))}return s}_appendPlaceholder(){return new K}_appendEager(){return new K}append(e,t,r){if(!ke(e))throw new Error("value should be string");const n=ke(r)?new fe(String(r)):r;t!=null&&t.tail&&(t._beforeTailState=this.state);let s;[e,s]=this.doPrepare(e,t);for(let u=0;u<e.length;++u){const l=this._appendChar(e[u],t,n);if(!l.rawInserted&&!this.doSkipInvalid(e[u],t,n))break;s.aggregate(l)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&s.aggregate(this._appendEager()),n!=null&&(s.tailShift+=this.appendTail(n).tailShift),s}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new K}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,r=this.value,n=e();return this.rawInputValue=t,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,r=e(this);return this.state=t,delete this._isolated,r}doSkipInvalid(e,t,r){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),K.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),K.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,r,n,s){r===void 0&&(r=""),n===void 0&&(n=L.NONE),s===void 0&&(s={input:!0});const u=e+t,l=this.extractTail(u),f=this.eager===!0||this.eager==="remove";let i;f&&(n=$a(n),i=this.extractInput(0,u,{raw:!0}));let x=e;const v=new K;if(n!==L.NONE&&(x=this.nearestInputPos(e,t>1&&e!==0&&!f?L.NONE:n),v.tailShift=x-e),v.aggregate(this.remove(x)),f&&n!==L.NONE&&i===this.rawInputValue)if(n===L.FORCE_LEFT){let c;for(;i===this.rawInputValue&&(c=this.displayValue.length);)v.aggregate(new K({tailShift:-1})).aggregate(this.remove(c-1))}else n===L.FORCE_RIGHT&&l.unshift();return v.aggregate(this.append(r,s,l))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!We(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||te.EMPTY_VALUES.includes(e)&&te.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new K}}te.DEFAULTS={skipInvalid:!0},te.EMPTY_VALUES=[void 0,null,""],q.Masked=te;class Re{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=ke(e)?new fe(String(e)):e;const t=this.chunks[this.chunks.length-1],r=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof fe)r?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof Re){if(e.stop==null){let n;for(;e.chunks.length&&e.chunks[0].stop==null;)n=e.chunks.shift(),n.from+=e.from,this.extend(n)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof q.MaskedPattern))return new fe(this.toString()).appendTo(e);const t=new K;for(let r=0;r<this.chunks.length;++r){const n=this.chunks[r],s=e._mapPosToBlock(e.displayValue.length),u=n.stop;let l;if(u!=null&&(!s||s.index<=u)&&((n instanceof Re||e._stops.indexOf(u)>=0)&&t.aggregate(e._appendPlaceholder(u)),l=n instanceof Re&&e._blocks[u]),l){const f=l.appendTail(n);t.aggregate(f);const i=n.toString().slice(f.rawInserted.length);i&&t.aggregate(e.append(i,{tail:!0}))}else t.aggregate(e.append(n.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...r}=e;Object.assign(this,r),this.chunks=t.map(n=>{const s="chunks"in n?new Re:new fe;return s.state=n,s})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let r=0;for(;r<this.chunks.length;){const n=this.chunks[r],s=n.unshift(t);if(n.toString()){if(!s)break;++r}else this.chunks.splice(r,1);if(s)return s}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],r=t.shift();if(t.toString()){if(!r)break;--e}else this.chunks.splice(e,1);if(r)return r}return""}}class ja{constructor(e,t){this.masked=e,this._log=[];const{offset:r,index:n}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((t=this.block)==null?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,L.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,L.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,L.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,L.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,L.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,L.NONE),!0})}}class z0{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new K}nearestInputPos(e,t){t===void 0&&(t=L.NONE);const r=0,n=this._value.length;switch(t){case L.LEFT:case L.FORCE_LEFT:return r;case L.NONE:case L.RIGHT:case L.FORCE_RIGHT:default:return n}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new K;const r=this.eager===!0||this.eager==="append",s=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!r)&&!t.tail,u=new K({inserted:this.char,rawInserted:s?this.char:""});return this._value=this.char,this._isRawInput=s&&(t.raw||t.input),u}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new K;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new fe("")}appendTail(e){return ke(e)&&(e=new fe(String(e))),e.appendTo(this)}append(e,t,r){const n=this._appendChar(e[0],t);return r!=null&&(n.tailShift+=this.appendTail(r).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class Xe{constructor(e){const{parent:t,isOptional:r,placeholderChar:n,displayChar:s,lazy:u,eager:l,...f}=e;this.masked=Ce(f),Object.assign(this,{parent:t,isOptional:r,placeholderChar:n,displayChar:s,lazy:u,eager:l})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new K}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new K;const r=this.masked.state;let n=this.masked._appendChar(e,this.currentMaskFlags(t));return n.inserted&&this.doValidate(t)===!1&&(n=new K,this.masked.state=r),!n.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=!!n.inserted,n}append(e,t,r){return this.masked.append(e,this.currentMaskFlags(t),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new K:(this.isFilled=!0,new K({inserted:this.placeholderChar}))}_appendEager(){return new K}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,r)}nearestInputPos(e,t){t===void 0&&(t=L.NONE);const r=0,n=this.value.length,s=Math.min(Math.max(e,r),n);switch(t){case L.LEFT:case L.FORCE_LEFT:return this.isComplete?s:r;case L.RIGHT:case L.FORCE_RIGHT:return this.isComplete?s:n;case L.NONE:default:return s}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||(e==null?void 0:e._beforeTailState)}}pad(e){return new K}}Xe.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Ka extends te{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=r=>r.search(t)>=0),super._update(e)}}q.MaskedRegExp=Ka;class re extends te{constructor(e){super({...re.DEFAULTS,...e,definitions:Object.assign({},Xe.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let r=!1,n=!1;for(let s=0;s<t.length;++s){if(this.blocks){const i=t.slice(s),x=Object.keys(this.blocks).filter(c=>i.indexOf(c)===0);x.sort((c,C)=>C.length-c.length);const v=x[0];if(v){const{expose:c,repeat:C,...d}=Le(this.blocks[v]),g={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...d,repeat:C,parent:this},p=C!=null?new q.RepeatBlock(g):Ce(g);p&&(this._blocks.push(p),c&&(this.exposeBlock=p),this._maskedBlocks[v]||(this._maskedBlocks[v]=[]),this._maskedBlocks[v].push(this._blocks.length-1)),s+=v.length-1;continue}}let u=t[s],l=u in e;if(u===re.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(u==="{"||u==="}"){r=!r;continue}if(u==="["||u==="]"){n=!n;continue}if(u===re.ESCAPE_CHAR){if(++s,u=t[s],!u)break;l=!1}const f=l?new Xe({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Le(e[u]),parent:this}):new z0({char:u,eager:this.eager,isUnmasking:r});this._blocks.push(f)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:t,...r}=e;this._blocks.forEach((n,s)=>n.state=t[s]),super.state=r}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new K;let r=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(r==null)return t;this._blocks[r].isFilled&&++r;for(let n=r;n<this._blocks.length;++n){const s=this._blocks[n]._appendEager();if(!s.inserted)break;t.aggregate(s)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const r=this._mapPosToBlock(this.displayValue.length),n=new K;if(!r)return n;for(let u=r.index,l;l=this._blocks[u];++u){var s;const f=l._appendChar(e,{...t,_beforeTailState:(s=t._beforeTailState)==null||(s=s._blocks)==null?void 0:s[u]});if(n.aggregate(f),f.consumed)break}return n}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const r=new Re;return e===t||this._forEachBlocksInRange(e,t,(n,s,u,l)=>{const f=n.extractTail(u,l);f.stop=this._findStopBefore(s),f.from=this._blockStartPos(s),f instanceof Re&&(f.blockIndex=s),r.extend(f)}),r}extractInput(e,t,r){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),r===void 0&&(r={}),e===t)return"";let n="";return this._forEachBlocksInRange(e,t,(s,u,l,f)=>{n+=s.extractInput(l,f,r)}),n}_findStopBefore(e){let t;for(let r=0;r<this._stops.length;++r){const n=this._stops[r];if(n<=e)t=n;else break}return t}_appendPlaceholder(e){const t=new K;if(this.lazy&&e==null)return t;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return t;const n=r.index,s=e??this._blocks.length;return this._blocks.slice(n,s).forEach(u=>{if(!u.lazy||e!=null){var l;t.aggregate(u._appendPlaceholder((l=u._blocks)==null?void 0:l.length))}}),t}_mapPosToBlock(e){let t="";for(let r=0;r<this._blocks.length;++r){const n=this._blocks[r],s=t.length;if(t+=n.displayValue,e<=t.length)return{index:r,offset:e-s}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,r)=>t+=r.displayValue.length,0)}_forEachBlocksInRange(e,t,r){t===void 0&&(t=this.displayValue.length);const n=this._mapPosToBlock(e);if(n){const s=this._mapPosToBlock(t),u=s&&n.index===s.index,l=n.offset,f=s&&u?s.offset:this._blocks[n.index].displayValue.length;if(r(this._blocks[n.index],n.index,l,f),s&&!u){for(let i=n.index+1;i<s.index;++i)r(this._blocks[i],i,0,this._blocks[i].displayValue.length);r(this._blocks[s.index],s.index,0,s.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const r=super.remove(e,t);return this._forEachBlocksInRange(e,t,(n,s,u,l)=>{r.aggregate(n.remove(u,l))}),r}nearestInputPos(e,t){if(t===void 0&&(t=L.NONE),!this._blocks.length)return 0;const r=new ja(this,e);if(t===L.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(t===L.LEFT||t===L.FORCE_LEFT){if(t===L.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),t===L.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=e||(r.popState(),r.ok&&r.pos<=e))return r.pos;r.popState()}return r.ok?r.pos:t===L.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return t===L.RIGHT||t===L.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:t===L.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,L.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let r=0;return this._forEachBlocksInRange(e,t,(n,s,u,l)=>{r+=n.totalInputPositions(u,l)}),r}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(r=>this._blocks[r]):[]}pad(e){const t=new K;return this._forEachBlocksInRange(0,this.displayValue.length,r=>t.aggregate(r.pad(e))),t}}re.DEFAULTS={...te.DEFAULTS,lazy:!0,placeholderChar:"_"},re.STOP_CHAR="`",re.ESCAPE_CHAR="\\",re.InputDefinition=Xe,re.FixedDefinition=z0,q.MaskedPattern=re;class Ye extends re{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:r=this.from||0,maxLength:n=this.maxLength||0,autofix:s=this.autofix,...u}=e;this.to=t,this.from=r,this.maxLength=Math.max(String(t).length,n),this.autofix=s;const l=String(this.from).padStart(this.maxLength,"0"),f=String(this.to).padStart(this.maxLength,"0");let i=0;for(;i<f.length&&f[i]===l[i];)++i;u.mask=f.slice(0,i).replace(/0/g,"\\0")+"0".repeat(this.maxLength-i),super._update(u)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",r="";const[,n,s]=e.match(/^(\D*)(\d*)(\D*)/)||[];return s&&(t="0".repeat(n.length)+s,r="9".repeat(n.length)+s),t=t.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[t,r]}doPrepareChar(e,t){t===void 0&&(t={});let r;return[e,r]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(r.skip=!this.isComplete),[e,r]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[s,u]=this.boundaries(this.value+e);return Number(u)<this.from?super._appendCharRaw(r[this.value.length],t):Number(s)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(n[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(t.search(/[^0]/)===-1&&t.length<=this._matchFrom)return!0;const[n,s]=this.boundaries(t);return this.from<=Number(s)&&Number(n)<=this.to&&super.doValidate(e)}pad(e){const t=new K;if(this.value.length===this.maxLength)return t;const r=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let s=0;s<n;++s)t.aggregate(super._appendCharRaw("0",e));r.split("").forEach(s=>this._appendCharRaw(s))}return t}}q.MaskedRange=Ye;const Wa="d{.}`m{.}`Y";class ge extends re{static extractPatternOptions(e){const{mask:t,pattern:r,...n}=e;return{...n,mask:ke(t)?t:r}}constructor(e){super(ge.extractPatternOptions({...ge.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:r,blocks:n,...s}={...ge.DEFAULTS,...e},u=Object.assign({},ge.GET_DEFAULT_BLOCKS());e.min&&(u.Y.from=e.min.getFullYear()),e.max&&(u.Y.to=e.max.getFullYear()),e.min&&e.max&&u.Y.from===u.Y.to&&(u.m.from=e.min.getMonth()+1,u.m.to=e.max.getMonth()+1,u.m.from===u.m.to&&(u.d.from=e.min.getDate(),u.d.to=e.max.getDate())),Object.assign(u,this.blocks,n),super._update({...s,mask:ke(t)?t:r,blocks:u})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&t!=null&&(this.min==null||this.min<=t)&&(this.max==null||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(ge.extractPatternOptions(e))}}ge.GET_DEFAULT_BLOCKS=()=>({d:{mask:Ye,from:1,to:31,maxLength:2},m:{mask:Ye,from:1,to:12,maxLength:2},Y:{mask:Ye,from:1900,to:9999}}),ge.DEFAULTS={...re.DEFAULTS,mask:Date,pattern:Wa,format:(o,e)=>{if(!o)return"";const t=String(o.getDate()).padStart(2,"0"),r=String(o.getMonth()+1).padStart(2,"0"),n=o.getFullYear();return[t,r,n].join(".")},parse:(o,e)=>{const[t,r,n]=o.split(".").map(Number);return new Date(n,r-1,t)}},q.MaskedDate=ge;class Qe extends te{constructor(e){super({...Qe.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(t=>{const{expose:r,...n}=Le(t),s=Ce({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...n});return r&&(this.exposeMask=s),s}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const r=this._applyDispatch(e,t);return this.currentMask&&r.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),r}_applyDispatch(e,t,r){e===void 0&&(e=""),t===void 0&&(t={}),r===void 0&&(r="");const n=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,s=this.rawInputValue,u=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:s,l=s.slice(u.length),f=this.currentMask,i=new K,x=f==null?void 0:f.state;return this.currentMask=this.doDispatch(e,{...t},r),this.currentMask&&(this.currentMask!==f?(this.currentMask.reset(),u&&(this.currentMask.append(u,{raw:!0}),i.tailShift=this.currentMask.value.length-n.length),l&&(i.tailShift+=this.currentMask.append(l,{raw:!0,tail:!0}).tailShift)):x&&(this.currentMask.state=x)),i}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new K;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,r;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((r=e._beforeTailState)==null?void 0:r.currentMask)||e._beforeTailState}}doDispatch(e,t,r){return t===void 0&&(t={}),r===void 0&&(r=""),this.dispatch(e,this,t,r)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[r,n]=super.doPrepare(e,t);if(this.currentMask){let s;[r,s]=super.doPrepare(r,this.currentMaskFlags(t)),n=n.aggregate(s)}return[r,n]}doPrepareChar(e,t){t===void 0&&(t={});let[r,n]=super.doPrepareChar(e,t);if(this.currentMask){let s;[r,s]=super.doPrepareChar(r,this.currentMaskFlags(t)),n=n.aggregate(s)}return[r,n]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,t){const r=new K;return this.currentMask&&r.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),r}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:r,currentMask:n,...s}=e;t&&this.compiledMasks.forEach((u,l)=>u.state=t[l]),r!=null&&(this.currentMask=r,this.currentMask.state=n),super.state=s}extractInput(e,t,r){return this.currentMask?this.currentMask.extractInput(e,t,r):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,r)=>{if(!e[r])return;const{mask:n,...s}=e[r];return We(t,s)&&t.maskEquals(n)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}Qe.DEFAULTS={...te.DEFAULTS,dispatch:(o,e,t,r)=>{if(!e.compiledMasks.length)return;const n=e.rawInputValue,s=e.compiledMasks.map((u,l)=>{const f=e.currentMask===u,i=f?u.displayValue.length:u.nearestInputPos(u.displayValue.length,L.FORCE_LEFT);return u.rawInputValue!==n?(u.reset(),u.append(n,{raw:!0})):f||u.remove(i),u.append(o,e.currentMaskFlags(t)),u.appendTail(r),{index:l,weight:u.rawInputValue.length,totalInputPositions:u.totalInputPositions(0,Math.max(i,u.nearestInputPos(u.displayValue.length,L.FORCE_LEFT)))}});return s.sort((u,l)=>l.weight-u.weight||l.totalInputPositions-u.totalInputPositions),e.compiledMasks[s[0].index]}},q.MaskedDynamic=Qe;class Je extends re{constructor(e){super({...Je.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...r}=e;if(t){const n=t.map(l=>l.length),s=Math.min(...n),u=Math.max(...n)-s;r.mask="*".repeat(s),u&&(r.mask+="["+"*".repeat(u)+"]"),this.enum=t}super._update(r)}_appendCharRaw(e,t){t===void 0&&(t={});const r=Math.min(this.nearestInputPos(0,L.FORCE_RIGHT),this.value.length),n=this.enum.filter(s=>this.matchValue(s,this.unmaskedValue+e,r));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(u,l)=>{const f=n[0][l];l>=this.value.length||f===u.value||(u.reset(),u._appendChar(f,t))});const s=super._appendCharRaw(n[0][this.value.length],t);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(u=>s.aggregate(super._appendCharRaw(u))),s}return new K({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new fe("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new K;const r=Math.min(super.nearestInputPos(0,L.FORCE_RIGHT),this.value.length);let n;for(n=e;n>=0&&!(this.enum.filter(l=>this.matchValue(l,this.value.slice(r,n),r)).length>1);--n);const s=super.remove(n,t);return s.tailShift+=n-e,s}get isComplete(){return this.enum.indexOf(this.value)>=0}}Je.DEFAULTS={...re.DEFAULTS,matchValue:(o,e,t)=>o.indexOf(e,t)===t},q.MaskedEnum=Je;class Ga extends te{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}q.MaskedFunction=Ga;var U0;class ie extends te{constructor(e){super({...ie.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",r=(this.scale?"("+$t(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map($t).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp($t(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){t===void 0&&(t={});const[r,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!r&&(n.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&n.aggregate(this._appendChar("-")),[r,n]}_separatorsCount(e,t){t===void 0&&(t=!1);let r=0;for(let n=0;n<e;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++r,t&&(e+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,r))}_appendCharRaw(e,t){t===void 0&&(t={});const r=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const s=this._value;this._value+=e;const u=this.number;let l=!isNaN(u),f=!1;if(l){let c;this.min!=null&&this.min<0&&this.number<this.min&&(c=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(c=this.max),c!=null&&(this.autofix?(this._value=this.format(c,this).replace(ie.UNMASKED_RADIX,this.radix),f||(f=s===this._value&&!t.tail)):l=!1),l&&(l=!!this._value.match(this._numberRegExp))}let i;l?i=new K({inserted:this._value.slice(s.length),rawInserted:f?"":e,skip:f}):(this._value=s,i=new K),this._value=this._insertThousandsSeparators(this._value);const x=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,v=this._separatorsCountFromSlice(x);return i.tailShift+=(v-n)*this.thousandsSeparator.length,i}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,t);if(r<=e)return r}return-1}_adjustRangeWithSeparators(e,t){const r=this._findSeparatorAround(e);r>=0&&(e=r);const n=this._findSeparatorAround(t);return n>=0&&(t=n+this.thousandsSeparator.length),[e,t]}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const r=this.value.slice(0,e),n=this.value.slice(t),s=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+n));const u=this._separatorsCountFromSlice(r);return new K({tailShift:(u-s)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case L.NONE:case L.LEFT:case L.FORCE_LEFT:{const r=this._findSeparatorAround(e-1);if(r>=0){const n=r+this.thousandsSeparator.length;if(e<n||this.value.length<=n||t===L.FORCE_LEFT)return r}break}case L.RIGHT:case L.FORCE_RIGHT:{const r=this._findSeparatorAround(e);if(r>=0)return r+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;this.min!=null&&(t=Math.max(t,this.min)),this.max!=null&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(r,n,s,u)=>n+u),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,r){t===void 0&&(t={});const n=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===ie.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,r)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ie.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(ie.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||ie.EMPTY_VALUES.includes(e)&&ie.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}U0=ie,ie.UNMASKED_RADIX=".",ie.EMPTY_VALUES=[...te.EMPTY_VALUES,0],ie.DEFAULTS={...te.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[U0.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:o=>o.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},q.MaskedNumber=ie;const zt={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function q0(o,e,t){e===void 0&&(e=zt.MASKED),t===void 0&&(t=zt.MASKED);const r=Ce(o);return n=>r.runIsolated(s=>(s[e]=n,s[t]))}function Za(o,e,t,r){return q0(e,t,r)(o)}q.PIPE_TYPE=zt,q.createPipe=q0,q.pipe=Za;class Xa extends re{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,r,n;const{repeat:s,...u}=Le(e);this._blockOpts=Object.assign({},this._blockOpts,u);const l=Ce(this._blockOpts);this.repeat=(t=(r=s??l.repeat)!=null?r:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((n=this._blocks)==null?void 0:n.length)||0,this.repeatFrom)),blocks:{m:l},eager:l.eager,overwrite:l.overwrite,skipInvalid:l.skipInvalid,lazy:l.lazy,placeholderChar:l.placeholderChar,displayChar:l.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(Ce(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const r=new K;for(let f=(n=(s=this._mapPosToBlock(this.displayValue.length))==null?void 0:s.index)!=null?n:Math.max(this._blocks.length-1,0),i,x;i=(u=this._blocks[f])!=null?u:x=!x&&this._allocateBlock(f);++f){var n,s,u,l;const v=i._appendChar(e,{...t,_beforeTailState:(l=t._beforeTailState)==null||(l=l._blocks)==null?void 0:l[f]});if(v.skip&&x){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(v),v.consumed)break}return r}_trimEmptyTail(e,t){var r,n;e===void 0&&(e=0);const s=Math.max(((r=this._mapPosToBlock(e))==null?void 0:r.index)||0,this.repeatFrom,0);let u;t!=null&&(u=(n=this._mapPosToBlock(t))==null?void 0:n.index),u==null&&(u=this._blocks.length-1);let l=0;for(let f=u;s<=f&&!this._blocks[f].unmaskedValue;--f,++l);l&&(this._blocks.splice(u-l+1,l),this.mask=this.mask.slice(l))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const r=super.remove(e,t);return this._trimEmptyTail(e,t),r}totalInputPositions(e,t){return e===void 0&&(e=0),t==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}q.RepeatBlock=Xa;try{globalThis.IMask=q}catch{}const Ya={key:0,class:"mb-0 text-body-2xs font-normal text-heading-text"},Qa={key:0,class:"text-orange-required"},Ja=["type","value","disabled","mask","placeholder","inputmode"],en={key:1,class:"animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"},tn={key:1,class:"text-body-3xs text-light-copy"},rn={key:2,class:"text-body-3xs text-red-500"},ce=a.defineComponent({__name:"input",props:{label:{default:""},type:{default:"text"},placeholder:{default:void 0},validationError:{default:""},hint:{default:""},mask:{default:""},rules:{default:()=>[]},isAmountInput:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},showCopyIcon:{type:Boolean,default:!1},preventPaste:{type:Boolean,default:!1},modelValue:{default:void 0},defaultValue:{default:""},className:{default:""}},emits:["update:modelValue","blur","copied"],setup(o,{emit:e}){const t=o,r=e,n=a.computed(()=>t.modelValue!==void 0),s=a.ref(t.modelValue??t.defaultValue??""),u=a.ref(""),l=a.ref(""),f=a.ref(null);let i=null;a.watch(()=>t.modelValue,h=>{n.value&&(s.value=h??"",i&&i.value!==(h??"")&&(i.value=h??""))});const x=a.computed(()=>t.isAmountInput?we(s.value.replace(/,/g,"")):s.value);function v(h){const F=h.target.value.replace(/,/g,"");n.value||(s.value=F),r("update:modelValue",F),a.nextTick(()=>{const b=f.value;if(b){const D=b.value.length;b.setSelectionRange(D,D)}})}function c(){r("blur",s.value)}function C(h){t.rules.includes("numeric")&&ir(h)}function d(h){t.preventPaste&&(h.preventDefault(),u.value="",l.value="Pasting is disabled for this input")}const g=a.computed(()=>t.disabled?"bg-grey-50 cursor-not-allowed":"bg-white"),p=a.computed(()=>t.validationError||l.value?"border-red-300 bg-red-50":"border-grey-100");function _(h){return navigator.clipboard.writeText(h)}function m(){_(s.value).then(()=>{l.value="",u.value="Text copied to clipboard",r("copied")}).catch(()=>{u.value="",l.value="Failed to copy text to clipboard"})}return a.onMounted(()=>{if(!f.value)return;const h=t.mask?{mask:t.mask}:void 0;h&&(i=q(f.value,h),s.value&&(i.value=s.value),i.on("accept",()=>{const B=(i==null?void 0:i.value)??"";n.value||(s.value=B),r("update:modelValue",B),a.nextTick(()=>{const F=f.value;if(F){const b=F.value.length;F.setSelectionRange(b,b)}})}))}),a.onBeforeUnmount(()=>{i==null||i.destroy(),i=null}),(h,B)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["flex flex-col gap-2",h.className])},[h.label?(a.openBlock(),a.createElementBlock("p",Ya,[a.createTextVNode(a.toDisplayString(h.label)+" ",1),h.required?(a.openBlock(),a.createElementBlock("span",Qa," *")):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["border-c px-3 py-2 flex items-center justify-between rounded-md h-12",g.value,p.value])},[a.renderSlot(h.$slots,"prefix"),a.createElementVNode("input",{ref_key:"inputEl",ref:f,type:h.type,value:x.value,disabled:h.disabled,mask:h.mask,placeholder:h.placeholder??(h.label?`Enter ${h.label.toLowerCase()}`:void 0),inputmode:h.isAmountInput?"decimal":void 0,class:"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full",onInput:v,onBlur:c,onKeydown:C,onPaste:d},null,40,Ja),h.loading?(a.openBlock(),a.createElementBlock("div",en)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(h.$slots,"suffix"),h.showCopyIcon&&s.value.trim()!==""?(a.openBlock(),a.createBlock(_e,{key:0,src:"assets/images/copyIcon.svg",alt:"copy",width:16,height:16,customClass:"cursor-pointer hover:opacity-70 transition-opacity",onClick:m})):a.createCommentVNode("",!0)],64))],2),h.hint||u.value?(a.openBlock(),a.createElementBlock("p",tn,a.toDisplayString(u.value||h.hint),1)):a.createCommentVNode("",!0),h.validationError||l.value?(a.openBlock(),a.createElementBlock("p",rn,a.toDisplayString(l.value||h.validationError),1)):a.createCommentVNode("",!0)],2))}}),an=["width","height"],nn={opacity:"0.6"},sn=["fill"],on=a.defineComponent({__name:"icon-chevron-down",props:{width:{default:24},height:{default:24},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("g",nn,[a.createElementVNode("path",{d:"M16.5813 7.83128L10.3313 14.0813C10.2434 14.1691 10.1242 14.2184 10 14.2184C9.87581 14.2184 9.75667 14.1691 9.66878 14.0813L3.41878 7.83128C3.33598 7.74242 3.2909 7.62489 3.29304 7.50345C3.29518 7.38201 3.34438 7.26615 3.43026 7.18026C3.51615 7.09438 3.63201 7.04518 3.75345 7.04304C3.87489 7.0409 3.99242 7.08598 4.08128 7.16878L10 13.0867L15.9188 7.16878C16.0076 7.08598 16.1252 7.0409 16.2466 7.04304C16.368 7.04518 16.4839 7.09438 16.5698 7.18026C16.6557 7.26615 16.7049 7.38201 16.707 7.50345C16.7092 7.62489 16.6641 7.74242 16.5813 7.83128Z",fill:a.unref(s)},null,8,sn)])],16,an))}}),ln=["width","height"],un={opacity:"0.7"},cn=["fill"],dn=a.defineComponent({__name:"icon-chevron-up",props:{width:{default:24},height:{default:24},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("g",un,[a.createElementVNode("path",{d:"M2.73508 9.73495L7.73508 4.73495C7.80539 4.66473 7.9007 4.62528 8.00008 4.62528C8.09945 4.62528 8.19476 4.66473 8.26508 4.73495L13.2651 9.73495C13.3313 9.80604 13.3674 9.90006 13.3657 9.99722C13.364 10.0944 13.3246 10.1871 13.2559 10.2558C13.1872 10.3245 13.0945 10.3638 12.9973 10.3655C12.9002 10.3673 12.8062 10.3312 12.7351 10.265L8.00008 5.53058L3.26508 10.265C3.19399 10.3312 3.09997 10.3673 3.00282 10.3655C2.90566 10.3638 2.81297 10.3245 2.74427 10.2558C2.67556 10.1871 2.6362 10.0944 2.63449 9.99722C2.63277 9.90006 2.66884 9.80604 2.73508 9.73495Z",fill:a.unref(s)},null,8,cn)])],16,ln))}}),xn={class:"mb-0 text-body-3xs font-medium text-orange-500"},hn=a.defineComponent({__name:"hint",props:{hint:{}},setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("p",xn,a.toDisplayString(e.hint),1))}}),fn={key:0,class:"mb-0 text-body-2xs font-normal text-heading-text"},pn={key:0,class:"text-orange-required"},mn=["aria-expanded","aria-controls","aria-disabled","aria-activedescendant"],vn={class:"flex items-center gap-2"},Cn={class:"flex items-center gap-2"},gn={key:0,class:"inline-block h-4 w-4 border-2 border-current border-t-transparent rounded-full animate-spin"},En=["aria-label"],Bn={key:0,class:"px-4 pt-2 pb-1"},_n=["placeholder"],yn=["onClick","id","aria-selected"],kn={class:"mb-0 text-body-2xs font-medium"},et=a.defineComponent({__name:"select",props:{options:{default:()=>[]},modelValue:{default:void 0},defaultValue:{default:void 0},className:{default:""},placeholder:{default:"Select an option"},hasSearch:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},validationError:{default:""},label:{default:""},hint:{default:""},required:{type:Boolean,default:!1},itemImageType:{default:null}},emits:["update:modelValue","change"],setup(o,{emit:e}){const t=o,r=e,n=a.ref(!1),s=a.ref(t.defaultValue??t.modelValue??""),u=a.ref([...t.options]),l=a.ref(-1),f=a.ref(null),i=a.ref(null),x=a.ref(null),v=a.computed(()=>t.modelValue!==void 0);a.watch(()=>t.modelValue,y=>{v.value&&(s.value=y??"")}),a.watch(()=>t.options,y=>{u.value=[...y]},{immediate:!0});const c=a.computed(()=>{const y=v.value?t.modelValue:s.value;return t.options.find(R=>R.value===y)??null}),C=a.computed(()=>{var y;return((y=c.value)==null?void 0:y.label)||t.placeholder||(t.label?`Select ${t.label}`:"Select an option")});function d(){if(t.disabled||n.value)return;u.value=[...t.options];const y=c.value?Math.max(0,t.options.findIndex(R=>R.value===c.value.value)):0;l.value=y,n.value=!0,a.nextTick(()=>{t.hasSearch&&x.value&&(x.value.focus(),x.value.select())})}function g(){n.value&&(n.value=!1,l.value=-1)}function p(){t.disabled||(n.value?g():d())}function _(y){if(!n.value)return;const R=y.target,I=f.value,N=i.value;I&&!I.contains(R)&&N&&!N.contains(R)&&g()}a.watch(n,y=>{y?document.addEventListener("mousedown",_):document.removeEventListener("mousedown",_)}),a.onBeforeUnmount(()=>document.removeEventListener("mousedown",_));function m(y){v.value||(s.value=y),r("update:modelValue",y),r("change",y),g()}function h(y){const R=y.target.value.toLowerCase(),I=t.options.filter(N=>N.label.toLowerCase().includes(R));u.value=I,l.value=I.length?0:-1}function B(y){if(!t.disabled)switch(y.key){case"Enter":case" ":case"Spacebar":case"ArrowDown":y.preventDefault(),n.value?b(1):d();break;case"ArrowUp":y.preventDefault(),n.value?b(-1):d();break;case"Escape":n.value&&(y.preventDefault(),g());break}}function F(y){switch(y.key){case"ArrowDown":y.preventDefault(),b(1);break;case"ArrowUp":y.preventDefault(),b(-1);break;case"Home":y.preventDefault(),l.value=u.value.length?0:-1,D(0);break;case"End":y.preventDefault(),l.value=u.value.length-1,D(u.value.length-1);break;case"Enter":if(y.preventDefault(),l.value>=0){const R=u.value[l.value];R&&m(R.value)}break;case"Escape":y.preventDefault(),g();break;case"Tab":g();break}}function b(y){if(!u.value.length)return;const R=u.value.length-1,I=l.value<0?0:Math.min(R,Math.max(0,l.value+y));l.value=I,D(I)}function D(y){var N;const R=i.value;if(!R)return;const I=R.querySelectorAll("[data-option]");y>=0&&y<I.length&&((N=I[y])==null||N.scrollIntoView({block:"nearest"}))}const V=a.computed(()=>t.disabled?"bg-grey-100 cursor-not-allowed":"bg-white"),M=a.computed(()=>t.validationError?"border-red-300":"border-grey-100 bg-white"),{options:A,placeholder:w,hasSearch:S,disabled:E,loading:k,validationError:T,label:O,hint:U,required:H,itemImageType:$,className:P}=a.toRefs(t);return(y,R)=>{var I;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["flex flex-col gap-2 relative",a.unref(P)])},[a.unref(O)?(a.openBlock(),a.createElementBlock("p",fn,[a.createTextVNode(a.toDisplayString(a.unref(O))+" ",1),a.unref(H)?(a.openBlock(),a.createElementBlock("span",pn," *")):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{ref_key:"triggerRef",ref:f,class:a.normalizeClass(["border-c rounded-md flex items-center justify-between h-12 cursor-pointer px-3 py-2",V.value,M.value]),role:"combobox","aria-haspopup":"listbox","aria-expanded":n.value,"aria-controls":n.value?"select-menu":void 0,"aria-disabled":a.unref(E)||void 0,"aria-activedescendant":n.value&&l.value>=0?`option-${l.value}`:void 0,tabindex:"0",onClick:p,onKeydown:B},[a.createElementVNode("div",vn,[a.renderSlot(y.$slots,"prefix"),a.createElementVNode("div",Cn,[c.value&&a.unref($)==="country"&&c.value.countryCode?(a.openBlock(),a.createBlock(_e,{key:0,src:`https://flagcdn.com/w40/${c.value.countryCode.toLowerCase()}.png`,alt:c.value.countryCode,width:28,customClass:"rounded-lg"},null,8,["src","alt"])):a.createCommentVNode("",!0),a.createElementVNode("p",{class:a.normalizeClass(["text-body-2xs font-normal mb-0",(I=c.value)!=null&&I.label?"text-sub-copy":"text-grey-500"])},a.toDisplayString(C.value),3)])]),a.unref(k)?(a.openBlock(),a.createElementBlock("span",gn)):n.value?(a.openBlock(),a.createBlock(dn,{key:1,color:"#8FAECA"})):(a.openBlock(),a.createBlock(on,{key:2,color:"#8FAECA"}))],42,mn),n.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"menuRef",ref:i,id:"select-menu",class:"border-c bg-white rounded-md border-grey-border text-body-xs font-normal text-input-grey w-full mt-2 max-h-22rem overflow-y-auto",role:"listbox","aria-label":a.unref(O)||"Options",style:{position:"absolute",top:"100%",zIndex:10},onKeydown:F},[a.unref(S)?(a.openBlock(),a.createElementBlock("div",Bn,[a.createElementVNode("input",{ref_key:"searchRef",ref:x,type:"text",placeholder:`Search ${a.unref(O)||"options"}`,class:"bg-transparent outline-none border-b pb-2 w-full focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal",onInput:h},null,40,_n)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(u.value,(N,X)=>{var Z;return a.openBlock(),a.createElementBlock("div",{key:N.value,onClick:J=>m(N.value),id:`option-${X}`,"data-option":"",role:"option","aria-selected":((Z=c.value)==null?void 0:Z.value)===N.value,class:a.normalizeClass(["px-4 py-3 first:pt-0 hover:bg-gray-100 flex items-center gap-2 cursor-pointer",X===l.value?"bg-gray-100":""])},[a.unref($)==="country"&&N.countryCode?(a.openBlock(),a.createBlock(_e,{key:0,src:`https://flagcdn.com/w40/${N.countryCode.toLowerCase()}.png`,alt:N.countryCode,width:28,customClass:"rounded-lg"},null,8,["src","alt"])):a.createCommentVNode("",!0),a.createElementVNode("p",kn,a.toDisplayString(N.label),1)],10,yn)}),128))],40,En)):a.createCommentVNode("",!0),a.unref(U)?(a.openBlock(),a.createBlock(hn,{key:2,hint:a.unref(U)},null,8,["hint"])):a.createCommentVNode("",!0),a.unref(T)?(a.openBlock(),a.createBlock(Zt,{key:3,errorMessage:a.unref(T)},null,8,["errorMessage"])):a.createCommentVNode("",!0)],2)}}}),An={class:"flex flex-col gap-6"},bn={key:0,class:"grid grid-cols-2 gap-6 overflow-y-auto"},Fn={class:"col-span-2"},Dn={class:"col-span-2"},wn={key:1,class:"grid grid-cols-2 gap-6 overflow-y-auto",style:{maxHeight:"320px"}},Sn={class:"col-span-2"},Vn={class:"col-span-2"},Nn=a.defineComponent({__name:"pay-by-card",props:{secretKey:{},paymentObject:{},environment:{},onPaymentAuthorized:{type:Function},onError:{type:Function}},setup(o){const e=o,t=e.environment??"sandbox",r=a.ref(0),n=a.ref(""),s=a.ref(!1),u=a.ref(!1),l=a.ref(""),f=a.ref(""),i=a.ref(!1),x=a.ref(!1),v=a.ref([]),c=a.ref([]),C=a.ref([]),d=a.reactive({address1:"",address2:"",postalCode:"",state:"",city:"",country:"",emailAddress:"",phoneNumber:""}),g=a.reactive({customerName:"",cardNo:"",expireDate:"",cvv:"",cardPin:""}),p=a.reactive({}),_=a.reactive({}),m=a.reactive({address1:"required",address2:"",country:"required",state:"required",city:"required",postalCode:"required|no_special|char_length:6",emailAddress:"required|email",phoneNumber:"required"}),h=a.reactive({customerName:"required",cardNo:"required|num_spaces",expireDate:"required",cvv:"required|numeric",cardPin:""}),B={address1:"Address Line 1",address2:"Address Line 2",postalCode:"Postal Code",state:"State",city:"City",country:"Country",emailAddress:"Email",phoneNumber:"Phone Number"},F={customerName:"Card Name",cardNo:"Card Number",expireDate:"Expiry Date",cvv:"CVV",cardPin:"Card PIN"},b=a.computed(()=>we(e.paymentObject.amount,e.paymentObject.currency));async function D(){var S,E,k,T,O,U,H,$,P,y,R,I,N,X,Z,J,j,Ae,Ee,Me,be,ne,ae,Ie,Fe,Te;if(r.value===0){const he=je(d,m,B);Object.assign(p,he),Object.keys(he).length===0&&(r.value=1);return}if(r.value===1){const he=je(g,h,F);if(Object.assign(_,he),Object.keys(he).length>0)return;try{s.value=!0,n.value="";const Y={pan:g.cardNo??"",expiryDate:g.expireDate??"",cvv:g.cvv??"",cardScheme:l.value,nameOnCard:g.customerName??"",...l.value==="Verve"?{pin:g.cardPin??""}:{}},se={address1:d.address1??"",address2:d.address2??"",postalCode:d.postalCode??"",state:d.state??"",city:d.city??"",country:d.country??"",emailAddress:d.emailAddress??"",phoneNumber:d.phoneNumber??""},ee=Ta(e.secretKey,Y),pe={...{customerId:((S=e.paymentObject)==null?void 0:S.email)||g.customerName||"",amount:String(((E=e.paymentObject)==null?void 0:E.amount)??""),currency:((k=e.paymentObject)==null?void 0:k.currency)||"USD",narration:((T=e.paymentObject)==null?void 0:T.narration)||"Test transaction",encryptedCardDetails:ee.requestParam,billingDetails:se,redirectUrl:((O=e.paymentObject)==null?void 0:O.redirectUrl)||"",paymentReference:f.value,isCheckout:!0},merchantId:e.secretKey};let z=await Rr(t,pe);if(z!=null&&z.responseParam&&(z=M0(t,z.responseParam)),z!=null&&z.isSuccessful){if(z.threeDsInteractionRequired===!0){const Pe={transactionReference:z.transactionReference,threeDsHtml:z.threeDsHtml,amount:z.amount,responseMessage:z.responseMessage,paReq:(U=z.threeDsHtml)==null?void 0:U.paReq,termUrl:(H=z.threeDsHtml)==null?void 0:H.termUrl,action:($=z.threeDsHtml)==null?void 0:$.action,acsUrl:(P=z.threeDsHtml)==null?void 0:P.acsUrl,md:(y=z.threeDsHtml)==null?void 0:y.md},me=btoa(JSON.stringify(Pe)),Be=`https://sandbox-merchant.buzapay.com/account/three-ds-confirm?threeDsData=${encodeURIComponent(me)}&paymentReference=${z.transactionReference}`;window.open(Be,"_self","noopener,noreferrer"),n.value="3D Secure authentication opened in new tab. Please complete the verification",s.value=!1;return}if(z.responseMessage==="Payer Interaction Required"&&z.threeDsHtml){const Pe={transactionReference:z.transactionReference,threeDsHtml:z.threeDsHtml,amount:z.amount,responseMessage:z.responseMessage,paReq:(R=z.threeDsHtml)==null?void 0:R.paReq,termUrl:(I=z.threeDsHtml)==null?void 0:I.termUrl,action:(N=z.threeDsHtml)==null?void 0:N.action,acsUrl:(X=z.threeDsHtml)==null?void 0:X.acsUrl,md:(Z=z.threeDsHtml)==null?void 0:Z.md},me=btoa(JSON.stringify(Pe)),Be=`https://sandbox-merchant.buzapay.com/account/three-ds-confirm?threeDsData=${encodeURIComponent(me)}&paymentReference=${z.transactionReference}`;window.open(Be,"_self","noopener,noreferrer"),n.value="3D Secure authentication opened in new tab. Please complete the verification",s.value=!1;return}(J=z.transactionReference)!=null&&J.trim()&&((Ae=e.onPaymentAuthorized)==null||Ae.call(e,{paymentId:z.transactionReference,paymentDate:(j=z==null?void 0:z.data)==null?void 0:j.updatedAt,paymentStatus:"authorized",message:n.value})),n.value="Card payment authorized successfully",s.value=!1;return}n.value=(z==null?void 0:z.responseMessage)||"Payment failed",(Me=e.onPaymentAuthorized)==null||Me.call(e,{paymentId:z==null?void 0:z.transactionReference,paymentDate:(Ee=z==null?void 0:z.data)==null?void 0:Ee.updatedAt,paymentStatus:"payment failed",message:n.value}),s.value=!1}catch(Y){let se="Payment failed";if((be=Y==null?void 0:Y.error)!=null&&be.responseParam)try{const ee=M0(t,Y.error.responseParam);se=(ee==null?void 0:ee.responseMessage)||se}catch{se=((ne=Y==null?void 0:Y.error)==null?void 0:ne.responseMessage)||((ae=Y==null?void 0:Y.error)==null?void 0:ae.message)||se}else se=((Ie=Y==null?void 0:Y.error)==null?void 0:Ie.responseMessage)||((Fe=Y==null?void 0:Y.error)==null?void 0:Fe.message)||"Payment failed";n.value=se,s.value=!1,(Te=e.onError)==null||Te.call(e,{errorMessage:n.value})}}}async function V(){var S;if(!e.secretKey){n.value="Secret key is required.";return}if(!He(e.paymentObject)){n.value="Kindly ensure you are passing all the required data.";return}u.value=!0,n.value="";try{const E=await $e(e.paymentObject,t,e.secretKey);if(E!=null&&E.isSuccessful&&E.launchUrl){const k=tt(E.launchUrl);f.value=k.paymentReference,n.value="Payment link created successfully"}else n.value="Failed to create payment link"}catch(E){n.value=(E==null?void 0:E.message)||"Failed to create payment link",(S=e.onError)==null||S.call(e,{errorMessage:n.value})}finally{u.value=!1}}async function M(){var S;i.value=!0;try{const E=await Ma(t,e.secretKey);E!=null&&E.isSuccessful&&(v.value=E.data,c.value=(E.data??[]).map(k=>({label:k.countryName,value:k.iso2})))}catch(E){n.value=(E==null?void 0:E.message)||"Failed to get countries",(S=e.onError)==null||S.call(e,{errorMessage:n.value})}finally{i.value=!1}}async function A(S){var k;const E=v.value.find(T=>T.iso2===S);if(E){x.value=!0;try{const T=await Pa(E.iso3,t,e.secretKey);T!=null&&T.isSuccessful&&(C.value=(T.data??[]).map(O=>({label:O.name,value:O.name})))}catch(T){n.value=(T==null?void 0:T.message)||"Failed to get country states",(k=e.onError)==null||k.call(e,{errorMessage:n.value})}finally{x.value=!1}}}function w(S){l.value=kr(S),h.cardPin=l.value==="Verve"?"required|numeric":""}return a.onMounted(async()=>{await V(),await M()}),(S,E)=>(a.openBlock(),a.createElementBlock("div",An,[r.value===0?(a.openBlock(),a.createElementBlock("div",bn,[a.createElementVNode("div",Fn,[a.createVNode(ce,{label:"Address Line 1",required:"",modelValue:d.address1,"onUpdate:modelValue":[E[0]||(E[0]=k=>d.address1=k),E[1]||(E[1]=k=>{d.address1=k,p.address1&&(p.address1="")})],"validation-error":p.address1??""},null,8,["modelValue","validation-error"])]),a.createElementVNode("div",Dn,[a.createVNode(ce,{label:"Address Line 2",modelValue:d.address2,"onUpdate:modelValue":[E[2]||(E[2]=k=>d.address2=k),E[3]||(E[3]=k=>d.address2=k)],"validation-error":p.address2??""},null,8,["modelValue","validation-error"])]),a.createVNode(et,{label:"Select Country",required:"",options:c.value,loading:i.value,modelValue:d.country,"onUpdate:modelValue":[E[4]||(E[4]=k=>d.country=k),E[5]||(E[5]=async k=>{d.country=k,d.state="",await A(k),p.country&&(p.country="")})],"validation-error":p.country??""},null,8,["options","loading","modelValue","validation-error"]),a.createVNode(et,{label:"Select State",required:"",options:C.value,loading:x.value,modelValue:d.state,"onUpdate:modelValue":[E[6]||(E[6]=k=>d.state=k),E[7]||(E[7]=k=>{d.state=k,p.state&&(p.state="")})],"validation-error":p.state??""},null,8,["options","loading","modelValue","validation-error"]),a.createVNode(ce,{label:"City",required:"",modelValue:d.city,"onUpdate:modelValue":[E[8]||(E[8]=k=>d.city=k),E[9]||(E[9]=k=>{d.city=k,p.city&&(p.city="")})],"validation-error":p.city??""},null,8,["modelValue","validation-error"]),a.createVNode(ce,{label:"Postal Code",required:"",modelValue:d.postalCode,"onUpdate:modelValue":[E[10]||(E[10]=k=>d.postalCode=k),E[11]||(E[11]=k=>{d.postalCode=k,p.postalCode&&(p.postalCode="")})],"validation-error":p.postalCode??""},null,8,["modelValue","validation-error"]),a.createVNode(ce,{label:"Email",required:"",modelValue:d.emailAddress,"onUpdate:modelValue":[E[12]||(E[12]=k=>d.emailAddress=k),E[13]||(E[13]=k=>{d.emailAddress=k,p.emailAddress&&(p.emailAddress="")})],"validation-error":p.emailAddress??""},null,8,["modelValue","validation-error"]),a.createVNode(ce,{label:"Phone Number",required:"",modelValue:d.phoneNumber,"onUpdate:modelValue":[E[14]||(E[14]=k=>d.phoneNumber=k),E[15]||(E[15]=k=>{d.phoneNumber=k,p.phoneNumber&&(p.phoneNumber="")})],"validation-error":p.phoneNumber??""},null,8,["modelValue","validation-error"])])):a.createCommentVNode("",!0),r.value===1?(a.openBlock(),a.createElementBlock("div",wn,[a.createElementVNode("div",Sn,[a.createVNode(ce,{label:"Card Name",required:"",modelValue:g.customerName,"onUpdate:modelValue":[E[16]||(E[16]=k=>g.customerName=k),E[17]||(E[17]=k=>{g.customerName=k,_.customerName&&(_.customerName="")})],"validation-error":_.customerName??""},null,8,["modelValue","validation-error"])]),a.createElementVNode("div",Vn,[a.createVNode(ce,{label:"Card Number",required:"",rules:["numeric"],mask:"0000 0000 0000 0000",placeholder:"0000 0000 0000 0000","prevent-paste":!0,modelValue:g.cardNo,"onUpdate:modelValue":[E[18]||(E[18]=k=>g.cardNo=k),E[19]||(E[19]=k=>{g.cardNo=k,_.cardNo&&(_.cardNo=""),w(k)})],"validation-error":_.cardNo??""},null,8,["modelValue","validation-error"])]),a.createVNode(ce,{label:"Expiry Date",required:"",modelValue:g.expireDate,"onUpdate:modelValue":[E[20]||(E[20]=k=>g.expireDate=k),E[21]||(E[21]=k=>{g.expireDate=k,_.expireDate&&(_.expireDate="")})],mask:"00/00",placeholder:"00/00","validation-error":_.expireDate??""},null,8,["modelValue","validation-error"]),a.createVNode(ce,{label:"CVV",required:"",rules:["numeric"],modelValue:g.cvv,"onUpdate:modelValue":[E[22]||(E[22]=k=>g.cvv=k),E[23]||(E[23]=k=>{g.cvv=k,_.cvv&&(_.cvv="")})],mask:"000",placeholder:"000","validation-error":_.cvv??""},null,8,["modelValue","validation-error"]),l.value==="Verve"?(a.openBlock(),a.createBlock(ce,{key:0,label:"Card Pin",required:"",rules:["numeric"],modelValue:g.cardPin,"onUpdate:modelValue":[E[24]||(E[24]=k=>g.cardPin=k),E[25]||(E[25]=k=>{g.cardPin=k,_.cardPin&&(_.cardPin="")})],mask:"0000",placeholder:"0000","validation-error":_.cardPin??""},null,8,["modelValue","validation-error"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createVNode(Se,{label:r.value===0?"Proceed":`Pay ${b.value}`,type:"primary",customClass:"w-full",loading:s.value,onClick:D,disabled:s.value},null,8,["label","loading","disabled"])]))}}),Rn=["width","height"],In=["fill"],Tn=["fill"],Mn=["fill"],Pn=a.defineComponent({__name:"icon-copy-success",props:{width:{default:16},height:{default:17},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M11.4002 1.6875H8.60016C5.9935 1.6875 4.8335 2.8475 4.8335 5.45417V6.1875C4.8335 6.46083 5.06016 6.6875 5.3335 6.6875H7.40016C9.46683 6.6875 10.1668 7.3875 10.1668 9.45417V11.5208C10.1668 11.7942 10.3935 12.0208 10.6668 12.0208H11.4002C14.0068 12.0208 15.1668 10.8608 15.1668 8.25417V5.45417C15.1668 2.8475 14.0068 1.6875 11.4002 1.6875ZM5.8335 5.6875V5.45417C5.8335 3.3875 6.5335 2.6875 8.60016 2.6875H11.4002C13.4668 2.6875 14.1668 3.3875 14.1668 5.45417V8.25417C14.1668 10.3208 13.4668 11.0208 11.4002 11.0208H11.1668V9.45417C11.1668 6.8475 10.0068 5.6875 7.40016 5.6875H5.8335Z",fill:a.unref(s)},null,8,In),a.createElementVNode("path",{d:"M7.40016 5.6875H4.60016C1.9935 5.6875 0.833496 6.8475 0.833496 9.45417V12.2542C0.833496 14.8608 1.9935 16.0208 4.60016 16.0208H7.40016C10.0068 16.0208 11.1668 14.8608 11.1668 12.2542V9.45417C11.1668 6.8475 10.0068 5.6875 7.40016 5.6875ZM4.60016 15.0208C2.5335 15.0208 1.8335 14.3208 1.8335 12.2542V9.45417C1.8335 7.3875 2.5335 6.6875 4.60016 6.6875H7.40016C9.46683 6.6875 10.1668 7.3875 10.1668 9.45417V12.2542C10.1668 14.3208 9.46683 15.0208 7.40016 15.0208H4.60016Z",fill:a.unref(s)},null,8,Tn),a.createElementVNode("path",{d:"M5.35302 12.6542C5.22635 12.6542 5.09969 12.6075 4.99969 12.5075L3.69969 11.2075C3.50635 11.0142 3.50635 10.6942 3.69969 10.5008C3.89302 10.3075 4.21302 10.3075 4.40635 10.5008L5.35302 11.4475L7.59302 9.2075C7.78635 9.01417 8.10635 9.01417 8.29969 9.2075C8.49302 9.40083 8.49302 9.72083 8.29969 9.91417L5.69969 12.5075C5.60635 12.6008 5.47969 12.6542 5.35302 12.6542Z",fill:a.unref(s)},null,8,Mn)],16,Rn))}}),ze=a.defineComponent({__name:"copy",props:{copyText:{},color:{}},setup(o){const e=o;function t(n){return navigator.clipboard.writeText(n)}function r(){t(e.copyText).then(()=>{}).catch(n=>{console.error("Copy failed:",n)})}return(n,s)=>(a.openBlock(),a.createBlock(Pn,{class:"cursor-pointer",color:n.color,onClick:r},null,8,["color"]))}}),On={class:"flex items-center gap-1"},Hn={key:1,class:"flex items-center justify-between"},$n={class:"flex items-center gap-1"},Ue=a.defineComponent({__name:"label-info",props:{type:{default:"vertical"},label:{default:""},labelCustomClass:{default:"text-body-4xs font-medium text-light-copy"},valueImageSrc:{default:""},valueImageCustomClass:{default:""},valueImagePosition:{default:"prefix"},hasValueCopy:{type:Boolean,default:!1},value:{default:""},valueCustomClass:{default:"text-body-2xs font-medium text-sub-copy"},alignRight:{type:Boolean,default:!1}},setup(o){const e=o,t=a.computed(()=>(e.label??"").toUpperCase()),r=a.computed(()=>!!e.valueImageSrc&&e.valueImagePosition==="prefix"),n=a.computed(()=>!!e.valueImageSrc&&e.valueImagePosition==="suffix"),s=a.computed(()=>sr(e.value,40)),{type:u,labelCustomClass:l,valueImageSrc:f,valueImageCustomClass:i,hasValueCopy:x,value:v,valueCustomClass:c,alignRight:C}=e;return(d,g)=>a.unref(u)==="vertical"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["flex flex-col gap-1",a.unref(C)?"text-right items-end":""])},[a.createElementVNode("p",{class:a.normalizeClass(a.unref(l))},a.toDisplayString(t.value),3),a.createElementVNode("div",On,[r.value?(a.openBlock(),a.createBlock(_e,{key:0,src:a.unref(f),alt:a.unref(v),width:22,customClass:a.unref(i)},null,8,["src","alt","customClass"])):a.createCommentVNode("",!0),a.unref(x)?(a.openBlock(),a.createElementBlock("p",{key:2,class:a.normalizeClass([a.unref(c),"truncate"])},a.toDisplayString(s.value),3)):(a.openBlock(),a.createElementBlock("p",{key:1,class:a.normalizeClass(a.unref(c))},a.toDisplayString(a.unref(v)),3)),a.unref(x)?(a.openBlock(),a.createBlock(ze,{key:3,copyText:a.unref(v),color:"#9DBFDE"},null,8,["copyText"])):a.createCommentVNode("",!0),n.value?(a.openBlock(),a.createBlock(_e,{key:4,src:a.unref(f),alt:a.unref(v),width:22,customClass:a.unref(i)},null,8,["src","alt","customClass"])):a.createCommentVNode("",!0)])],2)):(a.openBlock(),a.createElementBlock("div",Hn,[a.createElementVNode("p",{class:a.normalizeClass(a.unref(l))},a.toDisplayString(t.value),3),a.createElementVNode("div",$n,[r.value?(a.openBlock(),a.createBlock(_e,{key:0,src:a.unref(f),alt:a.unref(v),width:22,customClass:a.unref(i)},null,8,["src","alt","customClass"])):a.createCommentVNode("",!0),a.createElementVNode("p",{class:a.normalizeClass(a.unref(c))},a.toDisplayString(a.unref(v)),3),a.unref(x)?(a.openBlock(),a.createBlock(ze,{key:1,copyText:a.unref(v),color:"#9DBFDE"},null,8,["copyText"])):a.createCommentVNode("",!0),n.value?(a.openBlock(),a.createBlock(_e,{key:2,src:a.unref(f),alt:a.unref(v),width:22,customClass:a.unref(i)},null,8,["src","alt","customClass"])):a.createCommentVNode("",!0)])]))}}),Ln={class:"flex flex-col gap-10"},zn={key:0,class:"flex flex-col gap-10"},Un={key:1,class:"flex flex-col gap-10"},qn={class:"bg-[#EFF7FF] p-4 rounded-lg flex flex-col gap-6"},jn={class:"flex items-center justify-between"},Kn={class:"flex items-center justify-between"},Wn={class:"w-2/3 mx-auto text-center text-body-2xs font-medium text-sub-copy"},Gn={class:"text-orange-500"},Zn={class:"flex flex-col gap-4"},Xn=a.defineComponent({__name:"pay-by-transfer",props:{secretKey:{},paymentObject:{},environment:{},onPaymentAuthorized:{type:Function},onCancel:{type:Function},onError:{type:Function}},setup(o){const e=o,t=e.environment??"sandbox",r=a.ref(0),n=a.ref(!1),s=a.ref(!1),u=a.ref(!1),l=a.ref(""),f=a.ref(""),i=a.ref(!1),x=a.ref(null),v=a.ref(null),c=a.ref(!1),C=a.ref(!1),d=a.ref(""),g=a.ref(60),p=a.ref("00:00"),_=a.ref(null),m=a.reactive({customerName:""}),h=a.reactive({}),B={customerName:"required"},F={customerName:"Customer Name"},b=a.computed(()=>we(e.paymentObject.amount,e.paymentObject.currency));async function D(){var S,E,k,T;if(r.value===0){const O=je(m,B,F);if(Object.assign(h,O),Object.keys(O).length===0){const U={paymentReference:l.value,channel:"virtual_account",customerName:m.customerName??"",merchantId:e.secretKey};n.value=!0;try{const H=await Ir(t,U);if(H!=null&&H.isSuccessful){const $=((S=H.data)==null?void 0:S.data)??H.data??null;v.value=$,w(),d.value="Virtual account generated successfully for payment.",n.value=!0,r.value=1}else n.value=!1,d.value=(H==null?void 0:H.responseMessage)||"Failed to generate account"}catch(H){n.value=!1,d.value=((E=H==null?void 0:H.error)==null?void 0:E.responseMessage)||((k=H==null?void 0:H.error)==null?void 0:k.message)||"Error",(T=e.onError)==null||T.call(e,{errorMessage:d.value})}}return}}async function V(){var S,E,k,T,O,U,H,$;i.value=!0;try{const P=await Xt(t,l.value);if(P!=null&&P.isSuccessful){const y=((S=P.data)==null?void 0:S.data)??P.data??null;x.value=y;const R=(y==null?void 0:y.paymentStatus)==="Payment Received"||(y==null?void 0:y.paymentStatus)==="Received";c.value=R,(y==null?void 0:y.finalTransactionStatus)==null||(y==null?void 0:y.paymentStatus)==null?(s.value&&(d.value="Transaction not confirmed !!"),!u.value&&!R?(f.value="pending",(E=e.onPaymentAuthorized)==null||E.call(e,{paymentId:l.value,paymentDate:y==null?void 0:y.updatedAt,paymentStatus:"pending",message:d.value})):(f.value="confirmed",(k=e.onPaymentAuthorized)==null||k.call(e,{paymentId:l.value,paymentDate:y==null?void 0:y.updatedAt,paymentStatus:"confirmed",message:d.value}))):((y==null?void 0:y.finalTransactionStatus)==="Success"||(y==null?void 0:y.paymentStatus)==="Received"||(y==null?void 0:y.paymentStatus)==="Payment Received")&&(f.value="confirmed",u.value=!0,d.value="Transaction confirmed !!",(T=e.onPaymentAuthorized)==null||T.call(e,{paymentId:l.value,paymentDate:y==null?void 0:y.updatedAt,paymentStatus:"confirmed",message:d.value}))}else!(P!=null&&P.isSuccessful)&&(P==null?void 0:P.responseCode)==="119"&&(f.value="used",d.value=(P==null?void 0:P.responseMessage)||"",(O=e.onPaymentAuthorized)==null||O.call(e,{paymentId:l.value,paymentDate:null,paymentStatus:"used",message:d.value}))}catch(P){f.value="",d.value=((U=P==null?void 0:P.error)==null?void 0:U.responseMessage)||((H=P==null?void 0:P.error)==null?void 0:H.message)||"Something went wrong",($=e.onError)==null||$.call(e,{errorMessage:d.value})}finally{i.value=!1}}async function M(){var S;if(!e.secretKey){d.value="Secret key is required.";return}if(!He(e.paymentObject)){d.value="Kindly ensure you are passing all the required data.";return}C.value=!0,d.value="";try{const E=await $e(e.paymentObject,t,e.secretKey);if(E!=null&&E.isSuccessful&&E.launchUrl){const k=tt(E.launchUrl);l.value=k.paymentReference,d.value="Payment link created successfully"}else d.value="Failed to create payment link"}catch(E){d.value=(E==null?void 0:E.message)||"Failed to create payment link",(S=e.onError)==null||S.call(e,{errorMessage:d.value})}finally{C.value=!1}}function A(S){const E=String(Math.floor(S/60)).padStart(2,"0"),k=String(S%60).padStart(2,"0");p.value=`${E}:${k}`}function w(){_.value&&(clearInterval(_.value),_.value=null),A(g.value),_.value=window.setInterval(()=>{const S=g.value-1;if(S<0){_.value&&(clearInterval(_.value),_.value=null),p.value="00:00",g.value=0;return}g.value=S,A(S)},1e3)}return a.onMounted(async()=>{await M()}),(S,E)=>{var k,T,O,U;return a.openBlock(),a.createElementBlock("div",Ln,[r.value===0?(a.openBlock(),a.createElementBlock("div",zn,[a.createVNode(ce,{label:"Customer Name",required:"",modelValue:m.customerName,"onUpdate:modelValue":[E[0]||(E[0]=H=>m.customerName=H),E[1]||(E[1]=H=>{m.customerName=H,m.customerName&&(h.customerName="")})],validationError:h.customerName??""},null,8,["modelValue","validationError"]),a.createVNode(Se,{label:`Pay ${b.value}`,type:"primary",customClass:"w-full",loading:n.value,onClick:D},null,8,["label","loading"])])):r.value===1?(a.openBlock(),a.createElementBlock("div",Un,[a.createElementVNode("div",qn,[a.createVNode(Ue,{label:"Bank Name",value:`${((k=v.value)==null?void 0:k.bank)??""} ${((T=v.value)==null?void 0:T.accountName)??""}`},null,8,["value"]),a.createElementVNode("div",jn,[a.createVNode(Ue,{label:"Account Number",value:(O=v.value)==null?void 0:O.accountNumber},null,8,["value"]),a.createVNode(ze,{color:"#9DBFDE",copyText:((U=v.value)==null?void 0:U.accountNumber)??""},null,8,["copyText"])]),a.createElementVNode("div",Kn,[a.createVNode(Ue,{label:"Amount",value:b.value},null,8,["value"]),a.createVNode(ze,{color:"#9DBFDE",copyText:b.value},null,8,["copyText"])])]),a.createElementVNode("p",Wn,[E[3]||(E[3]=a.createTextVNode(" This account is for this transaction only and expires in ",-1)),a.createElementVNode("span",Gn,a.toDisplayString(g.value>=0?p.value:"00:00"),1)]),a.createElementVNode("div",Zn,[a.createVNode(Se,{label:"I have paid the money",type:"primary",customClass:"w-full",loading:i.value,onClick:V},null,8,["loading"]),a.createElementVNode("button",{type:"button",onClick:E[2]||(E[2]=H=>{var $;return($=S.onCancel)==null?void 0:$.call(S)}),class:"text-heading-text text-body-2xs font-medium text-center py-2 cursor-pointer"}," Cancel Payment ")])])):a.createCommentVNode("",!0)])}}}),Yn=["width","height"],Qn={"clip-path":"url(#clip0_10908_387048)"},Jn=["fill"],es={id:"clip0_10908_387048"},ts=["fill"],rs=a.defineComponent({__name:"icon-usdc",props:{width:{default:28},height:{default:28},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("g",Qn,[a.createElementVNode("path",{d:"M14 0C21.7324 0 28 6.26763 28 14C28 21.7324 21.7324 28 14 28C6.26763 28 0 21.7324 0 14C0 6.26763 6.26763 0 14 0ZM16.933 4.865C16.7195 4.76 16.506 4.865 16.4535 5.07762C16.4001 5.131 16.4001 5.18438 16.4001 5.29025V6.034L16.4089 6.125C16.4546 6.30501 16.5652 6.46177 16.7195 6.56512C20.8792 8.05262 23.0125 12.6726 21.4655 16.7615C20.6657 18.9928 18.9061 20.6911 16.7195 21.4883C16.506 21.5941 16.4001 21.7534 16.4001 22.0194V22.7631L16.4045 22.8401C16.4128 22.9241 16.4479 23.0033 16.5047 23.0658C16.5614 23.1284 16.6367 23.171 16.7195 23.1875C16.7729 23.1875 16.8796 23.1875 16.933 23.135C18.1331 22.7602 19.2473 22.1517 20.2113 21.3446C21.1753 20.5375 21.9701 19.5476 22.5499 18.432C23.1298 17.3164 23.4833 16.0972 23.59 14.8444C23.6967 13.5917 23.5546 12.3302 23.1718 11.1326C22.2128 8.10512 19.866 5.8205 16.933 4.865ZM11.2805 4.8125C11.2271 4.8125 11.1204 4.8125 11.067 4.865C9.86688 5.23978 8.75274 5.84826 7.78874 6.6554C6.82475 7.46254 6.02993 8.4524 5.45006 9.56797C4.87019 10.6836 4.51673 11.9028 4.41001 13.1556C4.30329 14.4083 4.44543 15.6698 4.82825 16.8674C5.78725 19.8424 8.08062 22.1261 11.067 23.0816C11.2805 23.1875 11.494 23.0816 11.5465 22.869C11.5999 22.8165 11.5999 22.7622 11.5999 22.6564V21.9126L11.5911 21.8426C11.5544 21.6947 11.417 21.5259 11.2805 21.4349C7.12075 19.9474 4.9875 15.3274 6.5345 11.2385C7.33425 9.00725 9.09388 7.30887 11.2805 6.51175C11.494 6.40587 11.5999 6.24663 11.5999 5.98063V5.23688L11.5955 5.15987C11.5872 5.07585 11.5521 4.99673 11.4954 4.93418C11.4386 4.87163 11.3633 4.82898 11.2805 4.8125ZM14.3736 7.574H13.573L13.496 7.581C13.321 7.616 13.1933 7.7665 13.146 7.99925V9.22075L12.9649 9.24875C11.4704 9.51475 10.5341 10.5464 10.5341 11.823C10.5341 13.5748 11.5999 14.2651 13.8399 14.5311C15.3335 14.7963 15.813 15.1156 15.813 15.9653C15.813 16.814 15.0666 17.3985 14.0534 17.3985C12.6665 17.3985 12.187 16.8149 12.0269 16.0177C11.9744 15.806 11.8134 15.6992 11.6532 15.6992H10.7467L10.6776 15.7054C10.5913 15.7193 10.513 15.7641 10.4572 15.8313C10.4014 15.8985 10.3718 15.9838 10.374 16.0711V16.1236L10.4029 16.2811C10.6566 17.5271 11.5106 18.4187 13.2003 18.6734V19.9483L13.2072 20.0252C13.2422 20.1985 13.3936 20.3263 13.6273 20.3726H14.427L14.504 20.3656C14.679 20.3306 14.8067 20.1801 14.854 19.9483V18.6725L15.0351 18.6375C16.534 18.3207 17.5201 17.2366 17.5201 15.8576C17.5201 13.9991 16.4001 13.3621 14.1601 13.0961C12.5598 12.8835 12.2404 12.4591 12.2404 11.7154C12.2404 10.9716 12.7741 10.4939 13.8399 10.4939C14.7998 10.4939 15.3335 10.8124 15.5995 11.6095C15.6272 11.6866 15.6779 11.7533 15.7447 11.8007C15.8115 11.8481 15.8912 11.8739 15.9731 11.8746H16.8262L16.8954 11.8694C16.982 11.8556 17.0606 11.8108 17.1166 11.7434C17.1726 11.6759 17.2022 11.5904 17.1999 11.5027V11.4503L17.1675 11.2989C17.0361 10.755 16.7366 10.2664 16.3115 9.90255C15.8864 9.53872 15.3574 9.31821 14.7997 9.27238V7.99925L14.7928 7.92225C14.7578 7.74812 14.6073 7.62038 14.3736 7.574Z",fill:a.unref(s)},null,8,Jn)]),a.createElementVNode("defs",null,[a.createElementVNode("clipPath",es,[a.createElementVNode("rect",{width:"28",height:"28",fill:a.unref(s)},null,8,ts)])])],16,Yn))}}),as=["width","height"],ns={"clip-path":"url(#clip0_10908_387045)"},ss=["fill"],is={id:"clip0_10908_387045"},os=["fill"],ls=a.defineComponent({__name:"icon-usdt",props:{width:{default:28},height:{default:28},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("g",ns,[a.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 28C6.26763 28 0 21.7324 0 14C0 6.26763 6.26763 0 14 0C21.7324 0 28 6.26763 28 14C28 21.7324 21.7324 28 14 28ZM15.6818 12.0689V9.99863H20.419V6.84162H7.52063V9.99863H12.2579V12.068C8.40787 12.2447 5.5125 13.0077 5.5125 13.9212C5.5125 14.8347 8.40787 15.5969 12.2579 15.7745V22.4088H15.6818V15.7727C19.5256 15.596 22.414 14.8339 22.414 13.9212C22.414 13.0086 19.5256 12.2465 15.6818 12.0689ZM15.6818 15.2101V15.2084C15.5855 15.2154 15.0894 15.2451 13.9825 15.2451C13.0987 15.2451 12.4766 15.2189 12.2579 15.2084V15.211C8.85587 15.0614 6.31662 14.469 6.31662 13.7602C6.31662 13.0524 8.85587 12.46 12.2579 12.3077V14.6212C12.4801 14.637 13.1171 14.6746 13.9974 14.6746C15.0535 14.6746 15.5829 14.6309 15.6818 14.6221V12.3095C19.0768 12.4609 21.6099 13.0532 21.6099 13.7602C21.6099 14.469 19.0768 15.0596 15.6818 15.2101Z",fill:a.unref(s)},null,8,ss)]),a.createElementVNode("defs",null,[a.createElementVNode("clipPath",is,[a.createElementVNode("rect",{width:"28",height:"28",fill:a.unref(s)},null,8,os)])])],16,as))}}),us={key:1,class:"flex items-center gap-1"},Ut=a.defineComponent({__name:"currency-amount",props:{currency:{},amount:{},textClass:{default:""},iconColorClass:{default:""},iconWidth:{default:16},iconHeight:{default:16}},setup(o){const e=o,t=a.computed(()=>{var r;return(r=e.currency)==null?void 0:r.toUpperCase()});return(r,n)=>t.value!=="USDT"&&t.value!=="USDC"?(a.openBlock(),a.createElementBlock("p",{key:0,class:a.normalizeClass(r.textClass)},a.toDisplayString(a.unref(we)(r.amount,t.value)),3)):(a.openBlock(),a.createElementBlock("div",us,[t.value==="USDT"?(a.openBlock(),a.createBlock(ls,{key:0,width:r.iconWidth,height:r.iconHeight,color:r.iconColorClass},null,8,["width","height","color"])):a.createCommentVNode("",!0),t.value==="USDC"?(a.openBlock(),a.createBlock(rs,{key:1,width:r.iconWidth,height:r.iconHeight,color:r.iconColorClass},null,8,["width","height","color"])):a.createCommentVNode("",!0),a.createElementVNode("p",{class:a.normalizeClass(r.textClass)},a.toDisplayString(a.unref(we)(r.amount)),3)]))}}),cs=["width","height"],ds=["fill"],xs=["fill"],hs=["fill"],fs=["fill"],ps=a.defineComponent({__name:"icon-arrow-swap",props:{width:{default:16},height:{default:17},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M10.3265 14.1948C10.1998 14.1948 10.0731 14.1481 9.97313 14.0481C9.77979 13.8548 9.77979 13.5348 9.97313 13.3414L13.3131 10.0014C13.5065 9.80811 13.8265 9.80811 14.0198 10.0014C14.2131 10.1948 14.2131 10.5148 14.0198 10.7081L10.6798 14.0481C10.5798 14.1414 10.4531 14.1948 10.3265 14.1948Z",fill:a.unref(s)},null,8,ds),a.createElementVNode("path",{d:"M13.6668 10.8477H2.3335C2.06016 10.8477 1.8335 10.621 1.8335 10.3477C1.8335 10.0743 2.06016 9.84766 2.3335 9.84766H13.6668C13.9402 9.84766 14.1668 10.0743 14.1668 10.3477C14.1668 10.621 13.9402 10.8477 13.6668 10.8477Z",fill:a.unref(s)},null,8,xs),a.createElementVNode("path",{d:"M2.33329 6.86079C2.20663 6.86079 2.07996 6.81413 1.97996 6.71413C1.78663 6.52079 1.78663 6.20079 1.97996 6.00746L5.31996 2.66746C5.51329 2.47413 5.83329 2.47413 6.02663 2.66746C6.21996 2.86079 6.21996 3.18079 6.02663 3.37413L2.68663 6.71413C2.59329 6.80746 2.45996 6.86079 2.33329 6.86079Z",fill:a.unref(s)},null,8,hs),a.createElementVNode("path",{d:"M13.6668 6.86133H2.3335C2.06016 6.86133 1.8335 6.63466 1.8335 6.36133C1.8335 6.08799 2.06016 5.86133 2.3335 5.86133H13.6668C13.9402 5.86133 14.1668 6.08799 14.1668 6.36133C14.1668 6.63466 13.9402 6.86133 13.6668 6.86133Z",fill:a.unref(s)},null,8,fs)],16,cs))}}),ms={class:"flex flex-col gap-6"},vs={class:"grid grid-cols-1 gap-6"},Cs={key:1,class:"flex flex-col gap-6"},gs={class:"mx-auto"},Es={class:"mb-0 text-body-4xs text-light-copy font-normal text-center"},Bs={class:"flex flex-col gap-6 border-c border-grey-100 p-4 rounded-2xl bg-light-white-50"},_s={class:"border-b border-grey-border pb-4 flex flex-col gap-2"},ys={class:"flex justify-between"},ks={class:"flex flex-col gap-1"},As={class:"mb-0 text-body-2xs font-medium text-sub-copy"},bs={class:"flex items-center gap-2"},Fs={class:"pb-4 flex flex-col gap-2"},Ds={class:"flex justify-between"},ws={class:"mb-0 text-body-2xs font-medium text-sub-copy w-2/3 break-words"},Ss={class:"flex flex-col gap-2"},Vs={class:"flex items-center justify-between border-b border-grey-border py-3"},Ns={class:"flex items-center justify-between py-4"},Rs={class:"flex flex-col gap-6"},Is=a.defineComponent({__name:"pay-by-stable-coin",props:{secretKey:{},paymentObject:{},environment:{},onPaymentAuthorized:{type:Function},onError:{type:Function}},setup(o){const e=o,t=e.environment??"sandbox",r=a.ref(0),n=a.ref(""),s=a.ref(!1),u=a.ref(!1),l=a.ref(!1),f=a.ref(!1),i=a.ref(""),x=a.ref([]),v=a.ref([]),c=a.ref(null),C=a.ref(null),d=a.ref(!1),g=a.ref(null),p=a.ref(""),_=a.reactive({stableCoin:"",network:""}),m=a.reactive({}),h={stableCoin:"required",network:"required"},B={stableCoin:"Stable Coin",network:"Network"},F=a.computed(()=>we(e.paymentObject.amount,e.paymentObject.currency)),b=a.computed(()=>c.value?(Number(c.value.transactionAmount)||0)+(c.value.networkFee||0):0);async function D(){var E;if(!e.secretKey){n.value="Secret key is required.";return}if(!He(e.paymentObject)){n.value="Kindly ensure you are passing all the required data.";return}s.value=!0,n.value="";try{const k=await $e(e.paymentObject,t,e.secretKey);if(k!=null&&k.isSuccessful&&k.launchUrl){const T=tt(k.launchUrl);i.value=T.paymentReference,n.value="Payment link created successfully"}else n.value="Failed to create payment link"}catch(k){n.value=(k==null?void 0:k.message)||"Failed to create payment link",(E=e.onError)==null||E.call(e,{errorMessage:n.value})}finally{s.value=!1}}async function V(E){var k;if(E){u.value=!0;try{const T=await Tr(t,E);T!=null&&T.isSuccessful?(c.value=T.data,r.value=1):n.value=(T==null?void 0:T.responseMessage)||"Failed to generate address"}catch(T){n.value=(T==null?void 0:T.message)||"Failed to generate address",(k=e.onError)==null||k.call(e,{errorMessage:n.value})}finally{u.value=!1}}}async function M(){var E;l.value=!0;try{const k=await Oa(t);k!=null&&k.isSuccessful&&(x.value=(k.data??[]).map(T=>({label:T.name,value:T.name}))??[])}catch(k){n.value=(k==null?void 0:k.message)||"Failed to get stable coins",(E=e.onError)==null||E.call(e,{errorMessage:n.value})}finally{l.value=!1}}async function A(E){var k,T;f.value=!0;try{const O=await Ha(t,E);if(O!=null&&O.isSuccessful){const U=O.networks??((k=O.data)==null?void 0:k.networks)??[];v.value=(U??[]).map(H=>({label:H,value:H}))}}catch(O){n.value=(O==null?void 0:O.message)||"Failed to get stable coin networks",(T=e.onError)==null||T.call(e,{errorMessage:n.value})}finally{f.value=!1}}async function w(){var E,k,T,O,U,H;d.value=!0;try{const $=await Xt(t,i.value);if($!=null&&$.isSuccessful){const P=$.data;g.value=P,(P==null?void 0:P.finalTransactionStatus)==null||(P==null?void 0:P.paymentStatus)==null?(n.value="Transaction not confirmed !!",p.value="pending",(E=e.onPaymentAuthorized)==null||E.call(e,{paymentId:i.value,paymentDate:(P==null?void 0:P.updatedAt)??"",paymentStatus:"pending",message:n.value})):((P==null?void 0:P.finalTransactionStatus)==="Success"||(P==null?void 0:P.paymentStatus)==="Payment Received")&&(n.value="Transaction confirmed !!",p.value="confirmed",(k=e.onPaymentAuthorized)==null||k.call(e,{paymentId:i.value,paymentDate:P==null?void 0:P.updatedAt,paymentStatus:"confirmed",message:n.value}))}else!($!=null&&$.isSuccessful)&&($==null?void 0:$.responseCode)==="119"&&(p.value="used",n.value=($==null?void 0:$.responseMessage)||"",(T=e.onPaymentAuthorized)==null||T.call(e,{paymentId:i.value,paymentDate:null,paymentStatus:"used",message:n.value}))}catch($){p.value="",n.value=((O=$==null?void 0:$.error)==null?void 0:O.responseMessage)||((U=$==null?void 0:$.error)==null?void 0:U.message)||"Something went wrong",(H=e.onError)==null||H.call(e,{errorMessage:n.value})}finally{d.value=!1}}async function S(){const E=je(_,h,B);if(Object.assign(m,E),Object.keys(E).length===0){const k={paymentReference:i.value,currency:_.stableCoin,chain:_.network,transactionAmount:e.paymentObject.amount,merchantId:e.secretKey};C.value=k,await V(k)}}return a.onMounted(async()=>{await D(),await M()}),(E,k)=>{var T,O,U,H,$,P,y,R,I;return a.openBlock(),a.createElementBlock("div",ms,[r.value===0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",vs,[a.createVNode(et,{label:"Select Crypto",required:"",options:x.value,loading:l.value,value:_.stableCoin,onChange:N=>{_.stableCoin=N,A(N),m.stableCoin&&(m.stableCoin="")},validationError:m.stableCoin??""},null,8,["options","loading","value","onChange","validationError"]),a.createVNode(et,{label:"Select Network",required:"",options:v.value,loading:f.value,value:_.network,onChange:N=>{_.network=N,m.network&&(m.network="")},validationError:m.network??""},null,8,["options","loading","value","onChange","validationError"])]),a.createVNode(Se,{label:`Pay ${F.value}`,type:"primary",customClass:"w-full",loading:u.value,onClick:S},null,8,["label","loading"])],64)):(a.openBlock(),a.createElementBlock("div",Cs,[a.createElementVNode("div",gs,[a.createElementVNode("p",Es,a.toDisplayString((T=C.value)==null?void 0:T.currency),1)]),a.createElementVNode("div",Bs,[a.createElementVNode("div",_s,[k[2]||(k[2]=a.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"},"Network",-1)),a.createElementVNode("div",ys,[a.createElementVNode("div",ks,[a.createElementVNode("p",As,a.toDisplayString((O=c.value)==null?void 0:O.chain),1),a.createElementVNode("div",bs,[k[0]||(k[0]=a.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"}," *Est. arrival = 3 mins ",-1)),k[1]||(k[1]=a.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"},"|",-1)),a.createVNode(Ut,{currency:((U=C.value)==null?void 0:U.currency)??"",amount:((H=c.value)==null?void 0:H.networkFee)??0,textClass:"mb-0 text-body-3xs text-light-copy font-normal",iconColorClass:"#557591",iconWidth:12,iconHeight:12},null,8,["currency","amount"])])]),a.createVNode(ps)])]),a.createElementVNode("div",Fs,[k[3]||(k[3]=a.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"}," Deposit Address > ",-1)),a.createElementVNode("div",Ds,[a.createElementVNode("p",ws,a.toDisplayString(($=c.value)==null?void 0:$.walletAddress),1),a.createVNode(ze,{copyText:((P=c.value)==null?void 0:P.walletAddress)??""},null,8,["copyText"])])])]),a.createElementVNode("div",Ss,[a.createElementVNode("div",Vs,[k[4]||(k[4]=a.createElementVNode("p",{class:"mb-0 text-body-2xs font-medium text-primary-black"}," Network fee ",-1)),a.createVNode(Ut,{currency:((y=C.value)==null?void 0:y.currency)??"",amount:((R=c.value)==null?void 0:R.networkFee)??0,textClass:"mb-0 text-body-2xs font-extrabold text-primary-black",iconColorClass:"#231F20"},null,8,["currency","amount"])]),a.createElementVNode("div",Ns,[k[5]||(k[5]=a.createElementVNode("p",{class:"mb-0 text-body-lg font-semibold text-primary-black"},"Pay",-1)),a.createVNode(Ut,{currency:((I=C.value)==null?void 0:I.currency)??"",amount:b.value,textClass:"mb-0 text-body-lg font-extrabold text-primary-black",iconColorClass:"#231F20",iconWidth:20,iconHeight:20},null,8,["currency","amount"])])]),a.createElementVNode("div",Rs,[a.createVNode(Se,{label:"Confirm Payment",type:"primary",customClass:"w-full",loading:d.value,onClick:w},null,8,["loading"])])]))])}}}),Ts=["width","height"],Ms=["fill"],Ps=a.defineComponent({__name:"icon-check-circle",props:{width:{default:67},height:{default:67},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:s}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 67 67",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M33.6705 0.0820312C15.2758 0.0820312 0.36377 14.9941 0.36377 33.3888C0.36377 51.7846 15.2758 66.6956 33.6705 66.6956C52.0663 66.6956 66.9773 51.7846 66.9773 33.3888C66.9773 14.9941 52.0663 0.0820312 33.6705 0.0820312ZM33.6705 62.5978C17.6011 62.5978 4.52712 49.4583 4.52712 33.3887C4.52712 17.3192 17.6011 4.24525 33.6705 4.24525C49.74 4.24525 62.814 17.3193 62.814 33.3887C62.814 49.4581 49.74 62.5978 33.6705 62.5978ZM46.9631 21.2016L27.4213 40.8662L18.621 32.0659C17.8081 31.253 16.4904 31.253 15.6765 32.0659C14.8636 32.8788 14.8636 34.1965 15.6765 35.0094L25.9797 45.3137C26.7926 46.1255 28.1103 46.1255 28.9243 45.3137C29.0179 45.22 29.0981 45.1179 29.171 45.0118L49.9086 24.1461C50.7205 23.3332 50.7205 22.0155 49.9086 21.2016C49.0947 20.3888 47.777 20.3888 46.9631 21.2016Z",fill:a.unref(s)},null,8,Ms)],16,Ts))}}),Os={class:"flex flex-col gap-8 p-16"},Hs={class:"flex flex-col gap-8"},$s={class:"flex flex-col gap-8"},Ls={class:"flex flex-col"},zs={class:"py-4 border-b border-grey-100"},Us={class:"py-4"},qs={class:"mx-auto",style:{width:"80%"}},js=a.defineComponent({__name:"success",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("div",Os,[a.createElementVNode("div",Hs,[a.createElementVNode("div",$s,[a.createVNode(Ps,{color:"#F47A1F",class:"mx-auto"}),t[0]||(t[0]=a.createElementVNode("div",{class:"flex flex-col text-center",style:{gap:"2px"}},[a.createElementVNode("p",{class:"text-heading-text font-medium text-header-2xl"},"₦2,500.00"),a.createElementVNode("p",{class:"text-sub-copy font-regular text-body-3xs"}," Has been paid successfully ")],-1))]),a.createElementVNode("div",Ls,[a.createElementVNode("div",zs,[a.createVNode(Ue,{type:"horizontal",label:"Order ID",value:"9900009000-8890-8829hd7"})]),a.createElementVNode("div",Us,[a.createVNode(Ue,{type:"horizontal",label:"Payment date",value:"July 24, 2025"})])])]),a.createElementVNode("div",qs,[a.createVNode(Se,{label:"Return to Merchant Website",type:"secondary",customClass:"w-full"})])]))}}),Ks={class:"grid grid-cols-3"},Ws={key:0,class:"bg-[#EFF7FF] px-6 py-8 flex flex-col gap-5 col-span-1 rounded-l-xl"},Gs={key:0,class:"flex items-center justify-between px-12 py-8"},Zs={key:1,class:"bg-heading-text rounded flex flex-col justify-center",style:{width:"52px",height:"52px"}},Xs={class:"flex flex-col gap-1"},Ys={class:"text-body-2xs font-regular text-sub-copy text-right"},Qs={class:"text-body-2xs font-regular text-sub-copy text-right"},Js={class:"text-orange-500 font-extrabold"},ei={key:1,class:"overflow-y-scroll px-10 pb-10 pt-2"},ti=a.defineComponent({__name:"checkout-card",props:{secretKey:{},environment:{},paymentObject:{},options:{},onPaymentAuthorized:{type:Function},onError:{type:Function}},setup(o){const e=o,t=e.environment??"sandbox",r=e.paymentObject??{merchantName:"",amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:"https://sandbox-merchant.buzapay.com/account/three-ds-status"},n=a.ref("PENDING"),s=a.ref([{label:"Card",value:"CARD"},{label:"Bank Transfer",value:"BANK_TRANSFER"},{label:"Stable Coin",value:"STABLE_COIN"}]),u=a.ref([]),l=a.ref(""),f=a.ref({paymentDate:"",paymentId:"",paymentStatus:""});function i(C){l.value=C}function x(C){var d;f.value={...C},C.paymentStatus==="Authorized"?n.value="SUCCESS":C.paymentStatus==="Payment failed"?n.value="PENDING":C.paymentStatus==="used"?n.value="USED":n.value="PENDING",(d=e.onPaymentAuthorized)==null||d.call(e,C)}a.watch(()=>[r.currency,r.amount],([C,d])=>{let g=[];C==="USD"?typeof d=="number"&&d<50?g=s.value.filter(p=>p.value!=="BANK_TRANSFER"&&p.value!=="STABLE_COIN"):g=s.value.filter(p=>p.value!=="BANK_TRANSFER"):g=s.value.filter(p=>p.value!=="STABLE_COIN"),u.value=g},{immediate:!0}),a.watch(()=>u.value,C=>{C.length&&(l.value=C[0].value)},{immediate:!0});const v=e.secretKey,c=e.options;return(C,d)=>(a.openBlock(),a.createBlock(Qr,null,{default:a.withCtx(()=>{var g,p;return[a.createElementVNode("div",Ks,[n.value==="PENDING"?(a.openBlock(),a.createElementBlock("div",Ws,[d[1]||(d[1]=a.createElementVNode("p",{class:"text-heading-text text-body-xs font-semibold"},"Pay with",-1)),a.createVNode(aa,{options:u.value,onSelectedChange:d[0]||(d[0]=_=>i(_))},null,8,["options"])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(n.value==="SUCCESS"?"col-span-3":"col-span-2")},[n.value==="PENDING"?(a.openBlock(),a.createElementBlock("div",Gs,[(g=a.unref(c))!=null&&g.imageUrl?(a.openBlock(),a.createBlock(_e,{key:0,src:((p=a.unref(c))==null?void 0:p.imageUrl)??"",alt:"Merchant Logo",width:52,height:52,customClass:"rounded-lg"},null,8,["src"])):(a.openBlock(),a.createElementBlock("div",Zs,[...d[2]||(d[2]=[a.createElementVNode("p",{class:"text-white text-center text-body-2xs font-medium"},"Logo",-1)])])),a.createElementVNode("div",Xs,[a.createElementVNode("p",Ys,a.toDisplayString(a.unref(r).merchantName),1),a.createElementVNode("p",Qs,[d[3]||(d[3]=a.createTextVNode(" Pay: ",-1)),a.createElementVNode("span",Js,a.toDisplayString(a.unref(we)(a.unref(r).amount,a.unref(r).currency)),1)])])])):a.createCommentVNode("",!0),n.value==="PENDING"?(a.openBlock(),a.createElementBlock("div",ei,[l.value==="CARD"?(a.openBlock(),a.createBlock(Nn,{key:0,secretKey:a.unref(v),environment:a.unref(t),paymentObject:a.unref(r),onPaymentAuthorized:x,onError:C.onError},null,8,["secretKey","environment","paymentObject","onError"])):l.value==="BANK_TRANSFER"?(a.openBlock(),a.createBlock(Xn,{key:1,secretKey:a.unref(v),environment:a.unref(t),paymentObject:a.unref(r),onPaymentAuthorized:x,onError:C.onError},null,8,["secretKey","environment","paymentObject","onError"])):(a.openBlock(),a.createBlock(Is,{key:2,secretKey:a.unref(v),environment:a.unref(t),paymentObject:a.unref(r),onPaymentAuthorized:x,onError:C.onError},null,8,["secretKey","environment","paymentObject","onError"]))])):a.createCommentVNode("",!0),n.value==="SUCCESS"?(a.openBlock(),a.createBlock(js,{key:2,amount:a.unref(r).amount,currency:a.unref(r).currency,redirectUrl:a.unref(r).redirectUrl??"",successObject:f.value},null,8,["amount","currency","redirectUrl","successObject"])):a.createCommentVNode("",!0)],2)])]}),_:1}))}});de.BzpCheckoutButton=Or,de.BzpCheckoutCard=ti,de.BzpCheckoutIframe=Yt,de.createMidenPG=rr,de.useMidenPG=ar,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
|
|
2
15
|
//# sourceMappingURL=index.umd.js.map
|