PageSourceSearch

https://firn.com/cdn/shopifycloud/checkout-web/assets/c1/ShopPayCaptcha.DPBCCrUk.js

js firn.com collected 2026-09-26 08:04:55 UTC 6,296 bytes, 1 lines download raw bytes

1import{au as w,b5 as A,a2 as S,A as x,h as L,u as l}from"./esnext-vendor.B9Da21W6.js";import{k as P,Y as k}from"./hydrate.DZ4YTm7p.js";import{S as j,mx as D}from"./addresses-is-address-empty.Bn2lNY_L.js";function h(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function f(s,i){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},f(s,i)}function H(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,f(s,i)}function U(s){return Object.entries(s).filter(function(i){i[0];var n=i[1];return n||n===!1}).map(function(i){var n=i[0],t=i[1];return encodeURIComponent(n)+"="+encodeURIComponent(t)}).join("&")}function v(s){var i=s&&s.ownerDocument||document,n=i.defaultView||i.parentWindow||window;return{document:i,window:n}}function m(s){return s||document.head}var y="hcaptcha-api-script-id",C="hcaptchaOnLoad",R=[],K=function(i){i===void 0&&(i={});var n=m(i.scriptLocation);delete i.scriptLocation;var t=v(n),e=R.find(function(r){var o=r.scope;return o===t.window});if(t.document.getElementById(y)&&e)return e.promise;var a=new Promise(function(r,o){t.window[C]=r;var p=i.apihost||"https://js.hcaptcha.com";delete i.apihost;var c=t.document.createElement("script");c.id=y,c.src=p+"/1/api.js?render=explicit&onload="+C,c.async=i.loadAsync!==void 0?i.loadAsync:!0,delete i.loadAsync,c.onerror=function(u){return o("script-error")};var d=U(i);c.src+=d!==""?"&"+d:"",n.appendChild(c)});return R.push({promise:a,scope:t.window}),a},M=(function(s){H(i,s);function i(t){var e;return e=s.call(this,t)||this,e._hcaptcha=void 0,e.renderCaptcha=e.renderCaptcha.bind(h(e)),e.resetCaptcha=e.resetCaptcha.bind(h(e)),e.removeCaptcha=e.removeCaptcha.bind(h(e)),e.isReady=e.isReady.bind(h(e)),e.loadCaptcha=e.loadCaptcha.bind(h(e)),e.handleOnLoad=e.handleOnLoad.bind(h(e)),e.handleSubmit=e.handleSubmit.bind(h(e)),e.handleExpire=e.handleExpire.bind(h(e)),e.handleError=e.handleError.bind(h(e)),e.handleOpen=e.handleOpen.bind(h(e)),e.handleClose=e.handleClose.bind(h(e)),e.handleChallengeExpired=e.handleChallengeExpired.bind(h(e)),e.ref=A(),e.apiScriptRequested=!1,e.state={isApiReady:!1,isRemoved:!1,elementId:t.id,captchaId:""},e}var n=i.prototype;return n.componentDidMount=function(){var e=this,a=m(this.props.scriptLocation),r=v(a);this._hcaptcha=r.window.hcaptcha||void 0;var o=typeof this._hcaptcha<"u";if(o){this.setState({isApiReady:!0},function(){e.renderCaptcha()});return}this.loadCaptcha()},n.componentWillUnmount=function(){var e=this.state.captchaId,a=this._hcaptcha;this.isReady()&&(a.reset(e),a.remove(e))},n.shouldComponentUpdate=function(e,a){return!(this.state.isApiReady!==a.isApiReady||this.state.isRemoved!==a.isRemoved)},n.componentDidUpdate=function(e){var a=this,r=["sitekey","size","theme","tabindex","languageOverride","endpoint"],o=r.every(function(p){return e[p]===a.props[p]});o||this.removeCaptcha(function(){a.renderCaptcha()})},n.loadCaptcha=function(){if(!this.apiScriptRequested){var e=this.props,a=e.apihost,r=e.assethost,o=e.endpoint,p=e.host,c=e.imghost,d=e.languageOverride,u=e.reCaptchaCompat,b=e.reportapi,_=e.sentry,g=e.custom,I=e.loadAsync,O=e.scriptLocation,E={apihost:a,assethost:r,endpoint:o,hl:d,host:p,imghost:c,recaptchacompat:u===!1?"off":null,reportapi:b,sentry:_,custom:g,loadAsync:I,scriptLocation:O};K(E).then(this.handleOnLoad).catch(this.handleError),this.apiScriptRequested=!0}},n.renderCaptcha=function(e){var a=this.state.isApiReady;if(a){var r=Object.assign({"open-callback":this.handleOpen,"close-callback":this.handleClose,"error-callback":this.handleError,"chalexpired-callback":this.handleChallengeExpired,"expired-callback":this.handleExpire,callback:this.handleSubmit},this.props,{hl:this.props.hl||this.props.languageOverride,languageOverride:void 0}),o=this._hcaptcha,p=o.render(this.ref.current,r);this.setState({isRemoved:!1,captchaId:p},function(){e&&e()})}},n.resetCaptcha=function(){var e=this.state.captchaId,a=this._hcaptcha;this.isReady()&&a.reset(e)},n.removeCaptcha=function(e){var a=this.state.captchaId,r=this._hcaptcha;this.isReady()&&this.setState({isRemoved:!0},function(){r.remove(a),e&&e()})},n.handleOnLoad=function(){var e=this;this.setState({isApiReady:!0},function(){var a=m(e.props.scriptLocation),r=v(a);e._hcaptcha=r.window.hcaptcha,e.renderCaptcha(function(){var o=e.props.onLoad;o&&o()})})},n.handleSubmit=function(e){var a=this.props.onVerify,r=this.state,o=r.isRemoved,p=r.captchaId,c=this._hcaptcha;if(!(typeof c>"u"||o)){var d=c.getResponse(p),u=c.getRespKey(p);a&&a(d,u)}},n.handleExpire=function(){var e=this.props.onExpire,a=this.state.captchaId,r=this._hcaptcha;this.isReady()&&(r.reset(a),e&&e())},n.handleError=function(e){var a=this.props.onError,r=this.state.captchaId,o=this._hcaptcha;this.isReady()&&o.reset(r),a&&a(e)},n.isReady=function(){var e=this.state,a=e.isApiReady,r=e.isRemoved;return a&&!r},n.handleOpen=function(){!this.isReady()||!this.props.onOpen||this.props.onOpen()},n.handleClose=function(){!this.isReady()||!this.props.onClose||this.props.onClose()},n.handleChallengeExpired=function(){!this.isReady()||!this.props.onChalExpired||this.props.onChalExpired()},n.execute=function(e){e===void 0&&(e=null);var a=this.state.captchaId,r=this._hcaptcha;if(this.isReady())return e&&typeof e!="object"&&(e=null),r.execute(a,e)},n.setData=function(e){var a=this.state.captchaId,r=this._hcaptcha;this.isReady()&&(e&&typeof e!="object"&&(e=null),r.setData(a,e))},n.getResponse=function(){var e=this._hcaptcha;return e.getResponse(this.state.captchaId)},n.getRespKey=function(){var e=this._hcaptcha;return e.getRespKey(this.state.captchaId)},n.render=function(){var e=this.state.elementId;return w("div",{ref:this.ref,id:e})},i})(S);function T(){const{i18n:s,shopPay:i}=j(),n=(typeof window>"u"?void 0:window.shopPayCaptchaSiteKey)??D,t=x(null);return L(()=>
1{if(t.current)return i.signup.unstable_setCaptchaRef(t.current),()=>{i.signup.unstable_setCaptchaRef(void 0)}},[i.signup]),l(k,{accessibilityLabel:s.translate("captcha.title"),children:l(P,{gap:"small-400",children:l(M,{size:"invisible",sitekey:n,languageOverride:s.locale,ref:t})})})}const W=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"}));export{M as H,W as S};

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.