PageSourceSearch

https://www.surlatable.com/mobify/bundle/4007/paypal.js

js surlatable.com collected 2026-10-02 03:30:58 UTC 11,505 bytes, 2 lines download raw bytes

1/*! For license information please see paypal.js.LICENSE.txt */
2"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[962],{27418(e,t,n){n.d(t,{JV:()=>I,ag:()=>x});var r,o,a,i=n(53828);!function(e){e.INITIAL="initial",e.PENDING="pending",e.REJECTED="rejected",e.RESOLVED="resolved"}(r||(r={})),function(e){e.LOADING_STATUS="setLoadingStatus",e.RESET_OPTIONS="resetOptions",e.SET_BRAINTREE_INSTANCE="braintreeInstance"}(o||(o={})),function(e){e.NUMBER="number",e.CVV="cvv",e.EXPIRATION_DATE="expirationDate",e.EXPIRATION_MONTH="expirationMonth",e.EXPIRATION_YEAR="expirationYear",e.POSTAL_CODE="postalCode"}(a||(a={}));var c=function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c.apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var l="data-react-paypal-script-id",d="dataJsSdkLibrary",f="react-paypal-js",p="dataNamespace",m="dataSdkIntegrationSource",v="Failed to load the PayPal JS SDK script.",y="3.117.0",h=("https://js.braintreegateway.com/web/".concat(y,"/js/client.min.js"),"https://js.braintreegateway.com/web/".concat(y,"/js/paypal-checkout.min.js"),"paypal");function E(e){return void 0===e&&(e=h),window[e]}function b(e){var t=e.reactComponentName,n=e.sdkComponentKey,r=e.sdkRequestedComponents,o=void 0===r?"":r,a=e.sdkDataNamespace,i=void 0===a?h:a,c=n.charAt(0).toUpperCase().concat(n.substring(1)),s="Unable to render <".concat(t," /> because window.").concat(i,".").concat(c," is undefined."),u="string"==typeof o?o:o.join(",");if(!u.includes(n)){var l=[u,n].filter(Boolean).join();s+="\nTo fix the issue, add '".concat(n,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n`<PayPalScriptProvider options={{ components: '".concat(l,"'}}>`.")}return s}function g(e){var t=e,n=l;t[n];var r=s(t,[n+""]);return"react-paypal-js-".concat(function(e){for(var t="",n=0;n<e.length;n++){var r=e[n].charCodeAt(0)*n;e[n+1]&&(r+=e[n+1].charCodeAt(0)*(n-1)),t+=String.fromCharCode(97+Math.abs(r)%26)}return t}(JSON.stringify(r)))}function S(e,t){var n,a,i,s;switch(t.type){case o.LOADING_STATUS:return"object"==typeof t.value?c(c({},e),{loadingStatus:t.value.state,loadingStatusErrorMessage:t.value.message}):c(c({},e),{loadingStatus:t.value});case o.RESET_OPTIONS:return i=e.options[l],(null==(s=self.document.querySelector("script[".concat(l,'="').concat(i,'"]')))?void 0:s.parentNode)&&s.parentNode.removeChild(s),c(c({},e),{loadingStatus:r.PENDING,options:c(c((n={},n[m]=f,n),t.value),(a={},a[l]="".concat(g(t.value)),a))});case o.SET_BRAINTREE_INSTANCE:return c(c({},e),{braintreePayPalCheckoutInstance:t.value});default:return e}}var N=(0,i.createContext)(null);function P(e){if("function"==typeof(null==e?void 0:e.dispatch)&&0!==e.dispatch.length)return e;throw new Error("usePayPalScriptReducer must be used within a PayPalScriptProvider")}function w(){var e=P((0,i.useContext)(N));return[c(c({},e),{isInitial:e.loadingStatus===r.INITIAL,isPending:e.loadingStatus===r.PENDING,isResolved:e.loadingStatus===r.RESOLVED,isRejected:e.loadingStatus===r.REJECTED}),e.dispatch]}(0,i.createContext)({});function O(e){var t=(0,i.useRef)(new Proxy({},{get:function(e,t,n){return"function"==typeof e[t]?function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e[t].apply(e,n)}:Reflect.get(e,t,n)}}));return t.current=Object.assign(t.current,e),t.current}var I=function(e){var t,n=e.className,r=void 0===n?"":n,o=e.disabled,a=void 0!==o&&o,l=e.children,d=e.forceReRender,f=void 0===d?[]:d,m=s(e,["className","disabled","children","forceReRender"]),v=a?{opacity:.38}:{},y="".concat(r," ").concat(a?"paypal-buttons-disabled":"").trim(),h=(0,i.useRef)(null),g=(0,i.useRef)(null),S=O(m),N=w()[0],P=N.isResolved,R=N.options,A=(0,i.useState)(null),T=A[0],j=A[1],C=(0,i.useState)(!0),k=C[0],D=C[1],_=(0,i.useState)(null)[1];function L(){null!==g.current&&g.current.close()["catch"](function(){})}return(null===(t=g.current)||void 0===t?void 0:t.updateProps)&&g.current.updateProps({message:m.message}),(0,i.useEffect)(function(){if(!1===P)return L;var e=E(R.dataNamespace);if(e===undefined||e.Buttons===undefined)return _(function(){throw new Error(b({reactComponentName:I.displayName,sdkComponentKey:"buttons",sdkRequestedComponents:R.components,sdkDataNamespace:R[p]}))}),L;try{g.current=e.Buttons(c(c({},S),{onInit:function(e,t){j(t),"function"==typeof m.onInit&&m.onInit(e,t)}}))}catch(t){return _(function(){throw new Error("Failed to render <PayPalButtons /> component. Failed to initialize:  ".concat(t))})}return!1===g.current.isEligible()?(D(!1),L):h.current?(g.current.render(h.current)["catch"](function(e){null!==h.current&&0!==h.current.children.length&&_(function(){throw new Error("Failed to render <PayPalButtons /> component. ".concat(e))})}),L):L},u(u([P],f,!0),[m.fundingSource],!1)),(0,i.useEffect)(function(){null!==T&&(!0===a?T.disable()["catch"](function(){}):T.enable()["catch"](function(){}))},[a,T]),i.createElement(i.Fragment,null,k?i.createElement("div",{ref:h,style:v,className:y}):l)};function R(e){var t=e.sdkBaseUrl,n=e.environment,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["sdkBaseUrl","environment"]),o=t||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(n),a=r,i=Object.keys(a).filter(function(e){return"undefined"!=typeof a[e]&&null!==a[e]&&""!==a[e]}).reduce(function(e,t){var n,r=a[t].toString();return n=function(e,t){return(t?"-":"")+e.toLowerCase()},"data"===(t=t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)).substring(0,4)||"crossorigin"===t?e.attributes[t]=r:e.queryParams[t]=r,e},{queryParams:{},attributes:{}}),c=i.queryParams,s=i.attributes;return c["merchant-id"]&&-1!==c["merchant-id"].indexOf(",")&&(s["data-merchant-id"]=c["merchant-id"],c["merchant-id"]="*"),{url:"".concat(o,"?").concat(A(c)),attributes:s}}function A(e){var t="";return Object.keys(e).forEach(function(n){0!==t.length&&(t+="&"),t+=n+"="+e[n]}),t}function T(e,t){void 0===t&&(t={});var n=document.createElement("script");return n.src=e,Object.keys(t).forEach(function(e){n.setAttribute(e,t[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",t["data-csp-nonce"])}),n}function j(e,t){if(void 0===t&&(t=Promise),D(e,t),"undefined"==typeof document)return t.resolve(null);var n=R(e),r=n.url,o=n.attributes,a=o["data-namespace"]||"paypal",i=k(a);return o["data-js-sdk-library"]||(o["data-js-sdk-library"]="paypal-js"),function(e,t){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var r=T(e,t),o=n.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(r.dataset).length)return null;var a=!0;return Object.keys(o.dataset).forEach(function(e){o.dataset[e]!==r.dataset[e]&&(a=!1)}),a?n:null}(r,o)&&i?t.resolve(i):C({url:r,attributes:o},t).then(function(){var e=k(a);if(e)return e;throw new Error("The window.".concat(a," global variable is not available."))})}function C(e,t){void 0===t&&(t=Promise),D(e,t);var n=e.url,r=e.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)throw new Error("Expected attributes to be an object.");return new t(function(e,t){if("undefined"==typeof document)return e();!function(e){var t=e.url,n=e.attributes,r=e.onSuccess,o=e.onError,a=T(t,n);a.onerror=o,a.onload=r,document.head.insertBefore(a,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return t(e)}})})}function k(e){return window[e]}function D(e,t){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==t&&"function"!=typeof t)throw new Error("Expected PromisePonyfill to be a function.")}I.displayName="PayPalButtons","function"==typeof SuppressedError&&SuppressedError;var _=function(e){var t=e.className,n=void 0===t?"":t,r=e.children,o=s(e,["className","children"]),a=w()[0],u=a.isResolved,l=a.options,d=(0,i.useRef)(null),f=(0,i.useState)(!0),m=f[0],v=f[1],y=(0,i.useState)(null)[1];return(0,i.useEffect)(function(){if(!1!==u){var e=E(l[p]);if(e===undefined||e.Marks===undefined)return y(function(){throw new Error(b({reactComponentName:_.displayName,sdkComponentKey:"marks",sdkRequestedComponents:l.components,sdkDataNamespace:l[p]}))});!function(e){var t=d.current;if(!t||!e.isEligible())return v(!1);t.firstChild&&t.removeChild(t.firstChild),e.render(t)["catch"](function(e){null!==t&&0!==t.children.length&&y(function(){throw new Error("Failed to render <PayPalMarks /> component. ".concat(e))})})}(e.Marks(c({},o)))}},[u,o.fundingSource]),i.createElement(i.Fragment,null,m?i.createElement("div",{ref:d,className:n}):r)};_.displayName="PayPalMarks";var L=function(e){var t=e.className,n=void 0===t?"":t,r=e.forceReRender,o=void 0===r?[]:r,a=s(e,["className","forceReRender"]),l=w()[0],d=l.isResolved,f=l.options,m=(0,i.useRef)(null),v=(0,i.useRef)(null),y=(0,i.useState)(null)[1];return(0,i.useEffect)(function(){if(!1!==d){var e=E(f[p]);if(e===undefined||e.Messages===undefined)return y(function(){throw new Error(b({reactComponentName:L.displayName,sdkComponentKey:"messages",sdkRequestedComponents:f.components,sdkDataNamespace:f[p]}))});v.current=e.Messages(c({},a)),v.current.render(m.current)["catch"](function(e){null!==m.current&&0!==m.current.children.length&&y(function(){throw new Error("Failed to render <PayPalMessages /> component. ".concat(e))})})}},u([d],o,!0)),i.createElement("div",{ref:m,className:n})};L.displayName="PayPalMessages";var x=function(e){var t,n=e.options,a=void 0===n?{clientId:"test"}:n,s=e.children,u=e.deferLoading,p=void 0!==u&&u,y=(0,i.useReducer)(S,{options:c(c({},a),(t={},t[d]=f,t[m]=f,t[l]="".concat(g(a)),t)),loadingStatus:p?r.INITIAL:r.PENDING}),h=y[0],E=y[1];return(0,i.useEffect)(function(){if(!1===p&&h.loadingStatus===r.INITIAL)return E({type:o.LOADING_STATUS,value:r.PENDING});if(h.loadingStatus===r.PENDING){var e=!0;return j(h.options).then(function(){e&&E({type:o.LOADING_STATUS,value:r.RESOLVED})})["catch"](function(t){console.error("".concat(v," ").concat(t)),e&&E({type:o.LOADING_STATUS,value:{state:r.REJECTED,message:String(t)}})}),function(){e=!1}}},[h.options,p,h.loadingStatus]),i.createElement(N.Provider,{value:c(c({},h),{dispatch:E})},s)};function B(){}(0,i.createContext)({cardFieldsForm:null,fields:{},registerField:B,unregisterField:B})}}]);

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.