1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,761229,325363,179615,e=>{"use strict";var t=e.i(950899),a=e.i(716715),n=e.i(971939),l=e.i(272653),o=e.i(293963),r=e.i(17572),s=e.i(323697),i=e.i(681859);e.i(106145);var u=e.i(768594),d=e.i(986405),c=e.i(17856),p=e.i(467866),f=e.i(98197),h=e.i(79319),m=e.i(86773),g=e.i(316757),x=e.i(772616),v=e.i(101117),I=e.i(39249),y=e.i(374768),C=e.i(489184),b=e.i(626191),w=e.i(535289);let A=i.default.features.connectWallet.isEnabled?function({onSuccess:e,onError:t,source:a="Login",isAuth:n,loginToRewards:o,fetchProtectedResource:r}){let[s,u]=l.default.useState(!1),d=l.default.useRef(!1),c=(0,m.default)(),p=(0,g.default)({source:a}),f=l.default.useCallback(async e=>{try{var t,a;let n;if(!o)throw Error("Login to rewards is not enabled");if(C.get(C.NAMES.REWARDS_API_TOKEN))throw Error("User already has logged in to rewards");let l=await c("rewards:config");if(!l.auth?.shared_siwe_login)throw Error("Shared SIWE login is not enabled");if(!(await c("rewards:check_user",{pathParams:{address:e}})).exists)throw Error("Rewards user does not exist");let r=await c("rewards:nonce",{queryParams:{blockscout_login_address:e,blockscout_login_chain_id:i.default.chain.id}});if(!r.merits_login_nonce||!r.nonce)throw Error("Cannot get merits login nonce");return{message:(t=r.nonce,a=r.merits_login_nonce,n="localhost"===window.location.hostname&&i.default.apis.rewards?new URL(i.default.apis.rewards.endpoint):window.location,[`${n.hostname} wants you to sign in with your Ethereum account:`,e,"",`Sign in/up to Blockscout Account V2 & Blockscout Merits program. Merits nonce: ${a}.`,"",`URI: ${n.origin}`,"Version: 1",`Chain ID: ${i.default.chain.id}`,`Nonce: ${t}`,`Issued At: ${new Date().toISOString()}`,`Expiration Time: ${new Date(Date.now()+w.YEAR).toISOString()}`].join("\n")),authNonce:r.nonce,rewardsNonce:r.merits_login_nonce,type:"shared"}}catch(t){return{message:(await c("core:auth_siwe_message",{queryParams:{address:e}})).siwe_message,type:"single"}}},[c,o]),h=l.default.useCallback((e,t)=>a=>c(n?"core:auth_link_address":"core:auth_siwe_verify",{fetchParams:{method:"POST",body:{message:e,signature:t,recaptcha_response:a},headers:{...a&&{"recaptcha-v2-response":a}}}}),[c,n]),A=l.default.useCallback(async a=>{try{let t=await (0,x.getWeb3Runtime)();await t.switchChain({chainId:Number(i.default.chain.id)});let n=await f(a),l=await t.signMessage({message:n.message}),o=await r(h(n.message,l)),s="shared"===n.type?await c("rewards:login",{fetchParams:{method:"POST",body:{nonce:n.authNonce,message:n.message,signature:l}}}):void 0;if(!("name"in o))throw Error("Something went wrong");e?.({address:a,profile:o,rewardsToken:s?.token})}catch(l){let e=(0,I.default)(l),a=(0,y.default)(l)?.message,n=e&&"shortMessage"in e&&"string"==typeof e.shortMessage?e.shortMessage:void 0;t?.(),b.toaster.error({title:"Error",description:a||n||(0,v.default)(l)||"Something went wrong"})}finally{u(!1)}},[f,r,h,c,e,t]),E=l.default.useCallback(()=>{u(!0),p.address?A(p.address):(d.current=!0,p.connect())},[A,p]);return l.default.useEffect(()=>{p.address&&d.current&&(d.current=!1,A(p.address))},[A,p.address]),l.default.useMemo(()=>({start:E,isPending:s}),[E,s])}:function(){return l.default.useMemo(()=>({start:()=>{},isPending:!1}),[])};var E=e.i(737680),P=e.i(344464);let S=l.default.memo(({onSuccess:e,onError:a,isAuth:n,source:o,loginToRewards:r})=>{let s=l.default.useRef(!1),i=(0,P.default)(),{start:u}=A({onSuccess:l.default.useCallback(({address:t,profile:a,rewardsToken:l})=>{e({type:"success_wallet",address:t,isAuth:n,profile:a,rewardsToken:l})},[e,n]),onError:l.default.useCallback(()=>{a(n)},[a,n]),source:o,isAuth:n,fetchProtectedResource:i.fetchProtectedResource,loginToRewards:r});return l.default.useEffect(()=>{s.current||(s.current=!0,u())},[u]),(0,t.jsxs)(f.Center,{minH:"100px",flexDir:"column",children:[!i.isInitError&&(0,t.jsx)(h.Spinner,{size:"xl"}),(0,t.jsx)(E.default,{...i})]})});var T=e.i(2996),k=e.i(86381),_=e.i(652454),V=e.i(957830),j=e.i(398908);
1let N=l.default.memo(({onSubmit:e,isAuth:a,mixpanelConfig:n})=>{let o=(0,m.default)(),r=(0,P.default)(),s=(0,_.useForm)({mode:"onBlur",defaultValues:{email:""}}),i=l.default.useCallback(e=>t=>o("core:auth_send_otp",{fetchParams:{method:"POST",body:{email:e,recaptcha_response:t},headers:{...t&&{"recaptcha-v2-response":t}}}}),[o]),c=l.default.useCallback(async t=>{try{await r.fetchProtectedResource(i(t.email)),a?n?.account_link_info.source!=="Profile"&&u.logEvent(d.EventTypes.ACCOUNT_LINK_INFO,{Source:n?.account_link_info.source??"Profile dropdown",Status:"OTP sent",Type:"Email"}):u.logEvent(d.EventTypes.LOGIN,{Action:"OTP sent",Source:"Email"}),e({type:"otp_code",email:t.email,isAuth:a})}catch(e){b.toaster.error({title:"Error",description:(0,y.default)(e)?.message||(0,v.default)(e)||"Something went wrong"})}},[r,i,a,e,n?.account_link_info.source]);return(0,t.jsx)(_.FormProvider,{...s,children:(0,t.jsxs)(T.chakra.form,{noValidate:!0,onSubmit:s.handleSubmit(c),children:[(0,t.jsx)(k.Text,{children:"Account email, used for transaction notifications from your watchlist."}),(0,t.jsx)(j.FormFieldEmail,{name:"email",required:!0,placeholder:"Email",bgColor:"dialog.bg",mt:6}),(0,t.jsx)(E.default,{...r}),(0,t.jsx)(V.Button,{mt:6,type:"submit",disabled:s.formState.isSubmitting||r.isInitError,loading:s.formState.isSubmitting,loadingText:"Send a code",children:"Send a code"})]})})});var F=e.i(398182),L=e.i(383150),R=e.i(260325);e.s([],454782),e.i(454782);var U=e.i(608865),[O,B]=(0,e.i(466732).createContext)({name:"PinInputContext",hookName:"usePinInputContext",providerName:"<PinInputProvider />"}),D=e=>e.children(B()),M=e.i(302432),W=e.i(383810),$=(0,l.forwardRef)((e,a)=>{let n=(0,W.mergeProps)(B().getControlProps(),e);return(0,t.jsx)(M.ark.div,{...n,ref:a})});$.displayName="PinInputControl";var H=e.i(763474),q=(0,l.forwardRef)((e,a)=>{let n=(0,W.mergeProps)(B().getHiddenInputProps(),e),l=(0,H.useFieldContext)();return(0,t.jsx)(M.ark.input,{"aria-describedby":l?.ariaDescribedby,...n,ref:a})});q.displayName="PinInputHiddenInput";var G=e.i(53742),K=(0,G.createSplitProps)(),z=(0,l.forwardRef)((e,a)=>{let[n,l]=K(e,["index"]),o=(0,W.mergeProps)(B().getInputProps(n),l);return(0,t.jsx)(M.ark.input,{...o,ref:a})});z.displayName="PinInputInput";var Y=(0,l.forwardRef)((e,a)=>{let n=(0,W.mergeProps)(B().getLabelProps(),e);return(0,t.jsx)(M.ark.label,{...n,ref:a})});Y.displayName="PinInputLabel";var Q=e.i(494046),Z=e.i(766793),J=e.i(96466),X=e.i(27918),ee=e.i(708158),et=e.i(677658),ea=e.i(841087),en=e.i(408519),el=e=>e.ids?.root??`pin-input:${e.id}`,eo=e=>e.ids?.hiddenInput??`pin-input:${e.id}:hidden`,er=e=>{let t=CSS.escape(el(e)),a=`input[data-ownedby=${t}]`;return(0,en.queryAll)(e.getById(el(e)),a)},es=(e,t)=>er(e)[t],ei=e=>e.getById(eo(e)),eu=(e,t)=>{e.value=t,e.setAttribute("value",t)},{choose:ed,createMachine:ec}=(0,J.setup)(),ep=ec({props:({props:e})=>({placeholder:"â",otp:!1,type:"numeric",defaultValue:e.count?eh([],e.count):[],...e,translations:{inputLabel:(e,t)=>`pin code ${e+1} of ${t}`,...e.translations}}),initialState:()=>"idle",context:({prop:e,bindable:t})=>({value:t(()=>({value:e("value")?eh(e("value"),e("count")):void 0,defaultValue:eh(e("defaultValue")??[],e("count")),isEqual:et.isEqual,onChange(t){e("onValueChange")?.({value:t,valueAsString:t.
1join("")})}})),focusedIndex:t(()=>({sync:!0,defaultValue:-1})),count:t(()=>({defaultValue:e("count")}))}),computed:{_value:({context:e})=>eh(e.get("value"),e.get("count")),valueLength:({computed:e})=>e("_value").length,filledValueLength:({computed:e})=>e("_value").filter(e=>e?.trim()!=="").length,isValueComplete:({computed:e})=>e("valueLength")===e("filledValueLength"),valueAsString:({computed:e})=>e("_value").join(""),focusedValue:({computed:e,context:t})=>e("_value")[t.get("focusedIndex")]||""},entry:ed([{guard:"autoFocus",actions:["setInputCount","setFocusIndexToFirst"]},{actions:["setInputCount"]}]),watch({action:e,track:t,context:a,computed:n}){t([()=>a.get("focusedIndex")],()=>{e(["focusInput","selectInputIfNeeded"])}),t([()=>a.get("value").join(",")],()=>{e(["syncInputElements","dispatchInputEvent"])}),t([()=>n("isValueComplete")],()=>{e(["invokeOnComplete","blurFocusedInputIfNeeded","autoSubmitIfNeeded"])})},on:{"VALUE.SET":[{guard:"hasIndex",actions:["setValueAtIndex"]},{actions:["setValue"]}],"VALUE.CLEAR":{actions:["clearValue","setFocusIndexToFirst"]}},states:{idle:{on:{"INPUT.FOCUS":{target:"focused",actions:["setFocusedIndex"]}}},focused:{on:{"INPUT.CHANGE":{actions:["setFocusedValue","syncInputValue","advanceFocusedIndex"]},"INPUT.ADVANCE":{actions:["advanceFocusedIndex"]},"INPUT.PASTE":{actions:["setPastedValue","setLastValueFocusIndex"]},"INPUT.FOCUS":{actions:["setFocusedIndex","focusInput"]},"INPUT.BLUR":{target:"idle",actions:["clearFocusedIndex"]},"INPUT.DELETE":{guard:"hasValue",actions:["clearFocusedValue"]},"INPUT.ARROW_LEFT":{actions:["setPrevFocusedIndex"]},"INPUT.ARROW_RIGHT":{actions:["setNextFocusedIndex"]},"INPUT.HOME":{actions:["setFocusIndexToFirst"]},"INPUT.END":{actions:["setFocusIndexToLast"]},"INPUT.BACKSPACE":[{guard:"hasValue",actions:["clearFocusedValue","setPrevFocusedIndex"]},{actions:["setPrevFocusedIndex","clearFocusedValue"]}],"INPUT.ENTER":{guard:"isValueComplete",actions:["requestFormSubmit"]},"VALUE.INVALID":{actions:["invokeOnInvalid"]}}}},implementations:{guards:{autoFocus:({prop:e})=>!!e("autoFocus"),hasValue:({context:e,computed:t})=>""!==t("_value")[e.get("focusedIndex")],isValueComplete:({computed:e})=>e("isValueComplete"),hasIndex:({event:e})=>void 0!==e.index},actions:{dispatchInputEvent({computed:e,scope:t}){let a=ei(t);(0,X.dispatchInputValueEvent)(a,{value:e("valueAsString")})},setInputCount({scope:e,context:t,prop:a}){if(a("count"))return;let n=er(e);t.set("count",n.length)},focusInput({context:e,scope:t}){let a=e.get("focusedIndex");-1!==a&&queueMicrotask(()=>{es(t,a)?.focus({preventScroll:!0})})},selectInputIfNeeded({context:e,prop:t,scope:a}){let n=e.get("focusedIndex");t("selectOnFocus")&&-1!==n&&(0,ee.raf)(()=>{es(a,n)?.select()})},invokeOnComplete({computed:e,prop:t}){e("isValueComplete")&&t("onValueComplete")?.({value:e("_value"),valueAsString:e("valueAsString")})},invokeOnInvalid({context:e,event:t,prop:a}){a("onValueInvalid")?.({value:t.value,index:e.get("focusedIndex")})},clearFocusedIndex({context:e}){e.set("focusedIndex",-1)},setFocusedIndex({context:e,event:t,computed:a}){let n=Math.min(a("filledValueLength"),a("valueLength")-1);e.set("focusedIndex",Math.min(t.index,n))},setValue({context:e,event:t}){let a=eh(t.value,e.get("count"));e.set("value",a)},setFocusedValue({context:e,event:t,computed:a,flush:n}){let l=a("focusedValue"),o=e.get("focusedIndex"),r=ef(l,t.value);n(()=>{e.set("value",(0,ea.setValueAtIndex)(a("_value"),o,r))})},revertInputValue({context:e,computed:t,scope:a}){eu(es(a,e.get("focusedIndex")),t("focusedValue"))},syncInputValue({context:e,event:t,scope:a}){let n=e.get("value");eu(es(a,t.index),n[t.index])},syncInputElements({context:e,scope:t}){let a=er(t),n=e.get("value");a.forEach((e,t)=>{eu(e,n[t])})},setPastedValue({context:e,event:t,computed:a,flush:n}){(0,ee.raf)(()=>{let l=a("valueAsString"),o=e.get("focusedIndex"),r=a("valueLength"),s=Math.min(o,a("filledValueLength")),i=s>0?l.substring(0,o):"",u=t.value.substring(0,r-s),d=eh(`${i}${u}`.split(""),r);n(()=>{e.set("value",d)})})},setValueAtIndex({context:e,event:t,computed:a}){let n=ef(a("focusedValue"),t.value);
1e.set("value",(0,ea.setValueAtIndex)(a("_value"),t.index,n))},clearValue({context:e}){let t=Array.from({length:e.get("count")}).fill("");queueMicrotask(()=>{e.set("value",t)})},clearFocusedValue({context:e,computed:t}){let a=e.get("focusedIndex");if(-1===a)return;let n=[...t("_value")];n.splice(a,1),n.push(""),e.set("value",n)},setFocusIndexToFirst({context:e}){e.set("focusedIndex",0)},setFocusIndexToLast({context:e,computed:t}){e.set("focusedIndex",Math.max(t("filledValueLength")-1,0))},advanceFocusedIndex({context:e,computed:t}){e.set("focusedIndex",Math.min(e.get("focusedIndex")+1,t("valueLength")-1))},setNextFocusedIndex({context:e,computed:t}){let a=e.get("focusedIndex")+1,n=Math.min(t("filledValueLength"),t("valueLength")-1);e.set("focusedIndex",Math.min(a,n))},setPrevFocusedIndex({context:e}){e.set("focusedIndex",Math.max(e.get("focusedIndex")-1,0))},setLastValueFocusIndex({context:e,computed:t}){(0,ee.raf)(()=>{e.set("focusedIndex",Math.min(t("filledValueLength"),t("valueLength")-1))})},blurFocusedInputIfNeeded({context:e,computed:t,prop:a,scope:n}){a("blurOnComplete")&&t("isValueComplete")&&(0,ee.raf)(()=>{es(n,e.get("focusedIndex"))?.blur()})},requestFormSubmit({computed:e,prop:t,scope:a}){if(!t("name")||!e("isValueComplete"))return;let n=ei(a);n?.form?.requestSubmit()},autoSubmitIfNeeded({computed:e,prop:t,scope:a}){if(!t("autoSubmit")||!e("isValueComplete"))return;let n=ei(a);n?.form?.requestSubmit()}}}});function ef(e,t){let a=t;e[0]===t[0]?a=t[1]:e[0]===t[1]&&(a=t[0]);let n=a.split("");return(a=n[n.length-1])??""}function eh(e,t){return Array.from({length:t||e.length}).fill("").map((t,a)=>e[a]||t)}var em=e.i(819232),eg=e.i(689072),ex=e.i(705544),ev=e.i(234723),eI=e.i(112056),ey=(0,e.i(802943).createAnatomy)("pinInput").parts("root","label","input","control"),eC=ey.build();e.s(["anatomy",0,ey,"parts",0,eC],325363);var eb={numeric:/^[0-9]+$/,alphabetic:/^[A-Za-z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/i};function ew(e,t,a){if(!a)return!t||!!eb[t]?.test(e);return RegExp(a,"g").test(e)}var eA=e.i(177416),eE=e.i(226545),eP=(0,G.createSplitProps)(),eS=(0,l.forwardRef)((e,a)=>{let[n,o]=eP(e,["autoFocus","autoSubmit","blurOnComplete","count","defaultValue","disabled","form","id","ids","invalid","mask","name","onValueChange","onValueComplete","onValueInvalid","otp","pattern","placeholder","readOnly","required","sanitizeValue","selectOnFocus","translations","type","value"]),r=(e=>{let t=(0,l.useId)(),{getRootNode:a}=(0,Q.useEnvironmentContext)(),{dir:n}=(0,Z.useLocaleContext)(),o=(0,H.useFieldContext)(),r={id:t,ids:{label:o?.ids.label,hiddenInput:o?.ids.control},disabled:o?.disabled,readOnly:o?.readOnly,required:o?.required,invalid:o?.invalid,dir:n,getRootNode:a,...e};return function(e,t){let{send:a,context:n,computed:l,prop:o,scope:r}=e,s=l("isValueComplete"),i=!!o("disabled"),u=!!o("readOnly"),d=!!o("invalid"),c=!!o("required"),p=o("translations"),f=n.get("focusedIndex");function h(){er(r)[0]?.focus()}return{focus:h,count:n.get("count"),items:Array.from({length:n.get("count")}).map((e,t)=>t),value:n.get("value"),valueAsString:l("valueAsString"),complete:s,setValue(e){Array.isArray(e)||(0,eI.invariant)("[pin-input/setValue] value must be an array"),a({type:"VALUE.SET",value:e})},clearValue(){a({type:"VALUE.CLEAR"})},setValueAtIndex(e,t){a({type:"VALUE.SET",value:t,index:e})},getRootProps:()=>t.element({dir:o("dir"),...eC.root.attrs,id:el(r),"data-invalid":(0,em.dataAttr)(d),"data-disabled":(0,em.dataAttr)(i),"data-complete":(0,em.dataAttr)(s),"data-readonly":(0,em.dataAttr)(u)}),getLabelProps:()=>t.label({...eC.label.attrs,dir:o("dir"),htmlFor:eo(r),id:r.ids?.label??`pin-input:${r.id}:label`,"data-invalid":(0,em.dataAttr)(d),"data-disabled":(0,em.dataAttr)(i),"data-complete":(0,em.dataAttr)(s),"data-required":(0,em.dataAttr)(c),"data-readonly":(0,em.dataAttr)(u),onClick(e){e.preventDefault(),h()}}),getHiddenInputProps:()=>t.input({"aria-hidden":!0,type:"text",tabIndex:-1,id:eo(r),readOnly:u,disabled:i,required:c,name:o("name"),form:o("form"),style:ev.visuallyHiddenStyle,maxLength:l("valueLength"),defaultValue:l("valueAsString")}),getControlProps:()=>t.element({...eC.control.attrs,dir:o("dir"),id:r.ids?.control??`pin-input:${r.id}:control`}),getInputProps(e){let n,{index:c}=e,h="numeric"===o("type")?"tel":"text",m=l("valueLength"),g=-1!==f?f:Math.min(l("filledValueLength"),m-1);return t.input({...eC.input.attrs,dir:o("dir"),disabled:i,tabIndex:c===g?0:-1,"data-disabled":(0,em.dataAttr)(i),"data-complete":(0,em.dataAttr)(s),"data-filled":(0,em.dataAttr)(""!==l("_value")[c]),id:(n=c.toString(),r.ids?.input?.(n)??`pin-input:${r.id}:${n}`),"data-index":c,"data-ownedby":el(r),"aria-label":p?.inputLabel?.(c,l("valueLength")),inputMode:o("otp")||"numeric"===o("type")?"numeric":"text","aria-invalid":(0,em.ariaAttr)(d),"data-invalid":(0,em.dataAttr)(d),enterKeyHint:c===m-1?"done":"next",type:o("mask")?"password":h,defaultValue:l("_value")[c]||"",readOnly:u,autoCapitalize:"none",autoComplete:o("otp")?"one-time-code":"off",placeholder:f===c?"":o("placeholder"),onPaste(e){let t=e.clipboardData?.getData("text/plain");if(!t)return;
1let n=o("sanitizeValue");if(n&&(t=n(t)),!ew(t,o("type"),o("pattern"))){a({type:"VALUE.INVALID",value:t}),e.preventDefault();return}e.preventDefault(),a({type:"INPUT.PASTE",value:t})},onBeforeInput(e){try{let t=(0,eg.getBeforeInputValue)(e);ew(t,o("type"),o("pattern"))||(a({type:"VALUE.INVALID",value:t}),e.preventDefault()),t.length>1&&e.currentTarget.setSelectionRange(0,1,"forward")}catch{}},onChange(e){let t=(0,eg.getNativeEvent)(e),{value:n}=e.currentTarget;if("insertFromPaste"===t.inputType){e.currentTarget.value=n[0]||"";return}if(n.length>2){a({type:"INPUT.PASTE",value:n}),e.currentTarget.value=n[0],e.preventDefault();return}"deleteContentBackward"===t.inputType?a({type:"INPUT.BACKSPACE"}):"deleteByCut"===t.inputType?a({type:"INPUT.DELETE"}):n!==l("focusedValue")&&a({type:"INPUT.CHANGE",value:n,index:c})},onKeyDown(e){if(e.defaultPrevented||(0,eg.isComposingEvent)(e)||(0,eg.isModifierKey)(e))return;if(1===e.key.length&&l("focusedValue")===e.key){e.preventDefault(),a({type:"INPUT.ADVANCE"});return}let t={Backspace(){a({type:"INPUT.BACKSPACE"})},Delete(){a({type:"INPUT.DELETE"})},ArrowLeft(){a({type:"INPUT.ARROW_LEFT"})},ArrowRight(){a({type:"INPUT.ARROW_RIGHT"})},Enter(){a({type:"INPUT.ENTER"})},Home(){a({type:"INPUT.HOME"})},End(){a({type:"INPUT.END"})}}[(0,eg.getEventKey)(e,{dir:o("dir"),orientation:"horizontal"})];t&&(t(e),e.preventDefault())},onFocus(){a({type:"INPUT.FOCUS",index:c})},onBlur(e){let t=e.relatedTarget;(0,ex.isHTMLElement)(t)&&t.dataset.ownedby===el(r)||a({type:"INPUT.BLUR",index:c})}})}}}((0,eE.useMachine)(ep,r),eA.normalizeProps)})(n),s=(0,W.mergeProps)(r.getRootProps(),o);return(0,t.jsx)(O,{value:r,children:(0,t.jsx)(M.ark.div,{...s,ref:a})})});eS.displayName="PinInputRoot";var eT=(0,G.createSplitProps)(),ek=(0,l.forwardRef)((e,a)=>{let[{value:n},l]=eT(e,["value"]),o=(0,W.mergeProps)(n.getRootProps(),l);return(0,t.jsx)(O,{value:n,children:(0,t.jsx)(M.ark.div,{...o,ref:a})})});ek.displayName="PinInputRootProvider";var e_=(0,U.__exportAll)({Context:()=>D,Control:()=>$,HiddenInput:()=>q,Input:()=>z,Label:()=>Y,Root:()=>eS,RootProvider:()=>ek});let{withProvider:eV,withContext:ej,useStyles:eN,PropsProvider:eF}=(0,e.i(717515).createSlotRecipeContext)({key:"pinInput"}),eL=eV(e_.RootProvider,"root",{forwardAsChild:!0}),eR=eV(e_.Root,"root",{forwardProps:["mask"],forwardAsChild:!0}),eU=ej(e_.Control,"control",{forwardAsChild:!0}),eO=ej(e_.Input,"input",{forwardAsChild:!0}),eB=ej(e_.Label,"label",{forwardAsChild:!0}),eD=e_.Context,eM=e_.HiddenInput;e.s(["Context",0,eD,"Control",0,eU,"HiddenInput",0,eM,"Input",0,eO,"Label",0,eB,"PropsProvider",0,eF,"Root",0,eR,"RootProvider",0,eL],756967);var eW=e.i(756967),eW=eW,e$=e.i(498790);let eH=l.forwardRef(function(e,a){let{count:n=6,inputProps:l,rootRef:o,attached:r,placeholder:s=" ",bgColor:i,...u}=e;return(0,t.jsxs)(eW.Root,{ref:o,placeholder:s,...u,children:[(0,t.jsx)(eW.HiddenInput,{ref:a,...l}),(0,t.jsx)(eW.Control,{children:(0,t.jsx)(e$.Group,{attached:r,children:Array.from({length:n}).map((e,a)=>(0,t.jsx)(eW.Input,{index:a,bgColor:i},a))})})]})});e.s(["PinInput",0,eH],179615);let eq=l.default.memo(({isDisabled:e})=>{let{control:a}=(0,_.useFormContext)(),{field:n,fieldState:o,formState:r}=(0,_.useController)({control:a,name:"code",rules:{required:!0,minLength:6,maxLength:6}}),s=e||r.isSubmitting,i=l.default.useCallback(({value:e})=>{n.onChange(e)},[n]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.HStack,{children:(0,t.jsx)(eH,{otp:!0,name:n.name,value:n.value,onValueChange:i,disabled:s,invalid:!!o.error,bgColor:"dialog.bg"})}),o.error?.message&&(0,t.jsx)(k.Text,{color:"text.error",textStyle:"sm",mt:1,children:o.error.message})]})}),eG=l.default.memo(({email:e,onSuccess:a,isAuth:n})=>{let o=(0,m.default)(),r=(0,P.default)(),[s,i]=l.default.useState(!1),u=(0,_.useForm)({mode:"onBlur",defaultValues:{code:[]}}),d=l.default.useCallback(t=>o(n?"core:auth_link_email":"core:auth_confirm_otp",{fetchParams:{method:"POST",body:{otp:t.code.join(""),email:e}}}).then(t=>{if(!("name"in t))throw Error("Something went wrong");a({type:"success_email",email:e,isAuth:n,profile:t})}).catch(e=>{let t=(0,y.default)(e);t?.message?u.setError("code",{message:t.message}):b.toaster.error({title:"Error",description:(0,v.default)(e)||"Something went wrong"})}),[o,e,a,n,u]),c=l.default.useCallback(t=>o("core:auth_send_otp",{fetchParams:{method:"POST",body:{email:e,recaptcha_response:t},headers:{...t&&{"recaptcha-v2-response":t}}}}),[o,e]),p=l.default.useCallback(async()=>{try{u.clearErrors("code"),i(!0),await r.fetchProtectedResource(c),b.toaster.success({title:"Success",description:"Code has been sent to your email"})}catch(t){let e=(0,y.default)(t);b.toaster.error({title:"Error",description:e?.message||(0,v.default)(t)||"Something went wrong"})}finally{i(!1)}},[u,r,c]);return(0,t.jsx)(_.FormProvider,{...u,children:(0,t.jsxs)(T.chakra.form,{noValidate:!0,onSubmit:u.handleSubmit(d),children:[(0,t.jsxs)(k.Text,{mb:6,children:["Please check"," ",(0,t.jsx)(T.chakra.span,{fontWeight:"700",children:e}
1)," ","and enter your code below."]}),(0,t.jsx)(eq,{isDisabled:s}),(0,t.jsxs)(V.Button,{variant:"link",columnGap:2,mt:3,disabled:s||r.isInitError,onClick:p,children:[(0,t.jsx)(L.default,{name:"repeat",boxSize:5}),(0,t.jsx)(F.Box,{fontSize:"sm",children:"Resend code"})]}),(0,t.jsx)(E.default,{...r}),(0,t.jsx)(V.Button,{mt:6,type:"submit",loading:u.formState.isSubmitting,disabled:u.formState.isSubmitting||s||r.isInitError,loadingText:"Submit",onClick:u.handleSubmit(d),children:"Submit"})]})})});var eK=e.i(514095);let ez=l.default.memo(({onSelectMethod:e})=>{let a=l.default.useCallback(()=>{u.logEvent(d.EventTypes.LOGIN,{Action:"Email",Source:"Options selector"}),e({type:"email"})},[e]),n=l.default.useCallback(()=>{u.logEvent(d.EventTypes.LOGIN,{Action:"Wallet",Source:"Options selector"}),e({type:"connect_wallet",loginToRewards:!0})},[e]);return(0,t.jsxs)(eK.VStack,{gap:3,mt:4,align:"stretch",children:[(0,t.jsx)(V.Button,{variant:"outline",onClick:n,children:"Continue with Web3 wallet"}),(0,t.jsx)(V.Button,{variant:"outline",onClick:a,children:"Continue with email"})]})}),eY=l.default.memo(({email:e,onConnectWallet:a,onClose:n,isAuth:o,profile:r})=>{let s=l.default.useCallback(()=>{a({type:"connect_wallet",isAuth:!0,loginToRewards:!0})},[a]);return o?(0,t.jsxs)(F.Box,{children:[(0,t.jsxs)(k.Text,{children:["Your account was linked to"," ",(0,t.jsx)(T.chakra.span,{fontWeight:"700",children:e})," ","email. Use for the next login."]}),(0,t.jsx)(V.Button,{mt:6,variant:"outline",onClick:n,children:"Got it!"})]}):(0,t.jsxs)(F.Box,{children:[(0,t.jsxs)(k.Text,{children:[(0,t.jsx)(T.chakra.span,{fontWeight:"700",children:e})," ","email has been successfully used to log in to your Blockscout account."]}),!r?.address_hash&&i.default.features.connectWallet.isEnabled?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.Text,{mt:6,children:"Add your web3 wallet to safely interact with smart contracts and dapps inside Blockscout."}),(0,t.jsx)(V.Button,{mt:6,onClick:s,children:"Connect wallet"})]}):(0,t.jsx)(V.Button,{variant:"outline",mt:6,onClick:n,children:"Got it!"})]})});var eQ=e.i(304786),eZ=e.i(635140),eJ=e.i(873686);let eX=l.default.memo(({address:e,onAddEmail:a,onClose:n,isAuth:o,profile:r,rewardsToken:s})=>{let u=l.default.useCallback(()=>{a({type:"email",isAuth:!0})},[a]);return o?(0,t.jsxs)(F.Box,{children:[(0,t.jsxs)(k.Text,{children:["Your account was linked to"," ",(0,t.jsx)(T.chakra.span,{fontWeight:"700",children:(0,eZ.default)(e)})," ","wallet. Use for the next login."]}),(0,t.jsx)(V.Button,{mt:6,variant:"outline",onClick:n,children:"Got it!"})]}):(0,t.jsxs)(F.Box,{children:[(0,t.jsxs)(k.Text,{children:["Wallet"," ",(0,t.jsx)(T.chakra.span,{fontWeight:"700",children:(0,eZ.default)(e)})," ","has been successfully used to log in to your Blockscout account",!!s&&" and Merits Program","."]}),r?.email?(0,t.jsx)(V.Button,{mt:6,variant:"outline",onClick:n,children:"Got it!"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(k.Text,{mt:6,children:["Add your email to receive exclusive updates about Blockscout ",i.default.features.rewards.isEnabled?"Merits ":" ","and notifications about addresses in your watch list."]}),(0,t.jsxs)(eQ.Flex,{mt:6,gap:6,children:[(0,t.jsx)(V.Button,{onClick:u,children:"Add email"}),(0,t.jsxs)(V.Button,{variant:"link",onClick:n,children:["I",eJ.apos,"ll do it later"]})]})]})]})}),e0=i.default.features.account,e1=l.default.memo(({initialScreen:e,onClose:i,mixpanelConfig:f,closeOnError:h})=>{let[m,g]=l.default.useState([e]),[x,v]=l.default.useState(!1),[I,y]=l.default.useState(void 0),{onLoginSuccess:C}=(0,s.useRewardsContext)(),b=(0,n.useRouter)(),w=(0,r.default)(),A=(0,a.useQueryClient)();l.default.useEffect(()=>{"isAuth"in e&&e.isAuth?u.logEvent(d.EventTypes.ACCOUNT_LINK_INFO,{Status:"Started",Type:"connect_wallet"===e.type?"Wallet":"Email",Source:f?.account_link_info.source??"Profile dropdown"}):u.logEvent(d.EventTypes.LOGIN,{Action:"Started",Source:c.getPageType(b.pathname)})},[e,f,b.pathname]);let E=l.default.useCallback(e=>{g(t=>[...t,e])},[]),P=l.default.useCallback(()=>{g(e=>e.length>1?e.slice(0,-1):e)},[]),T=l.default.useCallback(t=>{t||h?i():g([e])},[e,i,h]),k=l.default.useCallback(async t=>
1{v(!0),"isAuth"in e&&e.isAuth?u.logEvent(d.EventTypes.ACCOUNT_LINK_INFO,{Status:"Finished",Type:"success_wallet"===t.type?"Wallet":"Email",Source:f?.account_link_info.source??"Profile dropdown"}):u.logEvent(d.EventTypes.LOGIN,{Action:"Success",Source:"success_wallet"===t.type?"Wallet":"Email"}),A.setQueryData((0,o.getResourceKey)("core:user_info"),()=>t.profile),await w.refetch(),"rewardsToken"in t&&t.rewardsToken&&(y(t.rewardsToken),C(t.rewardsToken)),E(t)},[e,f?.account_link_info.source,E,w,A,C]),_=l.default.useCallback(()=>{i(x,I)},[x,I,i]),V=l.default.useCallback(({open:e})=>{e||i(x,I)},[i,x,I]),j=m[m.length-1],F=(()=>{switch(j.type){case"select_method":return"Select a way to login";case"connect_wallet":return j.isAuth?"Add wallet":"Continue with wallet";case"email":return j.isAuth?"Add email":"Continue with email";case"otp_code":return"Confirmation code";case"success_email":case"success_wallet":return"Congrats!"}})(),L=(()=>{switch(j.type){case"select_method":return(0,t.jsx)(ez,{onSelectMethod:E});case"connect_wallet":return(0,t.jsx)(S,{onSuccess:k,onError:T,isAuth:j.isAuth,loginToRewards:j.loginToRewards,source:f?.wallet_connect?.source});case"email":return(0,t.jsx)(N,{onSubmit:E,isAuth:j.isAuth,mixpanelConfig:f});case"otp_code":return(0,t.jsx)(eG,{email:j.email,onSuccess:k,isAuth:j.isAuth});case"success_email":return(0,t.jsx)(eY,{email:j.email,onConnectWallet:E,onClose:_,isAuth:j.isAuth,profile:j.profile});case"success_wallet":return(0,t.jsx)(eX,{address:j.address,onAddEmail:E,onClose:_,isAuth:j.isAuth,profile:j.profile,rewardsToken:j.rewardsToken})}})();return e0.isEnabled?(0,t.jsx)(p.DialogRoot,{open:!0,onOpenChange:V,size:{lgDown:"full",lg:"sm"},modal:!1,closeOnInteractOutside:!["email","otp_code","connect_wallet","select_method"].includes(j.type),trapFocus:!1,preventScroll:!1,children:(0,t.jsxs)(p.DialogContent,{children:[(0,t.jsx)(p.DialogHeader,{onBackToClick:m.length>1&&!m[m.length-1].type.startsWith("success")?P:void 0,children:F}),(0,t.jsx)(p.DialogBody,{children:L})]})}):null});e.s(["default",0,e1],761229)}]);
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.