1(self["webpackChunkvisa_canada"]=self["webpackChunkvisa_canada"]||[]).push([[1785],{61785:function(t,e){var n,i,r,s,o,a,c,u,l,d,p,h,y,f,m,v,g,P,S,w,I,A,b,C,O,T,N,E,M,B,j,R,k,U,D,F,x,G,_,V,H,J,L,z,X,K,q,W,Y,$,Z,Q,tt,et,nt,it,rt,st,ot,at,ct,ut,lt,dt,pt,ht,yt,ft,mt,vt,gt,Pt,St,wt,It,At,bt,Ct,Ot,Tt,Nt,Et,Mt,Bt,jt,Rt,kt,Ut,Dt,Ft,xt,Gt,_t,Vt,Ht,Jt,Lt,zt,Xt,Kt;(function(t){var n={},i={};n.define=function(t,e,n){if(e&&e.length)for(var r=0;r<e.length;r++)e[r]=i[e[r]];i[t]=n.apply(this,e||[])},t.connectsdk=n,e.connectsdk=n,n.define("connectsdk.core",[],function(){return n})})("undefined"===typeof window?this:window),Xt=[],n=function(){var t="undefined"===typeof window?this:window,n={};return t.connectsdk=n,e.connectsdk=n,n}.apply(i={},Xt),void 0!==n||(n=i),Xt=[n],r=function(t){function e(t){function e(t){var e=this;this.pending=[],this.resolve=function(t){e.complete("resolve",t)},this.reject=function(t){e.complete("reject",t)},t&&(this.isSingleton=!0)}e.prototype={then:function(t,e){return this.pending.push({resolve:t,reject:e}),this},complete:function(t,e){while(this.pending[0])this.pending.shift()[t](e)}},t.Promise=e}return e(connectsdk),connectsdk.Promise}.apply(s={},Xt),void 0!==r||(r=s),Xt=[n],o=function(t){var e={},n="".trim?function(t){return t.trim()}:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};function i(){if(!("undefined"===typeof XMLHttpRequest||"file:"===window.location.protocol&&window.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}return!1}function r(t){return t.status>=200&&t.status<300||304==t.status||0==t.status&&t.responseText}function s(n,s){var o,a,c=i(),u={};function l(t){if(4==c.readyState){var n=c.mimeType||c.getResponseHeader("content-type")||"";if(u.status=c.status,u.responseText=c.responseText,/json/.test(n)?u.responseJSON=e.parseJSON(c.responseText):/xml/.test(n)&&(u.responseXML=e.parseXML(c.responseText)),u.success=r(c),s.callback)return s.callback(u,c);u.success?(s.success&&s.success(u,c),o&&o.resolve(u,c)):(s.error&&s.error(u,c),o&&o.reject(u,c))}}function d(){var t={Accept:"text/javascript, application/json, text/html, application/xml, text/xml, */*","Content-Type":"application/json"};for(var e in t)s.headers.hasOwnProperty(e)||(s.headers[e]=t[e]);for(var e in s.headers)c.setRequestHeader(e,s.headers[e])}function p(){try{d(),c.send(s.postBody)}catch(t){s.error&&s.error()}}return t.Promise&&(o=new t.Promise),"undefined"===typeof s&&(s={}),s.method=s.method?s.method.toLowerCase():"get",s.asynchronous=s.asynchronous||!0,s.postBody=s.postBody||"",c.onreadystatechange=l,c.open(s.method,n,s.asynchronous),s.headers=s.headers||{},s.contentType&&(s.headers["Content-Type"]=s.contentType),"string"!==typeof s.postBody&&(s.postBody=e.serialize(s.postBody)),a={set:function(t,e){return s.headers[t]=e,a},send:function(t,n){return s.postBody=e.serialize(t),s.callback=n,p(),a},end:function(t){return s.callback=t,p(),a},data:function(t){return s.postBody=e.serialize(t),a},then:function(){return a.end(),o&&o.then.apply(o,arguments),a}},a}function o(t,e,n){var i=this;function r(t){i.success(t),i.teardown()}this.url=t,this.methodName="__connectsdk_jsonp_"+parseInt((new Date).getTime()),this.success=e,this.failure=n,window[this.methodName]=r}return e.serialize=function(t){if(t){if("string"===typeof t)return t;var e=[];for(var n in t)e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")}},e.parseJSON=function(t){return"string"===typeof t&&t?(t=n(t),window.JSON.parse(t)):null},window.DOMParser?e.parseXML=function(t){return(new DOMParser).parseFromString(t,"text/xml")}:e.parseXML=function(t){var e=new ActiveXObject("Microsoft.XMLDOM");return e.async="false",e.loadXML(t),e},o.prototype.run=function(){this.scriptTag=document.createElement("script"),this.scriptTag.id=this.methodName,this.scriptTag.src=this.url.replace("{callback}",this.methodName);var t=this;this.scriptTag.onerror=function(){t.failure()},document.body.appendChild(this.scriptTag)},o.prototype.teardown=function(){window[this.methodName]=null;try{delete window[this.methodName]}catch(t){}this.scriptTag&&document.body.removeChild(this.scriptTag)},e.get=function(t,e){return"undefined"===typeof e&&(e={}),e.method="get",s(t,e)},e.post=function(t,e){return"undefined"===typeof e&&(e={}),e.method="post",s(t,e)},e.jsonp=function(t,e){"undefined"===typeof e&&(e={});var n=new o(t,e.success,e.failure);n.run()},t.get=e.get,t.post=e.post,t.jsonp=e.jsonp,e.ajax=s,t.net=e,e}.apply(a={},Xt),void 0!==o||(o=a),Xt=[n],c=function(t){var e=function(){var t;function e(){var t=302,e=320,n=3012;return{applePayPaymentProductId:t,googlePayPaymentProductId:e,bancontactPaymentProductId:n,getMetadata:function(){return{screenSize:window.innerWidth+"x"+window.innerHeight,platformIdentifier:window.navigator.userAgent,sdkIdentifier:(document.GC&&document.GC.rppEnabledPage?"rpp-":"")+"JavaScriptClientSDK/v3.20.1",sdkCreator:"Ingenico"}},collectDeviceInformation:function(){return{timezoneOffsetUtcMinutes:(new Date).getTimezoneOffset(),locale:navigator.language,browserData:{javaScriptEnabled:!0,javaEnabled:navigator.javaEnabled(),colorDepth:screen.colorDepth,screenHeight:screen.height,screenWidth:screen.width,innerHeight:window.innerHeight,innerWidth:window.innerWidth}}},base64Encode:function(t){if("object"===typeof t)try{t=JSON.stringify(t)}catch(f){throw"data must be either a String or a JSON object"}var e,n,i,r,s,o,a,c,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/=",l=0,d=0,p="",h=[];if(!t)return t;do{e=t.charCodeAt(l++),n=t.charCodeAt(l++),i=t.charCodeAt(l++),c=e<<16|n<<8|i,r=c>>18&63,s=c>>12&63,o=c>>6&63,a=63&c,h[d++]=u.charAt(r)+u.charAt(s)+u.charAt(o)+u.charAt(a)}while(l<t.length);p=h.join("");var y=t.length%3;return(y?p.slice(0,y-3):p)+"===".slice(y||3)},filterOutProductsThatAreNotSupportedInThisBrowser:function(t){for(var e=t.paymentProducts.length-1,n=0;e>=n;e--){var i=t.paymentProducts[e];i&&this.paymentProductsThatAreNotSupportedInThisBrowser.indexOf(i.id)>-1&&t.paymentProducts.splice(e,1)}},paymentProductsThatAreNotSupportedInThisBrowser:[]}}return{getInstance:function(){return t||(t=e()),t}}}();return t.Util=e,e}.apply(u={},Xt),void 0!==c||(c=u),Xt=[n,r,c],l=function(t,e,n){var i=n.getInstance(),r=null,s=null,o=null,a=null,c=null,u=function(){return{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:a}}},l=function(){return{type:"PAYMENT_GATEWAY",parameters:{gateway:o,gatewayMerchantId:r.googlePay.gatewayMerchantId}}},d=function(){return Object.assign({},u(),{tokenizationSpecification:l()})},p=function(){return{totalPriceStatus:"NOT_CURRENTLY_KNOWN",currencyCode:s.currency}},h=function(){return{merchantName:r.googlePay.merchantName}},y=function(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[u()]}},f=function(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[d()],transactionInfo:p(),merchantInfo:h()}};function m(){if(null===c){var t="TEST";"PROD"===s.environment&&(t="PROD"),window.google?c=new google.payments.api.PaymentsClient({environment:t}):console.error("The Google Pay API script was not loaded https://developers.google.com/pay/api/web/guides/tutorial#js-load")}return c}function v(){var t=f(),e=m();r.googlePay.gatewayMerchantId&&r.googlePay.merchantName?e.prefetchPaymentData(t):console.warn("Prefetching payment data was not triggered because of missing information. gatewayMerchantId: "+r.googlePay.gatewayMerchantId+", merchantName: "+r.googlePay.merchantName)}var g=function(t){this.isGooglePayAvailable=function(t,n,c){s=t,r=n,c&&c.networks?(o=c.gateway,a=c.networks):(o="globalcollect",a=c);var u=new e;return setTimeout(function(){if(a&&a.length>0){var t=m();t?t.isReadyToPay(y()).then(function(t){u.resolve(t),v()}).catch(function(){i.paymentProductsThatAreNotSupportedInThisBrowser.push(i.googlePayPaymentProductId),u.reject("failed to run isReadyToPay() with Google Pay API")}):(i.paymentProductsThatAreNotSupportedInThisBrowser.push(i.googlePayPaymentProductId),u.reject("The Google Pay API script was not loaded https://developers.google.com/pay/api/web/guides/tutorial#js-load"))}else i.paymentProductsThatAreNotSupportedInThisBrowser.push(i.googlePayPaymentProductId),u.reject("There are no product networks available")},0),u},this.isMerchantIdProvided=function(t){return t.googlePay.merchantId?t.googlePay.merchantId:(i.paymentProductsThatAreNotSupportedInThisBrowser.push(i.googlePayPaymentProductId),!1)}};return t.GooglePay=g,g}.apply(d={},Xt),void 0!==l||(l=d),Xt=[n,r,c],p=function(t,e,n){var i=n.getInstance(),r=function(){this.isApplePayAvailable=function(){var t=window.ApplePaySession&&window.ApplePaySession.canMakePayments();return t||i.paymentProductsThatAreNotSupportedInThisBrowser.push(i.applePayPaymentProductId),t},this.initPayment=function(t,n){var i,r=new e,s=t,o=n;i=s.acquirerCountry?s.acquirerCountry:s.countryCode;var a={currencyCode:s.currency,countryCode:i,total:{label:s.displayName,amount:s.totalAmount/100},supportedNetworks:s.networks,merchantCapabilities:["supports3DS"]},c=new ApplePaySession(1,a);return c.begin(),c.onvalidatemerchant=function(t){s.validationURL=t.validationURL,s.domainName=window.location.hostname,o.createPaymentProductSession("302",s).then(function(t){try{c.completeMerchantValidation(JSON.parse(t.paymentProductSession302SpecificOutput.sessionObject))}catch(e){r.reject({message:"Error completing merchant validation"}),c.abort()}},function(){r.reject({message:"Error completing merchant validation"}),c.abort()})},c.onpaymentauthorized=function(t){t.payment.token?(status=ApplePaySession.STATUS_SUCCESS,r.resolve({message:"Payment authorized",data:t.payment.token}),c.completePayment(status)):(status=ApplePaySession.STATUS_FAILURE,r.reject({message:"Error payment authorization"}),c.completePayment(status))},r}};return t.ApplePay=r,r}.apply(h={},Xt),void 0!==p||(p=h),Xt=[n],y=function(t){var e=function(t){this.json=t,this.keyId=t.keyId,this.publicKey=t.publicKey};return t.PublicKeyResponse=e,e}.apply(f={},Xt),void 0!==y||(y=f),Xt=[n],m=function(t){var e=function(t,e){if(this.endpoints={PROD:{EU:{API:"https://ams1.api-ingenico.com/client/v1",ASSETS:"https://assets.pay1.secured-by-ingenico.com"},US:{API:"https://us.api-ingenico.com/client/v1",ASSETS:"https://assets.pay2.secured-by-ingenico.com"},AMS:{API:"https://ams2.api-ingenico.com/client/v1",ASSETS:"https://assets.pay3.secured-by-ingenico.com"},PAR:{API:"https://par.api-ingenico.com/client/v1",ASSETS:"https://assets.pay4.secured-by-ingenico.com"}},PREPROD:{EU:{API:"https://ams1.preprod.api-ingenico.com/client/v1",ASSETS:"https://assets.pay1.preprod.secured-by-ingenico.com"},US:{API:"https://us.preprod.api-ingenico.com/client/v1",ASSETS:"https://assets.pay2.preprod.secured-by-ingenico.com"},AMS:{API:"https://ams2.preprod.api-ingenico.com/client/v1",ASSETS:"https://assets.pay3.preprod.secured-by-ingenico.com"},PAR:{API:"https://par-preprod.api-ingenico.com/client/v1",ASSETS:"https://assets.pay4.preprod.secured-by-ingenico.com"}},SANDBOX:{EU:{API:"https://ams1.sandbox.api-ingenico.com/client/v1",ASSETS:"https://assets.pay1.sandbox.secured-by-ingenico.com"},US:{API:"https://us.sandbox.api-ingenico.com/client/v1",ASSETS:"https://assets.pay2.sandbox.secured-by-ingenico.com"},AMS:{API:"https://ams2.sandbox.api-ingenico.com/client/v1",ASSETS:"https://assets.pay3.sandbox.secured-by-ingenico.com"},PAR:{API:"https://par.sandbox.api-ingenico.com/client/v1",ASSETS:"https://assets.pay4.sandbox.secured-by-ingenico.com"}},INTEGRATION:{EU:{API:"https://int-test-api.gcsip.nl:4443/client/v1",ASSETS:"https://assets.int-test-rpp.gcsip.nl:4443"},US:{API:"https://int-test-api.gcsip.nl:4443/client/v1",ASSETS:"https://assets.int-test-rpp.gcsip.nl:4443"},AMS:{API:"https://int-test-api.gcsip.nl:4443/client/v1",ASSETS:"https://assets.int-test-rpp.gcsip.nl:4443"},PAR:{API:"https://int-test-api.gcsip.nl:4443/client/v1",ASSETS:"https://assets.int-test-rpp.gcsip.nl:4443"}}
1,DEV_NAMI:{EU:{API:"https://nami-test-api.gcsip.nl:4443/client/v1",ASSETS:"https://assets.nami-test-rpp.gcsip.nl:4443"},US:{API:"https://nami-test-api.gcsip.nl:4443/client/v1",ASSETS:"https://assets.nami-test-rpp.gcsip.nl:4443"},AMS:{API:"https://nami-test-api.gcsip.nl:4443/client/v1",ASSETS:"https://assets.nami-test-rpp.gcsip.nl:4443"},PAR:{API:"https://nami-test-api.gcsip.nl:4443/client/v1",ASSETS:"https://assets.nami-test-rpp.gcsip.nl:4443"}},DEV_ISC:{EU:{API:"//api.gc-dev.isaac.local/client/v1",ASSETS:"//rpp.gc-dev.isaac.local"},US:{API:"//api.gc-ci-dev.isaac.local/client/v1",ASSETS:"//rpp.gc-ci-dev.isaac.local"},AMS:{API:"//api.gc-dev.isaac.local/client/v1",ASSETS:"//rpp.gc-dev.isaac.local"},PAR:{API:"//api.gc-dev.isaac.local/client/v1",ASSETS:"//rpp.gc-dev.isaac.local"}}},t.clientSessionId){if(t.clientSessionID)throw new Error("You cannot use both the clientSessionId and the clientSessionID at the same time, please use the clientSessionId only.")}else t.clientSessionId=t.clientSessionID;if(t.assetUrl){if(t.assetsBaseUrl)throw new Error("You cannot use both the assetUrl and the assetsBaseUrl at the same time, please use the assetUrl only.")}else t.assetUrl=t.assetsBaseUrl;if(t.clientApiUrl){if(t.apiBaseUrl)throw new Error("You cannot use both the clientApiUrl and the apiBaseUrl at the same time, please use the clientApiUrl only.")}else t.clientApiUrl=t.apiBaseUrl;if(this.clientSessionId=t.clientSessionId,this.customerId=t.customerId,t.region&&!t.clientApiUrl)console.warn("Using regions is deprecated, switch to clientApiUrl"),this.clientApiUrl=this.endpoints[t.environment][t.region].API,this.assetUrl=this.endpoints[t.environment][t.region].ASSETS;else{if(this.clientApiUrl=t.clientApiUrl,this.assetUrl=t.assetUrl,!this.clientApiUrl)throw new Error("This version of the connectSDK requires an clientApiUrl, which you did not provide.");if(!this.assetUrl)throw new Error("This version of the connectSDK requires an assetUrl, which you did not provide.");if(-1===this.clientApiUrl.indexOf("//"))throw new Error("A valid URL is required for the clientApiUrl, you provided '"+this.clientApiUrl+"'");var n=this.clientApiUrl.split("/");if(""!==n[0]&&0!==n[0].indexOf("http"))throw new Error("A valid URL is required for the clientApiUrl, you provided '"+this.clientApiUrl+"'");var i=n.splice(3).join("/");if(i){if("client"===i)this.clientApiUrl+="/"+e.split("/")[1];else if(0!==i.indexOf(e)||i.length!==e.length)throw new Error("This version of the connectSDK is only compatible with "+e+", you supplied: '"+i+"'")}else this.clientApiUrl+="/"+e}};return t.C2SCommunicatorConfiguration=e,e}.apply(v={},Xt),void 0!==m||(m=v),Xt=[n,r],g=function(t,e){var n=function(){this.status="",this.countryCode="",this.paymentProductId="",this.isAllowedInContext="",this.coBrands=[]};return t.IinDetailsResponse=n,n}.apply(P={},Xt),void 0!==g||(g=P),Xt=[n,r,o,c,y,g,l,p],S=function(t,e,n,i,r,s,o,a){var c=function(t,c){var u=t,l=i.getInstance(),d={},p=c,h=this,y=new o(h),f=new a(h),m={expirydate:"tel",string:"text",numericstring:"tel",integer:"number",expirationDate:"tel"},v=function(t){return t&&S(t,"/")?t:t+"/"},g=function(t,e){return t=v(t),P(e,t)?e:t+e},P=function(t,e){return 0===t.indexOf(e)},S=function(t,e){return-1!==t.indexOf(e,t.length-e.length)},w=function(t,e){for(var n=0,i=t.fields.length;n<i;n++){var r=t.fields[n];for(var s in r.type=r.displayHints&&r.displayHints.obfuscate?"password":m[r.type],r.dataRestrictions.validators)r.validators=r.validators||[],r.validators.push(s);r.displayHints&&r.displayHints.formElement&&"list"===r.displayHints.formElement.type&&(r.displayHints.formElement.list=!0),r.displayHints&&r.displayHints.tooltip&&r.displayHints.tooltip.image&&(r.displayHints.tooltip.image=g(e,r.displayHints.tooltip.image))}return t.fields.sort(function(t,e){return t.displayHints.displayOrder<e.displayHints.displayOrder?-1:1}),t.displayHints.logo=g(e,t.displayHints.logo),t},I=function(t,e,n){for(var i=0,r=t["paymentProduct"+n].length;i<r;i++){var s=t["paymentProduct"+n][i];s.displayHints.logo=g(e,s.displayHints.logo)}return t["paymentProduct"+n].sort(function(t,e){return t.displayHints.displayOrder<e.displayHints.displayOrder?-1:1}),t},A=function(t,e){for(var n=t.length-1,i=0;n>=i;n--){var r=t[n];if(r&&r.id===e)return!0}return!1},b=function(t,e){for(var n=t.length-1,i=0;n>=i;n--){var r=t[n];if(r&&r.id===e)return r.paymentProduct320SpecificData}return!1},C=l.getMetadata(),O=function(t,e,n){l.filterOutProductsThatAreNotSupportedInThisBrowser(t),d[n]=t,0===t.paymentProducts.length?e.reject("No payment products available"):e.resolve(t)};this.getBasicPaymentProducts=function(t,i){var r=t.locale?t.locale+"_":"";i=i||{};var s=new e,o=(new Date).getTime(),a="getPaymentProducts-"+t.totalAmount+"_"+t.countryCode+"_"+r+t.isRecurring+"_"+t.currency+"_"+JSON.stringify(i);if(d[a])setTimeout(function(){s.resolve(d[a])},0);else{var c=t.locale?"&locale="+t.locale:"";n.get(v(u.clientApiUrl)+u.customerId+"/products?countryCode="+t.countryCode+"&isRecurring="+t.isRecurring+"&amount="+t.totalAmount+"¤cyCode="+t.currency+"&hide=fields"+c+"&cacheBust="+o).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(e){if(e.success){var n=I(e.responseJSON,u.assetUrl,"s");if(A(n.paymentProducts,l.applePayPaymentProductId)&&f.isApplePayAvailable(),A(n.paymentProducts,l.googlePayPaymentProductId)&&y.isMerchantIdProvided(i)){var r=b(n.paymentProducts,l.googlePayPaymentProductId);y.isGooglePayAvailable(t,i,r).then(function(){O(n,s,a)},function(){O(n,s,a)})}else O(n,s,a)}else s.reject("failed to retrieve Basic Payment Products",e)})}return s},this.getBasicPaymentProductGroups=function(t){var i=t.locale?t.locale+"_":"",r=new e,s=(new Date).getTime(),o="getPaymentProductGroups-"+t.totalAmount+"_"+t.countryCode+"_"+i+t.isRecurring+"_"+t.currency;
1if(d[o])setTimeout(function(){r.resolve(d[o])},0);else{var a=t.locale?"&locale="+t.locale:"";n.get(v(u.clientApiUrl)+u.customerId+"/productgroups?countryCode="+t.countryCode+"&isRecurring="+t.isRecurring+"&amount="+t.totalAmount+"¤cyCode="+t.currency+"&hide=fields"+a+"&cacheBust="+s).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(t){if(t.success){var e=I(t.responseJSON,u.assetUrl,"Groups");d[o]=e,r.resolve(e)}else r.reject(t.responseJSON)})}return r},this.getPaymentProduct=function(i,r,s){s=s||{};var o=r.locale?r.locale+"_":"",a=new e,c=(new Date).getTime(),h="getPaymentProduct-"+i+"_"+r.totalAmount+"_"+r.countryCode+"_"+o+r.isRecurring+"_"+r.currency+"_"+JSON.stringify(s);if(l.paymentProductsThatAreNotSupportedInThisBrowser.indexOf(i)>-1)setTimeout(function(){a.reject({errorId:"48b78d2d-1b35-4f8b-92cb-57cc2638e901",errors:[{code:"1007",propertyName:"productId",message:"UNKNOWN_PRODUCT_ID",httpStatusCode:404}]})},0);else if(p&&p.id===i)d[h]||(d[h]=w(p,u.assetUrl)),setTimeout(function(){a.resolve(d[h])},0);else if(d[h])setTimeout(function(){a.resolve(d[h])},0);else{var m=r.locale?"&locale="+r.locale:"",g=v(u.clientApiUrl)+u.customerId+"/products/"+i+"?countryCode="+r.countryCode+"&isRecurring="+r.isRecurring+"&amount="+r.totalAmount+"¤cyCode="+r.currency+m;i===l.bancontactPaymentProductId&&s&&s.bancontact&&s.bancontact.forceBasicFlow&&(g+="&forceBasicFlow="+s.bancontact.forceBasicFlow),g+="&cacheBust="+c,n.get(g).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(e){if(e.success){var n=w(e.responseJSON,t.assetUrl);if(d[h]=n,i!==l.applePayPaymentProductId||f.isApplePayAvailable())if(i===l.googlePayPaymentProductId&&y.isMerchantIdProvided(s)){var o=n.paymentProduct320SpecificData.networks;y.isGooglePayAvailable(r,s,o).then(function(t){t?a.resolve(n):a.reject(n)},function(){a.reject(n)})}else a.resolve(n);else a.reject(n)}else a.reject("failed to retrieve Payment Product",e)})}return a},this.getPaymentProductGroup=function(i,r){var s=r.locale?r.locale+"_":"",o=new e,a=(new Date).getTime(),c="getPaymentProductGroup-"+i+"_"+r.totalAmount+"_"+r.countryCode+"_"+s+r.isRecurring+"_"+r.currency;if(p&&p.id===i)d[c]||(d[c]=w(p,u.assetUrl)),setTimeout(function(){o.resolve(d[c])},0);else if(d[c])setTimeout(function(){o.resolve(d[c])},0);else{var h=r.locale?"&locale="+r.locale:"";n.get(v(u.clientApiUrl)+u.customerId+"/productgroups/"+i+"?countryCode="+r.countryCode+"&isRecurring="+r.isRecurring+"&amount="+r.totalAmount+"¤cyCode="+r.currency+h+"&cacheBust="+a).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(e){if(e.success){var n=w(e.responseJSON,t.assetUrl);d[c]=n,o.resolve(n)}else o.reject(e.responseJSON)})}return o},this.getPaymentProductIdByCreditCardNumber=function(t,i){var r=new e,o=new s,a="getPaymentProductIdByCreditCardNumber-"+t,c=this;if(this.context=i,d[a])setTimeout(function(){r.resolve(d[a])},0);else{var p=function(t){return t.length>=6};p(t)?n.post(v(u.clientApiUrl)+u.customerId+"/services/getIINdetails").data(JSON.stringify(this.convertContextToIinDetailsContext(t,this.context))).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(t){t.success?(o.json=t.responseJSON,o.countryCode=t.responseJSON.countryCode,o.paymentProductId=t.responseJSON.paymentProductId,o.isAllowedInContext=t.responseJSON.isAllowedInContext,o.coBrands=t.responseJSON.coBrands,t.responseJSON.hasOwnProperty("isAllowedInContext")?(o.status="SUPPORTED",!1===o.isAllowedInContext&&(o.status="EXISTING_BUT_NOT_ALLOWED"),d[a]=o,r.resolve(o)):c.getPaymentProduct(o.paymentProductId,c.context).then(function(t){o.status=t?"SUPPORTED":"UNSUPPORTED",d[a]=o,r.resolve(o)},function(){o.status="UNKNOWN",r.reject(o)})):(o.status="UNKNOWN",o.json=t.responseJSON,r.reject(o))}):(o.status="NOT_ENOUGH_DIGITS",setTimeout(function(){r.resolve(o)},0))}return r},this.convertContextToIinDetailsContext=function(t,e){var n={bin:t,paymentContext:{countryCode:e.countryCode,isRecurring:e.isRecurring,isInstallments:e.isInstallments,amountOfMoney:{amount:e.totalAmount,currencyCode:e.currency}}};return"undefined"!==typeof e.accountOnFileId&&(n.accountOnFileId=e.accountOnFileId),n},this.getPublicKey=function(){var t=new e,i="publicKey";return d[i]?setTimeout(function(){t.resolve(d[i])},0):n.get(v(u.clientApiUrl)+u.customerId+"/crypto/publickey").set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(e){if(e.success){var n=new r(e.responseJSON);d[i]=n,t.resolve(n)}else t.reject("unable to get public key")}),t},this.getPaymentProductNetworks=function(t,i){var r=new e,s="paymentProductNetworks-"+t+"_"+i.countryCode+"_"+i.currency+"_"+i.totalAmount+"_"+i.isRecurring;return d[s]?setTimeout(function(){r.resolve(d[s])},0):n.get(v(u.clientApiUrl)+u.customerId+"/products/"+t+"/networks?countryCode="+i.countryCode+"¤cyCode="+i.currency+"&amount="+i.totalAmount+"&isRecurring="+i.isRecurring).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(t){t.success?(d[s]=t.responseJSON,r.resolve(t.responseJSON)):r.reject(t.responseJSON)}),r},this.getPaymentProductDirectory=function(t,i,r){var s=new e,o="getPaymentProductDirectory-"+t+"_"+i+"_"+r;return d[o]?setTimeout(function(){s.resolve(d[o])},0):n.get(v(u.clientApiUrl)+u.customerId+"/products/"+t+"/directory?countryCode="+r+"¤cyCode="+i).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(t){t.success?(d[o]=t.responseJSON,s.resolve(t.responseJSON)):s.reject("unable to retrieve payment product directory")}),s},this.convertAmount=function(t,i,r){var s=new e,o="convertAmount-"+t+"_"+i+"_"+r;return d[o]?setTimeout(function(){s.resolve(d[o])},0):n.get(v(u.clientApiUrl)+u.customerId+"/services/convert/amount?source="+i+"&target="+r+"&amount="+t).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(t){t.success?(d[o]=t.responseJSON,s.resolve(t.responseJSON)):s.reject("unable to convert amount")}),s},this.getThirdPartyPaymentStatus=function(t){var i=new e;return n.get(v(u.clientApiUrl)+u.customerId+"/payments/"+t+"/thirdpartystatus").set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(t){t.success?i.resolve(t.responseJSON):i.reject("unable to retrieve third party status")}),i},this.getCustomerDetails=function(t,i){var r=new e,s="getCustomerDetails_"+i.countryCode;return s=T(s,i.values),d[s]?setTimeout(function(){r.resolve(d[s])},0):n.post(v(u.clientApiUrl)+u.customerId+"/products/"+t+"/customerDetails").data(JSON.stringify(i)).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(t){t.success?(d[s]=t.responseJSON,r.resolve(t.responseJSON)):r.reject(t.responseJSON)}),r},this.createPaymentProductSession=function(t,i){var r=new e,s="createPaymentProductSession_"+i.validationURL+"_"+i.domainName+"_"+i.displayName,o={paymentProductSession302SpecificInput:{validationUrl:i.validationURL,domainName:i.domainName,displayName:i.displayName}};return d[s]?setTimeout(function(){r.resolve(d[s])},0):n.post(v(u.clientApiUrl)+u.customerId+"/products/"+t+"/sessions").data(JSON.stringify(o)).set("X-GCS-ClientMetaInfo",l.base64Encode(C)).set("Authorization","GCS v1Client:"+u.clientSessionId).end(function(t){t.success?(d[s]=t.responseJSON,r.resolve(t.responseJSON)):r.reject(t.responseJSON)}),r},this.initApplePayPayment=function(t,n,i){var r=new e,s=t;return s.displayName=n.merchantName,n.acquirerCountry&&(s.acquirerCountry=n.acquirerCountry),s.networks=i,f.initPayment(s,this).then(function(t){r.resolve(t)},function(t){r.reject(t)}),r};var T=function(t,e){var n=t;for(var i in e)e.hasOwnProperty(i)&&(n+="_"+e[i].key+"_"+e[i].value);return n};this.transformPaymentProductJSON=function(t){return w(t,u.assetUrl)}};return t.C2SCommunicator=c,c}.apply(w={},Xt),void 0!==S||(S=w),Xt=[n],I=function(t){var e=function(t){this.json=t,this.attributeKey=t.attributeKey,this.mask=t.mask,this.wildcardMask=t.mask?t.mask.replace(/9/g,"*"):""};return t.LabelTemplateElement=e,e}.apply(A={},Xt),void 0!==I||(I=A),Xt=[n],b=function(t){var e=function(t){this.json=t,this.key=t.key,this.value=t.value,this.status=t.status,this.mustWriteReason=t.mustWriteReason};return t.Attribute=e,e}.apply(C={},Xt),void 0!==b||(b=C),Xt=[n,I],O=function(t,e){var n=function(t,n,i){if(t.labelTemplate)for(var r=0,s=t.labelTemplate.length;r<s;r++){var o=new e(t.labelTemplate[r]);n.push(o),i[o.attributeKey]=o}},i=function(t){this.json=t,this.labelTemplate=[],this.labelTemplateElementByAttributeKey={},n(t,this.labelTemplate,this.labelTemplateElementByAttributeKey)};return t.AccountOnFileDisplayHints=i,i}.apply(T={},Xt),void 0!==O||(O=T),Xt=[n,O,b],N=function(t,e,n){var i=function(t,e,
1i){if(t.attributes)for(var r=0,s=t.attributes.length;r<s;r++){var o=new n(t.attributes[r]);e.push(o),i[o.key]=o}},r=function(n){this.json=n,this.attributes=[],this.attributeByKey={},this.displayHints=new e(n.displayHints),this.id=n.id,this.paymentProductId=n.paymentProductId,this.getMaskedValueByAttributeKey=function(e){var n,i=this.attributeByKey[e].value;try{n=this.displayHints.labelTemplateElementByAttributeKey[e].wildcardMask}catch(s){}if(void 0!==i&&void 0!==n){var r=new t.MaskingUtil;return r.applyMask(n,i)}},i(n,this.attributes,this.attributeByKey)};return t.AccountOnFile=r,r}.apply(E={},Xt),void 0!==N||(N=E),Xt=[n],M=function(t){var e=function(t){this.json=t,this.networks=t.networks};return t.PaymentProduct302SpecificData=e,e}.apply(B={},Xt),void 0!==M||(M=B),Xt=[n],j=function(t){var e=function(t){this.json=t,this.gateway=t.gateway,this.networks=t.networks};return t.PaymentProduct320SpecificData=e,e}.apply(R={},Xt),void 0!==j||(j=R),Xt=[n],k=function(t){var e=function(t){this.json=t,this.integrationTypes=t.integrationTypes};return t.PaymentProduct863SpecificData=e,e}.apply(U={},Xt),void 0!==k||(k=U),Xt=[n],D=function(t){var e=function(t){this.json=t,this.displayOrder=t.displayOrder,this.label=t.label,this.logo=t.logo};return t.PaymentProductDisplayHints=e,e}.apply(F={},Xt),void 0!==D||(D=F),Xt=[n,N,D,M,j,k],x=function(t,e,n,i,r,s){var o=function(t,n,o,a){if(t.accountsOnFile)for(var c=0,u=t.accountsOnFile.length;c<u;c++){var l=new e(t.accountsOnFile[c]);o.push(l),a[l.id]=l}t.paymentProduct302SpecificData&&(n.paymentProduct302SpecificData=new i(t.paymentProduct302SpecificData)),t.paymentProduct320SpecificData&&(n.paymentProduct320SpecificData=new r(t.paymentProduct320SpecificData)),t.paymentProduct863SpecificData&&(n.paymentProduct863SpecificData=new s(t.paymentProduct863SpecificData))},a=function(t){this.json=t,this.json.type="product",this.accountsOnFile=[],this.accountOnFileById={},this.allowsRecurring=t.allowsRecurring,this.allowsTokenization=t.allowsTokenization,this.autoTokenized=t.autoTokenized,this.allowsInstallments=t.allowsInstallments,this.acquirerCountry=t.acquirerCountry,this.displayHints=new n(t.displayHints),this.id=t.id,this.maxAmount=t.maxAmount,this.minAmount=t.minAmount,this.paymentMethod=t.paymentMethod,this.mobileIntegrationLevel=t.mobileIntegrationLevel,this.usesRedirectionTo3rdParty=t.usesRedirectionTo3rdParty,this.paymentProductGroup=t.paymentProductGroup,o(t,this,this.accountsOnFile,this.accountOnFileById)};return t.BasicPaymentProduct=a,a}.apply(G={},Xt),void 0!==x||(x=G),Xt=[n,N,D],_=function(t,e,n){var i=function(t,n,i){if(t.accountsOnFile)for(var r=0,s=t.accountsOnFile.length;r<s;r++){var o=new e(t.accountsOnFile[r]);n.push(o),i[o.id]=o}},r=function(t){this.json=t,this.json.type="group",this.id=t.id,this.acquirerCountry=t.acquirerCountry,this.displayHints=new n(t.displayHints),this.accountsOnFile=[],this.accountOnFileById={},i(t,this.accountsOnFile,this.accountOnFileById)};return t.BasicPaymentProductGroup=r,r}.apply(V={},Xt),void 0!==_||(_=V),Xt=[n],H=function(t){var e=function(t,e){this.formattedValue=t,this.cursorIndex=e};return t.MaskedString=e,e}.apply(J={},Xt),void 0!==H||(H=J),Xt=[n,H],L=function(t,e){var n=function(t,e,i,r,s){t+e<s.length&&t<r.length&&("9"===r[t]&&Number(s[t+e])>-1&&" "!==s[t+e]||"*"===r[t]||s[t+e]===r[t]?i.push(s[t+e]):"9"!==r[t]&&"*"!==r[t]?(i.push(r[t]),e--):(s.splice(t+e,1),t--),n(t+1,e,i,r,s))},i=function(){this.applyMask=function(t,i,r){var s=[],o=i.split("");if(t){for(var a=t.split(""),c=[],u=0,l=a.length;u<l;u++){var d=a[u];"{"===d||"}"===d||c.push(d)}n(0,0,s,c,o)}else for(u=0,l=o.length;u<l;u++){d=o[u];s.push(d)}i=s.join("");var p=1;if(r){var h=r.split("");for(u=0,l=s.length;u<l;u++)if(s[u]!==h[u]){p=u+1;break}}return i.substring(0,i.length-1)===r&&(p=i.length+1),new e(i,p)},this.getMaxLengthBasedOnMask=function(t){if(t){for(var e=t.split(""),n=-1,i=0,r=e.length;i<r;i++){n++;var s=e[i];"{"!==s&&"}"!==s||n--}return n}},this.removeMask=function(t,e){var n=[],i=e?e.split(""):[];if(t)for(var r=t.split(""),s=-1,o=!1,a=0,c=r.length;a<c;a++){s++;var u=r[a];"{"===u||"}"===u?(s--,"{"===u?o=!0:"}
1"===u&&(o=!1)):o&&i[s]&&n.push(i[s])}else for(a=0,c=i.length;a<c;a++){u=i[a];n.push(u)}return n.join("").trim()}};return t.MaskingUtil=i,i}.apply(z={},Xt),void 0!==L||(L=z),Xt=[n],X=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.validate=function(t){var e=[[0,2,4,6,8,1,3,5,7,9],[0,1,2,3,4,5,6,7,8,9]],n=0;return t.replace(/\D+/g,"").replace(/[\d]/g,function(t,i,r){n+=e[r.length-i&1][parseInt(t,10)]}),n%10===0&&n>0}};return t.ValidationRuleLuhn=e,e}.apply(K={},Xt),void 0!==X||(X=K),Xt=[n],q=function(t){var e=function(t){var e=/\d{4}|\d{6}$/g;return e.test(t)},n=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.validate=function(t){if(t=t.replace(/[^\d]/g,""),!e(t))return!1;var n;if(4===t.length)n=[t.substring(0,2),"20"+t.substring(2,4)];else{if(6!==t.length)return!1;n=[t.substring(0,2),t.substring(2,6)]}var i=n[0]-1,r=n[1],s=new Date(r,i,1);if(s.getMonth()!==Number(i)||s.getFullYear()!==Number(r))return!1;var o=new Date,a=new Date(o.getFullYear(),o.getMonth(),1),c=new Date(o.getFullYear()+25,11,1);return s>=a&&s<=c}};return t.ValidationRuleExpirationDate=n,n}.apply(W={},Xt),void 0!==q||(q=W),Xt=[n],Y=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.allowedValues=t.attributes.allowedValues,this.validate=function(t){for(var e=0,n=this.allowedValues.length;e<n;e++)if(this.allowedValues[e]===t)return!0;return!1}};return t.ValidationRuleFixedList=e,e}.apply($={},Xt),void 0!==Y||(Y=$),Xt=[n],Z=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.maxLength=t.attributes.maxLength,this.minLength=t.attributes.minLength,this.validate=function(t){return this.minLength<=t.length&&t.length<=this.maxLength}};return t.ValidationRuleLength=e,e}.apply(Q={},Xt),void 0!==Z||(Z=Q),Xt=[n],tt=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.maxValue=t.attributes.maxValue,this.minValue=t.attributes.minValue,this.validate=function(t){return!isNaN(t)&&(t=Number(t),this.minValue<=t&&t<=this.maxValue)}};return t.ValidationRuleRange=e,e}.apply(et={},Xt),void 0!==tt||(tt=et),Xt=[n],nt=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.regularExpression=t.attributes.regularExpression,this.validate=function(t){var e=new RegExp(this.regularExpression);return e.test(t)}};return t.ValidationRuleRegularExpression=e,e}.apply(it={},Xt),void 0!==nt||(nt=it),Xt=[n],rt=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type;for(var e=[],n=18;n>0;n--)e.push(Math.pow(2,n-1)%11);this.validate=function(t){if(t.length<15)return!1;if(15==t.length)return!isNaN(t);if(t.length<18||t.length>18)return!1;for(var n=0,i=0;i<t.length-1;i++)n+=t.charAt(i)*e[i];var r=(12-n%11)%11,s=t.charAt(17);return r<10?r==s:!!s&&"X"===s.toUpperCase()}};return t.ValidationRuleResidentIdNumber=e,e}.apply(st={},Xt),void 0!==rt||(rt=st),Xt=[n],ot=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.validate=function(t){var e=new RegExp(/^[^@\.]+(\.[^@\.]+)*@([^@\.]+\.)*[^@\.]+\.[^@\.][^@\.]+$/i);return e.test(t)}};return t.ValidationRuleEmailAddress=e,e}.apply(at={},Xt),void 0!==ot||(ot=at),Xt=[n],ct=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.validate=function(t){return!0===t||"true"===t}};return t.ValidationRuleTermsAndConditions=e,e}.apply(ut={},Xt),void 0!==ct||(ct=ut),Xt=[n],lt=function(t){var e=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.fiscalNumberLength=t.attributes.fiscalNumberLength,this.validate=function(t,e){return"undefined"===typeof e&&(e=""),e.length===this.fiscalNumberLength&&t.length>0||e.length!==this.fiscalNumberLength}};return t.ValidationRuleBoletoBancarioRequiredness=e,e}.apply(dt={},Xt),void 0!==lt||(lt=dt),Xt=[n],pt=function(t){var e=function(t){return t.replace(/[^\d\w]+/g,"").toUpperCase()},n=function(t){return"string"===typeof t&&/^[A-Z]{2}[0-9]{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}$/.test(e(t))},i=function(t){return e(t).replace(/(^.{4})(.*)/,"$2$1").replace(/[A-Z]/g,function(t){return t.charCodeAt(0)-55})},r=function(t){this.json=t,this.type=t.type,this.errorMessageId=t.type,this.validate=function(t){if(!n(t))return!1;var e,r=i(t);while(r.length>2)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97===1}};return t.ValidationRuleIban=r,r}.apply(ht={},Xt),void 0!==pt||(pt=ht),Xt=[n,ot,ct,q,Y,Z,X,tt,nt,lt,pt,rt],yt=function(t,e,n,i,r,s,o,a,c,u,l,d){var p={EmailAddress:e,TermsAndConditions:n,ExpirationDate:i,FixedList:r,Length:s,Luhn:o,Range:a,RegularExpression:c,BoletoBancarioRequiredness:u,Iban:l,ResidentIdNumber:d},h=function(){this.makeValidator=function(t){try{var e=t.type.charAt(0).toUpperCase()+t.type.slice(1);return new p[e](t)}catch(n){console.warn("no validator for ",e)}return null}};return t.ValidationRuleFactory=h,h}.apply(ft={},Xt),void 0!==yt||(yt=ft),Xt=[n,q,Y,Z,X,tt,nt,ot,ct,pt,rt,yt],mt=function(t,e,n,i,r,s,o,a,c,u,l,d){var p=function(t,e){var n=function(t,e,n){var i=new d;if(t.validators)for(var r in t.validators){var s=i.makeValidator({type:r,attributes:t.validators[r]});s&&(e.push(s),n[s.type]=s)}};this.json=t,this.isRequired=t.isRequired,this.validationRules=[],this.validationRuleByType={},n(t,this.validationRules,this.validationRuleByType)};return t.DataRestrictions=p,p}.apply(vt={},Xt),void 0!==mt||(mt=vt),Xt=[n],gt=function(t){var e=function(t){this.json=t,this.displayName=t.displayName,this.value=t.value};return t.ValueMappingElement=e,e}.apply(Pt={},Xt),void 0!==gt||(gt=Pt),Xt=[n,gt],St=function(t,e){var n=function(t){var n=function(t,n){if(t.valueMapping)for(var i=0,r=t.valueMapping.length;i<r;i++)n.push(new e(t.valueMapping[i]))};this.json=t,this.type=t.type,this.valueMapping=[],n(t,this.valueMapping)};return t.FormElement=n,n}.apply(wt={},Xt),void 0!==St||(St=wt),Xt=[n],It=function(t){var e=function(t){this.json=t,this.image=t.image,this.label=t.label};return t.Tooltip=e,e}.apply(At={},Xt),void 0!==It||(It=At),Xt=[n,It,St],bt=function(t,e,n){var i=function(t){this.json=t,this.displayOrder=t.displayOrder,t.formElement&&(this.formElement=new n(t.formElement)),this.label=t.label,this.mask=t.mask,this.obfuscate=t.obfuscate,this.placeholderL
1abel=t.placeholderLabel,this.preferredInputType=t.preferredInputType,this.tooltip=t.tooltip?new e(t.tooltip):void 0,this.alwaysShow=t.alwaysShow,this.wildcardMask=t.mask?t.mask.replace(/9/g,"*"):""};return t.PaymentProductFieldDisplayHints=i,i}.apply(Ct={},Xt),void 0!==bt||(bt=Ct),Xt=[n,bt,mt,L],Ot=function(t,e,n,i){var r=function(t){this.json=t,this.displayHints=t.displayHints?new e(t.displayHints):"",this.dataRestrictions=new n(t.dataRestrictions,this.displayHints?this.displayHints.mask:""),this.id=t.id,this.type=t.type;var r=[];this.getErrorCodes=function(t){return t&&(r=[],this.isValid(t)),r},this.isValid=function(t){var e=this.dataRestrictions.validationRules,n=!1,i=this.applyMask(t);t=this.removeMask(i.formattedValue);for(var s=0,o=e.length;s<o;s++){var a=e[s];a.validate(t)||(n=!0,r.push(a.errorMessageId))}return!n},this.applyMask=function(t,e){var n=new i;return n.applyMask(this.displayHints.mask,t,e)},this.applyWildcardMask=function(t,e){var n=new i;return n.applyMask(this.displayHints.wildcardMask,t,e)},this.removeMask=function(t){var e=new i;return e.removeMask(this.displayHints.mask,t)}};return t.PaymentProductField=r,r}.apply(Tt={},Xt),void 0!==Ot||(Ot=Tt),Xt=[n,x,Ot],Nt=function(t,e,n){var i=function(t,e,i){if(t.fields)for(var r=0,s=t.fields.length;r<s;r++){var o=new n(t.fields[r]);e.push(o),i[o.id]=o}},r=function(t){var n=new e(t);return n.paymentProductFields=[],n.paymentProductFieldById={},i(n.json,n.paymentProductFields,n.paymentProductFieldById),n};return t.PaymentProduct=r,r}.apply(Et={},Xt),void 0!==Nt||(Nt=Et),Xt=[n,x,Ot],Mt=function(t,e,n){var i=function(t,e,i){if(t.fields)for(var r=0,s=t.fields.length;r<s;r++){var o=new n(t.fields[r]);e.push(o),i[o.id]=o}},r=function(t){var n=new e(t);return n.json=t,n.json.type="group",n.paymentProductFields=[],n.paymentProductFieldById={},i(n.json,n.paymentProductFields,n.paymentProductFieldById),n};return t.PaymentProductGroup=r,r}.apply(Bt={},Xt),void 0!==Mt||(Mt=Bt),Xt=[n,x],jt=function(t,e){var n=function(t,n,i,r,s,o){if(t.paymentProducts)for(var a=0,c=t.paymentProducts.length;a<c;a++){var u=new e(t.paymentProducts[a]);if(n.push(u),r[u.id]=u,u.accountsOnFile)for(var l=u.accountsOnFile,d=0,p=l.length;d<p;d++){var h=l[d];i.push(h),s[h.id]=h,o[h.id]=u}}},i=function(t){this.basicPaymentProducts=[],this.basicPaymentProductById={},this.basicPaymentProductByAccountOnFileId={},this.accountsOnFile=[],this.accountOnFileById={},this.json=t,n(t,this.basicPaymentProducts,this.accountsOnFile,this.basicPaymentProductById,this.accountOnFileById,this.basicPaymentProductByAccountOnFileId)};return t.BasicPaymentProducts=i,i}.apply(Rt={},Xt),void 0!==jt||(jt=Rt),Xt=[n,_],kt=function(t,e){var n=function(t,n,i,r,s){if(t.paymentProductGroups)for(var o=0,a=t.paymentProductGroups.length;o<a;o++){var c=new e(t.paymentProductGroups[o]);if(n.push(c),r[c.id]=c,c.accountsOnFile)for(var u=c.accountsOnFile,l=0,d=u.length;l<d;l++){var p=u[l];i.push(p),s[p.id]=p}}},i=function(t){this.basicPaymentProductGroups=[],this.basicPaymentProductGroupById={},this.accountsOnFile=[],this.accountOnFileById={},this.json=t,n(t,this.basicPaymentProductGroups,this.accountsOnFile,this.basicPaymentProductGroupById,this.accountOnFileById)};return t.BasicPaymentProductGroups=i,i}.apply(Ut={},Xt),void 0!==kt||(kt=Ut),Xt=[n],Dt=function(t){"use strict";var e=function(t,e,n){var i=[];if(e){for(var r=0,s=e.basicPaymentProductGroups.length;r<s;r++)for(var o=e.basicPaymentProductGroups[r].id,a=!1,c=0,u=t.basicPaymentProducts.length;c<u;c++){var l=t.basicPaymentProducts[c].paymentProductGroup;l===o&&!1===a?(t.basicPaymentProducts.splice(c,1,e.basicPaymentProductGroups[r]),a=!0):l===o&&!0===a&&i.push(c)}for(r=i.length-1,s=0;r>=s;r--)t.basicPaymentProducts.splice(i[r],1)}n.basicPaymentItems=JSON.parse(JSON.stringify(t.basicPaymentProducts));for(r=0,s=n.basicPaymentItems.length;r<s;r++){var d=n.basicPaymentItems[r];if(n.basicPaymentItemById[d.id]=d,d.accountsOnFile){var p=d.accountsOnFile;for(c=0,u=p.length;c<u;c++){var h=p[c];n.accountsOnFile.push(h),n.accountOnFileById[h.id]=h}}}},n=function(t,n){this.basicPaymentItems=[],this.basicPaymentItemById={},this.accountsOnFile=[],this.accountOnFileById={},e(t,n,this)};return t.BasicPaymentItems=n,n}.apply(Ft={},Xt),void 0!==Dt||(Dt=Ft),Xt=[n],xt=function(t){var e=function(t){var e={},n=null,i=null,r=!1;this.isValid=function(){var t=this.getErrorMessageIds(),e=this.getPaymentProduct();if(!e)return!1;for(var n=!0,i=0;i<e.paymentProductFields.length;i++){var r=e.paymentProductFields[i];if(r.dataRestrictions.isRequired){var s=this.getValue(r.id);s||this.getAccountOnFile()||(n=!1)}}return 0===t.length&&n},this.setValue=function(t,n){e[t]=n},this.setTokenize=function(t){r=t},this.getTokenize=function(){return r},this.getErrorMessageIds=function(){var t=[];for(var i in e){var r=n.paymentProductFieldById[i];r&&(t=t.concat(r.getErrorCodes(e[i])))}return t},this.getValue=function(t){return e[t]},this.getValues=function(){return e},this.getMaskedValue=function(t){var e=n.paymentProductFieldById[t],i=e.applyM
1ask(this.getValue(t));return i.formattedValue()},this.getMaskedValues=function(){var t=e,i=[];for(var r in t){var s=n.paymentProductFieldById[r],o=s.applyMask(this.getValue(r));i[r]=o.formattedValue}return i},this.getUnmaskedValues=function(){var t=e,i=[];for(var r in t){var s=n.paymentProductFieldById[r];if(s){var o=s.applyMask(this.getValue(r)),a=o.formattedValue;i[r]=s.removeMask(a)}}return i},this.setPaymentProduct=function(t){"group"!==t.type&&(n=t)},this.getPaymentProduct=function(){return n},this.setAccountOnFile=function(t){for(var n=0,r=t.attributes.length;n<r;n++){var s=t.attributes[n];delete e[s.key]}i=t},this.getAccountOnFile=function(){return i},this.getClientSessionID=function(){return t}};return t.PaymentRequest=e,e}.apply(Gt={},Xt),void 0!==xt||(xt=Gt),Xt=[n],_t=function(t){var e=function(t){this.totalAmount="undefined"!==typeof t.totalAmount?t.totalAmount:"",this.countryCode=t.countryCode,this.isRecurring="undefined"!==typeof t.isRecurring?t.isRecurring:"",this.currency=t.currency,"undefined"!==typeof t.locale&&(this.locale=t.locale),this.isInstallments=t.isInstallments||"","undefined"!==typeof t.accountOnFileId&&(this.accountOnFileId=parseInt(t.accountOnFileId))};return t.C2SPaymentProductContext=e,e}.apply(Vt={},Xt),void 0!==_t||(_t=Vt),Xt=[n],Ht=function(t){var e=forge.pki,n=(forge.asn1,512),i=128,r=function(t){return t=forge.util.encode64(t),t=t.split("=")[0],t=t.replace(/\+/g,"-"),t=t.replace(/\//g,"_"),t},s=function(t){var e={alg:"RSA-OAEP",enc:"A256CBC-HS512",kid:t};return JSON.stringify(e)},o=function(t){var n=forge.util.decode64(t),i=forge.util.createBuffer(n,"raw"),r=forge.asn1.fromDer(i),s=e.publicKeyFromAsn1(r);return s},a=function(t,e){var n=e.encrypt(t,"RSA-OAEP");return n},c=function(t,e,n){var i=forge.cipher.createCipher("AES-CBC",e);return i.start({iv:n}),i.update(forge.util.createBuffer(t)),i.finish(),i.output.bytes()},u=function(t){var e=forge.util.createBuffer(t),n=8*e.length(),i=forge.util.createBuffer();return i.putInt32(0),i.putInt32(n),i.bytes()},l=function(t,e,n,i,r){var s=forge.util.createBuffer();s.putBytes(e),s.putBytes(n),s.putBytes(i),s.putBytes(r);var o=s.bytes(),a=forge.hmac.create();return a.start(forge.sha512.create(),t),a.update(o),a.digest().bytes()},d=function(){this.encrypt=function(t,e){var d=JSON.stringify(t),p=s(e.keyId),h=r(p),y=forge.random.getBytesSync(n/8),f=o(e.publicKey),m=a(y,f),v=r(m),g=y.substring(0,n/2/8),P=y.substring(n/2/8),S=forge.random.getBytesSync(i/8),w=r(S),I=c(d,P,S),A=r(I),b=u(h),C=l(g,h,S,I,b),O=C.substring(0,C.length/2),T=r(O);return h+"."+v+"."+w+"."+A+"."+T}};return t.JOSEEncryptor=d,d}.apply(Jt={},Xt),void 0!==Ht||(Ht=Jt),Xt=[n,r,Ht,c],Lt=function(t,e,n,i){var r=i.getInstance(),s=function(t){this.encrypt=function(i){var s=new e,o="";return t.then(function(t){if(i.isValid()){var e={clientSessionId:i.getClientSessionID(),nonce:forge.util.bytesToHex(forge.random.getBytesSync(16)),paymentProductId:i.getPaymentProduct().id,tokenize:i.getTokenize()};i.getAccountOnFile()&&(e["accountOnFileId"]=i.getAccountOnFile().id);for(var a=[],c=i.getUnmaskedValues(),u=Object.getOwnPropertyNames(c),l=0;l<u.length;l++){var d=u[l];"length"!==d&&a.push({key:d,value:c[d]})}e["paymentValues"]=a,e["collectedDeviceInformation"]=r.collectDeviceInformation();var p=new n;o=p.encrypt(e,t),s.resolve(o)}else s.reject(i.getErrorMessageIds())},function(t){s.reject(t)}),s}};return t.Encryptor=s,s}.apply(zt={},Xt),void 0!==Lt||(Lt=zt),Xt=[n,S,m,g,r,_t,jt,kt,Nt,Mt,Dt,xt,Lt],Kt=function(t,e,n,i,r,s,o,a,c,u,l,d,p){var h="client/v1",y=function(t,i){var y,f,m,v,g=new n(t,h),P=new e(g,i),S=this;this.clientApiUrl=g.clientApiUrl,this.assetUrl=g.assetUrl,this.getBasicPaymentProducts=function(t,e){var n=new r,i=new s(t);return P.getBasicPaymentProducts(i,e).then(function(e){f=t;var i=new o(e);n.resolve(i)},function(t){n.reject(t)}),n},this.getBasicPaymentProductGroups=function(t){var e=new r,n=new s(t);return P.getBasicPaymentProductGroups(n).then(function(n){f=t;var i=new a(n);e.resolve(i)},function(t){e.reject(t)}),e},this.getBasicPaymentItems=function(t,e,n){var i=new r;
1return e?S.getBasicPaymentProducts(t,n).then(function(e){S.getBasicPaymentProductGroups(t).then(function(t){var n=new l(e,t);i.resolve(n)},function(t){i.reject(t)})},function(t){i.reject(t)}):S.getBasicPaymentProducts(t,n).then(function(t){var e=new l(t,null);i.resolve(e)},function(t){i.reject(t)}),i},this.getPaymentProduct=function(t,e,n){var i=new r;0;var o=new s(f||e);return P.getPaymentProduct(t,o,n).then(function(t){y=new c(t),i.resolve(y)},function(t){y=null,i.reject(t)}),i},this.getPaymentProductGroup=function(t,e){var n=new r;0;var i=new s(f||e);return P.getPaymentProductGroup(t,i).then(function(t){v=new u(t),n.resolve(v)},function(t){v=null,n.reject(t)}),n},this.getIinDetails=function(t,e){t=t.replace(/ /g,""),t=t.length>=8?t.substring(0,8):t.substring(0,6);var n=new s(f||e);return P.getPaymentProductIdByCreditCardNumber(t,n)},this.getPublicKey=function(){return P.getPublicKey()},this.getPaymentProductNetworks=function(t,e){var n=new r,i=new s(e);return P.getPaymentProductNetworks(t,i).then(function(t){f=e,n.resolve(t)},function(t){n.reject(t)}),n},this.getPaymentProductDirectory=function(t,e,n){return P.getPaymentProductDirectory(t,e,n)},this.convertAmount=function(t,e,n){return P.convertAmount(t,e,n)},this.getPaymentRequest=function(){return m||(m=new d(g.clientSessionId)),m},this.getEncryptor=function(){var t=P.getPublicKey();return new p(t)},this.getThirdPartyPaymentStatus=function(t){var e=new r;return P.getThirdPartyPaymentStatus(t).then(function(t){e.resolve(t)},function(t){e.reject(t)}),e},this.getCustomerDetails=function(t,e){return P.getCustomerDetails(t,e)},this.createPaymentProductSession=function(t,e){return P.createPaymentProductSession(t,e)},this.createApplePayPayment=function(t,e,n){var i=new r;return P.initApplePayPayment(t,e,n).then(function(t){i.resolve(t)},function(t){i.reject(t)}),i},this.transformPaymentProductJSON=function(t){return new c(P.transformPaymentProductJSON(t))},this.transformPaymentProductGroupJSON=function(t){return new u(P.transformPaymentProductJSON(t))}};return t.Session=y,y}.apply(e,Xt),void 0===Kt||(t.exports=Kt)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.