1import{b as V,c as D,D as Ht,x as jt,o as L,e as $,B as Y,A as H,y as xe,q as G,f as t,z as M,F as ce,K as ut,k as Se,J as Te,M as _n,L as st,j as le,t as bn,w as xn,E as Cn,m as ct}from"./vue-1AtMcz7l.js";import{a as kn,u as Kt}from"./vue-router-BL0W4KYo.js";import{b as J,e as oe}from"./api-By18TgAG.js";import{A as Yt,bo as En,ae as te,t as dt,bZ as Pn,cw as ft,bl as An,cx as pt,s as Ue,q as Le,aB as Sn,bm as Tn,df as Nn,S as Rn,dg as Bn,B as Mn}from"./public-shell-B_x5oatf.js";import{trackProfileUpdated as In,trackVerificationEmailResent as Un}from"./mixpanel-DT0Ikp3G.js";import{_ as Ln}from"./AppPageLayout-Bh1yRcus.js";import{_ as ht}from"./AppSelect-V6dFg7rf.js";import{_ as Ae}from"./PasswordRevealInput-CMd-_wqj.js";import{a as Dn}from"./content-CdKKYwFJ.js";import{_ as $n}from"./PinDigitBoxes-BYXWUIRB.js";import{a as Fn,s as Vn}from"./twoFactorReauth-Cv5RUwJJ.js";import{_ as zn,a as qn}from"./AccountManageShell-TB9Auixn.js";import{u as gt}from"./timezone-C1WFMaLm.js";import"./axios-CH-jSbCW.js";import"./guestSession-DuFht6JD.js";import"./Sidebar-BIa60X3P.js";import"./usePressOrLongPress-Bo2AzNjN.js";import"./notesListScopeCache-BTTJbRCz.js";import"./useNoteLock-DAH1Drl9.js";import"./reminderNotificationPlatformCopy-Lh4Xwm6U.js";import"./reminderNotificationSupport-DrOlugB6.js";import"./nativeReminderNotifications-WBUuc_UT.js";import"./useSearchDialog-PJA20_B2.js";import"./useNotesLayoutUi-rLFSmLjJ.js";import"./providers-BM2ighsu.js";import"./AccountDeletionBanner-D06rqRSm.js";import"./DatacenterMigrationBanner-C5-Y1gcG.js";import"./useDatacenterMigration-BsX8jSLg.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"8ed42405eab16ca6f21c30b45346c6f30a2e6f72"};var r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="2539f2d3-2c0b-412a-af88-44e7762c0a74",a._sentryDebugIdIdentifier="sentry-dbid-2539f2d3-2c0b-412a-af88-44e7762c0a74")}catch{}})();var be={},De,vt;function On(){return vt||(vt=1,De=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),De}var $e={},ve={},mt;function we(){if(mt)return ve;mt=1;let a;const r=[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 ve.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},ve.getSymbolTotalCodewords=function(o){return r[o]},ve.getBCHDigit=function(i){let o=0;for(;i!==0;)o++,i>>>=1;return o},ve.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');a=o},ve.isKanjiModeEnabled=function(){return typeof a<"u"},ve.toSJIS=function(o){return a(o)},ve}var Fe={},wt;function it(){return wt||(wt=1,(function(a){a.L={bit:1},a.M={bit:0},a.Q={bit:3},a.H={bit:2};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return a.L;case"m":case"medium":return a.M;case"q":case"quartile":return a.Q;case"h":case"high":return a.H;default:throw new Error("Unknown EC Level: "+i)}}a.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},a.from=function(o,e){if(a.isValid(o))return o;try{return r(o)}catch{return e}}})(Fe)),Fe}var Ve,yt;function Hn(){if(yt)return Ve;yt=1;function a(){this.buffer=[],this.length=0}return a.prototype={get:function(r){const i=Math.floor(r/8);return(this.buffer[i]>>>7-r%8&1)===1},put:function(r,i){for(let o=0;o<i;o++)this.putBit((r>>>i-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),r&&(this.buffer[i]|=128>>>this.length%8),this.length++}},Ve=a,Ve}var ze,_t;function jn(){if(_t)return ze;_t=1;function a(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}return a.prototype.set=function(r,i,o,e){const n=r*this.size+i;this.data[n]=o,e&&(this.reservedBit[n]=!0)},a.prototype.get=function(r,i){return this.data[r*this.size+i]},a.prototype.xor=function(r,i,o){this.data[r*this.size+i]^=o},a.prototype.isReserved=function(r,i){return this.reservedBit[r*this.size+i]},ze=a,ze}var qe={},bt;function Kn(){return bt||(bt=1,(function(a){const r=we().getSymbolSize;
1a.getRowColCoords=function(o){if(o===1)return[];const e=Math.floor(o/7)+2,n=r(o),l=n===145?26:Math.ceil((n-13)/(2*e-2))*2,c=[n-7];for(let s=1;s<e-1;s++)c[s]=c[s-1]-l;return c.push(6),c.reverse()},a.getPositions=function(o){const e=[],n=a.getRowColCoords(o),l=n.length;for(let c=0;c<l;c++)for(let s=0;s<l;s++)c===0&&s===0||c===0&&s===l-1||c===l-1&&s===0||e.push([n[c],n[s]]);return e}})(qe)),qe}var Oe={},xt;function Yn(){if(xt)return Oe;xt=1;const a=we().getSymbolSize,r=7;return Oe.getPositions=function(o){const e=a(o);return[[0,0],[e-r,0],[0,e-r]]},Oe}var He={},Ct;function Gn(){return Ct||(Ct=1,(function(a){a.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r={N1:3,N2:3,N3:40,N4:10};a.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},a.from=function(e){return a.isValid(e)?parseInt(e,10):void 0},a.getPenaltyN1=function(e){const n=e.size;let l=0,c=0,s=0,h=null,d=null;for(let _=0;_<n;_++){c=s=0,h=d=null;for(let w=0;w<n;w++){let p=e.get(_,w);p===h?c++:(c>=5&&(l+=r.N1+(c-5)),h=p,c=1),p=e.get(w,_),p===d?s++:(s>=5&&(l+=r.N1+(s-5)),d=p,s=1)}c>=5&&(l+=r.N1+(c-5)),s>=5&&(l+=r.N1+(s-5))}return l},a.getPenaltyN2=function(e){const n=e.size;let l=0;for(let c=0;c<n-1;c++)for(let s=0;s<n-1;s++){const h=e.get(c,s)+e.get(c,s+1)+e.get(c+1,s)+e.get(c+1,s+1);(h===4||h===0)&&l++}return l*r.N2},a.getPenaltyN3=function(e){const n=e.size;let l=0,c=0,s=0;for(let h=0;h<n;h++){c=s=0;for(let d=0;d<n;d++)c=c<<1&2047|e.get(h,d),d>=10&&(c===1488||c===93)&&l++,s=s<<1&2047|e.get(d,h),d>=10&&(s===1488||s===93)&&l++}return l*r.N3},a.getPenaltyN4=function(e){let n=0;const l=e.data.length;for(let s=0;s<l;s++)n+=e.data[s];return Math.abs(Math.ceil(n*100/l/5)-10)*r.N4};function i(o,e,n){switch(o){case a.Patterns.PATTERN000:return(e+n)%2===0;case a.Patterns.PATTERN001:return e%2===0;case a.Patterns.PATTERN010:return n%3===0;case a.Patterns.PATTERN011:return(e+n)%3===0;case a.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2===0;case a.Patterns.PATTERN101:return e*n%2+e*n%3===0;case a.Patterns.PATTERN110:return(e*n%2+e*n%3)%2===0;case a.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}a.applyMask=function(e,n){const l=n.size;for(let c=0;c<l;c++)for(let s=0;s<l;s++)n.isReserved(s,c)||n.xor(s,c,i(e,s,c))},a.getBestMask=function(e,n){const l=Object.keys(a.Patterns).length;let c=0,s=1/0;for(let h=0;h<l;h++){n(h),a.applyMask(h,e);const d=a.getPenaltyN1(e)+a.getPenaltyN2(e)+a.getPenaltyN3(e)+a.getPenaltyN4(e);a.applyMask(h,e),d<s&&(s=d,c=h)}return c}})(He)),He}var Pe={},kt;function Gt(){if(kt)return Pe;kt=1;const a=it(),r=[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],i=[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 Pe.getBlocksCount=function(e,n){switch(n){case a.L:return r[(e-1)*4+0];case a.M:return r[(e-1)*4+1];case a.Q:return r[(e-1)*4+2];case a.H:return r[(e-1)*4+3];default:return}},Pe.getTotalCodewordsCount=function(e,n){switch(n){case a.L:return i[(e-1)*4+0];case a.M:return i[(e-1)*4+1];case a.Q:return i[(e-1)*4+2];case a.H:return i[(e-1)*4+3];default:return}},Pe}var je={},ke={},Et;function Jn(){if(Et)return ke;Et=1;const a=new Uint8Array(512),r=new Uint8Array(256);return(function(){let o=1;for(let e=0;e<255;e++)a[e]=o,r[o]=e,o<<=1,o&256&&(o^=285);for(let e=255;e<512;
1e++)a[e]=a[e-255]})(),ke.log=function(o){if(o<1)throw new Error("log("+o+")");return r[o]},ke.exp=function(o){return a[o]},ke.mul=function(o,e){return o===0||e===0?0:a[r[o]+r[e]]},ke}var Pt;function Qn(){return Pt||(Pt=1,(function(a){const r=Jn();a.mul=function(o,e){const n=new Uint8Array(o.length+e.length-1);for(let l=0;l<o.length;l++)for(let c=0;c<e.length;c++)n[l+c]^=r.mul(o[l],e[c]);return n},a.mod=function(o,e){let n=new Uint8Array(o);for(;n.length-e.length>=0;){const l=n[0];for(let s=0;s<e.length;s++)n[s]^=r.mul(e[s],l);let c=0;for(;c<n.length&&n[c]===0;)c++;n=n.slice(c)}return n},a.generateECPolynomial=function(o){let e=new Uint8Array([1]);for(let n=0;n<o;n++)e=a.mul(e,new Uint8Array([1,r.exp(n)]));return e}})(je)),je}var Ke,At;function Wn(){if(At)return Ke;At=1;const a=Qn();function r(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return r.prototype.initialize=function(o){this.degree=o,this.genPoly=a.generateECPolynomial(this.degree)},r.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(o.length+this.degree);e.set(o);const n=a.mod(e,this.genPoly),l=this.degree-n.length;if(l>0){const c=new Uint8Array(this.degree);return c.set(n,l),c}return n},Ke=r,Ke}var Ye={},Ge={},Je={},St;function Jt(){return St||(St=1,Je.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}),Je}var ie={},Tt;function Qt(){if(Tt)return ie;Tt=1;const a="[0-9]+",r="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r 2]))+`;ie.KANJI=new RegExp(i,"g"),ie.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ie.BYTE=new RegExp(o,"g"),ie.NUMERIC=new RegExp(a,"g"),ie.ALPHANUMERIC=new RegExp(r,"g");const e=new RegExp("^"+i+"$"),n=new RegExp("^"+a+"$"),l=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ie.testKanji=function(s){return e.test(s)},ie.testNumeric=function(s){return n.test(s)},ie.testAlphanumeric=function(s){return l.test(s)},ie}var Nt;function ye(){return Nt||(Nt=1,(function(a){const r=Jt(),i=Qt();a.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},a.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},a.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},a.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},a.MIXED={bit:-1},a.getCharCountIndicator=function(n,l){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!r.isValid(l))throw new Error("Invalid version: "+l);return l>=1&&l<10?n.ccBits[0]:l<27?n.ccBits[1]:n.ccBits[2]},a.getBestModeForData=function(n){return i.testNumeric(n)?a.NUMERIC:i.testAlphanumeric(n)?a.ALPHANUMERIC:i.testKanji(n)?a.KANJI:a.BYTE},a.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},a.isValid=function(n){return n&&n.bit&&n.ccBits};function o(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return a.NUMERIC;case"alphanumeric":return a.ALPHANUMERIC;case"kanji":return a.KANJI;case"byte":return a.BYTE;default:throw new Error("Unknown mode: "+e)}}a.from=function(n,l){if(a.isValid(n))return n;try{return o(n)}catch{return l}}})(Ge)),Ge}var Rt;function Zn(){return Rt||(Rt=1,(function(a){const r=we(),i=Gt(),o=it(),e=ye(),n=Jt(),l=7973,c=r.getBCHDigit(l);function s(w,p,N){for(let R=1;R<=40;R++)if(p<=a.getCapacity(R,N,w))return R}function h(w,p){return e.getCharCountIndicator(w,p)+4}function d(w,p){let N=0;return w.forEach(function(R){const z=h(R.mode,p);N+=z+R.getBitsLength()}),N}function _(w,p){for(let N=1;N<=40;N++)if(d(w,N)<=a.getCapacity(N,p,e.MIXED))return N}a.from=function(p,N){return n.isValid(p)?parseInt(p,10):N},a.getCapacity=function(p,N,R){if(!n.isValid(p))throw new Error("Invalid QR Code version");typeof R>"u"&&(R=e.BYTE);const z=r.getSymbolTotalCodewords(p),C=i.getTotalCodewordsCount(p,N),B=(z-C)*8;if(R===e.MIXED)return B;const E=B-h(R,p);switch(R){case e.NUMERIC:return Math.floor(E/10*3);case e.ALPHANUMERIC:return Math.floor(E/11*2);case e.KANJI:return Math.floor(E/13);case e.BYTE:default:return Math.floor(E/8)}},a.getBestVersionForData=function(p,N){let R;const z=o.from(N,o.M);if(Array.isArray(p)){if(p.length>1)return _(p,z);if(p.length===0)return 1;R=p[0]}else R=p;return s(R.mode,R.getLength(),z)},a.getEncodedBits=function(p){if(!n.isValid(p)||p<7)throw new Error("Invalid QR Code version");let N=p<<12;for(;
2r.getBCHDigit(N)-c>=0;)N^=l<<r.getBCHDigit(N)-c;return p<<12|N}})(Ye)),Ye}var Qe={},Bt;function Xn(){if(Bt)return Qe;Bt=1;const a=we(),r=1335,i=21522,o=a.getBCHDigit(r);return Qe.getEncodedBits=function(n,l){const c=n.bit<<3|l;let s=c<<10;for(;a.getBCHDigit(s)-o>=0;)s^=r<<a.getBCHDigit(s)-o;return(c<<10|s)^i},Qe}var We={},Ze,Mt;function eo(){if(Mt)return Ze;Mt=1;const a=ye();function r(i){this.mode=a.NUMERIC,this.data=i.toString()}return r.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let e,n,l;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),l=parseInt(n,10),o.put(l,10);const c=this.data.length-e;c>0&&(n=this.data.substr(e),l=parseInt(n,10),o.put(l,c*3+1))},Ze=r,Ze}var Xe,It;function to(){if(It)return Xe;It=1;const a=ye(),r=["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 i(o){this.mode=a.ALPHANUMERIC,this.data=o}return i.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;
2n+=2){let l=r.indexOf(this.data[n])*45;l+=r.indexOf(this.data[n+1]),e.put(l,11)}this.data.length%2&&e.put(r.indexOf(this.data[n]),6)},Xe=i,Xe}var et,Ut;function no(){if(Ut)return et;Ut=1;const a=ye();function r(i){this.mode=a.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return r.getBitsLength=function(o){return o*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(i){for(let o=0,e=this.data.length;o<e;o++)i.put(this.data[o],8)},et=r,et}var tt,Lt;function oo(){if(Lt)return tt;Lt=1;const a=ye(),r=we();function i(o){this.mode=a.KANJI,this.data=o}return i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let e;for(e=0;e<this.data.length;e++){let n=r.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` 3Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),o.put(n,13)}},tt=i,tt}var nt={exports:{}},Dt;function ao(){return Dt||(Dt=1,(function(a){var r={single_source_shortest_paths:function(i,o,e){var n={},l={};l[o]=0;var c=r.PriorityQueue.make();c.push(o,0);for(var s,h,d,_,w,p,N,R,z;!c.empty();){s=c.pop(),h=s.value,_=s.cost,w=i[h]||{};for(d in w)w.hasOwnProperty(d)&&(p=w[d],N=_+p,R=l[d],z=typeof l[d]>"u",(z||R>N)&&(l[d]=N,c.push(d,N),n[d]=h))}if(typeof e<"u"&&typeof l[e]>"u"){var C=["Could not find a path from ",o," to ",e,"."].join("");throw new Error(C)}return n},extract_shortest_path_from_predecessor_list:function(i,o){for(var e=[],n=o;n;)e.push(n),i[n],n=i[n];return e.reverse(),e},find_path:function(i,o,e){var n=r.single_source_shortest_paths(i,o,e);return r.extract_shortest_path_from_predecessor_list(n,e)},PriorityQueue:{make:function(i){var o=r.PriorityQueue,e={},n;i=i||{};for(n in o)o.hasOwnProperty(n)&&(e[n]=o[n]);return e.queue=[],e.sorter=i.sorter||o.default_sorter,e},default_sorter:function(i,o){return i.cost-o.cost},push:function(i,o){var e={value:i,cost:o};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};a.exports=r})(nt)),nt.exports}var $t;function ro(){return $t||($t=1,(function(a){const r=ye(),i=eo(),o=to(),e=no(),n=oo(),l=Qt(),c=we(),s=ao();function h(C){return unescape(encodeURIComponent(C)).length}function d(C,B,E){const x=[];let q;for(;(q=C.exec(E))!==null;)x.push({data:q[0],index:q.index,mode:B,length:q[0].length});return x}function _(C){const B=d(l.NUMERIC,r.NUMERIC,C),E=d(l.ALPHANUMERIC,r.ALPHANUMERIC,C);let x,q;return c.isKanjiModeEnabled()?(x=d(l.BYTE,r.BYTE,C),q=d(l.KANJI,r.KANJI,C)):(x=d(l.BYTE_KANJI,r.BYTE,C),q=[]),B.concat(E,x,q).sort(function(b,g){return b.index-g.index}).map(function(b){return{data:b.data,mode:b.mode,length:b.length}})}function w(C,B){switch(B){case r.NUMERIC:return i.getBitsLength(C);case r.ALPHANUMERIC:return o.getBitsLength(C);case r.KANJI:return n.getBitsLength(C);case r.BYTE:return e.getBitsLength(C)}}function p(C){return C.reduce(function(B,E){const x=B.length-1>=0?B[B.length-1]:null;return x&&x.mode===E.mode?(B[B.length-1].data+=E.data,B):(B.push(E),B)},[])}function N(C){const B=[];for(let E=0;E<C.length;E++){const x=C[E];switch(x.mode){case r.NUMERIC:B.push([x,{data:x.data,mode:r.ALPHANUMERIC,length:x.length},{data:x.data,mode:r.BYTE,length:x.length}]);break;case r.ALPHANUMERIC:B.push([x,{data:x.data,mode:r.BYTE,length:x.length}]);break;case r.KANJI:B.push([x,{data:x.data,mode:r.BYTE,length:h(x.data)}]);break;case r.BYTE:B.push([{data:x.data,mode:r.BYTE,length:h(x.data)}])}}return B}function R(C,B){const E={},x={start:{}};let q=["start"];for(let y=0;y<C.length;y++){const b=C[y],g=[];for(let v=0;v<b.length;v++){const k=b[v],P=""+y+v;g.push(P),E[P]={node:k,lastCount:0},x[P]={};for(let S=0;S<q.length;S++){const A=q[S];E[A]&&E[A].node.mode===k.mode?(x[A][P]=w(E[A].lastCount+k.length,k.mode)-w(E[A].lastCount,k.mode),E[A].lastCount+=k.length):(E[A]&&(E[A].lastCount=k.length),x[A][P]=w(k.length,k.mode)+4+r.getCharCountIndicator(k.mode,B))}}q=g}for(let y=0;y<q.length;y++)x[q[y]].end=0;return{map:x,table:E}}function z(C,B){let E;const x=r.getBestModeForData(C);if(E=r.from(B,x),E!==r.BYTE&&E.bit<x.bit)throw new Error('"'+C+'" cannot be encoded with mode '+r.toString(E)+`. 4 Suggested mode is: `+r.toString(x));switch(E===r.KANJI&&!c.isKanjiModeEnabled()&&(E=r.BYTE),E){case r.NUMERIC:return new i(C);case r.ALPHANUMERIC:return new o(C);case r.KANJI:return new n(C);case r.BYTE:return new e(C)}}a.fromArray=function(B){return B.reduce(function(E,x){return typeof x=="str
4ing"?E.push(z(x,null)):x.data&&E.push(z(x.data,x.mode)),E},[])},a.fromString=function(B,E){const x=_(B,c.isKanjiModeEnabled()),q=N(x),y=R(q,E),b=s.find_path(y.map,"start","end"),g=[];for(let v=1;v<b.length-1;v++)g.push(y.table[b[v]].node);return a.fromArray(p(g))},a.rawSplit=function(B){return a.fromArray(_(B,c.isKanjiModeEnabled()))}})(We)),We}var Ft;function so(){if(Ft)return $e;Ft=1;const a=we(),r=it(),i=Hn(),o=jn(),e=Kn(),n=Yn(),l=Gn(),c=Gt(),s=Wn(),h=Zn(),d=Xn(),_=ye(),w=ro();function p(y,b){const g=y.size,v=n.getPositions(b);for(let k=0;k<v.length;k++){const P=v[k][0],S=v[k][1];for(let A=-1;A<=7;A++)if(!(P+A<=-1||g<=P+A))for(let I=-1;I<=7;I++)S+I<=-1||g<=S+I||(A>=0&&A<=6&&(I===0||I===6)||I>=0&&I<=6&&(A===0||A===6)||A>=2&&A<=4&&I>=2&&I<=4?y.set(P+A,S+I,!0,!0):y.set(P+A,S+I,!1,!0))}}function N(y){const b=y.size;for(let g=8;g<b-8;g++){const v=g%2===0;y.set(g,6,v,!0),y.set(6,g,v,!0)}}function R(y,b){const g=e.getPositions(b);for(let v=0;v<g.length;v++){const k=g[v][0],P=g[v][1];for(let S=-2;S<=2;S++)for(let A=-2;A<=2;A++)S===-2||S===2||A===-2||A===2||S===0&&A===0?y.set(k+S,P+A,!0,!0):y.set(k+S,P+A,!1,!0)}}function z(y,b){const g=y.size,v=h.getEncodedBits(b);let k,P,S;for(let A=0;A<18;A++)k=Math.floor(A/3),P=A%3+g-8-3,S=(v>>A&1)===1,y.set(k,P,S,!0),y.set(P,k,S,!0)}function C(y,b,g){const v=y.size,k=d.getEncodedBits(b,g);let P,S;for(P=0;P<15;P++)S=(k>>P&1)===1,P<6?y.set(P,8,S,!0):P<8?y.set(P+1,8,S,!0):y.set(v-15+P,8,S,!0),P<8?y.set(8,v-P-1,S,!0):P<9?y.set(8,15-P-1+1,S,!0):y.set(8,15-P-1,S,!0);y.set(v-8,8,1,!0)}function B(y,b){const g=y.size;let v=-1,k=g-1,P=7,S=0;for(let A=g-1;A>0;A-=2)for(A===6&&A--;;){for(let I=0;I<2;I++)if(!y.isReserved(k,A-I)){let ee=!1;S<b.length&&(ee=(b[S]>>>P&1)===1),y.set(k,A-I,ee),P--,P===-1&&(S++,P=7)}if(k+=v,k<0||g<=k){k-=v,v=-v;break}}}function E(y,b,g){const v=new i;g.forEach(function(I){v.put(I.mode.bit,4),v.put(I.getLength(),_.getCharCountIndicator(I.mode,y)),I.write(v)});const k=a.getSymbolTotalCodewords(y),P=c.getTotalCodewordsCount(y,b),S=(k-P)*8;for(v.getLengthInBits()+4<=S&&v.put(0,4);v.getLengthInBits()%8!==0;)v.putBit(0);const A=(S-v.getLengthInBits())/8;for(let I=0;I<A;I++)v.put(I%2?17:236,8);return x(v,y,b)}function x(y,b,g){const v=a.getSymbolTotalCodewords(b),k=c.getTotalCodewordsCount(b,g),P=v-k,S=c.getBlocksCount(b,g),A=v%S,I=S-A,ee=Math.floor(v/S),ae=Math.floor(P/S),_e=ae+1,O=ee-ae,Q=new s(O);let de=0;const re=new Array(S),fe=new Array(S);let pe=0;const j=new Uint8Array(y.buffer);for(let ne=0;ne<S;ne++){const ge=ne<I?ae:_e;re[ne]=j.slice(de,de+ge),fe[ne]=Q.encode(re[ne]),de+=ge,pe=Math.max(pe,ge)}const he=new Uint8Array(v);let me=0,W,Z;for(W=0;W<pe;W++)for(Z=0;Z<S;Z++)W<re[Z].length&&(he[me++]=re[Z][W]);for(W=0;W<O;W++)for(Z=0;Z<S;Z++)he[me++]=fe[Z][W];return he}function q(y,b,g,v){let k;if(Array.isArray(y))k=w.fromArray(y);else if(typeof y=="string"){let ee=b;if(!ee){const ae=w.rawSplit(y);ee=h.getBestVersionForData(ae,g)}k=w.fromString(y,ee||40)}else throw new Error("Invalid data");const P=h.getBestVersionForData(k,g);if(!P)throw new Error("The amount of data is too big to be stored in a QR Code");if(!b)b=P;else if(b<P)throw new Error(` 5The chosen QR Code version cannot contain this amount of data. 6Minimum version required to store current data is: `+P+`. 7`);const S=E(b,g,k),A=a.getSymbolSize(b),I=new o(A);return p(I,b),N(I),R(I,b),C(I,g,0),b>=7&&z(I,b),B(I,S),isNaN(v)&&(v=l.getBestMask(I,C.bind(null,I,g))),l.applyMask(v,I),C(I,g,v),{modules:I,version:b,errorCorrectionLevel:g,maskPattern:v,segments:k}}return $e.create=function(b,g){if(typeof b>"u"||b==="")throw new Error("No input text");let v=r.M,k,P;return typeof g<"u"&&(v=r.from(g.errorCorrectionLevel,r.M),k=h.from(g.version),P=l.from(g.maskPattern),g.toSJISFunc&&a.setToSJISFunction(g.toSJISFunc)),q(b,k,v,P)},$e}var ot={},at={},Vt;function Wt(){return Vt||(Vt=1,(function(a){function r(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let o=i.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+i);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(n){return[n,n]}))),o.length===6&&o.push("F","F");const e=parseInt(o.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+o.slice(0,6).join("")}}a.getOptions=function(o){o||(o={}),o.color||(o.color={});const e=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,n=o.width&&o.width>=21?o.width:void 0,l=o.scale||4;
7return{width:n,scale:n?4:l,margin:e,color:{dark:r(o.color.dark||"#000000ff"),light:r(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},a.getScale=function(o,e){return e.width&&e.width>=o+e.margin*2?e.width/(o+e.margin*2):e.scale},a.getImageWidth=function(o,e){const n=a.getScale(o,e);return Math.floor((o+e.margin*2)*n)},a.qrToImageData=function(o,e,n){const l=e.modules.size,c=e.modules.data,s=a.getScale(l,n),h=Math.floor((l+n.margin*2)*s),d=n.margin*s,_=[n.color.light,n.color.dark];for(let w=0;w<h;w++)for(let p=0;p<h;p++){let N=(w*h+p)*4,R=n.color.light;if(w>=d&&p>=d&&w<h-d&&p<h-d){const z=Math.floor((w-d)/s),C=Math.floor((p-d)/s);R=_[c[z*l+C]?1:0]}o[N++]=R.r,o[N++]=R.g,o[N++]=R.b,o[N]=R.a}}})(at)),at}var zt;function io(){return zt||(zt=1,(function(a){const r=Wt();function i(e,n,l){e.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=l,n.width=l,n.style.height=l+"px",n.style.width=l+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}a.render=function(n,l,c){let s=c,h=l;typeof s>"u"&&(!l||!l.getContext)&&(s=l,l=void 0),l||(h=o()),s=r.getOptions(s);const d=r.getImageWidth(n.modules.size,s),_=h.getContext("2d"),w=_.createImageData(d,d);return r.qrToImageData(w.data,n,s),i(_,h,d),_.putImageData(w,0,0),h},a.renderToDataURL=function(n,l,c){let s=c;typeof s>"u"&&(!l||!l.getContext)&&(s=l,l=void 0),s||(s={});const h=a.render(n,l,s),d=s.type||"image/png",_=s.rendererOpts||{};return h.toDataURL(d,_.quality)}})(ot)),ot}var rt={},qt;function lo(){if(qt)return rt;qt=1;const a=Wt();function r(e,n){const l=e.a/255,c=n+'="'+e.hex+'"';return l<1?c+" "+n+'-opacity="'+l.toFixed(2).slice(1)+'"':c}function i(e,n,l){let c=e+n;return typeof l<"u"&&(c+=" "+l),c}function o(e,n,l){let c="",s=0,h=!1,d=0;for(let _=0;_<e.length;_++){const w=Math.floor(_%n),p=Math.floor(_/n);!w&&!h&&(h=!0),e[_]?(d++,_>0&&w>0&&e[_-1]||(c+=h?i("M",w+l,.5+p+l):i("m",s,0),s=0,h=!1),w+1<n&&e[_+1]||(c+=i("h",d),d=0)):s++}return c}return rt.render=function(n,l,c){const s=a.getOptions(l),h=n.modules.size,d=n.modules.data,_=h+s.margin*2,w=s.color.light.a?"<path "+r(s.color.light,"fill")+' d="M0 0h'+_+"v"+_+'H0z"/>':"",p="<path "+r(s.color.dark,"stroke")+' d="'+o(d,h,s.margin)+'"/>',N='viewBox="0 0 '+_+" "+_+'"',z='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+N+' shape-rendering="crispEdges">'+w+p+`</svg> 8`;return typeof c=="function"&&c(null,z),z},rt}var Ot;function uo(){if(Ot)return be;Ot=1;const a=On(),r=so(),i=io(),o=lo();function e(n,l,c,s,h){const d=[].slice.call(arguments,1),_=d.length,w=typeof d[_-1]=="function";if(!w&&!a())throw new Error("Callback required as last argument");if(w){if(_<2)throw new Error("Too few arguments provided");_===2?(h=c,c=l,l=s=void 0):_===3&&(l.getContext&&typeof h>"u"?(h=s,s=void 0):(h=s,s=c,c=l,l=void 0))}else{if(_<1)throw new Error("Too few arguments provided");return _===1?(c=l,l=s=void 0):_===2&&!l.getContext&&(s=c,c=l,l=void 0),new Promise(function(p,N){try{const R=r.create(c,s);p(n(R,l,s))}catch(R){N(R)}})}try{const p=r.create(c,s);h(null,n(p,l,s))}catch(p){h(p)}}return be.create=r.create,be.toCanvas=e.bind(null,i.render),be.toDataURL=e.bind(null,i.renderToDataURL),be.toString=e.bind(null,function(n,l,c){return o.render(n,c)}),be}var co=uo();const fo=Dn(co),po={key:0,class:"xn-account-plan-warning","data-testid":"two-factor-upgrade"},ho={class:"xn-profile-section-head xn-profile-section-head--solo"},go={class:"xn-profile-section-head__main"},vo={class:"xn-profile-section-head__icon","aria-hidden":"true"},mo={class:"xn-profile-section-body"},wo={key:0,class:"text-sm text-red-600 dark:text-red-400",role:"alert"},yo={key:1,class:"text-sm text-gray-500 dark:text-gray-400"},_o={key:2,class:"xn-account-form max-w-xl","data-testid":"two-factor-reauth-gate"},bo={class:"xn-profile-panel-row__desc"},xo={key:0,class:"text-sm text-red-600 dark:text-red-400",role:"alert"},Co={class:"xn-account-actions"},ko=["disabled"],Eo=["disabled"],Po={class:"flex flex-col gap-2 xs:flex-row"},Ao=["disabled","data-testid","onClick"],So={key:0,class:"text-sm text-red-600 dark:text-red-400",role:"alert"},To={class:"xn-account-actions"},No=["disabled"],Ro={key:3,"data-testid":"two-factor-codes"},Bo={class:"my-4 grid grid-cols-2 gap-2 font-mono text-sm","aria-label":"Recovery codes"},Mo={class:"xn-account-actions !justify-start"},Io={class:"mt-4 flex items-start gap-2.5 text-sm text-gray-700 dark:text-gray-300"},Uo={class:"mt-4 xn-account-actions"},Lo=["disabled"],Do={key:4,class:"xn-account-form max-w-xl","data-testid":"two-factor-setup"},$o={class:"flex flex-col items-start gap-4 sm:flex-row"},Fo=["src"],Vo={key:1,class:"flex h-44 w-44 shrink-0 items-center justify-center text-sm text-gray-500"},zo={class:"min-w-0 flex-1"},qo={class:"break-all rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 font-mono text-sm tracking-wider text-gray-900 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","data-testid":"two-factor-secret"},Oo={class:"max-w-xs"},Ho={key:0,class:"text-sm text-red-600 dark:text-red-400",role:"alert"},jo={class:"xn-account-actions"},Ko=["disabled"],Yo=["disabled"],Go={key:5,class:"xn-account-form max-w-xl"},Jo={class:"xn-profile-panel-row__title"},Qo={class:"xn-profile-panel-row__desc"},Wo=["disabled"],Zo={key:0,class:"text-sm text-red-600 dark:text-red-400",role:"alert"},Xo={class:"xn-account-actions"},ea=["disabled"],ta=["disabled"],na={class:"xn-profile-panel-row"},oa={class:"xn-profile-panel-row__body"},aa={class:"xn-profile-panel-row__desc"},ra={class:"xn-profile-panel-row"},sa={class:"xn-profile-panel-row__body"},ia={class:"xn-profile-panel-row__desc","data-testid":"two-factor-remaining"},la={key:0,class:"xn-profile-status-badge xn-profile-status-badge--warning"},ua={key:0,class:"mt-3 text-xs text-gray-500 dark:text-gray-400"},ca={class:"mt-4 xn-account-actions !justify-start"},da={key:0,class:"mt-3 text-sm text-red-600 dark:text-red-400",role:"alert"},fa={class:"mt-4 xn-account-actions !justify-start"},pa=["disabled","title"],ha={__name:"TwoFactorAuthCard",props:{authProvider:{type:String,default:"local"},linkedAuthProviders:{type:Array,default:()=>[]}},emits:["updated"],setup(a,{emit:r}){const i=a,o=r,e=kn(),n=Kt(),{showSuccess:l,showError:c}=Yt(),s=V({enabled:!1,planAllowed:!1,recoveryCodesRemaining:0,enabledAt:null,hasPassword:!1}),h=V(!0),d=V(""),_=V(!1),w=V(""),p=V("idle"),N=V(""),R=V(""),z=V(""),C=V(""),B=V([]),E=V(!1),x=V(!1),q=V(""),y=V(""),b=V(""),g=V(!1),v=V(""),k=D(()=>s.value.hasPassword===!0),P=D(()=>{const T=new Set;i.authProvider&&i.authProvider!=="local"&&T.add(i.authProvider);for(const m of i.linkedAuthProviders||[])T.add(m);return[...T].filter(m=>m==="google"||m==="apple")}
8),S=D(()=>!h.value&&!s.value.planAllowed&&!s.value.enabled),A=D(()=>En(null,"two-step verification")),I=D(()=>N.value.replace(/(.{4})/g,"$1 ").trim()),ee=D(()=>{const T=s.value.enabledAt?new Date(s.value.enabledAt):null;return T&&!Number.isNaN(T.getTime())?`On since ${T.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}`:"On"}),ae=D(()=>{const T=s.value.recoveryCodesRemaining;return T===0?"No recovery codes left â generate new ones.":`${T} unused ${T===1?"code":"codes"} left.`});async function _e(){h.value=!0,d.value="";try{const T=await J.getTwoFactorStatus();s.value={...s.value,...T.twoFactor}}catch(T){d.value=oe(T)||"Could not load two-step verification."}finally{h.value=!1}}function O(){w.value="",z.value="",C.value=""}function Q(){q.value="",y.value="",b.value="",g.value=!1,v.value=""}function de(T){Q(),y.value=T,p.value="reauth"}function re(){p.value="idle",Q()}async function fe(){y.value==="enable"?await he():y.value==="disable"&&(O(),p.value="disable")}async function pe(){if(!(g.value||!b.value)){g.value=!0,v.value="";try{const T=await J.reauthWithPassword({password:b.value});q.value=T.reauthToken,b.value="",await fe()}catch(T){v.value=oe(T)||"Incorrect password."}finally{g.value=!1}}}async function j(T){if(!g.value){v.value="",g.value=!0;try{const m=await Vn(T,y.value||"enable");m&&(q.value=m,await fe())}catch(m){v.value=oe(m)||`Could not confirm with ${T==="apple"?"Apple":"Google"}.`}finally{g.value=!1}}}async function he(){_.value=!0,w.value="";try{const T=await J.setupTwoFactor({reauthToken:q.value});N.value=T.secret,R.value=await fo.toDataURL(T.otpauthUri,{width:176,margin:1}),O(),p.value="setup"}catch(T){p.value="idle",w.value=oe(T)||"Could not start setup. Please try again.",Q()}finally{_.value=!1}}function me(){p.value="idle",N.value="",R.value="",O(),Q(),J.cancelTwoFactorSetup().catch(()=>{})}async function W(){_.value=!0,w.value="";try{const T=await J.enableTwoFactor({code:z.value,reauthToken:q.value});B.value=T.recoveryCodes||[],E.value=!1,N.value="",R.value="",O(),Q(),p.value="codes",s.value={...s.value,enabled:!0,enabledAt:new Date().toISOString(),recoveryCodesRemaining:B.value.length},o("updated",T.user||null),l("Two-step verification is on")}catch(T){w.value=oe(T)||"Could not turn on two-step verification.",z.value=""}finally{_.value=!1}}function Z(T){O(),p.value=T}function ne(){p.value="idle",O(),Q()}async function ge(){if(!(_.value||!C.value.trim())){_.value=!0,w.value="";try{if(p.value==="disable"){const T=await J.disableTwoFactor({code:C.value.trim(),reauthToken:q.value});s.value={...s.value,enabled:!1,enabledAt:null,recoveryCodesRemaining:0},o("updated",T.user||null),l("Two-step verification is off"),ne()}else{const T=await J.regenerateTwoFactorRecoveryCodes({code:C.value.trim()});B.value=T.recoveryCodes||[],E.value=!1,s.value={...s.value,recoveryCodesRemaining:B.value.length},O(),p.value="codes"}}catch(T){w.value=oe(T)||"That did not work. Please try again."}finally{_.value=!1}}}function Ce(){return["XpressNotes recovery codes","Each code can be used once if you lose access to your authenticator app.","",...B.value,""].join(` 9`)}async function Ne(){try{await navigator.clipboard.writeText(Ce()),x.value=!0,setTimeout(()=>{x.value=!1},2e3)}catch{c("Could not copy. Select the codes and copy them manually.")}}function Re(){const T=new Blob([Ce()],{type:"text/plain"}),m=URL.createObjectURL(T),ue=document.createElement("a");ue.href=m,ue.download="xpressnotes-recovery-codes.txt",document.body.appendChild(ue),ue.click(),ue.remove(),URL.revokeObjectURL(m)}function Be(){B.value=[],E.value=!1,p.value="idle"}return Ht(async()=>{await _e();const T=Fn(e,n);T&&(q.value=T.reauthToken,y.value=T.intent,await fe())}),(T,m)=>{const ue=jt("router-link");return L(),$("div",{class:le(["card min-w-0",{"xn-account-card--disabled":S.value}]),"data-testid":"two-factor-card"},[S.value?(L(),$("p",po,[m[8]||(m[8]=Y(" Not included in your plan. ",-1)),H(ue,{to:"/account/subscription",class:"font-medium underline hover:no-underline"},{default:xe(()=>[...m[7]||(m[7]=[Y(" Upgrade your subscription ",-1)])]),_:1}),m[9]||(m[9]=Y(" to use two-step verification. ",-1))])):G("",!0),t("div",ho,[t("div",go,[t("span",vo,[H(te,{name:"shield",size:20})]),m[10]||(m[10]=t("div",{class:"min-w-0"},[t("h3",{class:"xn-profile-section-head__title"},"Two-step verification"),t("p",{class:"xn-profile-section-head__desc"}," Require a code from an authenticator app whenever you sign in. ")],-1))])]),t("div",mo,[d.value?(L(),$("p",wo,[Y(M(d.value)+" ",1),t("button",{type:"button",class:"xn-account-link-action ml-1",onClick:_e},"Try again")])):h.value?(L(),$("p",yo,"Loadingâ¦")):p.value==="reauth"?(L(),$("div",_o,[t("div",null,[m[11]||(m[11]=t("p",{class:"xn-profile-panel-row__title"},"Confirm it's you",-1)),t("p",bo,M(y.value==="enable"?"For your security, confirm it's you before setting up two-step verification.":"For your security, confirm it's you before turning off two-step verification."),1)]),k.value?(L(),$(ce,{key:0},[t("div",null,[m[12]||(m[12]=t("label",{class:"xn-account-field-label",for:"xn-2fa-reauth-password"},"Account password",-1)),H(Ae,{"input-id":"xn-2fa-reauth-password",modelValue:b.value,"onUpdate:modelValue":m[0]||(m[0]=K=>b.value=K),variant:"app",autocomplete:"current-password",placeholder:"Enter your password",autofocus:"",onKeyup:ut(pe,["enter"])},null,8,["modelValue"])]),v.value?(L(),$("p",xo,M(v.value),1)):G("",!0),t("div",Co,[t("button",{type:"button",class:"btn-account-secondary",disabled:g.value,onClick:re}
9," Cancel ",8,ko),t("button",{type:"button",class:"btn-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:g.value||!b.value,onClick:pe},M(g.value?"Verifyingâ¦":"Continue"),9,Eo)])],64)):(L(),$(ce,{key:1},[m[13]||(m[13]=t("p",{class:"xn-account-field-hint"},"Your account has no password â sign in again to confirm.",-1)),t("div",Po,[(L(!0),$(ce,null,Se(P.value,K=>(L(),$("button",{key:K,type:"button",class:"btn-account-outline-primary",disabled:g.value,"data-testid":`two-factor-reauth-${K}`,onClick:se=>j(K)},M(g.value?"Confirmingâ¦":`Continue with ${K==="apple"?"Apple":"Google"}`),9,Ao))),128))]),v.value?(L(),$("p",So,M(v.value),1)):G("",!0),t("div",To,[t("button",{type:"button",class:"btn-account-secondary",disabled:g.value,onClick:re}," Cancel ",8,No)])],64))])):p.value==="codes"?(L(),$("div",Ro,[m[16]||(m[16]=t("p",{class:"xn-profile-panel-row__title"},"Save your recovery codes",-1)),m[17]||(m[17]=t("p",{class:"xn-profile-panel-row__desc"}," Each code works once if you lose your authenticator. Store them somewhere safe â you won't see them again. ",-1)),t("ul",Bo,[(L(!0),$(ce,null,Se(B.value,K=>(L(),$("li",{key:K,class:"rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-center tracking-wider text-gray-900 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"},M(K),1))),128))]),t("div",Mo,[t("button",{type:"button",class:"btn-account-outline-primary",onClick:Ne},[H(te,{name:"copy",size:16,class:"mr-1 inline-block align-[-3px]"}),Y(" "+M(x.value?"Copied":"Copy"),1)]),t("button",{type:"button",class:"btn-account-outline-primary",onClick:Re},[H(te,{name:"download",size:16,class:"mr-1 inline-block align-[-3px]"}),m[14]||(m[14]=Y(" Download ",-1))])]),t("label",Io,[Te(t("input",{"onUpdate:modelValue":m[1]||(m[1]=K=>E.value=K),type:"checkbox",class:"mt-0.5 h-5 w-5 shrink-0 cursor-pointer accent-xn-primary","data-testid":"two-factor-saved-ack"},null,512),[[_n,E.value]]),m[15]||(m[15]=t("span",null,"I've saved these recovery codes somewhere safe.",-1))]),t("div",Uo,[t("button",{type:"button",class:"btn-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:!E.value,onClick:Be}," Done ",8,Lo)])])):p.value==="setup"?(L(),$("div",Do,[m[21]||(m[21]=t("ol",{class:"list-decimal space-y-1 pl-5 text-sm text-gray-700 dark:text-gray-300"},[t("li",null,"Open an authenticator app (Google Authenticator, Authy, 1Passwordâ¦)."),t("li",null,"Scan this QR code, or enter the key manually."),t("li",null,"Type the 6-digit code the app shows.")],-1)),t("div",$o,[R.value?(L(),$("img",{key:0,src:R.value,width:"176",height:"176",alt:"QR code for your authenticator app",class:"shrink-0 rounded-lg border border-gray-200 bg-white p-2 dark:border-gray-600"},null,8,Fo)):(L(),$("div",Vo," Preparing QR code⦠")),t("div",zo,[m[18]||(m[18]=t("p",{class:"xn-account-field-label"},"Setup key",-1)),t("p",qo,M(I.value),1),m[19]||(m[19]=t("p",{class:"xn-account-field-hint"}," Can't scan the QR code? Enter this key manually in your authenticator app instead. Keep it private. ",-1))])]),t("div",null,[m[20]||(m[20]=t("label",{class:"xn-account-field-label",for:"xn-2fa-setup-code"},"Authentication code",-1)),t("div",Oo,[H($n,{id:"xn-2fa-setup-code",modelValue:z.value,"onUpdate:modelValue":m[2]||(m[2]=K=>z.value=K),masked:!1,disabled:_.value,autocomplete:"one-time-code",autofocus:""},null,8,["modelValue","disabled"])])]),w.value?(L(),$("p",Ho,M(w.value),1)):G("",!0),t("div",jo,[t("button",{type:"button",class:"btn-account-secondary",disabled:_.value,onClick:me}," Cancel ",8,Ko),t("button",{type:"button",class:"btn-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:_.value||z.value.length!==6,onClick:W},M(_.value?"Turning onâ¦":"Turn on"),9,Yo)])])):p.value==="disable"||p.value==="regenerate"?(L(),$("div",Go,[t("div",null,[t("p",Jo,M(p.value==="disable"?"Turn off two-step verification":"Generate new recovery codes"),1),t("p",Qo,M(p.value==="disable"?"Your account will be protected by your sign-in method alone.":"Your current recovery codes will stop working."),1)]),t("div",null,[m[22]||(m[22]=t("label",{class:"xn-account-field-label",for:"xn-2fa-manage-code"},"Authenticator or recovery code",-1)),Te(t("input",{id:"xn-2fa-manage-code","onUpdate:modelValue":m[3]||(m[3]=K=>C.value=K),type:"text",class:"xn-account-input",placeholder:"123456 or xxxxx-xxxxx",autocomplete:"one-time-code",autocapitalize:"off",spellcheck:"false",disabled:_.value,onKeyup:ut(ge,["enter"])},null,40,Wo),[[st,C.value]])]),w.value?(L(),$("p",Zo,M(w.value),1)):G("",!0),t("div",Xo,[t("button",{type:"button",class:"btn-account-secondary",disabled:_.value,onClick:ne}
9," Cancel ",8,ea),t("button",{type:"button",class:le([p.value==="disable"?"btn-account-danger":"btn-primary","disabled:cursor-not-allowed disabled:opacity-50"]),disabled:_.value||!C.value.trim(),onClick:ge},M(_.value?"Workingâ¦":p.value==="disable"?"Turn off":"Generate codes"),11,ta)])])):s.value.enabled?(L(),$(ce,{key:6},[t("div",na,[t("div",oa,[m[23]||(m[23]=t("p",{class:"xn-profile-panel-row__title"},"Authenticator app",-1)),t("p",aa,M(ee.value),1)]),m[24]||(m[24]=t("span",{class:"xn-profile-status-badge xn-profile-status-badge--success"},"On",-1))]),t("div",ra,[t("div",sa,[m[25]||(m[25]=t("p",{class:"xn-profile-panel-row__title"},"Recovery codes",-1)),t("p",ia,M(ae.value),1)]),s.value.recoveryCodesRemaining<=2?(L(),$("span",la," Running low ")):G("",!0)]),s.value.planAllowed?G("",!0):(L(),$("p",ua," Your current plan doesn't include two-step verification. It stays on until you turn it off, but you can't turn it back on without upgrading. ")),t("div",ca,[t("button",{type:"button",class:"btn-account-outline-primary",onClick:m[4]||(m[4]=K=>Z("regenerate"))}," New recovery codes "),t("button",{type:"button",class:"btn-account-outline-danger",onClick:m[5]||(m[5]=K=>de("disable"))}," Turn off ")])],64)):(L(),$(ce,{key:7},[m[26]||(m[26]=bn('<div class="xn-profile-panel-row"><div class="xn-profile-panel-row__body"><p class="xn-profile-panel-row__title">Authenticator app</p><p class="xn-profile-panel-row__desc"> Adds a second step to every sign-in, so a stolen password alone can't open your notes. </p></div><span class="xn-profile-status-badge xn-profile-status-badge--muted">Off</span></div>',1)),w.value?(L(),$("p",da,M(w.value),1)):G("",!0),t("div",fa,[t("button",{type:"button",class:"btn-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:!s.value.planAllowed||_.value,title:s.value.planAllowed?void 0:A.value,"data-testid":"two-factor-turn-on",onClick:m[6]||(m[6]=K=>de("enable"))},M(_.value?"Startingâ¦":"Set up"),9,pa)])],64))])],2)}}},ga={key:0,class:"flex justify-center items-center py-12","aria-busy":"true"},va={key:1,class:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mb-6"},ma={class:"text-red-800 dark:text-red-200"},wa={key:2,class:"space-y-5 min-w-0 max-w-full"},ya={class:"xn-profile-hero min-w-0"},_a={class:"xn-profile-hero__inner"},ba=["disabled","aria-expanded"],xa={class:"xn-profile-avatar__overlay"},Ca=["disabled"],ka=["disabled"],Ea={class:"flex-1 min-w-0 text-center sm:text-left"},Pa={class:"xn-profile-hero__name"},Aa={class:"xn-profile-hero__email"},Sa={class:"xn-profile-hero__badges"},Ta={class:"xn-profile-badge xn-profile-badge--plan"},Na=["title"],Ra={class:"xn-profile-badge xn-profile-badge--muted"},Ba={class:"card min-w-0"},Ma={class:"xn-profile-section-head xn-profile-section-head--solo"},Ia={class:"xn-profile-section-head__main"},Ua={class:"xn-profile-section-head__icon","aria-hidden":"true"},La={key:0,class:"xn-profile-section-head__actions !hidden sm:!flex"},Da={class:"xn-profile-section-body"},$a={class:"xn-profile-dl"},Fa={class:"xn-profile-dl__row"},Va={class:"xn-profile-dl__value"},za={class:"xn-profile-dl__row"},qa={class:"xn-profile-dl__value"},Oa={class:"xn-profile-dl__row"},Ha={class:"xn-profile-dl__value break-all"},ja={class:"xn-profile-dl__row"},Ka={class:"xn-profile-dl__row"},Ya={class:"xn-profile-dl__value"},Ga={key:1,class:"xn-account-form"},Ja={class:"grid grid-cols-1 md:grid-cols-2 gap-5 min-w-0"},Qa={class:"min-w-0"},Wa={class:"min-w-0"},Za={class:"min-w-0"},Xa={class:"xn-account-field-value break-all"},er={class:"grid grid-cols-1 md:grid-cols-2 gap-5 min-w-0"},tr={class:"min-w-0"},nr={class:"min-w-0"},or={class:"xn-account-actions"},ar=["disabled"],rr={class:"card min-w-0"},sr={class:"xn-profile-section-head xn-profile-section-head--solo"},ir={class:"xn-profile-section-head__main"},lr={class:"xn-profile-section-head__icon","aria-hidden":"true"},ur={class:"min-w-0"},cr={class:"xn-profile-section-head__title"},dr={class:"xn-profile-section-head__desc"},fr={class:"xn-profile-section-body xn-profile-password-body"},pr={class:"xn-profile-password-grid"},hr={class:"xn-profile-password-form"},gr={class:"xn-account-form"},vr={key:0},mr={class:"xn-profile-password-art","aria-hidden":"true"},wr={class:"xn-profile-password-art__scene"},yr={class:"xn-profile-password-art__card-stack"},_r={class:"xn-profile-password-art__card"},br={class:"xn-profile-password-art__dots"},xr={class:"mt-4 xn-account-actions"},Cr=["disabled"],kr={class:"card min-w-0"},Er={class:"xn-profile-section-head xn-profile-section-head--solo"},Pr={class:"xn-profile-section-head__main"},Ar={class:"xn-profile-section-head__icon","aria-hidden":"true"},Sr={class:"xn-profile-section-body"},Tr={class:"xn-profile-panel-row"},Nr={class:"xn-profile-panel-row__body"},Rr=["disabled"],Br={class:"xn-profile-panel-row__body"},Mr={class:"xn-profile-panel-row__title"},Ir={class:"xn-profile-panel-row__desc"},Ur={class:"card min-w-0 xn-profile-delete-card"},Lr={class:"xn-profile-section-head xn-profile-section-head--solo"},Dr={class:"xn-profile-section-head__main"},$r={class:"xn-profile-section-head__icon xn-profile-section-head__icon--danger","aria-hidden":"true"},Fr={class:"xn-profile-section-body"},Vr={class:"xn-account-card-desc list-disc space-y-1.5 pl-5"},zr={key:0,class:"mt-4 text-sm text-red-700 dark:text-red-300 leading-relaxed"},qr={key:1,class:"mt-5 xn-account-actions"},Or=["disabled"],ys={__name:"Profile",setup(a,{expose:r}){const i=Kt(),o=V(null);r({openSidebar:()=>{o.value?.openMenu?.()}});const{showSuccess:e,showError:n}=Yt(),{showDialog:l,closeDialog:c}=Mn();function s(f){return f?{...f,emailVerified:f.emailVerified===!0,country:f.country||"",timezone:f.timezone||"UTC",preferences:f.preferences||{theme:"light",fontSize:16,diaryDateFormat:"iso"}}:null}const h=dt(),d=V(s(h)),_=Pn(),w=V(!h),p=V(null),N=V(null),R=V(!1),z=V(!1),C=V(!1),B=V(!1),E=V(!1),x=V(!1),q=V(null),y=V(null),b=V(!1),g=D(()=>d.value?.emailVerified===!0),v=D(()=>d.value?.deletionPending===!0),k=D(()=>d.value?.hasPassword===!0),P=D(()=>k.value?"Change Password":"Set Password"),S=D(()=>k.value?"Choose a strong password to keep your account secure.":"Add a password so you can sign in with your email as well as Google or Apple."),A=D(()=>C.value?k.value?"Changingâ¦":"Settingâ¦":k.value?"Change Password":"Set Password"),I=D(()=>{const f=d.value?.linkedAuthProviders;if(Array.isArray(f)&&f.length>0)return f.map(F=>String(F).toLowerCase());const u=String(d.value?.authProvider||"").toLowerCase();return u&&u!=="local"&&u!=="guest"?[u]:[]}),ee=D(()=>{const f=new Set(I.value);return[{id:"google",label:"Google",connected:f.has("google")},{id:"apple",label:"Apple",connected:f.has("apple")}]}),ae=D(()=>
9{const f=d.value?.accountDeletionGraceDays??14;return`${f} day${f===1?"":"s"}`}),_e=D(()=>d.value?.deletionScheduledFor?ft(d.value.deletionScheduledFor):"the scheduled date"),O=V({firstName:"",lastName:"",country:"",timezone:"UTC"});function Q(f){const u=(f?.firstName||"").trim(),F=(f?.lastName||"").trim();if(u||F)return{firstName:u,lastName:F};const U=(f?.name||"").trim();if(!U)return{firstName:"",lastName:""};const X=U.split(/\s+/);return X.length===1?{firstName:X[0],lastName:""}:{firstName:X[0],lastName:X.slice(1).join(" ")}}function de(f,u,F=""){return[f,u].map(X=>(X||"").trim()).filter(Boolean).join(" ")||(F||"").trim()||"User"}const re=D(()=>de(d.value?.firstName,d.value?.lastName,d.value?.name)),fe=D(()=>Q(d.value).firstName||"Not set"),pe=D(()=>Q(d.value).lastName||""),j=V({currentPassword:"",newPassword:"",confirmPassword:""}),he=D(()=>j.value.newPassword.length>=8),me=D(()=>!(!(j.value.newPassword&&j.value.confirmPassword&&j.value.newPassword.length>=8&&j.value.newPassword===j.value.confirmPassword)||k.value&&!j.value.currentPassword)),W=D(()=>{const f=gt.getAllCountries();return Object.keys(f).map(u=>({code:u,name:f[u].name})).sort((u,F)=>u.name.localeCompare(F.name))}),Z=D(()=>{const f=gt.getAllTimezones();return Object.keys(f).map(u=>{const U=f[u].utcOffset,X=Math.floor(Math.abs(U)/60),wn=Math.abs(U)%60,yn=`${U>=0?"+":"-"}${String(X).padStart(2,"0")}:${String(wn).padStart(2,"0")}`;return{value:u,label:`${u} (UTC${yn})`}}).sort((u,F)=>{const U=f[u.value],X=f[F.value];return U.utcOffset!==X.utcOffset?U.utcOffset-X.utcOffset:u.value.localeCompare(F.value)})}),ne=D(()=>W.value.map(f=>({value:f.name,label:f.name}))),ge=D(()=>Z.value),Ce=D(()=>d.value?.hasAvatar===!0&&!!d.value?.avatarViewToken),Ne=D(()=>An(d.value)),Re=D(()=>{const{firstName:f,lastName:u}=Q(d.value);if(f&&u)return(f[0]+u[0]).toUpperCase();const F=re.value;if(!F||F==="User")return"U";const U=F.split(/\s+/);return U.length>=2?(U[0][0]+U[U.length-1][0]).toUpperCase():F.substring(0,2).toUpperCase()}),Be=D(()=>(_.value,d.value?.createdAt?pt(d.value.createdAt):pt(new Date))),T=D(()=>{const f=d.value?.subscriptionPlan||"free";return f.charAt(0).toUpperCase()+f.slice(1)}),m=D(()=>String(d.value?.subscriptionPlan||"free").toLowerCase()!=="free"),ue=D(()=>N.value?.applicable===!0),K=D(()=>Number(N.value?.count)||0),se=D(()=>String(N.value?.level||"green").toLowerCase()),Zt=D(()=>se.value==="amber"?"xn-profile-badge--warning":se.value==="red"?"xn-profile-badge--danger":"xn-profile-badge--verified"),Xt=D(()=>se.value==="amber"||se.value==="red"?"alert":"check"),en=D(()=>{const f=K.value;return f===1?"1 strike":`${f} strikes`}),tn=D(()=>se.value==="amber"?"Needs attention":se.value==="red"?"At risk":"Good standing"),nn=D(()=>se.value==="green"?"Good standing":`${tn.value} · ${en.value}`),on=D(()=>se.value==="amber"?"1 strike in the last 3 months. Open Account Standing for details.":se.value==="red"?`${K.value} strikes in the last 3 months. Open Account Standing for details.`:"No moderation strikes in the last 3 months. Click for details.");function an(){i.push(Rn.standing)}async function rn(){try{const f=await J.getAccountStanding();N.value=f.standing||null}catch{N.value=null}}function sn(f){!f||!d.value||(d.value={...d.value,twoFactorEnabled:!!f.twoFactorEnabled})}const ln=async()=>{p.value=null;const f=dt();if(!f){w.value=!1,p.value="Please log in to view your profile";return}d.value=s(f),w.value=!1,rn();try{const u=await J.getCurrentUser();u?.user&&(d.value=s(u.user),Ue(Le(u.user)))}catch{}},lt=()=>{const{firstName:f,lastName:u}=Q(d.value);O.value={firstName:f,lastName:u,country:d.value?.country||"",timezone:d.value?.timezone||"UTC"},R.value=!0},un=()=>{R.value=!1,O.value={firstName:"",lastName:"",country:"",timezone:"UTC"}};function Me(f){f&&(d.value=s(f),Ue(Le(f)))}function Ee(){b.value=!1}function cn(){x.value||(b.value=!b.value)}function Ie(f){!b.value||!y.value||y.value.contains(f.target)||Ee()}function dn(){x.value||(Ee(),q.value?.click())}async function fn(f){const u=f.target?.files?.[0];if(f.target.value="",!!u){x.value=!0;try{const F=await Nn(u),U=await J.uploadAvatar(F);Me(U.user),Ee(),e("Photo updated")}
9catch(F){n(oe(F)||F.message||"Failed to upload photo")}finally{x.value=!1}}}async function pn(){if(!x.value){x.value=!0;try{const f=await J.removeAvatar();Me(f.user),Ee(),e("Photo removed")}catch(f){n(oe(f)||"Failed to remove photo")}finally{x.value=!1}}}const hn=async()=>{try{z.value=!0;const f=await J.updateProfile({firstName:O.value.firstName.trim(),lastName:O.value.lastName.trim(),country:O.value.country.trim(),timezone:O.value.timezone.trim()||"UTC"});Me(f.user),Bn(),In({changedFields:["first_name","last_name","country","timezone"]}),R.value=!1,e("Profile updated successfully")}catch(f){n(f.response?.data?.error||"Failed to update profile")}finally{z.value=!1}},gn=async()=>{B.value=!0;try{await J.resendVerificationEmail(),Un({source:"profile"}),e("Verification email sent! Please check your inbox.")}catch(f){n(oe(f)||"Failed to resend verification email. Please try again later.")}finally{B.value=!1}},vn=async()=>{if(!me.value){n("Please fill all fields and ensure passwords match");return}if(j.value.newPassword.length<8){n("Password must be at least 8 characters long");return}if(j.value.newPassword!==j.value.confirmPassword){n("Passwords do not match");return}try{C.value=!0;const f=!k.value;await J.changePassword(j.value.newPassword,k.value?j.value.currentPassword:""),j.value={currentPassword:"",newPassword:"",confirmPassword:""},d.value&&(d.value={...d.value,hasPassword:!0}),e(f?"Password set successfully":"Password changed successfully")}catch(f){const u=oe(f);n(u)}finally{C.value=!1}},mn=async()=>{const f=(d.value?.email||"").trim();let u=null;for(;;){if(u=await l({title:"Delete your account?",message:`Your account will be scheduled for permanent deletion in ${ae.value}. You can cancel anytime before then. 10 11Type your email address to confirm.`,type:"danger",input:!0,inputPlaceholder:f||"Enter your account email",confirmText:"Delete account",showCancel:!0}),c(!1),!u||typeof u!="string")return;const F=u.trim().toLowerCase();if(!f||F!==f.toLowerCase()){n("Email does not match your account");continue}break}try{E.value=!0;const F=await J.requestAccountDeletion(f);F?.user&&(d.value=F.user,Ue(Le(F.user)));const U=F?.scheduledFor||F?.user?.deletionScheduledFor||d.value?.deletionScheduledFor,X=U?ft(U):"the scheduled date";e(`Your account will be permanently deleted on ${X}. Use Cancel deletion anytime to keep your account.`)}catch(F){n(oe(F)||"Failed to schedule account deletion")}finally{E.value=!1}};return xn(b,f=>{f?document.addEventListener("pointerdown",Ie,!0):document.removeEventListener("pointerdown",Ie,!0)}),Ht(()=>{ln()}),Cn(()=>{document.removeEventListener("pointerdown",Ie,!0)}),(f,u)=>{const F=jt("router-link");return L(),ct(zn,null,{default:xe(()=>[H(Ln,{title:"Profile","show-sidebar":!1,"account-manage-chrome":!0},{"header-actions":xe(()=>[H(qn,{ref_key:"accountMobileNavRef",ref:o},null,512)]),default:xe(()=>[w.value?(L(),$("div",ga,[H(Sn)])):p.value?(L(),$("div",va,[t("p",ma,M(p.value),1)])):(L(),$("div",wa,[t("div",ya,[t("div",_a,[t("div",{ref_key:"avatarWrapRef",ref:y,class:le(["xn-profile-avatar-wrap",{"is-open":b.value}])},[t("div",{class:le(["xn-profile-avatar",{"is-busy":x.value}])},[t("button",{type:"button",class:"xn-profile-avatar__hit",disabled:x.value,"aria-expanded":b.value,"aria-label":"Photo options",onClick:cn},[H(Tn,{src:Ne.value,"img-class":"xn-profile-avatar__img"},{default:xe(()=>[Y(M(Re.value),1)]),_:1},8,["src"])],8,ba),t("div",xa,[t("button",{type:"button",class:"xn-profile-avatar__action",disabled:x.value,onClick:dn},M(Ce.value?"Replace":"Add"),9,Ca),Ce.value?(L(),$("button",{key:0,type:"button",class:"xn-profile-avatar__action",disabled:x.value,onClick:pn}," Remove ",8,ka)):G("",!0)])],2),t("input",{ref_key:"avatarInputRef",ref:q,type:"file",accept:"image/jpeg,image/png,image/webp,image/gif",class:"hidden",onChange:fn},null,544)],2),t("div",Ea,[t("h2",Pa,M(re.value),1),t("p",Aa,M(d.value?.email),1),t("div",Sa,[t("span",Ta,[m.value?(L(),ct(te,{key:0,name:"crown",size:14,class:"shrink-0"})):G("",!0),Y(" "+M(T.value)+" Plan ",1)]),t("span",{class:le(["xn-profile-badge",g.value?"xn-profile-badge--verified":"xn-profile-badge--warning"])},[H(te,{name:g.value?"check":"email",size:14,class:"shrink-0"},null,8,["name"]),Y(" Email "+M(g.value?"verified":"unverified"),
111)],2),ue.value?(L(),$("button",{key:0,type:"button",class:le(["xn-profile-badge",Zt.value]),title:on.value,onClick:an},[H(te,{name:Xt.value,size:14,class:"shrink-0"},null,8,["name"]),Y(" "+M(nn.value),1)],10,Na)):G("",!0),t("span",Ra,[H(te,{name:"diary",size:14,class:"shrink-0"}),Y(" Member since "+M(Be.value),1)])])])])]),t("div",Ba,[t("div",Ma,[t("div",Ia,[t("span",Ua,[H(te,{name:"user",size:20})]),u[7]||(u[7]=t("div",{class:"min-w-0"},[t("h3",{class:"xn-profile-section-head__title"},"Personal information"),t("p",{class:"xn-profile-section-head__desc"},"Name, location, and timezone for reminders.")],-1))]),R.value?G("",!0):(L(),$("div",La,[t("button",{type:"button",class:"btn-account-outline-primary",onClick:lt}," Edit ")]))]),t("div",Da,[R.value?(L(),$("div",Ga,[t("div",Ja,[t("div",Qa,[u[14]||(u[14]=t("label",{class:"xn-account-field-label"},"First name",-1)),Te(t("input",{"onUpdate:modelValue":u[0]||(u[0]=U=>O.value.firstName=U),type:"text",class:"xn-account-input",placeholder:"First name",autocomplete:"given-name"},null,512),[[st,O.value.firstName]])]),t("div",Wa,[u[15]||(u[15]=t("label",{class:"xn-account-field-label"},"Last name",-1)),Te(t("input",{"onUpdate:modelValue":u[1]||(u[1]=U=>O.value.lastName=U),type:"text",class:"xn-account-input",placeholder:"Last name",autocomplete:"family-name"},null,512),[[st,O.value.lastName]])])]),t("div",Za,[u[16]||(u[16]=t("label",{class:"xn-account-field-label"},"Email",-1)),t("div",Xa,M(d.value?.email),1),u[17]||(u[17]=t("p",{class:"xn-account-field-hint"},"Cannot be changed",-1))]),t("div",er,[t("div",tr,[u[18]||(u[18]=t("label",{class:"xn-account-field-label"},"Country",-1)),H(ht,{modelValue:O.value.country,"onUpdate:modelValue":u[2]||(u[2]=U=>O.value.country=U),options:ne.value,placeholder:"Select a country","search-placeholder":"Search countryâ¦","leading-icon":"diary","aria-label":"Country"},null,8,["modelValue","options"])]),t("div",nr,[u[19]||(u[19]=t("label",{class:"xn-account-field-label"},"Timezone",-1)),H(ht,{modelValue:O.value.timezone,"onUpdate:modelValue":u[3]||(u[3]=U=>O.value.timezone=U),options:ge.value,placeholder:"Select a timezone","search-placeholder":"Search timezoneâ¦","leading-icon":"clock","aria-label":"Timezone"},null,8,["modelValue","options"]),u[20]||(u[20]=t("p",{class:"mt-1 text-xs text-gray-500 dark:text-gray-400"}," Reminders and dates use this timezone. New accounts default to UTC. ",-1))])]),t("div",or,[t("button",{type:"button",class:"btn-account-secondary",onClick:un}," Cancel "),t("button",{type:"button",class:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",disabled:z.value,onClick:hn},M(z.value?"Savingâ¦":"Save changes"),9,ar)])])):(L(),$(ce,{key:0},[t("dl",$a,[t("div",Fa,[u[8]||(u[8]=t("dt",{class:"xn-profile-dl__label"},"First name",-1)),t("dd",Va,M(fe.value),1)]),t("div",za,[u[9]||(u[9]=t("dt",{class:"xn-profile-dl__label"},"Last name",-1)),t("dd",qa,M(pe.value||"â"),1)]),t("div",Oa,[u[10]||(u[10]=t("dt",{class:"xn-profile-dl__label"},"Email",-1)),t("dd",Ha,M(d.value?.email),1)]),t("div",ja,[u[11]||(u[11]=t("dt",{class:"xn-profile-dl__label"}
11,"Country",-1)),t("dd",{class:le(["xn-profile-dl__value",d.value?.country?"":"xn-profile-dl__value--empty"])},M(d.value?.country||"Not set"),3)]),t("div",Ka,[u[13]||(u[13]=t("dt",{class:"xn-profile-dl__label"},"Timezone",-1)),t("dd",Ya,[Y(M(d.value?.timezone||"UTC")+" ",1),u[12]||(u[12]=t("span",{class:"xn-profile-dl__hint"}," Reminders and dates use this timezone. ",-1))])])]),t("div",{class:"mt-4 sm:!hidden"},[t("button",{type:"button",class:"btn-account-outline-primary",onClick:lt}," Edit ")])],64))])]),t("div",rr,[t("div",sr,[t("div",ir,[t("span",lr,[H(te,{name:"lock",size:20})]),t("div",ur,[t("h3",cr,M(P.value),1),t("p",dr,M(S.value),1)])])]),t("div",fr,[t("div",pr,[t("div",hr,[t("div",gr,[k.value?(L(),$("div",vr,[u[21]||(u[21]=t("label",{class:"xn-account-field-label"},"Current password",-1)),H(Ae,{modelValue:j.value.currentPassword,"onUpdate:modelValue":u[4]||(u[4]=U=>j.value.currentPassword=U),variant:"app",autocomplete:"current-password",placeholder:"Enter current password"},null,8,["modelValue"])])):G("",!0),t("div",null,[u[23]||(u[23]=t("label",{class:"xn-account-field-label"},"New password",-1)),H(Ae,{modelValue:j.value.newPassword,"onUpdate:modelValue":u[5]||(u[5]=U=>j.value.newPassword=U),variant:"app",minlength:"8",autocomplete:"new-password",placeholder:"Enter new password"},null,8,["modelValue"]),j.value.newPassword.length>0?(L(),$("p",{key:0,class:le(["xn-account-field-hint xn-account-password-rule",he.value?"xn-account-password-rule--ok":"xn-account-password-rule--bad"]),role:"status"},[H(te,{name:he.value?"check":"close",size:14,class:"shrink-0"},null,8,["name"]),u[22]||(u[22]=Y(" At least 8 characters ",-1))],2)):G("",!0)]),t("div",null,[u[24]||(u[24]=t("label",{class:"xn-account-field-label"},"Confirm new password",-1)),H(Ae,{modelValue:j.value.confirmPassword,"onUpdate:modelValue":u[6]||(u[6]=U=>j.value.confirmPassword=U),variant:"app",minlength:"8",autocomplete:"new-password",placeholder:"Confirm new password"},null,8,["modelValue"])])])]),t("div",mr,[u[27]||(u[27]=t("span",{class:"xn-profile-password-art__sparkle xn-profile-password-art__sparkle--1"},null,-1)),u[28]||(u[28]=t("span",{class:"xn-profile-password-art__sparkle xn-profile-password-art__sparkle--2"},null,-1)),u[29]||(u[29]=t("span",{class:"xn-profile-password-art__sparkle xn-profile-password-art__sparkle--3"},null,-1)),u[30]||(u[30]=t("span",{class:"xn-profile-password-art__sparkle xn-profile-password-art__sparkle--4"},null,-1)),u[31]||(u[31]=t("span",{class:"xn-profile-password-art__sparkle xn-profile-password-art__sparkle--5"},null,-1)),u[32]||(u[32]=t("div",{class:"xn-profile-password-art__glow"},null,-1)),t("div",wr,[u[26]||(u[26]=t("svg",{class:"xn-profile-password-art__shield",viewBox:"0 0 120 132",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("defs",null,[t("linearGradient",{id:"xn-profile-shield-fill",x1:"60",y1:"12",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse"},[t("stop",{"stop-color":"#f0eef9"}),t("stop",{offset:"0.45","stop-color":"#ded9f2"}),t("stop",{offset:"1","stop-color":"#c8bff0","stop-opacity":"0.85"})])]),t("path",{d:"M60 10L18 26.5V64.5C18 92.5 38.5 112.5 60 122C81.5 112.5 102 92.5 102 64.5V26.5L60 10Z",fill:"url(#xn-profile-shield-fill)",stroke:"currentColor","stroke-width":"5","stroke-linejoin":"round"}),t("g",{class:"xn-profile-password-art__lock"},[t("path",{d:"M48 58V50.5C48 41.5 53 36 60 36C67 36 72 41.5 72 50.5V58H76V50.5C76 39.5 69 32 60 32C51 32 44 39.5 44 50.5V58H48Z",fill:"currentColor"}),t("rect",{x:"44",y:"58",width:"32",height:"26",rx:"5",fill:"currentColor"}),t("circle",{cx:"60",cy:"69",r:"3.5",fill:"white"})])],-1)),t("div",yr,[u[25]||(u[25]=t("div",{class:"xn-profile-password-art__card-shadow"},null,-1)),t("div",_r,[t("div",br,[(L(),$(ce,null,Se(5,U=>t("span",{key:U,class:"xn-profile-password-art__dot"})),64))])])])])])]),t("div",xr,[t("button",{type:"button",class:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",disabled:C.value||!me.value,onClick:vn},M(A.value),9,Cr)])])]),t("div",kr,[t("div",Er,[t("div",Pr,[t("span",Ar,[H(te,{name:"shield",size:20})]),u[33]||(u[33]=t("div",{class:"min-w-0"},[t("h3",{class:"xn-profile-section-head__title"},"Sign-in methods"),t("p",{class:"xn-profile-section-head__desc"},"Email verification and connected accounts.")],-1))])]),t("div",Sr,[t("div",Tr,[t("div",Nr,[u[34]||(u[34]=t("p",{class:"xn-profile-panel-row__title"},"Email verification",-1)),u[35]||(u[35]=t("p",{class:"xn-profile-panel-row__desc"},"Required to activate your account",-1)),g.value?G("",!0):(L(),$("button",{key:0,t
11ype:"button",class:"xn-account-link-action !mt-2",disabled:B.value,onClick:gn},M(B.value?"Sendingâ¦":"Resend verification email"),9,Rr))]),t("span",{class:le(["xn-profile-status-badge",g.value?"xn-profile-status-badge--success":"xn-profile-status-badge--warning"])},M(g.value?"Verified":"Unverified"),3)]),(L(!0),$(ce,null,Se(ee.value,U=>(L(),$("div",{key:U.id,class:"xn-profile-panel-row"},[t("div",Br,[t("p",Mr,M(U.label),1),t("p",Ir,M(U.connected?`Signed in with ${U.label}`:`Not connected via ${U.label}`),1)]),t("span",{class:le(["xn-profile-status-badge",U.connected?"xn-profile-status-badge--success":"xn-profile-status-badge--muted"])},M(U.connected?"Connected":"Not connected"),3)]))),128))])]),H(ha,{"auth-provider":d.value?.authProvider,"linked-auth-providers":d.value?.linkedAuthProviders,onUpdated:sn},null,8,["auth-provider","linked-auth-providers"]),t("div",Ur,[t("div",Lr,[t("div",Dr,[t("span",$r,[H(te,{name:"trash",size:20})]),u[36]||(u[36]=t("div",{class:"min-w-0"},[t("h3",{class:"xn-profile-section-head__title"},"Delete account"),t("p",{class:"xn-profile-section-head__desc"}," Permanently remove your account and all associated data. ")],-1))])]),t("div",Fr,[t("ul",Vr,[t("li",null,[u[37]||(u[37]=Y(" You will have ",-1)),t("strong",null,M(ae.value),1),u[38]||(u[38]=Y(" to cancel before deletion is final. ",-1))]),t("li",null,[H(F,{to:"/account/import-export",class:"xn-text-link"},{default:xe(()=>[...u[39]||(u[39]=[Y(" Export your data ",-1)])]),_:1}),u[40]||(u[40]=Y(" first if you need a copy. ",-1))])]),v.value?(L(),$("p",zr," Deletion is scheduled for "+M(_e.value)+". Use the banner above to cancel or export your data. ",1)):G("",!0),v.value?G("",!0):(L(),$("div",qr,[t("button",{type:"button",class:"btn-account-outline-danger",disabled:E.value,onClick:mn},M(E.value?"Schedulingâ¦":"Delete my account"),9,Or)]))])])]))]),_:1})]),_:1})}}};export{ys as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.