@paynext/sdk 0.0.133 → 0.0.134

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -192,7 +192,7 @@ ${m}::-ms-input-placeholder{${h}}
192
192
  '></path>
193
193
  </svg>
194
194
  <span class="${xe.srOnly}">Success</span>
195
- `);N(this,"element",document.createElement("div"));this.element.classList.add(xe.successContainer),this.element.innerHTML=this.template}render(){return this.element}};const Kf={container:"_container_79xkl_1",title:"_title_79xkl_5"};class W1{constructor(){N(this,"element");N(this,"message",document.createElement("p"));N(this,"icon",new H1);this.element=document.createElement("div"),this.element.classList.add(Kf.container),this.message.classList.add(Kf.title),this.element.append(this.icon.render(),this.message)}addClassName(e){Pe(this.element,e)}removeClassName(e){this.element.classList.remove(e)}render(){return this.element}}const Yf={container:"_container_g3abj_1",title:"_title_g3abj_12"},ca=class ca{constructor(e,n){N(this,"element");N(this,"message",document.createElement("p"));N(this,"icon",new Ts);N(this,"hasCustomMessage",!1);N(this,"hasConfigMessage",!1);this.translate=e,this.element=document.createElement("div"),this.element.classList.add(Yf.container),this.message.classList.add(Yf.title),n?(this.message.textContent=n,this.hasCustomMessage=!0,this.hasConfigMessage=!0):this.message.textContent=e.messages().status.error,this.element.append(this.icon.render(),this.message),this.translate.subscribe(({messages:r})=>{this.hasCustomMessage||(this.message.textContent=r.status.error)}),ca.instances.add(this)}setMessage(e){this.hasConfigMessage||(this.message.textContent=e,this.hasCustomMessage=!!e)}addClassName(e){Pe(this.element,e)}removeClassName(e){this.element.classList.remove(e)}hide(){this.element.style.display="none"}show(){this.element.style.display="flex"}render(){return this.element}};N(ca,"instances",new Set);let nc=ca;class G1{constructor(e){N(this,"isLoading",!1);N(this,"isFormOpen",!1);N(this,"closedHeight",0);N(this,"hasLoadedOnce",!1);N(this,"checkout");N(this,"container",document.createElement("div"));N(this,"loader",new K0);N(this,"success");N(this,"buttons");N(this,"form");N(this,"error");N(this,"errorPrevHeight",null);N(this,"FORM_HEIGHT",309);this.config=e,this.buttons=new N1(e),this.form=new j1({translate:e.state.translate,className:ut.hidden,stylesState:e.state.styles,isDefaultVariant:e.state.checkout.getState().variant==="default",onPaymentAttempt:n=>{var r,i;return(i=(r=this.config.state.checkout.getState()).onCheckoutAttempt)==null?void 0:i.call(r,n)}}),this.success=new W1,this.success.addClassName(ut.hidden),this.error=new nc(e.state.translate,e.state.checkout.getState().errorMessageText),this.error.hide(),this.container.append(this.loader.render(),this.buttons.render(),this.form.render()),this.checkout=document.createElement("div"),this.checkout.classList.add(ut.checkout),this.checkout.append(this.container,this.error.render(),this.success.render())}init(){return j(this,null,function*(){this.buttons.addEventListener("onPaymentAttempt",e=>{var r;const n=this.config.state.checkout.getState();(r=n.onCheckoutAttempt)==null||r.call(n,{paymentMethod:e}),this.hideError()}),this.buttons.addEventListener("onFormLoaded",()=>{const{onCheckoutLoaded:e}=this.config.state.checkout.getState();!this.hasLoadedOnce&&e&&(this.hasLoadedOnce=!0,e({success:!0}))}),this.buttons.addEventListener("ready",()=>j(this,null,function*(){var n;this.loader.setClassName(ut.hidden);const{variant:e}=this.config.state.checkout.getState();if(this.form.setDefaultVariant(e==="default"),this.buttons.showButton(),e==="default"){const r=this.checkout.getBoundingClientRect().height;r<this.FORM_HEIGHT&&(this.checkout.style.height=`${r}px`),this.form.element.classList.remove(ut.hidden),r<this.FORM_HEIGHT&&(yield(n=this.checkout.animate({minHeight:[`${r}px`,`${this.FORM_HEIGHT}px`]},{duration:250,easing:"ease-out",fill:"forwards"}).finished)!=null?n:Promise.resolve(),this.checkout.style.height=""),this.isFormOpen=!0}})),this.buttons.addEventListener("open",()=>j(this,null,function*(){var i;if(this.isLoading)return;this.hideError();const e=this.checkout.getBoundingClientRect().height;this.closedHeight=e,e<this.FORM_HEIGHT&&(this.checkout.style.height=`${e}px`),yield Xe(this.buttons.buttons,ws.close,ws.transition),this.buttons.buttons.classList.add(ut.hidden),this.form.element.classList.add(ut.formInitial),this.form.element.classList.remove(ut.hidden);const n=e;let r=null;n<this.FORM_HEIGHT&&(this.checkout.style.height=`${n}px`,r=(i=this.checkout.animate({minHeight:[`${n}px`,`${this.FORM_HEIGHT}px`]},{duration:250,easing:"ease-out",fill:"forwards"}).finished)!=null?i:Promise.resolve()),yield Promise.all([Xe(this.form.element,Ir.open,Ir.transition),r!=null?r:Promise.resolve()]),n<this.FORM_HEIGHT&&(this.checkout.style.height=""),this.isFormOpen=!0})),this.buttons.addEventListener("error",e=>{const{onCheckoutFail:n,onCheckoutLoaded:r}=this.config.state.checkout.getState(),i=this.config.state.translate.messages(),s=Ss(e,i);this.showError(s);const o={status:"sdk_failed",status_reason:{advice_code:null,decline_code:null,message:`${e.paymentMethod}: ${e.message||e}`}};!this.hasLoadedOnce&&r&&(this.hasLoadedOnce=!0,r({success:!1,error:o})),n==null||n(o)}),this.buttons.addEventListener("success",e=>{const{clientToken:n}=this.config.state.checkout.getState();switch(e.type){case"apple":return this.handleSuccess({clientSession:n,applePay:e});case"google":return this.handleSuccess({clientSession:n,googlePay:e});case"paypal":return this.handleSuccess({clientSession:n,paypal:{billing_agreement_token:e}});case"venmo":return this.handleSuccess({clientSession:n,braintree:{nonce:e}})}}),this.form.addEventListener("close",()=>j(this,null,function*(){var s,o;if(this.isLoading)return;this.hideError();const e=this.checkout.getBoundingClientRect().height;let n=null;this.closedHeight>0&&e>this.closedHeight&&(this.checkout.style.height=`${e}px`,n=(s=this.checkout.animate({minHeight:[`${e}px`,`${this.closedHeight}px`]},{duration:250,easing:"ease-out",fill:"forwards"}).finished)!=null?s:Promise.resolve()),yield Xe(this.form.element,Ir.close,Ir.transition),this.form.element.classList.add(ut.hidden);const{variant:i}=this.config.state.checkout.getState();if(i!=="default"){this.buttons.buttons.classList.add(ut.btnsInitial),this.buttons.buttons.classList.remove(ut.hidden);const a=Xe(this.buttons.buttons,ws.open,ws.transition);yield Promise.all([a,n!=null?n:Promise.resolve()])}this.closedHeight>0&&(n=(o=this.checkout.animate({minHeight:[`${e}px`,`${this.closedHeight}px`]},{duration:250,easing:"ease-out",fill:"forwards"}).finished)!=null?o:Promise.resolve(),this.checkout.style.height="auto"),this.isFormOpen=!1})),this.form.addEventListener("submit",e=>j(this,null,function*(){if(this.isLoading||(this.form.touchSubmit(),this.hideError(),!this.form.validate()))return;const r=e.number.replace(/\D/g,""),i=this.config.state.checkout.getState(),s=this.config.service.ev.getEv(),[o,a]=yield Promise.all([s.encrypt(r),s.encrypt(e.cvc)]),[c,u]=e.expiry.split("/");yield this.handleSuccess({clientSession:i.clientToken,card:{firstSixDigits:r.slice(0,6),lastFourDigits:r.slice(-4),expMonth:Number(c),expYear:Number(u),cardBrand:e.cardBrand||"",number:o,cvc:a,type:J.CARD,metadata:{name:e.name,userAgent:navigator==null?void 0:navigator.userAgent}}})})),yield this.buttons.init()})}handleError(e){var s;const n=this.config.state.checkout.getState(),r=this.config.state.translate.messages(),i=Ss(e,r);e&&(this.showError(i),(s=n.onCheckoutFail)==null||s.call(n,e)),this.setLoading(!1)}handleSuccess(e){return j(this,null,function*(){var s,o;if(this.isLoading)return;this.hideError(),this.setLoading(!0);const n=this.config.state.checkout.getState(),r=this.config.state.translate.messages();let i;try{if(i=yield Ub(e,n.environment,n.apiVersion),i.error)throw new Error(((s=i.error)==null?void 0:s.message)||r.status.error);if(i.three_ds_session_id){yield this.config.service.ev.initThreeDs({threeDsId:i.three_ds_session_id,onSuccess:()=>{this.setLoading(!1),this.handleSuccess($(y({},e),{threeDsSessionId:i==null?void 0:i.three_ds_session_id}))},onError:()=>{this.handleError(i==null?void 0:i.status_reason)}});return}if(i.payment_status===pt.FAILED||i.payment_status===pt.DECLINED){this.handleError(i.status_reason);return}yield this.showSuccess(),this.setLoading(!1)}catch(a){const c=e.card?J.CARD:e.applePay?J.APPLE_PAY:e.googlePay?J.GOOGLE_PAY:e.paypal?J.PAYPAL:e.braintree?J.VENMO:J.CARD;return this.handleError({status:"sdk_failed",status_reason:{advice_code:null,decline_code:null,message:`${c}: ${a.message||a}}`}})}(o=n.onCheckoutComplete)==null||o.call(n,i)})}showSuccess(){return j(this,null,function*(){this.container.classList.add(ut.hidden),this.success.removeClassName(ut.hidden),yield Xe(this.success.element,Ir.open,Ir.transition)})}hideError(){if(this.error.hide(),this.errorPrevHeight!==null){const e=this.checkout.getBoundingClientRect().height;this.checkout.style.height=`${e}px`;const n=this.checkout.animate({minHeight:[`${e}px`,`${this.closedHeight}px`]},{duration:250,easing:"ease-out",fill:"forwards"});this.checkout.style.height="auto",n.onfinish=()=>{this.errorPrevHeight=null},n.oncancel=()=>{this.errorPrevHeight=null}}}showError(e){if(this.loader.setClassName(ut.hidden),e&&this.error.setMessage(e),this.error.show(),this.errorPrevHeight===null){const n=this.checkout.getBoundingClientRect().height;this.errorPrevHeight=n,this.checkout.style.height=`${n}px`,requestAnimationFrame(()=>{const r=this.checkout.getBoundingClientRect().height,i=this.checkout.animate({minHeight:[`${n}px`,`${r}px`]},{duration:250,easing:"ease-out",fill:"forwards"});i.onfinish=()=>{this.checkout.style.height=""}})}}setLoading(e){this.isLoading=e,this.form.setLoading(e),this.loader.setClassName(!e||this.isFormOpen?ut.hidden:"")}render(){return this.checkout}}const Z=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,ie=globalThis,sn="10.22.0";function on(){return ki(ie),ie}function ki(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||sn,e[sn]=e[sn]||{}}function Ar(t,e,n=ie){const r=n.__SENTRY__=n.__SENTRY__||{},i=r[sn]=r[sn]||{};return i[t]||(i[t]=e())}const rc=["debug","info","warn","error","log","assert","trace"],q1="Sentry Logger ",Is={};function Sn(t){if(!("console"in ie))return t();const e=ie.console,n={},r=Object.keys(Is);r.forEach(i=>{const s=Is[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function K1(){sc().enabled=!0}function Y1(){sc().enabled=!1}function Xf(){return sc().enabled}function X1(...t){ic("log",...t)}function Q1(...t){ic("warn",...t)}function J1(...t){ic("error",...t)}function ic(t,...e){Z&&Xf()&&Sn(()=>{ie.console[t](`${q1}[${t}]:`,...e)})}function sc(){return Z?Ar("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const D={enable:K1,disable:Y1,isEnabled:Xf,log:X1,warn:Q1,error:J1},Qf=50,Kt="?",Jf=/\(error: (.*)\)/,Zf=/captureMessage|captureException/;function ep(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{const s=[],o=n.split(`
195
+ `);N(this,"element",document.createElement("div"));this.element.classList.add(xe.successContainer),this.element.innerHTML=this.template}render(){return this.element}};const Kf={container:"_container_79xkl_1",title:"_title_79xkl_5"};class W1{constructor(){N(this,"element");N(this,"message",document.createElement("p"));N(this,"icon",new H1);this.element=document.createElement("div"),this.element.classList.add(Kf.container),this.message.classList.add(Kf.title),this.element.append(this.icon.render(),this.message)}addClassName(e){Pe(this.element,e)}removeClassName(e){this.element.classList.remove(e)}render(){return this.element}}const Yf={container:"_container_g3abj_1",title:"_title_g3abj_12"},ca=class ca{constructor(e,n){N(this,"element");N(this,"message",document.createElement("p"));N(this,"icon",new Ts);N(this,"hasCustomMessage",!1);N(this,"hasConfigMessage",!1);this.translate=e,this.element=document.createElement("div"),this.element.classList.add(Yf.container),this.message.classList.add(Yf.title),n?(this.message.textContent=n,this.hasCustomMessage=!0,this.hasConfigMessage=!0):this.message.textContent=e.messages().status.error,this.element.append(this.icon.render(),this.message),this.translate.subscribe(({messages:r})=>{this.hasCustomMessage||(this.message.textContent=r.status.error)}),ca.instances.add(this)}setMessage(e){this.hasConfigMessage||(this.message.textContent=e,this.hasCustomMessage=!!e)}addClassName(e){Pe(this.element,e)}removeClassName(e){this.element.classList.remove(e)}hide(){this.element.style.display="none"}show(){this.element.style.display="flex"}render(){return this.element}};N(ca,"instances",new Set);let nc=ca;class G1{constructor(e){N(this,"isLoading",!1);N(this,"isFormOpen",!1);N(this,"closedHeight",0);N(this,"hasLoadedOnce",!1);N(this,"checkout");N(this,"container",document.createElement("div"));N(this,"loader",new K0);N(this,"success");N(this,"buttons");N(this,"form");N(this,"error");N(this,"errorPrevHeight",null);N(this,"FORM_HEIGHT",309);this.config=e,this.buttons=new N1(e),this.form=new j1({translate:e.state.translate,className:ut.hidden,stylesState:e.state.styles,isDefaultVariant:e.state.checkout.getState().variant==="default",onPaymentAttempt:n=>{var r,i;return(i=(r=this.config.state.checkout.getState()).onCheckoutAttempt)==null?void 0:i.call(r,n)}}),this.success=new W1,this.success.addClassName(ut.hidden),this.error=new nc(e.state.translate,e.state.checkout.getState().errorMessageText),this.error.hide(),this.container.append(this.loader.render(),this.buttons.render(),this.form.render()),this.checkout=document.createElement("div"),this.checkout.classList.add(ut.checkout),this.checkout.append(this.container,this.error.render(),this.success.render())}init(){return j(this,null,function*(){this.buttons.addEventListener("onPaymentAttempt",e=>{var r;const n=this.config.state.checkout.getState();(r=n.onCheckoutAttempt)==null||r.call(n,{paymentMethod:e}),this.hideError()}),this.buttons.addEventListener("onFormLoaded",()=>{const{onCheckoutLoaded:e}=this.config.state.checkout.getState();!this.hasLoadedOnce&&e&&(this.hasLoadedOnce=!0,e({success:!0}))}),this.buttons.addEventListener("ready",()=>j(this,null,function*(){var n;this.loader.setClassName(ut.hidden);const{variant:e}=this.config.state.checkout.getState();if(this.form.setDefaultVariant(e==="default"),this.buttons.showButton(),e==="default"){const r=this.checkout.getBoundingClientRect().height;r<this.FORM_HEIGHT&&(this.checkout.style.height=`${r}px`),this.form.element.classList.remove(ut.hidden),r<this.FORM_HEIGHT&&(yield(n=this.checkout.animate({minHeight:[`${r}px`,`${this.FORM_HEIGHT}px`]},{duration:250,easing:"ease-out",fill:"forwards"}).finished)!=null?n:Promise.resolve(),this.checkout.style.height=""),this.isFormOpen=!0}})),this.buttons.addEventListener("open",()=>j(this,null,function*(){var i;if(this.isLoading)return;this.hideError();const e=this.checkout.getBoundingClientRect().height;this.closedHeight=e,e<this.FORM_HEIGHT&&(this.checkout.style.height=`${e}px`),yield Xe(this.buttons.buttons,ws.close,ws.transition),this.buttons.buttons.classList.add(ut.hidden),this.form.element.classList.add(ut.formInitial),this.form.element.classList.remove(ut.hidden);const n=e;let r=null;n<this.FORM_HEIGHT&&(this.checkout.style.height=`${n}px`,r=(i=this.checkout.animate({minHeight:[`${n}px`,`${this.FORM_HEIGHT}px`]},{duration:250,easing:"ease-out",fill:"forwards"}).finished)!=null?i:Promise.resolve()),yield Promise.all([Xe(this.form.element,Ir.open,Ir.transition),r!=null?r:Promise.resolve()]),n<this.FORM_HEIGHT&&(this.checkout.style.height=""),this.isFormOpen=!0})),this.buttons.addEventListener("error",e=>{const{onCheckoutFail:n,onCheckoutLoaded:r}=this.config.state.checkout.getState(),i=this.config.state.translate.messages(),s=Ss(e,i);this.showError(s);const o={status:"sdk_failed",status_reason:{advice_code:null,decline_code:null,message:`${e.paymentMethod}: ${e.message||e}`}};!this.hasLoadedOnce&&r&&(this.hasLoadedOnce=!0,r({success:!1,error:o})),n==null||n(o)}),this.buttons.addEventListener("success",e=>{const{clientToken:n}=this.config.state.checkout.getState();switch(e.type){case"apple":return this.handleSuccess({clientSession:n,applePay:e});case"google":return this.handleSuccess({clientSession:n,googlePay:e});case"paypal":return this.handleSuccess({clientSession:n,paypal:{billing_agreement_token:e}});case"venmo":return this.handleSuccess({clientSession:n,braintree:{nonce:e}})}}),this.form.addEventListener("close",()=>j(this,null,function*(){var s,o;if(this.isLoading)return;this.hideError();const e=this.checkout.getBoundingClientRect().height;let n=null;this.closedHeight>0&&e>this.closedHeight&&(this.checkout.style.height=`${e}px`,n=(s=this.checkout.animate({minHeight:[`${e}px`,`${this.closedHeight}px`]},{duration:250,easing:"ease-out",fill:"forwards"}).finished)!=null?s:Promise.resolve()),yield Xe(this.form.element,Ir.close,Ir.transition),this.form.element.classList.add(ut.hidden);const{variant:i}=this.config.state.checkout.getState();if(i!=="default"){this.buttons.buttons.classList.add(ut.btnsInitial),this.buttons.buttons.classList.remove(ut.hidden);const a=Xe(this.buttons.buttons,ws.open,ws.transition);yield Promise.all([a,n!=null?n:Promise.resolve()])}this.closedHeight>0&&(n=(o=this.checkout.animate({minHeight:[`${e}px`,`${this.closedHeight}px`]},{duration:250,easing:"ease-out",fill:"forwards"}).finished)!=null?o:Promise.resolve(),this.checkout.style.height="auto"),this.isFormOpen=!1})),this.form.addEventListener("submit",e=>j(this,null,function*(){if(this.isLoading||(this.form.touchSubmit(),this.hideError(),!this.form.validate()))return;const r=e.number.replace(/\D/g,""),i=this.config.state.checkout.getState(),s=this.config.service.ev.getEv(),[o,a]=yield Promise.all([s.encrypt(r),s.encrypt(e.cvc)]),[c,u]=e.expiry.split("/");yield this.handleSuccess({clientSession:i.clientToken,card:{firstSixDigits:r.slice(0,6),lastFourDigits:r.slice(-4),expMonth:Number(c),expYear:Number(u),cardBrand:e.cardBrand||"",number:o,cvc:a,type:J.CARD,metadata:{name:e.name,userAgent:navigator==null?void 0:navigator.userAgent}}})})),yield this.buttons.init()})}handleError(e){var s;const n=this.config.state.checkout.getState(),r=this.config.state.translate.messages(),i=Ss(e,r);e&&(this.showError(i),(s=n.onCheckoutFail)==null||s.call(n,e)),this.setLoading(!1)}handleSuccess(e){return j(this,null,function*(){var s,o;if(this.isLoading)return;this.hideError(),this.setLoading(!0);const n=this.config.state.checkout.getState(),r=this.config.state.translate.messages();let i;try{if(i=yield Ub(e,n.environment,n.apiVersion),i.error)throw new Error(((s=i.error)==null?void 0:s.message)||r.status.error);if(i.three_ds_session_id){yield this.config.service.ev.initThreeDs({threeDsId:i.three_ds_session_id,onSuccess:()=>{this.setLoading(!1),this.handleSuccess($(y({},e),{threeDsSessionId:i==null?void 0:i.three_ds_session_id}))},onError:()=>{this.handleError(i==null?void 0:i.status_reason)}});return}if(i.payment_status===pt.FAILED||i.payment_status===pt.DECLINED){this.handleError(i.status_reason);return}yield this.showSuccess(),this.setLoading(!1)}catch(a){const c=e.card?J.CARD:e.applePay?J.APPLE_PAY:e.googlePay?J.GOOGLE_PAY:e.paypal?J.PAYPAL:e.braintree?J.VENMO:J.CARD;return this.handleError({status:"sdk_failed",status_reason:{advice_code:null,decline_code:null,message:`${c}: ${this.stringifyError(a)}`}})}(o=n.onCheckoutComplete)==null||o.call(n,i)})}showSuccess(){return j(this,null,function*(){this.container.classList.add(ut.hidden),this.success.removeClassName(ut.hidden),yield Xe(this.success.element,Ir.open,Ir.transition)})}hideError(){if(this.error.hide(),this.errorPrevHeight!==null){const e=this.checkout.getBoundingClientRect().height;this.checkout.style.height=`${e}px`;const n=this.checkout.animate({minHeight:[`${e}px`,`${this.closedHeight}px`]},{duration:250,easing:"ease-out",fill:"forwards"});this.checkout.style.height="auto",n.onfinish=()=>{this.errorPrevHeight=null},n.oncancel=()=>{this.errorPrevHeight=null}}}showError(e){if(this.loader.setClassName(ut.hidden),e&&this.error.setMessage(e),this.error.show(),this.errorPrevHeight===null){const n=this.checkout.getBoundingClientRect().height;this.errorPrevHeight=n,this.checkout.style.height=`${n}px`,requestAnimationFrame(()=>{const r=this.checkout.getBoundingClientRect().height,i=this.checkout.animate({minHeight:[`${n}px`,`${r}px`]},{duration:250,easing:"ease-out",fill:"forwards"});i.onfinish=()=>{this.checkout.style.height=""}})}}setLoading(e){this.isLoading=e,this.form.setLoading(e),this.loader.setClassName(!e||this.isFormOpen?ut.hidden:"")}stringifyError(e){if(!e)return"Unknown error";if(typeof e=="string")return e;if(e instanceof Error)return e.message||e.name;try{return JSON.stringify(e)}catch(n){return String(e)}}render(){return this.checkout}}const Z=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,ie=globalThis,sn="10.22.0";function on(){return ki(ie),ie}function ki(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||sn,e[sn]=e[sn]||{}}function Ar(t,e,n=ie){const r=n.__SENTRY__=n.__SENTRY__||{},i=r[sn]=r[sn]||{};return i[t]||(i[t]=e())}const rc=["debug","info","warn","error","log","assert","trace"],q1="Sentry Logger ",Is={};function Sn(t){if(!("console"in ie))return t();const e=ie.console,n={},r=Object.keys(Is);r.forEach(i=>{const s=Is[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function K1(){sc().enabled=!0}function Y1(){sc().enabled=!1}function Xf(){return sc().enabled}function X1(...t){ic("log",...t)}function Q1(...t){ic("warn",...t)}function J1(...t){ic("error",...t)}function ic(t,...e){Z&&Xf()&&Sn(()=>{ie.console[t](`${q1}[${t}]:`,...e)})}function sc(){return Z?Ar("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const D={enable:K1,disable:Y1,isEnabled:Xf,log:X1,warn:Q1,error:J1},Qf=50,Kt="?",Jf=/\(error: (.*)\)/,Zf=/captureMessage|captureException/;function ep(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{const s=[],o=n.split(`
196
196
  `);for(let a=r;a<o.length;a++){let c=o[a];c.length>1024&&(c=c.slice(0,1024));const u=Jf.test(c)?c.replace(Jf,"$1"):c;if(!u.match(/\S*Error: /)){for(const d of e){const l=d(u);if(l){s.push(l);break}}if(s.length>=Qf+i)break}}return eS(s.slice(i))}}function Z1(t){return Array.isArray(t)?ep(...t):t}function eS(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(As(e).function||"")&&e.pop(),e.reverse(),Zf.test(As(e).function||"")&&(e.pop(),Zf.test(As(e).function||"")&&e.pop()),e.slice(0,Qf).map(n=>$(y({},n),{filename:n.filename||As(e).filename,function:n.function||Kt}))}function As(t){return t[t.length-1]||{}}const oc="<anonymous>";function an(t){try{return!t||typeof t!="function"?oc:t.name||oc}catch(e){return oc}}function ac(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch(r){return}}}const ks={},tp={};function wn(t,e){ks[t]=ks[t]||[],ks[t].push(e)}function Cn(t,e){if(!tp[t]){tp[t]=!0;try{e()}catch(n){Z&&D.error(`Error while instrumenting ${t}`,n)}}}function It(t,e){const n=t&&ks[t];if(n)for(const r of n)try{r(e)}catch(i){Z&&D.error(`Error while triggering instrumentation handler.
197
197
  Type: ${t}
198
198
  Name: ${an(r)}