1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[13550],{5388:(e,t,n)=>{n.d(t,{NI:()=>f,VM:()=>p,gi:()=>m,lK:()=>g,s6:()=>x,tY:()=>h,yX:()=>d,zS:()=>v});var i=n(35175),r=n(72921),o=n(31794);let a="niho.accountMerge.intent",l="niho.accountMerge.completedNotice",s="niho.accountMergeSuggestion.dismissed:";function c(){try{return window.sessionStorage}catch{return null}}function u(){try{return window.localStorage}catch{return null}}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();try{let t=c(),n=null==t?void 0:t.getItem(a);if(!t||!n)return null;let i=JSON.parse(n),r="string"==typeof(null==i?void 0:i.expiresAt)?Date.parse(i.expiresAt):NaN;if("string"!=typeof(null==i?void 0:i.intentToken)||0===i.intentToken.length||!Number.isFinite(r)||r<=e)return t.removeItem(a),null;return{intentToken:i.intentToken,expiresAt:i.expiresAt}}catch{return null}}function h(){try{var e;null==(e=c())||e.removeItem(a)}catch{}}function m(){try{var e;null==(e=c())||e.setItem(l,"1")}catch{}}function g(){try{let e=c();if(!e||"1"!==e.getItem(l))return!1;return e.removeItem(l),!0}catch{return!1}}function f(e){try{var t;return(null==(t=u())?void 0:t.getItem(`${s}${e}`))==="1"}catch{return!1}}function x(e){try{var t;null==(t=u())||t.setItem(`${s}${e}`,"1")}catch{}}let b=/^\/living\/([^/?#]+)\/?$/;function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.match(b);if(null==n?void 0:n[1]){let e=n[1];try{e=decodeURIComponent(e)}catch{}return(0,r.V)((0,o.ce)(e))}let i=t&&!t.startsWith("?")?`?${t}`:t;return(0,r.V)(`${e}${i}`)}async function v(e){let t,n=await i.a.createIntent();if(!function(e){try{let t=c();if(!t)return!1;return t.setItem(a,JSON.stringify(e)),!0}catch{return!1}}({intentToken:n.intentToken,expiresAt:n.expiresAt}))throw Error("account merge intent could not be stored");return t=new URLSearchParams({merge:"1",returnUrl:(0,r.V)(e)}),`/auth/email?${t.toString()}`}},13550:(e,t,n)=>{n.r(t),n.d(t,{AccountMergeSuggestionRoot:()=>p});var i=n(95155),r=n(12115),o=n(75796),a=n(9005),l=n(64577),s=n(73321),c=n(26708),u=n(35175),d=n(5388),h=n(39851),m=n(92552),g=n(12234),f=n(32232);let x="bottom-[calc(var(--global-bottom-nav-height,var(--niho-safe-area-bottom,env(safe-area-inset-bottom,0px)))+12px)]";function b(){return(0,g.UI)({cookieValue:"u"<typeof document?null:(0,g.lO)(document.cookie),acceptLanguage:"u"<typeof navigator?null:navigator.language})}function p(){var e,t;let n=(0,s.usePathname)()??"/",g=(0,s.useRouter)(),{user:p,loading:v}=(0,h.As)(),[y]=(0,r.useState)(b),w=(0,f.x)(y),k=(0,r.useCallback)(e=>(0,m.fp)(w,e),[w]),j=(null==p?void 0:p.uid)??null,N="/auth"===n||n.startsWith("/auth/"),[S,I]=(0,r.useState)(null),[A,E]=(0,r.useState)(!1),[$,T]=(0,r.useState)(!1),[M,C]=(0,r.useState)(!1),z=(0,r.useMemo)(()=>!!j&&(0,d.NI)(j),[j]),O=null!==j&&(z||S===j);(0,r.useEffect)(()=>{T(!1)},[j]);let R=!v&&null!==j&&!N&&!O,V=(0,c.I)({queryKey:["account-merge","suggestion",j],queryFn:()=>u.a.getSuggestion(),enabled:R,staleTime:1/0,gcTime:1/0,retry:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1}),W=(null==(e=V.data)?void 0:e.eligible)===!0,{refetch:L}=V,q=(0,r.useRef)(n);(0,r.useEffect)(()=>{q.current!==n&&(q.current=n,R&&W&&L())},[R,W,n,L]),(0,r.useEffect)(()=>{!N&&(0,d.lK)()&&C(!0)},[N,n]),(0,r.useEffect)(()=>{if(!M)return;let e=window.setTimeout(()=>C(!1),4500);return()=>window.clearTimeout(e)},[M]);let F=async()=>{if(!A){E(!0),T(!1);try{let e=window.location.search,t=await (0,d.zS)((0,d.VM)(n,e));g.push(t)}catch{T(!0)}finally{E(!1)}}},U=R&&(null==(t=V.data)?void 0:t.suggested)===!0;return(0,i.jsxs)(i.Fragment,{children:[U?(0,i.jsxs)("section",{"aria-label":k({ja:"ç»é²æ¸ã¿ã®ã¢ã«ã¦ã³ãã«ã¤ãã¦ã®ãæ¡å
",en:"About your existing account"}),className:`fixed inset-x-3 z-40 mx-auto max-w-[430px] rounded-2xl border border-niho-border bg-white/95 p-4 shadow-lg backdrop-blur-[8px] ${x}`,children:[(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)("span",{"aria-hidden":"true",className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-niho-accent-soft text-niho-accent-ink",children:(0,i.jsx)(o.A,{className:"h-5 w-5",strokeWidth:2.2})}),(0,i.jsxs)("div",{className:"min-w-0 flex-1 pt-0.5",children:[(0,i.jsx)("p",{className:"text-body font-bold text-niho-text",children:k({ja:"ã¡ã¼ã«ã¢ãã¬ã¹ã§ç»é²æ¸ã¿ã§ããï¼",en:"Already registered with your email?"})}),(0,i.jsx)("p",{className:"mt-1 text-sub leading-relaxed text-niho-text-sub",children:k({ja:"ãã°ã¤ã³ããã¨ãã¢ã«ã¦ã³ããã²ã¨ã¤ã«ã¾ã¨ãã¾ã",en:"Log in to combine your accounts into one"})})]}),(0,i.jsx)("button",{type:"button","aria-label":k({ja:"éãã",en:"Close"}),onClick:()=>{j&&((0,d.s6)(j),I(j))},className:"-mr-2 -mt-2 inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-full text-niho-text-sub transition-colors hover:bg-niho-surface-warm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-niho-soft/60",children:(0,i.jsx)(a.A,{className:"h-4 w-4","aria-hidden":"true"})})]}),$?(0,i.jsx)("p",{role:"alert",className:"mt-3 text-sub leading-relaxed text-niho-danger",children:k({ja:"ãã¾ãé²ãã¾ããã§ãããæéãããã¦ããä¸åº¦ã試ããã ããã",en:"Something went wrong. Wait a moment and try again."})}):null,(0,i.jsx)("button",{type:"button",onClick:()=>void F(),disabled:A,className:"mt-3 flex min-h-11 w-full items-center justify-center rounded-full border border-niho-dark bg-white px-4 text-body font-bold text-niho-accent-ink transition-colors hover:bg-niho-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-niho-soft/60 disabled:cursor-not-allowed disabled:opacity-50",children:k({ja:"ã¡ã¼ã«ã¢ãã¬ã¹ã§ãã°ã¤ã³",en:"Log in with email"})})]}):null,M?(0,i.jsxs)("div",{role:"status",className:`pointer-events-none fixed inset-x-4 z-[210] mx-auto flex max-w-[520px] items-center gap-2.5 rounded-2xl border border-niho-border bg-white/95 px-3.5 py-3 text-sub font-bold text-niho-text shadow-lg backdrop-blur-[8px] ${x}`,children:[(0,i.jsx)("span",{"aria-hidden":"true",className:"flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full bg-niho-accent-soft text-niho-accent-ink",children:(0,i.jsx)(l.A,{className:"h-3.5 w-3.5",
1strokeWidth:2.6})}),(0,i.jsx)("span",{children:k({ja:"ã¢ã«ã¦ã³ããã¾ã¨ãã¾ãã",en:"Your accounts are now combined"})})]}):null]})}},35175:(e,t,n)=>{n.d(t,{a:()=>r});var i=n(34626);let r={getSuggestion:()=>(0,i.Jt)("/api/me/account-merge/suggestion"),checkEmail:e=>(0,i.bE)("/api/me/account-merge/email-check",{email:e}),createIntent:()=>(0,i.bE)("/api/me/account-merge/intents"),complete:e=>(0,i.bE)("/api/me/account-merge/complete",{intentToken:e})}},75796:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(21425);let r={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};r.node;let o=(0,i.A)(r)}}]);
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.