Files
LangBot/web/.next/static/chunks/f3adbaa38ed06d97.js
T

20 lines
25 KiB
JavaScript

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},4480,(e,t,r)=>{t.exports=e.r(96387)},56907,20317,e=>{"use strict";var t=e.i(15742);e.i(81795).BackendClient,e.s([],56907),e.s(["httpClient",()=>t.backendClient],20317)},47108,29136,23371,e=>{"use strict";var t=e.i(83227);let r=(0,t.default)("moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);e.s(["Moon",()=>r],47108);let n=(0,t.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",()=>n],29136);let a=(0,t.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);e.s(["Monitor",()=>a],23371)},69038,20847,84522,e=>{"use strict";var t=e.i(83227);let r=(0,t.default)("mail",[["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"}]]);e.s(["Mail",()=>r],69038);let n=(0,t.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["Lock",()=>n],20847);var a=e.i(60498),o=e.i(47108),l=e.i(29136),i=e.i(23371),s=e.i(73344),u=e.i(74035);function c(){let{theme:e,setTheme:t}=(0,s.useTheme)();return(0,a.jsxs)(u.Button,{variant:"outline",size:"icon",onClick:()=>t("light"===e?"dark":"dark"===e?"system":"light"),className:"h-9 w-9",children:["light"===e&&(0,a.jsx)(l.Sun,{className:"h-[1.2rem] w-[1.2rem]"}),"dark"===e&&(0,a.jsx)(o.Moon,{className:"h-[1.2rem] w-[1.2rem]"}),"system"===e&&(0,a.jsx)(i.Monitor,{className:"h-[1.2rem] w-[1.2rem]"})]})}e.s(["ThemeToggle",()=>c],84522)},75327,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return o},urlQueryToSearchParams:function(){return i}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});function o(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function l(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,l(e));else t.set(r,l(n));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},61301,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return s}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(11522)._(e.r(75327)),l=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",i=e.hash||"",s=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),s&&"object"==typeof s&&(s=String(o.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${a}${c}${i}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},48889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(49311);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,n)),t&&(a.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},89673,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return b},NormalizeError:function(){return y},PageNotFoundError:function(){return x},SP:function(){return h},ST:function(){return g},WEB_VITALS:function(){return o},execOnce:function(){return l},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return s},isResSent:function(){return p},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return j}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=["CLS","FCP","FID","INP","LCP","TTFB"];function l(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>i.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function p(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&p(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let h="u">typeof performance,g=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class x extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class b extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function j(e){return JSON.stringify({message:e.message,stack:e.stack})}},94546,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(89673),a=e.r(74976);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},66952,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},11789,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return x}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(11522),l=e.r(60498),i=o._(e.r(49311)),s=e.r(61301),u=e.r(98027),c=e.r(48889),d=e.r(89673),p=e.r(67719);e.r(69035);let f=e.r(7103),m=e.r(94546),h=e.r(93735);function g(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function v(t){var r;let n,a,o,[s,v]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),x=(0,i.useRef)(null),{href:b,as:w,children:j,prefetch:P=null,passHref:E,replace:k,shallow:C,scroll:S,onClick:M,onMouseEnter:O,onTouchStart:T,legacyBehavior:N=!1,onNavigate:_,ref:R,unstable_dynamicOnHover:F,...L}=t;n=j,N&&("string"==typeof n||"number"==typeof n)&&(n=(0,l.jsx)("a",{children:n}));let A=i.default.useContext(u.AppRouterContext),I=!1!==P,D=!1!==P?null===(r=P)||"auto"===r?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:B,as:$}=i.default.useMemo(()=>{let e=g(b);return{href:e,as:w?g(w):e}},[b,w]);if(N){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(n)}let U=N?a&&"object"==typeof a&&a.ref:R,W=i.default.useCallback(e=>(null!==A&&(x.current=(0,f.mountLinkInstance)(e,B,A,D,I,v)),()=>{x.current&&((0,f.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,f.unmountPrefetchableInstance)(e)}),[I,B,A,D,v]),z={ref:(0,c.useMergedRef)(W,U),onClick(t){N||"function"!=typeof M||M(t),N&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!A||t.defaultPrevented||function(t,r,n,a,o,l,s){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(21946);i.default.startTransition(()=>{d(n||r,o?"replace":"push",l??!0,a.current)})}}(t,B,$,x,k,S,_)},onMouseEnter(e){N||"function"!=typeof O||O(e),N&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),A&&I&&(0,f.onNavigationIntent)(e.currentTarget,!0===F)},onTouchStart:function(e){N||"function"!=typeof T||T(e),N&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),A&&I&&(0,f.onNavigationIntent)(e.currentTarget,!0===F)}};return(0,d.isAbsoluteUrl)($)?z.href=$:N&&!E&&("a"!==a.type||"href"in a.props)||(z.href=(0,p.addBasePath)($)),o=N?i.default.cloneElement(a,z):(0,l.jsx)("a",{...L,...z,children:n}),(0,l.jsx)(y.Provider,{value:s,children:o})}e.r(66952);let y=(0,i.createContext)(f.IDLE_LINK_STATUS),x=()=>(0,i.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},82854,e=>{"use strict";var t=e.i(60498),r=e.i(74035),n=e.i(87980),a=e.i(81817),o=e.i(49311),l=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,p=(e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=o.createContext({}),m=o.forwardRef((e,t)=>{let r;var n,a,l,m,v,{value:y,onChange:x,maxLength:b,textAlign:w="left",pattern:j,placeholder:P,inputMode:E="numeric",onComplete:k,pushPasswordManagerStrategy:C="increase-width",pasteTransformer:S,containerClassName:M,noScriptCSSFallback:O=g,render:T,children:N}=e,_=((e,t)=>{var r={};for(var n in e)c.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&u)for(var n of u(e))0>t.indexOf(n)&&d.call(e,n)&&(r[n]=e[n]);return r})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[R,F]=o.useState("string"==typeof _.defaultValue?_.defaultValue:""),L=null!=y?y:R,A=(r=o.useRef(),o.useEffect(()=>{r.current=L}),r.current),I=o.useCallback(e=>{null==x||x(e),F(e)},[x]),D=o.useMemo(()=>j?"string"==typeof j?new RegExp(j):j:null,[j]),B=o.useRef(null),$=o.useRef(null),U=o.useRef({value:L,onChange:I,isIOS:"u">typeof window&&(null==(a=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:a.call(n,"-webkit-touch-callout","none"))}),W=o.useRef({prev:[null==(l=B.current)?void 0:l.selectionStart,null==(m=B.current)?void 0:m.selectionEnd,null==(v=B.current)?void 0:v.selectionDirection]});o.useImperativeHandle(t,()=>B.current,[]),o.useEffect(()=>{let e=B.current,t=$.current;if(!e||!t)return;function r(){if(document.activeElement!==e){G(null),Q(null);return}let t=e.selectionStart,r=e.selectionEnd,n=e.selectionDirection,a=e.maxLength,o=e.value,l=W.current.prev,i=-1,s=-1,u;if(0!==o.length&&null!==t&&null!==r){let e=t===r,n=t===o.length&&o.length<a;if(e&&!n){if(0===t)i=0,s=1,u="forward";else if(t===a)i=t-1,s=t,u="backward";else if(a>1&&o.length>1){let e=0;if(null!==l[0]&&null!==l[1]){u=t<l[1]?"backward":"forward";let r=l[0]===l[1]&&l[0]<a;"backward"!==u||r||(e=-1)}i=e+t,s=e+t+1}}-1!==i&&-1!==s&&i!==s&&B.current.setSelectionRange(i,s,u)}let c=-1!==i?i:t,d=-1!==s?s:r,p=null!=u?u:n;G(c),Q(d),W.current.prev=[c,d,p]}if(U.current.value!==e.value&&U.current.onChange(e.value),W.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",r,{capture:!0}),r(),document.activeElement===e&&q(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";h(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),h(e.sheet,`[data-input-otp]:autofill { ${t} }`),h(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),h(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),h(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let n=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};n();let a=new ResizeObserver(n);return a.observe(e),()=>{document.removeEventListener("selectionchange",r,{capture:!0}),a.disconnect()}},[]);let[z,K]=o.useState(!1),[H,q]=o.useState(!1),[V,G]=o.useState(null),[Z,Q]=o.useState(null);o.useEffect(()=>{var e;setTimeout(e=()=>{var e,t,r,n;null==(e=B.current)||e.dispatchEvent(new Event("input"));let a=null==(t=B.current)?void 0:t.selectionStart,o=null==(r=B.current)?void 0:r.selectionEnd,l=null==(n=B.current)?void 0:n.selectionDirection;null!==a&&null!==o&&(G(a),Q(o),W.current.prev=[a,o,l])},0),setTimeout(e,10),setTimeout(e,50)},[L,H]),o.useEffect(()=>{void 0!==A&&L!==A&&A.length<b&&L.length===b&&(null==k||k(L))},[b,k,A,L]);let X=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[a,l]=o.useState(!1),[i,s]=o.useState(!1),[u,c]=o.useState(!1),d=o.useMemo(()=>"none"!==r&&("increase-width"===r||"experimental-no-flickering"===r)&&a&&i,[a,i,r]),p=o.useCallback(()=>{let n=e.current,a=t.current;if(!n||!a||u||"none"===r)return;let o=n.getBoundingClientRect().left+n.offsetWidth,i=n.getBoundingClientRect().top+n.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(o-18,i)===n||(l(!0),c(!0))},[e,t,u,r]);return o.useEffect(()=>{let t=e.current;if(!t||"none"===r)return;function n(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}n();let a=setInterval(n,1e3);return()=>{clearInterval(a)}},[e,r]),o.useEffect(()=>{let e=n||document.activeElement===t.current;if("none"===r||!e)return;let a=setTimeout(p,0),o=setTimeout(p,2e3),l=setTimeout(p,5e3),i=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(a),clearTimeout(o),clearTimeout(l),clearTimeout(i)}},[t,n,r,p]),{hasPWMBadge:a,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:$,inputRef:B,pushPasswordManagerStrategy:C,isFocused:H}),J=o.useCallback(e=>{let t=e.currentTarget.value.slice(0,b);t.length>0&&D&&!D.test(t)?e.preventDefault():("string"==typeof A&&t.length<A.length&&document.dispatchEvent(new Event("selectionchange")),I(t))},[b,I,A,D]),Y=o.useCallback(()=>{var e;if(B.current){let t=Math.min(B.current.value.length,b-1),r=B.current.value.length;null==(e=B.current)||e.setSelectionRange(t,r),G(t),Q(r)}q(!0)},[b]),ee=o.useCallback(e=>{var t,r;let n=B.current;if(!S&&(!U.current.isIOS||!e.clipboardData||!n))return;let a=e.clipboardData.getData("text/plain"),o=S?S(a):a;e.preventDefault();let l=null==(t=B.current)?void 0:t.selectionStart,i=null==(r=B.current)?void 0:r.selectionEnd,s=(l!==i?L.slice(0,l)+o+L.slice(i):L.slice(0,l)+o+L.slice(l)).slice(0,b);if(s.length>0&&D&&!D.test(s))return;n.value=s,I(s);let u=Math.min(s.length,b-1),c=s.length;n.setSelectionRange(u,c),G(u),Q(c)},[b,I,D,L]),et=o.useMemo(()=>({position:"relative",cursor:_.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[_.disabled]),er=o.useMemo(()=>({position:"absolute",inset:0,width:X.willPushPWMBadge?`calc(100% + ${X.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:X.willPushPWMBadge?`inset(0 ${X.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:w,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[X.PWM_BADGE_SPACE_WIDTH,X.willPushPWMBadge,w]),en=o.useMemo(()=>o.createElement("input",i(((e,t)=>{for(var r in t||(t={}))c.call(t,r)&&p(e,r,t[r]);if(u)for(var r of u(t))d.call(t,r)&&p(e,r,t[r]);return e})({autoComplete:_.autoComplete||"one-time-code"},_),s({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===L.length||void 0,"data-input-otp-mss":V,"data-input-otp-mse":Z,inputMode:E,pattern:null==D?void 0:D.source,"aria-placeholder":P,style:er,maxLength:b,value:L,ref:B,onPaste:e=>{var t;ee(e),null==(t=_.onPaste)||t.call(_,e)},onChange:J,onMouseOver:e=>{var t;K(!0),null==(t=_.onMouseOver)||t.call(_,e)},onMouseLeave:e=>{var t;K(!1),null==(t=_.onMouseLeave)||t.call(_,e)},onFocus:e=>{var t;Y(),null==(t=_.onFocus)||t.call(_,e)},onBlur:e=>{var t;q(!1),null==(t=_.onBlur)||t.call(_,e)}}))),[J,Y,ee,E,er,b,Z,V,_,null==D?void 0:D.source,L]),ea=o.useMemo(()=>({slots:Array.from({length:b}).map((e,t)=>{var r;let n=H&&null!==V&&null!==Z&&(V===Z&&t===V||t>=V&&t<Z),a=void 0!==L[t]?L[t]:null;return{char:a,placeholderChar:void 0!==L[0]?null:null!=(r=null==P?void 0:P[t])?r:null,isActive:n,hasFakeCaret:n&&null===a}}),isFocused:H,isHovering:!_.disabled&&z}),[H,z,b,Z,V,_.disabled,L]),eo=o.useMemo(()=>T?T(ea):o.createElement(f.Provider,{value:ea},N),[N,ea,T]);return o.createElement(o.Fragment,null,null!==O&&o.createElement("noscript",null,o.createElement("style",null,O)),o.createElement("div",{ref:$,"data-input-otp-container":!0,style:et,className:M},eo,o.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},en)))});function h(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}m.displayName="Input";var g=`
[data-input-otp] {
--nojs-bg: white !important;
--nojs-fg: black !important;
background-color: var(--nojs-bg) !important;
color: var(--nojs-fg) !important;
caret-color: var(--nojs-fg) !important;
letter-spacing: .25em !important;
text-align: center !important;
border: 1px solid var(--nojs-fg) !important;
border-radius: 4px !important;
width: 100% !important;
}
@media (prefers-color-scheme: dark) {
[data-input-otp] {
--nojs-bg: black !important;
--nojs-fg: white !important;
}
}`,v=e.i(83227);let y=(0,v.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var x=e.i(14407);function b({className:e,containerClassName:r,...n}){return(0,t.jsx)(m,{"data-slot":"input-otp",containerClassName:(0,x.cn)("flex items-center gap-2 has-disabled:opacity-50",r),className:(0,x.cn)("disabled:cursor-not-allowed",e),...n})}function w({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"input-otp-group",className:(0,x.cn)("flex items-center",e),...r})}function j({index:e,className:r,...n}){let a=o.useContext(f),{char:l,hasFakeCaret:i,isActive:s}=a?.slots[e]??{};return(0,t.jsxs)("div",{"data-slot":"input-otp-slot","data-active":s,className:(0,x.cn)("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",r),...n,children:[l,i&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function P({...e}){return(0,t.jsx)("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:(0,t.jsx)(y,{})})}var E=e.i(57728),k=e.i(16585),C=e.i(29176),S=e.i(64339);e.i(56907);var M=e.i(20317),O=e.i(4480),T=e.i(69038),N=e.i(20847);let _=(0,v.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var R=e.i(50098);e.i(26128);var F=e.i(91830),L=e.i(11789),A=e.i(84522);let I=/^[0-9a-zA-Z]+$/;function D(){let e=(0,O.useRouter)(),{t:l}=(0,F.useTranslation)(),[i,s]=(0,o.useState)(!1),u=(0,E.useForm)({resolver:(0,k.zodResolver)(C.object({email:C.string().email(l("common.invalidEmail")),recoveryKey:C.string().min(1,l("resetPassword.recoveryKeyRequired")),newPassword:C.string().min(1,l("resetPassword.newPasswordRequired"))})),defaultValues:{email:"",recoveryKey:"",newPassword:""}});return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-neutral-900",children:(0,t.jsxs)(a.Card,{className:"w-[375px] shadow-lg dark:shadow-white/10",children:[(0,t.jsxs)(a.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)(L.default,{href:"/login",className:"flex items-center text-sm text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 transition-colors",children:[(0,t.jsx)(_,{className:"h-4 w-4 mr-1"}),l("resetPassword.backToLogin")]}),(0,t.jsx)(A.ThemeToggle,{})]}),(0,t.jsx)(a.CardTitle,{className:"text-2xl text-center",children:l("resetPassword.title")}),(0,t.jsx)(a.CardDescription,{className:"text-center",children:l("resetPassword.description")})]}),(0,t.jsx)(a.CardContent,{children:(0,t.jsx)(S.Form,{...u,children:(0,t.jsxs)("form",{onSubmit:u.handleSubmit(function(t){var r,n,a;r=t.email,n=t.recoveryKey,a=t.newPassword,s(!0),M.httpClient.resetPassword(r,n,a).then(()=>{R.toast.success(l("resetPassword.resetSuccess")),e.push("/login")}).catch(()=>{R.toast.error(l("resetPassword.resetFailed"))}).finally(()=>{s(!1)})}),className:"space-y-6",children:[(0,t.jsx)(S.FormField,{control:u.control,name:"email",render:({field:e})=>(0,t.jsxs)(S.FormItem,{children:[(0,t.jsx)(S.FormLabel,{children:l("common.email")}),(0,t.jsx)(S.FormControl,{children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(T.Mail,{className:"absolute left-3 top-3 h-4 w-4 text-gray-400"}),(0,t.jsx)(n.Input,{placeholder:l("common.enterEmail"),className:"pl-10",...e})]})}),(0,t.jsx)(S.FormMessage,{})]})}),(0,t.jsx)(S.FormField,{control:u.control,name:"recoveryKey",render:({field:e})=>(0,t.jsxs)(S.FormItem,{children:[(0,t.jsx)(S.FormLabel,{children:l("resetPassword.recoveryKey")}),(0,t.jsx)(S.FormDescription,{children:l("resetPassword.recoveryKeyDescription")}),(0,t.jsx)(S.FormControl,{children:(0,t.jsxs)(b,{maxLength:6,value:e.value,pattern:I.source,onChange:t=>{let r=t.toUpperCase();e.onChange(r)},children:[(0,t.jsxs)(w,{children:[(0,t.jsx)(j,{index:0}),(0,t.jsx)(j,{index:1}),(0,t.jsx)(j,{index:2})]}),(0,t.jsx)(P,{}),(0,t.jsxs)(w,{children:[(0,t.jsx)(j,{index:3}),(0,t.jsx)(j,{index:4}),(0,t.jsx)(j,{index:5})]})]})}),(0,t.jsx)(S.FormMessage,{})]})}),(0,t.jsx)(S.FormField,{control:u.control,name:"newPassword",render:({field:e})=>(0,t.jsxs)(S.FormItem,{children:[(0,t.jsx)(S.FormLabel,{children:l("resetPassword.newPassword")}),(0,t.jsx)(S.FormControl,{children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(N.Lock,{className:"absolute left-3 top-3 h-4 w-4 text-gray-400"}),(0,t.jsx)(n.Input,{type:"password",placeholder:l("resetPassword.enterNewPassword"),className:"pl-10",...e})]})}),(0,t.jsx)(S.FormMessage,{})]})}),(0,t.jsx)(r.Button,{type:"submit",className:"w-full mt-4 cursor-pointer",disabled:i,children:i?l("resetPassword.resetting"):l("resetPassword.resetPassword")})]})})})]})})}e.s(["default",()=>D],82854)}]);