var Lw=Object.defineProperty;var Rw=(r,e,a)=>e in r?Lw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a;var Dw=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var ze=(r,e,a)=>Rw(r,typeof e!="symbol"?e+"":e,a);var ZU=Dw((a_,iv)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(s){if(s.ep)return;s.ep=!0;const c=a(s);fetch(s.href,c)}})();try{}catch(r){console.error("[wxt] Failed to initialize plugins",r)}function qi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Bw(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var a=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(a,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),a}var Df={exports:{}},El={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ty;function Uw(){if(ty)return El;ty=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function a(i,s,c){var d=null;if(c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),"key"in s){c={};for(var m in s)m!=="key"&&(c[m]=s[m])}else c=s;return s=c.ref,{$$typeof:r,type:i,key:d,ref:s!==void 0?s:null,props:c}}return El.Fragment=e,El.jsx=a,El.jsxs=a,El}var ay;function _w(){return ay||(ay=1,Df.exports=Uw()),Df.exports}var l=_w(),Bf={exports:{}},bl={},Uf={exports:{}},_f={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ny;function Mw(){return ny||(ny=1,function(r){function e($,re){var ye=$.length;$.push(re);e:for(;0<ye;){var Ae=ye-1>>>1,j=$[Ae];if(0<s(j,re))$[Ae]=re,$[ye]=j,ye=Ae;else break e}}function a($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var re=$[0],ye=$.pop();if(ye!==re){$[0]=ye;e:for(var Ae=0,j=$.length,X=j>>>1;Ae<X;){var ee=2*(Ae+1)-1,ie=$[ee],Ie=ee+1,we=$[Ie];if(0>s(ie,ye))Ie<j&&0>s(we,ie)?($[Ae]=we,$[Ie]=ye,Ae=Ie):($[Ae]=ie,$[ee]=ye,Ae=ee);else if(Ie<j&&0>s(we,ye))$[Ae]=we,$[Ie]=ye,Ae=Ie;else break e}}return re}function s($,re){var ye=$.sortIndex-re.sortIndex;return ye!==0?ye:$.id-re.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();r.unstable_now=function(){return d.now()-m}}var g=[],f=[],E=1,p=null,C=3,I=!1,x=!1,T=!1,k=!1,R=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function O($){for(var re=a(f);re!==null;){if(re.callback===null)i(f);else if(re.startTime<=$)i(f),re.sortIndex=re.expirationTime,e(g,re);else break;re=a(f)}}function U($){if(T=!1,O($),!x)if(a(g)!==null)x=!0,P||(P=!0,q());else{var re=a(f);re!==null&&me(U,re.startTime-$)}}var P=!1,K=-1,H=5,Q=-1;function V(){return k?!0:!(r.unstable_now()-Q<H)}function G(){if(k=!1,P){var $=r.unstable_now();Q=$;var re=!0;try{e:{x=!1,T&&(T=!1,_(K),K=-1),I=!0;var ye=C;try{t:{for(O($),p=a(g);p!==null&&!(p.expirationTime>$&&V());){var Ae=p.callback;if(typeof Ae=="function"){p.callback=null,C=p.priorityLevel;var j=Ae(p.expirationTime<=$);if($=r.unstable_now(),typeof j=="function"){p.callback=j,O($),re=!0;break t}p===a(g)&&i(g),O($)}else i(g);p=a(g)}if(p!==null)re=!0;else{var X=a(f);X!==null&&me(U,X.startTime-$),re=!1}}break e}finally{p=null,C=ye,I=!1}re=void 0}}finally{re?q():P=!1}}}var q;if(typeof S=="function")q=function(){S(G)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ne=W.port2;W.port1.onmessage=G,q=function(){ne.postMessage(null)}}else q=function(){R(G,0)};function me($,re){K=R(function(){$(r.unstable_now())},re)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function($){$.callback=null},r.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<$?Math.floor(1e3/$):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_next=function($){switch(C){case 1:case 2:case 3:var re=3;break;default:re=C}var ye=C;C=re;try{return $()}finally{C=ye}},r.unstable_requestPaint=function(){k=!0},r.unstable_runWithPriority=function($,re){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ye=C;C=$;try{return re()}finally{C=ye}},r.unstable_scheduleCallback=function($,re,ye){var Ae=r.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?Ae+ye:Ae):ye=Ae,$){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=ye+j,$={id:E++,callback:re,priorityLevel:$,startTime:ye,expirationTime:j,sortIndex:-1},ye>Ae?($.sortIndex=ye,e(f,$),a(g)===null&&$===a(f)&&(T?(_(K),K=-1):T=!0,me(U,ye-Ae))):($.sortIndex=j,e(g,$),x||I||(x=!0,P||(P=!0,q()))),$},r.unstable_shouldYield=V,r.unstable_wrapCallback=function($){var re=C;return function(){var ye=C;C=re;try{return $.apply(this,arguments)}finally{C=ye}}}}(_f)),_f}var ry;function Fw(){return ry||(ry=1,Uf.exports=Mw()),Uf.exports}var Mf={exports:{}},Ct={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var iy;function Ow(){if(iy)return Ct;iy=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),p=Symbol.iterator;function C(j){return j===null||typeof j!="object"?null:(j=p&&j[p]||j["@@iterator"],typeof j=="function"?j:null)}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,T={};function k(j,X,ee){this.props=j,this.context=X,this.refs=T,this.updater=ee||I}k.prototype.isReactComponent={},k.prototype.setState=function(j,X){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,X,"setState")},k.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function R(){}R.prototype=k.prototype;function _(j,X,ee){this.props=j,this.context=X,this.refs=T,this.updater=ee||I}var S=_.prototype=new R;S.constructor=_,x(S,k.prototype),S.isPureReactComponent=!0;var O=Array.isArray,U={H:null,A:null,T:null,S:null,V:null},P=Object.prototype.hasOwnProperty;function K(j,X,ee,ie,Ie,we){return ee=we.ref,{$$typeof:r,type:j,key:X,ref:ee!==void 0?ee:null,props:we}}function H(j,X){return K(j.type,X,void 0,void 0,void 0,j.props)}function Q(j){return typeof j=="object"&&j!==null&&j.$$typeof===r}function V(j){var X={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ee){return X[ee]})}var G=/\/+/g;function q(j,X){return typeof j=="object"&&j!==null&&j.key!=null?V(""+j.key):X.toString(36)}function W(){}function ne(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(W,W):(j.status="pending",j.then(function(X){j.status==="pending"&&(j.status="fulfilled",j.value=X)},function(X){j.status==="pending"&&(j.status="rejected",j.reason=X)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function me(j,X,ee,ie,Ie){var we=typeof j;(we==="undefined"||we==="boolean")&&(j=null);var Re=!1;if(j===null)Re=!0;else switch(we){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(j.$$typeof){case r:case e:Re=!0;break;case E:return Re=j._init,me(Re(j._payload),X,ee,ie,Ie)}}if(Re)return Ie=Ie(j),Re=ie===""?"."+q(j,0):ie,O(Ie)?(ee="",Re!=null&&(ee=Re.replace(G,"$&/")+"/"),me(Ie,X,ee,"",function(He){return He})):Ie!=null&&(Q(Ie)&&(Ie=H(Ie,ee+(Ie.key==null||j&&j.key===Ie.key?"":(""+Ie.key).replace(G,"$&/")+"/")+Re)),X.push(Ie)),1;Re=0;var De=ie===""?".":ie+":";if(O(j))for(var Te=0;Te<j.length;Te++)ie=j[Te],we=De+q(ie,Te),Re+=me(ie,X,ee,we,Ie);else if(Te=C(j),typeof Te=="function")for(j=Te.call(j),Te=0;!(ie=j.next()).done;)ie=ie.value,we=De+q(ie,Te++),Re+=me(ie,X,ee,we,Ie);else if(we==="object"){if(typeof j.then=="function")return me(ne(j),X,ee,ie,Ie);throw X=String(j),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Re}function $(j,X,ee){if(j==null)return j;var ie=[],Ie=0;return me(j,ie,"","",function(we){return X.call(ee,we,Ie++)}),ie}function re(j){if(j._status===-1){var X=j._result;X=X(),X.then(function(ee){(j._status===0||j._status===-1)&&(j._status=1,j._result=ee)},function(ee){(j._status===0||j._status===-1)&&(j._status=2,j._result=ee)}),j._status===-1&&(j._status=0,j._result=X)}if(j._status===1)return j._result.default;throw j._result}var ye=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)};function Ae(){}return Ct.Children={map:$,forEach:function(j,X,ee){$(j,function(){X.apply(this,arguments)},ee)},count:function(j){var X=0;return $(j,function(){X++}),X},toArray:function(j){return $(j,function(X){return X})||[]},only:function(j){if(!Q(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},Ct.Component=k,Ct.Fragment=a,Ct.Profiler=s,Ct.PureComponent=_,Ct.StrictMode=i,Ct.Suspense=g,Ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Ct.__COMPILER_RUNTIME={__proto__:null,c:function(j){return U.H.useMemoCache(j)}},Ct.cache=function(j){return function(){return j.apply(null,arguments)}},Ct.cloneElement=function(j,X,ee){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var ie=x({},j.props),Ie=j.key,we=void 0;if(X!=null)for(Re in X.ref!==void 0&&(we=void 0),X.key!==void 0&&(Ie=""+X.key),X)!P.call(X,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&X.ref===void 0||(ie[Re]=X[Re]);var Re=arguments.length-2;if(Re===1)ie.children=ee;else if(1<Re){for(var De=Array(Re),Te=0;Te<Re;Te++)De[Te]=arguments[Te+2];ie.children=De}return K(j.type,Ie,void 0,void 0,we,ie)},Ct.createContext=function(j){return j={$$typeof:d,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:c,_context:j},j},Ct.createElement=function(j,X,ee){var ie,Ie={},we=null;if(X!=null)for(ie in X.key!==void 0&&(we=""+X.key),X)P.call(X,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(Ie[ie]=X[ie]);var Re=arguments.length-2;if(Re===1)Ie.children=ee;else if(1<Re){for(var De=Array(Re),Te=0;Te<Re;Te++)De[Te]=arguments[Te+2];Ie.children=De}if(j&&j.defaultProps)for(ie in Re=j.defaultProps,Re)Ie[ie]===void 0&&(Ie[ie]=Re[ie]);return K(j,we,void 0,void 0,null,Ie)},Ct.createRef=function(){return{current:null}},Ct.forwardRef=function(j){return{$$typeof:m,render:j}},Ct.isValidElement=Q,Ct.lazy=function(j){return{$$typeof:E,_payload:{_status:-1,_result:j},_init:re}},Ct.memo=function(j,X){return{$$typeof:f,type:j,compare:X===void 0?null:X}},Ct.startTransition=function(j){var X=U.T,ee={};U.T=ee;try{var ie=j(),Ie=U.S;Ie!==null&&Ie(ee,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(Ae,ye)}catch(we){ye(we)}finally{U.T=X}},Ct.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Ct.use=function(j){return U.H.use(j)},Ct.useActionState=function(j,X,ee){return U.H.useActionState(j,X,ee)},Ct.useCallback=function(j,X){return U.H.useCallback(j,X)},Ct.useContext=function(j){return U.H.useContext(j)},Ct.useDebugValue=function(){},Ct.useDeferredValue=function(j,X){return U.H.useDeferredValue(j,X)},Ct.useEffect=function(j,X,ee){var ie=U.H;if(typeof ee=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ie.useEffect(j,X)},Ct.useId=function(){return U.H.useId()},Ct.useImperativeHandle=function(j,X,ee){return U.H.useImperativeHandle(j,X,ee)},Ct.useInsertionEffect=function(j,X){return U.H.useInsertionEffect(j,X)},Ct.useLayoutEffect=function(j,X){return U.H.useLayoutEffect(j,X)},Ct.useMemo=function(j,X){return U.H.useMemo(j,X)},Ct.useOptimistic=function(j,X){return U.H.useOptimistic(j,X)},Ct.useReducer=function(j,X,ee){return U.H.useReducer(j,X,ee)},Ct.useRef=function(j){return U.H.useRef(j)},Ct.useState=function(j){return U.H.useState(j)},Ct.useSyncExternalStore=function(j,X,ee){return U.H.useSyncExternalStore(j,X,ee)},Ct.useTransition=function(){return U.H.useTransition()},Ct.version="19.1.0",Ct}var sy;function fh(){return sy||(sy=1,Mf.exports=Ow()),Mf.exports}var Ff={exports:{}},sn={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var oy;function jw(){if(oy)return sn;oy=1;var r=fh();function e(g){var f="https://react.dev/errors/"+g;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)f+="&args[]="+encodeURIComponent(arguments[E])}return"Minified React error #"+g+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(e(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal");function c(g,f,E){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:g,containerInfo:f,implementation:E}}var d=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,f){if(g==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,sn.createPortal=function(g,f){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return c(g,f,null,E)},sn.flushSync=function(g){var f=d.T,E=i.p;try{if(d.T=null,i.p=2,g)return g()}finally{d.T=f,i.p=E,i.d.f()}},sn.preconnect=function(g,f){typeof g=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(g,f))},sn.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},sn.preinit=function(g,f){if(typeof g=="string"&&f&&typeof f.as=="string"){var E=f.as,p=m(E,f.crossOrigin),C=typeof f.integrity=="string"?f.integrity:void 0,I=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;E==="style"?i.d.S(g,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:C,fetchPriority:I}):E==="script"&&i.d.X(g,{crossOrigin:p,integrity:C,fetchPriority:I,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},sn.preinitModule=function(g,f){if(typeof g=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var E=m(f.as,f.crossOrigin);i.d.M(g,{crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(g)},sn.preload=function(g,f){if(typeof g=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var E=f.as,p=m(E,f.crossOrigin);i.d.L(g,E,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},sn.preloadModule=function(g,f){if(typeof g=="string")if(f){var E=m(f.as,f.crossOrigin);i.d.m(g,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(g)},sn.requestFormReset=function(g){i.d.r(g)},sn.unstable_batchedUpdates=function(g,f){return g(f)},sn.useFormState=function(g,f,E){return d.H.useFormState(g,f,E)},sn.useFormStatus=function(){return d.H.useHostTransitionStatus()},sn.version="19.1.0",sn}var ly;function Pw(){if(ly)return Ff.exports;ly=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),Ff.exports=jw(),Ff.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var cy;function Hw(){if(cy)return bl;cy=1;var r=Fw(),e=fh(),a=Pw();function i(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,o=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(o=n.return),t=n.return;while(t)}return n.tag===3?o:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function m(t){if(c(t)!==t)throw Error(i(188))}function g(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(i(188));return n!==t?null:t}for(var o=t,u=n;;){var h=o.return;if(h===null)break;var y=h.alternate;if(y===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===y.child){for(y=h.child;y;){if(y===o)return m(h),t;if(y===u)return m(h),n;y=y.sibling}throw Error(i(188))}if(o.return!==u.return)o=h,u=y;else{for(var L=!1,M=h.child;M;){if(M===o){L=!0,o=h,u=y;break}if(M===u){L=!0,u=h,o=y;break}M=M.sibling}if(!L){for(M=y.child;M;){if(M===o){L=!0,o=y,u=h;break}if(M===u){L=!0,u=y,o=h;break}M=M.sibling}if(!L)throw Error(i(189))}}if(o.alternate!==u)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?t:n}function f(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=f(t),n!==null)return n;t=t.sibling}return null}var E=Object.assign,p=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),_=Symbol.for("react.consumer"),S=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function q(t){return t===null||typeof t!="object"?null:(t=G&&t[G]||t["@@iterator"],typeof t=="function"?t:null)}var W=Symbol.for("react.client.reference");function ne(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===W?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case k:return"Profiler";case T:return"StrictMode";case U:return"Suspense";case P:return"SuspenseList";case Q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case I:return"Portal";case S:return(t.displayName||"Context")+".Provider";case _:return(t._context.displayName||"Context")+".Consumer";case O:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case K:return n=t.displayName||null,n!==null?n:ne(t.type)||"Memo";case H:n=t._payload,t=t._init;try{return ne(t(n))}catch{}}return null}var me=Array.isArray,$=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},Ae=[],j=-1;function X(t){return{current:t}}function ee(t){0>j||(t.current=Ae[j],Ae[j]=null,j--)}function ie(t,n){j++,Ae[j]=t.current,t.current=n}var Ie=X(null),we=X(null),Re=X(null),De=X(null);function Te(t,n){switch(ie(Re,n),ie(we,t),ie(Ie,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?k0(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=k0(n),t=L0(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ee(Ie),ie(Ie,t)}function He(){ee(Ie),ee(we),ee(Re)}function Ne(t){t.memoizedState!==null&&ie(De,t);var n=Ie.current,o=L0(n,t.type);n!==o&&(ie(we,t),ie(Ie,o))}function Qe(t){we.current===t&&(ee(Ie),ee(we)),De.current===t&&(ee(De),gl._currentValue=ye)}var yt=Object.prototype.hasOwnProperty,We=r.unstable_scheduleCallback,nt=r.unstable_cancelCallback,Ht=r.unstable_shouldYield,ve=r.unstable_requestPaint,Be=r.unstable_now,$e=r.unstable_getCurrentPriorityLevel,Ye=r.unstable_ImmediatePriority,lt=r.unstable_UserBlockingPriority,et=r.unstable_NormalPriority,Et=r.unstable_LowPriority,Pt=r.unstable_IdlePriority,qt=r.log,Qt=r.unstable_setDisableYieldValue,na=null,B=null;function v(t){if(typeof qt=="function"&&Qt(t),B&&typeof B.setStrictMode=="function")try{B.setStrictMode(na,t)}catch{}}var N=Math.clz32?Math.clz32:ge,z=Math.log,ae=Math.LN2;function ge(t){return t>>>=0,t===0?32:31-(z(t)/ae|0)|0}var Ee=256,Ue=4194304;function ht(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function It(t,n,o){var u=t.pendingLanes;if(u===0)return 0;var h=0,y=t.suspendedLanes,L=t.pingedLanes;t=t.warmLanes;var M=u&134217727;return M!==0?(u=M&~y,u!==0?h=ht(u):(L&=M,L!==0?h=ht(L):o||(o=M&~t,o!==0&&(h=ht(o))))):(M=u&~y,M!==0?h=ht(M):L!==0?h=ht(L):o||(o=u&~t,o!==0&&(h=ht(o)))),h===0?0:n!==0&&n!==h&&(n&y)===0&&(y=h&-h,o=n&-n,y>=o||y===32&&(o&4194048)!==0)?n:h}function St(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function mt(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fr(){var t=Ee;return Ee<<=1,(Ee&4194048)===0&&(Ee=256),t}function ra(){var t=Ue;return Ue<<=1,(Ue&62914560)===0&&(Ue=4194304),t}function an(t){for(var n=[],o=0;31>o;o++)n.push(t);return n}function On(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function jn(t,n,o,u,h,y){var L=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var M=t.entanglements,Y=t.expirationTimes,de=t.hiddenUpdates;for(o=L&~o;0<o;){var be=31-N(o),Se=1<<be;M[be]=0,Y[be]=-1;var fe=de[be];if(fe!==null)for(de[be]=null,be=0;be<fe.length;be++){var he=fe[be];he!==null&&(he.lane&=-536870913)}o&=~Se}u!==0&&Oe(t,u,0),y!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=y&~(L&~n))}function Oe(t,n,o){t.pendingLanes|=n,t.suspendedLanes&=~n;var u=31-N(n);t.entangledLanes|=n,t.entanglements[u]=t.entanglements[u]|1073741824|o&4194090}function ci(t,n){var o=t.entangledLanes|=n;for(t=t.entanglements;o;){var u=31-N(o),h=1<<u;h&n|t[u]&n&&(t[u]|=n),o&=~h}}function Zt(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function sa(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function tr(){var t=re.p;return t!==0?t:(t=window.event,t===void 0?32:Y0(t.type))}function ar(t,n){var o=re.p;try{return re.p=t,n()}finally{re.p=o}}var Ra=Math.random().toString(36).slice(2),zt="__reactFiber$"+Ra,ya="__reactProps$"+Ra,Wt="__reactContainer$"+Ra,Da="__reactEvents$"+Ra,ja="__reactListeners$"+Ra,Rr="__reactHandles$"+Ra,oe="__reactResources$"+Ra,Me="__reactMarker$"+Ra;function _e(t){delete t[zt],delete t[ya],delete t[Da],delete t[ja],delete t[Rr]}function Xe(t){var n=t[zt];if(n)return n;for(var o=t.parentNode;o;){if(n=o[Wt]||o[zt]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(t=U0(t);t!==null;){if(o=t[zt])return o;t=U0(t)}return n}t=o,o=t.parentNode}return null}function kt(t){if(t=t[zt]||t[Wt]){var n=t.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return t}return null}function vt(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(i(33))}function it(t){var n=t[oe];return n||(n=t[oe]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function st(t){t[Me]=!0}var cn=new Set,Fe={};function Z(t,n){xe(t,n),xe(t+"Capture",n)}function xe(t,n){for(Fe[t]=n,t=0;t<n.length;t++)cn.add(n[t])}var Pe=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ut={},ca={};function oa(t){return yt.call(ca,t)?!0:yt.call(Ut,t)?!1:Pe.test(t)?ca[t]=!0:(Ut[t]=!0,!1)}function la(t,n,o){if(oa(n))if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+o)}}function Ga(t,n,o){if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+o)}}function va(t,n,o,u){if(u===null)t.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(n,o,""+u)}}var gr,ea;function xn(t){if(gr===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);gr=n&&n[1]||"",ea=-1<o.stack.indexOf(`
    at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
`+gr+t+ea}var Dr=!1;function Ts(t,n){if(!t||Dr)return"";Dr=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(n){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(he){var fe=he}Reflect.construct(t,[],Se)}else{try{Se.call()}catch(he){fe=he}t.call(Se.prototype)}}else{try{throw Error()}catch(he){fe=he}(Se=t())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(he){if(he&&fe&&typeof he.stack=="string")return[he.stack,fe.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),L=y[0],M=y[1];if(L&&M){var Y=L.split(`
`),de=M.split(`
`);for(h=u=0;u<Y.length&&!Y[u].includes("DetermineComponentFrameRoot");)u++;for(;h<de.length&&!de[h].includes("DetermineComponentFrameRoot");)h++;if(u===Y.length||h===de.length)for(u=Y.length-1,h=de.length-1;1<=u&&0<=h&&Y[u]!==de[h];)h--;for(;1<=u&&0<=h;u--,h--)if(Y[u]!==de[h]){if(u!==1||h!==1)do if(u--,h--,0>h||Y[u]!==de[h]){var be=`
`+Y[u].replace(" at new "," at ");return t.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",t.displayName)),be}while(1<=u&&0<=h);break}}}finally{Dr=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?xn(o):""}function ec(t){switch(t.tag){case 26:case 27:case 5:return xn(t.type);case 16:return xn("Lazy");case 13:return xn("Suspense");case 19:return xn("SuspenseList");case 0:case 15:return Ts(t.type,!1);case 11:return Ts(t.type.render,!1);case 1:return Ts(t.type,!0);case 31:return xn("Activity");default:return""}}function tc(t){try{var n="";do n+=ec(t),t=t.return;while(t);return n}catch(o){return`
Error generating stack: `+o.message+`
`+o.stack}}function wa(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Yt(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Br(t){var n=Yt(t)?"checked":"value",o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),u=""+t[n];if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,y=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return h.call(this)},set:function(L){u=""+L,y.call(this,L)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(L){u=""+L},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ur(t){t._valueTracker||(t._valueTracker=Br(t))}function Wi(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return t&&(u=Yt(t)?t.checked?"true":"false":t.value),t=u,t!==o?(n.setValue(t),!0):!1}function _r(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Co=/[\n"\\]/g;function An(t){return t.replace(Co,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function No(t,n,o,u,h,y,L,M){t.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?t.type=L:t.removeAttribute("type"),n!=null?L==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+wa(n)):t.value!==""+wa(n)&&(t.value=""+wa(n)):L!=="submit"&&L!=="reset"||t.removeAttribute("value"),n!=null?Ss(t,L,wa(n)):o!=null?Ss(t,L,wa(o)):u!=null&&t.removeAttribute("value"),h==null&&y!=null&&(t.defaultChecked=!!y),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+wa(M):t.removeAttribute("name")}function ui(t,n,o,u,h,y,L,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),n!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||n!=null))return;o=o!=null?""+wa(o):"",n=n!=null?""+wa(n):o,M||n===t.value||(t.value=n),t.defaultValue=n}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=M?t.checked:!!u,t.defaultChecked=!!u,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(t.name=L)}function Ss(t,n,o){n==="number"&&_r(t.ownerDocument)===t||t.defaultValue===""+o||(t.defaultValue=""+o)}function di(t,n,o,u){if(t=t.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<t.length;o++)h=n.hasOwnProperty("$"+t[o].value),t[o].selected!==h&&(t[o].selected=h),h&&u&&(t[o].defaultSelected=!0)}else{for(o=""+wa(o),n=null,h=0;h<t.length;h++){if(t[h].value===o){t[h].selected=!0,u&&(t[h].defaultSelected=!0);return}n!==null||t[h].disabled||(n=t[h])}n!==null&&(n.selected=!0)}}function ks(t,n,o){if(n!=null&&(n=""+wa(n),n!==t.value&&(t.value=n),o==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=o!=null?""+wa(o):""}function xo(t,n,o,u){if(n==null){if(u!=null){if(o!=null)throw Error(i(92));if(me(u)){if(1<u.length)throw Error(i(93));u=u[0]}o=u}o==null&&(o=""),n=o}o=wa(n),t.defaultValue=o,u=t.textContent,u===o&&u!==""&&u!==null&&(t.value=u)}function hr(t,n){if(n){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=n;return}}t.textContent=n}var To=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ac(t,n,o){var u=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":u?t.setProperty(n,o):typeof o!="number"||o===0||To.has(n)?n==="float"?t.cssFloat=o:t[n]=(""+o).trim():t[n]=o+"px"}function Yi(t,n,o){if(n!=null&&typeof n!="object")throw Error(i(62));if(t=t.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var h in n)u=n[h],n.hasOwnProperty(h)&&o[h]!==u&&ac(t,h,u)}else for(var y in n)n.hasOwnProperty(y)&&ac(t,y,n[y])}function mi(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),So=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function pn(t){return So.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Pn=null;function Fr(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var fi=null,Je=null;function Ls(t){var n=kt(t);if(n&&(t=n.stateNode)){var o=t[ya]||null;e:switch(t=n.stateNode,n.type){case"input":if(No(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+An(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var u=o[n];if(u!==t&&u.form===t.form){var h=u[ya]||null;if(!h)throw Error(i(90));No(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<o.length;n++)u=o[n],u.form===t.form&&Wi(u)}break e;case"textarea":ks(t,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&di(t,!!o.multiple,n,!1)}}}var gi=!1;function ko(t,n,o){if(gi)return t(n,o);gi=!0;try{var u=t(n);return u}finally{if(gi=!1,(fi!==null||Je!==null)&&(Qc(),fi&&(n=fi,t=Je,Je=fi=null,Ls(n),t)))for(n=0;n<t.length;n++)Ls(t[n])}}function hi(t,n){var o=t.stateNode;if(o===null)return null;var u=o[ya]||null;if(u===null)return null;o=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hn=!1;if(un)try{var nr={};Object.defineProperty(nr,"passive",{get:function(){Hn=!0}}),window.addEventListener("test",nr,nr),window.removeEventListener("test",nr,nr)}catch{Hn=!1}var Qn=null,A=null,b=null;function D(){if(b)return b;var t,n=A,o=n.length,u,h="value"in Qn?Qn.value:Qn.textContent,y=h.length;for(t=0;t<o&&n[t]===h[t];t++);var L=o-t;for(u=1;u<=L&&n[o-u]===h[y-u];u++);return b=h.slice(t,1<u?1-u:void 0)}function F(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function J(){return!0}function ce(){return!1}function pe(t){function n(o,u,h,y,L){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=y,this.target=L,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(o=t[M],this[M]=o?o(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?J:ce,this.isPropagationStopped=ce,this}return E(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=J)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=J)},persist:function(){},isPersistent:J}),n}var Ve={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wt=pe(Ve),At=E({},Ve,{view:0,detail:0}),ua=pe(At),Pa,Rs,Ji,Xi=E({},At,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Do,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ji&&(Ji&&t.type==="mousemove"?(Pa=t.screenX-Ji.screenX,Rs=t.screenY-Ji.screenY):Rs=Pa=0,Ji=t),Pa)},movementY:function(t){return"movementY"in t?t.movementY:Rs}}),nc=pe(Xi),rc=E({},Xi,{dataTransfer:0}),Ed=pe(rc),bd=E({},At,{relatedTarget:0}),Lo=pe(bd),Id=E({},Ve,{animationName:0,elapsedTime:0,pseudoElement:0}),vd=pe(Id),wd=E({},Ve,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Cd=pe(wd),Nd=E({},Ve,{data:0}),Ro=pe(Nd),xd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Td={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kd(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Sd[t])?!!n[t]:!1}function Do(){return kd}var Ld=E({},At,{key:function(t){if(t.key){var n=xd[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=F(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Td[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Do,charCode:function(t){return t.type==="keypress"?F(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?F(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Rd=pe(Ld),ic=E({},Xi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sc=pe(ic),Dd=E({},At,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Do}),Bd=pe(Dd),Ud=E({},Ve,{propertyName:0,elapsedTime:0,pseudoElement:0}),_d=pe(Ud),Md=E({},Xi,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),oc=pe(Md),Fd=E({},Ve,{newState:0,oldState:0}),Od=pe(Fd),jd=[9,13,27,32],Ai=un&&"CompositionEvent"in window,pi=null;un&&"documentMode"in document&&(pi=document.documentMode);var lc=un&&"TextEvent"in window&&!pi,Bo=un&&(!Ai||pi&&8<pi&&11>=pi),le=" ",Le=!1;function Ke(t,n){switch(t){case"keyup":return jd.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rt(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ct=!1;function Ot(t,n){switch(t){case"compositionend":return rt(n);case"keypress":return n.which!==32?null:(Le=!0,le);case"textInput":return t=n.data,t===le&&Le?null:t;default:return null}}function Tn(t,n){if(ct)return t==="compositionend"||!Ai&&Ke(t,n)?(t=D(),b=A=Qn=null,ct=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Bo&&n.locale!=="ko"?null:n.data;default:return null}}var yn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nn(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!yn[t.type]:n==="textarea"}function En(t,n,o,u){fi?Je?Je.push(u):Je=[u]:fi=u,n=Wc(n,"onChange"),0<n.length&&(o=new wt("onChange","change",null,o,u),t.push({event:o,listeners:n}))}var Or=null,Sn=null;function Pd(t){C0(t,0)}function cc(t){var n=vt(t);if(Wi(n))return t}function Kh(t,n){if(t==="change")return n}var Gh=!1;if(un){var Hd;if(un){var Qd="oninput"in document;if(!Qd){var qh=document.createElement("div");qh.setAttribute("oninput","return;"),Qd=typeof qh.oninput=="function"}Hd=Qd}else Hd=!1;Gh=Hd&&(!document.documentMode||9<document.documentMode)}function Wh(){Or&&(Or.detachEvent("onpropertychange",Yh),Sn=Or=null)}function Yh(t){if(t.propertyName==="value"&&cc(Sn)){var n=[];En(n,Sn,t,Fr(t)),ko(Pd,n)}}function sv(t,n,o){t==="focusin"?(Wh(),Or=n,Sn=o,Or.attachEvent("onpropertychange",Yh)):t==="focusout"&&Wh()}function ov(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return cc(Sn)}function lv(t,n){if(t==="click")return cc(n)}function cv(t,n){if(t==="input"||t==="change")return cc(n)}function uv(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var kn=typeof Object.is=="function"?Object.is:uv;function Uo(t,n){if(kn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var o=Object.keys(t),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var h=o[u];if(!yt.call(n,h)||!kn(t[h],n[h]))return!1}return!0}function Jh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Xh(t,n){var o=Jh(t);t=0;for(var u;o;){if(o.nodeType===3){if(u=t+o.textContent.length,t<=n&&u>=n)return{node:o,offset:n-t};t=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Jh(o)}}function $h(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?$h(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Zh(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=_r(t.document);n instanceof t.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)t=n.contentWindow;else break;n=_r(t.document)}return n}function zd(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var dv=un&&"documentMode"in document&&11>=document.documentMode,Ds=null,Vd=null,_o=null,Kd=!1;function eA(t,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Kd||Ds==null||Ds!==_r(u)||(u=Ds,"selectionStart"in u&&zd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),_o&&Uo(_o,u)||(_o=u,u=Wc(Vd,"onSelect"),0<u.length&&(n=new wt("onSelect","select",null,n,o),t.push({event:n,listeners:u}),n.target=Ds)))}function $i(t,n){var o={};return o[t.toLowerCase()]=n.toLowerCase(),o["Webkit"+t]="webkit"+n,o["Moz"+t]="moz"+n,o}var Bs={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionrun:$i("Transition","TransitionRun"),transitionstart:$i("Transition","TransitionStart"),transitioncancel:$i("Transition","TransitionCancel"),transitionend:$i("Transition","TransitionEnd")},Gd={},tA={};un&&(tA=document.createElement("div").style,"AnimationEvent"in window||(delete Bs.animationend.animation,delete Bs.animationiteration.animation,delete Bs.animationstart.animation),"TransitionEvent"in window||delete Bs.transitionend.transition);function Zi(t){if(Gd[t])return Gd[t];if(!Bs[t])return t;var n=Bs[t],o;for(o in n)if(n.hasOwnProperty(o)&&o in tA)return Gd[t]=n[o];return t}var aA=Zi("animationend"),nA=Zi("animationiteration"),rA=Zi("animationstart"),mv=Zi("transitionrun"),fv=Zi("transitionstart"),gv=Zi("transitioncancel"),iA=Zi("transitionend"),sA=new Map,qd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");qd.push("scrollEnd");function rr(t,n){sA.set(t,n),Z(n,[t])}var oA=new WeakMap;function zn(t,n){if(typeof t=="object"&&t!==null){var o=oA.get(t);return o!==void 0?o:(n={value:t,source:n,stack:tc(n)},oA.set(t,n),n)}return{value:t,source:n,stack:tc(n)}}var Vn=[],Us=0,Wd=0;function uc(){for(var t=Us,n=Wd=Us=0;n<t;){var o=Vn[n];Vn[n++]=null;var u=Vn[n];Vn[n++]=null;var h=Vn[n];Vn[n++]=null;var y=Vn[n];if(Vn[n++]=null,u!==null&&h!==null){var L=u.pending;L===null?h.next=h:(h.next=L.next,L.next=h),u.pending=h}y!==0&&lA(o,h,y)}}function dc(t,n,o,u){Vn[Us++]=t,Vn[Us++]=n,Vn[Us++]=o,Vn[Us++]=u,Wd|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function Yd(t,n,o,u){return dc(t,n,o,u),mc(t)}function _s(t,n){return dc(t,null,null,n),mc(t)}function lA(t,n,o){t.lanes|=o;var u=t.alternate;u!==null&&(u.lanes|=o);for(var h=!1,y=t.return;y!==null;)y.childLanes|=o,u=y.alternate,u!==null&&(u.childLanes|=o),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(h=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,h&&n!==null&&(h=31-N(o),t=y.hiddenUpdates,u=t[h],u===null?t[h]=[n]:u.push(n),n.lane=o|536870912),y):null}function mc(t){if(50<sl)throw sl=0,tf=null,Error(i(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ms={};function hv(t,n,o,u){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(t,n,o,u){return new hv(t,n,o,u)}function Jd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function jr(t,n){var o=t.alternate;return o===null?(o=Ln(t.tag,n,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=n,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&65011712,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,n=t.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function cA(t,n){t.flags&=65011714;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,n=o.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function fc(t,n,o,u,h,y){var L=0;if(u=t,typeof t=="function")Jd(t)&&(L=1);else if(typeof t=="string")L=pw(t,o,Ie.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Q:return t=Ln(31,o,n,h),t.elementType=Q,t.lanes=y,t;case x:return es(o.children,h,y,n);case T:L=8,h|=24;break;case k:return t=Ln(12,o,n,h|2),t.elementType=k,t.lanes=y,t;case U:return t=Ln(13,o,n,h),t.elementType=U,t.lanes=y,t;case P:return t=Ln(19,o,n,h),t.elementType=P,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case R:case S:L=10;break e;case _:L=9;break e;case O:L=11;break e;case K:L=14;break e;case H:L=16,u=null;break e}L=29,o=Error(i(130,t===null?"null":typeof t,"")),u=null}return n=Ln(L,o,n,h),n.elementType=t,n.type=u,n.lanes=y,n}function es(t,n,o,u){return t=Ln(7,t,u,n),t.lanes=o,t}function Xd(t,n,o){return t=Ln(6,t,null,n),t.lanes=o,t}function $d(t,n,o){return n=Ln(4,t.children!==null?t.children:[],t.key,n),n.lanes=o,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Fs=[],Os=0,gc=null,hc=0,Kn=[],Gn=0,ts=null,Pr=1,Hr="";function as(t,n){Fs[Os++]=hc,Fs[Os++]=gc,gc=t,hc=n}function uA(t,n,o){Kn[Gn++]=Pr,Kn[Gn++]=Hr,Kn[Gn++]=ts,ts=t;var u=Pr;t=Hr;var h=32-N(u)-1;u&=~(1<<h),o+=1;var y=32-N(n)+h;if(30<y){var L=h-h%5;y=(u&(1<<L)-1).toString(32),u>>=L,h-=L,Pr=1<<32-N(n)+h|o<<h|u,Hr=y+t}else Pr=1<<y|o<<h|u,Hr=t}function Zd(t){t.return!==null&&(as(t,1),uA(t,1,0))}function em(t){for(;t===gc;)gc=Fs[--Os],Fs[Os]=null,hc=Fs[--Os],Fs[Os]=null;for(;t===ts;)ts=Kn[--Gn],Kn[Gn]=null,Hr=Kn[--Gn],Kn[Gn]=null,Pr=Kn[--Gn],Kn[Gn]=null}var dn=null,Ea=null,jt=!1,ns=null,Ar=!1,tm=Error(i(519));function rs(t){var n=Error(i(418,""));throw Oo(zn(n,t)),tm}function dA(t){var n=t.stateNode,o=t.type,u=t.memoizedProps;switch(n[zt]=t,n[ya]=u,o){case"dialog":Bt("cancel",n),Bt("close",n);break;case"iframe":case"object":case"embed":Bt("load",n);break;case"video":case"audio":for(o=0;o<ll.length;o++)Bt(ll[o],n);break;case"source":Bt("error",n);break;case"img":case"image":case"link":Bt("error",n),Bt("load",n);break;case"details":Bt("toggle",n);break;case"input":Bt("invalid",n),ui(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0),Ur(n);break;case"select":Bt("invalid",n);break;case"textarea":Bt("invalid",n),xo(n,u.value,u.defaultValue,u.children),Ur(n)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||u.suppressHydrationWarning===!0||S0(n.textContent,o)?(u.popover!=null&&(Bt("beforetoggle",n),Bt("toggle",n)),u.onScroll!=null&&Bt("scroll",n),u.onScrollEnd!=null&&Bt("scrollend",n),u.onClick!=null&&(n.onclick=Yc),n=!0):n=!1,n||rs(t)}function mA(t){for(dn=t.return;dn;)switch(dn.tag){case 5:case 13:Ar=!1;return;case 27:case 3:Ar=!0;return;default:dn=dn.return}}function Mo(t){if(t!==dn)return!1;if(!jt)return mA(t),jt=!0,!1;var n=t.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||yf(t.type,t.memoizedProps)),o=!o),o&&Ea&&rs(t),mA(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8)if(o=t.data,o==="/$"){if(n===0){Ea=sr(t.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++;t=t.nextSibling}Ea=null}}else n===27?(n=Ea,Bi(t.type)?(t=vf,vf=null,Ea=t):Ea=n):Ea=dn?sr(t.stateNode.nextSibling):null;return!0}function Fo(){Ea=dn=null,jt=!1}function fA(){var t=ns;return t!==null&&(vn===null?vn=t:vn.push.apply(vn,t),ns=null),t}function Oo(t){ns===null?ns=[t]:ns.push(t)}var am=X(null),is=null,Qr=null;function yi(t,n,o){ie(am,n._currentValue),n._currentValue=o}function zr(t){t._currentValue=am.current,ee(am)}function nm(t,n,o){for(;t!==null;){var u=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),t===o)break;t=t.return}}function rm(t,n,o,u){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var y=h.dependencies;if(y!==null){var L=h.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=h;for(var Y=0;Y<n.length;Y++)if(M.context===n[Y]){y.lanes|=o,M=y.alternate,M!==null&&(M.lanes|=o),nm(y.return,o,t),u||(L=null);break e}y=M.next}}else if(h.tag===18){if(L=h.return,L===null)throw Error(i(341));L.lanes|=o,y=L.alternate,y!==null&&(y.lanes|=o),nm(L,o,t),L=null}else L=h.child;if(L!==null)L.return=h;else for(L=h;L!==null;){if(L===t){L=null;break}if(h=L.sibling,h!==null){h.return=L.return,L=h;break}L=L.return}h=L}}function jo(t,n,o,u){t=null;for(var h=n,y=!1;h!==null;){if(!y){if((h.flags&524288)!==0)y=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var L=h.alternate;if(L===null)throw Error(i(387));if(L=L.memoizedProps,L!==null){var M=h.type;kn(h.pendingProps.value,L.value)||(t!==null?t.push(M):t=[M])}}else if(h===De.current){if(L=h.alternate,L===null)throw Error(i(387));L.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(gl):t=[gl])}h=h.return}t!==null&&rm(n,t,o,u),n.flags|=262144}function Ac(t){for(t=t.firstContext;t!==null;){if(!kn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ss(t){is=t,Qr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function rn(t){return gA(is,t)}function pc(t,n){return is===null&&ss(t),gA(t,n)}function gA(t,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},Qr===null){if(t===null)throw Error(i(308));Qr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Qr=Qr.next=n;return o}var Av=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(o,u){t.push(u)}};this.abort=function(){n.aborted=!0,t.forEach(function(o){return o()})}},pv=r.unstable_scheduleCallback,yv=r.unstable_NormalPriority,Ba={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function im(){return{controller:new Av,data:new Map,refCount:0}}function Po(t){t.refCount--,t.refCount===0&&pv(yv,function(){t.controller.abort()})}var Ho=null,sm=0,js=0,Ps=null;function Ev(t,n){if(Ho===null){var o=Ho=[];sm=0,js=cf(),Ps={status:"pending",value:void 0,then:function(u){o.push(u)}}}return sm++,n.then(hA,hA),n}function hA(){if(--sm===0&&Ho!==null){Ps!==null&&(Ps.status="fulfilled");var t=Ho;Ho=null,js=0,Ps=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function bv(t,n){var o=[],u={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return t.then(function(){u.status="fulfilled",u.value=n;for(var h=0;h<o.length;h++)(0,o[h])(n)},function(h){for(u.status="rejected",u.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),u}var AA=$.S;$.S=function(t,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&Ev(t,n),AA!==null&&AA(t,n)};var os=X(null);function om(){var t=os.current;return t!==null?t:ia.pooledCache}function yc(t,n){n===null?ie(os,os.current):ie(os,n.pool)}function pA(){var t=om();return t===null?null:{parent:Ba._currentValue,pool:t}}var Qo=Error(i(460)),yA=Error(i(474)),Ec=Error(i(542)),lm={then:function(){}};function EA(t){return t=t.status,t==="fulfilled"||t==="rejected"}function bc(){}function bA(t,n,o){switch(o=t[o],o===void 0?t.push(n):o!==n&&(n.then(bc,bc),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,vA(t),t;default:if(typeof n.status=="string")n.then(bc,bc);else{if(t=ia,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=n,t.status="pending",t.then(function(u){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=u}},function(u){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,vA(t),t}throw zo=n,Qo}}var zo=null;function IA(){if(zo===null)throw Error(i(459));var t=zo;return zo=null,t}function vA(t){if(t===Qo||t===Ec)throw Error(i(483))}var Ei=!1;function cm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function um(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function bi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ii(t,n,o){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Vt&2)!==0){var h=u.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),u.pending=n,n=mc(t),lA(t,null,o),n}return dc(t,u,n,o),mc(t)}function Vo(t,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var u=n.lanes;u&=t.pendingLanes,o|=u,n.lanes=o,ci(t,o)}}function dm(t,n){var o=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var h=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var L={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?h=y=L:y=y.next=L,o=o.next}while(o!==null);y===null?h=y=n:y=y.next=n}else h=y=n;o={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=n:t.next=n,o.lastBaseUpdate=n}var mm=!1;function Ko(){if(mm){var t=Ps;if(t!==null)throw t}}function Go(t,n,o,u){mm=!1;var h=t.updateQueue;Ei=!1;var y=h.firstBaseUpdate,L=h.lastBaseUpdate,M=h.shared.pending;if(M!==null){h.shared.pending=null;var Y=M,de=Y.next;Y.next=null,L===null?y=de:L.next=de,L=Y;var be=t.alternate;be!==null&&(be=be.updateQueue,M=be.lastBaseUpdate,M!==L&&(M===null?be.firstBaseUpdate=de:M.next=de,be.lastBaseUpdate=Y))}if(y!==null){var Se=h.baseState;L=0,be=de=Y=null,M=y;do{var fe=M.lane&-536870913,he=fe!==M.lane;if(he?(_t&fe)===fe:(u&fe)===fe){fe!==0&&fe===js&&(mm=!0),be!==null&&(be=be.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ft=t,ot=M;fe=n;var $t=o;switch(ot.tag){case 1:if(ft=ot.payload,typeof ft=="function"){Se=ft.call($t,Se,fe);break e}Se=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=ot.payload,fe=typeof ft=="function"?ft.call($t,Se,fe):ft,fe==null)break e;Se=E({},Se,fe);break e;case 2:Ei=!0}}fe=M.callback,fe!==null&&(t.flags|=64,he&&(t.flags|=8192),he=h.callbacks,he===null?h.callbacks=[fe]:he.push(fe))}else he={lane:fe,tag:M.tag,payload:M.payload,callback:M.callback,next:null},be===null?(de=be=he,Y=Se):be=be.next=he,L|=fe;if(M=M.next,M===null){if(M=h.shared.pending,M===null)break;he=M,M=he.next,he.next=null,h.lastBaseUpdate=he,h.shared.pending=null}}while(!0);be===null&&(Y=Se),h.baseState=Y,h.firstBaseUpdate=de,h.lastBaseUpdate=be,y===null&&(h.shared.lanes=0),ki|=L,t.lanes=L,t.memoizedState=Se}}function wA(t,n){if(typeof t!="function")throw Error(i(191,t));t.call(n)}function CA(t,n){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)wA(o[t],n)}var Hs=X(null),Ic=X(0);function NA(t,n){t=Jr,ie(Ic,t),ie(Hs,n),Jr=t|n.baseLanes}function fm(){ie(Ic,Jr),ie(Hs,Hs.current)}function gm(){Jr=Ic.current,ee(Hs),ee(Ic)}var vi=0,Tt=null,Jt=null,xa=null,vc=!1,Qs=!1,ls=!1,wc=0,qo=0,zs=null,Iv=0;function Ca(){throw Error(i(321))}function hm(t,n){if(n===null)return!1;for(var o=0;o<n.length&&o<t.length;o++)if(!kn(t[o],n[o]))return!1;return!0}function Am(t,n,o,u,h,y){return vi=y,Tt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,$.H=t===null||t.memoizedState===null?lp:cp,ls=!1,y=o(u,h),ls=!1,Qs&&(y=TA(n,o,u,h)),xA(t),y}function xA(t){$.H=kc;var n=Jt!==null&&Jt.next!==null;if(vi=0,xa=Jt=Tt=null,vc=!1,qo=0,zs=null,n)throw Error(i(300));t===null||Ha||(t=t.dependencies,t!==null&&Ac(t)&&(Ha=!0))}function TA(t,n,o,u){Tt=t;var h=0;do{if(Qs&&(zs=null),qo=0,Qs=!1,25<=h)throw Error(i(301));if(h+=1,xa=Jt=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}$.H=Sv,y=n(o,u)}while(Qs);return y}function vv(){var t=$.H,n=t.useState()[0];return n=typeof n.then=="function"?Wo(n):n,t=t.useState()[0],(Jt!==null?Jt.memoizedState:null)!==t&&(Tt.flags|=1024),n}function pm(){var t=wc!==0;return wc=0,t}function ym(t,n,o){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~o}function Em(t){if(vc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}vc=!1}vi=0,xa=Jt=Tt=null,Qs=!1,qo=wc=0,zs=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xa===null?Tt.memoizedState=xa=t:xa=xa.next=t,xa}function Ta(){if(Jt===null){var t=Tt.alternate;t=t!==null?t.memoizedState:null}else t=Jt.next;var n=xa===null?Tt.memoizedState:xa.next;if(n!==null)xa=n,Jt=t;else{if(t===null)throw Tt.alternate===null?Error(i(467)):Error(i(310));Jt=t,t={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},xa===null?Tt.memoizedState=xa=t:xa=xa.next=t}return xa}function bm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(t){var n=qo;return qo+=1,zs===null&&(zs=[]),t=bA(zs,t,n),n=Tt,(xa===null?n.memoizedState:xa.next)===null&&(n=n.alternate,$.H=n===null||n.memoizedState===null?lp:cp),t}function Cc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Wo(t);if(t.$$typeof===S)return rn(t)}throw Error(i(438,String(t)))}function Im(t){var n=null,o=Tt.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var u=Tt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=bm(),Tt.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(t),u=0;u<t;u++)o[u]=V;return n.index++,o}function Vr(t,n){return typeof n=="function"?n(t):n}function Nc(t){var n=Ta();return vm(n,Jt,t)}function vm(t,n,o){var u=t.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=o;var h=t.baseQueue,y=u.pending;if(y!==null){if(h!==null){var L=h.next;h.next=y.next,y.next=L}n.baseQueue=h=y,u.pending=null}if(y=t.baseState,h===null)t.memoizedState=y;else{n=h.next;var M=L=null,Y=null,de=n,be=!1;do{var Se=de.lane&-536870913;if(Se!==de.lane?(_t&Se)===Se:(vi&Se)===Se){var fe=de.revertLane;if(fe===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),Se===js&&(be=!0);else if((vi&fe)===fe){de=de.next,fe===js&&(be=!0);continue}else Se={lane:0,revertLane:de.revertLane,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Y===null?(M=Y=Se,L=y):Y=Y.next=Se,Tt.lanes|=fe,ki|=fe;Se=de.action,ls&&o(y,Se),y=de.hasEagerState?de.eagerState:o(y,Se)}else fe={lane:Se,revertLane:de.revertLane,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Y===null?(M=Y=fe,L=y):Y=Y.next=fe,Tt.lanes|=Se,ki|=Se;de=de.next}while(de!==null&&de!==n);if(Y===null?L=y:Y.next=M,!kn(y,t.memoizedState)&&(Ha=!0,be&&(o=Ps,o!==null)))throw o;t.memoizedState=y,t.baseState=L,t.baseQueue=Y,u.lastRenderedState=y}return h===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function wm(t){var n=Ta(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=t;var u=o.dispatch,h=o.pending,y=n.memoizedState;if(h!==null){o.pending=null;var L=h=h.next;do y=t(y,L.action),L=L.next;while(L!==h);kn(y,n.memoizedState)||(Ha=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,u]}function SA(t,n,o){var u=Tt,h=Ta(),y=jt;if(y){if(o===void 0)throw Error(i(407));o=o()}else o=n();var L=!kn((Jt||h).memoizedState,o);L&&(h.memoizedState=o,Ha=!0),h=h.queue;var M=RA.bind(null,u,h,t);if(Yo(2048,8,M,[t]),h.getSnapshot!==n||L||xa!==null&&xa.memoizedState.tag&1){if(u.flags|=2048,Vs(9,xc(),LA.bind(null,u,h,o,n),null),ia===null)throw Error(i(349));y||(vi&124)!==0||kA(u,n,o)}return o}function kA(t,n,o){t.flags|=16384,t={getSnapshot:n,value:o},n=Tt.updateQueue,n===null?(n=bm(),Tt.updateQueue=n,n.stores=[t]):(o=n.stores,o===null?n.stores=[t]:o.push(t))}function LA(t,n,o,u){n.value=o,n.getSnapshot=u,DA(n)&&BA(t)}function RA(t,n,o){return o(function(){DA(n)&&BA(t)})}function DA(t){var n=t.getSnapshot;t=t.value;try{var o=n();return!kn(t,o)}catch{return!0}}function BA(t){var n=_s(t,2);n!==null&&_n(n,t,2)}function Cm(t){var n=bn();if(typeof t=="function"){var o=t;if(t=o(),ls){v(!0);try{o()}finally{v(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:t},n}function UA(t,n,o,u){return t.baseState=o,vm(t,Jt,typeof u=="function"?u:Vr)}function wv(t,n,o,u,h){if(Sc(t))throw Error(i(485));if(t=n.action,t!==null){var y={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){y.listeners.push(L)}};$.T!==null?o(!0):y.isTransition=!1,u(y),o=n.pending,o===null?(y.next=n.pending=y,_A(n,y)):(y.next=o.next,n.pending=o.next=y)}}function _A(t,n){var o=n.action,u=n.payload,h=t.state;if(n.isTransition){var y=$.T,L={};$.T=L;try{var M=o(h,u),Y=$.S;Y!==null&&Y(L,M),MA(t,n,M)}catch(de){Nm(t,n,de)}finally{$.T=y}}else try{y=o(h,u),MA(t,n,y)}catch(de){Nm(t,n,de)}}function MA(t,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){FA(t,n,u)},function(u){return Nm(t,n,u)}):FA(t,n,o)}function FA(t,n,o){n.status="fulfilled",n.value=o,OA(n),t.state=o,n=t.pending,n!==null&&(o=n.next,o===n?t.pending=null:(o=o.next,n.next=o,_A(t,o)))}function Nm(t,n,o){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=o,OA(n),n=n.next;while(n!==u)}t.action=null}function OA(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function jA(t,n){return n}function PA(t,n){if(jt){var o=ia.formState;if(o!==null){e:{var u=Tt;if(jt){if(Ea){t:{for(var h=Ea,y=Ar;h.nodeType!==8;){if(!y){h=null;break t}if(h=sr(h.nextSibling),h===null){h=null;break t}}y=h.data,h=y==="F!"||y==="F"?h:null}if(h){Ea=sr(h.nextSibling),u=h.data==="F!";break e}}rs(u)}u=!1}u&&(n=o[0])}}return o=bn(),o.memoizedState=o.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jA,lastRenderedState:n},o.queue=u,o=ip.bind(null,Tt,u),u.dispatch=o,u=Cm(!1),y=Lm.bind(null,Tt,!1,u.queue),u=bn(),h={state:n,dispatch:null,action:t,pending:null},u.queue=h,o=wv.bind(null,Tt,h,y,o),h.dispatch=o,u.memoizedState=t,[n,o,!1]}function HA(t){var n=Ta();return QA(n,Jt,t)}function QA(t,n,o){if(n=vm(t,n,jA)[0],t=Nc(Vr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=Wo(n)}catch(L){throw L===Qo?Ec:L}else u=n;n=Ta();var h=n.queue,y=h.dispatch;return o!==n.memoizedState&&(Tt.flags|=2048,Vs(9,xc(),Cv.bind(null,h,o),null)),[u,y,t]}function Cv(t,n){t.action=n}function zA(t){var n=Ta(),o=Jt;if(o!==null)return QA(n,o,t);Ta(),n=n.memoizedState,o=Ta();var u=o.queue.dispatch;return o.memoizedState=t,[n,u,!1]}function Vs(t,n,o,u){return t={tag:t,create:o,deps:u,inst:n,next:null},n=Tt.updateQueue,n===null&&(n=bm(),Tt.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=t.next=t:(u=o.next,o.next=t,t.next=u,n.lastEffect=t),t}function xc(){return{destroy:void 0,resource:void 0}}function VA(){return Ta().memoizedState}function Tc(t,n,o,u){var h=bn();u=u===void 0?null:u,Tt.flags|=t,h.memoizedState=Vs(1|n,xc(),o,u)}function Yo(t,n,o,u){var h=Ta();u=u===void 0?null:u;var y=h.memoizedState.inst;Jt!==null&&u!==null&&hm(u,Jt.memoizedState.deps)?h.memoizedState=Vs(n,y,o,u):(Tt.flags|=t,h.memoizedState=Vs(1|n,y,o,u))}function KA(t,n){Tc(8390656,8,t,n)}function GA(t,n){Yo(2048,8,t,n)}function qA(t,n){return Yo(4,2,t,n)}function WA(t,n){return Yo(4,4,t,n)}function YA(t,n){if(typeof n=="function"){t=t();var o=n(t);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function JA(t,n,o){o=o!=null?o.concat([t]):null,Yo(4,4,YA.bind(null,n,t),o)}function xm(){}function XA(t,n){var o=Ta();n=n===void 0?null:n;var u=o.memoizedState;return n!==null&&hm(n,u[1])?u[0]:(o.memoizedState=[t,n],t)}function $A(t,n){var o=Ta();n=n===void 0?null:n;var u=o.memoizedState;if(n!==null&&hm(n,u[1]))return u[0];if(u=t(),ls){v(!0);try{t()}finally{v(!1)}}return o.memoizedState=[u,n],u}function Tm(t,n,o){return o===void 0||(vi&1073741824)!==0?t.memoizedState=n:(t.memoizedState=o,t=t0(),Tt.lanes|=t,ki|=t,o)}function ZA(t,n,o,u){return kn(o,n)?o:Hs.current!==null?(t=Tm(t,o,u),kn(t,n)||(Ha=!0),t):(vi&42)===0?(Ha=!0,t.memoizedState=o):(t=t0(),Tt.lanes|=t,ki|=t,n)}function ep(t,n,o,u,h){var y=re.p;re.p=y!==0&&8>y?y:8;var L=$.T,M={};$.T=M,Lm(t,!1,n,o);try{var Y=h(),de=$.S;if(de!==null&&de(M,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var be=bv(Y,u);Jo(t,n,be,Un(t))}else Jo(t,n,u,Un(t))}catch(Se){Jo(t,n,{then:function(){},status:"rejected",reason:Se},Un())}finally{re.p=y,$.T=L}}function Nv(){}function Sm(t,n,o,u){if(t.tag!==5)throw Error(i(476));var h=tp(t).queue;ep(t,h,n,ye,o===null?Nv:function(){return ap(t),o(u)})}function tp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:ye},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:o},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ap(t){var n=tp(t).next.queue;Jo(t,n,{},Un())}function km(){return rn(gl)}function np(){return Ta().memoizedState}function rp(){return Ta().memoizedState}function xv(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var o=Un();t=bi(o);var u=Ii(n,t,o);u!==null&&(_n(u,n,o),Vo(u,n,o)),n={cache:im()},t.payload=n;return}n=n.return}}function Tv(t,n,o){var u=Un();o={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Sc(t)?sp(n,o):(o=Yd(t,n,o,u),o!==null&&(_n(o,t,u),op(o,n,u)))}function ip(t,n,o){var u=Un();Jo(t,n,o,u)}function Jo(t,n,o,u){var h={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Sc(t))sp(n,h);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var L=n.lastRenderedState,M=y(L,o);if(h.hasEagerState=!0,h.eagerState=M,kn(M,L))return dc(t,n,h,0),ia===null&&uc(),!1}catch{}finally{}if(o=Yd(t,n,h,u),o!==null)return _n(o,t,u),op(o,n,u),!0}return!1}function Lm(t,n,o,u){if(u={lane:2,revertLane:cf(),action:u,hasEagerState:!1,eagerState:null,next:null},Sc(t)){if(n)throw Error(i(479))}else n=Yd(t,o,u,2),n!==null&&_n(n,t,2)}function Sc(t){var n=t.alternate;return t===Tt||n!==null&&n===Tt}function sp(t,n){Qs=vc=!0;var o=t.pending;o===null?n.next=n:(n.next=o.next,o.next=n),t.pending=n}function op(t,n,o){if((o&4194048)!==0){var u=n.lanes;u&=t.pendingLanes,o|=u,n.lanes=o,ci(t,o)}}var kc={readContext:rn,use:Cc,useCallback:Ca,useContext:Ca,useEffect:Ca,useImperativeHandle:Ca,useLayoutEffect:Ca,useInsertionEffect:Ca,useMemo:Ca,useReducer:Ca,useRef:Ca,useState:Ca,useDebugValue:Ca,useDeferredValue:Ca,useTransition:Ca,useSyncExternalStore:Ca,useId:Ca,useHostTransitionStatus:Ca,useFormState:Ca,useActionState:Ca,useOptimistic:Ca,useMemoCache:Ca,useCacheRefresh:Ca},lp={readContext:rn,use:Cc,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:rn,useEffect:KA,useImperativeHandle:function(t,n,o){o=o!=null?o.concat([t]):null,Tc(4194308,4,YA.bind(null,n,t),o)},useLayoutEffect:function(t,n){return Tc(4194308,4,t,n)},useInsertionEffect:function(t,n){Tc(4,2,t,n)},useMemo:function(t,n){var o=bn();n=n===void 0?null:n;var u=t();if(ls){v(!0);try{t()}finally{v(!1)}}return o.memoizedState=[u,n],u},useReducer:function(t,n,o){var u=bn();if(o!==void 0){var h=o(n);if(ls){v(!0);try{o(n)}finally{v(!1)}}}else h=n;return u.memoizedState=u.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},u.queue=t,t=t.dispatch=Tv.bind(null,Tt,t),[u.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=Cm(t);var n=t.queue,o=ip.bind(null,Tt,n);return n.dispatch=o,[t.memoizedState,o]},useDebugValue:xm,useDeferredValue:function(t,n){var o=bn();return Tm(o,t,n)},useTransition:function(){var t=Cm(!1);return t=ep.bind(null,Tt,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,o){var u=Tt,h=bn();if(jt){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),ia===null)throw Error(i(349));(_t&124)!==0||kA(u,n,o)}h.memoizedState=o;var y={value:o,getSnapshot:n};return h.queue=y,KA(RA.bind(null,u,y,t),[t]),u.flags|=2048,Vs(9,xc(),LA.bind(null,u,y,o,n),null),o},useId:function(){var t=bn(),n=ia.identifierPrefix;if(jt){var o=Hr,u=Pr;o=(u&~(1<<32-N(u)-1)).toString(32)+o,n="«"+n+"R"+o,o=wc++,0<o&&(n+="H"+o.toString(32)),n+="»"}else o=Iv++,n="«"+n+"r"+o.toString(32)+"»";return t.memoizedState=n},useHostTransitionStatus:km,useFormState:PA,useActionState:PA,useOptimistic:function(t){var n=bn();n.memoizedState=n.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=Lm.bind(null,Tt,!0,o),o.dispatch=n,[t,n]},useMemoCache:Im,useCacheRefresh:function(){return bn().memoizedState=xv.bind(null,Tt)}},cp={readContext:rn,use:Cc,useCallback:XA,useContext:rn,useEffect:GA,useImperativeHandle:JA,useInsertionEffect:qA,useLayoutEffect:WA,useMemo:$A,useReducer:Nc,useRef:VA,useState:function(){return Nc(Vr)},useDebugValue:xm,useDeferredValue:function(t,n){var o=Ta();return ZA(o,Jt.memoizedState,t,n)},useTransition:function(){var t=Nc(Vr)[0],n=Ta().memoizedState;return[typeof t=="boolean"?t:Wo(t),n]},useSyncExternalStore:SA,useId:np,useHostTransitionStatus:km,useFormState:HA,useActionState:HA,useOptimistic:function(t,n){var o=Ta();return UA(o,Jt,t,n)},useMemoCache:Im,useCacheRefresh:rp},Sv={readContext:rn,use:Cc,useCallback:XA,useContext:rn,useEffect:GA,useImperativeHandle:JA,useInsertionEffect:qA,useLayoutEffect:WA,useMemo:$A,useReducer:wm,useRef:VA,useState:function(){return wm(Vr)},useDebugValue:xm,useDeferredValue:function(t,n){var o=Ta();return Jt===null?Tm(o,t,n):ZA(o,Jt.memoizedState,t,n)},useTransition:function(){var t=wm(Vr)[0],n=Ta().memoizedState;return[typeof t=="boolean"?t:Wo(t),n]},useSyncExternalStore:SA,useId:np,useHostTransitionStatus:km,useFormState:zA,useActionState:zA,useOptimistic:function(t,n){var o=Ta();return Jt!==null?UA(o,Jt,t,n):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:Im,useCacheRefresh:rp},Ks=null,Xo=0;function Lc(t){var n=Xo;return Xo+=1,Ks===null&&(Ks=[]),bA(Ks,t,n)}function $o(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Rc(t,n){throw n.$$typeof===p?Error(i(525)):(t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function up(t){var n=t._init;return n(t._payload)}function dp(t){function n(se,te){if(t){var ue=se.deletions;ue===null?(se.deletions=[te],se.flags|=16):ue.push(te)}}function o(se,te){if(!t)return null;for(;te!==null;)n(se,te),te=te.sibling;return null}function u(se){for(var te=new Map;se!==null;)se.key!==null?te.set(se.key,se):te.set(se.index,se),se=se.sibling;return te}function h(se,te){return se=jr(se,te),se.index=0,se.sibling=null,se}function y(se,te,ue){return se.index=ue,t?(ue=se.alternate,ue!==null?(ue=ue.index,ue<te?(se.flags|=67108866,te):ue):(se.flags|=67108866,te)):(se.flags|=1048576,te)}function L(se){return t&&se.alternate===null&&(se.flags|=67108866),se}function M(se,te,ue,Ce){return te===null||te.tag!==6?(te=Xd(ue,se.mode,Ce),te.return=se,te):(te=h(te,ue),te.return=se,te)}function Y(se,te,ue,Ce){var Ge=ue.type;return Ge===x?be(se,te,ue.props.children,Ce,ue.key):te!==null&&(te.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===H&&up(Ge)===te.type)?(te=h(te,ue.props),$o(te,ue),te.return=se,te):(te=fc(ue.type,ue.key,ue.props,null,se.mode,Ce),$o(te,ue),te.return=se,te)}function de(se,te,ue,Ce){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=$d(ue,se.mode,Ce),te.return=se,te):(te=h(te,ue.children||[]),te.return=se,te)}function be(se,te,ue,Ce,Ge){return te===null||te.tag!==7?(te=es(ue,se.mode,Ce,Ge),te.return=se,te):(te=h(te,ue),te.return=se,te)}function Se(se,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Xd(""+te,se.mode,ue),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case C:return ue=fc(te.type,te.key,te.props,null,se.mode,ue),$o(ue,te),ue.return=se,ue;case I:return te=$d(te,se.mode,ue),te.return=se,te;case H:var Ce=te._init;return te=Ce(te._payload),Se(se,te,ue)}if(me(te)||q(te))return te=es(te,se.mode,ue,null),te.return=se,te;if(typeof te.then=="function")return Se(se,Lc(te),ue);if(te.$$typeof===S)return Se(se,pc(se,te),ue);Rc(se,te)}return null}function fe(se,te,ue,Ce){var Ge=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ge!==null?null:M(se,te,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case C:return ue.key===Ge?Y(se,te,ue,Ce):null;case I:return ue.key===Ge?de(se,te,ue,Ce):null;case H:return Ge=ue._init,ue=Ge(ue._payload),fe(se,te,ue,Ce)}if(me(ue)||q(ue))return Ge!==null?null:be(se,te,ue,Ce,null);if(typeof ue.then=="function")return fe(se,te,Lc(ue),Ce);if(ue.$$typeof===S)return fe(se,te,pc(se,ue),Ce);Rc(se,ue)}return null}function he(se,te,ue,Ce,Ge){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return se=se.get(ue)||null,M(te,se,""+Ce,Ge);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case C:return se=se.get(Ce.key===null?ue:Ce.key)||null,Y(te,se,Ce,Ge);case I:return se=se.get(Ce.key===null?ue:Ce.key)||null,de(te,se,Ce,Ge);case H:var Lt=Ce._init;return Ce=Lt(Ce._payload),he(se,te,ue,Ce,Ge)}if(me(Ce)||q(Ce))return se=se.get(ue)||null,be(te,se,Ce,Ge,null);if(typeof Ce.then=="function")return he(se,te,ue,Lc(Ce),Ge);if(Ce.$$typeof===S)return he(se,te,ue,pc(te,Ce),Ge);Rc(te,Ce)}return null}function ft(se,te,ue,Ce){for(var Ge=null,Lt=null,at=te,ut=te=0,za=null;at!==null&&ut<ue.length;ut++){at.index>ut?(za=at,at=null):za=at.sibling;var Ft=fe(se,at,ue[ut],Ce);if(Ft===null){at===null&&(at=za);break}t&&at&&Ft.alternate===null&&n(se,at),te=y(Ft,te,ut),Lt===null?Ge=Ft:Lt.sibling=Ft,Lt=Ft,at=za}if(ut===ue.length)return o(se,at),jt&&as(se,ut),Ge;if(at===null){for(;ut<ue.length;ut++)at=Se(se,ue[ut],Ce),at!==null&&(te=y(at,te,ut),Lt===null?Ge=at:Lt.sibling=at,Lt=at);return jt&&as(se,ut),Ge}for(at=u(at);ut<ue.length;ut++)za=he(at,se,ut,ue[ut],Ce),za!==null&&(t&&za.alternate!==null&&at.delete(za.key===null?ut:za.key),te=y(za,te,ut),Lt===null?Ge=za:Lt.sibling=za,Lt=za);return t&&at.forEach(function(Oi){return n(se,Oi)}),jt&&as(se,ut),Ge}function ot(se,te,ue,Ce){if(ue==null)throw Error(i(151));for(var Ge=null,Lt=null,at=te,ut=te=0,za=null,Ft=ue.next();at!==null&&!Ft.done;ut++,Ft=ue.next()){at.index>ut?(za=at,at=null):za=at.sibling;var Oi=fe(se,at,Ft.value,Ce);if(Oi===null){at===null&&(at=za);break}t&&at&&Oi.alternate===null&&n(se,at),te=y(Oi,te,ut),Lt===null?Ge=Oi:Lt.sibling=Oi,Lt=Oi,at=za}if(Ft.done)return o(se,at),jt&&as(se,ut),Ge;if(at===null){for(;!Ft.done;ut++,Ft=ue.next())Ft=Se(se,Ft.value,Ce),Ft!==null&&(te=y(Ft,te,ut),Lt===null?Ge=Ft:Lt.sibling=Ft,Lt=Ft);return jt&&as(se,ut),Ge}for(at=u(at);!Ft.done;ut++,Ft=ue.next())Ft=he(at,se,ut,Ft.value,Ce),Ft!==null&&(t&&Ft.alternate!==null&&at.delete(Ft.key===null?ut:Ft.key),te=y(Ft,te,ut),Lt===null?Ge=Ft:Lt.sibling=Ft,Lt=Ft);return t&&at.forEach(function(kw){return n(se,kw)}),jt&&as(se,ut),Ge}function $t(se,te,ue,Ce){if(typeof ue=="object"&&ue!==null&&ue.type===x&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case C:e:{for(var Ge=ue.key;te!==null;){if(te.key===Ge){if(Ge=ue.type,Ge===x){if(te.tag===7){o(se,te.sibling),Ce=h(te,ue.props.children),Ce.return=se,se=Ce;break e}}else if(te.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===H&&up(Ge)===te.type){o(se,te.sibling),Ce=h(te,ue.props),$o(Ce,ue),Ce.return=se,se=Ce;break e}o(se,te);break}else n(se,te);te=te.sibling}ue.type===x?(Ce=es(ue.props.children,se.mode,Ce,ue.key),Ce.return=se,se=Ce):(Ce=fc(ue.type,ue.key,ue.props,null,se.mode,Ce),$o(Ce,ue),Ce.return=se,se=Ce)}return L(se);case I:e:{for(Ge=ue.key;te!==null;){if(te.key===Ge)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){o(se,te.sibling),Ce=h(te,ue.children||[]),Ce.return=se,se=Ce;break e}else{o(se,te);break}else n(se,te);te=te.sibling}Ce=$d(ue,se.mode,Ce),Ce.return=se,se=Ce}return L(se);case H:return Ge=ue._init,ue=Ge(ue._payload),$t(se,te,ue,Ce)}if(me(ue))return ft(se,te,ue,Ce);if(q(ue)){if(Ge=q(ue),typeof Ge!="function")throw Error(i(150));return ue=Ge.call(ue),ot(se,te,ue,Ce)}if(typeof ue.then=="function")return $t(se,te,Lc(ue),Ce);if(ue.$$typeof===S)return $t(se,te,pc(se,ue),Ce);Rc(se,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(o(se,te.sibling),Ce=h(te,ue),Ce.return=se,se=Ce):(o(se,te),Ce=Xd(ue,se.mode,Ce),Ce.return=se,se=Ce),L(se)):o(se,te)}return function(se,te,ue,Ce){try{Xo=0;var Ge=$t(se,te,ue,Ce);return Ks=null,Ge}catch(at){if(at===Qo||at===Ec)throw at;var Lt=Ln(29,at,null,se.mode);return Lt.lanes=Ce,Lt.return=se,Lt}finally{}}}var Gs=dp(!0),mp=dp(!1),qn=X(null),pr=null;function wi(t){var n=t.alternate;ie(Ua,Ua.current&1),ie(qn,t),pr===null&&(n===null||Hs.current!==null||n.memoizedState!==null)&&(pr=t)}function fp(t){if(t.tag===22){if(ie(Ua,Ua.current),ie(qn,t),pr===null){var n=t.alternate;n!==null&&n.memoizedState!==null&&(pr=t)}}else Ci()}function Ci(){ie(Ua,Ua.current),ie(qn,qn.current)}function Kr(t){ee(qn),pr===t&&(pr=null),ee(Ua)}var Ua=X(0);function Dc(t){for(var n=t;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||If(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function Rm(t,n,o,u){n=t.memoizedState,o=o(u,n),o=o==null?n:E({},n,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var Dm={enqueueSetState:function(t,n,o){t=t._reactInternals;var u=Un(),h=bi(u);h.payload=n,o!=null&&(h.callback=o),n=Ii(t,h,u),n!==null&&(_n(n,t,u),Vo(n,t,u))},enqueueReplaceState:function(t,n,o){t=t._reactInternals;var u=Un(),h=bi(u);h.tag=1,h.payload=n,o!=null&&(h.callback=o),n=Ii(t,h,u),n!==null&&(_n(n,t,u),Vo(n,t,u))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var o=Un(),u=bi(o);u.tag=2,n!=null&&(u.callback=n),n=Ii(t,u,o),n!==null&&(_n(n,t,o),Vo(n,t,o))}};function gp(t,n,o,u,h,y,L){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,y,L):n.prototype&&n.prototype.isPureReactComponent?!Uo(o,u)||!Uo(h,y):!0}function hp(t,n,o,u){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==t&&Dm.enqueueReplaceState(n,n.state,null)}function cs(t,n){var o=n;if("ref"in n){o={};for(var u in n)u!=="ref"&&(o[u]=n[u])}if(t=t.defaultProps){o===n&&(o=E({},o));for(var h in t)o[h]===void 0&&(o[h]=t[h])}return o}var Bc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Ap(t){Bc(t)}function pp(t){console.error(t)}function yp(t){Bc(t)}function Uc(t,n){try{var o=t.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function Ep(t,n,o){try{var u=t.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Bm(t,n,o){return o=bi(o),o.tag=3,o.payload={element:null},o.callback=function(){Uc(t,n)},o}function bp(t){return t=bi(t),t.tag=3,t}function Ip(t,n,o,u){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var y=u.value;t.payload=function(){return h(y)},t.callback=function(){Ep(n,o,u)}}var L=o.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(t.callback=function(){Ep(n,o,u),typeof h!="function"&&(Li===null?Li=new Set([this]):Li.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})})}function kv(t,n,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=o.alternate,n!==null&&jo(n,o,h,!0),o=qn.current,o!==null){switch(o.tag){case 13:return pr===null?nf():o.alternate===null&&ba===0&&(ba=3),o.flags&=-257,o.flags|=65536,o.lanes=h,u===lm?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([u]):n.add(u),sf(t,u,h)),!1;case 22:return o.flags|=65536,u===lm?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([u]):o.add(u)),sf(t,u,h)),!1}throw Error(i(435,o.tag))}return sf(t,u,h),nf(),!1}if(jt)return n=qn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,u!==tm&&(t=Error(i(422),{cause:u}),Oo(zn(t,o)))):(u!==tm&&(n=Error(i(423),{cause:u}),Oo(zn(n,o))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,u=zn(u,o),h=Bm(t.stateNode,u,h),dm(t,h),ba!==4&&(ba=2)),!1;var y=Error(i(520),{cause:u});if(y=zn(y,o),il===null?il=[y]:il.push(y),ba!==4&&(ba=2),n===null)return!0;u=zn(u,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,t=h&-h,o.lanes|=t,t=Bm(o.stateNode,u,t),dm(o,t),!1;case 1:if(n=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Li===null||!Li.has(y))))return o.flags|=65536,h&=-h,o.lanes|=h,h=bp(h),Ip(h,t,o,u),dm(o,h),!1}o=o.return}while(o!==null);return!1}var vp=Error(i(461)),Ha=!1;function qa(t,n,o,u){n.child=t===null?mp(n,null,o,u):Gs(n,t.child,o,u)}function wp(t,n,o,u,h){o=o.render;var y=n.ref;if("ref"in u){var L={};for(var M in u)M!=="ref"&&(L[M]=u[M])}else L=u;return ss(n),u=Am(t,n,o,L,y,h),M=pm(),t!==null&&!Ha?(ym(t,n,h),Gr(t,n,h)):(jt&&M&&Zd(n),n.flags|=1,qa(t,n,u,h),n.child)}function Cp(t,n,o,u,h){if(t===null){var y=o.type;return typeof y=="function"&&!Jd(y)&&y.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=y,Np(t,n,y,u,h)):(t=fc(o.type,null,u,n,n.mode,h),t.ref=n.ref,t.return=n,n.child=t)}if(y=t.child,!Hm(t,h)){var L=y.memoizedProps;if(o=o.compare,o=o!==null?o:Uo,o(L,u)&&t.ref===n.ref)return Gr(t,n,h)}return n.flags|=1,t=jr(y,u),t.ref=n.ref,t.return=n,n.child=t}function Np(t,n,o,u,h){if(t!==null){var y=t.memoizedProps;if(Uo(y,u)&&t.ref===n.ref)if(Ha=!1,n.pendingProps=u=y,Hm(t,h))(t.flags&131072)!==0&&(Ha=!0);else return n.lanes=t.lanes,Gr(t,n,h)}return Um(t,n,o,u,h)}function xp(t,n,o){var u=n.pendingProps,h=u.children,y=t!==null?t.memoizedState:null;if(u.mode==="hidden"){if((n.flags&128)!==0){if(u=y!==null?y.baseLanes|o:o,t!==null){for(h=n.child=t.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;n.childLanes=y&~u}else n.childLanes=0,n.child=null;return Tp(t,n,u,o)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&yc(n,y!==null?y.cachePool:null),y!==null?NA(n,y):fm(),fp(n);else return n.lanes=n.childLanes=536870912,Tp(t,n,y!==null?y.baseLanes|o:o,o)}else y!==null?(yc(n,y.cachePool),NA(n,y),Ci(),n.memoizedState=null):(t!==null&&yc(n,null),fm(),Ci());return qa(t,n,h,o),n.child}function Tp(t,n,o,u){var h=om();return h=h===null?null:{parent:Ba._currentValue,pool:h},n.memoizedState={baseLanes:o,cachePool:h},t!==null&&yc(n,null),fm(),fp(n),t!==null&&jo(t,n,u,!0),null}function _c(t,n){var o=n.ref;if(o===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(i(284));(t===null||t.ref!==o)&&(n.flags|=4194816)}}function Um(t,n,o,u,h){return ss(n),o=Am(t,n,o,u,void 0,h),u=pm(),t!==null&&!Ha?(ym(t,n,h),Gr(t,n,h)):(jt&&u&&Zd(n),n.flags|=1,qa(t,n,o,h),n.child)}function Sp(t,n,o,u,h,y){return ss(n),n.updateQueue=null,o=TA(n,u,o,h),xA(t),u=pm(),t!==null&&!Ha?(ym(t,n,y),Gr(t,n,y)):(jt&&u&&Zd(n),n.flags|=1,qa(t,n,o,y),n.child)}function kp(t,n,o,u,h){if(ss(n),n.stateNode===null){var y=Ms,L=o.contextType;typeof L=="object"&&L!==null&&(y=rn(L)),y=new o(u,y),n.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Dm,n.stateNode=y,y._reactInternals=n,y=n.stateNode,y.props=u,y.state=n.memoizedState,y.refs={},cm(n),L=o.contextType,y.context=typeof L=="object"&&L!==null?rn(L):Ms,y.state=n.memoizedState,L=o.getDerivedStateFromProps,typeof L=="function"&&(Rm(n,o,L,u),y.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(L=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),L!==y.state&&Dm.enqueueReplaceState(y,y.state,null),Go(n,u,y,h),Ko(),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(t===null){y=n.stateNode;var M=n.memoizedProps,Y=cs(o,M);y.props=Y;var de=y.context,be=o.contextType;L=Ms,typeof be=="object"&&be!==null&&(L=rn(be));var Se=o.getDerivedStateFromProps;be=typeof Se=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=n.pendingProps!==M,be||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||de!==L)&&hp(n,y,u,L),Ei=!1;var fe=n.memoizedState;y.state=fe,Go(n,u,y,h),Ko(),de=n.memoizedState,M||fe!==de||Ei?(typeof Se=="function"&&(Rm(n,o,Se,u),de=n.memoizedState),(Y=Ei||gp(n,o,Y,u,fe,de,L))?(be||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(n.flags|=4194308)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=de),y.props=u,y.state=de,y.context=L,u=Y):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{y=n.stateNode,um(t,n),L=n.memoizedProps,be=cs(o,L),y.props=be,Se=n.pendingProps,fe=y.context,de=o.contextType,Y=Ms,typeof de=="object"&&de!==null&&(Y=rn(de)),M=o.getDerivedStateFromProps,(de=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(L!==Se||fe!==Y)&&hp(n,y,u,Y),Ei=!1,fe=n.memoizedState,y.state=fe,Go(n,u,y,h),Ko();var he=n.memoizedState;L!==Se||fe!==he||Ei||t!==null&&t.dependencies!==null&&Ac(t.dependencies)?(typeof M=="function"&&(Rm(n,o,M,u),he=n.memoizedState),(be=Ei||gp(n,o,be,u,fe,he,Y)||t!==null&&t.dependencies!==null&&Ac(t.dependencies))?(de||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,he,Y),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,he,Y)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||L===t.memoizedProps&&fe===t.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||L===t.memoizedProps&&fe===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=he),y.props=u,y.state=he,y.context=Y,u=be):(typeof y.componentDidUpdate!="function"||L===t.memoizedProps&&fe===t.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||L===t.memoizedProps&&fe===t.memoizedState||(n.flags|=1024),u=!1)}return y=u,_c(t,n),u=(n.flags&128)!==0,y||u?(y=n.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:y.render(),n.flags|=1,t!==null&&u?(n.child=Gs(n,t.child,null,h),n.child=Gs(n,null,o,h)):qa(t,n,o,h),n.memoizedState=y.state,t=n.child):t=Gr(t,n,h),t}function Lp(t,n,o,u){return Fo(),n.flags|=256,qa(t,n,o,u),n.child}var _m={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mm(t){return{baseLanes:t,cachePool:pA()}}function Fm(t,n,o){return t=t!==null?t.childLanes&~o:0,n&&(t|=Wn),t}function Rp(t,n,o){var u=n.pendingProps,h=!1,y=(n.flags&128)!==0,L;if((L=y)||(L=t!==null&&t.memoizedState===null?!1:(Ua.current&2)!==0),L&&(h=!0,n.flags&=-129),L=(n.flags&32)!==0,n.flags&=-33,t===null){if(jt){if(h?wi(n):Ci(),jt){var M=Ea,Y;if(Y=M){e:{for(Y=M,M=Ar;Y.nodeType!==8;){if(!M){M=null;break e}if(Y=sr(Y.nextSibling),Y===null){M=null;break e}}M=Y}M!==null?(n.memoizedState={dehydrated:M,treeContext:ts!==null?{id:Pr,overflow:Hr}:null,retryLane:536870912,hydrationErrors:null},Y=Ln(18,null,null,0),Y.stateNode=M,Y.return=n,n.child=Y,dn=n,Ea=null,Y=!0):Y=!1}Y||rs(n)}if(M=n.memoizedState,M!==null&&(M=M.dehydrated,M!==null))return If(M)?n.lanes=32:n.lanes=536870912,null;Kr(n)}return M=u.children,u=u.fallback,h?(Ci(),h=n.mode,M=Mc({mode:"hidden",children:M},h),u=es(u,h,o,null),M.return=n,u.return=n,M.sibling=u,n.child=M,h=n.child,h.memoizedState=Mm(o),h.childLanes=Fm(t,L,o),n.memoizedState=_m,u):(wi(n),Om(n,M))}if(Y=t.memoizedState,Y!==null&&(M=Y.dehydrated,M!==null)){if(y)n.flags&256?(wi(n),n.flags&=-257,n=jm(t,n,o)):n.memoizedState!==null?(Ci(),n.child=t.child,n.flags|=128,n=null):(Ci(),h=u.fallback,M=n.mode,u=Mc({mode:"visible",children:u.children},M),h=es(h,M,o,null),h.flags|=2,u.return=n,h.return=n,u.sibling=h,n.child=u,Gs(n,t.child,null,o),u=n.child,u.memoizedState=Mm(o),u.childLanes=Fm(t,L,o),n.memoizedState=_m,n=h);else if(wi(n),If(M)){if(L=M.nextSibling&&M.nextSibling.dataset,L)var de=L.dgst;L=de,u=Error(i(419)),u.stack="",u.digest=L,Oo({value:u,source:null,stack:null}),n=jm(t,n,o)}else if(Ha||jo(t,n,o,!1),L=(o&t.childLanes)!==0,Ha||L){if(L=ia,L!==null&&(u=o&-o,u=(u&42)!==0?1:Zt(u),u=(u&(L.suspendedLanes|o))!==0?0:u,u!==0&&u!==Y.retryLane))throw Y.retryLane=u,_s(t,u),_n(L,t,u),vp;M.data==="$?"||nf(),n=jm(t,n,o)}else M.data==="$?"?(n.flags|=192,n.child=t.child,n=null):(t=Y.treeContext,Ea=sr(M.nextSibling),dn=n,jt=!0,ns=null,Ar=!1,t!==null&&(Kn[Gn++]=Pr,Kn[Gn++]=Hr,Kn[Gn++]=ts,Pr=t.id,Hr=t.overflow,ts=n),n=Om(n,u.children),n.flags|=4096);return n}return h?(Ci(),h=u.fallback,M=n.mode,Y=t.child,de=Y.sibling,u=jr(Y,{mode:"hidden",children:u.children}),u.subtreeFlags=Y.subtreeFlags&65011712,de!==null?h=jr(de,h):(h=es(h,M,o,null),h.flags|=2),h.return=n,u.return=n,u.sibling=h,n.child=u,u=h,h=n.child,M=t.child.memoizedState,M===null?M=Mm(o):(Y=M.cachePool,Y!==null?(de=Ba._currentValue,Y=Y.parent!==de?{parent:de,pool:de}:Y):Y=pA(),M={baseLanes:M.baseLanes|o,cachePool:Y}),h.memoizedState=M,h.childLanes=Fm(t,L,o),n.memoizedState=_m,u):(wi(n),o=t.child,t=o.sibling,o=jr(o,{mode:"visible",children:u.children}),o.return=n,o.sibling=null,t!==null&&(L=n.deletions,L===null?(n.deletions=[t],n.flags|=16):L.push(t)),n.child=o,n.memoizedState=null,o)}function Om(t,n){return n=Mc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Mc(t,n){return t=Ln(22,t,null,n),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function jm(t,n,o){return Gs(n,t.child,null,o),t=Om(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Dp(t,n,o){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),nm(t.return,n,o)}function Pm(t,n,o,u,h){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=u,y.tail=o,y.tailMode=h)}function Bp(t,n,o){var u=n.pendingProps,h=u.revealOrder,y=u.tail;if(qa(t,n,u.children,o),u=Ua.current,(u&2)!==0)u=u&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Dp(t,o,n);else if(t.tag===19)Dp(t,o,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}u&=1}switch(ie(Ua,u),h){case"forwards":for(o=n.child,h=null;o!==null;)t=o.alternate,t!==null&&Dc(t)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),Pm(n,!1,h,o,y);break;case"backwards":for(o=null,h=n.child,n.child=null;h!==null;){if(t=h.alternate,t!==null&&Dc(t)===null){n.child=h;break}t=h.sibling,h.sibling=o,o=h,h=t}Pm(n,!0,o,null,y);break;case"together":Pm(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Gr(t,n,o){if(t!==null&&(n.dependencies=t.dependencies),ki|=n.lanes,(o&n.childLanes)===0)if(t!==null){if(jo(t,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,o=jr(t,t.pendingProps),n.child=o,o.return=n;t.sibling!==null;)t=t.sibling,o=o.sibling=jr(t,t.pendingProps),o.return=n;o.sibling=null}return n.child}function Hm(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Ac(t)))}function Lv(t,n,o){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),yi(n,Ba,t.memoizedState.cache),Fo();break;case 27:case 5:Ne(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:yi(n,n.type,n.memoizedProps.value);break;case 13:var u=n.memoizedState;if(u!==null)return u.dehydrated!==null?(wi(n),n.flags|=128,null):(o&n.child.childLanes)!==0?Rp(t,n,o):(wi(n),t=Gr(t,n,o),t!==null?t.sibling:null);wi(n);break;case 19:var h=(t.flags&128)!==0;if(u=(o&n.childLanes)!==0,u||(jo(t,n,o,!1),u=(o&n.childLanes)!==0),h){if(u)return Bp(t,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ie(Ua,Ua.current),u)break;return null;case 22:case 23:return n.lanes=0,xp(t,n,o);case 24:yi(n,Ba,t.memoizedState.cache)}return Gr(t,n,o)}function Up(t,n,o){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ha=!0;else{if(!Hm(t,o)&&(n.flags&128)===0)return Ha=!1,Lv(t,n,o);Ha=(t.flags&131072)!==0}else Ha=!1,jt&&(n.flags&1048576)!==0&&uA(n,hc,n.index);switch(n.lanes=0,n.tag){case 16:e:{t=n.pendingProps;var u=n.elementType,h=u._init;if(u=h(u._payload),n.type=u,typeof u=="function")Jd(u)?(t=cs(u,t),n.tag=1,n=kp(null,n,u,t,o)):(n.tag=0,n=Um(null,n,u,t,o));else{if(u!=null){if(h=u.$$typeof,h===O){n.tag=11,n=wp(null,n,u,t,o);break e}else if(h===K){n.tag=14,n=Cp(null,n,u,t,o);break e}}throw n=ne(u)||u,Error(i(306,n,""))}}return n;case 0:return Um(t,n,n.type,n.pendingProps,o);case 1:return u=n.type,h=cs(u,n.pendingProps),kp(t,n,u,h,o);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(i(387));u=n.pendingProps;var y=n.memoizedState;h=y.element,um(t,n),Go(n,u,null,o);var L=n.memoizedState;if(u=L.cache,yi(n,Ba,u),u!==y.cache&&rm(n,[Ba],o,!0),Ko(),u=L.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:L.cache},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){n=Lp(t,n,u,o);break e}else if(u!==h){h=zn(Error(i(424)),n),Oo(h),n=Lp(t,n,u,o);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ea=sr(t.firstChild),dn=n,jt=!0,ns=null,Ar=!0,o=mp(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Fo(),u===h){n=Gr(t,n,o);break e}qa(t,n,u,o)}n=n.child}return n;case 26:return _c(t,n),t===null?(o=O0(n.type,null,n.pendingProps,null))?n.memoizedState=o:jt||(o=n.type,t=n.pendingProps,u=Jc(Re.current).createElement(o),u[zt]=n,u[ya]=t,Ya(u,o,t),st(u),n.stateNode=u):n.memoizedState=O0(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ne(n),t===null&&jt&&(u=n.stateNode=_0(n.type,n.pendingProps,Re.current),dn=n,Ar=!0,h=Ea,Bi(n.type)?(vf=h,Ea=sr(u.firstChild)):Ea=h),qa(t,n,n.pendingProps.children,o),_c(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&jt&&((h=u=Ea)&&(u=rw(u,n.type,n.pendingProps,Ar),u!==null?(n.stateNode=u,dn=n,Ea=sr(u.firstChild),Ar=!1,h=!0):h=!1),h||rs(n)),Ne(n),h=n.type,y=n.pendingProps,L=t!==null?t.memoizedProps:null,u=y.children,yf(h,y)?u=null:L!==null&&yf(h,L)&&(n.flags|=32),n.memoizedState!==null&&(h=Am(t,n,vv,null,null,o),gl._currentValue=h),_c(t,n),qa(t,n,u,o),n.child;case 6:return t===null&&jt&&((t=o=Ea)&&(o=iw(o,n.pendingProps,Ar),o!==null?(n.stateNode=o,dn=n,Ea=null,t=!0):t=!1),t||rs(n)),null;case 13:return Rp(t,n,o);case 4:return Te(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=Gs(n,null,u,o):qa(t,n,u,o),n.child;case 11:return wp(t,n,n.type,n.pendingProps,o);case 7:return qa(t,n,n.pendingProps,o),n.child;case 8:return qa(t,n,n.pendingProps.children,o),n.child;case 12:return qa(t,n,n.pendingProps.children,o),n.child;case 10:return u=n.pendingProps,yi(n,n.type,u.value),qa(t,n,u.children,o),n.child;case 9:return h=n.type._context,u=n.pendingProps.children,ss(n),h=rn(h),u=u(h),n.flags|=1,qa(t,n,u,o),n.child;case 14:return Cp(t,n,n.type,n.pendingProps,o);case 15:return Np(t,n,n.type,n.pendingProps,o);case 19:return Bp(t,n,o);case 31:return u=n.pendingProps,o=n.mode,u={mode:u.mode,children:u.children},t===null?(o=Mc(u,o),o.ref=n.ref,n.child=o,o.return=n,n=o):(o=jr(t.child,u),o.ref=n.ref,n.child=o,o.return=n,n=o),n;case 22:return xp(t,n,o);case 24:return ss(n),u=rn(Ba),t===null?(h=om(),h===null&&(h=ia,y=im(),h.pooledCache=y,y.refCount++,y!==null&&(h.pooledCacheLanes|=o),h=y),n.memoizedState={parent:u,cache:h},cm(n),yi(n,Ba,h)):((t.lanes&o)!==0&&(um(t,n),Go(n,null,null,o),Ko()),h=t.memoizedState,y=n.memoizedState,h.parent!==u?(h={parent:u,cache:u},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),yi(n,Ba,u)):(u=y.cache,yi(n,Ba,u),u!==h.cache&&rm(n,[Ba],o,!0))),qa(t,n,n.pendingProps.children,o),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function qr(t){t.flags|=4}function _p(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!z0(n)){if(n=qn.current,n!==null&&((_t&4194048)===_t?pr!==null:(_t&62914560)!==_t&&(_t&536870912)===0||n!==pr))throw zo=lm,yA;t.flags|=8192}}function Fc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?ra():536870912,t.lanes|=n,Js|=n)}function Zo(t,n){if(!jt)switch(t.tailMode){case"hidden":n=t.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function ga(t){var n=t.alternate!==null&&t.alternate.child===t.child,o=0,u=0;if(n)for(var h=t.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=u,t.childLanes=o,n}function Rv(t,n,o){var u=n.pendingProps;switch(em(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ga(n),null;case 1:return ga(n),null;case 3:return o=n.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),zr(Ba),He(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(Mo(n)?qr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,fA())),ga(n),null;case 26:return o=n.memoizedState,t===null?(qr(n),o!==null?(ga(n),_p(n,o)):(ga(n),n.flags&=-16777217)):o?o!==t.memoizedState?(qr(n),ga(n),_p(n,o)):(ga(n),n.flags&=-16777217):(t.memoizedProps!==u&&qr(n),ga(n),n.flags&=-16777217),null;case 27:Qe(n),o=Re.current;var h=n.type;if(t!==null&&n.stateNode!=null)t.memoizedProps!==u&&qr(n);else{if(!u){if(n.stateNode===null)throw Error(i(166));return ga(n),null}t=Ie.current,Mo(n)?dA(n):(t=_0(h,u,o),n.stateNode=t,qr(n))}return ga(n),null;case 5:if(Qe(n),o=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&qr(n);else{if(!u){if(n.stateNode===null)throw Error(i(166));return ga(n),null}if(t=Ie.current,Mo(n))dA(n);else{switch(h=Jc(Re.current),t){case 1:t=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:t=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":t=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":t=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":t=h.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof u.is=="string"?h.createElement("select",{is:u.is}):h.createElement("select"),u.multiple?t.multiple=!0:u.size&&(t.size=u.size);break;default:t=typeof u.is=="string"?h.createElement(o,{is:u.is}):h.createElement(o)}}t[zt]=n,t[ya]=u;e:for(h=n.child;h!==null;){if(h.tag===5||h.tag===6)t.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}n.stateNode=t;e:switch(Ya(t,o,u),o){case"button":case"input":case"select":case"textarea":t=!!u.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&qr(n)}}return ga(n),n.flags&=-16777217,null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==u&&qr(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(i(166));if(t=Re.current,Mo(n)){if(t=n.stateNode,o=n.memoizedProps,u=null,h=dn,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}t[zt]=n,t=!!(t.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||S0(t.nodeValue,o)),t||rs(n)}else t=Jc(t).createTextNode(u),t[zt]=n,n.stateNode=t}return ga(n),null;case 13:if(u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Mo(n),u!==null&&u.dehydrated!==null){if(t===null){if(!h)throw Error(i(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[zt]=n}else Fo(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ga(n),h=!1}else h=fA(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Kr(n),n):(Kr(n),null)}if(Kr(n),(n.flags&128)!==0)return n.lanes=o,n;if(o=u!==null,t=t!==null&&t.memoizedState!==null,o){u=n.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool);var y=null;u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==h&&(u.flags|=2048)}return o!==t&&o&&(n.child.flags|=8192),Fc(n,n.updateQueue),ga(n),null;case 4:return He(),t===null&&ff(n.stateNode.containerInfo),ga(n),null;case 10:return zr(n.type),ga(n),null;case 19:if(ee(Ua),h=n.memoizedState,h===null)return ga(n),null;if(u=(n.flags&128)!==0,y=h.rendering,y===null)if(u)Zo(h,!1);else{if(ba!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(y=Dc(t),y!==null){for(n.flags|=128,Zo(h,!1),t=y.updateQueue,n.updateQueue=t,Fc(n,t),n.subtreeFlags=0,t=o,o=n.child;o!==null;)cA(o,t),o=o.sibling;return ie(Ua,Ua.current&1|2),n.child}t=t.sibling}h.tail!==null&&Be()>Pc&&(n.flags|=128,u=!0,Zo(h,!1),n.lanes=4194304)}else{if(!u)if(t=Dc(y),t!==null){if(n.flags|=128,u=!0,t=t.updateQueue,n.updateQueue=t,Fc(n,t),Zo(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!jt)return ga(n),null}else 2*Be()-h.renderingStartTime>Pc&&o!==536870912&&(n.flags|=128,u=!0,Zo(h,!1),n.lanes=4194304);h.isBackwards?(y.sibling=n.child,n.child=y):(t=h.last,t!==null?t.sibling=y:n.child=y,h.last=y)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=Be(),n.sibling=null,t=Ua.current,ie(Ua,u?t&1|2:t&1),n):(ga(n),null);case 22:case 23:return Kr(n),gm(),u=n.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(o&536870912)!==0&&(n.flags&128)===0&&(ga(n),n.subtreeFlags&6&&(n.flags|=8192)):ga(n),o=n.updateQueue,o!==null&&Fc(n,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==o&&(n.flags|=2048),t!==null&&ee(os),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),zr(Ba),ga(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function Dv(t,n){switch(em(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return zr(Ba),He(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Qe(n),null;case 13:if(Kr(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Fo()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return ee(Ua),null;case 4:return He(),null;case 10:return zr(n.type),null;case 22:case 23:return Kr(n),gm(),t!==null&&ee(os),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return zr(Ba),null;case 25:return null;default:return null}}function Mp(t,n){switch(em(n),n.tag){case 3:zr(Ba),He();break;case 26:case 27:case 5:Qe(n);break;case 4:He();break;case 13:Kr(n);break;case 19:ee(Ua);break;case 10:zr(n.type);break;case 22:case 23:Kr(n),gm(),t!==null&&ee(os);break;case 24:zr(Ba)}}function el(t,n){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&t)===t){u=void 0;var y=o.create,L=o.inst;u=y(),L.destroy=u}o=o.next}while(o!==h)}}catch(M){ta(n,n.return,M)}}function Ni(t,n,o){try{var u=n.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&t)===t){var L=u.inst,M=L.destroy;if(M!==void 0){L.destroy=void 0,h=n;var Y=o,de=M;try{de()}catch(be){ta(h,Y,be)}}}u=u.next}while(u!==y)}}catch(be){ta(n,n.return,be)}}function Fp(t){var n=t.updateQueue;if(n!==null){var o=t.stateNode;try{CA(n,o)}catch(u){ta(t,t.return,u)}}}function Op(t,n,o){o.props=cs(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(u){ta(t,n,u)}}function tl(t,n){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof o=="function"?t.refCleanup=o(u):o.current=u}}catch(h){ta(t,n,h)}}function yr(t,n){var o=t.ref,u=t.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(h){ta(t,n,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){ta(t,n,h)}else o.current=null}function jp(t){var n=t.type,o=t.memoizedProps,u=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(h){ta(t,t.return,h)}}function Qm(t,n,o){try{var u=t.stateNode;Zv(u,t.type,o,n),u[ya]=n}catch(h){ta(t,t.return,h)}}function Pp(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Bi(t.type)||t.tag===4}function zm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Pp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Bi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Vm(t,n,o){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(t,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(t),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Yc));else if(u!==4&&(u===27&&Bi(t.type)&&(o=t.stateNode,n=null),t=t.child,t!==null))for(Vm(t,n,o),t=t.sibling;t!==null;)Vm(t,n,o),t=t.sibling}function Oc(t,n,o){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?o.insertBefore(t,n):o.appendChild(t);else if(u!==4&&(u===27&&Bi(t.type)&&(o=t.stateNode),t=t.child,t!==null))for(Oc(t,n,o),t=t.sibling;t!==null;)Oc(t,n,o),t=t.sibling}function Hp(t){var n=t.stateNode,o=t.memoizedProps;try{for(var u=t.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);Ya(n,u,o),n[zt]=t,n[ya]=o}catch(y){ta(t,t.return,y)}}var Wr=!1,Na=!1,Km=!1,Qp=typeof WeakSet=="function"?WeakSet:Set,Qa=null;function Bv(t,n){if(t=t.containerInfo,Af=au,t=Zh(t),zd(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var h=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var L=0,M=-1,Y=-1,de=0,be=0,Se=t,fe=null;t:for(;;){for(var he;Se!==o||h!==0&&Se.nodeType!==3||(M=L+h),Se!==y||u!==0&&Se.nodeType!==3||(Y=L+u),Se.nodeType===3&&(L+=Se.nodeValue.length),(he=Se.firstChild)!==null;)fe=Se,Se=he;for(;;){if(Se===t)break t;if(fe===o&&++de===h&&(M=L),fe===y&&++be===u&&(Y=L),(he=Se.nextSibling)!==null)break;Se=fe,fe=Se.parentNode}Se=he}o=M===-1||Y===-1?null:{start:M,end:Y}}else o=null}o=o||{start:0,end:0}}else o=null;for(pf={focusedElem:t,selectionRange:o},au=!1,Qa=n;Qa!==null;)if(n=Qa,t=n.child,(n.subtreeFlags&1024)!==0&&t!==null)t.return=n,Qa=t;else for(;Qa!==null;){switch(n=Qa,y=n.alternate,t=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,o=n,h=y.memoizedProps,y=y.memoizedState,u=o.stateNode;try{var ft=cs(o.type,h,o.elementType===o.type);t=u.getSnapshotBeforeUpdate(ft,y),u.__reactInternalSnapshotBeforeUpdate=t}catch(ot){ta(o,o.return,ot)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,o=t.nodeType,o===9)bf(t);else if(o===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":bf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=n.sibling,t!==null){t.return=n.return,Qa=t;break}Qa=n.return}}function zp(t,n,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:xi(t,o),u&4&&el(5,o);break;case 1:if(xi(t,o),u&4)if(t=o.stateNode,n===null)try{t.componentDidMount()}catch(L){ta(o,o.return,L)}else{var h=cs(o.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(h,n,t.__reactInternalSnapshotBeforeUpdate)}catch(L){ta(o,o.return,L)}}u&64&&Fp(o),u&512&&tl(o,o.return);break;case 3:if(xi(t,o),u&64&&(t=o.updateQueue,t!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{CA(t,n)}catch(L){ta(o,o.return,L)}}break;case 27:n===null&&u&4&&Hp(o);case 26:case 5:xi(t,o),n===null&&u&4&&jp(o),u&512&&tl(o,o.return);break;case 12:xi(t,o);break;case 13:xi(t,o),u&4&&Gp(t,o),u&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=Qv.bind(null,o),sw(t,o))));break;case 22:if(u=o.memoizedState!==null||Wr,!u){n=n!==null&&n.memoizedState!==null||Na,h=Wr;var y=Na;Wr=u,(Na=n)&&!y?Ti(t,o,(o.subtreeFlags&8772)!==0):xi(t,o),Wr=h,Na=y}break;case 30:break;default:xi(t,o)}}function Vp(t){var n=t.alternate;n!==null&&(t.alternate=null,Vp(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&_e(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var da=null,In=!1;function Yr(t,n,o){for(o=o.child;o!==null;)Kp(t,n,o),o=o.sibling}function Kp(t,n,o){if(B&&typeof B.onCommitFiberUnmount=="function")try{B.onCommitFiberUnmount(na,o)}catch{}switch(o.tag){case 26:Na||yr(o,n),Yr(t,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Na||yr(o,n);var u=da,h=In;Bi(o.type)&&(da=o.stateNode,In=!1),Yr(t,n,o),ul(o.stateNode),da=u,In=h;break;case 5:Na||yr(o,n);case 6:if(u=da,h=In,da=null,Yr(t,n,o),da=u,In=h,da!==null)if(In)try{(da.nodeType===9?da.body:da.nodeName==="HTML"?da.ownerDocument.body:da).removeChild(o.stateNode)}catch(y){ta(o,n,y)}else try{da.removeChild(o.stateNode)}catch(y){ta(o,n,y)}break;case 18:da!==null&&(In?(t=da,B0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),yl(t)):B0(da,o.stateNode));break;case 4:u=da,h=In,da=o.stateNode.containerInfo,In=!0,Yr(t,n,o),da=u,In=h;break;case 0:case 11:case 14:case 15:Na||Ni(2,o,n),Na||Ni(4,o,n),Yr(t,n,o);break;case 1:Na||(yr(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"&&Op(o,n,u)),Yr(t,n,o);break;case 21:Yr(t,n,o);break;case 22:Na=(u=Na)||o.memoizedState!==null,Yr(t,n,o),Na=u;break;default:Yr(t,n,o)}}function Gp(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{yl(t)}catch(o){ta(n,n.return,o)}}function Uv(t){switch(t.tag){case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Qp),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Qp),n;default:throw Error(i(435,t.tag))}}function Gm(t,n){var o=Uv(t);n.forEach(function(u){var h=zv.bind(null,t,u);o.has(u)||(o.add(u),u.then(h,h))})}function Rn(t,n){var o=n.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],y=t,L=n,M=L;e:for(;M!==null;){switch(M.tag){case 27:if(Bi(M.type)){da=M.stateNode,In=!1;break e}break;case 5:da=M.stateNode,In=!1;break e;case 3:case 4:da=M.stateNode.containerInfo,In=!0;break e}M=M.return}if(da===null)throw Error(i(160));Kp(y,L,h),da=null,In=!1,y=h.alternate,y!==null&&(y.return=null),h.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)qp(n,t),n=n.sibling}var ir=null;function qp(t,n){var o=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Rn(n,t),Dn(t),u&4&&(Ni(3,t,t.return),el(3,t),Ni(5,t,t.return));break;case 1:Rn(n,t),Dn(t),u&512&&(Na||o===null||yr(o,o.return)),u&64&&Wr&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var h=ir;if(Rn(n,t),Dn(t),u&512&&(Na||o===null||yr(o,o.return)),u&4){var y=o!==null?o.memoizedState:null;if(u=t.memoizedState,o===null)if(u===null)if(t.stateNode===null){e:{u=t.type,o=t.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":y=h.getElementsByTagName("title")[0],(!y||y[Me]||y[zt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=h.createElement(u),h.head.insertBefore(y,h.querySelector("head > title"))),Ya(y,u,o),y[zt]=t,st(y),u=y;break e;case"link":var L=H0("link","href",h).get(u+(o.href||""));if(L){for(var M=0;M<L.length;M++)if(y=L[M],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){L.splice(M,1);break t}}y=h.createElement(u),Ya(y,u,o),h.head.appendChild(y);break;case"meta":if(L=H0("meta","content",h).get(u+(o.content||""))){for(M=0;M<L.length;M++)if(y=L[M],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){L.splice(M,1);break t}}y=h.createElement(u),Ya(y,u,o),h.head.appendChild(y);break;default:throw Error(i(468,u))}y[zt]=t,st(y),u=y}t.stateNode=u}else Q0(h,t.type,t.stateNode);else t.stateNode=P0(h,u,t.memoizedProps);else y!==u?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,u===null?Q0(h,t.type,t.stateNode):P0(h,u,t.memoizedProps)):u===null&&t.stateNode!==null&&Qm(t,t.memoizedProps,o.memoizedProps)}break;case 27:Rn(n,t),Dn(t),u&512&&(Na||o===null||yr(o,o.return)),o!==null&&u&4&&Qm(t,t.memoizedProps,o.memoizedProps);break;case 5:if(Rn(n,t),Dn(t),u&512&&(Na||o===null||yr(o,o.return)),t.flags&32){h=t.stateNode;try{hr(h,"")}catch(he){ta(t,t.return,he)}}u&4&&t.stateNode!=null&&(h=t.memoizedProps,Qm(t,h,o!==null?o.memoizedProps:h)),u&1024&&(Km=!0);break;case 6:if(Rn(n,t),Dn(t),u&4){if(t.stateNode===null)throw Error(i(162));u=t.memoizedProps,o=t.stateNode;try{o.nodeValue=u}catch(he){ta(t,t.return,he)}}break;case 3:if(Zc=null,h=ir,ir=Xc(n.containerInfo),Rn(n,t),ir=h,Dn(t),u&4&&o!==null&&o.memoizedState.isDehydrated)try{yl(n.containerInfo)}catch(he){ta(t,t.return,he)}Km&&(Km=!1,Wp(t));break;case 4:u=ir,ir=Xc(t.stateNode.containerInfo),Rn(n,t),Dn(t),ir=u;break;case 12:Rn(n,t),Dn(t);break;case 13:Rn(n,t),Dn(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&($m=Be()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Gm(t,u)));break;case 22:h=t.memoizedState!==null;var Y=o!==null&&o.memoizedState!==null,de=Wr,be=Na;if(Wr=de||h,Na=be||Y,Rn(n,t),Na=be,Wr=de,Dn(t),u&8192)e:for(n=t.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(o===null||Y||Wr||Na||us(t)),o=null,n=t;;){if(n.tag===5||n.tag===26){if(o===null){Y=o=n;try{if(y=Y.stateNode,h)L=y.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{M=Y.stateNode;var Se=Y.memoizedProps.style,fe=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;M.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(he){ta(Y,Y.return,he)}}}else if(n.tag===6){if(o===null){Y=n;try{Y.stateNode.nodeValue=h?"":Y.memoizedProps}catch(he){ta(Y,Y.return,he)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;o===n&&(o=null),n=n.return}o===n&&(o=null),n.sibling.return=n.return,n=n.sibling}u&4&&(u=t.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,Gm(t,o))));break;case 19:Rn(n,t),Dn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Gm(t,u)));break;case 30:break;case 21:break;default:Rn(n,t),Dn(t)}}function Dn(t){var n=t.flags;if(n&2){try{for(var o,u=t.return;u!==null;){if(Pp(u)){o=u;break}u=u.return}if(o==null)throw Error(i(160));switch(o.tag){case 27:var h=o.stateNode,y=zm(t);Oc(t,y,h);break;case 5:var L=o.stateNode;o.flags&32&&(hr(L,""),o.flags&=-33);var M=zm(t);Oc(t,M,L);break;case 3:case 4:var Y=o.stateNode.containerInfo,de=zm(t);Vm(t,de,Y);break;default:throw Error(i(161))}}catch(be){ta(t,t.return,be)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Wp(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Wp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function xi(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)zp(t,n.alternate,n),n=n.sibling}function us(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Ni(4,n,n.return),us(n);break;case 1:yr(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&Op(n,n.return,o),us(n);break;case 27:ul(n.stateNode);case 26:case 5:yr(n,n.return),us(n);break;case 22:n.memoizedState===null&&us(n);break;case 30:us(n);break;default:us(n)}t=t.sibling}}function Ti(t,n,o){for(o=o&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var u=n.alternate,h=t,y=n,L=y.flags;switch(y.tag){case 0:case 11:case 15:Ti(h,y,o),el(4,y);break;case 1:if(Ti(h,y,o),u=y,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(de){ta(u,u.return,de)}if(u=y,h=u.updateQueue,h!==null){var M=u.stateNode;try{var Y=h.shared.hiddenCallbacks;if(Y!==null)for(h.shared.hiddenCallbacks=null,h=0;h<Y.length;h++)wA(Y[h],M)}catch(de){ta(u,u.return,de)}}o&&L&64&&Fp(y),tl(y,y.return);break;case 27:Hp(y);case 26:case 5:Ti(h,y,o),o&&u===null&&L&4&&jp(y),tl(y,y.return);break;case 12:Ti(h,y,o);break;case 13:Ti(h,y,o),o&&L&4&&Gp(h,y);break;case 22:y.memoizedState===null&&Ti(h,y,o),tl(y,y.return);break;case 30:break;default:Ti(h,y,o)}n=n.sibling}}function qm(t,n){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&Po(o))}function Wm(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Po(t))}function Er(t,n,o,u){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Yp(t,n,o,u),n=n.sibling}function Yp(t,n,o,u){var h=n.flags;switch(n.tag){case 0:case 11:case 15:Er(t,n,o,u),h&2048&&el(9,n);break;case 1:Er(t,n,o,u);break;case 3:Er(t,n,o,u),h&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Po(t)));break;case 12:if(h&2048){Er(t,n,o,u),t=n.stateNode;try{var y=n.memoizedProps,L=y.id,M=y.onPostCommit;typeof M=="function"&&M(L,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(Y){ta(n,n.return,Y)}}else Er(t,n,o,u);break;case 13:Er(t,n,o,u);break;case 23:break;case 22:y=n.stateNode,L=n.alternate,n.memoizedState!==null?y._visibility&2?Er(t,n,o,u):al(t,n):y._visibility&2?Er(t,n,o,u):(y._visibility|=2,qs(t,n,o,u,(n.subtreeFlags&10256)!==0)),h&2048&&qm(L,n);break;case 24:Er(t,n,o,u),h&2048&&Wm(n.alternate,n);break;default:Er(t,n,o,u)}}function qs(t,n,o,u,h){for(h=h&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;){var y=t,L=n,M=o,Y=u,de=L.flags;switch(L.tag){case 0:case 11:case 15:qs(y,L,M,Y,h),el(8,L);break;case 23:break;case 22:var be=L.stateNode;L.memoizedState!==null?be._visibility&2?qs(y,L,M,Y,h):al(y,L):(be._visibility|=2,qs(y,L,M,Y,h)),h&&de&2048&&qm(L.alternate,L);break;case 24:qs(y,L,M,Y,h),h&&de&2048&&Wm(L.alternate,L);break;default:qs(y,L,M,Y,h)}n=n.sibling}}function al(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=t,u=n,h=u.flags;switch(u.tag){case 22:al(o,u),h&2048&&qm(u.alternate,u);break;case 24:al(o,u),h&2048&&Wm(u.alternate,u);break;default:al(o,u)}n=n.sibling}}var nl=8192;function Ws(t){if(t.subtreeFlags&nl)for(t=t.child;t!==null;)Jp(t),t=t.sibling}function Jp(t){switch(t.tag){case 26:Ws(t),t.flags&nl&&t.memoizedState!==null&&Ew(ir,t.memoizedState,t.memoizedProps);break;case 5:Ws(t);break;case 3:case 4:var n=ir;ir=Xc(t.stateNode.containerInfo),Ws(t),ir=n;break;case 22:t.memoizedState===null&&(n=t.alternate,n!==null&&n.memoizedState!==null?(n=nl,nl=16777216,Ws(t),nl=n):Ws(t));break;default:Ws(t)}}function Xp(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function rl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];Qa=u,Zp(u,t)}Xp(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)$p(t),t=t.sibling}function $p(t){switch(t.tag){case 0:case 11:case 15:rl(t),t.flags&2048&&Ni(9,t,t.return);break;case 3:rl(t);break;case 12:rl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,jc(t)):rl(t);break;default:rl(t)}}function jc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];Qa=u,Zp(u,t)}Xp(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Ni(8,n,n.return),jc(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,jc(n));break;default:jc(n)}t=t.sibling}}function Zp(t,n){for(;Qa!==null;){var o=Qa;switch(o.tag){case 0:case 11:case 15:Ni(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Po(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Qa=u;else e:for(o=t;Qa!==null;){u=Qa;var h=u.sibling,y=u.return;if(Vp(u),u===o){Qa=null;break e}if(h!==null){h.return=y,Qa=h;break e}Qa=y}}}var _v={getCacheForType:function(t){var n=rn(Ba),o=n.data.get(t);return o===void 0&&(o=t(),n.data.set(t,o)),o}},Mv=typeof WeakMap=="function"?WeakMap:Map,Vt=0,ia=null,Dt=null,_t=0,Kt=0,Bn=null,Si=!1,Ys=!1,Ym=!1,Jr=0,ba=0,ki=0,ds=0,Jm=0,Wn=0,Js=0,il=null,vn=null,Xm=!1,$m=0,Pc=1/0,Hc=null,Li=null,Wa=0,Ri=null,Xs=null,$s=0,Zm=0,ef=null,e0=null,sl=0,tf=null;function Un(){if((Vt&2)!==0&&_t!==0)return _t&-_t;if($.T!==null){var t=js;return t!==0?t:cf()}return tr()}function t0(){Wn===0&&(Wn=(_t&536870912)===0||jt?fr():536870912);var t=qn.current;return t!==null&&(t.flags|=32),Wn}function _n(t,n,o){(t===ia&&(Kt===2||Kt===9)||t.cancelPendingCommit!==null)&&(Zs(t,0),Di(t,_t,Wn,!1)),On(t,o),((Vt&2)===0||t!==ia)&&(t===ia&&((Vt&2)===0&&(ds|=o),ba===4&&Di(t,_t,Wn,!1)),br(t))}function a0(t,n,o){if((Vt&6)!==0)throw Error(i(327));var u=!o&&(n&124)===0&&(n&t.expiredLanes)===0||St(t,n),h=u?jv(t,n):rf(t,n,!0),y=u;do{if(h===0){Ys&&!u&&Di(t,n,0,!1);break}else{if(o=t.current.alternate,y&&!Fv(o)){h=rf(t,n,!1),y=!1;continue}if(h===2){if(y=n,t.errorRecoveryDisabledLanes&y)var L=0;else L=t.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){n=L;e:{var M=t;h=il;var Y=M.current.memoizedState.isDehydrated;if(Y&&(Zs(M,L).flags|=256),L=rf(M,L,!1),L!==2){if(Ym&&!Y){M.errorRecoveryDisabledLanes|=y,ds|=y,h=4;break e}y=vn,vn=h,y!==null&&(vn===null?vn=y:vn.push.apply(vn,y))}h=L}if(y=!1,h!==2)continue}}if(h===1){Zs(t,0),Di(t,n,0,!0);break}e:{switch(u=t,y=h,y){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:Di(u,n,Wn,!Si);break e;case 2:vn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(h=$m+300-Be(),10<h)){if(Di(u,n,Wn,!Si),It(u,0,!0)!==0)break e;u.timeoutHandle=R0(n0.bind(null,u,o,vn,Hc,Xm,n,Wn,ds,Js,Si,y,2,-0,0),h);break e}n0(u,o,vn,Hc,Xm,n,Wn,ds,Js,Si,y,0,-0,0)}}break}while(!0);br(t)}function n0(t,n,o,u,h,y,L,M,Y,de,be,Se,fe,he){if(t.timeoutHandle=-1,Se=n.subtreeFlags,(Se&8192||(Se&16785408)===16785408)&&(fl={stylesheets:null,count:0,unsuspend:yw},Jp(n),Se=bw(),Se!==null)){t.cancelPendingCommit=Se(u0.bind(null,t,n,y,o,u,h,L,M,Y,be,1,fe,he)),Di(t,y,L,!de);return}u0(t,n,y,o,u,h,L,M,Y)}function Fv(t){for(var n=t;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var h=o[u],y=h.getSnapshot;h=h.value;try{if(!kn(y(),h))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Di(t,n,o,u){n&=~Jm,n&=~ds,t.suspendedLanes|=n,t.pingedLanes&=~n,u&&(t.warmLanes|=n),u=t.expirationTimes;for(var h=n;0<h;){var y=31-N(h),L=1<<y;u[y]=-1,h&=~L}o!==0&&Oe(t,o,n)}function Qc(){return(Vt&6)===0?(ol(0),!1):!0}function af(){if(Dt!==null){if(Kt===0)var t=Dt.return;else t=Dt,Qr=is=null,Em(t),Ks=null,Xo=0,t=Dt;for(;t!==null;)Mp(t.alternate,t),t=t.return;Dt=null}}function Zs(t,n){var o=t.timeoutHandle;o!==-1&&(t.timeoutHandle=-1,tw(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),af(),ia=t,Dt=o=jr(t.current,null),_t=n,Kt=0,Bn=null,Si=!1,Ys=St(t,n),Ym=!1,Js=Wn=Jm=ds=ki=ba=0,vn=il=null,Xm=!1,(n&8)!==0&&(n|=n&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=n;0<u;){var h=31-N(u),y=1<<h;n|=t[h],u&=~y}return Jr=n,uc(),o}function r0(t,n){Tt=null,$.H=kc,n===Qo||n===Ec?(n=IA(),Kt=3):n===yA?(n=IA(),Kt=4):Kt=n===vp?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Bn=n,Dt===null&&(ba=1,Uc(t,zn(n,t.current)))}function i0(){var t=$.H;return $.H=kc,t===null?kc:t}function s0(){var t=$.A;return $.A=_v,t}function nf(){ba=4,Si||(_t&4194048)!==_t&&qn.current!==null||(Ys=!0),(ki&134217727)===0&&(ds&134217727)===0||ia===null||Di(ia,_t,Wn,!1)}function rf(t,n,o){var u=Vt;Vt|=2;var h=i0(),y=s0();(ia!==t||_t!==n)&&(Hc=null,Zs(t,n)),n=!1;var L=ba;e:do try{if(Kt!==0&&Dt!==null){var M=Dt,Y=Bn;switch(Kt){case 8:af(),L=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(n=!0);var de=Kt;if(Kt=0,Bn=null,eo(t,M,Y,de),o&&Ys){L=0;break e}break;default:de=Kt,Kt=0,Bn=null,eo(t,M,Y,de)}}Ov(),L=ba;break}catch(be){r0(t,be)}while(!0);return n&&t.shellSuspendCounter++,Qr=is=null,Vt=u,$.H=h,$.A=y,Dt===null&&(ia=null,_t=0,uc()),L}function Ov(){for(;Dt!==null;)o0(Dt)}function jv(t,n){var o=Vt;Vt|=2;var u=i0(),h=s0();ia!==t||_t!==n?(Hc=null,Pc=Be()+500,Zs(t,n)):Ys=St(t,n);e:do try{if(Kt!==0&&Dt!==null){n=Dt;var y=Bn;t:switch(Kt){case 1:Kt=0,Bn=null,eo(t,n,y,1);break;case 2:case 9:if(EA(y)){Kt=0,Bn=null,l0(n);break}n=function(){Kt!==2&&Kt!==9||ia!==t||(Kt=7),br(t)},y.then(n,n);break e;case 3:Kt=7;break e;case 4:Kt=5;break e;case 7:EA(y)?(Kt=0,Bn=null,l0(n)):(Kt=0,Bn=null,eo(t,n,y,7));break;case 5:var L=null;switch(Dt.tag){case 26:L=Dt.memoizedState;case 5:case 27:var M=Dt;if(!L||z0(L)){Kt=0,Bn=null;var Y=M.sibling;if(Y!==null)Dt=Y;else{var de=M.return;de!==null?(Dt=de,zc(de)):Dt=null}break t}}Kt=0,Bn=null,eo(t,n,y,5);break;case 6:Kt=0,Bn=null,eo(t,n,y,6);break;case 8:af(),ba=6;break e;default:throw Error(i(462))}}Pv();break}catch(be){r0(t,be)}while(!0);return Qr=is=null,$.H=u,$.A=h,Vt=o,Dt!==null?0:(ia=null,_t=0,uc(),ba)}function Pv(){for(;Dt!==null&&!Ht();)o0(Dt)}function o0(t){var n=Up(t.alternate,t,Jr);t.memoizedProps=t.pendingProps,n===null?zc(t):Dt=n}function l0(t){var n=t,o=n.alternate;switch(n.tag){case 15:case 0:n=Sp(o,n,n.pendingProps,n.type,void 0,_t);break;case 11:n=Sp(o,n,n.pendingProps,n.type.render,n.ref,_t);break;case 5:Em(n);default:Mp(o,n),n=Dt=cA(n,Jr),n=Up(o,n,Jr)}t.memoizedProps=t.pendingProps,n===null?zc(t):Dt=n}function eo(t,n,o,u){Qr=is=null,Em(n),Ks=null,Xo=0;var h=n.return;try{if(kv(t,h,n,o,_t)){ba=1,Uc(t,zn(o,t.current)),Dt=null;return}}catch(y){if(h!==null)throw Dt=h,y;ba=1,Uc(t,zn(o,t.current)),Dt=null;return}n.flags&32768?(jt||u===1?t=!0:Ys||(_t&536870912)!==0?t=!1:(Si=t=!0,(u===2||u===9||u===3||u===6)&&(u=qn.current,u!==null&&u.tag===13&&(u.flags|=16384))),c0(n,t)):zc(n)}function zc(t){var n=t;do{if((n.flags&32768)!==0){c0(n,Si);return}t=n.return;var o=Rv(n.alternate,n,Jr);if(o!==null){Dt=o;return}if(n=n.sibling,n!==null){Dt=n;return}Dt=n=t}while(n!==null);ba===0&&(ba=5)}function c0(t,n){do{var o=Dv(t.alternate,t);if(o!==null){o.flags&=32767,Dt=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(t=t.sibling,t!==null)){Dt=t;return}Dt=t=o}while(t!==null);ba=6,Dt=null}function u0(t,n,o,u,h,y,L,M,Y){t.cancelPendingCommit=null;do Vc();while(Wa!==0);if((Vt&6)!==0)throw Error(i(327));if(n!==null){if(n===t.current)throw Error(i(177));if(y=n.lanes|n.childLanes,y|=Wd,jn(t,o,y,L,M,Y),t===ia&&(Dt=ia=null,_t=0),Xs=n,Ri=t,$s=o,Zm=y,ef=h,e0=u,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Vv(et,function(){return h0(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=$.T,$.T=null,h=re.p,re.p=2,L=Vt,Vt|=4;try{Bv(t,n,o)}finally{Vt=L,re.p=h,$.T=u}}Wa=1,d0(),m0(),f0()}}function d0(){if(Wa===1){Wa=0;var t=Ri,n=Xs,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=$.T,$.T=null;var u=re.p;re.p=2;var h=Vt;Vt|=4;try{qp(n,t);var y=pf,L=Zh(t.containerInfo),M=y.focusedElem,Y=y.selectionRange;if(L!==M&&M&&M.ownerDocument&&$h(M.ownerDocument.documentElement,M)){if(Y!==null&&zd(M)){var de=Y.start,be=Y.end;if(be===void 0&&(be=de),"selectionStart"in M)M.selectionStart=de,M.selectionEnd=Math.min(be,M.value.length);else{var Se=M.ownerDocument||document,fe=Se&&Se.defaultView||window;if(fe.getSelection){var he=fe.getSelection(),ft=M.textContent.length,ot=Math.min(Y.start,ft),$t=Y.end===void 0?ot:Math.min(Y.end,ft);!he.extend&&ot>$t&&(L=$t,$t=ot,ot=L);var se=Xh(M,ot),te=Xh(M,$t);if(se&&te&&(he.rangeCount!==1||he.anchorNode!==se.node||he.anchorOffset!==se.offset||he.focusNode!==te.node||he.focusOffset!==te.offset)){var ue=Se.createRange();ue.setStart(se.node,se.offset),he.removeAllRanges(),ot>$t?(he.addRange(ue),he.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),he.addRange(ue))}}}}for(Se=[],he=M;he=he.parentNode;)he.nodeType===1&&Se.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<Se.length;M++){var Ce=Se[M];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}au=!!Af,pf=Af=null}finally{Vt=h,re.p=u,$.T=o}}t.current=n,Wa=2}}function m0(){if(Wa===2){Wa=0;var t=Ri,n=Xs,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=$.T,$.T=null;var u=re.p;re.p=2;var h=Vt;Vt|=4;try{zp(t,n.alternate,n)}finally{Vt=h,re.p=u,$.T=o}}Wa=3}}function f0(){if(Wa===4||Wa===3){Wa=0,ve();var t=Ri,n=Xs,o=$s,u=e0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wa=5:(Wa=0,Xs=Ri=null,g0(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(Li=null),sa(o),n=n.stateNode,B&&typeof B.onCommitFiberRoot=="function")try{B.onCommitFiberRoot(na,n,void 0,(n.current.flags&128)===128)}catch{}if(u!==null){n=$.T,h=re.p,re.p=2,$.T=null;try{for(var y=t.onRecoverableError,L=0;L<u.length;L++){var M=u[L];y(M.value,{componentStack:M.stack})}}finally{$.T=n,re.p=h}}($s&3)!==0&&Vc(),br(t),h=t.pendingLanes,(o&4194090)!==0&&(h&42)!==0?t===tf?sl++:(sl=0,tf=t):sl=0,ol(0)}}function g0(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Po(n)))}function Vc(t){return d0(),m0(),f0(),h0()}function h0(){if(Wa!==5)return!1;var t=Ri,n=Zm;Zm=0;var o=sa($s),u=$.T,h=re.p;try{re.p=32>o?32:o,$.T=null,o=ef,ef=null;var y=Ri,L=$s;if(Wa=0,Xs=Ri=null,$s=0,(Vt&6)!==0)throw Error(i(331));var M=Vt;if(Vt|=4,$p(y.current),Yp(y,y.current,L,o),Vt=M,ol(0,!1),B&&typeof B.onPostCommitFiberRoot=="function")try{B.onPostCommitFiberRoot(na,y)}catch{}return!0}finally{re.p=h,$.T=u,g0(t,n)}}function A0(t,n,o){n=zn(o,n),n=Bm(t.stateNode,n,2),t=Ii(t,n,2),t!==null&&(On(t,2),br(t))}function ta(t,n,o){if(t.tag===3)A0(t,t,o);else for(;n!==null;){if(n.tag===3){A0(n,t,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Li===null||!Li.has(u))){t=zn(o,t),o=bp(2),u=Ii(n,o,2),u!==null&&(Ip(o,u,n,t),On(u,2),br(u));break}}n=n.return}}function sf(t,n,o){var u=t.pingCache;if(u===null){u=t.pingCache=new Mv;var h=new Set;u.set(n,h)}else h=u.get(n),h===void 0&&(h=new Set,u.set(n,h));h.has(o)||(Ym=!0,h.add(o),t=Hv.bind(null,t,n,o),n.then(t,t))}function Hv(t,n,o){var u=t.pingCache;u!==null&&u.delete(n),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,ia===t&&(_t&o)===o&&(ba===4||ba===3&&(_t&62914560)===_t&&300>Be()-$m?(Vt&2)===0&&Zs(t,0):Jm|=o,Js===_t&&(Js=0)),br(t)}function p0(t,n){n===0&&(n=ra()),t=_s(t,n),t!==null&&(On(t,n),br(t))}function Qv(t){var n=t.memoizedState,o=0;n!==null&&(o=n.retryLane),p0(t,o)}function zv(t,n){var o=0;switch(t.tag){case 13:var u=t.stateNode,h=t.memoizedState;h!==null&&(o=h.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(n),p0(t,o)}function Vv(t,n){return We(t,n)}var Kc=null,to=null,of=!1,Gc=!1,lf=!1,ms=0;function br(t){t!==to&&t.next===null&&(to===null?Kc=to=t:to=to.next=t),Gc=!0,of||(of=!0,Gv())}function ol(t,n){if(!lf&&Gc){lf=!0;do for(var o=!1,u=Kc;u!==null;){if(t!==0){var h=u.pendingLanes;if(h===0)var y=0;else{var L=u.suspendedLanes,M=u.pingedLanes;y=(1<<31-N(42|t)+1)-1,y&=h&~(L&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,I0(u,y))}else y=_t,y=It(u,u===ia?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||St(u,y)||(o=!0,I0(u,y));u=u.next}while(o);lf=!1}}function Kv(){y0()}function y0(){Gc=of=!1;var t=0;ms!==0&&(ew()&&(t=ms),ms=0);for(var n=Be(),o=null,u=Kc;u!==null;){var h=u.next,y=E0(u,n);y===0?(u.next=null,o===null?Kc=h:o.next=h,h===null&&(to=o)):(o=u,(t!==0||(y&3)!==0)&&(Gc=!0)),u=h}ol(t)}function E0(t,n){for(var o=t.suspendedLanes,u=t.pingedLanes,h=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var L=31-N(y),M=1<<L,Y=h[L];Y===-1?((M&o)===0||(M&u)!==0)&&(h[L]=mt(M,n)):Y<=n&&(t.expiredLanes|=M),y&=~M}if(n=ia,o=_t,o=It(t,t===n?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,o===0||t===n&&(Kt===2||Kt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&nt(u),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||St(t,o)){if(n=o&-o,n===t.callbackPriority)return n;switch(u!==null&&nt(u),sa(o)){case 2:case 8:o=lt;break;case 32:o=et;break;case 268435456:o=Pt;break;default:o=et}return u=b0.bind(null,t),o=We(o,u),t.callbackPriority=n,t.callbackNode=o,n}return u!==null&&u!==null&&nt(u),t.callbackPriority=2,t.callbackNode=null,2}function b0(t,n){if(Wa!==0&&Wa!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(Vc()&&t.callbackNode!==o)return null;var u=_t;return u=It(t,t===ia?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(a0(t,u,n),E0(t,Be()),t.callbackNode!=null&&t.callbackNode===o?b0.bind(null,t):null)}function I0(t,n){if(Vc())return null;a0(t,n,!0)}function Gv(){aw(function(){(Vt&6)!==0?We(Ye,Kv):y0()})}function cf(){return ms===0&&(ms=fr()),ms}function v0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:pn(""+t)}function w0(t,n){var o=n.ownerDocument.createElement("input");return o.name=n.name,o.value=n.value,t.id&&o.setAttribute("form",t.id),n.parentNode.insertBefore(o,n),t=new FormData(t),o.parentNode.removeChild(o),t}function qv(t,n,o,u,h){if(n==="submit"&&o&&o.stateNode===h){var y=v0((h[ya]||null).action),L=u.submitter;L&&(n=(n=L[ya]||null)?v0(n.formAction):L.getAttribute("formAction"),n!==null&&(y=n,L=null));var M=new wt("action","action",null,u,h);t.push({event:M,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(ms!==0){var Y=L?w0(h,L):new FormData(h);Sm(o,{pending:!0,data:Y,method:h.method,action:y},null,Y)}}else typeof y=="function"&&(M.preventDefault(),Y=L?w0(h,L):new FormData(h),Sm(o,{pending:!0,data:Y,method:h.method,action:y},y,Y))},currentTarget:h}]})}}for(var uf=0;uf<qd.length;uf++){var df=qd[uf],Wv=df.toLowerCase(),Yv=df[0].toUpperCase()+df.slice(1);rr(Wv,"on"+Yv)}rr(aA,"onAnimationEnd"),rr(nA,"onAnimationIteration"),rr(rA,"onAnimationStart"),rr("dblclick","onDoubleClick"),rr("focusin","onFocus"),rr("focusout","onBlur"),rr(mv,"onTransitionRun"),rr(fv,"onTransitionStart"),rr(gv,"onTransitionCancel"),rr(iA,"onTransitionEnd"),xe("onMouseEnter",["mouseout","mouseover"]),xe("onMouseLeave",["mouseout","mouseover"]),xe("onPointerEnter",["pointerout","pointerover"]),xe("onPointerLeave",["pointerout","pointerover"]),Z("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Z("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Z("onBeforeInput",["compositionend","keypress","textInput","paste"]),Z("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Z("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Z("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ll="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Jv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ll));function C0(t,n){n=(n&4)!==0;for(var o=0;o<t.length;o++){var u=t[o],h=u.event;u=u.listeners;e:{var y=void 0;if(n)for(var L=u.length-1;0<=L;L--){var M=u[L],Y=M.instance,de=M.currentTarget;if(M=M.listener,Y!==y&&h.isPropagationStopped())break e;y=M,h.currentTarget=de;try{y(h)}catch(be){Bc(be)}h.currentTarget=null,y=Y}else for(L=0;L<u.length;L++){if(M=u[L],Y=M.instance,de=M.currentTarget,M=M.listener,Y!==y&&h.isPropagationStopped())break e;y=M,h.currentTarget=de;try{y(h)}catch(be){Bc(be)}h.currentTarget=null,y=Y}}}}function Bt(t,n){var o=n[Da];o===void 0&&(o=n[Da]=new Set);var u=t+"__bubble";o.has(u)||(N0(n,t,2,!1),o.add(u))}function mf(t,n,o){var u=0;n&&(u|=4),N0(o,t,u,n)}var qc="_reactListening"+Math.random().toString(36).slice(2);function ff(t){if(!t[qc]){t[qc]=!0,cn.forEach(function(o){o!=="selectionchange"&&(Jv.has(o)||mf(o,!1,t),mf(o,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[qc]||(n[qc]=!0,mf("selectionchange",!1,n))}}function N0(t,n,o,u){switch(Y0(n)){case 2:var h=ww;break;case 8:h=Cw;break;default:h=Tf}o=h.bind(null,n,o,t),h=void 0,!Hn||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),u?h!==void 0?t.addEventListener(n,o,{capture:!0,passive:h}):t.addEventListener(n,o,!0):h!==void 0?t.addEventListener(n,o,{passive:h}):t.addEventListener(n,o,!1)}function gf(t,n,o,u,h){var y=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var L=u.tag;if(L===3||L===4){var M=u.stateNode.containerInfo;if(M===h)break;if(L===4)for(L=u.return;L!==null;){var Y=L.tag;if((Y===3||Y===4)&&L.stateNode.containerInfo===h)return;L=L.return}for(;M!==null;){if(L=Xe(M),L===null)return;if(Y=L.tag,Y===5||Y===6||Y===26||Y===27){u=y=L;continue e}M=M.parentNode}}u=u.return}ko(function(){var de=y,be=Fr(o),Se=[];e:{var fe=sA.get(t);if(fe!==void 0){var he=wt,ft=t;switch(t){case"keypress":if(F(o)===0)break e;case"keydown":case"keyup":he=Rd;break;case"focusin":ft="focus",he=Lo;break;case"focusout":ft="blur",he=Lo;break;case"beforeblur":case"afterblur":he=Lo;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=nc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=Ed;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=Bd;break;case aA:case nA:case rA:he=vd;break;case iA:he=_d;break;case"scroll":case"scrollend":he=ua;break;case"wheel":he=oc;break;case"copy":case"cut":case"paste":he=Cd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=sc;break;case"toggle":case"beforetoggle":he=Od}var ot=(n&4)!==0,$t=!ot&&(t==="scroll"||t==="scrollend"),se=ot?fe!==null?fe+"Capture":null:fe;ot=[];for(var te=de,ue;te!==null;){var Ce=te;if(ue=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||ue===null||se===null||(Ce=hi(te,se),Ce!=null&&ot.push(cl(te,Ce,ue))),$t)break;te=te.return}0<ot.length&&(fe=new he(fe,ft,null,o,be),Se.push({event:fe,listeners:ot}))}}if((n&7)===0){e:{if(fe=t==="mouseover"||t==="pointerover",he=t==="mouseout"||t==="pointerout",fe&&o!==Pn&&(ft=o.relatedTarget||o.fromElement)&&(Xe(ft)||ft[Wt]))break e;if((he||fe)&&(fe=be.window===be?be:(fe=be.ownerDocument)?fe.defaultView||fe.parentWindow:window,he?(ft=o.relatedTarget||o.toElement,he=de,ft=ft?Xe(ft):null,ft!==null&&($t=c(ft),ot=ft.tag,ft!==$t||ot!==5&&ot!==27&&ot!==6)&&(ft=null)):(he=null,ft=de),he!==ft)){if(ot=nc,Ce="onMouseLeave",se="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(ot=sc,Ce="onPointerLeave",se="onPointerEnter",te="pointer"),$t=he==null?fe:vt(he),ue=ft==null?fe:vt(ft),fe=new ot(Ce,te+"leave",he,o,be),fe.target=$t,fe.relatedTarget=ue,Ce=null,Xe(be)===de&&(ot=new ot(se,te+"enter",ft,o,be),ot.target=ue,ot.relatedTarget=$t,Ce=ot),$t=Ce,he&&ft)t:{for(ot=he,se=ft,te=0,ue=ot;ue;ue=ao(ue))te++;for(ue=0,Ce=se;Ce;Ce=ao(Ce))ue++;for(;0<te-ue;)ot=ao(ot),te--;for(;0<ue-te;)se=ao(se),ue--;for(;te--;){if(ot===se||se!==null&&ot===se.alternate)break t;ot=ao(ot),se=ao(se)}ot=null}else ot=null;he!==null&&x0(Se,fe,he,ot,!1),ft!==null&&$t!==null&&x0(Se,$t,ft,ot,!0)}}e:{if(fe=de?vt(de):window,he=fe.nodeName&&fe.nodeName.toLowerCase(),he==="select"||he==="input"&&fe.type==="file")var Ge=Kh;else if(nn(fe))if(Gh)Ge=cv;else{Ge=ov;var Lt=sv}else he=fe.nodeName,!he||he.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&mi(de.elementType)&&(Ge=Kh):Ge=lv;if(Ge&&(Ge=Ge(t,de))){En(Se,Ge,o,be);break e}Lt&&Lt(t,fe,de),t==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&Ss(fe,"number",fe.value)}switch(Lt=de?vt(de):window,t){case"focusin":(nn(Lt)||Lt.contentEditable==="true")&&(Ds=Lt,Vd=de,_o=null);break;case"focusout":_o=Vd=Ds=null;break;case"mousedown":Kd=!0;break;case"contextmenu":case"mouseup":case"dragend":Kd=!1,eA(Se,o,be);break;case"selectionchange":if(dv)break;case"keydown":case"keyup":eA(Se,o,be)}var at;if(Ai)e:{switch(t){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else ct?Ke(t,o)&&(ut="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(ut="onCompositionStart");ut&&(Bo&&o.locale!=="ko"&&(ct||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&ct&&(at=D()):(Qn=be,A="value"in Qn?Qn.value:Qn.textContent,ct=!0)),Lt=Wc(de,ut),0<Lt.length&&(ut=new Ro(ut,t,null,o,be),Se.push({event:ut,listeners:Lt}),at?ut.data=at:(at=rt(o),at!==null&&(ut.data=at)))),(at=lc?Ot(t,o):Tn(t,o))&&(ut=Wc(de,"onBeforeInput"),0<ut.length&&(Lt=new Ro("onBeforeInput","beforeinput",null,o,be),Se.push({event:Lt,listeners:ut}),Lt.data=at)),qv(Se,t,de,o,be)}C0(Se,n)})}function cl(t,n,o){return{instance:t,listener:n,currentTarget:o}}function Wc(t,n){for(var o=n+"Capture",u=[];t!==null;){var h=t,y=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||y===null||(h=hi(t,o),h!=null&&u.unshift(cl(t,h,y)),h=hi(t,n),h!=null&&u.push(cl(t,h,y))),t.tag===3)return u;t=t.return}return[]}function ao(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function x0(t,n,o,u,h){for(var y=n._reactName,L=[];o!==null&&o!==u;){var M=o,Y=M.alternate,de=M.stateNode;if(M=M.tag,Y!==null&&Y===u)break;M!==5&&M!==26&&M!==27||de===null||(Y=de,h?(de=hi(o,y),de!=null&&L.unshift(cl(o,de,Y))):h||(de=hi(o,y),de!=null&&L.push(cl(o,de,Y)))),o=o.return}L.length!==0&&t.push({event:n,listeners:L})}var Xv=/\r\n?/g,$v=/\u0000|\uFFFD/g;function T0(t){return(typeof t=="string"?t:""+t).replace(Xv,`
`).replace($v,"")}function S0(t,n){return n=T0(n),T0(t)===n}function Yc(){}function Xt(t,n,o,u,h,y){switch(o){case"children":typeof u=="string"?n==="body"||n==="textarea"&&u===""||hr(t,u):(typeof u=="number"||typeof u=="bigint")&&n!=="body"&&hr(t,""+u);break;case"className":Ga(t,"class",u);break;case"tabIndex":Ga(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ga(t,o,u);break;case"style":Yi(t,u,y);break;case"data":if(n!=="object"){Ga(t,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||o!=="href")){t.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=pn(""+u),t.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(o==="formAction"?(n!=="input"&&Xt(t,n,"name",h.name,h,null),Xt(t,n,"formEncType",h.formEncType,h,null),Xt(t,n,"formMethod",h.formMethod,h,null),Xt(t,n,"formTarget",h.formTarget,h,null)):(Xt(t,n,"encType",h.encType,h,null),Xt(t,n,"method",h.method,h,null),Xt(t,n,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=pn(""+u),t.setAttribute(o,u);break;case"onClick":u!=null&&(t.onclick=Yc);break;case"onScroll":u!=null&&Bt("scroll",t);break;case"onScrollEnd":u!=null&&Bt("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(i(60));t.innerHTML=o}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}o=pn(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,""+u):t.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":u===!0?t.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,u):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(o,u):t.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(o):t.setAttribute(o,u);break;case"popover":Bt("beforetoggle",t),Bt("toggle",t),la(t,"popover",u);break;case"xlinkActuate":va(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":va(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":va(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":va(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":va(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":va(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":va(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":va(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":va(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":la(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Mr.get(o)||o,la(t,o,u))}}function hf(t,n,o,u,h,y){switch(o){case"style":Yi(t,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(i(60));t.innerHTML=o}}break;case"children":typeof u=="string"?hr(t,u):(typeof u=="number"||typeof u=="bigint")&&hr(t,""+u);break;case"onScroll":u!=null&&Bt("scroll",t);break;case"onScrollEnd":u!=null&&Bt("scrollend",t);break;case"onClick":u!=null&&(t.onclick=Yc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fe.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),n=o.slice(2,h?o.length-7:void 0),y=t[ya]||null,y=y!=null?y[o]:null,typeof y=="function"&&t.removeEventListener(n,y,h),typeof u=="function")){typeof y!="function"&&y!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(n,u,h);break e}o in t?t[o]=u:u===!0?t.setAttribute(o,""):la(t,o,u)}}}function Ya(t,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",t),Bt("load",t);var u=!1,h=!1,y;for(y in o)if(o.hasOwnProperty(y)){var L=o[y];if(L!=null)switch(y){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Xt(t,n,y,L,o,null)}}h&&Xt(t,n,"srcSet",o.srcSet,o,null),u&&Xt(t,n,"src",o.src,o,null);return;case"input":Bt("invalid",t);var M=y=L=h=null,Y=null,de=null;for(u in o)if(o.hasOwnProperty(u)){var be=o[u];if(be!=null)switch(u){case"name":h=be;break;case"type":L=be;break;case"checked":Y=be;break;case"defaultChecked":de=be;break;case"value":y=be;break;case"defaultValue":M=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(i(137,n));break;default:Xt(t,n,u,be,o,null)}}ui(t,y,M,Y,de,L,h,!1),Ur(t);return;case"select":Bt("invalid",t),u=L=y=null;for(h in o)if(o.hasOwnProperty(h)&&(M=o[h],M!=null))switch(h){case"value":y=M;break;case"defaultValue":L=M;break;case"multiple":u=M;default:Xt(t,n,h,M,o,null)}n=y,o=L,t.multiple=!!u,n!=null?di(t,!!u,n,!1):o!=null&&di(t,!!u,o,!0);return;case"textarea":Bt("invalid",t),y=h=u=null;for(L in o)if(o.hasOwnProperty(L)&&(M=o[L],M!=null))switch(L){case"value":u=M;break;case"defaultValue":h=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(i(91));break;default:Xt(t,n,L,M,o,null)}xo(t,u,h,y),Ur(t);return;case"option":for(Y in o)if(o.hasOwnProperty(Y)&&(u=o[Y],u!=null))switch(Y){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Xt(t,n,Y,u,o,null)}return;case"dialog":Bt("beforetoggle",t),Bt("toggle",t),Bt("cancel",t),Bt("close",t);break;case"iframe":case"object":Bt("load",t);break;case"video":case"audio":for(u=0;u<ll.length;u++)Bt(ll[u],t);break;case"image":Bt("error",t),Bt("load",t);break;case"details":Bt("toggle",t);break;case"embed":case"source":case"link":Bt("error",t),Bt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in o)if(o.hasOwnProperty(de)&&(u=o[de],u!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Xt(t,n,de,u,o,null)}return;default:if(mi(n)){for(be in o)o.hasOwnProperty(be)&&(u=o[be],u!==void 0&&hf(t,n,be,u,o,void 0));return}}for(M in o)o.hasOwnProperty(M)&&(u=o[M],u!=null&&Xt(t,n,M,u,o,null))}function Zv(t,n,o,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,y=null,L=null,M=null,Y=null,de=null,be=null;for(he in o){var Se=o[he];if(o.hasOwnProperty(he)&&Se!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Y=Se;default:u.hasOwnProperty(he)||Xt(t,n,he,null,u,Se)}}for(var fe in u){var he=u[fe];if(Se=o[fe],u.hasOwnProperty(fe)&&(he!=null||Se!=null))switch(fe){case"type":y=he;break;case"name":h=he;break;case"checked":de=he;break;case"defaultChecked":be=he;break;case"value":L=he;break;case"defaultValue":M=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(i(137,n));break;default:he!==Se&&Xt(t,n,fe,he,u,Se)}}No(t,L,M,Y,de,be,y,h);return;case"select":he=L=M=fe=null;for(y in o)if(Y=o[y],o.hasOwnProperty(y)&&Y!=null)switch(y){case"value":break;case"multiple":he=Y;default:u.hasOwnProperty(y)||Xt(t,n,y,null,u,Y)}for(h in u)if(y=u[h],Y=o[h],u.hasOwnProperty(h)&&(y!=null||Y!=null))switch(h){case"value":fe=y;break;case"defaultValue":M=y;break;case"multiple":L=y;default:y!==Y&&Xt(t,n,h,y,u,Y)}n=M,o=L,u=he,fe!=null?di(t,!!o,fe,!1):!!u!=!!o&&(n!=null?di(t,!!o,n,!0):di(t,!!o,o?[]:"",!1));return;case"textarea":he=fe=null;for(M in o)if(h=o[M],o.hasOwnProperty(M)&&h!=null&&!u.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Xt(t,n,M,null,u,h)}for(L in u)if(h=u[L],y=o[L],u.hasOwnProperty(L)&&(h!=null||y!=null))switch(L){case"value":fe=h;break;case"defaultValue":he=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(i(91));break;default:h!==y&&Xt(t,n,L,h,u,y)}ks(t,fe,he);return;case"option":for(var ft in o)if(fe=o[ft],o.hasOwnProperty(ft)&&fe!=null&&!u.hasOwnProperty(ft))switch(ft){case"selected":t.selected=!1;break;default:Xt(t,n,ft,null,u,fe)}for(Y in u)if(fe=u[Y],he=o[Y],u.hasOwnProperty(Y)&&fe!==he&&(fe!=null||he!=null))switch(Y){case"selected":t.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Xt(t,n,Y,fe,u,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ot in o)fe=o[ot],o.hasOwnProperty(ot)&&fe!=null&&!u.hasOwnProperty(ot)&&Xt(t,n,ot,null,u,fe);for(de in u)if(fe=u[de],he=o[de],u.hasOwnProperty(de)&&fe!==he&&(fe!=null||he!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,n));break;default:Xt(t,n,de,fe,u,he)}return;default:if(mi(n)){for(var $t in o)fe=o[$t],o.hasOwnProperty($t)&&fe!==void 0&&!u.hasOwnProperty($t)&&hf(t,n,$t,void 0,u,fe);for(be in u)fe=u[be],he=o[be],!u.hasOwnProperty(be)||fe===he||fe===void 0&&he===void 0||hf(t,n,be,fe,u,he);return}}for(var se in o)fe=o[se],o.hasOwnProperty(se)&&fe!=null&&!u.hasOwnProperty(se)&&Xt(t,n,se,null,u,fe);for(Se in u)fe=u[Se],he=o[Se],!u.hasOwnProperty(Se)||fe===he||fe==null&&he==null||Xt(t,n,Se,fe,u,he)}var Af=null,pf=null;function Jc(t){return t.nodeType===9?t:t.ownerDocument}function k0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function L0(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function yf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ef=null;function ew(){var t=window.event;return t&&t.type==="popstate"?t===Ef?!1:(Ef=t,!0):(Ef=null,!1)}var R0=typeof setTimeout=="function"?setTimeout:void 0,tw=typeof clearTimeout=="function"?clearTimeout:void 0,D0=typeof Promise=="function"?Promise:void 0,aw=typeof queueMicrotask=="function"?queueMicrotask:typeof D0<"u"?function(t){return D0.resolve(null).then(t).catch(nw)}:R0;function nw(t){setTimeout(function(){throw t})}function Bi(t){return t==="head"}function B0(t,n){var o=n,u=0,h=0;do{var y=o.nextSibling;if(t.removeChild(o),y&&y.nodeType===8)if(o=y.data,o==="/$"){if(0<u&&8>u){o=u;var L=t.ownerDocument;if(o&1&&ul(L.documentElement),o&2&&ul(L.body),o&4)for(o=L.head,ul(o),L=o.firstChild;L;){var M=L.nextSibling,Y=L.nodeName;L[Me]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&L.rel.toLowerCase()==="stylesheet"||o.removeChild(L),L=M}}if(h===0){t.removeChild(y),yl(n);return}h--}else o==="$"||o==="$?"||o==="$!"?h++:u=o.charCodeAt(0)-48;else u=0;o=y}while(o);yl(n)}function bf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":bf(o),_e(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function rw(t,n,o,u){for(;t.nodeType===1;){var h=o;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[Me])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var y=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=sr(t.nextSibling),t===null)break}return null}function iw(t,n,o){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=sr(t.nextSibling),t===null))return null;return t}function If(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function sw(t,n){var o=t.ownerDocument;if(t.data!=="$?"||o.readyState==="complete")n();else{var u=function(){n(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function sr(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="F!"||n==="F")break;if(n==="/$")return null}}return t}var vf=null;function U0(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return t;n--}else o==="/$"&&n++}t=t.previousSibling}return null}function _0(t,n,o){switch(n=Jc(o),t){case"html":if(t=n.documentElement,!t)throw Error(i(452));return t;case"head":if(t=n.head,!t)throw Error(i(453));return t;case"body":if(t=n.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function ul(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);_e(t)}var Yn=new Map,M0=new Set;function Xc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Xr=re.d;re.d={f:ow,r:lw,D:cw,C:uw,L:dw,m:mw,X:gw,S:fw,M:hw};function ow(){var t=Xr.f(),n=Qc();return t||n}function lw(t){var n=kt(t);n!==null&&n.tag===5&&n.type==="form"?ap(n):Xr.r(t)}var no=typeof document>"u"?null:document;function F0(t,n,o){var u=no;if(u&&typeof n=="string"&&n){var h=An(n);h='link[rel="'+t+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),M0.has(h)||(M0.add(h),t={rel:t,crossOrigin:o,href:n},u.querySelector(h)===null&&(n=u.createElement("link"),Ya(n,"link",t),st(n),u.head.appendChild(n)))}}function cw(t){Xr.D(t),F0("dns-prefetch",t,null)}function uw(t,n){Xr.C(t,n),F0("preconnect",t,n)}function dw(t,n,o){Xr.L(t,n,o);var u=no;if(u&&t&&n){var h='link[rel="preload"][as="'+An(n)+'"]';n==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+An(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+An(o.imageSizes)+'"]')):h+='[href="'+An(t)+'"]';var y=h;switch(n){case"style":y=ro(t);break;case"script":y=io(t)}Yn.has(y)||(t=E({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:t,as:n},o),Yn.set(y,t),u.querySelector(h)!==null||n==="style"&&u.querySelector(dl(y))||n==="script"&&u.querySelector(ml(y))||(n=u.createElement("link"),Ya(n,"link",t),st(n),u.head.appendChild(n)))}}function mw(t,n){Xr.m(t,n);var o=no;if(o&&t){var u=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+An(u)+'"][href="'+An(t)+'"]',y=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=io(t)}if(!Yn.has(y)&&(t=E({rel:"modulepreload",href:t},n),Yn.set(y,t),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ml(y)))return}u=o.createElement("link"),Ya(u,"link",t),st(u),o.head.appendChild(u)}}}function fw(t,n,o){Xr.S(t,n,o);var u=no;if(u&&t){var h=it(u).hoistableStyles,y=ro(t);n=n||"default";var L=h.get(y);if(!L){var M={loading:0,preload:null};if(L=u.querySelector(dl(y)))M.loading=5;else{t=E({rel:"stylesheet",href:t,"data-precedence":n},o),(o=Yn.get(y))&&wf(t,o);var Y=L=u.createElement("link");st(Y),Ya(Y,"link",t),Y._p=new Promise(function(de,be){Y.onload=de,Y.onerror=be}),Y.addEventListener("load",function(){M.loading|=1}),Y.addEventListener("error",function(){M.loading|=2}),M.loading|=4,$c(L,n,u)}L={type:"stylesheet",instance:L,count:1,state:M},h.set(y,L)}}}function gw(t,n){Xr.X(t,n);var o=no;if(o&&t){var u=it(o).hoistableScripts,h=io(t),y=u.get(h);y||(y=o.querySelector(ml(h)),y||(t=E({src:t,async:!0},n),(n=Yn.get(h))&&Cf(t,n),y=o.createElement("script"),st(y),Ya(y,"link",t),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(h,y))}}function hw(t,n){Xr.M(t,n);var o=no;if(o&&t){var u=it(o).hoistableScripts,h=io(t),y=u.get(h);y||(y=o.querySelector(ml(h)),y||(t=E({src:t,async:!0,type:"module"},n),(n=Yn.get(h))&&Cf(t,n),y=o.createElement("script"),st(y),Ya(y,"link",t),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(h,y))}}function O0(t,n,o,u){var h=(h=Re.current)?Xc(h):null;if(!h)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(n=ro(o.href),o=it(h).hoistableStyles,u=o.get(n),u||(u={type:"style",instance:null,count:0,state:null},o.set(n,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=ro(o.href);var y=it(h).hoistableStyles,L=y.get(t);if(L||(h=h.ownerDocument||h,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,L),(y=h.querySelector(dl(t)))&&!y._p&&(L.instance=y,L.state.loading=5),Yn.has(t)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Yn.set(t,o),y||Aw(h,t,o,L.state))),n&&u===null)throw Error(i(528,""));return L}if(n&&u!==null)throw Error(i(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=io(o),o=it(h).hoistableScripts,u=o.get(n),u||(u={type:"script",instance:null,count:0,state:null},o.set(n,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function ro(t){return'href="'+An(t)+'"'}function dl(t){return'link[rel="stylesheet"]['+t+"]"}function j0(t){return E({},t,{"data-precedence":t.precedence,precedence:null})}function Aw(t,n,o,u){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?u.loading=1:(n=t.createElement("link"),u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2}),Ya(n,"link",o),st(n),t.head.appendChild(n))}function io(t){return'[src="'+An(t)+'"]'}function ml(t){return"script[async]"+t}function P0(t,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var u=t.querySelector('style[data-href~="'+An(o.href)+'"]');if(u)return n.instance=u,st(u),u;var h=E({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),st(u),Ya(u,"style",h),$c(u,o.precedence,t),n.instance=u;case"stylesheet":h=ro(o.href);var y=t.querySelector(dl(h));if(y)return n.state.loading|=4,n.instance=y,st(y),y;u=j0(o),(h=Yn.get(h))&&wf(u,h),y=(t.ownerDocument||t).createElement("link"),st(y);var L=y;return L._p=new Promise(function(M,Y){L.onload=M,L.onerror=Y}),Ya(y,"link",u),n.state.loading|=4,$c(y,o.precedence,t),n.instance=y;case"script":return y=io(o.src),(h=t.querySelector(ml(y)))?(n.instance=h,st(h),h):(u=o,(h=Yn.get(y))&&(u=E({},o),Cf(u,h)),t=t.ownerDocument||t,h=t.createElement("script"),st(h),Ya(h,"link",u),t.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,$c(u,o.precedence,t));return n.instance}function $c(t,n,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,y=h,L=0;L<u.length;L++){var M=u[L];if(M.dataset.precedence===n)y=M;else if(y!==h)break}y?y.parentNode.insertBefore(t,y.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(t,n.firstChild))}function wf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Cf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Zc=null;function H0(t,n,o){if(Zc===null){var u=new Map,h=Zc=new Map;h.set(o,u)}else h=Zc,u=h.get(o),u||(u=new Map,h.set(o,u));if(u.has(t))return u;for(u.set(t,null),o=o.getElementsByTagName(t),h=0;h<o.length;h++){var y=o[h];if(!(y[Me]||y[zt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var L=y.getAttribute(n)||"";L=t+L;var M=u.get(L);M?M.push(y):u.set(L,[y])}}return u}function Q0(t,n,o){t=t.ownerDocument||t,t.head.insertBefore(o,n==="title"?t.querySelector("head > title"):null)}function pw(t,n,o){if(o===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function z0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var fl=null;function yw(){}function Ew(t,n,o){if(fl===null)throw Error(i(475));var u=fl;if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var h=ro(o.href),y=t.querySelector(dl(h));if(y){t=y._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(u.count++,u=eu.bind(u),t.then(u,u)),n.state.loading|=4,n.instance=y,st(y);return}y=t.ownerDocument||t,o=j0(o),(h=Yn.get(h))&&wf(o,h),y=y.createElement("link"),st(y);var L=y;L._p=new Promise(function(M,Y){L.onload=M,L.onerror=Y}),Ya(y,"link",o),n.instance=y}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(u.count++,n=eu.bind(u),t.addEventListener("load",n),t.addEventListener("error",n))}}function bw(){if(fl===null)throw Error(i(475));var t=fl;return t.stylesheets&&t.count===0&&Nf(t,t.stylesheets),0<t.count?function(n){var o=setTimeout(function(){if(t.stylesheets&&Nf(t,t.stylesheets),t.unsuspend){var u=t.unsuspend;t.unsuspend=null,u()}},6e4);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(o)}}:null}function eu(){if(this.count--,this.count===0){if(this.stylesheets)Nf(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var tu=null;function Nf(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,tu=new Map,n.forEach(Iw,t),tu=null,eu.call(t))}function Iw(t,n){if(!(n.state.loading&4)){var o=tu.get(t);if(o)var u=o.get(null);else{o=new Map,tu.set(t,o);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<h.length;y++){var L=h[y];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(o.set(L.dataset.precedence,L),u=L)}u&&o.set(null,u)}h=n.instance,L=h.getAttribute("data-precedence"),y=o.get(L)||u,y===u&&o.set(null,h),o.set(L,h),this.count++,u=eu.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),y?y.parentNode.insertBefore(h,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),n.state.loading|=4}}var gl={$$typeof:S,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function vw(t,n,o,u,h,y,L,M){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=an(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=an(0),this.hiddenUpdates=an(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=y,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function V0(t,n,o,u,h,y,L,M,Y,de,be,Se){return t=new vw(t,n,o,L,M,Y,de,Se),n=1,y===!0&&(n|=24),y=Ln(3,null,null,n),t.current=y,y.stateNode=t,n=im(),n.refCount++,t.pooledCache=n,n.refCount++,y.memoizedState={element:u,isDehydrated:o,cache:n},cm(y),t}function K0(t){return t?(t=Ms,t):Ms}function G0(t,n,o,u,h,y){h=K0(h),u.context===null?u.context=h:u.pendingContext=h,u=bi(n),u.payload={element:o},y=y===void 0?null:y,y!==null&&(u.callback=y),o=Ii(t,u,n),o!==null&&(_n(o,t,n),Vo(o,t,n))}function q0(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<n?o:n}}function xf(t,n){q0(t,n),(t=t.alternate)&&q0(t,n)}function W0(t){if(t.tag===13){var n=_s(t,67108864);n!==null&&_n(n,t,67108864),xf(t,67108864)}}var au=!0;function ww(t,n,o,u){var h=$.T;$.T=null;var y=re.p;try{re.p=2,Tf(t,n,o,u)}finally{re.p=y,$.T=h}}function Cw(t,n,o,u){var h=$.T;$.T=null;var y=re.p;try{re.p=8,Tf(t,n,o,u)}finally{re.p=y,$.T=h}}function Tf(t,n,o,u){if(au){var h=Sf(u);if(h===null)gf(t,n,u,nu,o),J0(t,u);else if(xw(h,t,n,o,u))u.stopPropagation();else if(J0(t,u),n&4&&-1<Nw.indexOf(t)){for(;h!==null;){var y=kt(h);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var L=ht(y.pendingLanes);if(L!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;L;){var Y=1<<31-N(L);M.entanglements[1]|=Y,L&=~Y}br(y),(Vt&6)===0&&(Pc=Be()+500,ol(0))}}break;case 13:M=_s(y,2),M!==null&&_n(M,y,2),Qc(),xf(y,2)}if(y=Sf(u),y===null&&gf(t,n,u,nu,o),y===h)break;h=y}h!==null&&u.stopPropagation()}else gf(t,n,u,null,o)}}function Sf(t){return t=Fr(t),kf(t)}var nu=null;function kf(t){if(nu=null,t=Xe(t),t!==null){var n=c(t);if(n===null)t=null;else{var o=n.tag;if(o===13){if(t=d(n),t!==null)return t;t=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return nu=t,null}function Y0(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($e()){case Ye:return 2;case lt:return 8;case et:case Et:return 32;case Pt:return 268435456;default:return 32}default:return 32}}var Lf=!1,Ui=null,_i=null,Mi=null,hl=new Map,Al=new Map,Fi=[],Nw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function J0(t,n){switch(t){case"focusin":case"focusout":Ui=null;break;case"dragenter":case"dragleave":_i=null;break;case"mouseover":case"mouseout":Mi=null;break;case"pointerover":case"pointerout":hl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Al.delete(n.pointerId)}}function pl(t,n,o,u,h,y){return t===null||t.nativeEvent!==y?(t={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:y,targetContainers:[h]},n!==null&&(n=kt(n),n!==null&&W0(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),t)}function xw(t,n,o,u,h){switch(n){case"focusin":return Ui=pl(Ui,t,n,o,u,h),!0;case"dragenter":return _i=pl(_i,t,n,o,u,h),!0;case"mouseover":return Mi=pl(Mi,t,n,o,u,h),!0;case"pointerover":var y=h.pointerId;return hl.set(y,pl(hl.get(y)||null,t,n,o,u,h)),!0;case"gotpointercapture":return y=h.pointerId,Al.set(y,pl(Al.get(y)||null,t,n,o,u,h)),!0}return!1}function X0(t){var n=Xe(t.target);if(n!==null){var o=c(n);if(o!==null){if(n=o.tag,n===13){if(n=d(o),n!==null){t.blockedOn=n,ar(t.priority,function(){if(o.tag===13){var u=Un();u=Zt(u);var h=_s(o,u);h!==null&&_n(h,o,u),xf(o,u)}});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ru(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var o=Sf(t.nativeEvent);if(o===null){o=t.nativeEvent;var u=new o.constructor(o.type,o);Pn=u,o.target.dispatchEvent(u),Pn=null}else return n=kt(o),n!==null&&W0(n),t.blockedOn=o,!1;n.shift()}return!0}function $0(t,n,o){ru(t)&&o.delete(n)}function Tw(){Lf=!1,Ui!==null&&ru(Ui)&&(Ui=null),_i!==null&&ru(_i)&&(_i=null),Mi!==null&&ru(Mi)&&(Mi=null),hl.forEach($0),Al.forEach($0)}function iu(t,n){t.blockedOn===n&&(t.blockedOn=null,Lf||(Lf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Tw)))}var su=null;function Z0(t){su!==t&&(su=t,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){su===t&&(su=null);for(var n=0;n<t.length;n+=3){var o=t[n],u=t[n+1],h=t[n+2];if(typeof u!="function"){if(kf(u||o)===null)continue;break}var y=kt(o);y!==null&&(t.splice(n,3),n-=3,Sm(y,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function yl(t){function n(Y){return iu(Y,t)}Ui!==null&&iu(Ui,t),_i!==null&&iu(_i,t),Mi!==null&&iu(Mi,t),hl.forEach(n),Al.forEach(n);for(var o=0;o<Fi.length;o++){var u=Fi[o];u.blockedOn===t&&(u.blockedOn=null)}for(;0<Fi.length&&(o=Fi[0],o.blockedOn===null);)X0(o),o.blockedOn===null&&Fi.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var h=o[u],y=o[u+1],L=h[ya]||null;if(typeof y=="function")L||Z0(o);else if(L){var M=null;if(y&&y.hasAttribute("formAction")){if(h=y,L=y[ya]||null)M=L.formAction;else if(kf(h)!==null)continue}else M=L.action;typeof M=="function"?o[u+1]=M:(o.splice(u,3),u-=3),Z0(o)}}}function Rf(t){this._internalRoot=t}ou.prototype.render=Rf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));var o=n.current,u=Un();G0(o,u,t,n,null,null)},ou.prototype.unmount=Rf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;G0(t.current,2,null,t,null,null),Qc(),n[Wt]=null}};function ou(t){this._internalRoot=t}ou.prototype.unstable_scheduleHydration=function(t){if(t){var n=tr();t={blockedOn:null,target:t,priority:n};for(var o=0;o<Fi.length&&n!==0&&n<Fi[o].priority;o++);Fi.splice(o,0,t),o===0&&X0(t)}};var ey=e.version;if(ey!=="19.1.0")throw Error(i(527,ey,"19.1.0"));re.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=g(n),t=t!==null?f(t):null,t=t===null?null:t.stateNode,t};var Sw={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lu.isDisabled&&lu.supportsFiber)try{na=lu.inject(Sw),B=lu}catch{}}return bl.createRoot=function(t,n){if(!s(t))throw Error(i(299));var o=!1,u="",h=Ap,y=pp,L=yp,M=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(L=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(M=n.unstable_transitionCallbacks)),n=V0(t,1,!1,null,null,o,u,h,y,L,M,null),t[Wt]=n.current,ff(t),new Rf(n)},bl.hydrateRoot=function(t,n,o){if(!s(t))throw Error(i(299));var u=!1,h="",y=Ap,L=pp,M=yp,Y=null,de=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(L=o.onCaughtError),o.onRecoverableError!==void 0&&(M=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(Y=o.unstable_transitionCallbacks),o.formState!==void 0&&(de=o.formState)),n=V0(t,1,!0,n,o??null,u,h,y,L,M,Y,de),n.context=K0(null),o=n.current,u=Un(),u=Zt(u),h=bi(u),h.callback=null,Ii(o,h,u),o=u,n.current.lanes=o,On(n,o),br(n),t[Wt]=n.current,ff(t),new ou(n)},bl.version="19.1.0",bl}var uy;function Qw(){if(uy)return Bf.exports;uy=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),Bf.exports=Hw(),Bf.exports}var zw=Qw();const Vw=qi(zw);var w=fh();const id=qi(w),Kw=(r,e,a,i)=>{var c,d,m,g;const s=[a,{code:e,...i||{}}];if((d=(c=r==null?void 0:r.services)==null?void 0:c.logger)!=null&&d.forward)return r.services.logger.forward(s,"warn","react-i18next::",!0);Es(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(g=(m=r==null?void 0:r.services)==null?void 0:m.logger)!=null&&g.warn?r.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},dy={},jg=(r,e,a,i)=>{Es(a)&&dy[a]||(Es(a)&&(dy[a]=new Date),Kw(r,e,a,i))},Nb=(r,e)=>()=>{if(r.isInitialized)e();else{const a=()=>{setTimeout(()=>{r.off("initialized",a)},0),e()};r.on("initialized",a)}},Pg=(r,e,a)=>{r.loadNamespaces(e,Nb(r,a))},my=(r,e,a,i)=>{if(Es(a)&&(a=[a]),r.options.preload&&r.options.preload.indexOf(e)>-1)return Pg(r,a,i);a.forEach(s=>{r.options.ns.indexOf(s)<0&&r.options.ns.push(s)}),r.loadLanguages(e,Nb(r,i))},Gw=(r,e,a={})=>!e.languages||!e.languages.length?(jg(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(r,{lng:a.lng,precheck:(i,s)=>{var c;if(((c=a.bindI18n)==null?void 0:c.indexOf("languageChanging"))>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,r))return!1}}),Es=r=>typeof r=="string",qw=r=>typeof r=="object"&&r!==null,Ww=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Yw={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Jw=r=>Yw[r],Xw=r=>r.replace(Ww,Jw);let Hg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Xw};const $w=(r={})=>{Hg={...Hg,...r}},Zw=()=>Hg;let xb;const eC=r=>{xb=r},tC=()=>xb,aC={type:"3rdParty",init(r){$w(r.options.react),eC(r)}},nC=w.createContext();class rC{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const iC=(r,e)=>{const a=w.useRef();return w.useEffect(()=>{a.current=r},[r,e]),a.current},Tb=(r,e,a,i)=>r.getFixedT(e,a,i),sC=(r,e,a,i)=>w.useCallback(Tb(r,e,a,i),[r,e,a,i]),tt=(r,e={})=>{var O,U,P,K;const{i18n:a}=e,{i18n:i,defaultNS:s}=w.useContext(nC)||{},c=a||i||tC();if(c&&!c.reportNamespaces&&(c.reportNamespaces=new rC),!c){jg(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const H=(V,G)=>Es(G)?G:qw(G)&&Es(G.defaultValue)?G.defaultValue:Array.isArray(V)?V[V.length-1]:V,Q=[H,{},!1];return Q.t=H,Q.i18n={},Q.ready=!1,Q}(O=c.options.react)!=null&&O.wait&&jg(c,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const d={...Zw(),...c.options.react,...e},{useSuspense:m,keyPrefix:g}=d;let f=s||((U=c.options)==null?void 0:U.defaultNS);f=Es(f)?[f]:f||["translation"],(K=(P=c.reportNamespaces).addUsedNamespaces)==null||K.call(P,f);const E=(c.isInitialized||c.initializedStoreOnce)&&f.every(H=>Gw(H,c,d)),p=sC(c,e.lng||null,d.nsMode==="fallback"?f:f[0],g),C=()=>p,I=()=>Tb(c,e.lng||null,d.nsMode==="fallback"?f:f[0],g),[x,T]=w.useState(C);let k=f.join();e.lng&&(k=`${e.lng}${k}`);const R=iC(k),_=w.useRef(!0);w.useEffect(()=>{const{bindI18n:H,bindI18nStore:Q}=d;_.current=!0,!E&&!m&&(e.lng?my(c,e.lng,f,()=>{_.current&&T(I)}):Pg(c,f,()=>{_.current&&T(I)})),E&&R&&R!==k&&_.current&&T(I);const V=()=>{_.current&&T(I)};return H&&(c==null||c.on(H,V)),Q&&(c==null||c.store.on(Q,V)),()=>{_.current=!1,c&&(H==null||H.split(" ").forEach(G=>c.off(G,V))),Q&&c&&Q.split(" ").forEach(G=>c.store.off(G,V))}},[c,k]),w.useEffect(()=>{_.current&&E&&T(C)},[c,g,E]);const S=[x,c,E];if(S.t=x,S.i18n=c,S.ready=E,E||!E&&!m)return S;throw new Promise(H=>{e.lng?my(c,e.lng,f,()=>H()):Pg(c,f,()=>H())})};/**
 * react-router v7.12.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var fy="popstate";function oC(r={}){function e(s,c){let{pathname:d="/",search:m="",hash:g=""}=ws(s.location.hash.substring(1));return!d.startsWith("/")&&!d.startsWith(".")&&(d="/"+d),Qg("",{pathname:d,search:m,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function a(s,c){let d=s.document.querySelector("base"),m="";if(d&&d.getAttribute("href")){let g=s.location.href,f=g.indexOf("#");m=f===-1?g:g.slice(0,f)}return m+"#"+(typeof c=="string"?c:Kl(c))}function i(s,c){Cn(s.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(c)})`)}return cC(e,a,i,r)}function fa(r,e){if(r===!1||r===null||typeof r>"u")throw new Error(e)}function Cn(r,e){if(!r){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function lC(){return Math.random().toString(36).substring(2,10)}function gy(r,e){return{usr:r.state,key:r.key,idx:e}}function Qg(r,e,a=null,i){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof e=="string"?ws(e):e,state:a,key:e&&e.key||i||lC()}}function Kl({pathname:r="/",search:e="",hash:a=""}){return e&&e!=="?"&&(r+=e.charAt(0)==="?"?e:"?"+e),a&&a!=="#"&&(r+=a.charAt(0)==="#"?a:"#"+a),r}function ws(r){let e={};if(r){let a=r.indexOf("#");a>=0&&(e.hash=r.substring(a),r=r.substring(0,a));let i=r.indexOf("?");i>=0&&(e.search=r.substring(i),r=r.substring(0,i)),r&&(e.pathname=r)}return e}function cC(r,e,a,i={}){let{window:s=document.defaultView,v5Compat:c=!1}=i,d=s.history,m="POP",g=null,f=E();f==null&&(f=0,d.replaceState({...d.state,idx:f},""));function E(){return(d.state||{idx:null}).idx}function p(){m="POP";let k=E(),R=k==null?null:k-f;f=k,g&&g({action:m,location:T.location,delta:R})}function C(k,R){m="PUSH";let _=Qg(T.location,k,R);a&&a(_,k),f=E()+1;let S=gy(_,f),O=T.createHref(_);try{d.pushState(S,"",O)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;s.location.assign(O)}c&&g&&g({action:m,location:T.location,delta:1})}function I(k,R){m="REPLACE";let _=Qg(T.location,k,R);a&&a(_,k),f=E();let S=gy(_,f),O=T.createHref(_);d.replaceState(S,"",O),c&&g&&g({action:m,location:T.location,delta:0})}function x(k){return uC(k)}let T={get action(){return m},get location(){return r(s,d)},listen(k){if(g)throw new Error("A history only accepts one active listener");return s.addEventListener(fy,p),g=k,()=>{s.removeEventListener(fy,p),g=null}},createHref(k){return e(s,k)},createURL:x,encodeLocation(k){let R=x(k);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:C,replace:I,go(k){return d.go(k)}};return T}function uC(r,e=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),fa(a,"No window.location.(origin|href) available to create URL");let i=typeof r=="string"?r:Kl(r);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=a+i),new URL(i,a)}function Sb(r,e,a="/"){return dC(r,e,a,!1)}function dC(r,e,a,i){let s=typeof e=="string"?ws(e):e,c=oi(s.pathname||"/",a);if(c==null)return null;let d=kb(r);mC(d);let m=null;for(let g=0;m==null&&g<d.length;++g){let f=wC(c);m=IC(d[g],f,i)}return m}function kb(r,e=[],a=[],i="",s=!1){let c=(d,m,g=s,f)=>{let E={relativePath:f===void 0?d.path||"":f,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(E.relativePath.startsWith("/")){if(!E.relativePath.startsWith(i)&&g)return;fa(E.relativePath.startsWith(i),`Absolute route path "${E.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),E.relativePath=E.relativePath.slice(i.length)}let p=ii([i,E.relativePath]),C=a.concat(E);d.children&&d.children.length>0&&(fa(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),kb(d.children,e,C,p,g)),!(d.path==null&&!d.index)&&e.push({path:p,score:EC(p,d.index),routesMeta:C})};return r.forEach((d,m)=>{var g;if(d.path===""||!((g=d.path)!=null&&g.includes("?")))c(d,m);else for(let f of Lb(d.path))c(d,m,!0,f)}),e}function Lb(r){let e=r.split("/");if(e.length===0)return[];let[a,...i]=e,s=a.endsWith("?"),c=a.replace(/\?$/,"");if(i.length===0)return s?[c,""]:[c];let d=Lb(i.join("/")),m=[];return m.push(...d.map(g=>g===""?c:[c,g].join("/"))),s&&m.push(...d),m.map(g=>r.startsWith("/")&&g===""?"/":g)}function mC(r){r.sort((e,a)=>e.score!==a.score?a.score-e.score:bC(e.routesMeta.map(i=>i.childrenIndex),a.routesMeta.map(i=>i.childrenIndex)))}var fC=/^:[\w-]+$/,gC=3,hC=2,AC=1,pC=10,yC=-2,hy=r=>r==="*";function EC(r,e){let a=r.split("/"),i=a.length;return a.some(hy)&&(i+=yC),e&&(i+=hC),a.filter(s=>!hy(s)).reduce((s,c)=>s+(fC.test(c)?gC:c===""?AC:pC),i)}function bC(r,e){return r.length===e.length&&r.slice(0,-1).every((i,s)=>i===e[s])?r[r.length-1]-e[e.length-1]:0}function IC(r,e,a=!1){let{routesMeta:i}=r,s={},c="/",d=[];for(let m=0;m<i.length;++m){let g=i[m],f=m===i.length-1,E=c==="/"?e:e.slice(c.length)||"/",p=zu({path:g.relativePath,caseSensitive:g.caseSensitive,end:f},E),C=g.route;if(!p&&f&&a&&!i[i.length-1].route.index&&(p=zu({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},E)),!p)return null;Object.assign(s,p.params),d.push({params:s,pathname:ii([c,p.pathname]),pathnameBase:TC(ii([c,p.pathnameBase])),route:C}),p.pathnameBase!=="/"&&(c=ii([c,p.pathnameBase]))}return d}function zu(r,e){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[a,i]=vC(r.path,r.caseSensitive,r.end),s=e.match(a);if(!s)return null;let c=s[0],d=c.replace(/(.)\/+$/,"$1"),m=s.slice(1);return{params:i.reduce((f,{paramName:E,isOptional:p},C)=>{if(E==="*"){let x=m[C]||"";d=c.slice(0,c.length-x.length).replace(/(.)\/+$/,"$1")}const I=m[C];return p&&!I?f[E]=void 0:f[E]=(I||"").replace(/%2F/g,"/"),f},{}),pathname:c,pathnameBase:d,pattern:r}}function vC(r,e=!1,a=!0){Cn(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let i=[],s="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,g)=>(i.push({paramName:m,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(i.push({paramName:"*"}),s+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?s+="\\/*$":r!==""&&r!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),i]}function wC(r){try{return r.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Cn(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),r}}function oi(r,e){if(e==="/")return r;if(!r.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,i=r.charAt(a);return i&&i!=="/"?null:r.slice(a)||"/"}var Rb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,CC=r=>Rb.test(r);function NC(r,e="/"){let{pathname:a,search:i="",hash:s=""}=typeof r=="string"?ws(r):r,c;if(a)if(CC(a))c=a;else{if(a.includes("//")){let d=a;a=a.replace(/\/\/+/g,"/"),Cn(!1,`Pathnames cannot have embedded double slashes - normalizing ${d} -> ${a}`)}a.startsWith("/")?c=Ay(a.substring(1),"/"):c=Ay(a,e)}else c=e;return{pathname:c,search:SC(i),hash:kC(s)}}function Ay(r,e){let a=e.replace(/\/+$/,"").split("/");return r.split("/").forEach(s=>{s===".."?a.length>1&&a.pop():s!=="."&&a.push(s)}),a.length>1?a.join("/"):"/"}function Of(r,e,a,i){return`Cannot include a '${r}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}].  Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xC(r){return r.filter((e,a)=>a===0||e.route.path&&e.route.path.length>0)}function gh(r){let e=xC(r);return e.map((a,i)=>i===e.length-1?a.pathname:a.pathnameBase)}function hh(r,e,a,i=!1){let s;typeof r=="string"?s=ws(r):(s={...r},fa(!s.pathname||!s.pathname.includes("?"),Of("?","pathname","search",s)),fa(!s.pathname||!s.pathname.includes("#"),Of("#","pathname","hash",s)),fa(!s.search||!s.search.includes("#"),Of("#","search","hash",s)));let c=r===""||s.pathname==="",d=c?"/":s.pathname,m;if(d==null)m=a;else{let p=e.length-1;if(!i&&d.startsWith("..")){let C=d.split("/");for(;C[0]==="..";)C.shift(),p-=1;s.pathname=C.join("/")}m=p>=0?e[p]:"/"}let g=NC(s,m),f=d&&d!=="/"&&d.endsWith("/"),E=(c||d===".")&&a.endsWith("/");return!g.pathname.endsWith("/")&&(f||E)&&(g.pathname+="/"),g}var ii=r=>r.join("/").replace(/\/\/+/g,"/"),TC=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),SC=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,kC=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,LC=class{constructor(r,e,a,i=!1){this.status=r,this.statusText=e||"",this.internal=i,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function RC(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function DC(r){return r.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Db=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bb(r,e){let a=r;if(typeof a!="string"||!Rb.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let i=a,s=!1;if(Db)try{let c=new URL(window.location.href),d=a.startsWith("//")?new URL(c.protocol+a):new URL(a),m=oi(d.pathname,e);d.origin===c.origin&&m!=null?a=m+d.search+d.hash:s=!0}catch{Cn(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:s,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ub=["POST","PUT","PATCH","DELETE"];new Set(Ub);var BC=["GET",...Ub];new Set(BC);var bo=w.createContext(null);bo.displayName="DataRouter";var sd=w.createContext(null);sd.displayName="DataRouterState";var UC=w.createContext(!1),_b=w.createContext({isTransitioning:!1});_b.displayName="ViewTransition";var _C=w.createContext(new Map);_C.displayName="Fetchers";var MC=w.createContext(null);MC.displayName="Await";var Fn=w.createContext(null);Fn.displayName="Navigation";var Yl=w.createContext(null);Yl.displayName="Location";var cr=w.createContext({outlet:null,matches:[],isDataRoute:!1});cr.displayName="Route";var Ah=w.createContext(null);Ah.displayName="RouteError";var Mb="REACT_ROUTER_ERROR",FC="REDIRECT",OC="ROUTE_ERROR_RESPONSE";function jC(r){if(r.startsWith(`${Mb}:${FC}:{`))try{let e=JSON.parse(r.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function PC(r){if(r.startsWith(`${Mb}:${OC}:{`))try{let e=JSON.parse(r.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new LC(e.status,e.statusText,e.data)}catch{}}function HC(r,{relative:e}={}){fa(Io(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:i}=w.useContext(Fn),{hash:s,pathname:c,search:d}=Jl(r,{relative:e}),m=c;return a!=="/"&&(m=c==="/"?a:ii([a,c])),i.createHref({pathname:m,search:d,hash:s})}function Io(){return w.useContext(Yl)!=null}function tn(){return fa(Io(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Yl).location}var Fb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ob(r){w.useContext(Fn).static||w.useLayoutEffect(r)}function La(){let{isDataRoute:r}=w.useContext(cr);return r?eN():QC()}function QC(){fa(Io(),"useNavigate() may be used only in the context of a <Router> component.");let r=w.useContext(bo),{basename:e,navigator:a}=w.useContext(Fn),{matches:i}=w.useContext(cr),{pathname:s}=tn(),c=JSON.stringify(gh(i)),d=w.useRef(!1);return Ob(()=>{d.current=!0}),w.useCallback((g,f={})=>{if(Cn(d.current,Fb),!d.current)return;if(typeof g=="number"){a.go(g);return}let E=hh(g,JSON.parse(c),s,f.relative==="path");r==null&&e!=="/"&&(E.pathname=E.pathname==="/"?e:ii([e,E.pathname])),(f.replace?a.replace:a.push)(E,f.state,f)},[e,a,c,s,r])}w.createContext(null);function od(){let{matches:r}=w.useContext(cr),e=r[r.length-1];return e?e.params:{}}function Jl(r,{relative:e}={}){let{matches:a}=w.useContext(cr),{pathname:i}=tn(),s=JSON.stringify(gh(a));return w.useMemo(()=>hh(r,JSON.parse(s),i,e==="path"),[r,s,i,e])}function zC(r,e){return jb(r,e)}function jb(r,e,a,i,s){var _;fa(Io(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=w.useContext(Fn),{matches:d}=w.useContext(cr),m=d[d.length-1],g=m?m.params:{},f=m?m.pathname:"/",E=m?m.pathnameBase:"/",p=m&&m.route;{let S=p&&p.path||"";Hb(f,!p||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let C=tn(),I;if(e){let S=typeof e=="string"?ws(e):e;fa(E==="/"||((_=S.pathname)==null?void 0:_.startsWith(E)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${E}" but pathname "${S.pathname}" was given in the \`location\` prop.`),I=S}else I=C;let x=I.pathname||"/",T=x;if(E!=="/"){let S=E.replace(/^\//,"").split("/");T="/"+x.replace(/^\//,"").split("/").slice(S.length).join("/")}let k=Sb(r,{pathname:T});Cn(p||k!=null,`No routes matched location "${I.pathname}${I.search}${I.hash}" `),Cn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${I.pathname}${I.search}${I.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=WC(k&&k.map(S=>Object.assign({},S,{params:Object.assign({},g,S.params),pathname:ii([E,c.encodeLocation?c.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?E:ii([E,c.encodeLocation?c.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),d,a,i,s);return e&&R?w.createElement(Yl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...I},navigationType:"POP"}},R):R}function VC(){let r=ZC(),e=RC(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),a=r instanceof Error?r.stack:null,i="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:i},c={padding:"2px 4px",backgroundColor:i},d=null;return console.error("Error handled by React Router default ErrorBoundary:",r),d=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:c},"ErrorBoundary")," or"," ",w.createElement("code",{style:c},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),a?w.createElement("pre",{style:s},a):null,d)}var KC=w.createElement(VC,null),Pb=class extends w.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,e){return e.location!==r.location||e.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:e.error,location:e.location,revalidation:r.revalidation||e.revalidation}}componentDidCatch(r,e){this.props.onError?this.props.onError(r,e):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const a=PC(r.digest);a&&(r=a)}let e=r!==void 0?w.createElement(cr.Provider,{value:this.props.routeContext},w.createElement(Ah.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?w.createElement(GC,{error:r},e):e}};Pb.contextType=UC;var jf=new WeakMap;function GC({children:r,error:e}){let{basename:a}=w.useContext(Fn);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=jC(e.digest);if(i){let s=jf.get(e);if(s)throw s;let c=Bb(i.location,a);if(Db&&!jf.get(e))if(c.isExternal||i.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:i.replace}));throw jf.set(e,d),d}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return r}function qC({routeContext:r,match:e,children:a}){let i=w.useContext(bo);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),w.createElement(cr.Provider,{value:r},a)}function WC(r,e=[],a=null,i=null,s=null){if(r==null){if(!a)return null;if(a.errors)r=a.matches;else if(e.length===0&&!a.initialized&&a.matches.length>0)r=a.matches;else return null}let c=r,d=a==null?void 0:a.errors;if(d!=null){let E=c.findIndex(p=>p.route.id&&(d==null?void 0:d[p.route.id])!==void 0);fa(E>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,E+1))}let m=!1,g=-1;if(a)for(let E=0;E<c.length;E++){let p=c[E];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(g=E),p.route.id){let{loaderData:C,errors:I}=a,x=p.route.loader&&!C.hasOwnProperty(p.route.id)&&(!I||I[p.route.id]===void 0);if(p.route.lazy||x){m=!0,g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}let f=a&&i?(E,p)=>{var C,I;i(E,{location:a.location,params:((I=(C=a.matches)==null?void 0:C[0])==null?void 0:I.params)??{},unstable_pattern:DC(a.matches),errorInfo:p})}:void 0;return c.reduceRight((E,p,C)=>{let I,x=!1,T=null,k=null;a&&(I=d&&p.route.id?d[p.route.id]:void 0,T=p.route.errorElement||KC,m&&(g<0&&C===0?(Hb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,k=null):g===C&&(x=!0,k=p.route.hydrateFallbackElement||null)));let R=e.concat(c.slice(0,C+1)),_=()=>{let S;return I?S=T:x?S=k:p.route.Component?S=w.createElement(p.route.Component,null):p.route.element?S=p.route.element:S=E,w.createElement(qC,{match:p,routeContext:{outlet:E,matches:R,isDataRoute:a!=null},children:S})};return a&&(p.route.ErrorBoundary||p.route.errorElement||C===0)?w.createElement(Pb,{location:a.location,revalidation:a.revalidation,component:T,error:I,children:_(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:f}):_()},null)}function ph(r){return`${r} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function YC(r){let e=w.useContext(bo);return fa(e,ph(r)),e}function JC(r){let e=w.useContext(sd);return fa(e,ph(r)),e}function XC(r){let e=w.useContext(cr);return fa(e,ph(r)),e}function yh(r){let e=XC(r),a=e.matches[e.matches.length-1];return fa(a.route.id,`${r} can only be used on routes that contain a unique "id"`),a.route.id}function $C(){return yh("useRouteId")}function ZC(){var i;let r=w.useContext(Ah),e=JC("useRouteError"),a=yh("useRouteError");return r!==void 0?r:(i=e.errors)==null?void 0:i[a]}function eN(){let{router:r}=YC("useNavigate"),e=yh("useNavigate"),a=w.useRef(!1);return Ob(()=>{a.current=!0}),w.useCallback(async(s,c={})=>{Cn(a.current,Fb),a.current&&(typeof s=="number"?await r.navigate(s):await r.navigate(s,{fromRouteId:e,...c}))},[r,e])}var py={};function Hb(r,e,a){!e&&!py[r]&&(py[r]=!0,Cn(!1,a))}w.memo(tN);function tN({routes:r,future:e,state:a,onError:i}){return jb(r,void 0,a,i,e)}function aN({to:r,replace:e,state:a,relative:i}){fa(Io(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=w.useContext(Fn);Cn(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:c}=w.useContext(cr),{pathname:d}=tn(),m=La(),g=hh(r,gh(c),d,i==="path"),f=JSON.stringify(g);return w.useEffect(()=>{m(JSON.parse(f),{replace:e,state:a,relative:i})},[m,f,i,e,a]),null}function Eh(r){fa(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function nN({basename:r="/",children:e=null,location:a,navigationType:i="POP",navigator:s,static:c=!1,unstable_useTransitions:d}){fa(!Io(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=r.replace(/^\/*/,"/"),g=w.useMemo(()=>({basename:m,navigator:s,static:c,unstable_useTransitions:d,future:{}}),[m,s,c,d]);typeof a=="string"&&(a=ws(a));let{pathname:f="/",search:E="",hash:p="",state:C=null,key:I="default"}=a,x=w.useMemo(()=>{let T=oi(f,m);return T==null?null:{location:{pathname:T,search:E,hash:p,state:C,key:I},navigationType:i}},[m,f,E,p,C,I,i]);return Cn(x!=null,`<Router basename="${m}"> is not able to match the URL "${f}${E}${p}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:w.createElement(Fn.Provider,{value:g},w.createElement(Yl.Provider,{children:e,value:x}))}function Qb({children:r,location:e}){return zC(zg(r),e)}function zg(r,e=[]){let a=[];return w.Children.forEach(r,(i,s)=>{if(!w.isValidElement(i))return;let c=[...e,s];if(i.type===w.Fragment){a.push.apply(a,zg(i.props.children,c));return}fa(i.type===Eh,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),fa(!i.props.index||!i.props.children,"An index route cannot have child routes.");let d={id:i.props.id||c.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(d.children=zg(i.props.children,c)),a.push(d)}),a}var Lu="get",Ru="application/x-www-form-urlencoded";function ld(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function rN(r){return ld(r)&&r.tagName.toLowerCase()==="button"}function iN(r){return ld(r)&&r.tagName.toLowerCase()==="form"}function sN(r){return ld(r)&&r.tagName.toLowerCase()==="input"}function oN(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function lN(r,e){return r.button===0&&(!e||e==="_self")&&!oN(r)}function Vg(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((e,a)=>{let i=r[a];return e.concat(Array.isArray(i)?i.map(s=>[a,s]):[[a,i]])},[]))}function cN(r,e){let a=Vg(r);return e&&e.forEach((i,s)=>{a.has(s)||e.getAll(s).forEach(c=>{a.append(s,c)})}),a}var cu=null;function uN(){if(cu===null)try{new FormData(document.createElement("form"),0),cu=!1}catch{cu=!0}return cu}var dN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pf(r){return r!=null&&!dN.has(r)?(Cn(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ru}"`),null):r}function mN(r,e){let a,i,s,c,d;if(iN(r)){let m=r.getAttribute("action");i=m?oi(m,e):null,a=r.getAttribute("method")||Lu,s=Pf(r.getAttribute("enctype"))||Ru,c=new FormData(r)}else if(rN(r)||sN(r)&&(r.type==="submit"||r.type==="image")){let m=r.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=r.getAttribute("formaction")||m.getAttribute("action");if(i=g?oi(g,e):null,a=r.getAttribute("formmethod")||m.getAttribute("method")||Lu,s=Pf(r.getAttribute("formenctype"))||Pf(m.getAttribute("enctype"))||Ru,c=new FormData(m,r),!uN()){let{name:f,type:E,value:p}=r;if(E==="image"){let C=f?`${f}.`:"";c.append(`${C}x`,"0"),c.append(`${C}y`,"0")}else f&&c.append(f,p)}}else{if(ld(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Lu,i=null,s=Ru,d=r}return c&&s==="text/plain"&&(d=c,c=void 0),{action:i,method:a.toLowerCase(),encType:s,formData:c,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function bh(r,e){if(r===!1||r===null||typeof r>"u")throw new Error(e)}function fN(r,e,a,i){let s=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return a?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${i}`:s.pathname=`${s.pathname}.${i}`:s.pathname==="/"?s.pathname=`_root.${i}`:e&&oi(s.pathname,e)==="/"?s.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${i}`,s}async function gN(r,e){if(r.id in e)return e[r.id];try{let a=await import(r.module);return e[r.id]=a,a}catch(a){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function hN(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function AN(r,e,a){let i=await Promise.all(r.map(async s=>{let c=e.routes[s.route.id];if(c){let d=await gN(c,a);return d.links?d.links():[]}return[]}));return bN(i.flat(1).filter(hN).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function yy(r,e,a,i,s,c){let d=(g,f)=>a[f]?g.route.id!==a[f].route.id:!0,m=(g,f)=>{var E;return a[f].pathname!==g.pathname||((E=a[f].route.path)==null?void 0:E.endsWith("*"))&&a[f].params["*"]!==g.params["*"]};return c==="assets"?e.filter((g,f)=>d(g,f)||m(g,f)):c==="data"?e.filter((g,f)=>{var p;let E=i.routes[g.route.id];if(!E||!E.hasLoader)return!1;if(d(g,f)||m(g,f))return!0;if(g.route.shouldRevalidate){let C=g.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=a[0])==null?void 0:p.params)||{},nextUrl:new URL(r,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function pN(r,e,{includeHydrateFallback:a}={}){return yN(r.map(i=>{let s=e.routes[i.route.id];if(!s)return[];let c=[s.module];return s.clientActionModule&&(c=c.concat(s.clientActionModule)),s.clientLoaderModule&&(c=c.concat(s.clientLoaderModule)),a&&s.hydrateFallbackModule&&(c=c.concat(s.hydrateFallbackModule)),s.imports&&(c=c.concat(s.imports)),c}).flat(1))}function yN(r){return[...new Set(r)]}function EN(r){let e={},a=Object.keys(r).sort();for(let i of a)e[i]=r[i];return e}function bN(r,e){let a=new Set;return new Set(e),r.reduce((i,s)=>{let c=JSON.stringify(EN(s));return a.has(c)||(a.add(c),i.push({key:c,link:s})),i},[])}function zb(){let r=w.useContext(bo);return bh(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function IN(){let r=w.useContext(sd);return bh(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var Ih=w.createContext(void 0);Ih.displayName="FrameworkContext";function Vb(){let r=w.useContext(Ih);return bh(r,"You must render this element inside a <HydratedRouter> element"),r}function vN(r,e){let a=w.useContext(Ih),[i,s]=w.useState(!1),[c,d]=w.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:f,onMouseLeave:E,onTouchStart:p}=e,C=w.useRef(null);w.useEffect(()=>{if(r==="render"&&d(!0),r==="viewport"){let T=R=>{R.forEach(_=>{d(_.isIntersecting)})},k=new IntersectionObserver(T,{threshold:.5});return C.current&&k.observe(C.current),()=>{k.disconnect()}}},[r]),w.useEffect(()=>{if(i){let T=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(T)}}},[i]);let I=()=>{s(!0)},x=()=>{s(!1),d(!1)};return a?r!=="intent"?[c,C,{}]:[c,C,{onFocus:Il(m,I),onBlur:Il(g,x),onMouseEnter:Il(f,I),onMouseLeave:Il(E,x),onTouchStart:Il(p,I)}]:[!1,C,{}]}function Il(r,e){return a=>{r&&r(a),a.defaultPrevented||e(a)}}function wN({page:r,...e}){let{router:a}=zb(),i=w.useMemo(()=>Sb(a.routes,r,a.basename),[a.routes,r,a.basename]);return i?w.createElement(NN,{page:r,matches:i,...e}):null}function CN(r){let{manifest:e,routeModules:a}=Vb(),[i,s]=w.useState([]);return w.useEffect(()=>{let c=!1;return AN(r,e,a).then(d=>{c||s(d)}),()=>{c=!0}},[r,e,a]),i}function NN({page:r,matches:e,...a}){let i=tn(),{future:s,manifest:c,routeModules:d}=Vb(),{basename:m}=zb(),{loaderData:g,matches:f}=IN(),E=w.useMemo(()=>yy(r,e,f,c,i,"data"),[r,e,f,c,i]),p=w.useMemo(()=>yy(r,e,f,c,i,"assets"),[r,e,f,c,i]),C=w.useMemo(()=>{if(r===i.pathname+i.search+i.hash)return[];let T=new Set,k=!1;if(e.forEach(_=>{var O;let S=c.routes[_.route.id];!S||!S.hasLoader||(!E.some(U=>U.route.id===_.route.id)&&_.route.id in g&&((O=d[_.route.id])!=null&&O.shouldRevalidate)||S.hasClientLoader?k=!0:T.add(_.route.id))}),T.size===0)return[];let R=fN(r,m,s.unstable_trailingSlashAwareDataRequests,"data");return k&&T.size>0&&R.searchParams.set("_routes",e.filter(_=>T.has(_.route.id)).map(_=>_.route.id).join(",")),[R.pathname+R.search]},[m,s.unstable_trailingSlashAwareDataRequests,g,i,c,E,e,r,d]),I=w.useMemo(()=>pN(p,c),[p,c]),x=CN(p);return w.createElement(w.Fragment,null,C.map(T=>w.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...a})),I.map(T=>w.createElement("link",{key:T,rel:"modulepreload",href:T,...a})),x.map(({key:T,link:k})=>w.createElement("link",{key:T,nonce:a.nonce,...k})))}function xN(...r){return e=>{r.forEach(a=>{typeof a=="function"?a(e):a!=null&&(a.current=e)})}}var TN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{TN&&(window.__reactRouterVersion="7.12.0")}catch{}function SN({basename:r,children:e,unstable_useTransitions:a,window:i}){let s=w.useRef();s.current==null&&(s.current=oC({window:i,v5Compat:!0}));let c=s.current,[d,m]=w.useState({action:c.action,location:c.location}),g=w.useCallback(f=>{a===!1?m(f):w.startTransition(()=>m(f))},[a]);return w.useLayoutEffect(()=>c.listen(g),[c,g]),w.createElement(nN,{basename:r,children:e,location:d.location,navigationType:d.action,navigator:c,unstable_useTransitions:a})}var Kb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cd=w.forwardRef(function({onClick:e,discover:a="render",prefetch:i="none",relative:s,reloadDocument:c,replace:d,state:m,target:g,to:f,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:C,...I},x){let{basename:T,unstable_useTransitions:k}=w.useContext(Fn),R=typeof f=="string"&&Kb.test(f),_=Bb(f,T);f=_.to;let S=HC(f,{relative:s}),[O,U,P]=vN(i,I),K=DN(f,{replace:d,state:m,target:g,preventScrollReset:E,relative:s,viewTransition:p,unstable_defaultShouldRevalidate:C,unstable_useTransitions:k});function H(V){e&&e(V),V.defaultPrevented||K(V)}let Q=w.createElement("a",{...I,...P,href:_.absoluteURL||S,onClick:_.isExternal||c?e:H,ref:xN(x,U),target:g,"data-discover":!R&&a==="render"?"true":void 0});return O&&!R?w.createElement(w.Fragment,null,Q,w.createElement(wN,{page:S})):Q});cd.displayName="Link";var kN=w.forwardRef(function({"aria-current":e="page",caseSensitive:a=!1,className:i="",end:s=!1,style:c,to:d,viewTransition:m,children:g,...f},E){let p=Jl(d,{relative:f.relative}),C=tn(),I=w.useContext(sd),{navigator:x,basename:T}=w.useContext(Fn),k=I!=null&&FN(p)&&m===!0,R=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,_=C.pathname,S=I&&I.navigation&&I.navigation.location?I.navigation.location.pathname:null;a||(_=_.toLowerCase(),S=S?S.toLowerCase():null,R=R.toLowerCase()),S&&T&&(S=oi(S,T)||S);const O=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let U=_===R||!s&&_.startsWith(R)&&_.charAt(O)==="/",P=S!=null&&(S===R||!s&&S.startsWith(R)&&S.charAt(R.length)==="/"),K={isActive:U,isPending:P,isTransitioning:k},H=U?e:void 0,Q;typeof i=="function"?Q=i(K):Q=[i,U?"active":null,P?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let V=typeof c=="function"?c(K):c;return w.createElement(cd,{...f,"aria-current":H,className:Q,ref:E,style:V,to:d,viewTransition:m},typeof g=="function"?g(K):g)});kN.displayName="NavLink";var LN=w.forwardRef(({discover:r="render",fetcherKey:e,navigate:a,reloadDocument:i,replace:s,state:c,method:d=Lu,action:m,onSubmit:g,relative:f,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:C,...I},x)=>{let{unstable_useTransitions:T}=w.useContext(Fn),k=_N(),R=MN(m,{relative:f}),_=d.toLowerCase()==="get"?"get":"post",S=typeof m=="string"&&Kb.test(m),O=U=>{if(g&&g(U),U.defaultPrevented)return;U.preventDefault();let P=U.nativeEvent.submitter,K=(P==null?void 0:P.getAttribute("formmethod"))||d,H=()=>k(P||U.currentTarget,{fetcherKey:e,method:K,navigate:a,replace:s,state:c,relative:f,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:C});T&&a!==!1?w.startTransition(()=>H()):H()};return w.createElement("form",{ref:x,method:_,action:R,onSubmit:i?g:O,...I,"data-discover":!S&&r==="render"?"true":void 0})});LN.displayName="Form";function RN(r){return`${r} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gb(r){let e=w.useContext(bo);return fa(e,RN(r)),e}function DN(r,{target:e,replace:a,state:i,preventScrollReset:s,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let f=La(),E=tn(),p=Jl(r,{relative:c});return w.useCallback(C=>{if(lN(C,e)){C.preventDefault();let I=a!==void 0?a:Kl(E)===Kl(p),x=()=>f(r,{replace:I,state:i,preventScrollReset:s,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:m});g?w.startTransition(()=>x()):x()}},[E,f,p,a,i,e,r,s,c,d,m,g])}function qb(r){Cn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=w.useRef(Vg(r)),a=w.useRef(!1),i=tn(),s=w.useMemo(()=>cN(i.search,a.current?null:e.current),[i.search]),c=La(),d=w.useCallback((m,g)=>{const f=Vg(typeof m=="function"?m(new URLSearchParams(s)):m);a.current=!0,c("?"+f,g)},[c,s]);return[s,d]}var BN=0,UN=()=>`__${String(++BN)}__`;function _N(){let{router:r}=Gb("useSubmit"),{basename:e}=w.useContext(Fn),a=$C(),i=r.fetch,s=r.navigate;return w.useCallback(async(c,d={})=>{let{action:m,method:g,encType:f,formData:E,body:p}=mN(c,e);if(d.navigate===!1){let C=d.fetcherKey||UN();await i(C,a,d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:E,body:p,formMethod:d.method||g,formEncType:d.encType||f,flushSync:d.flushSync})}else await s(d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:E,body:p,formMethod:d.method||g,formEncType:d.encType||f,replace:d.replace,state:d.state,fromRouteId:a,flushSync:d.flushSync,viewTransition:d.viewTransition})},[i,s,e,a])}function MN(r,{relative:e}={}){let{basename:a}=w.useContext(Fn),i=w.useContext(cr);fa(i,"useFormAction must be used inside a RouteContext");let[s]=i.matches.slice(-1),c={...Jl(r||".",{relative:e})},d=tn();if(r==null){c.search=d.search;let m=new URLSearchParams(c.search),g=m.getAll("index");if(g.some(E=>E==="")){m.delete("index"),g.filter(p=>p).forEach(p=>m.append("index",p));let E=m.toString();c.search=E?`?${E}`:""}}return(!r||r===".")&&s.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:ii([a,c.pathname])),Kl(c)}function FN(r,{relative:e}={}){let a=w.useContext(_b);fa(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Gb("useViewTransitionState"),s=Jl(r,{relative:e});if(!a.isTransitioning)return!1;let c=oi(a.currentLocation.pathname,i)||a.currentLocation.pathname,d=oi(a.nextLocation.pathname,i)||a.nextLocation.pathname;return zu(s.pathname,d)!=null||zu(s.pathname,c)!=null}var uu={exports:{}},Ey;function ON(){if(Ey)return uu.exports;Ey=1;const r=a=>typeof crypto<"u"&&typeof crypto.getRandomValues=="function"?()=>{const i=crypto.getRandomValues(new Uint8Array(1))[0];return(i>=a?i%a:i).toString(a)}:()=>Math.floor(Math.random()*a).toString(a),e=(a=7,i=!1)=>Array.from({length:a},r(i?16:36)).join("");return uu.exports=e,uu.exports.default=e,uu.exports}var jN=ON();const Vu=qi(jN);var PN=()=>`uid::${Vu(7)}`,HN=(r,e=["endpointName","fingerprint"])=>typeof r=="object"&&r!==null&&e.every(a=>a in r),QN=r=>{if(!HN(r))throw new TypeError("Invalid connection args");return JSON.stringify(r)},zN=()=>{let r=[];return{add:(...e)=>{r=[...r,...e]},remove:e=>{r=typeof e=="string"?r.filter(a=>a.message.transactionId!==e):r.filter(a=>!e.includes(a))},entries:()=>r}},Hf=class{static toBackground(r,e){return r.postMessage(e)}static toExtensionContext(r,e){return r.postMessage(e)}},Du={exports:{}},VN=Du.exports,by;function KN(){return by||(by=1,function(r,e){(function(a,i){i(r)})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:VN,function(a){if(typeof globalThis!="object"||typeof chrome!="object"||!chrome||!chrome.runtime||!chrome.runtime.id)throw new Error("This script should only be loaded in a browser extension.");if(typeof globalThis.browser>"u"||Object.getPrototypeOf(globalThis.browser)!==Object.prototype){const i="The message port closed before a response was received.",s="Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)",c=d=>{const m={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(Object.keys(m).length===0)throw new Error("api-metadata.json has not been included in browser-polyfill");class g extends WeakMap{constructor(Q,V=void 0){super(V),this.createItem=Q}get(Q){return this.has(Q)||this.set(Q,this.createItem(Q)),super.get(Q)}}const f=H=>H&&typeof H=="object"&&typeof H.then=="function",E=(H,Q)=>(...V)=>{d.runtime.lastError?H.reject(new Error(d.runtime.lastError.message)):Q.singleCallbackArg||V.length<=1&&Q.singleCallbackArg!==!1?H.resolve(V[0]):H.resolve(V)},p=H=>H==1?"argument":"arguments",C=(H,Q)=>function(G,...q){if(q.length<Q.minArgs)throw new Error(`Expected at least ${Q.minArgs} ${p(Q.minArgs)} for ${H}(), got ${q.length}`);if(q.length>Q.maxArgs)throw new Error(`Expected at most ${Q.maxArgs} ${p(Q.maxArgs)} for ${H}(), got ${q.length}`);return new Promise((W,ne)=>{if(Q.fallbackToNoCallback)try{G[H](...q,E({resolve:W,reject:ne},Q))}catch(me){console.warn(`${H} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,me),G[H](...q),Q.fallbackToNoCallback=!1,Q.noCallback=!0,W()}else Q.noCallback?(G[H](...q),W()):G[H](...q,E({resolve:W,reject:ne},Q))})},I=(H,Q,V)=>new Proxy(Q,{apply(G,q,W){return V.call(q,H,...W)}});let x=Function.call.bind(Object.prototype.hasOwnProperty);const T=(H,Q={},V={})=>{let G=Object.create(null),q={has(ne,me){return me in H||me in G},get(ne,me,$){if(me in G)return G[me];if(!(me in H))return;let re=H[me];if(typeof re=="function")if(typeof Q[me]=="function")re=I(H,H[me],Q[me]);else if(x(V,me)){let ye=C(me,V[me]);re=I(H,H[me],ye)}else re=re.bind(H);else if(typeof re=="object"&&re!==null&&(x(Q,me)||x(V,me)))re=T(re,Q[me],V[me]);else if(x(V,"*"))re=T(re,Q[me],V["*"]);else return Object.defineProperty(G,me,{configurable:!0,enumerable:!0,get(){return H[me]},set(ye){H[me]=ye}}),re;return G[me]=re,re},set(ne,me,$,re){return me in G?G[me]=$:H[me]=$,!0},defineProperty(ne,me,$){return Reflect.defineProperty(G,me,$)},deleteProperty(ne,me){return Reflect.deleteProperty(G,me)}},W=Object.create(H);return new Proxy(W,q)},k=H=>({addListener(Q,V,...G){Q.addListener(H.get(V),...G)},hasListener(Q,V){return Q.hasListener(H.get(V))},removeListener(Q,V){Q.removeListener(H.get(V))}}),R=new g(H=>typeof H!="function"?H:function(V){const G=T(V,{},{getContent:{minArgs:0,maxArgs:0}});H(G)});let _=!1;const S=new g(H=>typeof H!="function"?H:function(V,G,q){let W=!1,ne,me=new Promise(Ae=>{ne=function(j){_||(console.warn(s,new Error().stack),_=!0),W=!0,Ae(j)}}),$;try{$=H(V,G,ne)}catch(Ae){$=Promise.reject(Ae)}const re=$!==!0&&f($);if($!==!0&&!re&&!W)return!1;const ye=Ae=>{Ae.then(j=>{q(j)},j=>{let X;j&&(j instanceof Error||typeof j.message=="string")?X=j.message:X="An unexpected error occurred",q({__mozWebExtensionPolyfillReject__:!0,message:X})}).catch(j=>{console.error("Failed to send onMessage rejected reply",j)})};return ye(re?$:me),!0}),O=({reject:H,resolve:Q},V)=>{d.runtime.lastError?d.runtime.lastError.message===i?Q():H(new Error(d.runtime.lastError.message)):V&&V.__mozWebExtensionPolyfillReject__?H(new Error(V.message)):Q(V)},U=(H,Q,V,...G)=>{if(G.length<Q.minArgs)throw new Error(`Expected at least ${Q.minArgs} ${p(Q.minArgs)} for ${H}(), got ${G.length}`);if(G.length>Q.maxArgs)throw new Error(`Expected at most ${Q.maxArgs} ${p(Q.maxArgs)} for ${H}(), got ${G.length}`);return new Promise((q,W)=>{const ne=O.bind(null,{resolve:q,reject:W});G.push(ne),V.sendMessage(...G)})},P={devtools:{network:{onRequestFinished:k(R)}},runtime:{onMessage:k(S),onMessageExternal:k(S),sendMessage:U.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:U.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},K={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return m.privacy={network:{"*":K},services:{"*":K},websites:{"*":K}},T(d,P,m)};a.exports=c(chrome)}else a.exports=globalThis.browser})}(Du)),Du.exports}var GN=KN();const qN=qi(GN);var WN=(r="")=>{const e=PN();let a,i=[];const s=zN(),c=new Set,d=new Set,m=(f,E)=>{switch(f.status){case"undeliverable":i.some(p=>p.message.messageID===f.message.messageID)||(i=[...i,{message:f.message,resolvedDestination:f.resolvedDestination}]);return;case"deliverable":i=i.reduce((p,C)=>C.resolvedDestination===f.deliverableTo?(Hf.toBackground(E,{type:"deliver",message:C.message}),p):[...p,C],[]);return;case"delivered":f.receipt.message.messageType==="message"&&s.add(f.receipt);return;case"incoming":f.message.messageType==="reply"&&s.remove(f.message.messageID),c.forEach(p=>p(f.message,E));return;case"terminated":{const p=s.entries().filter(C=>f.fingerprint===C.to);s.remove(p),p.forEach(({message:C})=>d.forEach(I=>I(C)))}}},g=()=>{a=qN.runtime.connect({name:QN({endpointName:r,fingerprint:e})}),a.onMessage.addListener(m),a.onDisconnect.addListener(g),Hf.toBackground(a,{type:"sync",pendingResponses:s.entries(),pendingDeliveries:[...new Set(i.map(({resolvedDestination:f})=>f))]})};return g(),{onFailure(f){d.add(f)},onMessage(f){c.add(f)},postMessage(f){Hf.toBackground(a,{type:"deliver",message:f})}}},YN=Object.defineProperty,JN=Object.defineProperties,XN=Object.getOwnPropertyDescriptors,Iy=Object.getOwnPropertySymbols,$N=Object.prototype.hasOwnProperty,ZN=Object.prototype.propertyIsEnumerable,vy=(r,e,a)=>e in r?YN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Wb=(r,e)=>{for(var a in e||(e={}))$N.call(e,a)&&vy(r,a,e[a]);if(Iy)for(var a of Iy(e))ZN.call(e,a)&&vy(r,a,e[a]);return r},Yb=(r,e)=>JN(r,XN(e)),ex=/^((?:background$)|devtools|popup|options|content-script|window)(?:@(\d+)(?:\.(\d+))?)?$/,Jb=r=>{const[,e,a,i]=r.match(ex)||[];return{context:e,tabId:+a,frameId:i?+i:void 0}};const tx=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],Kg=Symbol(".toJSON was called"),ax=r=>{r[Kg]=!0;const e=r.toJSON();return delete r[Kg],e},Xb=({from:r,seen:e,to_:a,forceEnumerable:i,maxDepth:s,depth:c})=>{const d=a||(Array.isArray(r)?[]:{});if(e.push(r),c>=s)return d;if(typeof r.toJSON=="function"&&r[Kg]!==!0)return ax(r);for(const[m,g]of Object.entries(r)){if(typeof Buffer=="function"&&Buffer.isBuffer(g)){d[m]="[object Buffer]";continue}if(g!==null&&typeof g=="object"&&typeof g.pipe=="function"){d[m]="[object Stream]";continue}if(typeof g!="function"){if(!g||typeof g!="object"){d[m]=g;continue}if(!e.includes(r[m])){c++,d[m]=Xb({from:r[m],seen:[...e],forceEnumerable:i,maxDepth:s,depth:c});continue}d[m]="[Circular]"}}for(const{property:m,enumerable:g}of tx)typeof r[m]=="string"&&Object.defineProperty(d,m,{value:r[m],enumerable:!0,configurable:!0,writable:!0});return d};function nx(r,e={}){const{maxDepth:a=Number.POSITIVE_INFINITY}=e;return typeof r=="object"&&r!==null?Xb({from:r,seen:[],forceEnumerable:!0,maxDepth:a,depth:0}):typeof r=="function"?`[Function: ${r.name||"anonymous"}]`:r}let $b=()=>({events:{},emit(r,...e){(this.events[r]||[]).forEach(a=>a(...e))},on(r,e){return(this.events[r]=this.events[r]||[]).push(e),()=>this.events[r]=(this.events[r]||[]).filter(a=>a!==e)}});var rx=(r,e,a)=>{const i=Vu(),s=new Map,c=new Map,d=m=>{if(m.destination.context===r&&!m.destination.frameId&&!m.destination.tabId){const{transactionId:g,messageID:f,messageType:E}=m,p=()=>{const I=s.get(g);if(I){const{err:x,data:T}=m;if(x){const k=x,R=self[k.name],_=new(typeof R=="function"?R:Error)(k.message);for(const S in k)_[S]=k[S];I.reject(_)}else I.resolve(T);s.delete(g)}},C=async()=>{let I,x,T=!1;try{const k=c.get(f);if(typeof k=="function")I=await k({sender:m.origin,id:f,data:m.data,timestamp:m.timestamp});else throw T=!0,new Error(`[webext-bridge] No handler registered in '${r}' to accept messages with id '${f}'`)}catch(k){x=k}finally{if(x&&(m.err=nx(x)),d(Yb(Wb({},m),{messageType:"reply",data:I,origin:{context:r,tabId:null},destination:m.origin,hops:[]})),x&&!T)throw I}};switch(E){case"reply":return p();case"message":return C()}}return m.hops.push(`${r}::${i}`),e(m)};return{handleMessage:d,endTransaction:m=>{const g=s.get(m);g==null||g.reject("Transaction was ended before it could complete"),s.delete(m)},sendMessage:(m,g,f="background")=>{const E=typeof f=="string"?Jb(f):f,p="Bridge#sendMessage ->";if(!E.context)throw new TypeError(`${p} Destination must be any one of known destinations`);return new Promise((C,I)=>{const x={messageID:m,data:g,destination:E,messageType:"message",transactionId:Vu(),origin:{context:r,tabId:null},hops:[],timestamp:Date.now()};s.set(x.transactionId,{resolve:C,reject:I});try{d(x)}catch(T){s.delete(x.transactionId),I(T)}})},onMessage:(m,g)=>(c.set(m,g),()=>c.delete(m))}},uo=class{constructor(r,e){this.endpointRuntime=r,this.streamInfo=e,this.emitter=$b(),this.isClosed=!1,this.handleStreamClose=()=>{this.isClosed||(this.isClosed=!0,this.emitter.emit("closed",!0),this.emitter.events={})},uo.initDone||(r.onMessage("__crx_bridge_stream_transfer__",a=>{const{streamId:i,streamTransfer:s,action:c}=a.data,d=uo.openStreams.get(i);d&&!d.isClosed&&(c==="transfer"&&d.emitter.emit("message",s),c==="close"&&(uo.openStreams.delete(i),d.handleStreamClose()))}),uo.initDone=!0),uo.openStreams.set(this.streamInfo.streamId,this)}get info(){return this.streamInfo}send(r){if(this.isClosed)throw new Error("Attempting to send a message over closed stream. Use stream.onClose(<callback>) to keep an eye on stream status");this.endpointRuntime.sendMessage("__crx_bridge_stream_transfer__",{streamId:this.streamInfo.streamId,streamTransfer:r,action:"transfer"},this.streamInfo.endpoint)}close(r){r&&this.send(r),this.handleStreamClose(),this.endpointRuntime.sendMessage("__crx_bridge_stream_transfer__",{streamId:this.streamInfo.streamId,streamTransfer:null,action:"close"},this.streamInfo.endpoint)}onMessage(r){return this.getDisposable("message",r)}onClose(r){return this.getDisposable("closed",r)}getDisposable(r,e){const a=this.emitter.on(r,e);return Object.assign(a,{dispose:a,close:a})}},Ku=uo;Ku.initDone=!1;Ku.openStreams=new Map;var ix=r=>{const e=new Map,a=new Map,i=$b();r.onMessage("__crx_bridge_stream_open__",d=>new Promise(m=>{const{sender:g,data:f}=d,{channel:E}=f;let p=!1,C=()=>{};const I=()=>{const x=a.get(E);typeof x=="function"?(x(new Ku(r,Yb(Wb({},f),{endpoint:g}))),p&&C(),m(!0)):p||(p=!0,C=i.on("did-change-stream-callbacks",I))};I()}));async function s(d,m){if(e.has(d))throw new Error("webext-bridge: A Stream is already open at this channel");const g=typeof m=="string"?Jb(m):m,f={streamId:Vu(),channel:d,endpoint:g},E=new Ku(r,f);return E.onClose(()=>e.delete(d)),await r.sendMessage("__crx_bridge_stream_open__",f,g),e.set(d,E),E}function c(d,m){if(a.has(d))throw new Error("webext-bridge: This channel has already been claimed. Stream allows only one-on-one communication");a.set(d,m),i.emit("did-change-stream-callbacks")}return{openStream:s,onOpenStreamChannel:c}},Zb=WN("popup"),vh=rx("popup",r=>Zb.postMessage(r));Zb.onMessage(vh.handleMessage);var{sendMessage:gt,onMessage:Qf}=vh;ix(vh);const sx=()=>{const[r,e]=w.useState(!1),a=w.useRef(null),i=w.useRef(0),s=(c,d)=>{setTimeout(()=>{if(a.current){const m=c/d*100;a.current.style.transition="none",a.current.style.width=`${m}%`,a.current.offsetHeight,requestAnimationFrame(()=>{a.current&&(a.current.style.transition=`width ${c}s linear`,a.current.style.width="0%")})}},10)};return w.useEffect(()=>{gt("GET_CLIPBOARD_COUNTDOWN_STATE",{},"background").then(g=>{const f=g;f&&f.remaining>0&&(i.current=f.id,e(!0),s(f.remaining,f.total))}).catch(()=>{});const c=Qf("CLIPBOARD_COUNTDOWN",({data:g})=>{const{remaining:f,total:E,id:p}=g;e(f>0),p!==i.current&&f>0&&(i.current=p,s(f,E))}),d=Qf("CLIPBOARD_CLEARED",()=>{e(!1),i.current=0,a.current&&(a.current.style.transition="none",a.current.style.width="0%")}),m=Qf("CLIPBOARD_COUNTDOWN_CANCELLED",()=>{e(!1),i.current=0,a.current&&(a.current.style.transition="none",a.current.style.width="0%")});return()=>{c(),d(),m()}},[]),r?l.jsx("div",{className:"fixed top-0 left-0 right-0 z-[60] h-1 bg-gray-200 dark:bg-gray-700",children:l.jsx("div",{ref:a,className:"h-full bg-orange-500",style:{width:"100%",transition:"none"}})}):null},ox=()=>{const{t:r}=tt(),e=La(),a=tn(),[i,s]=w.useState("items");w.useEffect(()=>{const E=a.pathname.substring(1),C=["items","emails","settings"].find(I=>E===I||E.startsWith(`${I}/`));C&&s(C)},[a]);const c=E=>{s(E),E==="items"?e(`/${E}`,{state:{resetFilters:!0}}):e(`/${E}`)};return["/","/login","/auth-settings","/unlock","/unlock-success","/upgrade"].includes(a.pathname)||new URLSearchParams(window.location.search).get("mode")==="inline_unlock"?null:l.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"flex justify-around items-center h-14",children:[l.jsxs("button",{onClick:()=>c("items"),id:"nav-vault",className:`flex flex-col items-center justify-center w-1/3 h-full ${i==="items"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[l.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),l.jsx("span",{className:"text-sm mt-1",children:r("menu.vault")})]}),l.jsxs("button",{onClick:()=>c("emails"),id:"nav-emails",className:`flex flex-col items-center justify-center w-1/3 h-full ${i==="emails"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[l.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),l.jsx("span",{className:"text-sm mt-1",children:r("menu.emails")})]}),l.jsxs("button",{onClick:()=>c("settings"),id:"nav-settings",className:`flex flex-col items-center justify-center w-1/3 h-full ${i==="settings"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[l.jsxs("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),l.jsx("span",{className:"text-sm mt-1",children:r("common.settings")})]})]})})},eI=({className:r="",width:e=200,height:a=50,showText:i=!0,color:s="currentColor"})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",version:"1.1",viewBox:"0 0 2000 500",width:e,height:a,className:r,children:[l.jsx("path",{d:"m459.87 294.95c0.016205 5.4005 0.03241 10.801-0.35022 16.873-1.111 6.3392-1.1941 12.173-2.6351 17.649-10.922 41.508-36.731 69.481-77.351 83.408-7.2157 2.4739-14.972 3.3702-22.479 4.995-23.629 0.042205-47.257 0.11453-70.886 0.12027-46.762 0.011322-93.523-0.01416-140.95-0.43411-8.59-2.0024-16.766-2.8352-24.398-5.3326-21.595-7.0666-39.523-19.656-53.708-37.552-10.227-12.903-17.579-27.17-21.28-43.221-1.475-6.3967-2.4711-12.904-3.6852-19.361-0.051849-5.747-0.1037-11.494 0.26915-17.886 4.159-42.973 27.68-71.638 63.562-92.153 0-0.70761-0.001961-1.6988 3.12e-4 -2.69 0.022484-9.8293-1.3071-19.894 0.35664-29.438 3.2391-18.579 11.08-35.272 23.763-49.773 12.098-13.832 26.457-23.989 43.609-30.029 7.813-2.7512 16.14-4.0417 24.234-5.9948 7.392-0.025734 14.784-0.05146 22.835 0.32253 4.1959 0.95392 7.7946 1.2538 11.258 2.1053 17.16 4.2192 32.287 12.176 45.469 24.104 2.2558 2.0411 4.372 6.6241 9.621 3.868 16.839-8.8419 34.718-11.597 53.603-8.594 16.791 2.6699 31.602 9.4308 44.236 20.636 11.531 10.227 19.84 22.841 25.393 37.236 6.3436 16.445 10.389 33.163 6.0798 49.389 7.9587 8.9321 15.807 16.704 22.421 25.414 9.162 12.065 15.33 25.746 18.144 40.776 0.97046 5.1848 1.9111 10.375 2.8654 15.563m-71.597 71.012c5.5615-5.2284 12.002-9.7986 16.508-15.817 10.474-13.992 14.333-29.916 11.288-47.446-2.2496-12.95-8.1973-24.076-17.243-33.063-12.746-12.663-28.865-18.614-46.786-18.569-69.912 0.17712-139.82 0.56831-209.74 0.96176-15.922 0.089599-29.168 7.4209-39.685 18.296-14.45 14.944-20.408 33.343-16.655 54.368 2.2763 12.754 8.2167 23.748 17.158 32.66 13.299 13.255 30.097 18.653 48.728 18.651 59.321-0.005188 118.64 0.042358 177.96-0.046601 9.5912-0.014374 19.181-0.86588 28.773-0.88855 10.649-0.025146 19.978-3.825 29.687-9.1074z",fill:"#EEC170"}),l.jsx("path",{d:"m162.77 293c15.654 4.3883 20.627 22.967 10.304 34.98-5.3104 6.1795-14.817 8.3208-24.278 5.0472-7.0723-2.4471-12.332-10.362-12.876-17.933-1.0451-14.542 11.089-23.176 21.705-23.046 1.5794 0.019287 3.1517 0.61566 5.1461 0.95184z",fill:"#EEC170"}),l.jsx("path",{d:"m227.18 293.64c7.8499 2.3973 11.938 8.2143 13.524 15.077 1.8591 8.0439-0.44817 15.706-7.1588 21.121-6.7633 5.4572-14.417 6.8794-22.578 3.1483-8.2972-3.7933-12.836-10.849-12.736-19.438 0.1687-14.497 14.13-25.368 28.948-19.908z",fill:"#EEC170"}),l.jsx("path",{d:"m261.57 319.07c-2.495-14.418 4.6853-22.603 14.596-26.108 9.8945-3.4995 23.181 3.4303 26.267 13.779 4.6504 15.591-7.1651 29.064-21.665 28.161-8.5254-0.53088-17.202-6.5094-19.198-15.831z",fill:"#EEC170"}),l.jsx("path",{d:"m336.91 333.41c-9.0175-4.2491-15.337-14.349-13.829-21.682 3.0825-14.989 13.341-20.304 23.018-19.585 10.653 0.79141 17.93 7.407 19.765 17.547 1.9588 10.824-4.1171 19.939-13.494 23.703-5.272 2.1162-10.091 1.5086-15.46 0.017883z",fill:"#EEC170"}),i&&l.jsx("text",{x:"550",y:"355",fontFamily:"Arial, Helvetica, sans-serif",fontWeight:"700",fontSize:"290",letterSpacing:"-7",fill:s,children:"AliasVault"})]});var wy=Object.prototype.hasOwnProperty;function Gg(r,e){var a,i;if(r===e)return!0;if(r&&e&&(a=r.constructor)===e.constructor){if(a===Date)return r.getTime()===e.getTime();if(a===RegExp)return r.toString()===e.toString();if(a===Array){if((i=r.length)===e.length)for(;i--&&Gg(r[i],e[i]););return i===-1}if(!a||typeof r=="object"){i=0;for(a in r)if(wy.call(r,a)&&++i&&!wy.call(e,a)||!(a in e)||!Gg(r[a],e[a]))return!1;return Object.keys(e).length===i}}return r!==r&&e!==e}const lx=new Error("request for lock canceled");var cx=function(r,e,a,i){function s(c){return c instanceof a?c:new a(function(d){d(c)})}return new(a||(a=Promise))(function(c,d){function m(E){try{f(i.next(E))}catch(p){d(p)}}function g(E){try{f(i.throw(E))}catch(p){d(p)}}function f(E){E.done?c(E.value):s(E.value).then(m,g)}f((i=i.apply(r,e||[])).next())})};class ux{constructor(e,a=lx){this._value=e,this._cancelError=a,this._queue=[],this._weightedWaiters=[]}acquire(e=1,a=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((i,s)=>{const c={resolve:i,reject:s,weight:e,priority:a},d=tI(this._queue,m=>a<=m.priority);d===-1&&e<=this._value?this._dispatchItem(c):this._queue.splice(d+1,0,c)})}runExclusive(e){return cx(this,arguments,void 0,function*(a,i=1,s=0){const[c,d]=yield this.acquire(i,s);try{return yield a(c)}finally{d()}})}waitForUnlock(e=1,a=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,a)?Promise.resolve():new Promise(i=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),dx(this._weightedWaiters[e-1],{resolve:i,priority:a})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const a=this._value;this._value-=e.weight,e.resolve([a,this._newReleaser(e.weight)])}_newReleaser(e){let a=!1;return()=>{a||(a=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const a=this._weightedWaiters[e-1];a&&(a.forEach(i=>i.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let a=this._value;a>0;a--){const i=this._weightedWaiters[a-1];if(!i)continue;const s=i.findIndex(c=>c.priority<=e);(s===-1?i:i.splice(0,s)).forEach(c=>c.resolve())}}}_couldLockImmediately(e,a){return(this._queue.length===0||this._queue[0].priority<a)&&e<=this._value}}function dx(r,e){const a=tI(r,i=>e.priority<=i.priority);r.splice(a+1,0,e)}function tI(r,e){for(let a=r.length-1;a>=0;a--)if(e(r[a]))return a;return-1}var mx=function(r,e,a,i){function s(c){return c instanceof a?c:new a(function(d){d(c)})}return new(a||(a=Promise))(function(c,d){function m(E){try{f(i.next(E))}catch(p){d(p)}}function g(E){try{f(i.throw(E))}catch(p){d(p)}}function f(E){E.done?c(E.value):s(E.value).then(m,g)}f((i=i.apply(r,e||[])).next())})};class fx{constructor(e){this._semaphore=new ux(1,e)}acquire(){return mx(this,arguments,void 0,function*(e=0){const[,a]=yield this._semaphore.acquire(1,e);return a})}runExclusive(e,a=0){return this._semaphore.runExclusive(()=>e(),1,a)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}var Ib,vb;const Bu=((vb=(Ib=globalThis.browser)==null?void 0:Ib.runtime)==null?void 0:vb.id)==null?globalThis.chrome:globalThis.browser,ke=gx();function gx(){const r={local:du("local"),session:du("session"),sync:du("sync"),managed:du("managed")},e=T=>{const k=r[T];if(k==null){const R=Object.keys(r).join(", ");throw Error(`Invalid area "${T}". Options: ${R}`)}return k},a=T=>{const k=T.indexOf(":"),R=T.substring(0,k),_=T.substring(k+1);if(_==null)throw Error(`Storage key should be in the form of "area:key", but received "${T}"`);return{driverArea:R,driverKey:_,driver:e(R)}},i=T=>T+"$",s=(T,k)=>{const R={...T};return Object.entries(k).forEach(([_,S])=>{S==null?delete R[_]:R[_]=S}),R},c=(T,k)=>T??k??null,d=T=>typeof T=="object"&&!Array.isArray(T)?T:{},m=async(T,k,R)=>{const _=await T.getItem(k);return c(_,(R==null?void 0:R.fallback)??(R==null?void 0:R.defaultValue))},g=async(T,k)=>{const R=i(k),_=await T.getItem(R);return d(_)},f=async(T,k,R)=>{await T.setItem(k,R??null)},E=async(T,k,R)=>{const _=i(k),S=d(await T.getItem(_));await T.setItem(_,s(S,R))},p=async(T,k,R)=>{if(await T.removeItem(k),R!=null&&R.removeMeta){const _=i(k);await T.removeItem(_)}},C=async(T,k,R)=>{const _=i(k);if(R==null)await T.removeItem(_);else{const S=d(await T.getItem(_));[R].flat().forEach(O=>delete S[O]),await T.setItem(_,S)}},I=(T,k,R)=>T.watch(k,R);return{getItem:async(T,k)=>{const{driver:R,driverKey:_}=a(T);return await m(R,_,k)},getItems:async T=>{const k=new Map,R=new Map,_=[];T.forEach(O=>{let U,P;typeof O=="string"?U=O:"getValue"in O?(U=O.key,P={fallback:O.fallback}):(U=O.key,P=O.options),_.push(U);const{driverArea:K,driverKey:H}=a(U),Q=k.get(K)??[];k.set(K,Q.concat(H)),R.set(U,P)});const S=new Map;return await Promise.all(Array.from(k.entries()).map(async([O,U])=>{(await r[O].getItems(U)).forEach(K=>{const H=`${O}:${K.key}`,Q=R.get(H),V=c(K.value,(Q==null?void 0:Q.fallback)??(Q==null?void 0:Q.defaultValue));S.set(H,V)})})),_.map(O=>({key:O,value:S.get(O)}))},getMeta:async T=>{const{driver:k,driverKey:R}=a(T);return await g(k,R)},getMetas:async T=>{const k=T.map(S=>{const O=typeof S=="string"?S:S.key,{driverArea:U,driverKey:P}=a(O);return{key:O,driverArea:U,driverKey:P,driverMetaKey:i(P)}}),R=k.reduce((S,O)=>{var U;return S[U=O.driverArea]??(S[U]=[]),S[O.driverArea].push(O),S},{}),_={};return await Promise.all(Object.entries(R).map(async([S,O])=>{const U=await Bu.storage[S].get(O.map(P=>P.driverMetaKey));O.forEach(P=>{_[P.key]=U[P.driverMetaKey]??{}})})),k.map(S=>({key:S.key,meta:_[S.key]}))},setItem:async(T,k)=>{const{driver:R,driverKey:_}=a(T);await f(R,_,k)},setItems:async T=>{const k={};T.forEach(R=>{const{driverArea:_,driverKey:S}=a("key"in R?R.key:R.item.key);k[_]??(k[_]=[]),k[_].push({key:S,value:R.value})}),await Promise.all(Object.entries(k).map(async([R,_])=>{await e(R).setItems(_)}))},setMeta:async(T,k)=>{const{driver:R,driverKey:_}=a(T);await E(R,_,k)},setMetas:async T=>{const k={};T.forEach(R=>{const{driverArea:_,driverKey:S}=a("key"in R?R.key:R.item.key);k[_]??(k[_]=[]),k[_].push({key:S,properties:R.meta})}),await Promise.all(Object.entries(k).map(async([R,_])=>{const S=e(R),O=_.map(({key:H})=>i(H));console.log(R,O);const U=await S.getItems(O),P=Object.fromEntries(U.map(({key:H,value:Q})=>[H,d(Q)])),K=_.map(({key:H,properties:Q})=>{const V=i(H);return{key:V,value:s(P[V]??{},Q)}});await S.setItems(K)}))},removeItem:async(T,k)=>{const{driver:R,driverKey:_}=a(T);await p(R,_,k)},removeItems:async T=>{const k={};T.forEach(R=>{let _,S;typeof R=="string"?_=R:"getValue"in R?_=R.key:"item"in R?(_=R.item.key,S=R.options):(_=R.key,S=R.options);const{driverArea:O,driverKey:U}=a(_);k[O]??(k[O]=[]),k[O].push(U),S!=null&&S.removeMeta&&k[O].push(i(U))}),await Promise.all(Object.entries(k).map(async([R,_])=>{await e(R).removeItems(_)}))},clear:async T=>{await e(T).clear()},removeMeta:async(T,k)=>{const{driver:R,driverKey:_}=a(T);await C(R,_,k)},snapshot:async(T,k)=>{var S;const _=await e(T).snapshot();return(S=k==null?void 0:k.excludeKeys)==null||S.forEach(O=>{delete _[O],delete _[i(O)]}),_},restoreSnapshot:async(T,k)=>{await e(T).restoreSnapshot(k)},watch:(T,k)=>{const{driver:R,driverKey:_}=a(T);return I(R,_,k)},unwatch(){Object.values(r).forEach(T=>{T.unwatch()})},defineItem:(T,k)=>{const{driver:R,driverKey:_}=a(T),{version:S=1,migrations:O={}}=k??{};if(S<1)throw Error("Storage item version cannot be less than 1. Initial versions should be set to 1, not 0.");const U=async()=>{var $;const V=i(_),[{value:G},{value:q}]=await R.getItems([_,V]);if(G==null)return;const W=(q==null?void 0:q.v)??1;if(W>S)throw Error(`Version downgrade detected (v${W} -> v${S}) for "${T}"`);if(W===S)return;console.debug(`[@wxt-dev/storage] Running storage migration for ${T}: v${W} -> v${S}`);const ne=Array.from({length:S-W},(re,ye)=>W+ye+1);let me=G;for(const re of ne)try{me=await(($=O==null?void 0:O[re])==null?void 0:$.call(O,me))??me}catch(ye){throw new hx(T,re,{cause:ye})}await R.setItems([{key:_,value:me},{key:V,value:{...q,v:S}}]),console.debug(`[@wxt-dev/storage] Storage migration completed for ${T} v${S}`,{migratedValue:me})},P=(k==null?void 0:k.migrations)==null?Promise.resolve():U().catch(V=>{console.error(`[@wxt-dev/storage] Migration failed for ${T}`,V)}),K=new fx,H=()=>(k==null?void 0:k.fallback)??(k==null?void 0:k.defaultValue)??null,Q=()=>K.runExclusive(async()=>{const V=await R.getItem(_);if(V!=null||(k==null?void 0:k.init)==null)return V;const G=await k.init();return await R.setItem(_,G),G});return P.then(Q),{key:T,get defaultValue(){return H()},get fallback(){return H()},getValue:async()=>(await P,k!=null&&k.init?await Q():await m(R,_,k)),getMeta:async()=>(await P,await g(R,_)),setValue:async V=>(await P,await f(R,_,V)),setMeta:async V=>(await P,await E(R,_,V)),removeValue:async V=>(await P,await p(R,_,V)),removeMeta:async V=>(await P,await C(R,_,V)),watch:V=>I(R,_,(G,q)=>V(G??H(),q??H())),migrate:U}}}}function du(r){const e=()=>{if(Bu.runtime==null)throw Error(["'wxt/storage' must be loaded in a web extension environment",`
 - If thrown during a build, see https://github.com/wxt-dev/wxt/issues/371`,` - If thrown during tests, mock 'wxt/browser' correctly. See https://wxt.dev/guide/go-further/testing.html
`].join(`
`));if(Bu.storage==null)throw Error("You must add the 'storage' permission to your manifest to use 'wxt/storage'");const i=Bu.storage[r];if(i==null)throw Error(`"browser.storage.${r}" is undefined`);return i},a=new Set;return{getItem:async i=>(await e().get(i))[i],getItems:async i=>{const s=await e().get(i);return i.map(c=>({key:c,value:s[c]??null}))},setItem:async(i,s)=>{s==null?await e().remove(i):await e().set({[i]:s})},setItems:async i=>{const s=i.reduce((c,{key:d,value:m})=>(c[d]=m,c),{});await e().set(s)},removeItem:async i=>{await e().remove(i)},removeItems:async i=>{await e().remove(i)},clear:async()=>{await e().clear()},snapshot:async()=>await e().get(),restoreSnapshot:async i=>{await e().set(i)},watch(i,s){const c=d=>{const m=d[i];m!=null&&(Gg(m.newValue,m.oldValue)||s(m.newValue??null,m.oldValue??null))};return e().onChanged.addListener(c),a.add(c),()=>{e().onChanged.removeListener(c),a.delete(c)}},unwatch(){a.forEach(i=>{e().onChanged.removeListener(i)}),a.clear()}}}class hx extends Error{constructor(e,a,i){super(`v${a} migration failed for "${e}"`,i),this.key=e,this.version=a}}var zf={exports:{}};const Ax={},px=Object.freeze(Object.defineProperty({__proto__:null,default:Ax},Symbol.toStringTag,{value:"Module"})),Cy=Bw(px);var Ny;function yx(){return Ny||(Ny=1,function(r,e){var a=void 0,i=function(s){return a||(a=new Promise(function(c,d){var m=typeof s<"u"?s:{},g=m.onAbort;m.onAbort=function(A){d(new Error(A)),g&&g(A)},m.postRun=m.postRun||[],m.postRun.push(function(){c(m)}),r=void 0;var f;f||(f=typeof m<"u"?m:{});var E=typeof window=="object",p=typeof WorkerGlobalScope<"u",C=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";f.onRuntimeInitialized=function(){function A(le,Le){switch(typeof Le){case"boolean":jd(le,Le?1:0);break;case"number":Md(le,Le);break;case"string":Fd(le,Le,-1,-1);break;case"object":if(Le===null)oc(le);else if(Le.length!=null){var Ke=mi(Le,Yi);Od(le,Ke,Le.length,-1),gi(Ke)}else Ai(le,"Wrong API use : tried to return a value of an unknown type ("+Le+").",-1);break;default:oc(le)}}function b(le,Le){for(var Ke=[],rt=0;rt<le;rt+=1){var ct=yt(Le+4*rt,"i32"),Ot=sc(ct);if(Ot===1||Ot===2)ct=_d(ct);else if(Ot===3)ct=Bd(ct);else if(Ot===4){Ot=ct,ct=Dd(Ot),Ot=Ud(Ot);for(var Tn=new Uint8Array(ct),yn=0;yn<ct;yn+=1)Tn[yn]=V[Ot+yn];ct=Tn}else ct=null;Ke.push(ct)}return Ke}function D(le,Le){this.Qa=le,this.db=Le,this.Oa=1,this.lb=[]}function F(le,Le){if(this.db=Le,Le=na(le)+1,this.eb=Ls(Le),this.eb===null)throw Error("Unable to allocate memory for the SQL string");B(le,G,this.eb,Le),this.kb=this.eb,this.Za=this.pb=null}function J(le){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),le!=null){var Le=this.filename,Ke="/",rt=Le;if(Ke&&(Ke=typeof Ke=="string"?Ke:tr(Ke),rt=Le?Ye(Ke+"/"+Le):Ke),Le=ht(!0,!0),rt=Z(rt,Le),le){if(typeof le=="string"){Ke=Array(le.length);for(var ct=0,Ot=le.length;ct<Ot;++ct)Ke[ct]=le.charCodeAt(ct);le=Ke}va(rt,Le|146),Ke=ea(rt,577),ec(Ke,le,0,le.length,0),xn(Ke),va(rt,Le)}}this.handleError(Ve(this.filename,ce)),this.db=yt(ce,"i32"),lc(this.db),this.fb={},this.Sa={}}var ce=Hn(4),pe=f.cwrap,Ve=pe("sqlite3_open","number",["string","number"]),wt=pe("sqlite3_close_v2","number",["number"]),At=pe("sqlite3_exec","number",["number","string","number","number","number"]),ua=pe("sqlite3_changes","number",["number"]),Pa=pe("sqlite3_prepare_v2","number",["number","string","number","number","number"]),Rs=pe("sqlite3_sql","string",["number"]),Ji=pe("sqlite3_normalized_sql","string",["number"]),Xi=pe("sqlite3_prepare_v2","number",["number","number","number","number","number"]),nc=pe("sqlite3_bind_text","number",["number","number","number","number","number"]),rc=pe("sqlite3_bind_blob","number",["number","number","number","number","number"]),Ed=pe("sqlite3_bind_double","number",["number","number","number"]),bd=pe("sqlite3_bind_int","number",["number","number","number"]),Lo=pe("sqlite3_bind_parameter_index","number",["number","string"]),Id=pe("sqlite3_step","number",["number"]),vd=pe("sqlite3_errmsg","string",["number"]),wd=pe("sqlite3_column_count","number",["number"]),Cd=pe("sqlite3_data_count","number",["number"]),Nd=pe("sqlite3_column_double","number",["number","number"]),Ro=pe("sqlite3_column_text","string",["number","number"]),xd=pe("sqlite3_column_blob","number",["number","number"]),Td=pe("sqlite3_column_bytes","number",["number","number"]),Sd=pe("sqlite3_column_type","number",["number","number"]),kd=pe("sqlite3_column_name","string",["number","number"]),Do=pe("sqlite3_reset","number",["number"]),Ld=pe("sqlite3_clear_bindings","number",["number"]),Rd=pe("sqlite3_finalize","number",["number"]),ic=pe("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),sc=pe("sqlite3_value_type","number",["number"]),Dd=pe("sqlite3_value_bytes","number",["number"]),Bd=pe("sqlite3_value_text","string",["number"]),Ud=pe("sqlite3_value_blob","number",["number"]),_d=pe("sqlite3_value_double","number",["number"]),Md=pe("sqlite3_result_double","",["number","number"]),oc=pe("sqlite3_result_null","",["number"]),Fd=pe("sqlite3_result_text","",["number","string","number","number"]),Od=pe("sqlite3_result_blob","",["number","number","number","number"]),jd=pe("sqlite3_result_int","",["number","number"]),Ai=pe("sqlite3_result_error","",["number","string","number"]),pi=pe("sqlite3_aggregate_context","number",["number","number"]),lc=pe("RegisterExtensionFunctions","number",["number"]),Bo=pe("sqlite3_update_hook","number",["number","number","number"]);D.prototype.bind=function(le){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(le)?this.Cb(le):le!=null&&typeof le=="object"?this.Db(le):!0},D.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var le=Id(this.Qa);switch(le){case 100:return!0;case 101:return!1;default:throw this.db.handleError(le)}},D.prototype.wb=function(le){return le==null&&(le=this.Oa,this.Oa+=1),Nd(this.Qa,le)},D.prototype.Gb=function(le){if(le==null&&(le=this.Oa,this.Oa+=1),le=Ro(this.Qa,le),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(le)},D.prototype.Hb=function(le){return le==null&&(le=this.Oa,this.Oa+=1),Ro(this.Qa,le)},D.prototype.getBlob=function(le){le==null&&(le=this.Oa,this.Oa+=1);var Le=Td(this.Qa,le);le=xd(this.Qa,le);for(var Ke=new Uint8Array(Le),rt=0;rt<Le;rt+=1)Ke[rt]=V[le+rt];return Ke},D.prototype.get=function(le,Le){Le=Le||{},le!=null&&this.bind(le)&&this.step(),le=[];for(var Ke=Cd(this.Qa),rt=0;rt<Ke;rt+=1)switch(Sd(this.Qa,rt)){case 1:var ct=Le.useBigInt?this.Gb(rt):this.wb(rt);le.push(ct);break;case 2:le.push(this.wb(rt));break;case 3:le.push(this.Hb(rt));break;case 4:le.push(this.getBlob(rt));break;default:le.push(null)}return le},D.prototype.getColumnNames=function(){for(var le=[],Le=wd(this.Qa),Ke=0;Ke<Le;Ke+=1)le.push(kd(this.Qa,Ke));return le},D.prototype.getAsObject=function(le,Le){le=this.get(le,Le),Le=this.getColumnNames();for(var Ke={},rt=0;rt<Le.length;rt+=1)Ke[Le[rt]]=le[rt];return Ke},D.prototype.getSQL=function(){return Rs(this.Qa)},D.prototype.getNormalizedSQL=function(){return Ji(this.Qa)},D.prototype.run=function(le){return le!=null&&this.bind(le),this.step(),this.reset()},D.prototype.sb=function(le,Le){Le==null&&(Le=this.Oa,this.Oa+=1),le=v(le);var Ke=mi(le,Yi);this.lb.push(Ke),this.db.handleError(nc(this.Qa,Le,Ke,le.length-1,0))},D.prototype.Bb=function(le,Le){Le==null&&(Le=this.Oa,this.Oa+=1);var Ke=mi(le,Yi);this.lb.push(Ke),this.db.handleError(rc(this.Qa,Le,Ke,le.length,0))},D.prototype.rb=function(le,Le){Le==null&&(Le=this.Oa,this.Oa+=1),this.db.handleError((le===(le|0)?bd:Ed)(this.Qa,Le,le))},D.prototype.Eb=function(le){le==null&&(le=this.Oa,this.Oa+=1),rc(this.Qa,le,0,0,0)},D.prototype.tb=function(le,Le){switch(Le==null&&(Le=this.Oa,this.Oa+=1),typeof le){case"string":this.sb(le,Le);return;case"number":this.rb(le,Le);return;case"bigint":this.sb(le.toString(),Le);return;case"boolean":this.rb(le+0,Le);return;case"object":if(le===null){this.Eb(Le);return}if(le.length!=null){this.Bb(le,Le);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+le+")."},D.prototype.Db=function(le){var Le=this;return Object.keys(le).forEach(function(Ke){var rt=Lo(Le.Qa,Ke);rt!==0&&Le.tb(le[Ke],rt)}),!0},D.prototype.Cb=function(le){for(var Le=0;Le<le.length;Le+=1)this.tb(le[Le],Le+1);return!0},D.prototype.reset=function(){return this.freemem(),Ld(this.Qa)===0&&Do(this.Qa)===0},D.prototype.freemem=function(){for(var le;(le=this.lb.pop())!==void 0;)gi(le)},D.prototype.free=function(){this.freemem();var le=Rd(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,le},F.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.mb(),Error("Database closed");var le=nr(),Le=Hn(4);nt(ce),nt(Le);try{this.db.handleError(Xi(this.db.db,this.kb,-1,ce,Le)),this.kb=yt(Le,"i32");var Ke=yt(ce,"i32");return Ke===0?(this.mb(),{done:!0}):(this.Za=new D(Ke,this.db),this.db.fb[Ke]=this.Za,{value:this.Za,done:!1})}catch(rt){throw this.pb=Be(this.kb),this.mb(),rt}finally{un(le)}},F.prototype.mb=function(){gi(this.eb),this.eb=null},F.prototype.getRemainingSQL=function(){return this.pb!==null?this.pb:Be(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(F.prototype[Symbol.iterator]=function(){return this}),J.prototype.run=function(le,Le){if(!this.db)throw"Database closed";if(Le){le=this.prepare(le,Le);try{le.step()}finally{le.free()}}else this.handleError(At(this.db,le,0,0,ce));return this},J.prototype.exec=function(le,Le,Ke){if(!this.db)throw"Database closed";var rt=nr(),ct=null;try{var Ot=To(le),Tn=Hn(4);for(le=[];yt(Ot,"i8")!==0;){nt(ce),nt(Tn),this.handleError(Xi(this.db,Ot,-1,ce,Tn));var yn=yt(ce,"i32");if(Ot=yt(Tn,"i32"),yn!==0){var nn=null;for(ct=new D(yn,this),Le!=null&&ct.bind(Le);ct.step();)nn===null&&(nn={columns:ct.getColumnNames(),values:[]},le.push(nn)),nn.values.push(ct.get(null,Ke));ct.free()}}return le}catch(En){throw ct&&ct.free(),En}finally{un(rt)}},J.prototype.each=function(le,Le,Ke,rt,ct){typeof Le=="function"&&(rt=Ke,Ke=Le,Le=void 0),le=this.prepare(le,Le);try{for(;le.step();)Ke(le.getAsObject(null,ct))}finally{le.free()}if(typeof rt=="function")return rt()},J.prototype.prepare=function(le,Le){if(nt(ce),this.handleError(Pa(this.db,le,-1,ce,0)),le=yt(ce,"i32"),le===0)throw"Nothing to prepare";var Ke=new D(le,this);return Le!=null&&Ke.bind(Le),this.fb[le]=Ke},J.prototype.iterateStatements=function(le){return new F(le,this)},J.prototype.export=function(){Object.values(this.fb).forEach(function(Le){Le.free()}),Object.values(this.Sa).forEach(Pn),this.Sa={},this.handleError(wt(this.db));var le=tc(this.filename);return this.handleError(Ve(this.filename,ce)),this.db=yt(ce,"i32"),lc(this.db),le},J.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(le){le.free()}),Object.values(this.Sa).forEach(Pn),this.Sa={},this.Ya&&(Pn(this.Ya),this.Ya=void 0),this.handleError(wt(this.db)),oa("/"+this.filename),this.db=null)},J.prototype.handleError=function(le){if(le===0)return null;throw le=vd(this.db),Error(le)},J.prototype.getRowsModified=function(){return ua(this.db)},J.prototype.create_function=function(le,Le){Object.prototype.hasOwnProperty.call(this.Sa,le)&&(Pn(this.Sa[le]),delete this.Sa[le]);var Ke=Fr(function(rt,ct,Ot){ct=b(ct,Ot);try{var Tn=Le.apply(null,ct)}catch(yn){Ai(rt,yn,-1);return}A(rt,Tn)},"viii");return this.Sa[le]=Ke,this.handleError(ic(this.db,le,Le.length,1,0,Ke,0,0,0)),this},J.prototype.create_aggregate=function(le,Le){var Ke=Le.init||function(){return null},rt=Le.finalize||function(nn){return nn},ct=Le.step;if(!ct)throw"An aggregate function must have a step function in "+le;var Ot={};Object.hasOwnProperty.call(this.Sa,le)&&(Pn(this.Sa[le]),delete this.Sa[le]),Le=le+"__finalize",Object.hasOwnProperty.call(this.Sa,Le)&&(Pn(this.Sa[Le]),delete this.Sa[Le]);var Tn=Fr(function(nn,En,Or){var Sn=pi(nn,1);Object.hasOwnProperty.call(Ot,Sn)||(Ot[Sn]=Ke()),En=b(En,Or),En=[Ot[Sn]].concat(En);try{Ot[Sn]=ct.apply(null,En)}catch(Pd){delete Ot[Sn],Ai(nn,Pd,-1)}},"viii"),yn=Fr(function(nn){var En=pi(nn,1);try{var Or=rt(Ot[En])}catch(Sn){delete Ot[En],Ai(nn,Sn,-1);return}A(nn,Or),delete Ot[En]},"vi");return this.Sa[le]=Tn,this.Sa[Le]=yn,this.handleError(ic(this.db,le,ct.length-1,1,0,0,Tn,yn,0)),this},J.prototype.updateHook=function(le){this.Ya&&(Bo(this.db,0,0),Pn(this.Ya),this.Ya=void 0),le&&(this.Ya=Fr(function(Le,Ke,rt,ct,Ot){switch(Ke){case 18:Le="insert";break;case 23:Le="update";break;case 9:Le="delete";break;default:throw"unknown operationCode in updateHook callback: "+Ke}if(rt=rt?ve(G,rt):"",ct=ct?ve(G,ct):"",Ot>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";le(Le,rt,ct,Number(Ot))},"viiiij"),Bo(this.db,this.Ya,0))},f.Database=J};var I={...f},x="./this.program",T=(A,b)=>{throw b},k="",R,_;if(C){var S=Cy;k=__dirname+"/",_=A=>(A=ye(A)?new URL(A):A,S.readFileSync(A)),R=async A=>(A=ye(A)?new URL(A):A,S.readFileSync(A,void 0)),!f.thisProgram&&1<process.argv.length&&(x=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),r.exports=f,T=(A,b)=>{throw process.exitCode=A,b}}else(E||p)&&(p?k=self.location.href:typeof document<"u"&&document.currentScript&&(k=document.currentScript.src),k=k.startsWith("blob:")?"":k.slice(0,k.replace(/[?#].*/,"").lastIndexOf("/")+1),p&&(_=A=>{var b=new XMLHttpRequest;return b.open("GET",A,!1),b.responseType="arraybuffer",b.send(null),new Uint8Array(b.response)}),R=async A=>{if(ye(A))return new Promise((D,F)=>{var J=new XMLHttpRequest;J.open("GET",A,!0),J.responseType="arraybuffer",J.onload=()=>{J.status==200||J.status==0&&J.response?D(J.response):F(J.status)},J.onerror=F,J.send(null)});var b=await fetch(A,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url)});var O=f.print||console.log.bind(console),U=f.printErr||console.error.bind(console);Object.assign(f,I),I=null,f.thisProgram&&(x=f.thisProgram);var P=f.wasmBinary,K,H=!1,Q,V,G,q,W,ne,me,$,re,ye=A=>A.startsWith("file://");function Ae(){var A=K.buffer;f.HEAP8=V=new Int8Array(A),f.HEAP16=q=new Int16Array(A),f.HEAPU8=G=new Uint8Array(A),f.HEAPU16=new Uint16Array(A),f.HEAP32=W=new Int32Array(A),f.HEAPU32=ne=new Uint32Array(A),f.HEAPF32=me=new Float32Array(A),f.HEAPF64=re=new Float64Array(A),f.HEAP64=$=new BigInt64Array(A),f.HEAPU64=new BigUint64Array(A)}var j=0,X=null;function ee(A){var b;throw(b=f.onAbort)==null||b.call(f,A),A="Aborted("+A+")",U(A),H=!0,new WebAssembly.RuntimeError(A+". Build with -sASSERTIONS for more info.")}var ie;async function Ie(A){if(!P)try{var b=await R(A);return new Uint8Array(b)}catch{}if(A==ie&&P)A=new Uint8Array(P);else if(_)A=_(A);else throw"both async and sync fetching of the wasm failed";return A}async function we(A,b){try{var D=await Ie(A);return await WebAssembly.instantiate(D,b)}catch(F){U(`failed to asynchronously prepare wasm: ${F}`),ee(F)}}async function Re(A){var b=ie;if(!P&&typeof WebAssembly.instantiateStreaming=="function"&&!ye(b)&&!C)try{var D=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(D,A)}catch(F){U(`wasm streaming compile failed: ${F}`),U("falling back to ArrayBuffer instantiation")}return we(b,A)}class De{constructor(b){ze(this,"name","ExitStatus");this.message=`Program terminated with exit(${b})`,this.status=b}}var Te=A=>{for(;0<A.length;)A.shift()(f)},He=[],Ne=[],Qe=()=>{var A=f.preRun.shift();Ne.unshift(A)};function yt(A,b="i8"){switch(b.endsWith("*")&&(b="*"),b){case"i1":return V[A];case"i8":return V[A];case"i16":return q[A>>1];case"i32":return W[A>>2];case"i64":return $[A>>3];case"float":return me[A>>2];case"double":return re[A>>3];case"*":return ne[A>>2];default:ee(`invalid type for getValue: ${b}`)}}var We=f.noExitRuntime||!0;function nt(A){var b="i32";switch(b.endsWith("*")&&(b="*"),b){case"i1":V[A]=0;break;case"i8":V[A]=0;break;case"i16":q[A>>1]=0;break;case"i32":W[A>>2]=0;break;case"i64":$[A>>3]=BigInt(0);break;case"float":me[A>>2]=0;break;case"double":re[A>>3]=0;break;case"*":ne[A>>2]=0;break;default:ee(`invalid type for setValue: ${b}`)}}var Ht=typeof TextDecoder<"u"?new TextDecoder:void 0,ve=(A,b=0,D=NaN)=>{var F=b+D;for(D=b;A[D]&&!(D>=F);)++D;if(16<D-b&&A.buffer&&Ht)return Ht.decode(A.subarray(b,D));for(F="";b<D;){var J=A[b++];if(J&128){var ce=A[b++]&63;if((J&224)==192)F+=String.fromCharCode((J&31)<<6|ce);else{var pe=A[b++]&63;J=(J&240)==224?(J&15)<<12|ce<<6|pe:(J&7)<<18|ce<<12|pe<<6|A[b++]&63,65536>J?F+=String.fromCharCode(J):(J-=65536,F+=String.fromCharCode(55296|J>>10,56320|J&1023))}}else F+=String.fromCharCode(J)}return F},Be=(A,b)=>A?ve(G,A,b):"",$e=(A,b)=>{for(var D=0,F=A.length-1;0<=F;F--){var J=A[F];J==="."?A.splice(F,1):J===".."?(A.splice(F,1),D++):D&&(A.splice(F,1),D--)}if(b)for(;D;D--)A.unshift("..");return A},Ye=A=>{var b=A.charAt(0)==="/",D=A.slice(-1)==="/";return(A=$e(A.split("/").filter(F=>!!F),!b).join("/"))||b||(A="."),A&&D&&(A+="/"),(b?"/":"")+A},lt=A=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(A).slice(1);return A=b[0],b=b[1],!A&&!b?".":(b&&(b=b.slice(0,-1)),A+b)},et=A=>A&&A.match(/([^\/]+|\/)\/*$/)[1],Et=()=>{if(C){var A=Cy;return b=>A.randomFillSync(b)}return b=>crypto.getRandomValues(b)},Pt=A=>{(Pt=Et())(A)},qt=(...A)=>{for(var b="",D=!1,F=A.length-1;-1<=F&&!D;F--){if(D=0<=F?A[F]:"/",typeof D!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!D)return"";b=D+"/"+b,D=D.charAt(0)==="/"}return b=$e(b.split("/").filter(J=>!!J),!D).join("/"),(D?"/":"")+b||"."},Qt=[],na=A=>{for(var b=0,D=0;D<A.length;++D){var F=A.charCodeAt(D);127>=F?b++:2047>=F?b+=2:55296<=F&&57343>=F?(b+=4,++D):b+=3}return b},B=(A,b,D,F)=>{if(!(0<F))return 0;var J=D;F=D+F-1;for(var ce=0;ce<A.length;++ce){var pe=A.charCodeAt(ce);if(55296<=pe&&57343>=pe){var Ve=A.charCodeAt(++ce);pe=65536+((pe&1023)<<10)|Ve&1023}if(127>=pe){if(D>=F)break;b[D++]=pe}else{if(2047>=pe){if(D+1>=F)break;b[D++]=192|pe>>6}else{if(65535>=pe){if(D+2>=F)break;b[D++]=224|pe>>12}else{if(D+3>=F)break;b[D++]=240|pe>>18,b[D++]=128|pe>>12&63}b[D++]=128|pe>>6&63}b[D++]=128|pe&63}}return b[D]=0,D-J},v=(A,b)=>{var D=Array(na(A)+1);return A=B(A,D,0,D.length),b&&(D.length=A),D},N=[];function z(A,b){N[A]={input:[],output:[],cb:b},st(A,ae)}var ae={open(A){var b=N[A.node.rdev];if(!b)throw new Oe(43);A.tty=b,A.seekable=!1},close(A){A.tty.cb.fsync(A.tty)},fsync(A){A.tty.cb.fsync(A.tty)},read(A,b,D,F){if(!A.tty||!A.tty.cb.xb)throw new Oe(60);for(var J=0,ce=0;ce<F;ce++){try{var pe=A.tty.cb.xb(A.tty)}catch{throw new Oe(29)}if(pe===void 0&&J===0)throw new Oe(6);if(pe==null)break;J++,b[D+ce]=pe}return J&&(A.node.atime=Date.now()),J},write(A,b,D,F){if(!A.tty||!A.tty.cb.qb)throw new Oe(60);try{for(var J=0;J<F;J++)A.tty.cb.qb(A.tty,b[D+J])}catch{throw new Oe(29)}return F&&(A.node.mtime=A.node.ctime=Date.now()),J}},ge={xb(){e:{if(!Qt.length){var A=null;if(C){var b=Buffer.alloc(256),D=0,F=process.stdin.fd;try{D=S.readSync(F,b,0,256)}catch(J){if(J.toString().includes("EOF"))D=0;else throw J}0<D&&(A=b.slice(0,D).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(A=window.prompt("Input: "),A!==null&&(A+=`
`));if(!A){A=null;break e}Qt=v(A,!0)}A=Qt.shift()}return A},qb(A,b){b===null||b===10?(O(ve(A.output)),A.output=[]):b!=0&&A.output.push(b)},fsync(A){var b;0<((b=A.output)==null?void 0:b.length)&&(O(ve(A.output)),A.output=[])},Tb(){return{Ob:25856,Qb:5,Nb:191,Pb:35387,Mb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Ub(){return 0},Vb(){return[24,80]}},Ee={qb(A,b){b===null||b===10?(U(ve(A.output)),A.output=[]):b!=0&&A.output.push(b)},fsync(A){var b;0<((b=A.output)==null?void 0:b.length)&&(U(ve(A.output)),A.output=[])}},Ue={Wa:null,Xa(){return Ue.createNode(null,"/",16895,0)},createNode(A,b,D,F){if((D&61440)===24576||(D&61440)===4096)throw new Oe(63);return Ue.Wa||(Ue.Wa={dir:{node:{Ta:Ue.La.Ta,Ua:Ue.La.Ua,lookup:Ue.La.lookup,hb:Ue.La.hb,rename:Ue.La.rename,unlink:Ue.La.unlink,rmdir:Ue.La.rmdir,readdir:Ue.La.readdir,symlink:Ue.La.symlink},stream:{Va:Ue.Ma.Va}},file:{node:{Ta:Ue.La.Ta,Ua:Ue.La.Ua},stream:{Va:Ue.Ma.Va,read:Ue.Ma.read,write:Ue.Ma.write,ib:Ue.Ma.ib,jb:Ue.Ma.jb}},link:{node:{Ta:Ue.La.Ta,Ua:Ue.La.Ua,readlink:Ue.La.readlink},stream:{}},ub:{node:{Ta:Ue.La.Ta,Ua:Ue.La.Ua},stream:it}}),D=ya(A,b,D,F),Wt(D.mode)?(D.La=Ue.Wa.dir.node,D.Ma=Ue.Wa.dir.stream,D.Na={}):(D.mode&61440)===32768?(D.La=Ue.Wa.file.node,D.Ma=Ue.Wa.file.stream,D.Ra=0,D.Na=null):(D.mode&61440)===40960?(D.La=Ue.Wa.link.node,D.Ma=Ue.Wa.link.stream):(D.mode&61440)===8192&&(D.La=Ue.Wa.ub.node,D.Ma=Ue.Wa.ub.stream),D.atime=D.mtime=D.ctime=Date.now(),A&&(A.Na[b]=D,A.atime=A.mtime=A.ctime=D.atime),D},Sb(A){return A.Na?A.Na.subarray?A.Na.subarray(0,A.Ra):new Uint8Array(A.Na):new Uint8Array(0)},La:{Ta(A){var b={};return b.dev=(A.mode&61440)===8192?A.id:1,b.ino=A.id,b.mode=A.mode,b.nlink=1,b.uid=0,b.gid=0,b.rdev=A.rdev,Wt(A.mode)?b.size=4096:(A.mode&61440)===32768?b.size=A.Ra:(A.mode&61440)===40960?b.size=A.link.length:b.size=0,b.atime=new Date(A.atime),b.mtime=new Date(A.mtime),b.ctime=new Date(A.ctime),b.blksize=4096,b.blocks=Math.ceil(b.size/b.blksize),b},Ua(A,b){for(var D of["mode","atime","mtime","ctime"])b[D]!=null&&(A[D]=b[D]);b.size!==void 0&&(b=b.size,A.Ra!=b&&(b==0?(A.Na=null,A.Ra=0):(D=A.Na,A.Na=new Uint8Array(b),D&&A.Na.set(D.subarray(0,Math.min(b,A.Ra))),A.Ra=b)))},lookup(){throw Ue.vb},hb(A,b,D,F){return Ue.createNode(A,b,D,F)},rename(A,b,D){try{var F=zt(b,D)}catch{}if(F){if(Wt(A.mode))for(var J in F.Na)throw new Oe(55);Ra(F)}delete A.parent.Na[A.name],b.Na[D]=A,A.name=D,b.ctime=b.mtime=A.parent.ctime=A.parent.mtime=Date.now()},unlink(A,b){delete A.Na[b],A.ctime=A.mtime=Date.now()},rmdir(A,b){var D=zt(A,b),F;for(F in D.Na)throw new Oe(55);delete A.Na[b],A.ctime=A.mtime=Date.now()},readdir(A){return[".","..",...Object.keys(A.Na)]},symlink(A,b,D){return A=Ue.createNode(A,b,41471,0),A.link=D,A},readlink(A){if((A.mode&61440)!==40960)throw new Oe(28);return A.link}},Ma:{read(A,b,D,F,J){var ce=A.node.Na;if(J>=A.node.Ra)return 0;if(A=Math.min(A.node.Ra-J,F),8<A&&ce.subarray)b.set(ce.subarray(J,J+A),D);else for(F=0;F<A;F++)b[D+F]=ce[J+F];return A},write(A,b,D,F,J,ce){if(b.buffer===V.buffer&&(ce=!1),!F)return 0;if(A=A.node,A.mtime=A.ctime=Date.now(),b.subarray&&(!A.Na||A.Na.subarray)){if(ce)return A.Na=b.subarray(D,D+F),A.Ra=F;if(A.Ra===0&&J===0)return A.Na=b.slice(D,D+F),A.Ra=F;if(J+F<=A.Ra)return A.Na.set(b.subarray(D,D+F),J),F}ce=J+F;var pe=A.Na?A.Na.length:0;if(pe>=ce||(ce=Math.max(ce,pe*(1048576>pe?2:1.125)>>>0),pe!=0&&(ce=Math.max(ce,256)),pe=A.Na,A.Na=new Uint8Array(ce),0<A.Ra&&A.Na.set(pe.subarray(0,A.Ra),0)),A.Na.subarray&&b.subarray)A.Na.set(b.subarray(D,D+F),J);else for(ce=0;ce<F;ce++)A.Na[J+ce]=b[D+ce];return A.Ra=Math.max(A.Ra,J+F),F},Va(A,b,D){if(D===1?b+=A.position:D===2&&(A.node.mode&61440)===32768&&(b+=A.node.Ra),0>b)throw new Oe(28);return b},ib(A,b,D,F,J){if((A.node.mode&61440)!==32768)throw new Oe(43);if(A=A.node.Na,J&2||!A||A.buffer!==V.buffer){J=!0,F=65536*Math.ceil(b/65536);var ce=ko(65536,F);if(ce&&G.fill(0,ce,ce+F),F=ce,!F)throw new Oe(48);A&&((0<D||D+b<A.length)&&(A.subarray?A=A.subarray(D,D+b):A=Array.prototype.slice.call(A,D,D+b)),V.set(A,F))}else J=!1,F=A.byteOffset;return{Kb:F,Ab:J}},jb(A,b,D,F){return Ue.Ma.write(A,b,0,F,D,!1),0}}},ht=(A,b)=>{var D=0;return A&&(D|=365),b&&(D|=146),D},It=null,St={},mt=[],fr=1,ra=null,an=!1,On=!0,jn={},Oe=class{constructor(A){ze(this,"name","ErrnoError");this.Pa=A}},ci=class{constructor(){ze(this,"gb",{});ze(this,"node",null)}get flags(){return this.gb.flags}set flags(A){this.gb.flags=A}get position(){return this.gb.position}set position(A){this.gb.position=A}},Zt=class{constructor(A,b,D,F){ze(this,"La",{});ze(this,"Ma",{});ze(this,"ab",null);A||(A=this),this.parent=A,this.Xa=A.Xa,this.id=fr++,this.name=b,this.mode=D,this.rdev=F,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(A){A?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(A){A?this.mode|=146:this.mode&=-147}};function sa(A,b={}){if(!A)throw new Oe(44);b.nb??(b.nb=!0),A.charAt(0)==="/"||(A="//"+A);var D=0;e:for(;40>D;D++){A=A.split("/").filter(Ve=>!!Ve);for(var F=It,J="/",ce=0;ce<A.length;ce++){var pe=ce===A.length-1;if(pe&&b.parent)break;if(A[ce]!==".")if(A[ce]==="..")J=lt(J),F=F.parent;else{J=Ye(J+"/"+A[ce]);try{F=zt(F,A[ce])}catch(Ve){if((Ve==null?void 0:Ve.Pa)===44&&pe&&b.Jb)return{path:J};throw Ve}if(!F.ab||pe&&!b.nb||(F=F.ab.root),(F.mode&61440)===40960&&(!pe||b.$a)){if(!F.La.readlink)throw new Oe(52);F=F.La.readlink(F),F.charAt(0)==="/"||(F=lt(J)+"/"+F),A=F+"/"+A.slice(ce+1).join("/");continue e}}}return{path:J,node:F}}throw new Oe(32)}function tr(A){for(var b;;){if(A===A.parent)return A=A.Xa.zb,b?A[A.length-1]!=="/"?`${A}/${b}`:A+b:A;b=b?`${A.name}/${b}`:A.name,A=A.parent}}function ar(A,b){for(var D=0,F=0;F<b.length;F++)D=(D<<5)-D+b.charCodeAt(F)|0;return(A+D>>>0)%ra.length}function Ra(A){var b=ar(A.parent.id,A.name);if(ra[b]===A)ra[b]=A.bb;else for(b=ra[b];b;){if(b.bb===A){b.bb=A.bb;break}b=b.bb}}function zt(A,b){var D=Wt(A.mode)?(D=ja(A,"x"))?D:A.La.lookup?0:2:54;if(D)throw new Oe(D);for(D=ra[ar(A.id,b)];D;D=D.bb){var F=D.name;if(D.parent.id===A.id&&F===b)return D}return A.La.lookup(A,b)}function ya(A,b,D,F){return A=new Zt(A,b,D,F),b=ar(A.parent.id,A.name),A.bb=ra[b],ra[b]=A}function Wt(A){return(A&61440)===16384}function Da(A){var b=["r","w","rw"][A&3];return A&512&&(b+="w"),b}function ja(A,b){if(On)return 0;if(!b.includes("r")||A.mode&292){if(b.includes("w")&&!(A.mode&146)||b.includes("x")&&!(A.mode&73))return 2}else return 2;return 0}function Rr(A,b){if(!Wt(A.mode))return 54;try{return zt(A,b),20}catch{}return ja(A,"wx")}function oe(A,b,D){try{var F=zt(A,b)}catch(J){return J.Pa}if(A=ja(A,"wx"))return A;if(D){if(!Wt(F.mode))return 54;if(F===F.parent||tr(F)==="/")return 10}else if(Wt(F.mode))return 31;return 0}function Me(A){if(!A)throw new Oe(63);return A}function _e(A){if(A=mt[A],!A)throw new Oe(8);return A}function Xe(A,b=-1){if(A=Object.assign(new ci,A),b==-1)e:{for(b=0;4096>=b;b++)if(!mt[b])break e;throw new Oe(33)}return A.fd=b,mt[b]=A}function kt(A,b=-1){var D,F;return A=Xe(A,b),(F=(D=A.Ma)==null?void 0:D.Rb)==null||F.call(D,A),A}function vt(A,b,D){var F=A==null?void 0:A.Ma.Ua;A=F?A:b,F??(F=b.La.Ua),Me(F),F(A,D)}var it={open(A){var b,D;A.Ma=St[A.node.rdev].Ma,(D=(b=A.Ma).open)==null||D.call(b,A)},Va(){throw new Oe(70)}};function st(A,b){St[A]={Ma:b}}function cn(A,b){var D=b==="/";if(D&&It)throw new Oe(10);if(!D&&b){var F=sa(b,{nb:!1});if(b=F.path,F=F.node,F.ab)throw new Oe(10);if(!Wt(F.mode))throw new Oe(54)}b={type:A,Wb:{},zb:b,Ib:[]},A=A.Xa(b),A.Xa=b,b.root=A,D?It=A:F&&(F.ab=b,F.Xa&&F.Xa.Ib.push(b))}function Fe(A,b,D){var F=sa(A,{parent:!0}).node;if(A=et(A),!A)throw new Oe(28);if(A==="."||A==="..")throw new Oe(20);var J=Rr(F,A);if(J)throw new Oe(J);if(!F.La.hb)throw new Oe(63);return F.La.hb(F,A,b,D)}function Z(A,b=438){return Fe(A,b&4095|32768,0)}function xe(A,b=511){return Fe(A,b&1023|16384,0)}function Pe(A,b,D){typeof D>"u"&&(D=b,b=438),Fe(A,b|8192,D)}function Ut(A,b){if(!qt(A))throw new Oe(44);var D=sa(b,{parent:!0}).node;if(!D)throw new Oe(44);b=et(b);var F=Rr(D,b);if(F)throw new Oe(F);if(!D.La.symlink)throw new Oe(63);D.La.symlink(D,b,A)}function ca(A){var b=sa(A,{parent:!0}).node;A=et(A);var D=zt(b,A),F=oe(b,A,!0);if(F)throw new Oe(F);if(!b.La.rmdir)throw new Oe(63);if(D.ab)throw new Oe(10);b.La.rmdir(b,A),Ra(D)}function oa(A){var b=sa(A,{parent:!0}).node;if(!b)throw new Oe(44);A=et(A);var D=zt(b,A),F=oe(b,A,!1);if(F)throw new Oe(F);if(!b.La.unlink)throw new Oe(63);if(D.ab)throw new Oe(10);b.La.unlink(b,A),Ra(D)}function la(A,b){return A=sa(A,{$a:!b}).node,Me(A.La.Ta)(A)}function Ga(A,b,D,F){vt(A,b,{mode:D&4095|b.mode&-4096,ctime:Date.now(),Fb:F})}function va(A,b){A=typeof A=="string"?sa(A,{$a:!0}).node:A,Ga(null,A,b)}function gr(A,b,D){if(Wt(b.mode))throw new Oe(31);if((b.mode&61440)!==32768)throw new Oe(28);var F=ja(b,"w");if(F)throw new Oe(F);vt(A,b,{size:D,timestamp:Date.now()})}function ea(A,b,D=438){if(A==="")throw new Oe(44);if(typeof b=="string"){var F={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if(typeof F>"u")throw Error(`Unknown file open mode: ${b}`);b=F}if(D=b&64?D&4095|32768:0,typeof A=="object")F=A;else{var J=A.endsWith("/");A=sa(A,{$a:!(b&131072),Jb:!0}),F=A.node,A=A.path}var ce=!1;if(b&64)if(F){if(b&128)throw new Oe(20)}else{if(J)throw new Oe(31);F=Fe(A,D|511,0),ce=!0}if(!F)throw new Oe(44);if((F.mode&61440)===8192&&(b&=-513),b&65536&&!Wt(F.mode))throw new Oe(54);if(!ce&&(J=F?(F.mode&61440)===40960?32:Wt(F.mode)&&(Da(b)!=="r"||b&576)?31:ja(F,Da(b)):44))throw new Oe(J);return b&512&&!ce&&(J=F,J=typeof J=="string"?sa(J,{$a:!0}).node:J,gr(null,J,0)),b&=-131713,J=Xe({node:F,path:tr(F),flags:b,seekable:!0,position:0,Ma:F.Ma,Lb:[],error:!1}),J.Ma.open&&J.Ma.open(J),ce&&va(F,D&511),!f.logReadFiles||b&1||A in jn||(jn[A]=1),J}function xn(A){if(A.fd===null)throw new Oe(8);A.ob&&(A.ob=null);try{A.Ma.close&&A.Ma.close(A)}catch(b){throw b}finally{mt[A.fd]=null}A.fd=null}function Dr(A,b,D){if(A.fd===null)throw new Oe(8);if(!A.seekable||!A.Ma.Va)throw new Oe(70);if(D!=0&&D!=1&&D!=2)throw new Oe(28);A.position=A.Ma.Va(A,b,D),A.Lb=[]}function Ts(A,b,D,F,J){if(0>F||0>J)throw new Oe(28);if(A.fd===null)throw new Oe(8);if((A.flags&2097155)===1)throw new Oe(8);if(Wt(A.node.mode))throw new Oe(31);if(!A.Ma.read)throw new Oe(28);var ce=typeof J<"u";if(!ce)J=A.position;else if(!A.seekable)throw new Oe(70);return b=A.Ma.read(A,b,D,F,J),ce||(A.position+=b),b}function ec(A,b,D,F,J){if(0>F||0>J)throw new Oe(28);if(A.fd===null)throw new Oe(8);if((A.flags&2097155)===0)throw new Oe(8);if(Wt(A.node.mode))throw new Oe(31);if(!A.Ma.write)throw new Oe(28);A.seekable&&A.flags&1024&&Dr(A,0,2);var ce=typeof J<"u";if(!ce)J=A.position;else if(!A.seekable)throw new Oe(70);return b=A.Ma.write(A,b,D,F,J,void 0),ce||(A.position+=b),b}function tc(A){var b,D=ea(A,D||0);A=la(A).size;var F=new Uint8Array(A);return Ts(D,F,0,A,0),b=F,xn(D),b}function wa(A,b,D){A=Ye("/dev/"+A);var F=ht(!!b,!!D);wa.yb??(wa.yb=64);var J=wa.yb++<<8|0;st(J,{open(ce){ce.seekable=!1},close(){var ce;(ce=D==null?void 0:D.buffer)!=null&&ce.length&&D(10)},read(ce,pe,Ve,wt){for(var At=0,ua=0;ua<wt;ua++){try{var Pa=b()}catch{throw new Oe(29)}if(Pa===void 0&&At===0)throw new Oe(6);if(Pa==null)break;At++,pe[Ve+ua]=Pa}return At&&(ce.node.atime=Date.now()),At},write(ce,pe,Ve,wt){for(var At=0;At<wt;At++)try{D(pe[Ve+At])}catch{throw new Oe(29)}return wt&&(ce.node.mtime=ce.node.ctime=Date.now()),At}}),Pe(A,F,J)}var Yt={};function Br(A,b,D){if(b.charAt(0)==="/")return b;if(A=A===-100?"/":_e(A).path,b.length==0){if(!D)throw new Oe(44);return A}return A+"/"+b}function Ur(A,b){W[A>>2]=b.dev,W[A+4>>2]=b.mode,ne[A+8>>2]=b.nlink,W[A+12>>2]=b.uid,W[A+16>>2]=b.gid,W[A+20>>2]=b.rdev,$[A+24>>3]=BigInt(b.size),W[A+32>>2]=4096,W[A+36>>2]=b.blocks;var D=b.atime.getTime(),F=b.mtime.getTime(),J=b.ctime.getTime();return $[A+40>>3]=BigInt(Math.floor(D/1e3)),ne[A+48>>2]=D%1e3*1e6,$[A+56>>3]=BigInt(Math.floor(F/1e3)),ne[A+64>>2]=F%1e3*1e6,$[A+72>>3]=BigInt(Math.floor(J/1e3)),ne[A+80>>2]=J%1e3*1e6,$[A+88>>3]=BigInt(b.ino),0}var Wi=void 0,_r=()=>{var A=W[+Wi>>2];return Wi+=4,A},Co=0,An=[0,31,60,91,121,152,182,213,244,274,305,335],No=[0,31,59,90,120,151,181,212,243,273,304,334],ui={},Ss=A=>{var b;Q=A,We||0<Co||((b=f.onExit)==null||b.call(f,A),H=!0),T(A,new De(A))},di=A=>{if(!H)try{if(A(),!(We||0<Co))try{Q=A=Q,Ss(A)}catch(b){b instanceof De||b=="unwind"||T(1,b)}}catch(b){b instanceof De||b=="unwind"||T(1,b)}},ks={},xo=()=>{if(!hr){var A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:x||"./this.program"},b;for(b in ks)ks[b]===void 0?delete A[b]:A[b]=ks[b];var D=[];for(b in A)D.push(`${b}=${A[b]}`);hr=D}return hr},hr,To=A=>{var b=na(A)+1,D=Hn(b);return B(A,G,D,b),D},ac=(A,b,D,F)=>{var J={string:At=>{var ua=0;return At!=null&&At!==0&&(ua=To(At)),ua},array:At=>{var ua=Hn(At.length);return V.set(At,ua),ua}};A=f["_"+A];var ce=[],pe=0;if(F)for(var Ve=0;Ve<F.length;Ve++){var wt=J[D[Ve]];wt?(pe===0&&(pe=nr()),ce[Ve]=wt(F[Ve])):ce[Ve]=F[Ve]}return D=A(...ce),D=function(At){return pe!==0&&un(pe),b==="string"?At?ve(G,At):"":b==="boolean"?!!At:At}(D)},Yi=0,mi=(A,b)=>(b=b==1?Hn(A.length):Ls(A.length),A.subarray||A.slice||(A=new Uint8Array(A)),G.set(A,b),b),Mr,So=[],pn,Pn=A=>{Mr.delete(pn.get(A)),pn.set(A,null),So.push(A)},Fr=(A,b)=>{if(!Mr){Mr=new WeakMap;var D=pn.length;if(Mr)for(var F=0;F<0+D;F++){var J=pn.get(F);J&&Mr.set(J,F)}}if(D=Mr.get(A)||0)return D;if(So.length)D=So.pop();else{try{pn.grow(1)}catch(wt){throw wt instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":wt}D=pn.length-1}try{pn.set(D,A)}catch(wt){if(!(wt instanceof TypeError))throw wt;if(typeof WebAssembly.Function=="function"){var ce=WebAssembly.Function;F={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},J={parameters:[],results:b[0]=="v"?[]:[F[b[0]]]};for(var pe=1;pe<b.length;++pe)J.parameters.push(F[b[pe]]);b=new ce(J,A)}else{F=[1],J=b.slice(0,1),b=b.slice(1),pe={i:127,p:127,j:126,f:125,d:124,e:111},F.push(96);var Ve=b.length;128>Ve?F.push(Ve):F.push(Ve%128|128,Ve>>7);for(ce of b)F.push(pe[ce]);J=="v"?F.push(0):F.push(1,pe[J]),b=[0,97,115,109,1,0,0,0,1],ce=F.length,128>ce?b.push(ce):b.push(ce%128|128,ce>>7),b.push(...F),b.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),b=new WebAssembly.Module(new Uint8Array(b)),b=new WebAssembly.Instance(b,{e:{f:A}}).exports.f}pn.set(D,b)}return Mr.set(A,D),D};ra=Array(4096),cn(Ue,"/"),xe("/tmp"),xe("/home"),xe("/home/web_user"),function(){xe("/dev"),st(259,{read:()=>0,write:(F,J,ce,pe)=>pe,Va:()=>0}),Pe("/dev/null",259),z(1280,ge),z(1536,Ee),Pe("/dev/tty",1280),Pe("/dev/tty1",1536);var A=new Uint8Array(1024),b=0,D=()=>(b===0&&(Pt(A),b=A.byteLength),A[--b]);wa("random",D),wa("urandom",D),xe("/dev/shm"),xe("/dev/shm/tmp")}(),function(){xe("/proc");var A=xe("/proc/self");xe("/proc/self/fd"),cn({Xa(){var b=ya(A,"fd",16895,73);return b.Ma={Va:Ue.Ma.Va},b.La={lookup(D,F){D=+F;var J=_e(D);return D={parent:null,Xa:{zb:"fake"},La:{readlink:()=>J.path},id:D+1},D.parent=D},readdir(){return Array.from(mt.entries()).filter(([,D])=>D).map(([D])=>D.toString())}},b}},"/proc/self/fd")}(),Ue.vb=new Oe(44),Ue.vb.stack="<generic error, no stack>";var fi={a:(A,b,D,F)=>ee(`Assertion failed: ${A?ve(G,A):""}, at: `+[b?b?ve(G,b):"":"unknown filename",D,F?F?ve(G,F):"":"unknown function"]),i:function(A,b){try{return A=A?ve(G,A):"",va(A,b),0}catch(D){if(typeof Yt>"u"||D.name!=="ErrnoError")throw D;return-D.Pa}},L:function(A,b,D){try{if(b=b?ve(G,b):"",b=Br(A,b),D&-8)return-28;var F=sa(b,{$a:!0}).node;return F?(A="",D&4&&(A+="r"),D&2&&(A+="w"),D&1&&(A+="x"),A&&ja(F,A)?-2:0):-44}catch(J){if(typeof Yt>"u"||J.name!=="ErrnoError")throw J;return-J.Pa}},j:function(A,b){try{var D=_e(A);return Ga(D,D.node,b,!1),0}catch(F){if(typeof Yt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},h:function(A){try{var b=_e(A);return vt(b,b.node,{timestamp:Date.now(),Fb:!1}),0}catch(D){if(typeof Yt>"u"||D.name!=="ErrnoError")throw D;return-D.Pa}},b:function(A,b,D){Wi=D;try{var F=_e(A);switch(b){case 0:var J=_r();if(0>J)break;for(;mt[J];)J++;return kt(F,J).fd;case 1:case 2:return 0;case 3:return F.flags;case 4:return J=_r(),F.flags|=J,0;case 12:return J=_r(),q[J+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(ce){if(typeof Yt>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},g:function(A,b){try{var D=_e(A),F=D.node,J=D.Ma.Ta;A=J?D:F,J??(J=F.La.Ta),Me(J);var ce=J(A);return Ur(b,ce)}catch(pe){if(typeof Yt>"u"||pe.name!=="ErrnoError")throw pe;return-pe.Pa}},H:function(A,b){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var D=_e(A);if(0>b||(D.flags&2097155)===0)throw new Oe(28);return gr(D,D.node,b),0}catch(F){if(typeof Yt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},G:function(A,b){try{if(b===0)return-28;var D=na("/")+1;return b<D?-68:(B("/",G,A,b),D)}catch(F){if(typeof Yt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},K:function(A,b){try{return A=A?ve(G,A):"",Ur(b,la(A,!0))}catch(D){if(typeof Yt>"u"||D.name!=="ErrnoError")throw D;return-D.Pa}},C:function(A,b,D){try{return b=b?ve(G,b):"",b=Br(A,b),xe(b,D),0}catch(F){if(typeof Yt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},J:function(A,b,D,F){try{b=b?ve(G,b):"";var J=F&256;return b=Br(A,b,F&4096),Ur(D,J?la(b,!0):la(b))}catch(ce){if(typeof Yt>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},x:function(A,b,D,F){Wi=F;try{b=b?ve(G,b):"",b=Br(A,b);var J=F?_r():0;return ea(b,D,J).fd}catch(ce){if(typeof Yt>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},v:function(A,b,D,F){try{if(b=b?ve(G,b):"",b=Br(A,b),0>=F)return-28;var J=sa(b).node;if(!J)throw new Oe(44);if(!J.La.readlink)throw new Oe(28);var ce=J.La.readlink(J),pe=Math.min(F,na(ce)),Ve=V[D+pe];return B(ce,G,D,F+1),V[D+pe]=Ve,pe}catch(wt){if(typeof Yt>"u"||wt.name!=="ErrnoError")throw wt;return-wt.Pa}},u:function(A){try{return A=A?ve(G,A):"",ca(A),0}catch(b){if(typeof Yt>"u"||b.name!=="ErrnoError")throw b;return-b.Pa}},f:function(A,b){try{return A=A?ve(G,A):"",Ur(b,la(A))}catch(D){if(typeof Yt>"u"||D.name!=="ErrnoError")throw D;return-D.Pa}},r:function(A,b,D){try{return b=b?ve(G,b):"",b=Br(A,b),D===0?oa(b):D===512?ca(b):ee("Invalid flags passed to unlinkat"),0}catch(F){if(typeof Yt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},q:function(A,b,D){try{b=b?ve(G,b):"",b=Br(A,b,!0);var F=Date.now(),J,ce;if(D){var pe=ne[D>>2]+4294967296*W[D+4>>2],Ve=W[D+8>>2];Ve==1073741823?J=F:Ve==1073741822?J=null:J=1e3*pe+Ve/1e6,D+=16,pe=ne[D>>2]+4294967296*W[D+4>>2],Ve=W[D+8>>2],Ve==1073741823?ce=F:Ve==1073741822?ce=null:ce=1e3*pe+Ve/1e6}else ce=J=F;if((ce??J)!==null){A=J;var wt=sa(b,{$a:!0}).node;Me(wt.La.Ua)(wt,{atime:A,mtime:ce})}return 0}catch(At){if(typeof Yt>"u"||At.name!=="ErrnoError")throw At;return-At.Pa}},m:()=>ee(""),l:()=>{We=!1,Co=0},A:function(A,b){A=-9007199254740992>A||9007199254740992<A?NaN:Number(A),A=new Date(1e3*A),W[b>>2]=A.getSeconds(),W[b+4>>2]=A.getMinutes(),W[b+8>>2]=A.getHours(),W[b+12>>2]=A.getDate(),W[b+16>>2]=A.getMonth(),W[b+20>>2]=A.getFullYear()-1900,W[b+24>>2]=A.getDay();var D=A.getFullYear();W[b+28>>2]=(D%4!==0||D%100===0&&D%400!==0?No:An)[A.getMonth()]+A.getDate()-1|0,W[b+36>>2]=-(60*A.getTimezoneOffset()),D=new Date(A.getFullYear(),6,1).getTimezoneOffset();var F=new Date(A.getFullYear(),0,1).getTimezoneOffset();W[b+32>>2]=(D!=F&&A.getTimezoneOffset()==Math.min(F,D))|0},y:function(A,b,D,F,J,ce,pe){J=-9007199254740992>J||9007199254740992<J?NaN:Number(J);try{if(isNaN(J))return 61;var Ve=_e(F);if((b&2)!==0&&(D&2)===0&&(Ve.flags&2097155)!==2)throw new Oe(2);if((Ve.flags&2097155)===1)throw new Oe(2);if(!Ve.Ma.ib)throw new Oe(43);if(!A)throw new Oe(28);var wt=Ve.Ma.ib(Ve,A,J,b,D),At=wt.Kb;return W[ce>>2]=wt.Ab,ne[pe>>2]=At,0}catch(ua){if(typeof Yt>"u"||ua.name!=="ErrnoError")throw ua;return-ua.Pa}},z:function(A,b,D,F,J,ce){ce=-9007199254740992>ce||9007199254740992<ce?NaN:Number(ce);try{var pe=_e(J);if(D&2){if(D=ce,(pe.node.mode&61440)!==32768)throw new Oe(43);if(!(F&2)){var Ve=G.slice(A,A+b);pe.Ma.jb&&pe.Ma.jb(pe,Ve,D,b,F)}}}catch(wt){if(typeof Yt>"u"||wt.name!=="ErrnoError")throw wt;return-wt.Pa}},n:(A,b)=>{if(ui[A]&&(clearTimeout(ui[A].id),delete ui[A]),!b)return 0;var D=setTimeout(()=>{delete ui[A],di(()=>hi(A,performance.now()))},b);return ui[A]={id:D,Xb:b},0},B:(A,b,D,F)=>{var J=new Date().getFullYear(),ce=new Date(J,0,1).getTimezoneOffset();J=new Date(J,6,1).getTimezoneOffset(),ne[A>>2]=60*Math.max(ce,J),W[b>>2]=+(ce!=J),b=pe=>{var Ve=Math.abs(pe);return`UTC${0<=pe?"-":"+"}${String(Math.floor(Ve/60)).padStart(2,"0")}${String(Ve%60).padStart(2,"0")}`},A=b(ce),b=b(J),J<ce?(B(A,G,D,17),B(b,G,F,17)):(B(A,G,F,17),B(b,G,D,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:A=>{var b=G.length;if(A>>>=0,2147483648<A)return!1;for(var D=1;4>=D;D*=2){var F=b*(1+.2/D);F=Math.min(F,A+100663296);e:{F=(Math.min(2147483648,65536*Math.ceil(Math.max(A,F)/65536))-K.buffer.byteLength+65535)/65536|0;try{K.grow(F),Ae();var J=1;break e}catch{}J=void 0}if(J)return!0}return!1},E:(A,b)=>{var D=0;return xo().forEach((F,J)=>{var ce=b+D;for(J=ne[A+4*J>>2]=ce,ce=0;ce<F.length;++ce)V[J++]=F.charCodeAt(ce);V[J]=0,D+=F.length+1}),0},F:(A,b)=>{var D=xo();ne[A>>2]=D.length;var F=0;return D.forEach(J=>F+=J.length+1),ne[b>>2]=F,0},e:function(A){try{var b=_e(A);return xn(b),0}catch(D){if(typeof Yt>"u"||D.name!=="ErrnoError")throw D;return D.Pa}},p:function(A,b){try{var D=_e(A);return V[b]=D.tty?2:Wt(D.mode)?3:(D.mode&61440)===40960?7:4,q[b+2>>1]=0,$[b+8>>3]=BigInt(0),$[b+16>>3]=BigInt(0),0}catch(F){if(typeof Yt>"u"||F.name!=="ErrnoError")throw F;return F.Pa}},w:function(A,b,D,F){try{e:{var J=_e(A);A=b;for(var ce,pe=b=0;pe<D;pe++){var Ve=ne[A>>2],wt=ne[A+4>>2];A+=8;var At=Ts(J,V,Ve,wt,ce);if(0>At){var ua=-1;break e}if(b+=At,At<wt)break;typeof ce<"u"&&(ce+=At)}ua=b}return ne[F>>2]=ua,0}catch(Pa){if(typeof Yt>"u"||Pa.name!=="ErrnoError")throw Pa;return Pa.Pa}},D:function(A,b,D,F){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var J=_e(A);return Dr(J,b,D),$[F>>3]=BigInt(J.position),J.ob&&b===0&&D===0&&(J.ob=null),0}catch(ce){if(typeof Yt>"u"||ce.name!=="ErrnoError")throw ce;return ce.Pa}},I:function(A){var D;try{var b=_e(A);return(D=b.Ma)!=null&&D.fsync?b.Ma.fsync(b):0}catch(F){if(typeof Yt>"u"||F.name!=="ErrnoError")throw F;return F.Pa}},t:function(A,b,D,F){try{e:{var J=_e(A);A=b;for(var ce,pe=b=0;pe<D;pe++){var Ve=ne[A>>2],wt=ne[A+4>>2];A+=8;var At=ec(J,V,Ve,wt,ce);if(0>At){var ua=-1;break e}if(b+=At,At<wt)break;typeof ce<"u"&&(ce+=At)}ua=b}return ne[F>>2]=ua,0}catch(Pa){if(typeof Yt>"u"||Pa.name!=="ErrnoError")throw Pa;return Pa.Pa}},k:Ss},Je;(async function(){var D;function A(F){var J;return Je=F.exports,K=Je.M,Ae(),pn=Je.O,j--,(J=f.monitorRunDependencies)==null||J.call(f,j),j==0&&X&&(F=X,X=null,F()),Je}j++,(D=f.monitorRunDependencies)==null||D.call(f,j);var b={a:fi};return f.instantiateWasm?new Promise(F=>{f.instantiateWasm(b,(J,ce)=>{A(J),F(J.exports)})}):(ie??(ie=f.locateFile?f.locateFile("sql-wasm.wasm",k):k+"sql-wasm.wasm"),A((await Re(b)).instance))})(),f._sqlite3_free=A=>(f._sqlite3_free=Je.P)(A),f._sqlite3_value_text=A=>(f._sqlite3_value_text=Je.Q)(A),f._sqlite3_prepare_v2=(A,b,D,F,J)=>(f._sqlite3_prepare_v2=Je.R)(A,b,D,F,J),f._sqlite3_step=A=>(f._sqlite3_step=Je.S)(A),f._sqlite3_reset=A=>(f._sqlite3_reset=Je.T)(A),f._sqlite3_exec=(A,b,D,F,J)=>(f._sqlite3_exec=Je.U)(A,b,D,F,J),f._sqlite3_finalize=A=>(f._sqlite3_finalize=Je.V)(A),f._sqlite3_column_name=(A,b)=>(f._sqlite3_column_name=Je.W)(A,b),f._sqlite3_column_text=(A,b)=>(f._sqlite3_column_text=Je.X)(A,b),f._sqlite3_column_type=(A,b)=>(f._sqlite3_column_type=Je.Y)(A,b),f._sqlite3_errmsg=A=>(f._sqlite3_errmsg=Je.Z)(A),f._sqlite3_clear_bindings=A=>(f._sqlite3_clear_bindings=Je._)(A),f._sqlite3_value_blob=A=>(f._sqlite3_value_blob=Je.$)(A),f._sqlite3_value_bytes=A=>(f._sqlite3_value_bytes=Je.aa)(A),f._sqlite3_value_double=A=>(f._sqlite3_value_double=Je.ba)(A),f._sqlite3_value_int=A=>(f._sqlite3_value_int=Je.ca)(A),f._sqlite3_value_type=A=>(f._sqlite3_value_type=Je.da)(A),f._sqlite3_result_blob=(A,b,D,F)=>(f._sqlite3_result_blob=Je.ea)(A,b,D,F),f._sqlite3_result_double=(A,b)=>(f._sqlite3_result_double=Je.fa)(A,b),f._sqlite3_result_error=(A,b,D)=>(f._sqlite3_result_error=Je.ga)(A,b,D),f._sqlite3_result_int=(A,b)=>(f._sqlite3_result_int=Je.ha)(A,b),f._sqlite3_result_int64=(A,b)=>(f._sqlite3_result_int64=Je.ia)(A,b),f._sqlite3_result_null=A=>(f._sqlite3_result_null=Je.ja)(A),f._sqlite3_result_text=(A,b,D,F)=>(f._sqlite3_result_text=Je.ka)(A,b,D,F),f._sqlite3_aggregate_context=(A,b)=>(f._sqlite3_aggregate_context=Je.la)(A,b),f._sqlite3_column_count=A=>(f._sqlite3_column_count=Je.ma)(A),f._sqlite3_data_count=A=>(f._sqlite3_data_count=Je.na)(A),f._sqlite3_column_blob=(A,b)=>(f._sqlite3_column_blob=Je.oa)(A,b),f._sqlite3_column_bytes=(A,b)=>(f._sqlite3_column_bytes=Je.pa)(A,b),f._sqlite3_column_double=(A,b)=>(f._sqlite3_column_double=Je.qa)(A,b),f._sqlite3_bind_blob=(A,b,D,F,J)=>(f._sqlite3_bind_blob=Je.ra)(A,b,D,F,J),f._sqlite3_bind_double=(A,b,D)=>(f._sqlite3_bind_double=Je.sa)(A,b,D),f._sqlite3_bind_int=(A,b,D)=>(f._sqlite3_bind_int=Je.ta)(A,b,D),f._sqlite3_bind_text=(A,b,D,F,J)=>(f._sqlite3_bind_text=Je.ua)(A,b,D,F,J),f._sqlite3_bind_parameter_index=(A,b)=>(f._sqlite3_bind_parameter_index=Je.va)(A,b),f._sqlite3_sql=A=>(f._sqlite3_sql=Je.wa)(A),f._sqlite3_normalized_sql=A=>(f._sqlite3_normalized_sql=Je.xa)(A),f._sqlite3_changes=A=>(f._sqlite3_changes=Je.ya)(A),f._sqlite3_close_v2=A=>(f._sqlite3_close_v2=Je.za)(A),f._sqlite3_create_function_v2=(A,b,D,F,J,ce,pe,Ve,wt)=>(f._sqlite3_create_function_v2=Je.Aa)(A,b,D,F,J,ce,pe,Ve,wt),f._sqlite3_update_hook=(A,b,D)=>(f._sqlite3_update_hook=Je.Ba)(A,b,D),f._sqlite3_open=(A,b)=>(f._sqlite3_open=Je.Ca)(A,b);var Ls=f._malloc=A=>(Ls=f._malloc=Je.Da)(A),gi=f._free=A=>(gi=f._free=Je.Ea)(A);f._RegisterExtensionFunctions=A=>(f._RegisterExtensionFunctions=Je.Fa)(A);var ko=(A,b)=>(ko=Je.Ga)(A,b),hi=(A,b)=>(hi=Je.Ha)(A,b),un=A=>(un=Je.Ia)(A),Hn=A=>(Hn=Je.Ja)(A),nr=()=>(nr=Je.Ka)();f.stackSave=()=>nr(),f.stackRestore=A=>un(A),f.stackAlloc=A=>Hn(A),f.cwrap=(A,b,D,F)=>{var J=!D||D.every(ce=>ce==="number"||ce==="boolean");return b!=="string"&&J&&!F?f["_"+A]:(...ce)=>ac(A,b,D,ce)},f.addFunction=Fr,f.removeFunction=Pn,f.UTF8ToString=Be,f.ALLOC_NORMAL=Yi,f.allocate=mi,f.allocateUTF8OnStack=To;function Qn(){function A(){var J;if(f.calledRun=!0,!H){if(!f.noFSInit&&!an){var b,D;an=!0,F??(F=f.stdin),b??(b=f.stdout),D??(D=f.stderr),F?wa("stdin",F):Ut("/dev/tty","/dev/stdin"),b?wa("stdout",null,b):Ut("/dev/tty","/dev/stdout"),D?wa("stderr",null,D):Ut("/dev/tty1","/dev/stderr"),ea("/dev/stdin",0),ea("/dev/stdout",1),ea("/dev/stderr",1)}if(Je.N(),On=!1,(J=f.onRuntimeInitialized)==null||J.call(f),f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;){var F=f.postRun.shift();He.unshift(F)}Te(He)}}if(0<j)X=Qn;else{if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Qe();Te(Ne),0<j?X=Qn:f.setStatus?(f.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>f.setStatus(""),1),A()},1)):A()}}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);0<f.preInit.length;)f.preInit.pop()();return Qn(),m}),a)};r.exports=i,r.exports.default=i}(zf)),zf.exports}var Ex=yx();const qg=qi(Ex);var xy=`
\uFEFFCREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
    "MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY,
    "ProductVersion" TEXT NOT NULL
);

BEGIN TRANSACTION;
CREATE TABLE "Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "Gender" VARCHAR NULL,
    "FirstName" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "BirthDate" TEXT NOT NULL,
    "AddressStreet" VARCHAR NULL,
    "AddressCity" VARCHAR NULL,
    "AddressState" VARCHAR NULL,
    "AddressZipCode" VARCHAR NULL,
    "AddressCountry" VARCHAR NULL,
    "Hobbies" TEXT NULL,
    "EmailPrefix" TEXT NULL,
    "PhoneMobile" TEXT NULL,
    "BankAccountIBAN" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

CREATE TABLE "Services" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Services" PRIMARY KEY,
    "Name" TEXT NULL,
    "Url" TEXT NULL,
    "Logo" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

CREATE TABLE "Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "Username" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "ServiceId" TEXT NOT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Attachment" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachment" PRIMARY KEY,
    "Filename" TEXT NOT NULL,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    CONSTRAINT "FK_Attachment_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Passwords" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passwords" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    CONSTRAINT "FK_Passwords_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_Attachment_CredentialId" ON "Attachment" ("CredentialId");

CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

CREATE INDEX "IX_Passwords_CredentialId" ON "Passwords" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708094944_1.0.0-InitialMigration', '9.0.4');

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708224522_1.0.1-EmptyTestMigration', '9.0.4');

ALTER TABLE "Aliases" RENAME COLUMN "EmailPrefix" TO "Email";

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240711204207_1.0.2-ChangeEmailColumn', '9.0.4');

CREATE TABLE "EncryptionKeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "IsPrimary" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240729105618_1.1.0-AddPkiTables', '9.0.4');

CREATE TABLE "Settings" (
    "Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805073413_1.2.0-AddSettingsTable', '9.0.4');

CREATE TABLE "ef_temp_Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "BirthDate" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Email" TEXT NULL,
    "FirstName" VARCHAR NULL,
    "Gender" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "ef_temp_Aliases" ("Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt")
SELECT "Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt"
FROM "Aliases";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Aliases";

ALTER TABLE "ef_temp_Aliases" RENAME TO "Aliases";

COMMIT;

PRAGMA foreign_keys = 1;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805122422_1.3.0-UpdateIdentityStructure', '9.0.4');

BEGIN TRANSACTION;
CREATE TABLE "ef_temp_Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "ServiceId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "Username" TEXT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Credentials" ("Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username")
SELECT "Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username"
FROM "Credentials";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Credentials";

ALTER TABLE "ef_temp_Credentials" RENAME TO "Credentials";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240812141727_1.3.1-MakeUsernameOptional', '9.0.4');

BEGIN TRANSACTION;
ALTER TABLE "Settings" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Services" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Passwords" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "EncryptionKeys" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Credentials" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Attachment" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Aliases" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240916105320_1.4.0-AddSyncSupport', '9.0.4');

ALTER TABLE "Attachment" RENAME TO "Attachments";

CREATE TABLE "ef_temp_Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Attachments" ("Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt")
SELECT "Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt"
FROM "Attachments";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240917191243_1.4.1-RenameAttachmentsPlural', '9.0.4');

BEGIN TRANSACTION;
CREATE TABLE "TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20250310131554_1.5.0-AddTotpCodes', '9.0.4');


PRAGMA foreign_keys = OFF;

-- Clean up any existing temp tables first
DROP TABLE IF EXISTS "__EFMigrationsHistory_temp";
DROP TABLE IF EXISTS "Aliases_temp";
DROP TABLE IF EXISTS "Services_temp";
DROP TABLE IF EXISTS "EncryptionKeys_temp";
DROP TABLE IF EXISTS "Settings_temp";
DROP TABLE IF EXISTS "Credentials_temp";
DROP TABLE IF EXISTS "Attachments_temp";
DROP TABLE IF EXISTS "Passwords_temp";
DROP TABLE IF EXISTS "TotpCodes_temp";

-- Create backup tables for all data
CREATE TABLE "__EFMigrationsHistory_temp" AS SELECT * FROM "__EFMigrationsHistory";
CREATE TABLE "Aliases_temp" AS SELECT * FROM "Aliases";
CREATE TABLE "Services_temp" AS SELECT * FROM "Services";
CREATE TABLE "EncryptionKeys_temp" AS SELECT * FROM "EncryptionKeys";
CREATE TABLE "Settings_temp" AS SELECT * FROM "Settings";
CREATE TABLE "Credentials_temp" AS SELECT * FROM "Credentials";
CREATE TABLE "Attachments_temp" AS SELECT * FROM "Attachments";
CREATE TABLE "Passwords_temp" AS SELECT * FROM "Passwords";
CREATE TABLE "TotpCodes_temp" AS SELECT * FROM "TotpCodes";

-- Delete orphaned records that do not have a valid FK to the credential object
DELETE FROM "Attachments_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "Passwords_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "TotpCodes_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");

-- Delete orphaned credentials that do not have valid FKs to alias or service objects
DELETE FROM "Credentials_temp" WHERE "AliasId" NOT IN (SELECT "Id" FROM "Aliases_temp");
DELETE FROM "Credentials_temp" WHERE "ServiceId" NOT IN (SELECT "Id" FROM "Services_temp");

-- After cleaning credentials, clean dependent tables again in case we removed credentials
DELETE FROM "Attachments_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "Passwords_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "TotpCodes_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");

-- Drop all existing tables
DROP TABLE "TotpCodes";
DROP TABLE "Passwords";
DROP TABLE "Attachments";
DROP TABLE "Credentials";
DROP TABLE "Settings";
DROP TABLE "EncryptionKeys";
DROP TABLE "Services";
DROP TABLE "Aliases";
DROP TABLE "__EFMigrationsHistory";

-- Recreate tables with proper constraints (no dependencies first)
CREATE TABLE "__EFMigrationsHistory" (
    "MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY,
    "ProductVersion" TEXT NOT NULL
);

CREATE TABLE "Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "BirthDate" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Email" TEXT NULL,
    "FirstName" VARCHAR NULL,
    "Gender" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE "Services" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Services" PRIMARY KEY,
    "Name" TEXT NULL,
    "Url" TEXT NULL,
    "Logo" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE "EncryptionKeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "IsPrimary" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE "Settings" (
    "Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

-- Tables with foreign keys
CREATE TABLE "Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "ServiceId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "Username" TEXT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Passwords" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passwords" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT "FK_Passwords_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE TABLE "TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);


-- Restore data from temp tables
INSERT INTO "__EFMigrationsHistory" SELECT * FROM "__EFMigrationsHistory_temp";
INSERT INTO "Aliases" SELECT * FROM "Aliases_temp";
INSERT INTO "Services" SELECT * FROM "Services_temp";
INSERT INTO "EncryptionKeys" SELECT * FROM "EncryptionKeys_temp";
INSERT INTO "Settings" SELECT * FROM "Settings_temp";
INSERT INTO "Credentials" SELECT * FROM "Credentials_temp";
INSERT INTO "Attachments" SELECT * FROM "Attachments_temp";
INSERT INTO "Passwords" SELECT * FROM "Passwords_temp";
INSERT INTO "TotpCodes" SELECT * FROM "TotpCodes_temp";

-- =====================================================================================
-- Date Format Normalization Migration
-- =====================================================================================
-- This migration normalizes ALL date fields to the standard format: 'yyyy-MM-dd HH:mm:ss.fff'
-- Previously the different clients used different date formats which complicate date parsing.
-- From version 0.24.0 onwards, all new dates are stored in this standard format.

-- Update Aliases table (CreatedAt, UpdatedAt, BirthDate)
UPDATE "Aliases" SET "CreatedAt" =
    CASE
        -- Already in correct format (yyyy-MM-dd HH:mm:ss.fff) - no change
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"

        -- ISO 8601 with milliseconds (yyyy-MM-ddTHH:mm:ss.fffZ) -> Replace T with space, remove Z and everything after .fff
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)

        -- Without milliseconds (yyyy-MM-dd HH:mm:ss or yyyy-MM-ddTHH:mm:ssZ) -> Add .000
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'

        -- Fallback: if none match, keep as-is (edge case)
        ELSE "CreatedAt"
    END;

UPDATE "Aliases" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- BirthDate: Always set time to 00:00:00 (no milliseconds for birth dates)
UPDATE "Aliases" SET "BirthDate" =
    CASE
        -- If empty or already '0001-01-01 00:00:00', keep as-is
        WHEN "BirthDate" = '' OR "BirthDate" = '0001-01-01 00:00:00'
            THEN "BirthDate"

        -- If already in correct format (yyyy-MM-dd 00:00:00), keep as-is
        WHEN "BirthDate" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] 00:00:00'
            THEN "BirthDate"

        -- Extract date part and set time to 00:00:00
        WHEN "BirthDate" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*'
            THEN substr("BirthDate", 1, 10) || ' 00:00:00'

        -- Fallback
        ELSE "BirthDate"
    END;

-- Update Services table (CreatedAt, UpdatedAt)
UPDATE "Services" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Services" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update EncryptionKeys table (CreatedAt, UpdatedAt)
UPDATE "EncryptionKeys" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "EncryptionKeys" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Settings table (CreatedAt, UpdatedAt)
UPDATE "Settings" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Settings" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Credentials table (CreatedAt, UpdatedAt)
UPDATE "Credentials" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Credentials" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Attachments table (CreatedAt, UpdatedAt)
UPDATE "Attachments" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Attachments" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Passwords table (CreatedAt, UpdatedAt)
UPDATE "Passwords" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Passwords" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update TotpCodes table (CreatedAt, UpdatedAt)
UPDATE "TotpCodes" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "TotpCodes" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- =====================================================================================
-- End of Date Format Normalization Migration
-- =====================================================================================

-- Recreate indexes
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");
CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");
CREATE INDEX "IX_Passwords_CredentialId" ON "Passwords" ("CredentialId");
CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

-- Clean up temp tables
DROP TABLE "__EFMigrationsHistory_temp";
DROP TABLE "Aliases_temp";
DROP TABLE "Services_temp";
DROP TABLE "EncryptionKeys_temp";
DROP TABLE "Settings_temp";
DROP TABLE "Credentials_temp";
DROP TABLE "Attachments_temp";
DROP TABLE "Passwords_temp";
DROP TABLE "TotpCodes_temp";

PRAGMA foreign_keys = ON;


CREATE TABLE "Passkeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passkeys" PRIMARY KEY,
    "RpId" TEXT COLLATE NOCASE NOT NULL,
    "UserHandle" BLOB NOT NULL,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "PrfKey" BLOB NULL,
    "DisplayName" TEXT NOT NULL,
    "AdditionalData" BLOB NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Passkeys_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_Passkeys_CredentialId" ON "Passkeys" ("CredentialId");

CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20251014122838_1.6.0-AddPasskeys', '9.0.4');

COMMIT;

PRAGMA foreign_keys = OFF;

BEGIN TRANSACTION;
ALTER TABLE "TotpCodes" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_TotpCodes_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");

ALTER TABLE "Passkeys" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_Passkeys_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_Passkeys_ItemId" ON "Passkeys" ("ItemId");

ALTER TABLE "Attachments" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_Attachments_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_Attachments_ItemId" ON "Attachments" ("ItemId");

CREATE TABLE "FieldDefinitions" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldDefinitions" PRIMARY KEY,
    "FieldType" TEXT NOT NULL,
    "Label" TEXT NOT NULL,
    "IsMultiValue" INTEGER NOT NULL,
    "IsHidden" INTEGER NOT NULL,
    "EnableHistory" INTEGER NOT NULL,
    "Weight" INTEGER NOT NULL,
    "ApplicableToTypes" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Folders" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Folders" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "ParentFolderId" TEXT NULL,
    "Weight" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Folders_Folders_ParentFolderId" FOREIGN KEY ("ParentFolderId") REFERENCES "Folders" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Logos" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Logos" PRIMARY KEY,
    "Source" TEXT NOT NULL,
    "FileData" BLOB NULL,
    "MimeType" TEXT NULL,
    "FetchedAt" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Tags" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Tags" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "Color" TEXT NULL,
    "DisplayOrder" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Items" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Items" PRIMARY KEY,
    "Name" TEXT NULL,
    "ItemType" TEXT NOT NULL,
    "LogoId" TEXT NULL,
    "DeletedAt" TEXT NULL,
    "FolderId" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Items_Folders_FolderId" FOREIGN KEY ("FolderId") REFERENCES "Folders" ("Id") ON DELETE SET NULL,
    CONSTRAINT "FK_Items_Logos_LogoId" FOREIGN KEY ("LogoId") REFERENCES "Logos" ("Id") ON DELETE SET NULL
);

CREATE TABLE "FieldHistories" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldHistories" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "FieldDefinitionId" TEXT NULL,
    "FieldKey" TEXT NULL,
    "ValueSnapshot" TEXT NOT NULL,
    "ChangedAt" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_FieldHistories_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "FieldDefinitions" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_FieldHistories_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

CREATE TABLE "FieldValues" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldValues" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "FieldDefinitionId" TEXT NULL,
    "FieldKey" TEXT NULL,
    "Value" TEXT NULL,
    "Weight" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_FieldValues_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "FieldDefinitions" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_FieldValues_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

CREATE TABLE "ItemTags" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_ItemTags" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "TagId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_ItemTags_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_ItemTags_Tags_TagId" FOREIGN KEY ("TagId") REFERENCES "Tags" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_FieldHistories_FieldDefinitionId" ON "FieldHistories" ("FieldDefinitionId");

CREATE INDEX "IX_FieldHistories_ItemId" ON "FieldHistories" ("ItemId");

CREATE INDEX "IX_FieldValues_FieldDefinitionId" ON "FieldValues" ("FieldDefinitionId");

CREATE INDEX "IX_FieldValues_FieldKey" ON "FieldValues" ("FieldKey");

CREATE INDEX "IX_FieldValues_ItemId" ON "FieldValues" ("ItemId");

CREATE INDEX "IX_FieldValues_ItemId_FieldDefinitionId_Weight" ON "FieldValues" ("ItemId", "FieldDefinitionId", "Weight");

CREATE INDEX "IX_FieldValues_ItemId_FieldKey" ON "FieldValues" ("ItemId", "FieldKey");

CREATE INDEX "IX_Folders_ParentFolderId" ON "Folders" ("ParentFolderId");

CREATE INDEX "IX_Items_FolderId" ON "Items" ("FolderId");

CREATE INDEX "IX_Items_LogoId" ON "Items" ("LogoId");

CREATE INDEX "IX_ItemTags_ItemId" ON "ItemTags" ("ItemId");

CREATE UNIQUE INDEX "IX_ItemTags_ItemId_TagId" ON "ItemTags" ("ItemId", "TagId");

CREATE INDEX "IX_ItemTags_TagId" ON "ItemTags" ("TagId");

CREATE UNIQUE INDEX "IX_Logos_Source" ON "Logos" ("Source");

CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");


                INSERT INTO Items (Id, Name, ItemType, LogoId, FolderId, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  c.Id,
                  s.Name AS Name,
                  CASE
                    WHEN a.Id IS NOT NULL AND (
                      (a.FirstName IS NOT NULL AND a.FirstName != '') OR
                      (a.LastName IS NOT NULL AND a.LastName != '') OR
                      (a.Gender IS NOT NULL AND a.Gender != '') OR
                      (a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
                    ) THEN 'Alias'
                    ELSE 'Login'
                  END AS ItemType,
                  NULL AS LogoId,
                  NULL AS FolderId,
                  c.CreatedAt,
                  c.UpdatedAt,
                  c.IsDeleted
                FROM Credentials c
                LEFT JOIN Services s ON s.Id = c.ServiceId
                LEFT JOIN Aliases a ON a.Id = c.AliasId;
            


                INSERT INTO Logos (Id, Source, FileData, MimeType, FetchedAt, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  -- Extract and normalize hostname: remove protocol, path, lowercase, and www. prefix
                  REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  ) AS Source,
                  s.Logo AS FileData,
                  'image/png' AS MimeType,
                  NULL AS FetchedAt,
                  MIN(s.CreatedAt) AS CreatedAt,
                  MAX(s.UpdatedAt) AS UpdatedAt,
                  0 AS IsDeleted
                FROM Services s
                WHERE s.Logo IS NOT NULL AND s.Url IS NOT NULL AND s.Url != ''
                GROUP BY REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  );
            


                UPDATE Items
                SET LogoId = (
                  SELECT l.Id FROM Logos l
                  INNER JOIN Services s ON REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  ) = l.Source
                  INNER JOIN Credentials c ON c.ServiceId = s.Id
                  WHERE c.Id = Items.Id
                  LIMIT 1
                )
                WHERE EXISTS (
                  SELECT 1 FROM Credentials c
                  INNER JOIN Services s ON s.Id = c.ServiceId
                  WHERE c.Id = Items.Id AND s.Logo IS NOT NULL
                );
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.url' AS FieldKey,
                  s.Url AS Value,
                  0 AS Weight,
                  s.UpdatedAt AS CreatedAt,
                  s.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Services s ON s.Id = c.ServiceId
                WHERE s.Url IS NOT NULL AND s.Url != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.username' AS FieldKey,
                  c.Username AS Value,
                  0 AS Weight,
                  c.UpdatedAt AS CreatedAt,
                  c.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                WHERE c.Username IS NOT NULL AND c.Username != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'notes.content' AS FieldKey,
                  c.Notes AS Value,
                  0 AS Weight,
                  c.UpdatedAt AS CreatedAt,
                  c.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                WHERE c.Notes IS NOT NULL AND c.Notes != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  p.CredentialId AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.password' AS FieldKey,
                  p.Value AS Value,
                  0 AS Weight,
                  p.UpdatedAt AS CreatedAt,
                  p.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Passwords p
                INNER JOIN (
                  SELECT CredentialId, MAX(UpdatedAt) AS MaxUpdated, MAX(Id) AS MaxId
                  FROM Passwords
                  WHERE IsDeleted = 0
                  GROUP BY CredentialId
                ) pm ON p.CredentialId = pm.CredentialId AND p.UpdatedAt = pm.MaxUpdated AND p.Id = pm.MaxId
                WHERE p.IsDeleted = 0;
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.email' AS FieldKey,
                  a.Email AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.Email IS NOT NULL AND a.Email != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.first_name' AS FieldKey,
                  a.FirstName AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.FirstName IS NOT NULL AND a.FirstName != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.last_name' AS FieldKey,
                  a.LastName AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.LastName IS NOT NULL AND a.LastName != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.gender' AS FieldKey,
                  a.Gender AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.Gender IS NOT NULL AND a.Gender != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.birthdate' AS FieldKey,
                  SUBSTR(a.BirthDate, 1, 10) AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%';
            

DROP TABLE "Passwords";

DROP TABLE "Credentials";

DROP TABLE "Aliases";

DROP TABLE "Services";

COMMIT;

PRAGMA foreign_keys = ON;

BEGIN TRANSACTION;
CREATE TABLE "ef_temp_Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Attachments" ("Id", "Blob", "CreatedAt", "Filename", "IsDeleted", "ItemId", "UpdatedAt")
SELECT "Id", "Blob", "CreatedAt", "Filename", "IsDeleted", "ItemId", "UpdatedAt"
FROM "Attachments";

CREATE TABLE "ef_temp_Passkeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passkeys" PRIMARY KEY,
    "AdditionalData" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "DisplayName" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "PrfKey" BLOB NULL,
    "PrivateKey" TEXT NOT NULL,
    "PublicKey" TEXT NOT NULL,
    "RpId" TEXT COLLATE NOCASE NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "UserHandle" BLOB NOT NULL,
    CONSTRAINT "FK_Passkeys_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Passkeys" ("Id", "AdditionalData", "CreatedAt", "DisplayName", "IsDeleted", "ItemId", "PrfKey", "PrivateKey", "PublicKey", "RpId", "UpdatedAt", "UserHandle")
SELECT "Id", "AdditionalData", "CreatedAt", "DisplayName", "IsDeleted", "ItemId", "PrfKey", "PrivateKey", "PublicKey", "RpId", "UpdatedAt", "UserHandle"
FROM "Passkeys";

CREATE TABLE "ef_temp_TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "CreatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_TotpCodes_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_TotpCodes" ("Id", "CreatedAt", "IsDeleted", "ItemId", "Name", "SecretKey", "UpdatedAt")
SELECT "Id", "CreatedAt", "IsDeleted", "ItemId", "Name", "SecretKey", "UpdatedAt"
FROM "TotpCodes";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

DROP TABLE "Passkeys";

ALTER TABLE "ef_temp_Passkeys" RENAME TO "Passkeys";

DROP TABLE "TotpCodes";

ALTER TABLE "ef_temp_TotpCodes" RENAME TO "TotpCodes";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_ItemId" ON "Attachments" ("ItemId");

CREATE INDEX "IX_Passkeys_ItemId" ON "Passkeys" ("ItemId");

CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");

CREATE INDEX "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20251213111207_1.7.0-FieldBasedDataModelUpdate', '9.0.4');

BEGIN TRANSACTION;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20260130221620_2.0.0-MajorVersionBump', '9.0.4');

COMMIT;
`,Ty={1:`\uFEFFBEGIN TRANSACTION;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708224522_1.0.1-EmptyTestMigration', '9.0.4');

COMMIT;`,2:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Aliases" RENAME COLUMN "EmailPrefix" TO "Email";

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240711204207_1.0.2-ChangeEmailColumn', '9.0.4');

COMMIT;`,3:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "EncryptionKeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "IsPrimary" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240729105618_1.1.0-AddPkiTables', '9.0.4');

COMMIT;`,4:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "Settings" (
    "Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805073413_1.2.0-AddSettingsTable', '9.0.4');

COMMIT;`,5:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "ef_temp_Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "BirthDate" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Email" TEXT NULL,
    "FirstName" VARCHAR NULL,
    "Gender" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "ef_temp_Aliases" ("Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt")
SELECT "Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt"
FROM "Aliases";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Aliases";

ALTER TABLE "ef_temp_Aliases" RENAME TO "Aliases";

COMMIT;

PRAGMA foreign_keys = 1;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805122422_1.3.0-UpdateIdentityStructure', '9.0.4');`,6:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "ef_temp_Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "ServiceId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "Username" TEXT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Credentials" ("Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username")
SELECT "Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username"
FROM "Credentials";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Credentials";

ALTER TABLE "ef_temp_Credentials" RENAME TO "Credentials";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240812141727_1.3.1-MakeUsernameOptional', '9.0.4');`,7:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Settings" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Services" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Passwords" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "EncryptionKeys" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Credentials" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Attachment" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Aliases" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240916105320_1.4.0-AddSyncSupport', '9.0.4');

COMMIT;`,8:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Attachment" RENAME TO "Attachments";

CREATE TABLE "ef_temp_Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Attachments" ("Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt")
SELECT "Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt"
FROM "Attachments";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240917191243_1.4.1-RenameAttachmentsPlural', '9.0.4');`,9:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20250310131554_1.5.0-AddTotpCodes', '9.0.4');

COMMIT;`,10:`\uFEFFBEGIN TRANSACTION;

PRAGMA foreign_keys = OFF;

-- Clean up any existing temp tables first
DROP TABLE IF EXISTS "__EFMigrationsHistory_temp";
DROP TABLE IF EXISTS "Aliases_temp";
DROP TABLE IF EXISTS "Services_temp";
DROP TABLE IF EXISTS "EncryptionKeys_temp";
DROP TABLE IF EXISTS "Settings_temp";
DROP TABLE IF EXISTS "Credentials_temp";
DROP TABLE IF EXISTS "Attachments_temp";
DROP TABLE IF EXISTS "Passwords_temp";
DROP TABLE IF EXISTS "TotpCodes_temp";

-- Create backup tables for all data
CREATE TABLE "__EFMigrationsHistory_temp" AS SELECT * FROM "__EFMigrationsHistory";
CREATE TABLE "Aliases_temp" AS SELECT * FROM "Aliases";
CREATE TABLE "Services_temp" AS SELECT * FROM "Services";
CREATE TABLE "EncryptionKeys_temp" AS SELECT * FROM "EncryptionKeys";
CREATE TABLE "Settings_temp" AS SELECT * FROM "Settings";
CREATE TABLE "Credentials_temp" AS SELECT * FROM "Credentials";
CREATE TABLE "Attachments_temp" AS SELECT * FROM "Attachments";
CREATE TABLE "Passwords_temp" AS SELECT * FROM "Passwords";
CREATE TABLE "TotpCodes_temp" AS SELECT * FROM "TotpCodes";

-- Delete orphaned records that do not have a valid FK to the credential object
DELETE FROM "Attachments_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "Passwords_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "TotpCodes_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");

-- Delete orphaned credentials that do not have valid FKs to alias or service objects
DELETE FROM "Credentials_temp" WHERE "AliasId" NOT IN (SELECT "Id" FROM "Aliases_temp");
DELETE FROM "Credentials_temp" WHERE "ServiceId" NOT IN (SELECT "Id" FROM "Services_temp");

-- After cleaning credentials, clean dependent tables again in case we removed credentials
DELETE FROM "Attachments_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "Passwords_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "TotpCodes_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");

-- Drop all existing tables
DROP TABLE "TotpCodes";
DROP TABLE "Passwords";
DROP TABLE "Attachments";
DROP TABLE "Credentials";
DROP TABLE "Settings";
DROP TABLE "EncryptionKeys";
DROP TABLE "Services";
DROP TABLE "Aliases";
DROP TABLE "__EFMigrationsHistory";

-- Recreate tables with proper constraints (no dependencies first)
CREATE TABLE "__EFMigrationsHistory" (
    "MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY,
    "ProductVersion" TEXT NOT NULL
);

CREATE TABLE "Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "BirthDate" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Email" TEXT NULL,
    "FirstName" VARCHAR NULL,
    "Gender" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE "Services" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Services" PRIMARY KEY,
    "Name" TEXT NULL,
    "Url" TEXT NULL,
    "Logo" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE "EncryptionKeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "IsPrimary" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE "Settings" (
    "Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

-- Tables with foreign keys
CREATE TABLE "Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "ServiceId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "Username" TEXT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Passwords" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passwords" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT "FK_Passwords_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE TABLE "TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);


-- Restore data from temp tables
INSERT INTO "__EFMigrationsHistory" SELECT * FROM "__EFMigrationsHistory_temp";
INSERT INTO "Aliases" SELECT * FROM "Aliases_temp";
INSERT INTO "Services" SELECT * FROM "Services_temp";
INSERT INTO "EncryptionKeys" SELECT * FROM "EncryptionKeys_temp";
INSERT INTO "Settings" SELECT * FROM "Settings_temp";
INSERT INTO "Credentials" SELECT * FROM "Credentials_temp";
INSERT INTO "Attachments" SELECT * FROM "Attachments_temp";
INSERT INTO "Passwords" SELECT * FROM "Passwords_temp";
INSERT INTO "TotpCodes" SELECT * FROM "TotpCodes_temp";

-- =====================================================================================
-- Date Format Normalization Migration
-- =====================================================================================
-- This migration normalizes ALL date fields to the standard format: 'yyyy-MM-dd HH:mm:ss.fff'
-- Previously the different clients used different date formats which complicate date parsing.
-- From version 0.24.0 onwards, all new dates are stored in this standard format.

-- Update Aliases table (CreatedAt, UpdatedAt, BirthDate)
UPDATE "Aliases" SET "CreatedAt" =
    CASE
        -- Already in correct format (yyyy-MM-dd HH:mm:ss.fff) - no change
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"

        -- ISO 8601 with milliseconds (yyyy-MM-ddTHH:mm:ss.fffZ) -> Replace T with space, remove Z and everything after .fff
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)

        -- Without milliseconds (yyyy-MM-dd HH:mm:ss or yyyy-MM-ddTHH:mm:ssZ) -> Add .000
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'

        -- Fallback: if none match, keep as-is (edge case)
        ELSE "CreatedAt"
    END;

UPDATE "Aliases" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- BirthDate: Always set time to 00:00:00 (no milliseconds for birth dates)
UPDATE "Aliases" SET "BirthDate" =
    CASE
        -- If empty or already '0001-01-01 00:00:00', keep as-is
        WHEN "BirthDate" = '' OR "BirthDate" = '0001-01-01 00:00:00'
            THEN "BirthDate"

        -- If already in correct format (yyyy-MM-dd 00:00:00), keep as-is
        WHEN "BirthDate" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] 00:00:00'
            THEN "BirthDate"

        -- Extract date part and set time to 00:00:00
        WHEN "BirthDate" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*'
            THEN substr("BirthDate", 1, 10) || ' 00:00:00'

        -- Fallback
        ELSE "BirthDate"
    END;

-- Update Services table (CreatedAt, UpdatedAt)
UPDATE "Services" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Services" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update EncryptionKeys table (CreatedAt, UpdatedAt)
UPDATE "EncryptionKeys" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "EncryptionKeys" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Settings table (CreatedAt, UpdatedAt)
UPDATE "Settings" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Settings" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Credentials table (CreatedAt, UpdatedAt)
UPDATE "Credentials" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Credentials" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Attachments table (CreatedAt, UpdatedAt)
UPDATE "Attachments" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Attachments" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Passwords table (CreatedAt, UpdatedAt)
UPDATE "Passwords" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Passwords" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update TotpCodes table (CreatedAt, UpdatedAt)
UPDATE "TotpCodes" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "TotpCodes" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- =====================================================================================
-- End of Date Format Normalization Migration
-- =====================================================================================

-- Recreate indexes
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");
CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");
CREATE INDEX "IX_Passwords_CredentialId" ON "Passwords" ("CredentialId");
CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

-- Clean up temp tables
DROP TABLE "__EFMigrationsHistory_temp";
DROP TABLE "Aliases_temp";
DROP TABLE "Services_temp";
DROP TABLE "EncryptionKeys_temp";
DROP TABLE "Settings_temp";
DROP TABLE "Credentials_temp";
DROP TABLE "Attachments_temp";
DROP TABLE "Passwords_temp";
DROP TABLE "TotpCodes_temp";

PRAGMA foreign_keys = ON;


CREATE TABLE "Passkeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passkeys" PRIMARY KEY,
    "RpId" TEXT COLLATE NOCASE NOT NULL,
    "UserHandle" BLOB NOT NULL,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "PrfKey" BLOB NULL,
    "DisplayName" TEXT NOT NULL,
    "AdditionalData" BLOB NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Passkeys_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_Passkeys_CredentialId" ON "Passkeys" ("CredentialId");

CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20251014122838_1.6.0-AddPasskeys', '9.0.4');

COMMIT;`,11:`\uFEFFPRAGMA foreign_keys = OFF;

BEGIN TRANSACTION;
ALTER TABLE "TotpCodes" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_TotpCodes_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");

ALTER TABLE "Passkeys" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_Passkeys_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_Passkeys_ItemId" ON "Passkeys" ("ItemId");

ALTER TABLE "Attachments" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_Attachments_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_Attachments_ItemId" ON "Attachments" ("ItemId");

CREATE TABLE "FieldDefinitions" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldDefinitions" PRIMARY KEY,
    "FieldType" TEXT NOT NULL,
    "Label" TEXT NOT NULL,
    "IsMultiValue" INTEGER NOT NULL,
    "IsHidden" INTEGER NOT NULL,
    "EnableHistory" INTEGER NOT NULL,
    "Weight" INTEGER NOT NULL,
    "ApplicableToTypes" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Folders" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Folders" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "ParentFolderId" TEXT NULL,
    "Weight" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Folders_Folders_ParentFolderId" FOREIGN KEY ("ParentFolderId") REFERENCES "Folders" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Logos" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Logos" PRIMARY KEY,
    "Source" TEXT NOT NULL,
    "FileData" BLOB NULL,
    "MimeType" TEXT NULL,
    "FetchedAt" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Tags" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Tags" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "Color" TEXT NULL,
    "DisplayOrder" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Items" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Items" PRIMARY KEY,
    "Name" TEXT NULL,
    "ItemType" TEXT NOT NULL,
    "LogoId" TEXT NULL,
    "DeletedAt" TEXT NULL,
    "FolderId" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Items_Folders_FolderId" FOREIGN KEY ("FolderId") REFERENCES "Folders" ("Id") ON DELETE SET NULL,
    CONSTRAINT "FK_Items_Logos_LogoId" FOREIGN KEY ("LogoId") REFERENCES "Logos" ("Id") ON DELETE SET NULL
);

CREATE TABLE "FieldHistories" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldHistories" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "FieldDefinitionId" TEXT NULL,
    "FieldKey" TEXT NULL,
    "ValueSnapshot" TEXT NOT NULL,
    "ChangedAt" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_FieldHistories_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "FieldDefinitions" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_FieldHistories_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

CREATE TABLE "FieldValues" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldValues" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "FieldDefinitionId" TEXT NULL,
    "FieldKey" TEXT NULL,
    "Value" TEXT NULL,
    "Weight" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_FieldValues_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "FieldDefinitions" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_FieldValues_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

CREATE TABLE "ItemTags" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_ItemTags" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "TagId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_ItemTags_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_ItemTags_Tags_TagId" FOREIGN KEY ("TagId") REFERENCES "Tags" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_FieldHistories_FieldDefinitionId" ON "FieldHistories" ("FieldDefinitionId");

CREATE INDEX "IX_FieldHistories_ItemId" ON "FieldHistories" ("ItemId");

CREATE INDEX "IX_FieldValues_FieldDefinitionId" ON "FieldValues" ("FieldDefinitionId");

CREATE INDEX "IX_FieldValues_FieldKey" ON "FieldValues" ("FieldKey");

CREATE INDEX "IX_FieldValues_ItemId" ON "FieldValues" ("ItemId");

CREATE INDEX "IX_FieldValues_ItemId_FieldDefinitionId_Weight" ON "FieldValues" ("ItemId", "FieldDefinitionId", "Weight");

CREATE INDEX "IX_FieldValues_ItemId_FieldKey" ON "FieldValues" ("ItemId", "FieldKey");

CREATE INDEX "IX_Folders_ParentFolderId" ON "Folders" ("ParentFolderId");

CREATE INDEX "IX_Items_FolderId" ON "Items" ("FolderId");

CREATE INDEX "IX_Items_LogoId" ON "Items" ("LogoId");

CREATE INDEX "IX_ItemTags_ItemId" ON "ItemTags" ("ItemId");

CREATE UNIQUE INDEX "IX_ItemTags_ItemId_TagId" ON "ItemTags" ("ItemId", "TagId");

CREATE INDEX "IX_ItemTags_TagId" ON "ItemTags" ("TagId");

CREATE UNIQUE INDEX "IX_Logos_Source" ON "Logos" ("Source");

CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");


                INSERT INTO Items (Id, Name, ItemType, LogoId, FolderId, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  c.Id,
                  s.Name AS Name,
                  CASE
                    WHEN a.Id IS NOT NULL AND (
                      (a.FirstName IS NOT NULL AND a.FirstName != '') OR
                      (a.LastName IS NOT NULL AND a.LastName != '') OR
                      (a.Gender IS NOT NULL AND a.Gender != '') OR
                      (a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
                    ) THEN 'Alias'
                    ELSE 'Login'
                  END AS ItemType,
                  NULL AS LogoId,
                  NULL AS FolderId,
                  c.CreatedAt,
                  c.UpdatedAt,
                  c.IsDeleted
                FROM Credentials c
                LEFT JOIN Services s ON s.Id = c.ServiceId
                LEFT JOIN Aliases a ON a.Id = c.AliasId;
            


                INSERT INTO Logos (Id, Source, FileData, MimeType, FetchedAt, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  -- Extract and normalize hostname: remove protocol, path, lowercase, and www. prefix
                  REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  ) AS Source,
                  s.Logo AS FileData,
                  'image/png' AS MimeType,
                  NULL AS FetchedAt,
                  MIN(s.CreatedAt) AS CreatedAt,
                  MAX(s.UpdatedAt) AS UpdatedAt,
                  0 AS IsDeleted
                FROM Services s
                WHERE s.Logo IS NOT NULL AND s.Url IS NOT NULL AND s.Url != ''
                GROUP BY REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  );
            


                UPDATE Items
                SET LogoId = (
                  SELECT l.Id FROM Logos l
                  INNER JOIN Services s ON REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  ) = l.Source
                  INNER JOIN Credentials c ON c.ServiceId = s.Id
                  WHERE c.Id = Items.Id
                  LIMIT 1
                )
                WHERE EXISTS (
                  SELECT 1 FROM Credentials c
                  INNER JOIN Services s ON s.Id = c.ServiceId
                  WHERE c.Id = Items.Id AND s.Logo IS NOT NULL
                );
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.url' AS FieldKey,
                  s.Url AS Value,
                  0 AS Weight,
                  s.UpdatedAt AS CreatedAt,
                  s.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Services s ON s.Id = c.ServiceId
                WHERE s.Url IS NOT NULL AND s.Url != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.username' AS FieldKey,
                  c.Username AS Value,
                  0 AS Weight,
                  c.UpdatedAt AS CreatedAt,
                  c.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                WHERE c.Username IS NOT NULL AND c.Username != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'notes.content' AS FieldKey,
                  c.Notes AS Value,
                  0 AS Weight,
                  c.UpdatedAt AS CreatedAt,
                  c.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                WHERE c.Notes IS NOT NULL AND c.Notes != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  p.CredentialId AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.password' AS FieldKey,
                  p.Value AS Value,
                  0 AS Weight,
                  p.UpdatedAt AS CreatedAt,
                  p.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Passwords p
                INNER JOIN (
                  SELECT CredentialId, MAX(UpdatedAt) AS MaxUpdated, MAX(Id) AS MaxId
                  FROM Passwords
                  WHERE IsDeleted = 0
                  GROUP BY CredentialId
                ) pm ON p.CredentialId = pm.CredentialId AND p.UpdatedAt = pm.MaxUpdated AND p.Id = pm.MaxId
                WHERE p.IsDeleted = 0;
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.email' AS FieldKey,
                  a.Email AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.Email IS NOT NULL AND a.Email != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.first_name' AS FieldKey,
                  a.FirstName AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.FirstName IS NOT NULL AND a.FirstName != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.last_name' AS FieldKey,
                  a.LastName AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.LastName IS NOT NULL AND a.LastName != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.gender' AS FieldKey,
                  a.Gender AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.Gender IS NOT NULL AND a.Gender != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.birthdate' AS FieldKey,
                  SUBSTR(a.BirthDate, 1, 10) AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%';
            

DROP TABLE "Passwords";

DROP TABLE "Credentials";

DROP TABLE "Aliases";

DROP TABLE "Services";

COMMIT;

PRAGMA foreign_keys = ON;

BEGIN TRANSACTION;
CREATE TABLE "ef_temp_Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Attachments" ("Id", "Blob", "CreatedAt", "Filename", "IsDeleted", "ItemId", "UpdatedAt")
SELECT "Id", "Blob", "CreatedAt", "Filename", "IsDeleted", "ItemId", "UpdatedAt"
FROM "Attachments";

CREATE TABLE "ef_temp_Passkeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passkeys" PRIMARY KEY,
    "AdditionalData" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "DisplayName" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "PrfKey" BLOB NULL,
    "PrivateKey" TEXT NOT NULL,
    "PublicKey" TEXT NOT NULL,
    "RpId" TEXT COLLATE NOCASE NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "UserHandle" BLOB NOT NULL,
    CONSTRAINT "FK_Passkeys_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Passkeys" ("Id", "AdditionalData", "CreatedAt", "DisplayName", "IsDeleted", "ItemId", "PrfKey", "PrivateKey", "PublicKey", "RpId", "UpdatedAt", "UserHandle")
SELECT "Id", "AdditionalData", "CreatedAt", "DisplayName", "IsDeleted", "ItemId", "PrfKey", "PrivateKey", "PublicKey", "RpId", "UpdatedAt", "UserHandle"
FROM "Passkeys";

CREATE TABLE "ef_temp_TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "CreatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_TotpCodes_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_TotpCodes" ("Id", "CreatedAt", "IsDeleted", "ItemId", "Name", "SecretKey", "UpdatedAt")
SELECT "Id", "CreatedAt", "IsDeleted", "ItemId", "Name", "SecretKey", "UpdatedAt"
FROM "TotpCodes";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

DROP TABLE "Passkeys";

ALTER TABLE "ef_temp_Passkeys" RENAME TO "Passkeys";

DROP TABLE "TotpCodes";

ALTER TABLE "ef_temp_TotpCodes" RENAME TO "TotpCodes";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_ItemId" ON "Attachments" ("ItemId");

CREATE INDEX "IX_Passkeys_ItemId" ON "Passkeys" ("ItemId");

CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");

CREATE INDEX "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20251213111207_1.7.0-FieldBasedDataModelUpdate', '9.0.4');`,12:`\uFEFFBEGIN TRANSACTION;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20260130221620_2.0.0-MajorVersionBump', '9.0.4');

COMMIT;`},Ma=[{revision:1,version:"1.0.0",description:"Initial Migration",releaseVersion:"0.1.0",compatibleUpToVersion:"0.0.0"},{revision:2,version:"1.0.1",description:"Empty Test Migration",releaseVersion:"0.2.0",compatibleUpToVersion:"0.1.0"},{revision:3,version:"1.0.2",description:"Change Email Column",releaseVersion:"0.3.0",compatibleUpToVersion:"0.2.0"},{revision:4,version:"1.1.0",description:"Add Pki Tables",releaseVersion:"0.4.0",compatibleUpToVersion:"0.3.0"},{revision:5,version:"1.2.0",description:"Add Settings Table",releaseVersion:"0.4.0",compatibleUpToVersion:"0.3.0"},{revision:6,version:"1.3.0",description:"Update Identity Structure",releaseVersion:"0.5.0",compatibleUpToVersion:"0.4.0"},{revision:7,version:"1.3.1",description:"Make Username Optional",releaseVersion:"0.5.0",compatibleUpToVersion:"0.4.0"},{revision:8,version:"1.4.0",description:"Add Sync Support",releaseVersion:"0.6.0",compatibleUpToVersion:"0.5.0"},{revision:9,version:"1.4.1",description:"Rename Attachments Plural",releaseVersion:"0.6.0",compatibleUpToVersion:"0.13.0"},{revision:10,version:"1.5.0",description:"Add 2FA Tokens to credentials",releaseVersion:"0.14.0",compatibleUpToVersion:"0.23.0"},{revision:11,version:"1.6.0",description:"Add Passkey support",releaseVersion:"0.24.0",compatibleUpToVersion:"0.25.0"},{revision:12,version:"1.7.0",description:"Update to Field-Based Data Model",releaseVersion:"0.26.0",compatibleUpToVersion:"0.25.0"},{revision:13,version:"2.0.0",description:"Update to Field-Based Data Model",releaseVersion:"0.26.1",compatibleUpToVersion:"0.25.0"}],Wg=class{getCreateVaultSql(){try{return{success:!0,sqlCommands:[xy],version:Ma[Ma.length-1].version,migrationNumber:Ma[Ma.length-1].revision}}catch(r){return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:r instanceof Error?r.message:"Unknown error creating vault SQL"}}}getUpgradeVaultSql(r,e){try{const a=e??Ma[Ma.length-1].revision,i=Ma.find(d=>d.revision===a);if(!i)return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:`Target migration number ${a} not found`};if(r>=a)return{success:!0,sqlCommands:[],version:i.version,migrationNumber:a};const s=Ma.filter(d=>d.revision>r&&d.revision<=a),c=[];for(const d of s){const m=d.revision-1,g=Ty[m];g&&c.push(g)}return{success:!0,sqlCommands:c,version:i.version,migrationNumber:a}}catch(a){return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:a instanceof Error?a.message:"Unknown error generating upgrade SQL"}}}getUpgradeToLatestSql(r){return this.getUpgradeVaultSql(r)}getUpgradeToVersionSql(r,e){const a=Ma.find(i=>i.version===e);return a?this.getUpgradeVaultSql(r,a.revision):{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:`Target version ${e} not found`}}getVersionCheckSql(){return["SELECT name FROM sqlite_master WHERE type='table' AND name='Settings';","SELECT Value FROM Settings WHERE Key = 'vault_version' AND IsDeleted = 0 LIMIT 1;","SELECT Value FROM Settings WHERE Key = 'vault_migration_number' AND IsDeleted = 0 LIMIT 1;"]}getVaultValidationSql(){return`SELECT name FROM sqlite_master WHERE type='table' AND name IN
            ('Aliases', 'Services', 'Credentials', 'Passwords', 'Attachments', 'EncryptionKeys', 'Settings', 'TotpCodes');`}parseVaultVersionInfo(r,e,a){let i="0.0.0",s=0;r&&(e?i=e:(i="1.0.0",s=1),a&&(s=parseInt(a,10)));const c=Ma[Ma.length-1],d=s<c.revision,m=Ma.filter(g=>g.revision>s);return{currentVersion:i,currentMigrationNumber:s,targetVersion:c.version,targetMigrationNumber:c.revision,needsUpgrade:d,availableUpgrades:m}}validateVaultStructure(r){const e=["Aliases","Services","Credentials","Passwords","Attachments","EncryptionKeys","Settings","TotpCodes"];return r.filter(i=>e.includes(i)).length>=5}getAllVersions(){return[...Ma]}getLatestVersion(){return Ma[Ma.length-1]}getMigrationSql(r){return Ty[r]}getCompleteSchemaSql(){return xy}};function Sy(r){const a=/^(\d+)\.(\d+)\.(\d+)$/.exec(r);return a?{major:parseInt(a[1],10),minor:parseInt(a[2],10),patch:parseInt(a[3],10)}:null}function bx(r,e){const a=Sy(r);if(!a)return{isCompatible:!1,databaseVersion:r,isKnownVersion:!1,isMajorVersionDifference:!1,isMinorVersionDifference:!1};const i=Ma.find(f=>f.version===r);if(i)return{isCompatible:!0,databaseVersion:r,clientVersion:i,isKnownVersion:!0,isMajorVersionDifference:!1,isMinorVersionDifference:!1};const s=e?Ma.find(f=>f.version===e)??ky():ky(),c=Sy(s.version);if(!c)return{isCompatible:!1,databaseVersion:r,isKnownVersion:!1,isMajorVersionDifference:!1,isMinorVersionDifference:!1};const d=a.major!==c.major,m=!d&&(a.minor!==c.minor||a.patch!==c.patch);return{isCompatible:!d,databaseVersion:r,clientVersion:s,isKnownVersion:!1,isMajorVersionDifference:d,isMinorVersionDifference:m}}function ky(){return Ma[Ma.length-1]}function Ix(r){const a=/_(\d+\.\d+\.\d+)-/.exec(r);return(a==null?void 0:a[1])??null}class vs extends Error{constructor(e){super(e),this.name="VaultVersionIncompatibleError",Object.setPrototypeOf(this,vs.prototype)}}const vx={loginTitle:"Bei AliasVault anmelden",username:"Benutzername oder E-Mail-Adresse",usernamePlaceholder:"Name / name@unternehmen.com",passwordPlaceholder:"Gib Dein Passwort ein",rememberMe:"Angemeldet bleiben",loginButton:"Anmelden",noAccount:"Noch kein Konto?",createVault:"Neuen Tresor erstellen",twoFactorTitle:"Bitte gib den Sicherheits-Code aus Deiner Authentifizierungs-App ein.",authCode:"Sicherheits-Code",authCodePlaceholder:"Gib den 6-stelligen Sicherheits-Code ein.",verify:"Bestätige",twoFactorNote:"Hinweis: Wenn Du keinen Zugriff auf Dein Authentifizierungsgerät hast, kannst Du Deine Zwei-Faktor-Authentifizierung (2FA) mit einem Wiederherstellungscode zurücksetzen, indem Du Dich über die Website anmeldest.",masterPassword:"Master-Passwort",unlockVault:"Entsperren",unlockWithPin:"Mit PIN entsperren",enterPinToUnlock:"Bitte gib Deine PIN zum Entsperren des Tresors ein",useMasterPassword:"Master-Passwort benutzen",unlockTitle:"Entsperre Deinen Tresor",logoutConfirm:"Bist Du sicher, dass Du Dich abmelden möchtest?",unlockSuccessTitle:"Ihr Tresor wurde erfolgreich entsperrt",unlockSuccessDescription:"Du kannst jetzt die Autofill-Funktion in Anmeldeformularen in Deinem Browser nutzen.",closePopup:"Popup schließen",browseVault:"Tresor durchsuchen",connectingTo:"Verbinde zu",switchAccounts:"Konto wechseln?",loginWithMobile:"Mit mobiler App anmelden",unlockWithMobile:"Mit mobiler App entsperren",scanQrCode:"Scanne diesen QR-Code mit Deiner AliasVault-App, um Dich anzumelden und Deinen Tresor zu entsperren.",errors:{invalidCode:"Bitte gib einen gültigen 6-stelligen Sicherheits-Code ein.",serverError:"Der AliasVault-Server konnte nicht erreicht werden. Bitte versuche es später noch einmal oder kontaktiere den Support, falls das Problem weiterhin besteht.",wrongPassword:"Falsches Passwort. Bitte versuche es erneut.",sessionExpired:"Deine Sitzung ist abgelaufen. Bitte melde Dich erneut an.",mobileLoginRequestExpired:"Zeitüberschreitung für mobile Anmeldeanforderungen. Bitte lade die Seite neu und versuche es erneut."}},wx={vault:"Vault",emails:"E-Mails"},Cx={loading:"Laden...",notice:"Hinweis",error:"Fehler",cancel:"Abbrechen",confirm:"Bestätigen",back:"Zurück",next:"Weiter",use:"Benutzen",add:"Add",delete:"Löschen",undo:"Rückgängig machen",save:"Speichern",saving:"Saving...",create:"Erstellen",or:"Oder",close:"Schließen",logout:"Abmelden",copied:"Kopiert!",openInNewWindow:"In neuem Fenster öffnen",enabled:"Aktiviert",disabled:"Deaktiviert",showPassword:"Passwort anzeigen",hidePassword:"Passwort verbergen",showDetails:"Details anzeigen",hideDetails:"Details ausblenden",copyToClipboard:"In die Zwischenablage kopieren",loadingEmails:"E-Mails werden geladen...",loadingTotpCodes:"TOTP-Codes werden geladen...",attachments:"Anhänge",loadingAttachments:"Anhänge werden geladen...",settings:"Einstellungen",recentEmails:"Neueste E-Mails",credentials:"Zugangsdaten",customFields:"Custom Fields",twoFactorAuthentication:"Zwei-Faktor-Authentifizierung",alias:"Alias",notes:"Notizen",email:"E-Mail-Adresse",username:"Benutzername",password:"Passwort",generate:"Generate",serviceName:"Name des Dienstes",loggedIn:"Angemeldet",syncingVault:"Tresor wird synchronisiert",checkingVaultUpdates:"Prüfe auf Tresor-Updates",syncingUpdatedVault:"Aktualisierter Tresor wird synchronisiert",loadMore:"Mehr laden",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Merging vault changes...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"Der AliasVault-Server konnte nicht erreicht werden. Bitte versuche es später noch einmal oder kontaktiere den Support, falls das Problem weiterhin besteht.",clientVersionNotSupported:"Diese Version der AliasVault-Browser-Erweiterung wird vom Server nicht mehr unterstützt. Bitte aktualisiere Deine Browser-Erweiterung auf die neueste Version.",browserExtensionOutdated:"Diese Browser-Erweiterung ist veraltet und kann nicht verwendet werden, um auf diesen Tresor zuzugreifen. Bitte aktualisiere die Browser-Erweiterung, um fortzufahren.",serverVersionNotSupported:"Der AliasVault-Server muss auf eine neuere Version aktualisiert werden, um diese Browser-Erweiterung nutzen zu können. Bitte kontaktiere den Support, falls Du Hilfe benötigst.",serverVersionTooOld:"Der AliasVault-Server muss auf eine neuere Version aktualisiert werden, um dieses Feature nutzen zu können. Bitte kontaktiere den Administrator des Servers, falls Du Hilfe benötigst.",unknownError:"Ein unbekannter Fehler ist aufgetreten",unknownErrorTryAgain:"Ein unbekannter Fehler ist aufgetreten. Bitte versuche es erneut.",vaultNotAvailable:"Tresor nicht verfügbar",vaultIsLocked:"Der Tresor ist gesperrt.",passwordChanged:"Dein Passwort hat sich seit Deiner letzten Anmeldung geändert. Bitte melden Dich aus Sicherheitsgründen erneut an.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"Ein unbekannter Fehler ist aufgetreten. Bitte versuche es erneut.",ACCOUNT_LOCKED:"Das Konto wurde wegen zu vieler fehlgeschlagener Anmeldeversuche vorübergehend gesperrt. Bitte versuche es später erneut.",ACCOUNT_BLOCKED:"Dein Konto wurde deaktiviert. Wenn Du glaubst, dass dies ein Fehler ist, kontaktiere bitte den Support.",USER_NOT_FOUND:"Ungültiger Benutzername oder Passwort. Bitte versuche es erneut.",INVALID_AUTHENTICATOR_CODE:"Ungültiger Sicherheits-Code. Bitte versuche es erneut.",INVALID_RECOVERY_CODE:"Ungültiger Wiederherstellungscode. Bitte versuche es erneut.",REFRESH_TOKEN_REQUIRED:"Aktualisierungstoken ist erforderlich.",INVALID_REFRESH_TOKEN:"Ungültiger Aktualisierungstoken.",PUBLIC_REGISTRATION_DISABLED:"Die Registrierung eines neuen Kontos ist auf diesem Server derzeit deaktiviert. Bitte kontaktiere den Administrator.",USERNAME_REQUIRED:"Der Benutzername ist erforderlich.",USERNAME_ALREADY_IN_USE:"Benutzername ist bereits vergeben.",USERNAME_AVAILABLE:"Der Benutzername ist verfügbar.",USERNAME_MISMATCH:"Der Benutzername stimmt nicht mit dem aktuellen Benutzer überein.",PASSWORD_MISMATCH:"Das angegebene Passwort stimmt nicht mit Deinem aktuellen Passwort überein.",ACCOUNT_SUCCESSFULLY_DELETED:"Konto erfolgreich gelöscht.",USERNAME_EMPTY_OR_WHITESPACE:"Der Benutzername darf nicht leer sein.",USERNAME_TOO_SHORT:"Der Benutzername ist zu kurz. Er muss mindestens 3 Zeichen lang sein.",USERNAME_TOO_LONG:"Der Benutzername ist zu lang. Er darf höchstens 40 Zeichen lang sein.",USERNAME_INVALID_EMAIL:"Ungültige E-Mail-Adresse.",USERNAME_INVALID_CHARACTERS:"Der Benutzername ist ungültig. Er darf nur aus Buchstaben oder Ziffern bestehen.",VAULT_NOT_UP_TO_DATE:"Dein Tresor ist nicht aktuell. Bitte synchronisiere Deinen Tresor und versuche es erneut.",INTERNAL_SERVER_ERROR:"Internal server error.",VAULT_ERROR:"Der lokale Tresor ist nicht aktuell. Bitte synchronisiere Deinen Tresor, indem Du die Seite aktualisierst, und versuche es erneut."}},Nx={or:"oder",new:"Neu",vaultLocked:"AliasVault ist gesperrt.",creatingNewAlias:"Neuen Alias erstellen...",noMatchesFound:"Keine Treffer gefunden",searchVault:"Tresor durchsuchen...",enterServiceName:"Name des Dienstes eingeben",enterEmailAddress:"E-Mail-Adresse eingeben",enterUsername:"Benutzername eingeben",hideFor1Hour:"Für 1 Stunde ausblenden (aktuelle Seite)",hidePermanently:"Dauerhaft ausblenden (aktuelle Seite)",createRandomAlias:"Zufälligen Alias generieren",createUsernamePassword:"Benutzername/Passwort erstellen",randomAlias:"Zufälliger Alias",usernamePassword:"Benutzername/Passwort",createAndSaveAlias:"Alias erstellen und speichern",createAndSaveCredential:"Zugang erstellen und speichern",randomIdentityDescription:"Generiere eine zufällige Identität mit einer zufälligen E-Mail-Adresse von AliasVault.",randomIdentityDescriptionDropdown:"Zufällige Identität mit zufälliger E-Mail-Adresse",manualCredentialDescription:"Gebe Deine eigene E-Mail-Adresse und Benutzernamen an.",manualCredentialDescriptionDropdown:"Manueller Benutzername und Passwort",failedToCreateIdentity:"Das Erstellen der Identität ist fehlgeschlagen. Bitte versuche es erneut.",enterEmailAndOrUsername:"E-Mail-Adresse und/oder Benutzername eingeben",autofillWithAliasVault:"Autofill mit AliasVault",generateRandomPassword:"Zufälliges Passwort erzeugen (wird in die Zwischenablage kopiert)",generateNewPassword:"Neues Passwort erzeugen",togglePasswordVisibility:"Passwort ein-/ausblenden",passwordCopiedToClipboard:"Passwort in die Zwischenablage kopiert",openAliasVaultToUpgrade:"Zum Aktualisieren AliasVault öffnen ",vaultUpgradeRequired:"Aktualisierung des Tresors erforderlich.",dismissPopup:"Popup schliessen"},xx={title:"Items",itemName:"Name",loginCredentials:"Zugangsdaten",cardInformation:"Card Information",addItem:"Add Item",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Item Details",editItem:"Edit Item",untitled:"Untitled",newFolder:"New Folder",createFolder:"Ordner erstellen",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"Ordner",welcomeTitle:"Welcome to AliasVault!",welcomeDescription:"Du möchtest die AliasVault-Browser-Erweiterung verwenden? Navigiere zu einer Website und verwende das AliasVault-Popup-Fenster um einen neuen Zugang zu erstellen.",noPasskeysFound:"Es wurden noch kein Passkey erstellt. Ein Passkey wird durch den Besuch einer Website erzeugt, die Passkeys als Authentifizierungsmethode anbietet.",noAttachmentsFound:"No items with attachments found",noItemsOfTypeFound:"No {{type}} items found",noMatchingItems:"No matching items found",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(All) Items",passkeys:"Passkeys"},deleteItemTitle:"Eintrag löschen",deleteItemConfirm:"Bist Du sicher, dass Du diesen Eintrag löschen möchtest?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"Schlagwörter",changePasswordComplexity:"Komplexität des Passworts ändern",passwordLength:"Passwortlänge",includeLowercase:"Kleinbuchstaben (a-z)",includeUppercase:"Großbuchstaben (A-Z)",includeNumbers:"Ziffern (0-9)",includeSpecialChars:"Sonderzeichen (!@#$%^&*)",avoidAmbiguousChars:"Mehrdeutige Zeichen (1, l, I, 0, O, etc.) vermeiden",privateEmailTitle:"Private E-Mail-Adresse",privateEmailAliasVaultServer:"AliasVault-Server",privateEmailDescription:"Ende-zu-Ende verschlüsselt, vollständig privat.",publicEmailTitle:"Öffentliche Temp-E-Mail-Anbieter",publicEmailDescription:"Anonyme, aber beschränkte Privatsphäre. E-Mail-Inhalt ist für jeden lesbar, der die Adresse kennt.",validation:{required:"Dieses Feld ist ein Pflichtfeld"}},Tx={selectType:"Add New Item",typeLabel:"Item Type",creating:"Creating",editing:"Editing",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Field Label",enterFieldName:"Enter field name",fieldType:"Field Type",fieldTypes:{text:"Text",hidden:"Hidden (masked text)",email:"E-Mail",url:"URL",phone:"Phone",number:"Number",date:"Date",textArea:"Text Area"},login:{title:"Anmelden"},alias:{title:"Alias"},creditCard:{title:"Credit Card"},note:{title:"Secure Note"}},Sx={"login.url":"Website URL","login.username":"Username","login.password":"Passwort","alias.first_name":"Vorname","alias.last_name":"Nachname","alias.gender":"Geschlecht","alias.birthdate":"Geburtsdatum","login.email":"E-Mail","notes.content":"Notizen","card.cardholder_name":"Cardholder Name","card.number":"Card Number","card.expiry_month":"Expiry Month","card.expiry_year":"Expiry Year","card.cvv":"CVV","card.pin":"PIN"},kx={addCode:"2FA-Code hinzufügen",instructions:"Gib den Secret-Key ein, der von der Website angezeigt wird, bei der Du die Zwei-Faktor-Authentifizierung hinzufügen möchtest.",nameOptional:"Name (optional)",secretKey:"Secret-Key",saveToViewCode:"Speichern, um den Code anzuzeigen",defaultName:"Authenticator",errors:{invalidSecretKey:"Ungültiges Format des Secret-Key"}},Lx={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},Rx={title:"E-Mails",deleteEmailTitle:"E-Mail löschen",deleteEmailConfirm:"Bist Du sicher, dass Du diese E-Mail unwiderruflich löschen möchtest?",from:"Von",to:"An",date:"Datum",emailContent:"Inhalt der E-Mail",emailNotFound:"E-Mail nicht gefunden",noEmails:"Keine E-Mails gefunden",noEmailsDescription:"Du hast bisher keine E-Mails an Deine privaten E-Mail-Adressen erhalten. Neue E-Mails werden hier angezeigt, sobald sie eintreffen.",offlineMessage:"Keine Verbindung. Bitte verbinde Dich mit dem Internet, um Deine E-Mails zu laden.",dateFormat:{justNow:"gerade eben",minutesAgo_single:"vor {{count}} Minute",minutesAgo_plural:"vor {{count}} Minuten",hoursAgo_single:"vor {{count}} Stunde",hoursAgo_plural:"vor {{count}} Stunden",yesterday:"gestern"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Die aktuell gewählte E-Mail-Adresse wird bereits verwendet. Bitte ändere die E-Mail-Adresse, indem Du diese Zugangsdaten bearbeitest.",CLAIM_DOES_NOT_EXIST:"Beim Laden der E-Mails ist ein Fehler aufgetreten. Bitte bearbeite und speichere den Eintrag, um die Datenbank zu synchronisieren, und versuche es dann erneut."}},Dx={serverUrl:"URL des Servers",language:"Sprache",autofillEnabled:"Autofill aktivieren",version:"Version",openWebApp:"Web-App öffnen",lock:"Sperren",globalSettings:"Allgemeine Einstellungen",autofillPopup:"Autofill-Popup",activeOnAllSites:"Auf allen Seiten aktiv (sofern nicht unten deaktiviert)",disabledOnAllSites:"Auf allen Seiten deaktiviert",rightClickContextMenu:"Kontextmenü mit Rechtsklick",autofillMatching:"Autofill-Übereinstimmung",autofillMatchingMode:"Autofill-Übereinstimmungs-Modus",autofillMatchingModeDescription:"Legt fest, welche Zugangsdaten als Übereinstimmung angesehen werden und wird als Vorschlag im Autofill-Popup für eine bestimmte Website angezeigt.",autofillMatchingDefault:"URL + Subdomain + Wildcard-Name",autofillMatchingUrlSubdomain:"URL + Subdomain",autofillMatchingUrlExact:"Nur exakte URL-Domain",siteSpecificSettings:"Seitenspezifische Einstellungen",autofillPopupOn:"Autofill-Popup auf: ",enabledForThisSite:"Für diese Seite aktiviert",disabledForThisSite:"Für diese Seite deaktivieren",temporarilyDisabledUntil:"Vorübergehend deaktiviert bis ",resetAllSiteSettings:"Alle seitenspezifischen Einstellungen zurücksetzen",appearance:"Erscheinungsbild",theme:"Thema",useDefault:"Standard verwenden",light:"Hell",dark:"Dunkel",keyboardShortcuts:"Tastaturkürzel",configureKeyboardShortcuts:"Tastaturkürzel konfigurieren",configure:"Konfigurieren",clipboardClearTimeout:"Zwischenablage nach dem Kopieren automatisch löschen",clipboardClearTimeoutDescription:"Zwischenablage nach dem Kopieren sensibler Daten automatisch löschen",clipboardClearDisabled:"Niemals löschen",clipboardClear5Seconds:"Nach 5 Sekunden löschen",clipboardClear10Seconds:"Nach 10 Sekunden löschen",clipboardClear15Seconds:"Nach 15 Sekunden löschen",autoLockTimeout:"Sperr-Timeout",autoLockTimeoutDescription:"Tresor bei Inaktivität automatisch sperren",autoLockTimeoutHelp:"Der Tresor wird erst nach dem angegebenen Zeitraum der Inaktivität gesperrt (keine Nutzung von Autofill oder Öffnen des Erweiterungs-Popups). Der Tresor wird immer gesperrt, wenn der Browser geschlossen wird, unabhängig von dieser Einstellung.",autoLockNever:"Niemals",autoLock15Seconds:"15 Sekunden",autoLock1Minute:"1 Minute",autoLock5Minutes:"5 Minuten",autoLock15Minutes:"15 Minuten",autoLock30Minutes:"30 Minuten",autoLock1Hour:"1 Stunde",autoLock4Hours:"4 Stunden",autoLock8Hours:"8 Stunden",autoLock24Hours:"24 Stunden",versionPrefix:"Version ",autofillSettings:"Autofill-Einstellungen",clipboardSettings:"Zwischenablage-Einstellungen",contextMenuSettings:"Kontextmenü-Einstellungen",passkeySettings:"Passkey-Einstellungen",contextMenu:"Kontextmenü",contextMenuEnabled:"Kontextmenü ist aktiviert",contextMenuDisabled:"Kontextmenü ist deaktiviert",contextMenuDescription:"Rechtsklicke auf Eingabefelder, um auf AliasVault-Optionen zuzugreifen",selectLanguage:"Sprache auswählen",serverConfiguration:"Serverkonfiguration",serverConfigurationDescription:"AliasVault-Server-URL für selbstgehostete Instanzen konfigurieren",customApiUrl:"API-URL",customClientUrl:"Client-URL",apiUrlHint:"Die API-Endpunkt-URL (normalerweise Client-URL + /api)",clientUrlHint:"Die URL der Webschnittstelle Deiner selbst gehosteten Instanz",autofillSettingsDescription:"Aktiviere oder deaktiviere das Autofill-Popup auf Webseiten",autofillEnabledDescription:"Autofill-Vorschläge werden auf den Anmeldeformularen angezeigt",autofillDisabledDescription:"Autofill-Vorschläge sind global deaktiviert",languageSettings:"Sprache",validation:{apiUrlRequired:"API-URL ist erforderlich",apiUrlInvalid:"Bitte gib eine gültige API-URL ein",clientUrlRequired:"Client-URL ist erforderlich",clientUrlInvalid:"Bitte gib eine gültige Client-URL ein"},unlockMethod:{title:"Methode zum Entsperren des Tresors",introText:"Wähle, wie Du Deinen Tresor entsperren möchtest. Du kannst Dein Master-Passwort verwenden (immer verfügbar) oder einen PIN-Code für einen schnelleren Zugriff einrichten. Nach drei fehlgeschlagenen PIN-Versuchen musst Du Dein Master-Passwort verwenden.",password:"Master-Passwort",pin:"PIN-Code",pinDescription:"Tresor mit PIN entsperren",setupPin:"PIN-Code einrichten",enterNewPinDescription:"PIN-Code aus mindestens 6 Ziffern eingeben",confirmPin:"PIN bestätigen",confirmPinDescription:"Zur Bestätigung PIN erneut eingeben",invalidPinFormat:"Ungültiges PIN-Format",pinMismatch:"PINs stimmen nicht überein",incorrectPin:"Falsche PIN. {{attemptsRemaining}} verbleibende Versuche.",incorrectPinSingular:"Falsche PIN. Ein Versuch übrig.",enableSuccess:"PIN-Sperre erfolgreich aktiviert!",pinLocked:"Die PIN-Sperre wurde deaktiviert. Bitte nutze Dein Master-Passwort, um Deinen Tresor zu entsperren.",pinSecurityWarning:"Die PIN-Entsperre in der Browser-Erweiterung kann weniger sicher Dein Master-Passwort sein, da PINs typischerweise eine niedrigere Entropie haben und möglicherweise gebruteforced werden können, wenn Dein Gerät kompromittiert wird. Benutze es nur auf Geräten, denen Du vollkommen vertraust."}},Bx={passkey:"Passkey",site:"Seite",helpText:"Passkeys werden auf der Webseite erzeugt. Sie können nicht manuell erstellt oder bearbeitet werden. Um diesen Passkey zu entfernen, kannst Du ihn von diesem Zugang löschen. Um einen Passkey zu ersetzen oder neu zu erstellen, rufe die entsprechende Webseite auf und folge den dortigen Anweisungen.",passkeyMarkedForDeletion:"Passkey zum Löschen vorgemerkt",passkeyWillBeDeleted:"Dieser Passkey wird gelöscht, wenn Du den Zugang speicherst.",useBrowserPasskey:"Browser-Passkey verwenden",bypass:{description:"Wie lange möchtest Du den Passkey-Anbieter des Browsers für {{origin}} verwenden?",thisTimeOnly:"Nur dieses Mal",alwaysForSite:"Für diese Seite immer"},authenticate:{title:"Mit Passkey anmelden",signInFor:"Mit Passkey anmelden für",selectPasskey:"Wähle einen Passkey zum Anmelden aus:",noPasskeysFound:"Kein Passkey für diese Seite gefunden"},create:{title:"Passkey erstellen",createFor:"Neuen Passkey erstellen für",titleLabel:"Titel",titlePlaceholder:"Gib einen Namen für diesen Passkey ein",createButton:"Passkey erstellen",selectPasskeyToReplace:"Wähle einen Passkey zum Ersetzen:",createNewPasskey:"Neuen Passkey erstellen",replacingPasskey:"Ersetzen des Passkeys: {{displayName}}",confirmReplace:"Ersetzen bestätigen",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Passkey-Anbieter",passkeyProviderOn:"Passkey-Anbieter an "}},Ux={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},_x={title:"Tresor aktualisieren",subtitle:"AliasVault wurde aktualisiert. Dadurch muss auch Dein Tresor aktualisiert werden. Dies sollte nur wenige Sekunden dauern.",versionInformation:"Versionsinformationen",yourVault:"Version Deines Tresors:",newVersion:"Neue verfügbare Version:",upgrade:"Tresor aktualisieren",upgrading:"Aktualisieren...",whatsNew:"Neu in dieser Version",whatsNewDescription:"Eine Aktualisierung ist erforderlich, um die folgenden Änderungen zu unterstützen:",noDescriptionAvailable:"Für diese Version ist keine Beschreibung vorhanden.",alerts:{unableToGetVersionInfo:"Versionsinformationen konnten nicht abgerufen werden. Bitte versuche es erneut.",selfHostedServer:"Selbstgehosteter Server",selfHostedWarning:"Nutzt Du einen selbst gehosteten Server, musst Du Deine Instanz ebenfalls updaten. Andernfalls kannst Du Dich im Web-Client nicht mehr anmelden.",continueUpgrade:"Aktualisierung fortsetzen",upgradeFailed:"Aktualisierung fehlgeschlagen",failedToApplyMigration:"Migration fehlgeschlagen ({{current}} von {{total}})"}},Mx={unsyncedChangesTitle:"Unsynced Changes",unsyncedChangesWarning:"You have unsynced changes that will be lost if you log out now. Are you sure you want to continue?",logoutAnyway:"Log out anyway"},Fx={auth:vx,menu:wx,common:Cx,content:Nx,items:xx,itemTypes:Tx,fieldLabels:Sx,totp:kx,attachmentUploader:Lx,emails:Rx,settings:Dx,passkeys:Bx,recentlyDeleted:Ux,upgrade:_x,logout:Mx},Ox={loginTitle:"Log in to AliasVault",username:"Username or email",usernamePlaceholder:"name / name@company.com",passwordPlaceholder:"Enter your password",rememberMe:"Remember me",loginButton:"Log in",noAccount:"No account yet?",createVault:"Create new vault",twoFactorTitle:"Please enter the authentication code from your authenticator app.",authCode:"Authentication Code",authCodePlaceholder:"Enter 6-digit code",verify:"Verify",twoFactorNote:"Note: if you don't have access to your authenticator device, you can reset your 2FA with a recovery code by logging in via the website.",masterPassword:"Master Password",unlockVault:"Unlock",unlockWithPin:"Unlock with PIN",enterPinToUnlock:"Enter your PIN to unlock your vault",useMasterPassword:"Use Master Password",unlockTitle:"Unlock Your Vault",logoutConfirm:"Are you sure you want to logout?",unlockSuccessTitle:"Your vault is successfully unlocked",unlockSuccessDescription:"You can now use autofill in login forms in your browser.",closePopup:"Close this popup",browseVault:"Browse vault contents",connectingTo:"Connecting to",switchAccounts:"Switch accounts?",loginWithMobile:"Log in using Mobile App",unlockWithMobile:"Unlock using Mobile App",scanQrCode:"Scan this QR code with your AliasVault mobile app to log in and unlock your vault.",errors:{invalidCode:"Please enter a valid 6-digit authentication code.",serverError:"Could not reach AliasVault server. Please try again later or contact support if the problem persists.",wrongPassword:"Incorrect password. Please try again.",sessionExpired:"Your session has expired. Please log in again.",mobileLoginRequestExpired:"Mobile login request timed out. Please reload the page and try again."}},jx={vault:"Vault",emails:"Emails"},Px={loading:"Loading...",notice:"Notice",error:"Error",cancel:"Cancel",confirm:"Confirm",back:"Back",next:"Next",use:"Use",add:"Add",delete:"Delete",undo:"Undo",save:"Save",saving:"Saving...",create:"Create",or:"Or",close:"Close",logout:"Logout",copied:"Copied!",openInNewWindow:"Open in new window",enabled:"Enabled",disabled:"Disabled",showPassword:"Show password",hidePassword:"Hide password",showDetails:"Show details",hideDetails:"Hide details",copyToClipboard:"Copy to clipboard",loadingEmails:"Loading emails...",loadingTotpCodes:"Loading TOTP codes...",attachments:"Attachments",loadingAttachments:"Loading attachments...",settings:"Settings",recentEmails:"Recent emails",credentials:"Credentials",customFields:"Custom Fields",twoFactorAuthentication:"Two-factor authentication",alias:"Alias",notes:"Notes",email:"Email",username:"Username",password:"Password",generate:"Generate",serviceName:"Service Name",loggedIn:"Logged in",syncingVault:"Syncing vault",checkingVaultUpdates:"Checking for vault updates",syncingUpdatedVault:"Syncing updated vault",loadMore:"Load more",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Merging vault changes...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"The AliasVault server is not available. Please try again later or contact support if the problem persists.",clientVersionNotSupported:"This version of the AliasVault browser extension is not supported by the server anymore. Please update your browser extension to the latest version.",browserExtensionOutdated:"This browser extension is outdated and cannot be used to access this vault. Please update this browser extension to continue.",serverVersionNotSupported:"The AliasVault server needs to be updated to a newer version in order to use this browser extension. Please contact support if you need help.",serverVersionTooOld:"The AliasVault server needs to be updated to a newer version in order to use this feature. Please contact the server admin if you need help.",unknownError:"An unknown error occurred",unknownErrorTryAgain:"An unknown error occurred. Please try again.",vaultNotAvailable:"Vault not available",vaultIsLocked:"Vault is locked",passwordChanged:"Your password has changed since the last time you logged in. Please login again for security reasons.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"An unknown error occurred. Please try again.",ACCOUNT_LOCKED:"Account temporarily locked due to too many failed attempts. Please try again later.",ACCOUNT_BLOCKED:"Your account has been disabled. If you believe this is a mistake, please contact support.",USER_NOT_FOUND:"Invalid username or password. Please try again.",INVALID_AUTHENTICATOR_CODE:"Invalid authenticator code. Please try again.",INVALID_RECOVERY_CODE:"Invalid recovery code. Please try again.",REFRESH_TOKEN_REQUIRED:"Refresh token is required.",INVALID_REFRESH_TOKEN:"Invalid refresh token.",PUBLIC_REGISTRATION_DISABLED:"New account registration is currently disabled on this server. Please contact the administrator.",USERNAME_REQUIRED:"Username is required.",USERNAME_ALREADY_IN_USE:"Username is already in use.",USERNAME_AVAILABLE:"Username is available.",USERNAME_MISMATCH:"Username does not match the current user.",PASSWORD_MISMATCH:"The provided password does not match your current password.",ACCOUNT_SUCCESSFULLY_DELETED:"Account successfully deleted.",USERNAME_EMPTY_OR_WHITESPACE:"Username cannot be empty or whitespace.",USERNAME_TOO_SHORT:"Username too short: must be at least 3 characters long.",USERNAME_TOO_LONG:"Username too long: cannot be longer than 40 characters.",USERNAME_INVALID_EMAIL:"Invalid email address.",USERNAME_INVALID_CHARACTERS:"Username is invalid, can only contain letters or digits.",VAULT_NOT_UP_TO_DATE:"Your vault is not up-to-date. Please synchronize your vault and try again.",INTERNAL_SERVER_ERROR:"Internal server error.",VAULT_ERROR:"The local vault is not up-to-date. Please synchronize your vault by refreshing the page and try again."}},Hx={or:"or",new:"New",vaultLocked:"AliasVault is locked.",creatingNewAlias:"Creating new alias...",noMatchesFound:"No matches found",searchVault:"Search vault...",enterServiceName:"Enter service name",enterEmailAddress:"Enter email address",enterUsername:"Enter username",hideFor1Hour:"Hide for 1 hour (current site)",hidePermanently:"Hide permanently (current site)",createRandomAlias:"Create random alias",createUsernamePassword:"Create username/password",randomAlias:"Random alias",usernamePassword:"Username/password",createAndSaveAlias:"Create and save alias",createAndSaveCredential:"Create and save credential",randomIdentityDescription:"Generate a random identity with a random email address accessible in AliasVault.",randomIdentityDescriptionDropdown:"Random identity with random email",manualCredentialDescription:"Specify your own email address and username.",manualCredentialDescriptionDropdown:"Manual username and password",failedToCreateIdentity:"Failed to create identity. Please try again.",enterEmailAndOrUsername:"Enter email and/or username",autofillWithAliasVault:"Autofill with AliasVault",generateRandomPassword:"Generate random password (copy to clipboard)",generateNewPassword:"Generate new password",togglePasswordVisibility:"Toggle password visibility",passwordCopiedToClipboard:"Password copied to clipboard",openAliasVaultToUpgrade:"Open AliasVault to upgrade",vaultUpgradeRequired:"Vault upgrade required.",dismissPopup:"Dismiss popup"},Qx={title:"Items",itemName:"Name",loginCredentials:"Login Credentials",cardInformation:"Card Information",addItem:"Add Item",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Item Details",editItem:"Edit Item",untitled:"Untitled",newFolder:"New Folder",createFolder:"Create Folder",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"Folder",welcomeTitle:"Welcome to AliasVault!",welcomeDescription:"To use the AliasVault browser extension: navigate to a website and use the AliasVault autofill popup to create a new credential.",noPasskeysFound:"No passkeys have been created yet. Passkeys are created by visiting a website that offers passkeys as an authentication method.",noAttachmentsFound:"No items with attachments found",noItemsOfTypeFound:"No {{type}} items found",noMatchingItems:"No matching items found",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(All) Items",passkeys:"Passkeys"},deleteItemTitle:"Delete Item",deleteItemConfirm:"Are you sure you want to delete this item?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"Tags",changePasswordComplexity:"Change password complexity",passwordLength:"Password length",includeLowercase:"Include lowercase letters",includeUppercase:"Include uppercase letters",includeNumbers:"Include numbers",includeSpecialChars:"Include special characters",avoidAmbiguousChars:"Avoid ambiguous characters (o, 0, etc.)",privateEmailTitle:"Private Email",privateEmailAliasVaultServer:"AliasVault server",privateEmailDescription:"E2E encrypted, fully private.",publicEmailTitle:"Public Temp Email Providers",publicEmailDescription:"Anonymous but limited privacy. Email content is readable by anyone that knows the address.",validation:{required:"This field is required"}},zx={selectType:"Add New Item",typeLabel:"Item Type",creating:"Creating",editing:"Editing",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Field Label",enterFieldName:"Enter field name",fieldType:"Field Type",fieldTypes:{text:"Text",hidden:"Hidden (masked text)",email:"Email",url:"URL",phone:"Phone",number:"Number",date:"Date",textArea:"Text Area"},login:{title:"Login"},alias:{title:"Alias"},creditCard:{title:"Credit Card"},note:{title:"Secure Note"}},Vx={"login.url":"Website URL","login.username":"Username","login.password":"Password","alias.first_name":"First Name","alias.last_name":"Last Name","alias.gender":"Gender","alias.birthdate":"Birthdate","login.email":"Email","notes.content":"Notes","card.cardholder_name":"Cardholder Name","card.number":"Card Number","card.expiry_month":"Expiry Month","card.expiry_year":"Expiry Year","card.cvv":"CVV","card.pin":"PIN"},Kx={addCode:"Add 2FA Code",instructions:"Enter the secret key shown by the website where you want to add two-factor authentication.",nameOptional:"Name (optional)",secretKey:"Secret Key",saveToViewCode:"Save to view code",defaultName:"Authenticator",errors:{invalidSecretKey:"Invalid secret key format."}},Gx={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},qx={title:"Emails",deleteEmailTitle:"Delete Email",deleteEmailConfirm:"Are you sure you want to permanently delete this email?",from:"From",to:"To",date:"Date",emailContent:"Email content",emailNotFound:"Email not found",noEmails:"No emails found",noEmailsDescription:"You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",offlineMessage:"You are offline. Please connect to the internet to load your emails.",dateFormat:{justNow:"just now",minutesAgo_single:"{{count}} min ago",minutesAgo_plural:"{{count}} mins ago",hoursAgo_single:"{{count}} hr ago",hoursAgo_plural:"{{count}} hrs ago",yesterday:"yesterday"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"The current chosen email address is already in use. Please change the email address by editing this credential.",CLAIM_DOES_NOT_EXIST:"An error occurred while trying to load the emails. Please try to edit and save the credential entry to synchronize the database, then try again."}},Wx={serverUrl:"Server URL",language:"Language",autofillEnabled:"Enable Autofill",version:"Version",openWebApp:"Open web app",lock:"Lock",globalSettings:"Global Settings",autofillPopup:"Autofill popup",activeOnAllSites:"Active on all sites (unless disabled below)",disabledOnAllSites:"Disabled on all sites",rightClickContextMenu:"Right-click context menu",autofillMatching:"Autofill Matching",autofillMatchingMode:"Autofill matching mode",autofillMatchingModeDescription:"Determines which credentials are considered a match and shown as suggestions in the autofill popup for a given website.",autofillMatchingDefault:"URL + subdomain + name wildcard",autofillMatchingUrlSubdomain:"URL + subdomain",autofillMatchingUrlExact:"Exact URL domain only",siteSpecificSettings:"Site-Specific Settings",autofillPopupOn:"Autofill popup on: ",enabledForThisSite:"Enabled for this site",disabledForThisSite:"Disabled for this site",temporarilyDisabledUntil:"Temporarily disabled until ",resetAllSiteSettings:"Reset all site-specific settings",appearance:"Appearance",theme:"Theme",useDefault:"Use default",light:"Light",dark:"Dark",keyboardShortcuts:"Keyboard Shortcuts",configureKeyboardShortcuts:"Configure keyboard shortcuts",configure:"Configure",clipboardClearTimeout:"Clear clipboard after copying",clipboardClearTimeoutDescription:"Automatically clear the clipboard after copying sensitive data",clipboardClearDisabled:"Never clear",clipboardClear5Seconds:"Clear after 5 seconds",clipboardClear10Seconds:"Clear after 10 seconds",clipboardClear15Seconds:"Clear after 15 seconds",autoLockTimeout:"Auto-lock Timeout",autoLockTimeoutDescription:"Automatically lock the vault after a period of inactivity",autoLockTimeoutHelp:"The vault will only lock after the specified period of inactivity (no autofill usage or extension popup opened). The vault will always lock when the browser is closed, regardless of this setting.",autoLockNever:"Never",autoLock15Seconds:"15 seconds",autoLock1Minute:"1 minute",autoLock5Minutes:"5 minutes",autoLock15Minutes:"15 minutes",autoLock30Minutes:"30 minutes",autoLock1Hour:"1 hour",autoLock4Hours:"4 hours",autoLock8Hours:"8 hours",autoLock24Hours:"24 hours",versionPrefix:"Version ",autofillSettings:"Autofill Settings",clipboardSettings:"Clipboard Settings",contextMenuSettings:"Context Menu Settings",passkeySettings:"Passkey Settings",contextMenu:"Context Menu",contextMenuEnabled:"Context menu is enabled",contextMenuDisabled:"Context menu is disabled",contextMenuDescription:"Right-click on input fields to access AliasVault options",selectLanguage:"Select Language",serverConfiguration:"Server Configuration",serverConfigurationDescription:"Configure the AliasVault server URL for self-hosted instances",customApiUrl:"API URL",customClientUrl:"Client URL",apiUrlHint:"The API endpoint URL (usually client URL + /api)",clientUrlHint:"The web interface URL of your self-hosted instance",autofillSettingsDescription:"Enable or disable the autofill popup on web pages",autofillEnabledDescription:"Autofill suggestions will appear on login forms",autofillDisabledDescription:"Autofill suggestions are disabled globally",languageSettings:"Language",validation:{apiUrlRequired:"API URL is required",apiUrlInvalid:"Please enter a valid API URL",clientUrlRequired:"Client URL is required",clientUrlInvalid:"Please enter a valid client URL"},unlockMethod:{title:"Vault Unlock Method",introText:"Choose how you want to unlock your vault. You can use your master password (always available) or set up a PIN code for faster access. After 3 failed PIN attempts, you'll need to use your master password.",password:"Master Password",pin:"PIN Code",pinDescription:"Unlock vault with PIN code",setupPin:"Setup PIN Code",enterNewPinDescription:"Enter a PIN code consisting of minimum 6 digits",confirmPin:"Confirm PIN",confirmPinDescription:"Enter your PIN again to confirm",invalidPinFormat:"Invalid PIN format",pinMismatch:"PINs do not match",incorrectPin:"Incorrect PIN. {{attemptsRemaining}} attempts remaining.",incorrectPinSingular:"Incorrect PIN. 1 attempt remaining.",enableSuccess:"PIN unlock enabled successfully!",pinLocked:"PIN unlock has been disabled. Please use your master password to unlock your vault.",pinSecurityWarning:"PIN unlock in the browser extension can be less secure than your master password, as PINs typically have lower entropy and may be brute-forced if your device is compromised. Use it only on devices you fully trust."}},Yx={passkey:"Passkey",site:"Site",helpText:"Passkeys are created on the website when prompted. They cannot be manually edited. To remove this passkey, you can delete it from this credential. To replace this passkey or create a new one, visit the website and follow its prompts.",passkeyMarkedForDeletion:"Passkey marked for deletion",passkeyWillBeDeleted:"This passkey will be deleted when you save this credential.",useBrowserPasskey:"Use Browser Passkey",bypass:{description:"How long would you like to use the browser's passkey provider for {{origin}}?",thisTimeOnly:"This time only",alwaysForSite:"Always for this site"},authenticate:{title:"Sign in with Passkey",signInFor:"Sign in with passkey for",selectPasskey:"Select a passkey to sign in:",noPasskeysFound:"No passkeys found for this site"},create:{title:"Create Passkey",createFor:"Create a new passkey for",titleLabel:"Title",titlePlaceholder:"Enter a name for this passkey",createButton:"Create Passkey",selectPasskeyToReplace:"Select a passkey to replace:",createNewPasskey:"Create New Passkey",replacingPasskey:"Replacing passkey: {{displayName}}",confirmReplace:"Confirm Replace",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Passkey Provider",passkeyProviderOn:"Passkey Provider on "}},Jx={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},Xx={title:"Upgrade Vault",subtitle:"AliasVault has updated and your vault needs to be upgraded. This should only take a few seconds.",versionInformation:"Version Information",yourVault:"Your vault version:",newVersion:"New available version:",upgrade:"Upgrade Vault",upgrading:"Upgrading...",whatsNew:"What's New",whatsNewDescription:"An upgrade is required to support the following changes:",noDescriptionAvailable:"No description available for this version.",alerts:{unableToGetVersionInfo:"Unable to get version information. Please try again.",selfHostedServer:"Self-Hosted Server",selfHostedWarning:"If you're using a self-hosted server, make sure to also update your self-hosted instance as otherwise logging in to the web client will stop working.",continueUpgrade:"Continue Upgrade",upgradeFailed:"Upgrade Failed",failedToApplyMigration:"Failed to apply migration ({{current}} of {{total}})"}},$x={unsyncedChangesTitle:"Unsynced Changes",unsyncedChangesWarning:"You have unsynced changes that will be lost if you log out now. Are you sure you want to continue?",logoutAnyway:"Log out anyway"},Zx={auth:Ox,menu:jx,common:Px,content:Hx,items:Qx,itemTypes:zx,fieldLabels:Vx,totp:Kx,attachmentUploader:Gx,emails:qx,settings:Wx,passkeys:Yx,recentlyDeleted:Jx,upgrade:Xx,logout:$x},eT={loginTitle:"Iniciar sesión en AliasVault",username:"Nombre de usuario o correo electrónico",usernamePlaceholder:"nombre / nombre@empresa.com",passwordPlaceholder:"Introduzca su contraseña",rememberMe:"Recordar mis datos",loginButton:"Iniciar sesión",noAccount:"¿Sin cuenta todavía?",createVault:"Crear nueva bóveda",twoFactorTitle:"Por favor, introduzca el código de autenticación de su aplicación de autenticación.",authCode:"Código de autenticación",authCodePlaceholder:"Introduzca código de 6 dígitos",verify:"Verificar",twoFactorNote:"Nota: si no tiene acceso a su dispositivo de autenticación, puede restablecer su 2FA con un código de recuperación iniciando sesión a través del sitio web.",masterPassword:"Contraseña Maestra",unlockVault:"Desbloquear",unlockWithPin:"Desbloquear con PIN",enterPinToUnlock:"Introduzca su PIN para desbloquear su bóveda",useMasterPassword:"Usar Contraseña Maestra",unlockTitle:"Desbloquear tu Bóveda",logoutConfirm:"¿Estás seguro de que quieres cerrar sesión?",unlockSuccessTitle:"Tu bóveda se ha desbloqueado correctamente",unlockSuccessDescription:"Ahora puede utilizar el autocompletado en los formularios de inicio de sesión en su navegador.",closePopup:"Cerrar esta ventana emergente",browseVault:"Navegar en el contenido de la bóveda",connectingTo:"Conectando con",switchAccounts:"¿Cambiar de cuenta?",loginWithMobile:"Iniciar sesión con la aplicación móvil",unlockWithMobile:"Desbloquear con la aplicación móvil",scanQrCode:"Escanea este código QR con tu aplicación móvil de AliasVault para iniciar sesión y desbloquear tu bóveda.",errors:{invalidCode:"Por favor, introduzca un código de autenticación de 6 dígitos válido.",serverError:"No se pudo llegar al servidor AliasVault. Por favor, inténtelo de nuevo más tarde o póngase en contacto con el soporte si el problema persiste.",wrongPassword:"Contraseña incorrecta. Por favor, inténtelo de nuevo.",sessionExpired:"Su sesión ha caducado. Por favor, inicie sesión de nuevo.",mobileLoginRequestExpired:"Se ha agotado el tiempo de inicio de sesión del móvil. Por favor, vuelva a cargar la página e inténtelo de nuevo."}},tT={vault:"Bóveda",emails:"Correos electrónicos"},aT={loading:"Cargando...",notice:"Aviso",error:"Error",cancel:"Cancelar",confirm:"Confirmar",back:"Atrás",next:"Siguiente",use:"Usar",add:"Añadir",delete:"Borrar",undo:"Deshacer",save:"Guardar",saving:"Guardando...",create:"Crear",or:"O",close:"Cerrar",logout:"Cerrar sesión",copied:"¡Copiado!",openInNewWindow:"Abrir en una ventana nueva",enabled:"Habilitado",disabled:"Desactivado",showPassword:"Mostrar contraseña",hidePassword:"Ocultar contraseña",showDetails:"Mostrar detalles",hideDetails:"Ocultar detalles",copyToClipboard:"Copiar al portapapeles",loadingEmails:"Cargando email...",loadingTotpCodes:"Cargando códigos TOTP...",attachments:"Archivos adjuntos",loadingAttachments:"Cargando archivos adjuntos...",settings:"Configuración",recentEmails:"Correos recientes",credentials:"Credenciales",customFields:"Campos Personalizados",twoFactorAuthentication:"Autenticación de doble factor",alias:"Alias",notes:"Notas",email:"Email",username:"Nombre de usuario",password:"Contraseña",generate:"Generar",serviceName:"Nombre del servicio",loggedIn:"Sesión iniciada",syncingVault:"Sincronizando bóveda",checkingVaultUpdates:"Comprobando actualizaciones de bóveda",syncingUpdatedVault:"Sincronizando bóveda actualizada",loadMore:"Cargar más",offline:"Desconectado",offlineMode:"Funcionando en modo sin conexión",pendingSync:"Sincronizando...",mergingVaultChanges:"Combinando cambios en la bóveda...",uploadingVault:"Subiendo bóveda...",errors:{serverNotAvailable:"El servidor AliasVault no está disponible. Por favor, inténtelo de nuevo más tarde o póngase en contacto con el soporte técnico si el problema persiste.",clientVersionNotSupported:"Esta versión de la extensión del navegador AliasVault ya no es compatible con el servidor. Por favor, actualice la extensión de su navegador a la última versión.",browserExtensionOutdated:"Esta extensión del navegador está desactualizada y no se puede utilizar para acceder a esta bóveda. Por favor, actualice esta extensión del navegador para continuar.",serverVersionNotSupported:"El servidor AliasVault necesita ser actualizado a una versión más reciente para poder usar esta extensión del navegador. Póngase en contacto con el soporte si necesita ayuda.",serverVersionTooOld:"El servidor AliasVault necesita ser actualizado a una versión más reciente para poder utilizar esta característica. Por favor, contacte con el administrador del servidor si necesita ayuda.",unknownError:"Se produjo un error desconocido",unknownErrorTryAgain:"Se ha producido un error desconocido. Por favor, inténtelo de nuevo.",vaultNotAvailable:"Bóveda no disponible",vaultIsLocked:"La bóveda está bloqueada",passwordChanged:"Tu contraseña ha cambiado desde la última vez que iniciaste sesión. Por favor, inicia sesión de nuevo por razones de seguridad.",syncConflictMaxRetries:"No se pudo sincronizar la bóveda después de múltiples intentos. Inténtalo de nuevo más tarde.",mergeFailed:"Error al combinar cambios en la bóveda. Por favor, inténtalo de nuevo."},apiErrors:{UNKNOWN_ERROR:"Se ha producido un error desconocido. Por favor, inténtelo de nuevo.",ACCOUNT_LOCKED:"Cuenta bloqueada temporalmente debido a demasiados intentos fallidos. Por favor, inténtelo de nuevo.",ACCOUNT_BLOCKED:"Tu cuenta ha sido desactivada. Si crees que esto es un error, ponte en contacto con soporte.",USER_NOT_FOUND:"Nombre de usuario o contraseña no válidos. Por favor, inténtelo de nuevo.",INVALID_AUTHENTICATOR_CODE:"Código de autenticación inválido. Por favor, inténtelo de nuevo.",INVALID_RECOVERY_CODE:"Código de recuperación inválido. Por favor, inténtelo de nuevo.",REFRESH_TOKEN_REQUIRED:"Se requiere un token de actualización.",INVALID_REFRESH_TOKEN:"Token de actualización inválido.",PUBLIC_REGISTRATION_DISABLED:"El registro de nueva cuenta está actualmente deshabilitado en este servidor. Por favor, contacte con el administrador.",USERNAME_REQUIRED:"Se requiere un nombre de usuario.",USERNAME_ALREADY_IN_USE:"El nombre de usuario ya está en uso.",USERNAME_AVAILABLE:"El nombre de usuario está disponible.",USERNAME_MISMATCH:"El nombre de usuario no coincide con el usuario actual.",PASSWORD_MISMATCH:"La contraseña proporcionada no coincide con su contraseña actual.",ACCOUNT_SUCCESSFULLY_DELETED:"Cuenta eliminada con éxito.",USERNAME_EMPTY_OR_WHITESPACE:"El nombre de usuario no puede estar vacío o en blanco.",USERNAME_TOO_SHORT:"Nombre de usuario demasiado corto: debe tener al menos 3 caracteres.",USERNAME_TOO_LONG:"Nombre de usuario demasiado largo: no puede tener más de 40 caracteres.",USERNAME_INVALID_EMAIL:"Dirección de correo electrónico inválida.",USERNAME_INVALID_CHARACTERS:"El nombre de usuario inválido, solo puede contener letras o dígitos.",VAULT_NOT_UP_TO_DATE:"Su bóveda no está actualizada. Por favor, sincronice su bóveda e inténtelo de nuevo.",INTERNAL_SERVER_ERROR:"Error interno del servidor.",VAULT_ERROR:"La bóveda local no está actualizada. Por favor, sincronice su bóveda actualizando la página e inténtelo de nuevo."}},nT={or:"o",new:"Nuevo",vaultLocked:"AliasVault está bloqueado.",creatingNewAlias:"Creando nuevo alias...",noMatchesFound:"No se han encontrado resultados",searchVault:"Buscar bóveda...",enterServiceName:"Introduzca el nombre del servicio",enterEmailAddress:"Introduzca la dirección de correo electrónico",enterUsername:"Introduzca nombre de usuario",hideFor1Hour:"Ocultar durante 1 hora (sitio actual)",hidePermanently:"Ocultar permanentemente (sitio actual)",createRandomAlias:"Crear alias aleatorio",createUsernamePassword:"Crear nombre de usuario / contraseña",randomAlias:"Alias aleatorio",usernamePassword:"Nombre de usuario/Contraseña",createAndSaveAlias:"Crear y guardar alias",createAndSaveCredential:"Crear y guardar credencial",randomIdentityDescription:"Generar una identidad aleatoria con una dirección de correo electrónico aleatoria accesible en AliasVault.",randomIdentityDescriptionDropdown:"Identidad aleatoria con correo electrónico aleatorio",manualCredentialDescription:"Especifique su propia dirección de correo electrónico y nombre de usuario.",manualCredentialDescriptionDropdown:"Nombre de usuario y contraseña manual",failedToCreateIdentity:"Error al crear la identidad. Por favor, inténtalo de nuevo.",enterEmailAndOrUsername:"Introduzca email y/o nombre de usuario",autofillWithAliasVault:"AutoFill con AliasVault",generateRandomPassword:"Generar contraseña aleatoria (copiar al portapapeles)",generateNewPassword:"Generar nueva contraseña",togglePasswordVisibility:"Cambiar la visibilidad de la contraseña",passwordCopiedToClipboard:"Contraseña copiada al portapapeles",openAliasVaultToUpgrade:"Abrir AliasVault para actualizar",vaultUpgradeRequired:"Actualización de bóveda requerida.",dismissPopup:"Descartar aviso"},rT={title:"Elementos",itemName:"Nombre",loginCredentials:"Credenciales de inicio de sesión",cardInformation:"Información de la tarjeta",addItem:"Añadir elemento",addNewItem:"Añadir nuevo elemento",saveItem:"Guardar elemento",itemDetails:"Detalles del elemento",editItem:"Editar elemento",untitled:"Untitled",newFolder:"Nueva carpeta",createFolder:"Create Folder",editFolder:"Editar carpeta",folderName:"Nombre de la carpeta",folderNameRequired:"El nombre de la carpeta es obligatorio",folder:"Folder",welcomeTitle:"¡Bienvenido a AliasVault!",welcomeDescription:"Para utilizar la extensión del navegador AliasVault: vaya a un sitio web y utilice la ventana de autocompletado de AliasVault para crear una nueva credencial.",noPasskeysFound:"No se han creado llaves de acceso todavía. Las llaves se crean visitando un sitio web que ofrece llaves de acceso como método de autenticación.",noAttachmentsFound:"No hay elementos con archivos adjuntos",noItemsOfTypeFound:"No se encontraron elementos {{type}}",noMatchingItems:"No hay elementos coincidentes",noMatchingItemsSearch:'No hay elementos que coincidan con "{{search}}"',noMatchingItemsWithFilter:'No hay elementos {{filter}} que coincidan con "{{search}}"',clearSearch:"Limpiar búsqueda",clearFilter:"Eliminar filtros",emptyFolderHint:"Esta carpeta está vacía. Para mover elementos a esta carpeta, edite el elemento y pulse el icono de la carpeta en el campo nombre.",allItemsInFolders:"Todos sus elementos están organizados en carpetas. Haga clic en una carpeta para ver sus credenciales o utilice la búsqueda para encontrar elementos específicos.",deleteFolder:"Borrar carpeta",deleteFolderKeepItems:"Eliminar solo la carpeta",deleteFolderKeepItemsDescription:"Los elementos se moverán de nuevo a la lista principal.",deleteFolderAndItems:"Eliminar carpeta y todos los elementos",deleteFolderAndItemsDescription:"{{count}} elemento(s) serán movidos a Borrados Recientemente.",filters:{all:"(Todos) Elementos",passkeys:"Llaves de acceso"},deleteItemTitle:"Eliminar elemento",deleteItemConfirm:"¿Está seguro de querer borrar este ítem?",viewHistory:"Ver historial",history:"Historial",noHistoryAvailable:"Sin historial disponible",tags:"Tags",changePasswordComplexity:"Cambiar complejidad de contraseña",passwordLength:"Longitud de la contraseña",includeLowercase:"Incluye letras minúsculas",includeUppercase:"Incluye letras mayúsculas",includeNumbers:"Incluye números",includeSpecialChars:"Incluye caracteres especiales",avoidAmbiguousChars:"Evita caracteres ambiguos (o, 0, etc.)",privateEmailTitle:"Correo electrónico privado",privateEmailAliasVaultServer:"Servidor AliasVault",privateEmailDescription:"E2E cifrado, totalmente privado.",publicEmailTitle:"Proveedores de Correo Temporal Públicos",publicEmailDescription:"Privacidad anónima pero limitada. Contenido de correo electrónico puede ser leído por cualquiera que conozca la dirección.",validation:{required:"Se requiere este campo"}},iT={selectType:"Añadir nuevo elemento",typeLabel:"Tipo de elemento",creating:"Creando",editing:"Editando",regenerateAlias:"Regenerar alias",addCustomField:"Añadir campo personalizado",fieldLabel:"Etiqueta del campo",enterFieldName:"Introduzca el nombre del campo",fieldType:"Tipo de campo",fieldTypes:{text:"Texto",hidden:"Oculto (texto enmascarado)",email:"Correo",url:"URL",phone:"Teléfono",number:"Número",date:"Date",textArea:"Área de texto"},login:{title:"Iniciar sesión"},alias:{title:"Alias"},creditCard:{title:"Tarjeta de crédito"},note:{title:"Nota segura"}},sT={"login.url":"URL de la web","login.username":"Nombre de usuario","login.password":"Contraseña","alias.first_name":"Nombre","alias.last_name":"Apellido","alias.gender":"Género","alias.birthdate":"Fecha de nacimiento","login.email":"Correo","notes.content":"Notas","card.cardholder_name":"Nombre titular","card.number":"Número de Tarjeta","card.expiry_month":"Mes de expiración","card.expiry_year":"Año de expiración","card.cvv":"CVV","card.pin":"PIN"},oT={addCode:"Añadir código 2FA",instructions:"Introduzca la clave secreta mostrada por el sitio web donde desea añadir autenticación de dos factores.",nameOptional:"Nombre (Opcional)",secretKey:"Clave secreta",saveToViewCode:"Guardar para ver el código",defaultName:"Autentificador",errors:{invalidSecretKey:"Formato de clave secreta inválida."}},lT={uploading:"Subiendo...",uploadSuccess:"Archivos subidos con éxito.",deleteSuccess:"Adjunto eliminado correctamente.",firefoxExpandRequired:"Para subir archivos, utilice la ventana ampliada.",openExpandedWindow:"Abrir ventana ampliada"},cT={title:"Correos electrónicos",deleteEmailTitle:"Eliminar correo",deleteEmailConfirm:"¿Está seguro que desea eliminar permanentemente este correo electrónico?",from:"De",to:"Para",date:"Fecha",emailContent:"Contenido del correo electrónico",emailNotFound:"Correo electrónico no encontrado",noEmails:"No se han encontrado correos electrónicos",noEmailsDescription:"No has recibido ningún correo electrónico en tus direcciones privadas todavía. Cuando recibas un nuevo correo electrónico, aparecerá aquí.",offlineMessage:"Está desconectado. Por favor, conéctese a Internet para cargar sus correos electrónicos.",dateFormat:{justNow:"ahora mismo",minutesAgo_single:"Hace {{count}} min",minutesAgo_plural:"Hace {{count}} min",hoursAgo_single:"Hace {{count}} h",hoursAgo_plural:"Hace {{count}} h",yesterday:"ayer"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"La dirección de correo electrónico elegida actualmente ya está en uso. Por favor, cambie la dirección de correo electrónico editando esta credencial.",CLAIM_DOES_NOT_EXIST:"Ocurrió un error mientras se trataba de cargar los correos electrónicos. Por favor, intente editar y guardar la entrada de credenciales para sincronizar la base de datos, y vuelva a intentarlo."}},uT={serverUrl:"URL del servidor",language:"Idioma",autofillEnabled:"Activar autocompletado",version:"Versión",openWebApp:"Abrir la aplicación web",lock:"Bloquear",globalSettings:"Ajustes globales",autofillPopup:"Ventana de autorrellenado",activeOnAllSites:"Activo en todos los sitios (a menos que se deshabilite debajo)",disabledOnAllSites:"Deshabilitado en todos los sitios",rightClickContextMenu:"Menú contextual del clic derecho",autofillMatching:"Coincidencia de autocompletado",autofillMatchingMode:"Modo de coincidencia de autocompletado",autofillMatchingModeDescription:"Determina qué credenciales se consideran coincidentes y se muestran como sugerencias en el popup de autorrelleno de un sitio web determinado.",autofillMatchingDefault:"URL + subdominio + nombre wildcard",autofillMatchingUrlSubdomain:"URL + subdominio",autofillMatchingUrlExact:"Solo URL exacta",siteSpecificSettings:"Ajustes específicos del sitio",autofillPopupOn:"Ventana de autorrelleno ",enabledForThisSite:"Habilitado para este sitio",disabledForThisSite:"Deshabilitado para este sitio",temporarilyDisabledUntil:"Deshabilitado temporalmente hasta ",resetAllSiteSettings:"Reiniciar todos los ajustes específicos del sitio",appearance:"Apariencia",theme:"Tema",useDefault:"Uso por defecto",light:"Claro",dark:"Oscuro",keyboardShortcuts:"Atajos de teclado",configureKeyboardShortcuts:"Configurar atajos de teclado",configure:"Configurar",clipboardClearTimeout:"Limpiar portapapeles después de copiar",clipboardClearTimeoutDescription:"Limpiar automáticamente el portapapeles después de copiar datos sensibles",clipboardClearDisabled:"Nunca limpiar",clipboardClear5Seconds:"Limpiar después 5 segundos",clipboardClear10Seconds:"Limpiar después 10 segundos",clipboardClear15Seconds:"Limpiar después 15 segundos",autoLockTimeout:"Tiempo de bloqueo automático",autoLockTimeoutDescription:"Bloquear automáticamente la bóveda después de un período de inactividad",autoLockTimeoutHelp:"La bóveda sólo se bloqueará después del período especificado de inactividad (no se abrirá el uso de autocompletado o la ventana emergente). La bóveda siempre se bloqueará cuando el navegador esté cerrado, independientemente de esta configuración.",autoLockNever:"Nunca",autoLock15Seconds:"15 segundos",autoLock1Minute:"1 minuto",autoLock5Minutes:"5 minutos",autoLock15Minutes:"15 minutos",autoLock30Minutes:"30 minutos",autoLock1Hour:"1 hora",autoLock4Hours:"4 horas",autoLock8Hours:"8 horas",autoLock24Hours:"24 horas",versionPrefix:"Versión ",autofillSettings:"Ajustes de autocompletado",clipboardSettings:"Ajustes del portapapeles",contextMenuSettings:"Ajustes del menú contextual",passkeySettings:"Ajustes de llaves de acceso",contextMenu:"Menú Contextual",contextMenuEnabled:"El menú contextual está activado",contextMenuDisabled:"El menú contextual está desactivado",contextMenuDescription:"Haga clic derecho en los campos de entrada para acceder a las opciones de AliasVault",selectLanguage:"Seleccionar idioma",serverConfiguration:"Configuración del servidor",serverConfigurationDescription:"Configurar la URL del servidor AliasVault para instancias self-hosted",customApiUrl:"API URL",customClientUrl:"URL de Cliente",apiUrlHint:"La URL del endpoint de la API (generalmente URL del cliente + /api)",clientUrlHint:"La URL de la interfaz web de su instancia self-hosted",autofillSettingsDescription:"Activar o desactivar la ventana emergente de autorrelleno en páginas web",autofillEnabledDescription:"Las sugerencias de autorrelleno aparecerán en los formularios de inicio de sesión",autofillDisabledDescription:"Las sugerencias de autorrelleno están desactivadas globalmente",languageSettings:"Idioma",validation:{apiUrlRequired:"La URL de la API es necesaria",apiUrlInvalid:"Por favor, introduzca una URL de API válida",clientUrlRequired:"La URL de cliente es necesaria",clientUrlInvalid:"Por favor, introduzca una URL de cliente válida"},unlockMethod:{title:"Método de desbloqueo de la bóveda",introText:"Elija cómo desea desbloquear su bóveda. Puede utilizar su contraseña maestra (siempre disponible) o configurar un código PIN para un acceso más rápido. Después de 3 intentos fallidos de PIN, necesitarás usar tu contraseña maestra.",password:"Contraseña Maestra",pin:"Código PIN",pinDescription:"Desbloquear bóveda con código PIN",setupPin:"Configurar código PIN",enterNewPinDescription:"Introduzca un código PIN que contenga un mínimo de 6 dígitos",confirmPin:"Confirmar PIN",confirmPinDescription:"Introduzca su PIN de nuevo para confirmar",invalidPinFormat:"Formato PIN inválido",pinMismatch:"Los PINs no coinciden",incorrectPin:"PIN incorrecto, {{attemptsRemaining}} intentos restantes.",incorrectPinSingular:"PIN incorrecto. 1 intento restante.",enableSuccess:"¡PIN activado con éxito!",pinLocked:"El desbloqueo con PIN ha sido deshabilitado. Por favor, utiliza tu contraseña maestra para desbloquear tu bóveda.",pinSecurityWarning:"El PIN de desbloqueo en la extensión del navegador puede ser menos seguro que su contraseña maestra, ya que los PIN típicamente tienen menos entropía y se pueden obtener por fuerza bruta si su dispositivo está en peligro. Úselo sólo en dispositivos en los que confíe plenamente."}},dT={passkey:"Llave de acceso",site:"Sitio",helpText:"Las llaves de acceso se crean en el sitio web cuando se le solicite. No pueden ser editadas manualmente. Para eliminar esta clave, puede eliminarla de esta credencial. Para reemplazar esta clave de acceso o crear una nueva, visite el sitio web y siga sus indicaciones.",passkeyMarkedForDeletion:"Llave de acceso marcada para eliminar",passkeyWillBeDeleted:"Esta llave de acceso se eliminará cuando guarde esta credencial.",useBrowserPasskey:"Usar llave de acceso del navegador",bypass:{description:"¿Cuánto tiempo quieres usar el proveedor de llaves de acceso del navegador para {{origin}}?",thisTimeOnly:"Solo esta vez",alwaysForSite:"Siempre para este sitio"},authenticate:{title:"Iniciar sesión con llave de acceso",signInFor:"Iniciar sesión con llave para",selectPasskey:"Seleccione una llave de acceso para iniciar sesión:",noPasskeysFound:"No se encontraron llaves de acceso para este sitio"},create:{title:"Crear llave de acceso",createFor:"Crear nueva llave de acceso para",titleLabel:"Título",titlePlaceholder:"Introduzca un nombre para esta llave de acceso",createButton:"Crear llave de acceso",selectPasskeyToReplace:"Seleccione una llave de acceso para reemplazar:",createNewPasskey:"Crear nueva llave de acceso",replacingPasskey:"Reemplazando llave de acceso: {{displayName}}",confirmReplace:"Confirmar reemplazo",selectExistingLogin:"Añadir al inicio de sesión existente:",selectExistingLoginDescription:"Adjuntar esta llave a una credencial de inicio de sesión existente para este sitio.",attachingToCredential:"Añadiendo llave a: {{serviceName}}",attachPasskey:"Añadir llave de acceso"},settings:{passkeyProvider:"Proveedor de llave de acceso",passkeyProviderOn:"Proveedor de llave de acceso en "}},mT={title:"Eliminados recientemente",noItems:"No hay elementos eliminados",noItemsDescription:"Los elementos que elimines aparecerán aquí durante 30 días antes de ser eliminados permanentemente.",description:"Estos elementos se eliminarán permanentemente después de 30 días. Puede restaurarlos o eliminarlos inmediatamente.",restore:"Restaurar",deletePermanently:"Eliminar permanentemente",emptyAll:"Vaciar todo",daysRemaining_one:"{{count}} día restante",daysRemaining_other:"{{count}} días restantes",expiringSoon:"Caduca pronto",confirmDeleteTitle:"¿Eliminar permanentemente?",confirmDeleteMessage:"Este elemento se eliminará permanentemente y no se puede recuperar.",confirmEmptyAllTitle:"¿Vaciar los recientemente eliminados?",confirmEmptyAllMessage:"Todos los elementos {{count}} se eliminarán permanentemente y no se podrán recuperar."},fT={title:"Actualizar bóveda",subtitle:"AliasVault se ha actualizado y tu bóveda necesita ser actualizada. Esto solo debería tardar unos segundos.",versionInformation:"Información de versión",yourVault:"Tu versión de bóveda:",newVersion:"Nueva versión disponible:",upgrade:"Actualizar bóveda",upgrading:"Actualizando...",whatsNew:"Novedades",whatsNewDescription:"Se requiere una actualización para soportar los siguientes cambios:",noDescriptionAvailable:"Ninguna descripción disponible para esta versión.",alerts:{unableToGetVersionInfo:"No se pudo obtener información de la versión. Por favor, inténtalo de nuevo.",selfHostedServer:"Servidor autoalojado",selfHostedWarning:"Si está utilizando un servidor autoalojado, asegúrese de actualizar su instancia autoalojada, ya que de lo contrario iniciar sesión en el cliente web dejará de funcionar.",continueUpgrade:"Continuar actualización",upgradeFailed:"Actualización fallida",failedToApplyMigration:"Error al migrar de ({{current}} a {{total}})"}},gT={unsyncedChangesTitle:"Cambios no sincronizados",unsyncedChangesWarning:"Tienes cambios no sincronizados que se perderán si te desconectas ahora. ¿Estás seguro de que quieres continuar?",logoutAnyway:"Cerrar sesión de todos modos"},hT={auth:eT,menu:tT,common:aT,content:nT,items:rT,itemTypes:iT,fieldLabels:sT,totp:oT,attachmentUploader:lT,emails:cT,settings:uT,passkeys:dT,recentlyDeleted:mT,upgrade:fT,logout:gT},AT={loginTitle:"Kirjaudu sisään AliasVaultiin",username:"Käyttäjänimi tai sähköposti",usernamePlaceholder:"nimi / nimi@yritys.fi",passwordPlaceholder:"Syötä salasanasi",rememberMe:"Muista minut",loginButton:"Kirjaudu sisään",noAccount:"Eikö tiliä vielä ole?",createVault:"Luo uusi holvi",twoFactorTitle:"Syötä tunnistautumiskoodi tunnistautumissovelluksestasi.",authCode:"Tunnistautumiskoodi",authCodePlaceholder:"Syötä 6-numeroinen koodi",verify:"Vahvista",twoFactorNote:"Huomautus: jos sinulla ei ole pääsyä tunnistautumislaitteeseen, voit palauttaa 2FA:n palautuskoodilla kirjautumalla sisään sivuston kautta.",masterPassword:"Pääsalasana",unlockVault:"Avaa lukitus",unlockWithPin:"Avaa PIN-koodilla",enterPinToUnlock:"Syötä PIN-koodi avataksesi holvisi",useMasterPassword:"Käytä pääsalasanaa",unlockTitle:"Avaa holvisi lukitus",logoutConfirm:"Oletko varma, että haluat kirjautua ulos?",unlockSuccessTitle:"Holvisi lukitus on avattu",unlockSuccessDescription:"Voit nyt käyttää automaattista täyttöä sisäänkirjautumislomakkeissa selaimessasi.",closePopup:"Sulje tämä ponnahdusikkuna",browseVault:"Selaa holvin sisältöä",connectingTo:"Yhdistetään kohteeseen",switchAccounts:"Vaihdetaanko tiliä?",loginWithMobile:"Kirjaudu sisään mobiilisovelluksella",unlockWithMobile:"Avaa käyttämällä mobiilisovellusta",scanQrCode:"Skannaa tämä QR-koodi AliasVault-mobiilisovelluksellasi kirjautuaksesi sisään ja avataksesi holvisi.",errors:{invalidCode:"Syötä kelvollinen 6-numeroinen tunnistautumiskoodi.",serverError:"AliasVault-palvelimeen ei saatu yhteyttä. Yritä myöhemmin uudelleen tai ota yhteyttä tukeen, jos ongelma jatkuu.",wrongPassword:"Virheellinen salasana. Yritä uudelleen.",sessionExpired:"Istuntosi on vanhentunut. Kirjaudu sisään uudelleen.",mobileLoginRequestExpired:"Mobiilikirjautumispyyntö aikakatkaistiin. Lataa sivu uudelleen ja yritä uudelleen."}},pT={vault:"Holvi",emails:"Sähköpostit"},yT={loading:"Ladataan...",notice:"Huomautus",error:"Virhe",cancel:"Peruuta",confirm:"Vahvista",back:"Takaisin",next:"Seuraava",use:"Käytä",add:"Lisää",delete:"Poista",undo:"Kumoa",save:"Tallenna",saving:"Saving...",create:"Luo",or:"Tai",close:"Sulje",logout:"Uloskirjautuminen",copied:"Kopioitu!",openInNewWindow:"Avaa uudessa ikkunassa",enabled:"Otettu käyttöön",disabled:"Pois käytöstä",showPassword:"Näytä salasana",hidePassword:"Piilota salasana",showDetails:"Näytä tiedot",hideDetails:"Piilota tiedot",copyToClipboard:"Kopioi leikepöydälle",loadingEmails:"Ladataan sähköposteja...",loadingTotpCodes:"Ladataan TOTP-koodeja...",attachments:"Liitteet",loadingAttachments:"Ladataan liitteitä...",settings:"Asetukset",recentEmails:"Viimeaikaiset sähköpostit",credentials:"Tunnistetiedot",customFields:"Räätälöidyt kentät",twoFactorAuthentication:"Kaksivaiheinen tunnistautuminen",alias:"Alias",notes:"Huomautukset",email:"Sähköposti",username:"Käyttäjänimi",password:"Salasana",generate:"Generate",serviceName:"Palvelun nimi",loggedIn:"Sisäänkirjautuneena",syncingVault:"Synkronoidaan holvia",checkingVaultUpdates:"Tarkistetaan holvin päivitysten varalta",syncingUpdatedVault:"Synkronoidaan päivitettyä holvia",loadMore:"Lataa lisää",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Yhdistetään holvin muutoksia...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"AliasVault-palvelin ei ole käytettävissä. Yritä myöhemmin uudelleen tai ota yhteyttä tukeen, jos ongelma jatkuu.",clientVersionNotSupported:"Palvelin ei enää tue tätä AliasVault-selainlaajennuksen versiota. Päivitä selaimen laajennus uusimpaan versioon.",browserExtensionOutdated:"Tämä selainlaajennus on vanhentunut, eikä sillä voi saada pääsyä tähän holviin. Päivitä tämä selainlaajennus jatkaaksesi.",serverVersionNotSupported:"AliasVault-palvelin on päivitettävä uudempaan versioon, jotta voit käyttää tätä selainlaajennusta. Ota yhteyttä tukeen, jos tarvitset apua.",serverVersionTooOld:"AliasVault-palvelin on päivitettävä uudempaan versioon, jotta se voi käyttää tätä ominaisuutta. Ota yhteyttä palvelimen ylläpitäjään jos tarvitset apua.",unknownError:"Tapahtui tuntematon virhe",unknownErrorTryAgain:"Tapahtui tuntematon virhe. Yritä uudelleen.",vaultNotAvailable:"Holvi ei käytettävissä",vaultIsLocked:"Holvi on lukittu",passwordChanged:"Salasanasi on muuttunut edellisen sisäänkirjautumisen jälkeen. Kirjaudu sisään uudelleen turvallisuussyistä.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"Tapahtui tuntematon virhe. Yritä uudelleen.",ACCOUNT_LOCKED:"Tili tilapäisesti lukittu liian monen epäonnistuneen yrityksen vuoksi. Yritä myöhemmin uudelleen.",ACCOUNT_BLOCKED:"Tilisi on poistettu käytöstä. Jos uskot, että tämä on virhe, ota yhteyttä tukeen.",USER_NOT_FOUND:"Virheellinen käyttäjänimi tai salasana. Yritä uudelleen.",INVALID_AUTHENTICATOR_CODE:"Virheellinen tunnistautumiskoodi. Yritä uudelleen.",INVALID_RECOVERY_CODE:"Virheellinen palautuskoodi. Yritä uudelleen.",REFRESH_TOKEN_REQUIRED:"Virkistyspoletti vaaditaan.",INVALID_REFRESH_TOKEN:"Virheellinen virkistyspoletti.",PUBLIC_REGISTRATION_DISABLED:"Uuden tilin rekisteröinti on tällä hetkellä poistettu käytöstä tällä palvelimella. Ota yhteyttä järjestelmänvalvojaan.",USERNAME_REQUIRED:"Käyttäjänimi vaaditaan.",USERNAME_ALREADY_IN_USE:"Käyttäjänimi on jo käytössä.",USERNAME_AVAILABLE:"Käyttäjänimi on saatavilla.",USERNAME_MISMATCH:"Käyttäjänimi ei vastaa nykyistä käyttäjää.",PASSWORD_MISMATCH:"Annettu salasana ei vastaa nykyistä salasanaasi.",ACCOUNT_SUCCESSFULLY_DELETED:"Tili poistettu.",USERNAME_EMPTY_OR_WHITESPACE:"Käyttäjänimi ei voi olla tyhjä eikä siinä voi olla välilyöntejä.",USERNAME_TOO_SHORT:"Käyttäjänimi liian lyhyt: sen on oltava vähintään 3 merkkiä pitkä.",USERNAME_TOO_LONG:"Käyttäjänimi liian pitkä: ei saa olla yli 40 merkkiä pidempi.",USERNAME_INVALID_EMAIL:"Virheellinen sähköpostiosoite.",USERNAME_INVALID_CHARACTERS:"Käyttäjänimi on virheellinen, voi sisältää vain kirjaimia tai numeroita.",VAULT_NOT_UP_TO_DATE:"Holvisi ei ole ajan tasalla. Synkronoi holvisi ja yritä uudelleen.",INTERNAL_SERVER_ERROR:"Sisäinen palvelinvirhe.",VAULT_ERROR:"Paikallinen holvi ei ole ajan tasalla. Synkronoi holvisi virkistämällä sivu ja yritä uudelleen."}},ET={or:"tai",new:"Uusi",vaultLocked:"AliasVault on lukittu.",creatingNewAlias:"Luodaan uutta aliasta...",noMatchesFound:"Osumia ei löytynyt",searchVault:"Etsi holvi...",enterServiceName:"Syötä palvelun nimi",enterEmailAddress:"Syötä sähköpostiosoite",enterUsername:"Syötä käyttäjänimi",hideFor1Hour:"Piilota tunnin ajan (nykyinen sivusto)",hidePermanently:"Piilota pysyvästi (nykyinen sivu)",createRandomAlias:"Luo sattumanvarainen alias",createUsernamePassword:"Luo käyttäjänimi/salasana",randomAlias:"Sattumanvarainen alias",usernamePassword:"Käyttäjänimi/Salasana",createAndSaveAlias:"Luo ja tallenna alias",createAndSaveCredential:"Luo ja tallenna tunnistetieto",randomIdentityDescription:"Luo satunnainen identiteetti, jolla on satunnainen sähköpostiosoite, johon on pääsy AliasVaultissa.",randomIdentityDescriptionDropdown:"Satunnainen identiteetti satunnaisen sähköpostiosoitteen kanssa",manualCredentialDescription:"Määritä oma sähköpostiosoitteesi ja käyttäjänimesi.",manualCredentialDescriptionDropdown:"Manuaalinen käyttäjänimi ja salasana",failedToCreateIdentity:"Identiteetin luominen epäonnistui. Yritä uudelleen.",enterEmailAndOrUsername:"Syötä sähköpostiosoite ja/tai käyttäjänimi",autofillWithAliasVault:"Automaattinen täyttö AliasVaultilla",generateRandomPassword:"Luo sattumanvarainen salasana (kopioi leikepöydälle)",generateNewPassword:"Luo uusi salasana",togglePasswordVisibility:"Salasanan näkyvyyden päälle/pois päältä kytkeminen",passwordCopiedToClipboard:"Salasana kopioitu leikepöydälle",openAliasVaultToUpgrade:"Avaa AliasVault päivittääksesi",vaultUpgradeRequired:"Holvin päivitys vaaditaan.",dismissPopup:"Hylkää ponnahdusikkuna"},bT={title:"Tiedot",itemName:"Nimi",loginCredentials:"Sisäänkirjautumistunnistetiedot",cardInformation:"Korttitiedot",addItem:"Lisää tieto",addNewItem:"Lisää uusi tieto",saveItem:"Tallenna tieto",itemDetails:"Näytä yksityiskohdat",editItem:"Muokkaa tietoa",untitled:"Nimetön",newFolder:"New Folder",createFolder:"Luo kansio",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"Kansio",welcomeTitle:"Tervetuloa AliasVaultiin!",welcomeDescription:"Käyttääksesi AliasVault-selainlaajennusta, siirry jollekin verkkosivustolle ja käytä AliasVaultin automaattisen täytön ponnahdusikkunaa luodaksesi uuden tunnistetiedon.",noPasskeysFound:"Todennusavaimia ei ole vielä luotu. Todennusavaimet on luotu vierailemalla verkkosivustolla, joka tarjoaa todennusavaimia todennusmenetelmänä.",noAttachmentsFound:"Liitteitä sisältäviä tietoja ei löytynyt",noItemsOfTypeFound:"No {{type}} tietoja ei löydy",noMatchingItems:"Vastaavia tietoja ei löytynyt",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(Kaikki) tiedot",passkeys:"Sala-avaimet"},deleteItemTitle:"Poista kohde",deleteItemConfirm:"Haluatko varmasti poistaa tämän kohteen?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"Tunnisteet",changePasswordComplexity:"Muuta salasanan monimutkaisuutta",passwordLength:"Salasanan pituus",includeLowercase:"Sisällytä pienet kirjaimet",includeUppercase:"Sisällytä isot kirjaimet",includeNumbers:"Sisällytä numerot",includeSpecialChars:"Sisällytä erikoismerkit",avoidAmbiguousChars:"Vältä epäselviä merkkejä (o, 0, jne.)",privateEmailTitle:"Yksityinen sähköposti",privateEmailAliasVaultServer:"AliasVault-palvelin",privateEmailDescription:"Päästä päähän (E2E) salattu, täysin yksityinen.",publicEmailTitle:"Julkiset väliaikaisten sähköpostiosoitteiden tarjoajat (PTEP)",publicEmailDescription:"Anonyymi, mutta rajoitettu yksityisyys. Sähköpostin sisällön voi lukea kuka tahansa, joka tietää osoitteen.",validation:{required:"Tämä kenttä on pakollinen"}},IT={selectType:"Add New Item",typeLabel:"Item Type",creating:"Luodaan",editing:"Muokaataan",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Kentän otsikko",enterFieldName:"Anna kentän nimi",fieldType:"Kentän tyyppi",fieldTypes:{text:"Teksti",hidden:"Hidden (masked text)",email:"Sähköposti",url:"URL",phone:"Puhelin",number:"Numero",date:"Päivämäärä",textArea:"Tekstialue"},login:{title:"Kirjaudu sisään"},alias:{title:"Alias"},creditCard:{title:"Luottokortti"},note:{title:"Secure Note"}},vT={"login.url":"Web-sivuston URL-osoite","login.username":"Käyttäjänimi","login.password":"Salasana","alias.first_name":"Etunimi","alias.last_name":"Sukunimi","alias.gender":"Sukupuoli","alias.birthdate":"Syntymäpäivä","login.email":"Sähköposti","notes.content":"Huomautukset","card.cardholder_name":"Kortinhaltijan nimi","card.number":"Kortin numero","card.expiry_month":"Vanhenemiskuukausi","card.expiry_year":"Vanhenemisvuosi","card.cvv":"CVV","card.pin":"PIN-koodi"},wT={addCode:"Lisää 2FA TOTP -koodi",instructions:"Syötä salainen avain, joka näkyy sivustossa, jossa haluat lisätä kaksivaiheisen tunnistautumisen",nameOptional:"Nimi (valinnainen)",secretKey:"Salainen avain",saveToViewCode:"Tallenna nähdäksesi koodin",defaultName:"Authenticator",errors:{invalidSecretKey:"Virheellinen salatun avaimen muoto."}},CT={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},NT={title:"Sähköpostit",deleteEmailTitle:"Poista sähköposti",deleteEmailConfirm:"Oletko varma, että haluat poistaa tämän sähköpostin pysyvästi?",from:"Lähettäjä",to:"Vastaanottaja",date:"Päivämäärä",emailContent:"Sähköpostin sisältö",emailNotFound:"Sähköpostia ei löytynyt",noEmails:"Sähköposteja ei löytynyt",noEmailsDescription:"Et ole vielä vastaanottanut sähköposteja yksityisissä sähköpostiosoitteissasi. Kun saat uuden sähköpostiviestin, se näkyy täällä.",offlineMessage:"Olet offline-tilassa. Ole hyvä ja yhdistä internetiin ladataksesi sähköpostiosoitteesi.",dateFormat:{justNow:"juuri nyt",minutesAgo_single:"{{count}} min sitten",minutesAgo_plural:"{{count}} minuuttia sitten",hoursAgo_single:"{{count}} tunti sitten",hoursAgo_plural:"{{count}} tuntia sitten",yesterday:"eilen"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Nykyinen valittu sähköpostiosoite on jo käytössä. Vaihda sähköpostiosoite muokkaamalla tätä tunnistetietoa.",CLAIM_DOES_NOT_EXIST:"Tapahtui virhe ladattaessa sähköposteja. Yritä muokata ja tallentaa tunnistetiedot synkronoidaksesi tietokannan, ja yritä sitten uudelleen."}},xT={serverUrl:"Palvelimen URL-osoite",language:"Kieli",autofillEnabled:"Ota automaattinen täyttö käyttöön",version:"Versio",openWebApp:"Avaa verkkosovellus",lock:"Lukitse",globalSettings:"Yleisesti pätevät asetukset",autofillPopup:"Automaattisen täytön ponnahdusikkuna",activeOnAllSites:"Aktiivisena kaikilla sivustoilla (ellei sitä ole poistettu käytöstä alla)",disabledOnAllSites:"Pois käytöstä kaikilla sivustoilla",rightClickContextMenu:"Oikea-napsauta kontekstivalikkoa",autofillMatching:"Automaattisen täytön täsmäytys",autofillMatchingMode:"Automaattisen täytön täsmäytystila",autofillMatchingModeDescription:"Määrittää, mitkä tunnistetiedot katsotaan osumiksi ja näytetään ehdotuksina tietyn verkkosivuston automaattisen täytön ponnahdusikkunassa.",autofillMatchingDefault:"URL + aliverkkotunnus + nimi jokerimerkki",autofillMatchingUrlSubdomain:"URL + aliverkkotunnus",autofillMatchingUrlExact:"Tarkka URL-verkkotunnus vain",siteSpecificSettings:"Sivustokohtaiset asetukset",autofillPopupOn:"Automaattisen täytön ponnahdusikkuna päällä: ",enabledForThisSite:"Otettu käyttöön tällä sivustolla",disabledForThisSite:"Poistettu käytöstä tällä sivustolla",temporarilyDisabledUntil:"Väliaikaisesti pois käytöstä, kunnes ",resetAllSiteSettings:"Nollaa kaikki sivustokohtaiset asetukset",appearance:"Ulkoasu",theme:"Teema",useDefault:"Käytä oletusta",light:"Vaalea",dark:"Tumma",keyboardShortcuts:"Näppäimistön pikanppäimet",configureKeyboardShortcuts:"Määritä näppäimistön pikanäppäimet",configure:"Määritä",clipboardClearTimeout:"Tyhjennä leikepöytä kopioimisen jälkeen",clipboardClearTimeoutDescription:"Tyhjennä leikepöytä automaattisesti arkaluonteisten tietojen kopioimisen jälkeen",clipboardClearDisabled:"Älä koskaan tyhjennä",clipboardClear5Seconds:"Tyhjennä 5 sekunnin jälkeen",clipboardClear10Seconds:"Tyhjennä 10 sekunnin jälkeen",clipboardClear15Seconds:"Tyhjennä 15 sekunnin jälkeen",autoLockTimeout:"Automaattisen lukituksen aikakatkaisu",autoLockTimeoutDescription:"Lukitse holvi automaattisesti käyttämättömyysjakson jälkeen",autoLockTimeoutHelp:"Holvi lukittuu vasta määritetyn käyttämättömyysjakson jälkeen (ei automaattista täyttöä tai laajennusten ponnahdusikkunoita ole avattu). Holvi lukittuu aina, kun selain suljetaan, tästä asetuksesta riippumatta.",autoLockNever:"Ei koskaan",autoLock15Seconds:"15 sekuntia",autoLock1Minute:"1 minuutti",autoLock5Minutes:"5 minuuttia",autoLock15Minutes:"15 minuuttia",autoLock30Minutes:"30 minuuttia",autoLock1Hour:"1 tunti",autoLock4Hours:"4 tuntia",autoLock8Hours:"8 tuntia",autoLock24Hours:"24 tuntia",versionPrefix:"Versio",autofillSettings:"Automaatisen täytön asetukset",clipboardSettings:"Leikepöydän asetukset",contextMenuSettings:"Kontekstivalikon asetukset",passkeySettings:"Todennusavainten asetukset",contextMenu:"Sisältövalikko",contextMenuEnabled:"Kontekstivalikko on otettu käyttöön",contextMenuDisabled:"Kontekstivalikko on poistettu käytöstä",contextMenuDescription:"Oikea-napsauta syöttökenttiä päästäksesi AliasVaultin vaihtoehtoihin",selectLanguage:"Valitse kieli",serverConfiguration:"Palvelimen asetukset",serverConfigurationDescription:"Määritä AliasVault-palvelimen URL-osoite itse isännöityille instanssille",customApiUrl:"API-URL-osoite",customClientUrl:"Asiakas-URL-osoite",apiUrlHint:"API päätepisteen URL (yleensä asiakkaan URL + /api)",clientUrlHint:"Web-käyttöliittymän URL-osoite itse isännöidyssä instanssissa",autofillSettingsDescription:"Ota käyttöön tai poista käytöstä automaattisen täytön ponnahdusikkuna verkkosivuilta",autofillEnabledDescription:"Automaattisen täytön ehdotukset näkyvät kirjautumislomakkeissa",autofillDisabledDescription:"Automaattitäyttöehdotukset on poistettu käytöstä kaikkialla",languageSettings:"Keili",validation:{apiUrlRequired:"API-URL-osoite vaaditaan",apiUrlInvalid:"Syötä kelvollinen API-URL-osoite",clientUrlRequired:"Asiakkaan URL-osoite vaaditaan",clientUrlInvalid:"Syötä kelvollinen asiakas-URL-osoite"},unlockMethod:{title:"Holvin lukituksen avausmenetelmä",introText:"Valitse, miten haluat avata holvisi. Voit käyttää pääsalasanaa (aina saatavilla) tai määrittää nopean 4-8 numeroisen PIN-koodin nopeampaa käyttöä varten. Kolmen epäonnistuneen PIN-yrityksen jälkeen sinun on käytettävä pääsalasanaa.",password:"Pääsalasana",pin:"PIN-koodi",pinDescription:"Avaa holvi PIN-koodilla",setupPin:"PIN-koodin määrittäminen",enterNewPinDescription:"Syötä PIN-koodi, jossa on vähintään 6 numeroa",confirmPin:"Vahvista PIN",confirmPinDescription:"Syötä PIN-koodi uudelleen vahvistaaksesi",invalidPinFormat:"Virheellinen PIN-muoto",pinMismatch:"PIN-koodit eivät täsmää",incorrectPin:"Väärä PIN-koodi. {{attemptsRemaining}} yritystä jäljellä.",incorrectPinSingular:"Virheellinen PIN-koodi. 1 yritys jäljellä.",enableSuccess:"PIN-lukituksen avaus käytössä onnistuneesti!",pinLocked:"PIN-lukituksen avaus on poistettu käytöstä. Ole hyvä ja käytä pääsalasanaa avataksesi holvisi.",pinSecurityWarning:"PIN-koodin lukituksen poisto selaimen laajennuksessa voi olla vähemmän turvallista kuin pääsalasana, koska PIN-koodit ovat tyypillisesti alempia entropia ja voi olla brute-pakko jos laite on vaarassa. Käytä sitä vain laitteissa, joihin täysin luotat."}},TT={passkey:"Sala-avain",site:"Sivusto",helpText:"Todennusavaimet, Passkeys, luodaan sivustolle pyydettäessä. Niitä ei voi manuaalisesti muokata. Voit poistaa tämän salasanan, voit poistaa sen tästä käyttäjätunnuksesta. Voit korvata tämän salasanan tai luoda uuden, käy verkkosivuilla ja seuraa sen kehotuksia.",passkeyMarkedForDeletion:"Todennusavain merkitty poistettavaksi",passkeyWillBeDeleted:"Tämä todennusavain poistetaan, kun tallennat tämän käyttäjätiedon.",useBrowserPasskey:"Käytä selaimen sala-avainta",bypass:{description:"Kuinka kauan haluat käyttää selaimen todennusavaimen tarjoajaa {{origin}}?",thisTimeOnly:"Vain tällä kertaa",alwaysForSite:"Aina tällä sivustolla"},authenticate:{title:"Kirjaudu sisään todennusavaimella",signInFor:"Kirjaudu sisään todennusavaimella saadaksesi",selectPasskey:"Valitse todennusavain jolla kirjaudutaan",noPasskeysFound:"Tällä sivustolla ei löytynyt todennusavaimia"},create:{title:"Luo Passkey, todennusavain",createFor:"Luo uusi Passkey, todennusavain",titleLabel:"Otsikko",titlePlaceholder:"Anna nimi tälle todennusavaimelle",createButton:"Luo todennusavain, Passkey",selectPasskeyToReplace:"Valitse todennusavain, johon korvataan",createNewPasskey:"Luo uusi sala-avain",replacingPasskey:"Korvaava todennusavain: {{displayName}}",confirmReplace:"Vahvista korvaaminen",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Todennusavaimen toimittaja",passkeyProviderOn:"Todennusavaimen toimittaja käytössä "}},ST={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},kT={title:"Päivitä holvi",subtitle:"AliasVault on päivitetty ja holvisi on päivitettävä. Tämän pitäisi kestää vain muutama sekunti.",versionInformation:"Versiotiedot",yourVault:"Holvisi versio:",newVersion:"Uusi saatavilla oleva versio:",upgrade:"Päivitä holvi",upgrading:"Päivitetään...",whatsNew:"Mitä uutta?",whatsNewDescription:"Päivitys vaaditaan seuraavien muutosten tukemiseksi:",noDescriptionAvailable:"Tälle versiolle ei ole saatavilla kuvausta.",alerts:{unableToGetVersionInfo:"Versiotietojen hakeminen epäonnistui. Yritä uudelleen.",selfHostedServer:"Itseisännöity palvelin",selfHostedWarning:"Jos käytät itseisännöityä palvelinta, muista päivittää myös itseisännöity instanssisi, koska muuten verkkoasiakassovellukseen kirjautuminen lakkaa toimimasta.",continueUpgrade:"Jatka päivitystä",upgradeFailed:"Päivitys epäonnistui",failedToApplyMigration:"Siirron käyttöönotto epäonnistui ({{current}} / {{total}})"}},LT={unsyncedChangesTitle:"Synkronoimattomat muutokset",unsyncedChangesWarning:"Sinulla on synkronoimattomia muutoksia, jotka menetetään, jos kirjaudut ulos nyt. Oletko varma, että haluat jatkaa?",logoutAnyway:"Kirjaudu ulos joka tapauksessa"},RT={auth:AT,menu:pT,common:yT,content:ET,items:bT,itemTypes:IT,fieldLabels:vT,totp:wT,attachmentUploader:CT,emails:NT,settings:xT,passkeys:TT,recentlyDeleted:ST,upgrade:kT,logout:LT},DT={loginTitle:"Se connecter à AliasVault",username:"Nom d'utilisateur ou email",usernamePlaceholder:"nom / nom@entreprise.com",passwordPlaceholder:"Saisissez votre mot de passe",rememberMe:"Se souvenir de moi",loginButton:"Se connecter",noAccount:"Pas de compte ?",createVault:"Créer un nouveau coffre",twoFactorTitle:"Veuillez entrer le code d'authentification de votre application d'authentification.",authCode:"Code d'authentification",authCodePlaceholder:"Saisissez le code à 6 chiffres",verify:"Vérifier",twoFactorNote:"Remarque : si vous n'avez pas accès à votre appareil d'authentification, vous pouvez réinitialiser votre authentification à double facteur avec un code de récupération en vous connectant via le site web.",masterPassword:"Mot de passe principal",unlockVault:"Déverrouiller",unlockWithPin:"Déverrouiller avec un code PIN",enterPinToUnlock:"Entrez votre code PIN pour déverrouiller votre coffre",useMasterPassword:"Utiliser le mot de passe principal",unlockTitle:"Déverrouiller votre coffre",logoutConfirm:"Êtes-vous sûr de vouloir vous déconnecter ?",unlockSuccessTitle:"Votre coffre a été déverrouillé avec succès",unlockSuccessDescription:"Vous pouvez maintenant utiliser le remplissage automatique des formulaires de connexion dans votre navigateur.",closePopup:"Fermer cette popup",browseVault:"Parcourir le contenu du coffre",connectingTo:"Connexion à",switchAccounts:"Changer de compte ?",loginWithMobile:"Se connecter à l'aide de l'application mobile",unlockWithMobile:"Déverrouiller en utilisant l'application mobile",scanQrCode:"Scannez ce code QR avec votre application mobile AliasVault pour vous connecter et déverrouiller votre coffre.",errors:{invalidCode:"Veuillez entrer un code d'authentification valide à 6 chiffres.",serverError:"Impossible d'accéder au serveur AliasVault. Veuillez réessayer plus tard ou contacter le support si le problème persiste.",wrongPassword:"Mot de passe incorrect, veuillez réessayer.",sessionExpired:"Votre session a expiré. Veuillez vous reconnecter.",mobileLoginRequestExpired:"La demande de connexion de l'application mobile a expiré. Veuillez recharger la page et réessayer."}},BT={vault:"Coffre-fort",emails:"Emails"},UT={loading:"Chargement...",notice:"Notification",error:"Erreur",cancel:"Annuler",confirm:"Confirmer",back:"Retour",next:"Suivant",use:"Utiliser",add:"Ajouter",delete:"Supprimer",undo:"Annuler",save:"Sauvegarder",saving:"Sauvegarde...",create:"Créer",or:"Ou",close:"Fermer",logout:"Déconnexion",copied:"Copié !",openInNewWindow:"Ouvrir dans une nouvelle fenêtre",enabled:"Activé",disabled:"Désactivé",showPassword:"Afficher le mot de passe",hidePassword:"Cacher le mot de passe",showDetails:"Afficher les détails",hideDetails:"Masquer les détails",copyToClipboard:"Copier dans le presse-papiers",loadingEmails:"Chargement des emails...",loadingTotpCodes:"Chargement des codes TOTP...",attachments:"Pièces jointes",loadingAttachments:"Chargement des pièces jointes...",settings:"Réglages",recentEmails:"Emails récents",credentials:"Identifiants",customFields:"Champs Personnalisés",twoFactorAuthentication:"Authentification à double facteur",alias:"Alias",notes:"Notes",email:"Email",username:"Nom d'utilisateur",password:"Mot de passe",generate:"Générer",serviceName:"Nom du service",loggedIn:"Connecté(e)",syncingVault:"Synchronisation du coffre",checkingVaultUpdates:"Vérification des mises à jour du coffre",syncingUpdatedVault:"Synchronisation du coffre mis à jour",loadMore:"Voir plus",offline:"Hors ligne",offlineMode:"Fonctionnement en mode hors ligne",pendingSync:"Synchronisation...",mergingVaultChanges:"Fusion des modifications du coffre...",uploadingVault:"Envoi du coffre...",errors:{serverNotAvailable:"Le serveur d'AliasVault n'est pas disponible. Veuillez réessayer plus tard ou contacter le support si le problème persiste.",clientVersionNotSupported:"Cette version de l'extension de navigateur AliasVault n'est plus prise en charge par le serveur. Veuillez mettre à jour votre extension de navigateur à la dernière version.",browserExtensionOutdated:"Cette extension de navigateur est obsolète et ne peut pas être utilisée pour accéder à ce coffre-fort. Veuillez la mettre à jour pour continuer.",serverVersionNotSupported:"Le serveur d'AliasVault doit être mis à jour vers une version plus récente afin d'utiliser cette extension de navigateur. Veuillez contacter le support si vous avez besoin d'aide.",serverVersionTooOld:"Le serveur AliasVault doit être mis à jour vers une version plus récente pour pouvoir utiliser cette fonctionnalité. Veuillez contacter l'administrateur du serveur si vous avez besoin d'aide.",unknownError:"Une erreur inconnue s'est produite",unknownErrorTryAgain:"Une erreur inconnue s'est produite. Merci de réessayer.",vaultNotAvailable:"Coffre non disponible",vaultIsLocked:"Le coffre est verrouillé",passwordChanged:"Votre mot de passe a changé depuis la dernière fois que vous vous êtes connecté. Veuillez vous reconnecter pour des raisons de sécurité.",syncConflictMaxRetries:"Impossible de synchroniser le coffre après plusieurs tentatives. Veuillez réessayer plus tard.",mergeFailed:"Impossible de fusionner les modifications du coffre. Veuillez réessayer."},apiErrors:{UNKNOWN_ERROR:"Une erreur inconnue s'est produite. Merci de réessayer.",ACCOUNT_LOCKED:"Compte temporairement verrouillé en raison d'un trop grand nombre de tentatives infructueuses. Veuillez réessayer plus tard.",ACCOUNT_BLOCKED:"Votre compte a été désactivé. Si vous pensez que c'est une erreur, veuillez contacter le support.",USER_NOT_FOUND:"Nom d'utilisateur ou mot de passe invalide. Veuillez réessayer.",INVALID_AUTHENTICATOR_CODE:"Code d'authentification invalide. Veuillez réessayer.",INVALID_RECOVERY_CODE:"Code de récupération invalide. Veuillez réessayer.",REFRESH_TOKEN_REQUIRED:"Un jeton d'actualisation est requis.",INVALID_REFRESH_TOKEN:"Jeton d'actualisation invalide.",PUBLIC_REGISTRATION_DISABLED:"L'enregistrement d'un nouveau compte est actuellement désactivé sur ce serveur. Veuillez contacter l'administrateur.",USERNAME_REQUIRED:"Nom d’utilisateur requis.",USERNAME_ALREADY_IN_USE:"Nom d'utilisateur déjà utilisé.",USERNAME_AVAILABLE:"Ce nom d'utilisateur est disponible.",USERNAME_MISMATCH:"Le nom d'utilisateur ne correspond pas à l'utilisateur actuel.",PASSWORD_MISMATCH:"Le mot de passe indiqué ne correspond pas à votre mot de passe actuel.",ACCOUNT_SUCCESSFULLY_DELETED:"Compte supprimé avec succès.",USERNAME_EMPTY_OR_WHITESPACE:"Le nom d'utilisateur ne peut pas être vide ou contenir un espace.",USERNAME_TOO_SHORT:"Le nom d'utilisateur est trop court : il doit comporter au moins 3 caractères.",USERNAME_TOO_LONG:"Le nom d'utilisateur est trop long : il ne peut pas contenir plus de 40 caractères.",USERNAME_INVALID_EMAIL:"Adresse e-mail invalide.",USERNAME_INVALID_CHARACTERS:"Le nom d'utilisateur n'est pas valide, il ne peut contenir que des lettres ou des chiffres.",VAULT_NOT_UP_TO_DATE:"Votre coffre n'est pas à jour. Veuillez synchroniser votre coffre et réessayer.",INTERNAL_SERVER_ERROR:"Erreur interne du serveur.",VAULT_ERROR:"Le coffre local n'est pas à jour. Veuillez synchroniser votre coffre en rafraîchissant la page et réessayez."}},_T={or:"ou",new:"Nouveautés",vaultLocked:"AliasVault est verrouillé.",creatingNewAlias:"Création de nouveaux alias...",noMatchesFound:"Aucun résultat trouvé",searchVault:"Rechercher dans le coffre...",enterServiceName:"Entrez le nom du service",enterEmailAddress:"Entrer l'adresse email",enterUsername:"Entrez le nom d'utilisateur",hideFor1Hour:"Cacher pendant 1 heure (site actuel)",hidePermanently:"Masquer définitivement (site actuel)",createRandomAlias:"Créer un alias aléatoire",createUsernamePassword:"Créer un nom d'utilisateur/mot de passe",randomAlias:"Alias aléatoire",usernamePassword:"Nom d’utilisateur / mot de passe",createAndSaveAlias:"Créer et enregistrer l'alias",createAndSaveCredential:"Créer et enregistrer les identifiants",randomIdentityDescription:"Générer une identité aléatoire avec une adresse email aléatoire accessible dans AliasVault.",randomIdentityDescriptionDropdown:"Identité aléatoire avec email aléatoire",manualCredentialDescription:"Spécifiez votre propre adresse email et nom d'utilisateur.",manualCredentialDescriptionDropdown:"Identifiant et mot de passe manuels",failedToCreateIdentity:"Échec de la création de l'identité. Veuillez réessayer.",enterEmailAndOrUsername:"Entrez l'adresse email et/ou le nom d'utilisateur",autofillWithAliasVault:"Remplissage automatique avec AliasVault",generateRandomPassword:"Générer un mot de passe aléatoire (copier dans le presse-papier)",generateNewPassword:"Générer un nouveau mot de passe",togglePasswordVisibility:"Afficher ou masquer le mot de passe",passwordCopiedToClipboard:"Mot de passe copié dans le presse-papiers",openAliasVaultToUpgrade:"Ouvrez AliasVault pour améliorer",vaultUpgradeRequired:"Mise à niveau du coffre requise.",dismissPopup:"Fermer"},MT={title:"Éléments",itemName:"Nom",loginCredentials:"Identifiants de connexion",cardInformation:"Informations de la carte",addItem:"Ajouter un élément",addNewItem:"Ajouter un nouvel élément",saveItem:"Enregistrer l'élément",itemDetails:"Détails de l’élément",editItem:"Editer l'élément",untitled:"Untitled",newFolder:"Nouveau dossier",createFolder:"Nouveau dossier",editFolder:"Éditer le dossier",folderName:"Nom du dossier",folderNameRequired:"Le nom du dossier est requis",folder:"Dossier",welcomeTitle:"Bienvenue dans AliasVault !",welcomeDescription:"Pour utiliser l'extension de navigateur AliasVault : accédez à un site web et utilisez la fenêtre de saisie automatique AliasVault pour créer un nouvel identifiant.",noPasskeysFound:"Aucune clé d'accès n'a encore été créée. Les clés d'accès sont créés en visitant un site Web qui propose des clés d'accès comme méthode d'authentification.",noAttachmentsFound:"Aucun élément avec pièces jointes trouvé",noItemsOfTypeFound:"Aucun élément {{type}} trouvé",noMatchingItems:"Aucun élément correspondant trouvé",noMatchingItemsSearch:'Aucun élément correspondant à "{{search}}"',noMatchingItemsWithFilter:'Aucun élément {{filter}} correspondant à "{{search}}"',clearSearch:"Effacer la recherche",clearFilter:"Effacer le filtre",emptyFolderHint:"Ce dossier est vide. Pour déplacer des éléments vers ce dossier, éditez l'élément et appuyez sur l'icône du dossier dans le champ nom.",allItemsInFolders:"Tous vos éléments sont organisés dans des dossiers. Appuyez sur un dossier ci-dessus pour voir vos identifiants, ou utilisez la recherche pour trouver des éléments spécifiques.",deleteFolder:"Supprimer le dossier",deleteFolderKeepItems:"Supprimer le dossier uniquement",deleteFolderKeepItemsDescription:"Les éléments seront déplacés dans la liste principale.",deleteFolderAndItems:"Supprimer le dossier et tous les éléments",deleteFolderAndItemsDescription:"{{count}} élément(s) vont être déplacés vers Récemment supprimés.",filters:{all:"(Tous) Éléments",passkeys:"Clés d'accès"},deleteItemTitle:"Supprimer l'élement",deleteItemConfirm:"Êtes-vous certain de vouloir supprimer cet élément?",viewHistory:"Voir l'historique",history:"Historique",noHistoryAvailable:"Pas d'historique disponible",tags:"Mots-clés",changePasswordComplexity:"Changer la complexité du mot de passe",passwordLength:"Longueur du mot de passe",includeLowercase:"Inclure les lettres minuscules",includeUppercase:"Inclure les lettres majuscules",includeNumbers:"Inclure des chiffres",includeSpecialChars:"Inclure des caractères spéciaux",avoidAmbiguousChars:"Éviter les caractères ambigus (o, 0, etc.)",privateEmailTitle:"E-mail privé",privateEmailAliasVaultServer:"Serveur AliasVault",privateEmailDescription:"E2E chiffré, entièrement privé.",publicEmailTitle:"Fournisseurs d'email public temporaires",publicEmailDescription:"Anonyme mais confidentiel limitée. Le contenu des e-mails est lisible par toute personne qui connaît l'adresse.",validation:{required:"Ce champ est requis"}},FT={selectType:"Ajouter un nouvel élément",typeLabel:"Type d'élément",creating:"Création",editing:"Édition",regenerateAlias:"Régénérer l'alias",addCustomField:"Ajouter un champ personnalisé",fieldLabel:"Intitulé du champ",enterFieldName:"Entrez le nom du champ",fieldType:"Type de champ",fieldTypes:{text:"Texte",hidden:"Caché (texte masqué)",email:"Email",url:"URL",phone:"Téléphone",number:"Numéro",date:"Date",textArea:"Zone de texte"},login:{title:"Se connecter"},alias:{title:"Alias"},creditCard:{title:"Carte de crédit"},note:{title:"Note sécurisée"}},OT={"login.url":"URL du site","login.username":"Username","login.password":"Mot de passe","alias.first_name":"Prénom","alias.last_name":"Nom","alias.gender":"Genre","alias.birthdate":"Date de naissance","login.email":"Email","notes.content":"Notes","card.cardholder_name":"Nom du titulaire de la carte","card.number":"Numéro de la carte","card.expiry_month":"Mois d'expiration","card.expiry_year":"Année d'expiration","card.cvv":"CVV","card.pin":"PIN"},jT={addCode:"Ajouter un code 2FA",instructions:"Entrez la clé secrète affichée par le site Web où vous souhaitez ajouter l'authentification à deux facteurs.",nameOptional:"Nom (facultatif)",secretKey:"Clé secrète",saveToViewCode:"Enregistrer pour afficher le code",defaultName:"Authentificateur",errors:{invalidSecretKey:"Format de clé secrète invalide."}},PT={uploading:"Envoi...",uploadSuccess:"Fichiers envoyés avec succès.",deleteSuccess:"Pièce jointe supprimée avec succès.",firefoxExpandRequired:"Pour envoyer des fichiers, utilisez la fenêtre étendue.",openExpandedWindow:"Ouvrir la fenêtre étendue"},HT={title:"Emails",deleteEmailTitle:"Supprimer l'email",deleteEmailConfirm:"Êtes-vous sûr de vouloir supprimer définitivement cet email ?",from:"De",to:"À",date:"Date",emailContent:"Contenu de l'email",emailNotFound:"Email introuvable",noEmails:"Aucun email trouvé",noEmailsDescription:"Vous n'avez pas encore reçu d'emails dans vos adresses email privées. Quand vous recevez un nouvel email, il apparaîtra ici.",offlineMessage:"Vous êtes déconnecté. Veuillez vous connecter à internet pour charger vos e-mails.",dateFormat:{justNow:"maintenant",minutesAgo_single:"Il y a {{count}} minute",minutesAgo_plural:"Il y a {{count}} minutes",hoursAgo_single:"Il y a {{count}} heure",hoursAgo_plural:"Il y a {{count}} heures",yesterday:"hier"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"L'adresse email actuelle est déjà utilisée. Veuillez modifier l'adresse email en modifiant cet identifiant.",CLAIM_DOES_NOT_EXIST:"Une erreur s'est produite en essayant de charger les emails. Veuillez essayer de modifier et enregistrer les informations d'identification pour synchroniser la base de données, puis réessayez."}},QT={serverUrl:"URL du serveur",language:"Langue",autofillEnabled:"Activer le remplissage automatique",version:"Version",openWebApp:"Ouvrir l’application web",lock:"Verrouiller",globalSettings:"Paramètres généraux",autofillPopup:"Remplissage automatique de la popup",activeOnAllSites:"Activé sur tous les sites (sauf si désactivé ci-dessous)",disabledOnAllSites:"Désactivé sur tous les sites",rightClickContextMenu:"Clic-droit sur le menu contextuel",autofillMatching:"Correspondance de remplissage automatique",autofillMatchingMode:"Remplir automatiquement le mode correspondant",autofillMatchingModeDescription:"Détermine quels identifiants sont considérés comme une correspondance et sont affichés comme des suggestions dans la fenêtre de saisie automatique pour un site web donné.",autofillMatchingDefault:"URL + sous-domaine + nom générique",autofillMatchingUrlSubdomain:"URL + sous-domaine",autofillMatchingUrlExact:"Domaine d'URL exact uniquement",siteSpecificSettings:"Paramètres spécifiques au site",autofillPopupOn:"Popup de saisie automatique sur:  ",enabledForThisSite:"Activé pour ce site",disabledForThisSite:"Désactivé pour ce site",temporarilyDisabledUntil:"Temporairement désactivé jusqu'au ",resetAllSiteSettings:"Réinitialiser tous les paramètres spécifiques au site",appearance:"Apparence",theme:"Thème",useDefault:"Utiliser par défaut",light:"Clair",dark:"Sombre",keyboardShortcuts:"Raccourcis clavier",configureKeyboardShortcuts:"Configurer les raccourcis clavier",configure:"Configurer",clipboardClearTimeout:"Effacer le presse-papiers après copie",clipboardClearTimeoutDescription:"Effacer automatiquement le presse-papiers après copie des données sensibles",clipboardClearDisabled:"Ne jamais effacer",clipboardClear5Seconds:"Effacer après 5 secondes",clipboardClear10Seconds:"Effacer après 10 secondes",clipboardClear15Seconds:"Effacer après 15 secondes",autoLockTimeout:"Délai de verrouillage automatique",autoLockTimeoutDescription:"Verrouiller automatiquement le coffre après une période d'inactivité",autoLockTimeoutHelp:"Le coffre ne se verrouille qu'après la période d'inactivité spécifiée (aucune fenêtre pop-up de saisie automatique ou d'extension). Le coffre sera toujours verrouillé lorsque le navigateur sera fermé, quel que soit ce paramètre.",autoLockNever:"Jamais",autoLock15Seconds:"15 secondes",autoLock1Minute:"1 minute",autoLock5Minutes:"5 minutes",autoLock15Minutes:"15 minutes",autoLock30Minutes:"30 minutes",autoLock1Hour:"1 heure",autoLock4Hours:"4 heures",autoLock8Hours:"8 heures",autoLock24Hours:"24 heures",versionPrefix:"Version ",autofillSettings:"Paramètres du remplissage automatique",clipboardSettings:"Paramètres du presse-papiers",contextMenuSettings:"Paramètres du menu contextuel",passkeySettings:"Paramètres de la clé d'accès",contextMenu:"Menu contextuel",contextMenuEnabled:"Le menu contextuel est activé",contextMenuDisabled:"Le menu contextuel est désactivé",contextMenuDescription:"Faites un clic droit sur les champs de saisie pour accéder aux options d'AliasVault",selectLanguage:"Sélectionner une langue",serverConfiguration:"Configuration du serveur",serverConfigurationDescription:"Configurer l'URL du serveur AliasVault pour les instances auto-hébergées",customApiUrl:"URL de l'API",customClientUrl:"URL du client",apiUrlHint:"L'URL du point de terminaison de l'API (généralement l'URL du client + /api)",clientUrlHint:"L'URL de l'interface web de votre instance auto-hébergée",autofillSettingsDescription:"Activer ou désactiver la popup de saisie automatique sur les pages web",autofillEnabledDescription:"Les suggestions de saisie automatique apparaîtront dans les formulaires de connexion",autofillDisabledDescription:"Les suggestions de saisie automatique sont désactivées globalement",languageSettings:"Langue",validation:{apiUrlRequired:"L'URL de l'API est requise",apiUrlInvalid:"Veuillez entrer une URL d'API valide",clientUrlRequired:"L'URL du client est requise",clientUrlInvalid:"Veuillez entrer une URL de client valide"},unlockMethod:{title:"Méthode de déverrouillage du coffre",introText:"Choisissez comment vous voulez déverrouiller votre coffre. Vous pouvez utiliser votre mot de passe principal (toujours disponible) ou configurer un code PIN pour un accès rapide. Après 3 tentatives de PIN échouées, vous devrez utiliser votre mot de passe maître.",password:"Mot de passe maître",pin:"Code PIN",pinDescription:"Déverrouiller le coffre avec le code PIN",setupPin:"Configurer le code PIN",enterNewPinDescription:"Entrez un code PIN composé d'au moins 6 chiffres",confirmPin:"Confirmer le code PIN",confirmPinDescription:"Saisissez à nouveau votre code PIN pour confirmer",invalidPinFormat:"Format de code PIN invalide",pinMismatch:"Les codes PIN ne correspondent pas",incorrectPin:"Code PIN incorrect, {{attemptsRemaining}} tentatives restantes.",incorrectPinSingular:"Code PIN incorrect. 1 tentative restante.",enableSuccess:"Déverrouillage par code PIN activé avec succès!",pinLocked:"Le déverrouillage par code PIN a été désactivé. Veuillez utiliser votre mot de passe maître pour déverrouiller votre coffre.",pinSecurityWarning:"Le déverrouillage par code PIN dans l'extension du navigateur peut être moins sécurisé que votre mot de passe principal, car les codes PIN ont généralement une entropie plus faible et peuvent être trouvés par brute force si votre appareil est compromis. Ne l'utilisez que sur les appareils de confiance totale."}},zT={passkey:"Clé d'accès",site:"Site",helpText:"Les clés d'accès sont créées sur le site Web lorsque vous y êtes invité. Elles ne peuvent pas être modifiées manuellement. Pour supprimer cette clé d'accès, vous pouvez la supprimer de cet identifiant. Pour remplacer cette clé d'accès ou en créer une nouvelle, visitez le site Web et suivez ses instructions.",passkeyMarkedForDeletion:"Clé d'accès marquée pour suppression",passkeyWillBeDeleted:"Cette clé d'accès sera supprimée lorsque vous enregistrerez cet identifiant.",useBrowserPasskey:"Utiliser la clé d'accès du navigateur",bypass:{description:"Combien de temps souhaitez-vous utiliser le fournisseur de clé d'accès du navigateur pour {{origin}}?",thisTimeOnly:"Cette fois seulement",alwaysForSite:"Toujours pour ce site"},authenticate:{title:"Se connecter avec une clé d’accès",signInFor:"Se connecter avec une clé d’accès pour",selectPasskey:"Sélectionnez une clé d'accès pour vous connecter:",noPasskeysFound:"Aucune clé d'accès trouvée pour ce site"},create:{title:"Créer une clé d'accès",createFor:"Créer une nouvelle clé d'accès pour",titleLabel:"Titre",titlePlaceholder:"Entrez un nom pour cette clé d'accès",createButton:"Créer clé d'accès",selectPasskeyToReplace:"Sélectionnez une clé d'accès à remplacer:",createNewPasskey:"Créer une nouvelle clé d'accès",replacingPasskey:"Remplacement de la clé d'accès : {{displayName}}",confirmReplace:"Confirmer le remplacement",selectExistingLogin:"Ajouter à l'identifiant existant :",selectExistingLoginDescription:"Joindre cette clé d'accès à un identifiant de connexion existant pour ce site.",attachingToCredential:"Ajout de la clé d'accès à : {{serviceName}}",attachPasskey:"Ajouter une clé d'accès"},settings:{passkeyProvider:"Fournisseur de clés d'accès",passkeyProviderOn:"Fournisseur de clé d'accès activé "}},VT={title:"Supprimé récemment",noItems:"Aucun élément supprimé",noItemsDescription:"Les éléments que vous supprimez apparaîtront ici pendant 30 jours avant d'être définitivement supprimés.",description:"Ces éléments seront définitivement supprimés après 30 jours. Vous pouvez les restaurer ou les supprimer immédiatement.",restore:"Restaurer",deletePermanently:"Supprimer définitivement",emptyAll:"Vider tout",daysRemaining_one:"{{count}} jour restant",daysRemaining_other:"{{count}} jours restants",expiringSoon:"Expirant bientôt",confirmDeleteTitle:"Supprimer définitivement?",confirmDeleteMessage:"Cet élément sera définitivement supprimé et ne pourra pas être récupéré.",confirmEmptyAllTitle:"Vider récemment supprimé ?",confirmEmptyAllMessage:"Tous les {{count}} éléments seront définitivement supprimés et ne pourront pas être récupérés."},KT={title:"Mettre à niveau le coffre",subtitle:"AliasVault a mis à jour et votre coffre doit être mis à niveau. Cela ne devrait prendre que quelques secondes.",versionInformation:"Informations de version",yourVault:"Votre version de coffre-fort :",newVersion:"Nouvelle version valable :",upgrade:"Mettre le coffre à niveau",upgrading:"Mise à niveau...",whatsNew:"Nouveautés",whatsNewDescription:"Une mise à niveau est nécessaire pour prendre en charge les modifications suivantes :",noDescriptionAvailable:"Aucune description disponible pour cette version.",alerts:{unableToGetVersionInfo:"Impossible d'obtenir les informations de version. Veuillez réessayer.",selfHostedServer:"Serveur auto-hébergé",selfHostedWarning:"Si vous utilisez un serveur auto-hébergé, assurez-vous également de mettre à jour votre instance auto-hébergée, sinon la connexion au client web cessera de fonctionner.",continueUpgrade:"Continuer la mise à jour",upgradeFailed:"Échec de la mise à niveau",failedToApplyMigration:"Impossible d'appliquer la migration ({{current}} sur {{total}})"}},GT={unsyncedChangesTitle:"Changements non synchronisés",unsyncedChangesWarning:"Vous avez des modifications non synchronisées qui seront perdues si vous vous déconnectez maintenant. Êtes-vous sûr de vouloir continuer ?",logoutAnyway:"Se déconnecter quand même"},qT={auth:DT,menu:BT,common:UT,content:_T,items:MT,itemTypes:FT,fieldLabels:OT,totp:jT,attachmentUploader:PT,emails:HT,settings:QT,passkeys:zT,recentlyDeleted:VT,upgrade:KT,logout:GT},WT={loginTitle:"כניסה ל־AliasVault",username:"שם משתמש או דוא״ל",usernamePlaceholder:"שם / name@company.com",passwordPlaceholder:"נא למלא את הסיסמה שלך",rememberMe:"לזכור אותי",loginButton:"כניסה",noAccount:"אין לך חשבון עדיין?",createVault:"יצירת כספת חדשה",twoFactorTitle:"נא למלא את קוד האימות מיישומון המאמת שלך.",authCode:"קוד אימות",authCodePlaceholder:"נא למלא קוד באורך 6 ספרות",verify:"אימות",twoFactorNote:"לתשומת ליבך: אם אין לך גישה להתקן המאמת (authenticator) שלך, אפשר לאפס אימות דו־שלבי עם קוד שחזור על ידי כניסה דרך האתר.",masterPassword:"סיסמת על",unlockVault:"שחרור נעילה",unlockWithPin:"שחרור נעילה עם קוד אישי",enterPinToUnlock:"נא למלא את הקוד האישי שלך כדי לשחרר את הכספת שלך",useMasterPassword:"להשתמש בסיסמה על",unlockTitle:"שחרור נעילת הכספת שלך",logoutConfirm:"לצאת?",unlockSuccessTitle:"נעילת הכספת שלך נפתחה בהצלחה",unlockSuccessDescription:"מעתה ניתן להשתמש בהשלמה אוטומטית בטופסי כניסה בדפדפן שלך.",closePopup:"סגירת החלונית הצצה הזאת",browseVault:"עיון בתוכן הכספת",connectingTo:"מתבצעת התחברות אל",switchAccounts:"להחליף חשבונות?",loginWithMobile:"Log in using Mobile App",unlockWithMobile:"Unlock using Mobile App",scanQrCode:"Scan this QR code with your AliasVault mobile app to log in and unlock your vault.",errors:{invalidCode:"נא למלא קוד אימות באורך 6 ספרות.",serverError:"לא ניתן ליצור קשר עם השרת של AliasVault. נא לנסות שוב מאוחר יותר או ליצור קשר עם התמיכה אם הבעיה נשנית.",wrongPassword:"סיסמה שגויה. נא לנסות שוב.",sessionExpired:"תוקף ההפעלה שלך פג. נא להיכנס מחדש.",mobileLoginRequestExpired:"Mobile login request timed out. Please reload the page and try again."}},YT={vault:"Vault",emails:"הודעות דוא״ל"},JT={loading:"בטעינה…",notice:"לתשומת ליבך",error:"שגיאה",cancel:"ביטול",confirm:"אישור",back:"חזרה",next:"הבא",use:"להשתמש",add:"Add",delete:"מחיקה",undo:"הסגה",save:"שמירה",saving:"Saving...",create:"יצירה",or:"או",close:"סגירה",logout:"יציאה",copied:"הועתק!",openInNewWindow:"פתיחה בחלון חדש",enabled:"פעיל",disabled:"כבוי",showPassword:"הצגת סיסמה",hidePassword:"הסתרת סיסמה",showDetails:"הצגת פרטים",hideDetails:"הסתרת פרטים",copyToClipboard:"העתקה ללוח הגזירים",loadingEmails:"הודעות הדוא״ל נטענות…",loadingTotpCodes:"הקודים החד־פעמיים הזמניים נטענים…",attachments:"צרופות",loadingAttachments:"הצרופות נטענות…",settings:"הגדרות",recentEmails:"הודעות דוא״ל אחרונות",credentials:"פרטי גישה",customFields:"Custom Fields",twoFactorAuthentication:"אימות דו־שלבי",alias:"כינוי",notes:"הערות",email:"דוא״ל",username:"שם משתמש",password:"סיסמה",generate:"Generate",serviceName:"שם השירות",loggedIn:"נכנסת",syncingVault:"הכספת מסתנכרת",checkingVaultUpdates:"מתבצעת בדיקה לשינויים בכספת",syncingUpdatedVault:"הכספת העדכנית מסתנכרת",loadMore:"לטעון עוד",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Merging vault changes...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"שרת ה־AliasVault לא זמין. נא לנסות שוב מאוחר יותר או ליצור קשר עם התמיכה אם הבעיה נשנית.",clientVersionNotSupported:"הגרסה הזאת של הרחבת הדפדפן של AliasVault לא נתמכת עוד על ידי השרת. נא לעדכן את הרחבת הדפדפן שלך לגרסה העדכנית ביותר.",browserExtensionOutdated:"הרחבת הדפדפן הזאת לא עדכנית ואי אפשר להשתמש בה כדי לגשת לכספת הזאת. נא לעדכן את הרחבת הדפדפן הזאת כדי להמשיך.",serverVersionNotSupported:"יש לעדכן את שרת AliasVault לגרסה חדשה יותר כדי להשתמש בהרחבת הדפדפן הזאת. נא ליצור קשר עם התמיכה לקבלת עזרה.",serverVersionTooOld:"The AliasVault server needs to be updated to a newer version in order to use this feature. Please contact the server admin if you need help.",unknownError:"אירעה שגיאה לא ידועה",unknownErrorTryAgain:"אירעה שגיאה לא ידועה, נא לנסות שוב.",vaultNotAvailable:"הכספת לא זמינה",vaultIsLocked:"הכספת נעולה",passwordChanged:"הסיסמה שלך השתנתה מאז הפעם האחרונה שנכנסת למערכת. נא להיכנס שוב מטעמי אבטחת מידע.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"אירעה שגיאה לא ידועה, נא לנסות שוב.",ACCOUNT_LOCKED:"החשבון נעול זמנית עקב ריבוי ניסיונות כושלים. נא לנסות שוב מאוחר יותר.",ACCOUNT_BLOCKED:"החשבון שלך הושבת. אם לדעתך מדובר בטעות, נא ליצור קשר עם התמיכה.",USER_NOT_FOUND:"שם המשתמש או הסיסמה שגויים. נא לנסות שוב.",INVALID_AUTHENTICATOR_CODE:"קוד מאמת שגוי. נא לנסות שוב.",INVALID_RECOVERY_CODE:"קוד שחזור שגוי. נא לנסות שוב.",REFRESH_TOKEN_REQUIRED:"אסימון ריענון חובה.",INVALID_REFRESH_TOKEN:"אסימון ריענון שגוי.",PUBLIC_REGISTRATION_DISABLED:"רישום חשבון חדש מושבת כרגע בשרת הזה. נא ליצור קשר עם ההנהלה.",USERNAME_REQUIRED:"שם משתמש חובה.",USERNAME_ALREADY_IN_USE:"שם המשתמש כבר תפוס.",USERNAME_AVAILABLE:"שם המשתמש פנוי.",USERNAME_MISMATCH:"שם המשתמש לא מתאים למשתמש הנוכחי.",PASSWORD_MISMATCH:"הסיסמה שסופקה לא תואמת לסיסמה הנוכחית שלך.",ACCOUNT_SUCCESSFULLY_DELETED:"החשבון נמחק בהצלחה.",USERNAME_EMPTY_OR_WHITESPACE:"שם המשתמש לא יכול להיות ריק או מורכב מרווחים בלבד.",USERNAME_TOO_SHORT:"שם המשתמש קצר מדי: חייב להיות באורך 3 תווים לפחות.",USERNAME_TOO_LONG:"שם המשתמש ארוך מדי: לא יכול להיות ארוך מ־40 תווים.",USERNAME_INVALID_EMAIL:"כתובת דוא״ל שגויה.",USERNAME_INVALID_CHARACTERS:"שם המשתמש שגוי, יכול להכיל רק תווים או ספרות.",VAULT_NOT_UP_TO_DATE:"הכספת שלך אינה עדכנית. נא לסנכרן את הכספת שלך ולנסות שוב.",INTERNAL_SERVER_ERROR:"שגיאת שרת פנימית.",VAULT_ERROR:"הכספת המקומית אינה עדכנית. נא לסנכרן את הכספת שלך על ידי ריענון העמוד ולנסות שוב."}},XT={or:"או",new:"חדש",vaultLocked:"AliasVault נעול.",creatingNewAlias:"נוצר כינוי חדש...",noMatchesFound:"לא נמצאו תוצאות",searchVault:"חיפוש בכספת…",enterServiceName:"נא למלא את שם השירות",enterEmailAddress:"נא למלא כתובת דוא״ל",enterUsername:"נא למלא שם משתמש",hideFor1Hour:"הסתרה למשך שעה (האתר הנוכחי)",hidePermanently:"הסתרה לצמיתות (האתר הנוכחי)",createRandomAlias:"יצירת כינוי אקראי",createUsernamePassword:"יצירת שם משתמש/סיסמה",randomAlias:"כינוי אקראי",usernamePassword:"שם משתמש/סיסמה",createAndSaveAlias:"יצירה ושמירה של כינוי",createAndSaveCredential:"יצירה ושמירה של פרטי גישה",randomIdentityDescription:"יצירת זהות אקראית עם כתובת דוא״ל אקראית שנגישה דרך AliasVault.",randomIdentityDescriptionDropdown:"זהות אקראיות עם דוא״ל אקראי",manualCredentialDescription:"נא לציין כתובת דוא״ל ושם משתמש משלך.",manualCredentialDescriptionDropdown:"שם משתמש וסיסמה ידניים",failedToCreateIdentity:"יצירת הזהות נכשלה. נא לנסות שוב.",enterEmailAndOrUsername:"נא למלא דוא״ל ו/או שם משתמש",autofillWithAliasVault:"השלמה אוטומטית עם AliasVault",generateRandomPassword:"יצירת סיסמה אקראית (העתקה ללוח הגזירים)",generateNewPassword:"יצירת סיסמה חדשה",togglePasswordVisibility:"הצגת/הסתרת סיסמה",passwordCopiedToClipboard:"הסיסמה הועתקה ללוח הגזירים",openAliasVaultToUpgrade:"יש לפתוח את AliasVault כדי לשדרג",vaultUpgradeRequired:"יש לשדרג את הכספת.",dismissPopup:"התעלמות מחלונית"},$T={title:"Items",itemName:"שם",loginCredentials:"פרטי הגישה",cardInformation:"Card Information",addItem:"Add Item",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Item Details",editItem:"Edit Item",untitled:"Untitled",newFolder:"New Folder",createFolder:"יצירת תיקייה",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"תיקייה",welcomeTitle:"ברוך בואך ל־AliasVault!",welcomeDescription:"כדי להשתמש בהרחבת הדפדפן של AliasVault: יש לנווט לאתר ולהשתמש בחלונית ההשלמה האוטומטית של AliasVault כדי ליצור פרטי גישה חדשים.",noPasskeysFound:"No passkeys have been created yet. Passkeys are created by visiting a website that offers passkeys as an authentication method.",noAttachmentsFound:"No items with attachments found",noItemsOfTypeFound:"No {{type}} items found",noMatchingItems:"No matching items found",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(All) Items",passkeys:"Passkeys"},deleteItemTitle:"Delete Item",deleteItemConfirm:"Are you sure you want to delete this item?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"תגיות",changePasswordComplexity:"החלפת מורכבת הסיסמה",passwordLength:"אורך הסיסמה",includeLowercase:"לכלול אותיות קטנות",includeUppercase:"לכלול אותיות גדולות",includeNumbers:"לכלול מספרים",includeSpecialChars:"לכלול תווים מיוחדים",avoidAmbiguousChars:"עדיף להימנע מאותיות וספרות שדומים זה לזה (o,‏ 0 וכו׳)",privateEmailTitle:"כתובת דוא״ל פרטית",privateEmailAliasVaultServer:"שרת AliasVault",privateEmailDescription:"הצפנה מקצה לקצה, פרטיות מלאה.",publicEmailTitle:"ספקי תיבת דוא״ל זמנית ציבוריים",publicEmailDescription:"פרטיות אלמונית אך מוגבלת. תוכן הדוא״ל נגיש לכל מי שיודע את הכתובת.",validation:{required:"שדה חובה"}},ZT={selectType:"Add New Item",typeLabel:"Item Type",creating:"Creating",editing:"Editing",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Field Label",enterFieldName:"Enter field name",fieldType:"Field Type",fieldTypes:{text:"Text",hidden:"Hidden (masked text)",email:"דוא״ל",url:"URL",phone:"Phone",number:"Number",date:"תאריך",textArea:"Text Area"},login:{title:"כניסה"},alias:{title:"כינוי"},creditCard:{title:"Credit Card"},note:{title:"Secure Note"}},eS={"login.url":"Website URL","login.username":"שם משתמש","login.password":"סיסמה","alias.first_name":"שם פרטי","alias.last_name":"שם משפחה","alias.gender":"מגדר","alias.birthdate":"תאריך לידה","login.email":"דוא״ל","notes.content":"הערות","card.cardholder_name":"Cardholder Name","card.number":"Card Number","card.expiry_month":"Expiry Month","card.expiry_year":"Expiry Year","card.cvv":"CVV","card.pin":"PIN"},tS={addCode:"Add 2FA Code",instructions:"Enter the secret key shown by the website where you want to add two-factor authentication.",nameOptional:"שם (רשות)",secretKey:"מפתח סודי",saveToViewCode:"יש לשמור כדי לצפות בקוד",defaultName:"Authenticator",errors:{invalidSecretKey:"Invalid secret key format."}},aS={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},nS={title:"הודעות דוא״ל",deleteEmailTitle:"מחיקת הודעת דוא״ל",deleteEmailConfirm:"למחוק את הודעת הדוא״ל הזאת לצמיתות?",from:"מאת",to:"אל",date:"תאריך",emailContent:"תוכן הודעת דוא״ל",emailNotFound:"הודעת הדוא״ל לא נמצאה",noEmails:"לא נמצאו הודעות דוא״ל",noEmailsDescription:"לא קיבלת הודעות דוא״ל כלשהן לכתובות הדוא״ל הפרטיות שלך עדיין. כשמגיעה הודעה חדשה היא תופיע כאן.",offlineMessage:"החיבור שלך מנותק. נא להתחבר לאינטרנט כדי לטעון את הודעות הדוא״ל שלך.",dateFormat:{justNow:"ממש הרגע",minutesAgo_single:"לפני דקה",minutesAgo_plural:"לפני {{count}} דקות",hoursAgo_single:"לפני שעה",hoursAgo_plural:"לפני {{count}} שעות",yesterday:"אתמול"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"כתובת הדוא״ל שנבחרה תפוסה. נא לשנות את כתובת הדוא״ל על ידי עריכת פרטי הגישה.",CLAIM_DOES_NOT_EXIST:"אירעה שגיאה בניסיון לטעון את הודעות הדוא״ל. נא לנסות לערוך ולשמור את רשומת פרטי הקשר כדי לסנכרן את מסד הנתונים ואז לנסות שוב."}},rS={serverUrl:"כתובת שרת",language:"שפה",autofillEnabled:"הפעלת השלמה אוטומטית",version:"גרסה",openWebApp:"פתיחת אתר",lock:"נעילה",globalSettings:"הגדרות מקיפות",autofillPopup:"חלונית השלמה אוטומטית",activeOnAllSites:"פעיל בכל האתרים (למעט אם נכבה להלן)",disabledOnAllSites:"כבוי בכל האתרים",rightClickContextMenu:"תפריט הקשר בלחיצה ימנית",autofillMatching:"התאמת השלמה אוטומטית",autofillMatchingMode:"מצב התאמת השלמה אוטומטית",autofillMatchingModeDescription:"הגדרה אילו פרטי גישה נחשבים תואמים ויופיעו כהצעות בחלונית ההשלמה האוטומטית לאתר מסוים.",autofillMatchingDefault:"כתובת + שם תת־תחום + תו כל על שם",autofillMatchingUrlSubdomain:"כתובת + שם תת־תחום",autofillMatchingUrlExact:"תחום כתובת מדויקת בלבד",siteSpecificSettings:"הגדרות תואמות אתר",autofillPopupOn:"חלונית השלמה אוטומטית ב־: ",enabledForThisSite:"פעיל לאתר הזה",disabledForThisSite:"כבוי לאתר הזה",temporarilyDisabledUntil:"כבוי זמנית עד ",resetAllSiteSettings:"איפוס כל ההגדרות הנקודתיות לאתרים",appearance:"מראה",theme:"ערכת עיצוב",useDefault:"להשתמש בברירת המחדל",light:"בהירה",dark:"כהה",keyboardShortcuts:"קיצורי מקלדת",configureKeyboardShortcuts:"הגדרת קיצורי מקלדת",configure:"הגדרה",clipboardClearTimeout:"לפנות את לוח הגזירים לאחר העתקה",clipboardClearTimeoutDescription:"לפנות את לוח הגזירים אוטומטית לאחר העתקת נתונים רגישים",clipboardClearDisabled:"אף פעם לא לפנות",clipboardClear5Seconds:"לפנות אחרי 5 שניות",clipboardClear10Seconds:"לפנות אחרי 10 שניות",clipboardClear15Seconds:"לפנות אחרי 15 שניות",autoLockTimeout:"תום המתנה לנעילה אוטומטית",autoLockTimeoutDescription:"לנעול את הכספת אוטומטית לאחר פרק זמן של חוסר פעילות",autoLockTimeoutHelp:"הכספת תינעל רק לאחר משך זמן של חוסר פעילות (אין שימוש בהשלמה אוטומטית או פתיחת חלונית הרחבה). הכספת תמיד תינעל עם סגירת הדפדפן, ללא תלות בהגדרה הזאת.",autoLockNever:"אף פעם",autoLock15Seconds:"15 שניות",autoLock1Minute:"דקה",autoLock5Minutes:"5 דקות",autoLock15Minutes:"15 דקות",autoLock30Minutes:"30 דקות",autoLock1Hour:"שעה",autoLock4Hours:"4 שעות",autoLock8Hours:"8 שעות",autoLock24Hours:"24 שעות",versionPrefix:"גרסה ",autofillSettings:"הגדרות השלמה אוטומטית",clipboardSettings:"הגדרות לוח הגזירים",contextMenuSettings:"הגדרות תפריט הקשר",passkeySettings:"Passkey Settings",contextMenu:"תפריט הקשר",contextMenuEnabled:"תפריט הקשר פעיל",contextMenuDisabled:"תפריט הקשר כבוי",contextMenuDescription:"ניתן ללחוץ על שדה עם הלחצן הימני כדי לגשת לאפשרויות AliasVault",selectLanguage:"בחירת שפה",serverConfiguration:"הגדרות שרת",serverConfigurationDescription:"הגדרת כתובת שרת AliasVault לעותקים באירוח עצמי",customApiUrl:"כתובת API",customClientUrl:"כתובת לקוח",apiUrlHint:"נקודת הקצה של ה־API (בדרך כלל כתובת לקוח + ‎/api)",clientUrlHint:"כתובת ממשק המשתמש הדפדפני של העותק באירוע העצמי שלך",autofillSettingsDescription:"הפעלת או כיבוי חלוניות השלמה אוטומטית בעמודי אתרים",autofillEnabledDescription:"הצעות השלמה אוטומטית בטופסי כניסה למערכות",autofillDisabledDescription:"הצעות השלמה אוטומטית כבויות באופן מקיף",languageSettings:"שפה",validation:{apiUrlRequired:"כתובת API חובה",apiUrlInvalid:"נא למלא כתובת API תקפה",clientUrlRequired:"כתובת לקוח חובה",clientUrlInvalid:"נא למלא כתובת לקוח תקפה"},unlockMethod:{title:"שיטת שחרור נעילת כספת",introText:"Choose how you want to unlock your vault. You can use your master password (always available) or set up a PIN code for faster access. After 3 failed PIN attempts, you'll need to use your master password.",password:"סיסמת על",pin:"קוד אישי",pinDescription:"שחרור כספת עם קוד אישי",setupPin:"הגדרת קוד גישה אישי",enterNewPinDescription:"נא למלא קוד אישי שמורכב מ־6 ספרות לפחות",confirmPin:"אישור קוד אישי",confirmPinDescription:"נא למלא את הקוד האישי שלך שוב לאישור",invalidPinFormat:"תבנית הקוד האישי שגויה",pinMismatch:"הקודים האישיים לא תואמים",incorrectPin:"קוד אישי שגוי. נותרו {{attemptsRemaining}} ניסיונות.",incorrectPinSingular:"קוד אישי שגוי. נותר עוד ניסיון.",enableSuccess:"שחרור קוד אישי הופעל בהצלחה!",pinLocked:"שחרור נעילה עם קוד אישי הושבתה. נא להשתמש בסיסמת העל שלך כדי לשחרר את הכספת שלך.",pinSecurityWarning:"PIN unlock in the browser extension can be less secure than your master password, as PINs typically have lower entropy and may be brute-forced if your device is compromised. Use it only on devices you fully trust."}},iS={passkey:"Passkey",site:"אתר",helpText:"Passkeys are created on the website when prompted. They cannot be manually edited. To remove this passkey, you can delete it from this credential. To replace this passkey or create a new one, visit the website and follow its prompts.",passkeyMarkedForDeletion:"Passkey marked for deletion",passkeyWillBeDeleted:"This passkey will be deleted when you save this credential.",useBrowserPasskey:"Use Browser Passkey",bypass:{description:"How long would you like to use the browser's passkey provider for {{origin}}?",thisTimeOnly:"בפעם הזאת בלבד",alwaysForSite:"תמיד לאתר הזה"},authenticate:{title:"Sign in with Passkey",signInFor:"Sign in with passkey for",selectPasskey:"Select a passkey to sign in:",noPasskeysFound:"No passkeys found for this site"},create:{title:"Create Passkey",createFor:"Create a new passkey for",titleLabel:"כותרת",titlePlaceholder:"Enter a name for this passkey",createButton:"Create Passkey",selectPasskeyToReplace:"Select a passkey to replace:",createNewPasskey:"Create New Passkey",replacingPasskey:"Replacing passkey: {{displayName}}",confirmReplace:"אישור החלפה",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Passkey Provider",passkeyProviderOn:"Passkey Provider on "}},sS={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},oS={title:"שדרוג כספת",subtitle:"AliasVault התעדכן וצריך לשדרג את הכספת שלך. הפעולה הזאת אמורה לארוך מספר שניות.",versionInformation:"פרטי גרסה",yourVault:"גרסת הכספת שלך:",newVersion:"הגרסה החדשה הזמינה:",upgrade:"שדרוג כספת",upgrading:"משתדרגת…",whatsNew:"מה חדש",whatsNewDescription:"יש לשדרג כדי שתהיה תמיכה בשינויים הבאים:",noDescriptionAvailable:"אין תיאור זמין לגרסה הזאת.",alerts:{unableToGetVersionInfo:"לא ניתן לקבל את פרטי הגרסה. נא לנסות שוב מאוחר יותר.",selfHostedServer:"שרת באירוח עצמי",selfHostedWarning:"אם מדובר בשרת שמתארח עצמאית, נא לוודא שהעותק שמתארח אצלך גם כן מתעדכן כי אחרת הכניסה לאתר תפסיק לעבוד.",continueUpgrade:"להמשיך בשדרוג",upgradeFailed:"השדרוג נכשל",failedToApplyMigration:"החלת ההסבה נכשלה ({{current}} מתוך {{total}})"}},lS={unsyncedChangesTitle:"Unsynced Changes",unsyncedChangesWarning:"You have unsynced changes that will be lost if you log out now. Are you sure you want to continue?",logoutAnyway:"Log out anyway"},cS={auth:WT,menu:YT,common:JT,content:XT,items:$T,itemTypes:ZT,fieldLabels:eS,totp:tS,attachmentUploader:aS,emails:nS,settings:rS,passkeys:iS,recentlyDeleted:sS,upgrade:oS,logout:lS},uS={loginTitle:"Accedi ad AliasVaultriem",username:"Nome utente o mail",usernamePlaceholder:"nome / nome@azienda.com",passwordPlaceholder:"Inserisci la tua password",rememberMe:"Ricordati di me",loginButton:"Accedi",noAccount:"Non hai ancora un account?",createVault:"Crea una nuova cassaforte",twoFactorTitle:"Inserisci il codice di autenticazione dalla tua app di autenticazione.",authCode:"Codice di Autenticazione",authCodePlaceholder:"Inserisci il codice a 6 cifre",verify:"Verifica",twoFactorNote:"Nota: se non hai accesso al tuo dispositivo di autenticazione, puoi reimpostare il tuo 2FA con un codice di recupero accedendo tramite il sito web.",masterPassword:"Password principale",unlockVault:"Sblocca",unlockWithPin:"Sblocca con PIN",enterPinToUnlock:"Inserisci il PIN per sbloccare la cassaforte",useMasterPassword:"Usa La Password Principale",unlockTitle:"Sblocca la tua cassaforte",logoutConfirm:"Sei sicuro di volerti disconnettere?",unlockSuccessTitle:"La cassaforte è stata sbloccata con successo",unlockSuccessDescription:"Ora puoi usare l'auto-riempimento nei moduli di accesso nel tuo browser.",closePopup:"Chiudi questo popup",browseVault:"Sfoglia i contenuti della cassaforte",connectingTo:"Connessione a",switchAccounts:"Cambia account",loginWithMobile:"Accedi con l'App Mobile",unlockWithMobile:"Sblocca con l'App Mobile",scanQrCode:"Scansiona questo codice QR con l'app mobile di AliasVault per accedere e sbloccare la cassaforte.",errors:{invalidCode:"Inserisci un codice di autenticazione a 6 cifre valido.",serverError:"Impossibile connettersi al server di AliasVault. Riprova più tardi o contatta il supporto se il problema persiste.",wrongPassword:"Password non corretta. Riprova nuovamente.",sessionExpired:"La tua sessione è scaduta. Effettua di nuovo il login.",mobileLoginRequestExpired:"Richiesta di accesso mobile scaduta. Per favore ricarica la pagina e riprova."}},dS={vault:"Cassaforte",emails:"E-Mail"},mS={loading:"Caricamento in corso...",notice:"Avviso",error:"Errore",cancel:"Annulla",confirm:"Conferma",back:"Indietro",next:"Avanti",use:"Usa",add:"Aggiungi",delete:"Elimina",undo:"Annulla",save:"Salva",saving:"Salvataggio...",create:"Creare",or:"O",close:"Chiudi",logout:"Esci",copied:"Copiato!",openInNewWindow:"Apri in una nuova finestra",enabled:"Abilitato",disabled:"Disabilitato",showPassword:"Mostra password",hidePassword:"Nascondi password",showDetails:"Mostra dettagli",hideDetails:"Nascondi dettagli",copyToClipboard:"Copia negli appunti",loadingEmails:"Caricamento e-mail in corso...",loadingTotpCodes:"Caricamento codici TOTP in corso...",attachments:"Allegati",loadingAttachments:"Caricamento allegati in corso...",settings:"Impostazioni",recentEmails:"E-mail recenti",credentials:"Credenziali",customFields:"Campi Personalizzati",twoFactorAuthentication:"Autenticazione a due fattori",alias:"Alias",notes:"Note",email:"E-mail",username:"Nome utente",password:"Password",generate:"Genera",serviceName:"Nome Servizio",loggedIn:"Accesso effettuato",syncingVault:"Sincronizzazione cassaforte",checkingVaultUpdates:"Controllo aggiornamenti cassaforte",syncingUpdatedVault:"Sincronizzazione cassaforte aggiornata",loadMore:"Carica altro",offline:"Offline",offlineMode:"Funzionamento in modalità offline",pendingSync:"Sincronizzazione...",mergingVaultChanges:"Sincronizzzazione modifiche della cassaforte...",uploadingVault:"Caricamento cassaforte in corso...",errors:{serverNotAvailable:"Il server di AliasVault non è disponibile. Riprova più tardi o contatta il supporto se il problema persiste.",clientVersionNotSupported:"Questa versione dell'estensione del browser AliasVault non è più supportata dal server. Aggiorna l'estensione alla versione più recente.",browserExtensionOutdated:"Questa estensione del browser è obsoleta e non può essere utilizzata per accedere a questa cassaforte. Si prega di aggiornare questa estensione per continuare.",serverVersionNotSupported:"Il server di AliasVault necessita un aggiornamento a una versione più recente per poter usare questa estensione. Contatta il supporto se hai bisogno di assistenza.",serverVersionTooOld:"Il server AliasVault deve essere aggiornato a una versione più recente per poter utilizzare questa app mobile. Se hai bisogno di aiuto, contatta il supporto.",unknownError:"Si è verificato un errore sconosciuto",unknownErrorTryAgain:"Si è verificato un errore sconosciuto. Riprova.",vaultNotAvailable:"Cassaforte non disponibile",vaultIsLocked:"La cassaforte è bloccata",passwordChanged:"La tua password è cambiata dall'ultima volta che hai effettuato l'accesso. Effettua nuovamente l'accesso per motivi di sicurezza.",syncConflictMaxRetries:"Impossibile sincronizzare la cassaforte dopo più tentativi. Riprova più tardi.",mergeFailed:"Sincronizzazione della cassaforte non riuscita. Riprovare."},apiErrors:{UNKNOWN_ERROR:"Si è verificato un errore sconosciuto. Riprova.",ACCOUNT_LOCKED:"Account temporaneamente bloccato a causa di troppi tentativi falliti. Riprova più tardi.",ACCOUNT_BLOCKED:"Il tuo account è stato disabilitato. Se ritieni che sia un errore, contatta il supporto.",USER_NOT_FOUND:"Nome utente o password non validi. Riprova.",INVALID_AUTHENTICATOR_CODE:"Codice di autenticazione non valido. Riprova.",INVALID_RECOVERY_CODE:"Codice di recupero non valido. Riprova.",REFRESH_TOKEN_REQUIRED:"È necessario aggiornare il token.",INVALID_REFRESH_TOKEN:"Token di aggiornamento non valido",PUBLIC_REGISTRATION_DISABLED:"La registrazione di nuovi account è attualmente disabilitata su questo server. Contatta l'amministratore.",USERNAME_REQUIRED:"È richiesto il nome utente.",USERNAME_ALREADY_IN_USE:"Il nome utente è già in uso.",USERNAME_AVAILABLE:"Il nome utente è disponibile.",USERNAME_MISMATCH:"Il nome utente non corrisponde all'utente corrente.",PASSWORD_MISMATCH:"La password fornita non corrisponde alla password attuale.",ACCOUNT_SUCCESSFULLY_DELETED:"Account eliminato con successo.",USERNAME_EMPTY_OR_WHITESPACE:"Il nome utente non può essere vuoto o contenere spazi.",USERNAME_TOO_SHORT:"Nome utente troppo corto: deve contenere almeno 3 caratteri.",USERNAME_TOO_LONG:"Nome utente troppo lungo: non può superare i 40 caratteri.",USERNAME_INVALID_EMAIL:"Indirizzo email non valido.",USERNAME_INVALID_CHARACTERS:"Il nome utente non è valido, può contenere solo lettere o cifre.",VAULT_NOT_UP_TO_DATE:"La tua cassaforte non è aggiornata. Sincronizzala e riprova.",INTERNAL_SERVER_ERROR:"Errore interno del server.",VAULT_ERROR:"La cassaforte locale non è aggiornata. Sincronizzala ricaricando la pagina e riprova."}},fS={or:"o",new:"Nuovo",vaultLocked:"AliasVault è bloccato.",creatingNewAlias:"Creazione nuovo alias...",noMatchesFound:"Nessun risultato trovato",searchVault:"Cerca nella cassaforte...",enterServiceName:"Inserisci nome servizio",enterEmailAddress:"Inserisci indirizzo email",enterUsername:"Inserisci nome utente",hideFor1Hour:"Nascondi per 1 ora (sito corrente)",hidePermanently:"Nascondi permanentemente (sito corrente)",createRandomAlias:"Crea alias casuale",createUsernamePassword:"Crea nome utente/password",randomAlias:"Alias casuale",usernamePassword:"Nome utente/password",createAndSaveAlias:"Crea e salva alias",createAndSaveCredential:"Crea e salva credenziali",randomIdentityDescription:"Genera un'identità casuale con un indirizzo email casuale accessibile in AliasVault.",randomIdentityDescriptionDropdown:"Identità casuale con email casuale",manualCredentialDescription:"Specifica il tuo indirizzo email e nome utente.",manualCredentialDescriptionDropdown:"Nome utente e password manuali",failedToCreateIdentity:"Impossibile creare identità. Riprova.",enterEmailAndOrUsername:"Inserisci email e/o nome utente",autofillWithAliasVault:"Compilazione automatica con AliasVault",generateRandomPassword:"Genera password casuale (copia negli appunti)",generateNewPassword:"Genera nuova password",togglePasswordVisibility:"Mostra/Nascondi password",passwordCopiedToClipboard:"Password copiata negli appunti",openAliasVaultToUpgrade:"Apri AliasVault per aggiornare",vaultUpgradeRequired:"Aggiornamento della cassaforte richiesto.",dismissPopup:"Chiudi finestra"},gS={title:"Elementi",itemName:"Nome",loginCredentials:"Credenziali di accesso",cardInformation:"Informazioni sulla scheda",addItem:"Aggiungi Elemento",addNewItem:"Aggiungi nuovo elemento",saveItem:"Salva Elemento",itemDetails:"Dettagli Elemento",editItem:"Modifica Elemento",untitled:"Senza titolo",newFolder:"Nuova Cartella",createFolder:"Crea cartella",editFolder:"Modifica Cartella",folderName:"Nome Cartella",folderNameRequired:"Il nome della cartella è obbligatorio",folder:"Cartella",welcomeTitle:"Benvenuto in AliasVault!",welcomeDescription:"Per usare l'estensione browser AliasVault: naviga su un sito e usa la finestra di compilazione automatica per creare una nuova credenziale.",noPasskeysFound:"Non sono state ancora create passkey. Le passkey vengono create visitando un sito web che offre le passkey come metodo di autenticazione.",noAttachmentsFound:"Nessun elemento con allegati trovato",noItemsOfTypeFound:"Nessun elemento {{type}} trovato",noMatchingItems:"Nessun elemento corrispondente trovato",noMatchingItemsSearch:'Nessun elemento corrispondente "{{search}}"',noMatchingItemsWithFilter:'Nessun elemento {{filter}} corrispondente "{{search}}"',clearSearch:"Cancella ricerca",clearFilter:"Cancella filtro",emptyFolderHint:"Questa cartella è vuota. Per spostare gli elementi in questa cartella, modificare l'elemento e toccare l'icona della cartella nel campo nome.",allItemsInFolders:"Tutti gli elementi sono organizzati in cartelle. Fare clic su una cartella qui sopra per visualizzare le credenziali o utilizzare la ricerca per trovare elementi specifici.",deleteFolder:"Elimina Cartella",deleteFolderKeepItems:"Elimina solo la cartella",deleteFolderKeepItemsDescription:"Gli elementi verranno spostati nella lista principale.",deleteFolderAndItems:"Elimina cartella e tutti gli elementi",deleteFolderAndItemsDescription:"{{count}} oggetto(i) verrà spostato in Eliminato Recentemente.",filters:{all:"(Tutti) Elementi",passkeys:"Passkey"},deleteItemTitle:"Elimina elemento",deleteItemConfirm:"Sei sicuro di voler rimuovere questo elemento?",viewHistory:"Visualizza cronologia",history:"Cronologia",noHistoryAvailable:"Nessuna cronologia disponibile",tags:"Tags",changePasswordComplexity:"Modifica complessità password",passwordLength:"Lunghezza password",includeLowercase:"Includi lettere minuscole",includeUppercase:"Includi lettere maiuscole",includeNumbers:"Includi numeri",includeSpecialChars:"Includi caratteri speciali",avoidAmbiguousChars:"Evita caratteri ambigui (o, 0, ecc.)",privateEmailTitle:"Email Privata",privateEmailAliasVaultServer:"Server AliasVault",privateEmailDescription:"E2E crittografato, completamente privato.",publicEmailTitle:"Fornitori Pubblici di Email Temporanee",publicEmailDescription:"Anonimi ma con privacy ridotta. Accessibile a chiunque conosca l'indirizzo.",validation:{required:"Campo obbligatorio"}},hS={selectType:"Aggiungi Nuovo Elemento",typeLabel:"Tipo Elemento",creating:"Creazione in corso",editing:"Modifica",regenerateAlias:"Rigenera alias",addCustomField:"Aggiungere un campo personalizzato",fieldLabel:"Etichetta del campo",enterFieldName:"Inserisci il nome del campo",fieldType:"Tipo di campo",fieldTypes:{text:"Testo",hidden:"Nascosto (testo mascherato)",email:"Email",url:"URL",phone:"Telefono",number:"Numero",date:"Data",textArea:"Area di testo"},login:{title:"Accesso"},alias:{title:"Alias"},creditCard:{title:"Carta Di Credito"},note:{title:"Nota sicura"}},AS={"login.url":"URL del sito","login.username":"Nome Utente","login.password":"Password","alias.first_name":"Nome","alias.last_name":"Cognome","alias.gender":"Genere","alias.birthdate":"Data di nascita","login.email":"Email","notes.content":"Note","card.cardholder_name":"Nome del titolare della carta","card.number":"Numero della Carta","card.expiry_month":"Mese di Scadenza","card.expiry_year":"Anno di Scadenza","card.cvv":"CVV","card.pin":"PIN"},pS={addCode:"Aggiungi Codice 2FA",instructions:"Inserisci la chiave segreta mostrata dal sito in cui vuoi aggiungere un'autenticazione a due fattori.",nameOptional:"Nome (facoltativo)",secretKey:"Chiave segreta",saveToViewCode:"Salva per visualizzare il codice",defaultName:"Autenticazione",errors:{invalidSecretKey:"Formato chiave segreta non valido."}},yS={uploading:"Caricamento...",uploadSuccess:"File caricati correttamente",deleteSuccess:"Allegato eliminato con successo.",firefoxExpandRequired:"Per caricare i file, usa la finestra estesa.",openExpandedWindow:"Apri Finestra Estesa"},ES={title:"Email",deleteEmailTitle:"Elimina Email",deleteEmailConfirm:"Sei sicuro di voler eliminare definitivamente questa email?",from:"Da",to:"A",date:"Data",emailContent:"Contenuto email",emailNotFound:"Email non trovata",noEmails:"Nessuna email trovata",noEmailsDescription:"Non hai ancora ricevuto email ai tuoi indirizzi email privati. Quando ne riceverai una nuova, apparirà qui.",offlineMessage:"Sei offline. Collegati a internet per caricare le email.",dateFormat:{justNow:"proprio ora",minutesAgo_single:"{{count}} min fa",minutesAgo_plural:"{{count}} min fa",hoursAgo_single:"{{count}} ora fa",hoursAgo_plural:"{{count}} ore fa",yesterday:"ieri"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"L'indirizzo email attualmente scelto è già in uso. Cambia l'indirizzo modificando queste credenziali.",CLAIM_DOES_NOT_EXIST:"Si è verificato un errore durante il caricamento delle email. Prova a modificare e salvare le credenziali per sincronizzare il database, poi riprova."}},bS={serverUrl:"URL del server",language:"Lingua",autofillEnabled:"Abilita compilazione automatica",version:"Versione",openWebApp:"Apri app web",lock:"Blocca",globalSettings:"Impostazioni globali",autofillPopup:"Popup compilazione automatica",activeOnAllSites:"Attivo su tutti i siti (a meno che non sia disabilitato sotto)",disabledOnAllSites:"Disabilitato su tutti i siti",rightClickContextMenu:"Menu contestuale clic destro",autofillMatching:"Riconoscimento campi automatica.",autofillMatchingMode:"Modalità riconoscimento capi automatica",autofillMatchingModeDescription:"Determina quali credenziali vengono considerate corrispondenti e mostrate come suggerimenti nel popup di compilazione automatica per un determinato sito web.",autofillMatchingDefault:"URL + sottodominio + nome wildcard",autofillMatchingUrlSubdomain:"URL + sottodominio",autofillMatchingUrlExact:"Solo dominio URL esatto",siteSpecificSettings:"Impostazioni specifiche per sito",autofillPopupOn:"Finestra compilazione automatica su: ",enabledForThisSite:"Abilitato per questo sito",disabledForThisSite:"Disabilitato per questo sito",temporarilyDisabledUntil:"Disabilitato temporaneamente fino a ",resetAllSiteSettings:"Reimposta tutte le impostazioni specifiche per sito",appearance:"Aspetto",theme:"Tema",useDefault:"Usa predefinito",light:"Chiaro",dark:"Scuro",keyboardShortcuts:"Scorciatoie da tastiera",configureKeyboardShortcuts:"Configura scorciatoie da tastiera",configure:"Configura",clipboardClearTimeout:"Cancella appunti dopo la copia",clipboardClearTimeoutDescription:"Cancella automaticamente gli appunti dopo aver copiato i dati sensibili",clipboardClearDisabled:"Non pulire mai",clipboardClear5Seconds:"Cancella dopo 5 secondi",clipboardClear10Seconds:"Cancella dopo 10 secondi",clipboardClear15Seconds:"Cancella dopo 15 secondi",autoLockTimeout:"Timeout Blocco Automatico",autoLockTimeoutDescription:"Blocca automaticamente la cassaforte dopo un periodo di inattività",autoLockTimeoutHelp:"La cassaforte si bloccherà solo dopo il periodo specificato di inattività (nessun utilizzo di riempimento automatico o estensione popup aperto). La cassaforte si bloccherà sempre quando il browser è chiuso, indipendentemente da questa impostazione.",autoLockNever:"Mai",autoLock15Seconds:"15 secondi",autoLock1Minute:"1 minuto",autoLock5Minutes:"5 minuti",autoLock15Minutes:"15 minuti",autoLock30Minutes:"30 minuti",autoLock1Hour:"1 ora",autoLock4Hours:"4 ore",autoLock8Hours:"8 ore",autoLock24Hours:"24 ore",versionPrefix:"Versione ",autofillSettings:"Impostazioni di riempimento automatico",clipboardSettings:"Impostazioni appunti",contextMenuSettings:"Preferenze menu contestuale",passkeySettings:"Impostazioni Passkey",contextMenu:"Menu contestuale",contextMenuEnabled:"Il menu contestuale è attivato",contextMenuDisabled:"Il menu contestuale è disabilitato",contextMenuDescription:"Click destro sui campi di input per accedere alle opzioni di AliasVault",selectLanguage:"Seleziona la lingua",serverConfiguration:"Configurazione del server",serverConfigurationDescription:"Configurare l'URL del server AliasVault per le istanze self-hosted",customApiUrl:"API URL",customClientUrl:"Url Client",apiUrlHint:"L'URL endpoint API (di solito URL client + /api)",clientUrlHint:"L'URL dell'interfaccia web della tua istanza self-hosted",autofillSettingsDescription:"Abilita o disabilita il popup di riempimento automatico sulle pagine web",autofillEnabledDescription:"I suggerimenti di riempimento automatico appariranno nei moduli di accesso",autofillDisabledDescription:"I suggerimenti di riempimento automatico sono disabilitati",languageSettings:"Lingua",validation:{apiUrlRequired:"L'URL API è obbligatorio",apiUrlInvalid:"Inserisci un URL API valido",clientUrlRequired:"L'URL del client è obbligatorio",clientUrlInvalid:"Inserisci un URL del client valido"},unlockMethod:{title:"Metodo di sblocco cassaforte",introText:"Scegli come sbloccare la cassaforte. Puoi usare la tua password principale (sempre disponibile) o impostare un codice PIN per un accesso più veloce. Dopo 3 tentativi di PIN falliti, è necessario utilizzare la password principale.",password:"Password Principale",pin:"Codice PIN",pinDescription:"Sblocca la cassaforte con codice PIN",setupPin:"Imposta Codice Pin",enterNewPinDescription:"Inserisci un codice PIN composto da almeno 6 cifre",confirmPin:"Conferma PIN",confirmPinDescription:"Inserisci di nuovo il tuo PIN per confermare",invalidPinFormat:"Formato PIN non valido",pinMismatch:"I PIN non corrispondono",incorrectPin:"PIN errato. {{attemptsRemaining}} tentativi rimanenti.",incorrectPinSingular:"Pin non corretto. 1 tentativo rimanente.",enableSuccess:"Sblocco PIN abilitato con successo!",pinLocked:"Il PIN sblocco è stato disabilitato. Utilizza la tua password principale per sbloccare la cassaforte.",pinSecurityWarning:"Lo sblocco PIN nell'estensione del browser può essere meno sicuro della tua password principale, poichè i PIN hanno tipicamente entropia inferiore e possono essere brutalmente forzati se il dispositivo è compromesso. Usalo solo su dispositivi che ti fidi completamente."}},IS={passkey:"Passkey",site:"Sito",helpText:"Le chiavi di accesso vengono create sul sito web quando richiesto. Non possono essere modificate manualmente. Per rimuovere questa chiave di accesso, è possibile eliminarla da questa credenziale. Per sostituire questa passkey o crearne una nuova, visitare il sito web e seguire i relativi suggerimenti.",passkeyMarkedForDeletion:"Passkey contrassegnata per l'eliminazione",passkeyWillBeDeleted:"Questa passkey verrà eliminata quando si salva questa credenziale.",useBrowserPasskey:"Usa Browser Passkey",bypass:{description:"Per quanto tempo vorresti usare il provider di chiavi di accesso del browser per {{origin}}?",thisTimeOnly:"Solo questa volta",alwaysForSite:"Sempre per questo sito"},authenticate:{title:"Accedi con Passkey",signInFor:"Accedi con passkey per",selectPasskey:"Selezionare una passkey per accedere:",noPasskeysFound:"Nessuna passkey trovata per questo sito"},create:{title:"Crea Passkey",createFor:"Crea una nuova passkey per",titleLabel:"Titolo",titlePlaceholder:"Inserisci un nome per questa passkey",createButton:"Crea Passkey",selectPasskeyToReplace:"Selezionare una chiave di accesso da sostituire:",createNewPasskey:"Crea Nuova Passkey",replacingPasskey:"Sostituzione passkey: {{displayName}}",confirmReplace:"Conferma la sostituzione",selectExistingLogin:"Aggiungere al login esistente:",selectExistingLoginDescription:"Allega questa passkey a una credenziale di accesso esistente per questo sito.",attachingToCredential:"Aggiunta passkey a: {{serviceName}}",attachPasskey:"Aggiungi Passkey"},settings:{passkeyProvider:"Provider Passkey",passkeyProviderOn:"Passkey Provider attivo"}},vS={title:"Eliminato di Recente",noItems:"Nessun elemento eliminato",noItemsDescription:"Gli elementi cancellati appariranno qui per 30 giorni prima di essere rimossi definitivamente.",description:"Questi elementi verranno eliminati definitivamente dopo 30 giorni. È possibile ripristinarli o eliminarli immediatamente.",restore:"Ripristina",deletePermanently:"Elimina Definitivamente",emptyAll:"Svuota Tutto",daysRemaining_one:"{{count}} giorno rimanente",daysRemaining_other:"{{count}} giorni rimanenti",expiringSoon:"In scadenza a breve",confirmDeleteTitle:"Elimina definitivamente?",confirmDeleteMessage:"Questo elemento verrà eliminato definitivamente e non può essere recuperato.",confirmEmptyAllTitle:'Svuotare "Eliminati di recente"?',confirmEmptyAllMessage:"Questi {{count}} elementi verranno eliminati permanentemente e non potranno essere recuperati."},wS={title:"Aggiorna Cassaforte",subtitle:"AliasVault è stato aggiornato e la tua cassaforte deve essere aggiornata. Dovrebbe richiedere solo pochi secondi.",versionInformation:"Informazioni sulla versione",yourVault:"Versione della tua cassaforte:",newVersion:"Nuova versione disponibile:",upgrade:"Aggiorna cassaforte",upgrading:"Aggiornamento in corso...",whatsNew:"Novità",whatsNewDescription:"È richiesto un aggiornamento per supportare le seguenti modifiche:",noDescriptionAvailable:"Nessuna descrizione disponibile per questa versione.",alerts:{unableToGetVersionInfo:"Impossibile ottenere informazioni sulla versione. Riprova.",selfHostedServer:"Server Autospitato",selfHostedWarning:"Se usi un server autospitato, assicurati di aggiornare anche la tua istanza, altrimenti l'accesso al client web smetterà di funzionare.",continueUpgrade:"Continua aggiornamento",upgradeFailed:"Aggiornamento non riuscito",failedToApplyMigration:"Impossibile eseguire la migrazione ({{current}} di {{total}})"}},CS={unsyncedChangesTitle:"Modifiche non Sincronizzate",unsyncedChangesWarning:"Hai delle modifiche non sincronizzate che andranno perse se ti disconnetti ora. Sei sicuro di voler continuare?",logoutAnyway:"Esci comunque"},NS={auth:uS,menu:dS,common:mS,content:fS,items:gS,itemTypes:hS,fieldLabels:AS,totp:pS,attachmentUploader:yS,emails:ES,settings:bS,passkeys:IS,recentlyDeleted:vS,upgrade:wS,logout:CS},xS={loginTitle:"Inloggen bij AliasVault",username:"Gebruikersnaam of e-mail",usernamePlaceholder:"naam / naam@bedrijf.com",passwordPlaceholder:"Voer je wachtwoord in",rememberMe:"Onthoud mij",loginButton:"Inloggen",noAccount:"Nog geen account?",createVault:"Nieuwe vault aanmaken",twoFactorTitle:"Voer de authenticatiecode van je authenticator-app in.",authCode:"Authenticatiecode",authCodePlaceholder:"Voer 6-cijferige code in",verify:"Verifiëren",twoFactorNote:"Opmerking: als je geen toegang hebt tot je authenticator, kunt je je 2FA resetten door met een in te loggen via de website.",masterPassword:"Hoofdwachtwoord",unlockVault:"Ontgrendelen",unlockWithPin:"Ontgrendelen met PIN",enterPinToUnlock:"Voer je pincode in om je vault te ontgrendelen",useMasterPassword:"Gebruik hoofdwachtwoord",unlockTitle:"Ontgrendel je vault",logoutConfirm:"Weet je zeker dat je wilt uitloggen?",unlockSuccessTitle:"Je vault is succesvol ontgrendeld",unlockSuccessDescription:"Je kunt nu automatisch invullen gebruiken in inlogformulieren in je browser.",closePopup:"Sluit deze popup",browseVault:"Bekijk vault inhoud",connectingTo:"Verbinden met",switchAccounts:"Wisselen van account?",loginWithMobile:"Log in via de mobiele app",unlockWithMobile:"Ontgrendel met mobiele app",scanQrCode:"Scan deze QR-code met de AliasVault mobiele app om in te loggen en je kluis te ontgrendelen.",errors:{invalidCode:"Voer een geldige 6-cijferige code in.",serverError:"Kon de AliasVault server niet bereiken. Probeer het later opnieuw of neem contact op met support als het probleem aanhoudt.",wrongPassword:"Onjuist wachtwoord. Probeer het opnieuw.",sessionExpired:"Je sessie is verlopen. Log opnieuw in.",mobileLoginRequestExpired:"Time-out van de mobiele inlogaanvraag. Herlaad de pagina en probeer opnieuw."}},TS={vault:"Vault",emails:"E-mails"},SS={loading:"Laden...",notice:"Melding",error:"Fout",cancel:"Annuleren",confirm:"Bevestigen",back:"Terug",next:"Volgende",use:"Gebruik",add:"Toevoegen",delete:"Verwijderen",undo:"Ongedaan maken",save:"Opslaan",saving:"Opslaan...",create:"Aanmaken",or:"Of",close:"Sluiten",logout:"Uitloggen",copied:"Gekopieerd!",openInNewWindow:"Openen in nieuw venster",enabled:"Ingeschakeld",disabled:"Uitgeschakeld",showPassword:"Wachtwoord tonen",hidePassword:"Wachtwoord verbergen",showDetails:"Toon details",hideDetails:"Verberg details",copyToClipboard:"Naar klembord kopiëren",loadingEmails:"E-mails laden...",loadingTotpCodes:"TOTP-codes laden...",attachments:"Bijlagen",loadingAttachments:"Bijlagen laden...",settings:"Instellingen",recentEmails:"Recente e-mails",credentials:"Credentials",customFields:"Extra velden",twoFactorAuthentication:"Tweestapsverificatie",alias:"Alias",notes:"Notities",email:"E-mail",username:"Gebruikersnaam",password:"Wachtwoord",generate:"Genereren",serviceName:"Naam",loggedIn:"Ingelogd",syncingVault:"Vault synchroniseren",checkingVaultUpdates:"Controleren op vault updates",syncingUpdatedVault:"Bijgewerkte vault synchroniseren",loadMore:"Laad meer",offline:"Offline",offlineMode:"Offline modus",pendingSync:"Synchroniseren...",mergingVaultChanges:"Vault wijzigingen mergen...",uploadingVault:"Vault opslaan...",errors:{serverNotAvailable:"De AliasVault server is niet beschikbaar. Probeer het later opnieuw of neem contact op met de ondersteuning als het probleem aanhoudt.",clientVersionNotSupported:"Deze versie van de AliasVault browserextensie wordt niet meer ondersteund door de server. Update je browserextensie naar de nieuwste versie.",browserExtensionOutdated:"Deze browserextensie is verouderd en kan niet worden gebruikt om toegang te krijgen tot deze vault. Update deze browserextensie om door te gaan.",serverVersionNotSupported:"De AliasVault server moet worden bijgewerkt naar een nieuwere versie om deze browserextensie te kunnen gebruiken. Neem contact op met support als je hulp nodig hebt.",serverVersionTooOld:"De AliasVault server moet bijgewerkt worden naar een nieuwere versie om deze functie te kunnen gebruiken. Neem contact op met support als je hulp nodig hebt.",unknownError:"Er is een onbekende fout opgetreden",unknownErrorTryAgain:"Er is een onbekende fout opgetreden. Probeer het opnieuw.",vaultNotAvailable:"Vault niet beschikbaar",vaultIsLocked:"Vault is vergrendeld",passwordChanged:"Je wachtwoord is veranderd sinds de laatste keer dat je bent ingelogd. Log opnieuw in.",syncConflictMaxRetries:"Kan de vault niet synchroniseren na meerdere pogingen. Probeer het later opnieuw.",mergeFailed:"Samenvoegen vault wijzigingen mislukt. Probeer het opnieuw."},apiErrors:{UNKNOWN_ERROR:"Er is een onbekende fout opgetreden. Probeer het opnieuw.",ACCOUNT_LOCKED:"Account tijdelijk vergrendeld vanwege te veel mislukte pogingen. Probeer het later opnieuw.",ACCOUNT_BLOCKED:"Je account is uitgeschakeld. Als je denkt dat dit een vergissing is, neem dan contact op met support.",USER_NOT_FOUND:"Gebruikersnaam of wachtwoord is onjuist. Probeer het opnieuw.",INVALID_AUTHENTICATOR_CODE:"Ongeldige authenticator code. Probeer het opnieuw.",INVALID_RECOVERY_CODE:"Ongeldige herstelcode. Probeer het opnieuw.",REFRESH_TOKEN_REQUIRED:"Refresh token is vereist.",INVALID_REFRESH_TOKEN:"Ongeldig refresh token.",PUBLIC_REGISTRATION_DISABLED:"Registratie van nieuwe accounts is momenteel uitgeschakeld op deze server. Neem contact op met de beheerder.",USERNAME_REQUIRED:"Gebruikersnaam is vereist.",USERNAME_ALREADY_IN_USE:"Gebruikersnaam is al in gebruik.",USERNAME_AVAILABLE:"Gebruikersnaam is beschikbaar.",USERNAME_MISMATCH:"Gebruikersnaam komt niet overeen met de huidige gebruiker.",PASSWORD_MISMATCH:"Het opgegeven wachtwoord komt niet overeen met je huidige wachtwoord.",ACCOUNT_SUCCESSFULLY_DELETED:"Account succesvol verwijderd.",USERNAME_EMPTY_OR_WHITESPACE:"Gebruikersnaam mag niet leeg zijn of alleen uit spaties bestaan.",USERNAME_TOO_SHORT:"Gebruikersnaam te kort: moet minimaal 3 tekens lang zijn.",USERNAME_TOO_LONG:"Gebruikersnaam te lang: mag niet langer zijn dan 40 tekens.",USERNAME_INVALID_EMAIL:"Ongeldig e-mailadres.",USERNAME_INVALID_CHARACTERS:"Gebruikersnaam is ongeldig, mag alleen letters of cijfers bevatten.",VAULT_NOT_UP_TO_DATE:"Je vault is niet up-to-date. Synchroniseer je vault en probeer het opnieuw.",INTERNAL_SERVER_ERROR:"Interne serverfout.",VAULT_ERROR:"Je lokale vault is niet up-to-date. Synchroniseer je vault door de pagina te vernieuwen en probeer het opnieuw."}},kS={or:"of",new:"Nieuw",vaultLocked:"AliasVault is vergrendeld.",creatingNewAlias:"Nieuwe alias aanmaken...",noMatchesFound:"Geen resultaten gevonden",searchVault:"Vault doorzoeken...",enterServiceName:"Voer servicenaam in",enterEmailAddress:"Voer e-mailadres in",enterUsername:"Voer gebruikersnaam in",hideFor1Hour:"Verberg voor 1 uur (huidige site)",hidePermanently:"Permanent verbergen (huidige site)",createRandomAlias:"Willekeurige alias aanmaken",createUsernamePassword:"Gebruikersnaam/wachtwoord aanmaken",randomAlias:"Alias",usernamePassword:"Gebruikersnaam/wachtwoord",createAndSaveAlias:"Alias aanmaken",createAndSaveCredential:"Credential aanmaken",randomIdentityDescription:"Genereer een willekeurige identiteit met een willekeurig e-mailadres toegankelijk in AliasVault.",randomIdentityDescriptionDropdown:"Willekeurige identiteit met willekeurige e-mail",manualCredentialDescription:"Specificeer je eigen e-mailadres en/of gebruikersnaam.",manualCredentialDescriptionDropdown:"Handmatige gebruikersnaam en wachtwoord",failedToCreateIdentity:"Identiteit aanmaken mislukt. Probeer opnieuw.",enterEmailAndOrUsername:"Voer e-mail en/of gebruikersnaam in",autofillWithAliasVault:"Autofill met AliasVault",generateRandomPassword:"Willekeurig wachtwoord genereren (kopiëren naar klembord)",generateNewPassword:"Genereer nieuw wachtwoord",togglePasswordVisibility:"Schakel zichtbaarheid van wachtwoord in/uit",passwordCopiedToClipboard:"Wachtwoord gekopieerd naar klembord",openAliasVaultToUpgrade:"Open AliasVault om te upgraden",vaultUpgradeRequired:"Update is vereist.",dismissPopup:"Pop-up sluiten"},LS={title:"Items",itemName:"Naam",loginCredentials:"Inloggegevens",cardInformation:"Kaartgegevens",addItem:"Item toevoegen",addNewItem:"Nieuw item toevoegen",saveItem:"Item opslaan",itemDetails:"Item details",editItem:"Item bewerken",untitled:"Naamloos",newFolder:"Nieuwe map",createFolder:"Map aanmaken",editFolder:"Map bewerken",folderName:"Mapnaam",folderNameRequired:"Mapnaam is verplicht",folder:"Map",welcomeTitle:"Welkom bij AliasVault!",welcomeDescription:"Om de AliasVault browser extensie te gebruiken: navigeer naar een website en gebruik de AliasVault autofill popup om nieuwe credentials aan te maken.",noPasskeysFound:"Er zijn nog geen passkeys aangemaakt. Passkeys worden gemaakt door een website te bezoeken die passkeys als een authenticatiemethode biedt.",noAttachmentsFound:"Geen items gevonden met bijlagen",noItemsOfTypeFound:"Geen {{type}} items gevonden",noMatchingItems:"Geen items gevonden",noMatchingItemsSearch:'Geen items die overeenkomen met "{{search}}"',noMatchingItemsWithFilter:'Geen {{filter}} items die overeenkomen met "{{search}}"',clearSearch:"Wis zoekopdracht",clearFilter:"Wis filter",emptyFolderHint:"Deze map is leeg. Om items naar deze map te verplaatsen, wijzig het item en selecteer deze map.",allItemsInFolders:"Al je items zijn georganiseerd in mappen. Klik op een map hierboven om je gegevens te bekijken, of gebruik de zoekopdracht om specifieke items te vinden.",deleteFolder:"Map verwijderen",deleteFolderKeepItems:"Verwijder alleen map",deleteFolderKeepItemsDescription:"Items zullen terug worden verplaatst naar de hoofdlijst.",deleteFolderAndItems:"Verwijder map en alle items",deleteFolderAndItemsDescription:"{{count}} item(s) zullen worden verplaatst naar recent verwijderd.",filters:{all:"(Alle) Items",passkeys:"Passkeys"},deleteItemTitle:"Verwijder item",deleteItemConfirm:"Weet je zeker dat je dit item wilt verwijderen?",viewHistory:"Toon geschiedenis",history:"Geschiedenis",noHistoryAvailable:"Nog geen geschiedenis",tags:"Labels",changePasswordComplexity:"Wijzig wachtwoord complexiteit",passwordLength:"Wachtwoordlengte",includeLowercase:"Inclusief kleine letters",includeUppercase:"Inclusief hoofdletters",includeNumbers:"Inclusief cijfers",includeSpecialChars:"Inclusief speciale karakters",avoidAmbiguousChars:"Onduidelijke tekens vermijden (o, 0, etc.)",privateEmailTitle:"Privé e-mail",privateEmailAliasVaultServer:"AliasVault server",privateEmailDescription:"E2E versleuteld, volledig privé.",publicEmailTitle:"Publieke tijdelijke e-mailproviders",publicEmailDescription:"Anoniem maar beperkte privacy. E-mail inhoud is leesbaar door iedereen die het adres kent.",validation:{required:"Dit veld is verplicht"}},RS={selectType:"Nieuw item toevoegen",typeLabel:"Itemtype",creating:"Aanmaken",editing:"Bewerken",regenerateAlias:"Alias opnieuw genereren",addCustomField:"Voeg eigen veld toe",fieldLabel:"Veldlabel",enterFieldName:"Voer de veldnaam in",fieldType:"Veldtype",fieldTypes:{text:"Tekst",hidden:"Verborgen (gemaskeerde tekst)",email:"E-mail",url:"URL",phone:"Telefoon",number:"Nummer",date:"Datum",textArea:"Tekstvak"},login:{title:"Login"},alias:{title:"Alias"},creditCard:{title:"Creditcard"},note:{title:"Veilige notitie"}},DS={"login.url":"Website URL","login.username":"Gebruikersnaam","login.password":"Wachtwoord","alias.first_name":"Voornaam","alias.last_name":"Achternaam","alias.gender":"Geslacht","alias.birthdate":"Geboortedatum","login.email":"E-mail","notes.content":"Notities","card.cardholder_name":"Naam kaarthouder","card.number":"Kaartnummer","card.expiry_month":"Vervalmaand","card.expiry_year":"Vervaljaar","card.cvv":"CVV","card.pin":"Pincode"},BS={addCode:"2FA-code toevoegen",instructions:"Voer de secret key in die door de website wordt weergegeven waar je tweestapsverificatie wilt toevoegen.",nameOptional:"Naam (optioneel)",secretKey:"Secret key",saveToViewCode:"Opslaan om code te bekijken",defaultName:"Authenticator",errors:{invalidSecretKey:"Ongeldig formaat."}},US={uploading:"Uploaden...",uploadSuccess:"Bestand succesvol geüpload.",deleteSuccess:"Bijlage is succesvol verwijderd.",firefoxExpandRequired:"Gebruik het grote venster om bestanden te uploaden.",openExpandedWindow:"Open groot venster"},_S={title:"E-mails",deleteEmailTitle:"E-mail verwijderen",deleteEmailConfirm:"Weet je zeker dat je deze e-mail definitief wilt verwijderen?",from:"Van",to:"Naar",date:"Datum",emailContent:"E-mailinhoud",emailNotFound:"E-mail niet gevonden",noEmails:"Geen e-mails gevonden",noEmailsDescription:"Je hebt nog geen e-mails ontvangen op je privé e-mailadressen. Wanneer je een nieuwe e-mail ontvangt, zal deze hier verschijnen.",offlineMessage:"Je bent offline. Maak verbinding met het internet om je e-mails te laden.",dateFormat:{justNow:"zojuist",minutesAgo_single:"{{count}} min geleden",minutesAgo_plural:"{{count}} min. geleden",hoursAgo_single:"{{count}} uur geleden",hoursAgo_plural:"{{count}} uur geleden",yesterday:"gisteren"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Het huidige gekozen e-mailadres is al in gebruik. Wijzig het e-mailadres door deze credential te bewerken.",CLAIM_DOES_NOT_EXIST:"Er is een fout opgetreden bij het laden van e-mails. Probeer de credential te bewerken en op te slaan om de database te synchroniseren, en probeer het opnieuw."}},MS={serverUrl:"Server URL",language:"Taal",autofillEnabled:"Autofill",version:"Versie",openWebApp:"Web-app openen",lock:"Vergrendelen",globalSettings:"Globale Instellingen",autofillPopup:"Autofill popup",activeOnAllSites:"Actief voor alle sites (tenzij hieronder uitgeschakeld)",disabledOnAllSites:"Uitgeschakeld op alle sites",rightClickContextMenu:"Rechtermuisknop menu",autofillMatching:"Autofill matching",autofillMatchingMode:"Autofill matching modus",autofillMatchingModeDescription:"Bepaalt op welke manier credentials worden beschouwd als matches en worden getoond als suggestie in de autofill popup voor een bepaalde website.",autofillMatchingDefault:"URL + subdomein + naam wildcard",autofillMatchingUrlSubdomain:"URL + subdomein",autofillMatchingUrlExact:"Exacte URL-domein",siteSpecificSettings:"Site-specifieke Instellingen",autofillPopupOn:"Autofill popup op: ",enabledForThisSite:"Ingeschakeld voor deze site",disabledForThisSite:"Uitgeschakeld voor deze site",temporarilyDisabledUntil:"Tijdelijk uitgeschakeld tot ",resetAllSiteSettings:"Alle site-specifieke instellingen resetten",appearance:"Uiterlijk",theme:"Thema",useDefault:"Standaard gebruiken",light:"Licht",dark:"Donker",keyboardShortcuts:"Snelkoppelingen",configureKeyboardShortcuts:"Snelkoppelingen configureren",configure:"Configureren",clipboardClearTimeout:"Automatisch klembord wissen na kopiëren",clipboardClearTimeoutDescription:"Automatisch het klembord wissen na kopiëren van gevoelige gegevens",clipboardClearDisabled:"Nooit wissen",clipboardClear5Seconds:"Wis na 5 seconden",clipboardClear10Seconds:"Wis na 10 seconden",clipboardClear15Seconds:"Wis na 15 seconden",autoLockTimeout:"Automatisch vergrendelen",autoLockTimeoutDescription:"Vergrendel de vault automatisch na inactiviteit",autoLockTimeoutHelp:"De vault zal alleen vergrendelen na de opgegeven periode van inactiviteit (geen automatisch invullen of extensie geopend). De vault wordt altijd vergrendeld wanneer de browser wordt afgesloten, ongeacht deze instelling.",autoLockNever:"Nooit",autoLock15Seconds:"15 seconden",autoLock1Minute:"1 minuut",autoLock5Minutes:"5 minuten",autoLock15Minutes:"15 minuten",autoLock30Minutes:"30 minuten",autoLock1Hour:"1 uur",autoLock4Hours:"4 uur",autoLock8Hours:"8 uur",autoLock24Hours:"24 uur",versionPrefix:"Versie ",autofillSettings:"Autofill instellingen",clipboardSettings:"Klembord instellingen",contextMenuSettings:"Context menu instellingen",passkeySettings:"Passkey instellingen",contextMenu:"Context menu",contextMenuEnabled:"Context menu is ingeschakeld",contextMenuDisabled:"Context menu is uitgeschakeld",contextMenuDescription:"Klik met de rechtermuisknop op invoervelden om AliasVault opties te zien",selectLanguage:"Selecteer taal",serverConfiguration:"Serverconfiguratie",serverConfigurationDescription:"Configureer de AliasVault server URL voor self-hosted omgevingen",customApiUrl:"API URL",customClientUrl:"Client URL",apiUrlHint:"De API endpoint URL (meestal client URL + /api)",clientUrlHint:"De webinterface URL van je self-hosted omgeving",autofillSettingsDescription:"Schakel de autofill pop-up in of uit op webpagina's",autofillEnabledDescription:"Autofill suggesties verschijnen op login formulieren",autofillDisabledDescription:"Autofill suggesties zijn uitgeschakeld",languageSettings:"Taal",validation:{apiUrlRequired:"API URL is vereist",apiUrlInvalid:"Voer een geldige API URL in",clientUrlRequired:"Client URL is vereist",clientUrlInvalid:"Voer een geldige client URL in"},unlockMethod:{title:"Vault ontgrendelmethode",introText:"Kies hoe je je vault wilt ontgrendelen. Je kunt je hoofdwachtwoord gebruiken (altijd beschikbaar) of een pincode instellen voor snellere toegang. Na 3 mislukte PIN-pogingen moet je je hoofdwachtwoord gebruiken.",password:"Hoofdwachtwoord",pin:"Pincode",pinDescription:"Ontgrendel vault met pincode",setupPin:"Pincode instellen",enterNewPinDescription:"Voer een pincode in van minimaal 6 cijfers",confirmPin:"Bevestig pincode",confirmPinDescription:"Voer je pincode nogmaals in om te bevestigen",invalidPinFormat:"Ongeldige pincode",pinMismatch:"Pincodes komen niet overeen",incorrectPin:"Onjuiste PIN. {{attemptsRemaining}} pogingen resterend.",incorrectPinSingular:"Onjuiste PIN. 1 poging resterend.",enableSuccess:"Pincode succesvol ingeschakeld!",pinLocked:"Pincode is uitgeschakeld. Gebruik je hoofdwachtwoord om je kluis te ontgrendelen.",pinSecurityWarning:"Pincode ontgrendeling in de browserextensie kan minder veilig zijn dan je hoofdwachtwoord, omdat een pincode makkelijker kan worden gebruteforced als iemand toegang heeft tot je apparaat. Gebruik deze optie daarom alleen op apparaten die je volledig vertrouwt."}},FS={passkey:"Passkey",site:"Website",helpText:"Passkeys worden aangemaakt op de website wanneer er om wordt gevraagd. Ze kunnen niet handmatig worden bewerkt. Om deze toegangssleutel te verwijderen, kun je deze verwijderen uit deze credential. Om deze passkey te vervangen of een nieuwe te maken, bezoek de website in kwestie en volg de instructies.",passkeyMarkedForDeletion:"Passkey gemarkeerd om te verwijderen",passkeyWillBeDeleted:"Deze passkey zal worden verwijderd wanneer je deze credential opslaat.",useBrowserPasskey:"Gebruik browser passkey",bypass:{description:"Hoe lang wilt je de browser passkey voor {{origin}} gebruiken?",thisTimeOnly:"Alleen deze keer",alwaysForSite:"Altijd voor deze site"},authenticate:{title:"Inloggen met passkey",signInFor:"Inloggen met passkey voor",selectPasskey:"Selecteer een passkey om in te loggen:",noPasskeysFound:"Geen passkeys gevonden voor deze site"},create:{title:"Passkey aanmaken",createFor:"Maak een nieuwe passkey voor",titleLabel:"Titel",titlePlaceholder:"Voer een naam in voor deze passkey",createButton:"Passkey aanmaken",selectPasskeyToReplace:"Selecteer een passkey om te vervangen:",createNewPasskey:"Passkey aanmaken",replacingPasskey:"Passkey vervangen: {{displayName}}",confirmReplace:"Bevestig vervanging",selectExistingLogin:"Toevoegen aan bestaande login:",selectExistingLoginDescription:"Deze passkey toevoegen aan een bestaande inloggegevens voor deze site.",attachingToCredential:"Passkey toevoegen aan: {{serviceName}}",attachPasskey:"Passkey toevoegen"},settings:{passkeyProvider:"Passkey provider",passkeyProviderOn:"Passkey provider ingeschakeld"}},OS={title:"Recent verwijderd",noItems:"Geen verwijderde items",noItemsDescription:"Items die je verwijdert verschijnen hier gedurende 30 dagen voordat ze definitief verwijderd worden.",description:"Deze items zullen na 30 dagen permanent verwijderd worden. Je kunt ze herstellen of ze direct verwijderen.",restore:"Herstel",deletePermanently:"Permanent verwijderen",emptyAll:"Alles verwijderen",daysRemaining_one:"{{count}} dag resterend",daysRemaining_other:"{{count}} dagen resterend",expiringSoon:"Vervalt binnenkort",confirmDeleteTitle:"Permanent verwijderen?",confirmDeleteMessage:"Dit item zal permanent worden verwijderd en kan niet worden hersteld.",confirmEmptyAllTitle:"Recent verwijderd leegmaken?",confirmEmptyAllMessage:"Alle {{count}} items zullen permanent worden verwijderd en kunnen niet worden hersteld."},jS={title:"Vault upgraden",subtitle:"AliasVault is vernieuwd en je vault moet worden bijgewerkt. Dit kan enkele seconden duren.",versionInformation:"Versie-informatie",yourVault:"Jouw vault versie:",newVersion:"Nieuwe beschikbare versie:",upgrade:"Vault upgraden",upgrading:"Aan het upgraden...",whatsNew:"Wat is er nieuw",whatsNewDescription:"Een upgrade is vereist vanwege de volgende wijzigingen:",noDescriptionAvailable:"Voor deze versie is geen beschrijving beschikbaar.",alerts:{unableToGetVersionInfo:"Kan versie-informatie niet ophalen. Probeer het opnieuw.",selfHostedServer:"Self-hosted server",selfHostedWarning:"Als je een self-hosted server gebruikt, zorg er dan voor dat je ook je eigen self-hosted instantie bijwerkt, omdat anders het inloggen via de web client niet meer zal werken.",continueUpgrade:"Verdergaan",upgradeFailed:"Upgrade mislukt",failedToApplyMigration:"Kon migratie niet toepassen ({{current}} van {{total}})"}},PS={unsyncedChangesTitle:"Niet-gesynchroniseerde wijzigingen",unsyncedChangesWarning:"Er zijn niet gesynchroniseerde wijzigingen die verloren zullen gaan als je nu uitlogt. Weet je zeker dat je wilt doorgaan?",logoutAnyway:"Toch uitloggen"},HS={auth:xS,menu:TS,common:SS,content:kS,items:LS,itemTypes:RS,fieldLabels:DS,totp:BS,attachmentUploader:US,emails:_S,settings:MS,passkeys:FS,recentlyDeleted:OS,upgrade:jS,logout:PS},QS={loginTitle:"Zaloguj się do AliasVault",username:"Nazwa użytkownika lub e-mail",usernamePlaceholder:"nazwa / nazwa@firma.com",passwordPlaceholder:"Wprowadź swoje hasło ",rememberMe:"Zapamiętaj mnie",loginButton:"Zaloguj się",noAccount:"Nie masz jeszcze konta?",createVault:"Utwórz nowy sejf",twoFactorTitle:"Wprowadź kod uwierzytelniający z aplikacji uwierzytelniającej.",authCode:"Kod uwierzytelniania",authCodePlaceholder:"Wpisz 6-cyfrowy kod",verify:"Potwierdź",twoFactorNote:"Uwaga: Jeśli nie masz dostępu do swojego urządzenia uwierzytelniającego, możesz zresetować swój kod 2FA za pomocą kodu odzyskiwania, logując się za pośrednictwem strony internetowej.",masterPassword:"Hasło główne",unlockVault:"Odblokuj",unlockWithPin:"Odblokuj za pomocą kodu PIN",enterPinToUnlock:"Wprowadź swój kod PIN, aby odblokować sejf",useMasterPassword:"Użyj hasła głównego",unlockTitle:"Odblokuj swój sejf",logoutConfirm:"Czy na pewno chcesz się wylogować?",unlockSuccessTitle:"Twój sejf został pomyślnie odblokowany.",unlockSuccessDescription:"Możesz teraz używać automatycznego uzupełniania w formularzach logowania w przeglądarce.",closePopup:"Zamknij to okno.",browseVault:"Przeglądaj zawartość sejfu",connectingTo:"Łączenie z",switchAccounts:"Przełącz konto",loginWithMobile:"Zaloguj się za pomocą aplikacji mobilnej",unlockWithMobile:"Odblokuj za pomocą aplikacji mobilnej",scanQrCode:"Zeskanuj ten kod QR za pomocą aplikacji mobilnej AliasVault, aby się zalogować i odblokować sejf.",errors:{invalidCode:"Wprowadź prawidłowy 6-cyfrowy kod uwierzytelniający.",serverError:"Nie można połączyć się z serwerem AliasVault. Spróbuj ponownie później lub skontaktuj się z pomocą techniczną, jeśli problem będzie się powtarzał.",wrongPassword:"Hasło jest nieprawidłowe. Spróbuj ponownie.",sessionExpired:"Twoja sesja wygasła. Prosimy o zalogowanie się ponownie.",mobileLoginRequestExpired:"Limit czasu logowania upłynął. Proszę odświeżyć stronę i spróbować ponownie."}},zS={vault:"Sejf",emails:"Skrzynka odbiorcza"},VS={loading:"Wczytywanie…",notice:"Uwaga",error:"Błąd",cancel:"Anuluj",confirm:"Potwierdź",back:"Powrót",next:"Dalej",use:"Użyj",add:"Dodaj",delete:"Usuń",undo:"Cofnij",save:"Zapisz",saving:"Zapisywanie...",create:"Utwórz",or:"lub",close:"Zamknąć",logout:"Wyloguj się",copied:"Skopiowano",openInNewWindow:"Otwórz w nowym oknie.",enabled:"Aktywne",disabled:"Nie aktywne",showPassword:"Pokaż hasło",hidePassword:"Ukryj hasło",showDetails:"Pokaż szczegóły",hideDetails:"Ukryj szczegóły",copyToClipboard:"Skopiuj do schowka",loadingEmails:"Ładowanie wiadomości e-mail...",loadingTotpCodes:"Ładowanie kodów TOTP...",attachments:"Załączniki",loadingAttachments:"Ładowanie załączników...",settings:"Ustawienia",recentEmails:"Ostatnie wiadomości e-mail",credentials:"Dane logowania",customFields:"Pola niestandardowe",twoFactorAuthentication:"Weryfikacja dwuetapowa (2FA)",alias:"Alias",notes:"Notatki",email:"Adres e-mail",username:"Nazwa użytkownika",password:"Hasło",generate:"Generate",serviceName:"Nazwa usługi",loggedIn:"Zalogowano",syncingVault:"Synchronizacja sejfu",checkingVaultUpdates:"Sprawdzanie aktualizacji sejfu",syncingUpdatedVault:"Synchronizacja zaktualizowanego sejfu",loadMore:"Załaduj więcej",offline:"Jesteś w trybie offline",offlineMode:"Praca w trybie offline",pendingSync:"Synchronizowanie...",mergingVaultChanges:"Łączenie zmian w sejfie...",uploadingVault:"Ładowanie sejfu...",errors:{serverNotAvailable:"Serwer AliasVault jest niedostępny. Spróbuj ponownie później lub skontaktuj się z pomocą techniczną, jeśli problem nadal występuje.",clientVersionNotSupported:"Ta wersja rozszerzenia przeglądarki AliasVault nie jest już obsługiwana przez serwer. Zaktualizuj rozszerzenie przeglądarki do najnowszej wersji.",browserExtensionOutdated:"To rozszerzenie przeglądarki jest nieaktualne i nie można go używać do uzyskania dostępu do tego sejfu. Aby kontynuować, zaktualizuj to rozszerzenie przeglądarki.",serverVersionNotSupported:"Aby korzystać z tego rozszerzenia przeglądarki, należy zaktualizować serwer AliasVault do nowszej wersji. Jeśli potrzebujesz pomocy, skontaktuj się z działem pomocy technicznej.",serverVersionTooOld:"Aby korzystać z tej funkcji, serwer AliasVault musi zostać zaktualizowany do nowszej wersji. Jeśli potrzebujesz pomocy, skontaktuj się z administratorem serwera.",unknownError:"Wystąpił nieznany błąd",unknownErrorTryAgain:"Wystąpił nieznany błąd. Spróbuj ponownie.",vaultNotAvailable:"Sejf niedostępny",vaultIsLocked:"Sejf jest zablokowany",passwordChanged:"Twoje hasło uległo zmianie od czasu ostatniego logowania. Ze względów bezpieczeństwa prosimy o ponowne zalogowanie się.",syncConflictMaxRetries:"Nie można zsynchronizować sejfu po wielu próbach. Spróbuj ponownie później.",mergeFailed:"Nie udało się scalić zmian w sejfie. Spróbuj ponownie."},apiErrors:{UNKNOWN_ERROR:"Wystąpił nieznany błąd. Spróbuj ponownie.",ACCOUNT_LOCKED:"Konto zostało tymczasowo zablokowane z powodu zbyt wielu nieudanych prób. Spróbuj ponownie później.",ACCOUNT_BLOCKED:"Twoje konto zostało zablokowane. Jeśli uważasz, że to pomyłka, skontaktuj się z pomocą techniczną.",USER_NOT_FOUND:"Nieprawidłowa nazwa użytkownika lub hasło. Spróbuj ponownie.",INVALID_AUTHENTICATOR_CODE:"Nieprawidłowy kod uwierzytelniający. Spróbuj ponownie.",INVALID_RECOVERY_CODE:"Nieprawidłowy kod odzyskiwania. Spróbuj ponownie.",REFRESH_TOKEN_REQUIRED:"Wymagany jest token odświeżania.",INVALID_REFRESH_TOKEN:"Nieprawidłowy token odświeżania.",PUBLIC_REGISTRATION_DISABLED:"Rejestracja nowych kont jest obecnie wyłączona na tym serwerze. Skontaktuj się z administratorem.",USERNAME_REQUIRED:"Wymagane jest podanie nazwy użytkownika.",USERNAME_ALREADY_IN_USE:"Nazwa użytkownika jest już używana.",USERNAME_AVAILABLE:"Nazwa użytkownika jest już używana.",USERNAME_MISMATCH:"Nazwa użytkownika nie pasuje do aktualnego użytkownika.",PASSWORD_MISMATCH:"Podane hasło nie zgadza się z Twoim aktualnym hasłem.",ACCOUNT_SUCCESSFULLY_DELETED:"Konto zostało pomyślnie usunięte.",USERNAME_EMPTY_OR_WHITESPACE:"Nazwa użytkownika nie może być pusta ani zawierać spacji.",USERNAME_TOO_SHORT:"Nazwa użytkownika jest zbyt krótka: musi mieć co najmniej 3 znaki.",USERNAME_TOO_LONG:"Nazwa użytkownika jest zbyt długa: nie może przekraczać 40 znaków.",USERNAME_INVALID_EMAIL:"Nieprawidłowy adres e-mail.",USERNAME_INVALID_CHARACTERS:"Nazwa użytkownika jest nieprawidłowa, może zawierać tylko litery lub cyfry.",VAULT_NOT_UP_TO_DATE:"Twój sejf nie jest aktualny. Zsynchronizuj sejf i spróbuj ponownie.",INTERNAL_SERVER_ERROR:"Wewnętrzny błąd serwera.",VAULT_ERROR:"Lokalny sejf nie jest aktualny. Zsynchronizuj sejf, odświeżając stronę, i spróbuj ponownie."}},KS={or:"lub",new:"Nowy",vaultLocked:"AliasVault jest zablokowany.",creatingNewAlias:"Tworzenie nowego aliasu...",noMatchesFound:"Nie znaleziono żadnych wyników",searchVault:"Przeszukaj sejf...",enterServiceName:"Wprowadź nazwę usługi",enterEmailAddress:"Wprowadź adres e-mail",enterUsername:"Wprowadź nazwę użytkownika",hideFor1Hour:"Ukryj na 1 godzinę (bieżąca strona)",hidePermanently:"Ukryj na stałe (bieżąca strona)",createRandomAlias:"Utwórz losowy alias",createUsernamePassword:"Utwórz nazwę użytkownika/hasło",randomAlias:"Losowy alias",usernamePassword:"Nazwa użytkownika/hasło",createAndSaveAlias:"Utwórz i zapisz alias",createAndSaveCredential:"Utwórz i zapisz dane uwierzytelniające",randomIdentityDescription:"Wygeneruj losową tożsamość z losowym adresem e-mail dostępnym w AliasVault.",randomIdentityDescriptionDropdown:"Losowa tożsamość z losowym adresem e-mail",manualCredentialDescription:"Określ swój adres e-mail i nazwę użytkownika.",manualCredentialDescriptionDropdown:"Ręczne wprowadzanie nazwy użytkownika i hasła",failedToCreateIdentity:"Nie udało się utworzyć tożsamości. Spróbuj ponownie.",enterEmailAndOrUsername:"Wprowadź adres e-mail i/lub nazwę użytkownika",autofillWithAliasVault:"Autouzupełnianie za pomocą AliasVault",generateRandomPassword:"Wygeneruj losowe hasło (skopiuj do schowka)",generateNewPassword:"Wygeneruj nowe hasło",togglePasswordVisibility:"Przełącz widoczność hasła",passwordCopiedToClipboard:"Hasło skopiowane do schowka",openAliasVaultToUpgrade:"Otwórz AliasVault, aby dokonać aktualizacji",vaultUpgradeRequired:"Wymagana aktualizacja sejfu.",dismissPopup:"Zamknij wyskakujące okienko"},GS={title:"Elementy",itemName:"Nazwa",loginCredentials:"Dane logowania",cardInformation:"Informacje o karcie",addItem:"Dodaj element",addNewItem:"Dodaj nowy element",saveItem:"Zapisz element",itemDetails:"Szczegóły produktu",editItem:"Edytuj element",untitled:"Bez tytułu",newFolder:"Nowy folder",createFolder:"Utwórz folder",editFolder:"Edytuj folder",folderName:"Nazwa folderu",folderNameRequired:"Nazwa folderu jest wymagana",folder:"Katalog",welcomeTitle:"Witamy w AliasVault!",welcomeDescription:"Aby skorzystać z rozszerzenia przeglądarki AliasVault - przejdź do strony internetowej i użyj okienka autozupelniania, aby utworzyć nowa tożsamość.",noPasskeysFound:"Nie utworzono jeszcze żadnych kluczy dostępu. Klucze dostępu tworzy się, odwiedzając stronę internetową, która oferuje klucze dostępu jako metodę uwierzytelniania.",noAttachmentsFound:"Nie znaleziono żadnych elementów z załącznikami.",noItemsOfTypeFound:"Nie znaleziono elementów {{type}}",noMatchingItems:"Nie znaleziono pasujących elementów",noMatchingItemsSearch:"Nie znaleziono żadnych elementów pasujących do „{{search}}”",noMatchingItemsWithFilter:"Brak elementów {{filter}} pasujących do „{{search}}”",clearSearch:"Wyczyść wyszukiwanie",clearFilter:"Usuń filtr",emptyFolderHint:"Ten folder jest pusty. Aby przenieść elementy do tego folderu, edytuj element i wybierz ten folder.",allItemsInFolders:"Wszystkie Twoje elementy są uporządkowane w folderach. Kliknij folder powyżej, aby wyświetlić swoje dane logowania, lub skorzystaj z wyszukiwarki, aby znaleźć konkretne elementy.",deleteFolder:"Usuń folder",deleteFolderKeepItems:"Usuń tylko folder",deleteFolderKeepItemsDescription:"Elementy zostaną przeniesione z powrotem do listy głównej.",deleteFolderAndItems:"Usuń folder i wszystkie elementy",deleteFolderAndItemsDescription:"{{count}} element(ów) zostaną przeniesione do Ostatnio usunięte.",filters:{all:"(Wszystkie) pozycje",passkeys:"Klucze dostępu"},deleteItemTitle:"Usuń element",deleteItemConfirm:"Czy na pewno chcesz usunąć ten element?",viewHistory:"Pokaż historię",history:"Historia",noHistoryAvailable:"Brak dostępnej historii",tags:"Znaczniki",changePasswordComplexity:"Zmień komplikację hasła",passwordLength:"Długość hasła",includeLowercase:"Uwzględnij małe litery",includeUppercase:"Uwzględnij wielkie litery",includeNumbers:"Uwzględnij numery",includeSpecialChars:"Uwzględnij znaki specjalne",avoidAmbiguousChars:"Unikaj dwuznacznych znaków (o, 0, itp.)",privateEmailTitle:"Prywatny adres e-mail",privateEmailAliasVaultServer:"Serwer AliasVault",privateEmailDescription:"Szyfrowane E2E, w pełni prywatne.",publicEmailTitle:"Publiczni dostawcy tymczasowych adresów e-mail",publicEmailDescription:"Anonimowe, ale ograniczają prywatność. Treść wiadomości e-mail jest dostępna dla każdego, kto zna adres.",validation:{required:"To pole jest wymagane"}},qS={selectType:"Dodaj nowy element",typeLabel:"Typ elementu",creating:"Tworzenie",editing:"Edytowanie",regenerateAlias:"Ponownie wygeneruj alias",addCustomField:"Dodaj pole niestandardowe",fieldLabel:"Etykieta pola",enterFieldName:"Wprowadź nazwę pola",fieldType:"Typ pola",fieldTypes:{text:"Tekst",hidden:"Ukryty (zamaskowany tekst)",email:"Skrzynka odbiorcza",url:"adres URL",phone:"Numer telefonu",number:"Numer",date:"Data",textArea:"Obszar tekst"},login:{title:"Zaloguj się"},alias:{title:"Tożsamość (Alias)"},creditCard:{title:"Karta płatnicza"},note:{title:"Bezpieczna notatka"}},WS={"login.url":"URL strony internetowej","login.username":"Nazwa użytkownika","login.password":"Hasło","alias.first_name":"Imię","alias.last_name":"Nazwisko","alias.gender":"Płeć","alias.birthdate":"Data urodzenia","login.email":"Skrzynka odbiorcza","notes.content":"Notatki","card.cardholder_name":"Imię i nazwisko posiadacza karty","card.number":"Numer karty","card.expiry_month":"Miesiąc wygaśnięcia","card.expiry_year":"Rok wygaśnięcia","card.cvv":"Kod CVV","card.pin":"Kod PIN"},YS={addCode:"Dodaj kod 2FA",instructions:"Wprowadź tajny klucz wyświetlony na stronie internetowej, na której chcesz dodać uwierzytelnianie dwuskładnikowe.",nameOptional:"Nazwa (opcjonalnie)",secretKey:"Tajny klucz",saveToViewCode:"Zapisz, aby wyświetlić kod",defaultName:"Uwierzytelnianie",errors:{invalidSecretKey:"Nieprawidłowy format tajnego klucza."}},JS={uploading:"Przesyłanie...",uploadSuccess:"Plik został przesłany pomyślnie.",deleteSuccess:"Element został pomyślnie usunięty.",firefoxExpandRequired:"Aby przesłać pliki, użyj rozszerzonego okna.",openExpandedWindow:"Otwórz rozszerzone okno"},XS={title:"Skrzynka odbiorcza",deleteEmailTitle:"Usuń e-mail",deleteEmailConfirm:"Czy na pewno chcesz trwale usunąć ten e-mail?",from:"Od",to:"Do",date:"Data",emailContent:"Treść wiadomości e-mail",emailNotFound:"Nie znaleziono wiadomości e-mail",noEmails:"Nie znaleziono wiadomości e-mail",noEmailsDescription:"Nie otrzymałeś jeszcze żadnych wiadomości e-mail na prywatne adresy e-mail. Kiedy otrzymasz nowy e-mail, pojawi się on tutaj.",offlineMessage:"Jesteś offline. Połącz się z Internetem, aby załadować wiadomości e-mail.",dateFormat:{justNow:"w tej chwili",minutesAgo_single:"{{count}} minut temu",minutesAgo_plural:"{{count}} minut temu",hoursAgo_single:"{{count}} godzinę temu",hoursAgo_plural:"{{count}} godzin temu",yesterday:"wczoraj"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Wybrany adres e-mail jest już w użyciu. Proszę zmienić adres e-mail poprzez edycję danych logowania.",CLAIM_DOES_NOT_EXIST:"Wystąpił błąd podczas próby załadowania wiadomości e-mail. Spróbuj edytować i zapisać wpis logowania, aby zsynchronizować bazę danych, a następnie spróbuj ponownie."}},$S={serverUrl:"Adres URL serwera",language:"Język",autofillEnabled:"Włącz autouzupełnianie",version:"Wersja",openWebApp:"Otwórz aplikację internetową",lock:"Zablokuj",globalSettings:"Ustawienia ogólne",autofillPopup:"Okno autouzupełniania",activeOnAllSites:"Aktywne we wszystkich witrynach (chyba że jest wyłączone)",disabledOnAllSites:"Wyłączone na wszystkich witrynach",rightClickContextMenu:"Aktywacja menu kontekstowego",autofillMatching:"Dopasowanie autouzupełniania",autofillMatchingMode:"Tryb dopasowania autouzupełniania",autofillMatchingModeDescription:"Określa, które dane logowania są uważane za dopasowane i wyświetlane jako sugestie w oknie autouzupełniania dla danej strony internetowej.",autofillMatchingDefault:"Adres URL + subdomena + nazwa wieloznaczna",autofillMatchingUrlSubdomain:"Adres URL + subdomena",autofillMatchingUrlExact:"Dokładna domena adresu URL",siteSpecificSettings:"Ustawienia dotyczące witryny",autofillPopupOn:"Wyskakujące okno autouzupełniania: ",enabledForThisSite:"Włączone dla tej witryny",disabledForThisSite:"Wyłączone dla tej witryny",temporarilyDisabledUntil:"Tymczasowo nieaktywne do ",resetAllSiteSettings:"Zresetuj wszystkie ustawienia witryny",appearance:"Wygląd",theme:"Motyw",useDefault:"Użyj domyślnego",light:"Jasny",dark:"Ciemny",keyboardShortcuts:"Skróty klawiaturowe",configureKeyboardShortcuts:"Skonfiguruj skróty klawiaturowe",configure:"Konfiguracja",clipboardClearTimeout:"Wyczyść schowek po skopiowaniu",clipboardClearTimeoutDescription:"Automatycznie wyczyść schowek po skopiowaniu poufnych danych",clipboardClearDisabled:"Nigdy nie czyść",clipboardClear5Seconds:"Wyczyść po 5 sekundach",clipboardClear10Seconds:"Wyczyść po 10 sekundach",clipboardClear15Seconds:"Wyczyść po 15 sekundach",autoLockTimeout:"Blokada rozszerzenia",autoLockTimeoutDescription:"Automatycznie zablokuj sejf po okresie bezczynności",autoLockTimeoutHelp:"Sejf zostanie zablokowany dopiero po określonym okresie nieaktywności (żadne użycie autouzupełniania lub okienko rozszerzenia nie zostało otwarte). Sejf zostanie zablokowany, gdy przeglądarka zostanie zamknięta, niezależnie od tego ustawienia.",autoLockNever:"Nigdy",autoLock15Seconds:"15 sekund",autoLock1Minute:"1 minuta",autoLock5Minutes:"5 minut",autoLock15Minutes:"15 minut",autoLock30Minutes:"30 minut",autoLock1Hour:"1 godzina",autoLock4Hours:"4 godziny",autoLock8Hours:"8 godzin",autoLock24Hours:"24 godziny",versionPrefix:"Wersja ",autofillSettings:"Ustawienia autouzupełniania",clipboardSettings:"Ustawienia schowka",contextMenuSettings:"Ustawienia menu kontekstowego",passkeySettings:"Ustawienia kluczy dostępu",contextMenu:"Menu kontekstowe",contextMenuEnabled:"Menu kontekstowe jest włączone",contextMenuDisabled:"Menu kontekstowe jest wyłączone",contextMenuDescription:"Kliknij prawym przyciskiem myszy na pola wejściowe, aby uzyskać dostęp do opcji AliasVault",selectLanguage:"Wybierz język",serverConfiguration:"Konfiguracja serwera",serverConfigurationDescription:"Skonfiguruj adres URL serwera sejfu AliasVault",customApiUrl:"Adres URL interfejsu API",customClientUrl:"Adresy URL klienta",apiUrlHint:"Adres URL punktu końcowego API (zazwyczaj adres URL klienta + /api)",clientUrlHint:"Adres URL interfejsu sieci web dla twojej samodzielnej instancji",autofillSettingsDescription:"Włącz lub wyłącz okno autouzupełniania na stronach internetowych",autofillEnabledDescription:"Sugestie autouzupełniania pojawią się na formularzach logowania",autofillDisabledDescription:"Podpowiedzi wyłączone we wszystkich polach",languageSettings:"Język",validation:{apiUrlRequired:"API URL jest wymagane",apiUrlInvalid:"Wprowadź poprawny adres URL API",clientUrlRequired:"Adres URL klienta jest wymagany",clientUrlInvalid:"Wprowadź prawidłowy adres URL klienta"},unlockMethod:{title:"Metoda odblokowania skarbca",introText:"Wybierz sposób odblokowania sejfu. Możesz użyć hasła głównego (zawsze dostępnego) lub skonfigurować kod PIN, aby uzyskać szybszy dostęp. Po 3 nieudanych próbach wprowadzenia kodu PIN konieczne będzie użycie hasła głównego.",password:"Hasło główne",pin:"Kod PIN",pinDescription:"Odblokuj sejf za pomocą kodu PIN",setupPin:"Ustaw kod PIN",enterNewPinDescription:"Wprowadź kod PIN składający się z co najmniej 6 cyfr",confirmPin:"Potwierdź kod PIN",confirmPinDescription:"Wprowadź ponownie swój kod PIN, aby potwierdzić",invalidPinFormat:"Nieprawidłowy format kodu PIN",pinMismatch:"Kody PIN nie są zgodne",incorrectPin:"Nieprawidłowy kod PIN. Pozostało {{attemptsRemaining}} prób.",incorrectPinSingular:"Nieprawidłowy kod PIN. Pozostała 1 próba.",enableSuccess:"Odblokowanie za pomocą kodu PIN zostało aktywowane!",pinLocked:"Odblokowanie za pomocą kodu PIN zostało wyłączone. Aby odblokować sejf, użyj hasła głównego.",pinSecurityWarning:"Odblokowanie za pomocą kodu PIN w rozszerzeniu przeglądarki może być mniej bezpieczne niż hasło główne, ponieważ kody PIN mają zazwyczaj niższą entropię i mogą zostać złamane metodą Brute-Force, jeśli urządzenie zostanie naruszone. Używaj tej funkcji tylko na urządzeniach, którym w pełni ufasz."}},ZS={passkey:"Kod dostępu",site:"Strona internetowa",helpText:"Klucze dostępu są tworzone na stronie internetowej po wyświetleniu monitu. Nie można ich edytować ręcznie. Aby usunąć ten klucz dostępu, można go usunąć z tych poświadczeń. Aby zastąpić ten klucz dostępu lub utworzyć nowy, należy odwiedzić stronę internetową i postępować zgodnie z wyświetlanymi instrukcjami.",passkeyMarkedForDeletion:"Klucz dostępu oznaczony do usunięcia",passkeyWillBeDeleted:"To hasło zostanie usunięte po zapisaniu tych danych logowania.",useBrowserPasskey:"Użyj klucza dostępu przeglądarki",bypass:{description:"Jak długo chcesz korzystać z dostawcy kluczy przeglądarki dla {{origin}}?",thisTimeOnly:"Tylko tym razem",alwaysForSite:"Zawsze dla tej witryny"},authenticate:{title:"Zaloguj się za pomocą klucza bezpieczeństwa",signInFor:"Zaloguj się za pomocą klucza bezpieczeństwa dla",selectPasskey:"Wybierz klucz dostępu, aby się zalogować:",noPasskeysFound:"Nie znaleziono kluczy dostępu dla tej witryny"},create:{title:"Utwórz klucz dostępu",createFor:"Utwórz nowy klucz dostępu dla",titleLabel:"Tytuł",titlePlaceholder:"Wprowadź nazwę dla tego klucza dostępu",createButton:"Utwórz klucz dostępu",selectPasskeyToReplace:"Wybierz klucz dostępu, który chcesz zastąpić:",createNewPasskey:"Utwórz nowy klucz dostępu",replacingPasskey:"Zamiana klucza dostępu: {{displayName}}",confirmReplace:"Potwierdź zamianę",selectExistingLogin:"Dodaj do istniejącego loginu:",selectExistingLoginDescription:"Dołącz ten klucz dostępu do istniejącego logowania dla tej witryny.",attachingToCredential:"Dodawanie klucza dostępu do: {{serviceName}}",attachPasskey:"Dodaj klucz dostępu"},settings:{passkeyProvider:"Dostawca klucza dostępu",passkeyProviderOn:"Dostawca klucza dostępu włączony "}},e1={title:"Ostatnio usunięte",noItems:"Brak usuniętych elementów",noItemsDescription:"Usunięte elementy pojawią się tutaj na 30 dni, zanim zostaną trwale usunięte.",description:"Te elementy zostaną trwale usunięte po 30 dniach. Możesz je przywrócić lub natychmiast usunąć.",restore:"Przywróć",deletePermanently:"Usuń bezpowrotnie",emptyAll:"Opróżnij wszystkie",daysRemaining_one:"Pozostało {{count}} dni",daysRemaining_other:"Pozostało {{count}} dni",expiringSoon:"Wkrótce wygasa",confirmDeleteTitle:"Usunąć trwale?",confirmDeleteMessage:"Ten element zostanie trwale usunięty i nie będzie można go odzyskać.",confirmEmptyAllTitle:"Opróżnij ostatnio usunięte?",confirmEmptyAllMessage:"Wszystkie elementy {{count}} zostaną trwale usunięte i nie mogą zostać odzyskane."},t1={title:"Aktualizacja sejfu",subtitle:"Wersja AliasVault jest nieaktualna i konieczna jest aktualizacja Twojego sejfu. Zajmie to tylko kilka sekund.",versionInformation:"Informacje o wersji",yourVault:"Twoja wersja sejfu:",newVersion:"Nowa dostępna wersja:",upgrade:"Aktualizuj sejf",upgrading:"Aktualizacja...",whatsNew:"Co nowego",whatsNewDescription:"Uaktualnienie jest wymagane do obsługi następujących zmian:",noDescriptionAvailable:"Brak dostępnego opisu dla tej wersji.",alerts:{unableToGetVersionInfo:"Nie można uzyskać informacji o wersji. Spróbuj ponownie.",selfHostedServer:"Serwer własny",selfHostedWarning:"Jeśli używasz własnego serwera, upewnij się, że zaktualizujesz swoją samodzielną instancję, ponieważ w przeciwnym razie logowanie się do klienta internetowego przestanie działać.",continueUpgrade:"Kontynuuj aktualizację",upgradeFailed:"Aktualizacja nie powiodła się",failedToApplyMigration:"Nie udało się zastosować migracji ({{current}} of {{total}})"}},a1={unsyncedChangesTitle:"Zmiany niesynchronizowane",unsyncedChangesWarning:"Masz niezsynchronizowane zmiany, które zostaną utracone, jeśli się teraz wylogujesz. Czy na pewno chcesz kontynuować?",logoutAnyway:"Wyloguj się mimo wszystko"},n1={auth:QS,menu:zS,common:VS,content:KS,items:GS,itemTypes:qS,fieldLabels:WS,totp:YS,attachmentUploader:JS,emails:XS,settings:$S,passkeys:ZS,recentlyDeleted:e1,upgrade:t1,logout:a1},r1={loginTitle:"Fazer login no AliasVault",username:"Nome de usuário ou e-mai",usernamePlaceholder:"nome / nome@empresa.com",passwordPlaceholder:"Digite sua senha",rememberMe:"Lembrar-me",loginButton:"Entrar",noAccount:"Não possui conta?",createVault:"Criar novo cofre",twoFactorTitle:"Por favor, insira o código de autenticação do seu aplicativo de autenticação.",authCode:"Código de Autenticação",authCodePlaceholder:"Digite o código de 6 dígitos",verify:"Verificar",twoFactorNote:"Nota: se você não tem acesso ao seu aparelho de verificação, você pode resetar seu 2FA com um código de recuperação fazendo login no site.",masterPassword:"Senha Mestre",unlockVault:"Desbloquear",unlockWithPin:"Desbloquear com PIN",enterPinToUnlock:"Digite seu PIN para desbloquear seu cofre",useMasterPassword:"Utilizar Senha Mestre",unlockTitle:"Desbloquear Seu Cofre",logoutConfirm:"Tem certeza que deseja sair?",unlockSuccessTitle:"O seu cofre foi desbloqueado com sucesso",unlockSuccessDescription:"Agora você pode utilizar o preenchimento automático nos formulários de login no seu navegador.",closePopup:"Fechar este pop-up",browseVault:"Navegar por conteúdo do cofre",connectingTo:"Conectando à",switchAccounts:"Mudar de conta?",loginWithMobile:"Entrar utilizado Dispositivo Móvel",unlockWithMobile:"Desbloquear utilizando Dispositivo Móvel",scanQrCode:"Escaneie este código QR com seu aplicativo AliasVault para dispositivo móvel para entrar e desbloquear seu cofre.",errors:{invalidCode:"Por favor digite o código de autenticação de 6 dígitos.",serverError:"Não foi possível conectar ao servidor do AliasVault. Por favor tente novamente mais tarde ou entre em contato com o suporte caso o problema persista.",wrongPassword:"Senha incorreta. Por favor tente novamente.",sessionExpired:"Sua sessão expirou. Por favor, faça login novamente.",mobileLoginRequestExpired:"Requisição de login pelo dispositivo móvel demorou muito. Por favor, atualize a página e tente novamente."}},i1={vault:"Cofre",emails:"E-mails"},s1={loading:"Carregando...",notice:"Aviso",error:"Erro",cancel:"Cancelar",confirm:"Confirmar",back:"Voltar",next:"Próximo",use:"Utilizar",add:"Adicionar",delete:"Excluir",undo:"Desfazer",save:"Salvar",saving:"Salvando...",create:"Criar",or:"Ou",close:"Fechar",logout:"Sair",copied:"Copiado!",openInNewWindow:"Abrir em uma nova janela",enabled:"Habilitado",disabled:"Desabilitado",showPassword:"Mostrar senha",hidePassword:"Ocultar senha",showDetails:"Exibir detalhes",hideDetails:"Esconder detalhes",copyToClipboard:"Copiar para a área de transferência",loadingEmails:"Carregando e-mails...",loadingTotpCodes:"Carregando códigos TOTP...",attachments:"Anexos",loadingAttachments:"Carregando anexos...",settings:"Configurações",recentEmails:"E-mails recentes",credentials:"Credenciais",customFields:"Campos Personalizados",twoFactorAuthentication:"Autenticação de dois fatores",alias:"Alias",notes:"Notas",email:"E-mail",username:"Nome de Usuário",password:"Senha",generate:"Gerar",serviceName:"Nome do Serviço",loggedIn:"Logado",syncingVault:"Sincronizando cofre",checkingVaultUpdates:"Verificando atualizações do cofre",syncingUpdatedVault:"Sincronizando cofre atualizado",loadMore:"Carregar mais",offline:"Offline",offlineMode:"Operando em modo offline",pendingSync:"Sincronizando...",mergingVaultChanges:"Integrando mudanças do cofre...",uploadingVault:"Fazendo upload do cofre...",errors:{serverNotAvailable:"O servidor AliasVault não está disponível. Por favor, tente novamente mais tarde ou entre em contato com o suporte caso o problema persista.",clientVersionNotSupported:"Esta versão da extensão AliasVault para o navegador não é mais suportada pelo servidor. Por favor, atualize sua extensão para a última versão.",browserExtensionOutdated:"Esta extensão do navegador está desatualizada e não pode ser utilizada para acessar este cofre. Por favor, atualize esta extensão para continuar.",serverVersionNotSupported:"O servidor AliasVault precisa ser atualizado para uma nova versão para poder utilizar esta extensão de navegador. Por favor, entre em contato com o suporte caso precise de ajuda.",serverVersionTooOld:"O servidor do AliasVault deve ser atualizado para uma versão mais recente para utilizar esta função. Por favor, entre em contato com o administrador do servidor se precisar de ajuda.",unknownError:"Ocorreu um erro desconhecido",unknownErrorTryAgain:"Ocorreu um erro inesperado. Por favor, tente novamente.",vaultNotAvailable:"Cofre não disponível",vaultIsLocked:"O cofre está bloqueado",passwordChanged:"Sua senha mudou desde o último login. Por favor, realize login novamente por questões de segurança.",syncConflictMaxRetries:"Não foi possível sincronizar seu cofre após várias tentativas. Por favor, tente novamente mais tarde.",mergeFailed:"Falha ao combinar mudanças do cofre. Por favor, tente novamente."},apiErrors:{UNKNOWN_ERROR:"Um erro desconhecido ocorreu. Por favor, tente novamente.",ACCOUNT_LOCKED:"Conta temporariamente bloqueada por muitas tentativas de login falhas. Por favor, tente novamente mais tarde.",ACCOUNT_BLOCKED:"Sua conta foi desabilitada. Se você acredita que isto foi um erro, por favor, entre em contato com o suporte.",USER_NOT_FOUND:"Usuário ou senha incorretos. Por favor, tente novamente.",INVALID_AUTHENTICATOR_CODE:"Código de autenticação incorreto. Por favor, tente novamente.",INVALID_RECOVERY_CODE:"Código de recuperação inválido. Por favor, tente novamente.",REFRESH_TOKEN_REQUIRED:"Token de atualização é obrigatório.",INVALID_REFRESH_TOKEN:"Token de atualização inválido.",PUBLIC_REGISTRATION_DISABLED:"Registro de novas contas está atualmente desabilitado neste servidor. Por favor entre em contato com o administrador.",USERNAME_REQUIRED:"Nome de usuário é obrigatório.",USERNAME_ALREADY_IN_USE:"Nome de usuário já está em uso.",USERNAME_AVAILABLE:"Nome de usuário está disponível.",USERNAME_MISMATCH:"Nome de usuário não corresponde ao usuário atual.",PASSWORD_MISMATCH:"A senha digitada não corresponde á sua senha atual.",ACCOUNT_SUCCESSFULLY_DELETED:"Conta excluída com sucesso.",USERNAME_EMPTY_OR_WHITESPACE:"Nome de usuário não pode estar vazio ou em branco.",USERNAME_TOO_SHORT:"Nome de usuário muito curto: deve ter pelo menos 3 caracteres.",USERNAME_TOO_LONG:"Nome de usuário muito longo: não pode conter mais de 40 caracteres.",USERNAME_INVALID_EMAIL:"Endereço de e-mail inválido.",USERNAME_INVALID_CHARACTERS:"Nome de usuário é inválido, deve conter apenas letras ou números.",VAULT_NOT_UP_TO_DATE:"Seu cofre não está atualizado. Por favor, sincronize seu cofre e tente novamente.",INTERNAL_SERVER_ERROR:"Erro intero do servidor.",VAULT_ERROR:"O cofre local não está atualizado. Por favor, sincronize seu cofre recarregando a página e tente novamente."}},o1={or:"ou",new:"Novo",vaultLocked:"AliasVault está bloqueado.",creatingNewAlias:"Criando novo alias...",noMatchesFound:"Nenhum resultado encontrado",searchVault:"Pesquisar cofre...",enterServiceName:"Digite o nome do serviço",enterEmailAddress:"Digite o endereço de e-mail",enterUsername:"Digite o nome de usuário",hideFor1Hour:"Ocultar por 1 hora (site atual)",hidePermanently:"Ocultar permanentemente (site atual)",createRandomAlias:"Criar alias aleatório",createUsernamePassword:"Criar nome de usuário/senha",randomAlias:"Alias aleatório",usernamePassword:"Nome de usuário/senha",createAndSaveAlias:"Criar e salvar alias",createAndSaveCredential:"Criar e salvar credencial",randomIdentityDescription:"Gerar uma identidade aleatória com um endereço de e-mail aleatório acessível pelo AliasVault.",randomIdentityDescriptionDropdown:"Identidade aleatória com e-mail aleatório",manualCredentialDescription:"Especifique seu próprio endereço de e-mail e nome de usuário.",manualCredentialDescriptionDropdown:"Nome de usuário e senha manuais",failedToCreateIdentity:"Falha ao criar identidade. Por favor, tente novamente.",enterEmailAndOrUsername:"Digite o e-mail e/ou nome de usuário",autofillWithAliasVault:"Preenchimento Automático com AliasVault",generateRandomPassword:"Gerar senha aleatória (copiar para a área de transferência)",generateNewPassword:"Gerar nova senha",togglePasswordVisibility:"Alternar visibilidade da senha",passwordCopiedToClipboard:"Senha copiada para a área de transferência",openAliasVaultToUpgrade:"Abra o AliasVault para atualizar",vaultUpgradeRequired:"Atualização de cofre necessária.",dismissPopup:"Ignorar pop-up"},l1={title:"Itens",itemName:"Nome",loginCredentials:"Credenciais de Login",cardInformation:"Informações do Cartão",addItem:"Adicionar Item",addNewItem:"Adicionar novo item",saveItem:"Salvar Item",itemDetails:"Detalhes do Item",editItem:"Editar Item",untitled:"Sem Título",newFolder:"Nova Pasta",createFolder:"Criar Pasta",editFolder:"Editar Pasta",folderName:"Nome da Pasta",folderNameRequired:"Nome da pasta é obrigatório",folder:"Pasta",welcomeTitle:"Boas-vindas ao AliasVault!",welcomeDescription:"Para utilizar a extensão de navegador do AliasVault: navegue para um site e utilize o pop-up de preenchimento automático do AliasVault para criar uma nova credencial.",noPasskeysFound:"Nenhuma passkey foi criada ainda. Passkeys são veiadas visitando um website que ofereça passkey como método de autenticação.",noAttachmentsFound:"Nenhum item com anexos foi encontrado",noItemsOfTypeFound:"Nenhum item do tipo {{type}} foi encontrado",noMatchingItems:"Nenhum ítem correspondente encontrado",noMatchingItemsSearch:'Nenhum item corresponde à "{{search}}"',noMatchingItemsWithFilter:'Nenhum item com o filtro {{filter}} corresponde à "{{search}}"',clearSearch:"Limpar pesquisa",clearFilter:"Limpar filtro",emptyFolderHint:"Esta pasta está vazia. Para mover itens para esta pasta, edite o item e toque no ícone da pasta no campo de nome.",allItemsInFolders:"Todos os seus itens estão organizados em pastas. Clique em uma pasta acima para ver suas credenciais, ou utilize a busca para encontrar itens específicos.",deleteFolder:"Excluir Pasta",deleteFolderKeepItems:"Excluir apenas a pasta",deleteFolderKeepItemsDescription:"Itens serão movidos de volta para a lista principal.",deleteFolderAndItems:"Excluir pasta e todos os itens",deleteFolderAndItemsDescription:"{{count}} item(s) será(ão) movido(s) para Recentemente Excluídos.",filters:{all:"(Todos os) Itens",passkeys:"Passkeys"},deleteItemTitle:"Excluir Item",deleteItemConfirm:"Tem certeza que deseja excluir este item?",viewHistory:"Visualizar histórico",history:"Histórico",noHistoryAvailable:"Histórico não disponível",tags:"Tags",changePasswordComplexity:"Alterar complexidade de senha",passwordLength:"Tamanho da senha",includeLowercase:"Incluir letras minúsculas",includeUppercase:"Incluir letras maiúsculas",includeNumbers:"Incluir números",includeSpecialChars:"Incluir caracteres especiais",avoidAmbiguousChars:"Evitar caracteres ambíguos (o, 0, etc.)",privateEmailTitle:"E-mail Privado",privateEmailAliasVaultServer:"Servidor AliasVault",privateEmailDescription:"Criptografia E2E, totalmente privado.",publicEmailTitle:"Provedores Públicos de E-mail Temporário",publicEmailDescription:"Anônimo mas com privacidade limitada. Conteúdo do e-mail pode ser lido por qualquer um que souber o endereço.",validation:{required:"Este campo é obrigatório"}},c1={selectType:"Adicionar Novo Item",typeLabel:"Tipo do Item",creating:"Criando",editing:"Editando",regenerateAlias:"Gerar alias novamente",addCustomField:"Adicionar campo personalizado",fieldLabel:"Nome do Campo",enterFieldName:"Digite o nome do campo",fieldType:"Tipo do Campo",fieldTypes:{text:"Texto",hidden:"Escondido (texto mascarado)",email:"E-mail",url:"URL",phone:"Telefone",number:"Número",date:"Data",textArea:"Área de Texto"},login:{title:"Login"},alias:{title:"Alias"},creditCard:{title:"Cartão de Crédito"},note:{title:"Nota Segura"}},u1={"login.url":"URL do Website","login.username":"Nome de usuário","login.password":"Senha","alias.first_name":"Primeiro Nome","alias.last_name":"Sobrenome","alias.gender":"Gênero","alias.birthdate":"Data de nascimento","login.email":"E-mail","notes.content":"Notas","card.cardholder_name":"Nome do Titular do Cartão","card.number":"Número do Cartão","card.expiry_month":"Mês de Expiração","card.expiry_year":"Ano de Expiração","card.cvv":"CVV","card.pin":"Senha"},d1={addCode:"Adicionar Código de Autenticação de Dois Fatores",instructions:"Digite a chave secreta exibida pelo website que você quer adicionar a autenticação de dois fatores.",nameOptional:"Nome (opcional)",secretKey:"Chave Secreta",saveToViewCode:"Salvar para ver código",defaultName:"Autenticador",errors:{invalidSecretKey:"Formato de chave secreta inválido."}},m1={uploading:"Fazendo upload...",uploadSuccess:"Arquivos enviados com sucesso.",deleteSuccess:"Anexo excluído com sucesso.",firefoxExpandRequired:"Para fazer o upload dr arquivos, use a tela expandida.",openExpandedWindow:"Abrir Tela Expandida"},f1={title:"E-mails",deleteEmailTitle:"Excluir E-mail",deleteEmailConfirm:"Tem certeza de que deseja excluir permanentemente este e-mail?",from:"De",to:"Para",date:"Data",emailContent:"Conteúdo do email",emailNotFound:"E-mail não encontrado",noEmails:"Nenhum e-mail encontrado",noEmailsDescription:"Você ainda não recebeu nenhum e-mail em seus endereços de e-mail privados. Quando receber um novo e-mail, ele aparecerá aqui.",offlineMessage:"Você está offline. Por favor, conecte-se à internet para carregar seus e-mails.",dateFormat:{justNow:"agora",minutesAgo_single:"há {{count}} minuto",minutesAgo_plural:"há {{count}} minutos",hoursAgo_single:"há {{count}} hora",hoursAgo_plural:"há {{count}} horas",yesterday:"ontem"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"O e-mail escolhido já está em uso. Por favor, altere o endereço de e-mail editando esta credencial.",CLAIM_DOES_NOT_EXIST:"Ocorreu um erro ao tentar carregar os e-mails. Por favor, tente editar e salvar a credencial para sincronizar com o banco de dados, e tente novamente."}},g1={serverUrl:"URL do servidor",language:"Idioma",autofillEnabled:"Ativar o Preenchimento Automático",version:"Versão",openWebApp:"Abrir aplicativo web",lock:"Bloquear",globalSettings:"Configurações Gerais",autofillPopup:"Pop-up de preenchimento automático",activeOnAllSites:"Ativado em todos os sites (a menos que esteja desabilitado abaixo)",disabledOnAllSites:"Desativado em todos os sites",rightClickContextMenu:"Menu do botão direito",autofillMatching:"Correspondência de Preenchimento Automático",autofillMatchingMode:"Modo de correspondência de preenchimento automático",autofillMatchingModeDescription:"Determina quais credenciais são consideradas uma correspondência e mostradas como sugestões no pop-up de preenchimento automático para um determinado site.",autofillMatchingDefault:"Wildcard URL + subdomínio + nome",autofillMatchingUrlSubdomain:"URL + subdomínio",autofillMatchingUrlExact:"Apenas URL exato do domínio",siteSpecificSettings:"Configurações Específicas do Site",autofillPopupOn:"Pop-up de preenchimento automático em: ",enabledForThisSite:"Habilitado para este site",disabledForThisSite:"Desabilitado para este site",temporarilyDisabledUntil:"Temporariamente desabilitado até ",resetAllSiteSettings:"Redefinir todas as configurações específicas do site",appearance:"Aparência",theme:"Tema",useDefault:"Utilizar padrão",light:"Claro",dark:"Escuro",keyboardShortcuts:"Atalhos do Teclado",configureKeyboardShortcuts:"Configurar atalhos do teclado",configure:"Configurar",clipboardClearTimeout:"Limpar área de transferência após copiar",clipboardClearTimeoutDescription:"Limpar automaticamente a área de transferência após copiar dados sensíveis",clipboardClearDisabled:"Nunca limpar",clipboardClear5Seconds:"Limpar após 5 segundos",clipboardClear10Seconds:"Limpar após 10 segundos",clipboardClear15Seconds:"Limpar após 15 segundos",autoLockTimeout:"Tempo para bloqueio automático",autoLockTimeoutDescription:"Bloquear o cofre automaticamente após período de inatividade",autoLockTimeoutHelp:"O cofre será bloqueado apenas após o período de inatividade especificado (nenhuma utilização de preenchimento automático ou pop-up da extensão abertos). O cofre sempre será bloqueado quando o navegador for fechado, independentemente desta configuração.",autoLockNever:"Nunca",autoLock15Seconds:"15 segundos",autoLock1Minute:"1 minuto",autoLock5Minutes:"5 minutos",autoLock15Minutes:"15 minutos",autoLock30Minutes:"30 minutos",autoLock1Hour:"1 hora",autoLock4Hours:"4 horas",autoLock8Hours:"8 horas",autoLock24Hours:"24 horas",versionPrefix:"Versão ",autofillSettings:"Configurações de Preenchimento Automático",clipboardSettings:"Configurações da Área de Transferência",contextMenuSettings:"Configurações do Menu de Contexto",passkeySettings:"Configurações de Passkey",contextMenu:"Menu de Contexto",contextMenuEnabled:"Menu de contexto está habilitado",contextMenuDisabled:"Menu de contexto está desabilitado",contextMenuDescription:"Clique com o botão direito nos campos para acessar as opções do AliasVault",selectLanguage:"Selecionar Idioma",serverConfiguration:"Configurações do Servidor",serverConfigurationDescription:"Configure o URL do servidor do AliasVault para instâncias self-hosted",customApiUrl:"URL da API",customClientUrl:"URL do Cliente",apiUrlHint:"O URL do endpoint da API (geralmente o URL do cliente + /api)",clientUrlHint:"O URL da interface web da sua instância self-hosted",autofillSettingsDescription:"Habilite ou desabilite o popup de autopreenchimento em páginas web",autofillEnabledDescription:"Sugestões de autopreenchimento aparecerão em formulários de login",autofillDisabledDescription:"Sugestões de autopreenchimento estão desabilitadas globalmente",languageSettings:"Idioma",validation:{apiUrlRequired:"URL de API é obrigatório",apiUrlInvalid:"Por favor, digite um URL de API válido",clientUrlRequired:"URL de Cliente é obrigatório",clientUrlInvalid:"Por favor, digite um URL de cliente válido"},unlockMethod:{title:"Método de Desbloqueio do Cofre",introText:"Escolha como você quer desbloquear seu cofre. Você pode utilizar sua senha mestre (sempre disponível), ou configurar um PIN para facilitar o acesso. Após 3 tentativas incorretas de PIN, você deverá utilizar sua senha mestre.",password:"Senha Mestre",pin:"Código PIN",pinDescription:"Desbloquear cofre com código PIN",setupPin:"Configurar Código PIN",enterNewPinDescription:"Digite um PIN que consista de, pelo menos, 6 dígitos",confirmPin:"Confirmar PIN",confirmPinDescription:"Digite seu PIN novamente para confirmar",invalidPinFormat:"Formato de PIN inválido",pinMismatch:"PINs não correspondem",incorrectPin:"PIN incorreto. {{attemptsRemaining}} tentativas restantes.",incorrectPinSingular:"PIN incorreto. 1 tentativa restante.",enableSuccess:"Desbloqueio por PIN habilitado com sucesso!",pinLocked:"Desbloqueio por PIN foi desabilitado. Por favor, utilize sua senha mestre para desbloquear o cofre.",pinSecurityWarning:"Desbloqueio por PIN na extensão de navegador pode ser menos segura que sua senha mestre, uma vez que PINs geralmente tem uma entropia menor e podem ser vulneráveis à tentativas forçadas caso seu dispositivo esteja comprometido. Utilize apenas em dispositivos que tenha total confiança."}},h1={passkey:"Passkey",site:"Site",helpText:"Passkeys são criadas no website quando solicitado. Elas não podem ser editadas manualmente. Para remover esta passkey, você pode excluí-la desta credencial. Para trocar esta passkey ou gerar uma nova, visite o website e siga as instruções.",passkeyMarkedForDeletion:"Passkey marcada para ser excluída",passkeyWillBeDeleted:"Esta passkey será excluída quando você salvar esta credencial.",useBrowserPasskey:"Utilizar Passkey do Navegador",bypass:{description:"Por quanto tempo você deseja utilizar o provedor de passkey do navegador para {{origin}}?",thisTimeOnly:"Apenas desta vez",alwaysForSite:"Sempre para este site"},authenticate:{title:"Fazer login com uma Passkey",signInFor:"Fazer login com uma passkey para",selectPasskey:"Selecione uma passkey para fazer login:",noPasskeysFound:"Nenhuma passkey foi encontrada para este site"},create:{title:"Criar Passkey",createFor:"Criar nova passkey para",titleLabel:"Título",titlePlaceholder:"Digite um nome para esta passkey",createButton:"Criar Passkey",selectPasskeyToReplace:"Selecione uma passkey para alterar:",createNewPasskey:"Criar Nova Passkey",replacingPasskey:"Alternado passkey: {{displayName}}",confirmReplace:"Confirmar Alterações",selectExistingLogin:"Adicionar à login existente:",selectExistingLoginDescription:"Adicionar este passkey em uma credencial de login para este site.",attachingToCredential:"Adicionando passkey em: {{serviceName}}",attachPasskey:"Adicionar Passkey"},settings:{passkeyProvider:"Provedor de Passkey",passkeyProviderOn:"Provedor de Passkey em "}},A1={title:"Recentemente Excluídos",noItems:"Nenhum item excluído",noItemsDescription:"Itens que você excluir aparecerão aqui por 30 dias, antes de serem removidos permanentemente.",description:"Estes itens serão excluídos permanentemente após 30 dias. Você pode restaurá-los ou excluí-los imediatamente.",restore:"Restaurar",deletePermanently:"Excluir Permanentemente",emptyAll:"Esvaziar Tudo",daysRemaining_one:"{{count}} dia restante",daysRemaining_other:"{{count}} dias restantes",expiringSoon:"Expirando em breve",confirmDeleteTitle:"Excluir Permanentemente?",confirmDeleteMessage:"Este item será excluído permanentemente, e não poderá ser restaurado.",confirmEmptyAllTitle:"Esvaziar Recentemente Excluídos?",confirmEmptyAllMessage:"Todos os {{count}} itens serão excluídos permanentemente, e não poderão ser restaurados."},p1={title:"Atualizar Cofre",subtitle:"AliasVault foi atualizado e seu cofre precisa ser atualizado. Isso deve levar apenas alguns segundos.",versionInformation:"Informação de Versão",yourVault:"Versão do seu cofre:",newVersion:"Nova versão disponível:",upgrade:"Atualizar Cofre",upgrading:"Atualizando...",whatsNew:"O Que Há de Novo",whatsNewDescription:"Uma atualização é necessária para utilizar as seguintes mudanças:",noDescriptionAvailable:"Nenhuma descrição disponível para esta versão.",alerts:{unableToGetVersionInfo:"Não foi possível solicitar informações da versão. Por favor, tente novamente.",selfHostedServer:"Servidor Self-Hosted",selfHostedWarning:"Se você está utilizando um servidor self-hosted, faça também a atualização da instância self-hosted, caso contrário o login no cliente web vai parar de funcionar.",continueUpgrade:"Continuar Atualização",upgradeFailed:"Atualização Falhou",failedToApplyMigration:"Falha ao aplicar migração ({{current}} de {{total}})"}},y1={unsyncedChangesTitle:"Alterações Dessincronizadas",unsyncedChangesWarning:"Você tem alterações dessincronizadas que serão perdidas caso você saia da sua conta agora. Têm certeza que deseja continuar?",logoutAnyway:"Sair assim mesmo"},E1={auth:r1,menu:i1,common:s1,content:o1,items:l1,itemTypes:c1,fieldLabels:u1,totp:d1,attachmentUploader:m1,emails:f1,settings:g1,passkeys:h1,recentlyDeleted:A1,upgrade:p1,logout:y1},b1={loginTitle:"Autentificare în AliasVault",username:"Numele de utilizator sau adresa de e-mail",usernamePlaceholder:"nume / nume@companie.com",passwordPlaceholder:"Introdu parola",rememberMe:"Ține-mă minte",loginButton:"Autentificare",noAccount:"Nu ai încă un cont?",createVault:"Creează un seif nou",twoFactorTitle:"Introdu codul de autentificare din aplicația ta de autentificare.",authCode:"Cod de autentificare",authCodePlaceholder:"Introdu codul din 6 cifre",verify:"Verifică",twoFactorNote:"Notă: dacă nu ai acces la dispozitivul de autentificare, poți reseta 2FA cu un cod de recuperare autentificându-te prin intermediul site-ului web.",masterPassword:"Parolă principală",unlockVault:"Deblochează",unlockWithPin:"Deblochează cu PIN",enterPinToUnlock:"Introdu codul PIN pentru a debloca seiful",useMasterPassword:"Folosește parola principală",unlockTitle:"Deblochează seiful",logoutConfirm:"Sigur vrei să te deconectezi?",unlockSuccessTitle:"Seiful a fost deblocat cu succes",unlockSuccessDescription:"Acum poți folosi completarea automată pentru câmpurile cu date de autentificare în browserul tău.",closePopup:"Închide această fereastră",browseVault:"Răsfoiește conținutul seifului",connectingTo:"Conectare la",switchAccounts:"Schimbați contul?",loginWithMobile:"Autentificare prin aplicația mobilă",unlockWithMobile:"Deblochează prin aplicația mobilă",scanQrCode:"Scanează acest cod QR cu aplicația mobilă AliasVault pentru a te autentifica și debloca seiful.",errors:{invalidCode:"Introdu un cod de autentificare valid din 6 cifre.",serverError:"Conexiunea la serverul AliasVault a eșuat. Încearcă mai târziu sau contactează asistența dacă problema persistă.",wrongPassword:"Parolă incorectă. Încearcă din nou.",sessionExpired:"Sesiunea a expirat. Autentifică-te din nou.",mobileLoginRequestExpired:"Cererea de autentificare mobilă a expirat. Reîncarcă pagina și încearcă din nou."}},I1={vault:"Seif",emails:"E-mailuri"},v1={loading:"Se încarcă...",notice:"Notificare",error:"Eroare",cancel:"Anulați",confirm:"Confirmă",back:"Înapoi",next:"Înainte",use:"Folosește",add:"Adaugă",delete:"Șterge",undo:"Reveniți",save:"Salvează",saving:"Se salvează...",create:"Creează",or:"Sau",close:"Închide",logout:"Deconectare",copied:"Copiat!",openInNewWindow:"Deschide în fereastră nouă",enabled:"Activat",disabled:"Dezactivat",showPassword:"Afișează parola",hidePassword:"Ascunde parola",showDetails:"Afișează detalii",hideDetails:"Ascunde detalii",copyToClipboard:"Copiază în clipboard",loadingEmails:"Se încarcă e-mailurile...",loadingTotpCodes:"Se încarcă codurile TOTP...",attachments:"Atașamente",loadingAttachments:"Se încarcă atașamentele...",settings:"Setări",recentEmails:"E-mailuri recente",credentials:"Date de autentificare",customFields:"Câmpuri personalizate",twoFactorAuthentication:"Autentificare cu doi factori",alias:"Alias",notes:"Note",email:"E-mail",username:"Utilizator",password:"Parolă",generate:"Generează",serviceName:"Nume Serviciu",loggedIn:"Autentificat",syncingVault:"Se sincronizează seiful",checkingVaultUpdates:"Se verifică actualizările seifului",syncingUpdatedVault:"Se sincronizează seiful actualizat",loadMore:"Încarcă mai multe",offline:"Deconectat",offlineMode:"Funcționează în modul offline",pendingSync:"Se sincronizează...",mergingVaultChanges:"Se îmbină modificările seifului...",uploadingVault:"Se încarcă seiful...",errors:{serverNotAvailable:"Serverul AliasVault nu este disponibil. Încearcă mai târziu sau contactează asistența.",clientVersionNotSupported:"Această versiune a extensiei AliasVault nu mai este compatibilă cu serverul. Actualizează extensia la cea mai recentă versiune.",browserExtensionOutdated:"Versiune extensie incompatibilă. Pentru a accesa seiful, actualizează extensia AliasVault la ultima versiune disponibilă.",serverVersionNotSupported:"Serverul AliasVault trebuie actualizat la o versiune mai nouă pentru a folosi această extensie. Contactează asistența pentru ajutor.",serverVersionTooOld:"Serverul AliasVault trebuie actualizat la o versiune mai nouă pentru a folosi această funcție. Contactează administratorul serverului.",unknownError:"A apărut o eroare necunoscută",unknownErrorTryAgain:"A apărut o eroare necunoscută. Încearcă din nou.",vaultNotAvailable:"Seiful nu este disponibil",vaultIsLocked:"Seiful este blocat",passwordChanged:"Parola ta a fost schimbată de la ultima autentificare. Autentifică-te din nou din motive de securitate.",syncConflictMaxRetries:"Sincronizarea seifului a eșuat după mai multe încercări. Reîncearcă mai târziu.",mergeFailed:"Îmbinarea modificărilor seifului a eșuat. Încearcă din nou."},apiErrors:{UNKNOWN_ERROR:"A apărut o eroare necunoscută. Încearcă din nou.",ACCOUNT_LOCKED:"Cont blocat temporar din cauza prea multor încercări eșuate. Reîncearcă mai târziu.",ACCOUNT_BLOCKED:"Contul tău a fost dezactivat. Dacă crezi că este o greșeală, contactează asistența.",USER_NOT_FOUND:"Utilizator sau parolă invalidă. Încearcă din nou.",INVALID_AUTHENTICATOR_CODE:"Cod de autentificare invalid. Încearcă din nou.",INVALID_RECOVERY_CODE:"Cod de recuperare invalid. Încearcă din nou.",REFRESH_TOKEN_REQUIRED:"Este necesar un token de actualizare.",INVALID_REFRESH_TOKEN:"Token de actualizare nevalid.",PUBLIC_REGISTRATION_DISABLED:"Înregistrarea conturilor noi este dezactivată pe acest server. Contactează administratorul.",USERNAME_REQUIRED:"Numele de utilizator este obligatoriu.",USERNAME_ALREADY_IN_USE:"Numele de utilizator este deja folosit.",USERNAME_AVAILABLE:"Numele de utilizator este disponibil.",USERNAME_MISMATCH:"Numele de utilizator nu se potrivește cu utilizatorul curent.",PASSWORD_MISMATCH:"Parola furnizată nu se potrivește cu parola ta curentă.",ACCOUNT_SUCCESSFULLY_DELETED:"Cont șters cu succes.",USERNAME_EMPTY_OR_WHITESPACE:"Numele de utilizator nu poate fi gol sau format doar din spații goale.",USERNAME_TOO_SHORT:"Nume prea scurt: trebuie să aibă cel puțin 3 caractere.",USERNAME_TOO_LONG:"Nume prea lung: nu poate depăși 40 de caractere.",USERNAME_INVALID_EMAIL:"Adresă de e-mail invalidă.",USERNAME_INVALID_CHARACTERS:"Numele de utilizator este invalid, poate conține doar litere sau cifre.",VAULT_NOT_UP_TO_DATE:"Seiful nu este la zi. Sincronizează seiful și încearcă din nou.",INTERNAL_SERVER_ERROR:"Eroare internă de server.",VAULT_ERROR:"Seiful local nu este la zi. Sincronizează seiful reîncărcând pagina."}},w1={or:"sau",new:"Nou",vaultLocked:"AliasVault este blocat.",creatingNewAlias:"Se creează un alias nou...",noMatchesFound:"Nicio potrivire găsită",searchVault:"Caută în seif...",enterServiceName:"Introdu numele serviciului",enterEmailAddress:"Introdu adresa de e-mail",enterUsername:"Introdu numele de utilizator",hideFor1Hour:"Ascunde pentru 1 oră (site-ul curent)",hidePermanently:"Ascunde definitiv (site-ul curent)",createRandomAlias:"Creează un alias aleatoriu",createUsernamePassword:"Creează utilizator/parolă",randomAlias:"Alias aleatoriu",usernamePassword:"Utilizator/parolă",createAndSaveAlias:"Creează și salvează alias",createAndSaveCredential:"Creează și salvează datele de autentificare",randomIdentityDescription:"Generează o identitate aleatorie cu o adresă de e-mail aleatorie accesibilă în AliasVault.",randomIdentityDescriptionDropdown:"Identitate aleatorie cu e-mail aleatoriu",manualCredentialDescription:"Specifică propria adresă de e-mail și numele de utilizator.",manualCredentialDescriptionDropdown:"Nume de utilizator și parolă introduse manual",failedToCreateIdentity:"Eșec la crearea identității. Încearcă din nou.",enterEmailAndOrUsername:"Introdu adresa de e-mail și/sau numele de utilizator",autofillWithAliasVault:"Completare automată cu AliasVault",generateRandomPassword:"Generează parolă aleatorie (copiază în clipboard)",generateNewPassword:"Generează parolă nouă",togglePasswordVisibility:"Comută vizibilitatea parolei",passwordCopiedToClipboard:"Parolă copiată în clipboard",openAliasVaultToUpgrade:"Deschide AliasVault pentru actualizare",vaultUpgradeRequired:"Este necesară actualizarea seifului.",dismissPopup:"Închide fereastra"},C1={title:"Elemente",itemName:"Nume",loginCredentials:"Date de autentificare",cardInformation:"Informații Card",addItem:"Adaugă element",addNewItem:"Adaugă element nou",saveItem:"Salvează element",itemDetails:"Detalii element",editItem:"Editează element",untitled:"Fără titlu",newFolder:"Dosar nou",createFolder:"Creează dosar",editFolder:"Editează dosarul",folderName:"Nume dosar",folderNameRequired:"Numele dosarului este obligatoriu",folder:"Dosar",welcomeTitle:"Bun venit în AliasVault!",welcomeDescription:"Pentru a utiliza extensia de browser AliasVault: accesează un site web și folosește fereastra pop-up de completare automată AliasVault pentru a crea noi date de autentificare.",noPasskeysFound:"Nu a fost creat niciun passkey încă. Passkey-urile sunt create vizitând site-uri care oferă această metodă de autentificare.",noAttachmentsFound:"Nu s-au găsit elemente cu atașamente",noItemsOfTypeFound:"Nu s-au găsit elemente de tip {{type}}",noMatchingItems:"Nu s-au găsit elemente care să se potrivească",noMatchingItemsSearch:"Nu s-au găsit elemente pentru „{{search}}”",noMatchingItemsWithFilter:"Niciun element {{filter}} nu se potrivește cu „{{search}}”",clearSearch:"Șterge căutarea",clearFilter:"Șterge filtrul",emptyFolderHint:"Acest dosar este gol. Pentru a muta elemente aici, editează elementul și apasă pe pictograma folderului din câmpul de nume.",allItemsInFolders:"Toate elementele tale sunt organizate în dosare. Apasă pe un dosar de mai sus pentru a vizualiza datele de autentificare sau folosește căutarea pentru a găsi elemente specifice.",deleteFolder:"Șterge dosarul",deleteFolderKeepItems:"Șterge doar dosarul",deleteFolderKeepItemsDescription:"Elementele vor fi mutate înapoi în lista principală.",deleteFolderAndItems:"Șterge dosarul și toate elementele",deleteFolderAndItemsDescription:"{{count}} element(e) vor fi mutate la Șterse Recent.",filters:{all:"(Toate) Elementele",passkeys:"Passkeys"},deleteItemTitle:"Șterge element",deleteItemConfirm:"Sigur vrei să ștergi acest element?",viewHistory:"Vezi istoric",history:"Istoric",noHistoryAvailable:"Niciun istoric disponibil",tags:"Etichete",changePasswordComplexity:"Schimbă complexitatea parolei",passwordLength:"Lungime parolă",includeLowercase:"Include litere mici",includeUppercase:"Include litere mari",includeNumbers:"Include cifre",includeSpecialChars:"Include caractere speciale",avoidAmbiguousChars:"Evită caracterele ambigue (o, 0, etc.)",privateEmailTitle:"E-mail Privat",privateEmailAliasVaultServer:"Server AliasVault",privateEmailDescription:"Criptat E2E, complet privat.",publicEmailTitle:"Furnizori Publici de E-mail Temporar",publicEmailDescription:"Anonim, dar cu confidențialitate limitată. Conținutul poate fi citit de oricine cunoaște adresa.",validation:{required:"Acest câmp este obligatoriu"}},N1={selectType:"Adaugă element nou",typeLabel:"Tip element",creating:"Creare",editing:"Editare",regenerateAlias:"Regenerează alias",addCustomField:"Adaugă câmp personalizat",fieldLabel:"Etichetă câmp",enterFieldName:"Introdu numele câmpului",fieldType:"Tip câmp",fieldTypes:{text:"Text",hidden:"Ascuns (text mascat)",email:"E-mail",url:"URL",phone:"Telefon",number:"Număr",date:"Dată",textArea:"Zonă text"},login:{title:"Autentificare"},alias:{title:"Alias"},creditCard:{title:"Card de credit"},note:{title:"Notă securizată"}},x1={"login.url":"URL Website","login.username":"Utilizator","login.password":"Parolă","alias.first_name":"Prenume","alias.last_name":"Nume","alias.gender":"Gen","alias.birthdate":"Data nașterii","login.email":"E-mail","notes.content":"Note","card.cardholder_name":"Nume Titular","card.number":"Număr card","card.expiry_month":"Lună expirare","card.expiry_year":"An expirare","card.cvv":"CVV","card.pin":"PIN"},T1={addCode:"Adaugă cod 2FA",instructions:"Introdu cheia secretă afișată de site-ul unde dorești să activezi autentificarea cu doi factori.",nameOptional:"Nume (opțional)",secretKey:"Cheie Secretă",saveToViewCode:"Salvează pentru a vedea codul",defaultName:"Authenticator",errors:{invalidSecretKey:"Format cheie secretă invalid."}},S1={uploading:"Se încarcă...",uploadSuccess:"Fișiere încărcate cu succes.",deleteSuccess:"Atașament șters cu succes.",firefoxExpandRequired:"Pentru a încărca fișiere, folosește fereastra extinsă.",openExpandedWindow:"Deschide fereastra extinsă"},k1={title:"E-mailuri",deleteEmailTitle:"Șterge e-mail",deleteEmailConfirm:"Sigur vrei să ștergi definitiv acest e-mail?",from:"De la",to:"Către",date:"Data",emailContent:"Conținut e-mail",emailNotFound:"E-mailul nu a fost găsit",noEmails:"Nu s-au găsit e-mailuri",noEmailsDescription:"Nu ai primit încă niciun e-mail pe adresele tale private. Atunci când vei primi un e-mail nou, acesta va apărea aici.",offlineMessage:"Sunteți offline. Conectează-te la internet pentru a încărca e-mailurile.",dateFormat:{justNow:"acum",minutesAgo_single:"{{count}} minut în urmă",minutesAgo_plural:"{{count}} minute în urmă",hoursAgo_single:"{{count}} oră în urmă",hoursAgo_plural:"{{count}} ore în urmă",yesterday:"ieri"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Adresa de e-mail aleasă este deja utilizată. Schimbă adresa de e-mail prin editarea acestor date de autentificare.",CLAIM_DOES_NOT_EXIST:"A apărut o eroare la încărcarea e-mailurilor. Editează și salvează datele de autentificare pentru a sincroniza baza de date, apoi încearcă din nou."}},L1={serverUrl:"URL Server",language:"Limbă",autofillEnabled:"Activează completarea automată",version:"Versiune",openWebApp:"Deschide aplicația web",lock:"Blocați",globalSettings:"Setări Globale",autofillPopup:"Fereastra de completare automată",activeOnAllSites:"Activă pe toate site-urile (cu excepțiile de mai jos)",disabledOnAllSites:"Dezactivat pe toate site-urile",rightClickContextMenu:"Meniu contextual (clic dreapta)",autofillMatching:"Potrivire completare automată",autofillMatchingMode:"Mod de potrivire a completării automate",autofillMatchingModeDescription:"Determină care date de autentificare sunt considerate potrivite și afișate ca sugestii în fereastra de completare automată pentru un anumit site web.",autofillMatchingDefault:"URL + subdomeniu + nume (wildcard)",autofillMatchingUrlSubdomain:"URL + subdomeniu",autofillMatchingUrlExact:"Doar domeniul exact al URL-ului",siteSpecificSettings:"Setări specifice site-ului",autofillPopupOn:"Fereastra de completare automată pe: ",enabledForThisSite:"Activat pentru acest site",disabledForThisSite:"Dezactivat pentru acest site",temporarilyDisabledUntil:"Dezactivat temporar până la ",resetAllSiteSettings:"Resetează toate setările specifice site-ului",appearance:"Aspect",theme:"Temă",useDefault:"Implicită",light:"Luminoasă",dark:"Întunecată",keyboardShortcuts:"Comenzi rapide de tastatură",configureKeyboardShortcuts:"Configurează comenzile rapide de la tastatură",configure:"Configurează",clipboardClearTimeout:"Golește clipboardul după copiere",clipboardClearTimeoutDescription:"Golește automat clipboardul după copierea datelor sensibile",clipboardClearDisabled:"Niciodată",clipboardClear5Seconds:"După 5 secunde",clipboardClear10Seconds:"După 10 secunde",clipboardClear15Seconds:"După 15 secunde",autoLockTimeout:"Interval auto-blocare",autoLockTimeoutDescription:"Blocați automat seiful după o perioadă de inactivitate",autoLockTimeoutHelp:"Seiful se va bloca doar după perioada de inactivitate specificată (fără completare automată sau deschiderea extensiei). Seiful se va bloca întotdeauna la închiderea browserului.",autoLockNever:"Niciodată",autoLock15Seconds:"15 secunde",autoLock1Minute:"1 minut",autoLock5Minutes:"5 minute",autoLock15Minutes:"15 minute",autoLock30Minutes:"30 minute",autoLock1Hour:"1 oră",autoLock4Hours:"4 ore",autoLock8Hours:"8 ore",autoLock24Hours:"24 ore",versionPrefix:"Versiune ",autofillSettings:"Setări completare automată",clipboardSettings:"Setări clipboard",contextMenuSettings:"Setări meniu contextual",passkeySettings:"Setări passkey",contextMenu:"Meniu Contextual",contextMenuEnabled:"Meniul contextual este activat",contextMenuDisabled:"Meniul contextual este dezactivat",contextMenuDescription:"Clic dreapta pe câmpurile de introducere pentru a accesa opțiunile AliasVault",selectLanguage:"Selectați limba",serverConfiguration:"Configurare Server",serverConfigurationDescription:"Configurează URL-ul serverului AliasVault pentru instanțele self-hosted",customApiUrl:"URL API",customClientUrl:"URL Client",apiUrlHint:"URL-ul endpoint-ului API (de obicei URL client + /api)",clientUrlHint:"URL-ul interfeței web a instanței tale",autofillSettingsDescription:"Activează sau dezactivează fereastra de completare automată",autofillEnabledDescription:"Sugestiile de completare automată vor apărea în câmpurile de autentificare",autofillDisabledDescription:"Sugestiile sunt dezactivate global",languageSettings:"Limbă",validation:{apiUrlRequired:"URL-ul API este obligatoriu",apiUrlInvalid:"Introdu un URL API valid",clientUrlRequired:"URL-ul Client este obligatoriu",clientUrlInvalid:"Introdu un URL Client valid"},unlockMethod:{title:"Metodă deblocare seif",introText:"Alege cum dorești să îți deblochezi seiful. Poți folosi parola principală (întotdeauna disponibilă) sau poți configura un cod PIN pentru acces rapid. După 3 încercări eșuate ale PIN-ului, va trebui să folosești parola principală.",password:"Parolă principală",pin:"Cod PIN",pinDescription:"Deblochează seiful cu codul PIN",setupPin:"Configurează Cod PIN",enterNewPinDescription:"Introdu un cod PIN de cel puțin 6 cifre",confirmPin:"Confirmă PIN",confirmPinDescription:"Introdu PIN-ul din nou pentru confirmare",invalidPinFormat:"Format PIN invalid",pinMismatch:"PIN-urile nu se potrivesc",incorrectPin:"PIN incorect. {{attemptsRemaining}} încercări rămase.",incorrectPinSingular:"PIN incorect. 1 încercare rămasă.",enableSuccess:"Deblocarea prin PIN a fost activată!",pinLocked:"Deblocarea prin PIN a fost dezactivată. Folosește parola principală.",pinSecurityWarning:"Deblocarea prin PIN în extensia de browser poate fi mai puțin sigură decât parola principală. PIN-urile au o entropie mai scăzută, fiind vulnerabile la atacuri de tip brute-force dacă dispozitivul este compromis. Folosește-o doar pe dispozitive în care ai încredere deplină."}},R1={passkey:"Passkey",site:"Site",helpText:"Passkey-urile sunt create pe site-uri când este solicitat. Nu pot fi editate manual. Pentru a înlocui un passkey, vizitează site-ul respectiv.",passkeyMarkedForDeletion:"Passkey marcat pentru ștergere",passkeyWillBeDeleted:"Acest passkey va fi șters atunci când salvezi aceste date de autentificare.",useBrowserPasskey:"Folosește Passkey-ul Browserului",bypass:{description:"Cât timp dorești să folosești furnizorul de passkey al browserului pentru {{origin}}?",thisTimeOnly:"Doar de data aceasta",alwaysForSite:"Întotdeauna pentru acest site"},authenticate:{title:"Autentificare cu Passkey",signInFor:"Autentificare cu passkey pentru",selectPasskey:"Selectați un passkey pentru autentificare:",noPasskeysFound:"Nu s-au găsit passkey-uri pentru acest site"},create:{title:"Creează Passkey",createFor:"Creează un passkey nou pentru",titleLabel:"Titlu",titlePlaceholder:"Introdu un nume pentru acest passkey",createButton:"Creează Passkey",selectPasskeyToReplace:"Selectați un passkey pentru a-l înlocui:",createNewPasskey:"Creează Passkey Nou",replacingPasskey:"Se înlocuiește passkey-ul: {{displayName}}",confirmReplace:"Confirmă Înlocuirea",selectExistingLogin:"Adaugă la o autentificare existentă:",selectExistingLoginDescription:"Atașează acest passkey unor date de autentificare existente pentru acest site.",attachingToCredential:"Se adaugă passkey-ul la: {{serviceName}}",attachPasskey:"Adaugă Passkey"},settings:{passkeyProvider:"Furnizor Passkey",passkeyProviderOn:"Furnizor Passkey pe "}},D1={title:"Șterse Recent",noItems:"Niciun element șters",noItemsDescription:"Elementele șterse vor apărea aici timp de 30 de zile înainte de a fi eliminate definitiv.",description:"Aceste elemente vor fi șterse definitiv după 30 de zile. Le poți restaura sau șterge imediat.",restore:"Restaurează",deletePermanently:"Șterge Definitiv",emptyAll:"Golește tot",daysRemaining_one:"{{count}} zi rămasă",daysRemaining_other:"{{count}} zile rămase",expiringSoon:"Expiră curând",confirmDeleteTitle:"Ștergi Definitiv?",confirmDeleteMessage:"Acest element va fi șters definitiv și nu va putea fi recuperat.",confirmEmptyAllTitle:"Golești elementele șterse recent?",confirmEmptyAllMessage:"Toate cele {{count}} elemente vor fi șterse definitiv și nu vor putea fi recuperate."},B1={title:"Actualizare Seif",subtitle:"AliasVault s-a actualizat și seiful tău trebuie actualizat. Aceasta va dura doar câteva secunde.",versionInformation:"Informații Versiune",yourVault:"Versiunea seifului tău:",newVersion:"Versiune nouă disponibilă:",upgrade:"Actualizează Seiful",upgrading:"Se actualizează...",whatsNew:"Ce este nou",whatsNewDescription:"Este necesară o actualizare pentru a permite următoarele modificări:",noDescriptionAvailable:"Nicio descriere disponibilă pentru această versiune.",alerts:{unableToGetVersionInfo:"Informațiile despre versiune nu au putut fi obținute. Reîncearcă.",selfHostedServer:"Server Self-Hosted",selfHostedWarning:"Dacă folosești un server self-hosted, asigură-te că actualizezi și instanța serverului, altfel autentificarea în clientul web nu va mai funcționa.",continueUpgrade:"Continuă Actualizarea",upgradeFailed:"Actualizare Eșuată",failedToApplyMigration:"Eșec la aplicarea migrării ({{current}} din {{total}})"}},U1={unsyncedChangesTitle:"Modificări Nesincronizate",unsyncedChangesWarning:"Ai modificări nesincronizate care se vor pierde dacă te deconectezi acum. Sigur vrei să continui?",logoutAnyway:"Deconectează-te oricum"},_1={auth:b1,menu:I1,common:v1,content:w1,items:C1,itemTypes:N1,fieldLabels:x1,totp:T1,attachmentUploader:S1,emails:k1,settings:L1,passkeys:R1,recentlyDeleted:D1,upgrade:B1,logout:U1},M1={loginTitle:"Войдите в AliasVault",username:"Имя пользователя или почта",usernamePlaceholder:"имя / имя@company.com",passwordPlaceholder:"Введите ваш пароль",rememberMe:"Запомнить меня",loginButton:"Войти",noAccount:"Нет аккаунта?",createVault:"Создать новое хранилище",twoFactorTitle:"Пожалуйста, введите код аутентификации из вашего приложения-аутентификатора.",authCode:"Код аутентификации",authCodePlaceholder:"Введите 6-значный код",verify:"Проверить",twoFactorNote:"Примечание: если у вас нет доступа к устройству аутентификации, вы можете сбросить ваш 2FA с помощью кода восстановления, войдя в систему через сайт.",masterPassword:"Мастер пароль",unlockVault:"Разблокировать",unlockWithPin:"Разблокировать ПИН-кодом\uFEFF",enterPinToUnlock:"Введите ПИН-код для разблокировки хранилища",useMasterPassword:"Использовать мастер-пароль",unlockTitle:"Разблокировать ваше хранилище",logoutConfirm:"Вы уверены, что хотите выйти?",unlockSuccessTitle:"Ваше хранилище успешно разблокировано",unlockSuccessDescription:"Теперь вы можете использовать автозаполнение форм входа в Вашем браузере.",closePopup:"Закрыть окно",browseVault:"Обзор содержимого хранилища",connectingTo:"Подключение к",switchAccounts:"Переключить аккаунт?",loginWithMobile:"Войти с помощью мобильного приложения",unlockWithMobile:"Разблокировать через мобильное приложение",scanQrCode:"Сканируйте QR-код в приложении AliasVault, чтобы войти.",errors:{invalidCode:"Пожалуйста, введите правильный 6-значный код аутентификации.",serverError:"Не удалось подключиться к серверу AliasVault. Пожалуйста, повторите попытку позже или обратитесь в службу поддержки, если проблема не устранится.",wrongPassword:"Неверный пароль. Пожалуйста, повторите попытку.",sessionExpired:"Время сеанса истекло. Пожалуйста, войдите снова.",mobileLoginRequestExpired:"Истекло время ожидания входа. Перезагрузите страницу и повторите попытку."}},F1={vault:"Хранилище",emails:"Почта"},O1={loading:"Загрузка...",notice:"Примечание",error:"Ошибка",cancel:"Отмена",confirm:"Подтвердить",back:"Назад",next:"Далее",use:"Использовать",add:"Добавить",delete:"Удалить",undo:"Отменить",save:"Сохранить",saving:"Сохраняем...",create:"Создать",or:"Или",close:"Закрыть",logout:"Выйти",copied:"Скопировано!",openInNewWindow:"Открыть в новом окне",enabled:"Включено",disabled:"Отключено",showPassword:"Показать пароль",hidePassword:"Скрыть пароль",showDetails:"Показать подробности",hideDetails:"Скрыть подробности",copyToClipboard:"Скопировать в буфер обмена",loadingEmails:"Загрузка писем...",loadingTotpCodes:"Загрузка TOTP кодов...",attachments:"Вложения",loadingAttachments:"Загрузка вложений...",settings:"Настройки",recentEmails:"Последние письма",credentials:"Учетные записи",customFields:"Пользовательские поля",twoFactorAuthentication:"Двухфакторная аутентификация",alias:"Псевдоним",notes:"Заметки",email:"Электронная почта",username:"Имя пользователя",password:"Пароль",generate:"Сгенерировать",serviceName:"Название сервиса",loggedIn:"Вход выполнен",syncingVault:"Синхронизация хранилища",checkingVaultUpdates:"Проверка наличия обновлений в хранилище",syncingUpdatedVault:"Синхронизация обновленного хранилища",loadMore:"Загрузить ещё",offline:"Офлайн",offlineMode:"Работа в автономном режиме",pendingSync:"Синхронизация...",mergingVaultChanges:"Объединение изменений в хранилище...",uploadingVault:"Загрузка хранилища...",errors:{serverNotAvailable:"Сервер AliasVault недоступен. Пожалуйста, повторите попытку позже или обратитесь в службу поддержки, если проблема не устранится.",clientVersionNotSupported:"Эта версия браузерного расширения AliasVault больше не поддерживается сервером. Пожалуйста, обновите расширение вашего браузера до последней версии.",browserExtensionOutdated:"Это расширение браузера устарело и не может быть использовано для доступа к этому хранилищу. Пожалуйста, обновите расширение, чтобы продолжить.",serverVersionNotSupported:"Чтобы использовать это расширение для браузера, сервер AliasVault необходимо обновить до более новой версии. Пожалуйста, обратитесь в службу поддержки, если вам нужна помощь.",serverVersionTooOld:"Сервер AliasVault необходимо обновить до более новой версии, чтобы использовать эту функцию. Если вам нужна помощь, обратитесь к администратору сервера.",unknownError:"Произошла неизвестная ошибка",unknownErrorTryAgain:"Произошла неизвестная ошибка. Попробуйте снова.",vaultNotAvailable:"Хранилище недоступно",vaultIsLocked:"Хранилище заблокировано",passwordChanged:"С момента вашего последнего входа ваш пароль изменился. Пожалуйста, войдите еще раз в целях безопасности.",syncConflictMaxRetries:"Ошибка синхронизации хранилища. Повторите попытку позже.",mergeFailed:"Не удалось объединить изменения. Попробуйте снова."},apiErrors:{UNKNOWN_ERROR:"Произошла неизвестная ошибка. Пожалуйста, попробуйте снова.",ACCOUNT_LOCKED:"Учетная запись временно заблокирована из-за слишком большого количества неудачных попыток. Пожалуйста, повторите попытку позже.",ACCOUNT_BLOCKED:"Ваша учетная запись была заблокирована. Если вы считаете, что это ошибка, пожалуйста, свяжитесь со службой поддержки.",USER_NOT_FOUND:"Неверное имя пользователя или пароль. Пожалуйста, попробуйте снова.",INVALID_AUTHENTICATOR_CODE:"Неверный код аутентификатора. Пожалуйста, попробуйте снова.",INVALID_RECOVERY_CODE:"Неверный код восстановления. Пожалуйста, попробуйте снова.",REFRESH_TOKEN_REQUIRED:"Требуется токен обновления.",INVALID_REFRESH_TOKEN:"Недопустимый токен обновления.",PUBLIC_REGISTRATION_DISABLED:"В настоящее время регистрация новой учетной записи на этом сервере отключена. Пожалуйста, свяжитесь с администратором.",USERNAME_REQUIRED:"Требуется ввести имя пользователя.",USERNAME_ALREADY_IN_USE:"Имя пользователя уже используется.",USERNAME_AVAILABLE:"Имя пользователя доступно.",USERNAME_MISMATCH:"Имя пользователя не соответствует текущему пользователю.",PASSWORD_MISMATCH:"Указанный пароль не совпадает с вашим текущим паролем.",ACCOUNT_SUCCESSFULLY_DELETED:"Аккаунт успешно удалена.",USERNAME_EMPTY_OR_WHITESPACE:"Имя пользователя не может быть пустым или через пробел.",USERNAME_TOO_SHORT:"Слишком короткое имя пользователя: должно быть не менее 3-х символов.",USERNAME_TOO_LONG:"Слишком длинное имя пользователя: оно не может быть длиннее 40 символов.",USERNAME_INVALID_EMAIL:"Неверный адрес электронной почты.",USERNAME_INVALID_CHARACTERS:"Имя пользователя неверно, может содержать только буквы или цифры.",VAULT_NOT_UP_TO_DATE:"Ваше хранилище не обновлено. Пожалуйста, синхронизируйте ваше хранилище и повторите попытку.",INTERNAL_SERVER_ERROR:"Внутренняя ошибка сервера.",VAULT_ERROR:"Локальное хранилище не обновлено. Пожалуйста, синхронизируйте ваше хранилище, обновив страницу, и повторите попытку."}},j1={or:"или",new:"Новый",vaultLocked:"AliasVault заблокирован.",creatingNewAlias:"Создание нового псевдонима...",noMatchesFound:"Совпадений не найдено",searchVault:"Поиск хранилища...",enterServiceName:"Введите имя сервиса",enterEmailAddress:"Введите адрес электронной почты",enterUsername:"Введите имя пользователя",hideFor1Hour:"Скрыть на 1 час (текущий сайт)",hidePermanently:"Скрыть навсегда (текущий сайт)",createRandomAlias:"Создать случайный псевдоним",createUsernamePassword:"Создайте имя пользователя/пароль",randomAlias:"Случайный псевдоним",usernamePassword:"Имя пользователя/пароль",createAndSaveAlias:"Создать и сохранить псевдоним",createAndSaveCredential:"Создать и сохранить учетные данные",randomIdentityDescription:"Сгенерировать случайную личность со случайным адресом электронной почты, доступным в AliasVault.",randomIdentityDescriptionDropdown:"Случайная личность со случайным адресом электронной почты",manualCredentialDescription:"Укажите свой собственный адрес электронной почты и имя пользователя.",manualCredentialDescriptionDropdown:"Ручной ввод имени пользователя и пароля",failedToCreateIdentity:"Не удалось создать личность. Пожалуйста, попробуйте снова.",enterEmailAndOrUsername:"Введите адрес электронной почты и/или имя пользователя",autofillWithAliasVault:"Автозаполнение с помощью AliasVault",generateRandomPassword:"Сгенерировать случайный пароль (скопировать в буфер обмена)",generateNewPassword:"Сгенерировать новый пароль",togglePasswordVisibility:"Переключение видимости пароля",passwordCopiedToClipboard:"Пароль скопирован в буфер обмена",openAliasVaultToUpgrade:"Откройте AliasVault для обновления",vaultUpgradeRequired:"Требуется обновление хранилища.",dismissPopup:"Закрыть окно"},P1={title:"Записи",itemName:"Имя",loginCredentials:"Учетные данные для авторизации",cardInformation:"Данные карты",addItem:"Добавить запись",addNewItem:"Добавить запись",saveItem:"Сохранить запись",itemDetails:"Детали записи",editItem:"Редактировать запись",untitled:"Без названия",newFolder:"Новая папка",createFolder:"Создать папку",editFolder:"Изменить папку",folderName:"Название папки",folderNameRequired:"Название папки обязательно",folder:"Папка",welcomeTitle:"Добро пожаловать в AliasVault!",welcomeDescription:"Чтобы использовать браузерное расширение AliasVault: перейдите на сайт и используйте всплывающее окно автозаполнения AliasVault для создания новых учетных данных.",noPasskeysFound:"Ключи доступа еще не созданы. Ключи доступа создаются при посещении веб-сайта, который предлагает их в качестве метода аутентификации.",noAttachmentsFound:"Элементы с вложениями не найдены",noItemsOfTypeFound:"Элементы типа «{{type}}» не найдены",noMatchingItems:"Совпадений не найдено",noMatchingItemsSearch:'По запросу "{{search}}" ничего не найдено',noMatchingItemsWithFilter:'Ничего не найдено в "{{filter}}" по запросу "{{search}}"',clearSearch:"Очистить поиск",clearFilter:"Сбросить фильтр",emptyFolderHint:"Эта папка пуста. Чтобы переместить сюда записи, перейдите в режим редактирования записи и нажмите на иконку папки в поле имени.",allItemsInFolders:"Все ваши данные разложены по папкам. Выберите нужную папку выше или воспользуйтесь поиском, чтобы найти конкретную запись.",deleteFolder:"Удалить папку",deleteFolderKeepItems:"Удалить только папку",deleteFolderKeepItemsDescription:"Элементы будут перемещены обратно в основной список.",deleteFolderAndItems:"Удалить папку и все элементы",deleteFolderAndItemsDescription:"{{count}} объект(ов) будет перемещено в раздел «Недавно удалённые».",filters:{all:"(Все) Записи",passkeys:"Ключи доступа"},deleteItemTitle:"Удалить элемент",deleteItemConfirm:"Вы уверены, что хотите удалить этот элемент?",viewHistory:"Посмотреть историю",history:"История",noHistoryAvailable:"История пока пуста",tags:"Теги",changePasswordComplexity:"Изменить сложность пароля",passwordLength:"Длина пароля",includeLowercase:"Включить строчные буквы",includeUppercase:"Включить заглавные буквы",includeNumbers:"Включить числа",includeSpecialChars:"Включить специальные символы",avoidAmbiguousChars:"Избегать двусмысленных символов (o, 0 и т.д.)",privateEmailTitle:"Личная электронная почта",privateEmailAliasVaultServer:"Сервер AliasVault",privateEmailDescription:"Шифрование E2E, полностью приватный.",publicEmailTitle:"Общедоступные временные поставщики электронной почты",publicEmailDescription:"Анонимность, но ограниченная конфиденциальность. Содержимое письма может прочитать любой, кому известен адрес.",validation:{required:"Это поле является обязательным"}},H1={selectType:"Добавить новую запись",typeLabel:"Тип записи",creating:"Создание",editing:"Редактирование",regenerateAlias:"Перегенерировать псевдоним",addCustomField:"Добавить свое поле",fieldLabel:"Название поля",enterFieldName:"Введите название поля",fieldType:"Тип поля",fieldTypes:{text:"Текст",hidden:"Скрыто (маскированный текст)",email:"Почта",url:"URL",phone:"Телефон",number:"Номер",date:"Дата",textArea:"Текстовая область"},login:{title:"Логин"},alias:{title:"Псевдоним"},creditCard:{title:"Банковская карта"},note:{title:"Защищенная заметка"}},Q1={"login.url":"URL веб-сайта","login.username":"Логин","login.password":"Пароль","alias.first_name":"Имя","alias.last_name":"Фамилия","alias.gender":"Пол","alias.birthdate":"Дата рождения","login.email":"Почта","notes.content":"Примечание","card.cardholder_name":"Имя держателя карты","card.number":"Номер карты","card.expiry_month":"Месяц окончания","card.expiry_year":"Год окончания","card.cvv":"CVV-код","card.pin":"PIN"},z1={addCode:"Добавить код 2FA",instructions:"Введите секретный ключ, указанный на веб-сайте, где вы хотите добавить двухфакторную аутентификацию.",nameOptional:"Имя (необязательно)",secretKey:"Секретный ключ",saveToViewCode:"Сохранить для просмотра кода",defaultName:"Аутентификатор",errors:{invalidSecretKey:"Неверный формат секретного ключа."}},V1={uploading:"Загрузка...",uploadSuccess:"Файлы успешно загружены.",deleteSuccess:"Вложение успешно удалено.",firefoxExpandRequired:"Для загрузки файлов используйте расширенное окно.",openExpandedWindow:"Открыть расширенное окно"},K1={title:"Письма",deleteEmailTitle:"Удалить письмо",deleteEmailConfirm:"Вы уверены, что хотите навсегда удалить это письмо?",from:"От",to:"К",date:"Дата",emailContent:"Содержимое письма",emailNotFound:"Адрес электронной почты не найден",noEmails:"Электронные письма не найдены",noEmailsDescription:"Вы еще не получали никаких электронных писем на свои личные адреса электронной почты. Когда вы получите новое электронное письмо, оно появится здесь.",offlineMessage:"Вы не в сети. Пожалуйста, подключитесь к Интернету, чтобы загрузить свои электронные письма.",dateFormat:{justNow:"прямо сейчас",minutesAgo_single:"{{count}} мин назад",minutesAgo_plural:"{{count}} минут назад",hoursAgo_single:"{{count}} часов назад",hoursAgo_plural:"{{count}} часов назад",yesterday:"вчера"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Текущий выбранный адрес электронной почты уже используется. Пожалуйста, измените адрес электронной почты, отредактировав эти учетные данные.",CLAIM_DOES_NOT_EXIST:"При попытке загрузить письма произошла ошибка. Пожалуйста, попробуйте отредактировать и сохранить данные для синхронизации базы данных, затем повторите попытку."}},G1={serverUrl:"URL-адрес сервера",language:"Язык",autofillEnabled:"Включить автозаполнение",version:"Версия",openWebApp:"Открыть веб-приложение",lock:"Заблокировать",globalSettings:"Глобальные настройки",autofillPopup:"Всплывающее окно автозаполнения",activeOnAllSites:"Активен на всех сайтах (если не отключен ниже)",disabledOnAllSites:"Отключено на всех сайтах",rightClickContextMenu:"Контекстное меню правым щелчком мыши",autofillMatching:"Соответствие автозаполнения",autofillMatchingMode:"Режим сопоставления автозаполнения",autofillMatchingModeDescription:"Определяет, какие учетные данные считаются соответствующими и отображаются в качестве предложений во всплывающем окне автозаполнения для данного веб-сайта.",autofillMatchingDefault:"URL + поддомен + подстановочный знак в названии",autofillMatchingUrlSubdomain:"URL + поддомен",autofillMatchingUrlExact:"Только точный URL-адрес домена",siteSpecificSettings:"Настройки для конкретного сайта",autofillPopupOn:"Всплывающее окно автозаполнения: ",enabledForThisSite:"Включено для этого сайта",disabledForThisSite:"Отключено для этого сайта",temporarilyDisabledUntil:"Временно отключен до тех пор, пока",resetAllSiteSettings:"Сбросить все настройки для сайтов",appearance:"Внешний вид",theme:"Тема",useDefault:"Использовать по умолчанию",light:"Светлая",dark:"Темная",keyboardShortcuts:"Горячие клавиши",configureKeyboardShortcuts:"Настройка горячих клавиш",configure:"Настройка",clipboardClearTimeout:"Очистить буфер обмена после копирования",clipboardClearTimeoutDescription:"Автоматическая очистка буфера обмена после копирования конфиденциальных данных",clipboardClearDisabled:"Никогда не очищать",clipboardClear5Seconds:"Очистка через 5 секунд",clipboardClear10Seconds:"Очистка через 10 секунд",clipboardClear15Seconds:"Очистка через 15 секунд",autoLockTimeout:"Тайм-аут автоматической блокировки",autoLockTimeoutDescription:"Автоматическая блокировка хранилища после некоторого периода бездействия",autoLockTimeoutHelp:"Хранилище будет заблокировано только по истечении указанного периода бездействия (не будет использоваться функция автозаполнения или не откроется всплывающее окно с расширением). Хранилище всегда будет заблокировано при закрытии браузера, независимо от этого параметра.",autoLockNever:"Никогда",autoLock15Seconds:"15 секунд",autoLock1Minute:"1 минута",autoLock5Minutes:"5 минут",autoLock15Minutes:"15 минут",autoLock30Minutes:"30 минут",autoLock1Hour:"1 час",autoLock4Hours:"4 часа",autoLock8Hours:"8 часов",autoLock24Hours:"24 часов",versionPrefix:"Версия ",autofillSettings:"Настройки автозаполнения",clipboardSettings:"Настройки буфера обмена",contextMenuSettings:"Настройки контекстного меню",passkeySettings:"Настройки ключа доступа",contextMenu:"Контекстное меню",contextMenuEnabled:"Контекстное меню включено",contextMenuDisabled:"Контекстное меню отключено",contextMenuDescription:"Щелкните правой кнопкой мыши на полях ввода, чтобы получить доступ к параметрам AliasVault",selectLanguage:"Выбрать язык",serverConfiguration:"Конфигурация сервера",serverConfigurationDescription:"Настройте URL-адрес сервера AliasVault для самостоятельно размещенных экземпляров",customApiUrl:"URL-адрес API",customClientUrl:"URL-адрес клиента\uFEFF",apiUrlHint:"URL-адрес конечной точки API (обычно URL-адрес клиента + /api)\uFEFF",clientUrlHint:"URL-адрес веб-интерфейса вашего самостоятельно размещенного экземпляра",autofillSettingsDescription:"Включить или отключить всплывающее окно автозаполнения на веб-страницах",autofillEnabledDescription:"В формах входа будут появляться подсказки для автозаполнения",autofillDisabledDescription:"Подсказки автозаполнения отключены глобально",languageSettings:"Язык",validation:{apiUrlRequired:"Требуется URL-адрес API",apiUrlInvalid:"Пожалуйста, введите корректный URL-адрес API",clientUrlRequired:"Требуется URL-адрес клиента",clientUrlInvalid:"Пожалуйста, введите корректный URL-адрес клиента"},unlockMethod:{title:"Способ разблокировки хранилища",introText:"Выберите способ разблокировки хранилища. Вы можете использовать свой мастер-пароль (он доступен всегда) или установить ПИН-код для быстрого доступа. После 3 неудачных попыток ввода ПИН-кода необходимо будет ввести мастер-пароль.",password:"Мастер-пароль",pin:"ПИН-код",pinDescription:"Разблокировать хранилище ПИН-кодом",setupPin:"Установить ПИН-код",enterNewPinDescription:"Введите ПИН-код, состоящий как минимум из 6 цифр",confirmPin:"Подтвердите ПИН-код\uFEFF",confirmPinDescription:"Повторите ПИН-код для подтверждения",invalidPinFormat:"Неверный формат ПИН-кода\uFEFF",pinMismatch:"ПИН-коды не совпадают",incorrectPin:"Неверный ПИН-код. Осталось {{attemptsRemaining}} попытки.",incorrectPinSingular:"Неверный ПИН-код. Осталась 1 попытка.",enableSuccess:"Разблокировка по ПИН-коду успешно включена",pinLocked:"Разблокировка по ПИН-коду отключена. Пожалуйста, используйте ваш мастер-пароль для разблокировки хранилища.",pinSecurityWarning:"Разблокировка с помощью ПИН-кода в расширении для браузера может быть менее безопасной, чем использование вашего мастер-пароля, поскольку ПИН-коды обычно имеют более низкую энтропию и могут быть подобраны методом перебора (брутфорс), если ваше устройство будет скомпрометировано. Используйте этот способ только на устройствах, которым вы полностью доверяете."}},q1={passkey:"Ключ доступа",site:"Сайт",helpText:"Ключи доступа создаются на веб-сайте по запросу. Их нельзя редактировать вручную. Чтобы удалить этот ключ доступа, вы можете удалить его из этой учетной записи. Чтобы заменить этот ключ доступа или создать новый, посетите веб-сайт и следуйте его инструкциям.",passkeyMarkedForDeletion:"Ключ доступа помечен на удаление\uFEFF",passkeyWillBeDeleted:"Этот ключ доступа будет удален при сохранении этой учетной записи.",useBrowserPasskey:"Использовать ключ доступа из браузера\uFEFF",bypass:{description:"На какой срок вы хотите предоставить сайту {{origin}} доступ к ключам, сохраненным в браузере?",thisTimeOnly:"Только в этот раз",alwaysForSite:"Всегда для этого сайта"},authenticate:{title:"Вход с помощью ключа доступа",signInFor:"Вход с ключом доступа для",selectPasskey:"Выберите ключ доступа для входа:",noPasskeysFound:"Ключи доступа для этого сайта не найдены"},create:{title:"Создание ключа доступа",createFor:"Создайте новый ключ доступа для",titleLabel:"Название",titlePlaceholder:"Укажите название для этого ключа доступа",createButton:"Создать ключ доступа",selectPasskeyToReplace:"Выберите ключ доступа для замены:",createNewPasskey:"Создать новый ключ доступа",replacingPasskey:"Замена ключа доступа: {{displayName}}",confirmReplace:"Подтвердить замену",selectExistingLogin:"Привязать к логину:",selectExistingLoginDescription:"Привяжите этот ключ доступа к существующей учетной записи для этого сайта.",attachingToCredential:"Добавление ключа доступа для: {{serviceName}}",attachPasskey:"Добавить ключ доступа"},settings:{passkeyProvider:"Провайдер ключей доступа",passkeyProviderOn:"Провайдер ключей доступа включен "}},W1={title:"Недавно удаленные",noItems:"Нет удаленных элементов",noItemsDescription:"Удаленные элементы будут храниться здесь 30 дней, после чего они будут удалены безвозвратно.",description:"Эти элементы будут безвозвратно удалены через 30 дней. Вы можете восстановить их или удалить немедленно.",restore:"Восстановить",deletePermanently:"Удалить безвозвратно",emptyAll:"Очистить все",daysRemaining_one:"Остался {{count}} день",daysRemaining_other:"Осталось {{count}} дней",expiringSoon:"Скоро будут удалены",confirmDeleteTitle:"Удалить безвозвратно?",confirmDeleteMessage:"Этот элемент будет удален навсегда без возможности восстановления.",confirmEmptyAllTitle:"Очистить «Недавно удалённые»?",confirmEmptyAllMessage:"Все элементы {{count}} будут удалены навсегда без возможности восстановления."},Y1={title:"Обновить хранилище",subtitle:"AliasVault обновился, и ваше хранилище необходимо обновить. Это займет всего несколько секунд.",versionInformation:"Информация о версии",yourVault:"Версия вашего хранилища:",newVersion:"Доступна новая версия:",upgrade:"Обновить хранилище",upgrading:"Обновление...",whatsNew:"Что нового",whatsNewDescription:"Для поддержки следующих изменений требуется обновление:",noDescriptionAvailable:"Описание для этой версии недоступно.",alerts:{unableToGetVersionInfo:"Не удалось получить информацию о версии. Пожалуйста, попробуйте снова.",selfHostedServer:"Автономный сервер",selfHostedWarning:"Если вы используете автономный сервер, обязательно обновите свой автономный экземпляр, так как в противном случае вход в веб-клиент перестанет работать.",continueUpgrade:"Продолжить обновление",upgradeFailed:"Ошибка обновления",failedToApplyMigration:"Не удалось применить перенос ({{current}} из {{total}})"}},J1={unsyncedChangesTitle:"Несинхронизированные изменения",unsyncedChangesWarning:"У вас есть несинхронизированные изменения, которые будут потеряны, если вы выйдете из аккаунта сейчас. Вы уверены, что хотите продолжить?",logoutAnyway:"Все равно выйти"},X1={auth:M1,menu:F1,common:O1,content:j1,items:P1,itemTypes:H1,fieldLabels:Q1,totp:z1,attachmentUploader:V1,emails:K1,settings:G1,passkeys:q1,recentlyDeleted:W1,upgrade:Y1,logout:J1},$1={loginTitle:"Увійти до AliasVault",username:"Ім'я користувача або електронна пошта",usernamePlaceholder:"ім'я / name@company.com",passwordPlaceholder:"Введіть ваш пароль",rememberMe:"Запам'ятати мене",loginButton:"Увійти",noAccount:"Ще не маєте облікового запису?",createVault:"Створити нове сховище",twoFactorTitle:"Будь ласка, введіть код автентифікації з вашого застосунку для автентифікації.",authCode:"Код автентифікації",authCodePlaceholder:"Введіть 6-значний код",verify:"Перевірка",twoFactorNote:"Примітка: якщо у вас немає доступу до вашого пристрою автентифікатора, ви можете скинути налаштування 2FA за допомогою коду відновлення, увійшовши через вебсайт.",masterPassword:"Головний пароль",unlockVault:"Розблокувати",unlockWithPin:"Розблокувати за допомогою ПІН-коду",enterPinToUnlock:"Введіть свій ПІН-код, щоб розблокувати сховище",useMasterPassword:"Використовуйте головний пароль",unlockTitle:"Розблокувати своє сховище",logoutConfirm:"Ви впевнені, що хочете вийти?",unlockSuccessTitle:"Ваше сховище успішно розблоковано",unlockSuccessDescription:"Тепер ви можете використовувати автозаповнення форм входу у вашому браузері.",closePopup:"Закрити цю підказку",browseVault:"Переглянути вміст сховища",connectingTo:"Підключення до",switchAccounts:"Змінити обліковий запис?",loginWithMobile:"Увійти за допомогою мобільного додатку",unlockWithMobile:"Розблокувати за допомогою мобільного додатку",scanQrCode:"Проскануйте цей QR-код за допомогою мобільного додатка AliasVault, щоб увійти та розблокувати сховище.",errors:{invalidCode:"Будь ласка, введіть дійсний 6-значний код автентифікації.",serverError:"Не вдалося зв’язатися зі сервером AliasVault. Будь ласка, спробуйте пізніше або зверніться до служби підтримки, якщо проблема не зникне.",wrongPassword:"Невірний пароль. Будь ласка, спробуйте ще раз.",sessionExpired:"Час сеансу закінчився. Будь ласка, увійдіть знову.",mobileLoginRequestExpired:"Час очікування запиту на вхід у мобільний додаток закінчився. Перезавантажте сторінку та спробуйте ще раз."}},Z1={vault:"Vault",emails:"Електронні адреси"},ek={loading:"Завантаження даних...",notice:"Примітка",error:"Помилка",cancel:"Скасувати",confirm:"Підтвердити",back:"Назад",next:"Далі",use:"Використовувати",add:"Add",delete:"Видалити",undo:"Скасувати",save:"Зберегти",saving:"Saving...",create:"Створити",or:"Або",close:"Закрити",logout:"Вихід",copied:"Скопійовано!",openInNewWindow:"Відкрити у новому вікні",enabled:"Увімкнено",disabled:"Вимкнено",showPassword:"Показати пароль",hidePassword:"Приховати пароль",showDetails:"Показати подробиці",hideDetails:"Приховати подробиці",copyToClipboard:"Копіювати до буфера обміну",loadingEmails:"Завантаження електронних адрес...",loadingTotpCodes:"Завантаження кодів TOTP...",attachments:"Вкладення",loadingAttachments:"Завантаження вкладень...",settings:"Налаштування",recentEmails:"Останні електронні листи",credentials:"Облікові дані",customFields:"Custom Fields",twoFactorAuthentication:"Двофакторна автентифікація",alias:"Псевдонім",notes:"Нотатки",email:"Електронна пошта",username:"Ім'я користувача",password:"Пароль",generate:"Generate",serviceName:"Назва сервісу",loggedIn:"Вхід виконано",syncingVault:"Синхронізація сховища",checkingVaultUpdates:"Перевірка оновлень сховища",syncingUpdatedVault:"Синхронізація оновленого сховища",loadMore:"Завантажити ще",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Merging vault changes...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"Не вдалося зв’язатися зі сервером AliasVault. Будь ласка, спробуйте пізніше або зверніться до служби підтримки, якщо проблема не зникне.",clientVersionNotSupported:"Ця версія розширення браузера AliasVault більше не підтримується сервером. Будь ласка, оновіть розширення браузера до останньої версії.",browserExtensionOutdated:"Це розширення браузера застаріло, і його не можна використовувати для доступу до цього сховища. Щоб продовжити, оновіть це розширення браузера.",serverVersionNotSupported:"Щоб використовувати це розширення браузера, потрібно оновити сервер AliasVault до новішої версії. Зверніться до служби підтримки, якщо вам потрібна допомога.",serverVersionTooOld:"Щоб скористатися цією функцією, потрібно оновити сервер AliasVault до нової версії. Якщо вам потрібна допомога, будь ласка, зверніться до адміністратора сервера.",unknownError:"Сталася невідома помилка",unknownErrorTryAgain:"Сталася невідома помилка. Будь ласка, спробуйте ще раз.",vaultNotAvailable:"Сховище недоступне",vaultIsLocked:"Сховище заблоковано",passwordChanged:"Ваш пароль змінився з моменту останнього входу. З міркувань безпеки, будь ласка, увійдіть ще раз.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"Сталася невідома помилка. Будь ласка, спробуйте ще раз.",ACCOUNT_LOCKED:"Обліковий запис тимчасово заблоковано через занадто багато невдалих спроб. Будь ласка, спробуйте пізніше.",ACCOUNT_BLOCKED:"Ваш обліковий запис вимкнено. Якщо ви вважаєте, що це помилка, зверніться до служби підтримки.",USER_NOT_FOUND:"Недійсне ім'я користувача або пароль. Спробуйте ще раз.",INVALID_AUTHENTICATOR_CODE:"Недійсний код автентифікатора. Спробуйте ще раз.",INVALID_RECOVERY_CODE:"Недійсний код відновлення. Будь ласка, спробуйте ще раз.",REFRESH_TOKEN_REQUIRED:"Необхідне оновлення токена.",INVALID_REFRESH_TOKEN:"Оновлення токена невдале.",PUBLIC_REGISTRATION_DISABLED:"Реєстрація нових облікових записів на цьому сервері наразі вимкнена. Зверніться до адміністратора.",USERNAME_REQUIRED:"Ім'я користувача обов'язкове.",USERNAME_ALREADY_IN_USE:"Ім'я користувача вже використовується.",USERNAME_AVAILABLE:"Ім'я користувача доступне.",USERNAME_MISMATCH:"Ім'я користувача не відповідає поточному користувачеві.",PASSWORD_MISMATCH:"Введений пароль не відповідає вашому поточному паролю.",ACCOUNT_SUCCESSFULLY_DELETED:"Обліковий запис успішно видалено.",USERNAME_EMPTY_OR_WHITESPACE:"Ім’я користувача не може бути порожнім або містити пробіли.",USERNAME_TOO_SHORT:"Ім’я користувача закоротке: має містити щонайменше 3 символи.",USERNAME_TOO_LONG:"Ім'я користувача занадто довге: не може бути довшим за 40 символів.",USERNAME_INVALID_EMAIL:"Недійсна адреса електронної пошти.",USERNAME_INVALID_CHARACTERS:"Ім'я користувача недійсне, може містити лише літери або цифри.",VAULT_NOT_UP_TO_DATE:"Ваше сховище застаріло. Синхронізуйте його та спробуйте ще раз.",INTERNAL_SERVER_ERROR:"Внутрішня помилка сервера.",VAULT_ERROR:"Локальне сховище не оновлене. Синхронізуйте своє сховище, оновивши сторінку, та повторіть спробу."}},tk={or:"або",new:"Новий",vaultLocked:"AliasVault заблоковано.",creatingNewAlias:"Створення нового псевдоніму...",noMatchesFound:"Збігів не знайдено",searchVault:"Пошук сховища...",enterServiceName:"Введіть назву служби",enterEmailAddress:"Введіть електронну адресу",enterUsername:"Введіть ім'я користувача",hideFor1Hour:"Сховати протягом 1 години (поточний сайт)",hidePermanently:"Приховати назавжди (поточний сайт)",createRandomAlias:"Створити випадковий псевдонім",createUsernamePassword:"Створити ім'я користувача/пароль",randomAlias:"Випадковий псевдонім",usernamePassword:"Ім'я користувача/Пароль",createAndSaveAlias:"Створити та зберегти псевдонім",createAndSaveCredential:"Створити та зберегти облікові дані",randomIdentityDescription:"Згенеруйте випадкову особу з випадковою адресою електронної пошти, доступною в AliasVault.",randomIdentityDescriptionDropdown:"Випадкова ідентифікація з випадковою електронною поштою",manualCredentialDescription:"Вкажіть власну адресу електронної пошти та ім'я користувача.",manualCredentialDescriptionDropdown:"Ім'я користувача та пароль вручну",failedToCreateIdentity:"Не вдалося створити ідентифікатор. Спробуйте ще раз.",enterEmailAndOrUsername:"Введіть електронну пошту та/або ім'я користувача",autofillWithAliasVault:"Автозаповнення за допомогою AliasVault",generateRandomPassword:"Згенерувати випадковий пароль (скопіювати в буфер обміну)",generateNewPassword:"Згенерувати новий пароль",togglePasswordVisibility:"Перемикання видимості пароля",passwordCopiedToClipboard:"Пароль скопійовано в буфер обміну",openAliasVaultToUpgrade:"Відкрити AliasVault для покращення",vaultUpgradeRequired:"Потрібне оновлення сховища.",dismissPopup:"Закрити спливаюче вікно"},ak={title:"Items",itemName:"Назва",loginCredentials:"Дані для входу",cardInformation:"Card Information",addItem:"Add Item",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Item Details",editItem:"Edit Item",untitled:"Untitled",newFolder:"New Folder",createFolder:"Створити теку",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"Тека",welcomeTitle:"Ласкаво просимо до AliasVult!",welcomeDescription:"Щоб скористатися розширенням браузера AliasVault: перейдіть на вебсайт і скористайтеся спливаючим вікном автозаповнення AliasVault, щоб створити нові облікові дані.",noPasskeysFound:"Ключі доступу ще не створено. Ключі доступу створюються під час відвідування вебсайту, який пропонує ключі доступу як спосіб автентифікації.",noAttachmentsFound:"No items with attachments found",noItemsOfTypeFound:"No {{type}} items found",noMatchingItems:"No matching items found",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(All) Items",passkeys:"Ключі доступу"},deleteItemTitle:"Delete Item",deleteItemConfirm:"Are you sure you want to delete this item?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"Теги",changePasswordComplexity:"Зміна складності пароля",passwordLength:"Довжина пароля",includeLowercase:"Включити малі літери",includeUppercase:"Включити великі літери",includeNumbers:"Включити числа",includeSpecialChars:"Включити спеціальні символи",avoidAmbiguousChars:"Уникайте неоднозначних символів (o, 0 тощо)",privateEmailTitle:"Приватна електронна адреса",privateEmailAliasVaultServer:"Сервер AliasVault",privateEmailDescription:"Наскрізне шифрування, повністю конфіденційно.",publicEmailTitle:"Публічні тимчасові постачальники електронної пошти",publicEmailDescription:"Анонімно, але обмежена конфіденційність. Зміст електронного листа може прочитати будь-хто, хто знає адресу.",validation:{required:"Це поле обов'язкове"}},nk={selectType:"Add New Item",typeLabel:"Item Type",creating:"Creating",editing:"Editing",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Field Label",enterFieldName:"Enter field name",fieldType:"Field Type",fieldTypes:{text:"Text",hidden:"Hidden (masked text)",email:"Електронна пошта",url:"URL",phone:"Phone",number:"Number",date:"Date",textArea:"Text Area"},login:{title:"Увійти"},alias:{title:"Псевдонім"},creditCard:{title:"Credit Card"},note:{title:"Secure Note"}},rk={"login.url":"Website URL","login.username":"Username","login.password":"Пароль","alias.first_name":"Ім’я","alias.last_name":"Прізвище","alias.gender":"Стать","alias.birthdate":"Birthdate","login.email":"Пошта","notes.content":"Нотатки","card.cardholder_name":"Cardholder Name","card.number":"Card Number","card.expiry_month":"Expiry Month","card.expiry_year":"Expiry Year","card.cvv":"CVV","card.pin":"PIN"},ik={addCode:"Add 2FA Code",instructions:"Enter the secret key shown by the website where you want to add two-factor authentication.",nameOptional:"Ім'я (необов'язково)",secretKey:"Секретний ключ",saveToViewCode:"Зберегти для перегляду коду",defaultName:"Authenticator",errors:{invalidSecretKey:"Invalid secret key format."}},sk={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},ok={title:"Електронні листи",deleteEmailTitle:"Видалити електронного листа",deleteEmailConfirm:"Ви впевнені, що хочете остаточно видалити цей електронний лист?",from:"Від",to:"До",date:"Дата",emailContent:"Вміст електронного листа",emailNotFound:"Електронний лист не знайдено",noEmails:"Електронних листів не знайдено",noEmailsDescription:"Ви ще не отримували жодних листів на свої приватні адреси електронної пошти. Коли ви отримаєте новий лист, він з’явиться тут.",offlineMessage:"Ви офлайн. Будь ласка, приєднайтесь до Інтернету, щоб завантажити свої електронні листи.",dateFormat:{justNow:"щойно",minutesAgo_single:"{{count}} хвилина тому",minutesAgo_plural:"{{count}} хвилин тому",hoursAgo_single:"{{count}} година тому",hoursAgo_plural:"{{count}} годин тому",yesterday:"учора"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Поточна вибрана електронна адреса вже використовується. Змініть електронну адресу, відредагувавши ці облікові дані.",CLAIM_DOES_NOT_EXIST:"Під час спроби завантажити електронні листи сталася помилка. Спробуйте відредагувати та зберегти запис облікових даних, щоб синхронізувати базу даних, а потім повторіть спробу."}},lk={serverUrl:"URL-адреса сервера",language:"Мова",autofillEnabled:"Увімкнути автозаповнення",version:"Версія",openWebApp:"Відкрити веб додаток",lock:"Заблокувати",globalSettings:"Глобальні налаштування",autofillPopup:"Спливаюче вікно автозаповнення",activeOnAllSites:"Активно на всіх сайтах (якщо не вимкнено нижче)",disabledOnAllSites:"Вимкнено на всіх сайтах",rightClickContextMenu:"Контекстне меню правою кнопкою миші",autofillMatching:"Автозаповнення відповідності",autofillMatchingMode:"Режим автозаповнення відповідностей",autofillMatchingModeDescription:"Визначає, які облікові дані вважаються відповідними та будуть показуватися як пропозиції у спливному вікні автозаповнення для певного вебсайту.",autofillMatchingDefault:"URL-адреса + піддомен + універсальне ім'я",autofillMatchingUrlSubdomain:"URL-адреса + піддомен",autofillMatchingUrlExact:"Лише точний домен URL-адреси",siteSpecificSettings:"Налаштування, специфічні для сайту",autofillPopupOn:"Спливаюче вікно автозаповнення на: ",enabledForThisSite:"Увімкнено для цього сайту",disabledForThisSite:"Вимкнено для цього сайту",temporarilyDisabledUntil:"Тимчасово вимкнено до ",resetAllSiteSettings:"Скинути всі налаштування, характерні для сайту",appearance:"Зовнішній вигляд",theme:"Тема",useDefault:"Використовувати за замовчуванням",light:"Світла",dark:"Темна",keyboardShortcuts:"Комбінації клавіш",configureKeyboardShortcuts:"Налаштування комбінацій клавіш",configure:"Налаштування",clipboardClearTimeout:"Очистити буфер обміну після копіювання",clipboardClearTimeoutDescription:"Автоматично очищати буфер обміну після копіювання конфіденційних даних",clipboardClearDisabled:"Ніколи не очищати",clipboardClear5Seconds:"Очистити після 5 секунд",clipboardClear10Seconds:"Очистити після 10 секунд",clipboardClear15Seconds:"Очистити після 15 секунд",autoLockTimeout:"Тайм-аут автоматичного блокування",autoLockTimeoutDescription:"Автоматично блокувати сховище після періоду бездіяльності",autoLockTimeoutHelp:"Сховище буде заблоковано лише після зазначеного періоду бездіяльності (не використовується автозаповнення або не відкривається спливне вікно розширення). Сховище завжди блокуватиметься, коли браузер закривається, незалежно від цього налаштування.",autoLockNever:"Ніколи",autoLock15Seconds:"15 секунд",autoLock1Minute:"1 хвилина",autoLock5Minutes:"5 хвилин",autoLock15Minutes:"15 хвилин",autoLock30Minutes:"30 хвилин",autoLock1Hour:"1 година",autoLock4Hours:"4 години",autoLock8Hours:"8 годин",autoLock24Hours:"24 години",versionPrefix:"Версія ",autofillSettings:"Налаштування автозаповнення",clipboardSettings:"Параметри буфера обміну",contextMenuSettings:"Налаштування контекстного меню",passkeySettings:"Налаштування ключа доступу",contextMenu:"Контекстне меню",contextMenuEnabled:"Контекстне меню увімкнено",contextMenuDisabled:"Контекстне меню вимкнено",contextMenuDescription:"Натисніть правою кнопкою миші на поля введення, щоб отримати доступ до параметрів AliasVault",selectLanguage:"Виберіть мову",serverConfiguration:"Конфігурація сервера",serverConfigurationDescription:"Налаштування URL-адреси сервера AliasVault для самостійно розміщених екземплярів",customApiUrl:"URL-адреса API",customClientUrl:"URL-адреса клієнта",apiUrlHint:"URL-адреса кінцевої точки API (зазвичай URL-адреса клієнта + /api)",clientUrlHint:"URL-адреса вебінтерфейсу вашого самостійного екземпляра",autofillSettingsDescription:"Увімкнення або вимкнення спливаючого вікна автозаповнення на вебсторінках",autofillEnabledDescription:"",autofillDisabledDescription:"Autofill suggestions are disabled globally",languageSettings:"Мова",validation:{apiUrlRequired:"URL-адреса API обов'язкова",apiUrlInvalid:"Будь ласка, введіть дійсну URL-адресу API",clientUrlRequired:"URL-адреса клієнта обов'язкова",clientUrlInvalid:"Будь ласка, введіть дійсну URL-адресу клієнта"},unlockMethod:{title:"Метод розблокування сховища",introText:"Choose how you want to unlock your vault. You can use your master password (always available) or set up a PIN code for faster access. After 3 failed PIN attempts, you'll need to use your master password.",password:"Головний пароль",pin:"ПІН-код",pinDescription:"Unlock vault with PIN code",setupPin:"Setup PIN Code",enterNewPinDescription:"Enter a PIN code consisting of minimum 6 digits",confirmPin:"Підтвердити ПІН-код",confirmPinDescription:"Enter your PIN again to confirm",invalidPinFormat:"Invalid PIN format",pinMismatch:"PINs do not match",incorrectPin:"Incorrect PIN. {{attemptsRemaining}} attempts remaining.",incorrectPinSingular:"Incorrect PIN. 1 attempt remaining.",enableSuccess:"Розблокування PIN-кодом успішно ввімкнено!",pinLocked:"PIN unlock has been disabled. Please use your master password to unlock your vault.",pinSecurityWarning:"PIN unlock in the browser extension can be less secure than your master password, as PINs typically have lower entropy and may be brute-forced if your device is compromised. Use it only on devices you fully trust."}},ck={passkey:"Ключ доступу",site:"Вебсайт",helpText:"Passkeys are created on the website when prompted. They cannot be manually edited. To remove this passkey, you can delete it from this credential. To replace this passkey or create a new one, visit the website and follow its prompts.",passkeyMarkedForDeletion:"Ключ доступу позначено для видалення",passkeyWillBeDeleted:"Цей ключ доступу буде видалено, коли ви збережете ці облікові дані.",useBrowserPasskey:"Use Browser Passkey",bypass:{description:"How long would you like to use the browser's passkey provider for {{origin}}?",thisTimeOnly:"This time only",alwaysForSite:"Always for this site"},authenticate:{title:"Sign in with Passkey",signInFor:"Sign in with passkey for",selectPasskey:"Select a passkey to sign in:",noPasskeysFound:"No passkeys found for this site"},create:{title:"Create Passkey",createFor:"Create a new passkey for",titleLabel:"Заголовок",titlePlaceholder:"Enter a name for this passkey",createButton:"Create Passkey",selectPasskeyToReplace:"Select a passkey to replace:",createNewPasskey:"Create New Passkey",replacingPasskey:"Replacing passkey: {{displayName}}",confirmReplace:"Confirm Replace",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Passkey Provider",passkeyProviderOn:"Passkey Provider on "}},uk={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},dk={title:"Оновлення сховища",subtitle:"AliasVault оновлено, і ваше сховище потрібно оновити. Це займе лише кілька секунд.",versionInformation:"Інформація про версію",yourVault:"Ваша версія сховища:",newVersion:"Доступна нова версія:",upgrade:"Оновлення сховища",upgrading:"Оновлення...",whatsNew:"Що нового",whatsNewDescription:"Для підтримки таких змін потрібне оновлення:",noDescriptionAvailable:"Для цієї версії немає опису.",alerts:{unableToGetVersionInfo:"Не вдалося отримати інформацію про версію. Спробуйте ще раз.",selfHostedServer:"Сервер із самостійним розміщенням",selfHostedWarning:"Якщо ви використовуєте власний сервер, обов’язково оновіть і свій власний екземпляр, інакше вхід до вебклієнта перестане працювати.",continueUpgrade:"Продовжити оновлення",upgradeFailed:"Помилка оновлення",failedToApplyMigration:"Не вдалося застосувати міграцію ({{current}} з {{total}})"}},mk={unsyncedChangesTitle:"Unsynced Changes",unsyncedChangesWarning:"You have unsynced changes that will be lost if you log out now. Are you sure you want to continue?",logoutAnyway:"Log out anyway"},fk={auth:$1,menu:Z1,common:ek,content:tk,items:ak,itemTypes:nk,fieldLabels:rk,totp:ik,attachmentUploader:sk,emails:ok,settings:lk,passkeys:ck,recentlyDeleted:uk,upgrade:dk,logout:mk},gk={loginTitle:"登录到 AliasVault",username:"用户名或邮箱",usernamePlaceholder:"姓名 / name@company.com",passwordPlaceholder:"输入您的密码",rememberMe:"记住我",loginButton:"登录",noAccount:"还没有账户？",createVault:"创建新密码库",twoFactorTitle:"请输入来自您身份验证器应用的身份验证码",authCode:"身份验证码",authCodePlaceholder:"输入 6 位数代码",verify:"验证",twoFactorNote:"注意：如果无法访问您的认证设备，您可以通过网站登录，使用恢复码重置两步验证（2FA）。",masterPassword:"主密码",unlockVault:"解锁",unlockWithPin:"使用 PIN 解锁",enterPinToUnlock:"输入您的 PIN 以解锁密码库",useMasterPassword:"使用主密码",unlockTitle:"解锁您的密码库",logoutConfirm:"确定要退出登录吗？",unlockSuccessTitle:"您的密码库已成功解锁",unlockSuccessDescription:"现在您可以在浏览器的登录表单中使用自动填充功能了。",closePopup:"关闭此弹窗",browseVault:"浏览密码库内容",connectingTo:"正在连接",switchAccounts:"切换账户？",loginWithMobile:"使用移动应用登录",unlockWithMobile:"使用移动应用解锁",scanQrCode:"使用 AliasVault 移动端应用扫描该二维码，即可登录并解锁您的密码库。",errors:{invalidCode:"请输入有效的6位动态验证码。",serverError:"无法连接到AliasVault服务器。请稍后重试，若问题依旧，请联系支持人员。",wrongPassword:"密码不正确。请重试。",sessionExpired:"您的会话已过期。请重新登录。",mobileLoginRequestExpired:"移动端登录请求超时。请重新加载页面后重试。"}},hk={vault:"密码库",emails:"邮件"},Ak={loading:"加载中…",notice:"注意",error:"错误",cancel:"取消",confirm:"确认",back:"返回",next:"下一步",use:"使用",add:"添加",delete:"删除",undo:"撤销",save:"保存",saving:"保存中…",create:"创建",or:"或",close:"关闭",logout:"退出登录",copied:"已复制！",openInNewWindow:"在新窗口中打开",enabled:"启用",disabled:"禁用",showPassword:"显示密码",hidePassword:"隐藏密码",showDetails:"显示详情",hideDetails:"隐藏详情",copyToClipboard:"复制到剪贴板",loadingEmails:"加载邮件中…",loadingTotpCodes:"加载TOTP验证码中…",attachments:"附件",loadingAttachments:"加载附件中…",settings:"设置",recentEmails:"近期邮件",credentials:"凭据",customFields:"自定义字段",twoFactorAuthentication:"两步验证（2FA）",alias:"别名",notes:"备注",email:"邮箱",username:"用户名",password:"密码",generate:"生成",serviceName:"服务名称",loggedIn:"已登录",syncingVault:"正在同步密码库",checkingVaultUpdates:"检查密码库更新中",syncingUpdatedVault:"同步更新后的密码库",loadMore:"加载更多",offline:"离线",offlineMode:"正在离线模式运行",pendingSync:"同步中…",mergingVaultChanges:"正在合并密码库更改...",uploadingVault:"正在上传密码库…",errors:{serverNotAvailable:"AliasVault服务器不可用。请稍后重试，若问题持续请联系支持人员。",clientVersionNotSupported:"此版本的AliasVault浏览器扩展已不被服务器支持。请将浏览器扩展更新到最新版本。",browserExtensionOutdated:"此浏览器扩展已过时，无法用于访问此密码库。请更新此浏览器扩展以继续。",serverVersionNotSupported:"AliasVault服务器需要更新到新版本才能使用此浏览器扩展。如需帮助，请联系支持人员。",serverVersionTooOld:"AliasVault 服务器需要更新到更高版本才能使用此功能。如需帮助，请联系服务器管理员。",unknownError:"发生未知错误",unknownErrorTryAgain:"发生未知错误，请重试。",vaultNotAvailable:"密码库不可用",vaultIsLocked:"密码库已锁定",passwordChanged:"登录密码已更新，请重新登录以确保账户安全。",syncConflictMaxRetries:"多次尝试后仍无法同步密码库，请稍后重试。",mergeFailed:"合并密码库更改失败，请重试。"},apiErrors:{UNKNOWN_ERROR:"发生未知错误。请重试。",ACCOUNT_LOCKED:"由于多次尝试失败，账户已暂时锁定。请稍后重试。",ACCOUNT_BLOCKED:"您的账户已被停用。若您认为此操作有误，请联系支持人员。",USER_NOT_FOUND:"用户名或密码无效。请重试。",INVALID_AUTHENTICATOR_CODE:"身份验证器验证码无效。请重试。",INVALID_RECOVERY_CODE:"恢复码无效。请重试。",REFRESH_TOKEN_REQUIRED:"刷新令牌为必填项。",INVALID_REFRESH_TOKEN:"刷新令牌无效。",PUBLIC_REGISTRATION_DISABLED:"当前服务器已禁用新账户注册。请联系管理员。",USERNAME_REQUIRED:"用户名为必填项。",USERNAME_ALREADY_IN_USE:"用户名已被使用。",USERNAME_AVAILABLE:"用户名可用。",USERNAME_MISMATCH:"用户名与当前用户不匹配。",PASSWORD_MISMATCH:"提供的密码与您的当前密码不匹配。",ACCOUNT_SUCCESSFULLY_DELETED:"账户已成功删除。",USERNAME_EMPTY_OR_WHITESPACE:"用户名不能为空或仅含空格。",USERNAME_TOO_SHORT:"用户名过短：至少需要3个字符。",USERNAME_TOO_LONG:"用户名过长：不能超过40个字符。",USERNAME_INVALID_EMAIL:"无效的邮箱地址。",USERNAME_INVALID_CHARACTERS:"用户名无效，只能包含字母或数字。",VAULT_NOT_UP_TO_DATE:"您的密码库不是最新的。请同步您的密码库后重试。",INTERNAL_SERVER_ERROR:"服务器内部错误。",VAULT_ERROR:"本地密码库不是最新的。请刷新页面同步密码库后重试。"}},pk={or:"或",new:"新建",vaultLocked:"AliasVault已锁定。",creatingNewAlias:"正在创建新别名…",noMatchesFound:"未找到匹配项",searchVault:"搜索密码库…",enterServiceName:"输入服务名称",enterEmailAddress:"输入邮箱地址",enterUsername:"输入用户名",hideFor1Hour:"隐藏1小时（当前网站）",hidePermanently:"永久隐藏（当前网站）",createRandomAlias:"创建随机别名",createUsernamePassword:"创建用户名/密码",randomAlias:"随机别名",usernamePassword:"用户名/密码",createAndSaveAlias:"创建并保存别名",createAndSaveCredential:"创建并保存凭据",randomIdentityDescription:"生成一个包含随机邮箱地址的随机身份，可在AliasVault中查看。",randomIdentityDescriptionDropdown:"带随机邮箱的随机身份",manualCredentialDescription:"指定您自己的邮箱地址和用户名。",manualCredentialDescriptionDropdown:"手动输入用户名和密码",failedToCreateIdentity:"创建身份失败。请重试。",enterEmailAndOrUsername:"输入邮箱和/或用户名",autofillWithAliasVault:"使用AliasVault自动填充",generateRandomPassword:"生成随机密码（复制到剪贴板）",generateNewPassword:"生成新密码",togglePasswordVisibility:"切换密码可见性",passwordCopiedToClipboard:"密码已复制到剪贴板",openAliasVaultToUpgrade:"打开AliasVault进行升级",vaultUpgradeRequired:"需要升级密码库。",dismissPopup:"关闭弹窗"},yk={title:"项目",itemName:"名称",loginCredentials:"登录凭据",cardInformation:"卡信息",addItem:"添加项目",addNewItem:"添加新项目",saveItem:"保存项目",itemDetails:"项目详情",editItem:"编辑项目",untitled:"无标题",newFolder:"新建文件夹",createFolder:"创建文件夹",editFolder:"编辑文件夹",folderName:"文件夹名称",folderNameRequired:"文件夹名称为必填项",folder:"文件夹",welcomeTitle:"欢迎使用 AliasVault!",welcomeDescription:"要使用AliasVault浏览器扩展：导航到某个网站，使用AliasVault自动填充弹窗创建新凭据。",noPasskeysFound:"尚未创建通行密钥。访问以通行密钥为认证方式的网站才能创建通行密钥。",noAttachmentsFound:"未找到带附件的项目",noItemsOfTypeFound:"未找到 {{type}} 项目",noMatchingItems:"未找到匹配的项目",noMatchingItemsSearch:"未找到匹配“{{search}}”的项目",noMatchingItemsWithFilter:"未找到匹配“{{search}}”的 {{filter}} 项目",clearSearch:"清除搜索",clearFilter:"清除筛选器",emptyFolderHint:"此文件夹为空。要将项目移动到此文件夹，请编辑该项目，然后点击名称字段中的文件夹图标。",allItemsInFolders:"您的所有项目都已整理到文件夹中。点击上方文件夹即可查看您的凭据，或使用搜索查找特定的项目。",deleteFolder:"删除文件夹",deleteFolderKeepItems:"仅删除文件夹",deleteFolderKeepItemsDescription:"项目将被移回主列表。",deleteFolderAndItems:"删除文件夹和所有项目",deleteFolderAndItemsDescription:"{{count}} 个项目将被移至“近期删除”。",filters:{all:"（所有）项目",passkeys:"通行密钥"},deleteItemTitle:"删除项目",deleteItemConfirm:"您确定要删除此项目吗？",viewHistory:"查看历史记录",history:"历史记录",noHistoryAvailable:"暂无历史记录",tags:"标签",changePasswordComplexity:"更改密码复杂度",passwordLength:"密码长度",includeLowercase:"包含小写字母",includeUppercase:"包含大写字母",includeNumbers:"包含数字",includeSpecialChars:"包含特殊字符",avoidAmbiguousChars:"避免易混淆字符（o、0 等）",privateEmailTitle:"私人邮箱",privateEmailAliasVaultServer:"AliasVault 服务器",privateEmailDescription:"端到端加密，完全私密。",publicEmailTitle:"公共临时邮箱提供商",publicEmailDescription:"匿名但隐私性有限，任何知晓其地址的人均可读取邮件内容。",validation:{required:"此字段为必填项"}},Ek={selectType:"添加新项目",typeLabel:"项目类型",creating:"创建",editing:"编辑",regenerateAlias:"重新生成别名",addCustomField:"添加自定义字段",fieldLabel:"字段标签",enterFieldName:"输入字段名称",fieldType:"字段类型",fieldTypes:{text:"文本",hidden:"隐藏（已遮挡文本）",email:"邮箱",url:"URL",phone:"手机",number:"号码",date:"日期",textArea:"文本区域"},login:{title:"登录"},alias:{title:"别名"},creditCard:{title:"信用卡"},note:{title:"安全笔记"}},bk={"login.url":"网站 URL","login.username":"用户名","login.password":"密码","alias.first_name":"名","alias.last_name":"姓","alias.gender":"性别","alias.birthdate":"出生日期","login.email":"邮箱","notes.content":"备注","card.cardholder_name":"持卡人姓名","card.number":"卡号","card.expiry_month":"到期月份","card.expiry_year":"到期年份","card.cvv":"CVV","card.pin":"PIN"},Ik={addCode:"添加两步验证码",instructions:"输入要添加两步验证的网站显示的密钥。",nameOptional:"名称（可选）",secretKey:"密钥",saveToViewCode:"保存以查看验证码",defaultName:"身份验证器",errors:{invalidSecretKey:"密钥格式无效。"}},vk={uploading:"上传中…",uploadSuccess:"文件上传成功。",deleteSuccess:"附件删除成功。",firefoxExpandRequired:"要上传文件，请使用展开的窗口。",openExpandedWindow:"打开展开的窗口"},wk={title:"邮件",deleteEmailTitle:"删除邮件",deleteEmailConfirm:"确定要永久删除此邮件吗？",from:"发件人",to:"收件人",date:"日期",emailContent:"邮件内容",emailNotFound:"未找到邮件",noEmails:"未找到邮件",noEmailsDescription:"您的私人邮箱地址尚未收到任何邮件。当您收到新邮件时，会显示在这里。",offlineMessage:"您处于离线状态。请连接互联网以加载邮件。",dateFormat:{justNow:"刚刚",minutesAgo_single:"{{count}}分钟前",minutesAgo_plural:"{{count}}分钟前",hoursAgo_single:"{{count}}小时前",hoursAgo_plural:"{{count}}小时前",yesterday:"昨天"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"当前选择的邮箱地址已被使用。请通过编辑此凭据修改邮箱地址。",CLAIM_DOES_NOT_EXIST:"加载邮件时发生错误。请尝试编辑并保存凭据条目以同步数据库，然后重试。"}},Ck={serverUrl:"服务器 URL",language:"语言",autofillEnabled:"启用自动填充",version:"版本",openWebApp:"打开网页应用",lock:"锁定",globalSettings:"全局设置",autofillPopup:"自动填充弹窗",activeOnAllSites:"在所有网站上激活（除非在下方禁用）",disabledOnAllSites:"在所有网站上禁用",rightClickContextMenu:"右键上下文菜单",autofillMatching:"自动填充匹配",autofillMatchingMode:"自动填充匹配模式",autofillMatchingModeDescription:"用于判定哪些凭据会被视为匹配项，并在指定网站的自动填充弹窗中显示为建议选项。",autofillMatchingDefault:"URL + 子域名 + 名称通配符",autofillMatchingUrlSubdomain:"URL + 子域名",autofillMatchingUrlExact:"精确匹配URL域名",siteSpecificSettings:"网站特定设置",autofillPopupOn:"自动填充弹窗在以下位置： ",enabledForThisSite:"对此网站启用",disabledForThisSite:"对此网站禁用",temporarilyDisabledUntil:"暂时禁用至 ",resetAllSiteSettings:"重置所有网站特定设置",appearance:"外观",theme:"主题",useDefault:"使用默认",light:"浅色",dark:"深色",keyboardShortcuts:"键盘快捷键",configureKeyboardShortcuts:"配置键盘快捷键",configure:"配置",clipboardClearTimeout:"复制后清除剪贴板",clipboardClearTimeoutDescription:"复制敏感数据后自动清除剪贴板",clipboardClearDisabled:"从不清除",clipboardClear5Seconds:"5秒后清除",clipboardClear10Seconds:"10 秒后清除",clipboardClear15Seconds:"15分钟后清除",autoLockTimeout:"自动锁定超时时间",autoLockTimeoutDescription:"无操作一段时间后自动锁定密码库",autoLockTimeoutHelp:"密码库仅在达到指定的无操作时长后才会锁定（未使用自动填充功能或未打开扩展程序弹窗）。无论此设置如何，关闭浏览器时密码库始终会锁定。",autoLockNever:"从不",autoLock15Seconds:"15 秒",autoLock1Minute:"1 分钟",autoLock5Minutes:"5 分钟",autoLock15Minutes:"15 分钟",autoLock30Minutes:"30 分钟",autoLock1Hour:"1 小时",autoLock4Hours:"4 小时",autoLock8Hours:"8 小时",autoLock24Hours:"24 小时",versionPrefix:"版本 ",autofillSettings:"自动填充设置",clipboardSettings:"剪贴板设置",contextMenuSettings:"上下文菜单设置",passkeySettings:"通行密钥设置",contextMenu:"上下文菜单",contextMenuEnabled:"上下文菜单已启用",contextMenuDisabled:"上下文菜单已停用",contextMenuDescription:"右键点击输入字段即可访问 AliasVault 选项",selectLanguage:"选择语言",serverConfiguration:"服务器配置",serverConfigurationDescription:"为自托管实例配置 AliasVault 服务器 URL",customApiUrl:"API URL",customClientUrl:"客户端 URL",apiUrlHint:"API 端点 URL（通常为客户端 URL + /api）",clientUrlHint:"您自托管实例的 Web 界面 URL",autofillSettingsDescription:"启用或禁用网页上的自动填充弹出窗口",autofillEnabledDescription:"自动填充建议将显示在登录表单上",autofillDisabledDescription:"自动填充建议已全局禁用",languageSettings:"语言",validation:{apiUrlRequired:"API URL 为必填项",apiUrlInvalid:"请输入有效的 API URL",clientUrlRequired:"客户端 URL 为必填项",clientUrlInvalid:"请输入有效的客户端 URL"},unlockMethod:{title:"密码库解锁方式",introText:"选择您解锁密码库的方式。您可以使用主密码（始终可用），也可以设置 PIN 码以便快捷访问。PIN 码输入错误 3 次后，您需要使用主密码。",password:"主密码",pin:"PIN 码",pinDescription:"使用 PIN 码解锁密码库",setupPin:"设置 PIN 码",enterNewPinDescription:"请输入至少 6 位数的 PIN 码",confirmPin:"确认 PIN",confirmPinDescription:"再次输入您的 PIN 以确认",invalidPinFormat:"PIN 格式无效",pinMismatch:"PIN 不一致",incorrectPin:"PIN 码错误，剩余 {{attemptsRemaining}} 次尝试。",incorrectPinSingular:"PIN 码错误，剩余 1 次尝试。",enableSuccess:"PIN 码解锁已成功启用！",pinLocked:"PIN 码解锁已禁用，请使用您的主密码解锁您的密码库。",pinSecurityWarning:"浏览器扩展中的 PIN 码解锁可能不如您的主密码安全，因为 PIN 码的熵值通常较低，若您的设备遭到入侵，则可能被暴力破解。请仅在您完全信任的设备上使用该方式。"}},Nk={passkey:"通行密钥",site:"网站",helpText:"通行密钥会在网站提示时自动生成，无法手动编辑。要移除此通行密钥，您可以在此凭据中进行删除。要替换或创建新的通行密钥，请访问网站并按照其提示操作。",passkeyMarkedForDeletion:"通行密钥已标记为删除",passkeyWillBeDeleted:"保存此凭据后，此通行密钥将被删除。",useBrowserPasskey:"使用浏览器通行密钥",bypass:{description:"对于 {{origin}}，您希望使用浏览器的密码提供程序多长时间？",thisTimeOnly:"仅一次",alwaysForSite:"始终为此网站"},authenticate:{title:"使用通行密钥登录",signInFor:"使用通行密钥登录或",selectPasskey:"选择要登录的通行密钥：",noPasskeysFound:"未找到此网站的通行密钥"},create:{title:"创建通行密钥",createFor:"创建新通行密钥用于",titleLabel:"标题",titlePlaceholder:"输入此通行密钥的名称",createButton:"创建通行密钥",selectPasskeyToReplace:"选择要替换的通行密钥：",createNewPasskey:"创建新通行密钥",replacingPasskey:"替换通行密钥：{{displayName}}",confirmReplace:"确认替换",selectExistingLogin:"添加到现有登录：",selectExistingLoginDescription:"将此通行密钥附加到此站点的现有登录凭据中。",attachingToCredential:"正在将通行密钥添加到：{{serviceName}}",attachPasskey:"添加通行密钥"},settings:{passkeyProvider:"通行密钥提供程序",passkeyProviderOn:"通行密钥提供程序于"}},xk={title:"近期删除",noItems:"没有删除的项目",noItemsDescription:"您删除的项目将在此处停留 30 天，随后永久移除。",description:"这些项目将在 30 天后永久删除。您可以立即还原或永久删除。",restore:"还原",deletePermanently:"永久删除",emptyAll:"全部清空",daysRemaining_one:"剩余 {{count}} 天",daysRemaining_other:"剩余 {{count}} 天",expiringSoon:"即将到期",confirmDeleteTitle:"永久删除吗？",confirmDeleteMessage:"此项目将被永久删除，且无法恢复。",confirmEmptyAllTitle:"清空“近期删除”吗？",confirmEmptyAllMessage:"所有 {{count}} 个项目将被永久删除，且无法恢复。"},Tk={title:"升级密码库",subtitle:"AliasVault已更新，您的密码库需要升级，仅需数秒。",versionInformation:"版本信息",yourVault:"您的密码库版本：",newVersion:"新可用版本：",upgrade:"升级密码库",upgrading:"升级中…",whatsNew:"新功能",whatsNewDescription:"需要升级才能支持以下更改：",noDescriptionAvailable:"此版本无可用说明。",alerts:{unableToGetVersionInfo:"无法获取版本信息。请重试。",selfHostedServer:"自托管服务器",selfHostedWarning:"如果您使用的是自托管服务器，请确保同时更新您的自托管实例，否则将无法登录网页客户端。",continueUpgrade:"继续升级",upgradeFailed:"升级失败",failedToApplyMigration:"应用迁移失败（{{current}} / {{total}}）"}},Sk={unsyncedChangesTitle:"未同步的更改",unsyncedChangesWarning:"您有更改尚未同步，若您现在退出登录，这些更改将会丢失。您确定要继续吗？",logoutAnyway:"仍要退出登录"},kk={auth:gk,menu:hk,common:Ak,content:pk,items:yk,itemTypes:Ek,fieldLabels:bk,totp:Ik,attachmentUploader:vk,emails:wk,settings:Ck,passkeys:Nk,recentlyDeleted:xk,upgrade:Tk,logout:Sk},_l={de:{translation:Fx},en:{translation:Zx},es:{translation:hT},fi:{translation:RT},fr:{translation:qT},he:{translation:cS},it:{translation:NS},nl:{translation:HS},pl:{translation:n1},pt:{translation:E1},ro:{translation:_1},ru:{translation:X1},uk:{translation:fk},zh:{translation:kk}},Ol=[{code:"de",name:"German",nativeName:"Deutsch",flag:"🇩🇪"},{code:"en",name:"English",nativeName:"English",flag:"🇺🇸"},{code:"es",name:"Spanish",nativeName:"Español",flag:"🇪🇸"},{code:"fi",name:"Finnish",nativeName:"Suomi",flag:"🇫🇮"},{code:"fr",name:"French",nativeName:"Français",flag:"🇫🇷"},{code:"he",name:"Hebrew",nativeName:"עברית",flag:"🇮🇱"},{code:"it",name:"Italian",nativeName:"Italiano",flag:"🇮🇹"},{code:"nl",name:"Dutch",nativeName:"Nederlands",flag:"🇳🇱"},{code:"pl",name:"Polish",nativeName:"Polski",flag:"🇵🇱"},{code:"pt",name:"Portuguese Brazilian",nativeName:"Português Brasileiro",flag:"🇧🇷"},{code:"ro",name:"Romanian",nativeName:"Română",flag:"🇷🇴"},{code:"ru",name:"Russian",nativeName:"Русский",flag:"🇷🇺"},{code:"uk",name:"Ukrainian",nativeName:"Українська",flag:"🇺🇦"},{code:"zh",name:"Chinese",nativeName:"简体中文",flag:"🇨🇳"}],Sr="en",Gu=Ol.map(r=>r.code),mu=new Map;async function Ly(r){const e=`all:${r}`;if(mu.has(e))return mu.get(e);if(_l[r]){const a=_l[r].translation;return mu.set(e,a),a}if(r!==Sr&&_l[Sr]){console.warn(`Translations not found for ${r}, falling back to ${Sr}`);const a=_l[Sr].translation;return mu.set(e,a),a}return console.warn(`No translations found for ${r} and no fallback available`),{}}function Lk(r){return Ol.find(e=>e.code===r)}function Ry(r,e){return e.split(".").reduce((a,i)=>a&&typeof a=="object"&&a!==null&&i in a?a[i]:void 0,r)}async function Rk(){try{const r=await ke.getItem("local:language");if(r&&Gu.includes(r))return r;const e=navigator.language.split("-")[0],a=Gu.includes(e)?e:Sr;return await ke.setItem("local:language",a),a}catch(r){return console.error("Failed to get current language:",r),Sr}}async function Dk(r,e){try{const a=await Rk(),i=await Ly(a),s=Ry(i,r);if(s&&typeof s=="string")return s;if(a!==Sr){const c=await Ly(Sr),d=Ry(c,r);if(d&&typeof d=="string")return d}return e||r}catch(a){return console.error("Translation error:",a),e||r}}function Bk(r){return r.toISOString().replace("T"," ").replace("Z","").substring(0,23)}function Vf(){return Bk(new Date)}class Xl{constructor(e){this.client=e}async withTransaction(e){this.client.beginTransaction();try{const a=await e();return await this.client.commitTransaction(),a}catch(a){throw this.client.rollbackTransaction(),a}}softDelete(e,a){const i=Vf();return this.client.executeUpdate(`UPDATE ${e} SET IsDeleted = 1, UpdatedAt = ? WHERE Id = ?`,[i,a])}softDeleteByForeignKey(e,a,i){const s=Vf();return this.client.executeUpdate(`UPDATE ${e} SET IsDeleted = 1, UpdatedAt = ? WHERE ${a} = ?`,[s,i])}hardDelete(e,a){return this.client.executeUpdate(`DELETE FROM ${e} WHERE Id = ?`,[a])}hardDeleteByForeignKey(e,a,i){return this.client.executeUpdate(`DELETE FROM ${e} WHERE ${a} = ?`,[i])}tableExists(e){return this.client.executeQuery("SELECT name FROM sqlite_master WHERE type='table' AND name=?",[e]).length>0}generateId(){return crypto.randomUUID().toUpperCase()}now(){return Vf()}buildInClause(e){return{placeholders:e.map(()=>"?").join(","),values:e}}}var $a={LoginUsername:"login.username",LoginPassword:"login.password",LoginEmail:"login.email",LoginUrl:"login.url",CardNumber:"card.number",CardCardholderName:"card.cardholder_name",CardExpiryMonth:"card.expiry_month",CardExpiryYear:"card.expiry_year",CardCvv:"card.cvv",CardPin:"card.pin",AliasFirstName:"alias.first_name",AliasLastName:"alias.last_name",AliasGender:"alias.gender",AliasBirthdate:"alias.birthdate",NotesContent:"notes.content"},ma={Login:"Login",Alias:"Alias",CreditCard:"CreditCard",Note:"Note"},aa={Text:"Text",Password:"Password",Hidden:"Hidden",Email:"Email",URL:"URL",Date:"Date",Number:"Number",Phone:"Phone",TextArea:"TextArea"},dt={Primary:"Primary",Login:"Login",Alias:"Alias",Card:"Card",Custom:"Custom",Notes:"Notes",Metadata:"Metadata"},wh={"login.email":{FieldKey:"login.email",FieldType:"Email",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Login:{ShowByDefault:!1},Alias:{ShowByDefault:!0}},EnableHistory:!0,Category:dt.Login,DefaultDisplayOrder:10},"login.username":{FieldKey:"login.username",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Login:{ShowByDefault:!0},Alias:{ShowByDefault:!0}},EnableHistory:!0,Category:dt.Login,DefaultDisplayOrder:15},"login.password":{FieldKey:"login.password",FieldType:"Password",IsHidden:!0,IsMultiValue:!1,ApplicableToTypes:{Login:{ShowByDefault:!0},Alias:{ShowByDefault:!0}},EnableHistory:!0,Category:dt.Login,DefaultDisplayOrder:20},"login.url":{FieldKey:"login.url",FieldType:"URL",IsHidden:!1,IsMultiValue:!0,ApplicableToTypes:{Login:{ShowByDefault:!0},Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Primary,DefaultDisplayOrder:5},"alias.first_name":{FieldKey:"alias.first_name",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Alias,DefaultDisplayOrder:20},"alias.last_name":{FieldKey:"alias.last_name",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Alias,DefaultDisplayOrder:30},"alias.gender":{FieldKey:"alias.gender",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Alias,DefaultDisplayOrder:50},"alias.birthdate":{FieldKey:"alias.birthdate",FieldType:"Date",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Alias,DefaultDisplayOrder:60},"card.cardholder_name":{FieldKey:"card.cardholder_name",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Card,DefaultDisplayOrder:10},"card.number":{FieldKey:"card.number",FieldType:"Hidden",IsHidden:!0,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Card,DefaultDisplayOrder:20},"card.expiry_month":{FieldKey:"card.expiry_month",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Card,DefaultDisplayOrder:30},"card.expiry_year":{FieldKey:"card.expiry_year",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Card,DefaultDisplayOrder:40},"card.cvv":{FieldKey:"card.cvv",FieldType:"Hidden",IsHidden:!0,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Card,DefaultDisplayOrder:50},"card.pin":{FieldKey:"card.pin",FieldType:"Hidden",IsHidden:!0,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!1}},EnableHistory:!1,Category:dt.Card,DefaultDisplayOrder:60},"notes.content":{FieldKey:"notes.content",FieldType:"TextArea",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Login:{ShowByDefault:!1},Alias:{ShowByDefault:!1},CreditCard:{ShowByDefault:!1},Note:{ShowByDefault:!0}},EnableHistory:!1,Category:dt.Notes,DefaultDisplayOrder:100}};function fo(r){return wh[r]}function jl(r,e){return e in r.ApplicableToTypes}function Ml(r,e){const a=r.ApplicableToTypes[e];return(a==null?void 0:a.ShowByDefault)??!1}function Uk(r){return Object.values(wh).filter(e=>jl(e,r)).sort((e,a)=>e.DefaultDisplayOrder-a.DefaultDisplayOrder)}function _k(r){return Object.values(wh).filter(e=>jl(e,r)&&!Ml(e,r)).sort((e,a)=>e.DefaultDisplayOrder-a.DefaultDisplayOrder)}function fu(r,e){const a=r.Fields.find(i=>i.FieldKey===e);if(a)return Array.isArray(a.Value)?a.Value[0]:a.Value}function Mk(r,e){const a={};return r.Fields.forEach(i=>{const s=e(i);a[s]||(a[s]=[]),a[s].push(i)}),a}function Fk(r){const e=Mk(r,a=>a.FieldKey.startsWith("login.")?dt.Login:a.FieldKey.startsWith("alias.")?dt.Alias:a.FieldKey.startsWith("card.")?dt.Card:a.FieldKey.startsWith("notes.")?dt.Notes:a.FieldKey.startsWith("metadata.")?dt.Metadata:dt.Custom);for(const a of Object.keys(e))e[a].sort((i,s)=>(i.DisplayOrder??0)-(s.DisplayOrder??0));return e}function gu(r,e){const a=fo(r);if(!a)throw new Error(`Unknown system field: ${r}. Use createCustomField for custom fields.`);return{FieldKey:r,Label:e.label??r,FieldType:a.FieldType,Value:e.value,IsHidden:a.IsHidden,DisplayOrder:e.displayOrder??a.DefaultDisplayOrder,IsCustomField:!1,EnableHistory:a.EnableHistory}}var Kf=10;class Gf{static processFieldRows(e){const a=e.map(c=>this.processFieldRow(c)),i=new Map,s=new Map;for(const c of a){const d=`${c.ItemId}_${c.FieldKey}`;s.has(d)||s.set(d,[]),s.get(d).push(c.Value),i.has(c.ItemId)||i.set(c.ItemId,[]);const m=i.get(c.ItemId);m.find(f=>f.FieldKey===c.FieldKey)||m.push({FieldKey:c.FieldKey,Label:c.Label,FieldType:c.FieldType,Value:"",IsHidden:c.IsHidden===1,DisplayOrder:c.DisplayOrder,IsCustomField:c.IsCustomField,EnableHistory:c.EnableHistory})}for(const[c,d]of i)for(const m of d){const g=`${c}_${m.FieldKey}`,f=s.get(g)||[];f.length===1?m.Value=f[0]:m.Value=f}return i}static processFieldRow(e){if(e.FieldKey){const a=fo(e.FieldKey);return{ItemId:e.ItemId,FieldKey:e.FieldKey,Label:e.FieldKey,FieldType:(a==null?void 0:a.FieldType)||aa.Text,IsHidden:a!=null&&a.IsHidden?1:0,Value:e.Value,DisplayOrder:(a==null?void 0:a.DefaultDisplayOrder)??e.DisplayOrder,IsCustomField:!1,EnableHistory:(a==null?void 0:a.EnableHistory)??!1}}else return{ItemId:e.ItemId,FieldKey:e.FieldDefinitionId||"",Label:e.CustomLabel||"",FieldType:e.CustomFieldType||aa.Text,IsHidden:e.CustomIsHidden||0,Value:e.Value,DisplayOrder:e.DisplayOrder,IsCustomField:!0,EnableHistory:e.CustomEnableHistory===1}}static processFieldRowsForSingleItem(e){const a=new Map,i=new Map;for(const s of e){const c=s.FieldKey||s.FieldDefinitionId||"";if(a.has(c)||a.set(c,[]),a.get(c).push(s.Value),!i.has(c))if(s.FieldKey){const d=fo(s.FieldKey);i.set(c,{FieldKey:s.FieldKey,Label:s.FieldKey,FieldType:(d==null?void 0:d.FieldType)||aa.Text,IsHidden:d!=null&&d.IsHidden?1:0,DisplayOrder:(d==null?void 0:d.DefaultDisplayOrder)??s.DisplayOrder,IsCustomField:!1,EnableHistory:(d==null?void 0:d.EnableHistory)??!1})}else i.set(c,{FieldKey:c,Label:s.CustomLabel||"",FieldType:s.CustomFieldType||aa.Text,IsHidden:s.CustomIsHidden||0,DisplayOrder:s.DisplayOrder,IsCustomField:!0,EnableHistory:s.CustomEnableHistory===1})}return Array.from(i.entries()).map(([s,c])=>{const d=a.get(s)||[];return{...c,FieldType:c.FieldType,Value:d.length===1?d[0]:d,IsHidden:c.IsHidden===1,IsCustomField:c.IsCustomField,EnableHistory:c.EnableHistory}})}}class vl{static mapRow(e,a=[],i=[]){return{Id:e.Id,Name:e.Name,ItemType:e.ItemType,Logo:e.Logo??void 0,FolderId:e.FolderId,FolderPath:e.FolderPath||null,Tags:i,Fields:a,HasPasskey:e.HasPasskey===1,HasAttachment:e.HasAttachment===1,HasTotp:e.HasTotp===1,CreatedAt:e.CreatedAt,UpdatedAt:e.UpdatedAt}}static mapRows(e,a,i){return e.map(s=>this.mapRow(s,a.get(s.Id)||[],i.get(s.Id)||[]))}static groupTagsByItem(e){const a=new Map;for(const i of e)a.has(i.ItemId)||a.set(i.ItemId,[]),a.get(i.ItemId).push({Id:i.Id,Name:i.Name,Color:i.Color||void 0});return a}static mapTagRows(e){return e.map(a=>({Id:a.Id,Name:a.Name,Color:a.Color||void 0}))}static mapDeletedItemRow(e,a=[]){return{Id:e.Id,Name:e.Name,ItemType:e.ItemType,Logo:e.Logo?new Uint8Array(e.Logo):void 0,FolderId:e.FolderId,FolderPath:e.FolderPath,DeletedAt:e.DeletedAt,HasPasskey:e.HasPasskey===1,HasAttachment:e.HasAttachment===1,HasTotp:e.HasTotp===1,Fields:a,CreatedAt:e.CreatedAt,UpdatedAt:e.UpdatedAt}}}function Dy(r){return new Date(r).getTime()}class qf{static mapRow(e){return{Id:e.Id,ItemId:e.ItemId,RpId:e.RpId,UserHandle:e.UserHandle??void 0,PublicKey:e.PublicKey,PrivateKey:e.PrivateKey,DisplayName:e.DisplayName,PrfKey:e.PrfKey??void 0,AdditionalData:e.AdditionalData,CreatedAt:Dy(e.CreatedAt),UpdatedAt:Dy(e.UpdatedAt),IsDeleted:e.IsDeleted}}static mapRowWithItem(e){return{...this.mapRow(e),Username:e.Username,ServiceName:e.ServiceName}}static mapRows(e){return e.map(a=>this.mapRow(a))}static mapRowsWithItem(e){return e.map(a=>this.mapRowWithItem(a))}}const _a=class _a{static getFieldValuesForItems(e){return`
      SELECT
        fv.ItemId,
        fv.FieldKey,
        fv.FieldDefinitionId,
        fd.Label as CustomLabel,
        fd.FieldType as CustomFieldType,
        fd.IsHidden as CustomIsHidden,
        fd.EnableHistory as CustomEnableHistory,
        fv.Value,
        fv.Weight as DisplayOrder
      FROM FieldValues fv
      LEFT JOIN FieldDefinitions fd ON fv.FieldDefinitionId = fd.Id
      WHERE fv.ItemId IN (${Array(e).fill("?").join(",")})
        AND fv.IsDeleted = 0
      ORDER BY fv.ItemId, fv.Weight`}static getTagsForItems(e){return`
      SELECT
        it.ItemId,
        t.Id,
        t.Name,
        t.Color
      FROM ItemTags it
      INNER JOIN Tags t ON it.TagId = t.Id
      WHERE it.ItemId IN (${Array(e).fill("?").join(",")})
        AND it.IsDeleted = 0
        AND t.IsDeleted = 0
      ORDER BY t.DisplayOrder, t.Name`}};ze(_a,"BASE_SELECT",`
    SELECT DISTINCT
      i.Id,
      i.Name,
      i.ItemType,
      i.FolderId,
      f.Name as FolderPath,
      l.FileData as Logo,
      CASE WHEN EXISTS (SELECT 1 FROM Passkeys pk WHERE pk.ItemId = i.Id AND pk.IsDeleted = 0) THEN 1 ELSE 0 END as HasPasskey,
      CASE WHEN EXISTS (SELECT 1 FROM Attachments att WHERE att.ItemId = i.Id AND att.IsDeleted = 0) THEN 1 ELSE 0 END as HasAttachment,
      CASE WHEN EXISTS (SELECT 1 FROM TotpCodes tc WHERE tc.ItemId = i.Id AND tc.IsDeleted = 0) THEN 1 ELSE 0 END as HasTotp,
      i.CreatedAt,
      i.UpdatedAt
    FROM Items i
    LEFT JOIN Logos l ON i.LogoId = l.Id
    LEFT JOIN Folders f ON i.FolderId = f.Id`),ze(_a,"GET_ALL_ACTIVE",`
    ${_a.BASE_SELECT}
    WHERE i.IsDeleted = 0 AND i.DeletedAt IS NULL
    ORDER BY i.CreatedAt DESC`),ze(_a,"GET_BY_ID",`
    SELECT
      i.Id,
      i.Name,
      i.ItemType,
      i.FolderId,
      l.FileData as Logo,
      CASE WHEN EXISTS (SELECT 1 FROM Passkeys pk WHERE pk.ItemId = i.Id AND pk.IsDeleted = 0) THEN 1 ELSE 0 END as HasPasskey,
      CASE WHEN EXISTS (SELECT 1 FROM Attachments att WHERE att.ItemId = i.Id AND att.IsDeleted = 0) THEN 1 ELSE 0 END as HasAttachment,
      CASE WHEN EXISTS (SELECT 1 FROM TotpCodes tc WHERE tc.ItemId = i.Id AND tc.IsDeleted = 0) THEN 1 ELSE 0 END as HasTotp,
      i.CreatedAt,
      i.UpdatedAt
    FROM Items i
    LEFT JOIN Logos l ON i.LogoId = l.Id
    WHERE i.Id = ? AND i.IsDeleted = 0`),ze(_a,"GET_RECENTLY_DELETED",`
    ${_a.BASE_SELECT},
      i.DeletedAt
    FROM Items i
    LEFT JOIN Logos l ON i.LogoId = l.Id
    LEFT JOIN Folders f ON i.FolderId = f.Id
    WHERE i.IsDeleted = 0 AND i.DeletedAt IS NOT NULL
    ORDER BY i.DeletedAt DESC`),ze(_a,"COUNT_RECENTLY_DELETED",`
    SELECT COUNT(*) as count
    FROM Items
    WHERE IsDeleted = 0 AND DeletedAt IS NOT NULL`),ze(_a,"GET_FIELD_VALUES_FOR_ITEM",`
    SELECT
      fv.FieldKey,
      fv.FieldDefinitionId,
      fd.Label as CustomLabel,
      fd.FieldType as CustomFieldType,
      fd.IsHidden as CustomIsHidden,
      fd.EnableHistory as CustomEnableHistory,
      fv.Value,
      fv.Weight as DisplayOrder
    FROM FieldValues fv
    LEFT JOIN FieldDefinitions fd ON fv.FieldDefinitionId = fd.Id
    WHERE fv.ItemId = ? AND fv.IsDeleted = 0
    ORDER BY fv.Weight`),ze(_a,"GET_TAGS_FOR_ITEM",`
    SELECT
      t.Id,
      t.Name,
      t.Color
    FROM ItemTags it
    INNER JOIN Tags t ON it.TagId = t.Id
    WHERE it.ItemId = ? AND it.IsDeleted = 0 AND t.IsDeleted = 0
    ORDER BY t.DisplayOrder, t.Name`),ze(_a,"INSERT_ITEM",`
    INSERT INTO Items (Id, Name, ItemType, LogoId, FolderId, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?)`),ze(_a,"UPDATE_ITEM",`
    UPDATE Items
    SET Name = ?,
        ItemType = ?,
        FolderId = ?,
        LogoId = COALESCE(?, LogoId),
        UpdatedAt = ?
    WHERE Id = ?`),ze(_a,"UPDATE_ITEM_WITH_LOGO",`
    UPDATE Items
    SET Name = ?,
        ItemType = ?,
        FolderId = ?,
        LogoId = ?,
        UpdatedAt = ?
    WHERE Id = ?`),ze(_a,"TRASH_ITEM",`
    UPDATE Items
    SET DeletedAt = ?,
        UpdatedAt = ?
    WHERE Id = ? AND IsDeleted = 0`),ze(_a,"RESTORE_ITEM",`
    UPDATE Items
    SET DeletedAt = NULL,
        UpdatedAt = ?
    WHERE Id = ? AND IsDeleted = 0 AND DeletedAt IS NOT NULL`),ze(_a,"TOMBSTONE_ITEM",`
    UPDATE Items
    SET IsDeleted = 1,
        Name = NULL,
        LogoId = NULL,
        FolderId = NULL,
        UpdatedAt = ?
    WHERE Id = ?`),ze(_a,"GET_LOGO_ID",`
    SELECT LogoId FROM Items WHERE Id = ?`),ze(_a,"GET_ALL_EMAIL_ADDRESSES",`
    SELECT DISTINCT fv.Value as Email
    FROM FieldValues fv
    INNER JOIN Items i ON fv.ItemId = i.Id
    WHERE fv.FieldKey = ?
      AND fv.Value IS NOT NULL
      AND fv.Value != ''
      AND fv.IsDeleted = 0
      AND i.IsDeleted = 0`);let Ja=_a;class lr{}ze(lr,"GET_EXISTING_FOR_ITEM",`
    SELECT Id, FieldKey, FieldDefinitionId, Value
    FROM FieldValues
    WHERE ItemId = ? AND IsDeleted = 0`),ze(lr,"INSERT",`
    INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`),ze(lr,"UPDATE",`
    UPDATE FieldValues
    SET Value = ?,
        Weight = ?,
        UpdatedAt = ?
    WHERE Id = ?`),ze(lr,"SOFT_DELETE",`
    UPDATE FieldValues
    SET IsDeleted = 1,
        UpdatedAt = ?
    WHERE Id = ?`),ze(lr,"GET_FOR_HISTORY",`
    SELECT FieldKey, Value
    FROM FieldValues
    WHERE ItemId = ? AND IsDeleted = 0 AND FieldKey IS NOT NULL`);class ai{}ze(ai,"EXISTS",`
    SELECT Id FROM FieldDefinitions WHERE Id = ?`),ze(ai,"EXISTS_ACTIVE",`
    SELECT Id FROM FieldDefinitions WHERE Id = ? AND IsDeleted = 0`),ze(ai,"INSERT",`
    INSERT INTO FieldDefinitions (Id, FieldType, Label, IsMultiValue, IsHidden, EnableHistory, Weight, ApplicableToTypes, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`),ze(ai,"UPDATE",`
    UPDATE FieldDefinitions
    SET Label = ?,
        FieldType = ?,
        IsHidden = ?,
        Weight = ?,
        UpdatedAt = ?
    WHERE Id = ?`);class xr{static softDeleteOld(e){return`
      UPDATE FieldHistories
      SET IsDeleted = 1, UpdatedAt = ?
      WHERE Id IN (${Array(e).fill("?").join(",")})`}}ze(xr,"INSERT",`
    INSERT INTO FieldHistories (Id, ItemId, FieldDefinitionId, FieldKey, ValueSnapshot, ChangedAt, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`),ze(xr,"GET_FOR_FIELD",`
    SELECT
      Id,
      ItemId,
      FieldKey,
      ValueSnapshot,
      ChangedAt,
      CreatedAt,
      UpdatedAt
    FROM FieldHistories
    WHERE ItemId = ? AND FieldKey = ? AND IsDeleted = 0
    ORDER BY ChangedAt DESC
    LIMIT ?`),ze(xr,"GET_FOR_PRUNING",`
    SELECT Id, ChangedAt
    FROM FieldHistories
    WHERE ItemId = ? AND FieldKey = ? AND IsDeleted = 0
    ORDER BY ChangedAt DESC`),ze(xr,"SOFT_DELETE",`
    UPDATE FieldHistories
    SET IsDeleted = 1, UpdatedAt = ?
    WHERE Id = ?`);class Ok extends Xl{constructor(e,a){super(e),this.logoRepository=a}getAll(){let e;try{e=this.client.executeQuery(Ja.GET_ALL_ACTIVE)}catch(m){if(m instanceof Error&&m.message.includes("no such table"))return[];throw m}if(e.length===0)return[];const a=e.map(m=>m.Id),i=this.client.executeQuery(Ja.getFieldValuesForItems(a.length),a),s=Gf.processFieldRows(i),c=this.client.executeQuery(Ja.getTagsForItems(a.length),a),d=vl.groupTagsByItem(c);return vl.mapRows(e,s,d)}getById(e){const a=this.client.executeQuery(Ja.GET_BY_ID,[e]);if(a.length===0)return null;const i=this.client.executeQuery(Ja.GET_FIELD_VALUES_FOR_ITEM,[e]),s=Gf.processFieldRowsForSingleItem(i),c=this.client.executeQuery(Ja.GET_TAGS_FOR_ITEM,[e]),d=vl.mapTagRows(c);return vl.mapRow(a[0],s,d)}getAllEmailAddresses(){return this.client.executeQuery(Ja.GET_ALL_EMAIL_ADDRESSES,[$a.LoginEmail]).map(a=>a.Email)}async create(e,a=[],i=[]){return this.withTransaction(async()=>{const s=this.now(),c=e.Id||this.generateId(),d=this.resolveLogoId(e,s);return this.client.executeUpdate(Ja.INSERT_ITEM,[c,e.Name??null,e.ItemType,d,e.FolderId??null,s,s,0]),e.Fields&&e.Fields.length>0&&this.insertFieldValues(c,e.Fields,e.ItemType,s),this.insertTotpCodes(c,i,s),this.insertAttachments(c,a,s),c})}async update(e,a=[],i=[],s=[],c=[]){return this.withTransaction(async()=>{const d=this.now(),m=this.resolveLogoId(e,d),g=this.client.executeQuery("SELECT Name, ItemType, FolderId, LogoId FROM Items WHERE Id = ?",[e.Id])[0];if(g){const f=(e.Name??null)!==g.Name,E=String(e.ItemType)!==String(g.ItemType),p=(e.FolderId??null)!==g.FolderId,C=m!==g.LogoId;(f||E||p||C)&&this.client.executeUpdate(Ja.UPDATE_ITEM_WITH_LOGO,[e.Name??null,e.ItemType,e.FolderId??null,m,d,e.Id])}return await this.trackFieldHistory(e.Id,e.Fields,d),this.updateFieldValues(e,d),this.handleTotpCodes(e.Id,c,s,d),this.handleAttachments(e.Id,i,a,d),1})}async trash(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(Ja.TRASH_ITEM,[a,a,e])})}async restore(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(Ja.RESTORE_ITEM,[a,e])})}async permanentlyDelete(e){return this.withTransaction(async()=>{const a=this.now(),i=this.client.executeQuery(Ja.GET_LOGO_ID,[e]),s=i.length>0?i[0].LogoId:null;this.hardDeleteByForeignKey("FieldValues","ItemId",e),this.hardDeleteByForeignKey("FieldHistories","ItemId",e),this.hardDeleteByForeignKey("Passkeys","ItemId",e),this.hardDeleteByForeignKey("TotpCodes","ItemId",e),this.hardDeleteByForeignKey("Attachments","ItemId",e),this.hardDeleteByForeignKey("ItemTags","ItemId",e);const c=this.client.executeUpdate(Ja.TOMBSTONE_ITEM,[a,e]);return s&&this.logoRepository.cleanupOrphanedLogo(s),c})}getRecentlyDeleted(){let e;try{e=this.client.executeQuery(`
        SELECT DISTINCT
          i.Id,
          i.Name,
          i.ItemType,
          i.FolderId,
          f.Name as FolderPath,
          l.FileData as Logo,
          i.DeletedAt,
          CASE WHEN EXISTS (SELECT 1 FROM Passkeys pk WHERE pk.ItemId = i.Id AND pk.IsDeleted = 0) THEN 1 ELSE 0 END as HasPasskey,
          CASE WHEN EXISTS (SELECT 1 FROM Attachments att WHERE att.ItemId = i.Id AND att.IsDeleted = 0) THEN 1 ELSE 0 END as HasAttachment,
          CASE WHEN EXISTS (SELECT 1 FROM TotpCodes tc WHERE tc.ItemId = i.Id AND tc.IsDeleted = 0) THEN 1 ELSE 0 END as HasTotp,
          i.CreatedAt,
          i.UpdatedAt
        FROM Items i
        LEFT JOIN Logos l ON i.LogoId = l.Id
        LEFT JOIN Folders f ON i.FolderId = f.Id
        WHERE i.IsDeleted = 0 AND i.DeletedAt IS NOT NULL
        ORDER BY i.DeletedAt DESC`)}catch(c){if(c instanceof Error&&c.message.includes("no such table"))return[];throw c}if(e.length===0)return[];const a=e.map(c=>c.Id),i=this.client.executeQuery(Ja.getFieldValuesForItems(a.length),a),s=Gf.processFieldRows(i);return e.map(c=>vl.mapDeletedItemRow(c,s.get(c.Id)||[]))}getRecentlyDeletedCount(){var e;try{return((e=this.client.executeQuery(Ja.COUNT_RECENTLY_DELETED)[0])==null?void 0:e.count)||0}catch(a){if(a instanceof Error&&a.message.includes("no such table"))return 0;throw a}}getFieldHistory(e,a){return this.client.executeQuery(xr.GET_FOR_FIELD,[e,a,Kf]).map(s=>({Id:s.Id,ItemId:s.ItemId,FieldKey:s.FieldKey,ValueSnapshot:s.ValueSnapshot,ChangedAt:s.ChangedAt,CreatedAt:s.CreatedAt,UpdatedAt:s.UpdatedAt}))}async deleteFieldHistory(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(xr.SOFT_DELETE,[a,e])})}resolveLogoId(e,a){var m;const i=(m=e.Fields)==null?void 0:m.find(g=>g.FieldKey==="login.url"),s=i==null?void 0:i.Value,c=Array.isArray(s)?s[0]:s,d=this.logoRepository.extractSourceFromUrl(c);if(e.Logo){const g=this.logoRepository.convertLogoToUint8Array(e.Logo);if(g)return this.logoRepository.getOrCreate(d,g,a)}else if(d!=="unknown")return this.logoRepository.getIdForSource(d);return null}insertFieldValues(e,a,i,s){for(const c of a){if((!c.Value||typeof c.Value=="string"&&c.Value.trim()==="")&&!c.IsCustomField)continue;let m=null;c.IsCustomField&&(m=this.ensureFieldDefinition(c,i,s));const f=(Array.isArray(c.Value)?c.Value:[c.Value]).filter(p=>p&&p.trim()!==""),E=c.IsCustomField&&f.length===0?[""]:f;for(const p of E)this.client.executeUpdate(lr.INSERT,[this.generateId(),e,m,c.IsCustomField?null:c.FieldKey,p,c.DisplayOrder??0,s,s,0]);if(c.EnableHistory&&f.length>0){const p=this.generateId(),C=JSON.stringify(f);this.client.executeUpdate(xr.INSERT,[p,e,null,c.FieldKey,C,s,s,s,0])}}}ensureFieldDefinition(e,a,i){return this.client.executeQuery(ai.EXISTS,[e.FieldKey]).length===0&&this.client.executeUpdate(ai.INSERT,[e.FieldKey,e.FieldType,e.Label,0,e.IsHidden?1:0,0,e.DisplayOrder??0,a,i,i,0]),e.FieldKey}updateFieldValues(e,a){const i=this.client.executeQuery(lr.GET_EXISTING_FOR_ITEM,[e.Id]),s=new Map,c=new Map;for(const m of i){const g=m.FieldKey||m.FieldDefinitionId||"",f=c.get(g)||0;s.set(`${g}:${f}`,{Id:m.Id,Value:m.Value}),c.set(g,f+1)}const d=new Set;if(e.Fields&&e.Fields.length>0)for(const m of e.Fields){if((!m.Value||typeof m.Value=="string"&&m.Value.trim()==="")&&!m.IsCustomField)continue;let f=null;m.IsCustomField&&(f=this.ensureOrUpdateFieldDefinition(m,e.ItemType,a));const E=Array.isArray(m.Value)?m.Value:[m.Value],p=m.FieldKey,C=E.filter(x=>x&&(typeof x!="string"||x.trim()!=="")),I=m.IsCustomField&&C.length===0?[""]:C;for(let x=0;x<I.length;x++){const T=I[x],k=`${p}:${x}`,R=s.get(k);R?(d.add(R.Id),R.Value!==T&&this.client.executeUpdate(lr.UPDATE,[T,m.DisplayOrder??0,a,R.Id])):this.client.executeUpdate(lr.INSERT,[this.generateId(),e.Id,f,m.IsCustomField?null:m.FieldKey,T,m.DisplayOrder??0,a,a,0])}}for(const m of i)d.has(m.Id)||this.client.executeUpdate(lr.SOFT_DELETE,[a,m.Id])}ensureOrUpdateFieldDefinition(e,a,i){return this.client.executeQuery(ai.EXISTS_ACTIVE,[e.FieldKey]).length===0?this.client.executeUpdate(ai.INSERT,[e.FieldKey,e.FieldType,e.Label,0,e.IsHidden?1:0,0,e.DisplayOrder??0,a,i,i,0]):this.client.executeUpdate(ai.UPDATE,[e.Label,e.FieldType,e.IsHidden?1:0,e.DisplayOrder??0,i,e.FieldKey]),e.FieldKey}async trackFieldHistory(e,a,i){const s=this.client.executeQuery(lr.GET_FOR_HISTORY,[e]),c={};for(const d of s)c[d.FieldKey]||(c[d.FieldKey]=[]),c[d.FieldKey].push(d.Value);for(const d of a){if(!d.EnableHistory)continue;const m=c[d.FieldKey]||[],f=(Array.isArray(d.Value)?d.Value:[d.Value]).filter(p=>p&&p.trim()!=="");if((m.length!==f.length||!m.every((p,C)=>p===f[C]))&&f.length>0){const p=this.generateId(),C=JSON.stringify(f);this.client.executeUpdate(xr.INSERT,[p,e,null,d.FieldKey,C,i,i,i,0]),await this.pruneFieldHistory(e,d.FieldKey,i)}}}async pruneFieldHistory(e,a,i){const s=this.client.executeQuery(xr.GET_FOR_PRUNING,[e,a]);if(s.length>Kf){const d=s.slice(Kf).map(m=>m.Id);d.length>0&&this.client.executeUpdate(xr.softDeleteOld(d.length),[i,...d])}}insertTotpCodes(e,a,i){for(const s of a)this.client.executeUpdate(`INSERT INTO TotpCodes (Id, Name, SecretKey, ItemId, CreatedAt, UpdatedAt, IsDeleted)
         VALUES (?, ?, ?, ?, ?, ?, ?)`,[s.Id||this.generateId(),s.Name,s.SecretKey,e,i,i,0])}handleTotpCodes(e,a,i,s){const c=this.client.executeQuery("SELECT Id, Name, SecretKey FROM TotpCodes WHERE ItemId = ? AND IsDeleted = 0",[e]),d=new Map(c.map(m=>[m.Id,m]));for(const m of a){const g=i.includes(m.Id);if(m.IsDeleted)g&&this.client.executeUpdate("UPDATE TotpCodes SET IsDeleted = 1, UpdatedAt = ? WHERE Id = ?",[s,m.Id]);else if(g){const f=d.get(m.Id);f&&(f.Name!==m.Name||f.SecretKey!==m.SecretKey)&&this.client.executeUpdate("UPDATE TotpCodes SET Name = ?, SecretKey = ?, UpdatedAt = ? WHERE Id = ?",[m.Name,m.SecretKey,s,m.Id])}else this.client.executeUpdate(`INSERT INTO TotpCodes (Id, Name, SecretKey, ItemId, CreatedAt, UpdatedAt, IsDeleted)
           VALUES (?, ?, ?, ?, ?, ?, ?)`,[m.Id||this.generateId(),m.Name,m.SecretKey,e,s,s,0])}}insertAttachments(e,a,i){for(const s of a){const c=s.Blob instanceof Uint8Array?s.Blob:new Uint8Array(s.Blob);this.client.executeUpdate(`INSERT INTO Attachments (Id, Filename, Blob, ItemId, CreatedAt, UpdatedAt, IsDeleted)
         VALUES (?, ?, ?, ?, ?, ?, ?)`,[s.Id||this.generateId(),s.Filename,c,e,i,i,0])}}handleAttachments(e,a,i,s){const c=new Set(a.map(d=>d.Id));for(const d of i)c.has(d)||this.client.executeUpdate("UPDATE Attachments SET IsDeleted = 1, UpdatedAt = ? WHERE Id = ?",[s,d]);for(const d of a){const m=i.includes(d.Id);if(d.IsDeleted)m&&this.client.executeUpdate("UPDATE Attachments SET IsDeleted = 1, UpdatedAt = ? WHERE Id = ?",[s,d.Id]);else if(!m){const g=d.Blob instanceof Uint8Array?d.Blob:new Uint8Array(d.Blob);this.client.executeUpdate(`INSERT INTO Attachments (Id, Filename, Blob, ItemId, CreatedAt, UpdatedAt, IsDeleted)
           VALUES (?, ?, ?, ?, ?, ?, ?)`,[d.Id||this.generateId(),d.Filename,g,e,s,s,0])}}}}const fs={GET_BY_RP_ID:`
    SELECT
      p.Id,
      p.ItemId,
      p.RpId,
      p.UserHandle,
      p.PublicKey,
      p.PrivateKey,
      p.DisplayName,
      p.PrfKey,
      p.AdditionalData,
      p.CreatedAt,
      p.UpdatedAt,
      p.IsDeleted,
      i.Name as ServiceName,
      (SELECT fv.Value FROM FieldValues fv WHERE fv.ItemId = i.Id AND fv.FieldKey = '${$a.LoginUsername}' AND fv.IsDeleted = 0 LIMIT 1) as Username
    FROM Passkeys p
    INNER JOIN Items i ON p.ItemId = i.Id
    WHERE p.RpId = ? AND p.IsDeleted = 0
      AND i.IsDeleted = 0 AND i.DeletedAt IS NULL
    ORDER BY p.CreatedAt DESC`,GET_BY_ID_WITH_ITEM:`
    SELECT
      p.Id,
      p.ItemId,
      p.RpId,
      p.UserHandle,
      p.PublicKey,
      p.PrivateKey,
      p.DisplayName,
      p.PrfKey,
      p.AdditionalData,
      p.CreatedAt,
      p.UpdatedAt,
      p.IsDeleted,
      i.Name as ServiceName,
      (SELECT fv.Value FROM FieldValues fv WHERE fv.ItemId = i.Id AND fv.FieldKey = '${$a.LoginUsername}' AND fv.IsDeleted = 0 LIMIT 1) as Username
    FROM Passkeys p
    INNER JOIN Items i ON p.ItemId = i.Id
    WHERE p.Id = ? AND p.IsDeleted = 0
      AND i.IsDeleted = 0 AND i.DeletedAt IS NULL`,GET_BY_ITEM_ID:`
    SELECT
      p.Id,
      p.ItemId,
      p.RpId,
      p.UserHandle,
      p.PublicKey,
      p.PrivateKey,
      p.DisplayName,
      p.PrfKey,
      p.AdditionalData,
      p.CreatedAt,
      p.UpdatedAt,
      p.IsDeleted
    FROM Passkeys p
    WHERE p.ItemId = ? AND p.IsDeleted = 0
    ORDER BY p.CreatedAt DESC`,INSERT:`
    INSERT INTO Passkeys (
      Id, ItemId, RpId, UserHandle, PublicKey, PrivateKey,
      PrfKey, DisplayName, AdditionalData, CreatedAt, UpdatedAt, IsDeleted
    )
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,UPDATE_DISPLAY_NAME:`
    UPDATE Passkeys
    SET DisplayName = ?,
        UpdatedAt = ?
    WHERE Id = ?`,SOFT_DELETE:`
    UPDATE Passkeys
    SET IsDeleted = 1,
        UpdatedAt = ?
    WHERE Id = ?`,SOFT_DELETE_BY_ITEM:`
    UPDATE Passkeys
    SET IsDeleted = 1,
        UpdatedAt = ?
    WHERE ItemId = ?`};class jk extends Xl{getByRpId(e){const a=this.client.executeQuery(fs.GET_BY_RP_ID,[e]);return qf.mapRowsWithItem(a)}getById(e){const a=this.client.executeQuery(fs.GET_BY_ID_WITH_ITEM,[e]);return a.length===0?null:qf.mapRowWithItem(a[0])}getByItemId(e){const a=this.client.executeQuery(fs.GET_BY_ITEM_ID,[e]);return qf.mapRows(a)}async create(e){return this.withTransaction(async()=>{const a=this.now();let i=null;e.PrfKey&&(i=e.PrfKey instanceof Uint8Array?e.PrfKey:new Uint8Array(e.PrfKey));let s=null;e.UserHandle&&(s=e.UserHandle instanceof Uint8Array?e.UserHandle:new Uint8Array(e.UserHandle)),this.client.executeUpdate(fs.INSERT,[e.Id,e.ItemId,e.RpId,s,e.PublicKey,e.PrivateKey,i,e.DisplayName,e.AdditionalData??null,a,a,0])})}async deleteById(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(fs.SOFT_DELETE,[a,e])})}async deleteByItemId(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(fs.SOFT_DELETE_BY_ITEM,[a,e])})}async updateDisplayName(e,a){return this.withTransaction(async()=>{const i=this.now();return this.client.executeUpdate(fs.UPDATE_DISPLAY_NAME,[a,i,e])})}}const $r={GET_ALL:`
    SELECT Id, Name, ParentFolderId, Weight
    FROM Folders
    WHERE IsDeleted = 0
    ORDER BY Weight, Name`,GET_BY_ID:`
    SELECT Id, Name, ParentFolderId
    FROM Folders
    WHERE Id = ? AND IsDeleted = 0`,INSERT:`
    INSERT INTO Folders (Id, Name, ParentFolderId, Weight, IsDeleted, CreatedAt, UpdatedAt)
    VALUES (?, ?, ?, 0, 0, ?, ?)`,UPDATE_NAME:`
    UPDATE Folders
    SET Name = ?,
        UpdatedAt = ?
    WHERE Id = ?`,SOFT_DELETE:`
    UPDATE Folders
    SET IsDeleted = 1,
        UpdatedAt = ?
    WHERE Id = ?`,CLEAR_ITEMS_FOLDER:`
    UPDATE Items
    SET FolderId = NULL,
        UpdatedAt = ?
    WHERE FolderId = ?`,TRASH_ITEMS_IN_FOLDER:`
    UPDATE Items
    SET DeletedAt = ?,
        UpdatedAt = ?,
        FolderId = NULL
    WHERE FolderId = ? AND IsDeleted = 0 AND DeletedAt IS NULL`,MOVE_ITEM:`
    UPDATE Items
    SET FolderId = ?,
        UpdatedAt = ?
    WHERE Id = ?`};class Pk extends Xl{async create(e,a){return this.withTransaction(async()=>{const i=crypto.randomUUID().toUpperCase(),s=this.now();return this.client.executeUpdate($r.INSERT,[i,e,a||null,s,s]),i})}getAll(){try{return this.client.executeQuery($r.GET_ALL)}catch(e){if(e instanceof Error&&e.message.includes("no such table"))return[];throw e}}getById(e){const a=this.client.executeQuery($r.GET_BY_ID,[e]);return a.length>0?a[0]:null}async update(e,a){return this.withTransaction(async()=>{const i=this.now();return this.client.executeUpdate($r.UPDATE_NAME,[a,i,e])})}async delete(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate($r.CLEAR_ITEMS_FOLDER,[a,e]),this.client.executeUpdate($r.SOFT_DELETE,[a,e])})}async deleteWithContents(e){return this.withTransaction(async()=>{const a=this.now(),i=this.client.executeUpdate($r.TRASH_ITEMS_IN_FOLDER,[a,a,e]);return this.client.executeUpdate($r.SOFT_DELETE,[a,e]),i})}async moveItem(e,a){return this.withTransaction(async()=>{const i=this.now();return this.client.executeUpdate($r.MOVE_ITEM,[a,i,e])})}}const hu={GET_SETTING:`
    SELECT s.Value
    FROM Settings s
    WHERE s.Key = ?`,GET_ENCRYPTION_KEYS:`
    SELECT
      x.PublicKey,
      x.PrivateKey,
      x.IsPrimary
    FROM EncryptionKeys x`,GET_TOTP_FOR_ITEM:`
    SELECT
      Id,
      Name,
      SecretKey,
      ItemId
    FROM TotpCodes
    WHERE ItemId = ? AND IsDeleted = 0`,GET_ATTACHMENTS_FOR_ITEM:`
    SELECT
      Id,
      Filename,
      Blob,
      ItemId,
      CreatedAt,
      UpdatedAt,
      IsDeleted
    FROM Attachments
    WHERE ItemId = ? AND IsDeleted = 0`};class Hk extends Xl{getSetting(e,a=""){const i=this.client.executeQuery(hu.GET_SETTING,[e]);return i.length>0?i[0].Value:a}getDefaultIdentityLanguage(){return this.getSetting("DefaultIdentityLanguage")}getDefaultIdentityGender(){return this.getSetting("DefaultIdentityGender","random")}getDefaultIdentityAgeRange(){return this.getSetting("DefaultIdentityAgeRange","random")}getPasswordSettings(){const e=this.getSetting("PasswordGenerationSettings"),a={Length:18,UseLowercase:!0,UseUppercase:!0,UseNumbers:!0,UseSpecialChars:!0,UseNonAmbiguousChars:!1};try{if(e)return{...a,...JSON.parse(e)}}catch(i){console.warn("Failed to parse password settings:",i)}return a}getAllEncryptionKeys(){return this.client.executeQuery(hu.GET_ENCRYPTION_KEYS)}getTotpCodesForItem(e){try{return this.tableExists("TotpCodes")?this.client.executeQuery(hu.GET_TOTP_FOR_ITEM,[e]):[]}catch(a){return console.error("Error getting TOTP codes for item:",a),[]}}getAttachmentsForItem(e){try{return this.tableExists("Attachments")?this.client.executeQuery(hu.GET_ATTACHMENTS_FOR_ITEM,[e]):[]}catch(a){return console.error("Error getting attachments for item:",a),[]}}getDefaultEmailDomain(){return this.getSetting("DefaultEmailDomain")}getEffectiveIdentityLanguage(){const e=this.getDefaultIdentityLanguage();return e||navigator.language.substring(0,2)}}const wl={GET_ID_FOR_SOURCE:`
    SELECT Id FROM Logos
    WHERE Source = ? AND IsDeleted = 0
    LIMIT 1`,INSERT:`
    INSERT INTO Logos (Id, Source, FileData, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?)`,COUNT_USAGE:`
    SELECT COUNT(*) as count FROM Items
    WHERE LogoId = ? AND IsDeleted = 0`,HARD_DELETE:`
    DELETE FROM Logos WHERE Id = ?`};class Qk extends Xl{hasLogoForSource(e){return this.client.executeQuery(wl.GET_ID_FOR_SOURCE,[e]).length>0}getIdForSource(e){const a=this.client.executeQuery(wl.GET_ID_FOR_SOURCE,[e]);return a.length>0?a[0].Id:null}getOrCreate(e,a,i){const s=this.getIdForSource(e);if(s)return s;const c=this.generateId();return this.client.executeUpdate(wl.INSERT,[c,e,a,i,i,0]),c}cleanupOrphanedLogo(e){const a=this.client.executeQuery(wl.COUNT_USAGE,[e]);(a.length>0?a[0].count:0)===0&&(this.client.executeUpdate(wl.HARD_DELETE,[e]),console.debug(`[LogoRepository] Deleted orphaned logo: ${e}`))}extractSourceFromUrl(e){if(!e)return"unknown";try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase().replace(/^www\./,"")}catch{return"unknown"}}convertLogoToUint8Array(e){if(!e)return null;try{if(typeof e=="object"&&!ArrayBuffer.isView(e)&&!Array.isArray(e)){const a=Object.values(e);return new Uint8Array(a)}if(Array.isArray(e)||e instanceof ArrayBuffer||e instanceof Uint8Array)return new Uint8Array(e)}catch(a){console.warn("Failed to convert logo to Uint8Array:",a)}return null}}class Yg{constructor(){ze(this,"db",null);ze(this,"isInTransaction",!1);ze(this,"_items",null);ze(this,"_passkeys",null);ze(this,"_folders",null);ze(this,"_settings",null);ze(this,"_logos",null)}get items(){return this._items||(this._items=new Ok(this,this.logos)),this._items}get passkeys(){return this._passkeys||(this._passkeys=new jk(this)),this._passkeys}get folders(){return this._folders||(this._folders=new Pk(this)),this._folders}get settings(){return this._settings||(this._settings=new Hk(this)),this._settings}get logos(){return this._logos||(this._logos=new Qk(this)),this._logos}getDb(){return this.db}async initializeFromBase64(e){try{const a=atob(e),i=new Uint8Array(a.length);for(let c=0;c<a.length;c++)i[c]=a.charCodeAt(c);const s=await qg({locateFile:c=>`src/${c}`});this.db=new s.Database(i),this._items=null,this._passkeys=null,this._folders=null,this._settings=null,this._logos=null}catch(a){throw console.error("Error initializing SQLite database:",a),a}}beginTransaction(){if(!this.db)throw new Error("Database not initialized");if(this.isInTransaction)throw new Error("Transaction already in progress");try{this.db.run("BEGIN TRANSACTION"),this.isInTransaction=!0}catch(e){throw console.error("Error beginning transaction:",e),e}}async commitTransaction(){if(!this.db)throw new Error("Database not initialized");if(!this.isInTransaction)throw new Error("No transaction in progress");try{this.db.run("COMMIT"),this.isInTransaction=!1}catch(e){throw console.error("Error committing transaction:",e),e}}rollbackTransaction(){if(!this.db)throw new Error("Database not initialized");if(!this.isInTransaction)throw new Error("No transaction in progress");try{this.db.run("ROLLBACK"),this.isInTransaction=!1}catch(e){throw console.error("Error rolling back transaction:",e),e}}exportToBase64(){if(!this.db)throw new Error("Database not initialized");try{this.db.run("VACUUM");const e=this.db.export();let a="";for(let i=0;i<e.length;i++)a+=String.fromCharCode(e[i]);return btoa(a)}catch(e){throw console.error("Error exporting SQLite database:",e),e}}executeQuery(e,a=[]){if(!this.db)throw new Error("Database not initialized");try{const i=this.db.prepare(e);i.bind(a);const s=[];for(;i.step();)s.push(i.getAsObject());return i.free(),s}catch(i){throw console.error("Error executing query:",i),i}}executeUpdate(e,a=[]){if(!this.db)throw new Error("Database not initialized");try{const i=this.db.prepare(e);i.bind(a),i.step();const s=this.db.getRowsModified();return i.free(),s}catch(i){throw console.error("Error executing update:",i),i}}executeRaw(e){if(!this.db)throw new Error("Database not initialized");try{const a=e.split(";");for(const i of a){const s=i.trim();s.length===0||s.toUpperCase().startsWith("BEGIN TRANSACTION")||s.toUpperCase().startsWith("COMMIT")||s.toUpperCase().startsWith("ROLLBACK")||this.db.run(s)}}catch(a){throw console.error("Error executing raw SQL:",a),a}}close(){this.db&&(this.db.close(),this.db=null)}async getDatabaseVersion(){if(!this.db)throw new Error("Database not initialized");try{const e=this.executeQuery(`
        SELECT MigrationId
        FROM __EFMigrationsHistory
        ORDER BY MigrationId DESC
        LIMIT 1`);if(e.length===0)throw new Error("No migrations found in the database.");const a=e[0].MigrationId,i=Ix(a);if(!i)throw new Error("Could not extract version from migration ID");const s=bx(i);if(!s.isCompatible){const m=await Dk("common.errors.browserExtensionOutdated");throw new vs(m)}if(s.isKnownVersion&&s.clientVersion)return s.clientVersion;const d=new Wg().getLatestVersion();return{revision:d.revision,version:i,description:`Unknown version ${i} (backwards compatible)`,releaseVersion:d.releaseVersion,compatibleUpToVersion:d.compatibleUpToVersion}}catch(e){throw console.error("Error getting database version:",e),e}}async getLatestDatabaseVersion(){const a=new Wg().getAllVersions();return a[a.length-1]}async hasPendingMigrations(){try{const e=await this.getDatabaseVersion(),a=await this.getLatestDatabaseVersion();return e.revision<a.revision}catch(e){throw console.error("Error checking pending migrations:",e),e}}static imgSrcFromBytes(e){if(!e||Array.isArray(e)&&e.length===0||e instanceof Uint8Array&&e.length===0)return null;try{const a=this.toUint8Array(e),i=this.base64Encode(a);return i?`data:${this.detectMimeType(a)};base64,${i}`:null}catch(a){return console.error("Error setting logo:",a),null}}static extractSourceFromUrl(e){if(!e)return"unknown";try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase().replace(/^www\./,"")}catch{return"unknown"}}static detectMimeType(e){const a=()=>{const c=new TextDecoder().decode(e.slice(0,5)).toLowerCase();return c.includes("<?xml")||c.includes("<svg")},i=()=>e[0]===0&&e[1]===0&&e[2]===1&&e[3]===0,s=()=>e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71;return a()?"image/svg+xml":i()?"image/x-icon":s()?"image/png":"image/x-icon"}static toUint8Array(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);const a=Object.keys(e).length,i=new Uint8Array(a);for(let s=0;s<a;s++)i[s]=e[s];return i}static base64Encode(e){try{const a=Array.from(this.toUint8Array(e));return btoa(a.reduce((i,s)=>i+String.fromCharCode(s),""))}catch(a){return console.error("Error encoding to base64:",a),null}}}const By={"local:publicEmailDomains":"session:publicEmailDomains","local:privateEmailDomains":"session:privateEmailDomains","local:hiddenPrivateEmailDomains":"session:hiddenPrivateEmailDomains","local:encryptionKeyDerivationParams":"session:encryptionKeyDerivationParams"};async function Pl(r){let e=await ke.getItem(r);if(e===null&&r in By){const a=By[r];e=await ke.getItem(a),e!==null&&(await ke.setItem(r,e),await ke.removeItem(a))}return e}const aI=w.createContext(void 0),zk=({children:r})=>{const[e,a]=w.useState(null),[i,s]=w.useState(!1),[c,d]=w.useState(!1),[m,g]=w.useState(!1),f=w.useRef(!1),[E,p]=w.useState(!1),[C,I]=w.useState(!1),[x,T]=w.useState(0),k=w.useCallback(()=>E||C,[E,C]),R=w.useCallback(async q=>{f.current=q,g(q),await ke.setItem("local:isOfflineMode",q)},[]);w.useEffect(()=>{(async()=>{const[W,ne,me]=await Promise.all([ke.getItem("local:isOfflineMode"),ke.getItem("local:isDirty"),ke.getItem("local:serverRevision")]);f.current=W??!1,g(W??!1),p(ne??!1),T(me??0)})()},[]);const _=w.useCallback(async q=>{const W=new Yg;return await W.initializeFromBase64(q),a(W),s(!0),d(!0),W},[]),S=w.useCallback(async()=>{try{const q=await gt("GET_VAULT",{},"background");if(q!=null&&q.vault){const W=new Yg;return await W.initializeFromBase64(q.vault),a(W),s(!0),d(!0),W}else return s(!0),d(!1),null}catch(q){return console.error("Error retrieving vault from background:",q),s(!0),d(!1),null}},[]),O=w.useCallback(async()=>{try{const q=await Pl("local:publicEmailDomains"),W=await Pl("local:privateEmailDomains"),ne=await Pl("local:hiddenPrivateEmailDomains"),me=await ke.getItem("local:serverRevision");return!q&&!W?null:{publicEmailDomains:q??[],privateEmailDomains:W??[],hiddenPrivateEmailDomains:ne??[],serverRevision:me??0}}catch(q){return console.error("Error getting vault metadata from local storage:",q),null}},[]),U=w.useCallback(async()=>{const[q,W]=await Promise.all([ke.getItem("local:isDirty"),ke.getItem("local:serverRevision")]);p(q??!1),T(W??0)},[]),P=w.useCallback(async()=>e?await e.hasPendingMigrations():!1,[e]);w.useEffect(()=>{i||S()},[i,S]);const K=w.useCallback(async q=>{await gt("STORE_ENCRYPTION_KEY",q,"background")},[]),H=w.useCallback(async q=>{await gt("STORE_ENCRYPTION_KEY_DERIVATION_PARAMS",q,"background")},[]),Q=w.useCallback(()=>{a(null),s(!1),d(!1)},[]),V=w.useCallback(()=>f.current,[]),G=w.useMemo(()=>({sqliteClient:e,dbInitialized:i,dbAvailable:c,isOffline:m,getIsOffline:V,isDirty:E,isSyncing:C,serverRevision:x,setIsOffline:R,setIsSyncing:I,shouldSuppressEmailErrors:k,loadDatabase:_,loadStoredDatabase:S,storeEncryptionKey:K,storeEncryptionKeyDerivationParams:H,clearDatabase:Q,getVaultMetadata:O,refreshSyncState:U,hasPendingMigrations:P}),[e,i,c,m,V,E,C,x,R,k,_,S,K,H,Q,O,U,P]);return l.jsx(aI.Provider,{value:G,children:r})},Gt=()=>{const r=w.useContext(aI);if(r===void 0)throw new Error("useDb must be used within a DbProvider");return r},Uu="local:aliasvault_disabled_sites",qu="local:aliasvault_global_autofill_popup_enabled",Uy="local:aliasvault_global_context_menu_enabled",go="local:aliasvault_vault_locked_dismiss_until",Au="local:aliasvault_temporary_disabled_sites",_y="local:aliasvault_clipboard_clear_timeout",My="local:aliasvault_auto_lock_timeout",Fy="local:aliasvault_autofill_matching_mode",Oy="local:aliasvault_passkey_provider_enabled",bs="local:aliasvault_passkey_disabled_sites",Wu="session:pendingRedirectUrl",Wf="local:aliasvault_skip_form_restore";var _u={exports:{}},Vk=_u.exports,jy;function Kk(){return jy||(jy=1,function(r,e){(function(a,i){r.exports=i()})(Vk,function(){return(()=>{var a,i,s={773:(m,g,f)=>{var E,p=typeof self<"u"&&self.Module!==void 0?self.Module:{},C={};for(E in p)p.hasOwnProperty(E)&&(C[E]=p[E]);var I,x,T,k;I=typeof window=="object",x=typeof importScripts=="function",T=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",k=!I&&!T&&!x;var R,_,S,O,U,P="";T?(P=x?f(967).dirname(P)+"/":"//",R=function(ve,Be){return O||(O=f(145)),U||(U=f(967)),ve=U.normalize(ve),O.readFileSync(ve,Be?null:"utf8")},S=function(ve){var Be=R(ve,!0);return Be.buffer||(Be=new Uint8Array(Be)),G(Be.buffer),Be},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),m.exports=p,process.on("uncaughtException",function(ve){if(!(ve instanceof nt))throw ve}),process.on("unhandledRejection",ee),p.inspect=function(){return"[Emscripten Module object]"}):k?(typeof read<"u"&&(R=function(ve){return read(ve)}),S=function(ve){var Be;return typeof readbuffer=="function"?new Uint8Array(readbuffer(ve)):(G(typeof(Be=read(ve,"binary"))=="object"),Be)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(I||x)&&(x?P=self.location.href:typeof document<"u"&&document.currentScript&&(P=document.currentScript.src),P=P.indexOf("blob:")!==0?P.substr(0,P.lastIndexOf("/")+1):"",R=function(ve){var Be=new XMLHttpRequest;return Be.open("GET",ve,!1),Be.send(null),Be.responseText},x&&(S=function(ve){var Be=new XMLHttpRequest;return Be.open("GET",ve,!1),Be.responseType="arraybuffer",Be.send(null),new Uint8Array(Be.response)}),_=function(ve,Be,$e){var Ye=new XMLHttpRequest;Ye.open("GET",ve,!0),Ye.responseType="arraybuffer",Ye.onload=function(){Ye.status==200||Ye.status==0&&Ye.response?Be(Ye.response):$e()},Ye.onerror=$e,Ye.send(null)}),p.print||console.log.bind(console);var K,H,Q=p.printErr||console.warn.bind(console);for(E in C)C.hasOwnProperty(E)&&(p[E]=C[E]);C=null,p.arguments&&p.arguments,p.thisProgram&&p.thisProgram,p.quit&&p.quit,p.wasmBinary&&(K=p.wasmBinary),p.noExitRuntime,typeof WebAssembly!="object"&&ee("no native wasm support detected");var V=!1;function G(ve,Be){ve||ee("Assertion failed: "+Be)}var q,W,ne=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function me(ve){q=ve,p.HEAP8=new Int8Array(ve),p.HEAP16=new Int16Array(ve),p.HEAP32=new Int32Array(ve),p.HEAPU8=W=new Uint8Array(ve),p.HEAPU16=new Uint16Array(ve),p.HEAPU32=new Uint32Array(ve),p.HEAPF32=new Float32Array(ve),p.HEAPF64=new Float64Array(ve)}p.INITIAL_MEMORY;var $,re=[],ye=[],Ae=[],j=0,X=null;function ee(ve){throw p.onAbort&&p.onAbort(ve),Q(ve+=""),V=!0,ve="abort("+ve+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(ve)}function ie(ve){return ve.startsWith("data:application/octet-stream;base64,")}function Ie(ve){return ve.startsWith("file://")}p.preloadedImages={},p.preloadedAudios={};var we,Re="argon2.wasm";function De(ve){try{if(ve==Re&&K)return new Uint8Array(K);if(S)return S(ve);throw"both async and sync fetching of the wasm failed"}catch(Be){ee(Be)}}function Te(ve){for(;ve.length>0;){var Be=ve.shift();if(typeof Be!="function"){var $e=Be.func;typeof $e=="number"?Be.arg===void 0?$.get($e)():$.get($e)(Be.arg):$e(Be.arg===void 0?null:Be.arg)}else Be(p)}}function He(ve){try{return H.grow(ve-q.byteLength+65535>>>16),me(H.buffer),1}catch{}}ie(Re)||(we=Re,Re=p.locateFile?p.locateFile(we,P):P+we);var Ne,Qe={a:function(ve,Be,$e){W.copyWithin(ve,Be,Be+$e)},b:function(ve){var Be,$e=W.length,Ye=2147418112;if((ve>>>=0)>Ye)return!1;for(var lt=1;lt<=4;lt*=2){var et=$e*(1+.2/lt);if(et=Math.min(et,ve+100663296),He(Math.min(Ye,((Be=Math.max(ve,et))%65536>0&&(Be+=65536-Be%65536),Be))))return!0}return!1}},yt=(function(){var ve={a:Qe};function Be(lt,et){var Et,Pt=lt.exports;p.asm=Pt,me((H=p.asm.c).buffer),$=p.asm.k,Et=p.asm.d,ye.unshift(Et),function(qt){if(j--,p.monitorRunDependencies&&p.monitorRunDependencies(j),j==0&&X){var Qt=X;X=null,Qt()}}()}function $e(lt){Be(lt.instance)}function Ye(lt){return function(){if(!K&&(I||x)){if(typeof fetch=="function"&&!Ie(Re))return fetch(Re,{credentials:"same-origin"}).then(function(et){if(!et.ok)throw"failed to load wasm binary file at '"+Re+"'";return et.arrayBuffer()}).catch(function(){return De(Re)});if(_)return new Promise(function(et,Et){_(Re,function(Pt){et(new Uint8Array(Pt))},Et)})}return Promise.resolve().then(function(){return De(Re)})}().then(function(et){return WebAssembly.instantiate(et,ve)}).then(lt,function(et){Q("failed to asynchronously prepare wasm: "+et),ee(et)})}if(j++,p.monitorRunDependencies&&p.monitorRunDependencies(j),p.instantiateWasm)try{return p.instantiateWasm(ve,Be)}catch(lt){return Q("Module.instantiateWasm callback failed with error: "+lt),!1}K||typeof WebAssembly.instantiateStreaming!="function"||ie(Re)||Ie(Re)||typeof fetch!="function"?Ye($e):fetch(Re,{credentials:"same-origin"}).then(function(lt){return WebAssembly.instantiateStreaming(lt,ve).then($e,function(et){return Q("wasm streaming compile failed: "+et),Q("falling back to ArrayBuffer instantiation"),Ye($e)})})}(),p.___wasm_call_ctors=function(){return(p.___wasm_call_ctors=p.asm.d).apply(null,arguments)},p._argon2_hash=function(){return(p._argon2_hash=p.asm.e).apply(null,arguments)},p._malloc=function(){return(yt=p._malloc=p.asm.f).apply(null,arguments)}),We=(p._free=function(){return(p._free=p.asm.g).apply(null,arguments)},p._argon2_verify=function(){return(p._argon2_verify=p.asm.h).apply(null,arguments)},p._argon2_error_message=function(){return(p._argon2_error_message=p.asm.i).apply(null,arguments)},p._argon2_encodedlen=function(){return(p._argon2_encodedlen=p.asm.j).apply(null,arguments)},p._argon2_hash_ext=function(){return(p._argon2_hash_ext=p.asm.l).apply(null,arguments)},p._argon2_verify_ext=function(){return(p._argon2_verify_ext=p.asm.m).apply(null,arguments)},p.stackAlloc=function(){return(We=p.stackAlloc=p.asm.n).apply(null,arguments)});function nt(ve){this.name="ExitStatus",this.message="Program terminated with exit("+ve+")",this.status=ve}function Ht(ve){function Be(){Ne||(Ne=!0,p.calledRun=!0,V||(Te(ye),p.onRuntimeInitialized&&p.onRuntimeInitialized(),function(){if(p.postRun)for(typeof p.postRun=="function"&&(p.postRun=[p.postRun]);p.postRun.length;)$e=p.postRun.shift(),Ae.unshift($e);var $e;Te(Ae)}()))}j>0||(function(){if(p.preRun)for(typeof p.preRun=="function"&&(p.preRun=[p.preRun]);p.preRun.length;)$e=p.preRun.shift(),re.unshift($e);var $e;Te(re)}(),j>0||(p.setStatus?(p.setStatus("Running..."),setTimeout(function(){setTimeout(function(){p.setStatus("")},1),Be()},1)):Be()))}if(p.allocate=function(ve,Be){var $e;return $e=Be==1?We(ve.length):yt(ve.length),ve.subarray||ve.slice?W.set(ve,$e):W.set(new Uint8Array(ve),$e),$e},p.UTF8ToString=function(ve,Be){return ve?function($e,Ye,lt){for(var et=Ye+lt,Et=Ye;$e[Et]&&!(Et>=et);)++Et;if(Et-Ye>16&&$e.subarray&&ne)return ne.decode($e.subarray(Ye,Et));for(var Pt="";Ye<Et;){var qt=$e[Ye++];if(128&qt){var Qt=63&$e[Ye++];if((224&qt)!=192){var na=63&$e[Ye++];if((qt=(240&qt)==224?(15&qt)<<12|Qt<<6|na:(7&qt)<<18|Qt<<12|na<<6|63&$e[Ye++])<65536)Pt+=String.fromCharCode(qt);else{var B=qt-65536;Pt+=String.fromCharCode(55296|B>>10,56320|1023&B)}}else Pt+=String.fromCharCode((31&qt)<<6|Qt)}else Pt+=String.fromCharCode(qt)}return Pt}(W,ve,Be):""},p.ALLOC_NORMAL=0,X=function ve(){Ne||Ht(),Ne||(X=ve)},p.run=Ht,p.preInit)for(typeof p.preInit=="function"&&(p.preInit=[p.preInit]);p.preInit.length>0;)p.preInit.pop()();Ht(),m.exports=p,p.unloadRuntime=function(){typeof self<"u"&&delete self.Module,p=H=$=q=W=void 0,delete m.exports}},631:function(m,g,f){var E,p;(p=typeof(E=function(){const C=typeof self<"u"?self:this,I={Argon2d:0,Argon2i:1,Argon2id:2};function x(S){if(x._promise)return x._promise;if(x._module)return Promise.resolve(x._module);let O;return O=C.process&&C.process.versions&&C.process.versions.node?T().then(U=>new Promise(P=>{U.postRun=()=>P(U)})):(C.loadArgon2WasmBinary?C.loadArgon2WasmBinary():Promise.resolve(f(721)).then(U=>function(P){const K=atob(P),H=new Uint8Array(new ArrayBuffer(K.length));for(let Q=0;Q<K.length;Q++)H[Q]=K.charCodeAt(Q);return H}(U))).then(U=>function(P,K){return new Promise(H=>(C.Module={wasmBinary:P,wasmMemory:K,postRun(){H(Module)}},T()))}(U,S?function(P){const V=Math.min(Math.max(Math.ceil(P*1024/65536),256)+256,32767);return new WebAssembly.Memory({initial:V,maximum:32767})}(S):void 0)),x._promise=O,O.then(U=>(x._module=U,delete x._promise,U))}function T(){return C.loadArgon2WasmModule?C.loadArgon2WasmModule():Promise.resolve(f(773))}function k(S,O){return S.allocate(O,"i8",S.ALLOC_NORMAL)}function R(S,O){return k(S,new Uint8Array([...O,0]))}function _(S){if(typeof S!="string")return S;if(typeof TextEncoder=="function")return new TextEncoder().encode(S);if(typeof Buffer=="function")return Buffer.from(S);throw new Error("Don't know how to encode UTF8")}return{ArgonType:I,hash:function(S){const O=S.mem||1024;return x(O).then(U=>{const P=S.time||1,K=S.parallelism||1,H=_(S.pass),Q=R(U,H),V=H.length,G=_(S.salt),q=R(U,G),W=G.length,ne=S.type||I.Argon2d,me=U.allocate(new Array(S.hashLen||24),"i8",U.ALLOC_NORMAL),$=S.secret?k(U,S.secret):0,re=S.secret?S.secret.byteLength:0,ye=S.ad?k(U,S.ad):0,Ae=S.ad?S.ad.byteLength:0,j=S.hashLen||24,X=U._argon2_encodedlen(P,O,K,W,j,ne),ee=U.allocate(new Array(X+1),"i8",U.ALLOC_NORMAL);let ie,Ie,we;try{Ie=U._argon2_hash_ext(P,O,K,Q,V,q,W,me,j,ee,X,ne,$,re,ye,Ae,19)}catch(Re){ie=Re}if(Ie!==0||ie){try{ie||(ie=U.UTF8ToString(U._argon2_error_message(Ie)))}catch{}we={message:ie,code:Ie}}else{let Re="";const De=new Uint8Array(j);for(let Te=0;Te<j;Te++){const He=U.HEAP8[me+Te];De[Te]=He,Re+=("0"+(255&He).toString(16)).slice(-2)}we={hash:De,hashHex:Re,encoded:U.UTF8ToString(ee)}}try{U._free(Q),U._free(q),U._free(me),U._free(ee),ye&&U._free(ye),$&&U._free($)}catch{}if(ie)throw we;return we})},verify:function(S){return x().then(O=>{const U=_(S.pass),P=R(O,U),K=U.length,H=S.secret?k(O,S.secret):0,Q=S.secret?S.secret.byteLength:0,V=S.ad?k(O,S.ad):0,G=S.ad?S.ad.byteLength:0,q=R(O,_(S.encoded));let W,ne,me,$=S.type;if($===void 0){let re=S.encoded.split("$")[1];re&&(re=re.replace("a","A"),$=I[re]||I.Argon2d)}try{ne=O._argon2_verify_ext(q,P,K,H,Q,V,G,$)}catch(re){W=re}if(ne||W){try{W||(W=O.UTF8ToString(O._argon2_error_message(ne)))}catch{}me={message:W,code:ne}}try{O._free(P),O._free(q)}catch{}if(W)throw me;return me})},unloadRuntime:function(){x._module&&(x._module.unloadRuntime(),delete x._promise,delete x._module)}}})=="function"?E.apply(g,[]):E)===void 0||(m.exports=p)},721:function(m,g){m.exports=" "},145:()=>{},967:()=>{}},c={};function d(m){var g=c[m];if(g!==void 0)return g.exports;var f=c[m]={exports:{}};return s[m].call(f.exports,f,f.exports,d),f.exports}return i=Object.getPrototypeOf?m=>Object.getPrototypeOf(m):m=>m.__proto__,d.t=function(m,g){if(1&g&&(m=this(m)),8&g||typeof m=="object"&&m&&(4&g&&m.__esModule||16&g&&typeof m.then=="function"))return m;var f=Object.create(null);d.r(f);var E={};a=a||[null,i({}),i([]),i(i)];for(var p=2&g&&m;typeof p=="object"&&!~a.indexOf(p);p=i(p))Object.getOwnPropertyNames(p).forEach(C=>E[C]=()=>m[C]);return E.default=()=>m,d.d(f,E),f},d.d=(m,g)=>{for(var f in g)d.o(g,f)&&!d.o(m,f)&&Object.defineProperty(m,f,{enumerable:!0,get:g[f]})},d.o=(m,g)=>Object.prototype.hasOwnProperty.call(m,g),d.r=m=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(m,"__esModule",{value:!0})},d(631)})()})}(_u)),_u.exports}var Gk=Kk();const nI=qi(Gk);var wb,Cb;const qk=(Cb=(wb=globalThis.browser)==null?void 0:wb.runtime)!=null&&Cb.id?globalThis.browser:globalThis.chrome,li=qk,Ch="local:aliasvault_pin_enabled",Nh="local:aliasvault_pin_encrypted_key",xh="local:aliasvault_pin_salt",Th="local:aliasvault_pin_length",po="local:aliasvault_pin_failed_attempts",Jg=4;class Mu extends Error{constructor(){super("PIN locked after too many failed attempts"),this.name="PinLockedError"}}class Gl extends Error{constructor(){super("Invalid PIN format"),this.name="InvalidPinFormatError"}}class Xg extends Error{constructor(a){super(`Incorrect PIN. ${a} attempts remaining.`);ze(this,"attemptsRemaining");this.name="IncorrectPinError",this.attemptsRemaining=a}}async function rI(){try{return await ke.getItem(Ch)===!0}catch{return!1}}async function Wk(){try{return await ke.getItem(Th)||null}catch{return null}}function Sh(r){return/^\d{6,8}$/.test(r)}async function iI(){try{return await ke.getItem(po)||0}catch{return 0}}async function sI(){return await iI()>=Jg}async function Yk(r,e){if(!Sh(r))throw new Gl;try{const a=crypto.getRandomValues(new Uint8Array(16)),i=$g(a.buffer),s=await oI(a),c=await lI(r,s),d=crypto.getRandomValues(new Uint8Array(12)),m=await crypto.subtle.encrypt({name:"AES-GCM",iv:d},c,new TextEncoder().encode(e)),g=new Uint8Array(d.length+m.byteLength);g.set(d,0),g.set(new Uint8Array(m),d.length);const f=$g(g.buffer);await Promise.all([ke.setItem(Ch,!0),ke.setItem(Nh,f),ke.setItem(xh,i),ke.setItem(Th,r.length),ke.setItem(po,0)])}catch(a){throw a instanceof Gl||console.error("[PinUnlockService] Failed to setup PIN:",a),a}}async function Jk(r){if(!Sh(r))throw new Gl;if(await sI())throw new Mu;try{const[e,a]=await Promise.all([ke.getItem(Nh),ke.getItem(xh)]);if(!e||!a)throw new Mu;const i=new Uint8Array(Hy(e)),s=i.slice(0,12),c=i.slice(12),d=new Uint8Array(Hy(a)),m=await oI(d),g=await lI(r,m),f=await crypto.subtle.decrypt({name:"AES-GCM",iv:s},g,c),E=new TextDecoder().decode(f);return await ke.setItem(po,0),E}catch{const a=await iI()+1;throw await ke.setItem(po,a),a>=Jg?(await kh(),new Mu):new Xg(Jg-a)}}async function kh(){try{await Promise.all([ke.removeItem(Ch),ke.removeItem(Nh),ke.removeItem(xh),ke.removeItem(Th),ke.removeItem(po)])}catch(r){throw console.error("[PinUnlockService] Failed to disable PIN:",r),r}}async function Py(){try{await ke.setItem(po,0)}catch(r){console.error("[PinUnlockService] Failed to reset failed attempts:",r)}}async function Xk(){const r=li.runtime.id,e=new TextEncoder().encode(r),a=await crypto.subtle.digest("SHA-256",e);return new Uint8Array(a)}async function oI(r){const e=await Xk(),a=new Uint8Array(r.length+e.length);return a.set(r,0),a.set(e,r.length),a}async function lI(r,e){const a=$g(e.buffer),i=await nI.hash({pass:r,salt:a,time:3,mem:65536,parallelism:1,hashLen:32,type:2});return await crypto.subtle.importKey("raw",i.hash,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function $g(r){const e=new Uint8Array(r);let a="";for(let i=0;i<e.byteLength;i++)a+=String.fromCharCode(e[i]);return btoa(a)}function Hy(r){const e=atob(r),a=new Uint8Array(e.length);for(let i=0;i<e.length;i++)a[i]=e.charCodeAt(i);return a.buffer}const cI=w.createContext(void 0),$k=({children:r})=>{const[e,a]=w.useState(!1),[i,s]=w.useState(null),[c,d]=w.useState(null),m=Gt(),g=w.useCallback(async()=>{const x=await ke.getItem("local:accessToken"),T=await ke.getItem("local:refreshToken"),k=await ke.getItem("local:username");return a(!0),x&&T&&k?(s(k),!0):!1},[s]),f=w.useCallback(async(x,T,k)=>{await ke.setItem("local:username",x),await ke.setItem("local:accessToken",T),await ke.setItem("local:refreshToken",k),await ke.setItem(go,0),s(x)},[]),E=w.useCallback(async x=>{await gt("CLEAR_SESSION",{},"background"),m==null||m.clearDatabase();try{await kh()}catch(T){console.error("Failed to remove PIN data:",T)}x&&d(x)},[m]),p=w.useCallback(async x=>{await E(x),await gt("CLEAR_VAULT_DATA",{},"background"),s(null)},[E]),C=w.useCallback(()=>{d(null)},[]),I=w.useMemo(()=>({isInitialized:e,username:i,initializeAuth:g,setAuthTokens:f,clearAuthUserInitiated:p,clearAuthForced:E,globalMessage:c,clearGlobalMessage:C}),[e,i,g,c,f,p,E,C]);return l.jsx(cI.Provider,{value:I,children:r})},$l=()=>{const r=w.useContext(cI);if(r===void 0)throw new Error("useAuth must be used within an AuthProvider");return r};class Zk{constructor(){ze(this,"listeners",new Set)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}emit(e){this.listeners.forEach(a=>{try{a(e)}catch(i){console.error("Error in logout listener:",i)}})}}const Zg=new Zk,ti=class ti{constructor(){}static isServerVersionSupported(e){return this.versionGreaterThanOrEqualTo(e,this.MIN_SERVER_VERSION)}static versionGreaterThanOrEqualTo(e,a){const[i,s]=e.split("-"),[c,d]=a.split("-"),m=i.split(".").map(Number),g=c.split(".").map(Number);for(let f=0;f<Math.max(m.length,g.length);f++){const E=m[f]??0,p=g[f]??0;if(E>p)return!0;if(E<p)return!1}return!s&&d?!0:s&&!d?!1:!s&&!d?!0:s>=d}};ze(ti,"VERSION","0.26.1"),ze(ti,"API_VERSION",ti.VERSION.split("-")[0]),ze(ti,"MIN_SERVER_VERSION","0.12.0-dev"),ze(ti,"CLIENT_NAME","firefox"),ze(ti,"DEFAULT_CLIENT_URL","https://app.aliasvault.net"),ze(ti,"DEFAULT_API_URL","https://app.aliasvault.net/api");let Za=ti;class si extends Error{constructor(e){super(e),this.name="ApiAuthError"}}class ud extends Error{constructor(e="Network error",a){super(e),this.name="NetworkError",this.cause=a,Object.setPrototypeOf(this,ud.prototype)}}class e2{async getBaseUrl(){return(await this.getApiUrl()).replace(/\/$/,"")+"/v1/"}async isSelfHosted(){return await this.getApiUrl()!==Za.DEFAULT_API_URL}async authFetch(e,a={},i=!0,s=!0){const c=new Headers(a.headers??{}),d=await this.getAccessToken();d&&c.set("Authorization",`Bearer ${d}`);const m={...a,headers:c};try{const g=await this.rawFetch(e,m);if(g.status===401){const f=await this.refreshAccessToken();if(f){c.set("Authorization",`Bearer ${f}`);const E=await this.rawFetch(e,{...m,headers:c});if(!E.ok)throw new si("Request failed after token refresh");return i?E.json():E}else throw Zg.emit("auth.errors.sessionExpired"),new si("Session expired")}if(!g.ok&&s)throw new Error(`HTTP error! status: ${g.status}`);return i?g.json():g}catch(g){throw console.error("API request failed:",g),g}}async rawFetch(e,a={}){const s=await this.getBaseUrl()+e,c=new Headers(a.headers??{});c.set("X-AliasVault-Client",`${Za.CLIENT_NAME}-${Za.API_VERSION}`);const d={...a,headers:c};try{return await fetch(s,d)}catch(m){throw console.error("API request failed:",m),new ud(m instanceof Error?m.message:"Network request failed",m instanceof Error?m:void 0)}}async get(e){return this.authFetch(e,{method:"GET"})}async downloadBlob(e){try{const i=await(await this.authFetch(e,{method:"GET",headers:{Accept:"application/octet-stream"}},!1)).arrayBuffer();return new Uint8Array(i)}catch(a){throw console.error("Error downloading blob:",a),a}}async post(e,a,i=!0){return this.authFetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)},i)}async put(e,a){return this.authFetch(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}async delete(e){return this.authFetch(e,{method:"DELETE"},!1)}async revokeTokens(){try{const e=await this.getRefreshToken();e&&await this.post("Auth/revoke",{token:await this.getAccessToken(),refreshToken:e},!1)}catch(e){console.error("WebApi revoke tokens error:",e)}}async getStatus(){try{return await this.get("Auth/status")}catch(e){if(e instanceof si)throw e;return{clientVersionSupported:!0,serverVersion:"0.0.0",vaultRevision:0,srpSalt:""}}}validateStatusResponse(e){return e.clientVersionSupported?Za.isServerVersionSupported(e.serverVersion)?null:"serverVersionNotSupported":"clientVersionNotSupported"}async refreshAccessToken(){const e=await this.getRefreshToken();if(!e)return null;try{const a=await this.rawFetch("Auth/refresh",{method:"POST",headers:{"Content-Type":"application/json","X-Ignore-Failure":"true"},body:JSON.stringify({token:await this.getAccessToken(),refreshToken:e})});if(!a.ok)throw new Error("Failed to refresh token");const i=await a.json();return this.updateTokens(i.token,i.refreshToken),i.token}catch{return Zg.emit("auth.errors.sessionExpired"),null}}async getAccessToken(){return await ke.getItem("local:accessToken")??null}async getRefreshToken(){return await ke.getItem("local:refreshToken")??null}async updateTokens(e,a){await ke.setItem("local:accessToken",e),await ke.setItem("local:refreshToken",a)}async getApiUrl(){const e=await ke.getItem("local:apiUrl");return!e||e.length===0?Za.DEFAULT_API_URL:e}}const uI=w.createContext(null),t2=({children:r})=>{const[e,a]=w.useState(null);return w.useEffect(()=>{const i=new e2;a(i)},[]),e?l.jsx(uI.Provider,{value:e,children:r}):null},ur=()=>{const r=w.useContext(uI);if(!r)throw new Error("useWebApi must be used within a WebApiProvider");return r},dI=w.createContext(void 0),a2=({children:r})=>{const e=$l(),a=ur(),[i,s]=w.useState(!1),c=w.useRef(!1),{t:d}=tt(),m=w.useCallback(async p=>{if(!c.current)try{c.current=!0,await a.revokeTokens(),await e.clearAuthForced(p)}catch(C){console.error("Error during logout:",C)}finally{c.current=!1,s(!1)}},[e,a]),g=w.useCallback(async()=>{const p=await e.initializeAuth();return s(p),p},[e]),f=w.useCallback(async(p,C,I)=>{await e.setAuthTokens(p,C,I),s(!0)},[e]);w.useEffect(()=>Zg.subscribe(async C=>{await m(d(C))}),[m,d]),w.useEffect(()=>{g()},[g]);const E=w.useMemo(()=>({isInitialized:e.isInitialized,username:e.username,globalMessage:e.globalMessage,logout:m,initializeAuth:g,setAuthTokens:f,clearGlobalMessage:e.clearGlobalMessage,isLoggedIn:i}),[e.isInitialized,e.username,e.globalMessage,e.clearGlobalMessage,m,g,f,i]);return l.jsx(dI.Provider,{value:E,children:r})},dr=()=>{const r=w.useContext(dI);if(r===void 0)throw new Error("useApp must be used within an AppProvider");return r};class Aa{static isPopup(){return new URLSearchParams(window.location.search).get("expanded")==="true"?!0:window.innerWidth>390}static getReturnPath(){return new URLSearchParams(window.location.search).get("returnTo")}static openInNewPopup(e,a){const c=window.screen.width/2-400,d=window.screen.height/2-1e3/2,m=e||window.location.hash.replace("#",""),g=new URLSearchParams;g.set("expanded","true"),a&&g.set("returnTo",a);const f=`popup.html?${g.toString()}#${m}`;window.open(f,"AliasVaultPopup",`width=800,height=1000,left=${c},top=${d},popup=true`),window.close()}}const n2=()=>{const{t:r}=tt(),e=dr(),a=Gt();return!e.isLoggedIn||!a.dbAvailable?null:a.isOffline?l.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 rounded-md text-xs font-medium",children:[l.jsxs("div",{className:"relative",children:[l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18.364 5.636a9 9 0 010 12.728m0 0l-2.829-2.829m2.829 2.829L21 21M15.536 8.464a5 5 0 010 7.072m0 0l-2.829-2.829m-4.243 2.829a4.978 4.978 0 01-1.414-2.83m-1.414 5.658a9 9 0 01-2.167-9.238m7.824 2.167a1 1 0 111.414 1.414m-1.414-1.414L3 3m8.293 8.293l1.414 1.414"})}),a.isDirty&&l.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 bg-red-500 rounded-full"})]}),l.jsx("span",{children:r("common.offline")})]}):a.isSyncing?l.jsx("div",{title:r("common.syncingVault"),className:"flex items-center gap-1.5 px-2 py-1 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded-md text-xs font-medium",children:l.jsx("svg",{className:"w-3.5 h-3.5 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}):a.isDirty?l.jsx("div",{title:r("common.pendingSync"),className:"flex items-center gap-1.5 px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 rounded-md text-xs font-medium",children:l.jsxs("div",{className:"relative",children:[l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),l.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 bg-blue-500 dark:bg-blue-400 rounded-full animate-pulse"})]})}):null},mI=({routes:r=[],rightButtons:e})=>{const{t:a}=tt(),i=dr(),s=La(),c=tn(),d=r==null?void 0:r.find(E=>{const p=E.path.replace(/:\w+/g,"[^/]+");return new RegExp(`^${p}$`).test(c.pathname)}),m=w.useCallback(()=>{const E=Aa.getReturnPath();E&&Aa.isPopup()&&window.history.length<=2?s(E):s(-1)},[s]),g=()=>{s("/auth-settings")},f=()=>{c.pathname==="/upgrade"||c.pathname==="/login"||c.pathname==="/unlock"||(i.isLoggedIn?s("/items"):s("/"))};return l.jsx("header",{className:"fixed z-30 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-center h-16 px-4",children:[d!=null&&d.showBackButton?l.jsx("button",{id:"back",onClick:m,className:"flex items-center gap-2 hover:bg-gray-100 dark:hover:bg-gray-700 pr-2 pt-1.5 pb-1.5 rounded-lg group",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 text-gray-500 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),d.title&&l.jsx("h1",{className:"text-lg font-medium text-gray-900 dark:text-white ml-2",children:d.title})]})}):l.jsx("div",{className:"flex items-center",children:l.jsxs("button",{onClick:()=>f(),className:"flex items-center hover:opacity-80 transition-opacity",children:[l.jsx(eI,{width:125,height:40,showText:!0,className:"text-gray-900 dark:text-white"}),l.jsx("span",{className:"text-primary-500 text-[10px] font-normal",children:"BETA"})]})}),l.jsx("div",{className:"flex-grow"}),l.jsx(n2,{}),l.jsx("div",{className:"flex items-center gap-2",children:i.isLoggedIn?e:l.jsxs(l.Fragment,{children:[e,l.jsxs("button",{id:"settings",onClick:g,className:"p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700",children:[l.jsx("span",{className:"sr-only",children:a("common.settings")}),l.jsx("svg",{className:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})]})]})})]})})},r2=({routes:r,headerButtons:e,message:a,children:i})=>l.jsxs("div",{className:"min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col max-h-[600px]",children:[l.jsx(sx,{}),l.jsx(mI,{routes:r,rightButtons:e}),l.jsx("main",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900",style:{paddingTop:"64px",height:"calc(100% - 120px)"},children:l.jsxs("div",{className:"px-4 pb-4 pt-2 mb-16",children:[a&&l.jsx("p",{className:"text-red-500 mb-4",children:a}),i||l.jsx(Qb,{children:r.map(s=>l.jsx(Eh,{path:s.path,element:s.element},s.path))})]})}),l.jsx(ox,{})]}),i2=({children:r})=>l.jsxs("div",{className:"min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col max-h-[600px]",children:[l.jsx("header",{className:"fixed z-30 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-center justify-center h-16 px-4",children:[l.jsx(eI,{width:125,height:40,showText:!0,className:"text-gray-900 dark:text-white"}),l.jsx("span",{className:"text-primary-500 text-[10px] font-normal",children:"BETA"})]})}),l.jsx("main",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900",style:{paddingTop:"64px"},children:l.jsx("div",{className:"p-4",children:r})})]}),$n=()=>{const r={width:"40px",height:"40px",borderRadius:"50%",animation:"spin 1s linear infinite"},e=l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
      `}),l.jsx("div",{className:"border-[4px] border-solid border-current/10 dark:border-white/10 border-t-current dark:border-t-white",style:r})]});return l.jsx("div",{className:"inline-flex items-center",children:e})},fI=w.createContext(void 0),s2=({children:r})=>{const[e,a]=w.useState(null),i=w.useCallback(c=>{a(c)},[]),s=w.useMemo(()=>({setHeaderButtons:i,headerButtons:e}),[i,e]);return l.jsx(fI.Provider,{value:s,children:r})},mr=()=>{const r=w.useContext(fI);if(r===void 0)throw new Error("useHeaderButtons must be used within a HeaderButtonsProvider");return r},o2=()=>{const{isLoading:r}=pa();if(!r)return null;const e={width:"40px",height:"40px",borderRadius:"50%",animation:"spin 1s linear infinite"},a=l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
      `}),l.jsx("div",{className:"border-[4px] border-solid border-current/10 dark:border-white/10 border-t-current dark:border-t-white",style:e})]});return l.jsx("div",{className:"fixed inset-0 w-full h-full z-50 bg-gray-200 dark:bg-gray-500 bg-opacity-90 flex items-center justify-center",children:l.jsx("div",{className:"relative",children:a})})},gI=w.createContext(void 0),l2=({children:r})=>{const[e,a]=w.useState(!0),[i,s]=w.useState(!1),[c,d]=w.useState(void 0),m=E=>{s(!0),d(E)},g=()=>{s(!1),d(void 0)},f=w.useMemo(()=>({isLoading:i,loadingMessage:c,showLoading:m,hideLoading:g,isInitialLoading:e,setIsInitialLoading:a}),[i,c,e]);return l.jsxs(gI.Provider,{value:f,children:[l.jsx(o2,{message:c}),r]})},pa=()=>{const r=w.useContext(gI);if(r===void 0)throw new Error("useLoading must be used within a LoadingProvider");return r},c2="session:lastVisitedPage",u2="session:lastVisitedTime",d2="session:navigationHistory",hI=w.createContext(void 0),m2=({children:r})=>{const e=tn(),a=La(),{isInitialized:i,isLoggedIn:s}=dr(),{dbInitialized:c,dbAvailable:d}=Gt(),m=i&&c,g=m&&(!s||!d),f=w.useCallback(async()=>{if(m&&!g&&!["/","/reinitialize","/login","/unlock","/unlock-success","/auth-settings","/upgrade","/passkeys/create","/passkeys/authenticate"].includes(e.pathname)){const C=e.pathname.split("/").filter(Boolean),I=[];let x="";for(let T=0;T<C.length;T++)x+="/"+C[T],I.push({pathname:x,search:e.search,hash:e.hash});await Promise.all([ke.setItem(c2,e.pathname),ke.setItem(u2,Date.now()),ke.setItem(d2,I)])}},[e,m,g]);w.useEffect(()=>{m&&f()},[e.pathname,e.search,e.hash,m,f]),w.useEffect(()=>{m&&!s&&a("/login",{replace:!0})},[m,s]);const E=w.useMemo(()=>({storeCurrentPage:f,isFullyInitialized:m,requiresAuth:g}),[f,m,g]);return l.jsx(hI.Provider,{value:E,children:r})},f2=()=>{const r=w.useContext(hI);if(r===void 0)throw new Error("useNavigation must be used within a NavigationProvider");return r};var Yf,Qy;function g2(){if(Qy)return Yf;Qy=1;function r(R){this._maxSize=R,this.clear()}r.prototype.clear=function(){this._size=0,this._values=Object.create(null)},r.prototype.get=function(R){return this._values[R]},r.prototype.set=function(R,_){return this._size>=this._maxSize&&this.clear(),R in this._values||this._size++,this._values[R]=_};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,a=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,c=/^\s*(['"]?)(.*?)(\1)\s*$/,d=512,m=new r(d),g=new r(d),f=new r(d);Yf={Cache:r,split:p,normalizePath:E,setter:function(R){var _=E(R);return g.get(R)||g.set(R,function(O,U){for(var P=0,K=_.length,H=O;P<K-1;){var Q=_[P];if(Q==="__proto__"||Q==="constructor"||Q==="prototype")return O;H=H[_[P++]]}H[_[P]]=U})},getter:function(R,_){var S=E(R);return f.get(R)||f.set(R,function(U){for(var P=0,K=S.length;P<K;)if(U!=null||!_)U=U[S[P++]];else return;return U})},join:function(R){return R.reduce(function(_,S){return _+(I(S)||a.test(S)?"["+S+"]":(_?".":"")+S)},"")},forEach:function(R,_,S){C(Array.isArray(R)?R:p(R),_,S)}};function E(R){return m.get(R)||m.set(R,p(R).map(function(_){return _.replace(c,"$2")}))}function p(R){return R.match(e)||[""]}function C(R,_,S){var O=R.length,U,P,K,H;for(P=0;P<O;P++)U=R[P],U&&(k(U)&&(U='"'+U+'"'),H=I(U),K=!H&&/^\d+$/.test(U),_.call(S,U,H,K,P,R))}function I(R){return typeof R=="string"&&R&&["'",'"'].indexOf(R.charAt(0))!==-1}function x(R){return R.match(i)&&!R.match(a)}function T(R){return s.test(R)}function k(R){return!I(R)&&(x(R)||T(R))}return Yf}var Is=g2(),Jf,zy;function h2(){if(zy)return Jf;zy=1;const r=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=E=>E.match(r)||[],a=E=>E[0].toUpperCase()+E.slice(1),i=(E,p)=>e(E).join(p).toLowerCase(),s=E=>e(E).reduce((p,C)=>`${p}${p?C[0].toUpperCase()+C.slice(1).toLowerCase():C.toLowerCase()}`,"");return Jf={words:e,upperFirst:a,camelCase:s,pascalCase:E=>a(s(E)),snakeCase:E=>i(E,"_"),kebabCase:E=>i(E,"-"),sentenceCase:E=>a(i(E," ")),titleCase:E=>e(E).map(a).join(" ")},Jf}var Xf=h2(),pu={exports:{}},Vy;function A2(){if(Vy)return pu.exports;Vy=1,pu.exports=function(s){return r(e(s),s)},pu.exports.array=r;function r(s,c){var d=s.length,m=new Array(d),g={},f=d,E=a(c),p=i(s);for(c.forEach(function(I){if(!p.has(I[0])||!p.has(I[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});f--;)g[f]||C(s[f],f,new Set);return m;function C(I,x,T){if(T.has(I)){var k;try{k=", node was:"+JSON.stringify(I)}catch{k=""}throw new Error("Cyclic dependency"+k)}if(!p.has(I))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(I));if(!g[x]){g[x]=!0;var R=E.get(I)||new Set;if(R=Array.from(R),x=R.length){T.add(I);do{var _=R[--x];C(_,p.get(_),T)}while(x);T.delete(I)}m[--d]=I}}}function e(s){for(var c=new Set,d=0,m=s.length;d<m;d++){var g=s[d];c.add(g[0]),c.add(g[1])}return Array.from(c)}function a(s){for(var c=new Map,d=0,m=s.length;d<m;d++){var g=s[d];c.has(g[0])||c.set(g[0],new Set),c.has(g[1])||c.set(g[1],new Set),c.get(g[0]).add(g[1])}return c}function i(s){for(var c=new Map,d=0,m=s.length;d<m;d++)c.set(s[d],d);return c}return pu.exports}var p2=A2();const y2=qi(p2),E2=Object.prototype.toString,b2=Error.prototype.toString,I2=RegExp.prototype.toString,v2=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",w2=/^Symbol\((.*)\)(.*)$/;function C2(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Ky(r,e=!1){if(r==null||r===!0||r===!1)return""+r;const a=typeof r;if(a==="number")return C2(r);if(a==="string")return e?`"${r}"`:r;if(a==="function")return"[Function "+(r.name||"anonymous")+"]";if(a==="symbol")return v2.call(r).replace(w2,"Symbol($1)");const i=E2.call(r).slice(8,-1);return i==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):i==="Error"||r instanceof Error?"["+b2.call(r)+"]":i==="RegExp"?I2.call(r):null}function Gi(r,e){let a=Ky(r,e);return a!==null?a:JSON.stringify(r,function(i,s){let c=Ky(this[i],e);return c!==null?c:s},2)}function AI(r){return r==null?[]:[].concat(r)}let pI,yI,EI,N2=/\$\{\s*(\w+)\s*\}/g;pI=Symbol.toStringTag;class Gy{constructor(e,a,i,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[pI]="Error",this.name="ValidationError",this.value=a,this.path=i,this.type=s,this.errors=[],this.inner=[],AI(e).forEach(c=>{if(ln.isError(c)){this.errors.push(...c.errors);const d=c.inner.length?c.inner:[c];this.inner.push(...d)}else this.errors.push(c)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}yI=Symbol.hasInstance;EI=Symbol.toStringTag;class ln extends Error{static formatError(e,a){const i=a.label||a.path||"this";return a=Object.assign({},a,{path:i,originalPath:a.path}),typeof e=="string"?e.replace(N2,(s,c)=>Gi(a[c])):typeof e=="function"?e(a):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,a,i,s,c){const d=new Gy(e,a,i,s);if(c)return d;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[EI]="Error",this.name=d.name,this.message=d.message,this.type=d.type,this.value=d.value,this.path=d.path,this.errors=d.errors,this.inner=d.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ln)}static[yI](e){return Gy[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Nr={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:a,originalValue:i})=>{const s=i!=null&&i!==a?` (cast from the value \`${Gi(i,!0)}\`).`:".";return e!=="mixed"?`${r} must be a \`${e}\` type, but the final value was: \`${Gi(a,!0)}\``+s:`${r} must match the configured type. The validated value was: \`${Gi(a,!0)}\``+s}},wn={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},x2={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},eh={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},T2={isValue:"${path} field must be ${value}"},Fu={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},S2={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},k2={notType:r=>{const{path:e,value:a,spec:i}=r,s=i.types.length;if(Array.isArray(a)){if(a.length<s)return`${e} tuple value has too few items, expected a length of ${s} but got ${a.length} for value: \`${Gi(a,!0)}\``;if(a.length>s)return`${e} tuple value has too many items, expected a length of ${s} but got ${a.length} for value: \`${Gi(a,!0)}\``}return ln.formatError(Nr.notType,r)}};Object.assign(Object.create(null),{mixed:Nr,string:wn,number:x2,date:eh,object:Fu,array:S2,boolean:T2,tuple:k2});const Lh=r=>r&&r.__isYupSchema__;class Yu{static fromOptions(e,a){if(!a.then&&!a.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:s,otherwise:c}=a,d=typeof i=="function"?i:(...m)=>m.every(g=>g===i);return new Yu(e,(m,g)=>{var f;let E=d(...m)?s:c;return(f=E==null?void 0:E(g))!=null?f:g})}constructor(e,a){this.fn=void 0,this.refs=e,this.refs=e,this.fn=a}resolve(e,a){let i=this.refs.map(c=>c.getValue(a==null?void 0:a.value,a==null?void 0:a.parent,a==null?void 0:a.context)),s=this.fn(i,e,a);if(s===void 0||s===e)return e;if(!Lh(s))throw new TypeError("conditions must return a schema object");return s.resolve(a)}}const yu={context:"$",value:"."};class Cs{constructor(e,a={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===yu.context,this.isValue=this.key[0]===yu.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?yu.context:this.isValue?yu.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&Is.getter(this.path,!0),this.map=a.map}getValue(e,a,i){let s=this.isContext?i:this.isValue?e:a;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,a){return this.getValue(e,a==null?void 0:a.parent,a==null?void 0:a.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Cs.prototype.__isYupRef=!0;const ys=r=>r==null;function so(r){function e({value:a,path:i="",options:s,originalValue:c,schema:d},m,g){const{name:f,test:E,params:p,message:C,skipAbsent:I}=r;let{parent:x,context:T,abortEarly:k=d.spec.abortEarly,disableStackTrace:R=d.spec.disableStackTrace}=s;function _(G){return Cs.isRef(G)?G.getValue(a,x,T):G}function S(G={}){const q=Object.assign({value:a,originalValue:c,label:d.spec.label,path:G.path||i,spec:d.spec,disableStackTrace:G.disableStackTrace||R},p,G.params);for(const ne of Object.keys(q))q[ne]=_(q[ne]);const W=new ln(ln.formatError(G.message||C,q),a,q.path,G.type||f,q.disableStackTrace);return W.params=q,W}const O=k?m:g;let U={path:i,parent:x,type:f,from:s.from,createError:S,resolve:_,options:s,originalValue:c,schema:d};const P=G=>{ln.isError(G)?O(G):G?g(null):O(S())},K=G=>{ln.isError(G)?O(G):m(G)};if(I&&ys(a))return P(!0);let Q;try{var V;if(Q=E.call(U,a,U),typeof((V=Q)==null?void 0:V.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${U.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(Q).then(P,K)}}catch(G){K(G);return}P(Q)}return e.OPTIONS=r,e}function L2(r,e,a,i=a){let s,c,d;return e?(Is.forEach(e,(m,g,f)=>{let E=g?m.slice(1,m.length-1):m;r=r.resolve({context:i,parent:s,value:a});let p=r.type==="tuple",C=f?parseInt(E,10):0;if(r.innerType||p){if(p&&!f)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${d}" must contain an index to the tuple element, e.g. "${d}[0]"`);if(a&&C>=a.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${m}, in the path: ${e}. because there is no value at that index. `);s=a,a=a&&a[C],r=p?r.spec.types[C]:r.innerType}if(!f){if(!r.fields||!r.fields[E])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${d} which is a type: "${r.type}")`);s=a,a=a&&a[E],r=r.fields[E]}c=E,d=g?"["+m+"]":"."+m}),{schema:r,parent:s,parentPath:c}):{parent:s,parentPath:e,schema:r}}class Ju extends Set{describe(){const e=[];for(const a of this.values())e.push(Cs.isRef(a)?a.describe():a);return e}resolveAll(e){let a=[];for(const i of this.values())a.push(e(i));return a}clone(){return new Ju(this.values())}merge(e,a){const i=this.clone();return e.forEach(s=>i.add(s)),a.forEach(s=>i.delete(s)),i}}function mo(r,e=new Map){if(Lh(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let a;if(r instanceof Date)a=new Date(r.getTime()),e.set(r,a);else if(r instanceof RegExp)a=new RegExp(r),e.set(r,a);else if(Array.isArray(r)){a=new Array(r.length),e.set(r,a);for(let i=0;i<r.length;i++)a[i]=mo(r[i],e)}else if(r instanceof Map){a=new Map,e.set(r,a);for(const[i,s]of r.entries())a.set(i,mo(s,e))}else if(r instanceof Set){a=new Set,e.set(r,a);for(const i of r)a.add(mo(i,e))}else if(r instanceof Object){a={},e.set(r,a);for(const[i,s]of Object.entries(r))a[i]=mo(s,e)}else throw Error(`Unable to clone ${r}`);return a}class Lr{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ju,this._blacklist=new Ju,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Nr.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(a=>{a.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const a=Object.create(Object.getPrototypeOf(this));return a.type=this.type,a._typeCheck=this._typeCheck,a._whitelist=this._whitelist.clone(),a._blacklist=this._blacklist.clone(),a.internalTests=Object.assign({},this.internalTests),a.exclusiveTests=Object.assign({},this.exclusiveTests),a.deps=[...this.deps],a.conditions=[...this.conditions],a.tests=[...this.tests],a.transforms=[...this.transforms],a.spec=mo(Object.assign({},this.spec,e)),a}label(e){let a=this.clone();return a.spec.label=e,a}meta(...e){if(e.length===0)return this.spec.meta;let a=this.clone();return a.spec.meta=Object.assign(a.spec.meta||{},e[0]),a}withMutation(e){let a=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=a,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let a=this,i=e.clone();const s=Object.assign({},a.spec,i.spec);return i.spec=s,i.internalTests=Object.assign({},a.internalTests,i.internalTests),i._whitelist=a._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=a._blacklist.merge(e._blacklist,e._whitelist),i.tests=a.tests,i.exclusiveTests=a.exclusiveTests,i.withMutation(c=>{e.tests.forEach(d=>{c.test(d.OPTIONS)})}),i.transforms=[...a.transforms,...i.transforms],i}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let a=this;if(a.conditions.length){let i=a.conditions;a=a.clone(),a.conditions=[],a=i.reduce((s,c)=>c.resolve(s,e),a),a=a.resolve(e)}return a}resolveOptions(e){var a,i,s,c;return Object.assign({},e,{from:e.from||[],strict:(a=e.strict)!=null?a:this.spec.strict,abortEarly:(i=e.abortEarly)!=null?i:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(c=e.disableStackTrace)!=null?c:this.spec.disableStackTrace})}cast(e,a={}){let i=this.resolve(Object.assign({value:e},a)),s=a.assert==="ignore-optionality",c=i._cast(e,a);if(a.assert!==!1&&!i.isType(c)){if(s&&ys(c))return c;let d=Gi(e),m=Gi(c);throw new TypeError(`The value of ${a.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}". 

attempted value: ${d} 
`+(m!==d?`result of cast: ${m}`:""))}return c}_cast(e,a){let i=e===void 0?e:this.transforms.reduce((s,c)=>c.call(this,s,e,this),e);return i===void 0&&(i=this.getDefault(a)),i}_validate(e,a={},i,s){let{path:c,originalValue:d=e,strict:m=this.spec.strict}=a,g=e;m||(g=this._cast(g,Object.assign({assert:!1},a)));let f=[];for(let E of Object.values(this.internalTests))E&&f.push(E);this.runTests({path:c,value:g,originalValue:d,options:a,tests:f},i,E=>{if(E.length)return s(E,g);this.runTests({path:c,value:g,originalValue:d,options:a,tests:this.tests},i,s)})}runTests(e,a,i){let s=!1,{tests:c,value:d,originalValue:m,path:g,options:f}=e,E=T=>{s||(s=!0,a(T,d))},p=T=>{s||(s=!0,i(T,d))},C=c.length,I=[];if(!C)return p([]);let x={value:d,originalValue:m,path:g,options:f,schema:this};for(let T=0;T<c.length;T++){const k=c[T];k(x,E,function(_){_&&(Array.isArray(_)?I.push(..._):I.push(_)),--C<=0&&p(I)})}}asNestedTest({key:e,index:a,parent:i,parentPath:s,originalParent:c,options:d}){const m=e??a;if(m==null)throw TypeError("Must include `key` or `index` for nested validations");const g=typeof m=="number";let f=i[m];const E=Object.assign({},d,{strict:!0,parent:i,value:f,originalValue:c[m],key:void 0,[g?"index":"key"]:m,path:g||m.includes(".")?`${s||""}[${g?m:`"${m}"`}]`:(s?`${s}.`:"")+e});return(p,C,I)=>this.resolve(E)._validate(f,E,C,I)}validate(e,a){var i;let s=this.resolve(Object.assign({},a,{value:e})),c=(i=a==null?void 0:a.disableStackTrace)!=null?i:s.spec.disableStackTrace;return new Promise((d,m)=>s._validate(e,a,(g,f)=>{ln.isError(g)&&(g.value=f),m(g)},(g,f)=>{g.length?m(new ln(g,f,void 0,void 0,c)):d(f)}))}validateSync(e,a){var i;let s=this.resolve(Object.assign({},a,{value:e})),c,d=(i=a==null?void 0:a.disableStackTrace)!=null?i:s.spec.disableStackTrace;return s._validate(e,Object.assign({},a,{sync:!0}),(m,g)=>{throw ln.isError(m)&&(m.value=g),m},(m,g)=>{if(m.length)throw new ln(m,e,void 0,void 0,d);c=g}),c}isValid(e,a){return this.validate(e,a).then(()=>!0,i=>{if(ln.isError(i))return!1;throw i})}isValidSync(e,a){try{return this.validateSync(e,a),!0}catch(i){if(ln.isError(i))return!1;throw i}}_getDefault(e){let a=this.spec.default;return a==null?a:typeof a=="function"?a.call(this,e):mo(a)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,a){const i=this.clone({nullable:e});return i.internalTests.nullable=so({message:a,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),i}optionality(e,a){const i=this.clone({optional:e});return i.internalTests.optionality=so({message:a,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=Nr.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Nr.notNull){return this.nullability(!1,e)}required(e=Nr.required){return this.clone().withMutation(a=>a.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let a=this.clone();return a.transforms.push(e),a}test(...e){let a;if(e.length===1?typeof e[0]=="function"?a={test:e[0]}:a=e[0]:e.length===2?a={name:e[0],test:e[1]}:a={name:e[0],message:e[1],test:e[2]},a.message===void 0&&(a.message=Nr.default),typeof a.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),s=so(a),c=a.exclusive||a.name&&i.exclusiveTests[a.name]===!0;if(a.exclusive&&!a.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return a.name&&(i.exclusiveTests[a.name]=!!a.exclusive),i.tests=i.tests.filter(d=>!(d.OPTIONS.name===a.name&&(c||d.OPTIONS.test===s.OPTIONS.test))),i.tests.push(s),i}when(e,a){!Array.isArray(e)&&typeof e!="string"&&(a=e,e=".");let i=this.clone(),s=AI(e).map(c=>new Cs(c));return s.forEach(c=>{c.isSibling&&i.deps.push(c.key)}),i.conditions.push(typeof a=="function"?new Yu(s,a):Yu.fromOptions(s,a)),i}typeError(e){let a=this.clone();return a.internalTests.typeError=so({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),a}oneOf(e,a=Nr.oneOf){let i=this.clone();return e.forEach(s=>{i._whitelist.add(s),i._blacklist.delete(s)}),i.internalTests.whiteList=so({message:a,name:"oneOf",skipAbsent:!0,test(s){let c=this.schema._whitelist,d=c.resolveAll(this.resolve);return d.includes(s)?!0:this.createError({params:{values:Array.from(c).join(", "),resolved:d}})}}),i}notOneOf(e,a=Nr.notOneOf){let i=this.clone();return e.forEach(s=>{i._blacklist.add(s),i._whitelist.delete(s)}),i.internalTests.blacklist=so({message:a,name:"notOneOf",test(s){let c=this.schema._blacklist,d=c.resolveAll(this.resolve);return d.includes(s)?this.createError({params:{values:Array.from(c).join(", "),resolved:d}}):!0}}),i}strip(e=!0){let a=this.clone();return a.spec.strip=e,a}describe(e){const a=(e?this.resolve(e):this).clone(),{label:i,meta:s,optional:c,nullable:d}=a.spec;return{meta:s,label:i,optional:c,nullable:d,default:a.getDefault(e),type:a.type,oneOf:a._whitelist.describe(),notOneOf:a._blacklist.describe(),tests:a.tests.map(g=>({name:g.OPTIONS.name,params:g.OPTIONS.params})).filter((g,f,E)=>E.findIndex(p=>p.name===g.name)===f)}}}Lr.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])Lr.prototype[`${r}At`]=function(e,a,i={}){const{parent:s,parentPath:c,schema:d}=L2(this,e,a,i.context);return d[r](s&&s[c],Object.assign({},i,{parent:s,path:e}))};for(const r of["equals","is"])Lr.prototype[r]=Lr.prototype.oneOf;for(const r of["not","nope"])Lr.prototype[r]=Lr.prototype.notOneOf;const R2=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function D2(r){const e=th(r);if(!e)return Date.parse?Date.parse(r):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let a=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(a=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(a=0-a)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+a,e.second,e.millisecond)}function th(r){var e,a;const i=R2.exec(r);return i?{year:Zr(i[1]),month:Zr(i[2],1)-1,day:Zr(i[3],1),hour:Zr(i[4]),minute:Zr(i[5]),second:Zr(i[6]),millisecond:i[7]?Zr(i[7].substring(0,3)):0,precision:(e=(a=i[7])==null?void 0:a.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:Zr(i[10]),minuteOffset:Zr(i[11])}:null}function Zr(r,e=0){return Number(r)||e}let B2=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,U2=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,_2=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,M2="^\\d{4}-\\d{2}-\\d{2}",F2="\\d{2}:\\d{2}:\\d{2}",O2="(([+-]\\d{2}(:?\\d{2})?)|Z)",j2=new RegExp(`${M2}T${F2}(\\.\\d+)?${O2}$`),P2=r=>ys(r)||r===r.trim(),H2={}.toString();function ah(){return new bI}class bI extends Lr{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,a,i)=>{if(!i.spec.coerce||i.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===H2?e:s})})}required(e){return super.required(e).withMutation(a=>a.test({message:e||Nr.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(a=>a.OPTIONS.name!=="required"),e))}length(e,a=wn.length){return this.test({message:a,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,a=wn.min){return this.test({message:a,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,a=wn.max){return this.test({name:"max",exclusive:!0,message:a,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,a){let i=!1,s,c;return a&&(typeof a=="object"?{excludeEmptyString:i=!1,message:s,name:c}=a:s=a),this.test({name:c||"matches",message:s||wn.matches,params:{regex:e},skipAbsent:!0,test:d=>d===""&&i||d.search(e)!==-1})}email(e=wn.email){return this.matches(B2,{name:"email",message:e,excludeEmptyString:!0})}url(e=wn.url){return this.matches(U2,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=wn.uuid){return this.matches(_2,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let a="",i,s;return e&&(typeof e=="object"?{message:a="",allowOffset:i=!1,precision:s=void 0}=e:a=e),this.matches(j2,{name:"datetime",message:a||wn.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:a||wn.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:c=>{if(!c||i)return!0;const d=th(c);return d?!!d.z:!1}}).test({name:"datetime_precision",message:a||wn.datetime_precision,params:{precision:s},skipAbsent:!0,test:c=>{if(!c||s==null)return!0;const d=th(c);return d?d.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=wn.trim){return this.transform(a=>a!=null?a.trim():a).test({message:e,name:"trim",test:P2})}lowercase(e=wn.lowercase){return this.transform(a=>ys(a)?a:a.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:a=>ys(a)||a===a.toLowerCase()})}uppercase(e=wn.uppercase){return this.transform(a=>ys(a)?a:a.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:a=>ys(a)||a===a.toUpperCase()})}}ah.prototype=bI.prototype;let Q2=new Date(""),z2=r=>Object.prototype.toString.call(r)==="[object Date]";class Rh extends Lr{constructor(){super({type:"date",check(e){return z2(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,a,i)=>!i.spec.coerce||i.isType(e)||e===null?e:(e=D2(e),isNaN(e)?Rh.INVALID_DATE:new Date(e)))})}prepareParam(e,a){let i;if(Cs.isRef(e))i=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${a}\` must be a Date or a value that can be \`cast()\` to a Date`);i=s}return i}min(e,a=eh.min){let i=this.prepareParam(e,"min");return this.test({message:a,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(i)}})}max(e,a=eh.max){let i=this.prepareParam(e,"max");return this.test({message:a,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(i)}})}}Rh.INVALID_DATE=Q2;function V2(r,e=[]){let a=[],i=new Set,s=new Set(e.map(([d,m])=>`${d}-${m}`));function c(d,m){let g=Is.split(d)[0];i.add(g),s.has(`${m}-${g}`)||a.push([m,g])}for(const d of Object.keys(r)){let m=r[d];i.add(d),Cs.isRef(m)&&m.isSibling?c(m.path,d):Lh(m)&&"deps"in m&&m.deps.forEach(g=>c(g,d))}return y2.array(Array.from(i),a).reverse()}function qy(r,e){let a=1/0;return r.some((i,s)=>{var c;if((c=e.path)!=null&&c.includes(i))return a=s,!0}),a}function II(r){return(e,a)=>qy(r,e)-qy(r,a)}const K2=(r,e,a)=>{if(typeof r!="string")return r;let i=r;try{i=JSON.parse(r)}catch{}return a.isType(i)?i:r};function Ou(r){if("fields"in r){const e={};for(const[a,i]of Object.entries(r.fields))e[a]=Ou(i);return r.setFields(e)}if(r.type==="array"){const e=r.optional();return e.innerType&&(e.innerType=Ou(e.innerType)),e}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(Ou)}):"optional"in r?r.optional():r}const G2=(r,e)=>{const a=[...Is.normalizePath(e)];if(a.length===1)return a[0]in r;let i=a.pop(),s=Is.getter(Is.join(a),!0)(r);return!!(s&&i in s)};let Wy=r=>Object.prototype.toString.call(r)==="[object Object]";function Yy(r,e){let a=Object.keys(r.fields);return Object.keys(e).filter(i=>a.indexOf(i)===-1)}const q2=II([]);function vI(r){return new wI(r)}class wI extends Lr{constructor(e){super({type:"object",check(a){return Wy(a)||typeof a=="function"}}),this.fields=Object.create(null),this._sortErrors=q2,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,a={}){var i;let s=super._cast(e,a);if(s===void 0)return this.getDefault(a);if(!this._typeCheck(s))return s;let c=this.fields,d=(i=a.stripUnknown)!=null?i:this.spec.noUnknown,m=[].concat(this._nodes,Object.keys(s).filter(p=>!this._nodes.includes(p))),g={},f=Object.assign({},a,{parent:g,__validating:a.__validating||!1}),E=!1;for(const p of m){let C=c[p],I=p in s;if(C){let x,T=s[p];f.path=(a.path?`${a.path}.`:"")+p,C=C.resolve({value:T,context:a.context,parent:g});let k=C instanceof Lr?C.spec:void 0,R=k==null?void 0:k.strict;if(k!=null&&k.strip){E=E||p in s;continue}x=!a.__validating||!R?C.cast(s[p],f):s[p],x!==void 0&&(g[p]=x)}else I&&!d&&(g[p]=s[p]);(I!==p in g||g[p]!==s[p])&&(E=!0)}return E?g:s}_validate(e,a={},i,s){let{from:c=[],originalValue:d=e,recursive:m=this.spec.recursive}=a;a.from=[{schema:this,value:d},...c],a.__validating=!0,a.originalValue=d,super._validate(e,a,i,(g,f)=>{if(!m||!Wy(f)){s(g,f);return}d=d||f;let E=[];for(let p of this._nodes){let C=this.fields[p];!C||Cs.isRef(C)||E.push(C.asNestedTest({options:a,key:p,parent:f,parentPath:a.path,originalParent:d}))}this.runTests({tests:E,value:f,originalValue:d,options:a},i,p=>{s(p.sort(this._sortErrors).concat(g),f)})})}clone(e){const a=super.clone(e);return a.fields=Object.assign({},this.fields),a._nodes=this._nodes,a._excludedEdges=this._excludedEdges,a._sortErrors=this._sortErrors,a}concat(e){let a=super.concat(e),i=a.fields;for(let[s,c]of Object.entries(this.fields)){const d=i[s];i[s]=d===void 0?c:d}return a.withMutation(s=>s.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let a={};return this._nodes.forEach(i=>{var s;const c=this.fields[i];let d=e;(s=d)!=null&&s.value&&(d=Object.assign({},d,{parent:d.value,value:d.value[i]})),a[i]=c&&"getDefault"in c?c.getDefault(d):void 0}),a}setFields(e,a){let i=this.clone();return i.fields=e,i._nodes=V2(e,a),i._sortErrors=II(Object.keys(e)),a&&(i._excludedEdges=a),i}shape(e,a=[]){return this.clone().withMutation(i=>{let s=i._excludedEdges;return a.length&&(Array.isArray(a[0])||(a=[a]),s=[...i._excludedEdges,...a]),i.setFields(Object.assign(i.fields,e),s)})}partial(){const e={};for(const[a,i]of Object.entries(this.fields))e[a]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return Ou(this)}pick(e){const a={};for(const i of e)this.fields[i]&&(a[i]=this.fields[i]);return this.setFields(a,this._excludedEdges.filter(([i,s])=>e.includes(i)&&e.includes(s)))}omit(e){const a=[];for(const i of Object.keys(this.fields))e.includes(i)||a.push(i);return this.pick(a)}from(e,a,i){let s=Is.getter(e,!0);return this.transform(c=>{if(!c)return c;let d=c;return G2(c,e)&&(d=Object.assign({},c),i||delete d[e],d[a]=s(c)),d})}json(){return this.transform(K2)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Fu.exact,test(a){if(a==null)return!0;const i=Yy(this.schema,a);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,a=Fu.noUnknown){typeof e!="boolean"&&(a=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:a,test(s){if(s==null)return!0;const c=Yy(this.schema,s);return!e||c.length===0||this.createError({params:{unknown:c.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,a=Fu.noUnknown){return this.noUnknown(!e,a)}transformKeys(e){return this.transform(a=>{if(!a)return a;const i={};for(const s of Object.keys(a))i[e(s)]=a[s];return i})}camelCase(){return this.transformKeys(Xf.camelCase)}snakeCase(){return this.transformKeys(Xf.snakeCase)}constantCase(){return this.transformKeys(e=>Xf.snakeCase(e).toUpperCase())}describe(e){const a=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[c,d]of Object.entries(a.fields)){var s;let m=e;(s=m)!=null&&s.value&&(m=Object.assign({},m,{parent:m.value,value:m.value[c]})),i.fields[c]=d.describe(m)}return i}}vI.prototype=wI.prototype;const CI=({variant:r="dropdown",size:e="md"})=>{const{i18n:a}=tt(),[i,s]=w.useState(!1),c=w.useRef(null),d=Lk(a.language)||Ol[0];w.useEffect(()=>{const g=f=>{c.current&&!c.current.contains(f.target)&&s(!1)};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[]);const m=async g=>{await a.changeLanguage(g),await ke.setItem("local:language",g),s(!1),a.emit("languageChanged",g)};return r==="buttons"?l.jsx("div",{className:"flex space-x-2",children:Ol.map(g=>l.jsxs("button",{onClick:()=>m(g.code),className:`flex items-center space-x-1 px-2 py-1 text-xs rounded transition-colors ${a.language===g.code?"bg-primary-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-500"}`,title:g.nativeName,children:[l.jsx("span",{className:"text-sm",children:g.flag}),l.jsx("span",{children:g.code.toUpperCase()})]},g.code))}):l.jsxs("div",{className:"relative",ref:c,children:[l.jsxs("button",{onClick:()=>s(!i),className:`w-full flex items-center justify-between px-3 py-1.5 rounded-lg border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors ${e==="sm"?"text-sm":"text-base"}`,children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("span",{className:"text-lg",children:d.flag}),l.jsx("span",{children:d.nativeName})]}),l.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${i?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),i&&l.jsx("div",{className:"absolute top-full left-0 mt-1 w-full bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg z-50",children:Ol.map(g=>l.jsxs("button",{onClick:()=>m(g.code),className:`w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors first:rounded-t-lg last:rounded-b-lg ${e==="sm"?"text-sm":"text-base"}`,children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("span",{className:"text-lg",children:g.flag}),l.jsx("span",{className:"text-gray-700 dark:text-gray-200",children:g.nativeName})]}),a.language===g.code&&l.jsx("svg",{className:"w-4 h-4 text-primary-500",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},g.code))})]})},$f=[{label:"Aliasvault.net",value:Za.DEFAULT_API_URL},{label:"Self-hosted",value:"custom"}],W2=r=>vI().shape({apiUrl:ah().required(r("settings.validation.apiUrlRequired")).test("is-valid-api-url",r("settings.validation.apiUrlInvalid"),e=>{if(!e)return!0;try{const a=new URL(e);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}}),clientUrl:ah().required(r("settings.validation.clientUrlRequired")).test("is-valid-client-url",r("settings.validation.clientUrlInvalid"),e=>{if(!e)return!0;try{const a=new URL(e);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}})}),Y2=()=>{const{t:r}=tt(),[e,a]=w.useState(""),[i,s]=w.useState(""),[c,d]=w.useState(""),[m,g]=w.useState(!0),[f,E]=w.useState({}),{setIsInitialLoading:p}=pa(),C=W2(r),I=w.useRef(null),x=w.useRef(null),T=w.useRef(null),k=w.useRef(null);w.useEffect(()=>()=>{if(I.current&&clearTimeout(I.current),x.current&&clearTimeout(x.current),T.current!==null){const U=T.current;ke.setItem("local:apiUrl",U)}if(k.current!==null){const U=k.current;ke.setItem("local:clientUrl",U)}},[]),w.useEffect(()=>{(async()=>{const P=await ke.getItem("local:apiUrl"),K=await ke.getItem("local:clientUrl"),H=await ke.getItem(qu)!==!1,Q=await ke.getItem(go);g(Q?!1:H);const V=$f.find(G=>G.value===P);V?a(V.value):P?(a("custom"),s(P),d(K??"")):a($f[0].value),p(!1)})()},[p]);const R=async U=>{const P=U.target.value;a(P),P!=="custom"&&(await ke.setItem("local:apiUrl",""),await ke.setItem("local:clientUrl",""),s(""),d(""),E({}))},_=w.useCallback(U=>{const P=U.target.value;s(P),T.current=P,I.current&&clearTimeout(I.current),I.current=setTimeout(async()=>{try{await C.validateAt("apiUrl",{apiUrl:P}),E(K=>({...K,apiUrl:void 0})),await ke.setItem("local:apiUrl",P),T.current=null}catch(K){K instanceof ln&&(E(H=>({...H,apiUrl:K.message})),await ke.setItem("local:apiUrl",Za.DEFAULT_API_URL),await ke.setItem("local:clientUrl",Za.DEFAULT_CLIENT_URL),T.current=null)}},150)},[C]),S=w.useCallback(U=>{const P=U.target.value;d(P),k.current=P,x.current&&clearTimeout(x.current),x.current=setTimeout(async()=>{try{await C.validateAt("clientUrl",{clientUrl:P}),E(K=>({...K,clientUrl:void 0})),await ke.setItem("local:clientUrl",P),k.current=null}catch(K){K instanceof ln&&(E(H=>({...H,clientUrl:K.message})),k.current=null)}},150)},[C]),O=async()=>{const U=!m;await ke.setItem(qu,U),U&&(await ke.setItem(Uu,[]),await ke.setItem(go,0)),g(U)};return l.jsxs("div",{className:"p-4 space-y-6",children:[l.jsxs("div",{className:"space-y-4 pb-6 border-b border-gray-200 dark:border-gray-700",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-1",children:r("settings.serverConfiguration","Server Configuration")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("settings.serverConfigurationDescription","Configure the AliasVault server URL for self-hosted instances")})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"api-connection",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:r("settings.serverUrl")}),l.jsx("select",{id:"api-connection",value:e,onChange:R,className:"w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white",children:$f.map(U=>l.jsx("option",{value:U.value,children:U.label},U.value))})]}),e==="custom"&&l.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-primary-500",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"custom-api-url",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:r("settings.customApiUrl","API URL")}),l.jsx("input",{id:"custom-api-url",type:"text",value:i,onChange:_,placeholder:"https://vault.example.com/api",className:`w-full bg-gray-50 border ${f.apiUrl?"border-red-500":"border-gray-300"} text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white`}),f.apiUrl&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:f.apiUrl}),l.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:r("settings.apiUrlHint","The API endpoint URL (usually client URL + /api)")})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"custom-client-url",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:r("settings.customClientUrl","Client URL")}),l.jsx("input",{id:"custom-client-url",type:"text",value:c,onChange:S,placeholder:"https://vault.example.com",className:`w-full bg-gray-50 border ${f.clientUrl?"border-red-500":"border-gray-300"} text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white`}),f.clientUrl&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:f.clientUrl}),l.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:r("settings.clientUrlHint","The web interface URL of your self-hosted instance")})]})]})]}),l.jsxs("div",{className:"space-y-4 pb-6 border-b border-gray-200 dark:border-gray-700",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-1",children:r("settings.autofillSettings","Autofill Settings")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("settings.autofillSettingsDescription","Enable or disable the autofill popup on web pages")})]}),l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r("settings.autofillEnabled")}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:m?r("settings.autofillEnabledDescription","Autofill suggestions will appear on login forms"):r("settings.autofillDisabledDescription","Autofill suggestions are disabled globally")})]}),l.jsx("button",{onClick:O,className:`px-4 py-2 rounded-md transition-colors font-medium text-sm ${m?"bg-green-200 text-green-800 hover:bg-green-300 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50":"bg-red-200 text-red-800 hover:bg-red-300 dark:bg-red-900/30 dark:text-red-400 dark:hover:bg-red-900/50"}`,children:m?r("common.enabled","Enabled"):r("common.disabled","Disabled")})]})]}),l.jsxs("div",{className:"space-y-4 pb-6",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-1",children:r("settings.languageSettings","Language")})}),l.jsx("div",{children:l.jsx(CI,{variant:"dropdown",size:"sm"})})]}),l.jsxs("div",{className:"text-center text-xs text-gray-400 dark:text-gray-600 pt-4 border-t border-gray-200 dark:border-gray-700",children:[r("settings.version"),": ",Za.VERSION]})]})},ha=w.forwardRef(({onClick:r,id:e,children:a,type:i="button",variant:s="primary"},c)=>{const d={primary:"bg-primary-500 hover:bg-primary-600",secondary:"bg-gray-500 hover:bg-gray-600"};return l.jsx("button",{ref:c,className:`${d[s]} text-white font-medium rounded-lg px-4 py-2 text-sm w-full`,onClick:r,type:i,id:e,children:a})});ha.displayName="Button";var oo={},Zf,Jy;function J2(){return Jy||(Jy=1,Zf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Zf}var eg={},ji={},Xy;function Ns(){if(Xy)return ji;Xy=1;let r;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return ji.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},ji.getSymbolTotalCodewords=function(i){return e[i]},ji.getBCHDigit=function(a){let i=0;for(;a!==0;)i++,a>>>=1;return i},ji.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');r=i},ji.isKanjiModeEnabled=function(){return typeof r<"u"},ji.toSJIS=function(i){return r(i)},ji}var tg={},$y;function Dh(){return $y||($y=1,function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+a)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,s){if(r.isValid(i))return i;try{return e(i)}catch{return s}}}(tg)),tg}var ag,Zy;function X2(){if(Zy)return ag;Zy=1;function r(){this.buffer=[],this.length=0}return r.prototype={get:function(e){const a=Math.floor(e/8);return(this.buffer[a]>>>7-e%8&1)===1},put:function(e,a){for(let i=0;i<a;i++)this.putBit((e>>>a-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),e&&(this.buffer[a]|=128>>>this.length%8),this.length++}},ag=r,ag}var ng,eE;function $2(){if(eE)return ng;eE=1;function r(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return r.prototype.set=function(e,a,i,s){const c=e*this.size+a;this.data[c]=i,s&&(this.reservedBit[c]=!0)},r.prototype.get=function(e,a){return this.data[e*this.size+a]},r.prototype.xor=function(e,a,i){this.data[e*this.size+a]^=i},r.prototype.isReserved=function(e,a){return this.reservedBit[e*this.size+a]},ng=r,ng}var rg={},tE;function Z2(){return tE||(tE=1,function(r){const e=Ns().getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];const s=Math.floor(i/7)+2,c=e(i),d=c===145?26:Math.ceil((c-13)/(2*s-2))*2,m=[c-7];for(let g=1;g<s-1;g++)m[g]=m[g-1]-d;return m.push(6),m.reverse()},r.getPositions=function(i){const s=[],c=r.getRowColCoords(i),d=c.length;for(let m=0;m<d;m++)for(let g=0;g<d;g++)m===0&&g===0||m===0&&g===d-1||m===d-1&&g===0||s.push([c[m],c[g]]);return s}}(rg)),rg}var ig={},aE;function eL(){if(aE)return ig;aE=1;const r=Ns().getSymbolSize,e=7;return ig.getPositions=function(i){const s=r(i);return[[0,0],[s-e,0],[0,s-e]]},ig}var sg={},nE;function tL(){return nE||(nE=1,function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},r.from=function(s){return r.isValid(s)?parseInt(s,10):void 0},r.getPenaltyN1=function(s){const c=s.size;let d=0,m=0,g=0,f=null,E=null;for(let p=0;p<c;p++){m=g=0,f=E=null;for(let C=0;C<c;C++){let I=s.get(p,C);I===f?m++:(m>=5&&(d+=e.N1+(m-5)),f=I,m=1),I=s.get(C,p),I===E?g++:(g>=5&&(d+=e.N1+(g-5)),E=I,g=1)}m>=5&&(d+=e.N1+(m-5)),g>=5&&(d+=e.N1+(g-5))}return d},r.getPenaltyN2=function(s){const c=s.size;let d=0;for(let m=0;m<c-1;m++)for(let g=0;g<c-1;g++){const f=s.get(m,g)+s.get(m,g+1)+s.get(m+1,g)+s.get(m+1,g+1);(f===4||f===0)&&d++}return d*e.N2},r.getPenaltyN3=function(s){const c=s.size;let d=0,m=0,g=0;for(let f=0;f<c;f++){m=g=0;for(let E=0;E<c;E++)m=m<<1&2047|s.get(f,E),E>=10&&(m===1488||m===93)&&d++,g=g<<1&2047|s.get(E,f),E>=10&&(g===1488||g===93)&&d++}return d*e.N3},r.getPenaltyN4=function(s){let c=0;const d=s.data.length;for(let g=0;g<d;g++)c+=s.data[g];return Math.abs(Math.ceil(c*100/d/5)-10)*e.N4};function a(i,s,c){switch(i){case r.Patterns.PATTERN000:return(s+c)%2===0;case r.Patterns.PATTERN001:return s%2===0;case r.Patterns.PATTERN010:return c%3===0;case r.Patterns.PATTERN011:return(s+c)%3===0;case r.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(c/3))%2===0;case r.Patterns.PATTERN101:return s*c%2+s*c%3===0;case r.Patterns.PATTERN110:return(s*c%2+s*c%3)%2===0;case r.Patterns.PATTERN111:return(s*c%3+(s+c)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(s,c){const d=c.size;for(let m=0;m<d;m++)for(let g=0;g<d;g++)c.isReserved(g,m)||c.xor(g,m,a(s,g,m))},r.getBestMask=function(s,c){const d=Object.keys(r.Patterns).length;let m=0,g=1/0;for(let f=0;f<d;f++){c(f),r.applyMask(f,s);const E=r.getPenaltyN1(s)+r.getPenaltyN2(s)+r.getPenaltyN3(s)+r.getPenaltyN4(s);r.applyMask(f,s),E<g&&(g=E,m=f)}return m}}(sg)),sg}var Eu={},rE;function NI(){if(rE)return Eu;rE=1;const r=Dh(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Eu.getBlocksCount=function(s,c){switch(c){case r.L:return e[(s-1)*4+0];case r.M:return e[(s-1)*4+1];case r.Q:return e[(s-1)*4+2];case r.H:return e[(s-1)*4+3];default:return}},Eu.getTotalCodewordsCount=function(s,c){switch(c){case r.L:return a[(s-1)*4+0];case r.M:return a[(s-1)*4+1];case r.Q:return a[(s-1)*4+2];case r.H:return a[(s-1)*4+3];default:return}},Eu}var og={},Cl={},iE;function aL(){if(iE)return Cl;iE=1;const r=new Uint8Array(512),e=new Uint8Array(256);return function(){let i=1;for(let s=0;s<255;s++)r[s]=i,e[i]=s,i<<=1,i&256&&(i^=285);for(let s=255;s<512;s++)r[s]=r[s-255]}(),Cl.log=function(i){if(i<1)throw new Error("log("+i+")");return e[i]},Cl.exp=function(i){return r[i]},Cl.mul=function(i,s){return i===0||s===0?0:r[e[i]+e[s]]},Cl}var sE;function nL(){return sE||(sE=1,function(r){const e=aL();r.mul=function(i,s){const c=new Uint8Array(i.length+s.length-1);for(let d=0;d<i.length;d++)for(let m=0;m<s.length;m++)c[d+m]^=e.mul(i[d],s[m]);return c},r.mod=function(i,s){let c=new Uint8Array(i);for(;c.length-s.length>=0;){const d=c[0];for(let g=0;g<s.length;g++)c[g]^=e.mul(s[g],d);let m=0;for(;m<c.length&&c[m]===0;)m++;c=c.slice(m)}return c},r.generateECPolynomial=function(i){let s=new Uint8Array([1]);for(let c=0;c<i;c++)s=r.mul(s,new Uint8Array([1,e.exp(c)]));return s}}(og)),og}var lg,oE;function rL(){if(oE)return lg;oE=1;const r=nL();function e(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(i){this.degree=i,this.genPoly=r.generateECPolynomial(this.degree)},e.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const s=new Uint8Array(i.length+this.degree);s.set(i);const c=r.mod(s,this.genPoly),d=this.degree-c.length;if(d>0){const m=new Uint8Array(this.degree);return m.set(c,d),m}return c},lg=e,lg}var cg={},ug={},dg={},lE;function xI(){return lE||(lE=1,dg.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),dg}var Ir={},cE;function TI(){if(cE)return Ir;cE=1;const r="[0-9]+",e="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
]))+`;Ir.KANJI=new RegExp(a,"g"),Ir.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ir.BYTE=new RegExp(i,"g"),Ir.NUMERIC=new RegExp(r,"g"),Ir.ALPHANUMERIC=new RegExp(e,"g");const s=new RegExp("^"+a+"$"),c=new RegExp("^"+r+"$"),d=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Ir.testKanji=function(g){return s.test(g)},Ir.testNumeric=function(g){return c.test(g)},Ir.testAlphanumeric=function(g){return d.test(g)},Ir}var uE;function xs(){return uE||(uE=1,function(r){const e=xI(),a=TI();r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(c,d){if(!c.ccBits)throw new Error("Invalid mode: "+c);if(!e.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?c.ccBits[0]:d<27?c.ccBits[1]:c.ccBits[2]},r.getBestModeForData=function(c){return a.testNumeric(c)?r.NUMERIC:a.testAlphanumeric(c)?r.ALPHANUMERIC:a.testKanji(c)?r.KANJI:r.BYTE},r.toString=function(c){if(c&&c.id)return c.id;throw new Error("Invalid mode")},r.isValid=function(c){return c&&c.bit&&c.ccBits};function i(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+s)}}r.from=function(c,d){if(r.isValid(c))return c;try{return i(c)}catch{return d}}}(ug)),ug}var dE;function iL(){return dE||(dE=1,function(r){const e=Ns(),a=NI(),i=Dh(),s=xs(),c=xI(),d=7973,m=e.getBCHDigit(d);function g(C,I,x){for(let T=1;T<=40;T++)if(I<=r.getCapacity(T,x,C))return T}function f(C,I){return s.getCharCountIndicator(C,I)+4}function E(C,I){let x=0;return C.forEach(function(T){const k=f(T.mode,I);x+=k+T.getBitsLength()}),x}function p(C,I){for(let x=1;x<=40;x++)if(E(C,x)<=r.getCapacity(x,I,s.MIXED))return x}r.from=function(I,x){return c.isValid(I)?parseInt(I,10):x},r.getCapacity=function(I,x,T){if(!c.isValid(I))throw new Error("Invalid QR Code version");typeof T>"u"&&(T=s.BYTE);const k=e.getSymbolTotalCodewords(I),R=a.getTotalCodewordsCount(I,x),_=(k-R)*8;if(T===s.MIXED)return _;const S=_-f(T,I);switch(T){case s.NUMERIC:return Math.floor(S/10*3);case s.ALPHANUMERIC:return Math.floor(S/11*2);case s.KANJI:return Math.floor(S/13);case s.BYTE:default:return Math.floor(S/8)}},r.getBestVersionForData=function(I,x){let T;const k=i.from(x,i.M);if(Array.isArray(I)){if(I.length>1)return p(I,k);if(I.length===0)return 1;T=I[0]}else T=I;return g(T.mode,T.getLength(),k)},r.getEncodedBits=function(I){if(!c.isValid(I)||I<7)throw new Error("Invalid QR Code version");let x=I<<12;for(;e.getBCHDigit(x)-m>=0;)x^=d<<e.getBCHDigit(x)-m;return I<<12|x}}(cg)),cg}var mg={},mE;function sL(){if(mE)return mg;mE=1;const r=Ns(),e=1335,a=21522,i=r.getBCHDigit(e);return mg.getEncodedBits=function(c,d){const m=c.bit<<3|d;let g=m<<10;for(;r.getBCHDigit(g)-i>=0;)g^=e<<r.getBCHDigit(g)-i;return(m<<10|g)^a},mg}var fg={},gg,fE;function oL(){if(fE)return gg;fE=1;const r=xs();function e(a){this.mode=r.NUMERIC,this.data=a.toString()}return e.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(i){let s,c,d;for(s=0;s+3<=this.data.length;s+=3)c=this.data.substr(s,3),d=parseInt(c,10),i.put(d,10);const m=this.data.length-s;m>0&&(c=this.data.substr(s),d=parseInt(c,10),i.put(d,m*3+1))},gg=e,gg}var hg,gE;function lL(){if(gE)return hg;gE=1;const r=xs(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(i){this.mode=r.ALPHANUMERIC,this.data=i}return a.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(s){let c;for(c=0;c+2<=this.data.length;c+=2){let d=e.indexOf(this.data[c])*45;d+=e.indexOf(this.data[c+1]),s.put(d,11)}this.data.length%2&&s.put(e.indexOf(this.data[c]),6)},hg=a,hg}var Ag,hE;function cL(){if(hE)return Ag;hE=1;const r=xs();function e(a){this.mode=r.BYTE,typeof a=="string"?this.data=new TextEncoder().encode(a):this.data=new Uint8Array(a)}return e.getBitsLength=function(i){return i*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(a){for(let i=0,s=this.data.length;i<s;i++)a.put(this.data[i],8)},Ag=e,Ag}var pg,AE;function uL(){if(AE)return pg;AE=1;const r=xs(),e=Ns();function a(i){this.mode=r.KANJI,this.data=i}return a.getBitsLength=function(s){return s*13},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(i){let s;for(s=0;s<this.data.length;s++){let c=e.toSJIS(this.data[s]);if(c>=33088&&c<=40956)c-=33088;else if(c>=57408&&c<=60351)c-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+`
Make sure your charset is UTF-8`);c=(c>>>8&255)*192+(c&255),i.put(c,13)}},pg=a,pg}var yg={exports:{}},pE;function dL(){return pE||(pE=1,function(r){var e={single_source_shortest_paths:function(a,i,s){var c={},d={};d[i]=0;var m=e.PriorityQueue.make();m.push(i,0);for(var g,f,E,p,C,I,x,T,k;!m.empty();){g=m.pop(),f=g.value,p=g.cost,C=a[f]||{};for(E in C)C.hasOwnProperty(E)&&(I=C[E],x=p+I,T=d[E],k=typeof d[E]>"u",(k||T>x)&&(d[E]=x,m.push(E,x),c[E]=f))}if(typeof s<"u"&&typeof d[s]>"u"){var R=["Could not find a path from ",i," to ",s,"."].join("");throw new Error(R)}return c},extract_shortest_path_from_predecessor_list:function(a,i){for(var s=[],c=i;c;)s.push(c),a[c],c=a[c];return s.reverse(),s},find_path:function(a,i,s){var c=e.single_source_shortest_paths(a,i,s);return e.extract_shortest_path_from_predecessor_list(c,s)},PriorityQueue:{make:function(a){var i=e.PriorityQueue,s={},c;a=a||{};for(c in i)i.hasOwnProperty(c)&&(s[c]=i[c]);return s.queue=[],s.sorter=a.sorter||i.default_sorter,s},default_sorter:function(a,i){return a.cost-i.cost},push:function(a,i){var s={value:a,cost:i};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=e}(yg)),yg.exports}var yE;function mL(){return yE||(yE=1,function(r){const e=xs(),a=oL(),i=lL(),s=cL(),c=uL(),d=TI(),m=Ns(),g=dL();function f(R){return unescape(encodeURIComponent(R)).length}function E(R,_,S){const O=[];let U;for(;(U=R.exec(S))!==null;)O.push({data:U[0],index:U.index,mode:_,length:U[0].length});return O}function p(R){const _=E(d.NUMERIC,e.NUMERIC,R),S=E(d.ALPHANUMERIC,e.ALPHANUMERIC,R);let O,U;return m.isKanjiModeEnabled()?(O=E(d.BYTE,e.BYTE,R),U=E(d.KANJI,e.KANJI,R)):(O=E(d.BYTE_KANJI,e.BYTE,R),U=[]),_.concat(S,O,U).sort(function(K,H){return K.index-H.index}).map(function(K){return{data:K.data,mode:K.mode,length:K.length}})}function C(R,_){switch(_){case e.NUMERIC:return a.getBitsLength(R);case e.ALPHANUMERIC:return i.getBitsLength(R);case e.KANJI:return c.getBitsLength(R);case e.BYTE:return s.getBitsLength(R)}}function I(R){return R.reduce(function(_,S){const O=_.length-1>=0?_[_.length-1]:null;return O&&O.mode===S.mode?(_[_.length-1].data+=S.data,_):(_.push(S),_)},[])}function x(R){const _=[];for(let S=0;S<R.length;S++){const O=R[S];switch(O.mode){case e.NUMERIC:_.push([O,{data:O.data,mode:e.ALPHANUMERIC,length:O.length},{data:O.data,mode:e.BYTE,length:O.length}]);break;case e.ALPHANUMERIC:_.push([O,{data:O.data,mode:e.BYTE,length:O.length}]);break;case e.KANJI:_.push([O,{data:O.data,mode:e.BYTE,length:f(O.data)}]);break;case e.BYTE:_.push([{data:O.data,mode:e.BYTE,length:f(O.data)}])}}return _}function T(R,_){const S={},O={start:{}};let U=["start"];for(let P=0;P<R.length;P++){const K=R[P],H=[];for(let Q=0;Q<K.length;Q++){const V=K[Q],G=""+P+Q;H.push(G),S[G]={node:V,lastCount:0},O[G]={};for(let q=0;q<U.length;q++){const W=U[q];S[W]&&S[W].node.mode===V.mode?(O[W][G]=C(S[W].lastCount+V.length,V.mode)-C(S[W].lastCount,V.mode),S[W].lastCount+=V.length):(S[W]&&(S[W].lastCount=V.length),O[W][G]=C(V.length,V.mode)+4+e.getCharCountIndicator(V.mode,_))}}U=H}for(let P=0;P<U.length;P++)O[U[P]].end=0;return{map:O,table:S}}function k(R,_){let S;const O=e.getBestModeForData(R);if(S=e.from(_,O),S!==e.BYTE&&S.bit<O.bit)throw new Error('"'+R+'" cannot be encoded with mode '+e.toString(S)+`.
 Suggested mode is: `+e.toString(O));switch(S===e.KANJI&&!m.isKanjiModeEnabled()&&(S=e.BYTE),S){case e.NUMERIC:return new a(R);case e.ALPHANUMERIC:return new i(R);case e.KANJI:return new c(R);case e.BYTE:return new s(R)}}r.fromArray=function(_){return _.reduce(function(S,O){return typeof O=="string"?S.push(k(O,null)):O.data&&S.push(k(O.data,O.mode)),S},[])},r.fromString=function(_,S){const O=p(_,m.isKanjiModeEnabled()),U=x(O),P=T(U,S),K=g.find_path(P.map,"start","end"),H=[];for(let Q=1;Q<K.length-1;Q++)H.push(P.table[K[Q]].node);return r.fromArray(I(H))},r.rawSplit=function(_){return r.fromArray(p(_,m.isKanjiModeEnabled()))}}(fg)),fg}var EE;function fL(){if(EE)return eg;EE=1;const r=Ns(),e=Dh(),a=X2(),i=$2(),s=Z2(),c=eL(),d=tL(),m=NI(),g=rL(),f=iL(),E=sL(),p=xs(),C=mL();function I(P,K){const H=P.size,Q=c.getPositions(K);for(let V=0;V<Q.length;V++){const G=Q[V][0],q=Q[V][1];for(let W=-1;W<=7;W++)if(!(G+W<=-1||H<=G+W))for(let ne=-1;ne<=7;ne++)q+ne<=-1||H<=q+ne||(W>=0&&W<=6&&(ne===0||ne===6)||ne>=0&&ne<=6&&(W===0||W===6)||W>=2&&W<=4&&ne>=2&&ne<=4?P.set(G+W,q+ne,!0,!0):P.set(G+W,q+ne,!1,!0))}}function x(P){const K=P.size;for(let H=8;H<K-8;H++){const Q=H%2===0;P.set(H,6,Q,!0),P.set(6,H,Q,!0)}}function T(P,K){const H=s.getPositions(K);for(let Q=0;Q<H.length;Q++){const V=H[Q][0],G=H[Q][1];for(let q=-2;q<=2;q++)for(let W=-2;W<=2;W++)q===-2||q===2||W===-2||W===2||q===0&&W===0?P.set(V+q,G+W,!0,!0):P.set(V+q,G+W,!1,!0)}}function k(P,K){const H=P.size,Q=f.getEncodedBits(K);let V,G,q;for(let W=0;W<18;W++)V=Math.floor(W/3),G=W%3+H-8-3,q=(Q>>W&1)===1,P.set(V,G,q,!0),P.set(G,V,q,!0)}function R(P,K,H){const Q=P.size,V=E.getEncodedBits(K,H);let G,q;for(G=0;G<15;G++)q=(V>>G&1)===1,G<6?P.set(G,8,q,!0):G<8?P.set(G+1,8,q,!0):P.set(Q-15+G,8,q,!0),G<8?P.set(8,Q-G-1,q,!0):G<9?P.set(8,15-G-1+1,q,!0):P.set(8,15-G-1,q,!0);P.set(Q-8,8,1,!0)}function _(P,K){const H=P.size;let Q=-1,V=H-1,G=7,q=0;for(let W=H-1;W>0;W-=2)for(W===6&&W--;;){for(let ne=0;ne<2;ne++)if(!P.isReserved(V,W-ne)){let me=!1;q<K.length&&(me=(K[q]>>>G&1)===1),P.set(V,W-ne,me),G--,G===-1&&(q++,G=7)}if(V+=Q,V<0||H<=V){V-=Q,Q=-Q;break}}}function S(P,K,H){const Q=new a;H.forEach(function(ne){Q.put(ne.mode.bit,4),Q.put(ne.getLength(),p.getCharCountIndicator(ne.mode,P)),ne.write(Q)});const V=r.getSymbolTotalCodewords(P),G=m.getTotalCodewordsCount(P,K),q=(V-G)*8;for(Q.getLengthInBits()+4<=q&&Q.put(0,4);Q.getLengthInBits()%8!==0;)Q.putBit(0);const W=(q-Q.getLengthInBits())/8;for(let ne=0;ne<W;ne++)Q.put(ne%2?17:236,8);return O(Q,P,K)}function O(P,K,H){const Q=r.getSymbolTotalCodewords(K),V=m.getTotalCodewordsCount(K,H),G=Q-V,q=m.getBlocksCount(K,H),W=Q%q,ne=q-W,me=Math.floor(Q/q),$=Math.floor(G/q),re=$+1,ye=me-$,Ae=new g(ye);let j=0;const X=new Array(q),ee=new Array(q);let ie=0;const Ie=new Uint8Array(P.buffer);for(let He=0;He<q;He++){const Ne=He<ne?$:re;X[He]=Ie.slice(j,j+Ne),ee[He]=Ae.encode(X[He]),j+=Ne,ie=Math.max(ie,Ne)}const we=new Uint8Array(Q);let Re=0,De,Te;for(De=0;De<ie;De++)for(Te=0;Te<q;Te++)De<X[Te].length&&(we[Re++]=X[Te][De]);for(De=0;De<ye;De++)for(Te=0;Te<q;Te++)we[Re++]=ee[Te][De];return we}function U(P,K,H,Q){let V;if(Array.isArray(P))V=C.fromArray(P);else if(typeof P=="string"){let me=K;if(!me){const $=C.rawSplit(P);me=f.getBestVersionForData($,H)}V=C.fromString(P,me||40)}else throw new Error("Invalid data");const G=f.getBestVersionForData(V,H);if(!G)throw new Error("The amount of data is too big to be stored in a QR Code");if(!K)K=G;else if(K<G)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+G+`.
`);const q=S(K,H,V),W=r.getSymbolSize(K),ne=new i(W);return I(ne,K),x(ne),T(ne,K),R(ne,H,0),K>=7&&k(ne,K),_(ne,q),isNaN(Q)&&(Q=d.getBestMask(ne,R.bind(null,ne,H))),d.applyMask(Q,ne),R(ne,H,Q),{modules:ne,version:K,errorCorrectionLevel:H,maskPattern:Q,segments:V}}return eg.create=function(K,H){if(typeof K>"u"||K==="")throw new Error("No input text");let Q=e.M,V,G;return typeof H<"u"&&(Q=e.from(H.errorCorrectionLevel,e.M),V=f.from(H.version),G=d.from(H.maskPattern),H.toSJISFunc&&r.setToSJISFunction(H.toSJISFunc)),U(K,V,Q,G)},eg}var Eg={},bg={},bE;function SI(){return bE||(bE=1,function(r){function e(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let i=a.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+a);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(c){return[c,c]}))),i.length===6&&i.push("F","F");const s=parseInt(i.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+i.slice(0,6).join("")}}r.getOptions=function(i){i||(i={}),i.color||(i.color={});const s=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,c=i.width&&i.width>=21?i.width:void 0,d=i.scale||4;return{width:c,scale:c?4:d,margin:s,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},r.getScale=function(i,s){return s.width&&s.width>=i+s.margin*2?s.width/(i+s.margin*2):s.scale},r.getImageWidth=function(i,s){const c=r.getScale(i,s);return Math.floor((i+s.margin*2)*c)},r.qrToImageData=function(i,s,c){const d=s.modules.size,m=s.modules.data,g=r.getScale(d,c),f=Math.floor((d+c.margin*2)*g),E=c.margin*g,p=[c.color.light,c.color.dark];for(let C=0;C<f;C++)for(let I=0;I<f;I++){let x=(C*f+I)*4,T=c.color.light;if(C>=E&&I>=E&&C<f-E&&I<f-E){const k=Math.floor((C-E)/g),R=Math.floor((I-E)/g);T=p[m[k*d+R]?1:0]}i[x++]=T.r,i[x++]=T.g,i[x++]=T.b,i[x]=T.a}}}(bg)),bg}var IE;function gL(){return IE||(IE=1,function(r){const e=SI();function a(s,c,d){s.clearRect(0,0,c.width,c.height),c.style||(c.style={}),c.height=d,c.width=d,c.style.height=d+"px",c.style.width=d+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(c,d,m){let g=m,f=d;typeof g>"u"&&(!d||!d.getContext)&&(g=d,d=void 0),d||(f=i()),g=e.getOptions(g);const E=e.getImageWidth(c.modules.size,g),p=f.getContext("2d"),C=p.createImageData(E,E);return e.qrToImageData(C.data,c,g),a(p,f,E),p.putImageData(C,0,0),f},r.renderToDataURL=function(c,d,m){let g=m;typeof g>"u"&&(!d||!d.getContext)&&(g=d,d=void 0),g||(g={});const f=r.render(c,d,g),E=g.type||"image/png",p=g.rendererOpts||{};return f.toDataURL(E,p.quality)}}(Eg)),Eg}var Ig={},vE;function hL(){if(vE)return Ig;vE=1;const r=SI();function e(s,c){const d=s.a/255,m=c+'="'+s.hex+'"';return d<1?m+" "+c+'-opacity="'+d.toFixed(2).slice(1)+'"':m}function a(s,c,d){let m=s+c;return typeof d<"u"&&(m+=" "+d),m}function i(s,c,d){let m="",g=0,f=!1,E=0;for(let p=0;p<s.length;p++){const C=Math.floor(p%c),I=Math.floor(p/c);!C&&!f&&(f=!0),s[p]?(E++,p>0&&C>0&&s[p-1]||(m+=f?a("M",C+d,.5+I+d):a("m",g,0),g=0,f=!1),C+1<c&&s[p+1]||(m+=a("h",E),E=0)):g++}return m}return Ig.render=function(c,d,m){const g=r.getOptions(d),f=c.modules.size,E=c.modules.data,p=f+g.margin*2,C=g.color.light.a?"<path "+e(g.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",I="<path "+e(g.color.dark,"stroke")+' d="'+i(E,f,g.margin)+'"/>',x='viewBox="0 0 '+p+" "+p+'"',k='<svg xmlns="http://www.w3.org/2000/svg" '+(g.width?'width="'+g.width+'" height="'+g.width+'" ':"")+x+' shape-rendering="crispEdges">'+C+I+`</svg>
`;return typeof m=="function"&&m(null,k),k},Ig}var wE;function AL(){if(wE)return oo;wE=1;const r=J2(),e=fL(),a=gL(),i=hL();function s(c,d,m,g,f){const E=[].slice.call(arguments,1),p=E.length,C=typeof E[p-1]=="function";if(!C&&!r())throw new Error("Callback required as last argument");if(C){if(p<2)throw new Error("Too few arguments provided");p===2?(f=m,m=d,d=g=void 0):p===3&&(d.getContext&&typeof f>"u"?(f=g,g=void 0):(f=g,g=m,m=d,d=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(m=d,d=g=void 0):p===2&&!d.getContext&&(g=m,m=d,d=void 0),new Promise(function(I,x){try{const T=e.create(m,g);I(c(T,d,g))}catch(T){x(T)}})}try{const I=e.create(m,g);f(null,c(I,d,g))}catch(I){f(I)}}return oo.create=e.create,oo.toCanvas=s.bind(null,a.render),oo.toDataURL=s.bind(null,a.renderToDataURL),oo.toString=s.bind(null,function(c,d,m){return i.render(c,m)}),oo}var pL=AL();const yL=qi(pL),Zn=({isOpen:r,onClose:e,title:a,children:i,maxWidth:s="max-w-md",showCloseButton:c=!0,footer:d,showHeaderBorder:m=!0,bodyClassName:g="px-6 py-4"})=>{const{t:f}=tt(),E=w.useCallback(I=>{I.key==="Escape"&&e()},[e]);if(w.useEffect(()=>{if(r)return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[r,E]),!r)return null;const p=I=>{I.target===I.currentTarget&&e()},C=a||c;return l.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 transition-opacity",onClick:e}),l.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:p,children:l.jsxs("div",{className:`relative transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow-xl transition-all w-full ${s} mx-4`,children:[C&&l.jsxs("div",{className:`px-6 py-4 flex items-center justify-between ${m?"border-b border-gray-200 dark:border-gray-700":""}`,children:[a&&l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:a}),!a&&l.jsx("div",{}),c&&l.jsxs("button",{type:"button",className:"text-gray-400 hover:text-gray-500 focus:outline-none",onClick:e,children:[l.jsx("span",{className:"sr-only",children:f("common.close")}),l.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})]}),l.jsx("div",{className:g,children:i}),d&&l.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:d})]})})]})};var Mn=(r=>(r.TIMEOUT="TIMEOUT",r.GENERIC="GENERIC",r))(Mn||{}),vg={},Nl={},CE;function EL(){if(CE)return Nl;CE=1,Nl.byteLength=m,Nl.toByteArray=f,Nl.fromByteArray=C;for(var r=[],e=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=i.length;s<c;++s)r[s]=i[s],e[i.charCodeAt(s)]=s;e[45]=62,e[95]=63;function d(I){var x=I.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var T=I.indexOf("=");T===-1&&(T=x);var k=T===x?0:4-T%4;return[T,k]}function m(I){var x=d(I),T=x[0],k=x[1];return(T+k)*3/4-k}function g(I,x,T){return(x+T)*3/4-T}function f(I){var x,T=d(I),k=T[0],R=T[1],_=new a(g(I,k,R)),S=0,O=R>0?k-4:k,U;for(U=0;U<O;U+=4)x=e[I.charCodeAt(U)]<<18|e[I.charCodeAt(U+1)]<<12|e[I.charCodeAt(U+2)]<<6|e[I.charCodeAt(U+3)],_[S++]=x>>16&255,_[S++]=x>>8&255,_[S++]=x&255;return R===2&&(x=e[I.charCodeAt(U)]<<2|e[I.charCodeAt(U+1)]>>4,_[S++]=x&255),R===1&&(x=e[I.charCodeAt(U)]<<10|e[I.charCodeAt(U+1)]<<4|e[I.charCodeAt(U+2)]>>2,_[S++]=x>>8&255,_[S++]=x&255),_}function E(I){return r[I>>18&63]+r[I>>12&63]+r[I>>6&63]+r[I&63]}function p(I,x,T){for(var k,R=[],_=x;_<T;_+=3)k=(I[_]<<16&16711680)+(I[_+1]<<8&65280)+(I[_+2]&255),R.push(E(k));return R.join("")}function C(I){for(var x,T=I.length,k=T%3,R=[],_=16383,S=0,O=T-k;S<O;S+=_)R.push(p(I,S,S+_>O?O:S+_));return k===1?(x=I[T-1],R.push(r[x>>2]+r[x<<4&63]+"==")):k===2&&(x=(I[T-2]<<8)+I[T-1],R.push(r[x>>10]+r[x>>4&63]+r[x<<2&63]+"=")),R.join("")}return Nl}var bu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var NE;function bL(){return NE||(NE=1,bu.read=function(r,e,a,i,s){var c,d,m=s*8-i-1,g=(1<<m)-1,f=g>>1,E=-7,p=a?s-1:0,C=a?-1:1,I=r[e+p];for(p+=C,c=I&(1<<-E)-1,I>>=-E,E+=m;E>0;c=c*256+r[e+p],p+=C,E-=8);for(d=c&(1<<-E)-1,c>>=-E,E+=i;E>0;d=d*256+r[e+p],p+=C,E-=8);if(c===0)c=1-f;else{if(c===g)return d?NaN:(I?-1:1)*(1/0);d=d+Math.pow(2,i),c=c-f}return(I?-1:1)*d*Math.pow(2,c-i)},bu.write=function(r,e,a,i,s,c){var d,m,g,f=c*8-s-1,E=(1<<f)-1,p=E>>1,C=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=i?0:c-1,x=i?1:-1,T=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,d=E):(d=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-d))<1&&(d--,g*=2),d+p>=1?e+=C/g:e+=C*Math.pow(2,1-p),e*g>=2&&(d++,g/=2),d+p>=E?(m=0,d=E):d+p>=1?(m=(e*g-1)*Math.pow(2,s),d=d+p):(m=e*Math.pow(2,p-1)*Math.pow(2,s),d=0));s>=8;r[a+I]=m&255,I+=x,m/=256,s-=8);for(d=d<<s|m,f+=s;f>0;r[a+I]=d&255,I+=x,d/=256,f-=8);r[a+I-x]|=T*128}),bu}/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var xE;function IL(){return xE||(xE=1,function(r){const e=EL(),a=bL(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=m,r.SlowBuffer=_,r.INSPECT_MAX_BYTES=50;const s=2147483647;r.kMaxLength=s,m.TYPED_ARRAY_SUPPORT=c(),!m.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const B=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(B,v),B.foo()===42}catch{return!1}}Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}});function d(B){if(B>s)throw new RangeError('The value "'+B+'" is invalid for option "size"');const v=new Uint8Array(B);return Object.setPrototypeOf(v,m.prototype),v}function m(B,v,N){if(typeof B=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(B)}return g(B,v,N)}m.poolSize=8192;function g(B,v,N){if(typeof B=="string")return C(B,v);if(ArrayBuffer.isView(B))return x(B);if(B==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(Et(B,ArrayBuffer)||B&&Et(B.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Et(B,SharedArrayBuffer)||B&&Et(B.buffer,SharedArrayBuffer)))return T(B,v,N);if(typeof B=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const z=B.valueOf&&B.valueOf();if(z!=null&&z!==B)return m.from(z,v,N);const ae=k(B);if(ae)return ae;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof B[Symbol.toPrimitive]=="function")return m.from(B[Symbol.toPrimitive]("string"),v,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B)}m.from=function(B,v,N){return g(B,v,N)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array);function f(B){if(typeof B!="number")throw new TypeError('"size" argument must be of type number');if(B<0)throw new RangeError('The value "'+B+'" is invalid for option "size"')}function E(B,v,N){return f(B),B<=0?d(B):v!==void 0?typeof N=="string"?d(B).fill(v,N):d(B).fill(v):d(B)}m.alloc=function(B,v,N){return E(B,v,N)};function p(B){return f(B),d(B<0?0:R(B)|0)}m.allocUnsafe=function(B){return p(B)},m.allocUnsafeSlow=function(B){return p(B)};function C(B,v){if((typeof v!="string"||v==="")&&(v="utf8"),!m.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const N=S(B,v)|0;let z=d(N);const ae=z.write(B,v);return ae!==N&&(z=z.slice(0,ae)),z}function I(B){const v=B.length<0?0:R(B.length)|0,N=d(v);for(let z=0;z<v;z+=1)N[z]=B[z]&255;return N}function x(B){if(Et(B,Uint8Array)){const v=new Uint8Array(B);return T(v.buffer,v.byteOffset,v.byteLength)}return I(B)}function T(B,v,N){if(v<0||B.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(B.byteLength<v+(N||0))throw new RangeError('"length" is outside of buffer bounds');let z;return v===void 0&&N===void 0?z=new Uint8Array(B):N===void 0?z=new Uint8Array(B,v):z=new Uint8Array(B,v,N),Object.setPrototypeOf(z,m.prototype),z}function k(B){if(m.isBuffer(B)){const v=R(B.length)|0,N=d(v);return N.length===0||B.copy(N,0,0,v),N}if(B.length!==void 0)return typeof B.length!="number"||Pt(B.length)?d(0):I(B);if(B.type==="Buffer"&&Array.isArray(B.data))return I(B.data)}function R(B){if(B>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return B|0}function _(B){return+B!=B&&(B=0),m.alloc(+B)}m.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==m.prototype},m.compare=function(v,N){if(Et(v,Uint8Array)&&(v=m.from(v,v.offset,v.byteLength)),Et(N,Uint8Array)&&(N=m.from(N,N.offset,N.byteLength)),!m.isBuffer(v)||!m.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===N)return 0;let z=v.length,ae=N.length;for(let ge=0,Ee=Math.min(z,ae);ge<Ee;++ge)if(v[ge]!==N[ge]){z=v[ge],ae=N[ge];break}return z<ae?-1:ae<z?1:0},m.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(v,N){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return m.alloc(0);let z;if(N===void 0)for(N=0,z=0;z<v.length;++z)N+=v[z].length;const ae=m.allocUnsafe(N);let ge=0;for(z=0;z<v.length;++z){let Ee=v[z];if(Et(Ee,Uint8Array))ge+Ee.length>ae.length?(m.isBuffer(Ee)||(Ee=m.from(Ee)),Ee.copy(ae,ge)):Uint8Array.prototype.set.call(ae,Ee,ge);else if(m.isBuffer(Ee))Ee.copy(ae,ge);else throw new TypeError('"list" argument must be an Array of Buffers');ge+=Ee.length}return ae};function S(B,v){if(m.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||Et(B,ArrayBuffer))return B.byteLength;if(typeof B!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);const N=B.length,z=arguments.length>2&&arguments[2]===!0;if(!z&&N===0)return 0;let ae=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return Be(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N*2;case"hex":return N>>>1;case"base64":return lt(B).length;default:if(ae)return z?-1:Be(B).length;v=(""+v).toLowerCase(),ae=!0}}m.byteLength=S;function O(B,v,N){let z=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0,v>>>=0,N<=v))return"";for(B||(B="utf8");;)switch(B){case"hex":return Ae(this,v,N);case"utf8":case"utf-8":return ne(this,v,N);case"ascii":return re(this,v,N);case"latin1":case"binary":return ye(this,v,N);case"base64":return W(this,v,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,v,N);default:if(z)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),z=!0}}m.prototype._isBuffer=!0;function U(B,v,N){const z=B[v];B[v]=B[N],B[N]=z}m.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<v;N+=2)U(this,N,N+1);return this},m.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<v;N+=4)U(this,N,N+3),U(this,N+1,N+2);return this},m.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<v;N+=8)U(this,N,N+7),U(this,N+1,N+6),U(this,N+2,N+5),U(this,N+3,N+4);return this},m.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?ne(this,0,v):O.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(v){if(!m.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:m.compare(this,v)===0},m.prototype.inspect=function(){let v="";const N=r.INSPECT_MAX_BYTES;return v=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(v+=" ... "),"<Buffer "+v+">"},i&&(m.prototype[i]=m.prototype.inspect),m.prototype.compare=function(v,N,z,ae,ge){if(Et(v,Uint8Array)&&(v=m.from(v,v.offset,v.byteLength)),!m.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(N===void 0&&(N=0),z===void 0&&(z=v?v.length:0),ae===void 0&&(ae=0),ge===void 0&&(ge=this.length),N<0||z>v.length||ae<0||ge>this.length)throw new RangeError("out of range index");if(ae>=ge&&N>=z)return 0;if(ae>=ge)return-1;if(N>=z)return 1;if(N>>>=0,z>>>=0,ae>>>=0,ge>>>=0,this===v)return 0;let Ee=ge-ae,Ue=z-N;const ht=Math.min(Ee,Ue),It=this.slice(ae,ge),St=v.slice(N,z);for(let mt=0;mt<ht;++mt)if(It[mt]!==St[mt]){Ee=It[mt],Ue=St[mt];break}return Ee<Ue?-1:Ue<Ee?1:0};function P(B,v,N,z,ae){if(B.length===0)return-1;if(typeof N=="string"?(z=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,Pt(N)&&(N=ae?0:B.length-1),N<0&&(N=B.length+N),N>=B.length){if(ae)return-1;N=B.length-1}else if(N<0)if(ae)N=0;else return-1;if(typeof v=="string"&&(v=m.from(v,z)),m.isBuffer(v))return v.length===0?-1:K(B,v,N,z,ae);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?ae?Uint8Array.prototype.indexOf.call(B,v,N):Uint8Array.prototype.lastIndexOf.call(B,v,N):K(B,[v],N,z,ae);throw new TypeError("val must be string, number or Buffer")}function K(B,v,N,z,ae){let ge=1,Ee=B.length,Ue=v.length;if(z!==void 0&&(z=String(z).toLowerCase(),z==="ucs2"||z==="ucs-2"||z==="utf16le"||z==="utf-16le")){if(B.length<2||v.length<2)return-1;ge=2,Ee/=2,Ue/=2,N/=2}function ht(St,mt){return ge===1?St[mt]:St.readUInt16BE(mt*ge)}let It;if(ae){let St=-1;for(It=N;It<Ee;It++)if(ht(B,It)===ht(v,St===-1?0:It-St)){if(St===-1&&(St=It),It-St+1===Ue)return St*ge}else St!==-1&&(It-=It-St),St=-1}else for(N+Ue>Ee&&(N=Ee-Ue),It=N;It>=0;It--){let St=!0;for(let mt=0;mt<Ue;mt++)if(ht(B,It+mt)!==ht(v,mt)){St=!1;break}if(St)return It}return-1}m.prototype.includes=function(v,N,z){return this.indexOf(v,N,z)!==-1},m.prototype.indexOf=function(v,N,z){return P(this,v,N,z,!0)},m.prototype.lastIndexOf=function(v,N,z){return P(this,v,N,z,!1)};function H(B,v,N,z){N=Number(N)||0;const ae=B.length-N;z?(z=Number(z),z>ae&&(z=ae)):z=ae;const ge=v.length;z>ge/2&&(z=ge/2);let Ee;for(Ee=0;Ee<z;++Ee){const Ue=parseInt(v.substr(Ee*2,2),16);if(Pt(Ue))return Ee;B[N+Ee]=Ue}return Ee}function Q(B,v,N,z){return et(Be(v,B.length-N),B,N,z)}function V(B,v,N,z){return et($e(v),B,N,z)}function G(B,v,N,z){return et(lt(v),B,N,z)}function q(B,v,N,z){return et(Ye(v,B.length-N),B,N,z)}m.prototype.write=function(v,N,z,ae){if(N===void 0)ae="utf8",z=this.length,N=0;else if(z===void 0&&typeof N=="string")ae=N,z=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite(z)?(z=z>>>0,ae===void 0&&(ae="utf8")):(ae=z,z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ge=this.length-N;if((z===void 0||z>ge)&&(z=ge),v.length>0&&(z<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");ae||(ae="utf8");let Ee=!1;for(;;)switch(ae){case"hex":return H(this,v,N,z);case"utf8":case"utf-8":return Q(this,v,N,z);case"ascii":case"latin1":case"binary":return V(this,v,N,z);case"base64":return G(this,v,N,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,v,N,z);default:if(Ee)throw new TypeError("Unknown encoding: "+ae);ae=(""+ae).toLowerCase(),Ee=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function W(B,v,N){return v===0&&N===B.length?e.fromByteArray(B):e.fromByteArray(B.slice(v,N))}function ne(B,v,N){N=Math.min(B.length,N);const z=[];let ae=v;for(;ae<N;){const ge=B[ae];let Ee=null,Ue=ge>239?4:ge>223?3:ge>191?2:1;if(ae+Ue<=N){let ht,It,St,mt;switch(Ue){case 1:ge<128&&(Ee=ge);break;case 2:ht=B[ae+1],(ht&192)===128&&(mt=(ge&31)<<6|ht&63,mt>127&&(Ee=mt));break;case 3:ht=B[ae+1],It=B[ae+2],(ht&192)===128&&(It&192)===128&&(mt=(ge&15)<<12|(ht&63)<<6|It&63,mt>2047&&(mt<55296||mt>57343)&&(Ee=mt));break;case 4:ht=B[ae+1],It=B[ae+2],St=B[ae+3],(ht&192)===128&&(It&192)===128&&(St&192)===128&&(mt=(ge&15)<<18|(ht&63)<<12|(It&63)<<6|St&63,mt>65535&&mt<1114112&&(Ee=mt))}}Ee===null?(Ee=65533,Ue=1):Ee>65535&&(Ee-=65536,z.push(Ee>>>10&1023|55296),Ee=56320|Ee&1023),z.push(Ee),ae+=Ue}return $(z)}const me=4096;function $(B){const v=B.length;if(v<=me)return String.fromCharCode.apply(String,B);let N="",z=0;for(;z<v;)N+=String.fromCharCode.apply(String,B.slice(z,z+=me));return N}function re(B,v,N){let z="";N=Math.min(B.length,N);for(let ae=v;ae<N;++ae)z+=String.fromCharCode(B[ae]&127);return z}function ye(B,v,N){let z="";N=Math.min(B.length,N);for(let ae=v;ae<N;++ae)z+=String.fromCharCode(B[ae]);return z}function Ae(B,v,N){const z=B.length;(!v||v<0)&&(v=0),(!N||N<0||N>z)&&(N=z);let ae="";for(let ge=v;ge<N;++ge)ae+=qt[B[ge]];return ae}function j(B,v,N){const z=B.slice(v,N);let ae="";for(let ge=0;ge<z.length-1;ge+=2)ae+=String.fromCharCode(z[ge]+z[ge+1]*256);return ae}m.prototype.slice=function(v,N){const z=this.length;v=~~v,N=N===void 0?z:~~N,v<0?(v+=z,v<0&&(v=0)):v>z&&(v=z),N<0?(N+=z,N<0&&(N=0)):N>z&&(N=z),N<v&&(N=v);const ae=this.subarray(v,N);return Object.setPrototypeOf(ae,m.prototype),ae};function X(B,v,N){if(B%1!==0||B<0)throw new RangeError("offset is not uint");if(B+v>N)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(v,N,z){v=v>>>0,N=N>>>0,z||X(v,N,this.length);let ae=this[v],ge=1,Ee=0;for(;++Ee<N&&(ge*=256);)ae+=this[v+Ee]*ge;return ae},m.prototype.readUintBE=m.prototype.readUIntBE=function(v,N,z){v=v>>>0,N=N>>>0,z||X(v,N,this.length);let ae=this[v+--N],ge=1;for(;N>0&&(ge*=256);)ae+=this[v+--N]*ge;return ae},m.prototype.readUint8=m.prototype.readUInt8=function(v,N){return v=v>>>0,N||X(v,1,this.length),this[v]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(v,N){return v=v>>>0,N||X(v,2,this.length),this[v]|this[v+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(v,N){return v=v>>>0,N||X(v,2,this.length),this[v]<<8|this[v+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(v,N){return v=v>>>0,N||X(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(v,N){return v=v>>>0,N||X(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},m.prototype.readBigUInt64LE=Qt(function(v){v=v>>>0,We(v,"offset");const N=this[v],z=this[v+7];(N===void 0||z===void 0)&&nt(v,this.length-8);const ae=N+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,ge=this[++v]+this[++v]*2**8+this[++v]*2**16+z*2**24;return BigInt(ae)+(BigInt(ge)<<BigInt(32))}),m.prototype.readBigUInt64BE=Qt(function(v){v=v>>>0,We(v,"offset");const N=this[v],z=this[v+7];(N===void 0||z===void 0)&&nt(v,this.length-8);const ae=N*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],ge=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+z;return(BigInt(ae)<<BigInt(32))+BigInt(ge)}),m.prototype.readIntLE=function(v,N,z){v=v>>>0,N=N>>>0,z||X(v,N,this.length);let ae=this[v],ge=1,Ee=0;for(;++Ee<N&&(ge*=256);)ae+=this[v+Ee]*ge;return ge*=128,ae>=ge&&(ae-=Math.pow(2,8*N)),ae},m.prototype.readIntBE=function(v,N,z){v=v>>>0,N=N>>>0,z||X(v,N,this.length);let ae=N,ge=1,Ee=this[v+--ae];for(;ae>0&&(ge*=256);)Ee+=this[v+--ae]*ge;return ge*=128,Ee>=ge&&(Ee-=Math.pow(2,8*N)),Ee},m.prototype.readInt8=function(v,N){return v=v>>>0,N||X(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},m.prototype.readInt16LE=function(v,N){v=v>>>0,N||X(v,2,this.length);const z=this[v]|this[v+1]<<8;return z&32768?z|4294901760:z},m.prototype.readInt16BE=function(v,N){v=v>>>0,N||X(v,2,this.length);const z=this[v+1]|this[v]<<8;return z&32768?z|4294901760:z},m.prototype.readInt32LE=function(v,N){return v=v>>>0,N||X(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},m.prototype.readInt32BE=function(v,N){return v=v>>>0,N||X(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},m.prototype.readBigInt64LE=Qt(function(v){v=v>>>0,We(v,"offset");const N=this[v],z=this[v+7];(N===void 0||z===void 0)&&nt(v,this.length-8);const ae=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(z<<24);return(BigInt(ae)<<BigInt(32))+BigInt(N+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),m.prototype.readBigInt64BE=Qt(function(v){v=v>>>0,We(v,"offset");const N=this[v],z=this[v+7];(N===void 0||z===void 0)&&nt(v,this.length-8);const ae=(N<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(ae)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+z)}),m.prototype.readFloatLE=function(v,N){return v=v>>>0,N||X(v,4,this.length),a.read(this,v,!0,23,4)},m.prototype.readFloatBE=function(v,N){return v=v>>>0,N||X(v,4,this.length),a.read(this,v,!1,23,4)},m.prototype.readDoubleLE=function(v,N){return v=v>>>0,N||X(v,8,this.length),a.read(this,v,!0,52,8)},m.prototype.readDoubleBE=function(v,N){return v=v>>>0,N||X(v,8,this.length),a.read(this,v,!1,52,8)};function ee(B,v,N,z,ae,ge){if(!m.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>ae||v<ge)throw new RangeError('"value" argument is out of bounds');if(N+z>B.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(v,N,z,ae){if(v=+v,N=N>>>0,z=z>>>0,!ae){const Ue=Math.pow(2,8*z)-1;ee(this,v,N,z,Ue,0)}let ge=1,Ee=0;for(this[N]=v&255;++Ee<z&&(ge*=256);)this[N+Ee]=v/ge&255;return N+z},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(v,N,z,ae){if(v=+v,N=N>>>0,z=z>>>0,!ae){const Ue=Math.pow(2,8*z)-1;ee(this,v,N,z,Ue,0)}let ge=z-1,Ee=1;for(this[N+ge]=v&255;--ge>=0&&(Ee*=256);)this[N+ge]=v/Ee&255;return N+z},m.prototype.writeUint8=m.prototype.writeUInt8=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,1,255,0),this[N]=v&255,N+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,2,65535,0),this[N]=v&255,this[N+1]=v>>>8,N+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,2,65535,0),this[N]=v>>>8,this[N+1]=v&255,N+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,4,4294967295,0),this[N+3]=v>>>24,this[N+2]=v>>>16,this[N+1]=v>>>8,this[N]=v&255,N+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,4,4294967295,0),this[N]=v>>>24,this[N+1]=v>>>16,this[N+2]=v>>>8,this[N+3]=v&255,N+4};function ie(B,v,N,z,ae){yt(v,z,ae,B,N,7);let ge=Number(v&BigInt(4294967295));B[N++]=ge,ge=ge>>8,B[N++]=ge,ge=ge>>8,B[N++]=ge,ge=ge>>8,B[N++]=ge;let Ee=Number(v>>BigInt(32)&BigInt(4294967295));return B[N++]=Ee,Ee=Ee>>8,B[N++]=Ee,Ee=Ee>>8,B[N++]=Ee,Ee=Ee>>8,B[N++]=Ee,N}function Ie(B,v,N,z,ae){yt(v,z,ae,B,N,7);let ge=Number(v&BigInt(4294967295));B[N+7]=ge,ge=ge>>8,B[N+6]=ge,ge=ge>>8,B[N+5]=ge,ge=ge>>8,B[N+4]=ge;let Ee=Number(v>>BigInt(32)&BigInt(4294967295));return B[N+3]=Ee,Ee=Ee>>8,B[N+2]=Ee,Ee=Ee>>8,B[N+1]=Ee,Ee=Ee>>8,B[N]=Ee,N+8}m.prototype.writeBigUInt64LE=Qt(function(v,N=0){return ie(this,v,N,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=Qt(function(v,N=0){return Ie(this,v,N,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(v,N,z,ae){if(v=+v,N=N>>>0,!ae){const ht=Math.pow(2,8*z-1);ee(this,v,N,z,ht-1,-ht)}let ge=0,Ee=1,Ue=0;for(this[N]=v&255;++ge<z&&(Ee*=256);)v<0&&Ue===0&&this[N+ge-1]!==0&&(Ue=1),this[N+ge]=(v/Ee>>0)-Ue&255;return N+z},m.prototype.writeIntBE=function(v,N,z,ae){if(v=+v,N=N>>>0,!ae){const ht=Math.pow(2,8*z-1);ee(this,v,N,z,ht-1,-ht)}let ge=z-1,Ee=1,Ue=0;for(this[N+ge]=v&255;--ge>=0&&(Ee*=256);)v<0&&Ue===0&&this[N+ge+1]!==0&&(Ue=1),this[N+ge]=(v/Ee>>0)-Ue&255;return N+z},m.prototype.writeInt8=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,1,127,-128),v<0&&(v=255+v+1),this[N]=v&255,N+1},m.prototype.writeInt16LE=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,2,32767,-32768),this[N]=v&255,this[N+1]=v>>>8,N+2},m.prototype.writeInt16BE=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,2,32767,-32768),this[N]=v>>>8,this[N+1]=v&255,N+2},m.prototype.writeInt32LE=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,4,2147483647,-2147483648),this[N]=v&255,this[N+1]=v>>>8,this[N+2]=v>>>16,this[N+3]=v>>>24,N+4},m.prototype.writeInt32BE=function(v,N,z){return v=+v,N=N>>>0,z||ee(this,v,N,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[N]=v>>>24,this[N+1]=v>>>16,this[N+2]=v>>>8,this[N+3]=v&255,N+4},m.prototype.writeBigInt64LE=Qt(function(v,N=0){return ie(this,v,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=Qt(function(v,N=0){return Ie(this,v,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function we(B,v,N,z,ae,ge){if(N+z>B.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function Re(B,v,N,z,ae){return v=+v,N=N>>>0,ae||we(B,v,N,4),a.write(B,v,N,z,23,4),N+4}m.prototype.writeFloatLE=function(v,N,z){return Re(this,v,N,!0,z)},m.prototype.writeFloatBE=function(v,N,z){return Re(this,v,N,!1,z)};function De(B,v,N,z,ae){return v=+v,N=N>>>0,ae||we(B,v,N,8),a.write(B,v,N,z,52,8),N+8}m.prototype.writeDoubleLE=function(v,N,z){return De(this,v,N,!0,z)},m.prototype.writeDoubleBE=function(v,N,z){return De(this,v,N,!1,z)},m.prototype.copy=function(v,N,z,ae){if(!m.isBuffer(v))throw new TypeError("argument should be a Buffer");if(z||(z=0),!ae&&ae!==0&&(ae=this.length),N>=v.length&&(N=v.length),N||(N=0),ae>0&&ae<z&&(ae=z),ae===z||v.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if(z<0||z>=this.length)throw new RangeError("Index out of range");if(ae<0)throw new RangeError("sourceEnd out of bounds");ae>this.length&&(ae=this.length),v.length-N<ae-z&&(ae=v.length-N+z);const ge=ae-z;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,z,ae):Uint8Array.prototype.set.call(v,this.subarray(z,ae),N),ge},m.prototype.fill=function(v,N,z,ae){if(typeof v=="string"){if(typeof N=="string"?(ae=N,N=0,z=this.length):typeof z=="string"&&(ae=z,z=this.length),ae!==void 0&&typeof ae!="string")throw new TypeError("encoding must be a string");if(typeof ae=="string"&&!m.isEncoding(ae))throw new TypeError("Unknown encoding: "+ae);if(v.length===1){const Ee=v.charCodeAt(0);(ae==="utf8"&&Ee<128||ae==="latin1")&&(v=Ee)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(N<0||this.length<N||this.length<z)throw new RangeError("Out of range index");if(z<=N)return this;N=N>>>0,z=z===void 0?this.length:z>>>0,v||(v=0);let ge;if(typeof v=="number")for(ge=N;ge<z;++ge)this[ge]=v;else{const Ee=m.isBuffer(v)?v:m.from(v,ae),Ue=Ee.length;if(Ue===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(ge=0;ge<z-N;++ge)this[ge+N]=Ee[ge%Ue]}return this};const Te={};function He(B,v,N){Te[B]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${B}]`,this.stack,delete this.name}get code(){return B}set code(ae){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ae,writable:!0})}toString(){return`${this.name} [${B}]: ${this.message}`}}}He("ERR_BUFFER_OUT_OF_BOUNDS",function(B){return B?`${B} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),He("ERR_INVALID_ARG_TYPE",function(B,v){return`The "${B}" argument must be of type number. Received type ${typeof v}`},TypeError),He("ERR_OUT_OF_RANGE",function(B,v,N){let z=`The value of "${B}" is out of range.`,ae=N;return Number.isInteger(N)&&Math.abs(N)>2**32?ae=Ne(String(N)):typeof N=="bigint"&&(ae=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(ae=Ne(ae)),ae+="n"),z+=` It must be ${v}. Received ${ae}`,z},RangeError);function Ne(B){let v="",N=B.length;const z=B[0]==="-"?1:0;for(;N>=z+4;N-=3)v=`_${B.slice(N-3,N)}${v}`;return`${B.slice(0,N)}${v}`}function Qe(B,v,N){We(v,"offset"),(B[v]===void 0||B[v+N]===void 0)&&nt(v,B.length-(N+1))}function yt(B,v,N,z,ae,ge){if(B>N||B<v){const Ee=typeof v=="bigint"?"n":"";let Ue;throw v===0||v===BigInt(0)?Ue=`>= 0${Ee} and < 2${Ee} ** ${(ge+1)*8}${Ee}`:Ue=`>= -(2${Ee} ** ${(ge+1)*8-1}${Ee}) and < 2 ** ${(ge+1)*8-1}${Ee}`,new Te.ERR_OUT_OF_RANGE("value",Ue,B)}Qe(z,ae,ge)}function We(B,v){if(typeof B!="number")throw new Te.ERR_INVALID_ARG_TYPE(v,"number",B)}function nt(B,v,N){throw Math.floor(B)!==B?(We(B,N),new Te.ERR_OUT_OF_RANGE("offset","an integer",B)):v<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,B)}const Ht=/[^+/0-9A-Za-z-_]/g;function ve(B){if(B=B.split("=")[0],B=B.trim().replace(Ht,""),B.length<2)return"";for(;B.length%4!==0;)B=B+"=";return B}function Be(B,v){v=v||1/0;let N;const z=B.length;let ae=null;const ge=[];for(let Ee=0;Ee<z;++Ee){if(N=B.charCodeAt(Ee),N>55295&&N<57344){if(!ae){if(N>56319){(v-=3)>-1&&ge.push(239,191,189);continue}else if(Ee+1===z){(v-=3)>-1&&ge.push(239,191,189);continue}ae=N;continue}if(N<56320){(v-=3)>-1&&ge.push(239,191,189),ae=N;continue}N=(ae-55296<<10|N-56320)+65536}else ae&&(v-=3)>-1&&ge.push(239,191,189);if(ae=null,N<128){if((v-=1)<0)break;ge.push(N)}else if(N<2048){if((v-=2)<0)break;ge.push(N>>6|192,N&63|128)}else if(N<65536){if((v-=3)<0)break;ge.push(N>>12|224,N>>6&63|128,N&63|128)}else if(N<1114112){if((v-=4)<0)break;ge.push(N>>18|240,N>>12&63|128,N>>6&63|128,N&63|128)}else throw new Error("Invalid code point")}return ge}function $e(B){const v=[];for(let N=0;N<B.length;++N)v.push(B.charCodeAt(N)&255);return v}function Ye(B,v){let N,z,ae;const ge=[];for(let Ee=0;Ee<B.length&&!((v-=2)<0);++Ee)N=B.charCodeAt(Ee),z=N>>8,ae=N%256,ge.push(ae),ge.push(z);return ge}function lt(B){return e.toByteArray(ve(B))}function et(B,v,N,z){let ae;for(ae=0;ae<z&&!(ae+N>=v.length||ae>=B.length);++ae)v[ae+N]=B[ae];return ae}function Et(B,v){return B instanceof v||B!=null&&B.constructor!=null&&B.constructor.name!=null&&B.constructor.name===v.name}function Pt(B){return B!==B}const qt=function(){const B="0123456789abcdef",v=new Array(256);for(let N=0;N<16;++N){const z=N*16;for(let ae=0;ae<16;++ae)v[z+ae]=B[N]+B[ae]}return v}();function Qt(B){return typeof BigInt>"u"?na:B}function na(){throw new Error("BigInt not supported")}}(vg)),vg}var ho=IL();class Mt{static async deriveKeyFromPassword(e,a,i="Argon2Id",s='{"Iterations":2,"MemorySize":19456,"DegreeOfParallelism":1}'){const c=JSON.parse(s);try{if(i!=="Argon2Id")throw new Error("Unsupported encryption type");return(await nI.hash({pass:e,salt:a,time:c.Iterations,mem:c.MemorySize,parallelism:c.DegreeOfParallelism,hashLen:32,type:2})).hash}catch(d){throw console.error("Argon2 hashing failed:",d),d}}static async symmetricEncrypt(e,a){if(!e)return e;const i=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),f=>f.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["encrypt"]),s=crypto.getRandomValues(new Uint8Array(12)),d=new TextEncoder().encode(e),m=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,d),g=new Uint8Array(s.length+m.byteLength);return g.set(s,0),g.set(new Uint8Array(m),s.length),btoa(Array.from(g).map(f=>String.fromCharCode(f)).join(""))}static async symmetricDecrypt(e,a){if(!e)return e;const i=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),f=>f.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["decrypt"]),s=Uint8Array.from(atob(e),f=>f.charCodeAt(0)),c=s.slice(0,12),d=s.slice(12),m=await crypto.subtle.decrypt({name:"AES-GCM",iv:c},i,d);return new TextDecoder().decode(m)}static async symmetricDecryptBytes(e,a){if(!e||e.length===0)return e;const i=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),m=>m.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["decrypt"]),s=e.slice(0,12),c=e.slice(12),d=await crypto.subtle.decrypt({name:"AES-GCM",iv:s},i,c);return new Uint8Array(d)}static async generateRsaKeyPair(){const e=await crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"]),a=await crypto.subtle.exportKey("jwk",e.publicKey),i=await crypto.subtle.exportKey("jwk",e.privateKey);return{publicKey:JSON.stringify(a),privateKey:JSON.stringify(i)}}static async encryptWithPublicKey(e,a){const i=await crypto.subtle.importKey("jwk",JSON.parse(a),{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),s=new TextEncoder().encode(e),c=await crypto.subtle.encrypt({name:"RSA-OAEP"},i,s);return btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(c))))}static async decryptWithPrivateKey(e,a){try{const i=await crypto.subtle.importKey("jwk",JSON.parse(a),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),s=Uint8Array.from(atob(e),d=>d.charCodeAt(0)),c=await crypto.subtle.decrypt({name:"RSA-OAEP"},i,s);return new Uint8Array(c)}catch(i){throw console.error("RSA decryption failed:",i),new Error(`Failed to decrypt: ${i instanceof Error?i.message:"Unknown error"}`)}}static async decryptEmail(e,a){try{const i=a.find(m=>m.PublicKey===e.encryptionKey);if(!i)throw new Error("Encryption key not found");const s=await Mt.decryptWithPrivateKey(e.encryptedSymmetricKey,i.PrivateKey),c=ho.Buffer.from(s).toString("base64"),d={...e};return d.subject=await Mt.symmetricDecrypt(e.subject,c),d.fromDisplay=await Mt.symmetricDecrypt(e.fromDisplay,c),d.fromDomain=await Mt.symmetricDecrypt(e.fromDomain,c),d.fromLocal=await Mt.symmetricDecrypt(e.fromLocal,c),e.messageHtml&&(d.messageHtml=await Mt.symmetricDecrypt(e.messageHtml,c)),e.messagePlain&&(d.messagePlain=await Mt.symmetricDecrypt(e.messagePlain,c)),d}catch(i){throw new Error(i instanceof Error?i.message:"Failed to decrypt email")}}static async decryptEmailList(e,a){return Promise.all(e.map(async i=>{try{const s=a.find(g=>g.PublicKey===i.encryptionKey);if(!s)throw new Error("Encryption key not found");const c=await Mt.decryptWithPrivateKey(i.encryptedSymmetricKey,s.PrivateKey),d=ho.Buffer.from(c).toString("base64"),m={...i};return m.subject=await Mt.symmetricDecrypt(i.subject,d),m.fromDisplay=await Mt.symmetricDecrypt(i.fromDisplay,d),m.fromDomain=await Mt.symmetricDecrypt(i.fromDomain,d),m.fromLocal=await Mt.symmetricDecrypt(i.fromLocal,d),i.messagePreview&&(m.messagePreview=await Mt.symmetricDecrypt(i.messagePreview,d)),m}catch(s){throw new Error(s instanceof Error?s.message:"Failed to decrypt email")}}))}static async decryptAttachment(e,a,i){try{const s=i.find(m=>m.PublicKey===a.encryptionKey);if(!s)throw new Error("Encryption key not found");const c=await Mt.decryptWithPrivateKey(a.encryptedSymmetricKey,s.PrivateKey),d=ho.Buffer.from(c).toString("base64");return await Mt.symmetricDecryptBytes(e,d)}catch(s){throw new Error(s instanceof Error?s.message:"Failed to decrypt attachment")}}}class vL{constructor(e){ze(this,"webApi");ze(this,"pollingInterval",null);ze(this,"requestId",null);ze(this,"privateKey",null);this.webApi=e}async initiate(){try{const e=await Mt.generateRsaKeyPair();this.privateKey=e.privateKey;const a=await this.webApi.rawFetch("auth/mobile-login/initiate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientPublicKey:e.publicKey})});if(!a.ok)throw Mn.GENERIC;const i=await a.json();return this.requestId=i.requestId,this.requestId}catch(e){throw typeof e=="string"&&Object.values(Mn).includes(e)?e:Mn.GENERIC}}async startPolling(e,a){if(!this.requestId||!this.privateKey)throw new Error("Must call initiate() before starting polling");const i=async()=>{try{if(!this.requestId){this.stopPolling();return}const s=await this.webApi.rawFetch(`auth/mobile-login/poll/${this.requestId}`,{method:"GET"});if(!s.ok){if(s.status===404){this.stopPolling(),this.privateKey=null,this.requestId=null,a(Mn.TIMEOUT);return}throw new Error(`Polling failed: ${s.status}`)}const c=await s.json();if(c.fulfilled&&c.encryptedSymmetricKey){this.stopPolling();const d=await Mt.decryptWithPrivateKey(c.encryptedDecryptionKey,this.privateKey),m=ho.Buffer.from(d).toString("base64"),g=await Mt.decryptWithPrivateKey(c.encryptedSymmetricKey,this.privateKey),f=ho.Buffer.from(g).toString("base64"),E=await Mt.symmetricDecrypt(c.encryptedToken,f),p=await Mt.symmetricDecrypt(c.encryptedRefreshToken,f),C=await Mt.symmetricDecrypt(c.encryptedUsername,f);this.privateKey=null,this.requestId=null;const I=await this.webApi.rawFetch("auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:C})});if(!I.ok){a(Mn.GENERIC);return}const x=await I.json(),T={username:C,token:E,refreshToken:p,decryptionKey:m,salt:x.salt,encryptionType:x.encryptionType,encryptionSettings:x.encryptionSettings};e(T)}}catch{this.stopPolling(),this.privateKey=null,this.requestId=null,a(Mn.GENERIC)}};this.pollingInterval=setInterval(i,3e3),setTimeout(()=>{this.pollingInterval&&(this.stopPolling(),this.privateKey=null,this.requestId=null,a(Mn.TIMEOUT))},21e4)}stopPolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.pollingInterval=null)}cleanup(){this.stopPolling(),this.privateKey=null,this.requestId=null}}const kI=({isOpen:r,onClose:e,onSuccess:a,webApi:i,mode:s="login"})=>{const{t:c}=tt(),[d,m]=w.useState(null),[g,f]=w.useState(null),[E,p]=w.useState(120),C=w.useRef(null),I=w.useRef(null),x=S=>{switch(S){case Mn.TIMEOUT:return c("auth.errors.mobileLoginRequestExpired");case Mn.GENERIC:default:return c("common.errors.unknownError")}};w.useEffect(()=>{if(d&&E>0&&r)return I.current=setInterval(()=>{p(S=>S<=1?(I.current&&clearInterval(I.current),0):S-1)},1e3),()=>{I.current&&clearInterval(I.current)}},[d,E,r]),w.useEffect(()=>r?((async()=>{try{f(null),m(null),p(120),C.current||(C.current=new vL(i));const U=`aliasvault://open/mobile-unlock/${await C.current.initiate()}`,P=await yL.toDataURL(U,{width:256,margin:2});m(P),await C.current.startPolling(async K=>{try{await a(K),T()}catch{m(null),f(Mn.GENERIC)}},K=>{m(null),f(K)})}catch(O){typeof O=="string"&&Object.values(Mn).includes(O)?f(O):f(Mn.GENERIC)}})(),()=>{C.current&&C.current.cleanup(),I.current&&clearInterval(I.current)}):void 0,[r]);const T=()=>{C.current&&C.current.cleanup(),I.current&&clearInterval(I.current),m(null),f(null),p(120),e()},k=S=>{const O=Math.floor(S/60),U=S%60;return`${O}:${U.toString().padStart(2,"0")}`},R=c(s==="unlock"?"auth.unlockWithMobile":"auth.loginWithMobile"),_=c("auth.scanQrCode");return l.jsxs(Zn,{isOpen:r,onClose:T,title:R,showHeaderBorder:!1,bodyClassName:"px-6 pb-6",children:[l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:_}),g&&l.jsx("div",{className:"mb-4 p-3 bg-red-100 dark:bg-red-900/30 border border-red-400 dark:border-red-700 rounded text-red-700 dark:text-red-400 text-sm",children:x(g)}),d&&l.jsxs("div",{className:"flex flex-col items-center mb-4",children:[l.jsx("img",{src:d,alt:"QR Code",className:"border-4 border-gray-200 dark:border-gray-600 rounded mb-3"}),l.jsx("div",{className:"text-gray-700 dark:text-gray-300 text-sm font-medium",children:k(E)})]}),!d&&!g&&l.jsx("div",{className:"flex justify-center py-8",children:l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})}),l.jsx("button",{type:"button",onClick:T,className:"mt-4 w-full inline-flex justify-center rounded-md bg-white dark:bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-900 dark:text-gray-200 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500",children:c("common.cancel")})]})};var Fa=(r=>(r.EXPAND="expand",r.EDIT="edit",r.DELETE="delete",r.SETTINGS="settings",r.RELOAD="reload",r.EXTERNAL_LINK="external_link",r.SAVE="save",r.PLUS="plus",r.TAB="tab",r.EYE="eye",r.EYE_OFF="eye_off",r))(Fa||{});const Bh=({type:r,className:e="w-5 h-5"})=>({expand:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})}),edit:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),delete:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),settings:l.jsxs("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),reload:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),external_link:l.jsxs("svg",{className:e,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),l.jsx("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]}),save:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),plus:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),tab:l.jsxs("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"})]}),eye:l.jsxs("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),eye_off:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})})})[r]||null,Nn=({onClick:r,title:e,iconType:a,variant:i="default",id:s})=>{const c={default:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",primary:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 hover:bg-primary-100 dark:hover:bg-primary-900/20",danger:"text-red-500 hover:text-red-600 hover:bg-red-100 dark:hover:bg-red-900/20"};return l.jsx("button",{id:s,onClick:r,className:`p-2 rounded-lg ${c[i]}`,title:e,children:l.jsx(Bh,{type:a})})},LI=()=>{const[r,e]=w.useState(Za.DEFAULT_API_URL);return{apiUrl:r,setApiUrl:e,loadApiUrl:async()=>{const s=await ke.getItem("local:apiUrl");s&&s.length>0?e(s):e(Za.DEFAULT_API_URL)},getDisplayUrl:()=>{const s=r.replace("https://","").replace("http://","").replace(":443","").replace("/api","");return s==="app.aliasvault.net"?"aliasvault.net":s}}},wL=()=>{const{loadApiUrl:r,getDisplayUrl:e}=LI(),a=La(),{t:i}=tt();w.useEffect(()=>{r()},[r]);const s=()=>{a("/auth-settings")};return l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:["(",i("auth.connectingTo")," ",l.jsx("button",{onClick:s,type:"button",className:"text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500 underline",children:e()}),")"]})};let je;function xt(r){Ql===ni.length&&ni.push(ni.length+1);const e=Ql;return Ql=ni[e],ni[e]=r,e}function nh(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const s=r.description;return s==null?"Symbol":`Symbol(${s})`}if(e=="function"){const s=r.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(r)){const s=r.length;let c="[";s>0&&(c+=nh(r[0]));for(let d=1;d<s;d++)c+=", "+nh(r[d]);return c+="]",c}const a=/\[object ([^\]]+)\]/.exec(toString.call(r));let i;if(a&&a.length>1)i=a[1];else return toString.call(r);if(i=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}
${r.stack}`:i}function CL(r){r<132||(ni[r]=Ql,Ql=r)}function NL(r,e){r=r>>>0;const a=bt(),i=[];for(let s=r;s<r+4*e;s+=4)i.push(Ka(a.getUint32(s,!0)));return i}function TE(r,e){return r=r>>>0,Hl().subarray(r/1,r/1+e)}let hs=null;function bt(){return(hs===null||hs.buffer.detached===!0||hs.buffer.detached===void 0&&hs.buffer!==je.memory.buffer)&&(hs=new DataView(je.memory.buffer)),hs}function Tr(r,e){return r=r>>>0,TL(r,e)}let Fl=null;function Hl(){return(Fl===null||Fl.byteLength===0)&&(Fl=new Uint8Array(je.memory.buffer)),Fl}function Ze(r){return ni[r]}function gs(r,e){try{return r.apply(this,e)}catch(a){je.__wbindgen_export3(xt(a))}}let ni=new Array(128).fill(void 0);ni.push(void 0,null,!0,!1);let Ql=ni.length;function vr(r){return r==null}function fn(r,e,a){if(a===void 0){const m=zl.encode(r),g=e(m.length,1)>>>0;return Hl().subarray(g,g+m.length).set(m),en=m.length,g}let i=r.length,s=e(i,1)>>>0;const c=Hl();let d=0;for(;d<i;d++){const m=r.charCodeAt(d);if(m>127)break;c[s+d]=m}if(d!==i){d!==0&&(r=r.slice(d)),s=a(s,i,i=d+r.length*3,1)>>>0;const m=Hl().subarray(s+d,s+i),g=zl.encodeInto(r,m);d+=g.written,s=a(s,i,d,1)>>>0}return en=d,s}function Ka(r){const e=Ze(r);return CL(r),e}let ju=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});ju.decode();const xL=2146435072;let wg=0;function TL(r,e){return wg+=e,wg>=xL&&(ju=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),ju.decode(),wg=e),ju.decode(Hl().subarray(r,r+e))}const zl=new TextEncoder;"encodeInto"in zl||(zl.encodeInto=function(r,e){const a=zl.encode(r);return e.set(a),{read:r.length,written:a.length}});let en=0;function SL(r){let e,a;try{const c=je.__wbindgen_add_to_stack_pointer(-16),d=fn(r,je.__wbindgen_export,je.__wbindgen_export2),m=en;je.extractDomain(c,d,m);var i=bt().getInt32(c+4*0,!0),s=bt().getInt32(c+4*1,!0);return e=i,a=s,Tr(i,s)}finally{je.__wbindgen_add_to_stack_pointer(16),je.__wbindgen_export4(e,a,1)}}function kL(r){let e,a;try{const c=je.__wbindgen_add_to_stack_pointer(-16),d=fn(r,je.__wbindgen_export,je.__wbindgen_export2),m=en;je.extractRootDomain(c,d,m);var i=bt().getInt32(c+4*0,!0),s=bt().getInt32(c+4*1,!0);return e=i,a=s,Tr(i,s)}finally{je.__wbindgen_add_to_stack_pointer(16),je.__wbindgen_export4(e,a,1)}}function LL(r){try{const s=je.__wbindgen_add_to_stack_pointer(-16);je.filterCredentials(s,xt(r));var e=bt().getInt32(s+4*0,!0),a=bt().getInt32(s+4*1,!0),i=bt().getInt32(s+4*2,!0);if(i)throw Ka(a);return Ka(e)}finally{je.__wbindgen_add_to_stack_pointer(16)}}function RL(){try{const i=je.__wbindgen_add_to_stack_pointer(-16);je.getSyncableTableNames(i);var r=bt().getInt32(i+4*0,!0),e=bt().getInt32(i+4*1,!0),a=NL(r,e).slice();return je.__wbindgen_export4(r,e*4,4),a}finally{je.__wbindgen_add_to_stack_pointer(16)}}function DL(r){try{const s=je.__wbindgen_add_to_stack_pointer(-16);je.mergeVaults(s,xt(r));var e=bt().getInt32(s+4*0,!0),a=bt().getInt32(s+4*1,!0),i=bt().getInt32(s+4*2,!0);if(i)throw Ka(a);return Ka(e)}finally{je.__wbindgen_add_to_stack_pointer(16)}}function BL(r){try{const s=je.__wbindgen_add_to_stack_pointer(-16);je.pruneVault(s,xt(r));var e=bt().getInt32(s+4*0,!0),a=bt().getInt32(s+4*1,!0),i=bt().getInt32(s+4*2,!0);if(i)throw Ka(a);return Ka(e)}finally{je.__wbindgen_add_to_stack_pointer(16)}}function UL(r,e,a){let i,s;try{const p=je.__wbindgen_add_to_stack_pointer(-16),C=fn(r,je.__wbindgen_export,je.__wbindgen_export2),I=en,x=fn(e,je.__wbindgen_export,je.__wbindgen_export2),T=en,k=fn(a,je.__wbindgen_export,je.__wbindgen_export2),R=en;je.srpDerivePrivateKey(p,C,I,x,T,k,R);var c=bt().getInt32(p+4*0,!0),d=bt().getInt32(p+4*1,!0),m=bt().getInt32(p+4*2,!0),g=bt().getInt32(p+4*3,!0),f=c,E=d;if(g)throw f=0,E=0,Ka(m);return i=f,s=E,Tr(f,E)}finally{je.__wbindgen_add_to_stack_pointer(16),je.__wbindgen_export4(i,s,1)}}function _L(r,e,a,i,s){try{const g=je.__wbindgen_add_to_stack_pointer(-16),f=fn(r,je.__wbindgen_export,je.__wbindgen_export2),E=en,p=fn(e,je.__wbindgen_export,je.__wbindgen_export2),C=en,I=fn(a,je.__wbindgen_export,je.__wbindgen_export2),x=en,T=fn(i,je.__wbindgen_export,je.__wbindgen_export2),k=en,R=fn(s,je.__wbindgen_export,je.__wbindgen_export2),_=en;je.srpDeriveSession(g,f,E,p,C,I,x,T,k,R,_);var c=bt().getInt32(g+4*0,!0),d=bt().getInt32(g+4*1,!0),m=bt().getInt32(g+4*2,!0);if(m)throw Ka(d);return Ka(c)}finally{je.__wbindgen_add_to_stack_pointer(16)}}function ML(r){let e,a;try{const f=je.__wbindgen_add_to_stack_pointer(-16),E=fn(r,je.__wbindgen_export,je.__wbindgen_export2),p=en;je.srpDeriveVerifier(f,E,p);var i=bt().getInt32(f+4*0,!0),s=bt().getInt32(f+4*1,!0),c=bt().getInt32(f+4*2,!0),d=bt().getInt32(f+4*3,!0),m=i,g=s;if(d)throw m=0,g=0,Ka(c);return e=m,a=g,Tr(m,g)}finally{je.__wbindgen_add_to_stack_pointer(16),je.__wbindgen_export4(e,a,1)}}function FL(){try{const i=je.__wbindgen_add_to_stack_pointer(-16);je.srpGenerateEphemeral(i);var r=bt().getInt32(i+4*0,!0),e=bt().getInt32(i+4*1,!0),a=bt().getInt32(i+4*2,!0);if(a)throw Ka(e);return Ka(r)}finally{je.__wbindgen_add_to_stack_pointer(16)}}function OL(){let r,e;try{const s=je.__wbindgen_add_to_stack_pointer(-16);je.srpGenerateSalt(s);var a=bt().getInt32(s+4*0,!0),i=bt().getInt32(s+4*1,!0);return r=a,e=i,Tr(a,i)}finally{je.__wbindgen_add_to_stack_pointer(16),je.__wbindgen_export4(r,e,1)}}const jL=new Set(["basic","cors","default"]);async function PL(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(i){if(r.ok&&jL.has(r.type)&&r.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const a=await r.arrayBuffer();return await WebAssembly.instantiate(a,e)}else{const a=await WebAssembly.instantiate(r,e);return a instanceof WebAssembly.Instance?{instance:a,module:r}:a}}function HL(){const r={};return r.wbg={},r.wbg.__wbg_Error_52673b7de5a0ca89=function(e,a){const i=Error(Tr(e,a));return xt(i)},r.wbg.__wbg_Number_2d1dcfcf4ec51736=function(e){return Number(Ze(e))},r.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,a){const i=String(Ze(a)),s=fn(i,je.__wbindgen_export,je.__wbindgen_export2),c=en;bt().setInt32(e+4*1,c,!0),bt().setInt32(e+4*0,s,!0)},r.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d=function(e,a){const i=Ze(a),s=typeof i=="bigint"?i:void 0;bt().setBigInt64(e+8*1,vr(s)?BigInt(0):s,!0),bt().setInt32(e+4*0,!vr(s),!0)},r.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b=function(e){const a=Ze(e),i=typeof a=="boolean"?a:void 0;return vr(i)?16777215:i?1:0},r.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(e,a){const i=nh(Ze(a)),s=fn(i,je.__wbindgen_export,je.__wbindgen_export2),c=en;bt().setInt32(e+4*1,c,!0),bt().setInt32(e+4*0,s,!0)},r.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317=function(e,a){return Ze(e)in Ze(a)},r.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27=function(e){return typeof Ze(e)=="bigint"},r.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd=function(e){return typeof Ze(e)=="function"},r.wbg.__wbg___wbindgen_is_object_ce774f3490692386=function(e){const a=Ze(e);return typeof a=="object"&&a!==null},r.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030=function(e){return typeof Ze(e)=="string"},r.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(e){return Ze(e)===void 0},r.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36=function(e,a){return Ze(e)===Ze(a)},r.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d=function(e,a){return Ze(e)==Ze(a)},r.wbg.__wbg___wbindgen_number_get_9619185a74197f95=function(e,a){const i=Ze(a),s=typeof i=="number"?i:void 0;bt().setFloat64(e+8*1,vr(s)?0:s,!0),bt().setInt32(e+4*0,!vr(s),!0)},r.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42=function(e,a){const i=Ze(a),s=typeof i=="string"?i:void 0;var c=vr(s)?0:fn(s,je.__wbindgen_export,je.__wbindgen_export2),d=en;bt().setInt32(e+4*1,d,!0),bt().setInt32(e+4*0,c,!0)},r.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(e,a){throw new Error(Tr(e,a))},r.wbg.__wbg_call_3020136f7a2d6e44=function(){return gs(function(e,a,i){const s=Ze(e).call(Ze(a),Ze(i));return xt(s)},arguments)},r.wbg.__wbg_call_abb4ff46ce38be40=function(){return gs(function(e,a){const i=Ze(e).call(Ze(a));return xt(i)},arguments)},r.wbg.__wbg_crypto_86f2631e91b51511=function(e){const a=Ze(e).crypto;return xt(a)},r.wbg.__wbg_done_62ea16af4ce34b24=function(e){return Ze(e).done},r.wbg.__wbg_entries_83c79938054e065f=function(e){const a=Object.entries(Ze(e));return xt(a)},r.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,a){let i,s;try{i=e,s=a,console.error(Tr(e,a))}finally{je.__wbindgen_export4(i,s,1)}},r.wbg.__wbg_getRandomValues_b3f15fcbfabb0f8b=function(){return gs(function(e,a){Ze(e).getRandomValues(Ze(a))},arguments)},r.wbg.__wbg_get_6b7bd52aca3f9671=function(e,a){const i=Ze(e)[a>>>0];return xt(i)},r.wbg.__wbg_get_af9dab7e9603ea93=function(){return gs(function(e,a){const i=Reflect.get(Ze(e),Ze(a));return xt(i)},arguments)},r.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(e,a){const i=Ze(e)[Ze(a)];return xt(i)},r.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355=function(e){let a;try{a=Ze(e)instanceof ArrayBuffer}catch{a=!1}return a},r.wbg.__wbg_instanceof_Map_084be8da74364158=function(e){let a;try{a=Ze(e)instanceof Map}catch{a=!1}return a},r.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434=function(e){let a;try{a=Ze(e)instanceof Uint8Array}catch{a=!1}return a},r.wbg.__wbg_isArray_51fd9e6422c0a395=function(e){return Array.isArray(Ze(e))},r.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16=function(e){return Number.isSafeInteger(Ze(e))},r.wbg.__wbg_iterator_27b7c8b35ab3e86b=function(){return xt(Symbol.iterator)},r.wbg.__wbg_length_22ac23eaec9d8053=function(e){return Ze(e).length},r.wbg.__wbg_length_d45040a40c570362=function(e){return Ze(e).length},r.wbg.__wbg_msCrypto_d562bbe83e0d4b91=function(e){const a=Ze(e).msCrypto;return xt(a)},r.wbg.__wbg_new_1ba21ce319a06297=function(){const e=new Object;return xt(e)},r.wbg.__wbg_new_25f239778d6112b9=function(){const e=new Array;return xt(e)},r.wbg.__wbg_new_6421f6084cc5bc5a=function(e){const a=new Uint8Array(Ze(e));return xt(a)},r.wbg.__wbg_new_8a6f238a6ece86ea=function(){const e=new Error;return xt(e)},r.wbg.__wbg_new_b546ae120718850e=function(){return xt(new Map)},r.wbg.__wbg_new_no_args_cb138f77cf6151ee=function(e,a){const i=new Function(Tr(e,a));return xt(i)},r.wbg.__wbg_new_with_length_aa5eaf41d35235e5=function(e){const a=new Uint8Array(e>>>0);return xt(a)},r.wbg.__wbg_next_138a17bbf04e926c=function(e){const a=Ze(e).next;return xt(a)},r.wbg.__wbg_next_3cfe5c0fe2a4cc53=function(){return gs(function(e){const a=Ze(e).next();return xt(a)},arguments)},r.wbg.__wbg_node_e1f24f89a7336c2e=function(e){const a=Ze(e).node;return xt(a)},r.wbg.__wbg_process_3975fd6c72f520aa=function(e){const a=Ze(e).process;return xt(a)},r.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd=function(e,a,i){Uint8Array.prototype.set.call(TE(e,a),Ze(i))},r.wbg.__wbg_randomFillSync_f8c153b79f285817=function(){return gs(function(e,a){Ze(e).randomFillSync(Ka(a))},arguments)},r.wbg.__wbg_require_b74f47fc2d022fd6=function(){return gs(function(){const e=iv.require;return xt(e)},arguments)},r.wbg.__wbg_set_3f1d0b984ed272ed=function(e,a,i){Ze(e)[Ka(a)]=Ka(i)},r.wbg.__wbg_set_7df433eea03a5c14=function(e,a,i){Ze(e)[a>>>0]=Ka(i)},r.wbg.__wbg_set_efaaf145b9377369=function(e,a,i){const s=Ze(e).set(Ze(a),Ze(i));return xt(s)},r.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,a){const i=Ze(a).stack,s=fn(i,je.__wbindgen_export,je.__wbindgen_export2),c=en;bt().setInt32(e+4*1,c,!0),bt().setInt32(e+4*0,s,!0)},r.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335=function(){const e=typeof global>"u"?null:global;return vr(e)?0:xt(e)},r.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1=function(){const e=typeof globalThis>"u"?null:globalThis;return vr(e)?0:xt(e)},r.wbg.__wbg_static_accessor_SELF_08f5a74c69739274=function(){const e=typeof self>"u"?null:self;return vr(e)?0:xt(e)},r.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024=function(){const e=typeof window>"u"?null:window;return vr(e)?0:xt(e)},r.wbg.__wbg_subarray_845f2f5bce7d061a=function(e,a,i){const s=Ze(e).subarray(a>>>0,i>>>0);return xt(s)},r.wbg.__wbg_value_57b7b035e117f7ee=function(e){const a=Ze(e).value;return xt(a)},r.wbg.__wbg_versions_4e31226f5e8dc909=function(e){const a=Ze(e).versions;return xt(a)},r.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,a){const i=Tr(e,a);return xt(i)},r.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){const a=BigInt.asUintN(64,e);return xt(a)},r.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return xt(e)},r.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,a){const i=TE(e,a);return xt(i)},r.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return xt(e)},r.wbg.__wbindgen_object_clone_ref=function(e){const a=Ze(e);return xt(a)},r.wbg.__wbindgen_object_drop_ref=function(e){Ka(e)},r}function QL(r,e){return je=r.exports,dd.__wbindgen_wasm_module=e,hs=null,Fl=null,je.__wbindgen_start(),je}async function dd(r){if(je!==void 0)return je;typeof r<"u"&&(Object.getPrototypeOf(r)===Object.prototype?{module_or_path:r}=r:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof r>"u"&&(r=new URL("aliasvault_core_bg.wasm",self.location.href));const e=HL();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:a,module:i}=await PL(await r,e);return QL(a,i)}const Iu={type:"Argon2Id",settings:JSON.stringify({DegreeOfParallelism:1,MemorySize:19456,Iterations:2})},Sa=class Sa{static async initWasm(){if(!this.wasmInitialized)return this.wasmInitPromise?this.wasmInitPromise:(this.wasmInitPromise=(async()=>{try{const e=li.runtime.getURL("src/aliasvault_core_bg.wasm"),i=await(await fetch(e)).arrayBuffer();await dd({module_or_path:i}),this.wasmInitialized=!0}catch(e){throw this.wasmInitPromise=null,e}})(),this.wasmInitPromise)}static normalizeUsername(e){return e.toLowerCase().trim()}static async generateSalt(){return await this.initWasm(),OL()}static bytesToHexString(e){return Array.from(e).map(a=>a.toString(16).padStart(2,"0")).join("").toUpperCase()}static bytesToBase64(e){return btoa(String.fromCharCode(...e))}static async derivePrivateKey(e,a,i){return await this.initWasm(),UL(e,Sa.normalizeUsername(a),i)}static async deriveVerifier(e){return await this.initWasm(),ML(e)}static async generateEphemeral(){return await this.initWasm(),FL()}static async deriveSession(e,a,i,s,c){return await this.initWasm(),_L(e,a,i,Sa.normalizeUsername(s),c)}static async prepareCredentials(e,a,i,s){const c=await Mt.deriveKeyFromPassword(e,a,i,s);return{passwordHashString:Sa.bytesToHexString(c),passwordHashBase64:Sa.bytesToBase64(c)}}static generateSrpIdentity(){return crypto.randomUUID()}static async prepareRegistration(e,a){const i=Sa.normalizeUsername(e),s=await Sa.generateSalt(),c=Sa.generateSrpIdentity(),d=await Sa.prepareCredentials(a,s,Iu.type,Iu.settings),m=await Sa.derivePrivateKey(s,c,d.passwordHashString),g=await Sa.deriveVerifier(m);return{username:i,salt:s,verifier:g,encryptionType:Iu.type,encryptionSettings:Iu.settings,srpIdentity:c}}static async registerUser(e,a,i){try{const s=await Sa.prepareRegistration(a,i),c=e.replace(/\/$/,"")+"/v1/",d=await fetch(`${c}Auth/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!d.ok){const g=await d.text();let f=`Registration failed with status ${d.status}`;try{f=JSON.parse(g).title||f}catch{f=g||f}return{success:!1,error:f}}return{success:!0,token:await d.json()}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error occurred"}}}static async login(e,a,i,s=!1){try{const c=e.replace(/\/$/,"")+"/v1/",d=Sa.normalizeUsername(a),m=await fetch(`${c}Auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d})});if(!m.ok){const k=await m.text();try{return{success:!1,error:JSON.parse(k).title}}catch{return{success:!1,error:k||"Login initiation failed"}}}const g=await m.json(),f=g.srpIdentity??d,E=await Sa.prepareCredentials(i,g.salt,g.encryptionType,g.encryptionSettings),p=await Sa.generateEphemeral(),C=await Sa.derivePrivateKey(g.salt,f,E.passwordHashString),I=await Sa.deriveSession(p.secret,g.serverEphemeral,g.salt,f,C),x=await fetch(`${c}Auth/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d,rememberMe:s,clientPublicEphemeral:p.public,clientSessionProof:I.proof})});if(!x.ok){const k=await x.text();try{return{success:!1,error:JSON.parse(k).title}}catch{return{success:!1,error:k||"Login validation failed"}}}const T=await x.json();return T.requiresTwoFactor?{success:!1,requiresTwoFactor:!0,loginResponse:g,passwordHashBase64:E.passwordHashBase64}:{success:!0,token:T.token,passwordHashBase64:E.passwordHashBase64,loginResponse:g}}catch(c){return{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}}};ze(Sa,"wasmInitialized",!1),ze(Sa,"wasmInitPromise",null);let on=Sa;class RI{constructor(e){ze(this,"webApiService");this.webApiService=e}async initiateLogin(e){const a=on.normalizeUsername(e),i=await this.webApiService.rawFetch("Auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a})});if(i.status===400){const c=await i.json();throw new si(c.title)}return await i.json()}async validateLogin(e,a,i,s){const c=on.normalizeUsername(e),d=s.srpIdentity??c,m=await on.generateEphemeral(),g=await on.derivePrivateKey(s.salt,d,a),f=await on.deriveSession(m.secret,s.serverEphemeral,s.salt,d,g),E={username:c,rememberMe:i,clientPublicEphemeral:m.public,clientSessionProof:f.proof},p=await this.webApiService.rawFetch("Auth/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)});if(p.status===400){const I=await p.json();throw new si(I.title)}return await p.json()}async validateLogin2Fa(e,a,i,s,c){const d=on.normalizeUsername(e),m=s.srpIdentity??d,g=await on.generateEphemeral(),f=await on.derivePrivateKey(s.salt,m,a),E=await on.deriveSession(g.secret,s.serverEphemeral,s.salt,m,f),p={username:d,rememberMe:i,clientPublicEphemeral:g.public,clientSessionProof:E.proof,code2Fa:c},C=await this.webApiService.rawFetch("Auth/validate-2fa",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(C.status===400){const x=await C.json();throw new si(x.title)}return await C.json()}}const zL=()=>{const{t:r}=tt(),e=La(),a=dr(),i=Gt(),{setHeaderButtons:s}=mr(),[c,d]=w.useState({username:"",password:""}),{showLoading:m,hideLoading:g,setIsInitialLoading:f}=pa(),[E,p]=w.useState(!0),[C,I]=w.useState(!1),[x,T]=w.useState(null),[k,R]=w.useState(null),[_,S]=w.useState(null),[O,U]=w.useState(!1),[P,K]=w.useState(""),[H,Q]=w.useState(null),[V,G]=w.useState(null),[q,W]=w.useState(!1),ne=ur(),me=new RI(ne),$=async(ee,ie)=>{const Ie=await ke.getItem("local:encryptedVault"),we=await ke.getItem("local:serverRevision");let Re=ee.vault.blob;if(Ie&&we!==null)try{const Te=await Mt.symmetricDecrypt(Ie,ie);if(we>=ee.vault.currentRevisionNumber)return console.info(`Existing vault is more advanced (rev ${we} >= ${ee.vault.currentRevisionNumber}), preserving local vault and will upload to server`),Re=Ie,await gt("STORE_VAULT_METADATA",{publicEmailDomainList:ee.vault.publicEmailDomainList,privateEmailDomainList:ee.vault.privateEmailDomainList,hiddenPrivateEmailDomainList:ee.vault.hiddenPrivateEmailDomainList},"background"),i.loadDatabase(Te);console.info(`Server vault is more advanced (rev ${ee.vault.currentRevisionNumber} > ${we}), using server vault`)}catch{console.info("Existing vault could not be decrypted (password changed), using server vault")}await gt("STORE_ENCRYPTED_VAULT",{vaultBlob:ee.vault.blob,serverRevision:ee.vault.currentRevisionNumber},"background"),await gt("STORE_VAULT_METADATA",{publicEmailDomainList:ee.vault.publicEmailDomainList,privateEmailDomainList:ee.vault.privateEmailDomainList,hiddenPrivateEmailDomainList:ee.vault.hiddenPrivateEmailDomainList},"background");const De=await Mt.symmetricDecrypt(Re,ie);return i.loadDatabase(De)},re=async(ee,ie,Ie,we,Re)=>{const De=await ne.authFetch("Vault",{method:"GET",headers:{Authorization:`Bearer ${ie}`}});await a.setAuthTokens(ee,ie,Ie),await i.storeEncryptionKey(we),await i.storeEncryptionKeyDerivationParams({salt:Re.salt,encryptionType:Re.encryptionType,encryptionSettings:Re.encryptionSettings});const Te=await $(De,we);try{if(await Te.hasPendingMigrations()){e("/upgrade",{replace:!0}),g();return}}catch(He){await a.logout(),G(He instanceof Error?He.message:r("common.errors.unknownError")),g();return}e("/reinitialize",{replace:!0}),g()};w.useEffect(()=>{(async()=>{const ie=await ke.getItem("local:clientUrl");let Ie=Za.DEFAULT_CLIENT_URL;ie&&ie.length>0&&(Ie=ie),Q(Ie);const we=await ke.getItem("local:username");we&&d(Re=>({...Re,username:we})),f(!1)})()},[f]),w.useEffect(()=>{const ee=Aa.isPopup()?null:l.jsx(l.Fragment,{children:l.jsx(Nn,{onClick:()=>Aa.openInNewPopup(),title:"Open in new window",iconType:Fa.EXPAND})});return s(ee),()=>{s(null)}},[s]);const ye=async ee=>{ee.preventDefault(),G(null);try{m(),a.clearGlobalMessage();const ie=on.normalizeUsername(c.username),Ie=await me.initiateLogin(ie),{passwordHashString:we,passwordHashBase64:Re}=await on.prepareCredentials(c.password,Ie.salt,Ie.encryptionType,Ie.encryptionSettings),De=await me.validateLogin(ie,we,E,Ie);if(De.requiresTwoFactor){T(Ie),R(we),S(Re),U(!0),g();return}if(!De.token)throw new Error(r("common.errors.unknownError"));await re(ie,De.token.token,De.token.refreshToken,Re,Ie)}catch(ie){ie instanceof si?G(r("common.apiErrors."+ie.message)):G(r("auth.errors.serverError")),g()}},Ae=async ee=>{ee.preventDefault(),G(null);try{if(m(),!k||!_||!x)throw new Error(r("common.errors.unknownError"));const ie=P.trim();if(!/^\d{6}$/.test(ie))throw new Error(r("auth.errors.invalidCode"));const Ie=on.normalizeUsername(c.username),we=await me.validateLogin2Fa(Ie,k,E,x,parseInt(P));if(!we.token)throw new Error(r("common.errors.unknownError"));await re(Ie,we.token.token,we.token.refreshToken,_,x),U(!1),K(""),R(null),S(null),T(null)}catch(ie){console.error("2FA error:",ie),ie instanceof si?G(r("common.apiErrors."+ie.message)):G(r("auth.errors.serverError")),g()}},j=async ee=>{m();try{a.clearGlobalMessage();const ie=await ne.authFetch("Vault",{method:"GET",headers:{Authorization:`Bearer ${ee.token}`}});await a.setAuthTokens(ee.username,ee.token,ee.refreshToken),await i.storeEncryptionKey(ee.decryptionKey),await i.storeEncryptionKeyDerivationParams({salt:ee.salt,encryptionType:ee.encryptionType,encryptionSettings:ee.encryptionSettings});const Ie=await $(ie,ee.decryptionKey);try{if(await Ie.hasPendingMigrations()){e("/upgrade",{replace:!0}),g(),f(!1);return}}catch(we){await a.logout(),G(we instanceof Error?we.message:r("common.errors.unknownError")),g();return}g(),f(!1),e("/reinitialize",{replace:!0})}catch(ie){throw G(ie instanceof Error?ie.message:r("common.errors.unknownError")),g(),ie}},X=ee=>{const{name:ie,value:Ie}=ee.target;d(we=>({...we,[ie]:Ie}))};return O?l.jsx("div",{children:l.jsxs("form",{onSubmit:Ae,className:"bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4",children:[V&&l.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:V}),l.jsxs("div",{className:"mb-6",children:[l.jsx("p",{className:"text-gray-700 dark:text-gray-200 mb-4",children:r("auth.twoFactorTitle")}),l.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"twoFactorCode",children:r("auth.authCode")}),l.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 leading-tight focus:outline-none focus:shadow-outline",id:"twoFactorCode",type:"text",value:P,onChange:ee=>K(ee.target.value),placeholder:r("auth.authCodePlaceholder"),required:!0})]}),l.jsxs("div",{className:"flex flex-col w-full space-y-2",children:[l.jsx(ha,{type:"submit",children:r("auth.verify")}),l.jsx(ha,{type:"button",onClick:()=>{d({username:"",password:""}),U(!1),K(""),R(null),S(null),T(null),G(null)},variant:"secondary",children:r("common.cancel")})]}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-4 text-center",children:r("auth.twoFactorNote")})]})}):l.jsx("div",{className:"flex flex-col items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-md",children:[l.jsxs("form",{onSubmit:ye,className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:[l.jsxs("div",{className:"text-center mb-6",children:[l.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r("auth.loginTitle")}),l.jsx(wL,{})]}),V&&l.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:V}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 dark:text-gray-200 font-medium mb-2",htmlFor:"username",children:r("auth.username")}),l.jsx("input",{className:"shadow appearance-none border rounded-lg w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",id:"username",type:"text",name:"username",placeholder:r("auth.usernamePlaceholder"),value:c.username,onChange:X,required:!0})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 dark:text-gray-200 font-medium mb-2",htmlFor:"password",children:r("common.password")}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{className:"shadow appearance-none border rounded-lg w-full py-2 px-3 pr-10 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",id:"password",type:C?"text":"password",name:"password",placeholder:r("auth.passwordPlaceholder"),value:c.password,onChange:X,required:!0}),l.jsx("button",{type:"button",className:"absolute right-2 top-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",onClick:()=>I(!C),tabIndex:-1,children:l.jsx(Bh,{type:C?Fa.EYE_OFF:Fa.EYE,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})})]})]}),l.jsx("div",{className:"mb-6",children:l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"checkbox",checked:E,onChange:ee=>p(ee.target.checked),className:"mr-2"}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-200",children:r("auth.rememberMe")})]})}),l.jsx(ha,{type:"submit",children:l.jsx("div",{className:"flex items-center justify-center gap-2",children:r("auth.loginButton")})}),l.jsxs("button",{type:"button",onClick:()=>W(!0),className:"w-full max-w-md mt-4 px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2",children:[l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),r("auth.loginWithMobile")]}),l.jsxs("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-6",children:[r("auth.noAccount")," ",l.jsx("a",{href:H??"",target:"_blank",rel:"noopener noreferrer",className:"text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500",children:r("auth.createVault")})]})]}),l.jsx(kI,{isOpen:q,onClose:()=>W(!1),onSuccess:j,webApi:ne,mode:"login"})]})})},As=({type:r,message:e,className:a=""})=>{const i=()=>{const s="p-3 border rounded-md text-sm";switch(r){case"error":return`${s} bg-red-100 dark:bg-red-900/30 border-red-300 dark:border-red-700 text-red-800 dark:text-red-300`;case"success":return`${s} bg-green-100 dark:bg-green-900/30 border-green-300 dark:border-green-700 text-green-800 dark:text-green-300`;case"warning":return`${s} bg-yellow-100 dark:bg-yellow-900/30 border-yellow-300 dark:border-yellow-700 text-yellow-800 dark:text-yellow-300`;case"info":return`${s} bg-blue-100 dark:bg-blue-900/30 border-blue-300 dark:border-blue-700 text-blue-800 dark:text-blue-300`;default:return s}};return l.jsx("div",{className:`${i()} ${a}`,children:e})},Uh=({isOpen:r,onClose:e,onConfirm:a})=>{const{t:i}=tt(),[s,c]=w.useState(null),d=w.useCallback(async()=>{try{const m=await gt("GET_SYNC_STATE",{},"background");c(m.isDirty)}catch(m){console.error("Failed to check sync state:",m),c(!1)}},[]);return w.useEffect(()=>{r&&(c(null),d())},[r,d]),!r||s===null?null:s?l.jsxs(Zn,{isOpen:r,onClose:e,maxWidth:"max-w-sm",showHeaderBorder:!1,showCloseButton:!1,bodyClassName:"p-6",children:[l.jsxs("div",{className:"flex items-start mb-4",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("svg",{className:"h-6 w-6 text-amber-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}),l.jsx("div",{className:"ml-3",children:l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:i("logout.unsyncedChangesTitle")})})]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:i("logout.unsyncedChangesWarning")}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{onClick:e,className:"flex-1 px-4 py-2 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-md transition-colors",children:i("common.cancel")}),l.jsx("button",{onClick:a,className:"flex-1 px-4 py-2 bg-red-500 hover:bg-red-600 text-white rounded-md transition-colors",children:i("logout.logoutAnyway")})]})]}):l.jsxs(Zn,{isOpen:r,onClose:e,maxWidth:"max-w-sm",showHeaderBorder:!1,showCloseButton:!1,bodyClassName:"p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-3",children:i("common.logout")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:i("auth.logoutConfirm")}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{onClick:e,className:"flex-1 px-4 py-2 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-md transition-colors",children:i("common.cancel")}),l.jsx("button",{onClick:a,className:"flex-1 px-4 py-2 bg-red-500 hover:bg-red-600 text-white rounded-md transition-colors",children:i("common.logout")})]})]})},SE=()=>{var a;const{t:r}=tt(),{username:e}=$l();return l.jsxs("div",{className:"flex flex-col items-center mb-6",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center mb-3",children:l.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-2xl font-medium",children:((a=e==null?void 0:e[0])==null?void 0:a.toUpperCase())||"?"})}),l.jsx("p",{className:"font-medium text-gray-900 dark:text-white text-base",children:e}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("common.loggedIn")})]})},VL=()=>{const{t:r}=tt(),e=dr(),a=$l(),i=Gt(),s=La(),{setHeaderButtons:c}=mr(),d=ur(),m=new RI(d),[g,f]=w.useState("password"),[E,p]=w.useState(!1),[C,I]=w.useState(""),[x,T]=w.useState(!1),[k,R]=w.useState(""),[_,S]=w.useState(6),O=w.useRef(null),U=w.useRef(null),[P,K]=w.useState(null),{showLoading:H,hideLoading:Q,setIsInitialLoading:V}=pa(),[G,q]=w.useState(!1),[W,ne]=w.useState(!1),me=async()=>{try{const De=await d.getStatus();if(De.serverVersion==="0.0.0")return V(!1),await i.setIsOffline(!0),{online:!1,error:null};const Te=d.validateStatusResponse(De);return Te!==null?(await e.logout(r("common.errors."+Te)),{online:!1,error:Te}):(V(!1),await i.setIsOffline(!1),{online:!0,error:null})}catch{return V(!1),{online:!1,error:"sessionExpired"}}};w.useEffect(()=>{(async()=>{const[Te,He]=await Promise.all([rI(),Wk()]);p(Te),S(He||6),f(Te?"pin":"password"),await me()})()},[]),w.useEffect(()=>{const De=Aa.isPopup()?null:l.jsx(Nn,{onClick:()=>Aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Fa.EXPAND});return c(De),()=>{c(null)}},[c,r]),w.useEffect(()=>{if(g!=="pin")return;const De=()=>{O.current&&O.current.focus()},Te=()=>{De()},He=()=>{De()};De();const Ne=U.current;return Ne&&Ne.addEventListener("click",Te),window.addEventListener("focus",He),()=>{Ne&&Ne.removeEventListener("click",Te),window.removeEventListener("focus",He)}},[g]);const $=async De=>{De.preventDefault(),K(null),H();const Te=await me();if(Te.error){Q();return}try{let He;if(Te.online){const Qe=await m.initiateLogin(a.username);He=(await on.prepareCredentials(C,Qe.salt,Qe.encryptionType,Qe.encryptionSettings)).passwordHashBase64,await i.storeEncryptionKeyDerivationParams({salt:Qe.salt,encryptionType:Qe.encryptionType,encryptionSettings:Qe.encryptionSettings})}else{const Qe=await gt("GET_ENCRYPTION_KEY_DERIVATION_PARAMS",{},"background");if(!Qe){K(r("common.errors.serverNotAvailable")),Q();return}He=(await on.prepareCredentials(C,Qe.salt,Qe.encryptionType,Qe.encryptionSettings)).passwordHashBase64,await i.setIsOffline(!0)}await i.storeEncryptionKey(He);const Ne=await i.loadStoredDatabase();if(!Ne){K(r("auth.errors.wrongPassword")),Q();return}if(await Ne.hasPendingMigrations()){s("/upgrade",{replace:!0}),Q();return}await ke.setItem(go,0),await Py(),s("/reinitialize",{replace:!0})}catch(He){He instanceof vs?await e.logout(He.message):K(r("auth.errors.wrongPassword")),console.error("Unlock error:",He)}finally{Q()}},re=w.useCallback(async De=>{R(De),K(null),De.length===_&&(await new Promise(Te=>setTimeout(Te,50)),await j(De))},[_]),ye=De=>{k.length<8&&re(k+De)},Ae=()=>{R(k.slice(0,-1)),K(null)},j=async(De=k)=>{if(De.length===_){K(null),H();try{const Te=await Jk(De);(await me()).online||await i.setIsOffline(!0),await i.storeEncryptionKey(Te);const Ne=await i.loadStoredDatabase();if(!Ne)throw new Xg(3);if(await Ne.hasPendingMigrations()){s("/upgrade",{replace:!0}),Q();return}await ke.setItem(go,0),s("/reinitialize",{replace:!0}),Q()}catch(Te){if(Te instanceof Mu)p(!1),f("password"),K(r("settings.unlockMethod.pinLocked"));else if(Te instanceof Xg){const He=Te.attemptsRemaining;K(He===1?r("settings.unlockMethod.incorrectPinSingular"):r("settings.unlockMethod.incorrectPin",{attemptsRemaining:He})),R("")}else Te instanceof Gl?(K(r("settings.unlockMethod.invalidPinFormat")),R("")):(console.error("PIN unlock failed:",Te),K(r("common.errors.unknownErrorTryAgain")),R(""));Q()}}},X=()=>{ne(!0)},ee=async()=>{ne(!1);try{await d.revokeTokens(),await a.clearAuthUserInitiated()}catch(De){console.error("Error during logout:",De)}},ie=async De=>{H();try{await d.revokeTokens(),await a.setAuthTokens(De.username,De.token,De.refreshToken),await i.storeEncryptionKey(De.decryptionKey),await i.storeEncryptionKeyDerivationParams({salt:De.salt,encryptionType:De.encryptionType,encryptionSettings:De.encryptionSettings});const Te=await i.loadStoredDatabase();if(!Te){K(r("common.errors.unknownErrorTryAgain")),Q();return}if(await Te.hasPendingMigrations()){s("/upgrade",{replace:!0}),Q();return}await ke.setItem(go,0),await Py(),s("/reinitialize",{replace:!0})}catch(Te){Te instanceof vs?await e.logout(Te.message):K(r("common.errors.unknownErrorTryAgain")),console.error("Mobile unlock error:",Te)}finally{Q()}},Ie=()=>{f("password"),K(null)},we=()=>{f("pin"),K(null)},Re=Array.from({length:_},(De,Te)=>l.jsx("div",{className:`w-4 h-4 rounded-full border-2 transition-all ${Te<k.length?"bg-primary-500 border-primary-500":"bg-transparent border-gray-300 dark:border-gray-600"}`},Te));return g==="pin"?l.jsx("div",{ref:U,className:"flex flex-col items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-md",children:[l.jsx(SE,{}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:[l.jsxs("div",{className:"text-center mb-4",children:[l.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white mb-1",children:r("auth.unlockTitle")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("auth.enterPinToUnlock")})]}),l.jsx("div",{className:"flex justify-center gap-2 mb-4",children:Re}),P&&l.jsx(As,{type:"error",message:P,className:"mb-3 text-center"}),l.jsx("input",{ref:O,type:"password",inputMode:"numeric",pattern:"[0-9]*",maxLength:8,value:k,onChange:De=>re(De.target.value.replace(/\D/g,"")),className:"w-0 h-0 opacity-0 absolute",autoFocus:!0,"aria-label":"PIN input"}),l.jsx("div",{children:l.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[[1,2,3,4,5,6,7,8,9].map(De=>l.jsx("button",{type:"button",onClick:()=>ye(De.toString()),className:"h-12 flex items-center justify-center text-xl font-semibold bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95",children:De},De)),l.jsx("div",{}),l.jsx("button",{type:"button",onClick:()=>ye("0"),className:"h-12 flex items-center justify-center text-xl font-semibold bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95",children:"0"}),l.jsx("button",{type:"button",onClick:Ae,className:"h-12 flex items-center justify-center bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95","aria-label":"Backspace",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z"})})})]})})]}),l.jsx("div",{className:"mt-4",children:l.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-6",children:l.jsx("button",{type:"button",onClick:Ie,className:"text-primary-600 hover:text-primary-700 dark:text-primary-500 dark:hover:text-primary-400 hover:underline font-medium",children:r("auth.useMasterPassword")})})})]})}):l.jsxs("div",{className:"flex flex-col items-center justify-center p-4",children:[l.jsxs("div",{className:"w-full max-w-md",children:[l.jsx(SE,{}),l.jsxs("form",{onSubmit:$,className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:[l.jsx("div",{className:"text-center mb-6",children:l.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r("auth.unlockTitle")})}),P&&l.jsx(As,{type:"error",message:P,className:"mb-4 text-center"}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 dark:text-gray-200 font-medium mb-2",htmlFor:"password",children:r("auth.masterPassword")}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{className:"shadow appearance-none border rounded-lg w-full py-2 px-3 pr-10 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",id:"password",type:x?"text":"password",value:C,onChange:De=>I(De.target.value),placeholder:r("auth.passwordPlaceholder"),required:!0,autoFocus:!0}),l.jsx("button",{type:"button",className:"absolute right-2 top-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",onClick:()=>T(!x),tabIndex:-1,children:l.jsx(Bh,{type:x?Fa.EYE_OFF:Fa.EYE,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})})]})]}),l.jsx(ha,{type:"submit",children:r("auth.unlockVault")}),!i.isOffline&&l.jsxs("button",{type:"button",onClick:()=>q(!0),className:"w-full max-w-md mt-4 px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2",children:[l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),r("auth.unlockWithMobile")]}),l.jsxs("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-6",children:[r("auth.switchAccounts")," ",l.jsx("button",{type:"button",onClick:X,className:"text-primary-600 hover:text-primary-700 dark:text-primary-500 dark:hover:text-primary-400 hover:underline font-medium",children:r("common.logout")})]})]})]}),E&&l.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-6",children:l.jsx("button",{type:"button",onClick:we,className:"text-primary-600 hover:text-primary-700 dark:text-primary-500 dark:hover:text-primary-400 hover:underline font-medium",children:r("auth.unlockWithPin")})}),l.jsx(kI,{isOpen:G,onClose:()=>q(!1),onSuccess:ie,webApi:d,mode:"unlock"}),l.jsx(Uh,{isOpen:W,onClose:()=>ne(!1),onConfirm:ee})]})},KL=()=>{const r=La(),{t:e}=tt(),a=()=>{const i=new URL(window.location.href);i.searchParams.delete("mode"),window.history.replaceState({},"",i),r("/items")};return l.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:[l.jsx("div",{className:"mb-4 text-green-600 dark:text-green-400",children:l.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsx("h2",{className:"text-xl font-semibold mb-4 text-gray-900 dark:text-white",children:e("auth.unlockSuccessTitle")}),l.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-400",children:e("auth.unlockSuccessDescription")}),l.jsxs("div",{className:"space-y-3 w-full",children:[l.jsx("button",{onClick:()=>window.close(),className:"w-full px-4 py-2 text-white bg-primary-600 rounded hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",children:e("auth.closePopup")}),l.jsx("button",{onClick:a,className:"w-full px-4 py-2 text-gray-700 bg-gray-100 rounded hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600",children:e("auth.browseVault")})]})]})},Xu=({isOpen:r,onClose:e,onConfirm:a,title:i,message:s,confirmText:c="",cancelText:d="",variant:m="default"})=>{const g=m==="danger"?"bg-red-600 hover:bg-red-700 focus:ring-red-500":"bg-primary-600 hover:bg-primary-700 focus:ring-primary-500";return l.jsxs(Zn,{isOpen:r,onClose:e,maxWidth:"max-w-lg",showHeaderBorder:!1,bodyClassName:"px-4 pb-4 pt-5",children:[l.jsxs("div",{className:"sm:flex sm:items-start",children:[m==="danger"&&l.jsx("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900 sm:mx-0 sm:h-10 sm:w-10",children:l.jsx("svg",{className:"h-6 w-6 text-red-600 dark:text-red-200",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}),l.jsxs("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[l.jsx("h3",{className:"text-lg font-semibold leading-6 text-gray-900 dark:text-white",children:i}),l.jsx("div",{className:"mt-2",children:l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:s})})]})]}),l.jsxs("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[c&&l.jsx("button",{type:"button",className:`inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 sm:ml-3 sm:w-auto ${g}`,onClick:a,children:c}),d&&l.jsx("button",{type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md bg-white dark:bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-900 dark:text-gray-200 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500 sm:mt-0 sm:w-auto",onClick:e,children:d})]})]})};class GL{constructor(){ze(this,"sqlJsInstance",null);ze(this,"rustInitialized",!1)}async initRust(){if(this.rustInitialized)return;const e=li.runtime.getURL("src/aliasvault_core_bg.wasm"),i=await(await fetch(e)).arrayBuffer();await dd(i),this.rustInitialized=!0}async merge(e,a){try{await this.initRust();const i=this.sqlJsInstance??await qg({locateFile:d=>`src/${d}`}),s=this.loadDatabase(i,e),c=this.loadDatabase(i,a);try{const d=RL(),m=d.map(C=>({name:C,records:this.readTableAsJson(s,C)})),g=d.map(C=>({name:C,records:this.readTableAsJson(c,C)})),f=JSON.parse(JSON.stringify({local_tables:m,server_tables:g}));console.debug("[VaultMerge] Merge input:",{localTableCount:m.length,serverTableCount:g.length,localTables:m.map(C=>({name:C.name,recordCount:C.records.length})),serverTables:g.map(C=>({name:C.name,recordCount:C.records.length}))});const E=DL(f);for(const C of E.statements){const I=C.params.map(x=>x===void 0?null:x);s.run(C.sql,I)}const p=this.exportDatabase(s);return{success:E.success,mergedVaultBase64:p,stats:{tablesProcessed:E.stats.tables_processed,recordsFromLocal:E.stats.records_from_local,recordsFromServer:E.stats.records_from_server,recordsCreatedLocally:E.stats.records_created_locally,conflicts:E.stats.conflicts}}}finally{s.close(),c.close()}}catch(i){throw console.error("Vault merge failed:",i),i}}async prune(e,a=30){try{await this.initRust();const i=this.sqlJsInstance??await qg({locateFile:c=>`src/${c}`}),s=this.loadDatabase(i,e);try{const d=["Items","FieldValues","Attachments","TotpCodes","Passkeys"].map(p=>({name:p,records:this.readTableAsJson(s,p)})),m=JSON.parse(JSON.stringify({tables:d,retention_days:a,current_time:new Date().toISOString()})),g=BL(m);for(const p of g.statements){const C=p.params.map(I=>I===void 0?null:I);s.run(p.sql,C)}const f=this.exportDatabase(s),E=g.statements.length;return E>0&&console.info(`[VaultMerge] Pruned expired items from trash (${E} SQL statements executed)`),{success:g.success,prunedVaultBase64:f,statementCount:E}}finally{s.close()}}catch(i){throw console.error("Vault prune failed:",i),i}}loadDatabase(e,a){const i=atob(a),s=new Uint8Array(i.length);for(let c=0;c<i.length;c++)s[c]=i.charCodeAt(c);return new e.Database(s)}exportDatabase(e){e.run("VACUUM");const a=e.export();let i="";for(let s=0;s<a.length;s++)i+=String.fromCharCode(a[s]);return btoa(i)}readTableAsJson(e,a){const i=[],s=e.prepare(`SELECT * FROM ${a}`);for(;s.step();){const c=s.getAsObject(),d=JSON.parse(JSON.stringify(c));i.push(d)}return s.free(),i}}const qL=new GL,md=()=>{const{t:r}=tt(),e=dr(),a=Gt(),i=ur(),s=w.useCallback(async m=>await a.hasPendingMigrations()?(m==null||m(),!0):!1,[a]),c=w.useCallback(async(m,g,f)=>(await a.setIsOffline(!0),m==null||m(r("common.offlineMode")),g==null||g(),f==null||f(!1),!0),[a,r]),d=w.useCallback(async(m={})=>{const{onSuccess:g,onError:f,onStatus:E,onOffline:p,onUpgradeRequired:C}=m;try{if(!await e.initializeAuth())return!1;E==null||E(r("common.checkingVaultUpdates"));const x=await i.getStatus(),T=await gt("GET_SYNC_STATE",{},"background");if(x.vaultRevision>T.serverRevision&&a.setIsSyncing(!0),x.serverVersion==="0.0.0")return a.dbAvailable?c(E,p,g):(f==null||f(r("common.errors.serverNotAvailable")),!1);const k=i.validateStatusResponse(x);if(k)return f==null||f(r("common.errors."+k)),!1;const R=await gt("GET_ENCRYPTION_KEY_DERIVATION_PARAMS",{},"background");if(R&&x.srpSalt&&x.srpSalt!==R.salt)return await e.logout(r("common.errors.passwordChanged")),!1;if(a.isOffline&&await a.setIsOffline(!1),x.vaultRevision>T.serverRevision){E==null||E(r("common.syncingUpdatedVault"));const _=await i.get("Vault");try{const S=await gt("GET_ENCRYPTION_KEY",{},"background");if(T.isDirty){E==null||E(r("common.mergingVaultChanges"));const P=await gt("GET_ENCRYPTED_VAULT",{},"background");if(P){const K=await Mt.symmetricDecrypt(P,S),H=await Mt.symmetricDecrypt(_.vault.blob,S),Q=await qL.merge(K,H);if(Q.success){console.info("Vault merge during sync completed:",Q.stats);const V=await Mt.symmetricEncrypt(Q.mergedVaultBase64,S);if(!(await gt("STORE_ENCRYPTED_VAULT",{vaultBlob:V,serverRevision:_.vault.currentRevisionNumber,expectedMutationSeq:T.mutationSequence},"background")).success)return console.info("Mutation detected during merge, re-syncing..."),d(m);E==null||E(r("common.uploadingVault"));const q=await gt("UPLOAD_VAULT",{},"background");if(q.success&&q.status===0)await gt("MARK_VAULT_CLEAN",{mutationSeqAtStart:q.mutationSeqAtStart,newServerRevision:q.newRevisionNumber},"background");else return q.status===2?d(m):(console.error("Failed to upload merged vault:",q.error),f==null||f(q.error??r("common.errors.unknownError")),!1);return await gt("STORE_VAULT_METADATA",{publicEmailDomainList:_.vault.publicEmailDomainList,privateEmailDomainList:_.vault.privateEmailDomainList,hiddenPrivateEmailDomainList:_.vault.hiddenPrivateEmailDomainList},"background"),await a.loadDatabase(Q.mergedVaultBase64),await a.refreshSyncState(),await s(C)?!1:(g==null||g(!0),!0)}else console.error("Vault merge failed during sync, using server vault")}}if(!(await gt("STORE_ENCRYPTED_VAULT",{vaultBlob:_.vault.blob,serverRevision:_.vault.currentRevisionNumber,expectedMutationSeq:T.mutationSequence},"background")).success)return console.info("Mutation detected during sync, re-syncing..."),d(m);await gt("STORE_VAULT_METADATA",{publicEmailDomainList:_.vault.publicEmailDomainList,privateEmailDomainList:_.vault.privateEmailDomainList,hiddenPrivateEmailDomainList:_.vault.hiddenPrivateEmailDomainList},"background");const U=await Mt.symmetricDecrypt(_.vault.blob,S);return await a.loadDatabase(U),await a.refreshSyncState(),await s(C)?!1:(g==null||g(!0),!0)}catch(S){if(S instanceof vs)return await e.logout(S.message),!1;throw new Error("Vault could not be decrypted, if the problem persists please logout and login again.")}}else if(x.vaultRevision===T.serverRevision){if(T.isDirty){E==null||E(r("common.uploadingVault"));const _=await gt("UPLOAD_VAULT",{},"background");if(_.success&&_.status===0)await gt("MARK_VAULT_CLEAN",{mutationSeqAtStart:_.mutationSeqAtStart,newServerRevision:_.newRevisionNumber},"background"),await a.refreshSyncState();else return _.status===2?d(m):(console.error("Failed to upload pending vault:",_.error),f==null||f(_.error??r("common.errors.unknownError")),!1);return g==null||g(!1),!0}}else if(x.vaultRevision<T.serverRevision){console.warn(`Server data loss detected! Server at rev ${x.vaultRevision}, client at rev ${T.serverRevision}. Uploading to recover server state.`),E==null||E(r("common.uploadingVault"));const _=await gt("UPLOAD_VAULT",{},"background");return _.success&&_.status===0?(await gt("MARK_VAULT_CLEAN",{mutationSeqAtStart:_.mutationSeqAtStart,newServerRevision:_.newRevisionNumber},"background"),await a.refreshSyncState(),console.info(`Server recovery complete: rev ${x.vaultRevision} → ${_.newRevisionNumber}`),g==null||g(!1),!0):_.status===2?(console.info("Another client recovered server first, re-syncing..."),d(m)):(console.error("Server recovery failed:",_.error),f==null||f(r("common.errors.unknownError")),!1)}return await s(C)||g==null||g(!1),!1}catch(I){const x=I instanceof Error?I.message:"Unknown error during vault sync";return console.error("Vault sync error:",I),I instanceof vs?(await e.logout(x),!1):I instanceof si?!1:I instanceof ud&&a.dbAvailable?c(E,p,g):(f==null||f(x),!1)}finally{a.setIsSyncing(!1)}},[e,a,i,r,s,c]);return{syncVault:d}};function vo(){const r=Gt(),{syncVault:e}=md(),a=w.useRef(!1),i=w.useCallback(async d=>{await d();const m=r.sqliteClient.exportToBase64(),g=await gt("GET_ENCRYPTION_KEY",{},"background"),f=await Mt.symmetricEncrypt(m,g);await gt("STORE_ENCRYPTED_VAULT",{vaultBlob:f,markDirty:!0},"background"),await r.refreshSyncState()},[r]),s=w.useCallback(async()=>{if(!a.current){a.current=!0;try{await e({onSuccess:async()=>{await r.refreshSyncState(),r.getIsOffline()||(await gt("GET_SYNC_STATE",{},"background")).isDirty&&(a.current=!1,await s())},onOffline:()=>{},onError:d=>{console.error("Background sync error:",d)}})}catch(d){console.error("Error during background sync:",d)}finally{a.current=!1}}},[r,e]);return{executeVaultMutationAsync:w.useCallback(async d=>{await i(d),s()},[i,s])}}const WL=()=>{var $;const{t:r}=tt(),{username:e}=dr(),a=$l(),i=Gt(),{sqliteClient:s}=i,{setHeaderButtons:c}=mr(),[d,m]=w.useState(!1),[g,f]=w.useState(null),[E,p]=w.useState(null),[C,I]=w.useState(null),[x,T]=w.useState(!1),[k,R]=w.useState(!1),[_,S]=w.useState(!1),{setIsInitialLoading:O}=pa(),U=ur(),{executeVaultMutationAsync:P}=vo(),{syncVault:K}=md(),H=La();w.useEffect(()=>{const re=Aa.isPopup()?null:l.jsx(l.Fragment,{children:l.jsx(Nn,{onClick:()=>Aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Fa.EXPAND})});return c(re),()=>{c(null)}},[c,r]);const Q=w.useCallback(async()=>{try{if(s){const re=await s.getDatabaseVersion(),ye=await s.getLatestDatabaseVersion();f(re),p(ye)}}catch(re){console.error("Failed to load version information:",re),I(r("upgrade.alerts.unableToGetVersionInfo"))}finally{O(!1)}},[s,O,r]);w.useEffect(()=>{Q()},[Q]);const V=async()=>{if(!s||!g||!E){I(r("upgrade.alerts.unableToGetVersionInfo"));return}if(await U.isSelfHosted()){T(!0);return}await G()},G=async()=>{if(!s||!g||!E){I(r("upgrade.alerts.unableToGetVersionInfo"));return}m(!0),I(null);try{const ye=new Wg().getUpgradeVaultSql(g.revision,E.revision);if(!ye.success)throw new Error(ye.error??r("upgrade.alerts.upgradeFailed"));if(ye.sqlCommands.length===0){await q();return}await P(async()=>{s.beginTransaction();for(let Ae=0;Ae<ye.sqlCommands.length;Ae++){const j=ye.sqlCommands[Ae];try{s.executeRaw(j)}catch(X){throw console.error(`Error executing SQL command ${Ae+1}:`,j,X),s.rollbackTransaction(),new Error(r("upgrade.alerts.failedToApplyMigration",{current:Ae+1,total:ye.sqlCommands.length}))}}s.commitTransaction()}),await q()}catch(re){console.error("Upgrade failed:",re),I(re instanceof Error?re.message:r("common.errors.unknownError"))}finally{m(!1)}},q=async()=>{try{await K({onSuccess:()=>{H("/items")},onError:re=>{console.error("Sync error after upgrade:",re),H("/items")}})}catch(re){console.error("Error during post-upgrade sync:",re),H("/items")}},W=()=>{S(!0)},ne=async()=>{S(!1);try{await U.revokeTokens(),await a.clearAuthUserInitiated()}catch(re){console.error("Error during logout:",re)}},me=()=>{R(!0)};return l.jsxs("div",{children:[d&&l.jsxs("div",{className:"fixed inset-0 flex flex-col justify-center items-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90 z-50",children:[l.jsx($n,{}),l.jsx("div",{className:"text-sm text-gray-500 mt-2",children:r("upgrade.upgrading")})]}),l.jsx(Xu,{isOpen:x,onClose:()=>T(!1),onConfirm:()=>{T(!1),G()},title:r("upgrade.alerts.selfHostedServer"),message:r("upgrade.alerts.selfHostedWarning"),confirmText:r("upgrade.alerts.continueUpgrade"),cancelText:r("common.cancel")}),l.jsx(Xu,{isOpen:k,onClose:()=>R(!1),onConfirm:()=>R(!1),title:r("upgrade.whatsNew"),message:`${r("upgrade.whatsNewDescription")}

${(E==null?void 0:E.description)??r("upgrade.noDescriptionAvailable")}`}),l.jsxs("form",{className:"w-full px-2 pt-2 pb-2 mb-4",children:[C&&l.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400",children:C}),l.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:l.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:(($=e==null?void 0:e[0])==null?void 0:$.toUpperCase())||"?"})})}),l.jsx("div",{children:l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:e})})]}),l.jsx("h2",{className:"text-xl font-bold dark:text-gray-200 mb-4",children:r("upgrade.title")}),l.jsxs("div",{className:"mb-6",children:[l.jsx("p",{className:"text-gray-700 dark:text-gray-200 mb-4",children:r("upgrade.subtitle")}),l.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded p-4 mb-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-200",children:r("upgrade.versionInformation")}),l.jsx("button",{type:"button",onClick:me,className:"bg-gray-200 dark:bg-gray-600 text-gray-800 dark:text-gray-200 rounded-full w-6 h-6 flex items-center justify-center text-sm font-bold hover:bg-gray-300 dark:hover:bg-gray-500",title:r("upgrade.whatsNew"),children:"?"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("upgrade.yourVault")}),l.jsx("span",{className:"text-sm font-bold text-orange-600 dark:text-orange-400",children:(g==null?void 0:g.compatibleUpToVersion)??"..."})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("upgrade.newVersion")}),l.jsx("span",{className:"text-sm font-bold text-green-600 dark:text-green-400",children:(E==null?void 0:E.releaseVersion)??"..."})]})]})]})]}),l.jsxs("div",{className:"flex flex-col w-full space-y-2",children:[l.jsx(ha,{type:"button",id:"upgrade-button",onClick:V,children:r(d?"upgrade.upgrading":"upgrade.upgrade")}),l.jsx("button",{type:"button",onClick:W,className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-sm font-medium py-2",disabled:d,children:r("common.logout")})]})]}),l.jsx(Uh,{isOpen:_,onClose:()=>S(!1),onConfirm:ne})]})};/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:DI,setPrototypeOf:kE,isFrozen:YL,getPrototypeOf:JL,getOwnPropertyDescriptor:XL}=Object;let{freeze:gn,seal:er,create:rh}=Object,{apply:ih,construct:sh}=typeof Reflect<"u"&&Reflect;gn||(gn=function(e){return e});er||(er=function(e){return e});ih||(ih=function(e,a){for(var i=arguments.length,s=new Array(i>2?i-2:0),c=2;c<i;c++)s[c-2]=arguments[c];return e.apply(a,s)});sh||(sh=function(e){for(var a=arguments.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];return new e(...i)});const vu=hn(Array.prototype.forEach),$L=hn(Array.prototype.lastIndexOf),LE=hn(Array.prototype.pop),xl=hn(Array.prototype.push),ZL=hn(Array.prototype.splice),Pu=hn(String.prototype.toLowerCase),Cg=hn(String.prototype.toString),Ng=hn(String.prototype.match),Tl=hn(String.prototype.replace),eR=hn(String.prototype.indexOf),tR=hn(String.prototype.trim),or=hn(Object.prototype.hasOwnProperty),mn=hn(RegExp.prototype.test),Sl=aR(TypeError);function hn(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var a=arguments.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];return ih(r,e,i)}}function aR(r){return function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return sh(r,a)}}function Rt(r,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pu;kE&&kE(r,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const c=a(s);c!==s&&(YL(e)||(e[i]=c),s=c)}r[s]=!0}return r}function nR(r){for(let e=0;e<r.length;e++)or(r,e)||(r[e]=null);return r}function Cr(r){const e=rh(null);for(const[a,i]of DI(r))or(r,a)&&(Array.isArray(i)?e[a]=nR(i):i&&typeof i=="object"&&i.constructor===Object?e[a]=Cr(i):e[a]=i);return e}function kl(r,e){for(;r!==null;){const i=XL(r,e);if(i){if(i.get)return hn(i.get);if(typeof i.value=="function")return hn(i.value)}r=JL(r)}function a(){return null}return a}const RE=gn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),xg=gn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Tg=gn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rR=gn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Sg=gn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),iR=gn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),DE=gn(["#text"]),BE=gn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),kg=gn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),UE=gn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),wu=gn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sR=er(/\{\{[\w\W]*|[\w\W]*\}\}/gm),oR=er(/<%[\w\W]*|[\w\W]*%>/gm),lR=er(/\$\{[\w\W]*/gm),cR=er(/^data-[\-\w.\u00B7-\uFFFF]+$/),uR=er(/^aria-[\-\w]+$/),BI=er(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dR=er(/^(?:\w+script|data):/i),mR=er(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),UI=er(/^html$/i),fR=er(/^[a-z][.\w]*(-[.\w]+)+$/i);var _E=Object.freeze({__proto__:null,ARIA_ATTR:uR,ATTR_WHITESPACE:mR,CUSTOM_ELEMENT:fR,DATA_ATTR:cR,DOCTYPE_NAME:UI,ERB_EXPR:oR,IS_ALLOWED_URI:BI,IS_SCRIPT_OR_DATA:dR,MUSTACHE_EXPR:sR,TMPLIT_EXPR:lR});const Ll={element:1,text:3,progressingInstruction:7,comment:8,document:9},gR=function(){return typeof window>"u"?null:window},hR=function(e,a){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";a&&a.hasAttribute(s)&&(i=a.getAttribute(s));const c="dompurify"+(i?"#"+i:"");try{return e.createPolicy(c,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},ME=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function _I(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gR();const e=Fe=>_I(Fe);if(e.version="3.3.1",e.removed=[],!r||!r.document||r.document.nodeType!==Ll.document||!r.Element)return e.isSupported=!1,e;let{document:a}=r;const i=a,s=i.currentScript,{DocumentFragment:c,HTMLTemplateElement:d,Node:m,Element:g,NodeFilter:f,NamedNodeMap:E=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:p,DOMParser:C,trustedTypes:I}=r,x=g.prototype,T=kl(x,"cloneNode"),k=kl(x,"remove"),R=kl(x,"nextSibling"),_=kl(x,"childNodes"),S=kl(x,"parentNode");if(typeof d=="function"){const Fe=a.createElement("template");Fe.content&&Fe.content.ownerDocument&&(a=Fe.content.ownerDocument)}let O,U="";const{implementation:P,createNodeIterator:K,createDocumentFragment:H,getElementsByTagName:Q}=a,{importNode:V}=i;let G=ME();e.isSupported=typeof DI=="function"&&typeof S=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:W,TMPLIT_EXPR:ne,DATA_ATTR:me,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:re,ATTR_WHITESPACE:ye,CUSTOM_ELEMENT:Ae}=_E;let{IS_ALLOWED_URI:j}=_E,X=null;const ee=Rt({},[...RE,...xg,...Tg,...Sg,...DE]);let ie=null;const Ie=Rt({},[...BE,...kg,...UE,...wu]);let we=Object.seal(rh(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Re=null,De=null;const Te=Object.seal(rh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let He=!0,Ne=!0,Qe=!1,yt=!0,We=!1,nt=!0,Ht=!1,ve=!1,Be=!1,$e=!1,Ye=!1,lt=!1,et=!0,Et=!1;const Pt="user-content-";let qt=!0,Qt=!1,na={},B=null;const v=Rt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let N=null;const z=Rt({},["audio","video","img","source","image","track"]);let ae=null;const ge=Rt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ee="http://www.w3.org/1998/Math/MathML",Ue="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xhtml";let It=ht,St=!1,mt=null;const fr=Rt({},[Ee,Ue,ht],Cg);let ra=Rt({},["mi","mo","mn","ms","mtext"]),an=Rt({},["annotation-xml"]);const On=Rt({},["title","style","font","a","script"]);let jn=null;const Oe=["application/xhtml+xml","text/html"],ci="text/html";let Zt=null,sa=null;const tr=a.createElement("form"),ar=function(Z){return Z instanceof RegExp||Z instanceof Function},Ra=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(sa&&sa===Z)){if((!Z||typeof Z!="object")&&(Z={}),Z=Cr(Z),jn=Oe.indexOf(Z.PARSER_MEDIA_TYPE)===-1?ci:Z.PARSER_MEDIA_TYPE,Zt=jn==="application/xhtml+xml"?Cg:Pu,X=or(Z,"ALLOWED_TAGS")?Rt({},Z.ALLOWED_TAGS,Zt):ee,ie=or(Z,"ALLOWED_ATTR")?Rt({},Z.ALLOWED_ATTR,Zt):Ie,mt=or(Z,"ALLOWED_NAMESPACES")?Rt({},Z.ALLOWED_NAMESPACES,Cg):fr,ae=or(Z,"ADD_URI_SAFE_ATTR")?Rt(Cr(ge),Z.ADD_URI_SAFE_ATTR,Zt):ge,N=or(Z,"ADD_DATA_URI_TAGS")?Rt(Cr(z),Z.ADD_DATA_URI_TAGS,Zt):z,B=or(Z,"FORBID_CONTENTS")?Rt({},Z.FORBID_CONTENTS,Zt):v,Re=or(Z,"FORBID_TAGS")?Rt({},Z.FORBID_TAGS,Zt):Cr({}),De=or(Z,"FORBID_ATTR")?Rt({},Z.FORBID_ATTR,Zt):Cr({}),na=or(Z,"USE_PROFILES")?Z.USE_PROFILES:!1,He=Z.ALLOW_ARIA_ATTR!==!1,Ne=Z.ALLOW_DATA_ATTR!==!1,Qe=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,yt=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,We=Z.SAFE_FOR_TEMPLATES||!1,nt=Z.SAFE_FOR_XML!==!1,Ht=Z.WHOLE_DOCUMENT||!1,$e=Z.RETURN_DOM||!1,Ye=Z.RETURN_DOM_FRAGMENT||!1,lt=Z.RETURN_TRUSTED_TYPE||!1,Be=Z.FORCE_BODY||!1,et=Z.SANITIZE_DOM!==!1,Et=Z.SANITIZE_NAMED_PROPS||!1,qt=Z.KEEP_CONTENT!==!1,Qt=Z.IN_PLACE||!1,j=Z.ALLOWED_URI_REGEXP||BI,It=Z.NAMESPACE||ht,ra=Z.MATHML_TEXT_INTEGRATION_POINTS||ra,an=Z.HTML_INTEGRATION_POINTS||an,we=Z.CUSTOM_ELEMENT_HANDLING||{},Z.CUSTOM_ELEMENT_HANDLING&&ar(Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&ar(Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&typeof Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(we.allowCustomizedBuiltInElements=Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),We&&(Ne=!1),Ye&&($e=!0),na&&(X=Rt({},DE),ie=[],na.html===!0&&(Rt(X,RE),Rt(ie,BE)),na.svg===!0&&(Rt(X,xg),Rt(ie,kg),Rt(ie,wu)),na.svgFilters===!0&&(Rt(X,Tg),Rt(ie,kg),Rt(ie,wu)),na.mathMl===!0&&(Rt(X,Sg),Rt(ie,UE),Rt(ie,wu))),Z.ADD_TAGS&&(typeof Z.ADD_TAGS=="function"?Te.tagCheck=Z.ADD_TAGS:(X===ee&&(X=Cr(X)),Rt(X,Z.ADD_TAGS,Zt))),Z.ADD_ATTR&&(typeof Z.ADD_ATTR=="function"?Te.attributeCheck=Z.ADD_ATTR:(ie===Ie&&(ie=Cr(ie)),Rt(ie,Z.ADD_ATTR,Zt))),Z.ADD_URI_SAFE_ATTR&&Rt(ae,Z.ADD_URI_SAFE_ATTR,Zt),Z.FORBID_CONTENTS&&(B===v&&(B=Cr(B)),Rt(B,Z.FORBID_CONTENTS,Zt)),Z.ADD_FORBID_CONTENTS&&(B===v&&(B=Cr(B)),Rt(B,Z.ADD_FORBID_CONTENTS,Zt)),qt&&(X["#text"]=!0),Ht&&Rt(X,["html","head","body"]),X.table&&(Rt(X,["tbody"]),delete Re.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw Sl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=Z.TRUSTED_TYPES_POLICY,U=O.createHTML("")}else O===void 0&&(O=hR(I,s)),O!==null&&typeof U=="string"&&(U=O.createHTML(""));gn&&gn(Z),sa=Z}},zt=Rt({},[...xg,...Tg,...rR]),ya=Rt({},[...Sg,...iR]),Wt=function(Z){let xe=S(Z);(!xe||!xe.tagName)&&(xe={namespaceURI:It,tagName:"template"});const Pe=Pu(Z.tagName),Ut=Pu(xe.tagName);return mt[Z.namespaceURI]?Z.namespaceURI===Ue?xe.namespaceURI===ht?Pe==="svg":xe.namespaceURI===Ee?Pe==="svg"&&(Ut==="annotation-xml"||ra[Ut]):!!zt[Pe]:Z.namespaceURI===Ee?xe.namespaceURI===ht?Pe==="math":xe.namespaceURI===Ue?Pe==="math"&&an[Ut]:!!ya[Pe]:Z.namespaceURI===ht?xe.namespaceURI===Ue&&!an[Ut]||xe.namespaceURI===Ee&&!ra[Ut]?!1:!ya[Pe]&&(On[Pe]||!zt[Pe]):!!(jn==="application/xhtml+xml"&&mt[Z.namespaceURI]):!1},Da=function(Z){xl(e.removed,{element:Z});try{S(Z).removeChild(Z)}catch{k(Z)}},ja=function(Z,xe){try{xl(e.removed,{attribute:xe.getAttributeNode(Z),from:xe})}catch{xl(e.removed,{attribute:null,from:xe})}if(xe.removeAttribute(Z),Z==="is")if($e||Ye)try{Da(xe)}catch{}else try{xe.setAttribute(Z,"")}catch{}},Rr=function(Z){let xe=null,Pe=null;if(Be)Z="<remove></remove>"+Z;else{const oa=Ng(Z,/^[\r\n\t ]+/);Pe=oa&&oa[0]}jn==="application/xhtml+xml"&&It===ht&&(Z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Z+"</body></html>");const Ut=O?O.createHTML(Z):Z;if(It===ht)try{xe=new C().parseFromString(Ut,jn)}catch{}if(!xe||!xe.documentElement){xe=P.createDocument(It,"template",null);try{xe.documentElement.innerHTML=St?U:Ut}catch{}}const ca=xe.body||xe.documentElement;return Z&&Pe&&ca.insertBefore(a.createTextNode(Pe),ca.childNodes[0]||null),It===ht?Q.call(xe,Ht?"html":"body")[0]:Ht?xe.documentElement:ca},oe=function(Z){return K.call(Z.ownerDocument||Z,Z,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},Me=function(Z){return Z instanceof p&&(typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||!(Z.attributes instanceof E)||typeof Z.removeAttribute!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function")},_e=function(Z){return typeof m=="function"&&Z instanceof m};function Xe(Fe,Z,xe){vu(Fe,Pe=>{Pe.call(e,Z,xe,sa)})}const kt=function(Z){let xe=null;if(Xe(G.beforeSanitizeElements,Z,null),Me(Z))return Da(Z),!0;const Pe=Zt(Z.nodeName);if(Xe(G.uponSanitizeElement,Z,{tagName:Pe,allowedTags:X}),nt&&Z.hasChildNodes()&&!_e(Z.firstElementChild)&&mn(/<[/\w!]/g,Z.innerHTML)&&mn(/<[/\w!]/g,Z.textContent)||Z.nodeType===Ll.progressingInstruction||nt&&Z.nodeType===Ll.comment&&mn(/<[/\w]/g,Z.data))return Da(Z),!0;if(!(Te.tagCheck instanceof Function&&Te.tagCheck(Pe))&&(!X[Pe]||Re[Pe])){if(!Re[Pe]&&it(Pe)&&(we.tagNameCheck instanceof RegExp&&mn(we.tagNameCheck,Pe)||we.tagNameCheck instanceof Function&&we.tagNameCheck(Pe)))return!1;if(qt&&!B[Pe]){const Ut=S(Z)||Z.parentNode,ca=_(Z)||Z.childNodes;if(ca&&Ut){const oa=ca.length;for(let la=oa-1;la>=0;--la){const Ga=T(ca[la],!0);Ga.__removalCount=(Z.__removalCount||0)+1,Ut.insertBefore(Ga,R(Z))}}}return Da(Z),!0}return Z instanceof g&&!Wt(Z)||(Pe==="noscript"||Pe==="noembed"||Pe==="noframes")&&mn(/<\/no(script|embed|frames)/i,Z.innerHTML)?(Da(Z),!0):(We&&Z.nodeType===Ll.text&&(xe=Z.textContent,vu([q,W,ne],Ut=>{xe=Tl(xe,Ut," ")}),Z.textContent!==xe&&(xl(e.removed,{element:Z.cloneNode()}),Z.textContent=xe)),Xe(G.afterSanitizeElements,Z,null),!1)},vt=function(Z,xe,Pe){if(et&&(xe==="id"||xe==="name")&&(Pe in a||Pe in tr))return!1;if(!(Ne&&!De[xe]&&mn(me,xe))){if(!(He&&mn($,xe))){if(!(Te.attributeCheck instanceof Function&&Te.attributeCheck(xe,Z))){if(!ie[xe]||De[xe]){if(!(it(Z)&&(we.tagNameCheck instanceof RegExp&&mn(we.tagNameCheck,Z)||we.tagNameCheck instanceof Function&&we.tagNameCheck(Z))&&(we.attributeNameCheck instanceof RegExp&&mn(we.attributeNameCheck,xe)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(xe,Z))||xe==="is"&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&mn(we.tagNameCheck,Pe)||we.tagNameCheck instanceof Function&&we.tagNameCheck(Pe))))return!1}else if(!ae[xe]){if(!mn(j,Tl(Pe,ye,""))){if(!((xe==="src"||xe==="xlink:href"||xe==="href")&&Z!=="script"&&eR(Pe,"data:")===0&&N[Z])){if(!(Qe&&!mn(re,Tl(Pe,ye,"")))){if(Pe)return!1}}}}}}}return!0},it=function(Z){return Z!=="annotation-xml"&&Ng(Z,Ae)},st=function(Z){Xe(G.beforeSanitizeAttributes,Z,null);const{attributes:xe}=Z;if(!xe||Me(Z))return;const Pe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ie,forceKeepAttr:void 0};let Ut=xe.length;for(;Ut--;){const ca=xe[Ut],{name:oa,namespaceURI:la,value:Ga}=ca,va=Zt(oa),gr=Ga;let ea=oa==="value"?gr:tR(gr);if(Pe.attrName=va,Pe.attrValue=ea,Pe.keepAttr=!0,Pe.forceKeepAttr=void 0,Xe(G.uponSanitizeAttribute,Z,Pe),ea=Pe.attrValue,Et&&(va==="id"||va==="name")&&(ja(oa,Z),ea=Pt+ea),nt&&mn(/((--!?|])>)|<\/(style|title|textarea)/i,ea)){ja(oa,Z);continue}if(va==="attributename"&&Ng(ea,"href")){ja(oa,Z);continue}if(Pe.forceKeepAttr)continue;if(!Pe.keepAttr){ja(oa,Z);continue}if(!yt&&mn(/\/>/i,ea)){ja(oa,Z);continue}We&&vu([q,W,ne],Dr=>{ea=Tl(ea,Dr," ")});const xn=Zt(Z.nodeName);if(!vt(xn,va,ea)){ja(oa,Z);continue}if(O&&typeof I=="object"&&typeof I.getAttributeType=="function"&&!la)switch(I.getAttributeType(xn,va)){case"TrustedHTML":{ea=O.createHTML(ea);break}case"TrustedScriptURL":{ea=O.createScriptURL(ea);break}}if(ea!==gr)try{la?Z.setAttributeNS(la,oa,ea):Z.setAttribute(oa,ea),Me(Z)?Da(Z):LE(e.removed)}catch{ja(oa,Z)}}Xe(G.afterSanitizeAttributes,Z,null)},cn=function Fe(Z){let xe=null;const Pe=oe(Z);for(Xe(G.beforeSanitizeShadowDOM,Z,null);xe=Pe.nextNode();)Xe(G.uponSanitizeShadowNode,xe,null),kt(xe),st(xe),xe.content instanceof c&&Fe(xe.content);Xe(G.afterSanitizeShadowDOM,Z,null)};return e.sanitize=function(Fe){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xe=null,Pe=null,Ut=null,ca=null;if(St=!Fe,St&&(Fe="<!-->"),typeof Fe!="string"&&!_e(Fe))if(typeof Fe.toString=="function"){if(Fe=Fe.toString(),typeof Fe!="string")throw Sl("dirty is not a string, aborting")}else throw Sl("toString is not a function");if(!e.isSupported)return Fe;if(ve||Ra(Z),e.removed=[],typeof Fe=="string"&&(Qt=!1),Qt){if(Fe.nodeName){const Ga=Zt(Fe.nodeName);if(!X[Ga]||Re[Ga])throw Sl("root node is forbidden and cannot be sanitized in-place")}}else if(Fe instanceof m)xe=Rr("<!---->"),Pe=xe.ownerDocument.importNode(Fe,!0),Pe.nodeType===Ll.element&&Pe.nodeName==="BODY"||Pe.nodeName==="HTML"?xe=Pe:xe.appendChild(Pe);else{if(!$e&&!We&&!Ht&&Fe.indexOf("<")===-1)return O&&lt?O.createHTML(Fe):Fe;if(xe=Rr(Fe),!xe)return $e?null:lt?U:""}xe&&Be&&Da(xe.firstChild);const oa=oe(Qt?Fe:xe);for(;Ut=oa.nextNode();)kt(Ut),st(Ut),Ut.content instanceof c&&cn(Ut.content);if(Qt)return Fe;if($e){if(Ye)for(ca=H.call(xe.ownerDocument);xe.firstChild;)ca.appendChild(xe.firstChild);else ca=xe;return(ie.shadowroot||ie.shadowrootmode)&&(ca=V.call(i,ca,!0)),ca}let la=Ht?xe.outerHTML:xe.innerHTML;return Ht&&X["!doctype"]&&xe.ownerDocument&&xe.ownerDocument.doctype&&xe.ownerDocument.doctype.name&&mn(UI,xe.ownerDocument.doctype.name)&&(la="<!DOCTYPE "+xe.ownerDocument.doctype.name+`>
`+la),We&&vu([q,W,ne],Ga=>{la=Tl(la,Ga," ")}),O&&lt?O.createHTML(la):la},e.setConfig=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ra(Fe),ve=!0},e.clearConfig=function(){sa=null,ve=!1},e.isValidAttribute=function(Fe,Z,xe){sa||Ra({});const Pe=Zt(Fe),Ut=Zt(Z);return vt(Pe,Ut,xe)},e.addHook=function(Fe,Z){typeof Z=="function"&&xl(G[Fe],Z)},e.removeHook=function(Fe,Z){if(Z!==void 0){const xe=$L(G[Fe],Z);return xe===-1?void 0:ZL(G[Fe],xe,1)[0]}return LE(G[Fe])},e.removeHooks=function(Fe){G[Fe]=[]},e.removeAllHooks=function(){G=ME()},e}var AR=_I();const pR={ALLOWED_TAGS:["div","span","p","br","hr","h1","h2","h3","h4","h5","h6","ul","ol","li","table","thead","tbody","tfoot","tr","th","td","a","img","b","i","u","s","strike","strong","em","small","sub","sup","blockquote","pre","code","font","center"],ALLOWED_ATTR:["style","class","id","width","height","align","valign","bgcolor","color","border","cellpadding","cellspacing","colspan","rowspan","face","size","href","target","rel","src","alt","title"],ALLOW_DATA_ATTR:!1,ADD_ATTR:["target"],FORBID_TAGS:["script","object","embed","iframe","frame","frameset","form","input","button","textarea","select","option","link","meta","base","applet"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur","onchange","onsubmit","onreset","onkeydown","onkeyup","onkeypress","ondblclick","oncontextmenu","onmousedown","onmouseup","onmousemove","ondrag","ondrop"]};class yR{sanitizeHtmlForEmailViewing(e){if(!e||e.trim()==="")return e;try{return AR.sanitize(e,pR)}catch(a){return console.error(`Error in sanitizeHtmlForEmailViewing: ${a instanceof Error?a.message:String(a)}`),""}}sanitizeAndPrepareEmailHtml(e){if(!e||e.trim()==="")return e;const a=this.sanitizeHtmlForEmailViewing(e);return this.convertAnchorTagsToOpenInNewTab(a)}convertAnchorTagsToOpenInNewTab(e){try{const i=new DOMParser().parseFromString(e,"text/html"),s=i.querySelectorAll("a[href]");return s.length>0&&s.forEach(c=>{if((!c.hasAttribute("target")||c.getAttribute("target")!=="_blank")&&c.setAttribute("target","_blank"),!c.hasAttribute("rel"))c.setAttribute("rel","noopener noreferrer");else{const d=c.getAttribute("rel")??"",m=new Set(d.split(" ").filter(g=>g.trim()!==""));m.add("noopener"),m.add("noreferrer"),c.setAttribute("rel",Array.from(m).join(" "))}}),i.documentElement.outerHTML}catch(a){return console.error(`Error in convertAnchorTagsToOpenInNewTab: ${a instanceof Error?a.message:String(a)}`),e}}normalizeUsername(e){return e.toLowerCase().trim()}}const ER=new yR,Zl=(r=!1,e=300)=>{const[a,i]=w.useState(r),s=w.useRef(null),c=w.useRef(null),d=w.useCallback(m=>{if(m)i(!0),c.current=Date.now();else{const g=c.current?Date.now()-c.current:0,f=Math.max(0,e-g);f===0?i(!1):(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{i(!1)},f))}},[e]);return w.useEffect(()=>{r&&(i(!0),c.current=Date.now())},[r,i]),w.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]),[a,d]},bR=()=>{const{t:r}=tt(),{id:e}=od(),a=La(),i=Gt(),s=ur(),[c,d]=w.useState(null),[m,g]=w.useState(null),[f,E]=Zl(!0,150),[p,C]=w.useState(!1),[I,x]=w.useState(!1),{setIsInitialLoading:T}=pa(),{setHeaderButtons:k}=mr(),[R,_]=w.useState(!1);w.useEffect(()=>{Aa.isPopup()&&(window.history.replaceState({},"","popup.html#/emails"),window.history.pushState({},"",`popup.html#/emails/${e}`)),(async()=>{try{if(E(!0),d(null),!(i!=null&&i.sqliteClient)||!e)return;if(i.isOffline){d(r("emails.offlineMessage")),E(!1),T(!1);return}const K=await s.get(`Email/${e}`),H=i.sqliteClient.settings.getAllEncryptionKeys(),Q=await Mt.decryptEmail(K,H);g(Q)}catch(K){d(K instanceof Error?K.message:"An error occurred")}finally{E(!1),T(!1)}})()},[e,i==null?void 0:i.sqliteClient,i.isOffline,r,s,E,T]);const S=w.useCallback(async()=>{try{await s.delete(`Email/${e}`),Aa.isPopup()?window.close():a("/emails")}catch(P){d(P instanceof Error?P.message:"Failed to delete email")}},[e,s,a]),O=w.useCallback(()=>{Aa.openInNewPopup(`/emails/${e}`)},[e]),U=async P=>{try{const K=await s.downloadBlob(`Email/${e}/attachments/${P.id}`);if(!(i!=null&&i.sqliteClient)||!m){d("Database context or email not available");return}const H=i.sqliteClient.settings.getAllEncryptionKeys(),Q=await Mt.decryptAttachment(K,m,H);if(!Q){d("Failed to decrypt attachment");return}const V=new Blob([new Uint8Array(Q)],{type:P.mimeType??"application/octet-stream"}),G=window.URL.createObjectURL(V),q=document.createElement("a");q.href=G,q.download=P.filename,document.body.appendChild(q),q.click(),window.URL.revokeObjectURL(G),document.body.removeChild(q)}catch(K){console.error("handleDownloadAttachment error",K),d(K instanceof Error?K.message:"Failed to download attachment")}};return w.useEffect(()=>{if(!R){const P=l.jsxs("div",{className:"flex items-center gap-2",children:[!Aa.isPopup()&&l.jsx(Nn,{onClick:O,title:r("common.openInNewWindow"),iconType:Fa.EXPAND}),l.jsx(Nn,{onClick:()=>C(!0),title:r("emails.deleteEmailTitle"),iconType:Fa.DELETE,variant:"danger"})]});k(P),_(!0)}return()=>{}},[k,R,O,r]),w.useEffect(()=>()=>k(null),[k]),f?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx($n,{})}):c?l.jsxs("div",{className:"text-red-500",children:[r("common.error")," ",c]}):m?l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx(Xu,{isOpen:p,onClose:()=>C(!1),onConfirm:()=>{C(!1),S()},title:r("emails.deleteEmailTitle"),message:r("emails.deleteEmailConfirm"),confirmText:r("common.delete"),cancelText:r("common.cancel"),variant:"danger"}),l.jsxs("div",{children:[l.jsxs("div",{children:[l.jsx("div",{className:"flex justify-between items-start",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:m.subject}),l.jsx("button",{onClick:()=>x(!I),className:"p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:r(I?"common.hideDetails":"common.showDetails"),children:l.jsx("svg",{className:`w-4 h-4 text-gray-500 dark:text-gray-400 transition-transform ${I?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})]})}),I&&l.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-gray-400 mt-2",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-bold",children:r("emails.from")})," ",l.jsx("span",{title:m.fromLocal+"@"+m.fromDomain,children:m.fromDisplay})]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-bold",children:r("emails.to")})," ",l.jsxs("span",{title:m.toLocal+"@"+m.toDomain,children:[m.toLocal,"@",m.toDomain]})]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-bold",children:r("emails.date")})," ",new Date(m.dateSystem).toLocaleString()]})]})]}),l.jsx("div",{className:"bg-white mt-4",children:m.messageHtml?l.jsx("iframe",{srcDoc:ER.sanitizeAndPrepareEmailHtml(m.messageHtml),className:"w-full min-h-[500px] border-0",title:r("emails.emailContent"),sandbox:"allow-popups allow-popups-to-escape-sandbox"}):l.jsx("pre",{className:"whitespace-pre-wrap text-gray-800 p-3",children:m.messagePlain})}),m.attachments&&m.attachments.length>0&&l.jsxs("div",{className:"p-6 border-t border-gray-200 dark:border-gray-700",children:[l.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:r("common.attachments")}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4",children:m.attachments.map(P=>l.jsxs("button",{onClick:()=>U(P),className:"flex items-center space-x-2 text-sm text-gray-600 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 text-left",children:[l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})}),l.jsxs("span",{children:[P.filename," (",Math.ceil(P.filesize/1024)," KB)"]})]},P.id))})]})]})]}):l.jsx("div",{className:"text-gray-500",children:r("emails.emailNotFound")})},oh=({onClick:r})=>l.jsxs("div",{className:"px-2 items-center",children:[l.jsxs("div",{className:"relative inline-flex items-center",children:[l.jsx("button",{id:"reload-vault",onClick:r,className:"absolute p-2 hover:bg-gray-200 rounded-2xl",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})})}),l.jsxs("svg",{"aria-hidden":"true",className:"inline w-8 h-8 text-gray-200 dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})]}),l.jsx("span",{className:"sr-only",children:"Loading..."})]}),IR=()=>{const{t:r}=tt(),e=Gt(),a=ur(),{setHeaderButtons:i}=mr(),[s,c]=w.useState(null),[d,m]=w.useState([]),{setIsInitialLoading:g}=pa(),[f,E]=Zl(!0,100),p=w.useCallback(async()=>{try{if(E(!0),c(null),!(e!=null&&e.sqliteClient))return;if(e.isOffline){E(!1),g(!1);return}const I=e.sqliteClient.items.getAllEmailAddresses();try{const x=await a.post("EmailBox/bulk",{addresses:I,page:1,pageSize:50}),T=e.sqliteClient.settings.getAllEncryptionKeys(),k=await Mt.decryptEmailList(x.mails,T);m(k)}catch(x){throw console.error(x),new Error(r("common.errors.unknownError"))}}catch(I){c(I instanceof Error?I.message:r("common.errors.unknownError"))}finally{E(!1),g(!1)}},[e==null?void 0:e.sqliteClient,e.isOffline,a,E,g,r]);w.useEffect(()=>{p()},[p]),w.useEffect(()=>{const I=Aa.isPopup()?null:l.jsx(Nn,{onClick:()=>Aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Fa.EXPAND});return i(I),()=>{i(null)}},[i,r]);const C=I=>{const x=new Date,T=new Date(I),k=Math.floor((x.getTime()-T.getTime())/1e3);if(k<60)return r("emails.dateFormat.justNow");if(k<3600){const R=Math.floor(k/60);return R===1?r("emails.dateFormat.minutesAgo_single",{count:R}):r("emails.dateFormat.minutesAgo_plural",{count:R})}else if(k<86400){const R=Math.floor(k/3600);return R===1?r("emails.dateFormat.hoursAgo_single",{count:R}):r("emails.dateFormat.hoursAgo_plural",{count:R})}else return k<172800?r("emails.dateFormat.yesterday"):T.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit"})};return f?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx($n,{})}):s?l.jsxs("div",{className:"text-red-500",children:[r("common.error"),": ",s]}):e.isOffline?l.jsxs("div",{children:[l.jsx("div",{className:"flex justify-between items-center mb-4",children:l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:r("emails.title")})}),l.jsx("div",{className:"text-gray-500 dark:text-gray-400 space-y-2",children:l.jsx("p",{className:"text-sm",children:r("emails.offlineMessage")})})]}):d.length===0?l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:r("emails.title")}),l.jsx(oh,{onClick:p})]}),l.jsx("div",{className:"text-gray-500 dark:text-gray-400 space-y-2",children:l.jsx("p",{className:"text-sm",children:r("emails.noEmailsDescription")})})]}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:r("emails.title")}),l.jsx(oh,{onClick:p})]}),l.jsx("div",{className:"space-y-2",children:d.map(I=>l.jsxs(cd,{to:`/emails/${I.id}`,className:"block p-4 bg-white dark:bg-gray-800 rounded-lg shadow hover:shadow-md transition-shadow border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",children:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsx("div",{className:"text-gray-900 dark:text-white mb-1 font-bold",children:I.subject}),l.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:C(I.dateSystem)})]}),l.jsx("div",{className:"text-gray-600 text-sm dark:text-gray-300 line-clamp-2",children:I.messagePreview})]},I.id))})]})},vR=()=>{const{isFullyInitialized:r}=f2();return r?l.jsx(aN,{to:"/reinitialize",replace:!0}):null},wR=()=>l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),CR=()=>l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),NR=()=>l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})}),$u=()=>l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),xR=r=>{switch(r){case dt.Notes:return l.jsx(wR,{});default:return l.jsx($u,{})}},TR=r=>{switch(r){case"2fa":return l.jsx(CR,{});case"attachments":return l.jsx(NR,{});default:return l.jsx($u,{})}},SR=({optionalSystemFields:r,visibleFieldKeys:e,optionalSections:a,callbacks:i})=>{const{t:s}=tt(),[c,d]=w.useState(!1),[m,g]=w.useState(!1),[f,E]=w.useState(""),[p,C]=w.useState("Text"),I=w.useCallback(()=>{g(!0),d(!1)},[]),x=w.useCallback(()=>{f.trim()&&(i.onAddCustomField(f,p),E(""),C("Text"),g(!1))},[f,p,i]),T=w.useCallback(()=>{E(""),C("Text"),g(!1)},[]),k=w.useCallback(S=>{i.onAddSystemField(S),d(!1)},[i]),R=w.useCallback(S=>{S(),d(!1)},[]),_=w.useMemo(()=>{const S=[];return r.forEach(O=>{e.has(O.FieldKey)||S.push({key:O.FieldKey,label:s(`fieldLabels.${O.FieldKey}`,{defaultValue:O.FieldKey}),icon:xR(O.Category),action:()=>k(O.FieldKey)})}),a.forEach(O=>{O.isVisible||S.push({key:O.key,label:s(`common.${O.key==="2fa"?"twoFactorAuthentication":O.key}`),icon:TR(O.key),action:()=>R(O.onAdd)})}),S},[r,e,a,s,k,R]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",id:"add-field-menu",onClick:()=>d(!c),className:"w-full px-4 py-2 border-2 border-dashed border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-400 rounded-md hover:border-primary-500 hover:text-primary-600 dark:hover:text-primary-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors flex items-center justify-center gap-2",children:l.jsx($u,{})}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50",onClick:()=>d(!1)}),l.jsxs("div",{className:"absolute bottom-full left-0 right-0 mb-1 z-20 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg overflow-hidden",children:[_.map(S=>l.jsxs("button",{type:"button",onClick:S.action,className:"w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 border-b border-gray-100 dark:border-gray-700 last:border-b-0 text-gray-700 dark:text-gray-300",children:[l.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:S.icon}),l.jsx("span",{children:S.label})]},S.key)),l.jsxs("button",{type:"button",onClick:I,className:"w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 border-b border-gray-100 dark:border-gray-700 last:border-b-0 text-gray-700 dark:text-gray-300",children:[l.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:l.jsx($u,{})}),l.jsx("span",{children:s("itemTypes.addCustomField")})]})]})]})]}),l.jsx(Zn,{isOpen:m,onClose:T,title:s("itemTypes.addCustomField"),footer:l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{type:"button",onClick:x,disabled:!f.trim(),className:"flex-1 px-4 py-2 bg-primary-600 text-white rounded-md hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:s("common.add")}),l.jsx("button",{type:"button",onClick:T,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:s("common.cancel")})]}),children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s("itemTypes.fieldLabel")}),l.jsx("input",{type:"text",value:f,onChange:S=>E(S.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white",placeholder:s("itemTypes.enterFieldName"),autoFocus:!0})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s("itemTypes.fieldType")}),l.jsxs("select",{value:p,onChange:S=>C(S.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white",children:[l.jsx("option",{value:"Text",children:s("itemTypes.fieldTypes.text")}),l.jsx("option",{value:"Hidden",children:s("itemTypes.fieldTypes.hidden")}),l.jsx("option",{value:"Email",children:s("itemTypes.fieldTypes.email")}),l.jsx("option",{value:"URL",children:s("itemTypes.fieldTypes.url")}),l.jsx("option",{value:"Phone",children:s("itemTypes.fieldTypes.phone")}),l.jsx("option",{value:"Number",children:s("itemTypes.fieldTypes.number")}),l.jsx("option",{value:"Date",children:s("itemTypes.fieldTypes.date")}),l.jsx("option",{value:"TextArea",children:s("itemTypes.fieldTypes.textArea")})]})]})]})})]})},kR=({htmlFor:r,label:e,onLabelChange:a,onDelete:i})=>{const[s,c]=w.useState(!1),[d,m]=w.useState(e),g=()=>{d.trim()&&(a(d.trim()),c(!1))},f=()=>{m(e),c(!1)},E=p=>{p.key==="Enter"?g():p.key==="Escape"&&f()};return s?l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("input",{type:"text",value:d,onChange:p=>m(p.target.value),onKeyDown:E,onBlur:g,className:"flex-1 px-2 py-1 text-sm font-medium text-gray-700 dark:text-gray-300 border border-primary-500 rounded focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:border-primary-400",placeholder:"Field label",autoFocus:!0}),l.jsx("button",{type:"button",onClick:g,className:"text-green-600 dark:text-green-400 hover:text-green-700 dark:hover:text-green-300 text-xs px-2 py-1",children:"✓"}),l.jsx("button",{type:"button",onClick:f,className:"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 text-xs px-2 py-1",children:"✕"})]}):l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("label",{htmlFor:r,className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:e}),l.jsx("button",{type:"button",onClick:()=>c(!0),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-xs",title:"Edit label",children:l.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),i&&l.jsx("button",{type:"button",onClick:i,className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 text-xs",title:"Delete field",children:l.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})},LR=({id:r,value:e,onChange:a,error:i,required:s=!1,onRemove:c,onGenerateAlias:d,isEmailMode:m,onEmailModeChange:g})=>{const{t:f}=tt(),E=Gt(),p=m!==void 0,[C,I]=w.useState(!0),x=p?m:C,T=w.useCallback(Ae=>{const j=typeof Ae=="function"?Ae(x):Ae;p&&g?g(j):I(j)},[p,g,x]),[k,R]=w.useState(""),[_,S]=w.useState(""),[O,U]=w.useState(!1),[P,K]=w.useState([]),[H,Q]=w.useState([]),[V,G]=w.useState([]),q=w.useRef(null),W=w.useRef(!1);w.useEffect(()=>{(async()=>{const j=await E.getVaultMetadata();K((j==null?void 0:j.publicEmailDomains)??[]),Q((j==null?void 0:j.privateEmailDomains)??[]),G((j==null?void 0:j.hiddenPrivateEmailDomains)??[])})()},[E]);const ne=w.useMemo(()=>H.length>0&&!(H.length===1&&(H[0]==="DISABLED.TLD"||H[0]==="")),[H]);w.useEffect(()=>{if(!e){R(""),_||(ne&&H[0]?S(H[0]):P[0]&&S(P[0]));return}if(e.includes("@")){const[Ae,j]=e.split("@");if(R(Ae),S(j),!W.current){const X=P.includes(j)||H.includes(j)||V.includes(j);p&&g?g(!X):p||T(!X)}}else R(e),!_&&!e.includes("@")&&(ne&&H[0]?S(H[0]):P[0]&&S(P[0]))},[e,P,H,V,ne,p,g,_,T]),w.useEffect(()=>{if(W.current||!e||!e.includes("@"))return;const Ae=e.split("@")[1];if(!Ae)return;const j=P.includes(Ae)||H.includes(Ae)||V.includes(Ae);p&&g?g(!j):p||j&&x&&T(!1)},[P,H,V,e,x,p,g,T]),w.useEffect(()=>{if(!x&&e&&!e.includes("@")&&e.trim()){const Ae=ne&&H[0]?H[0]:P[0],j=_||Ae;j&&(!_&&Ae&&S(Ae),a(`${e}@${j}`))}},[e,x,_,ne,H,P,a]);const me=w.useCallback(Ae=>{const j=Ae.target.value;if(W.current=!1,x){a(j);return}if(j.includes("@")){T(!0),a(j);return}if(R(j),!j||j.trim()==="")a("");else{const X=_||(ne&&H[0]?H[0]:P[0]||"");X?(a(`${j}@${X}`),_||S(X)):a(j)}},[x,_,a,T,ne,H,P]),$=w.useCallback(Ae=>{S(Ae);const j=k.includes("@")?k.split("@")[0]:k;!j||j.trim()===""?a(""):a(`${j}@${Ae}`),T(!1),U(!1)},[k,a,T]),re=w.useCallback(()=>{W.current=!0;const Ae=!x;if(T(Ae),Ae)a(""),R("");else{const j=ne&&H[0]?H[0]:P[0];S(j),R(""),a("")}},[x,ne,P,H,a,T]);w.useEffect(()=>{const Ae=j=>{q.current&&!q.current.contains(j.target)&&U(!1)};if(O)return document.addEventListener("mousedown",Ae),()=>{document.removeEventListener("mousedown",Ae)}},[O]);const ye=w.useCallback(()=>{W.current=!0,T(!1);const Ae=ne&&H[0]?H[0]:P[0];Ae&&S(Ae),R(""),a(""),d&&d()},[d,T,ne,H,P,a]);return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex items-center",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{type:"button",onClick:x?void 0:re,className:`text-sm font-medium transition-colors ${x?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 cursor-pointer"}`,children:f("common.email")}),l.jsx("span",{className:"mx-2 text-gray-400 dark:text-gray-500",children:"/"}),l.jsx("button",{type:"button",onClick:x?ye:void 0,className:`text-sm font-medium transition-colors ${x?"text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 cursor-pointer":"text-primary-600 dark:text-primary-400"}`,children:f("common.alias")}),s&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}),c&&l.jsx("button",{type:"button",onClick:c,className:"w-5 h-5 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors",title:f("common.delete"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),l.jsxs("div",{className:"relative w-full",children:[l.jsxs("div",{className:"flex w-full",children:[l.jsx("input",{type:"text",id:r,className:`flex-1 min-w-0 px-3 py-2 border text-sm ${i?"border-red-500":"border-gray-300 dark:border-gray-600"} ${x?"rounded-md":"rounded-l-md"} focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white`,value:x?e:k,onChange:me}),!x&&l.jsxs("button",{type:"button",onClick:()=>U(!O),className:`inline-flex items-center px-2 py-2 border border-l-0 border-gray-300 dark:border-gray-600 ${d?"":"rounded-r-md"} bg-gray-50 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-500 cursor-pointer text-sm truncate max-w-[120px]`,children:[l.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"@"}),l.jsx("span",{className:"truncate ml-0.5",children:_})]}),!x&&d&&l.jsx("button",{type:"button",onClick:d,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:f("common.generate"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]}),O&&!x&&l.jsx("div",{ref:q,className:"absolute z-50 mt-2 w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 max-h-96 overflow-y-auto",children:l.jsxs("div",{className:"p-4",children:[ne&&l.jsxs("div",{className:"mb-4",children:[l.jsxs("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:[f("items.privateEmailTitle")," ",l.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",f("items.privateEmailAliasVaultServer"),")"]})]}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:f("items.privateEmailDescription")}),l.jsx("div",{className:"flex flex-wrap gap-2",children:H.filter(Ae=>!V.includes(Ae)).map(Ae=>l.jsx("button",{type:"button",onClick:()=>$(Ae),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${_===Ae?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 border border-gray-300 dark:border-gray-600"}`,children:Ae},Ae))})]}),l.jsxs("div",{className:ne?"border-t border-gray-200 dark:border-gray-600 pt-4":"",children:[l.jsx("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:f("items.publicEmailTitle")}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:f("items.publicEmailDescription")}),l.jsx("div",{className:"flex flex-wrap gap-2",children:P.map(Ae=>l.jsx("button",{type:"button",onClick:()=>$(Ae),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${_===Ae?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 border border-gray-300 dark:border-gray-600"}`,children:Ae},Ae))})]})]})})]}),i&&l.jsx("p",{className:"text-sm text-red-500 mt-1",children:i})]})},RR=({name:r})=>{switch(r){case"visibility":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]});case"visibility-off":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),l.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]});case"refresh":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M23 4v6h-6"}),l.jsx("path",{d:"M1 20v-6h6"}),l.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]});case"settings":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l.jsx("path",{d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});default:return null}},fd=w.forwardRef(({id:r,label:e,value:a,onChange:i,type:s="text",placeholder:c,required:d=!1,multiline:m=!1,rows:g=1,error:f,buttons:E=[],showPassword:p,onShowPasswordChange:C},I)=>{const{t:x}=tt(),[T,k]=id.useState(!1),R=p!==void 0?p:T,_=U=>{p!==void 0?C==null||C(U):k(U)},S=`mt-1 block text-sm w-full rounded-md ${f?"border-red-500":"border-gray-300 dark:border-gray-600"} text-gray-900 sm:text-sm rounded-lg shadow-sm border focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:placeholder-gray-400 py-2 px-3`,O=s==="password"?[...E,{icon:R?"visibility-off":"visibility",onClick:()=>_(!R),title:x(R?"common.hidePassword":"common.showPassword")}]:E;return l.jsxs("div",{children:[l.jsxs("label",{htmlFor:r,className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:[e,d&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),l.jsxs("div",{className:"relative",children:[m?l.jsx("textarea",{id:r,value:a,onChange:U=>i(U.target.value),rows:g,placeholder:c,className:S}):l.jsx("input",{ref:I,type:s==="password"&&!R?"password":"text",id:r,value:a,onChange:U=>i(U.target.value),placeholder:c,className:S}),O.length>0&&l.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2",children:O.map((U,P)=>l.jsx("button",{type:"button",onClick:U.onClick,title:U.title,className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx(RR,{name:U.icon})})},P))})]}),f&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:f})]})});fd.displayName="FormInput";const Cu=({title:r,children:e,actions:a})=>l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[r&&l.jsxs("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white flex items-center justify-between",children:[typeof r=="string"?l.jsx("span",{children:r}):r,a&&l.jsx("div",{className:"flex items-center gap-2",children:a})]}),l.jsx("div",{className:"space-y-4",children:e})]}),DR=({id:r,label:e,value:a,onChange:i,placeholder:s,error:c,showValue:d,onShowValueChange:m})=>{const{t:g}=tt(),[f,E]=w.useState(!1),p=d!==void 0?d:f,C=w.useCallback(x=>{d!==void 0?m==null||m(x):E(x)},[d,m]),I=w.useCallback(()=>{C(!p)},[p,C]);return l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-gray-900 dark:text-white",children:e}),l.jsxs("div",{className:"flex",children:[l.jsx("div",{className:"relative flex-grow",children:l.jsx("input",{type:p?"text":"password",id:r,value:a,onChange:x=>i(x.target.value),placeholder:s,className:"outline-0 text-sm shadow-sm border border-gray-300 bg-gray-50 text-gray-900 sm:text-sm rounded-l-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white"})}),l.jsx("div",{className:"flex",children:l.jsx("button",{type:"button",onClick:I,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:g(p?"common.hidePassword":"common.showPassword"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p?l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}):l.jsxs(l.Fragment,{children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})})})]}),c&&l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c})]})};var BR=class{constructor(r){this.lowercaseChars="abcdefghijklmnopqrstuvwxyz",this.uppercaseChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.numberChars="0123456789",this.specialChars="!@#$%^&*()_+-=[]{}|;:,.<>?",this.ambiguousChars="Il1O0oZzSsBbGg2568|[]{}()<>;:,.`'\"_-",this.length=18,this.useLowercase=!0,this.useUppercase=!0,this.useNumbers=!0,this.useSpecial=!0,this.useNonAmbiguous=!1,r&&this.applySettings(r)}applySettings(r){return this.length=r.Length,this.useLowercase=r.UseLowercase,this.useUppercase=r.UseUppercase,this.useNumbers=r.UseNumbers,this.useSpecial=r.UseSpecialChars,this.useNonAmbiguous=r.UseNonAmbiguousChars,this}setLength(r){return this.length=r,this}useLowercaseLetters(r){return this.useLowercase=r,this}useUppercaseLetters(r){return this.useUppercase=r,this}useNumericCharacters(r){return this.useNumbers=r,this}useSpecialCharacters(r){return this.useSpecial=r,this}useNonAmbiguousCharacters(r){return this.useNonAmbiguous=r,this}getUnbiasedRandomIndex(r){const e=Math.floor(4294967296/r)*r;for(;;){const a=new Uint32Array(1);crypto.getRandomValues(a);const i=a[0];if(i<e)return i%r}}generateRandomPassword(){const r=this.buildCharacterSet();let e=this.generateInitialPassword(r);return e=this.ensureRequirements(e),e}buildCharacterSet(){let r="";return this.useLowercase&&(r+=this.lowercaseChars),this.useUppercase&&(r+=this.uppercaseChars),this.useNumbers&&(r+=this.numberChars),this.useSpecial&&(r+=this.specialChars),r.length===0&&(r=this.lowercaseChars),this.useNonAmbiguous&&(r=this.removeAmbiguousCharacters(r)),r}removeAmbiguousCharacters(r){for(const e of this.ambiguousChars)r=r.replace(e,"");return r}generateInitialPassword(r){let e="";for(let a=0;a<this.length;a++)e+=r[this.getUnbiasedRandomIndex(r.length)];return e}ensureRequirements(r){return this.useLowercase&&!/[a-z]/.exec(r)&&(r=this.addCharacterFromSet(r,this.getSafeCharacterSet(this.lowercaseChars))),this.useUppercase&&!/[A-Z]/.exec(r)&&(r=this.addCharacterFromSet(r,this.getSafeCharacterSet(this.uppercaseChars))),this.useNumbers&&!/\d/.exec(r)&&(r=this.addCharacterFromSet(r,this.getSafeCharacterSet(this.numberChars))),this.useSpecial&&!/[!@#$%^&*()_+\-=[\]{}|;:,.<>?]/.exec(r)&&(r=this.addCharacterFromSet(r,this.getSafeCharacterSet(this.specialChars))),r}getSafeCharacterSet(r){return this.useNonAmbiguous?this.removeAmbiguousCharacters(r):r}addCharacterFromSet(r,e){const a=this.getUnbiasedRandomIndex(this.length),i=e[this.getUnbiasedRandomIndex(e.length)];return r.substring(0,a)+i+r.substring(a+1)}},_h=r=>new BR(r);const UR=({isOpen:r,onClose:e,onSave:a,onSettingsChange:i,initialSettings:s})=>{const{t:c}=tt(),[d,m]=w.useState(s),[g,f]=w.useState(""),E=w.useCallback(x=>{try{const k=_h(x).generateRandomPassword();f(k)}catch(T){console.error("Error generating preview password:",T),f("")}},[]);w.useEffect(()=>{r&&(m({...s}),E({...s}))},[r,s,E]);const p=w.useCallback((x,T)=>{const k={...d,[x]:T};m(k),E(k),i==null||i(k)},[d,E,i]),C=w.useCallback(()=>{E(d)},[d,E]),I=w.useCallback(()=>{a(g),e()},[g,a,e]);return l.jsx(Zn,{isOpen:r,onClose:e,title:c("items.changePasswordComplexity"),maxWidth:"max-w-lg",footer:l.jsx("div",{className:"flex justify-end",children:l.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-md bg-gray-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-500",onClick:I,children:[l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 13l-3 3m0 0l-3-3m3 3V8m0 13a9 9 0 110-18 9 9 0 010 18z"})}),c("common.use")]})}),children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:g,readOnly:!0,className:"flex-1 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white font-mono"}),l.jsx("button",{type:"button",onClick:C,className:"px-3 py-2 text-sm text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:c("common.generate"),children:l.jsx("svg",{className:"w-4 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx("button",{type:"button",onClick:()=>p("UseLowercase",!d.UseLowercase),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${d.UseLowercase?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:c("items.includeLowercase"),children:l.jsx("span",{className:"font-mono text-base",children:"a-z"})}),l.jsx("button",{type:"button",onClick:()=>p("UseUppercase",!d.UseUppercase),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${d.UseUppercase?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:c("items.includeUppercase"),children:l.jsx("span",{className:"font-mono text-base",children:"A-Z"})}),l.jsx("button",{type:"button",onClick:()=>p("UseNumbers",!d.UseNumbers),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${d.UseNumbers?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:c("items.includeNumbers"),children:l.jsx("span",{className:"font-mono text-base",children:"0-9"})}),l.jsx("button",{type:"button",onClick:()=>p("UseSpecialChars",!d.UseSpecialChars),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${d.UseSpecialChars?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:c("items.includeSpecialChars"),children:l.jsx("span",{className:"font-mono text-base",children:"!@#"})})]}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("input",{id:"use-non-ambiguous",type:"checkbox",checked:d.UseNonAmbiguousChars,onChange:x=>p("UseNonAmbiguousChars",x.target.checked),className:"h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded dark:bg-gray-700 dark:border-gray-600"}),l.jsx("label",{htmlFor:"use-non-ambiguous",className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:c("items.avoidAmbiguousChars")})]})]})]})})},_R=({id:r,label:e,value:a,onChange:i,placeholder:s,error:c,showPassword:d,onShowPasswordChange:m,initialSettings:g,onSettingsChange:f})=>{const{t:E}=tt(),p=Gt(),[C,I]=w.useState(!1),[x,T]=w.useState(!1),[k,R]=w.useState(null),[_,S]=w.useState(!1),O=d!==void 0?d:C,U=w.useCallback(W=>{d!==void 0?m==null||m(W):I(W)},[d,m]);w.useEffect(()=>{(async()=>{try{if(p.sqliteClient){if(g!==void 0)R(g);else{const ne=p.sqliteClient.settings.getPasswordSettings();R(ne)}S(!0)}}catch(ne){console.error("Error loading password settings:",ne)}})()},[p.sqliteClient,g]);const P=w.useCallback(W=>{try{const me=_h(W).generateRandomPassword();i(me),U(!0)}catch(ne){console.error("Error generating password:",ne)}},[i,U]),K=w.useCallback(W=>{if(!k)return;const ne=parseInt(W.target.value,10),me={...k,Length:ne};R(me),f==null||f(me),P(me)},[k,P,f]),H=w.useCallback(()=>{k&&P(k)},[P,k]),Q=w.useCallback(W=>{i(W),U(!0)},[i,U]),V=w.useCallback(W=>{R(W),f==null||f(W)},[f]),G=w.useCallback(()=>{U(!O)},[O,U]),q=w.useCallback(()=>{T(!0)},[]);return!k||!_?l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-gray-900 dark:text-white",children:e}),l.jsx("div",{className:"animate-pulse bg-gray-200 dark:bg-gray-700 h-10 rounded-lg"})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-gray-900 dark:text-white",children:e}),l.jsxs("div",{className:"flex",children:[l.jsx("div",{className:"relative flex-grow",children:l.jsx("input",{type:O?"text":"password",id:r,value:a,onChange:W=>i(W.target.value),placeholder:s,className:"outline-0 text-sm shadow-sm border border-gray-300 bg-gray-50 text-gray-900 sm:text-sm rounded-l-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white"})}),l.jsxs("div",{className:"flex",children:[l.jsx("button",{type:"button",onClick:G,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:E(O?"common.hidePassword":"common.showPassword"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:O?l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}):l.jsxs(l.Fragment,{children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})}),l.jsx("button",{type:"button",onClick:H,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:E("common.generate"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),l.jsxs("div",{className:"pt-2",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{htmlFor:`${r}-length`,className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:E("items.passwordLength")}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:k.Length}),l.jsx("button",{type:"button",onClick:q,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",title:E("items.changePasswordComplexity"),children:l.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]})]}),l.jsx("input",{type:"range",id:`${r}-length`,min:"8",max:"64",value:k.Length,onChange:K,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]}),c&&l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c}),l.jsx(UR,{isOpen:x,onClose:()=>T(!1),onSave:Q,onSettingsChange:V,initialSettings:k})]})},MR=({id:r,label:e,value:a,onChange:i,placeholder:s,error:c,onRegenerate:d})=>{const{t:m}=tt(),g=w.useCallback(E=>{i(E.target.value)},[i]),f=w.useCallback(()=>{d()},[d]);return l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-gray-900 dark:text-white",children:e}),l.jsxs("div",{className:"flex",children:[l.jsx("div",{className:"relative flex-grow",children:l.jsx("input",{type:"text",id:r,value:a,onChange:g,placeholder:s,className:"outline-0 text-sm shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-l-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white"})}),l.jsx("div",{className:"flex",children:l.jsx("button",{type:"button",onClick:f,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:m("common.generate"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})})]}),c&&l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c})]})},FR=({attachments:r,onAttachmentsChange:e,itemId:a})=>{const{t:i}=tt(),[s,c]=w.useState(""),d=!Aa.isPopup(),m=async E=>{const p=E.target.files;if(!(!p||p.length===0)){c(i("attachmentUploader.uploading"));try{const C=[...r];for(const I of Array.from(p)){const x=await I.arrayBuffer(),T=new Uint8Array(x),k={Id:crypto.randomUUID().toUpperCase(),Filename:I.name,Blob:T,ItemId:"",CreatedAt:new Date().toISOString(),UpdatedAt:new Date().toISOString(),IsDeleted:!1};C.push(k)}e(C),c(i("attachmentUploader.uploadSuccess")),setTimeout(()=>c(""),3e3)}catch(C){console.error("Error uploading files:",C),c(i("common.errors.unknownErrorTryAgain")),setTimeout(()=>c(""),3e3)}E.target.value=""}},g=E=>{try{const p=[...r],C=p.findIndex(I=>I.Id===E.Id);C!==-1&&p.splice(C,1),e(p),c(i("attachmentUploader.deleteSuccess")),setTimeout(()=>c(""),3e3)}catch(p){console.error("Error deleting attachment:",p),c(i("common.errors.unknownErrorTryAgain")),setTimeout(()=>c(""),3e3)}},f=r.filter(E=>!E.IsDeleted);return l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[l.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:i("common.attachments")}),l.jsxs("div",{className:"space-y-4",children:[d?l.jsx("div",{className:"border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4 text-center",children:l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("p",{className:"mb-3",children:i("attachmentUploader.firefoxExpandRequired")}),l.jsx("button",{type:"button",onClick:()=>{const E=a?`/items/${a}`:"/items";Aa.openInNewPopup(void 0,E)},className:"inline-flex items-center px-3 py-1.5 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-md transition-colors",children:i("attachmentUploader.openExpandedWindow")})]})}):l.jsx("div",{children:l.jsx("input",{type:"file",multiple:!0,onChange:m,className:"block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"})}),s&&l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:s}),f.length>0&&l.jsx("div",{children:l.jsx("div",{className:"space-y-2",children:f.map(E=>l.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded border border-gray-200 dark:border-gray-600",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:E.Filename}),l.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(E.CreatedAt).toLocaleDateString()})]}),l.jsx("button",{type:"button",onClick:()=>g(E),className:"text-red-500 hover:text-red-700 focus:outline-none","aria-label":`Delete ${E.Filename}`,children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]},E.Id))})})]})]})},lh=({className:r="w-5 h-5"})=>l.jsx("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"})}),OR=({itemId:r})=>{const{t:e}=tt(),a=Gt(),[i,s]=w.useState([]),[c,d]=w.useState(!0);return w.useEffect(()=>{if(!(a!=null&&a.sqliteClient)||!r){d(!1);return}try{const m=a.sqliteClient.passkeys.getByItemId(r);s(m)}catch(m){console.error("Error loading passkeys:",m)}finally{d(!1)}},[a==null?void 0:a.sqliteClient,r]),c?l.jsx("div",{className:"flex justify-center p-2",children:l.jsx($n,{})}):i.length===0?null:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:e("passkeys.passkey")}),i.map(m=>l.jsx("div",{className:"p-3 rounded bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(lh,{className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"mb-1",children:l.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:m.DisplayName||e("passkeys.passkey")})}),l.jsx("div",{className:"space-y-1 mb-2",children:m.RpId&&l.jsxs("div",{children:[l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e("passkeys.site"),":"," "]}),l.jsx("span",{className:"text-sm text-gray-900 dark:text-white",children:m.RpId})]})}),l.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:e("passkeys.helpText")})]})]})},m.Id))]})},jR=({itemId:r,passkeyIdsMarkedForDeletion:e,onPasskeyMarkedForDeletion:a})=>{const{t:i}=tt(),s=Gt(),[c,d]=w.useState([]),[m,g]=w.useState(!0);w.useEffect(()=>{if(!(s!=null&&s.sqliteClient)||!r){g(!1);return}try{const p=s.sqliteClient.passkeys.getByItemId(r);d(p)}catch(p){console.error("Error loading passkeys:",p)}finally{g(!1)}},[s==null?void 0:s.sqliteClient,r]);const f=p=>{e.includes(p)||a([...e,p])},E=p=>{a(e.filter(C=>C!==p))};return m?l.jsx("div",{className:"flex justify-center p-2",children:l.jsx($n,{})}):c.length===0?null:l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[l.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:i("passkeys.passkey")}),l.jsx("div",{className:"space-y-3",children:c.map(p=>e.includes(p.Id)?l.jsx("div",{className:"p-3 rounded bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(lh,{className:"w-5 h-5 text-red-600 dark:text-red-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-red-900 dark:text-red-100",children:i("passkeys.passkeyMarkedForDeletion")}),l.jsx("button",{type:"button",onClick:()=>E(p.Id),className:"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:i("common.undo"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M3 7v6h6"}),l.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"})]})})]}),l.jsx("p",{className:"text-xs text-red-800 dark:text-red-200",children:i("passkeys.passkeyWillBeDeleted")})]})]})},p.Id):l.jsx("div",{className:"p-3 rounded bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(lh,{className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:p.DisplayName||i("passkeys.passkey")}),l.jsx("button",{type:"button",onClick:()=>f(p.Id),className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300",title:i("common.delete"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("polyline",{points:"3 6 5 6 21 6"}),l.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),l.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),l.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})})]}),l.jsx("div",{className:"space-y-1 mb-2",children:p.RpId&&l.jsxs("div",{children:[l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[i("passkeys.site"),":"," "]}),l.jsx("span",{className:"text-sm text-gray-900 dark:text-white",children:p.RpId})]})}),l.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:i("passkeys.helpText")})]})]})},p.Id))})]})};//! otpauth 9.4.0 | (c) Héctor Molinero Fernández | MIT | https://github.com/hectorm/otpauth
//! noble-hashes 1.7.1 | (c) Paul Miller | MIT | https://github.com/paulmillr/noble-hashes
const PR=r=>{const e=new ArrayBuffer(8),a=new Uint8Array(e);let i=r;for(let s=7;s>=0&&i!==0;s--)a[s]=i&255,i-=a[s],i/=256;return a};function Zu(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function HR(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function gd(r,...e){if(!HR(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error("Uint8Array expected of length "+e+", got length="+r.length)}function QR(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Zu(r.outputLen),Zu(r.blockLen)}function yo(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function MI(r,e){gd(r);const a=e.outputLen;if(r.length<a)throw new Error("digestInto() expects output buffer of length at least "+a)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function zR(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function Lg(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function wr(r,e){return r<<32-e|r>>>e}function Rg(r,e){return r<<e|r>>>32-e>>>0}const FE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function VR(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}function OE(r){for(let e=0;e<r.length;e++)r[e]=VR(r[e])}function KR(r){if(typeof r!="string")throw new Error("utf8ToBytes expected string, got "+typeof r);return new Uint8Array(new TextEncoder().encode(r))}function hd(r){return typeof r=="string"&&(r=KR(r)),gd(r),r}class Mh{clone(){return this._cloneInto()}}function wo(r){const e=i=>r().update(hd(i)).digest(),a=r();return e.outputLen=a.outputLen,e.blockLen=a.blockLen,e.create=()=>r(),e}class FI extends Mh{update(e){return yo(this),this.iHash.update(e),this}digestInto(e){yo(this),gd(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:a,iHash:i,finished:s,destroyed:c,blockLen:d,outputLen:m}=this;return e=e,e.finished=s,e.destroyed=c,e.blockLen=d,e.outputLen=m,e.oHash=a._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}constructor(e,a){super(),this.finished=!1,this.destroyed=!1,QR(e);const i=hd(a);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,c=new Uint8Array(s);c.set(i.length>s?e.create().update(i).digest():i);for(let d=0;d<c.length;d++)c[d]^=54;this.iHash.update(c),this.oHash=e.create();for(let d=0;d<c.length;d++)c[d]^=106;this.oHash.update(c),c.fill(0)}}const ch=(r,e,a)=>new FI(r,e).update(a).digest();ch.create=(r,e)=>new FI(r,e);function GR(r,e,a,i){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,a,i);const s=BigInt(32),c=BigInt(4294967295),d=Number(a>>s&c),m=Number(a&c),g=i?4:0,f=i?0:4;r.setUint32(e+g,d,i),r.setUint32(e+f,m,i)}function OI(r,e,a){return r&e^~r&a}function jI(r,e,a){return r&e^r&a^e&a}class Fh extends Mh{update(e){yo(this);const{view:a,buffer:i,blockLen:s}=this;e=hd(e);const c=e.length;for(let d=0;d<c;){const m=Math.min(s-this.pos,c-d);if(m===s){const g=Lg(e);for(;s<=c-d;d+=s)this.process(g,d);continue}i.set(e.subarray(d,d+m),this.pos),this.pos+=m,d+=m,this.pos===s&&(this.process(a,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){yo(this),MI(e,this),this.finished=!0;const{buffer:a,view:i,blockLen:s,isLE:c}=this;let{pos:d}=this;a[d++]=128,this.buffer.subarray(d).fill(0),this.padOffset>s-d&&(this.process(i,0),d=0);for(let p=d;p<s;p++)a[p]=0;GR(i,s-8,BigInt(this.length*8),c),this.process(i,0);const m=Lg(e),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=g/4,E=this.get();if(f>E.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<f;p++)m.setUint32(4*p,E[p],c)}digest(){const{buffer:e,outputLen:a}=this;this.digestInto(e);const i=e.slice(0,a);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:a,buffer:i,length:s,finished:c,destroyed:d,pos:m}=this;return e.length=s,e.pos=m,e.finished=c,e.destroyed=d,s%a&&e.buffer.set(i),e}constructor(e,a,i,s){super(),this.blockLen=e,this.outputLen=a,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Lg(this.buffer)}}const Rl=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Pi=new Uint32Array(80);class qR extends Fh{get(){const{A:e,B:a,C:i,D:s,E:c}=this;return[e,a,i,s,c]}set(e,a,i,s,c){this.A=e|0,this.B=a|0,this.C=i|0,this.D=s|0,this.E=c|0}process(e,a){for(let g=0;g<16;g++,a+=4)Pi[g]=e.getUint32(a,!1);for(let g=16;g<80;g++)Pi[g]=Rg(Pi[g-3]^Pi[g-8]^Pi[g-14]^Pi[g-16],1);let{A:i,B:s,C:c,D:d,E:m}=this;for(let g=0;g<80;g++){let f,E;g<20?(f=OI(s,c,d),E=1518500249):g<40?(f=s^c^d,E=1859775393):g<60?(f=jI(s,c,d),E=2400959708):(f=s^c^d,E=3395469782);const p=Rg(i,5)+f+m+E+Pi[g]|0;m=d,d=c,c=Rg(s,30),s=i,i=p}i=i+this.A|0,s=s+this.B|0,c=c+this.C|0,d=d+this.D|0,m=m+this.E|0,this.set(i,s,c,d,m)}roundClean(){Pi.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}constructor(){super(64,20,8,!1),this.A=Rl[0]|0,this.B=Rl[1]|0,this.C=Rl[2]|0,this.D=Rl[3]|0,this.E=Rl[4]|0}}const WR=wo(()=>new qR),YR=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Hi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qi=new Uint32Array(64);class PI extends Fh{get(){const{A:e,B:a,C:i,D:s,E:c,F:d,G:m,H:g}=this;return[e,a,i,s,c,d,m,g]}set(e,a,i,s,c,d,m,g){this.A=e|0,this.B=a|0,this.C=i|0,this.D=s|0,this.E=c|0,this.F=d|0,this.G=m|0,this.H=g|0}process(e,a){for(let p=0;p<16;p++,a+=4)Qi[p]=e.getUint32(a,!1);for(let p=16;p<64;p++){const C=Qi[p-15],I=Qi[p-2],x=wr(C,7)^wr(C,18)^C>>>3,T=wr(I,17)^wr(I,19)^I>>>10;Qi[p]=T+Qi[p-7]+x+Qi[p-16]|0}let{A:i,B:s,C:c,D:d,E:m,F:g,G:f,H:E}=this;for(let p=0;p<64;p++){const C=wr(m,6)^wr(m,11)^wr(m,25),I=E+C+OI(m,g,f)+YR[p]+Qi[p]|0,T=(wr(i,2)^wr(i,13)^wr(i,22))+jI(i,s,c)|0;E=f,f=g,g=m,m=d+I|0,d=c,c=s,s=i,i=I+T|0}i=i+this.A|0,s=s+this.B|0,c=c+this.C|0,d=d+this.D|0,m=m+this.E|0,g=g+this.F|0,f=f+this.G|0,E=E+this.H|0,this.set(i,s,c,d,m,g,f,E)}roundClean(){Qi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}constructor(){super(64,32,8,!1),this.A=Hi[0]|0,this.B=Hi[1]|0,this.C=Hi[2]|0,this.D=Hi[3]|0,this.E=Hi[4]|0,this.F=Hi[5]|0,this.G=Hi[6]|0,this.H=Hi[7]|0}}class JR extends PI{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const XR=wo(()=>new PI),$R=wo(()=>new JR),Nu=BigInt(2**32-1),uh=BigInt(32);function HI(r,e=!1){return e?{h:Number(r&Nu),l:Number(r>>uh&Nu)}:{h:Number(r>>uh&Nu)|0,l:Number(r&Nu)|0}}function QI(r,e=!1){let a=new Uint32Array(r.length),i=new Uint32Array(r.length);for(let s=0;s<r.length;s++){const{h:c,l:d}=HI(r[s],e);[a[s],i[s]]=[c,d]}return[a,i]}const ZR=(r,e)=>BigInt(r>>>0)<<uh|BigInt(e>>>0),eD=(r,e,a)=>r>>>a,tD=(r,e,a)=>r<<32-a|e>>>a,aD=(r,e,a)=>r>>>a|e<<32-a,nD=(r,e,a)=>r<<32-a|e>>>a,rD=(r,e,a)=>r<<64-a|e>>>a-32,iD=(r,e,a)=>r>>>a-32|e<<64-a,sD=(r,e)=>e,oD=(r,e)=>r,zI=(r,e,a)=>r<<a|e>>>32-a,VI=(r,e,a)=>e<<a|r>>>32-a,KI=(r,e,a)=>e<<a-32|r>>>64-a,GI=(r,e,a)=>r<<a-32|e>>>64-a;function lD(r,e,a,i){const s=(e>>>0)+(i>>>0);return{h:r+a+(s/2**32|0)|0,l:s|0}}const cD=(r,e,a)=>(r>>>0)+(e>>>0)+(a>>>0),uD=(r,e,a,i)=>e+a+i+(r/2**32|0)|0,dD=(r,e,a,i)=>(r>>>0)+(e>>>0)+(a>>>0)+(i>>>0),mD=(r,e,a,i,s)=>e+a+i+s+(r/2**32|0)|0,fD=(r,e,a,i,s)=>(r>>>0)+(e>>>0)+(a>>>0)+(i>>>0)+(s>>>0),gD=(r,e,a,i,s,c)=>e+a+i+s+c+(r/2**32|0)|0,Nt={fromBig:HI,split:QI,toBig:ZR,shrSH:eD,shrSL:tD,rotrSH:aD,rotrSL:nD,rotrBH:rD,rotrBL:iD,rotr32H:sD,rotr32L:oD,rotlSH:zI,rotlSL:VI,rotlBH:KI,rotlBL:GI,add:lD,add3L:cD,add3H:uD,add4L:dD,add4H:mD,add5H:gD,add5L:fD},[hD,AD]=Nt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),zi=new Uint32Array(80),Vi=new Uint32Array(80);class qI extends Fh{get(){const{Ah:e,Al:a,Bh:i,Bl:s,Ch:c,Cl:d,Dh:m,Dl:g,Eh:f,El:E,Fh:p,Fl:C,Gh:I,Gl:x,Hh:T,Hl:k}=this;return[e,a,i,s,c,d,m,g,f,E,p,C,I,x,T,k]}set(e,a,i,s,c,d,m,g,f,E,p,C,I,x,T,k){this.Ah=e|0,this.Al=a|0,this.Bh=i|0,this.Bl=s|0,this.Ch=c|0,this.Cl=d|0,this.Dh=m|0,this.Dl=g|0,this.Eh=f|0,this.El=E|0,this.Fh=p|0,this.Fl=C|0,this.Gh=I|0,this.Gl=x|0,this.Hh=T|0,this.Hl=k|0}process(e,a){for(let S=0;S<16;S++,a+=4)zi[S]=e.getUint32(a),Vi[S]=e.getUint32(a+=4);for(let S=16;S<80;S++){const O=zi[S-15]|0,U=Vi[S-15]|0,P=Nt.rotrSH(O,U,1)^Nt.rotrSH(O,U,8)^Nt.shrSH(O,U,7),K=Nt.rotrSL(O,U,1)^Nt.rotrSL(O,U,8)^Nt.shrSL(O,U,7),H=zi[S-2]|0,Q=Vi[S-2]|0,V=Nt.rotrSH(H,Q,19)^Nt.rotrBH(H,Q,61)^Nt.shrSH(H,Q,6),G=Nt.rotrSL(H,Q,19)^Nt.rotrBL(H,Q,61)^Nt.shrSL(H,Q,6),q=Nt.add4L(K,G,Vi[S-7],Vi[S-16]),W=Nt.add4H(q,P,V,zi[S-7],zi[S-16]);zi[S]=W|0,Vi[S]=q|0}let{Ah:i,Al:s,Bh:c,Bl:d,Ch:m,Cl:g,Dh:f,Dl:E,Eh:p,El:C,Fh:I,Fl:x,Gh:T,Gl:k,Hh:R,Hl:_}=this;for(let S=0;S<80;S++){const O=Nt.rotrSH(p,C,14)^Nt.rotrSH(p,C,18)^Nt.rotrBH(p,C,41),U=Nt.rotrSL(p,C,14)^Nt.rotrSL(p,C,18)^Nt.rotrBL(p,C,41),P=p&I^~p&T,K=C&x^~C&k,H=Nt.add5L(_,U,K,AD[S],Vi[S]),Q=Nt.add5H(H,R,O,P,hD[S],zi[S]),V=H|0,G=Nt.rotrSH(i,s,28)^Nt.rotrBH(i,s,34)^Nt.rotrBH(i,s,39),q=Nt.rotrSL(i,s,28)^Nt.rotrBL(i,s,34)^Nt.rotrBL(i,s,39),W=i&c^i&m^c&m,ne=s&d^s&g^d&g;R=T|0,_=k|0,T=I|0,k=x|0,I=p|0,x=C|0,{h:p,l:C}=Nt.add(f|0,E|0,Q|0,V|0),f=m|0,E=g|0,m=c|0,g=d|0,c=i|0,d=s|0;const me=Nt.add3L(V,q,ne);i=Nt.add3H(me,Q,G,W),s=me|0}({h:i,l:s}=Nt.add(this.Ah|0,this.Al|0,i|0,s|0)),{h:c,l:d}=Nt.add(this.Bh|0,this.Bl|0,c|0,d|0),{h:m,l:g}=Nt.add(this.Ch|0,this.Cl|0,m|0,g|0),{h:f,l:E}=Nt.add(this.Dh|0,this.Dl|0,f|0,E|0),{h:p,l:C}=Nt.add(this.Eh|0,this.El|0,p|0,C|0),{h:I,l:x}=Nt.add(this.Fh|0,this.Fl|0,I|0,x|0),{h:T,l:k}=Nt.add(this.Gh|0,this.Gl|0,T|0,k|0),{h:R,l:_}=Nt.add(this.Hh|0,this.Hl|0,R|0,_|0),this.set(i,s,c,d,m,g,f,E,p,C,I,x,T,k,R,_)}roundClean(){zi.fill(0),Vi.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}}class pD extends qI{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const yD=wo(()=>new qI),ED=wo(()=>new pD),WI=[],YI=[],JI=[],bD=BigInt(0),Dl=BigInt(1),ID=BigInt(2),vD=BigInt(7),wD=BigInt(256),CD=BigInt(113);for(let r=0,e=Dl,a=1,i=0;r<24;r++){[a,i]=[i,(2*a+3*i)%5],WI.push(2*(5*i+a)),YI.push((r+1)*(r+2)/2%64);let s=bD;for(let c=0;c<7;c++)e=(e<<Dl^(e>>vD)*CD)%wD,e&ID&&(s^=Dl<<(Dl<<BigInt(c))-Dl);JI.push(s)}const[ND,xD]=QI(JI,!0),jE=(r,e,a)=>a>32?KI(r,e,a):zI(r,e,a),PE=(r,e,a)=>a>32?GI(r,e,a):VI(r,e,a);function TD(r,e=24){const a=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let d=0;d<10;d++)a[d]=r[d]^r[d+10]^r[d+20]^r[d+30]^r[d+40];for(let d=0;d<10;d+=2){const m=(d+8)%10,g=(d+2)%10,f=a[g],E=a[g+1],p=jE(f,E,1)^a[m],C=PE(f,E,1)^a[m+1];for(let I=0;I<50;I+=10)r[d+I]^=p,r[d+I+1]^=C}let s=r[2],c=r[3];for(let d=0;d<24;d++){const m=YI[d],g=jE(s,c,m),f=PE(s,c,m),E=WI[d];s=r[E],c=r[E+1],r[E]=g,r[E+1]=f}for(let d=0;d<50;d+=10){for(let m=0;m<10;m++)a[m]=r[d+m];for(let m=0;m<10;m++)r[d+m]^=~a[(m+2)%10]&a[(m+4)%10]}r[0]^=ND[i],r[1]^=xD[i]}a.fill(0)}class Oh extends Mh{keccak(){FE||OE(this.state32),TD(this.state32,this.rounds),FE||OE(this.state32),this.posOut=0,this.pos=0}update(e){yo(this);const{blockLen:a,state:i}=this;e=hd(e);const s=e.length;for(let c=0;c<s;){const d=Math.min(a-this.pos,s-c);for(let m=0;m<d;m++)i[this.pos++]^=e[c++];this.pos===a&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:a,pos:i,blockLen:s}=this;e[i]^=a,(a&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){yo(this,!1),gd(e),this.finish();const a=this.state,{blockLen:i}=this;for(let s=0,c=e.length;s<c;){this.posOut>=i&&this.keccak();const d=Math.min(i-this.posOut,c-s);e.set(a.subarray(this.posOut,this.posOut+d),s),this.posOut+=d,s+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Zu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(MI(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:i,outputLen:s,rounds:c,enableXOF:d}=this;return e||(e=new Oh(a,i,s,d,c)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=c,e.suffix=i,e.outputLen=s,e.enableXOF=d,e.destroyed=this.destroyed,e}constructor(e,a,i,s=!1,c=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=i,this.enableXOF=s,this.rounds=c,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Zu(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=zR(this.state)}}const Ad=(r,e,a)=>wo(()=>new Oh(e,r,a)),SD=Ad(6,144,224/8),kD=Ad(6,136,256/8),LD=Ad(6,104,384/8),RD=Ad(6,72,512/8),Eo=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__<"u")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global})(),HE={SHA1:WR,SHA224:$R,SHA256:XR,SHA384:ED,SHA512:yD,"SHA3-224":SD,"SHA3-256":kD,"SHA3-384":LD,"SHA3-512":RD},jh=r=>{switch(!0){case/^(?:SHA-?1|SSL3-SHA1)$/i.test(r):return"SHA1";case/^SHA(?:2?-)?224$/i.test(r):return"SHA224";case/^SHA(?:2?-)?256$/i.test(r):return"SHA256";case/^SHA(?:2?-)?384$/i.test(r):return"SHA384";case/^SHA(?:2?-)?512$/i.test(r):return"SHA512";case/^SHA3-224$/i.test(r):return"SHA3-224";case/^SHA3-256$/i.test(r):return"SHA3-256";case/^SHA3-384$/i.test(r):return"SHA3-384";case/^SHA3-512$/i.test(r):return"SHA3-512";default:throw new TypeError(`Unknown hash algorithm: ${r}`)}},DD=(r,e,a)=>{if(ch){const i=HE[r]??HE[jh(r)];return ch(i,e,a)}else throw new Error("Missing HMAC function")},dh="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",BD=r=>{r=r.replace(/ /g,"");let e=r.length;for(;r[e-1]==="=";)--e;r=(e<r.length?r.substring(0,e):r).toUpperCase();const a=new ArrayBuffer(r.length*5/8|0),i=new Uint8Array(a);let s=0,c=0,d=0;for(let m=0;m<r.length;m++){const g=dh.indexOf(r[m]);if(g===-1)throw new TypeError(`Invalid character found: ${r[m]}`);c=c<<5|g,s+=5,s>=8&&(s-=8,i[d++]=c>>>s)}return i},UD=r=>{let e=0,a=0,i="";for(let s=0;s<r.length;s++)for(a=a<<8|r[s],e+=8;e>=5;)i+=dh[a>>>e-5&31],e-=5;return e>0&&(i+=dh[a<<5-e&31]),i},_D=r=>{r=r.replace(/ /g,"");const e=new ArrayBuffer(r.length/2),a=new Uint8Array(e);for(let i=0;i<r.length;i+=2)a[i/2]=parseInt(r.substring(i,i+2),16);return a},MD=r=>{let e="";for(let a=0;a<r.length;a++){const i=r[a].toString(16);i.length===1&&(e+="0"),e+=i}return e.toUpperCase()},FD=r=>{const e=new ArrayBuffer(r.length),a=new Uint8Array(e);for(let i=0;i<r.length;i++)a[i]=r.charCodeAt(i)&255;return a},OD=r=>{let e="";for(let a=0;a<r.length;a++)e+=String.fromCharCode(r[a]);return e},QE=Eo.TextEncoder?new Eo.TextEncoder:null,zE=Eo.TextDecoder?new Eo.TextDecoder:null,jD=r=>{if(!QE)throw new Error("Encoding API not available");return QE.encode(r)},PD=r=>{if(!zE)throw new Error("Encoding API not available");return zE.decode(r)},HD=r=>{var e;if((e=Eo.crypto)!=null&&e.getRandomValues)return Eo.crypto.getRandomValues(new Uint8Array(r));throw new Error("Cryptography API not available")};class ri{static fromLatin1(e){return new ri({buffer:FD(e).buffer})}static fromUTF8(e){return new ri({buffer:jD(e).buffer})}static fromBase32(e){return new ri({buffer:BD(e).buffer})}static fromHex(e){return new ri({buffer:_D(e).buffer})}get buffer(){return this.bytes.buffer}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,writable:!1,configurable:!1,value:OD(this.bytes)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,writable:!1,configurable:!1,value:PD(this.bytes)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,writable:!1,configurable:!1,value:UD(this.bytes)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,writable:!1,configurable:!1,value:MD(this.bytes)}),this.hex}constructor({buffer:e,size:a=20}={}){this.bytes=typeof e>"u"?HD(a):new Uint8Array(e),Object.defineProperty(this,"bytes",{enumerable:!0,writable:!1,configurable:!1,value:this.bytes})}}const QD=(r,e)=>{{if(r.length!==e.length)throw new TypeError("Input strings must have the same length");let a=-1,i=0;for(;++a<r.length;)i|=r.charCodeAt(a)^e.charCodeAt(a);return i===0}};class ka{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,counter:0,window:1}}static generate({secret:e,algorithm:a=ka.defaults.algorithm,digits:i=ka.defaults.digits,counter:s=ka.defaults.counter}){const c=DD(a,e.bytes,PR(s)),d=c[c.byteLength-1]&15;return(((c[d]&127)<<24|(c[d+1]&255)<<16|(c[d+2]&255)<<8|c[d+3]&255)%10**i).toString().padStart(i,"0")}generate({counter:e=this.counter++}={}){return ka.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:e})}static validate({token:e,secret:a,algorithm:i,digits:s=ka.defaults.digits,counter:c=ka.defaults.counter,window:d=ka.defaults.window}){if(e.length!==s)return null;let m=null;const g=f=>{const E=ka.generate({secret:a,algorithm:i,digits:s,counter:f});QD(e,E)&&(m=f-c)};g(c);for(let f=1;f<=d&&m===null&&(g(c-f),!(m!==null||(g(c+f),m!==null)));++f);return m}validate({token:e,counter:a=this.counter,window:i}){return ka.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:a,window:i})}toString(){const e=encodeURIComponent;return`otpauth://hotp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}constructor({issuer:e=ka.defaults.issuer,label:a=ka.defaults.label,issuerInLabel:i=ka.defaults.issuerInLabel,secret:s=new ri,algorithm:c=ka.defaults.algorithm,digits:d=ka.defaults.digits,counter:m=ka.defaults.counter}={}){this.issuer=e,this.label=a,this.issuerInLabel=i,this.secret=typeof s=="string"?ri.fromBase32(s):s,this.algorithm=jh(c),this.digits=d,this.counter=m}}class Ia{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}static counter({period:e=Ia.defaults.period,timestamp:a=Date.now()}={}){return Math.floor(a/1e3/e)}counter({timestamp:e=Date.now()}={}){return Ia.counter({period:this.period,timestamp:e})}static remaining({period:e=Ia.defaults.period,timestamp:a=Date.now()}={}){return e*1e3-a%(e*1e3)}remaining({timestamp:e=Date.now()}={}){return Ia.remaining({period:this.period,timestamp:e})}static generate({secret:e,algorithm:a,digits:i,period:s=Ia.defaults.period,timestamp:c=Date.now()}){return ka.generate({secret:e,algorithm:a,digits:i,counter:Ia.counter({period:s,timestamp:c})})}generate({timestamp:e=Date.now()}={}){return Ia.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:a,algorithm:i,digits:s,period:c=Ia.defaults.period,timestamp:d=Date.now(),window:m}){return ka.validate({token:e,secret:a,algorithm:i,digits:s,counter:Ia.counter({period:c,timestamp:d}),window:m})}validate({token:e,timestamp:a,window:i}){return Ia.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:a,window:i})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}constructor({issuer:e=Ia.defaults.issuer,label:a=Ia.defaults.label,issuerInLabel:i=Ia.defaults.issuerInLabel,secret:s=new ri,algorithm:c=Ia.defaults.algorithm,digits:d=Ia.defaults.digits,period:m=Ia.defaults.period}={}){this.issuer=e,this.label=a,this.issuerInLabel=i,this.secret=typeof s=="string"?ri.fromBase32(s):s,this.algorithm=jh(c),this.digits=d,this.period=m}}const zD=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,VD=/^[2-7A-Z]+=*$/i,KD=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,GD=/^[+-]?\d+$/,VE=/^\+?[1-9]\d*$/;class qD{static parse(e){let a;try{a=e.match(zD)}catch{}if(!Array.isArray(a))throw new URIError("Invalid URI format");const i=a[1].toLowerCase(),s=a[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),c=a[3].split("&").reduce((g,f)=>{const E=f.split(/=(.*)/,2).map(decodeURIComponent),p=E[0].toLowerCase(),C=E[1],I=g;return I[p]=C,I},{});let d;const m={};if(i==="hotp")if(d=ka,typeof c.counter<"u"&&GD.test(c.counter))m.counter=parseInt(c.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(i==="totp"){if(d=Ia,typeof c.period<"u")if(VE.test(c.period))m.period=parseInt(c.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof c.issuer<"u"&&(m.issuer=c.issuer),s.length===2?(m.label=s[1],typeof m.issuer>"u"||m.issuer===""?m.issuer=s[0]:s[0]===""&&(m.issuerInLabel=!1)):(m.label=s[0],typeof m.issuer<"u"&&m.issuer!==""&&(m.issuerInLabel=!1)),typeof c.secret<"u"&&VD.test(c.secret))m.secret=c.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof c.algorithm<"u")if(KD.test(c.algorithm))m.algorithm=c.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof c.digits<"u")if(VE.test(c.digits))m.digits=parseInt(c.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new d(m)}static stringify(e){if(e instanceof ka||e instanceof Ia)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const WD=({totpCodes:r,onTotpCodesChange:e,originalTotpCodeIds:a,isAddFormVisible:i,formData:s,onStateChange:c})=>{const{t:d}=tt(),[m,g]=w.useState(null),f=(R,_)=>{let S=R.trim(),O=_.trim();if(S.toLowerCase().startsWith("otpauth://totp/"))try{const U=qD.parse(S);U instanceof Ia&&(S=U.secret.base32,!O&&U.label&&(O=U.label))}catch{throw new Error(d("totp.errors.invalidSecretKey"))}if(S=S.replace(/\s/g,""),!/^[A-Z2-7]+=*$/i.test(S))throw new Error(d("totp.errors.invalidSecretKey"));return{secretKey:S,name:O||d("totp.defaultName")}},E=()=>{c({isAddFormVisible:!0,formData:{name:"",secretKey:""}}),g(null)},p=()=>{c({isAddFormVisible:!1,formData:{name:"",secretKey:""}}),g(null)},C=R=>{c({isAddFormVisible:i,formData:{...s,...R}})},I=R=>{if(R==null||R.preventDefault(),g(null),!s.secretKey){g(d("items.validation.required"));return}try{const{secretKey:_,name:S}=f(s.secretKey,s.name),O={Id:crypto.randomUUID().toUpperCase(),Name:S,SecretKey:_,ItemId:""},U=[...r,O];e(U),p()}catch(_){_ instanceof Error?g(_.message):g(d("common.errors.unknownErrorTryAgain"))}},x=R=>{const _=a.includes(R.Id);let S;_?S=r.map(O=>O.Id===R.Id?{...O,IsDeleted:!0}:O):S=r.filter(O=>O.Id!==R.Id),e(S)},T=r.filter(R=>!R.IsDeleted),k=T.length>0;return l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:d("common.twoFactorAuthentication")}),k&&!i&&l.jsx("button",{type:"button",onClick:E,className:"w-8 h-8 flex items-center justify-center text-primary-700 hover:text-white border border-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg dark:border-primary-500 dark:text-primary-500 dark:hover:text-white dark:hover:bg-primary-600 dark:focus:ring-primary-800",title:d("totp.addCode"),children:l.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),!k&&!i&&l.jsxs("button",{type:"button",onClick:E,className:"w-full py-1.5 px-4 flex items-center justify-center gap-2 text-primary-700 hover:text-white border border-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg dark:border-primary-500 dark:text-primary-500 dark:hover:text-white dark:hover:bg-primary-600 dark:focus:ring-primary-800",children:[l.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),l.jsx("span",{children:d("totp.addCode")})]}),i&&l.jsxs("div",{className:"p-4 mb-4 bg-gray-50 border border-gray-200 rounded-lg dark:bg-gray-700 dark:border-gray-600",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h4",{className:"text-lg font-medium text-gray-900 dark:text-white",children:d("totp.addCode")}),k&&l.jsx("button",{type:"button",onClick:p,className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white",children:l.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 14 14",children:l.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})})})]}),l.jsx("p",{className:"mb-4 text-sm text-gray-500 dark:text-gray-400",children:d("totp.instructions")}),m&&l.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg dark:bg-red-900/20 dark:border-red-800",children:l.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:m})}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{htmlFor:"totp-name",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:d("totp.nameOptional")}),l.jsx("input",{id:"totp-name",type:"text",value:s.name,onChange:R=>C({name:R.target.value}),className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{htmlFor:"totp-secret",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:d("totp.secretKey")}),l.jsx("input",{id:"totp-secret",type:"text",value:s.secretKey,onChange:R=>C({secretKey:R.target.value}),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),I(R))},className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx("button",{type:"button",onClick:R=>I(R),className:"text-white bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",children:d("common.save")})})]}),k&&l.jsx("div",{className:"grid grid-cols-1 gap-4 mt-4",children:T.map(R=>l.jsx("div",{className:"p-2 ps-3 pe-3 bg-gray-50 border border-gray-200 rounded-lg dark:bg-gray-700 dark:border-gray-600",children:l.jsxs("div",{className:"flex justify-between items-center gap-2",children:[l.jsx("div",{className:"flex items-center flex-1",children:l.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:R.Name})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex flex-col items-end",children:l.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:d("totp.saveToViewCode")})}),l.jsx("button",{type:"button",onClick:()=>x(R),className:"text-red-600 hover:text-red-800 dark:text-red-500 dark:hover:text-red-400",children:l.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})})]})]})},R.Id))})]})},YD=({inputRef:r,value:e,onChange:a,folders:i,selectedFolderId:s,onFolderChange:c})=>{const{t:d}=tt(),[m,g]=w.useState(!1),f=i.find(x=>x.Id===s),E=w.useCallback(x=>{c(x),g(!1)},[c]),p=w.useCallback(x=>{a(x.target.value)},[a]),C=w.useCallback(()=>{g(!0)},[]),I=w.useCallback(()=>{g(!1)},[]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("label",{htmlFor:"itemName",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[d("items.itemName")," ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("input",{ref:r,id:"itemName",type:"text",value:e,onChange:p,className:`w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white ${s?"pr-28":"pr-10"}`,required:!0}),l.jsxs("button",{type:"button",onClick:C,className:`absolute right-1 z-10 flex items-center gap-1 px-2 py-1 rounded transition-colors text-xs ${s?"bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400 hover:bg-primary-200 dark:hover:bg-primary-900/50":"text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-600"}`,title:(f==null?void 0:f.Name)||"-",children:[l.jsx("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),s&&l.jsx("span",{className:"max-w-16 truncate",children:f==null?void 0:f.Name})]})]})]}),m&&l.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 transition-opacity",onClick:I}),l.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:l.jsxs("div",{className:"relative transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 px-4 pb-4 pt-5 text-left shadow-xl transition-all w-full max-w-sm",children:[l.jsxs("button",{type:"button",className:"absolute right-4 top-4 text-gray-400 hover:text-gray-500 focus:outline-none",onClick:I,children:[l.jsx("span",{className:"sr-only",children:d("common.close")}),l.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]}),l.jsx("div",{className:"mb-4",children:l.jsx("h3",{className:"text-lg font-semibold leading-6 text-gray-900 dark:text-white",children:d("items.folder")})}),l.jsxs("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:[l.jsxs("button",{type:"button",onClick:()=>E(null),className:`w-full px-3 py-2 text-left rounded-md flex items-center gap-3 transition-colors ${s?"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700":"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300"}`,children:[l.jsx("svg",{className:`w-5 h-5 ${s?"text-gray-400":"text-primary-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})}),l.jsx("span",{className:"font-medium",children:"—"}),!s&&l.jsx("svg",{className:"w-5 h-5 ml-auto text-primary-600 dark:text-primary-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]}),i.map(x=>l.jsxs("button",{type:"button",onClick:()=>E(x.Id),className:`w-full px-3 py-2 text-left rounded-md flex items-center gap-3 transition-colors ${s===x.Id?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:[l.jsx("svg",{className:`w-5 h-5 ${s===x.Id?"text-primary-500":"text-gray-400"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),l.jsx("span",{className:"font-medium",children:x.Name}),s===x.Id&&l.jsx("svg",{className:"w-5 h-5 ml-auto text-primary-600 dark:text-primary-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},x.Id))]})]})})]})]})},ed=[{type:ma.Login,titleKey:"itemTypes.login.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})},{type:ma.Alias,titleKey:"itemTypes.alias.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})},{type:ma.CreditCard,titleKey:"itemTypes.creditCard.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})},{type:ma.Note,titleKey:"itemTypes.note.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}],JD=({selectedType:r,isEditMode:e,showDropdown:a,onDropdownToggle:i,onTypeChange:s,onRegenerateAlias:c})=>{const{t:d}=tt(),m=ed.find(g=>g.type===r);return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"w-full px-4 py-2 bg-primary-50 dark:bg-primary-900/20 border border-primary-200 dark:border-primary-800 rounded-lg flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>i(!a),className:"flex-1 flex items-center justify-between hover:opacity-80 transition-opacity",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-primary-600 dark:text-primary-400",children:m==null?void 0:m.iconSvg}),l.jsxs("span",{className:"text-primary-700 dark:text-primary-300 font-medium text-sm",children:[d(e?"itemTypes.editing":"itemTypes.creating")," ",m?d(m.titleKey):""]})]}),l.jsx("svg",{className:`w-4 h-4 text-primary-500 transition-transform ${a?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r===ma.Alias&&!e&&c&&l.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),c()},className:"flex-shrink-0 p-1.5 text-primary-600 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-300 hover:bg-primary-100 dark:hover:bg-primary-900/40 rounded transition-colors",title:d("itemTypes.regenerateAlias"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M23 4v6h-6"}),l.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),l.jsx("div",{className:"absolute z-20 mt-1 w-full bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg",children:ed.map(g=>l.jsxs("button",{type:"button",onClick:()=>s(g.type),className:`w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 border-b border-gray-100 dark:border-gray-700 last:border-b-0 ${r===g.type?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300":"text-gray-900 dark:text-white"}`,children:[l.jsx("span",{className:r===g.type?"text-primary-600 dark:text-primary-400":"text-gray-500 dark:text-gray-400",children:g.iconSvg}),l.jsx("span",{className:"font-medium",children:d(g.titleKey)}),r===g.type&&l.jsx("svg",{className:"w-5 h-5 ml-auto text-primary-600 dark:text-primary-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},g.type))})]})]})};var XI=(r=>(r.Male="Male",r.Female="Female",r.Other="Other",r))(XI||{}),Ph=class ei{constructor(){this.symbols=[".","-"]}generateUsername(e){let a=this.generateEmailPrefix(e);return a=a.replace(/[^a-zA-Z0-9]/g,""),a.length<ei.MIN_LENGTH?a+=this.generateRandomString(ei.MIN_LENGTH-a.length):a.length>ei.MAX_LENGTH&&(a=a.substring(0,ei.MAX_LENGTH)),a}generateEmailPrefix(e){const a=[];switch(typeof e.birthDate=="string"&&(e.birthDate=new Date(e.birthDate)),this.getSecureRandom(4)){case 0:a.push(e.firstName.substring(0,1).toLowerCase()+e.lastName.toLowerCase());break;case 1:a.push((e.firstName+e.lastName).toLowerCase());break;case 2:a.push(e.firstName.toLowerCase()+e.lastName.substring(0,1).toLowerCase());break;case 3:a.push(e.firstName.substring(0,Math.min(3,e.firstName.length)).toLowerCase()+e.lastName.toLowerCase());break}switch(this.getSecureRandom(2)){case 0:a.push(e.birthDate.getFullYear().toString());break;case 1:a.push(e.birthDate.getFullYear().toString().substring(2));break}let i=a.join(this.getRandomSymbol());if(this.getSecureRandom(2)===0){const s=this.getSecureRandom(i.length);i=i.slice(0,s)+this.getRandomSymbol()+i.slice(s)}return i=this.sanitizeEmailPrefix(i),i.length<ei.MIN_LENGTH?i+=this.generateRandomString(ei.MIN_LENGTH-i.length):i.length>ei.MAX_LENGTH&&(i=i.substring(0,ei.MAX_LENGTH)),i}generateRandomEmailPrefix(e=14){return this.generateRandomString(e)}sanitizeEmailPrefix(e){let a=e.replace(/[^a-zA-Z0-9._-]/g,"");return a=a.replace(/[-_.]{2,}/g,i=>i[0]),a=a.replace(/^[-._]+/,""),a=a.replace(/[-._]*$/,""),a}getRandomSymbol(){return this.getSecureRandom(3)===0?this.symbols[this.getSecureRandom(this.symbols.length)]:""}generateRandomString(e){const a="abcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:e},()=>a.charAt(this.getSecureRandom(a.length))).join("")}getSecureRandom(e){const a=new Uint32Array(1);return crypto.getRandomValues(a),a[0]%e}};Ph.MIN_LENGTH=6;Ph.MAX_LENGTH=20;var Hh=Ph,pd=class{constructor(){this.firstNamesMale=[],this.firstNamesFemale=[],this.lastNames=[],this.random=Math.random,this.firstNamesMale=this.getFirstNamesMaleJson(),this.firstNamesFemale=this.getFirstNamesFemaleJson(),this.lastNames=this.getLastNamesJson()}getFirstNamesMaleByDecade(){return[]}getFirstNamesFemaleByDecade(){return[]}generateRandomDateOfBirth(r){if(r){const{targetYear:m,yearDeviation:g}=r;if(g===0){const f=new Date(m,0,1),E=new Date(m,11,31),p=f.getTime()+this.random()*(E.getTime()-f.getTime());return new Date(p)}else{const f=m-g,E=m+g,p=new Date(f,0,1),C=new Date(E,11,31),I=p.getTime()+this.random()*(C.getTime()-p.getTime());return new Date(I)}}const e=new Date,a=21,i=65,s=new Date(e.getFullYear()-i,e.getMonth(),e.getDate()),c=new Date(e.getFullYear()-a,e.getMonth(),e.getDate()),d=s.getTime()+this.random()*(c.getTime()-s.getTime());return new Date(d)}selectFirstnamesForBirthdate(r,e){const a=r.getFullYear(),i=e?this.getFirstNamesMaleByDecade():this.getFirstNamesFemaleByDecade();if(i.length===0)return e?this.firstNamesMale:this.firstNamesFemale;const s=i.filter(d=>a>=d.startYear&&a<=d.endYear);if(s.length>0){const d=[];return s.forEach(m=>d.push(...m.names)),d}const c=[];return i.forEach(d=>c.push(...d.names)),c.length>0?c:e?this.firstNamesMale:this.firstNamesFemale}generateRandomIdentity(r,e){const a={firstName:"",lastName:"",gender:"Male",birthDate:new Date,emailPrefix:"",nickName:""};let i;r==="random"||r===void 0?i=this.random()<.5?"Male":"Female":r==="male"?i="Male":r==="female"?i="Female":i="Male",a.gender=i,a.birthDate=this.generateRandomDateOfBirth(e);let s;if(i==="Male")s=this.selectFirstnamesForBirthdate(a.birthDate,!0);else if(i==="Female")s=this.selectFirstnamesForBirthdate(a.birthDate,!1);else{const d=this.random()<.5;s=this.selectFirstnamesForBirthdate(a.birthDate,d)}a.firstName=s[Math.floor(this.random()*s.length)],a.lastName=this.lastNames[Math.floor(this.random()*this.lastNames.length)];const c=new Hh;return a.emailPrefix=c.generateEmailPrefix(a),a.nickName=c.generateUsername(a),a}},XD=["Aaron","Adam","Adrian","Aidan","Aiden","Alan","Albert","Alex","Alexander","Alfred","Amir","Andrew","Anthony","Antonio","Archer","Arthur","Asher","Austin","Axel","Barry","Beau","Beckett","Benjamin","Bennett","Bernard","Blake","Braden","Bradley","Brady","Brandon","Braxton","Brayden","Brendan","Brett","Brian","Bruce","Bryan","Bryce","Bryson","Caden","Caleb","Calvin","Camden","Cameron","Carlos","Carson","Carter","Casey","Cecil","Charles","Chase","Chester","Christian","Christopher","Clarence","Claude","Clifford","Clyde","Cody","Cole","Colin","Collin","Colton","Connor","Cooper","Corey","Craig","Curtis","Dakota","Dale","Dalton","Damian","Dan","Daniel","Darrell","Daryl","David","Dawson","Dean","Declan","Dennis","Derek","Devin","Dominic","Dominick","Don","Douglas","Dustin","Dylan","Earl","Easton","Edgar","Edmund","Edward","Edwin","Eli","Elias","Elijah","Elliot","Elliott","Emilio","Emmett","Eric","Ethan","Eugene","Evan","Everett","Felix","Ferdinand","Floyd","Forrest","Francis","Franklin","Frederick","Gabriel","Gael","Garrett","Gary","Gavin","George","Gerald","Gilbert","Glen","Gordon","Graham","Grant","Grayson","Gregory","Greyson","Harold","Harrison","Harvey","Hayden","Henry","Herman","Howard","Hudson","Hugh","Hugo","Hunter","Ian","Irving","Isaac","Isaiah","Ivan","Jace","Jack","Jackson","Jacob","Jaden","James","Jared","Jason","Jasper","Jayden","Jeffrey","Jeremiah","Jeremy","Jerome","Jesse","Jesus","Joel","John","Jonathan","Jordan","Jorge","Jose","Joseph","Joshua","Josiah","Juan","Justin","Kai","Kayden","Keith","Kenneth","Kevin","Kingston","Knox","Kyle","Landon","Lawrence","Leo","Leon","Leonard","Leonardo","Leslie","Levi","Liam","Lincoln","Lloyd","Logan","Luca","Lucas","Luis","Luke","Maddox","Malachi","Malcolm","Marcus","Mark","Martin","Marvin","Mason","Mateo","Matthew","Maurice","Max","Maxwell","Micah","Michael","Miguel","Miles","Milton","Mitchell","Morris","Nathan","Nathaniel","Neil","Nelson","Nicholas","Noah","Nolan","Norman","Oliver","Oscar","Owen","Parker","Patrick","Paul","Perry","Peter","Philip","Phillip","Preston","Ralph","Randy","Ray","Raymond","Rhett","Richard","Riley","Robert","Roderick","Rodney","Roger","Roland","Roman","Ronald","Ross","Roy","Russell","Ryan","Ryder","Ryker","Samuel","Sawyer","Scott","Sean","Sebastian","Seth","Shane","Shawn","Silas","Simon","Spencer","Stanley","Stephen","Steven","Stuart","Tanner","Terrence","Theodore","Thomas","Timothy","Travis","Trevor","Tristan","Tyler","Vernon","Victor","Vincent","Wade","Wallace","Walter","Warren","Wayne","Wendell","Wesley","Weston","William","Winston","Wyatt","Xavier","Zachariah","Zachary","Zane"],$D=["Aaliyah","Abigail","Ada","Adalyn","Adalynn","Addison","Adeline","Adriana","Alexa","Alexandra","Alice","Alina","Allison","Alyssa","Amara","Amaya","Amelia","Anastasia","Andrea","Anna","Annabelle","Aria","Ariana","Arianna","Arielle","Arya","Ashley","Aspen","Athena","Aubree","Aubrey","Audrey","Aurora","Autumn","Ava","Avery","Ayla","Bailey","Beatrice","Bella","Bianca","Blair","Brianna","Brielle","Brooklyn","Brynn","Calliope","Camila","Camille","Carmen","Caroline","Cassidy","Catalina","Cecilia","Celeste","Charlie","Charlotte","Chloe","Claire","Clara","Cora","Coraline","Dahlia","Daisy","Dakota","Daphne","Dawn","Delilah","Diana","Eden","Eleanor","Elena","Eliana","Elise","Eliza","Elizabeth","Ella","Ellie","Eloise","Ember","Emerson","Emersyn","Emery","Emilia","Emily","Emma","Esme","Esther","Eva","Evangeline","Evelyn","Everly","Faith","Fiona","Flora","Florence","Francesca","Freya","Gabriella","Gemma","Genesis","Georgia","Gianna","Giselle","Grace","Gwendolyn","Hadley","Hailey","Hannah","Harlow","Harmony","Harper","Haven","Hazel","Heidi","Helena","Holly","Hope","Imogen","India","Indie","Iris","Isabel","Isabella","Isabelle","Isla","Ivy","Jade","Jasmine","Jessie","Jocelyn","Josephine","Josie","Julia","Juliana","Juliet","June","Juniper","Kaia","Katherine","Kayla","Kaylee","Keira","Kennedy","Khloe","Kinsley","Kylie","Lara","Laura","Laurel","Layla","Leah","Leilani","Lena","Liliana","Lillian","Lily","Lola","Lorelei","Lucia","Lucy","Luna","Lydia","Lyla","Mabel","Mackenzie","Madeline","Madelyn","Madison","Maeve","Magnolia","Maisie","Malia","Margaret","Margot","Maria","Marina","Marlowe","Mary","Matilda","Maya","Melanie","Melody","Mia","Mira","Miranda","Morgan","Nadia","Naomi","Natalia","Natalie","Nell","Nevaeh","Nina","Noelle","Nora","Norah","Nova","Octavia","Odette","Olive","Olivia","Opal","Ophelia","Paisley","Pearl","Penelope","Peyton","Phoebe","Phoenix","Piper","Poppy","Primrose","Quinn","Raelynn","Ramona","Raven","Reagan","Reese","Riley","River","Robin","Rosalie","Rose","Rosemary","Rowan","Ruby","Ruth","Rylee","Ryleigh","Sabrina","Sadie","Sage","Salem","Samantha","Sarah","Sasha","Savannah","Scarlett","Selena","Serena","Serenity","Sienna","Sierra","Simone","Skye","Skylar","Sloane","Sofia","Sophia","Sophie","Stella","Summer","Sylvia","Sylvie","Talia","Taylor","Tessa","Thea","Thora","Valentina","Valeria","Vera","Victoria","Violet","Vivian","Vivienne","Willa","Willow","Winnie","Winter","Wren","Ximena","Yara","Zara","Zoe","Zoey"],ZD=["Abbott","Adams","Aguilar","Alexander","Allen","Alvarez","Anderson","Atkins","Bailey","Baker","Baldwin","Ballard","Barber","Barker","Barnes","Barrett","Bauer","Baxter","Beard","Bell","Bennett","Benson","Black","Blackwood","Blake","Blanchard","Booth","Bowman","Bradley","Briggs","Brooks","Brown","Bryant","Buckley","Burke","Burns","Butler","Byrd","Cain","Campbell","Cannon","Carlson","Carter","Castillo","Castro","Chandler","Chapman","Chavez","Chen","Clark","Clarke","Cobb","Cole","Coleman","Collier","Collins","Conrad","Cook","Cooke","Cooper","Cox","Craig","Crawford","Cross","Cruz","Cunningham","Dalton","Daniel","Davenport","Davis","Dawson","Dempsey","Dennis","Diaz","Dickerson","Dillon","Dixon","Doyle","Duran","Dyer","Edwards","Ellis","Erickson","Evans","Ewing","Farley","Farr","Farrell","Fernandez","Ferris","Fisher","Fitzgerald","Fleming","Fletcher","Flores","Foley","Ford","Foster","Fowler","Frazier","Freeman","Frost","Fuller","Gallagher","Garcia","Gardner","Garner","Garrett","Gates","Gibbs","Gibson","Gill","Glover","Goldberg","Gomez","Gonzales","Gonzalez","Goodman","Goodwin","Gordon","Graham","Graves","Gray","Green","Griffin","Griffith","Gross","Gutierrez","Guzman","Hale","Hall","Hamilton","Hancock","Harmon","Harris","Harrison","Hawkins","Hayes","Hayward","Henderson","Hendricks","Henry","Hensley","Hernandez","Herrera","Hicks","Hill","Hodges","Holland","Holmes","Holt","Hoover","Howard","Hudson","Huffman","Hughes","Humphrey","Hunter","Hutchinson","Isaac","Jackson","Jacobson","James","Jarvis","Jenkins","Jimenez","Johnson","Jones","Jordan","Keller","Kelly","Kennedy","Kent","Kerr","Kim","King","Kirby","Knowles","Koch","Landry","Lang","Lawson","Lee","Levy","Lewis","Livingston","Logan","Long","Lopez","Lowery","Lowry","Lucas","Luna","Malone","Manning","Marsh","Marshall","Martin","Martinez","Mason","May","McBride","McCoy","McDonald","McKinney","Mccarthy","Mcguire","Mckay","Mckenzie","Meadows","Medina","Mendez","Mendoza","Middleton","Miller","Miranda","Mitchell","Moody","Moore","Morales","Moreno","Morgan","Morris","Morse","Murphy","Murray","Myers","Nash","Neal","Nelson","Nguyen","Nichols","Nielsen","Nixon","Norton","Olson","Orr","Ortiz","Owens","Palmer","Parker","Parsons","Patel","Patterson","Payne","Pearce","Pearson","Perez","Perry","Peterson","Phillips","Pickett","Pollard","Porter","Potter","Powell","Pratt","Preston","Price","Ramirez","Ramos","Randall","Ray","Reed","Reyes","Reynolds","Richardson","Riddle","Riley","Rivera","Roach","Robbins","Roberts","Robinson","Rodriguez","Rogers","Romero","Ross","Rowe","Ruiz","Russell","Salinas","Sanchez","Sanders","Santana","Savage","Sawyer","Schmidt","Schultz","Scott","Sellers","Shannon","Sharp","Shaw","Shepherd","Shields","Short","Silva","Simmons","Simpson","Skinner","Sloan","Smith","Snyder","Sparks","Spears","Stanley","Stark","Steele","Stephenson","Stevens","Stewart","Stokes","Sullivan","Sutton","Swanson","Tanner","Tate","Taylor","Thomas","Thompson","Thornton","Torres","Tran","Travis","Tucker","Turner","Tyler","Underwood","Vargas","Vasquez","Vincent","Wagner","Walker","Wallace","Walters","Walton","Ward","Washington","Watkins","Watson","Weaver","Webb","Weeks","Welch","Wells","West","Whitaker","White","Wilcox","Wilkinson","Williams","Willis","Wilson","Winters","Wise","Wolfe","Wood","Woods","Woodward","Wright","Wyatt","Yates","York","Young","Zamora","Zimmerman"],KE=class extends pd{getFirstNamesMaleJson(){return XD}getFirstNamesFemaleJson(){return $D}getLastNamesJson(){return ZD}},eB=["Daan","Luuk","Sem","Finn","Milan","Levi","Noah","Lucas","Jesse","Thijs","Jayden","Bram","Lars","Ruben","Thomas","Tim","Sam","Liam","Julian","Mees","Ties","Sven","Max","Gijs","David","Stijn","Jasper","Niels","Jens","Timo","Cas","Joep","Roan","Tom","Tygo","Teun","Siem","Mats","Thijmen","Rens","Niek","Tobias","Dex","Hugo","Robin","Nick","Floris","Pepijn","Boaz","Olivier","Luca","Jurre","Jelle","Guus","Koen","Bart","Olaf","Wessel","Daniël","Job","Sander","Tijmen","Kai","Quinten","Owen","Morris","Fedde","Joris","Jesper","Mick","Ryan","Milo","Stan","Benjamin","Melle","Jip","Dylan","Brent","Mick","Dean","Otis","Abel","Luc","Sepp","Vince","Rayan","Noud","Hidde","Fabian","Jort","Damian","Boris","Sil","Moos","Aiden","Sep","Mika","Mijs","Mika","Felix","Merlijn","Alexander","Aron","Arthur","Axel","Bas","Bastiaan","Berend","Björn","Casper","Cees","Chris","Christian","Christiaan","Colin","Cornelis","Dani","Dennis","Dirk","Dominic","Eduard","Eelco","Erik","Erwin","Ezra","Faas","Filip","Florian","Frank","Frederik","Freek","Gerard","Gerrit","Giel","Gijs","Glenn","Govert","Harm","Harold","Hendrik","Henrik","Huub","Ian","Ivo","Jacob","Jake","Jan","Jarno","Jason","Jeffrey","Jeremy","Jim","Jimmy","Johan","Johannes","Jonas","Jonathan","Jos","Joshua","Justin","Kay","Kevin","Kjeld","Klaas","Lennard","Lennart","Leon","Lex","Liam","Loek","Lorenzo","Louis","Lowie","Maarten","Magnus","Maikel","Marc","Marcel","Marco","Martijn","Mathias","Matthijs","Maurits","Menno","Michiel","Nathan","Nico","Oscar","Pascal","Patrick","Paul","Peter","Philip","Pieter","Pim","Quincy","Remco","Rick","Rik","Robert","Rogier","Rowan","Ruud","Simon","Stefan","Steven","Thom","Victor","Vincent","Willem","Wouter","Yannick"],tB=["Emma","Sophie","Julia","Mila","Tess","Sara","Anna","Noor","Lotte","Liv","Eva","Nora","Zoë","Evi","Yara","Saar","Nina","Fenna","Lieke","Fleur","Isa","Roos","Lynn","Sofie","Sarah","Milou","Olivia","Maud","Lisa","Vera","Luna","Lina","Noa","Feline","Loïs","Lena","Floor","Charlotte","Esmee","Julie","Iris","Lara","Amber","Hailey","Mia","Lize","Isabelle","Cato","Fenne","Sanne","Norah","Sophia","Ella","Nova","Elin","Femke","Lizzy","Linde","Lauren","Rosalie","Lana","Emily","Elise","Esmée","Anne","Isabelle","Demi","Hannah","Liva","Suze","Fay","Isabel","Benthe","Evi","Amy","Jasmijn","Niene","Sterre","Fenna","Fiene","Liz","Ise","Mara","Nienke","Indy","Romy","Lola","Puck","Nora","Merel","Bente","Eline","Lily","Leah","Naomi","Mirthe","Valerie","Noor","Liva","Jade","Juul","Lise","Myrthe","Veerle","Aafke","Alicia","Amira","Aniek","Annabel","Annelies","Anouk","Astrid","Babette","Bianca","Britt","Carlijn","Chantal","Claire","Dagmar","Danique","Daphne","Denise","Dominique","Doris","Eefje","Elena","Eline","Elisa","Elisabeth","Ellen","Esther","Eveline","Fabienne","Felice","Fleur","Frederique","Gwen","Hanna","Heleen","Helena","Ilona","Imke","Inge","Irene","Iris","Janna","Janneke","Jasmine","Jennifer","Jessica","Joelle","Judith","Julia","Karin","Karlijn","Kim","Kirsten","Kyra","Laura","Lena","Lianne","Liesbeth","Linda","Lisanne","Lisette","Louise","Maartje","Manon","Margot","Marieke","Marijke","Marlies","Marloes","Marthe","Melissa","Michelle","Nadine","Natalie","Nicole","Nina","Noortje","Paulien","Petra","Rachel","Renee","Robin","Rosa","Roxanne","Sabine","Sandra","Saskia","Silke","Simone","Suzanne","Sylvie","Tamara","Tanja","Tara","Thea","Thirza","Tina","Tineke","Ursula","Victoria","Wendy","Wilma","Xandra","Yasmin","Yvette","Yvonne","Zara"],aB=["de Jong","Jansen","de Vries","van den Berg","van Dijk","Bakker","Janssen","Visser","Smit","Meijer","de Boer","Mulder","de Groot","Bos","Vos","Peters","Hendriks","van Leeuwen","Dekker","Brouwer","de Wit","Dijkstra","Smits","de Graaf","van der Meer","van der Linden","Kok","Jacobs","de Haan","Vermeulen","van den Heuvel","van der Veen","van den Broek","de Bruijn","de Bruin","van der Heijden","Schouten","van Beek","Willems","van Vliet","van de Ven","Hoekstra","Maas","Verhoeven","Koster","van Dam","van der Wal","Prins","Blom","Huisman","Peeters","Kuipers","van Veen","van Dongen","Veenstra","Kramer","van den Bosch","van der Meulen","Mol","Zwart","van der Laan","Martens","van de Pol","Postma","Tromp","Borst","Boon","van Doorn","Jonker","van der Velden","Willemsen","van Wijk","Groen","Gerritsen","Bosch","van Loon","van der Ploeg","de Ruiter","Molenaar","Boer","Klein","de Koning","van de Kamp","van der Horst","Verbeek","Vink","Goossens","Scholten","Hartman","van Dalen","van Elst","Brink","Boekel","van de Berg","Berends","van der Hoek","Kuiper","Kooijman","de Lange","van der Sluis","van Gelder","Martens","van Asselt","Timmermans","van Vliet","van Rijn","van Schaik","Bosman","Wolters","van Hout","Hermans","van Rooij","de Vos","van Donselaar","Evers","van den Brink","Verkerk","Groeneveld","van Duijn","Schuurman","Hoogendoorn","van Zanten","Koopman","Cornelissen","van Driel","Teunissen","Versteeg","van Deursen","Schipper","van Kempen","Bouwman","van der Valk","Nijhuis","van der Werf","van den Akker","Verhoef","Wessels","van der Poel","Driessen","van Oosten","Lambrechts","van der Vlist","Hoogeveen","van Gils","Rietveld","Barendrecht","van der Spek","Stam","van der Linde","Boersma","van Dijk","Schepers","van der Kolk","Roelofs","van der Velden","van den Burg","Westra","van der Steen","Pronk","van der Veer","Rozendaal","van den Bos","Konings","van der Wiel","Noordam","van der Laan","Schut","van der Vlugt","Witteveen","van der Zwan","Boogaard","van der Waal","Stolk","van der Windt","Rutten","van der Zanden","Spaans","van der Zwaan","Roos","van der Zijl","Schoenmaker","van Diepen","Romeijn","van Doesburg","Schippers","van Eck","Rijken","van Egmond","Schrama","van Eijk","Ruijter","van Engelen","Sanders","van Es","Schenk","van Essen","van Gaal","van Geenen","van Gent","van Gestel","van Gool","van Grinsven","van Gurp","van Haaften","van Haren","van Hattem","van Hees"],nB=class extends pd{getFirstNamesMaleJson(){return eB}getFirstNamesFemaleJson(){return tB}getLastNamesJson(){return aB}},rB=["Müller","Schmidt","Schneider","Fischer","Weber","Meyer","Wagner","Schulz","Becker","Hoffmann","Schäfer","Koch","Richter","Bauer","Klein","Wolf","Schröder","Neumann","Schwarz","Zimmermann","Braun","Hofmann","Krüger","Hartmann","Lange","Schmitt","Werner","Schmitz","Krause","Meier","Lehmann","Schmid","Schulze","Maier","Köhler","Herrmann","Walter","König","Mayer","Huber","Kaiser","Fuchs","Peters","Lang","Scholz","Möller","Weiß","Jung","Hahn","Schubert","Vogel","Friedrich","Günther","Keller","Winkler","Frank","Berger","Roth","Beck","Lorenz","Baumann","Franke","Albrecht","Schuster","Simon","Ludwig","Böhm","Winter","Kraus","Martin","Schumacher","Krämer","Vogt","Otto","Jäger","Stein","Groß","Sommer","Seidel","Heinrich","Haas","Brandt","Schreiber","Graf","Dietrich","Schulte","Kühn","Ziegler","Kuhn","Pohl","Engel","Horn","Bergmann","Voigt","Busch","Thomas","Sauer","Arnold","Pfeiffer","Wolff","Beyer","Seifert","Ernst","Lindner","Hübner","Kramer","Jansen","Franz","Peter","Hansen","Wenzel","Götz","Paul","Riedel","Barth","Kern","Hermann","Nagel","Wilhelm","Ott","Bock","Langer","Grimm","Ritter","Haase","Lenz","Förster","Mohr","Kruse","Schumann","Jahn","Thiel","Kaufmann","Zimmer","Hoppe","Petersen","Fiedler","Berg","Arndt","Marx","Lutz","Fritz","Kraft","Michel","Walther","Böttcher","Schütz","Eckert","Sander","Thiele","Reuter","Reinhardt","Schindler","Ebert","Kunz","Schilling","Schramm","Voß","Nowak","Hein","Hesse","Frey","Rudolph","Fröhlich","Beckmann","Kunze","Herzog","Bayer","Behrens","Stephan","Büttner","Gruber","Adam","Gärtner","Witt","Maurer","Bender","Bachmann","Schultz","Seitz","Geiger","Stahl","Steiner","Scherer","Kirchner","Dietz","Ullrich","Kurz","Breuer","Gerlach","Ulrich","Brinkmann","Fink","Heinz","Löffler","Reichert","Naumann","Böhme","Schröter","Blum","Göbel","Moser","Schlüter","Brunner","Körner","Schenk","Wirth","Wegner","Brand","Wendt","Stark","Schwab","Krebs","Heller","Wolter","Reimann","Rieger","Unger","Binder","Bruns","Döring","Menzel","Buchholz","Ackermann","Rose","Meißner","Janssen","Bartsch","May","Hirsch","Jakob","Schiller","Kopp","John","Hinz","Bach","Pfeifer","Bischoff","Engelhardt","Wilke","Sturm","Hildebrandt","Siebert","Urban","Link","Rohde","Kohl","Linke","Wittmann","Fricke","Köster","Gebhardt","Weiss","Vetter","Freitag","Nickel","Hennig","Rau","Münch","Witte","Noack","Renner","Westphal","Reich","Will","Baier","Kolb","Brückner","Marquardt","Kiefer","Keil","Henning","Heinze","Funk","Lemke","Ahrens","Esser","Pieper","Baum","Conrad","Schlegel","Fuhrmann","Decker","Jacob","Held","Röder","Berndt","Hanke","Kirsch","Neubauer","Hammer","Stoll","Erdmann","Mann","Philipp","Schön","Wiese","Kremer","Bartels","Klose","Mertens","Schreiner","Dittrich","Krieger","Kröger","Krug","Harms","Henke","Großmann","Martens","Heß","Schrader","Strauß","Adler","Herbst","Kühne","Heine","Konrad","Kluge","Henkel","Wiedemann","Albert","Popp","Wimmer","Karl","Wahl","Stadler","Hamann","Kuhlmann","Steffen","Lindemann","Fritsch","Bernhardt","Burkhardt","Preuß","Metzger","Bader","Nolte","Hauser","Blank","Beier","Klaus","Probst","Hess","Zander","Miller","Niemann","Funke","Haupt","Burger","Bode","Holz","Jost","Rauch","Rothe","Herold","Jordan","Anders","Fleischer","Wiegand","Hartung","Janßen","Lohmann","Krauß","Vollmer","Baur","Heinemann","Wild","Brenner","Reichel","Wetzel","Christ","Rausch","Hummel","Reiter","Mayr","Knoll","Kroll","Wegener","Beer","Schade","Neubert","Merz","Schüler","Strobel","Diehl","Behrendt","Glaser","Feldmann","Hagen","Jacobs","Rupp","Geißler","Straub","Hohmann","Römer","Stock","Haag","Meister","Freund","Dörr","Kessler","Betz","Seiler","Altmann","Weise","Metz","Eder","Busse","Mai","Wunderlich","Schütte","Hentschel","Voss","Weis","Heck","Born","Falk","Raab","Lauer","Völker","Bittner","Merkel","Sonntag","Moritz","Ehlers","Bertram","Hartwig","Rapp","Gerber","Zeller","Scharf","Pietsch","Kellner","Bär","Eichhorn","Giese","Wulf","Block","Opitz","Gottschalk","Jürgens","Greiner","Wieland","Benz","Keßler","Steffens","Heil","Seeger","Stumpf","Gross","Bühler","Eberhardt","Hiller","Buck","Weigel","Schweizer","Albers","Heuer","Pape","Hempel","Schott","Schütze","Scheffler","Engelmann","Wiesner","Runge","Geyer","Neuhaus","Forster","Oswald","Radtke","Heim","Geisler","Appel","Weidner","Seidl","Moll","Dorn","Klemm","Barthel","Gabriel","Springer","Timm","Engels","Kretschmer","Reimer","Steinbach","Hensel","Wichmann","Eichler","Hecht","Winkelmann","Heise","Noll","Fleischmann","Neugebauer","Hinrichs","Schaller","Lechner","Brandl","Mack","Gebauer","Siegel","Zahn","Singer","Michels","Schuler","Scholl","Uhlig","Brüggemann","Specht","Bürger","Eggert","Baumgartner","Weller","Schnell","Börner","Brauer","Kohler","Pfaff","Auer","Drescher","Otte","Frenzel","Petzold","Rother","Hagemann","Sattler","Wirtz","Ruf","Schirmer","Sauter","Schürmann","Junker","Walz","Dreyer","Sievers","Haller","Prinz","Stolz","Hausmann","Dick","Lux","Schnabel","Elsner","Kühl","Gerhardt","Klotz","Rabe","Schick","Faber","Riedl","Kranz","Fries","Reichelt","Rösch","Langner","Maaß","Wittig","Geier","Finke","Kasper","Maas","Bremer","Rath","Knapp","Dittmann","Kahl","Volk","Faust","Harder","Biermann","Pütz","Kempf","Mielke","Michaelis","Yilmaz","Abel","Thieme","Schütt","Hauck","Cordes","Eberle","Schaefer","Wehner","Haug","Fritzsche","Kilian","Eggers","Große","Matthes","Reinhold","Paulus","Dürr","Bohn","Thoma","Schober","Koller","Korn","Höhne","Hering","Gerdes","Ullmann","Jensen","Endres","Bernhard","Leonhardt","Eckhardt","Schaaf","Höfer","Junge","Rademacher","Pilz","Hellwig","Knorr","Helbig","Melzer","Lippert","Evers","Bahr","Klinger","Heitmann","Ehrhardt","Heinrichs","Horstmann","Behr","Stöhr","Drews","Rudolf","Sieber","Theis","Groth","Hecker","Weiler","Kemper","Rost","Lück","Claus","Hildebrand","Steinmetz","Götze","Trautmann","Blume","Kurth","Augustin","Nitsche","Janke","Jahnke","Klug","Damm","Heimann","Strauch","Schlosser","Uhl","Böhmer","Ries","Hellmann","Höhn","Hertel","Dreher","Borchert","Huth","Sperling","Just","Stenzel","Kunkel","Lau","Sprenger","Schönfeld","Pohlmann","Heilmann","Wacker","Lehner","Teichmann","Kaminski","Vogl","Gehrke","Hartl","Vogler","Schroeder","Thomsen","Nitschke","Engler","Liedtke","Wille","Starke","Friedrichs","Kirchhoff","Schwarze","Balzer","Reinhard","Heinen","Lotz","Küster","Kretzschmar","Schöne","Clemens","Hornung","Ulbrich","Renz","Hofer","Ruppert","Lohse","Schuh","Amann","Westermann","Stiller","Burmeister","Alt","Hampel","Brockmann","Wessel","Späth","Hoyer","Mader","Bartel","Rößler","Krieg","Grote","Schwarzer","Schweitzer","Scheer","Bosch","Zink","Roos","Wagener","Oppermann","Henze","Lehnert","Seemann","Trapp","Reiß","David","Pfeffer","Grau","Horst","Diekmann","Korte","Rehm","Wilde","Schleicher","Lampe","Grundmann","Veit","Daniel","Eisele","Hafner","Steinert","Sachs","Pfister","Kühnel","Schüller","Klatt","Bischof","Wendel","Tietz","Frick","Buschmann","Steinke","Menke","Baumeister","Kirschner","Loos","Ebner","Kastner","Wolters","Orth","Stange","Becher","Helm","Knobloch","Wörner","Heyer","Nguyen","Baumgärtner","Grund","Brüning","Ostermann","Cremer","Schauer","Jacobi","Ewald","Fürst","Widmann","Otten","Büchner","Petri","Fritsche","Kock","Ehlert","Kleine","Eckstein","Hacker","Brandes","Buchner","Hagedorn","Keck","Häusler","Muth","Apel","Heuser","Bastian","Kersten","Stamm","Niemeyer","Berthold","Gehrmann","Weinert","Schatz","Hager","Volkmann","Michael","Wieczorek","Wilms","Burghardt","Schultze","Merten","Schwartz","Kling","Rode","Neu","Mende","Thies","Böttger","Schell","Spindler","Pabst","Grün","Weiland","Mühlbauer","Hanisch","Doll","Janzen","Adams","Hermes","Haack","Cramer","Spies","Stern","Kugler","Budde","Jakobs","Scheller","Rösler","Reiser","Jonas","Herr","Ebeling","Wulff","Pauli","Löhr","Lukas","Rahn","Sachse","Köhn","Backhaus","Mahler","Hille","Kowalski","Heidrich","Brück","Gottwald","Heidenreich","Baumgarten","Hamm","Körber","Kübler","Frisch","Hardt","Enders","Bräuer","Seidler","Küpper","Lauterbach","Zeidler","Eckardt","Kreuzer","Schiffer","Schaper","Gehring","Hannemann","Ortmann","Petry","Thiemann","Tiedemann","Grünewald","Johannsen","Scheel","Volz","Kunert","Dieckmann","Bormann","Obermeier","Knauer","Schaub","Eilers","Berner","Pahl","Reinecke","Herz","Henn","Brehm","Hoff","Resch","Ochs","Krohn","Lerch","Raabe","Ehrlich","Hack","Friedl","Reis","Rogge","Meurer","Thelen","Drechsler","Hölscher","Morgenstern","Sommerfeld","Ebel","Kellermann","Rupprecht","Post","Hillebrand","Hill","Paulsen","Grabowski","Bolz","Lorenzen","Welsch","Seibel","Kleinert","Schröer","Jaeger","Wächter","Boldt","Palm","Kratz","Reimers","Pusch","Exner","Dietze","Wüst","Andres","Heide","Kaya","Reichardt","Kummer","Metzner","Grube","Ewert","Grunwald","Habermann","Zorn","Fichtner","Emmerich","Mangold","Reif","Ahlers","Kästner","Küppers","Petermann","Stratmann","Sailer","Schuhmacher","Hoch","Struck","Buchmann","Rauscher","Lüdtke","Wendler","Dreier","Zöller","Bucher","Siegert","Finger","Hopf","Rieck","Friese","Hopp","Sahin","Henrich","Spengler"],iB=["Michael","Peter","Hans","Klaus","Wolfgang","Thomas","Jürgen","Andreas","Bernd","Manfred","Rainer","Uwe","Dieter","Joachim","Karl","Holger","Werner","Ralf","Frank","Norbert","Ulrich","Rolf","Jörg","Gerhard","Günther","Helmut","Harald","Jens","Horst","Heinz","Reinhardt","Martin","Detlef","Stefan","Matthias","Volker","Christian","Gerd","Rüdiger","Alexander","Bernhard","Hartmut","Walter","Herbert","Georg","Ronald","Axel","Roland","Dirk","Josef","Lothar","Wilfried","Jan","Karsten","Udo","Ingo","Hermann","Kurt","Olaf","Franz","Siegfried","Dietmar","Mohammed","Heinrich","Alfred","Christoph","Viktor","Lutz","Johannes","Torsten","Kai","Rudolf","Richard","Waldemar","Robert","Jörn","Johann","Ernst","Reinhold","Eckhard","Friedrich","Burghard","Wilhelm","Heiko","Jochen","Harry","Hubert","Paul","Erich","Fred","Achim","Ali","Wolf","Erwin","Mario","Andre","Eberhard","Winfried","Heino","Sven","Willi","Ulf","Bodo","Henry","Vladimir","Dietrich","John","Armin","Edgar","Friedhelm","Gunnar","Arno","Fritz","Gerald","Henning","Abdul","Karlheinz","Andrzej","Markus","Otto","Roman","Knut","Wolfram","Nobert","Gunther","Konrad","Heiner","Mehmet","Nils","Bruno"],sB=["Thomas","Michael","Andreas","Stefan","Frank","Torsten","Peter","Jörg","Ralf","Matthias","Christian","Dirk","Jens","Martin","Klaus","Jürgen","Karsten","Uwe","Bernd","Markus","Oliver","Sven","Wolfgang","Holger","Olaf","Hans","Rainer","Kai","Jan","Volker","Joachim","Christoph","Alexander","Axel","Heiko","Norbert","Manfred","Andre","Dieter","Robert","Ulrich","Detlef","Harald","Ingo","Marc","Roland","Lars","Rolf","Marco","Jochen","Guido","Mike","Jörn","Georg","Gerhard","Rüdiger","Mario","Lutz","Bernhard","Nils","Udo","Dietmar","Gerd","Karl","Horst","Günther","Steffen","Johannes","Werner","Ronald","Arne","Daniel","Helmut","Achim","Mohammed","René","Ulf","Hartmut","Björn","Erik","Heinz","Patrick","Viktor","Walter","Ali","Gerald","Reinhardt","Henning","Tobias","Mehmet","Armin","Sebastian","Helge","Gunnar","Richard","Waldemar","Josef","Knut","Boris","Hermann","Paul","Burghard","Florian","Lothar","Sönke","Tim","Philipp","Franz","Clemens","Wilfried","Siegfried","Johann","Ahmet","Eckhard","Fred","Heinrich","Roman","John","Arno","Mustafa","Hasan","Gregor","Alfred","Arnd","Rudolf","Sergej","David","Manuel","Marcel","Friedrich","José","Marek","Mirko","Sascha","Thilo","Bodo","Darius","Hendrik","Herbert","Nikolai","Wolf","Nikola","Roger","Edgar","Ernst","Henry","Wolfram","Christopher","Vladimir","Gunther","Hüseyin","Harry","Hauke","Wilhelm","Arthur","Winfried","Henrik","Antonio","Felix","Anton","Bruno","Igor","Götz","Tom","Heino","Abdul","Miroslaw","Sören","Bert","Elmar","Hubert","Kurt","Ole","Tillmann","Ahmad","Andrej","Dennis","Adam","Ibrahim","Malte","Raphael","Reinhold","Eduard","Erwin","Marius","Nikolaus","Carlos","Ismail","Nico","Gernot","Jacek","Nicolas","Peer","Albert","Heiner","Timo","Andrzej","Jean","Berthold","Hanno"],oB=["Christian","Michael","Stefan","Andreas","Markus","Thomas","Matthias","Sven","Jan","Alexander","Oliver","Martin","Torsten","Frank","Marco","Marc","Jens","Daniel","Karsten","Andre","Sebastian","Lars","Dirk","Tobias","Jörg","Sascha","Kai","Florian","Christoph","Björn","Peter","Dennis","Mike","Ralf","Patrick","Robert","Holger","René","Nils","Heiko","Mario","Philipp","Olaf","Steffen","Tim","Timo","Ingo","Jürgen","Volker","Marcel","Benjamin","Bernd","Axel","Arne","Klaus","David","Jörn","Felix","Boris","Henning","Wolfgang","Uwe","Mirko","Torben","Johannes","Nico","Manuel","Jochen","Hans","Ali","Joachim","Malte","Mohammed","Roland","Simon","Rainer","Fabian","Gunnar","Ulrich","Ronny","Mehmet","Erik","Guido","Sergej","Hendrik","Viktor","Dominik","Roman","Georg","Bastian","Murat","Helge","Sören","Christopher","Karl","Andrej","Mustafa","Ulf","Lutz","Ole","Ahmet","Moritz","Enrico","Nicolas","Sönke","Paul","Harald","Norbert","Henrik","Raphael","Nikolai","Tom","Danny","Gerrit","Hasan","Gregor","Arthur","Bernhard","Marius","Konstantin","Achim","Norman","John","Thilo","Waldemar","Julian","Clemens","Hakan","Till","Ronald","Eduard","Erkan","Hauke","Manfred","Rüdiger","Adam","Ahmad","Klaas","Ibrahim","Vladimir","Adrian","Eugen","Falk","Maximilian","Richard","Andy","Frederik","Marek","Tino","Kevin","Knut","Pascal","Arnd","Detlef","Gerald","Max","Darius","Heinrich","Hüseyin","Igor","Alexej","Dieter","Eike","Tomasz","Wilhelm","Dietmar","Franz","Gerhard","Johann","Antonio","José","Rolf","Abdul","Peer","Ismail","Nikola","Bülent","Gerd","Jakob","Lukas","Niklas","Robin","Gordon","Friedrich","Jonas","Leif","Michel","Hermann","Oleg","Sandro","Tillmann","Burghard","Henry","Jean","Steven","Benedikt","Nikolaus","Ricardo","Roberto","Vitali","Amir","Günther","Helmut","Ivan","Rico","Falko","Jacek","Kim","Krzysztof","Piotr","Said","Silvio","Udo","Vitalij","Werner","Armin","Ayhan","Bodo","Carlos","Cengiz","Josef","Pierre","Ömer","Arno","Atilla","Birger","Dimitri","Georgios","Götz","Hagen","Hannes","Hartmut","Juan","Kolja","Marcin","Toni","Louis","Metin","Paulo","Pawel","Yusuf","Albert","Alex","Chris","Gunther","Lasse","Orhan","Ramazan","Rudolf","Walter"],lB=["Christian","Sebastian","Jan","Daniel","Stefan","Alexander","Michael","Dennis","Martin","Florian","Tobias","Matthias","Philipp","Patrick","Thomas","Benjamin","Andreas","Markus","Christoph","Marcel","Sven","Sascha","Tim","David","Felix","Johannes","Robert","Marco","Andre","Marc","Oliver","Christopher","Nils","Fabian","Simon","Björn","Timo","René","Dominik","Julian","Jens","Lars","Peter","Steffen","Manuel","Lukas","Moritz","Maximilian","Jonas","Mike","Kai","Frank","Paul","Kevin","Torben","Nico","Karsten","Torsten","Mario","Malte","Bastian","Hendrik","Max","Dirk","Pascal","Erik","Sören","Arne","Jakob","Nicolas","Konstantin","Niklas","Marius","Frederik","Roman","Henning","Jörg","Mirko","Mohammed","Viktor","Ali","Ralf","Raphael","Adrian","Danny","Steven","Ole","Hannes","Lennard","Benedikt","Georg","Marvin","Eugen","Robin","Jochen","Tom","Arthur","Heiko","Nikolai","Jannik","Till","Hans","Richard","Henrik","Pierre","Ronny","Sergej","Holger","Jannis","John","Boris","Jörn","Michel","Johann","Gregor","Klaus","Norman","Clemens","Hauke","Jonathan","Vincent","Enrico","Kim","Axel","Andrej","Toni","Karl","Waldemar","Bernd","Mehmet","Anton","Wolfgang","Ahmad","Mustafa","Andy","Ahmet","Lasse","Tino","Eike","Gerrit","Konrad","Joachim","Steve","Julius","Eduard","Murat","Dimitri","Friedrich","Gunnar","Jürgen","Adam","Ibrahim","Maurice","Klaas","Sönke","Bernhard","Igor","Tillmann","Alexej","Chris","Vladimir","Serkan","Thilo","Helge","Olaf","Roland","Gabriel","Nick","Falk","Nikola","Rico","Kolja","Leif","Pawel","Amir","Ingo","Jascha","Alex","Fatih","Gökhan","Hakan","Hasan","Kamil","Lutz","Marcin","Uwe","Achim","Finn","Samuel","Valentin","Vitali","Damian","Dustin","Franz","Leon","Darius","Erkan","Henry","Maxim","Peer"],cB=["Jan","Lukas","Philipp","Tim","Alexander","Daniel","Tobias","Dennis","Marcel","Felix","Kevin","Florian","Maximilian","Niklas","Jonas","Sebastian","Patrick","Fabian","Christian","Jannik","Julian","David","Marvin","Timo","Marc","Nico","Simon","Finn","Dominik","Nils","Leon","Pascal","Lennard","Max","Tom","Christopher","Benjamin","Moritz","Paul","Lars","Marco","Sven","Christoph","Robin","Johannes","Malte","Michael","Torben","Jakob","Matthias","Martin","Stefan","Mike","Andre","Jannis","Hendrik","Luca","Björn","Nicolas","Markus","René","Vincent","Jonathan","Steven","Frederik","Sascha","Thomas","Erik","Robert","Oliver","Andreas","Nick","Marius","Kai","Ole","Manuel","Joshua","Justin","Steffen","Adrian","Konstantin","Benedikt","Lasse","Louis","Maurice","Julius","Mirko","Anton","Till","John","Henrik","Henry","Bastian","Sören","Leonard","Raphael","Johann","Arne","Hannes","Michel","Karl","Mario","Ben","Mohammed","Viktor","Linus","Nikolai","Dustin","Aaron","Valentin","Peter","Toni","Henning","Marlon","Clemens","Danny","Justus","Jasper","Julien","Chris","Jens","Joel","Hauke","Kim","Richard","Gerrit","Cedric","Pierre","Karsten","Thore","Vivian","Mats","Ricardo","Arthur","Bennet","Fabio","Jannek","Kilian","Leo","Melvin","Noah","Samuel","Timon","Eike","Ali","Leif","Peer","Jean","Hans","Jeremy","Merlin","Jannes","Calvin","Jona","Elias","Lorenz","Marten","Can","Dario","Georg","Ahmet","Enrico","Oskar","Tristan","Jascha","Roman","Colin","Gabriel","Jason","Klaas","Morten","Nikola","Phil","Sönke","Alex","Cem","Konrad","Mattis","Rico","Armin","Brian","Frank","Gregor","Ralf","Thies","Norman","Ruben","Ahmad","Emre","Levin","Mehmet","Torge","Torsten","Bjarne","Kornelius","Steve","Jerome","Marek","Sandro","Thilo","Franz","Kenneth","Axel","Burak","Jörn","Kjell","Milan","Tjark","Kolja","Miguel","Tillmann","Emil","Friedrich","Lion","Rasmus","Tino","Caspar","Mert","Amir","Ibrahim","Joe","Leonhard","Mustafa","Onur","Ferdinand","Joscha","Laurenz","Maxim","Sam","Yasin","Antonio","Jeffrey","Jendrik","Nikolaus","Philippe","Sinan","Damian","Dirk","Fritz","Helge","Juri","Leander","Matti","Michele","Nino","Rouven","Said","Tarek","Theo","Timothy"],uB=["Leon","Lukas","Luca","Jonas","Tim","Finn","Paul","Felix","Maximilian","Louis","Niklas","Max","Ben","Julian","Jan","Philipp","Elias","Moritz","Noah","Jannik","Jannis","Tom","Nico","Simon","David","Alexander","Fabian","Erik","Jakob","Florian","Nils","Justin","Lennard","Nick","Linus","Daniel","Tobias","Jason","Dominik","Colin","Marvin","Mika","Sebastian","Kevin","Johannes","Julius","Robin","Jonathan","Henry","Hannes","Anton","Vincent","Benjamin","Marlon","Timo","Lenny","Adrian","Marc","Joel","Raphael","Dennis","Till","Joshua","Aaron","Emil","Pascal","Ole","Leonard","Leo","Lasse","Marcel","Samuel","Konstantin","Karl","Oskar","Lars","Lennox","Mattis","Jona","Kilian","Christian","Maurice","Justus","Jamie","Oliver","Malte","Silas","Michael","Mohammed","Jeremy","John","Phil","Bastian","Maxim","Johann","Liam","Nicolas","Mike","Levin","Benedikt","Marco","Noel","Luke","Bennet","Cedric","Gabriel","Theo","Matteo","Tyler","Valentin","Fabio","Marius","Jayden","Toni","Richard","Mats","Hendrik","Jannes","Henrik","Julien","Manuel","Arthur","Patrick","Matthias","Frederik","Connor","Tristan","Torben","Markus","Kai","Martin","Arda","Andreas","Damian","Timon","Franz","Michel","Levi","Finley","Robert","Thomas","Ian","Arne","Dustin","Christopher","Christoph","Bruno","Diego","Matti","Clemens","Leander","Magnus","Milan","Danny","Laurin","Lorenz","Laurenz","Sven","Ali","Leandro","Steven","Chris","Dean","Lenn","Pepe","Jasper","Konrad","Devin","Can","Domenik","Friedrich","Sean","Kian","Sam","Kjell","Ryan","Andre","Bjarne","Ruben","Stefan","Nikita","René","Peter","Hugo","Melvin","Jean","Leopold","Malik","Willi","Fritz","Leonardo","Quentin","Ahmet","Enrico","Emilio","Brian","Ferdinand","Antonio","Marten","Nevio","Thore","Joris","Leonhard","Roman","Anthony","Viktor","Henning","Sascha","Alex","Adam","Elia","Josef","Theodor","Jaron","Leif","Georg","Piet","Alessandro","Kaan","Lion","Miguel","Alessio","Carlos","Luan","Ilyas","Ricardo","Yusuf","Jannek","Mert","Peer","Yasin","Enes","Marek","Nino","Arian","Carlo","Janne","Gustav","Hasan","Mattes","Mustafa","William","Jerome","Milo","Dario","Mehmet","Hans","Thilo","Neo","Sören","Mirko","Sandro","Tamino","Emilian","Björn","Korbinian","Pierre","Emanuel","Bela","Benno","Merlin","Tino","Keno","Ludwig","Emre","Jordan","Kerem","Gianluca","Ibrahim","Jesse","Mario","Tjark","Eddy","Lian","Fiete","Etienne","Klaas","Marian","Efe","Jack","Calvin","Semih","Rico","Mick","Darian","Joost","Tommy","Angelo","Romeo","Keanu","Kurt","Raik","Tammo","Dylan","Nikolai","Thies","Armin","Darius","Maddox","Rasmus"],dB=["Ben","Leon","Paul","Jonas","Finn","Lukas","Louis","Luca","Noah","Elias","Felix","Maximilian","Max","Henry","Julian","Moritz","Tim","Emil","Jakob","Philipp","Niklas","Oskar","David","Anton","Alexander","Liam","Matteo","Theo","Tom","Jan"],mB=["Noah","Matteo","Leon","Elias","Finn","Paul","Luca","Emil","Louis","Theo","Henry","Felix","Ben","Liam","Leo","Lukas","Jonas","Jakob","Anton","Oskar","Maximilian","Mohammed","Levi","Milan","Jona","David","Karl","Jannis","Lio","Moritz","Adam","Max","Samuel","Mats","Alexander","Jonathan","Raphael","Aaron","Linus","Julian","Milo","Theodor","Carlo","Philipp","Valentin","Leonard","Erik","Mika","Johann","Niklas"],fB=["Angelika","Monika","Sabine","Karin","Petra","Gabriele","Birgit","Brigitte","Renate","Susanne","Barbara","Ursula","Ute","Marion","Jutta","Ingrid","Cornelia","Heike","Maria","Regina","Elke","Silvia","Andrea","Ulrike","Gisela","Angela","Bärbel","Christine","Martina","Christiane","Doris","Helga","Dagmar","Sigrid","Christa","Gudrun","Beate","Rita","Hannelore","Marlies","Eva","Claudia","Anke","Marianne","Annette","Elisabeth","Astrid","Erika","Heidi","Christel","Rosemarie","Anna","Bettina","Gabriela","Roswita","Ilona","Annegret","Evelyn","Sonja","Inge","Christina","Carmen","Irene","Kirsten","Lydia","Silke","Marina","Margret","Marita","Ruth","Maren","Sibylle","Waltraud","Ingeborg","Katharina","Vera","Heidemarie","Kerstin","Heidrun","Margrit","Carola","Iris","Antje","Katrin","Margit","Manuela","Veronika","Olga","Anne","Dorothea","Hildegard","Irmgard","Edith","Uta","Regine","Margarete","Anita","Frauke","Karen","Valentina","Anja","Tatjana","Ellen","Edeltraud","Verena","Dörte","Ilse","Gerda","Ines","Britta","Corinna","Elvira","Michaela","Annemarie","Anneliese","Gertrud","Gitta","Marie","Susann","Maike","Stefanie","Danuta","Gunda","Margot","Johanna","Irina","Ina","Theresa","Nina","Wiebke"],gB=["Sabine","Susanne","Petra","Andrea","Claudia","Birgit","Martina","Anja","Heike","Kerstin","Bettina","Gabriele","Katrin","Silke","Ute","Christine","Stefanie","Monika","Britta","Ulrike","Barbara","Kirsten","Silvia","Karin","Annette","Christiane","Beate","Manuela","Angela","Anke","Nicole","Marion","Cornelia","Christina","Angelika","Astrid","Elke","Michaela","Regina","Dagmar","Katja","Brigitte","Maria","Iris","Jutta","Antje","Tanja","Doris","Maike","Simone","Maren","Corinna","Sonja","Daniela","Carola","Alexandra","Eva","Ursula","Carmen","Sandra","Karen","Ines","Marina","Katharina","Elisabeth","Bärbel","Renate","Gaby","Anne","Anna","Gabriela","Sibylle","Heidi","Uta","Ina","Sigrid","Frauke","Ilona","Ingrid","Gudrun","Wiebke","Tatjana","Yvonne","Carolin","Patricia","Dörte","Susann","Birte","Rita","Julia","Irina","Bianca","Nikola","Ilka","Olga","Jeanette","Marlies","Helga","Melanie","Verena","Vera","Regine","Kirstin","Evelyn","Irene","Lydia","Christa","Annett","Marianne","Dorothea","Annegret","Elena","Gisela","Imke","Isabell","Heidrun","Viola","Diana","Esther","Susan","Inga","Judith","Ruth","Cordula","Jacqueline","Kai","Veronika","Carina","Roswita","Constanze","Marita","Natalie","Ramona","Ellen","Erika","Fatma","Nina","Svetlana","Dorothee","Inge","Nadja","Jasmin","Anita","Franziska","Friederike","Marie","Svenja","Jessica","Natascha","Rosemarie","Valentina","Ayse","Linda","Beatrix","Johanna","Ariane","Gesa","Larissa","Malgorzata","Miriam","Gunda","Margarete","Natalia","Almut","Ewa","Gitta","Jolanta","Babette","Beatrice","Christel","Christin","Sabrina","Dorit","Jana","Juliane","Hilke","Margret","Beata","Galina","Liane","Danuta","Elvira","Ingeborg","Rosa","Emine","Grit","Hannah","Sabina","Agnes","Edith","Gundula","Inken","Maja","Margit","Bozena","Helena","Theresa","Elzbieta","Hannelore","Tina"],hB=["Nicole","Stefanie","Sandra","Katrin","Claudia","Tanja","Anja","Melanie","Andrea","Daniela","Julia","Susanne","Katja","Christina","Kerstin","Silke","Sabine","Alexandra","Yvonne","Sonja","Nadine","Nina","Simone","Maike","Petra","Christine","Britta","Martina","Anna","Michaela","Manuela","Bianca","Katharina","Silvia","Bettina","Heike","Ulrike","Birgit","Anke","Christiane","Jessica","Monika","Maren","Eva","Anne","Antje","Diana","Jana","Cornelia","Wiebke","Kirsten","Miriam","Tina","Carolin","Astrid","Annette","Maria","Annika","Jennifer","Tatjana","Angela","Corinna","Barbara","Verena","Elena","Jasmin","Birte","Inga","Olga","Natalie","Ines","Iris","Ina","Marion","Beate","Irina","Svenja","Judith","Carina","Sarah","Patricia","Karin","Carmen","Franziska","Janine","Juliane","Saskia","Carola","Doreen","Frauke","Marina","Ute","Isabell","Annett","Christin","Karen","Mandy","Nadja","Svetlana","Natalia","Gabriele","Sabrina","Elke","Ramona","Natascha","Friederike","Ilka","Vanessa","Dagmar","Imke","Jeanette","Dörte","Angelika","Nikola","Rebecca","Regina","Janina","Kirstin","Johanna","Jutta","Elisabeth","Anita","Mareike","Sibylle","Maja","Esther","Vera","Agnieszka","Jenny","Peggy","Ariane","Hannah","Steffi","Joana","Victoria","Magdalena","Fatma","Lena","Sina","Doris","Uta","Larissa","Marie","Evelyn","Ann","Constanze","Jacqueline","Kati","Lydia","Agnes","Dana","Dorothea","Ilona","Kim","Ayse","Gaby","Katarzyna","Mirja","Pamela","Heidi","Helena","Viola","Isabella","Susann","Cindy","Cordula","Emine","Kathleen","Nancy","Beata","Denise","Susan","Ursula","Veronika","Brigitte","Gesa","Martha","Mirjam","Beatrice","Hatice","Dorothee","Linda","Malgorzata","Pia","Grit","Irene","Filiz","Yasemin","Berit","Ellen","Janet","Laura","Lisa","Renate","Ruth","Ewa","Gabriela","Ingrid","Liane","Mariam","Monique","Tamara","Antonia","Svantje","Alice","Margarete","Nele","Manja","Nora","Oksana","Özlem","Nadia","Ricarda","Bärbel","Carolina","Hülya","Inken","Rita","Sophie","Valentina","Violetta","Vivien","Britt","Inna","Leyla","Arzu","Kai","Natalja","Sandy","Silvana","Sophia","Beatrix","Ludmilla","Romy","Selma","Elvira","Helene","Henrike","Oxana","Rabea","Sabina","Wenke","Annegret","Aylin","Charlotte","Dorit","Emma","Jeannine","Marianne","Mona"],AB=["Julia","Stefanie","Anna","Katharina","Katrin","Sarah","Sandra","Nadine","Melanie","Christina","Jennifer","Nicole","Sabrina","Jessica","Annika","Claudia","Nina","Anne","Daniela","Franziska","Anja","Carolin","Jasmin","Christin","Katja","Janina","Jana","Janine","Yvonne","Alexandra","Svenja","Maike","Lena","Laura","Maria","Tanja","Susanne","Lisa","Andrea","Christine","Miriam","Sonja","Johanna","Ann","Sabine","Vanessa","Kerstin","Natalie","Bianca","Eva","Mareike","Marie","Verena","Jacqueline","Isabell","Hannah","Saskia","Simone","Tina","Juliane","Maren","Elena","Rebecca","Martina","Christiane","Carina","Mandy","Olga","Denise","Wiebke","Diana","Marina","Tatjana","Jenny","Manuela","Linda","Michaela","Nadja","Inga","Antje","Corinna","Patricia","Silvia","Ulrike","Kim","Judith","Ines","Monika","Birte","Ina","Victoria","Elisabeth","Theresa","Sina","Irina","Sophie","Silke","Friederike","Britta","Nora","Lea","Nele","Natascha","Bettina","Doreen","Barbara","Angela","Ramona","Cornelia","Anke","Natalia","Magdalena","Nancy","Annette","Astrid","Aylin","Susann","Kathleen","Alina","Lydia","Joana","Kirsten","Jeanette","Martha","Heike","Mona","Anita","Dana","Veronika","Yasemin","Sophia","Carolina","Svetlana","Esther","Charlotte","Antonia","Constanze","Vivien","Luisa","Svantje","Helena","Petra","Steffi","Pia","Susan","Monique","Lina","Mariam","Vera","Merle","Angelika","Karin","Maja","Frauke","Agnes","Isabella","Josephine","Frederike","Michelle","Carmen","Carola","Cindy","Madeleine","Janna","Larissa","Gina","Marlene","Anastasia","Elisa","Regina","Viola","Özlem","Alice","Evelyn","Marleen","Dominique","Lara","Karen","Nikola","Marion","Annabell","Annett","Dorothea","Iris","Henrike","Kira","Mirja","Camilla","Ronja","Valentina","Alena","Ariane","Dorothee","Fatma","Gesa","Agnieszka","Birgit","Ricarda","Sandy","Beate"],pB=["Julia","Anna","Sarah","Lisa","Laura","Katharina","Lena","Vanessa","Annika","Jennifer","Jana","Lea","Marie","Jasmin","Franziska","Hannah","Jessica","Michelle","Nina","Alina","Johanna","Carolin","Christina","Kim","Nadine","Jacqueline","Ann","Luisa","Sophie","Lara","Natalie","Svenja","Sabrina","Isabell","Sandra","Janina","Melanie","Leonie","Antonia","Saskia","Stefanie","Aylin","Denise","Nele","Pia","Alexandra","Katrin","Sophia","Sina","Melina","Janine","Vivien","Rebecca","Anne","Miriam","Victoria","Nicole","Mareike","Lina","Josephine","Merle","Clara","Maria","Maike","Charlotte","Celina","Paula","Carina","Larissa","Christin","Linda","Mandy","Theresa","Kimberly","Elena","Melissa","Jule","Celine","Daniela","Jenny","Kira","Patricia","Ronja","Bianca","Eva","Sonja","Joana","Gina","Tanja","Nora","Yvonne","Pauline","Emily","Natascha","Anja","Marina","Friederike","Angelina","Nadja","Paulina","Lynn","Alicia","Svea","Amelie","Katja","Juliane","Lilly","Marlene","Verena","Chantal","Milena","Maja","Chiara","Selina","Alena","Carlotta","Mona","Annabell","Carla","Claudia","Tatjana","Maren","Elisabeth","Emma","Helena","Inga","Luise","Tamara","Christine","Fiona","Judith","Frederike","Finja","Jill","Fenja","Tina","Cindy","Ina","Janne","Marleen","Mia","Samantha","Annalena","Janika","Henrike","Wiebke","Elisa","Esther","Ricarda","Janna","Stella","Carolina","Dana","Helen","Madeleine","Mara","Simone","Corinna","Diana","Fabienne","Monique","Samira","Sandy","Tabea","Valerie","Malin","Andrea","Birte","Swantje","Veronika","Kerstin","Magdalena","Ramona","Susanne","Greta","Juli","Kaja","Lucy","Zoe","Angelique","Jasmina","Tessa","Lydia","Sabine","Dominique","Malina","Michaela","Charline","Monika","Karen","Mira","Yasemin","Alica","Alice","Alisa","Angelika","Emilia","Henriette","Marieke","Vera","Anneke","Felicia","Giulia","Liza","Maxi","Viola","Annkatrin","Lotta","Olivia","Anastasia","Dilara","Felicitas","Mariam","Marisa","Rieke","Rosa","Beatrice","Constanze","Dorothea","Isabella","Juliana","Katerina","Martina","Merve","Philine","Valentina","Justine","Melisa","Michele","Mika","Nancy","Selin","Alissa","Angela","Cara","Charleen","Deborah","Ellen","Imke","Irina","Jeanette","Leona","Lorena","Manuela","Martha","Silvia","Viviane","Aline","Desiree","Xenia"],yB=["Hannah","Leonie","Anna","Lea","Lena","Mia","Emily","Laura","Lara","Sarah","Emma","Lilly","Marie","Sophie","Nele","Johanna","Lina","Julia","Maja","Sophia","Lisa","Amelie","Alina","Luisa","Leni","Clara","Jana","Charlotte","Paula","Emilia","Jasmin","Zoe","Annika","Katharina","Chiara","Pia","Finja","Josephine","Angelina","Jule","Lucy","Melina","Antonia","Vanessa","Emely","Victoria","Celina","Michelle","Nina","Isabell","Franziska","Fiona","Amy","Celine","Maria","Pauline","Stella","Carolin","Lia","Marlene","Melissa","Ida","Greta","Selina","Helena","Aylin","Merle","Ronja","Sina","Vivien","Mara","Eva","Kim","Elisa","Theresa","Jolina","Mathilda","Jette","Lotta","Luise","Elena","Carla","Jessica","Larissa","Luna","Nelly","Alicia","Lana","Linda","Milena","Miriam","Samira","Frieda","Magdalena","Carlotta","Alexandra","Fabienne","Kira","Helene","Nora","Elisabeth","Natalie","Tabea","Romy","Anne","Paulina","Juli","Christina","Annalena","Kimberly","Samantha","Annabell","Ella","Lynn","Mira","Letizia","Jennifer","Carina","Aaliyah","Rebecca","Anastasia","Dana","Isabella","Diana","Olivia","Lenja","Mariella","Mila","Lucia","Martha","Leyla","Joana","Elina","Carolina","Xenia","Gina","Nicole","Janina","Saskia","Evelyn","Anni","Marleen","Melanie","Svenja","Svea","Chantal","Tessa","Maike","Fenja","Leona","Josie","Joline","Cheyenne","Lorena","Noemi","Helen","Ann","Alissa","Malin","Lilian","Lotte","Mina","Felicitas","Liv","Jenny","Jill","Valentina","Veronika","Alexa","Kaja","Rieke","Yara","Dilara","Tuana","Laila","Tamara","Alisa","Ela","Marina","Alessia","Luana","Patricia","Lene","Jacqueline","Janne","Henriette","Ashley","Franka","Milla","Florentine","Selin","Selma","Giulia","Mona","Lisann","Aleyna","Rosalie","Sonja","Elif","Thea","Maren","Enya","Nadine","Alisha","Freya","Jamie","Denise","Aurelia","Ina","Christin","Judith","Lilith","Alena","Felicia","Juliana","Sandra","Zoey","Linnea","Soraya","Nisa","Stefanie","Juliane","Daria","Jasmina","Josefin","Friederike","Marla","Rosa","Cara","Nika","Naomi","Vivian","Amina","Elli","Cora","Luca","Madita","Mailin","Marieke","Tara","Amira","Liana","Lydia","Joy","Madlen","Nike","Hailey","Madeleine","Mareike","Aimee","Cassandra","Heidi","Joyce","Alea","Janine","Jonna","Sydney","Alia","Ilayda","Livia","Maira","Leana","Valerie","Thalia","Ellen","Emmi","Melisa","Inga","Julina","Smilla","Katja","Melinda","Valeria","Anouk","Liliana","Sabrina","Wiebke","Joleen","Leandra","Zeynep","Katrin","Tamina","Jenna","Levke","Salome","Annelie","Cecilia","Annemarie","Jona","Mary","Mirja","Collien","Alice","Azra","Ceylin","Lavinia","Maxi","Anja","Henrike","Mariam"],EB=["Mia","Emma","Hannah","Sophia","Emilia","Anna","Lea","Lina","Marie","Lena","Leonie","Emily","Amelie","Luisa","Johanna","Clara","Sophie","Lilly","Mila","Leni","Laura","Lara","Nele","Maja","Charlotte","Sarah","Ella","Ida","Mathilda","Frieda"],bB=["Emilia","Sophia","Emma","Hannah","Mia","Lina","Mila","Ella","Clara","Lea","Marie","Leni","Lia","Mathilda","Ida","Anna","Frieda","Leonie","Emily","Maja","Lilly","Luisa","Charlotte","Amelie","Sophie","Lena","Johanna","Lara","Mira","Nora","Nele","Sarah","Malia","Lotta","Juna","Paula","Luna","Elisa","Maria","Romy","Laura","Helena","Thea","Mara","Victoria","Antonia","Elena","Tilda","Carla","Eva"],IB=class extends pd{getFirstNamesMaleJson(){return[]}getFirstNamesFemaleJson(){return[]}getLastNamesJson(){return rB}getFirstNamesMaleByDecade(){return[{startYear:1950,endYear:1959,names:iB},{startYear:1960,endYear:1969,names:sB},{startYear:1970,endYear:1979,names:oB},{startYear:1980,endYear:1989,names:lB},{startYear:1990,endYear:1999,names:cB},{startYear:2e3,endYear:2009,names:uB},{startYear:2010,endYear:2019,names:dB},{startYear:2020,endYear:2029,names:mB}]}getFirstNamesFemaleByDecade(){return[{startYear:1950,endYear:1959,names:fB},{startYear:1960,endYear:1969,names:gB},{startYear:1970,endYear:1979,names:hB},{startYear:1980,endYear:1989,names:AB},{startYear:1990,endYear:1999,names:pB},{startYear:2e3,endYear:2009,names:yB},{startYear:2010,endYear:2019,names:EB},{startYear:2020,endYear:2029,names:bB}]}},vB=["Rossi","Russo","Ferrari","Esposito","Bianchi","Romano","Colombo","Ricci","Marino","Greco","Bruno","Gallo","Conti","De Luca","Mancini","Costa","Giordano","Rizzo","Lombardi","Moretti","Barbieri","Fontana","Santoro","Mariani","Rinaldi","Caruso","Ferrara","Galli","Martini","Leone","Longo","Gentile","Martinelli","Vitale","Serra","Coppola","De Santis","D'Angelo","Marchetti","Parisi","Villa","Conte","Ferraro","Ferri","Fabbri","Bianco","Marini","Grasso","Valentini","Messina"],wB=["Giuseppe","Giovanni","Antonio","Mario","Luigi","Francesco","Angelo","Vincenzo","Pietro","Salvatore","Carlo","Franco","Pasquale","Domenico","Raffaele","Carmelo","Paolo","Sergio","Bruno","Luciano","Giorgio","Aldo","Renato","Piero","Guido","Nicola","Rosario","Vittorio","Michele","Umberto","Romano","Gino","Silvano","Renzo","Attilio","Augusto","Benito","Biagio","Cesare","Corrado","Dino","Egidio","Elio","Enzo","Ettore","Fausto","Felice","Ferdinando","Ferruccio","Gaetano","Gastone","Gennaro","Gerardo","Germano","Italo","Lino","Marino","Nello","Nino","Orazio","Orlando","Osvaldo","Ottavio","Primo","Remo","Rinaldo","Rocco","Ruggero","Severino","Silvio","Ugo","Valerio","Vasco","Walter","Agostino","Alfredo","Armando","Arturo","Claudio","Enrico","Giancarlo","Gianfranco","Alberto","Marcello","Roberto","Stefano","Mauro","Fabio","Maurizio","Massimo","Alessandro","Lorenzo","Andrea","Marco","Giuliano","Adriano","Gianni","Sandro","Leone"],CB=["Roberto","Stefano","Paolo","Marco","Luca","Alessandro","Massimo","Mauro","Fabrizio","Maurizio","Gianluca","Claudio","Giorgio","Piero","Gianfranco","Gianni","Valter","Ivan","Danilo","Moreno","Loris","Sandro","Dario","Nicola","Enrico","Alberto","Fabio","Giuseppe","Antonio","Giovanni","Francesco","Andrea","Michele","Daniele","Emanuele","Vittorio","Silvano","Romano","Giuliano","Tiziano","Massimiliano","Antonello","Arrigo","Aurelio","Bernardo","Carlo","Cesare","Corrado","Costantino","Damiano","Diego","Dino","Donatello","Duccio","Edmondo","Egidio","Elio","Enea","Ercole","Ermanno","Eros","Ezio","Fausto","Ferdinando","Fiorello","Flavio","Floriano","Folco","Franco","Fulvio","Gabriele","Gaetano","Gastone","Giacomo","Gianbattista","Giancarlo","Gianmaria","Gianpaolo","Gianpiero","Gilberto","Gino","Giordano","Gualtiero","Guido","Gustavo","Iacopo","Igor","Ilario","Italo","Ivano","Jacopo","Lamberto","Lando","Lanfranco","Lazzaro","Leo","Leonardo","Leone"],NB=["Alessandro","Andrea","Marco","Luca","Stefano","Davide","Gianluca","Fabio","Francesco","Massimo","Roberto","Simone","Daniele","Emanuele","Christian","Riccardo","Federico","Matteo","Gabriele","Michele","Lorenzo","Alessio","Nicola","Alberto","Fabrizio","Massimiliano","Giorgio","Enrico","Claudio","Paolo","Ivan","Mirko","Manuel","Denis","Igor","Omar","Cristian","Yuri","Alex","Samuel","Mattia","Pietro","Vincenzo","Angelo","Salvatore","Luigi","Domenico","Raffaele","Rosario","Carmelo","Pasquale","Diego","Dario","Giulio","Valerio","Maurizio","Gianni","Sandro","Loris","Moreno","Danilo","Tiziano","Antonello","Bernardo","Carlo","Cesare","Corrado","Costantino","Damiano","Demetrio","Dino","Edoardo","Elia","Emilio","Enzo","Ermanno","Eros","Eugenio","Fausto","Flavio","Fulvio","Gaetano","Gerardo","Gianbattista","Gianmaria","Gianpaolo","Gilberto","Giuliano","Iacopo","Leonardo","Marcello","Martino","Niccolò","Piero","Rinaldo","Ruggero","Samuele","Saverio","Sebastiano","Tommaso"],xB=["Marco","Andrea","Luca","Alessandro","Stefano","Daniele","Simone","Davide","Matteo","Francesco","Lorenzo","Federico","Gianluca","Fabio","Massimo","Emanuele","Riccardo","Nicola","Christian","Roberto","Michele","Giuseppe","Antonio","Giovanni","Paolo","Alberto","Filippo","Giorgio","Enrico","Tommaso","Giacomo","Mattia","Gabriele","Samuele","Pietro","Vincenzo","Angelo","Raffaele","Domenico","Rosario","Salvatore","Luigi","Mario","Carmelo","Pasquale","Alessio","Cristian","Manuel","Mirko","Ivan","Omar","Denis","Igor","Yuri","Alex","Samuel","Jacopo","Nicolò","Edoardo","Leonardo","Diego","Dario","Giulio","Valerio","Claudio","Mauro","Fabrizio","Maurizio","Gianni","Piero","Sandro","Loris","Moreno","Danilo","Valter","Silvano","Romano","Giuliano","Tiziano","Massimiliano","Antonello","Arrigo","Aurelio","Bernardo","Carlo","Cesare","Corrado","Costantino","Damiano","Demetrio","Dino","Elia","Emilio","Enzo","Ermanno","Eros","Eugenio","Fausto"],TB=["Matteo","Andrea","Luca","Alessandro","Davide","Lorenzo","Francesco","Simone","Marco","Mattia","Federico","Riccardo","Gabriele","Stefano","Daniele","Nicola","Christian","Giacomo","Filippo","Tommaso","Emanuele","Michele","Giuseppe","Antonio","Giovanni","Alberto","Giorgio","Enrico","Pietro","Samuele","Alessio","Edoardo","Leonardo","Diego","Nicolò","Manuel","Mirko","Ivan","Jacopo","Giulio","Valerio","Claudio","Paolo","Roberto","Vincenzo","Angelo","Raffaele","Domenico","Rosario","Salvatore","Luigi","Mario","Carmelo","Pasquale","Massimo","Fabio","Gianluca","Maurizio","Fabrizio","Mauro","Gianni","Piero","Sandro","Loris","Moreno","Danilo","Valter","Silvano","Romano","Giuliano","Tiziano","Massimiliano","Antonello","Arrigo","Aurelio","Bernardo","Carlo","Cesare","Corrado","Costantino","Damiano","Dino","Elia","Emilio","Enea","Ettore","Eugenio","Flavio","Gaetano","Gerardo","Gianmaria","Gianpaolo","Gilberto","Gualtiero","Guido","Gustavo","Iacopo","Igor"],SB=["Francesco","Alessandro","Andrea","Matteo","Lorenzo","Mattia","Davide","Simone","Luca","Gabriele","Riccardo","Federico","Marco","Tommaso","Leonardo","Giuseppe","Antonio","Giovanni","Filippo","Giacomo","Christian","Edoardo","Samuele","Alessio","Michele","Daniele","Stefano","Nicola","Pietro","Giorgio","Enrico","Emanuele","Alberto","Diego","Nicolò","Manuel","Jacopo","Giulio","Valerio","Paolo","Roberto","Vincenzo","Angelo","Raffaele","Domenico","Rosario","Salvatore","Luigi","Mario","Carmelo","Pasquale","Kevin","Thomas","Nicholas","Samuel","Gabriel","Daniel","David","Jonathan","Michael","Patrick","Simon","Steven","William","Anthony","Christopher","George","Harry","Jack","James","Joseph","Joshua","Matthew","Oliver","Oscar","Richard","Robert","Ryan","Elia","Gioele","Enea","Liam","Noah","Ethan","Bryan","Nathan","Aron","Zeno","Leone","Brando","Tancredi","Manfredi","Dante","Lapo","Romeo","Ettore","Achille","Michelangelo","Orlando"],kB=["Francesco","Alessandro","Leonardo","Lorenzo","Mattia","Andrea","Gabriele","Matteo","Riccardo","Tommaso","Edoardo","Giuseppe","Antonio","Davide","Federico","Diego","Giovanni","Marco","Nicolò","Samuele","Michele","Pietro","Luca","Simone","Filippo","Giacomo","Christian","Alessio","Emanuele","Daniele","Stefano","Nicola","Giorgio","Enrico","Alberto","Manuel","Jacopo","Giulio","Valerio","Paolo","Roberto","Vincenzo","Angelo","Raffaele","Domenico","Rosario","Salvatore","Luigi","Mario","Carmelo","Pasquale","Nathan","Liam","Noah","Ethan","Mason","Logan","Lucas","Oliver","Elijah","Aiden","James","Benjamin","William","Alexander","Michael","Daniel","Henry","Jackson","Sebastian","Jack","Samuel","David","Joseph","Carter","Owen","Wyatt","John","Matthew","Luke","Julian","Gioele","Elia","Enea","Leone","Brando","Tancredi","Manfredi","Dante","Lapo","Romeo","Ettore","Achille","Michelangelo","Orlando","Cesare","Vittorio","Augusto","Sebastiano","Damiano","Gregorio","Ludovico","Martino","Niccolò","Rocco","Santo","Saverio","Tiziano","Valentino","Vasco","Zaccaria"],LB=["Maria","Anna","Rosa","Giuseppina","Angela","Giovanna","Teresa","Lucia","Carmela","Caterina","Francesca","Antonietta","Carla","Rita","Paola","Luisa","Fernanda","Franca","Gabriella","Giuliana","Lina","Mirella","Bruna","Adriana","Silvana","Marisa","Iolanda","Ines","Ida","Ester","Elvira","Elsa","Elena","Edda","Dina","Delia","Clara","Bice","Bianca","Assunta","Antonia","Annunziata","Amelia","Amalia","Agata","Ada","Adele","Adelina","Albina","Alda","Alma","Anita","Armida","Aurelia","Aurora","Beatrice","Celeste","Cesira","Clelia","Clotilde","Concetta","Costanza","Daria","Deanna","Dolores","Domenica","Dora","Edvige","Elda","Eleonora","Elisabetta","Emma","Enrica","Ersilia","Eugenia","Evelina","Fabiola","Fiammetta","Filomena","Flora","Floriana","Fulvia","Gemma","Gilda","Gina","Gioia","Grazia","Graziella","Immacolata","Irene","Irma","Isa","Jolanda","Laura","Lidia"],RB=["Roberta","Patrizia","Cinzia","Daniela","Lorella","Nadia","Monica","Susanna","Tiziana","Donatella","Simonetta","Antonella","Sabrina","Loredana","Marina","Barbara","Paola","Laura","Cristina","Rossella","Simona","Stefania","Manuela","Sonia","Sandra","Loretta","Orietta","Gigliola","Fiorella","Gabriella","Raffaella","Isabella","Marta","Elisabetta","Claudia","Alessandra","Federica","Michela","Serena","Valeria","Cecilia","Letizia","Luciana","Mara","Marcella","Margherita","Mariella","Marilena","Marisa","Milena","Mirella","Natalia","Nicoletta","Norma","Novella","Olga","Ombretta","Oriana","Ornella","Ottavia","Pamela","Piera","Priscilla","Rachele","Rebecca","Regina","Renata","Rita","Romina","Rosalina","Rosanna","Rosetta","Rosina","Santina","Savina","Silvia","Sofia","Speranza","Tina","Vanda","Vanna","Velia","Vera","Vilma","Vincenza","Violante","Virginia","Vittoria","Viviana","Wanda","Zita"],DB=["Barbara","Katia","Debora","Erika","Pamela","Samantha","Moira","Natascia","Tamara","Tatiana","Jessica","Valentina","Ilaria","Serena","Chiara","Silvia","Elena","Elisa","Francesca","Alessia","Federica","Giorgia","Martina","Giulia","Sara","Alice","Veronica","Eleonora","Vanessa","Sabrina","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Franca","Marinella","Silvana","Patrizia","Luisa","Monica","Manuela","Michela","Simona","Stefania","Claudia","Valeria","Roberta","Laura","Cristina","Daniela","Paola","Alessandra","Cecilia","Letizia","Marta","Elisabetta","Raffaella","Gabriella","Cinzia","Nadia","Donatella","Lorella","Susanna","Simonetta","Marina","Rossella","Sandra","Loretta","Orietta","Fiorella","Isabella","Gigliola","Margherita","Agnese"],BB=["Valentina","Francesca","Alessandra","Chiara","Silvia","Elena","Laura","Cristina","Roberta","Sara","Giulia","Martina","Alice","Ilaria","Serena","Federica","Michela","Simona","Manuela","Monica","Daniela","Paola","Barbara","Stefania","Claudia","Valeria","Eleonora","Veronica","Elisa","Giorgia","Alessia","Noemi","Giada","Aurora","Sofia","Ludovica","Ginevra","Beatrice","Matilde","Vittoria","Emma","Nicole","Gaia","Camilla","Bianca","Arianna","Melissa","Vanessa","Sabrina","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Franca","Marinella","Silvana","Patrizia","Luisa","Katia","Debora","Erika","Pamela","Samantha","Moira","Natascia","Tamara","Tatiana","Jessica","Greta","Rachele","Rebecca","Angelica","Benedetta","Costanza","Diletta","Lucrezia","Marta","Miriam","Asia","Desiree","Sharon","Denise","Chanel"],UB=["Giulia","Chiara","Martina","Sara","Francesca","Alessia","Silvia","Valentina","Alice","Federica","Giorgia","Elena","Laura","Elisa","Ilaria","Eleonora","Serena","Roberta","Cristina","Veronica","Simona","Michela","Manuela","Monica","Daniela","Paola","Barbara","Stefania","Claudia","Valeria","Noemi","Giada","Aurora","Sofia","Ludovica","Ginevra","Beatrice","Matilde","Vittoria","Emma","Nicole","Gaia","Camilla","Bianca","Arianna","Melissa","Vanessa","Sabrina","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Anna","Maria","Greta","Rachele","Rebecca","Angelica","Benedetta","Costanza","Diletta","Lucrezia","Marta","Miriam","Asia","Desiree","Sharon","Denise","Chanel","Emily","Jennifer","Jasmine","Luna","Maya","Mia","Michelle","Siria","Sole","Stella","Viola","Virginia","Zoe","Adele","Agata"],_B=["Giulia","Sofia","Martina","Sara","Chiara","Aurora","Alice","Alessia","Francesca","Giorgia","Ginevra","Ludovica","Greta","Gaia","Emma","Beatrice","Matilde","Vittoria","Noemi","Giada","Elena","Elisa","Anna","Maria","Nicole","Valentina","Federica","Silvia","Laura","Ilaria","Eleonora","Serena","Roberta","Cristina","Veronica","Simona","Michela","Manuela","Monica","Daniela","Paola","Barbara","Stefania","Claudia","Valeria","Arianna","Melissa","Vanessa","Sabrina","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Franca","Rachele","Rebecca","Angelica","Benedetta","Costanza","Diletta","Lucrezia","Marta","Miriam","Asia","Desiree","Sharon","Denise","Chanel","Emily","Jennifer","Jasmine","Luna","Maya","Mia","Michelle","Siria","Sole","Stella","Viola","Virginia","Zoe","Adele","Agata","Ambra","Cecilia"],MB=["Sofia","Aurora","Giulia","Ginevra","Alice","Giorgia","Emma","Greta","Martina","Beatrice","Matilde","Ludovica","Vittoria","Nicole","Chiara","Anna","Sara","Bianca","Gaia","Noemi","Francesca","Alessia","Elena","Elisa","Maria","Adele","Viola","Mia","Ambra","Cecilia","Margherita","Linda","Eleonora","Elisabetta","Valeria","Veronica","Vanessa","Sabrina","Pamela","Debora","Nadia","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Franca","Marinella","Silvana","Patrizia","Luisa","Ilaria","Monica","Manuela","Michela","Simona","Barbara","Agnese","Anita","Isabel","Chloe","Emily","Luna","Sole","Stella","Azzurra","Gioia","Diletta","Benedetta","Costanza","Angelica","Lucrezia","Marta","Miriam","Rachele","Rebecca","Serena","Zoe","Agata","Cloe","Dafne","Diana","Eva","Flora","Frida","Glenda","Irene","Iris"],FB=class extends pd{getFirstNamesMaleJson(){return[]}getFirstNamesFemaleJson(){return[]}getLastNamesJson(){return vB}getFirstNamesMaleByDecade(){return[{startYear:1950,endYear:1959,names:wB},{startYear:1960,endYear:1969,names:CB},{startYear:1970,endYear:1979,names:NB},{startYear:1980,endYear:1989,names:xB},{startYear:1990,endYear:1999,names:TB},{startYear:2e3,endYear:2009,names:SB},{startYear:2010,endYear:2019,names:kB}]}getFirstNamesFemaleByDecade(){return[{startYear:1950,endYear:1959,names:LB},{startYear:1960,endYear:1969,names:RB},{startYear:1970,endYear:1979,names:DB},{startYear:1980,endYear:1989,names:BB},{startYear:1990,endYear:1999,names:UB},{startYear:2e3,endYear:2009,names:_B},{startYear:2010,endYear:2019,names:MB}]}},OB=class{static normalizeBirthDate(r){if(!r||r.trim()===""||r.startsWith("0001-01-01"))return"";const e=r.trim(),a=e.match(/^(\d{4})-(\d{2})-(\d{2})/);if(a){const[,s,c,d]=a;return`${s}-${c}-${d}`}const i=new Date(e);if(!isNaN(i.getTime())){const s=i.getFullYear().toString().padStart(4,"0"),c=(i.getMonth()+1).toString().padStart(2,"0"),d=i.getDate().toString().padStart(2,"0");return`${s}-${c}-${d}`}return""}static isValidBirthDate(r){if(!r||r.trim()===""||r.startsWith("0001-01-01"))return!1;const e=new Date(r);return isNaN(e.getTime())?!1:e.getFullYear()>1&&e.getFullYear()<9999}};function jB(r){if(r==="random"||!r)return null;const e=r.split("-");if(e.length!==2)return null;const a=parseInt(e[0],10),i=parseInt(e[1],10);if(isNaN(a)||isNaN(i))return null;const s=new Date().getFullYear(),c=Math.floor((a+i)/2),d=s-c,m=Math.floor((i-a)/2);return{targetYear:d,yearDeviation:m}}var PB=r=>{switch(r.toLowerCase()){case"en":return new KE;case"nl":return new nB;case"de":return new IB;case"it":return new FB;default:return console.warn(`Language '${r}' is not supported. Falling back to English.`),new KE}};const HB=()=>{const r=Gt(),[e,a]=w.useState({username:null,password:null,email:null}),i=w.useCallback(async()=>{if(!(r!=null&&r.sqliteClient))throw new Error("Database not initialized");const d=r.sqliteClient.settings.getEffectiveIdentityLanguage(),m=PB(d),g=r.sqliteClient.settings.getPasswordSettings(),f=_h(g);return{identityGenerator:m,passwordGenerator:f}},[r==null?void 0:r.sqliteClient]),s=w.useCallback(async()=>{if(!(r!=null&&r.sqliteClient))return null;try{const{identityGenerator:d,passwordGenerator:m}=await i(),g=r.sqliteClient.settings.getDefaultIdentityGender(),f=r.sqliteClient.settings.getDefaultIdentityAgeRange(),E=jB(f),p=d.generateRandomIdentity(g,E),C=m.generateRandomPassword(),I=r.sqliteClient.settings.getDefaultEmailDomain(),x=I?`${p.emailPrefix}@${I}`:p.emailPrefix,T={email:x,firstName:p.firstName,lastName:p.lastName,gender:p.gender,birthdate:OB.normalizeBirthDate(p.birthDate.toISOString()),username:p.nickName,password:C};return a({username:p.nickName,password:C,email:x}),T}catch(d){return console.error("Error generating random alias:",d),null}},[r==null?void 0:r.sqliteClient,i]),c=w.useCallback(()=>new Hh().generateRandomEmailPrefix(),[]);return{generateAlias:s,generateRandomEmailPrefix:c,lastGeneratedValues:e,setLastGeneratedValues:a}},QB=({formId:r,isLoading:e,formData:a,onRestore:i,skipRestore:s=!1})=>{const c=w.useRef(!1),d=w.useCallback(async()=>{if(e)return;await gt("PERSIST_FORM_VALUES",JSON.stringify({formId:r,data:a}),"background")},[r,a,e]),m=w.useCallback(async()=>{if(s||c.current)return!1;const f=await gt("GET_PERSISTED_FORM_VALUES",null,"background");try{if(!f)return!1;let E=null;try{E=JSON.parse(f)}catch(C){return console.error("Error parsing persisted form data:",C),!1}return E.formId===r?(c.current=!0,i(E.data),!0):!1}catch(E){return console.error("Error loading persisted form data:",E),!1}},[r,i,s]),g=w.useCallback(async()=>{await gt("CLEAR_PERSISTED_FORM_VALUES",null,"background")},[]);return w.useEffect(()=>{e||d()},[e,d]),w.useEffect(()=>()=>{g()},[g]),{loadPersistedValues:m,clearPersistedValues:g,persistFormValues:d}},Jn={username:["username","login","identifier","user"],fullName:["fullname","full-name","full name"],firstName:["firstname","first-name","first_name","fname","name","given-name"],lastName:["lastname","last-name","last_name","lname","surname","family-name"],email:["email","mail","emailaddress"],emailConfirm:["confirm","verification","repeat","retype","verify","email2"],password:["password","pwd","pass"],birthdate:["birthdate","birth-date","dob","date-of-birth"],gender:["gender","sex"],birthDateDay:["-day","birthdate_d","birthdayday","_day","day"],birthDateMonth:["-month","birthdate_m","birthdaymonth","_month","month"],birthDateYear:["-year","birthdate_y","birthdayyear","_year","year"]},Dg={male:["male","man","m","gender1","mr","mr."],female:["female","woman","f","gender2","mrs","mrs.","ms","ms."],other:["other","diverse","custom","prefer not","unknown","gender3"]},zB=new Set(["login","signin","sign","register","signup","account","authentication","password","access","auth","session","authenticate","credentials","logout","signout","portal","dashboard","home","welcome","page","site","secure","member","user","profile","settings","menu","overview","index","main","start","landing","free","create","new","your","special","offer","deal","discount","promotion","newsletter","help","support","contact","about","faq","terms","privacy","cookie","service","services","products","shop","store","cart","checkout","online","web","digital","mobile","my","personal","private","general","default","standard","website","system","admin","administrator","platform","portal","gateway","api","interface","console","today","now","current","latest","newest","recent","the","and","or","but","to","up"]),Xn={username:["gebruikersnaam","gebruiker","login","identifier"],fullName:["volledige naam"],firstName:["voornaam","naam"],lastName:["achternaam"],email:["e-mailadres","e-mail"],emailConfirm:["bevestig","herhaal","verificatie"],password:["wachtwoord","pwd"],birthdate:["geboortedatum","geboorte-datum"],gender:["geslacht","aanhef"],birthDateDay:["dag"],birthDateMonth:["maand"],birthDateYear:["jaar"]},Bg={male:["man","mannelijk","heer"],female:["vrouw","vrouwelijk","mevrouw"],other:["anders","iets","overig","onbekend"]},VB=new Set(["inloggen","registreren","registratie","aanmelden","inschrijven","uitloggen","wachtwoord","toegang","authenticatie","account","portaal","overzicht","startpagina","welkom","pagina","beveiligd","lid","gebruiker","profiel","instellingen","menu","begin","hoofdpagina","gratis","nieuw","jouw","schrijf","nieuwsbrief","aanbieding","korting","speciaal","actie","hulp","ondersteuning","contact","over","voorwaarden","privacy","cookie","dienst","diensten","producten","winkel","bestellen","winkelwagen","online","web","digitaal","mobiel","mijn","persoonlijk","privé","algemeen","standaard","systeem","beheer","beheerder","platform","portaal","interface","console","vandaag","nu","huidig","recent","nieuwste","je","in","op","de","van","ons","allemaal"]),Va={username:[...new Set([...Jn.username,...Xn.username])],fullName:[...new Set([...Jn.fullName,...Xn.fullName])],firstName:[...new Set([...Jn.firstName,...Xn.firstName])],lastName:[...new Set([...Jn.lastName,...Xn.lastName])],email:[...new Set([...Xn.email,...Jn.email])],emailConfirm:[...new Set([...Jn.emailConfirm,...Xn.emailConfirm])],password:[...new Set([...Jn.password,...Xn.password])],birthdate:[...new Set([...Jn.birthdate,...Xn.birthdate])],gender:[...new Set([...Jn.gender,...Xn.gender])],birthDateDay:[...new Set([...Jn.birthDateDay,...Xn.birthDateDay])],birthDateMonth:[...new Set([...Jn.birthDateMonth,...Xn.birthDateMonth])],birthDateYear:[...new Set([...Jn.birthDateYear,...Xn.birthDateYear])]},Bl={male:[...new Set([...Dg.male,...Bg.male])],female:[...new Set([...Dg.female,...Bg.female])],other:[...new Set([...Dg.other,...Bg.other])]},GE=new Set([...zB,...VB]);class qE{constructor(e,a){ze(this,"document");ze(this,"clickedElement");ze(this,"visibilityCache");this.document=e,this.clickedElement=a??null,this.visibilityCache=new Map}containsLoginForm(){let e=this.getFormWrapper();return(e==null?void 0:e.getAttribute("role"))==="dialog"&&(e=e.querySelector("form")??e),e||(e=this.document.body),e.querySelectorAll("input").length>200?!1:!!(this.containsPasswordField(e)||this.containsLikelyUsernameOrEmailField(e))}getForm(){if(!this.clickedElement)return null;const e=this.getFormWrapper();return this.detectFormFields(e)}static getSuggestedServiceName(e,a){const i=e.title,s=4,c=50,d=x=>{const T=x.length>=3&&x.length<=c,k=x.split(/[\s|\-—/\\]+/).length<=s;return T&&k},m=x=>{const T=x.toLowerCase().split(" ").map(_=>_.toLowerCase());let k=0;for(;k<T.length&&GE.has(T[k].toLowerCase());)k++;let R=T.length-1;for(;R>k&&GE.has(T[R].toLowerCase());)R--;return T.slice(k,R+1)},g=(x,T)=>x.split(/[\s|]+/).filter(k=>T.includes(k.toLowerCase())).join(" "),f=a.hostname.replace(/^www\./,""),p=/[|\-—/\\:]/.exec(i);if(p){const x=p.index,T=i.substring(0,x).trim(),k=i.substring(x+1).trim(),R=m(T),_=m(k),S=g(T,R),O=g(k,_),U=d(S),P=d(O);if(U&&P)return[S,O,f];if(U)return[S,f];if(P)return[O,f]}const C=m(i),I=g(i,C);return d(I)?[I,f]:[f]}getFormWrapper(){var e;return(e=this.clickedElement)==null?void 0:e.closest('form, [role="dialog"]')}getActualInputElement(e){if(e.tagName.toLowerCase()==="input")return e;const a=e;if(a.shadowRoot){const s=a.shadowRoot.querySelector("input, textarea");if(s)return s}const i=e.querySelector("input, textarea");return i||e}isElementVisible(e){var i;if(!e)return!1;if(this.visibilityCache.has(e))return this.visibilityCache.get(e);let a=e;for(;a;){try{const s=(i=this.document.defaultView)==null?void 0:i.getComputedStyle(a);if(!s){let c=a;for(;c;)this.visibilityCache.set(c,!0),c=c.parentElement;return!0}if(s.display==="none"){let c=a;for(;c;)this.visibilityCache.set(c,!1),c=c.parentElement;return!1}if(s.visibility==="hidden"){let c=a;for(;c;)this.visibilityCache.set(c,!1),c=c.parentElement;return!1}if(parseFloat(s.opacity)===0){let c=a;for(;c;)this.visibilityCache.set(c,!1),c=c.parentElement;return!1}}catch{let s=a;for(;s;)this.visibilityCache.set(s,!0),s=s.parentElement;return!0}a=a.parentElement}return this.visibilityCache.set(e,!0),!0}findAllInputFields(e,a,i,s=[]){var p,C,I,x,T,k,R,_;const c=e?Array.from(e.querySelectorAll("input, select, [type]")):Array.from(this.document.querySelectorAll("input, select, [type]")),m=(e?Array.from(e.querySelectorAll("*")):Array.from(this.document.querySelectorAll("*"))).filter(S=>{const O=S;return O.shadowRoot?O.shadowRoot.querySelector("input, textarea")!==null:!1}),f=[...c,...m].filter((S,O,U)=>U.indexOf(S)===O),E=[];for(const S of Array.from(f)){if(s.includes(S)||!this.isElementVisible(S))continue;let U=S.tagName.toLowerCase()==="select"?"select":((p=S.type)==null?void 0:p.toLowerCase())||((C=S.getAttribute("type"))==null?void 0:C.toLowerCase())||"";const P=S,K=P.shadowRoot&&P.shadowRoot.querySelector("input, textarea");if(K&&!U){const W=P.shadowRoot.querySelector("input, textarea");W&&(U=((I=W.type)==null?void 0:I.toLowerCase())||"text")}if(!i.includes(U)&&!(K&&i.includes("text")&&!U))continue;if(i.includes("email")&&U==="email"){E.push({input:S,score:-1});continue}const H=[S.id,S.getAttribute("name"),S.getAttribute("placeholder")].map(W=>(W==null?void 0:W.toLowerCase())??"");if(S.id||S.getAttribute("name")){const W=this.document.querySelector(`label[for="${S.id||S.getAttribute("name")}"]`);W&&H.push(((x=W.textContent)==null?void 0:x.toLowerCase())??"")}let Q=S;for(let W=0;W<3&&Q;W++){const ne=Q.querySelectorAll('[slot="label"], [slot="helper-text"]');for(const me of Array.from(ne)){const $=((T=me.textContent)==null?void 0:T.toLowerCase())??"";$&&H.push($)}if(Q.shadowRoot){const me=Q.shadowRoot.querySelectorAll('slot[name="label"], slot[name="helper-text"]');for(const $ of Array.from(me)){const re=$.assignedNodes();for(const ye of re)ye.textContent&&H.push(ye.textContent.toLowerCase())}}Q=Q.parentElement}const V=S.parentElement;if(V)for(const W of Array.from(V.children))W!==S&&Array.from(W.classList).some(ne=>ne.toLowerCase().includes("label"))&&H.push(((k=W.textContent)==null?void 0:k.toLowerCase())??"");let G=S;for(let W=0;W<5&&G&&!(G.children.length>15);W++){const ne=G.querySelector("label");if(ne){H.push(((R=ne.textContent)==null?void 0:R.toLowerCase())??"");break}const me=G.closest("td");if(me){const $=me.closest("tr");if($){for(const re of Array.from($.querySelectorAll("td")))if(re!==me){H.push(((_=re.textContent)==null?void 0:_.toLowerCase())??"");break}}break}G=G.parentElement}let q=a.length;for(let W=0;W<a.length;W++)if(H.some(ne=>ne.includes(a[W]))){q=W;break}q<a.length&&E.push({input:S,score:q})}return E.sort((S,O)=>S.score-O.score).map(S=>S.input)}findInputField(e,a,i,s=[]){const c=this.findAllInputFields(e,a,i,s),d=this.filterOutNestedDuplicates(c,s);if(i.includes("email")){const m=d.find(g=>(g.type||"").toLowerCase()==="email");if(m)return m}return d.length>0?d[0]:null}findEmailField(e){const a=this.findAllInputFields(e,Va.email,["text","email"]),s=this.filterOutNestedDuplicates(a)[0]??null,c=s?this.findAllInputFields(e,Va.emailConfirm,["text","email"],[s]):[],m=this.filterOutNestedDuplicates(c)[0]??null;return{primary:s,confirm:m}}findBirthdateFields(e,a=[]){const i=this.findInputField(e,Va.birthdate,["date","text"],a);let s="yyyy-mm-dd";if(e&&i){const g=i.closest("div");if(g){const E=[...Array.from(g.getElementsByTagName("label")),...Array.from(g.getElementsByTagName("span")),g].map(p=>{var C;return((C=p.textContent)==null?void 0:C.toLowerCase())??""}).join(" ").replace(/[\s\u00A0]/g,"").toLowerCase();if(/dd[-/]mm[-/]jj/i.test(E)||/dd[-/]mm[-/]yyyy/i.test(E)?s=E.includes("/")?"dd/mm/yyyy":"dd-mm-yyyy":/mm[-/]dd[-/]yyyy/i.test(E)?s=E.includes("/")?"mm/dd/yyyy":"mm-dd-yyyy":/yyyy[-/]mm[-/]dd/i.test(E)&&(s=E.includes("/")?"yyyy/mm/dd":"yyyy-mm-dd"),s==="yyyy-mm-dd"&&i.placeholder){const p=i.placeholder.toLowerCase();/dd[-/]mm/i.test(p)?s=p.includes("/")?"dd/mm/yyyy":"dd-mm-yyyy":/mm[-/]dd/i.test(p)&&(s=p.includes("/")?"mm/dd/yyyy":"mm-dd-yyyy")}}}if(i)return{single:i,format:s,day:null,month:null,year:null};const c=this.findInputField(e,Va.birthDateDay,["text","number","select"],a),d=this.findInputField(e,Va.birthDateMonth,["text","number","select"],a),m=this.findInputField(e,Va.birthDateYear,["text","number","select"],a);return{single:null,format:"yyyy-mm-dd",day:c,month:d,year:m}}findGenderField(e,a=[]){const i=this.findInputField(e,Va.gender,["select"],a);if((i==null?void 0:i.tagName.toLowerCase())==="select")return{type:"select",field:i};const s=e?e.querySelectorAll('input[type="radio"][name*="gender"], input[type="radio"][name*="sex"]'):null;if(s&&s.length>0){const d=(m,g=!1)=>Array.from(s).find(f=>{var p,C;const E=[f.value,f.id,f.name,((C=(p=f.labels)==null?void 0:p[0])==null?void 0:C.textContent)??""].map(I=>(I==null?void 0:I.toLowerCase())??"");return g&&(Bl.male.some(I=>E.some(x=>x.includes(I)))||Bl.female.some(I=>E.some(x=>x.includes(I))))?!1:m.some(I=>E.some(x=>x.includes(I)))})??null;return{type:"radio",field:null,radioButtons:{male:d(Bl.male),female:d(Bl.female),other:d(Bl.other)}}}return{type:"text",field:this.findInputField(e,Va.gender,["text"],a)}}filterOutNestedDuplicates(e,a=[]){if(e.length===0)return e;const i=[];for(const s of e){let c=!0;for(const d of a){if(s===d){c=!1;break}if(d.contains(s)){c=!1;break}if(s.contains(d)){c=!1;break}const m=s,g=d;if(g.shadowRoot&&g.shadowRoot.contains(s)){c=!1;break}if(m.shadowRoot&&m.shadowRoot.contains(d)){c=!1;break}const f=this.getActualInputElement(s),E=this.getActualInputElement(d);if(f===E){c=!1;break}}if(c){for(const d of e)if(s!==d){if(s.contains(d)){c=!1;break}const m=s;if(m.shadowRoot&&m.shadowRoot.contains(d)){c=!1;break}}if(c){const d=this.getActualInputElement(s);if(d!==s&&e.includes(d))continue;i.push(s)}}}return i}findPasswordField(e){const a=this.findAllInputFields(e,Va.password,["password"]),i=this.filterOutNestedDuplicates(a);return{primary:i[0]??null,confirm:i[1]??null}}containsPasswordField(e){const a=this.findPasswordField(e);return!!(a.primary&&this.isElementVisible(a.primary))}containsLikelyUsernameOrEmailField(e){const a=this.findEmailField(e);if(a.primary&&this.isElementVisible(a.primary))return!0;const i=this.findInputField(e,Va.username,["text"],[]);if(i&&this.isElementVisible(i))return!0;const s=this.findInputField(e,Va.firstName,["text"],[]);if(s&&this.isElementVisible(s))return!0;const c=this.findInputField(e,Va.lastName,["text"],[]);return!!(c&&this.isElementVisible(c))}isAutofillTriggerableField(){const e=this.getFormWrapper();if(!this.clickedElement)return!1;const a=this.getActualInputElement(this.clickedElement),i=[this.clickedElement,a].filter((m,g,f)=>m&&f.indexOf(m)===g);if(this.findAllInputFields(e,Va.username,["text"]).some(m=>i.includes(m)))return!0;const c=this.findPasswordField(e);return!!(c.primary&&i.includes(c.primary)||c.confirm&&i.includes(c.confirm)||this.findAllInputFields(e,Va.email,["text","email"]).some(m=>i.includes(m)))}detectFormFields(e){const a=[],i=this.findEmailField(e);i.primary&&a.push(i.primary),i.confirm&&a.push(i.confirm);const s=this.findPasswordField(e);s.primary&&a.push(s.primary),s.confirm&&a.push(s.confirm);const c=this.findInputField(e,Va.username,["text"],a);c&&a.push(c);const d=this.findInputField(e,Va.fullName,["text"],a);d&&a.push(d);const m=this.findInputField(e,Va.lastName,["text"],a);m&&a.push(m);const g=this.findInputField(e,Va.firstName,["text"],a);g&&a.push(g);const f=this.findBirthdateFields(e,a);f.single&&a.push(f.single),f.day&&a.push(f.day),f.month&&a.push(f.month),f.year&&a.push(f.year);const E=this.findGenderField(e,a);return E.field&&a.push(E.field),{form:e,emailField:i.primary,emailConfirmField:i.confirm,usernameField:c,passwordField:s.primary,passwordConfirmField:s.confirm,fullNameField:d,firstNameField:g,lastNameField:m,birthdateField:f,genderField:E}}}class WE{static getServiceInfo(e,a){const i=qE.getSuggestedServiceName(e,a),s=a.href;let c="";try{const d=new URL(s);(d.protocol==="http:"||d.protocol==="https:")&&(c=d.origin+d.pathname,c.endsWith("/")&&(c=c.slice(0,-1)))}catch(d){console.error("Error parsing current URL:",d)}return{suggestedNames:i,currentUrl:s,serviceUrl:c,domain:a.hostname.replace(/^www\./,"")}}static getServiceInfoFromTab(e,a){try{const i=new URL(e),s={href:e,hostname:i.hostname,protocol:i.protocol,pathname:i.pathname,origin:i.origin},c={title:a||i.hostname},d=qE.getSuggestedServiceName(c,s);let m="";return(i.protocol==="http:"||i.protocol==="https:")&&(m=i.origin+i.pathname,m.endsWith("/")&&(m=m.slice(0,-1))),{suggestedNames:d,currentUrl:e,serviceUrl:m,domain:i.hostname.replace(/^www\./,"")}}catch(i){console.error("Error parsing tab URL:",i);const s=e.replace(/^https?:\/\/(www\.)?/,"").split("/")[0];return{suggestedNames:[s],currentUrl:e,serviceUrl:e,domain:s}}}static getEncodedServiceInfo(e,a){const i=this.getServiceInfo(e,a);return{serviceName:i.suggestedNames.length>0?encodeURIComponent(i.suggestedNames[0]):"",serviceUrl:i.serviceUrl?encodeURIComponent(i.serviceUrl):"",currentUrl:encodeURIComponent(i.currentUrl),domain:encodeURIComponent(i.domain)}}static getEncodedServiceInfoFromTab(e,a){const i=this.getServiceInfoFromTab(e,a);return{serviceName:i.suggestedNames.length>0?encodeURIComponent(i.suggestedNames[0]):"",serviceUrl:i.serviceUrl?encodeURIComponent(i.serviceUrl):"",currentUrl:encodeURIComponent(i.currentUrl),domain:encodeURIComponent(i.domain)}}}const KB=()=>{const[r]=qb();return{detectService:w.useCallback(async a=>{let i=a||"",s="";try{const c=r.get("serviceName"),d=r.get("serviceUrl"),m=r.get("currentUrl");if(c||d||m){if(c&&(i=decodeURIComponent(c)),d&&(s=decodeURIComponent(d)),m&&(!c||!d)){const g=decodeURIComponent(m),f=WE.getServiceInfoFromTab(g);!c&&f.suggestedNames.length>0&&(i=f.suggestedNames[0]),!d&&f.serviceUrl&&(s=f.serviceUrl)}}else{const[g]=await li.tabs.query({active:!0,currentWindow:!0});if(g!=null&&g.url){const f=WE.getServiceInfoFromTab(g.url,g.title);f.suggestedNames.length>0&&!i&&(i=f.suggestedNames[0]),f.serviceUrl&&(s=f.serviceUrl)}}}catch(c){console.error("Error detecting service information:",c)}return{serviceName:i,serviceUrl:s}},[r])}},GB=5e3;class Ki{static extractSourceFromUrl(e){if(!e)return"unknown";try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase().replace(/^www\./,"")}catch{return"unknown"}}static normalizeUrl(e){if(!e)return;const a=e.trim();if(a&&!(!a.startsWith("http://")&&!a.startsWith("https://")&&!a.startsWith("www.")))return a.startsWith("www.")?`https://${a}`:a}static extractFirstValidUrl(e){if(!e)return;const i=(Array.isArray(e)?e:[e]).find(s=>{const c=s==null?void 0:s.trim();return c&&(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("www."))});return Ki.normalizeUrl(i)}static hasLogoForUrl(e,a){if(!e)return!1;const i=Ki.extractSourceFromUrl(e);return i==="unknown"?!1:a.logos.hasLogoForSource(i)}static async fetchFavicon(e,a,i,s=GB){const c=Ki.normalizeUrl(e);if(!c)return{success:!1,error:"Invalid URL"};const d=Ki.extractSourceFromUrl(c);if(d==="unknown")return{success:!1,error:"Could not extract domain from URL"};if(a.logos.hasLogoForSource(d))return{success:!1,skipped:!0};try{const m=new Promise((E,p)=>setTimeout(()=>p(new Error("Favicon extraction timed out")),s)),g=i.get(`Favicon/Extract?url=${encodeURIComponent(c)}`),f=await Promise.race([g,m]);return f!=null&&f.image?{success:!0,imageData:Uint8Array.from(ho.Buffer.from(f.image,"base64"))}:{success:!1,error:"No favicon returned from server"}}catch(m){const g=m instanceof Error?m.message:"Unknown error";return console.error("[Favicon] Error extracting favicon:",g),{success:!1,error:g}}}static async fetchAndAttachFavicon(e,a,i,s){const c=Ki.extractFirstValidUrl(a);if(!c)return{...e,Logo:void 0};const d=await Ki.fetchFavicon(c,i,s);return d.success&&d.imageData?{...e,Logo:d.imageData}:e}}const qB=[ma.Login,ma.Alias,ma.CreditCard,ma.Note],WB=ma.Login,YE=()=>{const{t:r}=tt(),{id:e}=od(),[a]=qb(),i=La(),s=Gt(),c=e!==void 0&&e.length>0,d=a.get("type"),m=a.get("name"),g=a.get("folderId"),{executeVaultMutationAsync:f}=vo(),{setHeaderButtons:E}=mr(),{setIsInitialLoading:p}=pa(),{generateAlias:C,generateRandomEmailPrefix:I,lastGeneratedValues:x}=HB(),{detectService:T}=KB(),k=ur(),[R,_]=w.useState(!0),[S,O]=w.useState(!1),[U,P]=w.useState(null),[K,H]=w.useState({}),[Q,V]=w.useState([]),[G,q]=w.useState([]),[W,ne]=w.useState(!1),[me,$]=w.useState(!1),[re,ye]=w.useState(!1),Ae=w.useRef(!1),j=w.useRef(null),[X,ee]=w.useState(!1),[ie,Ie]=w.useState(new Set),[we,Re]=w.useState(new Set),[De,Te]=w.useState([]),[He,Ne]=w.useState([]),[Qe,yt]=w.useState({isAddFormVisible:!1,formData:{name:"",secretKey:""}}),[We,nt]=w.useState([]),[Ht,ve]=w.useState([]),[Be,$e]=w.useState([]),[Ye,lt]=w.useState(!0),[et,Et]=w.useState(void 0),[Pt]=w.useState(!1),qt=w.useCallback(oe=>{oe.item&&P(oe.item),oe.fieldValues&&H(oe.fieldValues),oe.customFields&&V(oe.customFields),oe.totpEditorState&&yt(oe.totpEditorState),oe.show2FA!==void 0&&$(oe.show2FA),oe.showAttachments!==void 0&&ye(oe.showAttachments),oe.manuallyAddedFields&&Ie(new Set(oe.manuallyAddedFields)),oe.isLoginEmailInEmailMode!==void 0&&lt(oe.isLoginEmailInEmailMode),oe.passwordSettings!==void 0&&Et(oe.passwordSettings)},[]),{loadPersistedValues:Qt,clearPersistedValues:na}=QB({formId:e||null,isLoading:R,formData:{item:U,fieldValues:K,customFields:Q,totpEditorState:Qe,show2FA:me,showAttachments:re,manuallyAddedFields:Array.from(ie),isLoginEmailInEmailMode:Ye,passwordSettings:et},onRestore:qt,skipRestore:Pt}),B=w.useMemo(()=>U?Uk(U.ItemType):[],[U]),v=w.useMemo(()=>B.find(oe=>oe.FieldKey==="notes.content"),[B]),N=w.useMemo(()=>U?_k(U.ItemType):[],[U]),z=w.useMemo(()=>{const oe=new Set;return B.forEach(Me=>{U&&Ml(Me,U.ItemType)&&oe.add(Me.FieldKey)}),ie.forEach(Me=>oe.add(Me)),we.forEach(Me=>oe.add(Me)),Object.keys(K).forEach(Me=>{const _e=K[Me];_e&&(Array.isArray(_e)?_e.length>0:_e.toString().trim()!=="")&&oe.add(Me)}),oe},[U,B,ie,we,K]),ae=w.useCallback(oe=>{if(!U)return!1;if(ie.has(oe.FieldKey)||we.has(oe.FieldKey))return!0;const Me=B.find(_e=>_e.FieldKey===oe.FieldKey);return Me?Ml(Me,U.ItemType):!0},[U,B,ie,we]),ge=w.useMemo(()=>B.filter(oe=>oe.Category===dt.Primary),[B]),Ee=w.useMemo(()=>{const oe={};return B.forEach(Me=>{if(Me.Category===dt.Notes||Me.Category===dt.Metadata||Me.Category===dt.Primary)return;const _e=Me.Category;oe[_e]||(oe[_e]=[]),oe[_e].push(Me)}),oe},[B]);w.useEffect(()=>{if(!(s!=null&&s.sqliteClient)||!e||!c){const oe=d&&qB.includes(d)?d:WB;(async()=>{const{serviceName:_e,serviceUrl:Xe}=await T(m),kt={Id:crypto.randomUUID().toUpperCase(),Name:_e,ItemType:oe,FolderId:g||null,Fields:[],CreatedAt:new Date().toISOString(),UpdatedAt:new Date().toISOString()};if(P(kt),lt(oe===ma.Login),Xe&&H(it=>({...it,"login.url":Xe})),s!=null&&s.sqliteClient){const it=s.sqliteClient.folders.getAll();q(it)}(await li.storage.local.get([Wf]))[Wf]?await li.storage.local.remove([Wf]):await Qt(),_(!1),p(!1)})();return}try{const oe=s.sqliteClient.items.getById(e);if(oe){P(oe);const Me=s.sqliteClient.folders.getAll();q(Me);const _e={},Xe=[],kt=new Set;oe.Fields.forEach(st=>{_e[st.FieldKey]=st.Value,kt.add(st.FieldKey),st.IsCustomField&&Xe.push({tempId:st.FieldKey,label:st.Label,fieldType:st.FieldType,isHidden:st.IsHidden,displayOrder:st.DisplayOrder})}),H(_e),V(Xe),Re(kt);const vt=s.sqliteClient.settings.getTotpCodesForItem(e);Te(vt),Ne(vt.map(st=>st.Id)),vt.length>0&&$(!0);const it=s.sqliteClient.settings.getAttachmentsForItem(e);nt(it),ve(it.map(st=>st.Id)),it.length>0&&ye(!0),_(!1),p(!1)}else console.error("Item not found"),i("/items")}catch(oe){console.error("Error loading item:",oe),_(!1),p(!1)}},[s==null?void 0:s.sqliteClient,e,c,d,m,g,i,p,T,Qt]);const Ue=w.useCallback(async()=>{const oe=await C();oe&&(H(Me=>{const _e=Me["login.username"]||"",Xe=Me["login.password"]||"",kt=Me["login.email"]||"",vt={...Me,"alias.first_name":oe.firstName,"alias.last_name":oe.lastName,"alias.gender":oe.gender,"alias.birthdate":oe.birthdate};return(!kt||kt===x.email)&&(vt["login.email"]=oe.email),(!_e||_e===x.username)&&(vt["login.username"]=oe.username),(!Xe||Xe===x.password)&&(vt["login.password"]=oe.password),vt}),ee(!0))},[C,x]),ht=w.useCallback(()=>{if(!(s!=null&&s.sqliteClient))return;const oe=K["alias.first_name"]||"",Me=K["alias.last_name"]||"";let _e;if(!oe.trim()&&!Me.trim())_e=I();else{const vt=K["alias.gender"]||XI.Other,it=K["alias.birthdate"]||"";_e=new Hh().generateEmailPrefix({firstName:oe,lastName:Me,gender:vt,birthDate:it?new Date(it):new Date,emailPrefix:"",nickName:""})}const Xe=s.sqliteClient.settings.getDefaultEmailDomain(),kt=Xe?`${_e}@${Xe}`:_e;H(vt=>({...vt,"login.email":kt}))},[s==null?void 0:s.sqliteClient,K,I]),It=w.useCallback(()=>{if(!(s!=null&&s.sqliteClient))return;const oe=I(),Me=s.sqliteClient.settings.getDefaultEmailDomain(),_e=Me?`${oe}@${Me}`:oe;H(Xe=>({...Xe,"login.email":_e}))},[s==null?void 0:s.sqliteClient,I]),St=w.useCallback(async()=>{const oe=await C();oe&&H(Me=>({...Me,"login.username":oe.username}))},[C]),mt=w.useMemo(()=>{if(!U)return!1;const oe=B.find(Me=>Me.FieldKey==="alias.first_name");return oe?Ml(oe,U.ItemType):!1},[U,B]),fr=w.useMemo(()=>B.some(oe=>oe.FieldKey==="login.username"||oe.FieldKey==="login.password"),[B]);w.useEffect(()=>{!c&&mt&&!R&&(s!=null&&s.sqliteClient)&&!Ae.current&&(Ae.current=!0,Ue())},[c,mt,R,s==null?void 0:s.sqliteClient,Ue]),w.useEffect(()=>{!c&&!R&&j.current&&j.current.focus()},[c,R]);const ra=w.useCallback((oe,Me)=>{H(_e=>({..._e,[oe]:Me}))},[]),an=w.useCallback(async()=>{if(U)try{const oe=[];B.forEach(_e=>{const Xe=K[_e.FieldKey];Xe&&(Array.isArray(Xe)?Xe.length>0:Xe.trim()!=="")&&oe.push({FieldKey:_e.FieldKey,Label:_e.FieldKey,FieldType:_e.FieldType,Value:Xe,IsHidden:_e.IsHidden,DisplayOrder:_e.DefaultDisplayOrder,IsCustomField:!1,EnableHistory:_e.EnableHistory})}),Q.forEach(_e=>{const Xe=K[_e.tempId]||"";oe.push({FieldKey:_e.tempId,Label:_e.label,FieldType:_e.fieldType,Value:Xe,IsHidden:_e.isHidden,DisplayOrder:_e.displayOrder,IsCustomField:!0,EnableHistory:!1})});let Me={...U,Id:c?U.Id:crypto.randomUUID().toUpperCase(),Fields:oe,UpdatedAt:new Date().toISOString()};if(s!=null&&s.sqliteClient&&(_(!0),Me=await Ki.fetchAndAttachFavicon(Me,K["login.url"],s.sqliteClient,k)),!(s!=null&&s.sqliteClient))throw new Error("Database not initialized");await f(async()=>{if(_(!1),c){if(await s.sqliteClient.items.update(Me,Ht,We,He,De),Be.length>0)for(const _e of Be)await s.sqliteClient.passkeys.deleteById(_e)}else await s.sqliteClient.items.create(Me,We,De)}),na(),c?i(-1):i(`/items/${Me.Id}`,{replace:!0})}catch(oe){console.error("Error saving item:",oe)}},[U,K,B,Q,s,c,f,i,Ht,We,He,De,Be,k,na]),On=w.useCallback(async()=>{if(!(!U||!c||!(s!=null&&s.sqliteClient)))try{await f(async()=>{await s.sqliteClient.items.trash(U.Id)}),i("/items")}catch(oe){console.error("Error deleting item:",oe)}finally{O(!1)}},[U,c,s,f,i]),jn=w.useCallback((oe,Me)=>{const Xe={tempId:crypto.randomUUID(),label:oe,fieldType:Me,isHidden:!1,displayOrder:B.length+Q.length+1};V(kt=>[...kt,Xe])},[B.length,Q.length]),Oe=w.useCallback(oe=>{V(Me=>Me.filter(_e=>_e.tempId!==oe)),H(Me=>{const _e={...Me};return delete _e[oe],_e})},[]),ci=w.useCallback((oe,Me)=>{V(_e=>_e.map(Xe=>Xe.tempId===oe?{...Xe,label:Me}:Xe))},[]),Zt=w.useCallback(oe=>{if(!U)return;const Me=U.ItemType;!c&&Me!==oe&&(H(_e=>{const Xe={};return Object.entries(_e).forEach(([kt,vt])=>{const it=fo(kt);it?jl(it,oe)&&(Xe[kt]=vt):Xe[kt]=vt}),Xe}),Ie(_e=>{const Xe=new Set;return _e.forEach(kt=>{const vt=fo(kt);(!vt||jl(vt,oe))&&Xe.add(kt)}),Xe}),Re(_e=>{const Xe=new Set;return _e.forEach(kt=>{const vt=fo(kt);(!vt||jl(vt,oe))&&Xe.add(kt)}),Xe})),Ae.current=!1,lt(oe===ma.Login),P({...U,ItemType:oe,Fields:c?U.Fields:[]}),ne(!1)},[U,c]),sa=w.useCallback(()=>{H(oe=>({...oe,"notes.content":""})),Ie(oe=>{const Me=new Set(oe);return Me.delete("notes.content"),Me})},[]),tr=w.useCallback(()=>{$(!0),yt({isAddFormVisible:!0,formData:{name:"",secretKey:""}})},[]),ar=w.useCallback(()=>{ye(!0)},[]),Ra=w.useCallback(oe=>{Ie(Me=>new Set(Me).add(oe))},[]),zt=w.useMemo(()=>{const oe=[];return fr&&oe.push({key:"2fa",isVisible:me,onAdd:tr}),oe.push({key:"attachments",isVisible:re,onAdd:ar}),oe},[fr,me,re,tr,ar]),ya=w.useCallback(oe=>{Ie(Me=>{const _e=new Set(Me);return _e.delete(oe),_e}),H(Me=>{const _e={...Me};return delete _e[oe],_e})},[]);w.useEffect(()=>{const oe=l.jsxs("div",{className:"flex items-center gap-2",children:[c&&l.jsx(Nn,{onClick:()=>O(!0),title:r("items.deleteItemTitle"),iconType:Fa.DELETE,variant:"danger"}),l.jsx(Nn,{id:"save-credential",onClick:an,title:r("items.saveItem"),iconType:Fa.SAVE})]});return E(oe),()=>E(null)},[E,c,r,an]);const Wt=w.useCallback((oe,Me,_e,Xe,kt,vt)=>{const it=K[oe]||"";if(kt){const Fe=Array.isArray(it)&&it.length>0?it:it?[it]:[""];return l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:Me}),Fe.map((Z,xe)=>l.jsxs("div",{className:"relative",children:[l.jsx("input",{id:`${oe}-${xe}`,type:"text",value:Z,onChange:Pe=>{const Ut=[...Fe];Ut[xe]=Pe.target.value,ra(oe,Ut.filter(ca=>ca.trim()!==""))},className:"w-full px-3 py-2 pr-10 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white"}),xe===Fe.length-1&&l.jsx("button",{type:"button",onClick:()=>ra(oe,[...Fe,""]),className:"absolute right-2 top-1/2 -translate-y-1/2 w-6 h-6 flex items-center justify-center text-gray-400 hover:text-primary-500 dark:hover:text-primary-400 transition-colors",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})})]},`${oe}-${xe}`))]})}const st=Array.isArray(it)?it[0]||"":it,cn=(Fe,Z=!0)=>vt?l.jsxs("div",{className:"relative",children:[Fe,l.jsx("button",{type:"button",onClick:vt,className:`absolute right-2 ${Z?"top-[38px]":"top-1/2"} -translate-y-1/2 w-6 h-6 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors`,title:r("common.delete"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}):Fe;switch(_e){case aa.Password:return cn(l.jsx(_R,{id:oe,label:Me,value:st,onChange:Fe=>ra(oe,Fe),showPassword:X,onShowPasswordChange:ee,initialSettings:et,onSettingsChange:Et}));case aa.Hidden:return cn(l.jsx(DR,{id:oe,label:Me,value:st,onChange:Fe=>ra(oe,Fe)}));case aa.TextArea:return cn(l.jsxs("div",{children:[Me&&l.jsx("label",{htmlFor:oe,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:Me}),l.jsx("textarea",{id:oe,value:st,onChange:Fe=>ra(oe,Fe.target.value),rows:4,className:`w-full px-3 py-2 ${vt?"pr-10":""} border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white`})]}));case aa.Email:return l.jsx(LR,{id:oe,value:st,onChange:Fe=>ra(oe,Fe),onRemove:vt,onGenerateAlias:mt?ht:It,isEmailMode:Ye,onEmailModeChange:lt});case aa.URL:case aa.Phone:case aa.Number:case aa.Date:case aa.Text:default:return oe==="login.username"&&mt?l.jsx(MR,{id:oe,label:Me,value:st,onChange:Fe=>ra(oe,Fe),onRegenerate:St}):cn(l.jsx(fd,{id:oe,label:Me,value:st,onChange:Fe=>ra(oe,Fe),type:"text"}))}},[K,ra,X,r,ht,It,mt,St,Ye,et]),Da=w.useCallback(oe=>{oe.preventDefault(),an()},[an]),ja=w.useCallback(oe=>{switch(oe){case dt.Login:return r("items.loginCredentials");case dt.Alias:return r("common.alias");case dt.Card:return r("items.cardInformation");default:return oe}},[r]),Rr=w.useCallback(oe=>oe===dt.Alias&&mt?l.jsx(l.Fragment,{children:l.jsx("button",{type:"button",onClick:Ue,className:"p-1.5 text-gray-400 hover:text-primary-500 focus:outline-none",title:r("common.generate"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M23 4v6h-6"}),l.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})}):null,[mt,Ue,r]);return R||!U?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx($n,{})}):l.jsxs("form",{onSubmit:Da,className:"space-y-4",children:[l.jsx(JD,{selectedType:U.ItemType,isEditMode:c,showDropdown:W,onDropdownToggle:ne,onTypeChange:Zt,onRegenerateAlias:mt&&!c?Ue:void 0}),l.jsxs(Cu,{children:[l.jsx(YD,{inputRef:j,value:U.Name||"",onChange:oe=>P({...U,Name:oe}),folders:G,selectedFolderId:U.FolderId,onFolderChange:oe=>P({...U,FolderId:oe})}),ge.map(oe=>l.jsx("div",{children:Wt(oe.FieldKey,r(`fieldLabels.${oe.FieldKey}`,{defaultValue:oe.FieldKey}),oe.FieldType,oe.IsHidden,oe.IsMultiValue)},oe.FieldKey))]}),c&&U.HasPasskey&&l.jsx(jR,{itemId:U.Id,passkeyIdsMarkedForDeletion:Be,onPasskeyMarkedForDeletion:$e}),Object.keys(Ee).map(oe=>{const Me=Ee[oe],_e=Me.filter(it=>ae(it)),Xe=oe===dt.Login?Me.find(it=>it.FieldKey==="login.email"):null,kt=Xe&&!ae(Xe),vt=oe===dt.Login?[..._e].sort((it,st)=>{const cn={"login.email":0,"login.username":1,"login.password":2},Fe=cn[it.FieldKey]??99,Z=cn[st.FieldKey]??99;return Fe-Z}):_e;return vt.length===0&&!kt?null:l.jsx(Cu,{title:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{children:ja(oe)}),kt&&l.jsxs("button",{type:"button",onClick:()=>Ra("login.email"),className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full transition-colors focus:outline-none text-gray-500 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 border border-dashed border-gray-300 dark:border-gray-600 hover:border-primary-400 dark:hover:border-primary-500",children:[l.jsxs("svg",{className:"w-2.5 h-2.5 -ml-0.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),l.jsx("span",{children:r("common.email")})]})]}),actions:Rr(oe),children:vt.map(it=>{const st=U&&ie.has(it.FieldKey)&&!Ml(it,U.ItemType);return l.jsx(id.Fragment,{children:Wt(it.FieldKey,r(`fieldLabels.${it.FieldKey}`,{defaultValue:it.FieldKey}),it.FieldType,it.IsHidden,it.IsMultiValue,st?()=>ya(it.FieldKey):void 0)},it.FieldKey)})},oe)}),v&&z.has("notes.content")&&l.jsx(Cu,{title:r("common.notes"),actions:ae(v)?void 0:l.jsx("button",{type:"button",onClick:sa,className:"p-1.5 text-gray-400 hover:text-red-500 focus:outline-none",title:r("common.delete"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),children:Wt(v.FieldKey,"",v.FieldType,v.IsHidden,v.IsMultiValue)}),Q.length>0&&l.jsx(Cu,{title:r("common.customFields"),children:Q.map(oe=>l.jsxs("div",{children:[l.jsx(kR,{htmlFor:oe.tempId,label:oe.label,onLabelChange:Me=>ci(oe.tempId,Me),onDelete:()=>Oe(oe.tempId)}),Wt(oe.tempId,"",oe.fieldType,oe.isHidden,!1)]},oe.tempId))}),me&&fr&&l.jsx(WD,{totpCodes:De,onTotpCodesChange:Te,originalTotpCodeIds:He,isAddFormVisible:Qe.isAddFormVisible,formData:Qe.formData,onStateChange:yt}),re&&l.jsx(FR,{attachments:We,onAttachmentsChange:nt,itemId:c?e:void 0}),l.jsx(SR,{optionalSystemFields:N,visibleFieldKeys:z,optionalSections:zt,callbacks:{onAddSystemField:Ra,onAddCustomField:jn}}),c&&l.jsx(Xu,{isOpen:S,onClose:()=>O(!1),title:r("items.deleteItemTitle"),message:r("items.deleteItemConfirm"),confirmText:r("common.delete"),cancelText:r("common.cancel"),onConfirm:On,variant:"danger"})]})},YB=({itemId:r})=>{const{t:e}=tt(),[a,i]=w.useState([]),[s,c]=w.useState(!0),d=Gt(),m=g=>{try{const f=g.Blob instanceof Uint8Array?g.Blob:new Uint8Array(g.Blob),E=new Blob([f]),p=URL.createObjectURL(E),C=document.createElement("a");C.href=p,C.download=g.Filename,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(p)}catch(f){console.error("Error downloading attachment:",f)}};return w.useEffect(()=>{(async()=>{if(!(!(d!=null&&d.sqliteClient)||!r))try{const f=d.sqliteClient.settings.getAttachmentsForItem(r);i(f)}catch(f){console.error("Error loading attachments:",f)}finally{c(!1)}})()},[r,d==null?void 0:d.sqliteClient]),s?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:e("common.attachments")}),e("common.loadingAttachments")]}):a.length===0?null:l.jsx("div",{className:"mb-4",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:e("common.attachments")}),l.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(g=>l.jsx("button",{className:"w-full text-left p-2 ps-3 pe-3 rounded bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",onClick:()=>m(g),"aria-label":`Download ${g.Filename}`,children:l.jsxs("div",{className:"flex justify-between items-center gap-2",children:[l.jsx("div",{className:"flex items-center flex-1",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:g.Filename}),l.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(g.CreatedAt).toLocaleDateString()})]})}),l.jsx("div",{className:"flex items-center",children:l.jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5m0 0l5-5m-5 5V4"})})})]})},g.Id))})]})})};class JB{constructor(){ze(this,"currentCopiedId","");ze(this,"onCopyCallbacks",[])}setCopied(e){this.currentCopiedId=e,this.notifySubscribers()}getCopiedId(){return this.currentCopiedId}subscribe(e){return this.onCopyCallbacks.push(e),()=>{this.onCopyCallbacks=this.onCopyCallbacks.filter(a=>a!==e)}}notifySubscribers(){this.onCopyCallbacks.forEach(e=>e(this.currentCopiedId))}}const xu=new JB,Ug=({name:r})=>{switch(r){case"visibility":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]});case"visibility-off":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),l.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]});case"copy":return l.jsxs(l.Fragment,{children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]});case"check":return l.jsx(l.Fragment,{children:l.jsx("polyline",{points:"20 6 9 17 4 12"})});default:return null}},Hu=({id:r,label:e,value:a,type:i="text",labelSuffix:s})=>{const{t:c}=tt(),[d,m]=w.useState(!1),[g,f]=w.useState(!1);w.useEffect(()=>{const p=xu.subscribe(C=>{f(C===r)});return()=>{p()}},[r]);const E=async()=>{try{await navigator.clipboard.writeText(a),xu.setCopied(r),await gt("CLIPBOARD_COPIED",{value:a},"background"),setTimeout(()=>{xu.getCopiedId()===r&&xu.setCopied("")},2e3)}catch(p){console.error("Failed to copy text:",p)}};return l.jsxs("div",{children:[l.jsxs("label",{htmlFor:r,className:"block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:[e,s]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:i==="password"&&!d?"password":"text",id:r,readOnly:!0,value:a,onClick:E,className:`w-full px-3 py-2.5 bg-white border ${g?"border-green-500 border-2":"border-gray-300"} text-gray-900 text-sm rounded-lg shadow-sm focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:placeholder-gray-400`}),l.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2",children:[g?l.jsx("button",{type:"button",className:"p-1 text-green-500 dark:text-green-400 transition-colors duration-200",title:c("common.copied"),children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx(Ug,{name:"check"})})}):l.jsx("button",{type:"button",onClick:E,className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",title:c("common.copyToClipboard"),children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx(Ug,{name:"copy"})})}),i==="password"&&l.jsx("button",{type:"button",onClick:()=>m(!d),className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",title:c(d?"common.hidePassword":"common.showPassword"),children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx(Ug,{name:d?"visibility-off":"visibility"})})})]})]})]})},XB=({isOpen:r,onClose:e,itemId:a,fieldKey:i,fieldLabel:s,fieldType:c,isHidden:d})=>{const{t:m}=tt(),g=Gt(),{executeVaultMutationAsync:f}=vo(),[E,p]=w.useState([]),[C,I]=w.useState(!0),[x,T]=w.useState(null),k=d||c===aa.Password||c===aa.Hidden,R=w.useCallback(async()=>{if(g!=null&&g.sqliteClient)try{I(!0);const U=g.sqliteClient.items.getFieldHistory(a,i);p(U)}catch(U){console.error("Error loading field history:",U)}finally{I(!1)}},[g==null?void 0:g.sqliteClient,a,i]);w.useEffect(()=>{r&&R()},[r,g==null?void 0:g.sqliteClient,a,i,R]);const _=U=>{try{return new Date(U).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return U}},S=U=>{try{return JSON.parse(U)}catch{return[U]}},O=async U=>{if(g!=null&&g.sqliteClient)try{await f(async()=>{await g.sqliteClient.items.deleteFieldHistory(U)}),R(),T(null)}catch(P){console.error("Error deleting field history:",P)}};return l.jsx(Zn,{isOpen:r,onClose:e,title:`${s} ${m("items.history")}`,maxWidth:"max-w-2xl",bodyClassName:"px-4 pb-4 pt-4 overflow-y-auto max-h-[60vh]",children:C?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):E.length===0?l.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:m("items.noHistoryAvailable")}):l.jsx("div",{className:"space-y-3",children:E.map(U=>{const P=S(U.ValueSnapshot),K=x===U.Id;return l.jsxs("div",{className:"rounded-lg p-4 border border-gray-200 dark:border-gray-700",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:_(U.ChangedAt)}),K?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:()=>O(U.Id),className:"text-xs px-2 py-1 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 font-medium",children:m("common.confirm")}),l.jsx("button",{type:"button",onClick:()=>T(null),className:"text-xs px-2 py-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:m("common.cancel")})]}):l.jsx("button",{type:"button",onClick:()=>T(U.Id),className:"text-xs px-2 py-1 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 transition-colors",title:m("common.delete"),children:l.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]}),P.map((H,Q)=>l.jsx("div",{className:"mt-2",children:l.jsx(Hu,{id:`history-${U.Id}-${Q}`,label:"",value:H,type:k?"password":"text"})},Q))]},U.Id)})})})},JE=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/g,$B=r=>{const e=[];let a=0,i;for(JE.lastIndex=0;(i=JE.exec(r))!==null;){i.index>a&&e.push({type:"text",content:r.slice(a,i.index)});const s=i[0],c=s.startsWith("http")?s:`http://${s}`;e.push({type:"url",content:s,href:c}),a=i.index+s.length}return a<r.length&&e.push({type:"text",content:r.slice(a)}),e},ZB=({text:r})=>{const e=$B(r);return l.jsx(l.Fragment,{children:e.map((a,i)=>a.type==="url"?l.jsx("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:a.content},i):l.jsx(id.Fragment,{children:a.content},i))})},lo=({field:r,itemId:e,hideLabel:a=!1})=>{const{t:i}=tt(),s=Gt(),[c,d]=w.useState(!1),[m,g]=w.useState(0),f=r.IsCustomField?r.Label||r.FieldKey:i(`fieldLabels.${r.FieldKey}`,{defaultValue:r.FieldKey}),E=r.EnableHistory===!0;if(w.useEffect(()=>{if(E&&e&&(s!=null&&s.sqliteClient))try{const T=s.sqliteClient.items.getFieldHistory(e,r.FieldKey);if(T.length>1)g(T.length);else if(T.length===1){const k=Array.isArray(r.Value)?r.Value:[r.Value],R=JSON.stringify(k.filter(S=>S&&S.trim()!=="")),_=T[0].ValueSnapshot;g(R!==_?1:0)}else g(0)}catch(T){console.error("[FieldBlock] Error checking history:",T)}},[E,e,r.FieldKey,r.Value,s==null?void 0:s.sqliteClient]),!r.Value||typeof r.Value=="string"&&r.Value.trim()==="")return null;const p=Array.isArray(r.Value)?r.Value:[r.Value];if(p.length>1)return l.jsx("div",{className:"space-y-2",children:p.map((T,k)=>l.jsx(Hu,{id:`${r.FieldKey}-${k}`,label:k===0?f:`${f} ${k+1}`,value:T,type:r.FieldType===aa.Password?"password":"text"},`${r.FieldKey}-${k}`))});const C=p[0],I=m>0&&e?l.jsx("button",{type:"button",onClick:()=>d(!0),className:"ml-2 inline-flex items-center text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 focus:outline-none",title:i("items.viewHistory"),children:l.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}):null,x=c&&e?l.jsx(XB,{isOpen:c,onClose:()=>d(!1),itemId:e,fieldKey:r.FieldKey,fieldLabel:f,fieldType:r.FieldType,isHidden:r.IsHidden}):null;switch(r.FieldType){case aa.Password:case aa.Hidden:return l.jsxs(l.Fragment,{children:[l.jsx(Hu,{id:r.FieldKey,label:f,value:C,type:"password",labelSuffix:I}),x]});case aa.TextArea:return l.jsxs("div",{children:[!a&&l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),l.jsx("div",{className:"p-4 bg-gray-50 rounded-lg dark:bg-gray-700",children:l.jsx("p",{className:"text-gray-900 dark:text-gray-100 whitespace-pre-wrap",children:l.jsx(ZB,{text:C})})})]});case aa.Email:case aa.URL:case aa.Phone:case aa.Date:case aa.Number:case aa.Text:default:return l.jsxs(l.Fragment,{children:[l.jsx(Hu,{id:r.FieldKey,label:f,value:C,type:"text",labelSuffix:I}),x]})}},eU=({itemId:r})=>{const{t:e}=tt(),[a,i]=w.useState([]),[s,c]=w.useState(!0),[d,m]=w.useState({}),[g,f]=w.useState(null),E=Gt(),p=(T=30)=>{const k=new Ia({secret:"dummy",algorithm:"SHA1",digits:6,period:T});return k.period-Math.floor(Date.now()/1e3)%k.period},C=()=>{const T=p();return Math.floor((30-T)/30*100)},I=T=>{try{return new Ia({secret:T,algorithm:"SHA1",digits:6,period:30}).generate()}catch(k){return console.error("Error generating TOTP code:",k),"Error"}},x=async(T,k)=>{try{await navigator.clipboard.writeText(T),f(k),await gt("CLIPBOARD_COPIED",{value:T},"background"),setTimeout(()=>{f(null)},2e3)}catch(R){console.error("Failed to copy:",R)}};return w.useEffect(()=>{(async()=>{if(!(!(E!=null&&E.sqliteClient)||!r))try{const k=E.sqliteClient.settings.getTotpCodesForItem(r);i(k)}catch(k){console.error("Error loading TOTP codes:",k)}finally{c(!1)}})()},[r,E==null?void 0:E.sqliteClient]),w.useEffect(()=>{const T=_=>{const S={};return a.forEach(O=>{const U=I(O.SecretKey);U!=="Error"?S[O.Id]=U:S[O.Id]=_[O.Id]??"Error"}),S},k={};a.forEach(_=>{k[_.Id]=I(_.SecretKey)}),m(k);const R=setInterval(()=>{m(T)},1e3);return()=>{clearInterval(R)}},[a]),s?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:e("common.twoFactorAuthentication")}),e("common.loadingTotpCodes")]}):a.length===0?null:l.jsx("div",{className:"mb-4",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:e("common.twoFactorAuthentication")}),l.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(T=>l.jsx("button",{className:"w-full text-left p-2 ps-3 pe-3 rounded bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",onClick:()=>x(d[T.Id],T.Id),"aria-label":`Copy ${T.Name} code`,children:l.jsxs("div",{className:"flex justify-between items-center gap-2",children:[l.jsx("div",{className:"flex items-center flex-1",children:l.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:T.Name})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex flex-col items-end",children:[l.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:d[T.Id]}),l.jsx("div",{className:"text-xs",children:g===T.Id?l.jsx("span",{className:"text-green-600 dark:text-green-400",children:e("common.copied")}):l.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[p(),"s"]})})]}),l.jsx("div",{className:"w-1 h-6 bg-gray-200 rounded-full dark:bg-gray-600",children:l.jsx("div",{className:"bg-blue-600 rounded-full transition-all",style:{height:`${C()}%`,width:"100%"}})})]})]})},T.Id))})]})})};var Qu={Placeholder:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <circle cx="10" cy="10" r="6.5" fill="none" stroke="#f49541" stroke-width="2.5"/>
  <circle cx="10" cy="10" r="2.5" fill="none" stroke="#f49541" stroke-width="2"/>
  <path d="M15 15L27 27" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
  <path d="M19 19L23 15" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
  <path d="M24 24L28 20" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
</svg>`,Note:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M8 4C6.9 4 6 4.9 6 6V26C6 27.1 6.9 28 8 28H24C25.1 28 26 27.1 26 26V11L19 4H8Z" fill="#f49541"/>
  <path d="M19 4V11H26L19 4Z" fill="#d68338"/>
  <rect x="10" y="14" width="12" height="1.5" rx="0.75" fill="#ffe096"/>
  <rect x="10" y="18" width="10" height="1.5" rx="0.75" fill="#ffe096"/>
  <rect x="10" y="22" width="8" height="1.5" rx="0.75" fill="#ffe096"/>
</svg>`,CreditCard:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <rect x="2" y="11" width="28" height="4" fill="#d68338"/>
  <rect x="5" y="18" width="8" height="2" rx="1" fill="#ffe096"/>
  <rect x="5" y="22" width="5" height="1.5" rx="0.75" fill="#fbcb74"/>
</svg>`,Visa:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <path d="M13.5 13L11.5 19H10L8.5 14.5C8.5 14.5 8.35 14 8 14C7.65 14 7 13.8 7 13.8L7.05 13.5H9.5C9.85 13.5 10.15 13.75 10.2 14.1L10.8 17L12.5 13.5H13.5V13ZM15 19H14L15 13H16L15 19ZM20 13.5C20 13.5 19.4 13.3 18.7 13.3C17.35 13.3 16.4 14 16.4 15C16.4 15.8 17.1 16.2 17.65 16.5C18.2 16.8 18.4 17 18.4 17.2C18.4 17.5 18.05 17.7 17.6 17.7C17 17.7 16.5 17.5 16.5 17.5L16.3 18.7C16.3 18.7 16.9 19 17.7 19C19.2 19 20.1 18.2 20.1 17.1C20.1 15.7 18.4 15.6 18.4 15C18.4 14.7 18.7 14.5 19.15 14.5C19.6 14.5 20.1 14.7 20.1 14.7L20.3 13.5H20V13.5ZM24 19L23.1 13.5H22C21.7 13.5 21.45 13.7 21.35 13.95L19 19H20.5L20.8 18H22.7L22.9 19H24ZM21.2 17L22 14.5L22.45 17H21.2Z" fill="#ffe096"/>
</svg>`,Mastercard:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <circle cx="13" cy="16" r="5" fill="#d68338"/>
  <circle cx="19" cy="16" r="5" fill="#ffe096"/>
  <path d="M16 12.5C17.1 13.4 17.8 14.6 17.8 16C17.8 17.4 17.1 18.6 16 19.5C14.9 18.6 14.2 17.4 14.2 16C14.2 14.6 14.9 13.4 16 12.5Z" fill="#fbcb74"/>
</svg>`,Amex:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <text x="16" y="18" text-anchor="middle" fill="#ffe096" font-size="8" font-weight="bold" font-family="Arial, sans-serif">AMEX</text>
</svg>`,Discover:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <circle cx="20" cy="16" r="4" fill="#ffe096"/>
  <path d="M7 14H8.5C9.3 14 10 14.7 10 15.5C10 16.3 9.3 17 8.5 17H7V14Z" fill="#ffe096"/>
  <rect x="11" y="14" width="1.5" height="3" fill="#ffe096"/>
  <path d="M14 15C14 14.4 14.4 14 15 14C15.3 14 15.5 14.1 15.7 14.3L16.5 13.5C16.1 13.2 15.6 13 15 13C13.9 13 13 13.9 13 15C13 16.1 13.9 17 15 17C15.6 17 16.1 16.8 16.5 16.5L15.7 15.7C15.5 15.9 15.3 16 15 16C14.4 16 14 15.6 14 15Z" fill="#ffe096"/>
</svg>`};const _g=({svg:r,className:e="w-8 h-8"})=>l.jsx("div",{className:`${e} flex-shrink-0`,dangerouslySetInnerHTML:{__html:r}}),tU=r=>{if(!r)return"CreditCard";const e=r.replace(/[\s-]/g,"");return/^\d{4,}/.test(e)?/^4/.test(e)?"Visa":/^5[1-5]/.test(e)||/^2[2-7]/.test(e)?"Mastercard":/^3[47]/.test(e)?"Amex":/^6(?:011|22|4[4-9]|5)/.test(e)?"Discover":"CreditCard":"CreditCard"},aU=r=>Qu[tU(r)],$I=({item:r,className:e="w-8 h-8"})=>{var i;if(r.ItemType===ma.Note)return l.jsx(_g,{svg:Qu.Note,className:e});if(r.ItemType===ma.CreditCard){const s=(i=r.Fields)==null?void 0:i.find(d=>d.FieldKey===$a.CardNumber),c=s!=null&&s.Value?Array.isArray(s.Value)?s.Value[0]:s.Value:void 0;return l.jsx(_g,{svg:aU(c),className:e})}const a=r.Logo&&r.Logo.length>0?Yg.imgSrcFromBytes(r.Logo):null;return a?l.jsx("img",{src:a,alt:r.Name||"Item",className:`${e} flex-shrink-0`,onError:s=>{const c=s.target;c.style.display="none";const d=c.parentElement;if(d){const m=document.createElement("div");m.className=e,m.innerHTML=Qu.Placeholder,d.insertBefore(m,c)}}}):l.jsx(_g,{svg:Qu.Placeholder,className:e})},nU=({email:r})=>{const{t:e}=tt(),[a,i]=w.useState([]),[s,c]=w.useState([]),[d,m]=w.useState(!0),[g,f]=w.useState(0),[E,p]=w.useState(!1),[C,I]=w.useState(null),[x,T]=w.useState(!1),[k,R]=w.useState(2),_=ur(),S=Gt(),O=3,U=k<a.length,P=(V,G)=>{const q=V.slice(0,G);c(q)},K=()=>{const V=Math.min(k+O,a.length);R(V),P(a,V)},H=async V=>(await Pl("local:publicEmailDomains")??[]).some(q=>V.toLowerCase().endsWith(`@${q.toLowerCase()}`)),Q=async V=>(await Pl("local:privateEmailDomains")??[]).some(q=>V.toLowerCase().endsWith(`@${q.toLowerCase()}`));return w.useEffect(()=>{const V=async()=>{var q;try{if(S.isOffline){m(!1);return}I(null);const W=await H(r),ne=await Q(r),me=W||ne;if(p(W),T(me),!me)return;if(W){const $=r.split("@")[0],re=await fetch(`https://api.spamok.com/v2/EmailBox/${$}`,{headers:{"X-Asdasd-Platform-Id":"av-chrome","X-Asdasd-Platform-Version":Za.VERSION}});if(!re.ok){I(e("common.errors.unknownError"));return}const ye=await re.json(),Ae=((q=ye==null?void 0:ye.mails)==null?void 0:q.toSorted((j,X)=>new Date(X.dateSystem).getTime()-new Date(j.dateSystem).getTime()))??[];d&&Ae.length>0&&f(Ae[0].id),i(j=>JSON.stringify(j.map(ee=>ee.id))!==JSON.stringify(Ae.map(ee=>ee.id))?(P(Ae,k),Ae):j)}else if(ne)try{const $=await _.authFetch(`EmailBox/${r}`,{method:"GET"},!0,!1);try{const ye=$.mails.toSorted((Ae,j)=>new Date(j.dateSystem).getTime()-new Date(Ae.dateSystem).getTime());if(ye){const Ae=await Mt.decryptEmailList(ye,S.sqliteClient.settings.getAllEncryptionKeys());d&&Ae.length>0&&f(Ae[0].id),i(j=>JSON.stringify(j.map(ee=>ee.id))!==JSON.stringify(Ae.map(ee=>ee.id))?(P(Ae,k),Ae):j),I(null)}}catch{const re=$;if(S.shouldSuppressEmailErrors())return;I(e("emails.apiErrors."+(re==null?void 0:re.code)));return}}catch{if(S.shouldSuppressEmailErrors())return;I(e("common.errors.unknownError"));return}}catch(W){console.error("Error loading emails:",W),I(e("common.errors.unknownError"))}m(!1)};V();const G=setInterval(V,2e3);return()=>clearInterval(G)},[r,d,_,S,e,k]),x?S.isOffline?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsx("div",{className:"flex items-center gap-2 mb-2",children:l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")})}),l.jsx("p",{className:"text-sm",children:e("emails.offlineMessage")})]}):C?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsx("div",{className:"flex items-center gap-2 mb-2",children:l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")})}),l.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded",children:l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:C})})]}):d?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")}),l.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),e("common.loadingEmails")]}):a.length===0?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4 text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")}),l.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),e("emails.noEmails")]}):l.jsxs("div",{className:"space-y-2 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")}),l.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),s.map(V=>E?l.jsxs("a",{href:`https://spamok.com/${r.split("@")[0]}/${V.id}`,target:"_blank",rel:"noopener noreferrer",className:`flex justify-between items-center p-2 ps-3 pe-3 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${V.id>g?"bg-yellow-50 dark:bg-yellow-900/30":""}`,children:[l.jsx("div",{className:"truncate flex-1",children:l.jsxs("span",{className:"text-sm text-gray-900 dark:text-white",children:[V.subject.substring(0,30),V.subject.length>30?"...":""]})}),l.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:new Date(V.dateSystem).toLocaleDateString()})]},V.id):l.jsxs(cd,{to:`/emails/${V.id}`,className:`flex justify-between items-center p-2 ps-3 pe-3 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${V.id>g?"bg-yellow-50 dark:bg-yellow-900/30":""}`,children:[l.jsx("span",{className:"truncate flex-1",children:l.jsxs("span",{className:"text-sm text-gray-900 dark:text-white",children:[V.subject.substring(0,30),V.subject.length>30?"...":""]})}),l.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:new Date(V.dateSystem).toLocaleDateString()})]},V.id)),U&&l.jsxs("button",{onClick:K,className:"w-full mt-2 py-1 px-3 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-md transition-colors duration-200 text-sm text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100 flex items-center justify-center gap-1",children:[l.jsx("span",{children:e("common.loadMore")}),l.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}):null},rU=()=>{const{t:r}=tt(),{id:e}=od(),a=La(),i=Gt(),[s,c]=w.useState(null),{setIsInitialLoading:d}=pa(),{setHeaderButtons:m}=mr(),g=w.useCallback(()=>{Aa.openInNewPopup(`/items/${e}`)},[e]),f=w.useCallback(()=>{a(`/items/${e}/edit`)},[e,a]);if(w.useEffect(()=>{if(Aa.isPopup()&&(window.history.replaceState({},"","popup.html#/items"),window.history.pushState({},"",`popup.html#/items/${e}`)),!(!(i!=null&&i.sqliteClient)||!e))try{const I=i.sqliteClient.items.getById(e);I?(c(I),d(!1)):(console.error("Item not found"),a("/items"))}catch(I){console.error("Error loading item:",I)}},[i.sqliteClient,e,a,d]),w.useEffect(()=>{const I=l.jsxs("div",{className:"flex items-center gap-2",children:[!Aa.isPopup()&&l.jsx(Nn,{onClick:g,title:r("common.openInNewWindow"),iconType:Fa.EXPAND}),l.jsx(Nn,{onClick:f,title:r("items.editItem"),iconType:Fa.EDIT})]});return m(I),()=>{}},[m,f,g,r]),w.useEffect(()=>()=>m(null),[m]),!s)return l.jsx("div",{children:r("common.loading")});const E=s.Fields.filter(I=>I.FieldType===aa.URL&&I.Value),p={...s,Fields:s.Fields.filter(I=>I.FieldType!==aa.URL)},C=Fk(p);return l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"flex justify-between items-start",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx($I,{item:s,className:"w-12 h-12 rounded-lg"}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:s.Name||r("items.untitled")}),E.length>0&&l.jsx("div",{className:"mt-1 space-y-1",children:E.flatMap(I=>(Array.isArray(I.Value)?I.Value:[I.Value]).map((T,k)=>/^https?:\/\//i.test(T)?l.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"block text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 break-all text-sm",children:T},`${I.FieldKey}-${k}`):l.jsx("span",{className:"block text-gray-500 dark:text-gray-300 break-all text-sm",children:T},`${I.FieldKey}-${k}`)))})]})]})}),(s.ItemType===ma.Login||s.ItemType===ma.Alias)&&(()=>{const I=s.Fields.find(k=>k.FieldKey==="login.email"),x=I==null?void 0:I.Value,T=Array.isArray(x)?x[0]:x;return T?l.jsx(nU,{email:T}):null})(),(s.ItemType===ma.Login||s.ItemType===ma.Alias)&&l.jsx(eU,{itemId:s.Id}),(s.ItemType===ma.Login||s.ItemType===ma.Alias)&&s.HasPasskey&&l.jsx(OR,{itemId:s.Id}),s.ItemType===ma.Note&&C[dt.Notes]&&C[dt.Notes].length>0&&C[dt.Notes].map(I=>l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r(`fieldLabels.${I.FieldKey}`,{defaultValue:I.Label||I.FieldKey})}),l.jsx(lo,{field:I,itemId:s.Id,hideLabel:!0})]},I.FieldKey)),Object.keys(C).length>0&&l.jsxs(l.Fragment,{children:[C[dt.Login]&&C[dt.Login].length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.credentials")}),C[dt.Login].map(I=>l.jsx(lo,{field:I,itemId:s.Id},I.FieldKey))]}),C[dt.Alias]&&C[dt.Alias].length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.alias")}),C[dt.Alias].map(I=>l.jsx(lo,{field:I,itemId:s.Id},I.FieldKey))]}),C[dt.Card]&&C[dt.Card].length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("items.cardInformation")}),C[dt.Card].map(I=>l.jsx(lo,{field:I,itemId:s.Id},I.FieldKey))]}),s.ItemType!==ma.Note&&C[dt.Notes]&&C[dt.Notes].length>0&&C[dt.Notes].map(I=>l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r(`fieldLabels.${I.FieldKey}`,{defaultValue:I.Label||I.FieldKey})}),l.jsx(lo,{field:I,itemId:s.Id,hideLabel:!0})]},I.FieldKey)),C[dt.Custom]&&C[dt.Custom].length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.customFields")}),C[dt.Custom].map(I=>l.jsx(lo,{field:I,itemId:s.Id},I.FieldKey))]})]}),l.jsx(YB,{itemId:s.Id}),s.Tags&&s.Tags.length>0&&l.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-4",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r("items.tags")}),l.jsx("div",{className:"flex flex-wrap gap-2",children:s.Tags.map(I=>l.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:I.Name},I.Id))})]})]})},iU=({isOpen:r,onClose:e,onDeleteFolderOnly:a,onDeleteFolderAndContents:i,itemCount:s})=>{const{t:c}=tt(),[d,m]=w.useState(!1),g=async()=>{m(!0);try{await a(),e()}catch(p){console.error("Error deleting folder:",p)}finally{m(!1)}},f=async()=>{m(!0);try{await i(),e()}catch(p){console.error("Error deleting folder with contents:",p)}finally{m(!1)}},E=()=>{d||e()};return l.jsx(Zn,{isOpen:r,onClose:E,title:c("items.deleteFolder"),footer:l.jsx("div",{className:"flex justify-end",children:l.jsx("button",{type:"button",onClick:E,disabled:d,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50",children:c("common.cancel")})}),children:l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"space-y-3 pt-2",children:[l.jsx("button",{type:"button",onClick:g,disabled:d,className:"w-full p-3 text-left border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"mt-0.5 text-orange-500",children:l.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 14l2 2 4-4"})]})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:c("items.deleteFolderKeepItems")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:c("items.deleteFolderKeepItemsDescription")})]})]})}),s>0&&l.jsx("button",{type:"button",onClick:f,disabled:d,className:"w-full p-3 text-left border border-red-300 dark:border-red-700 rounded-lg hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-50",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"mt-0.5 text-red-500",children:l.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("polyline",{points:"3 6 5 6 21 6"}),l.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-red-600 dark:text-red-400",children:c("items.deleteFolderAndItems")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:c("items.deleteFolderAndItemsDescription",{count:s})})]})]})})]})})})},XE=({isOpen:r,onClose:e,onSave:a,initialName:i="",mode:s})=>{const{t:c}=tt(),[d,m]=w.useState(i),[g,f]=w.useState(!1),[E,p]=w.useState(null);w.useEffect(()=>{r&&(m(i),p(null))},[r,i]);const C=async I=>{I.preventDefault();const x=d.trim();if(!x){p(c("items.folderNameRequired"));return}f(!0),p(null);try{await a(x),e()}catch(T){p(c("common.errors.unknownErrorTryAgain")),console.error("Error saving folder:",T)}finally{f(!1)}};return l.jsx(Zn,{isOpen:r,onClose:e,title:c(s==="create"?"items.createFolder":"items.editFolder"),footer:l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:e,disabled:g,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50",children:c("common.cancel")}),l.jsx("button",{type:"submit",form:"folder-form",disabled:g,className:"px-4 py-2 text-sm font-medium text-white bg-orange-600 hover:bg-orange-700 rounded focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 disabled:opacity-50",children:c(g?"common.saving":s==="create"?"common.create":"common.save")})]}),children:l.jsxs("form",{id:"folder-form",onSubmit:C,children:[l.jsx("label",{htmlFor:"folderName",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("items.folderName")}),l.jsx("input",{id:"folderName",type:"text",value:d,onChange:I=>m(I.target.value),autoFocus:!0,className:"w-full p-2 border dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-blue-500 focus:border-blue-500"}),E&&l.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:E})]})})},$E=({folder:r,onClick:e})=>l.jsxs("button",{onClick:e,className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-700/50 hover:bg-gray-50 dark:hover:bg-gray-600/50 border border-gray-200 dark:border-gray-600 rounded-full text-sm transition-colors focus:outline-none focus:ring-2 focus:ring-orange-500/50",children:[l.jsx("svg",{className:"w-3.5 h-3.5 text-orange-500 dark:text-orange-400 flex-shrink-0",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z"})}),l.jsx("span",{className:"text-gray-700 dark:text-gray-200 font-medium truncate max-w-[120px]",children:r.name}),r.itemCount>0&&l.jsx("span",{className:"text-gray-400 dark:text-gray-500 text-xs",children:r.itemCount})]}),sU=({item:r,showFolderPath:e=!1})=>{const{t:a}=tt(),i=La(),s=d=>{var f,E;let m="";const g=(f=d.Fields)==null?void 0:f.find(p=>p.FieldKey===$a.LoginUsername);if(g&&g.Value&&(m=Array.isArray(g.Value)?g.Value[0]:g.Value),!m){const p=(E=d.Fields)==null?void 0:E.find(C=>C.FieldKey===$a.LoginEmail);p&&p.Value&&(m=Array.isArray(p.Value)?p.Value[0]:p.Value)}return m.length>33?m.slice(0,30)+"...":m},c=d=>{let m=a("items.untitled");return d.Name&&(m=d.Name),m.length>33?m.slice(0,30)+"...":m};return l.jsx("li",{children:l.jsxs("button",{onClick:()=>i(`/items/${r.Id}`),className:"w-full p-2 border dark:border-gray-600 rounded flex items-center bg-white dark:bg-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[l.jsx("div",{className:"w-8 h-8 mr-2 flex-shrink-0",children:l.jsx($I,{item:r,className:"w-8 h-8"})}),l.jsxs("div",{className:"text-left flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:e&&r.FolderPath?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:[r.FolderPath," > "]}),c(r)]}):c(r)}),r.HasPasskey&&l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Has passkey",children:l.jsx("path",{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"})}),r.HasAttachment&&l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Has attachments",children:l.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),r.HasTotp&&l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",viewBox:"0 -960 960 960",fill:"currentColor","aria-label":"Has 2FA",children:l.jsx("path",{d:"M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm100-200h46v-240h-36l-70 50 24 36 36-26v180Zm124 0h156v-40h-94l-2-2q21-20 34.5-34t21.5-22q18-18 27-36t9-38q0-29-22-48.5T458-600q-26 0-47 15t-29 39l40 16q5-13 14.5-20.5T458-558q15 0 24.5 8t9.5 20q0 11-4 20.5T470-486l-32 32-54 54v40Zm296 0q36 0 58-20t22-52q0-18-10-32t-28-22v-2q14-8 22-20.5t8-29.5q0-27-21-44.5T678-600q-25 0-46.5 14.5T604-550l40 16q4-12 13-19t21-7q13 0 21.5 7.5T708-534q0 14-10 22t-26 8h-18v40h20q20 0 31 8t11 22q0 13-11 22.5t-25 9.5q-17 0-26-7.5T638-436l-40 16q7 29 28.5 44.5T680-360ZM160-240h640v-480H160v480Zm0 0v-480 480Z"})})]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s(r)})]})]})})},Ao="items-filter",oU=5*60*1e3,lU=()=>{try{const r=localStorage.getItem(Ao);if(!r)return"all";const{filter:e,timestamp:a}=JSON.parse(r);return Date.now()-a>oU?(localStorage.removeItem(Ao),"all"):e}catch{return"all"}},Tu=r=>{try{localStorage.setItem(Ao,JSON.stringify({filter:r,timestamp:Date.now()}))}catch{}},Su=r=>Object.values(ma).includes(r),ZE=()=>{const{t:r}=tt(),{folderId:e}=od(),a=tn(),i=Gt(),s=dr(),c=La(),{syncVault:d}=md(),{executeVaultMutationAsync:m}=vo(),{setHeaderButtons:g}=mr(),[f,E]=w.useState([]),[p,C]=w.useState(""),[I,x]=w.useState(lU()),[T,k]=w.useState(!1),[R,_]=w.useState(!1),[S,O]=w.useState(!1),[U,P]=w.useState(!1),[K,H]=w.useState(0),[Q,V]=w.useState(0),{setIsInitialLoading:G}=pa(),q=e??null,W=w.useMemo(()=>{if(!q||!(i!=null&&i.sqliteClient))return null;const Qe=i.sqliteClient.folders.getAll().find(yt=>yt.Id===q);return(Qe==null?void 0:Qe.Name)??null},[q,i==null?void 0:i.sqliteClient,Q]),[ne,me]=Zl(!0,100);w.useEffect(()=>{const Ne=a.state;Ne!=null&&Ne.resetFilters&&(C(""),x("all"),localStorage.removeItem(Ao),c(a.pathname,{replace:!0,state:{}}))},[a.state,a.pathname,c]);const $=w.useCallback(()=>{const Ne=new URLSearchParams;Su(I)&&Ne.set("type",I),q&&Ne.set("folderId",q);const Qe=Ne.toString();c(Qe?`/items/add?${Qe}`:"/items/add")},[c,I,q]),re=w.useCallback(()=>{_(!0)},[]),ye=w.useCallback(async Ne=>{if(!(i!=null&&i.sqliteClient)){console.error("[FOLDER DEBUG] No sqliteClient available");return}await m(async()=>{await i.sqliteClient.folders.create(Ne,q)});const Qe=i.sqliteClient.items.getAll();E(Qe)},[i,q,m]),Ae=w.useCallback(async()=>{if(!(i!=null&&i.sqliteClient)||!q)return;await m(async()=>{await i.sqliteClient.folders.delete(q)});const Ne=i.sqliteClient.items.getAll();E(Ne);const Qe=i.sqliteClient.items.getRecentlyDeletedCount();H(Qe),c("/items")},[i,q,m,c]),j=w.useCallback(async()=>{if(!(i!=null&&i.sqliteClient)||!q)return;await m(async()=>{await i.sqliteClient.folders.deleteWithContents(q)});const Ne=i.sqliteClient.items.getAll();E(Ne);const Qe=i.sqliteClient.items.getRecentlyDeletedCount();H(Qe),c("/items")},[i,q,m,c]),X=w.useCallback(async Ne=>{!(i!=null&&i.sqliteClient)||!q||(await m(async()=>{await i.sqliteClient.folders.update(q,Ne)}),V(Qe=>Qe+1),P(!1))},[i,q,m]),ee=w.useCallback(async()=>{if(i!=null&&i.sqliteClient)try{await d({onSuccess:async Ne=>{},onOffline:()=>{},onError:async Ne=>{console.error("Error syncing vault:",Ne)}})}catch(Ne){console.error("Error refreshing items:",Ne),await s.logout("Error while syncing vault, please re-authenticate.")}},[i,s,d]),ie=w.useCallback(async()=>{me(!0),await ee(),me(!1)},[ee,me]);w.useEffect(()=>{const Ne=l.jsxs("div",{className:"flex items-center gap-2",children:[!Aa.isPopup()&&l.jsx(Nn,{onClick:()=>Aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Fa.EXPAND}),l.jsx(Nn,{onClick:$,title:r("items.addNewItem"),iconType:Fa.PLUS})]});return g(Ne),()=>g(null)},[g,$,r]),w.useEffect(()=>{(async()=>{var Qe,yt;if(i!=null&&i.sqliteClient){me(!0);const We=((Qe=i.sqliteClient)==null?void 0:Qe.items.getAll())??[];E(We);const nt=((yt=i.sqliteClient)==null?void 0:yt.items.getRecentlyDeletedCount())??0;H(nt),me(!1),G(!1)}})()},[i==null?void 0:i.sqliteClient,me,G]);const Ie=()=>{if(q&&W)return W;switch(I){case"passkeys":return r("items.filters.passkeys");case"attachments":return r("common.attachments");case"all":return r("items.title");default:if(Su(I)){const Ne=ed.find(Qe=>Qe.type===I);if(Ne)return r(Ne.titleKey)}return r("items.title")}},we=w.useCallback((Ne,Qe)=>{C(""),c(`/items/folder/${Ne}`)},[c]),Re=()=>{if(q||p)return[];if(!(i!=null&&i.sqliteClient))return[];const Ne=i.sqliteClient.folders.getAll(),Qe=new Map;return f.forEach(We=>{We.FolderId&&Qe.set(We.FolderId,(Qe.get(We.FolderId)||0)+1)}),Ne.map(We=>({id:We.Id,name:We.Name,itemCount:Qe.get(We.Id)||0})).sort((We,nt)=>We.name.localeCompare(nt.name))},De=f.filter(Ne=>{var Ht,ve;if(q!==null){if(Ne.FolderId!==q)return!1}else if(!p&&Ne.FolderId)return!1;let Qe=!0;if(I==="passkeys"?Qe=Ne.HasPasskey===!0:I==="attachments"?Qe=Ne.HasAttachment===!0:Su(I)&&(Qe=Ne.ItemType===I),!Qe)return!1;const yt=p.toLowerCase().trim();return!!(!yt||(((Ht=Ne.Name)==null?void 0:Ht.toLowerCase())||"").includes(yt)||((ve=Ne.Fields)==null?void 0:ve.some(Be=>(Array.isArray(Be.Value)?Be.Value.join(" ").toLowerCase():(Be.Value||"").toLowerCase()).includes(yt)||Be.Label.toLowerCase().includes(yt))))}),Te=Re(),He=f.length>0&&f.every(Ne=>Ne.FolderId!==null);return ne?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx($n,{})}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center gap-2 mb-4",children:[l.jsxs("div",{className:"relative min-w-0 flex-1 flex items-center gap-2",children:[He&&!q?l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl min-w-0",children:l.jsx("span",{className:"truncate",children:r("items.title")})}):l.jsxs("button",{onClick:()=>k(!T),className:"flex items-center gap-1 text-gray-900 dark:text-white text-xl hover:text-gray-700 dark:hover:text-gray-300 focus:outline-none min-w-0",children:[l.jsxs("h2",{className:"flex items-baseline gap-1.5 min-w-0 overflow-hidden",children:[l.jsx("span",{className:"truncate",children:Ie()}),l.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400 shrink-0",children:["(",De.length,")"]})]}),l.jsx("svg",{className:"w-4 h-4 mt-1 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),q&&l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsx("button",{onClick:()=>P(!0),title:r("items.editFolder"),className:"p-1.5 text-gray-400 hover:text-orange-500 dark:text-gray-500 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),l.jsx("button",{onClick:()=>O(!0),title:r("items.deleteFolder"),className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:l.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("polyline",{points:"3 6 5 6 21 6"}),l.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]}),T&&!(He&&!q)&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>k(!1)}),l.jsx("div",{className:"absolute left-0 top-full mt-1 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-20",children:l.jsxs("div",{className:"py-1",children:[l.jsx("button",{onClick:()=>{const Ne="all";x(Ne),Tu(Ne),k(!1)},className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${I==="all"?"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400":"text-gray-700 dark:text-gray-300"}`,children:r("items.filters.all")}),l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),ed.map(Ne=>l.jsxs("button",{onClick:()=>{const Qe=Ne.type;x(Qe),Tu(Qe),k(!1)},className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center gap-2 ${I===Ne.type?"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400":"text-gray-700 dark:text-gray-300"}`,children:[l.jsx("span",{className:I===Ne.type?"text-orange-500 dark:text-orange-400":"text-gray-400 dark:text-gray-500",children:Ne.iconSvg}),r(Ne.titleKey)]},Ne.type)),l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),l.jsx("button",{onClick:()=>{const Ne="passkeys";x(Ne),Tu(Ne),k(!1)},className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${I==="passkeys"?"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400":"text-gray-700 dark:text-gray-300"}`,children:r("items.filters.passkeys")}),l.jsx("button",{onClick:()=>{const Ne="attachments";x(Ne),Tu(Ne),k(!1)},className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${I==="attachments"?"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400":"text-gray-700 dark:text-gray-300"}`,children:r("common.attachments")}),l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),l.jsxs("button",{onClick:()=>{k(!1),c("/items/deleted")},className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 flex items-center justify-between",children:[l.jsx("span",{children:r("recentlyDeleted.title")}),K>0&&l.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:K})]})]})})]})]}),l.jsx(oh,{onClick:ie})]}),f.length>0?l.jsx("div",{className:"mb-4",children:l.jsx("input",{type:"text",value:p,onChange:Ne=>C(Ne.target.value),placeholder:`${r("content.searchVault")}`,autoFocus:!0,className:"w-full p-2 border dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-blue-500 focus:border-blue-500"})}):l.jsx(l.Fragment,{}),f.length===0?l.jsx(l.Fragment,{children:l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 space-y-2 mb-10",children:[l.jsx("p",{children:r("items.welcomeTitle")}),l.jsx("p",{children:r("items.welcomeDescription")})]})}):De.length===0&&Te.length===0&&!He?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 space-y-3 mb-10",children:[(I!=="all"||p)&&l.jsxs(l.Fragment,{children:[l.jsx("p",{children:p&&I!=="all"?r("items.noMatchingItemsWithFilter",{filter:Ie(),search:p}):p?r("items.noMatchingItemsSearch",{search:p}):I==="passkeys"?r("items.noPasskeysFound"):I==="attachments"?r("items.noAttachmentsFound"):Su(I)?r("items.noItemsOfTypeFound",{type:Ie()}):r("items.noMatchingItems")}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[p&&l.jsxs("button",{onClick:()=>C(""),className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 rounded-lg transition-colors",children:[l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),r("items.clearSearch")]}),I!=="all"&&l.jsxs("button",{onClick:()=>{x("all"),localStorage.removeItem(Ao)},className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-100 dark:bg-orange-900/30 hover:bg-orange-200 dark:hover:bg-orange-900/50 text-orange-700 dark:text-orange-300 rounded-lg transition-colors",children:[l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),r("items.clearFilter")]})]})]}),q&&l.jsx("p",{className:"text-sm",children:r("items.emptyFolderHint")})]}):He&&De.length===0&&!q&&!p?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[Te.map(Ne=>l.jsx($E,{folder:Ne,onClick:()=>we(Ne.id,Ne.name)},Ne.id)),l.jsxs("button",{onClick:re,className:"inline-flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-full transition-colors focus:outline-none text-gray-500 dark:text-gray-400 hover:text-orange-600 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700/50",children:[l.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),l.jsxs("svg",{className:"w-3 h-3 -ml-0.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})]})]}),l.jsx("div",{className:"text-gray-500 dark:text-gray-400 text-sm",children:l.jsx("p",{children:r("items.allItemsInFolders")})})]}):l.jsxs(l.Fragment,{children:[!q&&!p&&l.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[Te.map(Ne=>l.jsx($E,{folder:Ne,onClick:()=>we(Ne.id,Ne.name)},Ne.id)),l.jsxs("button",{onClick:re,className:`inline-flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-full transition-colors focus:outline-none ${Te.length>0?"text-gray-500 dark:text-gray-400 hover:text-orange-600 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700/50":"text-gray-400 dark:text-gray-500 border border-dashed border-gray-300 dark:border-gray-600 hover:border-orange-400 dark:hover:border-orange-500 hover:text-orange-600 dark:hover:text-orange-400"}`,children:[l.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),l.jsxs("svg",{className:"w-3 h-3 -ml-0.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),Te.length===0&&l.jsx("span",{children:r("items.newFolder")})]})]}),De.length>0&&l.jsx("ul",{id:"items-list",className:"space-y-2",children:De.map(Ne=>l.jsx(sU,{item:Ne,showFolderPath:!!p&&!!Ne.FolderPath},Ne.Id))}),(I!=="all"||p)&&l.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mt-4 pt-4",children:[p&&l.jsxs("button",{onClick:()=>C(""),className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 rounded-lg transition-colors",children:[l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),r("items.clearSearch")]}),I!=="all"&&l.jsxs("button",{onClick:()=>{x("all"),localStorage.removeItem(Ao)},className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-100 dark:bg-orange-900/30 hover:bg-orange-200 dark:hover:bg-orange-900/50 text-orange-700 dark:text-orange-300 rounded-lg transition-colors",children:[l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),r("items.clearFilter")]})]})]}),l.jsx(XE,{isOpen:R,onClose:()=>_(!1),onSave:ye,mode:"create"}),l.jsx(XE,{isOpen:U,onClose:()=>P(!1),onSave:X,initialName:W||"",mode:"edit"}),l.jsx(iU,{isOpen:S,onClose:()=>O(!1),onDeleteFolderOnly:Ae,onDeleteFolderAndContents:j,itemCount:De.length})]})},eb=[{type:"Login",titleKey:"itemTypes.login.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})},{type:"Alias",titleKey:"itemTypes.alias.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})},{type:"CreditCard",titleKey:"itemTypes.creditCard.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})},{type:"Note",titleKey:"itemTypes.note.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}],cU=()=>{const{t:r}=tt(),e=La(),{setIsInitialLoading:a}=pa(),[i,s]=w.useState(""),[c,d]=w.useState("Login"),[m,g]=w.useState(!1);w.useEffect(()=>{a(!1)},[a]);const f=w.useCallback(()=>{const C=new URLSearchParams;C.set("type",c),i.trim()&&C.set("name",i.trim()),e(`/items/add?${C.toString()}`)},[c,i,e]),E=w.useCallback(C=>{d(C),g(!1)},[]),p=eb.find(C=>C.type===c);return l.jsxs("div",{className:"p-4 space-y-6",children:[l.jsx("div",{children:l.jsx(fd,{id:"itemName",label:r("common.serviceName"),value:i,onChange:s,type:"text",placeholder:r("common.serviceName")})}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r("itemTypes.typeLabel")}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>g(!m),className:"w-full px-4 py-3 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-primary-600 dark:text-primary-400",children:p==null?void 0:p.iconSvg}),l.jsx("span",{className:"font-medium",children:p?r(p.titleKey):""})]}),l.jsx("svg",{className:`w-5 h-5 text-gray-400 transition-transform ${m?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),m&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>g(!1)}),l.jsx("div",{className:"absolute z-20 mt-1 w-full bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg",children:eb.map(C=>l.jsxs("button",{type:"button",onClick:()=>E(C.type),className:`w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 border-b border-gray-100 dark:border-gray-700 last:border-b-0 ${c===C.type?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300":"text-gray-900 dark:text-white"}`,children:[l.jsx("span",{className:c===C.type?"text-primary-600 dark:text-primary-400":"text-gray-500 dark:text-gray-400",children:C.iconSvg}),l.jsx("span",{className:"font-medium",children:r(C.titleKey)}),c===C.type&&l.jsx("svg",{className:"w-5 h-5 ml-auto text-primary-600 dark:text-primary-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},C.type))})]})]})]}),l.jsx("button",{type:"button",onClick:f,className:"w-full px-4 py-3 bg-primary-600 text-white rounded-md hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 font-medium",children:r("common.next")})]})},tb=({isOpen:r,onClose:e,onConfirm:a,title:i,message:s,confirmText:c})=>{const{t:d}=tt();return l.jsx(Zn,{isOpen:r,onClose:e,title:i,maxWidth:"max-w-sm",footer:l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:e,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded",children:d("common.cancel")}),l.jsx("button",{onClick:a,className:"px-4 py-2 text-sm bg-red-600 text-white rounded hover:bg-red-700",children:c})]}),children:l.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:s})})},uU=(r,e=30)=>{const a=new Date(r),i=new Date(a.getTime()+e*24*60*60*1e3),s=new Date,c=Math.ceil((i.getTime()-s.getTime())/(24*60*60*1e3));return Math.max(0,c)},dU=()=>{const{t:r}=tt(),e=Gt(),{executeVaultMutationAsync:a}=vo(),{setHeaderButtons:i}=mr(),[s,c]=w.useState([]),[d,m]=w.useState(null),[g,f]=w.useState(!1),[E,p]=w.useState(!1),[C,I]=Zl(!0,100),x=w.useCallback(()=>{if(e!=null&&e.sqliteClient){const S=e.sqliteClient.items.getRecentlyDeleted();c(S)}},[e==null?void 0:e.sqliteClient]),T=w.useCallback(async S=>{e!=null&&e.sqliteClient&&(await a(async()=>{await e.sqliteClient.items.restore(S)}),x())},[e==null?void 0:e.sqliteClient,a,x]),k=w.useCallback(async()=>{!(e!=null&&e.sqliteClient)||!d||(await a(async()=>{await e.sqliteClient.items.permanentlyDelete(d)}),x(),f(!1),m(null))},[e==null?void 0:e.sqliteClient,a,x,d]),R=w.useCallback(async()=>{e!=null&&e.sqliteClient&&(await a(async()=>{for(const S of s)await e.sqliteClient.items.permanentlyDelete(S.Id)}),x(),p(!1))},[e==null?void 0:e.sqliteClient,a,s,x]);w.useEffect(()=>(i(null),()=>i(null)),[i]),w.useEffect(()=>{(async()=>{e!=null&&e.sqliteClient&&(I(!0),x(),I(!1))})()},[e==null?void 0:e.sqliteClient,I,x]);const _=w.useCallback(()=>{f(!1),m(null)},[]);return C?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx($n,{})}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsxs("h2",{className:"flex items-baseline gap-1.5 text-gray-900 dark:text-white text-xl",children:[r("recentlyDeleted.title"),l.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:["(",s.length,")"]})]}),s.length>0&&l.jsx("button",{onClick:()=>p(!0),className:"text-sm text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300",children:r("recentlyDeleted.emptyAll")})]}),s.length===0?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 space-y-2 mb-10",children:[l.jsx("p",{children:r("recentlyDeleted.noItems")}),l.jsx("p",{className:"text-sm",children:r("recentlyDeleted.noItemsDescription")})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-4",children:r("recentlyDeleted.description")}),l.jsx("ul",{className:"space-y-2",children:s.map(S=>{const O=S.DeletedAt,U=O?uU(O):30;return l.jsx("li",{className:"relative",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[S.Logo&&l.jsx("img",{src:`data:image/png;base64,${btoa(String.fromCharCode(...S.Logo))}`,alt:"",className:"w-6 h-6 rounded"}),l.jsx("span",{className:"font-medium text-gray-900 dark:text-white truncate",children:S.Name||r("items.untitled")})]}),l.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:U>0?r("recentlyDeleted.daysRemaining",{count:U}):l.jsx("span",{className:"text-red-500",children:r("recentlyDeleted.expiringSoon")})})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>T(S.Id),className:"px-3 py-1 text-sm bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded hover:bg-green-200 dark:hover:bg-green-900/50",children:r("recentlyDeleted.restore")}),l.jsx("button",{onClick:()=>{m(S.Id),f(!0)},className:"px-3 py-1 text-sm bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 rounded hover:bg-red-200 dark:hover:bg-red-900/50",children:r("common.delete")})]})]})})},S.Id)})})]}),l.jsx(tb,{isOpen:g&&!!d,onClose:_,onConfirm:k,title:r("recentlyDeleted.confirmDeleteTitle"),message:r("recentlyDeleted.confirmDeleteMessage"),confirmText:r("recentlyDeleted.deletePermanently")}),l.jsx(tb,{isOpen:E,onClose:()=>p(!1),onConfirm:R,title:r("recentlyDeleted.confirmEmptyAllTitle"),message:r("recentlyDeleted.confirmEmptyAllMessage",{count:s.length}),confirmText:r("recentlyDeleted.emptyAll")})]})},ZI=({isOpen:r,origin:e,onChoice:a,onCancel:i})=>{const{t:s}=tt();return l.jsxs(Zn,{isOpen:r,onClose:i,title:s("passkeys.useBrowserPasskey"),showCloseButton:!0,children:[l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:s("passkeys.bypass.description",{origin:e})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ha,{variant:"primary",onClick:()=>a("once"),children:s("passkeys.bypass.thisTimeOnly")}),l.jsx(ha,{variant:"secondary",onClick:()=>a("always"),children:s("passkeys.bypass.alwaysForSite")}),l.jsx(ha,{variant:"secondary",onClick:i,children:s("common.cancel")})]})]})};function ev(r={}){const{enabled:e=!0}=r,a=tn(),i=La(),{dbInitialized:s,dbAvailable:c}=Gt();return w.useEffect(()=>{if(!(!e||!s)&&!c){const d=`${a.pathname}${a.search}`;ke.setItem(Wu,d),i("/unlock")}},[e,s,c,a,i]),{isLocked:s&&!c}}async function mU(){const r=await ke.getItem(Wu);return r&&await ke.removeItem(Wu),r}async function fU(){await ke.removeItem(Wu)}var ps=(r=>(r.DEFAULT="default",r.URL_EXACT="url_exact",r.URL_SUBDOMAIN="url_subdomain",r))(ps||{});let Mg=null;async function Qh(){return Mg||(Mg=(async()=>{const r=li.runtime.getURL("src/aliasvault_core_bg.wasm"),e=await(await fetch(r)).arrayBuffer();await dd(e)})()),Mg}function gU(r,e){var i;const a=(i=r.Fields)==null?void 0:i.find(s=>s.FieldKey===e);return a?Array.isArray(a.Value)?a.Value.filter(s=>s&&s.length>0):a.Value?[a.Value]:[]:[]}async function hU(r,e,a,i="default"){return await Qh(),LL({credentials:r.map(c=>({Id:c.Id,ItemName:c.Name??"",ItemUrls:gU(c,$a.LoginUrl)})),current_url:e,page_title:a,matching_mode:i}).matched_ids.map(c=>r.find(d=>d.Id===c)).filter(c=>c!==void 0)}async function zh(r){return await Qh(),SL(r)}async function Vh(r){return await Qh(),kL(r)}const qe=class qe{constructor(){}static async createPasskey(e,a,i){var ne,me,$,re,ye;qe.pickSupportedAlgorithm(a.publicKey.pubKeyCredParams);const s=((ne=a.publicKey.rp)==null?void 0:ne.id)||new URL(a.origin).hostname,c=new Uint8Array(await crypto.subtle.digest("SHA-256",qe.te(s))),d=await crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!0,["sign","verify"]),m=await crypto.subtle.exportKey("jwk",d.publicKey),g=await crypto.subtle.exportKey("jwk",d.privateKey),f=qe.toB64u(e),E=qe.buildCoseEc2Es256(m);let p=65;const C=(me=a.publicKey.authenticatorSelection)==null?void 0:me.userVerification,I=!!(i!=null&&i.uvPerformed);(C==="required"||C==="preferred"&&I)&&(p|=4),p|=8,p|=16;const x=new Uint8Array([0,0,0,0]),T=new Uint8Array([e.length>>8&255,e.length&255]),k=qe.concat(qe.AAGUID,T,e,E),R=qe.concat(c,new Uint8Array([p]),x,k),S={type:"webauthn.create",challenge:qe.challengeToB64u(a.publicKey.challenge),origin:a.origin,crossOrigin:!1},O=JSON.stringify(S),U=qe.te(O),P=a.publicKey.attestation||"none",K=P==="none"||P==="indirect"?qe.buildAttObjNone(R):await qe.buildAttObjPackedSelf(R,U,d.privateKey);let H=null;($=a.publicKey.user)!=null&&$.id&&(H=typeof a.publicKey.user.id=="string"?a.publicKey.user.id:qe.toB64(a.publicKey.user.id instanceof Uint8Array?a.publicKey.user.id:new Uint8Array(a.publicKey.user.id)));let Q,V=!1,G;if(i!=null&&i.enablePrf){const Ae=new Uint8Array(32);if(crypto.getRandomValues(Ae),Q=qe.toB64u(Ae),V=!0,i!=null&&i.prfInputs){const j=qe.fromB64u(i.prfInputs.first);if(G={first:await qe.evaluatePrf(Ae,j)},i.prfInputs.second){const X=qe.fromB64u(i.prfInputs.second);G.second=await qe.evaluatePrf(Ae,X)}}}const q={rpId:s,credentialId:f,publicKey:m,privateKey:g,userId:H,userName:(re=a.publicKey.user)==null?void 0:re.name,userDisplayName:(ye=a.publicKey.user)==null?void 0:ye.displayName,prfSecret:Q};return{credential:{id:f,rawId:f,response:{clientDataJSON:qe.toB64u(U),attestationObject:qe.toB64u(K)},type:"public-key"},stored:q,prfEnabled:V,prfResults:G}}static async getAssertion(e,a,i){const s=a,c=e.publicKey.rpId||new URL(e.origin).hostname,d=new Uint8Array(await crypto.subtle.digest("SHA-256",qe.te(c)));let m=1;const g=e.publicKey.userVerification,f=!!(i!=null&&i.uvPerformed);(g==="required"||g==="preferred"&&f)&&(m|=4),((i==null?void 0:i.includeBEBS)??!0)&&(m|=8,m|=16);const E=new Uint8Array([0,0,0,0]),p=qe.concat(d,new Uint8Array([m]),E),I={type:"webauthn.get",challenge:qe.challengeToB64u(e.publicKey.challenge),origin:e.origin,crossOrigin:!1},x=JSON.stringify(I),T=qe.te(x),k=new Uint8Array(await crypto.subtle.digest("SHA-256",T)),R=qe.concat(p,k),_=await crypto.subtle.importKey("jwk",s.privateKey,{name:"ECDSA",namedCurve:"P-256"},!1,["sign"]),S=new Uint8Array(await crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},_,R)),O=qe.ecdsaRawToDer(S);let U=null;s.userId&&(U=s.userId.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""));let P;if(i!=null&&i.prfInputs&&s.prfSecret){const K=qe.fromB64u(s.prfSecret);if(P={first:await qe.evaluatePrf(K,i.prfInputs.first)},i.prfInputs.second){const Q=await qe.evaluatePrf(K,i.prfInputs.second);P.second=Q}}return{id:s.credentialId,rawId:s.credentialId,clientDataJSON:qe.toB64u(T),authenticatorData:qe.toB64u(p),signature:qe.toB64u(O),userHandle:U,prfResults:P}}static async evaluatePrf(e,a){const i=a instanceof Uint8Array?a:new Uint8Array(a),s=qe.te("WebAuthn PRF\0"),c=qe.concat(s,i),d=await crypto.subtle.digest("SHA-256",c),m=await crypto.subtle.importKey("raw",e,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await crypto.subtle.sign("HMAC",m,d)}static pickSupportedAlgorithm(e){if(!e||e.length===0)return-7;if(!e.some(i=>i.type==="public-key"&&i.alg===-7))throw new Error("No supported algorithm (ES256) in pubKeyCredParams");return-7}static buildCoseEc2Es256(e){const a=qe.pad32(qe.fromB64u(e.x)),i=qe.pad32(qe.fromB64u(e.y));return new Uint8Array([165,1,2,3,38,32,1,33,88,32,...a,34,88,32,...i])}static buildAttObjNone(e){const a=qe.cborText("fmt"),i=qe.cborText("none"),s=qe.cborText("attStmt"),c=new Uint8Array([160]),d=qe.cborText("authData"),m=qe.cborBstr(e);return qe.concat(new Uint8Array([163]),a,i,s,c,d,m)}static async buildAttObjPackedSelf(e,a,i){const s=new Uint8Array(await crypto.subtle.digest("SHA-256",a)),c=qe.concat(e,s),d=new Uint8Array(await crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},i,c)),m=qe.ecdsaRawToDer(d),g=qe.concat(qe.cborText("alg"),new Uint8Array([38]),qe.cborText("sig"),qe.cborBstr(m)),f=qe.concat(new Uint8Array([162]),g),E=qe.cborText("fmt"),p=qe.cborText("packed"),C=qe.cborText("attStmt"),I=qe.cborText("authData"),x=qe.cborBstr(e);return qe.concat(new Uint8Array([163]),E,p,C,f,I,x)}static cborText(e){const a=qe.te(e);return a.length<=23?new Uint8Array([96|a.length,...a]):a.length<=255?new Uint8Array([120,a.length,...a]):new Uint8Array([121,a.length>>8&255,a.length&255,...a])}static cborBstr(e){return e.length<=23?new Uint8Array([64|e.length,...e]):e.length<=255?new Uint8Array([88,e.length,...e]):new Uint8Array([89,e.length>>8&255,e.length&255,...e])}static ecdsaRawToDer(e){if(e.length!==64)throw new Error("Unexpected ECDSA signature length");const a=e.slice(0,32),i=e.slice(32,64),s=qe.derInt(a),c=qe.derInt(i);return new Uint8Array([48,s.length+c.length,...s,...c])}static derInt(e){let a=0;for(;a<e.length-1&&e[a]===0;)a++;let i=e.slice(a);if((i[0]&128)!==0){const s=new Uint8Array(i.length+1);s[0]=0,s.set(i,1),i=s}return new Uint8Array([2,i.length,...i])}static te(e){return new TextEncoder().encode(e)}static toB64(e){let a="";for(let i=0;i<e.length;i++)a+=String.fromCharCode(e[i]);return btoa(a)}static toB64u(e){return qe.toB64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}static fromB64u(e){const a=e.replace(/-/g,"+").replace(/_/g,"/"),i=a.length%4===2?"==":a.length%4===3?"=":"",s=atob(a+i),c=new Uint8Array(s.length);for(let d=0;d<s.length;d++)c[d]=s.charCodeAt(d);return c}static challengeToB64u(e){if(typeof e=="string")return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");const a=e instanceof Uint8Array?e:new Uint8Array(e);return qe.toB64u(a)}static pad32(e){if(e.length===32)return e;const a=new Uint8Array(32);return a.set(e,32-e.length),a}static concat(...e){const a=e.reduce((c,d)=>c+d.length,0),i=new Uint8Array(a);let s=0;for(const c of e)i.set(c,s),s+=c.length;return i}};ze(qe,"AAGUID",new Uint8Array([161,26,95,170,159,50,75,140,140,93,47,125,19,232,201,66]));let td=qe;class Xa{constructor(){}static guidToBytes(e){const a=e.replace(/-/g,"");if(a.length!==32)throw new Error("Invalid GUID format");const i=new Uint8Array(16);for(let s=0;s<16;s++)i[s]=parseInt(a.substr(s*2,2),16);return i}static bytesToGuid(e){if(e.length!==16)throw new Error("Invalid byte length for GUID");const a=Array.from(e).map(i=>i.toString(16).padStart(2,"0")).join("");return[a.substr(0,8),a.substr(8,4),a.substr(12,4),a.substr(16,4),a.substr(20)].join("-").toUpperCase()}static bytesToBase64Url(e){let a="";return e.forEach(s=>a+=String.fromCharCode(s)),btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}static base64UrlToBytes(e){let i=e.replace(/=+$/,"").replace(/-/g,"+").replace(/_/g,"/");for(;i.length%4;)i+="=";const s=atob(i),c=new Uint8Array(s.length);for(let d=0;d<s.length;d++)c[d]=s.charCodeAt(d);return c}static guidToBase64url(e){return this.bytesToBase64Url(this.guidToBytes(e))}static base64urlToGuid(e){return this.bytesToGuid(this.base64UrlToBytes(e))}static arrayBufferToBase64(e){const a=new Uint8Array(e);let i="";for(let s=0;s<a.length;s++)i+=String.fromCharCode(a[s]);return btoa(i)}static bytesToBase64url(e){const a=e instanceof Uint8Array?e:new Uint8Array(e);return this.bytesToBase64Url(a)}static base64urlToBytes(e){return this.base64UrlToBytes(e)}}const AU=()=>{const{t:r}=tt(),e=tn(),{setIsInitialLoading:a}=pa(),i=Gt(),[s,c]=w.useState(null),[d,m]=w.useState(!1),[g,f]=w.useState(null),[E,p]=w.useState([]),[C,I]=w.useState(!1),{isLocked:x}=ev(),T=w.useRef(null);w.useEffect(()=>{(async()=>{if(!i.dbInitialized||x)return;const P=new URLSearchParams(e.search).get("requestId");if(P)try{const K=await gt("GET_REQUEST_DATA",{requestId:P},"background");if(K&&K.type==="get"){c(K);const H=K.publicKey.rpId||new URL(K.origin).hostname,Q=i.sqliteClient.passkeys.getByRpId(H);let V=Q;if(K.publicKey.allowCredentials&&K.publicKey.allowCredentials.length>0){const G=new Set(K.publicKey.allowCredentials.map(q=>{try{return Xa.base64urlToGuid(q.id)}catch(W){return console.warn("Failed to convert credential ID to GUID:",q.id,W),null}}).filter(q=>q!==null));V=Q.filter(q=>G.has(q.Id))}p(V.map(G=>({id:G.Id,displayName:G.DisplayName,serviceName:G.ServiceName,rpId:G.RpId,username:G.Username})))}}catch(K){console.error("Failed to fetch request data:",K),f(r("common.errors.unknownError"))}a(!1)})()},[e,a,i.dbInitialized,x,i.sqliteClient,r]),w.useEffect(()=>{E.length>0&&T.current&&T.current.focus()},[E.length]),w.useEffect(()=>{const O=U=>{U.key==="Enter"&&!d&&E.length>0&&k(E[0].id)};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[d,E]);const k=async O=>{var U,P;if(!(!s||!i.sqliteClient)){m(!0),f(null);try{const K=i.sqliteClient.passkeys.getById(O);if(!K)throw new Error(r("common.errors.unknownError"));const H=JSON.parse(K.PublicKey),Q=JSON.parse(K.PrivateKey);let V;if(K.PrfKey)try{V=Xa.bytesToBase64url(K.PrfKey)}catch(ye){console.warn("Failed to convert PrfKey to base64url",ye)}let G=null;if(K.UserHandle)try{const ye=K.UserHandle instanceof Uint8Array?K.UserHandle:new Uint8Array(K.UserHandle);G=Xa.bytesToBase64url(ye)}catch(ye){console.warn("Failed to convert UserHandle to base64",ye)}const q={rpId:K.RpId,credentialId:Xa.guidToBase64url(K.Id),publicKey:H,privateKey:Q,userId:G,userName:K.Username??void 0,userDisplayName:K.ServiceName??void 0,prfSecret:V},W={origin:s.origin,requestId:s.requestId,publicKey:{rpId:s.publicKey.rpId,challenge:s.publicKey.challenge,userVerification:s.publicKey.userVerification}};let ne;if((P=(U=s.publicKey.extensions)==null?void 0:U.prf)!=null&&P.eval){const ye=s.publicKey.extensions.prf.eval.first;let Ae;if(typeof ye=="object"&&ye!==null&&!Array.isArray(ye)){const j=Object.keys(ye).map(Number).sort((X,ee)=>X-ee);Ae=new Uint8Array(j.length);for(let X=0;X<j.length;X++)Ae[X]=ye[X]}else if(typeof ye=="string"){const j=atob(ye);Ae=new Uint8Array(j.length);for(let X=0;X<j.length;X++)Ae[X]=j.charCodeAt(X)}else throw new Error("Unknown PRF input format");if(ne={first:Ae},s.publicKey.extensions.prf.eval.second){const j=s.publicKey.extensions.prf.eval.second;let X;if(typeof j=="object"&&j!==null&&!Array.isArray(j)){const ee=Object.keys(j).map(Number).sort((ie,Ie)=>ie-Ie);X=new Uint8Array(ee.length);for(let ie=0;ie<ee.length;ie++)X[ie]=j[ie]}else if(typeof j=="string"){const ee=atob(j);X=new Uint8Array(ee.length);for(let ie=0;ie<ee.length;ie++)X[ie]=ee.charCodeAt(ie)}else throw console.error("[PasskeyAuth] Unknown PRF second input type:",typeof j),new Error("Unknown PRF second input format");ne.second=X}}const me=await td.getAssertion(W,q,{uvPerformed:!0,includeBEBS:!0,prfInputs:ne});let $;me.prfResults&&($={first:Xa.arrayBufferToBase64(me.prfResults.first)},me.prfResults.second&&($.second=Xa.arrayBufferToBase64(me.prfResults.second)));const re={id:me.id,rawId:me.rawId,clientDataJSON:me.clientDataJSON,authenticatorData:me.authenticatorData,signature:me.signature,userHandle:me.userHandle,prfResults:$};await gt("PASSKEY_POPUP_RESPONSE",{requestId:s.requestId,credential:re},"background")}catch(K){console.error("PasskeyAuthenticate: Error during authentication",K),m(!1),f(r("common.errors.unknownError"))}}},R=async()=>{I(!0)},_=async O=>{if(s){if(O==="always"){const U=new URL(s.origin).hostname,P=await Vh(await zh(U)),K=await ke.getItem(bs)??[];K.includes(P)||(K.push(P),await ke.setItem(bs,K))}await gt("PASSKEY_POPUP_RESPONSE",{requestId:s.requestId,fallback:!0},"background")}},S=async()=>{s&&await gt("PASSKEY_POPUP_RESPONSE",{requestId:s.requestId,cancelled:!0},"background")};return s?l.jsxs(l.Fragment,{children:[l.jsx(ZI,{isOpen:C&&!!s,origin:s?new URL(s.origin).hostname:"",onChoice:_,onCancel:()=>I(!1)}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("passkeys.authenticate.title")}),l.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[r("passkeys.authenticate.signInFor")," ",l.jsx("strong",{children:s.origin})]})]}),g&&l.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:l.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:g})}),l.jsx("div",{className:"space-y-4",children:E&&E.length>0?l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:r("passkeys.authenticate.selectPasskey")}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-2 bg-gray-50 dark:bg-gray-800",children:E.map((O,U)=>l.jsxs("div",{ref:U===0?T:null,tabIndex:0,className:"p-3 rounded-lg border cursor-pointer transition-colors bg-white border-gray-200 hover:bg-gray-100 hover:border-gray-300 dark:bg-gray-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:border-gray-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500",onClick:()=>!d&&k(O.id),onKeyDown:P=>{P.key==="Enter"&&!d&&k(O.id)},children:[l.jsx("div",{className:"font-medium text-gray-900 dark:text-white text-sm truncate",children:O.serviceName}),l.jsx("div",{className:"flex items-center justify-between text-xs text-gray-600 dark:text-gray-400",children:l.jsx("span",{className:"truncate",children:O.displayName})})]},O.id))})]}):l.jsx("div",{className:"text-center py-8 bg-gray-50 dark:bg-gray-800 rounded-lg",children:l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:r("passkeys.authenticate.noPasskeysFound")})})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ha,{variant:"secondary",onClick:R,children:r("passkeys.useBrowserPasskey")}),l.jsx(ha,{variant:"secondary",onClick:S,children:r("common.cancel")})]})]})]}):l.jsx("div",{className:"flex justify-center py-8",children:l.jsx($n,{})})},Fg=({variant:r,children:e,className:a=""})=>{const i={info:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800 text-blue-800 dark:text-blue-200",warning:"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800 text-yellow-800 dark:text-yellow-200",error:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800 text-red-800 dark:text-red-200",success:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800 text-green-800 dark:text-green-200"};return l.jsx("div",{className:`p-3 border rounded-lg ${i[r]} ${a}`,children:l.jsx("p",{className:"text-sm",children:e})})},pU=()=>{var j,X;const{t:r}=tt(),e=tn(),{setIsInitialLoading:a}=pa(),i=Gt(),s=ur(),{executeVaultMutationAsync:c}=vo(),[d,m]=w.useState(null),[g,f]=w.useState(""),[E,p]=w.useState(null),{isLocked:C}=ev(),[I,x]=w.useState([]),[T,k]=w.useState([]),[R,_]=w.useState(null),[S,O]=w.useState(null),[U,P]=w.useState(!1),[K,H]=w.useState(!1),[Q,V]=w.useState(!1),G=w.useRef(null),q=w.useRef(null);w.useEffect(()=>{(async()=>{var we,Re,De,Te,He,Ne,Qe,yt;if(!i.dbInitialized||C)return;const Ie=new URLSearchParams(e.search).get("requestId");if(Ie)try{const We=await gt("GET_REQUEST_DATA",{requestId:Ie},"background");if(We&&We.type==="create"){m(We);const nt=((Re=(we=We.publicKey)==null?void 0:we.rp)==null?void 0:Re.name)||((Te=(De=We.publicKey)==null?void 0:De.rp)==null?void 0:Te.id)||"Passkey";if(f(nt),i.sqliteClient&&((Ne=(He=We.publicKey)==null?void 0:He.rp)!=null&&Ne.id)){const Ht=i.sqliteClient.passkeys.getByRpId(We.publicKey.rp.id);let ve=Ht;if(((Qe=We.publicKey.user)!=null&&Qe.id||(yt=We.publicKey.user)!=null&&yt.name)&&(ve=Ht.filter(Be=>{var $e,Ye;if(($e=We.publicKey.user)!=null&&$e.id&&Be.UserHandle)try{const lt=Xa.base64urlToBytes(We.publicKey.user.id),et=Be.UserHandle instanceof Uint8Array?Be.UserHandle:new Uint8Array(Be.UserHandle);if(lt.length===et.length&&lt.every((Et,Pt)=>Et===et[Pt]))return!0}catch{}return!!((Ye=We.publicKey.user)!=null&&Ye.name&&Be.Username&&Be.Username===We.publicKey.user.name)})),x(ve),ve.length===0){const $e=i.sqliteClient.items.getAll().filter(lt=>{const et=fu(lt,$a.LoginUsername),Et=fu(lt,$a.LoginPassword);return!et&&!Et?!1:!lt.HasPasskey});let Ye=[];$e.length>0&&(Ye=await hU($e,We.origin,We.publicKey.rp.name||"",ps.URL_SUBDOMAIN),k(Ye)),Ye.length===0&&P(!0)}}}}catch(We){console.error("Failed to fetch request data:",We),p(r("common.errors.unknownError"))}a(!1)})()},[e,a,i.dbInitialized,i.sqliteClient,C,r]),w.useEffect(()=>{U&&q.current?q.current.focus():!U&&I.length>0&&G.current&&G.current.focus()},[U,I.length]),w.useEffect(()=>{const ee=ie=>{ie.key==="Enter"&&!K&&U&&$()};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[U,K]);const W=()=>{_(null),O(null),P(!0)},ne=ee=>{_(ee),O(null),P(!0)},me=ee=>{O(ee),_(null),P(!0)},$=async()=>{var ee,ie;if(!(!d||!i.sqliteClient)){p(null);try{let Ie;if(d.origin){H(!0);try{const Ye=new Promise((Et,Pt)=>setTimeout(()=>Pt(new Error("Favicon extraction timed out")),5e3)),lt=s.get("Favicon/Extract?url="+d.origin),et=await Promise.race([lt,Ye]);if(et!=null&&et.image){const Et=atob(et.image),Pt=new Uint8Array(Et.length);for(let qt=0;qt<Et.length;qt++)Pt[qt]=Et.charCodeAt(qt);Ie=Pt}}catch{}}const we={origin:d.origin,requestId:d.requestId,publicKey:{rp:d.publicKey.rp,user:d.publicKey.user,challenge:d.publicKey.challenge,pubKeyCredParams:d.publicKey.pubKeyCredParams,attestation:d.publicKey.attestation,authenticatorSelection:d.publicKey.authenticatorSelection}},Re=crypto.randomUUID().toUpperCase(),De=Xa.guidToBytes(Re),Te=Xa.guidToBase64url(Re),He=(ie=(ee=d.publicKey)==null?void 0:ee.extensions)==null?void 0:ie.prf,Ne=!!He,Qe=He==null?void 0:He.eval,yt=await td.createPasskey(De,we,{uvPerformed:!0,credentialIdBytes:16,enablePrf:Ne,prfInputs:Qe}),{credential:We,stored:nt,prfEnabled:Ht,prfResults:ve}=yt;await c(async()=>{if(R){const Ye=i.sqliteClient.passkeys.getById(R);if(Ye){const lt=i.sqliteClient.items.getById(Ye.ItemId);lt&&await i.sqliteClient.items.update({...lt,Name:g,Logo:Ie??lt.Logo,Fields:[...(lt.Fields||[]).filter(Et=>Et.FieldKey!==$a.LoginUrl&&Et.FieldKey!==$a.LoginUsername),gu($a.LoginUrl,{value:d.origin}),gu($a.LoginUsername,{value:d.publicKey.user.name})]},[],[]),await i.sqliteClient.passkeys.deleteById(R);let et=null;if(nt.userId)try{et=Xa.base64urlToBytes(nt.userId)}catch{et=null}await i.sqliteClient.passkeys.create({Id:Re,ItemId:Ye.ItemId,RpId:nt.rpId,UserHandle:et,PublicKey:JSON.stringify(nt.publicKey),PrivateKey:JSON.stringify(nt.privateKey),DisplayName:d.publicKey.user.displayName||d.publicKey.user.name||"",PrfKey:nt.prfSecret?Xa.base64urlToBytes(nt.prfSecret):void 0,AdditionalData:null})}}else if(S){let Ye=null;if(nt.userId)try{Ye=Xa.base64urlToBytes(nt.userId)}catch{Ye=null}await i.sqliteClient.passkeys.create({Id:Re,ItemId:S,RpId:nt.rpId,UserHandle:Ye,PublicKey:JSON.stringify(nt.publicKey),PrivateKey:JSON.stringify(nt.privateKey),DisplayName:d.publicKey.user.displayName||d.publicKey.user.name||"",PrfKey:nt.prfSecret?Xa.base64urlToBytes(nt.prfSecret):void 0,AdditionalData:null})}else{const Ye={Id:"",Name:g,ItemType:ma.Login,Logo:Ie,Fields:[gu($a.LoginUrl,{value:d.origin}),gu($a.LoginUsername,{value:d.publicKey.user.name})],CreatedAt:new Date().toISOString(),UpdatedAt:new Date().toISOString()},lt=await i.sqliteClient.items.create(Ye,[]);let et=null;if(nt.userId)try{et=Xa.base64urlToBytes(nt.userId)}catch{et=null}await i.sqliteClient.passkeys.create({Id:Re,ItemId:lt,RpId:nt.rpId,UserHandle:et,PublicKey:JSON.stringify(nt.publicKey),PrivateKey:JSON.stringify(nt.privateKey),DisplayName:d.publicKey.user.displayName||d.publicKey.user.name||"",PrfKey:nt.prfSecret?Xa.base64urlToBytes(nt.prfSecret):void 0,AdditionalData:null})}});let Be;Ht&&(Be={prf:{enabled:!0,results:ve?{first:Xa.bytesToBase64url(new Uint8Array(ve.first)),second:ve.second?Xa.bytesToBase64url(new Uint8Array(ve.second)):void 0}:void 0}});const $e={id:Te,rawId:Te,clientDataJSON:We.response.clientDataJSON,attestationObject:We.response.attestationObject,extensions:Be};await gt("PASSKEY_POPUP_RESPONSE",{requestId:d.requestId,credential:$e},"background"),H(!1)}catch(Ie){console.error("PasskeyCreate: Error creating passkey",Ie),p(r("common.errors.unknownError"))}}},re=async()=>{V(!0)},ye=async ee=>{if(d){if(ee==="always"){const ie=new URL(d.origin).hostname,Ie=await Vh(await zh(ie)),we=await ke.getItem(bs)??[];we.includes(Ie)||(we.push(Ie),await ke.setItem(bs,we))}await gt("PASSKEY_POPUP_RESPONSE",{requestId:d.requestId,fallback:!0},"background")}},Ae=async()=>{d&&await gt("PASSKEY_POPUP_RESPONSE",{requestId:d.requestId,cancelled:!0},"background")};return d?l.jsxs(l.Fragment,{children:[l.jsx(ZI,{isOpen:Q&&!!d,origin:d?new URL(d.origin).hostname:"",onChoice:ye,onCancel:()=>V(!1)}),K&&l.jsx("div",{className:"fixed inset-0 flex flex-col justify-center items-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90 z-50",children:l.jsx($n,{})}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("passkeys.create.title")}),l.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[r("passkeys.create.createFor")," ",l.jsx("strong",{children:d.origin})]})]}),E&&l.jsx(Fg,{variant:"error",children:E}),!U&&I.length>0&&l.jsxs("div",{className:"space-y-4",children:[l.jsx(ha,{variant:"primary",onClick:W,ref:G,children:r("passkeys.create.createNewPasskey")}),l.jsx(ha,{variant:"secondary",onClick:re,children:r("passkeys.useBrowserPasskey")}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),l.jsx("div",{className:"relative flex justify-center text-sm",children:l.jsx("span",{className:"px-2 bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400",children:r("common.or")})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:r("passkeys.create.selectPasskeyToReplace")}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-2 bg-gray-50 dark:bg-gray-800",children:I.map(ee=>l.jsx("button",{onClick:()=>ne(ee.Id),className:"w-full p-3 text-left rounded-lg border cursor-pointer transition-colors bg-white border-gray-200 hover:bg-gray-100 hover:border-gray-300 dark:bg-gray-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:border-gray-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"font-medium text-gray-900 dark:text-white text-sm truncate",children:ee.ServiceName}),l.jsx("div",{className:"flex items-center justify-between text-xs text-gray-600 dark:text-gray-400",children:l.jsx("span",{className:"truncate",children:ee.DisplayName})})]}),l.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})},ee.Id))})]}),l.jsx(ha,{variant:"secondary",onClick:Ae,children:r("common.cancel")})]}),!U&&I.length===0&&T.length>0&&l.jsxs("div",{className:"space-y-4",children:[l.jsx(ha,{variant:"primary",onClick:W,ref:G,children:r("passkeys.create.createNewPasskey")}),l.jsx(ha,{variant:"secondary",onClick:re,children:r("passkeys.useBrowserPasskey")}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),l.jsx("div",{className:"relative flex justify-center text-sm",children:l.jsx("span",{className:"px-2 bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400",children:r("common.or")})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:r("passkeys.create.selectExistingLogin")}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:r("passkeys.create.selectExistingLoginDescription")}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-2 bg-gray-50 dark:bg-gray-800",children:T.map(ee=>l.jsx("button",{onClick:()=>me(ee.Id),className:"w-full p-3 text-left rounded-lg border cursor-pointer transition-colors bg-white border-gray-200 hover:bg-gray-100 hover:border-gray-300 dark:bg-gray-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:border-gray-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex items-center flex-1 min-w-0",children:l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"font-medium text-gray-900 dark:text-white text-sm truncate",children:ee.Name}),fu(ee,$a.LoginUsername)&&l.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:fu(ee,$a.LoginUsername)})]})}),l.jsx("svg",{className:"w-5 h-5 text-gray-400 flex-shrink-0 ml-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})},ee.Id))})]}),l.jsx(ha,{variant:"secondary",onClick:Ae,children:r("common.cancel")})]}),U&&l.jsxs("div",{className:"space-y-4",children:[R&&l.jsx(Fg,{variant:"warning",children:r("passkeys.create.replacingPasskey",{displayName:((j=I.find(ee=>ee.Id===R))==null?void 0:j.DisplayName)||""})}),S&&l.jsx(Fg,{variant:"info",children:r("passkeys.create.attachingToCredential",{serviceName:((X=T.find(ee=>ee.Id===S))==null?void 0:X.Name)||""})}),!S&&l.jsx(fd,{id:"displayName",label:r("passkeys.create.titleLabel"),value:g,onChange:f,placeholder:r("passkeys.create.titlePlaceholder"),ref:q}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ha,{variant:"primary",onClick:$,children:r(R?"passkeys.create.confirmReplace":S?"passkeys.create.attachPasskey":"passkeys.create.createButton")}),I.length>0||T.length>0?l.jsx(ha,{variant:"secondary",onClick:()=>{P(!1),_(null),O(null)},children:r("common.back")}):l.jsxs(l.Fragment,{children:[l.jsx(ha,{variant:"secondary",onClick:re,children:r("passkeys.useBrowserPasskey")}),l.jsx(ha,{variant:"secondary",onClick:Ae,children:r("common.cancel")})]})]})]})]})]}):l.jsx("div",{className:"flex justify-center py-8",children:l.jsx($n,{})})},ab="session:lastVisitedPage",nb="session:lastVisitedTime",rb="session:navigationHistory",yU=120*1e3,EU=()=>{const r=La(),{setIsInitialLoading:e}=pa(),{syncVault:a}=md(),i=w.useRef(!1),{isInitialized:s,isLoggedIn:c}=dr(),{dbInitialized:d,dbAvailable:m}=Gt(),g=s&&d,f=g&&(!c||!m),E=w.useCallback(async()=>{const[p,C,I]=await Promise.all([ke.getItem(ab),ke.getItem(nb),ke.getItem(rb)]);if(p&&C&&Date.now()-C<=yU){(I==null?void 0:I.length)>1?(r(I[0].pathname,{replace:!0}),r(p,{replace:!1})):r(p,{replace:!0});return}await Promise.all([ke.removeItem(ab),ke.removeItem(nb),ke.removeItem(rb),gt("CLEAR_PERSISTED_FORM_VALUES",null,"background")]),r("/items",{replace:!0})},[r]);return w.useEffect(()=>{(async()=>{const I=new URLSearchParams(window.location.search).get("mode")==="inline_unlock",x=await mU();if(!g)return;const T=!i.current;f?(e(!1),c?m||r("/unlock",{replace:!0}):r("/login",{replace:!0})):T?(i.current=!0,e(!1),I?r("/unlock-success",{replace:!0}):x?r(x,{replace:!0}):await E(),a({onUpgradeRequired:()=>{r("/upgrade",{replace:!0})},onError:k=>{console.error("Background vault sync error:",k)}})):(e(!1),E())})()},[g,f,c,m,r,e,a,E]),null},bU=()=>{const{t:r}=tt(),{setIsInitialLoading:e}=pa(),[a,i]=w.useState({disabledUrls:[],temporaryDisabledUrls:{},currentUrl:"",isEnabled:!0,isGloballyEnabled:!0}),[s,c]=w.useState(ps.DEFAULT),d=async()=>{const C={active:!0,currentWindow:!0},[I]=await li.tabs.query(C);return I},m=w.useCallback(async()=>{const C=await d(),I=new URL(C.url??"").hostname,x=await ke.getItem(Uu)??[],T=await ke.getItem(Au)??{},k=await ke.getItem(qu)!==!1,R=Date.now(),_=Object.fromEntries(Object.entries(T).filter(([O,U])=>U>R));Object.keys(_).length!==Object.keys(T).length&&await ke.setItem(Au,_);const S=await ke.getItem(Fy)??ps.DEFAULT;c(S),i({disabledUrls:x,temporaryDisabledUrls:_,currentUrl:I,isEnabled:!x.includes(I)&&!(I in _),isGloballyEnabled:k}),e(!1)},[e]);w.useEffect(()=>{m()},[m]);const g=async()=>{const{currentUrl:C,disabledUrls:I,temporaryDisabledUrls:x,isEnabled:T}=a;let k=[...I],R={...x};T?(k.includes(C)||k.push(C),delete R[C]):(k=k.filter(_=>_!==C),delete R[C]),await ke.setItem(Uu,k),await ke.setItem(Au,R),i(_=>({..._,disabledUrls:k,temporaryDisabledUrls:R,isEnabled:!T}))},f=async()=>{await ke.setItem(Uu,[]),await ke.setItem(Au,{}),i(C=>({...C,disabledUrls:[],temporaryDisabledUrls:{},isEnabled:!0}))},E=async()=>{const C=!a.isGloballyEnabled;await ke.setItem(qu,C),i(I=>({...I,isGloballyEnabled:C}))},p=async C=>{await ke.setItem(Fy,C),c(C)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.globalSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.autofillPopup")}),l.jsx("p",{className:`text-sm mt-1 ${a.isGloballyEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:a.isGloballyEnabled?r("settings.activeOnAllSites"):r("settings.disabledOnAllSites")})]}),l.jsx("button",{onClick:E,className:`px-4 py-2 rounded-md transition-colors ${a.isGloballyEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:a.isGloballyEnabled?r("common.enabled"):r("common.disabled")})]})})})]}),a.isGloballyEnabled&&l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.siteSpecificSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("p",{className:"font-medium text-gray-900 dark:text-white",children:[r("settings.autofillPopupOn"),a.currentUrl]}),l.jsx("p",{className:`text-sm mt-1 ${a.isEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:a.isEnabled?r("settings.enabledForThisSite"):r("settings.disabledForThisSite")}),!a.isEnabled&&a.temporaryDisabledUrls[a.currentUrl]&&l.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:[r("settings.temporarilyDisabledUntil"),new Date(a.temporaryDisabledUrls[a.currentUrl]).toLocaleTimeString()]})]}),a.isGloballyEnabled&&l.jsx("button",{onClick:g,className:`px-4 py-2 ml-1 rounded-md transition-colors ${a.isEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:a.isEnabled?r("common.enabled"):r("common.disabled")})]}),l.jsx("div",{className:"mt-4",children:l.jsx("button",{onClick:f,className:"w-full px-4 py-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 rounded-md text-gray-700 dark:text-gray-300 transition-colors text-sm",children:r("settings.resetAllSiteSettings")})})]})})]}),l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.autofillMatching")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white mb-2",children:r("settings.autofillMatchingMode")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:r("settings.autofillMatchingModeDescription")}),l.jsxs("select",{value:s,onChange:C=>p(C.target.value),className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500",children:[l.jsx("option",{value:ps.DEFAULT,children:r("settings.autofillMatchingDefault")}),l.jsx("option",{value:ps.URL_SUBDOMAIN,children:r("settings.autofillMatchingUrlSubdomain")}),l.jsx("option",{value:ps.URL_EXACT,children:r("settings.autofillMatchingUrlExact")})]})]})})})]})]})},tv=({title:r,content:e,className:a=""})=>{const[i,s]=w.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>s(!0),className:`${a}`,type:"button","aria-label":"Help",children:l.jsx("svg",{className:"w-4 h-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-help",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsx(Zn,{isOpen:i,onClose:()=>s(!1),title:r,children:l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:e})})]})},IU=()=>{const{t:r}=tt(),{setIsInitialLoading:e}=pa(),[a,i]=w.useState(0);w.useEffect(()=>{(async()=>{const d=await ke.getItem(My)??0;i(d),e(!1)})()},[e]);const s=async c=>{await ke.setItem(My,c),await gt("SET_AUTO_LOCK_TIMEOUT",c,"background"),i(c)};return l.jsx("div",{className:"space-y-6",children:l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.autoLockTimeout")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.autoLockTimeout")}),l.jsx(tv,{title:r("settings.autoLockTimeout"),content:r("settings.autoLockTimeoutHelp"),className:"ml-2"})]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:r("settings.autoLockTimeoutDescription")}),l.jsxs("select",{value:a,onChange:c=>s(Number(c.target.value)),className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500",children:[l.jsx("option",{value:"0",children:r("settings.autoLockNever")}),l.jsx("option",{value:"15",children:r("settings.autoLock15Seconds")}),l.jsx("option",{value:"60",children:r("settings.autoLock1Minute")}),l.jsx("option",{value:"300",children:r("settings.autoLock5Minutes")}),l.jsx("option",{value:"900",children:r("settings.autoLock15Minutes")}),l.jsx("option",{value:"1800",children:r("settings.autoLock30Minutes")}),l.jsx("option",{value:"3600",children:r("settings.autoLock1Hour")}),l.jsx("option",{value:"14400",children:r("settings.autoLock4Hours")}),l.jsx("option",{value:"28800",children:r("settings.autoLock8Hours")}),l.jsx("option",{value:"86400",children:r("settings.autoLock24Hours")})]})]})})})]})})},vU=()=>{const{t:r}=tt(),{setIsInitialLoading:e}=pa(),[a,i]=w.useState(10);w.useEffect(()=>{(async()=>{const d=await ke.getItem(_y)??10;i(d),e(!1)})()},[e]);const s=async c=>{await ke.setItem(_y,c),await gt("SET_CLIPBOARD_CLEAR_TIMEOUT",c,"background"),i(c)};return l.jsx("div",{className:"space-y-6",children:l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.clipboardSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white mb-2",children:r("settings.clipboardClearTimeout")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:r("settings.clipboardClearTimeoutDescription")}),l.jsxs("select",{value:a,onChange:c=>s(Number(c.target.value)),className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500",children:[l.jsx("option",{value:"0",children:r("settings.clipboardClearDisabled")}),l.jsx("option",{value:"5",children:r("settings.clipboardClear5Seconds")}),l.jsx("option",{value:"10",children:r("settings.clipboardClear10Seconds")}),l.jsx("option",{value:"15",children:r("settings.clipboardClear15Seconds")})]})]})})})]})})},wU=()=>{const{t:r}=tt(),{setIsInitialLoading:e}=pa(),[a,i]=w.useState(!0),s=w.useCallback(async()=>{const d=await ke.getItem(Uy)!==!1;i(d),e(!1)},[e]);w.useEffect(()=>{s()},[s]);const c=async()=>{const d=!a;await ke.setItem(Uy,d),await gt("TOGGLE_CONTEXT_MENU",{enabled:d},"background"),i(d)};return l.jsx("div",{className:"space-y-6",children:l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.contextMenu")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.rightClickContextMenu")}),l.jsx("p",{className:`text-sm mt-1 ${a?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:r(a?"settings.contextMenuEnabled":"settings.contextMenuDisabled")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-2",children:r("settings.contextMenuDescription")})]}),l.jsx("button",{onClick:c,className:`px-4 py-2 rounded-md transition-colors ${a?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:r(a?"common.enabled":"common.disabled")})]})})})]})})},CU=()=>{const{t:r}=tt(),{setIsInitialLoading:e}=pa();return w.useEffect(()=>{e(!1)},[e]),l.jsx("div",{className:"space-y-6",children:l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.language")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white mb-3",children:r("settings.selectLanguage")}),l.jsx(CI,{variant:"dropdown",size:"sm"})]})})})]})})},NU=()=>{const{t:r}=tt(),{setIsInitialLoading:e}=pa(),[a,i]=w.useState({disabledUrls:[],currentUrl:"",isEnabled:!0,isGloballyEnabled:!0}),s=async()=>{const f={active:!0,currentWindow:!0},[E]=await li.tabs.query(f);return E},c=w.useCallback(async()=>{const f=await s(),E=new URL(f.url??"").hostname,p=await Vh(await zh(E)),C=await ke.getItem(bs)??[],I=await ke.getItem(Oy)!==!1,x=!C.includes(p);i({disabledUrls:C,currentUrl:p,isEnabled:x,isGloballyEnabled:I}),e(!1)},[e]);w.useEffect(()=>{c()},[c]);const d=async()=>{const{currentUrl:f,disabledUrls:E,isEnabled:p}=a;let C=[...E];p?C.includes(f)||C.push(f):C=C.filter(I=>I!==f),await ke.setItem(bs,C),i(I=>({...I,disabledUrls:C,isEnabled:!p}))},m=async()=>{await ke.setItem(bs,[]),i(f=>({...f,disabledUrls:[],isEnabled:!0}))},g=async()=>{const f=!a.isGloballyEnabled;await ke.setItem(Oy,f),i(E=>({...E,isGloballyEnabled:f}))};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.globalSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("passkeys.settings.passkeyProvider")}),l.jsx("p",{className:`text-sm mt-1 ${a.isGloballyEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:a.isGloballyEnabled?r("settings.activeOnAllSites"):r("settings.disabledOnAllSites")})]}),l.jsx("button",{onClick:g,className:`px-4 py-2 rounded-md transition-colors ${a.isGloballyEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:a.isGloballyEnabled?r("common.enabled"):r("common.disabled")})]})})})]}),a.isGloballyEnabled&&l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.siteSpecificSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("p",{className:"font-medium text-gray-900 dark:text-white",children:[r("passkeys.settings.passkeyProviderOn"),a.currentUrl]}),l.jsx("p",{className:`text-sm mt-1 ${a.isEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:a.isEnabled?r("settings.enabledForThisSite"):r("settings.disabledForThisSite")})]}),a.isGloballyEnabled&&l.jsx("button",{onClick:d,className:`px-4 py-2 ml-1 rounded-md transition-colors ${a.isEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:a.isEnabled?r("common.enabled"):r("common.disabled")})]}),l.jsx("div",{className:"mt-4",children:l.jsx("button",{onClick:m,className:"w-full px-4 py-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 rounded-md text-gray-700 dark:text-gray-300 transition-colors text-sm",children:r("settings.resetAllSiteSettings")})})]})})]})]})},ib="local:theme",av=w.createContext(void 0),xU=({children:r})=>{const[e,a]=w.useState("system"),[i,s]=w.useState(!1);w.useEffect(()=>{(async()=>{const E=await d();a(E)})()},[]);const c=w.useCallback(f=>{a(f),m(f)},[]),d=async()=>await ke.getItem(ib)||"system",m=async f=>{await ke.setItem(ib,f)};w.useEffect(()=>{const f=()=>{if(e==="system"){const E=window.matchMedia("(prefers-color-scheme: dark)").matches;s(E),document.documentElement.classList.toggle("dark",E)}else{const E=e==="dark";s(E),document.documentElement.classList.toggle("dark",E)}};if(f(),e==="system"){const E=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>f();return E.addEventListener("change",p),()=>E.removeEventListener("change",p)}},[e]);const g=w.useMemo(()=>({theme:e,setTheme:c,isDarkMode:i}),[e,i,c]);return l.jsx(av.Provider,{value:g,children:r})},TU=()=>{const r=w.useContext(av);if(r===void 0)throw new Error("useTheme must be used within a ThemeProvider");return r},SU=()=>{var V,G;const{t:r}=tt(),{theme:e,setTheme:a}=TU(),i=dr(),s=$l(),c=ur(),{setHeaderButtons:d}=mr(),{setIsInitialLoading:m}=pa(),{loadApiUrl:g,getDisplayUrl:f}=LI(),E=La(),[p,C]=w.useState(!1),I=async()=>{const q=await ke.getItem("local:clientUrl");let W=Za.DEFAULT_CLIENT_URL;q&&q.length>0&&(W=q),window.open(W,"_blank")};w.useEffect(()=>{const q=l.jsxs("div",{className:"flex items-center gap-2",children:[!Aa.isPopup()&&l.jsx(l.Fragment,{children:l.jsx(Nn,{onClick:()=>Aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Fa.EXPAND})}),l.jsx(Nn,{onClick:I,title:r("settings.openWebApp"),iconType:Fa.EXTERNAL_LINK})]});return d(q),()=>d(null)},[d,r]);const x=w.useCallback(async()=>{await g(),m(!1)},[m,g]);w.useEffect(()=>{x()},[x]);const T=async q=>{a(q)},k=()=>{C(!0)},R=async()=>{C(!1);try{await c.revokeTokens(),await s.clearAuthUserInitiated()}catch(q){console.error("Error during logout:",q)}},_=async()=>{await gt("LOCK_VAULT",{},"background"),E("/unlock")},S=()=>{E("/settings/autofill")},O=()=>{E("/settings/clipboard")},U=()=>{E("/settings/language")},P=()=>{E("/settings/auto-lock")},K=()=>{E("/settings/unlock-method")},H=()=>{E("/settings/context-menu")},Q=()=>{E("/settings/passkeys")};return l.jsxs(l.Fragment,{children:[l.jsx(Uh,{isOpen:p,onClose:()=>C(!1),onConfirm:R}),l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"flex justify-between items-center mb-4",children:l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:r("common.settings")})}),l.jsx("section",{children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:l.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((G=(V=i.username)==null?void 0:V[0])==null?void 0:G.toUpperCase())||"?"})})}),l.jsxs("div",{children:[l.jsx("p",{className:"text font-medium text-gray-900 dark:text-white",children:i.username}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("common.loggedIn")})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:_,title:r("settings.lock"),className:"p-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 rounded-md transition-colors",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24","aria-label":r("settings.lock"),children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),l.jsx("button",{onClick:k,title:r("common.logout"),className:"p-2 bg-red-100 hover:bg-red-200 dark:bg-red-900/30 dark:hover:bg-red-900/50 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 rounded-md transition-colors",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24","aria-label":r("common.logout"),children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})})})]})]})})})}),l.jsx("section",{children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsxs("button",{onClick:K,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.unlockMethod.title")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:P,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.autoLockTimeout")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:S,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.autofillSettings")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:Q,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.passkeySettings")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})})}),l.jsx("section",{children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsxs("button",{onClick:O,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.clipboardSettings")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:H,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16m-7 6h7"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.contextMenuSettings")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:U,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.language")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})})}),l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.appearance")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white mb-2",children:r("settings.theme")}),l.jsxs("div",{className:"flex flex-col space-y-2",children:[l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"radio",name:"theme",value:"system",checked:e==="system",onChange:()=>T("system"),className:"mr-2"}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r("settings.useDefault")})]}),l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"radio",name:"theme",value:"light",checked:e==="light",onChange:()=>T("light"),className:"mr-2"}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r("settings.light")})]}),l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"radio",name:"theme",value:"dark",checked:e==="dark",onChange:()=>T("dark"),className:"mr-2"}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r("settings.dark")})]})]})]})})})]}),!1,l.jsxs("div",{className:"text-center text-gray-400 dark:text-gray-600",children:[r("settings.versionPrefix"),Za.VERSION," (",f(),")"]})]})]})},kU=()=>{const{t:r}=tt(),e=Gt(),{setIsInitialLoading:a,showLoading:i,hideLoading:s}=pa(),[c,d]=w.useState(void 0),[m,g]=w.useState(null),[f,E]=w.useState(null),[p,C]=w.useState(!1),[I,x]=w.useState(1),[T,k]=w.useState(""),[R,_]=w.useState(""),[S,O]=w.useState(!1),U=w.useCallback(async()=>{try{const[V,G]=await Promise.all([rI(),sI()]);d(V),O(G),a(!1)}catch(V){console.error("Failed to load PIN settings:",V),g(r("common.errors.unknownErrorTryAgain")),a(!1)}},[a,r]);w.useEffect(()=>{U()},[U]);const P=()=>{if(g(null),E(null),!e.dbAvailable){g(r("common.errors.unknownErrorTryAgain"));return}x(1),k(""),_(""),C(!0)},K=V=>{if(V.preventDefault(),g(null),!Sh(T)){g(r("settings.unlockMethod.invalidPinFormat"));return}x(2)},H=async V=>{if(V.preventDefault(),g(null),E(null),T!==R){g(r("settings.unlockMethod.pinMismatch"));return}try{i();const q=await ke.getItem("session:encryptionKey");if(!q){g(r("common.errors.unknownErrorTryAgain")),s();return}await Yk(T,q),d(!0),C(!1),x(1),k(""),_(""),E(r("settings.unlockMethod.enableSuccess")),s()}catch(G){console.error("Failed to enable PIN:",G),G instanceof Gl?g(r("settings.unlockMethod.invalidPinFormat")):g(r("common.errors.unknownErrorTryAgain")),s()}},Q=async()=>{g(null),E(null);try{i(),await kh(),d(!1),O(!1),s()}catch(V){console.error("Failed to disable PIN:",V),g(r("common.errors.unknownErrorTryAgain")),s()}};return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex items-start gap-2",children:l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("settings.unlockMethod.introText")})}),l.jsxs("div",{className:"mt-6",children:[m&&l.jsx(As,{type:"error",message:m,className:"mb-4"}),f&&l.jsx(As,{type:"success",message:f,className:"mb-4"}),S&&l.jsx(As,{type:"warning",message:r("settings.unlockMethod.pinLocked"),className:"mb-4"}),l.jsx("section",{children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-2 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.unlockMethod.pin")}),l.jsx(tv,{title:r("common.notice"),content:r("settings.unlockMethod.pinSecurityWarning"),className:"ml-2"})]}),l.jsx("p",{className:"text-sm mt-1 text-gray-600 dark:text-gray-400",children:r("settings.unlockMethod.pinDescription")})]})]}),c!==void 0&&l.jsx("button",{onClick:c&&!S?Q:P,className:`px-4 py-2 rounded-md transition-colors ${c&&!S?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:r(c&&!S?"common.enabled":"common.disabled")})]})})})}),l.jsx("section",{className:"mt-4",children:l.jsx("div",{className:"bg-gray-50 dark:bg-gray-700/30 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-2 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),l.jsx("div",{children:l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.unlockMethod.password")})})]}),l.jsx("div",{className:"px-4 py-2 rounded-md bg-green-500 text-white hover:bg-green-600 cursor-not-allowed",children:r("common.enabled")})]})})})}),p&&l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 max-w-md w-full mx-4 relative",children:[l.jsx("button",{type:"button",onClick:()=>{C(!1),x(1),k(""),_(""),g(null)},className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 transition-colors","aria-label":"Cancel",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),I===1&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 pr-8",children:r("settings.unlockMethod.setupPin")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:r("settings.unlockMethod.enterNewPinDescription")}),l.jsxs("form",{onSubmit:K,children:[l.jsx("div",{className:"mb-4",children:l.jsx("input",{type:"password",inputMode:"numeric",pattern:"[0-9]*",maxLength:8,value:T,onChange:V=>k(V.target.value.replace(/\D/g,"")),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white text-center text-2xl tracking-widest",autoFocus:!0})}),m&&l.jsx(As,{type:"error",message:m,className:"mb-4"}),l.jsx(ha,{type:"submit",children:r("common.next")})]})]}),I===2&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 pr-8",children:r("settings.unlockMethod.confirmPin")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:r("settings.unlockMethod.confirmPinDescription")}),l.jsxs("form",{onSubmit:H,children:[l.jsx("div",{className:"mb-4",children:l.jsx("input",{type:"password",inputMode:"numeric",pattern:"[0-9]*",maxLength:8,value:R,onChange:V=>_(V.target.value.replace(/\D/g,"")),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white text-center text-2xl tracking-widest",autoFocus:!0})}),m&&l.jsx(As,{type:"error",message:m,className:"mb-4"}),l.jsx(ha,{type:"submit",children:r("common.confirm")})]})]})]})})]})]})},LU=({routes:r,isLoading:e,message:a,headerButtons:i})=>{const s=tn(),c=r.find(f=>{const E=f.path.replace(/:\w+/g,"[^/]+");return new RegExp(`^${E}$`).test(s.pathname)}),d=(c==null?void 0:c.layout)??"default",m=e&&l.jsx("div",{className:"fixed inset-0 bg-white dark:bg-gray-900 z-50 flex items-center justify-center",children:l.jsx($n,{})}),g=l.jsx(Qb,{children:r.map(f=>l.jsx(Eh,{path:f.path,element:f.element},f.path))});switch(d){case"passkey":return l.jsxs(i2,{children:[m,a&&l.jsx("p",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:a}),g]});case"auth":return l.jsxs("div",{className:"min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col max-h-[600px]",children:[m,l.jsx(mI,{routes:r,rightButtons:i}),l.jsxs("main",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900",style:{paddingTop:"64px",height:"100%"},children:[a&&l.jsx("div",{className:"px-4 pt-0",children:l.jsx("p",{className:"text-red-500 dark:text-red-400 text-sm",children:a})}),g]})]});case"default":default:return l.jsxs(l.Fragment,{children:[m,l.jsx(r2,{routes:r,headerButtons:i,message:a,children:g})]})}},RU=()=>{const{t:r}=tt(),e=dr(),{isInitialLoading:a}=pa(),[i,s]=Zl(!0,150),[c,d]=w.useState(null),{headerButtons:m}=mr(),g=id.useMemo(()=>[{path:"/",element:l.jsx(vR,{}),showBackButton:!1},{path:"/reinitialize",element:l.jsx(EU,{}),showBackButton:!1},{path:"/login",element:l.jsx(zL,{}),showBackButton:!1,layout:"auth"},{path:"/unlock",element:l.jsx(VL,{}),showBackButton:!1,layout:"auth"},{path:"/unlock-success",element:l.jsx(KL,{}),showBackButton:!1},{path:"/upgrade",element:l.jsx(WL,{}),showBackButton:!1},{path:"/auth-settings",element:l.jsx(Y2,{}),showBackButton:!0,title:r("common.settings")},{path:"/items",element:l.jsx(ZE,{}),showBackButton:!1},{path:"/items/folder/:folderId",element:l.jsx(ZE,{}),showBackButton:!0,title:r("items.title")},{path:"/items/select-type",element:l.jsx(cU,{}),showBackButton:!0,title:r("itemTypes.selectType")},{path:"/items/add",element:l.jsx(YE,{}),showBackButton:!0,title:r("items.addItem")},{path:"/items/deleted",element:l.jsx(dU,{}),showBackButton:!0,title:r("recentlyDeleted.title")},{path:"/items/:id",element:l.jsx(rU,{}),showBackButton:!0,title:r("items.itemDetails")},{path:"/items/:id/edit",element:l.jsx(YE,{}),showBackButton:!0,title:r("items.editItem")},{path:"/passkeys/create",element:l.jsx(pU,{}),layout:"passkey"},{path:"/passkeys/authenticate",element:l.jsx(AU,{}),layout:"passkey"},{path:"/emails",element:l.jsx(IR,{}),showBackButton:!1},{path:"/emails/:id",element:l.jsx(bR,{}),showBackButton:!0,title:r("emails.title")},{path:"/settings",element:l.jsx(SU,{}),showBackButton:!1},{path:"/settings/unlock-method",element:l.jsx(kU,{}),showBackButton:!0,title:r("settings.unlockMethod.title")},{path:"/settings/autofill",element:l.jsx(bU,{}),showBackButton:!0,title:r("settings.autofillSettings")},{path:"/settings/context-menu",element:l.jsx(wU,{}),showBackButton:!0,title:r("settings.contextMenuSettings")},{path:"/settings/clipboard",element:l.jsx(vU,{}),showBackButton:!0,title:r("settings.clipboardSettings")},{path:"/settings/language",element:l.jsx(CU,{}),showBackButton:!0,title:r("settings.language")},{path:"/settings/auto-lock",element:l.jsx(IU,{}),showBackButton:!0,title:r("settings.autoLockTimeout")},{path:"/settings/passkeys",element:l.jsx(NU,{}),showBackButton:!0,title:r("settings.passkeySettings")}],[r]);return w.useEffect(()=>{a||s(!1)},[a,s]),w.useEffect(()=>{gt("POPUP_HEARTBEAT",{},"background").catch(()=>{});const f=setInterval(()=>{gt("POPUP_HEARTBEAT",{},"background").catch(()=>{})},5e3);return()=>{clearInterval(f)}},[]),w.useEffect(()=>{window.location.hash&&window.location.hash!=="#/"&&window.location.hash!=="#"||fU()},[]),w.useEffect(()=>{e.globalMessage?d(e.globalMessage):d(null)},[e,e.globalMessage]),l.jsx(SN,{children:l.jsx(m2,{children:l.jsx(LU,{routes:g,isLoading:i,message:c,headerButtons:m})})})},pt=r=>typeof r=="string",Ul=()=>{let r,e;const a=new Promise((i,s)=>{r=i,e=s});return a.resolve=r,a.reject=e,a},sb=r=>r==null?"":""+r,DU=(r,e,a)=>{r.forEach(i=>{e[i]&&(a[i]=e[i])})},BU=/###/g,ob=r=>r&&r.indexOf("###")>-1?r.replace(BU,"."):r,lb=r=>!r||pt(r),Vl=(r,e,a)=>{const i=pt(e)?e.split("."):e;let s=0;for(;s<i.length-1;){if(lb(r))return{};const c=ob(i[s]);!r[c]&&a&&(r[c]=new a),Object.prototype.hasOwnProperty.call(r,c)?r=r[c]:r={},++s}return lb(r)?{}:{obj:r,k:ob(i[s])}},cb=(r,e,a)=>{const{obj:i,k:s}=Vl(r,e,Object);if(i!==void 0||e.length===1){i[s]=a;return}let c=e[e.length-1],d=e.slice(0,e.length-1),m=Vl(r,d,Object);for(;m.obj===void 0&&d.length;)c=`${d[d.length-1]}.${c}`,d=d.slice(0,d.length-1),m=Vl(r,d,Object),m!=null&&m.obj&&typeof m.obj[`${m.k}.${c}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${c}`]=a},UU=(r,e,a,i)=>{const{obj:s,k:c}=Vl(r,e,Object);s[c]=s[c]||[],s[c].push(a)},ad=(r,e)=>{const{obj:a,k:i}=Vl(r,e);if(a&&Object.prototype.hasOwnProperty.call(a,i))return a[i]},_U=(r,e,a)=>{const i=ad(r,a);return i!==void 0?i:ad(e,a)},nv=(r,e,a)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in r?pt(r[i])||r[i]instanceof String||pt(e[i])||e[i]instanceof String?a&&(r[i]=e[i]):nv(r[i],e[i],a):r[i]=e[i]);return r},co=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var MU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const FU=r=>pt(r)?r.replace(/[&<>"'\/]/g,e=>MU[e]):r;class OU{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const a=this.regExpMap.get(e);if(a!==void 0)return a;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const jU=[" ",",","?","!",";"],PU=new OU(20),HU=(r,e,a)=>{e=e||"",a=a||"";const i=jU.filter(d=>e.indexOf(d)<0&&a.indexOf(d)<0);if(i.length===0)return!0;const s=PU.getRegExp(`(${i.map(d=>d==="?"?"\\?":d).join("|")})`);let c=!s.test(r);if(!c){const d=r.indexOf(a);d>0&&!s.test(r.substring(0,d))&&(c=!0)}return c},mh=(r,e,a=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const i=e.split(a);let s=r;for(let c=0;c<i.length;){if(!s||typeof s!="object")return;let d,m="";for(let g=c;g<i.length;++g)if(g!==c&&(m+=a),m+=i[g],d=s[m],d!==void 0){if(["string","number","boolean"].indexOf(typeof d)>-1&&g<i.length-1)continue;c+=g-c+1;break}s=d}return s},ql=r=>r==null?void 0:r.replace("_","-"),QU={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var a,i;(i=(a=console==null?void 0:console[r])==null?void 0:a.apply)==null||i.call(a,console,e)}};class nd{constructor(e,a={}){this.init(e,a)}init(e,a={}){this.prefix=a.prefix||"i18next:",this.logger=e||QU,this.options=a,this.debug=a.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,a,i,s){return s&&!this.debug?null:(pt(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[a](e))}create(e){return new nd(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new nd(this.logger,e)}}var kr=new nd;class yd{constructor(){this.observers={}}on(e,a){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const s=this.observers[i].get(a)||0;this.observers[i].set(a,s+1)}),this}off(e,a){if(this.observers[e]){if(!a){delete this.observers[e];return}this.observers[e].delete(a)}}emit(e,...a){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,c])=>{for(let d=0;d<c;d++)s(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,c])=>{for(let d=0;d<c;d++)s.apply(s,[e,...a])})}}class ub extends yd{constructor(e,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const a=this.options.ns.indexOf(e);a>-1&&this.options.ns.splice(a,1)}getResource(e,a,i,s={}){var f,E;const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,d=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;e.indexOf(".")>-1?m=e.split("."):(m=[e,a],i&&(Array.isArray(i)?m.push(...i):pt(i)&&c?m.push(...i.split(c)):m.push(i)));const g=ad(this.data,m);return!g&&!a&&!i&&e.indexOf(".")>-1&&(e=m[0],a=m[1],i=m.slice(2).join(".")),g||!d||!pt(i)?g:mh((E=(f=this.data)==null?void 0:f[e])==null?void 0:E[a],i,c)}addResource(e,a,i,s,c={silent:!1}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let m=[e,a];i&&(m=m.concat(d?i.split(d):i)),e.indexOf(".")>-1&&(m=e.split("."),s=a,a=m[1]),this.addNamespaces(a),cb(this.data,m,s),c.silent||this.emit("added",e,a,i,s)}addResources(e,a,i,s={silent:!1}){for(const c in i)(pt(i[c])||Array.isArray(i[c]))&&this.addResource(e,a,c,i[c],{silent:!0});s.silent||this.emit("added",e,a,i)}addResourceBundle(e,a,i,s,c,d={silent:!1,skipCopy:!1}){let m=[e,a];e.indexOf(".")>-1&&(m=e.split("."),s=i,i=a,a=m[1]),this.addNamespaces(a);let g=ad(this.data,m)||{};d.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?nv(g,i,c):g={...g,...i},cb(this.data,m,g),d.silent||this.emit("added",e,a,i)}removeResourceBundle(e,a){this.hasResourceBundle(e,a)&&delete this.data[e][a],this.removeNamespaces(a),this.emit("removed",e,a)}hasResourceBundle(e,a){return this.getResource(e,a)!==void 0}getResourceBundle(e,a){return a||(a=this.options.defaultNS),this.getResource(e,a)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const a=this.getDataByLanguage(e);return!!(a&&Object.keys(a)||[]).find(s=>a[s]&&Object.keys(a[s]).length>0)}toJSON(){return this.data}}var rv={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,a,i,s){return r.forEach(c=>{var d;e=((d=this.processors[c])==null?void 0:d.process(e,a,i,s))??e}),e}};const db={},mb=r=>!pt(r)&&typeof r!="boolean"&&typeof r!="number";class rd extends yd{constructor(e,a={}){super(),DU(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=kr.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,a={interpolation:{}}){const i={...a};if(e==null)return!1;const s=this.resolve(e,i);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,a){let i=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=a.ns||this.options.defaultNS||[];const d=i&&e.indexOf(i)>-1,m=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!HU(e,i,s);if(d&&!m){const g=e.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:e,namespaces:pt(c)?[c]:c};const f=e.split(i);(i!==s||i===s&&this.options.ns.indexOf(f[0])>-1)&&(c=f.shift()),e=f.join(s)}return{key:e,namespaces:pt(c)?[c]:c}}translate(e,a,i){let s=typeof a=="object"?{...a}:a;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const c=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,d=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:m,namespaces:g}=this.extractFromKey(e[e.length-1],s),f=g[g.length-1];let E=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;E===void 0&&(E=":");const p=s.lng||this.language,C=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return C?c?{res:`${f}${E}${m}`,usedKey:m,exactUsedKey:m,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:`${f}${E}${m}`:c?{res:m,usedKey:m,exactUsedKey:m,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:m;const I=this.resolve(e,s);let x=I==null?void 0:I.res;const T=(I==null?void 0:I.usedKey)||m,k=(I==null?void 0:I.exactUsedKey)||m,R=["[object Number]","[object Function]","[object RegExp]"],_=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,O=s.count!==void 0&&!pt(s.count),U=rd.hasDefaultValue(s),P=O?this.pluralResolver.getSuffix(p,s.count,s):"",K=s.ordinal&&O?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",H=O&&!s.ordinal&&s.count===0,Q=H&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${P}`]||s[`defaultValue${K}`]||s.defaultValue;let V=x;S&&!x&&U&&(V=Q);const G=mb(V),q=Object.prototype.toString.apply(V);if(S&&V&&G&&R.indexOf(q)<0&&!(pt(_)&&Array.isArray(V))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,V,{...s,ns:g}):`key '${m} (${this.language})' returned an object instead of string.`;return c?(I.res=W,I.usedParams=this.getUsedParamsDetails(s),I):W}if(d){const W=Array.isArray(V),ne=W?[]:{},me=W?k:T;for(const $ in V)if(Object.prototype.hasOwnProperty.call(V,$)){const re=`${me}${d}${$}`;U&&!x?ne[$]=this.translate(re,{...s,defaultValue:mb(Q)?Q[$]:void 0,joinArrays:!1,ns:g}):ne[$]=this.translate(re,{...s,joinArrays:!1,ns:g}),ne[$]===re&&(ne[$]=V[$])}x=ne}}else if(S&&pt(_)&&Array.isArray(x))x=x.join(_),x&&(x=this.extendTranslation(x,e,s,i));else{let W=!1,ne=!1;!this.isValidLookup(x)&&U&&(W=!0,x=Q),this.isValidLookup(x)||(ne=!0,x=m);const $=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ne?void 0:x,re=U&&Q!==x&&this.options.updateMissing;if(ne||W||re){if(this.logger.log(re?"updateKey":"missingKey",p,f,m,re?Q:x),d){const X=this.resolve(m,{...s,keySeparator:!1});X&&X.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ye=[];const Ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ae&&Ae[0])for(let X=0;X<Ae.length;X++)ye.push(Ae[X]);else this.options.saveMissingTo==="all"?ye=this.languageUtils.toResolveHierarchy(s.lng||this.language):ye.push(s.lng||this.language);const j=(X,ee,ie)=>{var we;const Ie=U&&ie!==x?ie:$;this.options.missingKeyHandler?this.options.missingKeyHandler(X,f,ee,Ie,re,s):(we=this.backendConnector)!=null&&we.saveMissing&&this.backendConnector.saveMissing(X,f,ee,Ie,re,s),this.emit("missingKey",X,f,ee,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?ye.forEach(X=>{const ee=this.pluralResolver.getSuffixes(X,s);H&&s[`defaultValue${this.options.pluralSeparator}zero`]&&ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&ee.push(`${this.options.pluralSeparator}zero`),ee.forEach(ie=>{j([X],m+ie,s[`defaultValue${ie}`]||Q)})}):j(ye,m,Q))}x=this.extendTranslation(x,e,s,I,i),ne&&x===m&&this.options.appendNamespaceToMissingKey&&(x=`${f}${E}${m}`),(ne||W)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${E}${m}`:m,W?x:void 0,s))}return c?(I.res=x,I.usedParams=this.getUsedParamsDetails(s),I):x}extendTranslation(e,a,i,s,c){var g,f;if((g=this.i18nFormat)!=null&&g.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const E=pt(e)&&(((f=i==null?void 0:i.interpolation)==null?void 0:f.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(E){const I=e.match(this.interpolator.nestingRegexp);p=I&&I.length}let C=i.replace&&!pt(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(C={...this.options.interpolation.defaultVariables,...C}),e=this.interpolator.interpolate(e,C,i.lng||this.language||s.usedLng,i),E){const I=e.match(this.interpolator.nestingRegexp),x=I&&I.length;p<x&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,(...I)=>(c==null?void 0:c[0])===I[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${I[0]} in key: ${a[0]}`),null):this.translate(...I,a),i)),i.interpolation&&this.interpolator.reset()}const d=i.postProcess||this.options.postProcess,m=pt(d)?[d]:d;return e!=null&&(m!=null&&m.length)&&i.applyPostProcessor!==!1&&(e=rv.handle(m,e,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,a={}){let i,s,c,d,m;return pt(e)&&(e=[e]),e.forEach(g=>{if(this.isValidLookup(i))return;const f=this.extractFromKey(g,a),E=f.key;s=E;let p=f.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const C=a.count!==void 0&&!pt(a.count),I=C&&!a.ordinal&&a.count===0,x=a.context!==void 0&&(pt(a.context)||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);p.forEach(k=>{var R,_;this.isValidLookup(i)||(m=k,!db[`${T[0]}-${k}`]&&((R=this.utils)!=null&&R.hasLoadedNamespace)&&!((_=this.utils)!=null&&_.hasLoadedNamespace(m))&&(db[`${T[0]}-${k}`]=!0,this.logger.warn(`key "${s}" for languages "${T.join(", ")}" won't get resolved as namespace "${m}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(S=>{var P;if(this.isValidLookup(i))return;d=S;const O=[E];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(O,E,S,k,a);else{let K;C&&(K=this.pluralResolver.getSuffix(S,a.count,a));const H=`${this.options.pluralSeparator}zero`,Q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(C&&(O.push(E+K),a.ordinal&&K.indexOf(Q)===0&&O.push(E+K.replace(Q,this.options.pluralSeparator)),I&&O.push(E+H)),x){const V=`${E}${this.options.contextSeparator}${a.context}`;O.push(V),C&&(O.push(V+K),a.ordinal&&K.indexOf(Q)===0&&O.push(V+K.replace(Q,this.options.pluralSeparator)),I&&O.push(V+H))}}let U;for(;U=O.pop();)this.isValidLookup(i)||(c=U,i=this.getResource(S,k,U,a))}))})}),{res:i,usedKey:s,exactUsedKey:c,usedLng:d,usedNS:m}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,a,i,s={}){var c;return(c=this.i18nFormat)!=null&&c.getResource?this.i18nFormat.getResource(e,a,i,s):this.resourceStore.getResource(e,a,i,s)}getUsedParamsDetails(e={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!pt(e.replace);let s=i?e.replace:e;if(i&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const c of a)delete s[c]}return s}static hasDefaultValue(e){const a="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&a===i.substring(0,a.length)&&e[i]!==void 0)return!0;return!1}}class fb{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=kr.create("languageUtils")}getScriptPartFromCode(e){if(e=ql(e),!e||e.indexOf("-")<0)return null;const a=e.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(e){if(e=ql(e),!e||e.indexOf("-")<0)return e;const a=e.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(e){if(pt(e)&&e.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(e)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let a;return e.forEach(i=>{if(a)return;const s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(a=s)}),!a&&this.options.supportedLngs&&e.forEach(i=>{if(a)return;const s=this.getScriptPartFromCode(i);if(this.isSupportedCode(s))return a=s;const c=this.getLanguagePartFromCode(i);if(this.isSupportedCode(c))return a=c;a=this.options.supportedLngs.find(d=>{if(d===c)return d;if(!(d.indexOf("-")<0&&c.indexOf("-")<0)&&(d.indexOf("-")>0&&c.indexOf("-")<0&&d.substring(0,d.indexOf("-"))===c||d.indexOf(c)===0&&c.length>1))return d})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(e,a){if(!e)return[];if(typeof e=="function"&&(e=e(a)),pt(e)&&(e=[e]),Array.isArray(e))return e;if(!a)return e.default||[];let i=e[a];return i||(i=e[this.getScriptPartFromCode(a)]),i||(i=e[this.formatLanguageCode(a)]),i||(i=e[this.getLanguagePartFromCode(a)]),i||(i=e.default),i||[]}toResolveHierarchy(e,a){const i=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],e),s=[],c=d=>{d&&(this.isSupportedCode(d)?s.push(d):this.logger.warn(`rejecting language code not found in supportedLngs: ${d}`))};return pt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&c(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&c(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&c(this.getLanguagePartFromCode(e))):pt(e)&&c(this.formatLanguageCode(e)),i.forEach(d=>{s.indexOf(d)<0&&c(this.formatLanguageCode(d))}),s}}const gb={zero:0,one:1,two:2,few:3,many:4,other:5},hb={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class zU{constructor(e,a={}){this.languageUtils=e,this.options=a,this.logger=kr.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,a){this.rules[e]=a}clearCache(){this.pluralRulesCache={}}getRule(e,a={}){const i=ql(e==="dev"?"en":e),s=a.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:i,type:s});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let d;try{d=new Intl.PluralRules(i,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),hb;if(!e.match(/-|_/))return hb;const g=this.languageUtils.getLanguagePartFromCode(e);d=this.getRule(g,a)}return this.pluralRulesCache[c]=d,d}needsPlural(e,a={}){let i=this.getRule(e,a);return i||(i=this.getRule("dev",a)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,a,i={}){return this.getSuffixes(e,i).map(s=>`${a}${s}`)}getSuffixes(e,a={}){let i=this.getRule(e,a);return i||(i=this.getRule("dev",a)),i?i.resolvedOptions().pluralCategories.sort((s,c)=>gb[s]-gb[c]).map(s=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,a,i={}){const s=this.getRule(e,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(a)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",a,i))}}const Ab=(r,e,a,i=".",s=!0)=>{let c=_U(r,e,a);return!c&&s&&pt(a)&&(c=mh(r,a,i),c===void 0&&(c=mh(e,a,i))),c},Og=r=>r.replace(/\$/g,"$$$$");class VU{constructor(e={}){var a;this.logger=kr.create("interpolator"),this.options=e,this.format=((a=e==null?void 0:e.interpolation)==null?void 0:a.format)||(i=>i),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:a,escapeValue:i,useRawValueToEscape:s,prefix:c,prefixEscaped:d,suffix:m,suffixEscaped:g,formatSeparator:f,unescapeSuffix:E,unescapePrefix:p,nestingPrefix:C,nestingPrefixEscaped:I,nestingSuffix:x,nestingSuffixEscaped:T,nestingOptionsSeparator:k,maxReplaces:R,alwaysFormat:_}=e.interpolation;this.escape=a!==void 0?a:FU,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=c?co(c):d||"{{",this.suffix=m?co(m):g||"}}",this.formatSeparator=f||",",this.unescapePrefix=E?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":E||"",this.nestingPrefix=C?co(C):I||co("$t("),this.nestingSuffix=x?co(x):T||co(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=R||1e3,this.alwaysFormat=_!==void 0?_:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(a,i)=>(a==null?void 0:a.source)===i?(a.lastIndex=0,a):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,a,i,s){var I;let c,d,m;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=x=>{if(x.indexOf(this.formatSeparator)<0){const _=Ab(a,g,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,i,{...s,...a,interpolationkey:x}):_}const T=x.split(this.formatSeparator),k=T.shift().trim(),R=T.join(this.formatSeparator).trim();return this.format(Ab(a,g,k,this.options.keySeparator,this.options.ignoreJSONStructure),R,i,{...s,...a,interpolationkey:k})};this.resetRegExp();const E=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((I=s==null?void 0:s.interpolation)==null?void 0:I.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>Og(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?Og(this.escape(x)):Og(x)}].forEach(x=>{for(m=0;c=x.regex.exec(e);){const T=c[1].trim();if(d=f(T),d===void 0)if(typeof E=="function"){const R=E(e,c,s);d=pt(R)?R:""}else if(s&&Object.prototype.hasOwnProperty.call(s,T))d="";else if(p){d=c[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${e}`),d="";else!pt(d)&&!this.useRawValueToEscape&&(d=sb(d));const k=x.safeValue(d);if(e=e.replace(c[0],k),p?(x.regex.lastIndex+=d.length,x.regex.lastIndex-=c[0].length):x.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),e}nest(e,a,i={}){let s,c,d;const m=(g,f)=>{const E=this.nestingOptionsSeparator;if(g.indexOf(E)<0)return g;const p=g.split(new RegExp(`${E}[ ]*{`));let C=`{${p[1]}`;g=p[0],C=this.interpolate(C,d);const I=C.match(/'/g),x=C.match(/"/g);(((I==null?void 0:I.length)??0)%2===0&&!x||x.length%2!==0)&&(C=C.replace(/'/g,'"'));try{d=JSON.parse(C),f&&(d={...f,...d})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${E}${C}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,g};for(;s=this.nestingRegexp.exec(e);){let g=[];d={...i},d=d.replace&&!pt(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.defaultValue;const f=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(f!==-1&&(g=s[1].slice(f).split(this.formatSeparator).map(E=>E.trim()).filter(Boolean),s[1]=s[1].slice(0,f)),c=a(m.call(this,s[1].trim(),d),d),c&&s[0]===e&&!pt(c))return c;pt(c)||(c=sb(c)),c||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),c=""),g.length&&(c=g.reduce((E,p)=>this.format(E,p,i.lng,{...i,interpolationkey:s[1].trim()}),c.trim())),e=e.replace(s[0],c),this.regexp.lastIndex=0}return e}}const KU=r=>{let e=r.toLowerCase().trim();const a={};if(r.indexOf("(")>-1){const i=r.split("(");e=i[0].toLowerCase().trim();const s=i[1].substring(0,i[1].length-1);e==="currency"&&s.indexOf(":")<0?a.currency||(a.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?a.range||(a.range=s.trim()):s.split(";").forEach(d=>{if(d){const[m,...g]=d.split(":"),f=g.join(":").trim().replace(/^'+|'+$/g,""),E=m.trim();a[E]||(a[E]=f),f==="false"&&(a[E]=!1),f==="true"&&(a[E]=!0),isNaN(f)||(a[E]=parseInt(f,10))}})}return{formatName:e,formatOptions:a}},pb=r=>{const e={};return(a,i,s)=>{let c=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(c={...c,[s.interpolationkey]:void 0});const d=i+JSON.stringify(c);let m=e[d];return m||(m=r(ql(i),s),e[d]=m),m(a)}},GU=r=>(e,a,i)=>r(ql(a),i)(e);class qU{constructor(e={}){this.logger=kr.create("formatter"),this.options=e,this.init(e)}init(e,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const i=a.cacheInBuiltFormats?pb:GU;this.formats={number:i((s,c)=>{const d=new Intl.NumberFormat(s,{...c});return m=>d.format(m)}),currency:i((s,c)=>{const d=new Intl.NumberFormat(s,{...c,style:"currency"});return m=>d.format(m)}),datetime:i((s,c)=>{const d=new Intl.DateTimeFormat(s,{...c});return m=>d.format(m)}),relativetime:i((s,c)=>{const d=new Intl.RelativeTimeFormat(s,{...c});return m=>d.format(m,c.range||"day")}),list:i((s,c)=>{const d=new Intl.ListFormat(s,{...c});return m=>d.format(m)})}}add(e,a){this.formats[e.toLowerCase().trim()]=a}addCached(e,a){this.formats[e.toLowerCase().trim()]=pb(a)}format(e,a,i,s={}){const c=a.split(this.formatSeparator);if(c.length>1&&c[0].indexOf("(")>1&&c[0].indexOf(")")<0&&c.find(m=>m.indexOf(")")>-1)){const m=c.findIndex(g=>g.indexOf(")")>-1);c[0]=[c[0],...c.splice(1,m)].join(this.formatSeparator)}return c.reduce((m,g)=>{var p;const{formatName:f,formatOptions:E}=KU(g);if(this.formats[f]){let C=m;try{const I=((p=s==null?void 0:s.formatParams)==null?void 0:p[s.interpolationkey])||{},x=I.locale||I.lng||s.locale||s.lng||i;C=this.formats[f](m,x,{...E,...s,...I})}catch(I){this.logger.warn(I)}return C}else this.logger.warn(`there was no format function for ${f}`);return m},e)}}const WU=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class YU extends yd{constructor(e,a,i,s={}){var c,d;super(),this.backend=e,this.store=a,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=kr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(d=(c=this.backend)==null?void 0:c.init)==null||d.call(c,i,s.backend,s)}queueLoad(e,a,i,s){const c={},d={},m={},g={};return e.forEach(f=>{let E=!0;a.forEach(p=>{const C=`${f}|${p}`;!i.reload&&this.store.hasResourceBundle(f,p)?this.state[C]=2:this.state[C]<0||(this.state[C]===1?d[C]===void 0&&(d[C]=!0):(this.state[C]=1,E=!1,d[C]===void 0&&(d[C]=!0),c[C]===void 0&&(c[C]=!0),g[p]===void 0&&(g[p]=!0)))}),E||(m[f]=!0)}),(Object.keys(c).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(c),pending:Object.keys(d),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(g)}}loaded(e,a,i){const s=e.split("|"),c=s[0],d=s[1];a&&this.emit("failedLoading",c,d,a),!a&&i&&this.store.addResourceBundle(c,d,i,void 0,void 0,{skipCopy:!0}),this.state[e]=a?-1:2,a&&i&&(this.state[e]=0);const m={};this.queue.forEach(g=>{UU(g.loaded,[c],d),WU(g,e),a&&g.errors.push(a),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(f=>{m[f]||(m[f]={});const E=g.loaded[f];E.length&&E.forEach(p=>{m[f][p]===void 0&&(m[f][p]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(g=>!g.done)}read(e,a,i,s=0,c=this.retryTimeout,d){if(!e.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:a,fcName:i,tried:s,wait:c,callback:d});return}this.readingCalls++;const m=(f,E)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(f&&E&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,a,i,s+1,c*2,d)},c);return}d(f,E)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const f=g(e,a);f&&typeof f.then=="function"?f.then(E=>m(null,E)).catch(m):m(null,f)}catch(f){m(f)}return}return g(e,a,m)}prepareLoading(e,a,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();pt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pt(a)&&(a=[a]);const c=this.queueLoad(e,a,i,s);if(!c.toLoad.length)return c.pending.length||s(),null;c.toLoad.forEach(d=>{this.loadOne(d)})}load(e,a,i){this.prepareLoading(e,a,{},i)}reload(e,a,i){this.prepareLoading(e,a,{reload:!0},i)}loadOne(e,a=""){const i=e.split("|"),s=i[0],c=i[1];this.read(s,c,"read",void 0,void 0,(d,m)=>{d&&this.logger.warn(`${a}loading namespace ${c} for language ${s} failed`,d),!d&&m&&this.logger.log(`${a}loaded namespace ${c} for language ${s}`,m),this.loaded(e,d,m)})}saveMissing(e,a,i,s,c,d={},m=()=>{}){var g,f,E,p,C;if((f=(g=this.services)==null?void 0:g.utils)!=null&&f.hasLoadedNamespace&&!((p=(E=this.services)==null?void 0:E.utils)!=null&&p.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${i}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((C=this.backend)!=null&&C.create){const I={...d,isUpdate:c},x=this.backend.create.bind(this.backend);if(x.length<6)try{let T;x.length===5?T=x(e,a,i,s,I):T=x(e,a,i,s),T&&typeof T.then=="function"?T.then(k=>m(null,k)).catch(m):m(null,T)}catch(T){m(T)}else x(e,a,i,s,m,I)}!e||!e[0]||this.store.addResource(e[0],a,i,s)}}}const yb=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),pt(r[1])&&(e.defaultValue=r[1]),pt(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const a=r[3]||r[2];Object.keys(a).forEach(i=>{e[i]=a[i]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Eb=r=>{var e,a;return pt(r.ns)&&(r.ns=[r.ns]),pt(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),pt(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((a=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:a.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},ku=()=>{},JU=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(a=>{typeof r[a]=="function"&&(r[a]=r[a].bind(r))})};class Wl extends yd{constructor(e={},a){if(super(),this.options=Eb(e),this.services={},this.logger=kr,this.modules={external:[]},JU(this),a&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,a),this;setTimeout(()=>{this.init(e,a)},0)}}init(e={},a){this.isInitializing=!0,typeof e=="function"&&(a=e,e={}),e.defaultNS==null&&e.ns&&(pt(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=yb();this.options={...i,...this.options,...Eb(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?kr.init(s(this.modules.logger),this.options):kr.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=qU;const E=new fb(this.options);this.store=new ub(this.options.resources,this.options);const p=this.services;p.logger=kr,p.resourceStore=this.store,p.languageUtils=E,p.pluralResolver=new zU(E,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),f&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=s(f),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new VU(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new YU(s(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(I,...x)=>{this.emit(I,...x)}),this.modules.languageDetector&&(p.languageDetector=s(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=s(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new rd(this.services,this.options),this.translator.on("*",(I,...x)=>{this.emit(I,...x)}),this.modules.external.forEach(I=>{I.init&&I.init(this)})}if(this.format=this.options.interpolation.format,a||(a=ku),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...E)=>this.store[f](...E)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...E)=>(this.store[f](...E),this)});const m=Ul(),g=()=>{const f=(E,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),m.resolve(p),a(E,p)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),m}loadResources(e,a=ku){var c,d;let i=a;const s=pt(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const m=[],g=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(p=>{p!=="cimode"&&m.indexOf(p)<0&&m.push(p)})};s?g(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(E=>g(E)),(d=(c=this.options.preload)==null?void 0:c.forEach)==null||d.call(c,f=>g(f)),this.services.backendConnector.load(m,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(f)})}else i(null)}reloadResources(e,a,i){const s=Ul();return typeof e=="function"&&(i=e,e=void 0),typeof a=="function"&&(i=a,a=void 0),e||(e=this.languages),a||(a=this.options.ns),i||(i=ku),this.services.backendConnector.reload(e,a,c=>{s.resolve(),i(c)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&rv.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let a=0;a<this.languages.length;a++){const i=this.languages[a];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,a){this.isLanguageChangingTo=e;const i=Ul();this.emit("languageChanging",e);const s=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},c=(m,g)=>{g?this.isLanguageChangingTo===e&&(s(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,i.resolve((...f)=>this.t(...f)),a&&a(m,(...f)=>this.t(...f))},d=m=>{var E,p;!e&&!m&&this.services.languageDetector&&(m=[]);const g=pt(m)?m:m&&m[0],f=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(pt(m)?[m]:m);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),(p=(E=this.services.languageDetector)==null?void 0:E.cacheUserLanguage)==null||p.call(E,f)),this.loadResources(f,C=>{c(C,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(e),i}getFixedT(e,a,i){const s=(c,d,...m)=>{let g;typeof d!="object"?g=this.options.overloadTranslationOptionHandler([c,d].concat(m)):g={...d},g.lng=g.lng||s.lng,g.lngs=g.lngs||s.lngs,g.ns=g.ns||s.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||s.keyPrefix);const f=this.options.keySeparator||".";let E;return g.keyPrefix&&Array.isArray(c)?E=c.map(p=>`${g.keyPrefix}${f}${p}`):E=g.keyPrefix?`${g.keyPrefix}${f}${c}`:c,this.t(E,g)};return pt(e)?s.lng=e:s.lngs=e,s.ns=a,s.keyPrefix=i,s}t(...e){var a;return(a=this.translator)==null?void 0:a.translate(...e)}exists(...e){var a;return(a=this.translator)==null?void 0:a.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=a.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const d=(m,g)=>{const f=this.services.backendConnector.state[`${m}|${g}`];return f===-1||f===0||f===2};if(a.precheck){const m=a.precheck(this,d);if(m!==void 0)return m}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(i,e)&&(!s||d(c,e)))}loadNamespaces(e,a){const i=Ul();return this.options.ns?(pt(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),a&&a(s)}),i):(a&&a(),Promise.resolve())}loadLanguages(e,a){const i=Ul();pt(e)&&(e=[e]);const s=this.options.preload||[],c=e.filter(d=>s.indexOf(d)<0&&this.services.languageUtils.isSupportedCode(d));return c.length?(this.options.preload=s.concat(c),this.loadResources(d=>{i.resolve(),a&&a(d)}),i):(a&&a(),Promise.resolve())}dir(e){var s,c;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";if(Intl.Locale){const d=new Intl.Locale(e);if(d&&d.getTextInfo){const m=d.getTextInfo();if(m&&m.direction)return m.direction}}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((c=this.services)==null?void 0:c.languageUtils)||new fb(yb());return e.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},a){return new Wl(e,a)}cloneInstance(e={},a=ku){const i=e.forkResourceStore;i&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},c=new Wl(s);if((e.debug!==void 0||e.prefix!==void 0)&&(c.logger=c.logger.clone(e)),["store","services","language"].forEach(m=>{c[m]=this[m]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},i){const m=Object.keys(this.store.data).reduce((g,f)=>(g[f]={...this.store.data[f]},g[f]=Object.keys(g[f]).reduce((E,p)=>(E[p]={...g[f][p]},E),g[f]),g),{});c.store=new ub(m,s),c.services.resourceStore=c.store}return c.translator=new rd(c.services,s),c.translator.on("*",(m,...g)=>{c.emit(m,...g)}),c.init(s,a),c.translator.options=s,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Oa=Wl.createInstance();Oa.createInstance=Wl.createInstance;Oa.createInstance;Oa.dir;Oa.init;Oa.loadResources;Oa.reloadResources;Oa.use;Oa.changeLanguage;Oa.getFixedT;Oa.t;Oa.exists;Oa.setDefaultNamespace;Oa.hasLoadedNamespace;Oa.loadNamespaces;Oa.loadLanguages;const XU=async()=>{const r=await ke.getItem("local:language");if(r&&Gu.includes(r))return r;const e=navigator.language.split("-")[0];return Gu.includes(e)?e:Sr},$U=async()=>{const r=await XU();await Oa.use(aC).init({resources:_l,lng:r,fallbackLng:Sr,debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1,bindI18n:"languageChanged loaded",bindI18nStore:""}})};$U().catch(r=>{console.error("Failed to initialize i18n:",r),Oa.emit("initialized")});const bb=()=>{Vw.createRoot(document.getElementById("root")).render(l.jsx(zk,{children:l.jsx(t2,{children:l.jsx($k,{children:l.jsx(a2,{children:l.jsx(l2,{children:l.jsx(s2,{children:l.jsx(xU,{children:l.jsx(RU,{})})})})})})})}))};Oa.isInitialized?bb():Oa.on("initialized",bb)});export default ZU();
