PageSourceSearch

https://repsshield.com/assets/index-Byg2HWAE.js

js repsshield.com collected 2026-09-24 14:17:29 UTC 1,281,000 bytes, 574 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-BkQ0Oa04.js","assets/vendor-Qgthw7N1.js","assets/web-BaZNN1KB.js","assets/web-CSqx1mRB.js","assets/LandingPage-Ctn-rx0z.js","assets/building-Bc-otC-f.js","assets/brain-CkeK6gqK.js","assets/calculator-C06MfOK6.js","assets/timer-B3GC1z8w.js","assets/useSEOMetaTags-DuPP1K7p.js","assets/useSchemaMarkup-CFsXJ2MT.js","assets/calendar-days-CZv4Giu2.js","assets/activity-DlNiJWQy.js","assets/LandingPreviewPage-ah2UzVRD.js","assets/PricingPage-D-n7KPko.js","assets/minus-BIk_cVu7.js","assets/FeaturesPage-D2UEWFI-.js","assets/AboutPage-CB060gXB.js","assets/WhyRepsShieldPage-D-2s07Dm.js","assets/ComparisonPage-TYiI_HVL.js","assets/REPSLogComparisonPage-XRmg67SL.js","assets/ChangelogPage-DOR6uQYn.js","assets/ApiDocsPage-37vQoMax.js","assets/key-Dc7JBqE5.js","assets/copy-DV8e8Olv.js","assets/TimeTrackingPage-ZwinGdOl.js","assets/smartphone-BhnFDoVR.js","assets/mic-BKcphmOD.js","assets/MaterialParticipationPage-zchqDgNb.js","assets/AuditReadyReportingPage-CT3FMLCA.js","assets/award-De1CK5jd.js","assets/GoalProgressTrackerPage-B0R2YieO.js","assets/bell-C5uWGH8D.js","assets/MultiPropertySupportPage-gstFn5tH.js","assets/user-plus-DIMyHSLg.js","assets/PremiumFeaturesPage-BjXs5bMy.js","assets/ToolsIndexPage-CIQxgUNu.js","assets/share-DRHJpH16.js","assets/RentalCalculatorPage-BJ4b0wNY.js","assets/chart-pie-P9cErRnq.js","assets/chart-line-DHDWAOEK.js","assets/generateCategoricalChart-BoqWx9k4.js","assets/LineChart-CNPEj-ac.js","assets/BrrrCalculatorPage-DkMA61Qn.js","assets/RepStatusCalculatorPage-D4B3Lbcw.js","assets/circle-x-C3yul9_R.js","assets/RepStatusAuditScanPage-DMp3VLUZ.js","assets/file-spreadsheet-BmInesC3.js","assets/RepHoursTrackerPage-h_VYbM6y.js","assets/ExchangeTimerPage-C9g4P_w0.js","assets/AreaChart-BtAPz8zO.js","assets/differenceInDays-B1HGzUkv.js","assets/share-2-BwzmsqEz.js","assets/ExchangeSharedPage-WetRR6ex.js","assets/CostSegEstimatorPage-C3dg4zg9.js","assets/CostSegEstimatorChatPage-CeXMsFkO.js","assets/BlogIndexPage-C29kYTzC.js","assets/useBlogPosts-CfrXCzu0.js","assets/api-DBoyQ-on.js","assets/BlogSidebar-Qi56_Elg.js","assets/BlogCategoryPage-A3BHuZ4B.js","assets/BlogPostPage-C5-MNipH.js","assets/RegisterPage-B85NkDfH.js","assets/ForgotPasswordPage-BIy0pQ6m.js","assets/ResetPasswordPage-BujKzLJv.js","assets/LogoutSuccessPage-FcS1iM5p.js","assets/AcceptInvitePage-Wuqgi1dW.js","assets/teamService-D0yxWeK5.js","assets/PrivacyPage-DCrOSave.js","assets/database-DQmaeQm0.js","assets/info-B94Hlx1u.js","assets/phone-N3qNKLw9.js","assets/TermsPage-B_kALELF.js","assets/AffiliateProgramPage-DPL2L4gY.js","assets/AffiliateSignupPage-DWsrj6-Z.js","assets/schema-D2obYZ_w.js","assets/diagnostics-RFvvhfwp.js","assets/public-diagnostics-D4285yRr.js","assets/debug-deployment-D819FpVu.js","assets/AgenticOnboarding-DtBgazvw.js","assets/time-entries-CpVpMVvX.js","assets/memberService-CISoEFwf.js","assets/useMemberProfile-DLE0qzBQ.js","assets/maximize-2-D7IQEluU.js","assets/file-image-Er1ZOYVg.js","assets/use-transform-CXyDomQV.js","assets/square-pen-D8PHEJvM.js","assets/stats-BJ8-38u-.js","assets/profile-BdW9QXVI.js","assets/MobileActionSheet-CSkEHcXe.js","assets/camera-D-cIusRY.js","assets/dashboard-kWDBVpCo.js","assets/useParallelQueries-D2tckJDW.js","assets/useIntegrations-CUanp7GW.js","assets/calendarService-CrpjTGeC.js","assets/CalendarDateRangeFilter-BVOXnJ7M.js","assets/differenceInMonths-CWoVTq_U.js","assets/index-Bs2JGf-v.js","assets/RepsClassificationSection-BliMW0iC.js","assets/authUtils-CcDzk6i0.js","assets/MailActivityCard-G6QR5aNV.js","assets/CalendarStatusLegend-BpVkF9GW.js","assets/checkbox-Cqr9jids.js","assets/useAutomation-lkaxjoGr.js","assets/automationService-OVbtW0oB.js","assets/message-circle-CEbsxAUX.js","assets/CalendarView-C6WRDhF9.js","assets/index-COtV6X2D.js","assets/grid-3x3-Dl22D3mL.js","assets/filter-ejjrE0l5.js","assets/play-BTJ7KJDO.js","assets/pause-BCrfl0Rj.js","assets/timeEntryService-DBf_VWTS.js","assets/toggle-group-BVV0MziZ.js","assets/history-DLcruDYK.js","assets/MobileImapConnectSheet-C6JGrTGV.js","assets/mobile-dashboard-calendar-CcCP3iL7.js","assets/mobile-dashboard-mail-C9e74Znl.js","assets/mobile-sync-settings-B6XkM7dm.js","assets/files-D0d35WiI.js","assets/useFileAccessUrl-6aqd6eyh.js","assets/hard-drive-436CTEuo.js","assets/file-history-CK-Gx_l6.js","assets/archive-DwAjs2Bp.js","assets/super-admin-B_gLlqAB.js","assets/BlogAdminPage-COCm83uq.js","assets/save-CiqQszcI.js","assets/sun-CgGJiP3e.js","assets/link-2-CaYPiQ6T.js","assets/PieChart-CAoo1sxk.js","assets/test-tube-diagonal-kj5xqKdl.js","assets/organization-admin-Dk_-H6DN.js","assets/analytics-JOA_m9vc.js","assets/arrow-up-right-D1j766Li.js","assets/properties-new-DhCu9AGM.js","assets/mapbox-gl-B5AkQ11C.js","assets/mapbox-gl-Bc17DTGM.css","assets/PropertyDetailPage-CLJB4tzf.js","assets/activity-ledger-enhanced-wV0xdVxu.js","assets/team-DrGdn2p5.js","assets/automation-BTOkvwvP.js","assets/rules-management-BeFNCv0L.js","assets/SmartCalendarDialog-CstA2nJu.js","assets/rules-management-test-Dsz1JM22.js","assets/RulesManagementSimplified-ClF6zTCE.js","assets/TestCalendar-nvC7VkIN.js","assets/test-dashboard-uPuqspfE.js","assets/affiliate-dashboard-DpvQl2Ns.js","assets/affiliate-settings-BbRcSi9t.js","assets/test-fixes-BWV-Y8J_.js","assets/file-preview-demo-MxgUIuqc.js","assets/settings-BqNGqJTJ.js","assets/manage-subscription-Bh0p4rVG.js","assets/welcome-tour-D6ksZPF3.js","assets/test-analytics-DWZ0gMMZ.js","assets/web-BCEY7X
1Fe.js","assets/web-ITOxpK7a.js"])))=>i.map(i=>d[i]);
2var ov=e=>{throw TypeError(e)};var Mf=(e,t,n)=>t.has(e)||ov("Cannot "+n);var $=(e,t,n)=>(Mf(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?ov("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,r)=>(Mf(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Be=(e,t,n)=>(Mf(e,t,"access private method"),n);var Ic=(e,t,n,r)=>({set _(s){ye(e,t,s,n)},get _(){return $(e,t,r)}});import{r as h,f as sa,c as Ne,u as pt,h as qp,L as Ce,S as Cu,i as We,R as el,g as Gp,e as kl}from"./vendor-Qgthw7N1.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var bk={exports:{}},Td={};/**
3 * @license React
4 * react-jsx-runtime.production.min.js
5 *
6 * Copyright (c) Facebook, Inc. and its affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var _2=h,A2=Symbol.for("react.element"),P2=Symbol.for("react.fragment"),R2=Object.prototype.hasOwnProperty,I2=_2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,M2={key:!0,ref:!0,__self:!0,__source:!0};function wk(e,t,n){var r,s={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)R2.call(t,r)&&!M2.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:A2,type:e,key:a,ref:o,props:s,_owner:I2.current}}Td.Fragment=P2;Td.jsx=wk;Td.jsxs=wk;bk.exports=Td;var i=bk.exports,kk,tm,lv=sa;tm=lv.createRoot,kk=lv.hydrateRoot;var ko=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ri,$s,Ba,ck,D2=(ck=class extends ko{constructor(){super();Se(this,Ri);Se(this,$s);Se(this,Ba);ye(this,Ba,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$(this,$s)||this.setEventListener($(this,Ba))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,$s))==null||t.call(this),ye(this,$s,void 0))}setEventListener(t){var n;ye(this,Ba,t),(n=$(this,$s))==null||n.call(this),ye(this,$s,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){$(this,Ri)!==t&&(ye(this,Ri,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof $(this,Ri)=="boolean"?$(this,Ri):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ri=new WeakMap,$s=new WeakMap,Ba=new WeakMap,ck),Yp=new D2,O2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zs,Wp,uk,L2=(uk=class{constructor(){Se(this,zs,O2);Se(this,Wp,!1)}setTimeoutProvider(e){ye(this,zs,e)}setTimeout(e,t){return $(this,zs).setTimeout(e,t)}clearTimeout(e){$(this,zs).clearTimeout(e)}setInterval(e,t){return $(this,zs).setInterval(e,t)}clearInterval(e){$(this,zs).clearInterval(e)}},zs=new WeakMap,Wp=new WeakMap,uk),_i=new L2;function F2(e){setTimeout(e,0)}var V2=typeof window>"u"||"Deno"in globalThis;function ln(){}function $2(e,t){return typeof e=="function"?e(t):e}function nm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Sk(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qs(e,t){return typeof e=="function"?e(t):e}function Dn(e,t){return typeof e=="function"?e(t):e}function cv(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Kp(o,t.options))return!1}else if(!Sl(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function uv(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(qi(t.options.mutationKey)!==qi(a))return!1}else if(!Sl(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Kp(e,t){return((t==null?void 0:t.queryKeyHashFn)||qi)(e)}function qi(e){return JSON.stringify(e,(t,n)=>rm(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Sl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Sl(e[n],t[n])):!1}var z2=Object.prototype.hasOwnProperty;function Nk(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=dv(e)&&dv(t);if(!r&&!(rm(e)&&rm(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,c=r?new Array(l):{};let u=0;for(let f=0;f<l;f++){const d=r?f:o[f],m=e[d],p=t[d];if(m===p){c[d]=m,(r?f<a:z2.call(e,d))&&u++;continue}if(m===null||p===null||typeof m!="object"||typeof p!="object"){c[d]=p;continue}const g=Nk(m,p,n+1);c[d]=g,g===m&&u++}return a===l&&u===a?e:c}function Tu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function dv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rm(e){if(!fv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!fv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function fv(e){return Object.prototype.toString.call(e)==="[object Object]"}function U2(e){return new Promise(t=>{_i.setTimeout(t,e)})}function sm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Nk(e,t):t}function B2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function H2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Qp=Symbol();function jk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Qp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zp(e,t){return typeof e=="function"?e(...t):!!e}function W2(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Nl=(()=>{let e=()=>V2;return{isServer(){return e()},setIsServer(t){e=t}}})();function im(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var q2=F2;function G2(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=q2;const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>
10{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Vt=G2(),Ha,Us,Wa,dk,Y2=(dk=class extends ko{constructor(){super();Se(this,Ha,!0);Se(this,Us);Se(this,Wa);ye(this,Wa,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){$(this,Us)||this.setEventListener($(this,Wa))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,Us))==null||t.call(this),ye(this,Us,void 0))}setEventListener(t){var n;ye(this,Wa,t),(n=$(this,Us))==null||n.call(this),ye(this,Us,t(this.setOnline.bind(this)))}setOnline(t){$(this,Ha)!==t&&(ye(this,Ha,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return $(this,Ha)}},Ha=new WeakMap,Us=new WeakMap,Wa=new WeakMap,dk),Eu=new Y2;function K2(e){return Math.min(1e3*2**e,3e4)}function Ck(e){return(e??"online")==="online"?Eu.isOnline():!0}var am=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Tk(e){let t=!1,n=0,r;const s=im(),a=()=>s.status!=="pending",o=x=>{var y;if(!a()){const v=new am(x);m(v),(y=e.onCancel)==null||y.call(e,v)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Yp.isFocused()&&(e.networkMode==="always"||Eu.isOnline())&&e.canRun(),f=()=>Ck(e.networkMode)&&e.canRun(),d=x=>{a()||(r==null||r(),s.resolve(x))},m=x=>{a()||(r==null||r(),s.reject(x))},p=()=>new Promise(x=>{var y;r=v=>{(a()||u())&&x(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var x;r=void 0,a()||(x=e.onContinue)==null||x.call(e)}),g=()=>{if(a())return;let x;const y=n===0?e.initialPromise:void 0;try{x=y??e.fn()}catch(v){x=Promise.reject(v)}Promise.resolve(x).then(d).catch(v=>{var C;if(a())return;const b=e.retry??(Nl.isServer()?0:3),w=e.retryDelay??K2,j=typeof w=="function"?w(n,v):w,S=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,v);if(t||!S){m(v);return}n++,(C=e.onFail)==null||C.call(e,n,v),U2(j).then(()=>u()?void 0:p()).then(()=>{t?m(v):g()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:c,canStart:f,start:()=>(f()?g():p().then(g),s)}}var Ii,fk,Ek=(fk=class{constructor(){Se(this,Ii)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nm(this.gcTime)&&ye(this,Ii,_i.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nl.isServer()?1/0:5*60*1e3))}clearGcTimeout(){$(this,Ii)!==void 0&&(_i.clearTimeout($(this,Ii)),ye(this,Ii,void 0))}},Ii=new WeakMap,fk);function Q2(e){return{onFetch:(t,n)=>{var f,d,m,p,g;const r=t.options,s=(m=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:m.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let x=!1;const y=w=>{W2(w,()=>t.signal,()=>x=!0)},v=jk(t.options,t.fetchOptions),b=async(w,j,S)=>{if(x)return Promise.reject(t.signal.reason);if(j==null&&w.pages.length)return Promise.resolve(w);const I=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:j,direction:S?"backward":"forward",meta:t.options.meta};return y(A),A})(),E=await v(I),{maxPages:N}=t.options,k=S?H2:B2;return{pages:k(w.pages,E,N),pageParams:k(w.pageParams,j,N)}};if(s&&a.length){const w=s==="backward",j=w?Z2:hv,S={pages:a,pageParams:o},C=j(r,S);l=await b(S,C,w)}else{const w=e??a.length;do{const j=c===0?o[0]??r.initialPageParam:hv(r,l);if(c>0&&j==null)break;l=await b(l,j),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var x,y;return(y=(x=t.options).persister)==null?void 0:y.call(x,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function hv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Z2(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}
10var qa,Mi,Ga,Yn,Di,Ut,Ql,Oi,Mn,_k,es,hk,X2=(hk=class extends Ek{constructor(t){super();Se(this,Mn);Se(this,qa);Se(this,Mi);Se(this,Ga);Se(this,Yn);Se(this,Di);Se(this,Ut);Se(this,Ql);Se(this,Oi);ye(this,Oi,!1),ye(this,Ql,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,Di,t.client),ye(this,Yn,$(this,Di).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,Mi,pv(this.options)),this.state=t.state??$(this,Mi),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return $(this,qa)}get promise(){var t;return(t=$(this,Ut))==null?void 0:t.promise}setOptions(t){if(this.options={...$(this,Ql),...t},t!=null&&t._type&&ye(this,qa,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=pv(this.options);n.data!==void 0&&(this.setState(mv(n.data,n.dataUpdatedAt)),ye(this,Mi,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,Yn).remove(this)}setData(t,n){const r=sm(this.state.data,t,this.options);return Be(this,Mn,es).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Be(this,Mn,es).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=$(this,Ut))==null?void 0:r.promise;return(s=$(this,Ut))==null||s.cancel(t),n?n.then(ln).catch(ln):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return $(this,Mi)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Dn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Qp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Qs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Sk(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,Ut))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,Ut))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,Yn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||($(this,Ut)&&($(this,Oi)||Be(this,Mn,_k).c
10all(this)?$(this,Ut).cancel({revert:!0}):$(this,Ut).cancelRetry()),this.scheduleGc()),$(this,Yn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Be(this,Mn,es).call(this,{type:"invalidate"})}async fetch(t,n){var u,f,d,m,p,g,x,y,v,b,w;if(this.state.fetchStatus!=="idle"&&((u=$(this,Ut))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($(this,Ut))return $(this,Ut).continueRetry(),$(this,Ut).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(S=>S.options.queryFn);j&&this.setOptions(j.options)}const r=new AbortController,s=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(ye(this,Oi,!0),r.signal)})},a=()=>{const j=jk(this.options,n),C=(()=>{const I={client:$(this,Di),queryKey:this.queryKey,meta:this.meta};return s(I),I})();return ye(this,Oi,!1),this.options.persister?this.options.persister(j,C,this):j(C)},l=(()=>{const j={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$(this,Di),state:this.state,fetchFn:a};return s(j),j})(),c=$(this,qa)==="infinite"?Q2(this.options.pages):this.options.behavior;c==null||c.onFetch(l,this),ye(this,Ga,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&Be(this,Mn,es).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),ye(this,Ut,Tk({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:j=>{j instanceof am&&j.revert&&this.setState({...$(this,Ga),fetchStatus:"idle"}),r.abort()},onFail:(j,S)=>{Be(this,Mn,es).call(this,{type:"failed",failureCount:j,error:S})},onPause:()=>{Be(this,Mn,es).call(this,{type:"pause"})},onContinue:()=>{Be(this,Mn,es).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const j=await $(this,Ut).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(p=(m=$(this,Yn).config).onSuccess)==null||p.call(m,j,this),(x=(g=$(this,Yn).config).onSettled)==null||x.call(g,j,this.state.error,this),j}catch(j){if(j instanceof am){if(j.silent)return $(this,Ut).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw Be(this,Mn,es).call(this,{type:"error",error:j}),(v=(y=$(this,Yn).config).onError)==null||v.call(y,j,this),(w=(b=$(this,Yn).config).onSettled)==null||w.call(b,this.state.data,j,this),j}finally{this.scheduleGc()}}},qa=new WeakMap,Mi=new WeakMap,Ga=new WeakMap,Yn=new WeakMap,Di=new WeakMap,Ut=new WeakMap,Ql=new WeakMap,Oi=new WeakMap,Mn=new WeakSet,_k=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},es=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ak(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...mv(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,Ga,t.manual?s:void 0),s;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Vt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),$(this,Yn).notify({query:this,type:"updated",action:t})})},hk);function Ak(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ck(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function mv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pv(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdate
10Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var bn,Qe,Zl,on,Li,Ya,ns,Bs,Xl,Ka,Qa,Fi,Vi,Hs,Za,ut,tl,om,lm,cm,um,dm,fm,hm,Pk,mk,J2=(mk=class extends ko{constructor(t,n){super();Se(this,ut);Se(this,bn);Se(this,Qe);Se(this,Zl);Se(this,on);Se(this,Li);Se(this,Ya);Se(this,ns);Se(this,Bs);Se(this,Xl);Se(this,Ka);Se(this,Qa);Se(this,Fi);Se(this,Vi);Se(this,Hs);Se(this,Za,new Set);this.options=n,ye(this,bn,t),ye(this,Bs,null),ye(this,ns,im()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,Qe).addObserver(this),gv($(this,Qe),this.options)?Be(this,ut,tl).call(this):this.updateResult(),Be(this,ut,um).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mm($(this,Qe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mm($(this,Qe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Be(this,ut,dm).call(this),Be(this,ut,fm).call(this),$(this,Qe).removeObserver(this)}setOptions(t){const n=this.options,r=$(this,Qe);if(this.options=$(this,bn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dn(this.options.enabled,$(this,Qe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Be(this,ut,hm).call(this),$(this,Qe).setOptions(this.options),n._defaulted&&!Tu(this.options,n)&&$(this,bn).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,Qe),observer:this});const s=this.hasListeners();s&&xv($(this,Qe),r,this.options,n)&&Be(this,ut,tl).call(this),this.updateResult(),s&&($(this,Qe)!==r||Dn(this.options.enabled,$(this,Qe))!==Dn(n.enabled,$(this,Qe))||Qs(this.options.staleTime,$(this,Qe))!==Qs(n.staleTime,$(this,Qe)))&&Be(this,ut,om).call(this);const a=Be(this,ut,lm).call(this);s&&($(this,Qe)!==r||Dn(this.options.enabled,$(this,Qe))!==Dn(n.enabled,$(this,Qe))||a!==$(this,Hs))&&Be(this,ut,cm).call(this,a)}getOptimisticResult(t){const n=$(this,bn).getQueryCache().build($(this,bn),t),r=this.createResult(n,t);return tI(this,r)&&(ye(this,on,r),ye(this,Ya,this.options),ye(this,Li,$(this,Qe).state)),r}getCurrentResult(){return $(this,on)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&$(this,ns).status==="pending"&&$(this,ns).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){$(this,Za).add(t)}getCurrentQuery(){return $(this,Qe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=$(this,bn).defaultQueryOptions(t),r=$(this,bn).getQueryCache().build($(this,bn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Be(this,ut,tl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,on)))}createResult(t,n){var N;const r=$(this,Qe),s=this.options,a=$(this,on),o=$(this,Li),l=$(this,Ya),u=t!==r?t.state:$(this,Zl),{state:f}=t;let d={...f},m=!1,p;if(n._optimisticResults){const k=this.hasListeners(),A=!k&&gv(t,n),M=k&&xv(t,r,n,s);(A||M)&&(d={...d,...Ak(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:x,status:y}=d;p=d.data;let v=!1;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let k;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(k=a.data,v=!0):k=typeof n.placeholderData=="function"?n.placeholderData((N=$(this,Qa))==null?void 0:N.state.data,$(this,Qa)):n.placeholderData,k!==void 0&&(y="success",p=sm(a==null?void 0:a.data,k,n),m=!0)}if(n.select&&p!==void 0&&!v)if(a&&p===(o==null?void 0:o.data)&&n.select===$(this,Xl))p=$(this,Ka);else try{ye(this,Xl,n.select),p=n.select(p),p=sm(a==null?void 0:a.data,p,n),ye(this,Ka,p),ye(this,Bs,null)}catch(k){ye(this,Bs,k)}$(this,Bs)&&(g=$(this,Bs),p=$(this,Ka),x=Date.now(),y="error");const b=d.fetchStatus==="fetching",w=y==="pending",j=y==="error",S=w&&b,C=p!==void 0,E={status:y,fetchStatus:d.fetchStatus,isPending:w,isSuccess:y==="success",isError:j,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:x,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdate
10Count:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:j&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:j&&C,isStale:Xp(t,n),refetch:this.refetch,promise:$(this,ns),isEnabled:Dn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const k=E.data!==void 0,A=E.status==="error"&&!k,M=V=>{A?V.reject(E.error):k&&V.resolve(E.data)},L=()=>{const V=ye(this,ns,E.promise=im());M(V)},F=$(this,ns);switch(F.status){case"pending":t.queryHash===r.queryHash&&M(F);break;case"fulfilled":(A||E.data!==F.value)&&L();break;case"rejected":(!A||E.error!==F.reason)&&L();break}}return E}updateResult(){const t=$(this,on),n=this.createResult($(this,Qe),this.options);if(ye(this,Li,$(this,Qe).state),ye(this,Ya,this.options),$(this,Li).data!==void 0&&ye(this,Qa,$(this,Qe)),Tu(n,t))return;ye(this,on,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!$(this,Za).size)return!0;const o=new Set(a??$(this,Za));return this.options.throwOnError&&o.add("error"),Object.keys($(this,on)).some(l=>{const c=l;return $(this,on)[c]!==t[c]&&o.has(c)})};Be(this,ut,Pk).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Be(this,ut,um).call(this)}},bn=new WeakMap,Qe=new WeakMap,Zl=new WeakMap,on=new WeakMap,Li=new WeakMap,Ya=new WeakMap,ns=new WeakMap,Bs=new WeakMap,Xl=new WeakMap,Ka=new WeakMap,Qa=new WeakMap,Fi=new WeakMap,Vi=new WeakMap,Hs=new WeakMap,Za=new WeakMap,ut=new WeakSet,tl=function(t){Be(this,ut,hm).call(this);let n=$(this,Qe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ln)),n},om=function(){Be(this,ut,dm).call(this);const t=Qs(this.options.staleTime,$(this,Qe));if(Nl.isServer()||$(this,on).isStale||!nm(t))return;const r=Sk($(this,on).dataUpdatedAt,t)+1;ye(this,Fi,_i.setTimeout(()=>{$(this,on).isStale||this.updateResult()},r))},lm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,Qe)):this.options.refetchInterval)??!1},cm=function(t){Be(this,ut,fm).call(this),ye(this,Hs,t),!(Nl.isServer()||Dn(this.options.enabled,$(this,Qe))===!1||!nm($(this,Hs))||$(this,Hs)===0)&&ye(this,Vi,_i.setInterval(()=>{(this.options.refetchIntervalInBackground||Yp.isFocused())&&Be(this,ut,tl).call(this)},$(this,Hs)))},um=function(){Be(this,ut,om).call(this),Be(this,ut,cm).call(this,Be(this,ut,lm).call(this))},dm=function(){$(this,Fi)!==void 0&&(_i.clearTimeout($(this,Fi)),ye(this,Fi,void 0))},fm=function(){$(this,Vi)!==void 0&&(_i.clearInterval($(this,Vi)),ye(this,Vi,void 0))},hm=function(){const t=$(this,bn).getQueryCache().build($(this,bn),this.options);if(t===$(this,Qe))return;const n=$(this,Qe);ye(this,Qe,t),ye(this,Zl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Pk=function(t){Vt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n($(this,on))}),$(this,bn).getQueryCache().notify({query:$(this,Qe),type:"observerResultsUpdated"})})},mk);function eI(e,t){return Dn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Dn(t.retryOnMount,e)===!1)}function gv(e,t){return eI(e,t)||e.state.data!==void 0&&mm(e,t,t.refetchOnMount)}function mm(e,t,n){if(Dn(t.enabled,e)!==!1&&Qs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Xp(e,t)}return!1}function xv(e,t,n,r){return(e!==t||Dn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Xp(e,n)}function Xp(e,t){return Dn(t.enabled,e)!==!1&&e.isStaleByTime(Qs(t.staleTime,e))}function tI(e,t){return!Tu(e.getCurrentResult(),t)}var Jl,wr,Zt,$i,kr,Ps,pk,nI=(pk=class extends Ek{constructor(t){super();Se(this,kr);Se(this,Jl);Se(this,wr);Se(this,Zt);Se(this,$i);ye(this,Jl,t.client),this.mutationId=t.mutationId,ye(this,Zt,t.mutationCache),ye(this,wr,[]),this.state=t.state||Rk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,wr).includes(t)||($(this,wr).push(t),this.clearGcTimeout(),$(this,Zt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,wr,$(this,wr).filter(n=>n!==t)),this.scheduleGc(),$(this,Zt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,wr).length||(this.state.status==="pending"?this.scheduleGc():$(this,Zt).remove(this))}continue(){var t;return((t=$(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,u,f,d,m,p,g,x,y,v,b,w,j,S,C,I;const n=()=>
10{Be(this,kr,Ps).call(this,{type:"continue"})},r={client:$(this,Jl),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,$i,Tk({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(E,N)=>{Be(this,kr,Ps).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Be(this,kr,Ps).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,Zt).canRun(this)}));const s=this.state.status==="pending",a=!$(this,$i).canStart();try{if(s)n();else{Be(this,kr,Ps).call(this,{type:"pending",variables:t,isPaused:a}),$(this,Zt).config.onMutate&&await $(this,Zt).config.onMutate(t,this,r);const N=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));N!==this.state.context&&Be(this,kr,Ps).call(this,{type:"pending",context:N,variables:t,isPaused:a})}const E=await $(this,$i).start();return await((u=(c=$(this,Zt).config).onSuccess)==null?void 0:u.call(c,E,t,this.state.context,this,r)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,E,t,this.state.context,r)),await((p=(m=$(this,Zt).config).onSettled)==null?void 0:p.call(m,E,null,this.state.variables,this.state.context,this,r)),await((x=(g=this.options).onSettled)==null?void 0:x.call(g,E,null,t,this.state.context,r)),Be(this,kr,Ps).call(this,{type:"success",data:E}),E}catch(E){try{await((v=(y=$(this,Zt).config).onError)==null?void 0:v.call(y,E,t,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((w=(b=this.options).onError)==null?void 0:w.call(b,E,t,this.state.context,r))}catch(N){Promise.reject(N)}try{await((S=(j=$(this,Zt).config).onSettled)==null?void 0:S.call(j,void 0,E,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((I=(C=this.options).onSettled)==null?void 0:I.call(C,void 0,E,t,this.state.context,r))}catch(N){Promise.reject(N)}throw Be(this,kr,Ps).call(this,{type:"error",error:E}),E}finally{$(this,Zt).runNext(this)}}},Jl=new WeakMap,wr=new WeakMap,Zt=new WeakMap,$i=new WeakMap,kr=new WeakSet,Ps=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Vt.batch(()=>{$(this,wr).forEach(r=>{r.onMutationUpdate(t)}),$(this,Zt).notify({mutation:this,type:"updated",action:t})})},pk);function Rk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rs,rr,ec,gk,rI=(gk=class extends ko{constructor(t={}){super();Se(this,rs);Se(this,rr);Se(this,ec);this.config=t,ye(this,rs,new Set),ye(this,rr,new Map),ye(this,ec,0)}build(t,n,r){const s=new nI({client:t,mutationCache:this,mutationId:++Ic(this,ec)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){$(this,rs).add(t);const n=Mc(t);if(typeof n=="string"){const r=$(this,rr).get(n);r?r.push(t):$(this,rr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,rs).delete(t)){const n=Mc(t);if(typeof n=="string"){const r=$(this,rr).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&$(this,rr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Mc(t);if(typeof n=="string"){const r=$(this,rr).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Mc(t);if(typeof n=="string"){const s=(r=$(this,rr).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vt.batch(()=>
10{$(this,rs).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,rs).clear(),$(this,rr).clear()})}getAll(){return Array.from($(this,rs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uv(n,r))}findAll(t={}){return this.getAll().filter(n=>uv(t,n))}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Vt.batch(()=>Promise.all(t.map(n=>n.continue().catch(ln))))}},rs=new WeakMap,rr=new WeakMap,ec=new WeakMap,gk);function Mc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ss,Ws,wn,is,fs,iu,pm,xk,sI=(xk=class extends ko{constructor(n,r){super();Se(this,fs);Se(this,ss);Se(this,Ws);Se(this,wn);Se(this,is);ye(this,ss,n),this.setOptions(r),this.bindMethods(),Be(this,fs,iu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=$(this,ss).defaultMutationOptions(n),Tu(this.options,r)||$(this,ss).getMutationCache().notify({type:"observerOptionsUpdated",mutation:$(this,wn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&qi(r.mutationKey)!==qi(this.options.mutationKey)?this.reset():((s=$(this,wn))==null?void 0:s.state.status)==="pending"&&$(this,wn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=$(this,wn))==null||n.removeObserver(this)}onMutationUpdate(n){Be(this,fs,iu).call(this),Be(this,fs,pm).call(this,n)}getCurrentResult(){return $(this,Ws)}reset(){var n;(n=$(this,wn))==null||n.removeObserver(this),ye(this,wn,void 0),Be(this,fs,iu).call(this),Be(this,fs,pm).call(this)}mutate(n,r){var s;return ye(this,is,r),(s=$(this,wn))==null||s.removeObserver(this),ye(this,wn,$(this,ss).getMutationCache().build($(this,ss),this.options)),$(this,wn).addObserver(this),$(this,wn).execute(n)}},ss=new WeakMap,Ws=new WeakMap,wn=new WeakMap,is=new WeakMap,fs=new WeakSet,iu=function(){var r;const n=((r=$(this,wn))==null?void 0:r.state)??Rk();ye(this,Ws,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},pm=function(n){Vt.batch(()=>{var r,s,a,o,l,c,u,f;if($(this,is)&&this.hasListeners()){const d=$(this,Ws).variables,m=$(this,Ws).context,p={client:$(this,ss),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=$(this,is)).onSuccess)==null||s.call(r,n.data,d,m,p)}catch(g){Promise.reject(g)}try{(o=(a=$(this,is)).onSettled)==null||o.call(a,n.data,null,d,m,p)}catch(g){Promise.reject(g)}}else if((n==null?void 0:n.type)==="error"){try{(c=(l=$(this,is)).onError)==null||c.call(l,n.error,d,m,p)}catch(g){Promise.reject(g)}try{(f=(u=$(this,is)).onSettled)==null||f.call(u,void 0,n.error,d,m,p)}catch(g){Promise.reject(g)}}}this.listeners.forEach(d=>{d($(this,Ws))})})},xk),Sr,yk,iI=(yk=class extends ko{constructor(t={}){super();Se(this,Sr);this.config=t,ye(this,Sr,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Kp(s,n);let o=this.get(a);return o||(o=new X2({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){$(this,Sr).has(t.queryHash)||($(this,Sr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=$(this,Sr).get(t.queryHash);n&&(t.destroy(),n===t&&$(this,Sr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,Sr).get(t)}getAll(){return[...$(this,Sr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>cv(t,r)):n}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Sr=new WeakMap,yk),jt,qs,Gs,Xa,Ja,Ys,eo,to,vk,aI=(vk=class{constructor(e={}){Se(this,jt);Se(this,qs);Se(this,Gs);Se(this,Xa);Se(this,Ja);Se(this,Ys);Se(this,eo);Se(this,to);ye(this,jt,e.queryCache||new iI),ye(this,qs,e.mutationCache||new rI),ye(this,Gs,e.defaultOptions||{}),ye(this,Xa,new Map),ye(this,Ja,new Map),ye(this,Ys,0)}mount(){Ic(this,Ys)._++,$(this,Ys)===1&&(ye(this,eo,Yp.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,jt).onFocus())})),ye(this,to,Eu.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,jt).onOnline())})))}unmount(){var e,t;Ic(this,Ys)._--,$(this,Ys)===0&&((e=$(this,eo))==null||e.call(this),ye(this,eo,void 0),(t=$(this,to))==null||t.call(this),ye(this,to,void 0))}isFetching(e){return $(this,jt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,qs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,jt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=$(this,jt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Qs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return $(this,jt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=$(this,jt).get(r.queryHash),a=s==null?void 0:s.state.data,o=$2(t,a);if(o!==void 0)return $(this,jt).build(this,r).setData(o,{...n,manual:!0})}
10setQueriesData(e,t,n){return Vt.batch(()=>$(this,jt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,jt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=$(this,jt);Vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=$(this,jt);return Vt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Vt.batch(()=>$(this,jt).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(ln).catch(ln)}invalidateQueries(e,t={}){return Vt.batch(()=>($(this,jt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Vt.batch(()=>$(this,jt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(ln)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(ln)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=$(this,jt).build(this,t);return n.isStaleByTime(Qs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ln).catch(ln)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ln).catch(ln)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Eu.isOnline()?$(this,qs).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,jt)}getMutationCache(){return $(this,qs)}getDefaultOptions(){return $(this,Gs)}setDefaultOptions(e){ye(this,Gs,e)}setQueryDefaults(e,t){$(this,Xa).set(qi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,Xa).values()],n={};return t.forEach(r=>{Sl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){$(this,Ja).set(qi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,Ja).values()],n={};return t.forEach(r=>{Sl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,Gs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Kp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Qp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,Gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,jt).clear(),$(this,qs).clear()}},jt=new WeakMap,qs=new WeakMap,Gs=new WeakMap,Xa=new WeakMap,Ja=new WeakMap,Ys=new WeakMap,eo=new WeakMap,to=new WeakMap,vk),Ik=h.createContext(void 0),wt=e=>{const t=h.useContext(Ik);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},oI=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Ik.Provider,{value:e,children:t})),Mk=h.createContext(!1),lI=()=>h.useContext(Mk);Mk.Provider;function cI(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uI=h.createContext(cI()),dI=()=>h.useContext(uI),fI=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Zp(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},hI=e=>{h.useEffect(()=>{e.clearReset()},[e])},mI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Zp(n,[e.error,r])),pI=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},gI=(e,t)=>e.isLoading&&e.isFetching&&!t,xI=(e,t)=>
10(e==null?void 0:e.suspense)&&t.isPending,yv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yI(e,t,n){var p,g,x,y;const r=lI(),s=dI(),a=wt(),o=a.defaultQueryOptions(e);(g=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||g.call(p,o);const l=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?"isRestoring":c?"optimistic":void 0,pI(o),fI(o,s,l),hI(s);const u=!a.getQueryCache().get(o.queryHash),[f]=h.useState(()=>new t(a,o)),d=f.getOptimisticResult(o),m=!r&&c;if(h.useSyncExternalStore(h.useCallback(v=>{const b=m?f.subscribe(Vt.batchCalls(v)):ln;return f.updateResult(),b},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),h.useEffect(()=>{f.setOptions(o)},[o,f]),xI(o,d))throw yv(o,f,s);if(mI({result:d,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw d.error;if((y=(x=a.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||y.call(x,o,d),o.experimental_prefetchInRender&&!Nl.isServer()&&gI(d,r)){const v=u?yv(o,f,s):l==null?void 0:l.promise;v==null||v.catch(ln).finally(()=>{f.updateResult()})}return o.notifyOnChangeProps?d:f.trackResult(d)}function it(e,t){return yI(e,J2)}function Dt(e,t){const n=wt(),[r]=h.useState(()=>new sI(n,e));h.useEffect(()=>{r.setOptions(e)},[r,e]);const s=h.useSyncExternalStore(h.useCallback(o=>r.subscribe(Vt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=h.useCallback((o,l)=>{r.mutate(o,l).catch(ln)},[r]);if(s.error&&Zp(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}/*! Capacitor: https://capacitorjs.com/ - MIT License */var no;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(no||(no={}));class Df extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const vI=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},bI=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},r=n.Plugins=n.Plugins||{},s=()=>t!==null?t.name:vI(e),a=()=>s()!=="web",o=d=>{const m=u.get(d);return!!(m!=null&&m.platforms.has(s())||l(d))},l=d=>{var m;return(m=n.PluginHeaders)===null||m===void 0?void 0:m.find(p=>p.name===d)},c=d=>e.console.error(d),u=new Map,f=(d,m={})=>{const p=u.get(d);if(p)return console.warn(`Capacitor plugin "${d}" already registered. Cannot register plugins twice.`),p.proxy;const g=s(),x=l(d);let y;const v=async()=>(!y&&g in m?y=typeof m[g]=="function"?y=await m[g]():y=m[g]:t!==null&&!y&&"web"in m&&(y=typeof m.web=="function"?y=await m.web():y=m.web),y),b=(E,N)=>{var k,A;if(x){const M=x==null?void 0:x.methods.find(L=>N===L.name);if(M)return M.rtype==="promise"?L=>n.nativePromise(d,N.toString(),L):(L,F)=>n.nativeCallback(d,N.toString(),L,F);if(E)return(k=E[N])===null||k===void 0?void 0:k.bind(E)}else{if(E)return(A=E[N])===null||A===void 0?void 0:A.bind(E);throw new Df(`"${d}" plugin is not implemented on ${g}`,no.Unimplemented)}},w=E=>{let N;const k=(...A)=>{const M=v().then(L=>{const F=b(L,E);if(F){const V=F(...A);return N=V==null?void 0:V.remove,V}else throw new Df(`"${d}.${E}()" is not implemented on ${g}`,no.Unimplemented)});return E==="addListener"&&(M.remove=async()=>N()),M};return k.toString=()=>`${E.toString()}() { [capacitor code] }`,Object.defineProperty(k,"name",{value:E,writable:!1,configurable:!1}),k},j=w("addListener"),S=w("removeListener"),C=(E,N)=>{const k=j({eventName:E},N),A=async()=>{const L=await k;S({eventName:E,callbackId:L},N)},M=new Promise(L=>k.then(()=>L({remove:A})));return M.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await A()},M},I=new Proxy({},{get(E,N){switch(N){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return x?C:j;case"removeListener":return S;default:return w(N)}}});return r[d]=I,u.set(d,{name:d,proxy:I,platforms:new Set([...Object.keys(m),...x?[g]:[]])}),I};return n.convertFileSrc||(n.convertFileSrc=d=>d),n.getPlatform=s,n.handleError=c,n.isNativePlatform=a,n.isPluginAvailable=o,n.registerPlugin=f,n.Exception=Df,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},wI=e=>e.Capacitor=bI(e),ro=wI(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),mr=ro.registerPlugin;class Jp{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),r&&this.sendRetainedArgumentsForEvent(t);const o=async()=>this.removeListener(t,n);return Promise.resolve({remove:o})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,r){const s=this.listeners[t];if(!s){if(r){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}s.forEach(a=>a(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new ro.Exception(t,no.Unimplemented)}unavailable(t="not available"){return new ro.Exception(t,no.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const s=r.indexOf(n);this.listeners[t].splice(s,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}
10addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(r=>{this.notifyListeners(t,r)}))}}const vv=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),bv=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class kI extends Jp{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[s,a]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");s=bv(s).trim(),a=bv(a).trim(),n[s]=a}),n}async setCookie(t){try{const n=vv(t.key),r=vv(t.value),s=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",a=(t.path||"/").replace("path=",""),o=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${s}; path=${a}; ${o};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}mr("CapacitorCookies",{web:()=>new kI});const SI=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const s=r.result;t(s.indexOf(",")>=0?s.split(",")[1]:s)},r.onerror=s=>n(s),r.readAsDataURL(e)}),NI=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(s=>s.toLocaleLowerCase()).reduce((s,a,o)=>(s[a]=e[t[o]],s),{})},jI=(e,t=!0)=>e?Object.entries(e).reduce((r,s)=>{const[a,o]=s;let l,c;return Array.isArray(o)?(c="",o.forEach(u=>{l=t?encodeURIComponent(u):u,c+=`${a}=${l}&`}),c.slice(0,-1)):(l=t?encodeURIComponent(o):o,c=`${a}=${l}`),`${r}&${c}`},"").substr(1):null,CI=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),s=NI(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(s.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[o,l]of Object.entries(e.data||{}))a.set(o,l);n.body=a.toString()}else if(s.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((l,c)=>{a.append(c,l)});else for(const l of Object.keys(e.data))a.append(l,e.data[l]);n.body=a;const o=new Headers(n.headers);o.delete("content-type"),n.headers=o}else(s.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class TI extends Jp{async request(t){const n=CI(t,t.webFetchExtra),r=jI(t.params,t.shouldEncodeUrlParams),s=r?`${t.url}?${r}`:t.url,a=await fetch(s,n),o=a.headers.get("content-type")||"";let{responseType:l="text"}=a.ok?t:{};o.includes("application/json")&&(l="json");let c,u;switch(l){case"arraybuffer":case"blob":u=await a.blob(),c=await SI(u);break;case"json":c=await a.json();break;case"document":case"text":default:c=await a.text()}const f={};return a.headers.forEach((d,m)=>{f[m]=d}
10),{data:c,headers:f,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}mr("CapacitorHttp",{web:()=>new TI});var wv;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(wv||(wv={}));var kv;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(kv||(kv={}));class EI extends Jp{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}mr("SystemBars",{web:()=>new EI});function _I(){return ro.isNativePlatform()?"https://repsshield.com"||"https://repsshield.com":""}function cl(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;const t=_I();if(!t)return e;const n=e.startsWith("/")?e:`/${e}`;return`${t}${n}`}async function _r(e,t){if(typeof e=="string")return fetch(cl(e),t);if(e instanceof URL)return fetch(new URL(cl(e.toString())),t);const n=new Request(cl(e.url),e);return fetch(n,t)}const AI="modulepreload",PI=function(e){return"/"+e},Sv={},ce=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=PI(c),c in Sv)return;Sv[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":AI,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((m,p)=>{d.addEventListener("load",m),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},Dk=mr("Preferences",{web:()=>ce(()=>import("./web-BkQ0Oa04.js"),__vite__mapDeps([0,1])).then(e=>new e.PreferencesWeb)}),Le=()=>{var r,s,a;if(typeof window>"u")return!1;const e=window.Capacitor,t=(r=window.location)==null?void 0:r.protocol,n=!!((a=(s=window.webkit)==null?void 0:s.messageHandlers)!=null&&a.bridge);return t==="capacitor:"||t==="ionic:"||n||typeof e<"u"&&e.isNativePlatform()},Ok=()=>{var e,t;return Le()&&((t=(e=window.Capacitor)==null?void 0:e.getPlatform)==null?void 0:t.call(e))==="android"},tc=()=>{var r,s,a,o,l,c;if(!Le())return!1;const e=(s=(r=window.Capacitor)==null?void 0:r.getPlatform)==null?void 0:s.call(r);if(e)return e==="ios";const t=((a=window.navigator)==null?void 0:a.userAgent)||"",n=/iPad|iPhone|iPod/.test(t);return!!((l=(o=window.webkit)==null?void 0:o.messageHandlers)!=null&&l.bridge)||n&&["capacitor:","ionic:"].includes((c=window.location)==null?void 0:c.protocol)},_u={};async function Au(e,t){_u[e]=t;try{localStorage.setItem(e,t)}catch{}if(Le())try{await Dk.set({key:e,value:t})}catch{}}function nc(e){if(e in _u)return _u[e];try{return localStorage.getItem(e)}catch{return null}}async function gm(e){delete _u[e];try{localStorage.removeItem(e)}catch{}if(Le())try{await Dk.remove({key:e})}catch{}}const Ed="accessToken",Lk="session_auth";async function Zs(e){await Promise.all([Au(Ed,e),Au(Lk,"true")])}function RI(){return nc(Ed)}async function Fk(){await Promise.all([gm(Ed),gm(Lk)])}function eg(){const e=nc(Ed);return e!==null&&e.length>0}const II=["accessToken","session_auth","refreshToken","user","demoMode","demoSubscriptionTier"],MI=["accessToken","refreshToken","connect.sid","authToken"];function DI(){const e=window.location.hostname,t=new Set;if(!e)return[];t.add(e),e&&!e.startsWith(".")&&t.add(`.${e}`);
10const n=e.split(".").filter(Boolean);if(n.length>2){const r=n.slice(-2).join(".");t.add(r),t.add(`.${r}`)}return[...t]}function OI(){const e="expires=Thu, 01 Jan 1970 00:00:00 GMT",t=["/",""],n=DI();for(const r of MI)for(const s of t){const a=s?`; path=${s}`:"";document.cookie=`${r}=; ${e}${a}`;for(const o of n)document.cookie=`${r}=; ${e}${a}; domain=${o}`}}const Nv=5e3;let Of=0;async function Or(e,t={}){const n=Date.now();if(!t.force&&n-Of<Nv){console.log("[auth] clearClientAuthState debounced — call within",Nv,"ms window"),Of=n;return}Of=n,await Fk(),await Promise.all(II.map(async r=>{try{localStorage.removeItem(r)}catch{}await gm(r)})),sessionStorage.clear(),await(e==null?void 0:e.cancelQueries()),e==null||e.setQueryData(["/api/auth/user"],null),e==null||e.removeQueries({queryKey:["/api/auth/user"]}),e==null||e.clear(),OI();try{const{clearOAuthState:r}=await ce(async()=>{const{clearOAuthState:s}=await Promise.resolve().then(()=>GI);return{clearOAuthState:s}},void 0);r()}catch{}}function so(e="/logout-success"){if(!Le()){window.location.replace(e);return}Pu()}function Pu(){if(!Le())return;const e="/login";`${window.location.pathname}${window.location.search}`!==e&&(window.history.replaceState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate")))}
10class Ks extends Error{constructor(t,n,r){super(t),this.status=n,this.body=r,this.name="ApiError"}}async function Ru(e){if(!e.ok){const t=await e.text()||e.statusText;if(e.status===429)throw console.warn("Rate limited - too many requests"),new Ks("Rate limited - please wait a moment before trying again",429);if(e.status===503&&e.headers.get("Replit-Proxy-Error")==="asleep")throw console.warn("Backend server is asleep - waking up..."),new Ks("Server is starting up - please wait a moment",503);try{const n=JSON.parse(t);if(n.message)throw new Ks(n.message,e.status,n)}catch(n){if(!(n instanceof SyntaxError))throw n}throw new Ks(`${e.status}: ${t}`,e.status)}}async function Ze(e,t,n){var l;console.group(`📡 [API] ${e} ${t}`);const r=nc("accessToken");let s={},a;n&&(n instanceof FormData?a=n:(s["Content-Type"]="application/json",a=JSON.stringify(n))),r&&(s.Authorization=`Bearer ${r}`);const o=await _r(t,{method:e,headers:s,body:a,credentials:"include"});if(console.groupEnd(),o.status===401&&r)try{const c=await _r("/api/auth/refresh",{method:"POST",credentials:"include"});if(c.ok){const u=await c.json();if((l=u.tokens)!=null&&l.accessToken){await Zs(u.tokens.accessToken),s.Authorization=`Bearer ${u.tokens.accessToken}`;const f=await _r(t,{method:e,headers:s,body:a,credentials:"include"});return await Ru(f),f}}}catch(c){throw console.error("Token refresh failed:",c),await Or(Ar),Pu(),c}return await Ru(o),o}const Vk=({on401:e})=>async({queryKey:t})=>{var c;const n=nc("accessToken"),r={};n&&(r.Authorization=`Bearer ${n}`);const[s,a]=t;let o=s;if(a&&Object.keys(a).length>0){const u=new URLSearchParams;Object.entries(a).forEach(([d,m])=>{m!=null&&u.append(d,String(m))});const f=u.toString();f&&(o=`${s}?${f}`)}const l=await _r(o,{credentials:"include",headers:r});if(l.status===401&&n)try{const u=await _r("/api/auth/refresh",{method:"POST",credentials:"include"});if(u.ok){const f=await u.json();if((c=f.tokens)!=null&&c.accessToken){await Zs(f.tokens.accessToken);const d=await _r(o,{credentials:"include",headers:{...r,Authorization:`Bearer ${f.tokens.accessToken}`}});return e==="returnNull"&&d.status===401?null:(await Ru(d),await d.json())}}}catch(u){if(console.error("Token refresh failed:",u),await Or(Ar),e==="returnNull")return null;throw Pu(),u}if(l.status===401){if(await Or(Ar),e==="returnNull")return null;Pu()}if(l.status===429){if(console.warn("Rate limited - too many requests to",t.join("/")),e==="returnNull")return null;throw new Error("Rate limited - too many requests")}return await Ru(l),await l.json()},Ar=new aI({defaultOptions:{queries:{queryFn:Vk({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1e3*2,retry:(e,t)=>t.message.includes("Rate limited")||t.message.includes("429")||t.message.includes("401")||t.message.includes("Unauthorized")?!1:e<1,retryDelay:e=>Math.min(1e3*2**e,3e4)},mutations:{retry:(e,t)=>t.message.includes("Rate limited")||t.message.includes("429")||t.message.includes("401")||t.message.includes("Unauthorized")?!1:e<1}}}),jv=Object.freeze(Object.defineProperty({__proto__:null,ApiError:Ks,apiRequest:Ze,getQueryFn:Vk,queryClient:Ar},Symbol.toStringTag,{value:"Module"})),$k=Ne.createContext(void 0),LI={user:{id:"demo-user-123",email:"[email protected]",firstName:"Sarah",lastName:"Martinez",profileImageUrl:"https://images.unsplash.com/photo-1494790108755-2616b332ef42?w=150",repType:"longTerm",isAdmin:!1,subscriptionStatus:"active",createdAt:"2024-01-15T08:00:00.000Z",updatedAt:new Date().toISOString()},properties:[{id:1,userId:"demo-user-123",nickname:"Downtown Loft Complex",address:"1247 Mission Street, Unit 302",city:"San Francisco",state:"CA",zipCode:"94103",propertyType:"Long-term Rental",createdAt:"2024-01-15T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:2,userId:"demo-user-123",nickname:"Suburban Family Home",address:"789 Elm Street",city:"Palo Alto",state:"CA",zipCode:"94301",propertyType:"Long-term Rental",createdAt:"2024-02-20T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:3,userId:"demo-user-123",nickname:"Beach House Airbnb",address:"456 Ocean Drive",city:"Santa Cruz",state:"CA",zipCode:"95060",propertyType:"Short-term Rental",createdAt:"2024-03-10T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:4,userId:"demo-user-123",nickname:"Mountain Cabin Retreat",address:"123 Pine Ridge Road",city:"Lake Tahoe",state:"CA",zipCode:"96150",propertyType:"Short-term Rental",createdAt:"2024-04-05T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:5,userId:"demo-user-123",nickname:"Tech Worker Condo",address:"901 Market Street, #1205",city:"San Francisco",state:"CA",zipCode:"94102",propertyType:"Long-term Rental",createdAt:"2024-05-12T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:6,userId:"demo-user-123",nickname:"University District Duplex",address:"2234 Telegraph Avenue",city:"Berkeley",state:"CA",zipCode:"94704",propertyType:"Long-term Rental",createdAt:"2024-06-18T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:7,userId:"demo-user-123",nickname:"Corporate Housing Unit",address:"567 Business Park Drive",city:"Sunnyvale",state:"CA",zipCode:"94086",propertyType:"Short-term Rental",createdAt:"2024-0
107-22T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:8,userId:"demo-user-123",nickname:"Artist Loft Studio",address:"890 Folsom Street, #4B",city:"San Francisco",state:"CA",zipCode:"94107",propertyType:"Long-term Rental",createdAt:"2024-08-14T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:9,userId:"demo-user-123",nickname:"Family Townhouse",address:"345 Residential Way",city:"San Mateo",state:"CA",zipCode:"94403",propertyType:"Long-term Rental",createdAt:"2024-09-08T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:10,userId:"demo-user-123",nickname:"Wine Country Villa",address:"678 Vineyard Lane",city:"Napa",state:"CA",zipCode:"94558",propertyType:"Short-term Rental",createdAt:"2024-10-15T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:11,userId:"demo-user-123",nickname:"Startup Incubator Space",address:"432 Innovation Blvd",city:"Mountain View",state:"CA",zipCode:"94041",propertyType:"Commercial",createdAt:"2024-11-02T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"},{id:12,userId:"demo-user-123",nickname:"Historic Victorian Rental",address:"1876 Victorian Street",city:"San Francisco",state:"CA",zipCode:"94115",propertyType:"Long-term Rental",createdAt:"2024-11-20T10:00:00.000Z",updatedAt:"2024-12-15T10:00:00.000Z"}],timeEntries:[{id:1,userId:"demo-user-123",propertyId:1,date:"2024-12-15T09:00:00.000Z",hours:3.5,activityType:"property-management",propertyType:"Long-term Rental",description:"Coordinated major HVAC system replacement with contractor team. Reviewed quotes, scheduled installation, and conducted quality inspection.",isMaterialParticipation:!0,evidenceFiles:["HVAC_Installation_Invoice.pdf","Before_After_Photos.jpg"],createdAt:"2024-12-15T09:00:00.000Z",updatedAt:"2024-12-15T09:00:00.000Z"},{id:2,userId:"demo-user-123",propertyId:3,date:"2024-12-14T14:00:00.000Z",hours:2,activityType:"leasing-tenant-relations",propertyType:"Short-term Rental",description:"Handled guest complaint about WiFi connectivity. Contacted internet provider, arranged technician visit, and provided compensation to guests.",isMaterialParticipation:!0,evidenceFiles:["Guest_Communication_Thread.pdf"],createdAt:"2024-12-14T14:00:00.000Z",updatedAt:"2024-12-14T14:00:00.000Z"},{id:4,userId:"demo-user-123",propertyId:2,date:"2024-12-12T16:00:00.000Z",hours:1.5,activityType:"bookkeeping-recordkeeping",propertyType:"Long-term Rental",description:"Monthly bookkeeping review - categorized expenses, reconciled bank statements, prepared quarterly tax documentation for CPA.",isMaterialParticipation:!1,evidenceFiles:["Monthly_P&L_Statement.pdf"],createdAt:"2024-12-12T16:00:00.000Z",updatedAt:"2024-12-12T16:00:00.000Z"},{id:5,userId:"demo-user-123",propertyId:4,date:"2024-12-11T10:00:00.000Z",hours:2.5,activityType:"vendor-contractor-management",propertyType:"Short-term Rental",description:"Interviewed and vetted new cleaning service providers. Compared rates, checked references, negotiated service agreements for three properties.",isMaterialParticipation:!0,evidenceFiles:["Cleaning_Service_Contracts.pdf","Reference_Check_Notes.docx"],createdAt:"2024-12-11T10:00:00.000Z",updatedAt:"2024-12-11T10:00:00.000Z"},{id:6,userId:"demo-user-123",propertyId:6,date:"2024-11-28T13:00:00.000Z",hours:3,activityType:"property-acquisition-activities",propertyType:"Long-term Rental",description:"Property inspection for potential acquisition in Berkeley. Conducted thorough walk-through, photographed condition issues, researched comparable sales.",isMaterialParticipation:!0,evidenceFiles:["Property_Inspection_Report.pdf","Inspection_Photos.zip"],createdAt:"2024-11-28T13:00:00.000Z",updatedAt:"2024-11-28T13:00:00.000Z"},{id:7,userId:"demo-user-123",propertyId:7,date:"2024-11-25T09:00:00.000Z",hours:1,activityType:"compliance-legal-administration",propertyType:"Short-term Rental",description:"Updated local business license and STR permit documentation. Filed quarterly occupancy tax returns with city of Sunnyvale.",isMaterialParticipation:!1,evidenceFiles:["Business_License_Renewal.pdf","Tax_Filing_Confirmation.pdf"],createdAt:"2024-11-25T09
10:00:00.000Z",updatedAt:"2024-11-25T09:00:00.000Z"},{id:8,userId:"demo-user-123",propertyId:8,date:"2024-11-22T15:00:00.000Z",hours:2,activityType:"travel-property-related-tasks",propertyType:"Long-term Rental",description:"Travel to artist loft for quarterly property inspection and tenant check-in. Documented maintenance needs and tenant satisfaction.",isMaterialParticipation:!0,evidenceFiles:["Travel_Mileage_Log.pdf","Quarterly_Inspection_Checklist.pdf"],createdAt:"2024-11-22T15:00:00.000Z",updatedAt:"2024-11-22T15:00:00.000Z"},{id:9,userId:"demo-user-123",propertyId:9,date:"2024-10-30T11:00:00.000Z",hours:4.5,activityType:"strategic-planning-portfolio-management",propertyType:"Long-term Rental",description:"Annual portfolio performance review and 2025 planning session. Analyzed ROI across all properties, identified optimization opportunities.",isMaterialParticipation:!0,evidenceFiles:["Portfolio_Performance_Analysis.xlsx","2025_Investment_Strategy.pdf"],createdAt:"2024-10-30T11:00:00.000Z",updatedAt:"2024-10-30T11:00:00.000Z"},{id:10,userId:"demo-user-123",propertyId:10,date:"2024-10-28T14:00:00.000Z",hours:2.5,activityType:"education-training-property-specific",propertyType:"Short-term Rental",description:"Attended Napa County STR regulation workshop. Learned about new noise ordinances and guest management requirements affecting wine country properties.",isMaterialParticipation:!1,evidenceFiles:["Workshop_Certificate.pdf","New_Regulations_Summary.pdf"],createdAt:"2024-10-28T14:00:00.000Z",updatedAt:"2024-10-28T14:00:00.000Z"}],milestones:[{id:1,userId:"demo-user-123",title:"Q4 2024 REP Hours Goal",targetHours:200,currentHours:145,deadline:"2024-12-31T23:59:59.000Z",category:"quarterly",isCompleted:!1,createdAt:"2024-10-01T10:00:00.000Z"},{id:2,userId:"demo-user-123",title:"Annual REP Status Achievement",targetHours:750,currentHours:642,deadline:"2024-12-31T23:59:59.000Z",category:"annual",isCompleted:!1,createdAt:"2024-01-01T10:00:00.000Z"}],analytics:{totalHours:642,materialParticipationHours:485,propertiesManaged:12,averageHoursPerWeek:15.2,complianceStatus:"on-track",monthlyTrend:"increasing",topActivityTypes:[{type:"property-management",hours:124,percentage:19.3},{type:"maintenance-repairs-oversight",hours:98,percentage:15.3},{type:"leasing-tenant-relations",hours:87,percentage:13.5},{type:"bookkeeping-recordkeeping",hours:76,percentage:11.8},{type:"vendor-contractor-management",hours:65,percentage:10.1}]}};let Wn={isDemoMode:!1,demoSubscriptionTier:"free"};function FI({children:e}){const t=()=>{Wn.isDemoMode=!0;try{localStorage.setItem("demoMode","true")}catch(c){console.warn("localStorage access failed:",c)}},n=()=>{Wn.isDemoMode=!1,Wn.demoSubscriptionTier="free";try{localStorage.removeItem("demoMode")}catch(c){console.warn("localStorage access failed:",c)}},r=()=>{Wn.demoSubscriptionTier=Wn.demoSubscriptionTier==="free"?"premium":"free"},s=()=>{Wn.demoSubscriptionTier="free"},a=["csv-export","ai-assistant","voice-to-text","image-analysis","milestones","advanced-analytics","calendar-sync","ai-description-analyzer","premium-analytics","advanced-reports","ai-chatbot-unlimited"],o=c=>Wn.isDemoMode?Wn.demoSubscriptionTier==="free"&&a.includes(c):!1,l=()=>{const c={...LI};return Wn.demoSubscriptionTier==="premium"?c.user.subscriptionStatus="active":(c.user.subscriptionStatus="inactive",c.milestones=[],c.timeEntries=c.timeEntries.slice(0,25)),c};try{localStorage.getItem("demoMode")==="true"&&(Wn.isDemoMode=!0)}catch(c){console.warn("Error accessing localStorage in DemoContext:",c)}return i.jsx($k.Provider,{value:{isDemoMode:Wn.isDemoMode,demoSubscriptionTier:Wn.demoSubscriptionTier,enterDemoMode:t,exitDemoMode:n,toggleDemoSubscription:r,resetDemo:s,getDemoData:l,isDemoFeatureBlocked:o},children:e})}function zk(){const e=Ne.useContext($k);return e===void 0?(console.warn("useDemo called outside DemoProvider - using fallback state"),{isDemoMode:!1,demoSubscriptionTier:"free",enterDemoMode:()=>console.warn("Demo not available: enterDemoMode called outside provider"),exitDemoMode:()=>console.warn("Demo not available: exitDemoMode called outside provider"),toggleDemoSubscription:()=>console.warn("Demo not available: toggleDemoSubscription called outside provider"),resetDemo:()=>console.warn("Demo not available: resetDemo called outside provider"),getDemoData:()=>({user:null}),isDemoFeatureBlocked:()=>!1}):e}const VI=1,$I=1e6;let Lf=0;function zI(){return Lf=(Lf+1)%Number.MAX_SAFE_INTEGER,Lf.toString()}const Ff=new Map,Cv=e=>{if(Ff.has(e))return;const t=setTimeout(()=>{Ff.delete(e),ul({type:"REMOVE_TOAST",toastId:e})},$I);Ff.set(e,t)},UI=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,VI)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;
10return n?Cv(n):e.toasts.forEach(r=>{Cv(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},au=[];let ou={toasts:[]};function ul(e){ou=UI(ou,e),au.forEach(t=>{t(ou)})}function BI({...e}){const t=zI(),n=s=>ul({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>ul({type:"DISMISS_TOAST",toastId:t});return ul({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Ht(){const[e,t]=h.useState(ou);return h.useEffect(()=>(au.push(t),()=>{const n=au.indexOf(t);n>-1&&au.splice(n,1)}),[e]),{...e,toast:BI,dismiss:n=>ul({type:"DISMISS_TOAST",toastId:n})}}const _d=mr("App",{web:()=>ce(()=>import("./web-BaZNN1KB.js"),__vite__mapDeps([2,1])).then(e=>new e.AppWeb)}),ir=mr("Browser",{web:()=>ce(()=>import("./web-CSqx1mRB.js"),__vite__mapDeps([3,1])).then(e=>new e.BrowserWeb)});class Uk extends Error{constructor(){super("OAuth cancelled by user"),this.name="OAuthCancelledError"}}let La=null,Yt=null,Xs=null,dl=null,Tv=null,xm=0;function Bk(e){const t=Date.now();if(Tv===e&&t-xm<2e3)return;Tv=e,xm=t,console.log("App opened with URL:",e);const n=new URL(e),r=n.protocol.replace(":","");if(r!=="com.repsshield.app"&&r!=="repsshield")return;if(n.hostname==="subscription"){const o=n.searchParams.get("status");Xs&&(Xs({status:o==="success"?"success":"cancelled",pending:!1}),Xs=null),ir.close().catch(()=>{});return}const a=n.searchParams.get("flow")||(Yt==null?void 0:Yt.flowType)||"login";dl==null||dl(e,a)}const Hk=e=>{Le()&&(dl=e,La&&La.remove(),_d.addListener("appUrlOpen",t=>{Bk(t.url)}).then(t=>{La=t}))},Wk=async()=>{La&&(await La.remove(),La=null),dl=null},qk=(e,t,n)=>{const r=new URL(cl(e));return r.searchParams.set("mobile","true"),r.searchParams.set("flow",t),r.searchParams.set("callback_url","com.repsshield.app://auth"),n&&r.searchParams.set("return_url",n),r.toString()};async function tg(e){var t,n;if(tc()){const r=(n=(t=window.Capacitor)==null?void 0:t.Plugins)==null?void 0:n.AuthSession;if(r)return new Promise((s,a)=>{r.start({url:e,callbackUrlScheme:"com.repsshield.app"}).then(o=>{o!=null&&o.url&&Bk(o.url),s()}).catch(o=>{const l=o.message||"",c=o.code||"";c==="CANCELED"||c==="canceledLogin"||/cancel/i.test(l)?(ng(),a(new Uk)):a(new Error(o.message||"Authentication failed"))})})}try{await ir.close()}catch{}await ir.open({url:e})}const ym=async(e="login",t)=>{if(!Le()){const r=e==="calendar"?"/api/auth/google/calendar":"/api/auth/google";window.location.href=t?`${r}?return_url=${encodeURIComponent(t)}`:r;return}Yt={flowType:e,returnUrl:t,pending:!0};const n=qk(e==="calendar"?"/api/auth/google/calendar":"/api/auth/google",e,t);console.log("Opening OAuth URL:",n),await tg(n)},Gk=async e=>{if(!Le()){const n=e?`/api/auth/apple?return_url=${encodeURIComponent(e)}`:"/api/auth/apple";window.location.href=n;return}Yt={flowType:"login",returnUrl:e,pending:!0};const t=qk("/api/auth/apple","login",e);await tg(t)},HI=async(e="mail",t)=>{if(!Le())throw new Error("Use the regular Microsoft auth flow for web");Yt={flowType:"microsoft",returnUrl:t,pending:!0};const n=await fetch(`/api/auth/microsoft/${e}/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({returnUrl:t,mobile:!0,callback_url:"com.repsshield.app://auth"})});if(!n.ok)throw new Error("Failed to get Microsoft auth URL");const{authUrl:r}=await n.json();await tg(r)},Yk=async()=>{if(Le())try{await ir.close()}catch(e){console.log("Error closing browser:",e)}},Kk=e=>{try{const n=new URL(e).searchParams,r=n.get("error");if(r)return{success:!1,error:decodeURIComponent(r),flowType:n.get("flow")||void 0};const s=n.get("token")||void 0,a=n.get("refresh_token")||void 0,o=n.get("flow")||(Yt==null?void 0:Yt.flowType),l=n.get("return_url")||(Yt==null?void 0:Yt.returnUrl);return{success:n.get("success")==="true"||!!s,token:s,refreshToken:a,flowType:o||"login",returnUrl:l||void 0}}catch{return{success:!1,error:"Failed to parse OAuth callback"}}},ng=()=>{Yt=null},vm=()=>(Yt==null?void 0:Yt.pending)===!0,jl=()=>xm,WI=()=>Yt,Qk=async e=>{if(!Le())throw new Error("openSubscriptionCheckout is only available on Capacitor");try{await ir.close()}catch{}return new Promise(t=>{let n=null,r=!1;const s=a=>{r||(r=!0,Xs=null,n==null||n.remove(),t(a))};Xs=a=>{s(a)},ir.addListener("browserFinished",()=>{const a=jl();
10Date.now()-a<3e3||(console.log("[Subscription] Browser dismissed before checkout completed"),s({status:"cancelled",pending:!1}))}).then(a=>{n=a}),ir.open({url:e}).catch(a=>{console.error("Failed to open subscription checkout:",a),s({status:"cancelled",pending:!1})})})},rg=async e=>{if(!Le())throw new Error("openBillingPortalNative is only available on Capacitor");try{await ir.close()}catch{}return new Promise(t=>{let n=null,r=!1;const s=a=>{r||(r=!0,Xs=null,n==null||n.remove(),t(a))};Xs=a=>{s(a)},ir.addListener("browserFinished",()=>{const a=jl();Date.now()-a<3e3||(console.log("[Subscription] Browser dismissed before portal completed"),s({status:"cancelled",pending:!1}))}).then(a=>{n=a}),ir.open({url:e}).catch(a=>{console.error("Failed to open billing portal:",a),s({status:"cancelled",pending:!1})})})},qI=e=>{Xs=e},GI=Object.freeze(Object.defineProperty({__proto__:null,OAuthCancelledError:Uk,clearOAuthState:ng,closeBrowser:Yk,getLastDeepLinkAt:jl,getOAuthState:WI,initAppUrlListener:Hk,isOAuthPending:vm,openAppleAuth:Gk,openBillingPortalNative:rg,openGoogleAuth:ym,openMicrosoftAuth:HI,openSubscriptionCheckout:Qk,parseOAuthCallback:Kk,removeAppUrlListener:Wk,setSubscriptionCallback:qI},Symbol.toStringTag,{value:"Module"})),Zk=h.createContext(null),YI=()=>{const e=h.useContext(Zk);if(!e)throw new Error("useCapacitorAuth must be used within CapacitorAuthProvider");return e};function KI(e){if(e instanceof Error){const t={name:e.name,message:e.message,stack:e.stack},n=e;return n.code&&(t.code=n.code),n.cause&&(t.cause=n.cause),t}try{return{type:typeof e,value:JSON.stringify(e)}}catch{return{type:typeof e,value:String(e)}}}const QI=({children:e})=>{const[,t]=pt(),n=wt(),{toast:r}=Ht(),[s,a]=h.useState(!1),o=h.useCallback(()=>{a(!1),ng(),sessionStorage.removeItem("oauth-in-progress"),sessionStorage.removeItem("oauthFlowInitiated"),sessionStorage.removeItem("oauthStartTime")},[]),l=h.useCallback(async(m,p)=>{console.log("Handling OAuth callback:",{url:m,flowType:p}),a(!0);try{await Yk();const g=Kk(m);if(!g.success){r({title:p==="calendar"?"Calendar Connection Failed":"Authentication Failed",description:g.error||"Failed to authenticate",variant:"destructive"}),p==="calendar"?t("/dashboard/sync-settings",{replace:!0}):t("/login?error=auth_failed");return}if(g.token){await Zs(g.token),g.refreshToken&&await Au("refreshToken",g.refreshToken),console.log("Tokens stored in localStorage:",{accessToken:g.token.substring(0,20)+"...",refreshToken:g.refreshToken?"present":"not present"});try{console.log("Verifying token with /api/auth/user..."),console.log("API Base URL:","https://repsshield.com"),console.log("Token (first 20 chars):",g.token.substring(0,20)+"...");const x=await _r("/api/auth/user",{method:"GET",headers:{Authorization:`Bearer ${g.token}`},credentials:Le()?"omit":"include"});if(console.log("Token verification response:",x.status),!x.ok){const b=await x.text();throw console.error("Token verification failed:",{status:x.status,statusText:x.statusText,body:b}),new Error(`Invalid token: ${x.status} - ${b}`)}const y=await x.json();console.log("User data received:",{id:y.id,email:y.email}),await Au("user",JSON.stringify(y)),n.setQueryData(["/api/auth/user"],y);const v=g.returnUrl||"/dashboard";t(v,{replace:!0})}catch(x){console.error("Token verification failed:",KI(x));let y="Could not verify your session. Please try again.";x instanceof Error&&(y=x.message),r({title:"Authentication Failed",description:y,variant:"destructive"}),t("/login?error=token_verification_failed")}}else{(p==="calendar"||p==="microsoft")&&await Promise.all([n.invalidateQueries({queryKey:["google-calendar","status"]}),n.invalidateQueries({queryKey:["microsoft-calendar","status"]}),n.invalidateQueries({queryKey:["microsoft-mail","status"]}),n.invalidateQueries({queryKey:["calendar","events"]}),n.invalidateQueries({queryKey:["mail","status"]}),n.invalidateQueries({queryKey:["/api/integrations/calendar-status"]})]),r({title:"Success",description:p==="calendar"?"Calendar connected successfully!":p==="microsoft"?"Outlook connected successfully!":"Authentication successful!"});const x=g.returnUrl||"/dashboard/sync-settings";t(x,{replace:!0})}}catch(g){console.error("Auth callback error:",g),r({title:"Authentication 
10Error",description:"An unexpected error occurred.",variant:"destructive"}),t("/login?error=auth_callback_error")}finally{o()}},[t,n,o,r]);h.useEffect(()=>{if(Le())return Hk(l),()=>{Wk()}},[l]),h.useEffect(()=>{if(!Le())return;const m=()=>{if(!vm())return;const g=jl();Date.now()-g<3e3||(console.log("[OAuth] User returned to app without completing auth — resetting"),o())};let p=null;return _d.addListener("appStateChange",g=>{g.isActive&&setTimeout(m,500)}).then(g=>{p=()=>{g.remove()}}),()=>{p&&p()}},[o]),h.useEffect(()=>{if(!Le())return;let m=null;return ir.addListener("browserFinished",()=>{if(!vm())return;const p=jl();Date.now()-p<3e3||(console.log("[OAuth] Browser dismissed before auth completed — resetting"),o())}).then(p=>{m=()=>{p.remove()}}),()=>{m&&m()}},[o]),h.useEffect(()=>{const m=new URLSearchParams(window.location.search),p=m.get("login"),g=m.get("error");if(g){r({title:"Authentication Failed",description:g==="token_verification_failed"?"Could not verify your session. Please try again.":"Sign in failed. Please try again.",variant:"destructive"});const x=window.location.pathname;window.history.replaceState({},"",x);return}if(p==="success"){const x=window.location.pathname;window.history.replaceState({},"",x)}},[r]);const c=h.useCallback(async m=>{if(Le()){a(!0);try{await ym("login",m)}catch(p){(p==null?void 0:p.name)==="OAuthCancelledError"?(console.log("Google auth cancelled by user"),o()):(console.error("Google auth error:",p),r({title:"Error",description:"Failed to open Google authentication.",variant:"destructive"}),o())}}else{const p=m?`/api/auth/google?return_url=${encodeURIComponent(m)}`:"/api/auth/google";window.location.href=p}},[o,r]),u=h.useCallback(async m=>{if(Le()){a(!0);try{await Gk(m)}catch(p){(p==null?void 0:p.name)==="OAuthCancelledError"?(console.log("Apple auth cancelled by user"),o()):(console.error("Apple auth error:",p),r({title:"Error",description:"Failed to open Apple authentication.",variant:"destructive"}),o())}}else{const p=m?`/api/auth/apple?return_url=${encodeURIComponent(m)}`:"/api/auth/apple";window.location.href=p}},[o,r]),f=h.useCallback(async m=>{if(Le()){a(!0);try{await ym("calendar",m)}catch(p){(p==null?void 0:p.name)==="OAuthCancelledError"?(console.log("Calendar auth cancelled by user"),o()):(console.error("Calendar auth error:",p),r({title:"Error",description:"Failed to open Google Calendar authentication.",variant:"destructive"}),o())}}else{const p=m?`/api/auth/google/calendar?return_url=${encodeURIComponent(m)}`:"/api/auth/google/calendar";window.location.href=p}},[o,r]),d={isCapacitor:Le(),isAndroid:Ok(),isIOS:tc(),isAuthenticating:s,openGoogleAuth:c,openAppleAuth:u,openCalendarAuth:f};return i.jsx(Zk.Provider,{value:d,children:e})};function ZI({children:e}){return h.useEffect(()=>{const t=localStorage.getItem("theme")||"light",n=document.documentElement;t==="dark"?n.classList.add("dark"):t==="light"?n.classList.remove("dark"):t==="system"&&(window.matchMedia("(prefers-color-scheme: dark)").matches?n.classList.add("dark"):n.classList.remove("dark"))},[]),i.jsx(i.Fragment,{children:e})}const Xk=h.createContext(void 0);function XI({children:e}){const[t,n]=h.useState(!1),[r,s]=h.useState(null),a=h.useCallback(()=>{n(!0)},[]),o=h.useCallback(()=>{n(!1)},[]),l=h.useCallback(()=>{r&&r()},[r]),c=h.useCallback(u=>{s(()=>u)},[]);return i.jsx(Xk.Provider,{value:{isOpen:t,openDialog:a,closeDialog:o,onEntryCreated:l,registerRefreshCallback:c},children:e})}function Jk(){const e=h.useContext(Xk);if(e===void 0)throw new Error("useNewEntryDialog must be used within a NewEntryDialogProvider");return e}const JI=h.createContext(void 0);function eM({children:e}){const[t,n]=h.useState(!1),r=it({queryKey:["/api/auth/user"],queryFn:async()=>{const o=await fetch("/api/auth/user");if(o.ok)return n(!0),o.json();if(n(!1),o.status===401)return null;throw new Error("Failed to fetch auth status")},retry:!1,staleTime:6e4}),s=it({queryKey:["/api/subscription/status"],queryFn:async()=>{const o=await fetch("/api/subscription/status");if(!o.ok)throw new Error("Failed to fetch subscription status");const l=await o.json();if(l.trialEndDate){const c=new Date,f=new Date(l.trialEndDate).getTime()-c.getTime(),d=Math.max(0,Math.ceil(f/(1e3*60*60*24)));return{...l,trialDaysRemaining:d,isTrialExpired:l.hasUsedTrial&&!l.isOnTrial&&l.subscriptionStatus!=="active"}}
10return{...l,trialDaysRemaining:0,isTrialExpired:l.hasUsedTrial&&!l.isOnTrial&&l.subscriptionStatus!=="active"}},enabled:t,staleTime:6e4,refetchInterval:3e5}),a=()=>{Ar.invalidateQueries({queryKey:["/api/subscription/status"]}),Ar.invalidateQueries({queryKey:["/api/auth/user"]})};return i.jsx(JI.Provider,{value:{status:s.data||null,isLoading:s.isLoading||r.isLoading,error:s.error,refetchStatus:a,isAuthenticated:t},children:e})}const eS=h.createContext(null);function tM({children:e}){const[t,n]=h.useState({isVisible:!1,id:"",mode:"fullscreen",loadingType:"auto",shouldShowEnhanced:!1}),r=h.useRef(null),s=h.useRef(null),a=h.useRef(null),o=h.useRef(null),l=h.useRef(""),c=h.useCallback(()=>`loading-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[]),u=h.useCallback((v={})=>{const b=c();l.current=b;const j=v.threshold??500,S=v.loadingType||"auto";r.current&&clearTimeout(r.current),a.current&&clearTimeout(a.current);let C=!1;return S==="enhanced"?C=!0:S==="minimal"&&(C=!1),r.current=setTimeout(()=>{l.current===b&&(o.current=Date.now(),n({isVisible:!0,id:b,message:v.message||"Please wait while we get everything ready for you...",subMessage:v.subMessage,progress:v.progress,mode:v.mode||"fullscreen",ariaLabel:v.ariaLabel,loadingType:S,threshold:j,shouldShowEnhanced:C,startTime:Date.now()}),S==="auto"&&(a.current=setTimeout(()=>{l.current===b&&n(I=>({...I,shouldShowEnhanced:!0}))},j)))},200),b},[c]),f=h.useCallback((v={})=>{const b=c();l.current=b;const j=v.threshold??500,S=v.loadingType||"auto";r.current&&(clearTimeout(r.current),r.current=null),a.current&&(clearTimeout(a.current),a.current=null);let C=!1;return S==="enhanced"&&(C=!0),o.current=Date.now(),n({isVisible:!0,id:b,message:v.message||"Please wait while we get everything ready for you...",subMessage:v.subMessage,progress:v.progress,mode:v.mode||"fullscreen",ariaLabel:v.ariaLabel,loadingType:S,threshold:j,shouldShowEnhanced:C,startTime:Date.now()}),S==="auto"&&(a.current=setTimeout(()=>{l.current===b&&n(I=>({...I,shouldShowEnhanced:!0}))},j)),b},[c]),d=h.useCallback(v=>{n(b=>b.isVisible?{...b,...v}:b)},[]),m=h.useCallback(v=>{if(v&&l.current!==v)return;r.current&&(clearTimeout(r.current),r.current=null),a.current&&(clearTimeout(a.current),a.current=null);const b=()=>{n(w=>({...w,isVisible:!1,shouldShowEnhanced:!1})),l.current=""};if(o.current){const w=Date.now()-o.current,j=400;w<j?s.current=setTimeout(b,j-w):b()}else b()},[]),p=h.useCallback(async(v,b={})=>{const w=u(b);try{const j=await v;return m(w),j}catch(j){throw m(w),j}},[u,m]),g=h.useCallback(()=>u({loadingType:"enhanced",message:"Signing you in...",mode:"fullscreen"}),[u]),x=h.useCallback(()=>u({loadingType:"enhanced",message:"Signing you out...",mode:"fullscreen"}),[u]);h.useEffect(()=>()=>{r.current&&clearTimeout(r.current),s.current&&clearTimeout(s.current),a.current&&clearTimeout(a.current)},[]);const y={loadingState:t,show:u,showSync:f,update:d,hide:m,showDuring:p,showForLogin:g,showForLogout:x};return i.jsx(eS.Provider,{value:y,children:e})}function tS(){const e=h.useContext(eS);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}const nS=h.createContext(void 0),nM=()=>{const e=h.useContext(nS);if(!e)throw new Error("useOnboarding must be used within OnboardingProvider");return e},Dc=[{id:"welcome",title:"Welcome to REPSShield! 🎉",description:"Let me show you around your new Real Estate Professional time tracking dashboard. This tour will help you understand all the features available to you.",targetSelector:'[data-tour="dashboard-header"]',position:"bottom"},{id:"rep-type",title:"Choose Your REP Type",description:"First, set your Real Estate Professional type. Toggle between Long-Term (750 hrs) and Short-Term (500 + 100 hrs) rentals. Click the expand button to see rental type details.",targetSelector:'[data-tour="rep-type-selector"]',position:"bottom"},{id:"progress-overview",title:"Track Your Progress",description:"This section shows your current REP status progress with visual indicators. You can see total hours, material participation hours, and monthly tracking all in one place.",targetSelector:'[data-tour="progress-overview"]',position:"bottom"},{id:"time-logging",title:"Log Your Activities",description:"Use this form to log your real estate activities. You can track hours, select activity types, add descriptions, and upload evidence files to support your REP status.",targetSelector:'[data-tour="time-logging-form"]',position:"left"},{id:"ai-assistant",title:"AI Assistant at Your Service",description:"Need help with REP requirements or tax questions? Our AI assistant can provide professional guidance and answer your real estate tax questions. Watch it open automatically!",targetSelector:'[data-tour="ai-chatbot"]',position:"left",page:"/dashboard",openChatbot:!0},{id:"stopwatch",title:"Real-Time Tracking",description:"Use the stopwatch to track t
10ime in real-time. Start it when you begin working, and it will automatically populate your time entry form when you stop.",targetSelector:'[data-tour="stopwatch"]',position:"left",page:"/dashboard",openStopwatch:!0},{id:"properties",title:"Manage Your Properties",description:"Now let's visit the Properties page! This grid shows all your rental properties where you can add new ones and manage existing properties. Each property can be linked to your time entries for better organization and reporting.",targetSelector:'[data-tour="properties-page"]',position:"top",page:"/properties"},{id:"activity-ledger",title:"View Your Activity History",description:"Let's visit the Activity Ledger page! Here you'll find all your logged activities in this interactive table where you can edit entries by clicking on them, upload evidence files, and export your data for tax purposes.",targetSelector:'[data-tour="activity-ledger-datatable"]',position:"top",page:"/activity-ledger"},{id:"analytics-overview",title:"Analytics Dashboard",description:"Now let's explore the analytics page! These summary cards show your productivity patterns, total hours, material participation progress, and REP compliance status at a glance.",targetSelector:'[data-tour="analytics-summary"]',position:"bottom",page:"/analytics"},{id:"analytics-charts",title:"Visual Analytics",description:"Interactive charts display your activity trends, peak productivity hours, and progress toward REP goals. Use these insights to optimize your time tracking strategy.",targetSelector:'[data-tour="analytics-charts"]',position:"top",page:"/analytics"},{id:"files-management",title:"File Vault & Management",description:"Next, let's visit the file vault! This secure storage system manages all your uploaded evidence files with AI-powered analysis and organization. Browse, search, and organize your files here.",targetSelector:'[data-tour="files-management"]',position:"top",page:"/files"},{id:"rules-overview",title:"Automation Rules System",description:"Welcome to Rules Management! This powerful system automatically categorizes your email and calendar activities based on rules you create. Explore the Unified, Mail, and Calendar tabs to set up automation and save time on manual activity tracking.",targetSelector:'[data-tour="rules-page-header"]',position:"bottom",page:"/rules-management"},{id:"complete",title:"Congratulations! You're All Set! 🎉",description:`Excellent! You've successfully completed the REPSShield tour and now know how to track your real estate activities across Dashboard, Properties, Activity Ledger, Analytics, Rules Management, and File Vault. You can restart this tour anytime from the help menu. Click "Finish" to start tracking your REP hours!`,targetSelector:'[data-tour="dashboard-header"]',position:"bottom",page:"/dashboard"}],rM=({children:e})=>{const[t,n]=h.useState(!1),[r,s]=h.useState(0),[a,o]=h.useState(!1),[l,c]=pt();h.useEffect(()=>{localStorage.getItem("repshield_onboarding_completed")==="true"&&o(!0)},[]);const u=()=>{o(!0),n(!0),s(0),c("/dashboard")},f=()=>{if(r<Dc.length-1){const y=Dc[r+1];y.page&&y.page!==l?(c(y.page),setTimeout(()=>{s(r+1)},1e3)):s(r+1)}else p()},d=()=>{if(r>0){const y=Dc[r-1];y.page&&y.page!==l?(c(y.page),setTimeout(()=>{s(r-1)},1e3)):s(r-1)}},m=()=>{p()},p=()=>{n(!1),s(0),o(!0),localStorage.setItem("repshield_onboarding_completed","true"),l!=="/dashboard"&&c("/dashboard")},x={isActive:t,currentStep:r,steps:Dc,startTour:u,nextStep:f,prevStep:d,skipTour:m,endTour:p,hasCompletedOnboarding:a,setHasCompletedOnboarding:o,restartTour:()=>{o(!1),n(!1),s(0),localStorage.removeItem("repshield_onboarding_completed"),l!=="/dashboard"&&c("/dashboard")}};return i.jsx(nS.Provider,{value:x,children:e})};class bm extends Ne.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught an error:",t,n),console.error("Error stack:",t.stack),console.error("Component stack:",n.componentStack),console.error("Production Error Details:",{message:t.message,stack:t.stack,componentStack:n.componentStack,url:window.location.href,userAgent:navigator.userAgent,t
10imestamp:new Date().toISOString()})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:i.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50 dark:bg-gray-900",children:i.jsxs("div",{className:"text-center p-8 max-w-md mx-auto",children:[i.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Something went wrong"}),i.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"We encountered an error while loading the application."}),!1,i.jsxs("div",{className:"space-x-3",children:[i.jsx("button",{className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",onClick:()=>window.location.reload(),children:"Reload Page"}),i.jsx("button",{className:"px-4 py-2 bg-gray-200 text-gray-800 rounded hover:bg-gray-300 transition-colors",onClick:()=>window.location.href="/",children:"Go Home"})]})]})}):this.props.children}}class sM extends Ne.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){if(t.message.includes("useState")||t.message.includes("useContext")||t.message.includes("useEffect")||t.message.includes("Cannot read properties of null"))return console.warn("HookErrorBoundary caught React hook error:",t.message),{hasError:!0,error:t};throw t}componentDidCatch(t,n){console.error("HookErrorBoundary details:",t,n)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:i.jsxs("div",{className:"p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:[i.jsx("h3",{className:"text-yellow-800 font-medium mb-2",children:"Loading Components..."}),i.jsx("p",{className:"text-yellow-700 text-sm",children:"Some components are still initializing. Please wait a moment."})]}):this.props.children}}function iM(){return i.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50 dark:bg-gray-900",children:i.jsxs("div",{className:"text-center p-8",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto mb-4"}),i.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"REPSShield"}),i.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Professional real estate tracking tool"})]})})}class aM extends Ne.Component{constructor(t){super(t),this.initializationTimer=null,this.initializeReact=()=>{try{if(typeof Ne<"u"&&Ne.useState&&Ne.useRef)this.setState({isReactReady:!0,error:null});else throw new Error("React hooks not available")}catch(n){console.warn("React hooks not ready, retrying...",n),setTimeout(()=>{try{this.setState({isReactReady:!0,error:null})}catch(r){this.setState({isReactReady:!1,error:r})}},2e3)}},this.state={isReactReady:!1,error:null}}componentDidMount(){this.initializationTimer=setTimeout(()=>{this.initializeReact()},100)}componentWillUnmount(){this.initializationTimer&&clearTimeout(this.initializationTimer)}render(){return this.state.isReactReady?this.state.error?i.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50 dark:bg-gray-900",children:i.jsxs("div",{className:"text-center p-8",children:[i.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Initializing Application"}),i.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"Please wait while we set up your workspace..."}),i.jsx("button",{className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",onClick:()=>window.location.reload(),children:"Refresh Page"})]})}):this.props.children:i.jsx(iM,{})}}function oM(){return i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsxs("div",{className:"text-center",children:[i.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Loading application..."}),i.jsx("p",{className:"text-gray-600",children:"Please wait while we start up."})]})})}function lM({children:e}){return i.jsx(aM,{children:i.jsx(bm,{fallback:i.jsx(oM,{}),children:i.jsx(FI,{children:i.jsx(oI,{client:Ar,children:i.jsx(sM,{children:i.jsx(eM,{children:i.jsx(ZI,{children:i.jsx(QI,{children:i.jsx(XI,{children:i.jsx(tM,{children:i.jsx(rM,{children:i.jsx(bm,{children:e})})})})})})})})})})})})}async function cM(){const e=RI(),t=e?{Authorization:`Bearer ${e}`}:{},n=await fetch("/api/auth/user",{credentials:"include",cache:"no-cache",headers:t});if(n.status===401)throw(await n.json().catch(()=>({}))).accountCanceled&&(window.location.href="/login?reason=account_canceled"),new Error("Unauthorized");if(!n.ok)throw new Error(`HTTP error: ${n.status}`);return n.json()}function uM(e={}){var u,f,d;const{enabled:t=!0}=e;wt();const{data:n,isLoading:r,error:s,isError:a}=it({queryKey:["/api/auth/user"],enabled:t,queryFn:cM,retry:(m,p)=>p.message.includes("401")||p.message.includes("Unauthorized")||p.message.includes("429")?!1:p.message.includes("Server is starting up")||p.message.includes("503")?m<3:m<1,retryDelay:m=>Math.min(1e3*2**m,5e3),refetchOnWindowFocus:!1,refetchOnMount:!1,refetchInterval:!1,staleTime:6e4,gcTime:6e4}),o=((u=s==null?void 0:s.message)==null?void 0:u.includes("401"))||((f=s==null?void 0:s.message)==null?void 0:f.includes("Unauthorized"))||(s==null?void 0:s.status)===401||((d=s==null?void 0:s.response)==null?void 0:d.status)===401,l=o||a?null:n??null,c=!o&&!a&&l!==null;return{user:l,isLoading:r&&!a,isAuthenticated:c,isAdmin:c&&!!(l!=null&&l.isAdmin),error:a?s:null}}function At(e={}){const t=wt(),n=uM(e),{user:r,isLoading:s,isAuthenticated:a,isAdmin:o,error:l}=n;let c;try{c=zk()}catch{c={isDemoMode:!1,demoSubscriptionTier:"free",getDemoData:()=>({user:null})}}const{isDemoMode:u,demoSubscriptionTier:f,getDemoData:d}=c;let m=r;u&&(m={...d().user,subscriptionStatus:f==="premium"?"active":"inactive",isAdmin:(r==null?void 0:r.isAdmin)||!1});async function p(w){var C;const j=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(w)}),S=await j.json().catch(()=>({}));if(!j.ok)throw new Error(S.message||"Login failed");return(C=S.tokens)!=null&&C.accessToken&&await Zs(S.tokens.accessToken),t.invalidateQueries({queryKey:["/api/auth/user"]}),{success:!0,user:S.user,tokens:S.tokens,redirectUrl:S.redirectUrl}}async function g(w){var C;const j=await fetch("/api/auth/signup",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(w)}),S=await j.json().catch(()=>({}));if(!j.ok)throw new Error(S.message||"Signup failed");return(C=S.tokens)!=null&&C.accessToken&&await Zs(S.tokens.accessToken),t.invalidateQueries({queryKey:["/api/auth/user"]}),{success:!0,user:S.user,tokens:S.tokens}}async function x(){try{await _r("/api/auth/logout",{method:"POST",credentials:"include"})}finally{await Or(t,{force:!0}),so("/login")}}async function y(){var w;try{const j=await fetch("/api/auth/refresh",{method:"POST",credentials:"include"});if(!j.ok)return null;const S=await j.json();if((w=S.tokens)!=null&&w.accessToken)return await Zs(S.tokens.accessToken),S.tokens}catch{}return null}function v(){t.invalidateQueries({queryKey:["/api/auth/user"]})}function b(){Or(t)}return{user:m,isLoading:s,isAuthenticated:a,isAdmin:o,error:l,login:p,signup:g,logout:x,refreshToken:y,refetchAuth:v,clearAuth:b}}function dM(){const[e]=pt(),{user:t,isAdmin:n}=At();h.useEffect(()=>{typeof window<"u"&&window.dataLayer&&window.dataLayer.push({event:"page_view",page_path:e,page_title:document.title,user_authenticated:!!t,is_admin:!!n})},[e,t,n])}function fM(){h.useEffect(()=>{const e=new URL(window.location.href);if(e.searchParams.has("logout")||e.searchParams.has("bust")||e.searchParams.has("emergency_logout")){e.searchParams.delete("logout"),e.searchParams.delete("bust"),e.searchParams.delete("emergency_logout"),e.searchParams.delete("clear_cache"),window.history.replaceState({},"",e.toString());try{Ar.removeQueries({queryKey:["/api/auth/user"]}),Ar.setQueryData(["/api/auth/user"],null),Ar.invalidateQueries({queryKey:["/api/auth/user"]})}catch{}}},[]),h.useEffect(()=>{window.location.hostname.includes("picard.replit.dev")&&window.location.search.includes("clearCache")&&ce(async()=>{const{clearAllCaches:t}=await Promise.resolve().then(()=>zie);return{clearAllCaches:t}},void 0).then(({clearAllCaches:t})=>{t().then(()=>{const n=new URL(window.location.href);n.searchParams.delete("clearCache"),window.history.replaceState({},"",n.toString())})})},[])}const hM=[{path:"/",component:h.lazy(()=>ce(()=>import("./LandingPage-Ctn-rx0z.js"),__vite__mapDeps([4,1,5,6,7,8,9,10,11,12])).then(e=>({default:e.default}))),prerender:!0,category:"marketing",isLandingPage:!0},{path:"/landing-preview",component:h.lazy(()=>ce(()=>import("./LandingPreviewPage-ah2UzVRD.js"),__vite__mapDeps([13,1,9,11]))),prerender:!1,category:"marketing",isLandingPage:!0},{path:"/pricing",component:h.lazy(()=>ce(()=>import("./PricingPage-D-n7KPko.js"),__vite__mapDeps([14,1,15]))),prerender:!0,category:"marketing",isLandingPage:!0},{path:"/features",component:h.lazy(()=>ce(()=>import("./FeaturesPage-D2UEWFI-.js"),__vite__mapDeps([16,1]))),prerender:!0,category:"marketing",isLandingPage:!0},{path:"/about",component:h.lazy(()=>ce(()=>import("./AboutPage-CB060gXB.js"),__vite__mapDeps([17,1]))),prerender:!0,category:"marketing",isLandingPage:!0},{path:"/why-reps-shield",component:h.lazy(()=>ce(()=>import("./WhyRepsShieldPage-D-2s07Dm.js"),__vite__mapDeps([18,1]))),prerender:!0,category:"marketing",isLandingPage:!0},{path:"/repstracker-alternative",component:h.lazy(()=>ce(()=>import("./ComparisonPage-TYiI_HVL.js"),__vite__mapDeps([19,1,6]))),prerender:!0,category:"marketing",isLandingPage:!1},{path:"/repslog-alternative",component:h.lazy(()=>ce(()=>import("./REPSLogComparisonPage-XRmg67SL.js"),__vite__mapDeps([20,1,6]))),prerender:!0,category:"marketing",isLandingPage:!1},{path:"/changelog",component:h.lazy(()=>ce(()=>import("./ChangelogPage-DOR6uQYn.js"),__vite__mapDeps([21,1]))),prerender:!0,category:"marketing",isLandingPage:!0},{path:"/docs/api",component:h.lazy(()=>ce(()=>import("./ApiDocsPage-37vQoMax.js"),__vite__mapDeps([22,1,23,24]))),prerender:!0,category:"marketing",isLandingPage:!0}],mM=[{path:"/features/time-tracking",component:h.lazy(()=>ce(()=>import("./TimeTrackingPage-ZwinGdOl.js"),__vite__mapDeps([25,1,26,27]))),prerender:!0,category:"features",isLandingPage:!0},{path:"/features/material-participation",component:h.lazy(()=>ce(()=>import("./MaterialParticipationPage-zchqDgNb.js"),__vite__mapDeps([28,1,7]))),prerender:!0,category:"features",isLandingPage:!0},{path:"/features/audit-ready-reporting",component:h.lazy(()=>ce(()=>import("./AuditReadyReportingPage-CT3FMLCA.js"),__vite__mapDeps([29,1,30]))),prerender:!0,category:"features",isLandingPage:!0},{path:"/features/goal-progress-tracker",component:h.lazy(()=>ce(()=>import("./GoalProgressTrackerPage-B0R2YieO.js"),__vite__mapDeps([31,1,32]))),prerender:!0,category:"features",isLandingPage:!0},{path:"/features/multi-property-support",component:h.lazy(()=>ce(()=>import("./MultiPropertySupportPage-gstFn5tH.js"),__vite__mapDeps([33,1,34]))),prerender:!0,category:"features",isLandingPage:!0},{path:"/features/premium-features",component:h.lazy(()=>ce(()=>import("./PremiumFeaturesPage-BjXs5bMy.js"),__vite__mapDeps([35,1,6,27]))),prerender:!0,category:"features",isLandingPage:!0}],pM=[{path:"/tools",component:h.lazy(()=>ce(()=>import("./ToolsIndexPage-CIQxgUNu.js"),__vite__mapDeps([36,1,7,37]))),prerender:!0,category:"tools",isLandingPage:!0},{path:"/tools/rental-calculator",component:h.lazy(()=>ce(()=>import("./RentalCalculatorPage-BJ4b0wNY.js"),__vite__mapDeps([38,1,39,7,40,41,42,37,24]))),prerender:!0,category:"tools",isLandingPage:!0},{path:"/tools/brrr-calculator",component:h.lazy(()=>ce(()=>import("./BrrrCalculatorPage-DkMA61Qn.js"),__vite__mapDeps([43,1,40,39,7,41,42,37,24]))),prerender:!0,category:"tools",isLandingPage:!0},{path:"/tools/rep-status-calculator",component:h.lazy(()=>ce(()=>import("./RepStatusCalculatorPage-D4B3Lbcw.js"),__vite__mapDeps([44,1,45,37,24]))),prerender:!0,category:"tools",isLandingPage:!0},{path:"/tools/rep-status-audit-scan",component:h.lazy(()=>ce(()=>import("./RepStatusAuditScanPage-DMp3VLUZ.js"),__vite__mapDeps([46,1,47,37,24,45]))),prerender:!0,category:"tools",isLandingPage:!0},{path:"/tools/rep-hours-tracker",component:h.lazy(()=>ce(()=>import("./RepHoursTrackerPage-h_VYbM6y.js"),__vite__mapDeps([48,1,47,24]))),prerender:!0,category:"tools",isLandingPage:!0},{path:"/tools/1031-exchange-timer",component:h.lazy(()=>ce(()=>import("./ExchangeTimerPage-C9g4P_w0.js"),__vite__mapDeps([49,1,7,41,50,51,52]))),prerender:!0,category:"tools",isLandingPage:!0},{path:"/tools/1031-exchange-share/:id",component:h.lazy(()=>ce(()=>import("./ExchangeSharedPage-WetRR6ex.js"),__vite__mapDeps([53,1,7,52,41,50,51]
10))),prerender:!1,category:"tools",isLandingPage:!0},{path:"/tools/cost-seg-estimator",component:h.lazy(()=>ce(()=>import("./CostSegEstimatorPage-C3dg4zg9.js"),__vite__mapDeps([54,1]))),prerender:!0,category:"tools",isLandingPage:!0},{path:"/tools/cost-seg-estimator/chat",component:h.lazy(()=>ce(()=>import("./CostSegEstimatorChatPage-CeXMsFkO.js"),__vite__mapDeps([55,1]))),prerender:!1,category:"tools",isLandingPage:!0}],gM=[{path:"/blog",component:h.lazy(()=>ce(()=>import("./BlogIndexPage-C29kYTzC.js"),__vite__mapDeps([56,1,9,57,58,59,11]))),prerender:!1,category:"marketing",isLandingPage:!0},{path:"/blog/category/:slug",component:h.lazy(()=>ce(()=>import("./BlogCategoryPage-A3BHuZ4B.js"),__vite__mapDeps([60,1,9,57,58,59,11]))),prerender:!1,category:"marketing",isLandingPage:!0},{path:"/blog/:slug",component:h.lazy(()=>ce(()=>import("./BlogPostPage-C5-MNipH.js"),__vite__mapDeps([61,1,9,10,57,58,11]))),prerender:!1,category:"marketing",isLandingPage:!0}],xM=[{path:"/login",component:h.lazy(()=>ce(()=>Promise.resolve().then(()=>Kq),void 0)),prerender:!0,category:"auth",isLandingPage:!1},{path:"/register",component:h.lazy(()=>ce(()=>import("./RegisterPage-B85NkDfH.js"),__vite__mapDeps([62,1]))),prerender:!0,category:"auth",isLandingPage:!1},{path:"/forgot-password",component:h.lazy(()=>ce(()=>import("./ForgotPasswordPage-BIy0pQ6m.js"),__vite__mapDeps([63,1]))),prerender:!1,category:"auth",isLandingPage:!1},{path:"/reset-password",component:h.lazy(()=>ce(()=>import("./ResetPasswordPage-BujKzLJv.js"),__vite__mapDeps([64,1]))),prerender:!1,category:"auth",isLandingPage:!1},{path:"/logout-success",component:h.lazy(()=>ce(()=>import("./LogoutSuccessPage-FcS1iM5p.js"),__vite__mapDeps([65,1]))),prerender:!1,category:"auth",isLandingPage:!1},{path:"/accept-invite/:token",component:h.lazy(()=>ce(()=>import("./AcceptInvitePage-Wuqgi1dW.js"),__vite__mapDeps([66,1,67]))),prerender:!1,category:"auth",isLandingPage:!1}],yM=[{path:"/privacy",component:h.lazy(()=>ce(()=>import("./PrivacyPage-DCrOSave.js"),__vite__mapDeps([68,1,69,70,52,26,71]))),prerender:!0,category:"legal",isLandingPage:!0},{path:"/terms",component:h.lazy(()=>ce(()=>import("./TermsPage-B_kALELF.js"),__vite__mapDeps([72,1,69,70,71]))),prerender:!0,category:"legal",isLandingPage:!1}],vM=[{path:"/affiliate-program",component:h.lazy(()=>ce(()=>import("./AffiliateProgramPage-DPL2L4gY.js"),__vite__mapDeps([73,1,30]))),prerender:!0,category:"affiliate",isLandingPage:!0},{path:"/affiliate-signup",component:h.lazy(()=>ce(()=>import("./AffiliateSignupPage-DWsrj6-Z.js"),__vite__mapDeps([74,1,75]))),prerender:!0,category:"affiliate",isLandingPage:!0}],bM=[{path:"/diagnostics",component:h.lazy(()=>ce(()=>import("./diagnostics-RFvvhfwp.js"),__vite__mapDeps([76,1,45]))),prerender:!1,category:"debug",isLandingPage:!1},{path:"/public-diagnostics",component:h.lazy(()=>ce(()=>import("./public-diagnostics-D4285yRr.js"),__vite__mapDeps([77,1,45]))),prerender:!1,category:"debug",isLandingPage:!1},{path:"/debug-deployment",component:h.lazy(()=>ce(()=>import("./debug-deployment-D819FpVu.js"),__vite__mapDeps([78,1,45]))),prerender:!1,category:"debug",isLandingPage:!1}],Cl=[...hM,...mM,...pM,...gM,...xM,...yM,...vM,...bM],wM=Cl.filter(e=>e.isLandingPage).map(e=>e.path),kM=Cl.filter(e=>e.category!=="debug").map(e=>e.path);Cl.filter(e=>e.prerender).map(e=>e.path);function rS(e){const t=e.split(/[?#]/,1)[0]||"/";return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function Ev(e){const t=rS(e);return wM.includes(t)||t.startsWith("/features/")||t.startsWith("/tools/")||t.startsWith("/blog/")}function sg(e){const t=rS(e);return kM.some(n=>t===n||t.startsWith(n+"/"))||t.startsWith("/tools/")}function _v(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ei(...e){return t=>{let n=!1;const r=e.map(s=>{const a=_v(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():_v(e[s],null)}}}}function Ae(...e){return h.useCallback(ei(...e),e)}function ti(e){const t=h.forwardRef((n,r)=>{let{children:s,...a}=n,o=null,l=!1;const c=[];Av(s)&&typeof Oc=="function"&&(s=Oc(s._payload)),h.Children.forEac
10h(s,m=>{var p;if(TM(m)){l=!0;const g=m;let x="child"in g.props?g.props.child:g.props.children;Av(x)&&typeof Oc=="function"&&(x=Oc(x._payload)),o=NM(g,x),c.push((p=o==null?void 0:o.props)==null?void 0:p.children)}else c.push(m)}),o?o=h.cloneElement(o,void 0,c):!l&&h.Children.count(s)===1&&h.isValidElement(s)&&(o=s);const u=o?CM(o):void 0,f=Ae(r,u);if(!o){if(s||s===0)throw new Error(l?PM(e):AM(e));return s}const d=jM(a,o.props??{});return o.type!==h.Fragment&&(d.ref=r?f:u),h.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}var sS=ti("Slot"),iS=Symbol.for("radix.slottable");function SM(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=iS,t}var NM=(e,t)=>{if("child"in e.props){const n=e.props.child;return h.isValidElement(n)?h.cloneElement(n,void 0,e.props.children(n.props.children)):null}return h.isValidElement(t)?t:null};function jM(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function CM(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function TM(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iS}var EM=Symbol.for("react.lazy");function Av(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===EM&&"_payload"in e&&_M(e._payload)}function _M(e){return typeof e=="object"&&e!==null&&"then"in e}var AM=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,PM=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Oc=qp[" use ".trim().toString()];function aS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=aS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function oS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=aS(e))&&(r&&(r+=" "),r+=t);return r}const Pv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rv=oS,So=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Rv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(u=>{const f=n==null?void 0:n[u],d=a==null?void 0:a[u];if(f===null)return null;const m=Pv(f)||Pv(d);return s[u][m]}),l=n&&Object.entries(n).reduce((u,f)=>{let[d,m]=f;return m===void 0||(u[d]=m),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:m,...p}=f;return Object.entries(p).every(g=>{let[x,y]=g;return Array.isArray(y)?y.includes({...a,...l}[x]):{...a,...l}[x]===y})?[...u,d,m]:u},[]);return Rv(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},ig="-",RM=e=>{const t=MM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(ig);return l[0]===""&&l.length!==1&&l.shift(),lS(l,t)||IM(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},lS=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?lS(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(ig);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},Iv=/^\[(.+)\]$/,IM=e=>{if(Iv.test(e)){const t=Iv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},MM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return OM(Object.entries(e.classGroups),n).forEach(([a,o])=>{wm(o,r,a,t)}),r},wm=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:Mv(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(DM(s)){wm(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}
vendor: 4,839 bytes, line 10
10Object.entries(s).forEach(([a,o])=>{wm(o,Mv(t,a),n,r)})})},Mv=(e,t)=>{let n=e;return t.split(ig).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},DM=e=>e.isThemeGetter,OM=(e,t)=>t?e.map(([n,r])=>{const s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,s]}):e,LM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return s(a,o),o},set(a,o){n.has(a)?n.set(a,o):s(a,o)}}},cS="!",FM=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,o=l=>{const c=[];let u=0,f=0,d;for(let y=0;y<l.length;y++){let v=l[y];if(u===0){if(v===s&&(r||l.slice(y,y+a)===t)){c.push(l.slice(f,y)),f=y+a;continue}if(v==="/"){d=y;continue}}v==="["?u++:v==="]"&&u--}const m=c.length===0?l:l.substring(f),p=m.startsWith(cS),g=p?m.substring(1):m,x=d&&d>f?d-f:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:x}};return n?l=>n({className:l,parseClassName:o}):o},VM=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},$M=e=>({cache:LM(e.cacheSize),parseClassName:FM(e),...RM(e)}),zM=/\s+/,UM=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(zM);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:f,hasImportantModifier:d,baseClassName:m,maybePostfixModifierPosition:p}=n(u);let g=!!p,x=r(g?m.substring(0,p):m);if(!x){if(!g){l=u+(l.length>0?" "+l:l);continue}if(x=r(m),!x){l=u+(l.length>0?" "+l:l);continue}g=!1}const y=VM(f).join(":"),v=d?y+cS:y,b=v+x;if(a.includes(b))continue;a.push(b);const w=s(x,g);for(let j=0;j<w.length;++j){const S=w[j];a.push(v+S)}l=u+(l.length>0?" "+l:l)}return l};function BM(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=uS(t))&&(r&&(r+=" "),r+=n);return r}const uS=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=uS(e[r]))&&(n&&(n+=" "),n+=t);return n};function HM(e,...t){let n,r,s,a=o;function o(c){const u=t.reduce((f,d)=>d(f),e());return n=$M(u),r=n.cache.get,s=n.cache.set,a=l,l(c)}function l(c){const u=r(c);if(u)return u;const f=UM(c,n);return s(c,f),f}return function(){return a(BM.apply(null,arguments))}}const vt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},dS=/^\[(?:([a-z-]+):)?(.+)\]$/i,WM=/^\d+\/\d+$/,qM=new Set(["px","full","screen"]),GM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,YM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,KM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,QM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yr=e=>Fa(e)||qM.has(e)||WM.test(e),js=e=>No(e,"length",iD),Fa=e=>!!e&&!Number.isNaN(Number(e)),Vf=e=>No(e,"number",Fa),Lo=e=>!!e&&Number.isInteger(Number(e)),XM=e=>e.endsWith("%")&&Fa(e.slice(0,-1)),He=e=>dS.test(e),Cs=e=>GM.test(e),JM=new Set(["length","size","percentage"]),eD=e=>No(e,JM,fS),tD=e=>No(e,"position",fS),nD=new Set(["image","url"]),rD=e=>No(e,nD,oD),sD=e=>No(e,"",aD),Fo=()=>!0,No=(e,t,n)=>{const r=dS.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},iD=e=>YM.test(e)&&!KM.test(e),fS=()=>!1,aD=e=>QM.test(e),oD=e=>ZM.test(e),lD=()=>{const e=vt("colors"),t=vt("spacing"),n=vt("blur"),r=vt("brightness"),s=vt("borderColor"),a=vt("borderRadius"),o=vt("borderSpacing"),l=vt("borderWidth"),c=vt("contrast"),u=vt("grayscale"),f=vt("hueRotate"),d=vt("invert"),m=vt("gap"),p=vt("gradientColorStops"),g=vt("gradientColorStopPositions"),x=vt("inset"),y=vt("margin"),v=vt("opacity"),b=vt("padding"),w=vt("saturate"),j=vt("scale"),S=vt("sepia"),C=vt("skew"),I=vt("space"),E=vt("translate"),N=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",He,t],M=()=>[He,t],L=()=>["",Yr,js],F=()=>["auto",Fa,He],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],P=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",He],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[Fa,He];return{cacheSize:500,separator:":",theme:{colors:[Fo],spacing:[Yr,js],blur:["none","",Cs,He],brightness:G(),borderColor:[e],borderRadius:["n
10one","","full",Cs,He],borderSpacing:M(),borderWidth:L(),contrast:G(),grayscale:D(),hueRotate:G(),invert:D(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[XM,js],inset:A(),margin:A(),opacity:G(),padding:M(),saturate:G(),scale:G(),sepia:D(),skew:G(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[Cs]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),He]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Lo,He]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",Lo,He]}],"grid-cols":[{"grid-cols":[Fo]}],"col-start-end":[{col:["auto",{span:["full",Lo,He]},He]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Fo]}],"row-start-end":[{row:["auto",{span:[Lo,He]},He]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,t]}],"min-w":[{"min-w":[He,t,"min","max","fit"]}],"max-w":[{"max-w":[He,t,"none","full","min","max","fit","prose",{screen:[Cs]},Cs]}],h:[{h:[He,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Cs,js]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vf]}],"font-family":[{font:[Fo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",He]}],"line-clamp":[{"line-clamp":["none",Fa,Vf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yr,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yr,js]}],"underline-offset":[{"underline-offset":["auto",Yr,He]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),tD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},rD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}
vendor: 5,180 bytes, line 10
10],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Yr,He]}],"outline-w":[{outline:[Yr,js]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Yr,js]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Cs,sD]}],"shadow-color":[{shadow:[Fo]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...P(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Cs,He]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",He]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Lo,He]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
10],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Yr,js,Vf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},cD=HM(lD);function W(...e){return cD(oS(e))}function Wie(e){const t=typeof e=="string"?parseFloat(e):e;return isNaN(t)?"0.0":t.toFixed(1)}function hS(e){if(!e)return"";try{return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0})}catch{return""}}function qie(e){const t=new Date(e),n=new Date,r=(a,o)=>a.getFullYear()===o.getFullYear()&&a.getMonth()===o.getMonth()&&a.getDate()===o.getDate(),s=a=>{const o=new Date;return o.setDate(n.getDate()-1),r(a,o)};return r(t,n)?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s(t)?"Yesterday":t.toLocaleDateString([],{month:"short",day:"numeric"})}const Tl=So("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 touch-manipulation active:scale-[0.97] active:opacity-90",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline active:scale-100"},size:{default:"h-12 px-4 py-2 sm:h-10",sm:"h-10 rounded-md px-3 sm:h-9",lg:"h-12 rounded-md px-8 sm:h-11",icon:"h-11 w-11 sm:h-10 sm:w-10"}},defaultVariants:{variant:"default",size:"default"}}),Z=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},a)=>{const o=r?sS:"button";return i.jsx(o,{className:W(Tl({variant:t,size:n,className:e})),ref:a,...s})});Z.displayName="Button";/**
11 * @license lucide-react v0.453.0 - ISC
12 *
13 * This source code is licensed under the ISC license.
14 * See the LICENSE file in the root directory of this source tree.
15 */const uD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mS=(...e)=>
vendor: 1,102 bytes, lines 15-30
15e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
16 * @license lucide-react v0.453.0 - ISC
17 *
18 * This source code is licensed under the ISC license.
19 * See the LICENSE file in the root directory of this source tree.
20 */var dD={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
21 * @license lucide-react v0.453.0 - ISC
22 *
23 * This source code is licensed under the ISC license.
24 * See the LICENSE file in the root directory of this source tree.
25 */const fD=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...dD,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:mS("lucide",s),...l},[...o.map(([u,f])=>h.createElement(u,f)),...Array.isArray(a)?a:[a]]));/**
26 * @license lucide-react v0.453.0 - ISC
27 *
28 * This source code is licensed under the ISC license.
29 * See the LICENSE file in the root directory of this source tree.
30 */const ue=(e,t)=>
30{const n=h.forwardRef(({className:r,...s},a)=>h.createElement(fD,{ref:a,iconNode:t,className:mS(`lucide-${uD(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
31 * @license lucide-react v0.453.0 - ISC
32 *
33 * This source code is licensed under the ISC license.
34 * See the LICENSE file in the root directory of this source tree.
35 */const ag=ue("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
36 * @license lucide-react v0.453.0 - ISC
37 *
38 * This source code is licensed under the ISC license.
39 * See the LICENSE file in the root directory of this source tree.
40 */const ls=ue("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
41 * @license lucide-react v0.453.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const Iu=ue("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
46 * @license lucide-react v0.453.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */const hD=ue("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
51 * @license lucide-react v0.453.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const mD=ue("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
56 * @license lucide-react v0.453.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const Dv=ue("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
61 * @license lucide-react v0.453.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const ia=ue("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
66 * @license lucide-react v0.453.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const pD=ue("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
71 * @license lucide-react v0.453.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const pS=ue("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
76 * @license lucide-react v0.453.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const ot=ue("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
81 * @license lucide-react v0.453.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const di=ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
86 * @license lucide-react v0.453.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const aa=ue("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
91 * @license lucide-react v0.453.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const Bn=ue("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
96 * @license lucide-react v0.453.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const gD=ue("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
101 * @license lucide-react v0.453.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const xD=ue("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
106 * @license lucide-react v0.453.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const hs=ue("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
111 * @license lucide-react v0.453.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const Fs=ue("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
116 * @license lucide-react v0.453.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const gS=ue("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
121 * @license lucide-react v0.453.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const yD=ue("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
126 * @license lucide-react v0.453.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const vD=ue("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
131 * @license lucide-react v0.453.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const bD=ue("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
136 * @license lucide-react v0.453.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const wD=ue("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
141 * @license lucide-react v0.453.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const xS=ue("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
146 * @license lucide-react v0.453.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const yS=ue("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
151 * @license lucide-react v0.453.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const kD=ue("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
156 * @license lucide-react v0.453.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const Ov=ue("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
161 * @license lucide-react v0.453.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const Qn=ue("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
166 * @license lucide-react v0.453.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const vS=ue("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
171 * @license lucide-react v0.453.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const SD=ue("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
176 * @license lucide-react v0.453.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const zi=ue("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
181 * @license lucide-react v0.453.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const ND=ue("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
186 * @license lucide-react v0.453.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const bS=ue("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
191 * @license lucide-react v0.453.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const jD=ue("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
196 * @license lucide-react v0.453.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const km=ue("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);/**
201 * @license lucide-react v0.453.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const $n=ue("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
206 * @license lucide-react v0.453.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const CD=ue("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
211 * @license lucide-react v0.453.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const og=ue("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
216 * @license lucide-react v0.453.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const TD=ue("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/**
221 * @license lucide-react v0.453.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const Ad=ue("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
226 * @license lucide-react v0.453.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const ED=ue("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
231 * @license lucide-react v0.453.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const _D=ue("LayoutList",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]]);/**
236 * @license lucide-react v0.453.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const Lv=ue("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
241 * @license lucide-react v0.453.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const AD=ue("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
246 * @license lucide-react v0.453.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const wS=ue("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
251 * @license lucide-react v0.453.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const Xe=ue("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
256 * @license lucide-react v0.453.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const kS=ue("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
261 * @license lucide-react v0.453.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const El=ue("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
266 * @license lucide-react v0.453.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const lg=ue("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
271 * @license lucide-react v0.453.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const cg=ue("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
276 * @license lucide-react v0.453.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const Pd=ue("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
281 * @license lucide-react v0.453.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const SS=ue("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
286 * @license lucide-react v0.453.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const PD=ue("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/**
291 * @license lucide-react v0.453.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const va=ue("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
296 * @license lucide-react v0.453.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const RD=ue("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
301 * @license lucide-react v0.453.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const ug=ue("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
306 * @license lucide-react v0.453.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const ID=ue("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
311 * @license lucide-react v0.453.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const io=ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
316 * @license lucide-react v0.453.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const _l=ue("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
321 * @license lucide-react v0.453.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const NS=ue("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
326 * @license lucide-react v0.453.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const jS=ue("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}
330],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
331 * @license lucide-react v0.453.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const MD=ue("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
336 * @license lucide-react v0.453.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const Al=ue("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
341 * @license lucide-react v0.453.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const lu=ue("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
346 * @license lucide-react v0.453.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const DD=ue("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
351 * @license lucide-react v0.453.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const OD=ue("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
356 * @license lucide-react v0.453.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const LD=ue("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
361 * @license lucide-react v0.453.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const rc=ue("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
366 * @license lucide-react v0.453.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const FD=ue("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
371 * @license lucide-react v0.453.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const VD=ue("Sparkle",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]]);/**
376 * @license lucide-react v0.453.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const Gi=ue("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
381 * @license lucide-react v0.453.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const Fv=ue("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
386 * @license lucide-react v0.453.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const Vv=ue("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
391 * @license lucide-react v0.453.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const $D=ue("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
396 * @license lucide-react v0.453.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const zD=ue("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
401 * @license lucide-react v0.453.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const CS=ue("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
405],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
406 * @license lucide-react v0.453.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const UD=ue("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
411 * @license lucide-react v0.453.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const BD=ue("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
416 * @license lucide-react v0.453.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const ms=ue("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
421 * @license lucide-react v0.453.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const Pl=ue("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
426 * @license lucide-react v0.453.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const ao=ue("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
431 * @license lucide-react v0.453.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const HD=ue("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
436 * @license lucide-react v0.453.0 - ISC
437 *
438 * This source code is licensed under the ISC license.
439 * See the LICENSE file in the root directory of this source tree.
440 */const TS=ue("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
441 * @license lucide-react v0.453.0 - ISC
442 *
443 * This source code is licensed under the ISC license.
444 * See the LICENSE file in the root directory of this source tree.
445 */const WD=ue("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
446 * @license lucide-react v0.453.0 - ISC
447 *
448 * This source code is licensed under the ISC license.
449 * See the LICENSE file in the root directory of this source tree.
450 */const $t=ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
451 * @license lucide-react v0.453.0 - ISC
452 *
453 * This source code is licensed under the ISC license.
454 * See the LICENSE file in the root directory of this source tree.
455 */const ES=ue("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function _S(){const[,e]=pt();return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundImage:"url('/auth.png')",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},children:i.jsxs("div",{className:"max-w-md w-full text-center px-4",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:i.jsx("img",{src:"/api/assets/404.png",alt:"404 Not Found",className:"h-60 w-auto"})}),i.jsxs("div",{className:"mb-8",children:[i.jsx("h1",{className:"text-6xl font-bold text-gray-900 dark:text-white mb-4",children:"404"}),i.jsx("h2",{className:"text-2xl font-semibold text-gray-800 dark:text-gray-200 mb-2",children:"Page Not Found"}),i.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"The page you're looking for doesn't exist or has been moved. Your REP status tracking is still safe with us!"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs(Z,{onClick:()=>
455e("/dashboard"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white",size:"lg",children:[i.jsx(Ad,{className:"h-5 w-5 mr-2"}),"Go to Dashboard"]}),i.jsxs(Z,{onClick:()=>e("/"),variant:"outline",className:"w-full",size:"lg",children:[i.jsx(ag,{className:"h-5 w-5 mr-2"}),"Back to REPSShield.com"]})]}),i.jsxs("div",{className:"mt-8 p-4 bg-white/90 dark:bg-gray-800/90 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:[i.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-2",children:[i.jsx(rc,{className:"h-5 w-5 text-blue-600"}),i.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:"Need Help?"})]}),i.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["If you believe this is an error, please contact"," ",i.jsx("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:underline",children:"[email protected]"})," ","or return to your dashboard to continue tracking your Real Estate Professional status."]})]}),i.jsx("div",{className:"mt-8 text-center",children:i.jsxs("div",{className:"flex items-center justify-center space-x-2 text-gray-500 dark:text-gray-400",children:[i.jsx("img",{src:"/repsshield-logo-icon.png",alt:"REPSShield",className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"REPSShield - Your Shield Against Audit Risks"})]})})]})})}const qD=h.lazy(()=>ce(()=>import("./AgenticOnboarding-DtBgazvw.js"),__vite__mapDeps([79,1,11,34])));function GD(){return i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full"})})}function YD({user:e,userData:t,location:n,children:r}){const s=(t==null?void 0:t.accountOwnerId)!=null;return e&&t&&t.hasCompletedOnboardingForm!==!0&&!s&&n!=="/onboarding"?i.jsx(h.Suspense,{fallback:i.jsx(GD,{}),children:i.jsx(qD,{onComplete:()=>{window.location.href="/dashboard"}})}):i.jsx(i.Fragment,{children:r})}function KD(){const[e,t]=pt(),[n,r]=h.useState(()=>{if(typeof window<"u"){const a=localStorage.getItem("repsshield-member-sidebar-expanded");return a!==null?JSON.parse(a):!0}return!0});h.useEffect(()=>{typeof window<"u"&&localStorage.setItem("repsshield-member-sidebar-expanded",JSON.stringify(n))},[n]);const s=[{path:"/member/time-entries",label:"My Time Entries",icon:xS},{path:"/member/stats",label:"My Statistics",icon:pS},{path:"/member/profile",label:"My Profile",icon:ao}];return i.jsxs("aside",{className:`hidden md:flex flex-col bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700 transition-[width] duration-200 overflow-hidden ${n?"w-72":"w-16"}`,children:[i.jsxs("div",{className:"h-16 px-4 flex items-center justify-between border-b border-gray-200 dark:border-gray-700",children:[n&&i.jsxs(Ce,{href:"/member/time-entries",className:"flex items-center gap-3 min-w-0 hover:opacity-80 transition-opacity hover:no-underline focus:no-underline",onClick:()=>t("/member/time-entries"),children:[i.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield Logo",className:"w-8 h-8 flex-shrink-0"}),i.jsx("span",{className:"font-semibold text-lg text-gray-900 dark:text-white truncate",children:"REPSShield"})]}),i.jsx(Z,{variant:"ghost",size:"icon",className:n?"ml-auto":"mx-auto",onClick:()=>r(!n),"aria-expanded":n,"aria-label":n?"Collapse sidebar":"Expand sidebar",children:i.jsx(Pd,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"flex-1 flex flex-col p-4 overflow-y-auto",children:[i.jsx("nav",{className:"space-y-4 mt-4",role:"navigation",children:s.map(a=>{const o=a.icon,l=e===a.path;return i.jsxs(Ce,{href:a.path,className:`flex items-center rounded-md text-base font-medium transition-colors group ${n?"px-3 py-2.5":"px-0 py-2 justify-center"} ${l?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100 hover:no-underline focus:no-underline":"text-blue-700 hover:bg-blue-50 hover:text-blue-800 dark:text-blue-200 dark:hover:bg-blue-900/50 dark:hover:text-blue-100 hover:no-underline focus:no-underline"}`,onClick:c=>
455{c.metaKey||c.ctrlKey||c.shiftKey||c.altKey||c.button!==0||(c.preventDefault(),t(a.path))},"aria-current":l?"page":void 0,"aria-label":n?void 0:a.label,title:n?void 0:a.label,children:[i.jsx(o,{className:"w-5 h-5 flex-shrink-0"}),n&&i.jsx("span",{className:"ml-2.5 truncate",children:a.label})]},a.path)})}),i.jsx("div",{className:"mt-auto pt-6",children:i.jsx("div",{className:`px-3 py-2 rounded-md bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 ${!n&&"px-0 py-2 flex justify-center"}`,children:n?i.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300 font-medium text-center",children:"Team Member Portal"}):i.jsx(ao,{className:"w-4 h-4 text-blue-700 dark:text-blue-300"})})})]})]})}function se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function zt(e,t=[]){let n=[];function r(a,o){const l=h.createContext(o);l.displayName=a+"Context";const c=n.length;n=[...n,o];const u=d=>{var v;const{scope:m,children:p,...g}=d,x=((v=m==null?void 0:m[e])==null?void 0:v[c])||l,y=h.useMemo(()=>g,Object.values(g));return i.jsx(x.Provider,{value:y,children:p})};u.displayName=a+"Provider";function f(d,m){var x;const p=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=h.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,f]}const s=()=>{const a=n.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,QD(s,...t)]}function QD(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const d=c(a)[`__scope${u}`];return{...l,...d}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var _t=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},ZD=qp[" useInsertionEffect ".trim().toString()]||_t;function jn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,o]=XD({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const f=h.useRef(e!==void 0);h.useEffect(()=>{const d=f.current;d!==l&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=l},[l,r])}const u=h.useCallback(f=>{var d;if(l){const m=JD(f)?f(e):f;m!==e&&((d=o.current)==null||d.call(o,m))}else a(f)},[l,e,a,o]);return[c,u]}function XD({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),a=h.useRef(t);return ZD(()=>{a.current=t},[t]),h.useEffect(()=>{var o;s.current!==n&&((o=a.current)==null||o.call(a,n),s.current=n)},[n,s]),[n,r,a]}function JD(e){return typeof e=="function"}var eO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pe=eO.reduce((e,t)=>{const n=ti(`Primitive.${t}`),r=h.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function dg(e,t){e&&sa.flushSync(()=>e.dispatchEvent(t))}function jo(e){const t=e+"CollectionProvider",[n,r]=zt(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=x=>{const{scope:y,children:v}=x,b=h.useRef(null),w=h.useRef(new Map).current;return i.jsx(s,{scope:y,itemMap:w,collectionRef:b,children:v})};o.displayName=t;const l=e+"CollectionSlot",c=ti(l),u=h.forwardRef((x,y)=>{const{scope:v,children:b}=x,w=a(l,v),j=Ae(y,w.collectionRef);return i.jsx(c,{ref:j,children:b})});u.displayName=l;const f=e+"CollectionItemSlot",d="data-radix-collection-item",m=ti(f),p=h.forwardRef((x,y)=>{const{scope:v,children:b,...w}=x,j=h.useRef(null),S=Ae(y,j),C=a(f,v);return h.useEffect(()=>(C.itemMap.set(j,{ref:j,...w}),()=>
455void C.itemMap.delete(j))),i.jsx(m,{[d]:"",ref:S,children:b})});p.displayName=f;function g(x){const y=a(e+"CollectionConsumer",x);return h.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,I)=>w.indexOf(C.ref.current)-w.indexOf(I.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},g,r]}var tO=h.createContext(void 0);function oa(e){const t=h.useContext(tO);return e||t||"ltr"}function Et(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function nO(e,t=globalThis==null?void 0:globalThis.document){const n=Et(e);h.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rO="DismissableLayer",Sm="dismissableLayer.update",sO="dismissableLayer.pointerDownOutside",iO="dismissableLayer.focusOutside",$v,fg=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),la=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:l,onDismiss:c,...u}=e,f=h.useContext(fg),[d,m]=h.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=h.useState({}),x=Ae(t,N=>m(N)),y=Array.from(f.layers),[v]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=d?y.indexOf(d):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,C=h.useRef(!1),I=lO(N=>{const k=N.target;if(!(k instanceof Node))return;const A=[...f.branches].some(M=>M.contains(k));!S||A||(a==null||a(N),l==null||l(N),N.defaultPrevented||c==null||c())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces}),E=cO(N=>{if(r&&C.current)return;const k=N.target;[...f.branches].some(M=>M.contains(k))||(o==null||o(N),l==null||l(N),N.defaultPrevented||c==null||c())},p);return nO(N=>{w===f.layers.size-1&&(s==null||s(N),!N.defaultPrevented&&c&&(N.preventDefault(),c()))},p),h.useEffect(()=>{if(d)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&($v=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),zv(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(d),f.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=$v))}},[d,p,n,f]),h.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),zv())},[d,f]),h.useEffect(()=>{const N=()=>g({});return document.addEventListener(Sm,N),()=>document.removeEventListener(Sm,N)},[]),i.jsx(pe.div,{...u,ref:x,style:{pointerEvents:j?S?"auto":"none":void 0,...e.style},onFocusCapture:se(e.onFocusCapture,E.onFocusCapture),onBlurCapture:se(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:se(e.onPointerDownCapture,I.onPointerDownCapture)})});la.displayName=rO;var aO="DismissableLayerBranch",AS=h.forwardRef((e,t)=>{const n=h.useContext(fg),r=h.useRef(null),s=Ae(t,r);return h.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(pe.div,{...e,ref:s})});AS.displayName=aO;function oO(){const e=h.useContext(fg),[t,n]=h.useState(null);return h.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function lO(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:a}=t,o=Et(e),l=h.useRef(!1),c=h.useRef(!1),u=h.useRef(new Map),f=h.useRef(()=>{});return h.useEffect(()=>{function d(){c.current=!1,s.current=!1,u.current.clear()}function m(){return Array.from(u.current.values()).some(Boolean)}function p(b){if(!c.current)return;const w=b.target;w instanceof Node&&[...a].some(S=>S.contains(w))||u.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{c.current&&f.current()},0)}function g(b){c.current&&u.current.set(b.type,!1)}const x=b=>{if(b.target&&!l.current){let w=function(){n.removeEventListener("click",f.current);const S=m();d(),S||PS(sO,o,j,{discrete:!0})};const j={originalEvent:b};c.current=!0,s.current=r&&b.button===0,u.current.clear(),!r||b.button!==0?w():(n.removeEventListener("click",f.current),f.current=w,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),d();l.current=!1},y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of y)n.addEventListener(b,p,!0),n.addEventListener(b,g);const v=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(v),n.removeEventListener("pointerdown",x),n.removeEventListener("click",f.current);for(const b of y)n.removeEventListener(b,p,!0),n.removeEventListener(b,g)}},[n,o,r,s,a]),{onPointerDownCapture:()=>l.current=!0}}function cO(e,t=globalThis==null?void 0:globalThis.document){const n=Et(e),r=h.useRef(!1);return h.useEffect(()=>{const s=a=>{a.target&&!r.current&&PS(iO,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zv(){const e=new CustomEvent(Sm);document.dispatchEvent(e)}function PS(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?dg(s,a):s.dispatchEvent(a)}var uO=la,dO=AS,Lc=0,vr=null;function Rd(){h.useEffect(()=>{vr||(vr={start:Uv(),end:Uv()});const{start:e,end:t}=vr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Lc++,()=>{Lc===1&&(vr==null||vr.start.remove(),vr==null||vr.end.remove(),vr=null),Lc=Math.max(0,Lc-1)}},[])}function Uv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.
455style.position="fixed",e.style.pointerEvents="none",e}var $f="focusScope.autoFocusOnMount",zf="focusScope.autoFocusOnUnmount",Bv={bubbles:!1,cancelable:!0},fO="FocusScope",sc=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=h.useState(null),u=Et(s),f=Et(a),d=h.useRef(null),m=Ae(t,x=>c(x)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let x=function(w){if(p.paused||!l)return;const j=w.target;l.contains(j)?d.current=j:Rs(d.current,{select:!0})},y=function(w){if(p.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||Rs(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Rs(l)};document.addEventListener("focusin",x),document.addEventListener("focusout",y);const b=new MutationObserver(v);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",y),b.disconnect()}}},[r,l,p.paused]),h.useEffect(()=>{if(l){Wv.add(p);const x=document.activeElement;if(!l.contains(x)){const v=new CustomEvent($f,Bv);l.addEventListener($f,u),l.dispatchEvent(v),v.defaultPrevented||(hO(yO(RS(l)),{select:!0}),document.activeElement===x&&Rs(l))}return()=>{l.removeEventListener($f,u),setTimeout(()=>{const v=new CustomEvent(zf,Bv);l.addEventListener(zf,f),l.dispatchEvent(v),v.defaultPrevented||Rs(x??document.body,{select:!0}),l.removeEventListener(zf,f),Wv.remove(p)},0)}}},[l,u,f,p]);const g=h.useCallback(x=>{if(!n&&!r||p.paused)return;const y=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,v=document.activeElement;if(y&&v){const b=x.currentTarget,[w,j]=mO(b);w&&j?!x.shiftKey&&v===j?(x.preventDefault(),n&&Rs(w,{select:!0})):x.shiftKey&&v===w&&(x.preventDefault(),n&&Rs(j,{select:!0})):v===b&&x.preventDefault()}},[n,r,p.paused]);return i.jsx(pe.div,{tabIndex:-1,...o,ref:m,onKeyDown:g})});sc.displayName=fO;function hO(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Rs(r,{select:t}),document.activeElement!==n)return}function mO(e){const t=RS(e),n=Hv(t,e),r=Hv(t.reverse(),e);return[n,r]}function RS(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Hv(e,t){for(const n of e)if(!pO(n,{upTo:t}))return n}function pO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gO(e){return e instanceof HTMLInputElement&&"select"in e}function Rs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gO(e)&&t&&e.select()}}var Wv=xO();function xO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=qv(e,t),e.unshift(t)},remove(t){var n;e=qv(e,t),(n=e[0])==null||n.resume()}}}function qv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yO(e){return e.filter(t=>t.tagName!=="A")}var vO=qp[" useId ".trim().toString()]||(()=>{}),bO=0;function Ot(e){const[t,n]=h.useState(vO());return _t(()=>{n(r=>r??String(bO++))},[e]),t?`radix-${t}`:""}const wO=["top","right","bottom","left"],ni=Math.min,Fn=Math.max,Mu=Math.round,Fc=Math.floor,Pr=e=>({x:e,y:e}),kO={left:"right",right:"left",bottom:"top",top:"bottom"};function Nm(e,t,n){return Fn(e,ni(t,n))}function ps(e,t){return typeof e=="function"?e(t):e}function gs(e){return e.split("-")[0]}function Co(e){return e.split("-")[1]}function hg(e){return e==="x"?"y":"x"}function mg(e){return e==="y"?"height":"width"}function Cr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function pg(e){return hg(Cr(e))}function SO(e,t,n){n===void 0&&(n=!1);const r=Co(e),s=pg(e),a=mg(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Du(o)),[o,Du(o)]}function NO(e){const t=Du(e);return[jm(e),t,jm(t)]}function jm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Gv=["left","right"],Yv=["right","left"],jO=["top","bottom"],CO=["bottom","top"];function TO(e,t,n){switch(e){case"top":case"bottom":return n?t?Yv:Gv:t?Gv:Yv;case"left":case"right":return t?jO:CO;default:return[]}}function EO(e,t,n,r){const s=Co(e);let a=TO(gs(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(jm)))),a}function Du(e){const t=gs(e);return kO[t]+e.slice(t.length)}function _O(e){return{top:0,right:0,bottom:0,left:0,...e}}function IS(e){return typeof e!="number"?_O(e):{top:e,right:e,bottom:e,left:e}}function Ou(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Kv(e,t,n){let{reference:r,floating:s}=e;const a=Cr(t),o=pg(t),l=mg(o),c=gs(t),u=a==="y",f=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let p;switch(c){case"top":p={x:f,y:r.y-s.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-s.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Co(t)){case"start":p[o]-=m*(n&&u?-1:1);break;case"end":p[o]+=m*(n&&u?-1:1);break}return p}async function AO(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=ps(t,e),g=IS(p),y=l[m?d==="floating"?"reference":"floating":d],v=Ou(await a.getClippingRect
455({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:c})),b=d==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),j=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},S=Ou(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:w,strategy:c}):b);return{top:(v.top-S.top+g.top)/j.y,bottom:(S.bottom-v.bottom+g.bottom)/j.y,left:(v.left-S.left+g.left)/j.x,right:(S.right-v.right+g.right)/j.x}}const PO=50,RO=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:AO},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:d}=Kv(u,r,c),m=r,p=0;const g={};for(let x=0;x<a.length;x++){const y=a[x];if(!y)continue;const{name:v,fn:b}=y,{x:w,y:j,data:S,reset:C}=await b({x:f,y:d,initialPlacement:r,placement:m,strategy:s,middlewareData:g,rects:u,platform:l,elements:{reference:e,floating:t}});f=w??f,d=j??d,g[v]={...g[v],...S},C&&p<PO&&(p++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:f,y:d}=Kv(u,m,c)),x=-1)}return{x:f,y:d,placement:m,strategy:s,middlewareData:g}},IO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:f=0}=ps(e,t)||{};if(u==null)return{};const d=IS(f),m={x:n,y:r},p=pg(s),g=mg(p),x=await o.getDimensions(u),y=p==="y",v=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",j=a.reference[g]+a.reference[p]-m[p]-a.floating[g],S=m[p]-a.reference[p],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let I=C?C[w]:0;(!I||!await(o.isElement==null?void 0:o.isElement(C)))&&(I=l.floating[w]||a.floating[g]);const E=j/2-S/2,N=I/2-x[g]/2-1,k=ni(d[v],N),A=ni(d[b],N),M=k,L=I-x[g]-A,F=I/2-x[g]/2+E,V=Nm(M,F,L),U=!c.arrow&&Co(s)!=null&&F!==V&&a.reference[g]/2-(F<M?k:A)-x[g]/2<0,P=U?F<M?F-M:F-L:0;return{[p]:m[p]+P,data:{[p]:V,centerOffset:F-V-P,...U&&{alignmentOffset:P}},reset:U}}}),MO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:x=!0,...y}=ps(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=gs(s),b=Cr(l),w=gs(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=m||(w||!x?[Du(l)]:NO(l)),C=g!=="none";!m&&C&&S.push(...EO(l,x,g,j));const I=[l,...S],E=await c.detectOverflow(t,y),N=[];let k=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&N.push(E[v]),d){const F=SO(s,o,j);N.push(E[F[0]],E[F[1]])}if(k=[...k,{placement:s,overflows:N}],!N.every(F=>F<=0)){var A,M;const F=(((A=a.flip)==null?void 0:A.index)||0)+1,V=I[F];if(V&&(!(d==="alignment"?b!==Cr(V):!1)||k.every(T=>Cr(T.placement)===b?T.overflows[0]>0:!0)))return{data:{index:F,overflows:k},reset:{placement:V}};let U=(M=k.filter(P=>P.overflows[0]<=0).sort((P,T)=>P.overflows[1]-T.overflows[1])[0])==null?void 0:M.placement;if(!U)switch(p){case"bestFit":{var L;const P=(L=k.filter(T=>{if(C){const D=Cr(T.placement);return D===b||D==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(D=>D>0).reduce((D,_)=>D+_,0)]).sort((T,D)=>T[1]-D[1])[0])==null?void 0:L[0];P&&(U=P);break}case"initialPlacement":U=l;break}if(s!==U)return{reset:{placement:U}}}return{}}}};function Qv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zv(e){return wO.some(t=>e[t]>=0)}const DO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=ps(e,t);switch(s){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=Qv(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Zv(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=Qv(o,n.floating);return{data:{escapedOffsets:l,escaped:Zv(l)}}}default:return{}}}}},MS=new Set(["left","top"]);async function OO(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=gs(n),l=Co(n),c=Cr(n)==="y",u=MS.has(o)?-1:1,f=a&&c?-1:1,d=ps(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}
455:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*f,y:m*u}:{x:m*u,y:p*f}}const LO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await OO(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},FO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:v=>{let{x:b,y:w}=v;return{x:b,y:w}}},...u}=ps(e,t),f={x:n,y:r},d=await a.detectOverflow(t,u),m=Cr(gs(s)),p=hg(m);let g=f[p],x=f[m];if(o){const v=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=g+d[v],j=g-d[b];g=Nm(w,g,j)}if(l){const v=m==="y"?"top":"left",b=m==="y"?"bottom":"right",w=x+d[v],j=x-d[b];x=Nm(w,x,j)}const y=c.fn({...t,[p]:g,[m]:x});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:o,[m]:l}}}}}},VO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=ps(e,t),f={x:n,y:r},d=Cr(s),m=hg(d);let p=f[m],g=f[d];const x=ps(l,t),y=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const w=m==="y"?"height":"width",j=a.reference[m]-a.floating[w]+y.mainAxis,S=a.reference[m]+a.reference[w]-y.mainAxis;p<j?p=j:p>S&&(p=S)}if(u){var v,b;const w=m==="y"?"width":"height",j=MS.has(gs(s)),S=a.reference[d]-a.floating[w]+(j&&((v=o.offset)==null?void 0:v[d])||0)+(j?0:y.crossAxis),C=a.reference[d]+a.reference[w]+(j?0:((b=o.offset)==null?void 0:b[d])||0)-(j?y.crossAxis:0);g<S?g=S:g>C&&(g=C)}return{[m]:p,[d]:g}}}},$O=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=ps(e,t),f=await o.detectOverflow(t,u),d=gs(s),m=Co(s),p=Cr(s)==="y",{width:g,height:x}=a.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(v=d,y=m==="end"?"top":"bottom");const b=x-f.top-f.bottom,w=g-f.left-f.right,j=ni(x-f[y],b),S=ni(g-f[v],w),C=!t.middlewareData.shift;let I=j,E=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=b),C&&!m){const k=Fn(f.left,0),A=Fn(f.right,0),M=Fn(f.top,0),L=Fn(f.bottom,0);p?E=g-2*(k!==0||A!==0?k+A:Fn(f.left,f.right)):I=x-2*(M!==0||L!==0?M+L:Fn(f.top,f.bottom))}await c({...t,availableWidth:E,availableHeight:I});const N=await o.getDimensions(l.floating);return g!==N.width||x!==N.height?{reset:{rects:!0}}:{}}}};function Id(){return typeof window<"u"}function To(e){return DS(e)?(e.nodeName||"").toLowerCase():"#document"}function zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ur(e){var t;return(t=(DS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function DS(e){return Id()?e instanceof Node||e instanceof zn(e).Node:!1}function or(e){return Id()?e instanceof Element||e instanceof zn(e).Element:!1}function ks(e){return Id()?e instanceof HTMLElement||e instanceof zn(e).HTMLElement:!1}function Xv(e){return!Id()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zn(e).ShadowRoot}function ic(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=lr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function zO(e){return/^(table|td|th)$/.test(To(e))}function Md(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const UO=/transform|translate|scale|rotate|perspective|filter/,BO=/paint|layout|strict|content/,vi=e=>!!e&&e!=="none";let Uf;function gg(e){const t=or(e)?lr(e):e;return vi(t.transform)||vi(t.translate)||vi(t.scale)||vi(t.rotate)||vi(t.perspective)||!xg()&&(vi(t.backdropFilter)||vi(t.filter))||UO.test(t.willChange||"")||BO.test(t.contain||"")}function HO(e){let t=ri(e);for(;ks(t)&&!oo(t);){if(gg(t))return t;if(Md(t))return null;t=ri(t)}return null}function xg(){return Uf==null&&(Uf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Uf}function oo(e){return/^(html|body|#document)$/.test(To(e))}function lr(e){return zn(e).getComputedStyle(e)}function Dd(e){return or(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ri(e){if(To(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xv(e)&&e.host||Ur(e);return Xv(t)?t.host:t}function OS(e){const t=ri(e);return oo(t)?e.ownerDocument?e.ownerDocument.body:e.body:ks(t)&&ic(t)?t:OS(t)}function Rl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=OS(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=zn(s);if(a){const l=Cm(o);
455return t.concat(o,o.visualViewport||[],ic(s)?s:[],l&&n?Rl(l):[])}else return t.concat(s,Rl(s,[],n))}function Cm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function LS(e){const t=lr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=ks(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=Mu(n)!==a||Mu(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function yg(e){return or(e)?e:e.contextElement}function Va(e){const t=yg(e);if(!ks(t))return Pr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=LS(t);let o=(a?Mu(n.width):n.width)/r,l=(a?Mu(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const WO=Pr(0);function FS(e){const t=zn(e);return!xg()||!t.visualViewport?WO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==zn(e)?!1:t}function Yi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=yg(e);let o=Pr(1);t&&(r?or(r)&&(o=Va(r)):o=Va(e));const l=qO(a,n,r)?FS(a):Pr(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,f=s.width/o.x,d=s.height/o.y;if(a){const m=zn(a),p=r&&or(r)?zn(r):r;let g=m,x=Cm(g);for(;x&&r&&p!==g;){const y=Va(x),v=x.getBoundingClientRect(),b=lr(x),w=v.left+(x.clientLeft+parseFloat(b.paddingLeft))*y.x,j=v.top+(x.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,u*=y.y,f*=y.x,d*=y.y,c+=w,u+=j,g=zn(x),x=Cm(g)}}return Ou({width:f,height:d,x:c,y:u})}function Od(e,t){const n=Dd(e).scrollLeft;return t?t.left+n:Yi(Ur(e)).left+n}function VS(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Od(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function GO(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=Ur(r),l=t?Md(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=Pr(1);const f=Pr(0),d=ks(r);if((d||!d&&!a)&&((To(r)!=="body"||ic(o))&&(c=Dd(r)),d)){const p=Yi(r);u=Va(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=o&&!d&&!a?VS(o,c):Pr(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-c.scrollTop*u.y+f.y+m.y}}function YO(e){return Array.from(e.getClientRects())}function KO(e){const t=Ur(e),n=Dd(e),r=e.ownerDocument.body,s=Fn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Fn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Od(e);const l=-n.scrollTop;return lr(r).direction==="rtl"&&(o+=Fn(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}const Jv=25;function QO(e,t){const n=zn(e),r=Ur(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const f=xg();(!f||f&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}const u=Od(r);if(u<=0){const f=r.ownerDocument,d=f.body,m=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-p);g<=Jv&&(a-=g)}else u<=Jv&&(a+=u);return{width:a,height:o,x:l,y:c}}function ZO(e,t){const n=Yi(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=ks(e)?Va(e):Pr(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function eb(e,t,n){let r;if(t==="viewport")r=QO(e,n);else if(t==="document")r=KO(Ur(e));else if(or(t))r=ZO(t,n);else{const s=FS(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ou(r)}function $S(e,t){const n=ri(e);return n===t||!or(n)||oo(n)?!1:lr(n).position==="fixed"||$S(n,t)}function XO(e,t){const n=t.get(e);if(n)return n;let r=Rl(e,[],!1).filter(l=>or(l)&&To(l)!=="body"),s=null;const a=lr(e).position==="fixed";let o=a?ri(e):e;for(;or(o)&&!oo(o);){const l=lr(o),c=gg(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||ic(o)&&!c&&$S(e,o))?r=r.filter(f=>f!==o):s=l,o=ri(o)}return t.set(e,r),r}function JO(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?Md(t)?[]:XO(t,this._c):[].concat(n),r],l=eb(t,o[0],s);let c=l.top,u=l.right,f=l.bottom,d=l.left;for(let m=1;m<o.length;m++){const p=eb(t,o[m],s);c=Fn(p.top,c),u=ni(p.right,u),f=ni(p.bottom,f),d=Fn(p.left,d)}return{width:u-d,height:f-c,x:d,y:c}}function eL(e){const{width:t,height:n}=LS(e);return{width:t,height:n}}function tL(e,t,n){const r=ks(t),s=Ur(t),a=n==="fixed",o=Yi(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Pr(0);function u(){c.x=Od(s)}if(r||!r&&!a)if((To(t)!=="body"||ic(s))&&(l=Dd(t)),r){const p=Yi(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&u();a&&!r&&s&&u();const f=s&&!r&&!a?VS(s,l):Pr(0),d=o.left+l.scrollLeft-c.x-f.x,m=o.top+l.scrollTop-c.y-f.y;return{x:d,y:m,width:o.width,height:o.height}}function Bf(e){return lr(e).position==="static"}function tb(e,t){if(!ks(e)||lr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ur(e)===n&&(n=n.ownerDocument.body),n}function zS(e,t){const n=zn(e);if(Md(e))return n;if(!ks(e)){let s=ri(e);for(;s&&!oo(s);){if(or(s)&&!Bf(s))return s;s=ri(s)}return n}let r=tb(e,t);for(;r&&zO(r)&&Bf(r);)r=tb(r,t);
455return r&&oo(r)&&Bf(r)&&!gg(r)?n:r||HO(e)||n}const nL=async function(e){const t=this.getOffsetParent||zS,n=this.getDimensions,r=await n(e.floating);return{reference:tL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rL(e){return lr(e).direction==="rtl"}const sL={convertOffsetParentRelativeRectToViewportRelativeRect:GO,getDocumentElement:Ur,getClippingRect:JO,getOffsetParent:zS,getElementRects:nL,getClientRects:YO,getDimensions:eL,getScale:Va,isElement:or,isRTL:rL};function US(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iL(e,t){let n=null,r;const s=Ur(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:f,top:d,width:m,height:p}=u;if(l||t(),!m||!p)return;const g=Fc(d),x=Fc(s.clientWidth-(f+m)),y=Fc(s.clientHeight-(d+p)),v=Fc(f),w={rootMargin:-g+"px "+-x+"px "+-y+"px "+-v+"px",threshold:Fn(0,ni(1,c))||1};let j=!0;function S(C){const I=C[0].intersectionRatio;if(I!==c){if(!j)return o();I?o(!1,I):r=setTimeout(()=>{o(!1,1e-7)},1e3)}I===1&&!US(u,e.getBoundingClientRect())&&o(),j=!1}try{n=new IntersectionObserver(S,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return o(!0),a}function aL(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=yg(e),f=s||a?[...u?Rl(u):[],...t?Rl(t):[]]:[];f.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const d=u&&l?iL(u,n):null;let m=-1,p=null;o&&(p=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!c&&p.observe(u),t&&p.observe(t));let g,x=c?Yi(e):null;c&&y();function y(){const v=Yi(e);x&&!US(x,v)&&n(),x=v,g=requestAnimationFrame(y)}return n(),()=>{var v;f.forEach(b=>{s&&b.removeEventListener("scroll",n),a&&b.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const oL=LO,lL=FO,cL=MO,uL=$O,dL=DO,nb=IO,fL=VO,hL=(e,t,n)=>{const r=new Map,s={platform:sL,...n},a={...s.platform,_c:r};return RO(e,t,{...s,platform:a})};var mL=typeof document<"u",pL=function(){},cu=mL?h.useLayoutEffect:pL;function Lu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lu(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!Lu(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function BS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rb(e,t){const n=BS(e);return Math.round(t*n)/n}function Hf(e){const t=h.useRef(e);return cu(()=>{t.current=e}),t}function gL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[f,d]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(r);Lu(m,r)||p(r);const[g,x]=h.useState(null),[y,v]=h.useState(null),b=h.useCallback(T=>{T!==C.current&&(C.current=T,x(T))},[]),w=h.useCallback(T=>{T!==I.current&&(I.current=T,v(T))},[]),j=a||g,S=o||y,C=h.useRef(null),I=h.useRef(null),E=h.useRef(f),N=c!=null,k=Hf(c),A=Hf(s),M=Hf(u),L=h.useCallback(()=>{if(!C.current||!I.current)return;const T={placement:t,strategy:n,middleware:m};A.current&&(T.platform=A.current),hL(C.current,I.current,T).then(D=>{const _={...D,isPositioned:M.current!==!1};F.current&&!Lu(E.current,_)&&(E.current=_,sa.flushSync(()=>{d(_)}))})},[m,t,n,A,M]);cu(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[u]);const F=h.useRef(!1);cu(()=>(F.current=!0,()=>{F.current=!1}),[]),cu(()=>{if(j&&(C.current=j),S&&(I.current=S),j&&S){if(k.current)return k.current(j,S,L);L()}},[j,S,L,k,N]);const V=h.useMemo(()=>({reference:C,floating:I,setReference:b,setFloating:w}),[b,w]),U=h.useMemo(()=>({reference:j,floating:S}),[j,S]),P=h.useMemo(()=>{const T={position:n,left:0,top:0};if(!U.floating)return T;const D=rb(U.floating,f.x),_=rb(U.floating,f.y);return l?{...T,transform:"translate("+D+"px, "+_+"px)",...BS(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:_}},[n,l,U.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:L,refs:V,elements:U,floatingStyles:P}),[f,L,V,U,P])}const xL=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?nb({element:r.current,padding:s}).fn(n):{}:r?nb({element:r,padding:s}).fn(n):{}}}},yL=(e,t)=>{const n=oL(e);return{name:n.name,fn:n.fn,options:[e,t]}},vL=(e,t)=>{const n=lL(e);return{name:n.name,fn:n.fn,options:[e,t]}},bL=(e,t)=>({fn:fL(e).fn,options:[e,t]}),wL=(e,t)=>{const n=cL(e);return{name:n.name,fn:n.fn,options:[e,t]}},kL=(e,t)=>{const n=uL(e);return{name:n.name,fn:n.fn,options:[e,t]}},SL=(e,t)=>{const n=dL(e);return{name:n.name,fn:n.fn,options:[e,t]}},NL=(e,t)=>{const n=xL(e);return{name:n.name,fn:n.fn,options:[e,t]}};var jL="Arrow",HS=h.forwardRef((e,t)=>
455{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(pe.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});HS.displayName=jL;var CL=HS;function vg(e){const[t,n]=h.useState(void 0);return _t(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var bg="Popper",[WS,fi]=zt(bg),[TL,qS]=WS(bg),GS=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null),[a,o]=h.useState(void 0);return i.jsx(TL,{scope:t,anchor:r,onAnchorChange:s,placementState:a,setPlacementState:o,children:n})};GS.displayName=bg;var YS="PopperAnchor",KS=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=qS(YS,n),o=h.useRef(null),l=a.onAnchorChange,c=h.useCallback(g=>{o.current=g,g&&l(g)},[l]),u=Ae(t,c),f=h.useRef(null);h.useEffect(()=>{if(!r)return;const g=f.current;f.current=r.current,g!==f.current&&l(f.current)});const d=a.placementState&&kg(a.placementState),m=d==null?void 0:d[0],p=d==null?void 0:d[1];return r?null:i.jsx(pe.div,{"data-radix-popper-side":m,"data-radix-popper-align":p,...s,ref:u})});KS.displayName=YS;var wg="PopperContent",[EL,_L]=WS(wg),QS=h.forwardRef((e,t)=>{var fe,ee,te,ge,oe,Ve;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:g,...x}=e,y=qS(wg,n),[v,b]=h.useState(null),w=Ae(t,$e=>b($e)),[j,S]=h.useState(null),C=vg(j),I=(C==null?void 0:C.width)??0,E=(C==null?void 0:C.height)??0,N=r+(a!=="center"?"-"+a:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(u)?u:[u],M=A.length>0,L={padding:k,boundary:A.filter(PL),altBoundary:M},{refs:F,floatingStyles:V,placement:U,isPositioned:P,middlewareData:T}=gL({strategy:"fixed",placement:N,whileElementsMounted:(...$e)=>aL(...$e,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[yL({mainAxis:s+E,alignmentAxis:o}),c&&vL({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?bL():void 0,...L}),c&&wL({...L}),kL({...L,apply:({elements:$e,rects:ze,availableWidth:qe,availableHeight:Oe})=>{const{width:Ft,height:Pe}=ze.reference,tt=$e.floating.style;tt.setProperty("--radix-popper-available-width",`${qe}px`),tt.setProperty("--radix-popper-available-height",`${Oe}px`),tt.setProperty("--radix-popper-anchor-width",`${Ft}px`),tt.setProperty("--radix-popper-anchor-height",`${Pe}px`)}}),j&&NL({element:j,padding:l}),RL({arrowWidth:I,arrowHeight:E}),m&&SL({strategy:"referenceHidden",...L,boundary:M?L.boundary:void 0})]}),D=y.setPlacementState;_t(()=>(D(U),()=>{D(void 0)}),[U,D]);const[_,G]=kg(U),z=Et(g);_t(()=>{P&&(z==null||z())},[P,z]);const R=(fe=T.arrow)==null?void 0:fe.x,q=(ee=T.arrow)==null?void 0:ee.y,Q=((te=T.arrow)==null?void 0:te.centerOffset)!==0,[K,X]=h.useState();return _t(()=>{v&&X(window.getComputedStyle(v).zIndex)},[v]),i.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:P?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(ge=T.transformOrigin)==null?void 0:ge.x,(oe=T.transformOrigin)==null?void 0:oe.y].join(" "),...((Ve=T.hide)==null?void 0:Ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(EL,{scope:n,placedSide:_,placedAlign:G,onArrowChange:S,arrowX:R,arrowY:q,shouldHideArrow:Q,children:i.jsx(pe.div,{"data-side":_,"data-align":G,...x,ref:w,style:{...x.style,animation:P?void 0:"none"}})})})});QS.displayName=wg;var ZS="PopperArrow",AL={top:"bottom",right:"left",bottom:"top",left:"right"},XS=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=_L(ZS,r),o=AL[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(CL,{...s,ref:n,style:{...s.style,display:"block"}})})});XS.displayName=ZS;function PL(e){return e!==null}var RL=e=>({name:"transformOrigin",options:e,fn(t){var y,v,b;const{placement:n,rects:r,middlewareData:s}=t,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,f]=kg(n),d={start:"0%",center:"50%",end:"100%"}[f],m=(((v=s.arrow)==null?void 0:v.x)??0)+l/2,p=(((b=s.arrow)==null?void 0:b.y)??0)+c/2;let g="",x="";return u==="bottom"?(g=o?d:`${m}px`,x=`${-c}px`):u==="top"?(g=o?d:`${m}px`,x=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,x=o?d:`${p}px`):u==="left"&&(g=`${r.floating.width+c}px`,x=o?d:`${p}px`),{data:{x:g,y:x}}}});function kg(e){const[t,n="center"]=e.split("-");return[t,n]}var Ld=GS,ac=KS,Fd=QS,Vd=XS,IL="Portal",ca=h.forwardRef((e,t)=>
455{var l;const{container:n,...r}=e,[s,a]=h.useState(!1);_t(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?sa.createPortal(i.jsx(pe.div,{...r,ref:t}),o):null});ca.displayName=IL;function ML(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Lt=e=>{const{present:t,children:n}=e,r=DL(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),a=OL(r.ref,LL(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:a}):null};Lt.displayName="Presence";function DL(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),a=h.useRef("none"),o=e?"mounted":"unmounted",[l,c]=ML(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Vc(r.current);a.current=l==="mounted"?u:"none"},[l]),_t(()=>{const u=r.current,f=s.current;if(f!==e){const m=a.current,p=Vc(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),_t(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=p=>{const x=Vc(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&x&&(c("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(a.current=Vc(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function sb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function OL(...e){const t=h.useRef(e);return t.current=e,h.useCallback(n=>{const r=t.current;let s=!1;const a=r.map(o=>{const l=sb(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<a.length;o++){const l=a[o];typeof l=="function"?l():sb(r[o],null)}}},[])}function Vc(e){return(e==null?void 0:e.animationName)||"none"}function LL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wf="rovingFocusGroup.onEntryFocus",FL={bubbles:!1,cancelable:!0},oc="RovingFocusGroup",[Tm,JS,VL]=jo(oc),[$L,$d]=zt(oc,[VL]),[zL,UL]=$L(oc),eN=h.forwardRef((e,t)=>i.jsx(Tm.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Tm.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(BL,{...e,ref:t})})}));eN.displayName=oc;var BL=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,m=h.useRef(null),p=Ae(t,m),g=oa(a),[x,y]=jn({prop:o,defaultProp:l??null,onChange:c,caller:oc}),[v,b]=h.useState(!1),w=Et(u),j=JS(n),S=h.useRef(!1),[C,I]=h.useState(0);return h.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(Wf,w),()=>E.removeEventListener(Wf,w)},[w]),i.jsx(zL,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:x,onItemFocus:h.useCallback(E=>y(E),[y]),onItemShiftTab:h.useCallback(()=>b(!0),[]),onFocusableItemAdd:h.useCallback(()=>I(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>I(E=>E-1),[]),children:i.jsx(pe.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:se(e.onMouseDown,()=>{S.current=!0}),onFocus:se(e.onFocus,E=>{const N=!S.current;if(E.target===E.currentTarget&&N&&!v){const k=new CustomEvent(Wf,FL);if(E.currentTarget.dispatchEvent(k),!k.defaultPrevented){const A=j().filter(U=>U.focusable),M=A.find(U=>U.active),L=A.find(U=>
455U.id===x),V=[M,L,...A].filter(Boolean).map(U=>U.ref.current);rN(V,f)}}S.current=!1}),onBlur:se(e.onBlur,()=>b(!1))})})}),tN="RovingFocusGroupItem",nN=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:o,...l}=e,c=Ot(),u=a||c,f=UL(tN,n),d=f.currentTabStopId===u,m=JS(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:x}=f;return h.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),i.jsx(Tm.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(pe.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:se(e.onMouseDown,y=>{r?f.onItemFocus(u):y.preventDefault()}),onFocus:se(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:se(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=qL(y,f.orientation,f.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const j=w.indexOf(y.currentTarget);w=f.loop?GL(w,j+1):w.slice(j+1)}setTimeout(()=>rN(w))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:x!=null}):o})})});nN.displayName=tN;var HL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WL(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function qL(e,t,n){const r=WL(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HL[r]}function rN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function GL(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sN=eN,iN=nN,YL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ba=new WeakMap,$c=new WeakMap,zc={},qf=0,aN=function(e){return e&&(e.host||aN(e.parentNode))},KL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=aN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},QL=function(e,t,n,r){var s=KL(t,Array.isArray(e)?e:[e]);zc[n]||(zc[n]=new WeakMap);var a=zc[n],o=[],l=new Set,c=new Set(s),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};s.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(m){if(l.has(m))f(m);else try{var p=m.getAttribute(r),g=p!==null&&p!=="false",x=(ba.get(m)||0)+1,y=(a.get(m)||0)+1;ba.set(m,x),a.set(m,y),o.push(m),x===1&&g&&$c.set(m,!0),y===1&&m.setAttribute(n,"true"),g||m.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return f(t),l.clear(),qf++,function(){o.forEach(function(d){var m=ba.get(d)-1,p=a.get(d)-1;ba.set(d,m),a.set(d,p),m||($c.has(d)||d.removeAttribute(r),$c.delete(d)),p||d.removeAttribute(n)}),qf--,qf||(ba=new WeakMap,ba=new WeakMap,$c=new WeakMap,zc={})}},zd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=YL(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),QL(r,s,n,"aria-hidden")):function(){return null}},jr=function(){return jr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},jr.apply(this,arguments)};function oN(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function ZL(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var uu="right-scroll-bar-position",du="width-before-scroll-bar",XL="with-scroll-bars-hidden",JL="--removed-body-scroll-bar-size";function Gf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function e4(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var t4=typeof window<"u"?h.useLayoutEffect:h.useEffect,ib=new WeakMap;function n4(e,t){var n=e4(null,function(r){return e.forEach(function(s){return Gf(s,r)})});return t4(function(){var r=ib.get(n);if(r){var s=new Set(r),a=new Set(e),o=n.current;
vendor: 4,196 bytes, lines 455-470
455s.forEach(function(l){a.has(l)||Gf(l,null)}),a.forEach(function(l){s.has(l)||Gf(l,o)})}ib.set(n,e)},[e]),n}function r4(e){return e}function s4(e,t){t===void 0&&(t=r4);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var f=o;o=[],f.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){o.push(f),u()},filter:function(f){return o=o.filter(f),n}}}};return s}function i4(e){e===void 0&&(e={});var t=s4(null);return t.options=jr({async:!0,ssr:!1},e),t}var lN=function(e){var t=e.sideCar,n=oN(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,jr({},n))};lN.isSideCarExport=!0;function a4(e,t){return e.useMedium(t),lN}var cN=i4(),Yf=function(){},Ud=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Yf,onWheelCapture:Yf,onTouchMoveCapture:Yf}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,d=e.shards,m=e.sideCar,p=e.noRelative,g=e.noIsolation,x=e.inert,y=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,w=e.gapMode,j=oN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,C=n4([n,t]),I=jr(jr({},j),s);return h.createElement(h.Fragment,null,f&&h.createElement(S,{sideCar:cN,removeScrollBar:u,shards:d,noRelative:p,noIsolation:g,inert:x,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:w}),o?h.cloneElement(h.Children.only(l),jr(jr({},I),{ref:C})):h.createElement(b,jr({},I,{className:c,ref:C}),l))});Ud.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ud.classNames={fullWidth:du,zeroRight:uu};var o4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function l4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=o4();return t&&e.setAttribute("nonce",t),e}function c4(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function u4(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var d4=function(){var e=0,t=null;return{add:function(n){e==0&&(t=l4())&&(c4(t,n),u4(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},f4=function(){var e=d4();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uN=function(){var e=f4(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},h4={left:0,top:0,right:0,gap:0},Kf=function(e){return parseInt(e||"",10)||0},m4=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Kf(n),Kf(r),Kf(s)]},p4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return h4;var t=m4(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},g4=uN(),$a="data-scroll-locked",x4=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
456  .`.concat(XL,` {
457   overflow: hidden `).concat(r,`;
458   padding-right: `).concat(l,"px ").concat(r,`;
459  }
460  body[`).concat($a,`] {
461    overflow: hidden `).concat(r,`;
462    overscroll-behavior: contain;
463    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
464    padding-left: `.concat(s,`px;
465    padding-top: `).concat(a,`px;
466    padding-right: `).concat(o,`px;
467    margin-left:0;
468    margin-top:0;
469    margin-right: `).concat(l,"px ").concat(r,`;
470    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";
470")].filter(Boolean).join(""),`
471  }
472  
473  .`).concat(uu,` {
474    right: `).concat(l,"px ").concat(r,`;
475  }
476  
477  .`).concat(du,` {
478    margin-right: `).concat(l,"px ").concat(r,`;
479  }
480  
481  .`).concat(uu," .").concat(uu,` {
482    right: 0 `).concat(r,`;
483  }
484  
485  .`).concat(du," .").concat(du,` {
486    margin-right: 0 `).concat(r,`;
487  }
488  
489  body[`).concat($a,`] {
490    `).concat(JL,": ").concat(l,`px;
491  }
492`)},ab=function(){var e=parseInt(document.body.getAttribute($a)||"0",10);return isFinite(e)?e:0},y4=function(){h.useEffect(function(){return document.body.setAttribute($a,(ab()+1).toString()),function(){var e=ab()-1;e<=0?document.body.removeAttribute($a):document.body.setAttribute($a,e.toString())}},[])},v4=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;y4();var a=h.useMemo(function(){return p4(s)},[s]);return h.createElement(g4,{styles:x4(a,!t,s,n?"":"!important")})},Em=!1;if(typeof window<"u")try{var Uc=Object.defineProperty({},"passive",{get:function(){return Em=!0,!0}});window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{Em=!1}var wa=Em?{passive:!1}:!1,b4=function(e){return e.tagName==="TEXTAREA"},dN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b4(e)&&n[t]==="visible")},w4=function(e){return dN(e,"overflowY")},k4=function(e){return dN(e,"overflowX")},ob=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=fN(e,r);if(s){var a=hN(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},S4=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},N4=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},fN=function(e,t){return e==="v"?w4(t):k4(t)},hN=function(e,t){return e==="v"?S4(t):N4(t)},j4=function(e,t){return e==="h"&&t==="rtl"?-1:1},C4=function(e,t,n,r,s){var a=j4(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,f=o>0,d=0,m=0;do{if(!l)break;var p=hN(e,l),g=p[0],x=p[1],y=p[2],v=x-y-a*g;(g||v)&&fN(e,l)&&(d+=v,m+=g);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(f&&Math.abs(d)<1||!f&&Math.abs(m)<1)&&(u=!0),u},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lb=function(e){return[e.deltaX,e.deltaY]},cb=function(e){return e&&"current"in e?e.current:e},T4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},E4=function(e){return`
493  .block-interactivity-`.concat(e,` {pointer-events: none;}
494  .allow-interactivity-`).concat(e,` {pointer-events: all;}
495`)},_4=0,ka=[];function A4(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(_4++)[0],a=h.useState(uN)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var x=ZL([e.lockRef.current],(e.shards||[]).map(cb),!0).filter(Boolean);return x.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),x.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(x,y){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var v=Bc(x),b=n.current,w="deltaX"in x?x.deltaX:b[0]-v[0],j="deltaY"in x?x.deltaY:b[1]-v[1],S,C=x.target,I=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in x&&I==="h"&&C.type==="range")return!1;var E=window.getSelection(),N=E&&E.anchorNode,k=N?N===C||N.contains(C):!1;if(k)return!1;var A=ob(I,C);if(!A)return!0;if(A?S=I:(S=I==="v"?"h":"v",A=ob(I,C)),!A)return!1;if(!r.current&&"changedTouches"in x&&(w||j)&&(r.current=S),!S)return!0;var M=r.current||S;return C4(M,y,x,M==="h"?w:j)},[]),c=h.useCallback(function(x){var y=x;if(!(!ka.length||ka[ka.length-1]!==a)){var v="deltaY"in y?lb(y):Bc(y),b=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&T4(S.delta,v)}
495)[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(cb).filter(Boolean).filter(function(S){return S.contains(y.target)}),j=w.length>0?l(y,w[0]):!o.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),u=h.useCallback(function(x,y,v,b){var w={name:x,delta:y,target:v,should:b,shadowParent:P4(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),f=h.useCallback(function(x){n.current=Bc(x),r.current=void 0},[]),d=h.useCallback(function(x){u(x.type,lb(x),x.target,l(x,e.lockRef.current))},[]),m=h.useCallback(function(x){u(x.type,Bc(x),x.target,l(x,e.lockRef.current))},[]);h.useEffect(function(){return ka.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",c,wa),document.addEventListener("touchmove",c,wa),document.addEventListener("touchstart",f,wa),function(){ka=ka.filter(function(x){return x!==a}),document.removeEventListener("wheel",c,wa),document.removeEventListener("touchmove",c,wa),document.removeEventListener("touchstart",f,wa)}},[]);var p=e.removeScrollBar,g=e.inert;return h.createElement(h.Fragment,null,g?h.createElement(a,{styles:E4(s)}):null,p?h.createElement(v4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function P4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const R4=a4(cN,A4);var lc=h.forwardRef(function(e,t){return h.createElement(Ud,jr({},e,{ref:t,sideCar:R4}))});lc.classNames=Ud.classNames;var _m=["Enter"," "],I4=["ArrowDown","PageUp","Home"],mN=["ArrowUp","PageDown","End"],M4=[...I4,...mN],D4={ltr:[..._m,"ArrowRight"],rtl:[..._m,"ArrowLeft"]},O4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cc="Menu",[Il,L4,F4]=jo(cc),[ua,pN]=zt(cc,[F4,fi,$d]),Bd=fi(),gN=$d(),[V4,da]=ua(cc),[$4,uc]=ua(cc),xN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:o=!0}=e,l=Bd(t),[c,u]=h.useState(null),f=h.useRef(!1),d=Et(a),m=oa(s);return h.useEffect(()=>{const p=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;const p=()=>d(!1);return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,d]),i.jsx(Ld,{...l,children:i.jsx(V4,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:u,children:i.jsx($4,{scope:t,onClose:h.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:m,modal:o,children:r})})})};xN.displayName=cc;var z4="MenuAnchor",Sg=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Bd(n);return i.jsx(ac,{...s,...r,ref:t})});Sg.displayName=z4;var Ng="MenuPortal",[U4,yN]=ua(Ng,{forceMount:void 0}),vN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=da(Ng,t);return i.jsx(U4,{scope:t,forceMount:n,children:i.jsx(Lt,{present:n||a.open,children:i.jsx(ca,{asChild:!0,container:s,children:r})})})};vN.displayName=Ng;var Zn="MenuContent",[B4,jg]=ua(Zn),bN=h.forwardRef((e,t)=>{const n=yN(Zn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=da(Zn,e.__scopeMenu),o=uc(Zn,e.__scopeMenu);return i.jsx(Il.Provider,{scope:e.__scopeMenu,children:i.jsx(Lt,{present:r||a.open,children:i.jsx(Il.Slot,{scope:e.__scopeMenu,children:o.modal?i.jsx(H4,{...s,ref:t}):i.jsx(W4,{...s,ref:t})})})})}),H4=h.forwardRef((e,t)=>{const n=da(Zn,e.__scopeMenu),r=h.useRef(null),s=Ae(t,r);return h.useEffect(()=>{const a=r.current;if(a)return zd(a)},[]),i.jsx(Cg,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:se(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),W4=h.forwardRef((e,t)=>{const n=da(Zn,e.__scopeMenu);return i.jsx(Cg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),q4=ti("MenuContent.ScrollLock"),Cg=h.forwardRef((e,t)=>
495{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:p,disableOutsideScroll:g,...x}=e,y=da(Zn,n),v=uc(Zn,n),b=Bd(n),w=gN(n),j=L4(n),[S,C]=h.useState(null),I=h.useRef(null),E=Ae(t,I,y.onContentChange),N=h.useRef(0),k=h.useRef(""),A=h.useRef(0),M=h.useRef(null),L=h.useRef("right"),F=h.useRef(0),V=g?lc:h.Fragment,U=g?{as:q4,allowPinchZoom:!0}:void 0,P=D=>{var X,fe;const _=k.current+D,G=j().filter(ee=>!ee.disabled),z=document.activeElement,R=(X=G.find(ee=>ee.ref.current===z))==null?void 0:X.textValue,q=G.map(ee=>ee.textValue),Q=s5(q,_,R),K=(fe=G.find(ee=>ee.textValue===Q))==null?void 0:fe.ref.current;(function ee(te){k.current=te,window.clearTimeout(N.current),te!==""&&(N.current=window.setTimeout(()=>ee(""),1e3))})(_),K&&setTimeout(()=>K.focus())};h.useEffect(()=>()=>window.clearTimeout(N.current),[]),Rd();const T=h.useCallback(D=>{var G,z;return L.current===((G=M.current)==null?void 0:G.side)&&a5(D,(z=M.current)==null?void 0:z.area)},[]);return i.jsx(B4,{scope:n,searchRef:k,onItemEnter:h.useCallback(D=>{T(D)&&D.preventDefault()},[T]),onItemLeave:h.useCallback(D=>{var _;T(D)||((_=I.current)==null||_.focus(),C(null))},[T]),onTriggerLeave:h.useCallback(D=>{T(D)&&D.preventDefault()},[T]),pointerGraceTimerRef:A,onPointerGraceIntentChange:h.useCallback(D=>{M.current=D},[]),children:i.jsx(V,{...U,children:i.jsx(sc,{asChild:!0,trapped:s,onMountAutoFocus:se(a,D=>{var _;D.preventDefault(),(_=I.current)==null||_.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:i.jsx(la,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:p,children:i.jsx(sN,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:se(c,D=>{v.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Fd,{role:"menu","aria-orientation":"vertical","data-state":ON(y.open),"data-radix-menu-content":"",dir:v.dir,...b,...x,ref:E,style:{outline:"none",...x.style},onKeyDown:se(x.onKeyDown,D=>{const G=D.target.closest("[data-radix-menu-content]")===D.currentTarget,z=D.ctrlKey||D.altKey||D.metaKey,R=D.key.length===1;G&&(D.key==="Tab"&&D.preventDefault(),!z&&R&&P(D.key));const q=I.current;if(D.target!==q||!M4.includes(D.key))return;D.preventDefault();const K=j().filter(X=>!X.disabled).map(X=>X.ref.current);mN.includes(D.key)&&K.reverse(),n5(K)}),onBlur:se(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(N.current),k.current="")}),onPointerMove:se(e.onPointerMove,Ml(D=>{const _=D.target,G=F.current!==D.clientX;if(D.currentTarget.contains(_)&&G){const z=D.clientX>F.current?"right":"left";L.current=z,F.current=D.clientX}}))})})})})})})});bN.displayName=Zn;var G4="MenuGroup",Tg=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(pe.div,{role:"group",...r,ref:t})});Tg.displayName=G4;var Y4="MenuLabel",wN=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(pe.div,{...r,ref:t})});wN.displayName=Y4;var Fu="MenuItem",ub="menu.itemSelect",Hd=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=h.useRef(null),o=uc(Fu,e.__scopeMenu),l=jg(Fu,e.__scopeMenu),c=Ae(t,a),u=h.useRef(!1),f=()=>{const d=a.current;if(!n&&d){const m=new CustomEvent(ub,{bubbles:!0,cancelable:!0});d.addEventListener(ub,p=>r==null?void 0:r(p),{once:!0}),dg(d,m),m.defaultPrevented?u.current=!1:o.onClose()}};return i.jsx(kN,{...s,ref:c,disabled:n,onClick:se(e.onClick,f),onPointerDown:d=>{var m;(m=e.onPointerDown)==null||m.call(e,d),u.current=!0},onPointerUp:se(e.onPointerUp,d=>{var m;u.current||(m=d.currentTarget)==null||m.click()}),onKeyDown:se(e.onKeyDown,d=>{const m=l.searchRef.current!=="";n||m&&d.key===" "||_m.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Hd.displayName=Fu;var kN=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,o=jg(Fu,n),l=gN(n),c=h.useRef(null),u=Ae(t,c),[f,d]=h.useState(!1),[m,p]=h.useState("");return h.useEffect(()=>{const g=c.current;g&&p((g.textContent??"").trim())},[a.children]),i.jsx(Il.ItemSlot,{scope:n,disabled:r,textValue:s??m,children:i.jsx(iN,{asChild:!0,...l,focusable:!r,children:i.jsx(pe.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:se(e.onPointerMove,Ml(g=>{r?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focu
495s({preventScroll:!0}))})),onPointerLeave:se(e.onPointerLeave,Ml(g=>o.onItemLeave(g))),onFocus:se(e.onFocus,()=>d(!0)),onBlur:se(e.onBlur,()=>d(!1))})})})}),K4="MenuCheckboxItem",SN=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(EN,{scope:e.__scopeMenu,checked:n,children:i.jsx(Hd,{role:"menuitemcheckbox","aria-checked":Vu(n)?"mixed":n,...s,ref:t,"data-state":_g(n),onSelect:se(s.onSelect,()=>r==null?void 0:r(Vu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});SN.displayName=K4;var NN="MenuRadioGroup",[Q4,Z4]=ua(NN,{value:void 0,onValueChange:()=>{}}),jN=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=Et(r);return i.jsx(Q4,{scope:e.__scopeMenu,value:n,onValueChange:a,children:i.jsx(Tg,{...s,ref:t})})});jN.displayName=NN;var CN="MenuRadioItem",TN=h.forwardRef((e,t)=>{const{value:n,...r}=e,s=Z4(CN,e.__scopeMenu),a=n===s.value;return i.jsx(EN,{scope:e.__scopeMenu,checked:a,children:i.jsx(Hd,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":_g(a),onSelect:se(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});TN.displayName=CN;var Eg="MenuItemIndicator",[EN,X4]=ua(Eg,{checked:!1}),_N=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=X4(Eg,n);return i.jsx(Lt,{present:r||Vu(a.checked)||a.checked===!0,children:i.jsx(pe.span,{...s,ref:t,"data-state":_g(a.checked)})})});_N.displayName=Eg;var J4="MenuSeparator",AN=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(pe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});AN.displayName=J4;var e5="MenuArrow",PN=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Bd(n);return i.jsx(Vd,{...s,...r,ref:t})});PN.displayName=e5;var t5="MenuSub",[Gie,RN]=ua(t5),nl="MenuSubTrigger",IN=h.forwardRef((e,t)=>{const n=da(nl,e.__scopeMenu),r=uc(nl,e.__scopeMenu),s=RN(nl,e.__scopeMenu),a=jg(nl,e.__scopeMenu),o=h.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},f=h.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return h.useEffect(()=>f,[f]),h.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),c(null)}},[l,c]),i.jsx(Sg,{asChild:!0,...u,children:i.jsx(kN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?s.contentId:void 0,"data-state":ON(n.open),...e,ref:ei(t,s.onTriggerChange),onClick:d=>{var m;(m=e.onClick)==null||m.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:se(e.onPointerMove,Ml(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:se(e.onPointerLeave,Ml(d=>{var p,g;f();const m=(p=n.content)==null?void 0:p.getBoundingClientRect();if(m){const x=(g=n.content)==null?void 0:g.dataset.side,y=x==="right",v=y?-5:5,b=m[y?"left":"right"],w=m[y?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:b,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:b,y:m.bottom}],side:x}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:se(e.onKeyDown,d=>{var p;const m=a.searchRef.current!=="";e.disabled||m&&d.key===" "||D4[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});IN.displayName=nl;var MN="MenuSubContent",DN=h.forwardRef((e,t)=>{const n=yN(Zn,e.__scopeMenu),{forceMount:r=n.forceMount,align:s="start",...a}=e,o=da(Zn,e.__scopeMenu),l=uc(Zn,e.__scopeMenu),c=RN(MN,e.__scopeMenu),u=h.useRef(null),f=Ae(t,u);return i.jsx(Il.Provider,{scope:e.__scopeMenu,children:i.jsx(Lt,{present:r||o.open,children:i.jsx(Il.Slot,{scope:e.__scopeMenu,children:i.jsx(Cg,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:f,align:s,side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var m;l.isUsingKeyboardRef.current&&((m=u.current)==null||m.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:se(e.onFocusOutside,d=>{d.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:se(e.onEscapeKeyDown,d=>{l.onClose(),d.preventDefault()}),onKeyDown:se(e.onKeyDown,d=>{var g;const m=d.currentTarget.contains(d.target),p=O4[l.dir].includes(d.key);
495m&&p&&(o.onOpenChange(!1),(g=c.trigger)==null||g.focus(),d.preventDefault())})})})})})});DN.displayName=MN;function ON(e){return e?"open":"closed"}function Vu(e){return e==="indeterminate"}function _g(e){return Vu(e)?"indeterminate":e?"checked":"unchecked"}function n5(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function r5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function s5(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=r5(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function i5(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,f=l.y,d=c.x,m=c.y;f>r!=m>r&&n<(d-u)*(r-f)/(m-f)+u&&(s=!s)}return s}function a5(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return i5(n,t)}function Ml(e){return t=>t.pointerType==="mouse"?e(t):void 0}var o5=xN,l5=Sg,c5=vN,u5=bN,d5=Tg,f5=wN,h5=Hd,m5=SN,p5=jN,g5=TN,x5=_N,y5=AN,v5=PN,b5=IN,w5=DN,Wd="DropdownMenu",[k5]=zt(Wd,[pN]),gn=pN(),[S5,LN]=k5(Wd),FN=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=gn(t),u=h.useRef(null),[f,d]=jn({prop:s,defaultProp:a??!1,onChange:o,caller:Wd});return i.jsx(S5,{scope:t,triggerId:Ot(),triggerRef:u,contentId:Ot(),open:f,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(m=>!m),[d]),modal:l,children:i.jsx(o5,{...c,open:f,onOpenChange:d,dir:r,modal:l,children:n})})};FN.displayName=Wd;var VN="DropdownMenuTrigger",$N=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,a=LN(VN,n),o=gn(n);return i.jsx(l5,{asChild:!0,...o,children:i.jsx(pe.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:ei(t,a.triggerRef),onPointerDown:se(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:se(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});$N.displayName=VN;var N5="DropdownMenuPortal",zN=e=>{const{__scopeDropdownMenu:t,...n}=e,r=gn(t);return i.jsx(c5,{...r,...n})};zN.displayName=N5;var UN="DropdownMenuContent",BN=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=LN(UN,n),a=gn(n),o=h.useRef(!1);return i.jsx(u5,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:t,onCloseAutoFocus:se(e.onCloseAutoFocus,l=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:se(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BN.displayName=UN;var j5="DropdownMenuGroup",C5=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(d5,{...s,...r,ref:t})});C5.displayName=j5;var T5="DropdownMenuLabel",HN=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(f5,{...s,...r,ref:t})});HN.displayName=T5;var E5="DropdownMenuItem",WN=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(h5,{...s,...r,ref:t})});WN.displayName=E5;var _5="DropdownMenuCheckboxItem",qN=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(m5,{...s,...r,ref:t})});qN.displayName=_5;var A5="DropdownMenuRadioGroup",P5=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(p5,{...s,...r,ref:t})});P5.displayName=A5;var R5="DropdownMenuRadioItem",GN=h.forwardRef((e,t)=>
495{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(g5,{...s,...r,ref:t})});GN.displayName=R5;var I5="DropdownMenuItemIndicator",YN=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(x5,{...s,...r,ref:t})});YN.displayName=I5;var M5="DropdownMenuSeparator",KN=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(y5,{...s,...r,ref:t})});KN.displayName=M5;var D5="DropdownMenuArrow",O5=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(v5,{...s,...r,ref:t})});O5.displayName=D5;var L5="DropdownMenuSubTrigger",QN=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(b5,{...s,...r,ref:t})});QN.displayName=L5;var F5="DropdownMenuSubContent",ZN=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=gn(n);return i.jsx(w5,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ZN.displayName=F5;var V5=FN,$5=$N,z5=zN,XN=BN,JN=HN,ej=WN,tj=qN,nj=GN,rj=YN,sj=KN,ij=QN,aj=ZN;const Ag=V5,Pg=$5,U5=h.forwardRef(({className:e,inset:t,children:n,...r},s)=>i.jsxs(ij,{ref:s,className:W("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,i.jsx(Bn,{className:"ml-auto h-4 w-4"})]}));U5.displayName=ij.displayName;const B5=h.forwardRef(({className:e,...t},n)=>i.jsx(aj,{ref:n,className:W("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));B5.displayName=aj.displayName;const qd=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(z5,{children:i.jsx(XN,{ref:r,sideOffset:t,className:W("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));qd.displayName=XN.displayName;const Ui=h.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(ej,{ref:r,className:W("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Ui.displayName=ej.displayName;const H5=h.forwardRef(({className:e,children:t,checked:n,...r},s)=>i.jsxs(tj,{ref:s,className:W("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(rj,{children:i.jsx(ot,{className:"h-4 w-4"})})}),t]}));H5.displayName=tj.displayName;const W5=h.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(nj,{ref:r,className:W("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(rj,{children:i.jsx(wD,{className:"h-2 w-2 fill-current"})})}),t]}));W5.displayName=nj.displayName;const Rg=h.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(JN,{ref:r,className:W("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Rg.displayName=JN.displayName;const $u=h.forwardRef(({className:e,...t},n)=>i.jsx(sj,{ref:n,className:W("-mx-1 my-1 h-px bg-muted",e),...t}));$u.displayName=sj.displayName;var Ig="Avatar",[q5]=zt(Ig),G5=[0,()=>{}],[Y5,oj]=q5(Ig),Mg=h.forwardRef((e,t)=>
495{const{__scopeAvatar:n,...r}=e,[s,a]=h.useState("idle"),[o,l]=Q5();return i.jsx(Y5,{scope:n,imageLoadingStatus:s,setImageLoadingStatus:a,imageCount:o,setImageCount:l,children:i.jsx(pe.span,{...r,ref:t})})});Mg.displayName=Ig;var lj="AvatarImage",Dg=h.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s,...a}=e,o=oj(lj,n);Z5(o.setImageCount);const l=K5(r,{referrerPolicy:a.referrerPolicy,crossOrigin:a.crossOrigin,loadingStatus:o.imageLoadingStatus,setLoadingStatus:o.setImageLoadingStatus}),c=Et(f=>{s==null||s(f)}),u=h.useRef(l);return _t(()=>{const f=u.current;u.current=l,l!==f&&c(l)},[l,c]),l==="loaded"?i.jsx(pe.img,{...a,ref:t,src:r}):null});Dg.displayName=lj;var cj="AvatarFallback",Og=h.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,a=oj(cj,n),[o,l]=h.useState(r===void 0);return h.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&a.imageLoadingStatus!=="loaded"?i.jsx(pe.span,{...s,ref:t}):null});Og.displayName=cj;function K5(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:s}){return _t(()=>{if(!e){n("error");return}const a=new window.Image,o=c=>{const u=c.currentTarget;n(db(u))},l=()=>n("error");return a.addEventListener("load",o),a.addEventListener("error",l),r&&(a.referrerPolicy=r),a.crossOrigin=s??null,a.src=e,n(db(a)),()=>{a.removeEventListener("load",o),a.removeEventListener("error",l),n("idle")}},[e,s,r,n]),t}function db(e){return e.complete?e.naturalWidth>0?"loaded":"error":"loading"}function Q5(){let e=G5;{e=h.useState(0);const[t]=e,n=h.useRef(!1);h.useEffect(()=>{t>1&&!n.current&&(n.current=!0,console.warn("Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior."))},[t])}return e}function Z5(e){h.useEffect(()=>(e(t=>t+1),()=>{e(t=>t-1)}),[e])}const Lg=h.forwardRef(({className:e,...t},n)=>i.jsx(Mg,{ref:n,className:W("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Lg.displayName=Mg.displayName;const uj=h.forwardRef(({className:e,src:t,...n},r)=>i.jsx(Dg,{ref:r,className:W("aspect-square h-full w-full",e),src:t,crossOrigin:"anonymous",referrerPolicy:"no-referrer",loading:"eager",...n}));uj.displayName=Dg.displayName;const Fg=h.forwardRef(({className:e,...t},n)=>i.jsx(Og,{ref:n,className:W("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Fg.displayName=Og.displayName;function dj({user:e,className:t,size:n="md",fallbackClassName:r}){const[s,a]=h.useState(e.profileImageUrl),[o,l]=h.useState(0),[c,u]=h.useState(),[f,d]=h.useState(!1),m={xs:"h-6 w-6",sm:"h-8 w-8",md:"h-10 w-10",lg:"h-24 w-24",xl:"h-32 w-32"},p={sm:"text-sm",md:"text-base",lg:"text-xl",xl:"text-3xl"},x=((C,I,E)=>C&&I?`${C[0]}${I[0]}`.toUpperCase():C?C[0].toUpperCase():E?E[0].toUpperCase():"U")(e.firstName,e.lastName,e.email);h.useEffect(()=>{e.profileImageUrl&&e.profileImageUrl.startsWith("profiles/")&&(d(!0),fetch(`/api/user/profile-photo-url/${e.id}`,{credentials:"include"}).then(async C=>{if(C.ok){const I=await C.json();I.url&&(u(I.url),a(I.url),l(E=>E+1))}}).catch(C=>{console.error("Failed to fetch R2 profile photo:",C)}).finally(()=>{d(!1)}))},[e.profileImageUrl,e.id]),h.useEffect(()=>{var N;if(e.profileImageUrl&&(e.profileImageUrl.includes("accounts.google.com")||e.profileImageUrl.includes("oauth"))){y(""),a(void 0);return}if(e.profileImageUrl&&e.profileImageUrl.startsWith("profiles/"))return;if(e.profileImageUrl&&e.profileImageUrl.includes("/api/files/profile/")){a(e.profileImageUrl);return}if(e.authProvider!=="google"||!e.googleId){a(e.profileImageUrl);return}if(!/^[0-9]{15,25}$/.test(e.googleId)){a((N=e.profileImageUrl)!=null&&N.startsWith("http")?"/api/proxy/profile-image":e.profileImageUrl);return}const I=async()=>{try{const k=e.profileImageUrl&&e.profileImageUrl.includes("googleusercontent.com")?e.profileImageUrl.split("?")[0]:`https://lh3.googleusercontent.com/a/${e.googleId}=s96-c`,A=`${k}?t=${Date.now()}`,M=new Image;M.crossOrigin="anonymous",M.onload=()=>{a(A),l(L=>L+1),y(k)},M.onerror=()=>{var L;a((L=e.profileImageUrl)!=null&&L.startsWith("http")&&!e.profileImageUrl.includes("accounts.google.com")?"/api/proxy/profile-image":e.profileImageUrl)},M.src=A}catch{a(e.profileImageUrl)}};I();const E=setInterval(I,5*60*1e3);return()=>clearInterval(E)},[e.googleId,e.authProvider,e.profileImageUrl,e.id]);const y=async C=>
495{if(C!==e.profileImageUrl)try{await fetch("/api/user/profile",{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({profileImageUrl:C||null})}),typeof window<"u"&&window.queryClient&&window.queryClient.invalidateQueries({queryKey:["/api/auth/user"]})}catch{}},v=(s==null?void 0:s.includes("accounts.google.com"))||(s==null?void 0:s.includes("oauth")),b=s==null?void 0:s.includes(".r2.cloudflarestorage.com"),w=s==null?void 0:s.includes("googleusercontent.com"),j=v?void 0:s!=null&&s.startsWith("http")&&!w&&!b?"/api/proxy/profile-image":s,S=!b&&j!==void 0;return i.jsxs(Lg,{className:`${m[n]} ${t||""}`,children:[i.jsx(uj,{src:j,alt:e.email||"User",crossOrigin:S?"anonymous":void 0,referrerPolicy:"no-referrer"},o),i.jsx(Fg,{className:`${p[n]} ${r||""}`,children:x})]})}function X5(){var a,o;const{user:e}=At(),t=e&&"teamMemberRole"in e?String(e.teamMemberRole):void 0,n=async()=>{try{const{queryClient:l}=await ce(async()=>{const{queryClient:c}=await Promise.resolve().then(()=>jv);return{queryClient:c}},void 0);await _r("/api/logout",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}}),await Or(l,{force:!0}),so("/logout-success")}catch{const{queryClient:c}=await ce(async()=>{const{queryClient:u}=await Promise.resolve().then(()=>jv);return{queryClient:u}},void 0);await Or(c,{force:!0}),so("/logout-success")}},r=e?`${((a=e.firstName)==null?void 0:a[0])||""}${((o=e.lastName)==null?void 0:o[0])||""}`.toUpperCase():"U",s=e?{id:e.id,email:e.email,firstName:e.firstName,lastName:e.lastName,profileImageUrl:e.profileImageUrl||void 0,authProvider:e.authProvider,googleId:e.googleId||void 0}:null;return i.jsxs("div",{className:"h-16 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 sm:px-6 flex items-center justify-between",children:[i.jsx("div",{className:"md:hidden"}),i.jsx("div",{className:"ml-auto flex items-center space-x-2 sm:space-x-4",children:i.jsxs(Ag,{children:[i.jsx(Pg,{asChild:!0,children:i.jsx(Z,{variant:"ghost",className:"relative h-10 w-10 rounded-full touch-target",children:s?i.jsx(dj,{user:s,size:"md",className:"h-10 w-10",fallbackClassName:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100"}):i.jsx(Lg,{className:"h-10 w-10",children:i.jsx(Fg,{className:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100",children:r})})})}),i.jsxs(qd,{align:"end",className:"w-56",children:[i.jsx(Rg,{children:i.jsxs("div",{className:"flex flex-col space-y-1",children:[i.jsxs("p",{className:"text-sm font-medium leading-none",children:[e==null?void 0:e.firstName," ",e==null?void 0:e.lastName]}),i.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:e==null?void 0:e.email}),t&&i.jsxs("p",{className:"text-xs leading-none text-muted-foreground mt-1",children:["Role: ",t]})]})}),i.jsx($u,{}),i.jsxs(Ui,{onClick:n,children:[i.jsx(El,{className:"mr-2 h-4 w-4"}),i.jsx("span",{children:"Log out"})]})]})]})})]})}const Vg=h.createContext({});function dc(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const Gd=h.createContext(null),$g=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class J5 extends h.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function eF({children:e,isPresent:t}){const n=h.useId(),r=h.useRef(null),s=h.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=h.useContext($g);return h.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=s.current;if(t||!r.current||!o||!l)return;r.current.dataset.motionPopId=n;const f=document.createElement("style");return a&&(f.nonce=a),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(`
496          [data-motion-pop-id="${n}"] {
497            position: absolute !important;
498            width: ${o}px !important;
499            height: ${l}px !important;
500            top: ${c}px !important;
501            left: ${u}px !important;
502          }
503        `),()=>{document.head.removeChild(f)}},[t]),i.jsx(J5,{isPresent:t,childRef:r,sizeRef:s,children:h.cloneElement(e,{ref:r})})}const tF=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:o})=>{const l=dc(nF),c=h.useId(),u=h.useCallback(d=>{l.set(d,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=h.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:d=>(l.set(d,!1),()=>l.delete(d))}),a?[Math.random(),u]:[n,u]);return h.useMemo(()=>{l.forEach((d,m)=>l.set(m,!1))},[n]),h.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=i.jsx(eF,{isPresent:n,children:e})),i.jsx(Gd.Provider,{value:f,children:e})};function nF(){return new Map}function fj(e=!0){const t=h.useContext(Gd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=h.useId();h.useEffect(()=>{e&&s(a)},[e]);const o=h.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const Hc=e=>e.key||"";function fb(e){const t=[];
vendor: 112,362 bytes, line 503
503return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const zg=typeof window<"u",Ug=zg?h.useLayoutEffect:h.useEffect,hj=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:a="sync",propagate:o=!1})=>{const[l,c]=fj(o),u=h.useMemo(()=>fb(e),[e]),f=o&&!l?[]:u.map(Hc),d=h.useRef(!0),m=h.useRef(u),p=dc(()=>new Map),[g,x]=h.useState(u),[y,v]=h.useState(u);Ug(()=>{d.current=!1,m.current=u;for(let j=0;j<y.length;j++){const S=Hc(y[j]);f.includes(S)?p.delete(S):p.get(S)!==!0&&p.set(S,!1)}},[y,f.length,f.join("-")]);const b=[];if(u!==g){let j=[...u];for(let S=0;S<y.length;S++){const C=y[S],I=Hc(C);f.includes(I)||(j.splice(S,0,C),b.push(C))}a==="wait"&&b.length&&(j=b),v(fb(j)),x(u);return}const{forceRender:w}=h.useContext(Vg);return i.jsx(i.Fragment,{children:y.map(j=>{const S=Hc(j),C=o&&!l?!1:u===y||f.includes(S),I=()=>{if(p.has(S))p.set(S,!0);else return;let E=!0;p.forEach(N=>{N||(E=!1)}),E&&(w==null||w(),v(m.current),o&&(c==null||c()),r&&r())};return i.jsx(tF,{isPresent:C,initial:!d.current||n?void 0:!1,custom:C?void 0:t,presenceAffectsLayout:s,mode:a,onExitComplete:C?void 0:I,children:j},S)})})},mn=e=>e;let rF=mn,mj=mn;function Bg(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ki=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},cs=e=>e*1e3,us=e=>e/1e3,sF={useManualTiming:!1};function iF(e){let t=new Set,n=new Set,r=!1,s=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){a.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,f=!1,d=!1)=>{const p=d&&r?t:n;return f&&a.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(o=u,r){s=!0;return}r=!0,[t,n]=[n,t],t.forEach(l),t.clear(),r=!1,s&&(s=!1,c.process(u))}};return c}const Wc=["read","resolveKeyframes","update","preRender","render","postRender"],aF=40;function pj(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Wc.reduce((v,b)=>(v[b]=iF(a),v),{}),{read:l,resolveKeyframes:c,update:u,preRender:f,render:d,postRender:m}=o,p=()=>{const v=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(v-s.timestamp,aF),1),s.timestamp=v,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),f.process(s),d.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},g=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:Wc.reduce((v,b)=>{const w=o[b];return v[b]=(j,S=!1,C=!1)=>(n||g(),w.schedule(j,S,C)),v},{}),cancel:v=>{for(let b=0;b<Wc.length;b++)o[Wc[b]].cancel(v)},state:s,steps:o}}const{schedule:ct,cancel:Lr,state:Bt,steps:Qf}=pj(typeof requestAnimationFrame<"u"?requestAnimationFrame:mn,!0),gj=h.createContext({strict:!1}),hb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},lo={};for(const e in hb)lo[e]={isEnabled:t=>hb[e].some(n=>!!t[n])};function oF(e){for(const t in e)lo[t]={...lo[t],...e[t]}}const lF=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function zu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||lF.has(e)}let xj=e=>!zu(e);function cF(e){e&&(xj=t=>t.startsWith("on")?!zu(t):e(t))}try{cF(require("@emotion/is-prop-valid").default)}catch{}function uF(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(xj(s)||n===!0&&zu(s)||!t&&!zu(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function dF(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Yd=h.createContext({});function Dl(e){return typeof e=="string"||Array.isArray(e)}function Kd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Hg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wg=["initial",...Hg];function Qd(e){return Kd(e.animate)||Wg.some(t=>Dl(e[t]))}function yj(e){return!!(Qd(e)||e.variants)}function fF(e,t){if(Qd(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Dl(n)?n:void 0,animate:Dl(r)?r:void 0}}return e.inherit!==!1?t:{}}function hF(e){const{initial:t,animate:n}=fF(e,h.useContext(Yd));return h.useMemo(()=>({initial:t,animate:n}),[mb(t),mb(n)])}function mb(e){return Array.isArray(e)?e.join(" "):e}const mF=Symbol.for("motionComponentSymbol");function Ra(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function pF(e,t,n){return h.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ra(n)&&(n.current=r))},[t])}const qg=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),gF="framerAppearId",vj="data-"+qg(gF),{schedule:Gg}=pj(queueMicrotask,!1),bj=h.createContext({});function xF(e,t,n,r,s){var a,o;const{visualElement:l}=h.useContext(Yd),c=h.useContext(gj),u=h.useContext(Gd),f=h.useContext($g).reducedMotion,d=h.useRef(null);r=r||c.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f}));const m=d.current,p=h.useContext(bj);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&yF(d.current,n,s,p);const g=h.useRef(!1);h.useInsertionEffect(()=>{m&&g.current&&m.update(n,u)});const x=n[vj],y=h.useRef(!!x&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,x))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,x)));return Ug(()=>{m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),Gg.render(m.render),y.current&&m.animationState&&m.animationState.animateChanges())}),h.useEffect(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)===null||v===void 0||v.call(window,x)}),y.current=!1))}),m}function yF(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:wj(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&Ra(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function wj(e){if(e)return e.options.allowProjection!==!1?e.projection:wj(e.parent)}function vF({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var a,o;e&&oF(e);function l(u,f){let d;const m={...h.useContext($g),...u,layoutId:bF(u)},{isStatic:p}=m,g=hF(u),x=r(u,p);if(!p&&zg){wF();const y=kF(m);d=y.MeasureLayout,g.visualElement=xF(s,x,m,t,y.ProjectionNode)}return i.jsxs(Yd.Provider,{value:g,children:[d&&g.visualElement?i.jsx(d,{visualElement:g.visualElement,...m}):null,n(s,u,pF(x,g.visualElement,f),x,p,g.visualElement)]})}l.displayName=`motion.${typeof s=="string"?s:`create(${(o=(a=s.displayName)!==null&&a!==void 0?a:s.name)!==null&&o!==void 0?o:""})`}`;const c=h.forwardRef(l);return c[mF]=s,c}function bF({layoutId:e}){const t=h.useContext(Vg).id;return t&&e!==void 0?t+"-"+e:e}function wF(e,t){h.useContext(gj).strict}function kF(e){const{drag:t,layout:n}=lo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const SF=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yg(e){return typeof e!="string"||e.includes("-")?!1:!!(SF.indexOf(e)>-1||/[A-Z]/u.test(e))}function pb(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Kg(e,t,n,r){if(typeof t=="function"){const[s,a]=pb(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=pb(r);t=t(n!==void 0?n:e.custom,s,a)}return t}const Am=e=>Array.isArray(e),NF=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),jF=e=>Am(e)?e[e.length-1]||0:e,tn=e=>!!(e&&e.getVelocity);function fu(e){const t=tn(e)?e.get():e;return NF(t)?t.toValue():t}function CF({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,a){const o={latestValues:TF(r,s,a,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const kj=e=>(t,n)=>{const r=h.useContext(Yd),s=h.useContext(Gd),a=()=>CF(e,t,r,s);return n?a():dc(a)};function TF(e,t,n,r){const s={},a=r(e,{});for(const m in a)s[m]=fu(a[m]);let{initial:o,animate:l}=e;const c=Qd(e),u=yj(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const d=f?l:o;if(d&&typeof d!="boolean"&&!Kd(d)){const m=Array.isArray(d)?d:[d];for(let p=0;p<m.length;p++){const g=Kg(e,m[p]);if(g){const{transitionEnd:x,transition:y,...v}=g;for(const b in v){let w=v[b];if(Array.isArray(w)){const j=f?w.length-1:0;w=w[j]}w!==null&&(s[b]=w)}for(const b in x)s[b]=x[b]}}}return s}const Eo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fa=new Set(Eo),Sj=e=>t=>typeof t=="string"&&t.startsWith(e),Nj=Sj("--"),EF=Sj("var(--"),Qg=e=>EF(e)?_F.test(e.split("/*")[0].trim()):!1,_F=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,jj=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Fr=(e,t,n)=>n>t?t:n<e?e:n,_o={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ol={..._o,transform:e=>Fr(0,1,e)},qc={..._o,default:1},fc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Is=fc("deg"),Rr=fc("%"),_e=fc("px"),AF=fc("vh"),PF=fc("vw"),gb={...Rr,parse:e=>Rr.parse(e)/100,transform:e=>Rr.transform(e*100)},RF={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,radius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,backgroundPositionX:_e,backgroundPositionY:_e},IF={rotate:Is,rotateX:Is,rotateY:Is,rotateZ:Is,scale:qc,scaleX:qc,scaleY:qc,scaleZ:qc,skew:Is,skewX:Is,skewY:Is,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:Ol,originX:gb,originY:gb,originZ:_e},xb={..._o,transform:Math.round},Zg={...RF,...IF,zIndex:xb,size:_e,fillOpacity:Ol,strokeOpacity:Ol,numOctaves:xb},MF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},DF=Eo.length;function OF(e,t,n){let r="",s=!0;for(let a=0;a<DF;a++){const o=Eo[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=jj(l,Zg[o]);if(!c){s=!1;const f=MF[o]||o;r+=`${f}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Xg(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(fa.has(c)){o=!0;continue}else if(Nj(c)){s[c]=u;continue}else{const f=jj(u,Zg[c]);c.startsWith("origin")?(l=!0,a[c]=f):r[c]=f}}if(t.transform||(o||n?r.transform=OF(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:f=0}=a;r.transformOrigin=`${c} ${u} ${f}`}}const LF={offset:"stroke-dashoffset",array:"stroke-dasharray"},FF={offset:"strokeDashoffset",array:"strokeDasharray"};function VF(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?LF:FF;e[a.offset]=_e.transform(-r);const o=_e.transform(t),l=_e.transform(n);e[a.array]=`${o} ${l}`}function yb(e,t,n){return typeof e=="string"?e:_e.transform(t+n*e)}function $F(e,t,n){const r=yb(t,e.x,e.width),s=yb(n,e.y,e.height);return`${r} ${s}`}function Jg(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:a,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...u},f,d){if(Xg(e,u,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:p,dimensions:g}=e;m.transform&&(g&&(p.transform=m.transform),delete m.transform),g&&(s!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=$F(g,s!==void 0?s:.5,a!==void 0?a:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),o!==void 0&&VF(m,o,l,c,!1)}const ex=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Cj=()=>({...ex(),attrs:{}}),tx=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Tj(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const Ej=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function _j(e,t,n,r){Tj(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Ej.has(s)?s:qg(s),t.attrs[s])}const Uu={};function zF(e){Object.assign(Uu,e)}function Aj(e,{layout:t,layoutId:n}){return fa.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Uu[e]||e==="opacity")}function nx(e,t,n){var r;const{style:s}=e,a={};for(const o in s)(tn(s[o])||t.style&&tn(t.style[o])||Aj(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[o]=s[o]);return a}function Pj(e,t,n){const r=nx(e,t,n);for(const s in e)if(tn(e[s])||tn(t[s])){const a=Eo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}function UF(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const vb=["x","y","width","height","cx","cy","r"],BF={useVisualState:kj({scrapeMotionValuesFromProps:Pj,createRenderState:Cj,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let a=!!e.drag;if(!a){for(const l in s)if(fa.has(l)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let l=0;l<vb.length;l++){const c=vb[l];e[c]!==t[c]&&(o=!0)}o&&ct.read(()=>{UF(n,r),ct.render(()=>{Jg(r,s,tx(n.tagName),e.transformTemplate),_j(n,r)})})}})},HF={useVisualState:kj({scrapeMotionValuesFromProps:nx,createRenderState:ex})};function Rj(e,t,n){for(const r in t)!tn(t[r])&&!Aj(r,n)&&(e[r]=t[r])}function WF({transformTemplate:e},t){return h.useMemo(()=>{const n=ex();return Xg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function qF(e,t){const n=e.style||{},r={};return Rj(r,n,e),Object.assign(r,WF(e,t)),r}function GF(e,t){const n={},r=qF(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function YF(e,t,n,r){const s=h.useMemo(()=>{const a=Cj();return Jg(a,t,tx(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Rj(a,e.style,e),s.style={...a,...s.style}}return s}function KF(e=!1){return(n,r,s,{latestValues:a},o)=>{const c=(Yg(n)?YF:GF)(r,a,o,n),u=uF(r,typeof n=="string",e),f=n!==h.Fragment?{...u,...c,ref:s}:{},{children:d}=r,m=h.useMemo(()=>tn(d)?d.get():d,[d]);return h.createElement(n,{...f,children:m})}}function QF(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...Yg(r)?BF:HF,preloadedFeatures:e,useRender:KF(s),createVisualElement:t,Component:r};return vF(o)}}function Ij(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Zd(e,t,n){const r=e.getProps();return Kg(r,t,n!==void 0?n:r.custom,e)}const Mj=Bg(()=>window.ScrollTimeline!==void 0);class ZF{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(Mj()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,a)=>{s&&s(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class XF extends ZF{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function rx(e,t){return e?e[t]||e.default||e:void 0}const Pm=2e4;function Dj(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Pm;)t+=n,r=e.next(t);return t>=Pm?1/0:t}function sx(e){return typeof e=="function"}function bb(e,t){e.timeline=t,e.onfinish=null}const ix=e=>Array.isArray(e)&&typeof e[0]=="number",JF={linearEasing:void 0};function e3(e,t){const n=Bg(e);return()=>{var r;return(r=JF[t])!==null&&r!==void 0?r:n()}}const Bu=e3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Oj=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=e(Ki(0,s-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function Lj(e){return!!(typeof e=="function"&&Bu()||!e||typeof e=="string"&&(e in Rm||Bu())||ix(e)||Array.isArray(e)&&e.every(Lj))}const rl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Rm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:rl([0,.65,.55,1]),circOut:rl([.55,0,1,.45]),backIn:rl([.31,.01,.66,-.59]),backOut:rl([.33,1.53,.69,.99])};function Fj(e,t){if(e)return typeof e=="function"&&Bu()?Oj(e,t):ix(e)?rl(e):Array.isArray(e)?e.map(n=>Fj(n,t)||Rm.easeOut):Rm[e]}const er={x:!1,y:!1};function Vj(){return er.x||er.y}function $j(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const a=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function zj(e,t){const n=$j(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function wb(e){return t=>{t.pointerType==="touch"||Vj()||e(t)}}function t3(e,t,n={}){const[r,s,a]=zj(e,n),o=wb(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const f=wb(d=>{u(d),c.removeEventListener("pointerleave",f)});c.addEventListener("pointerleave",f,s)});return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const Uj=(e,t)=>t?e===t?!0:Uj(e,t.parentElement):!1,ax=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,n3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function r3(e){return n3.has(e.tagName)||e.tabIndex!==-1}const sl=new WeakSet;function kb(e){return t=>{t.key==="Enter"&&e(t)}}function Zf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const s3=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=kb(()=>{if(sl.has(n))return;Zf(n,"down");const s=kb(()=>{Zf(n,"up")}),a=()=>Zf(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Sb(e){return ax(e)&&!Vj()}function i3(e,t,n={}){const[r,s,a]=zj(e,n),o=l=>{const c=l.currentTarget;if(!Sb(l)||sl.has(c))return;sl.add(c);const u=t(l),f=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",m),!(!Sb(p)||!sl.has(c))&&(sl.delete(c),typeof u=="function"&&u(p,{success:g}))},d=p=>{f(p,n.useGlobalTarget||Uj(c,p.target))},m=p=>{f(p,!1)};window.addEventListener("pointerup",d,s),window.addEventListener("pointercancel",m,s)};return r.forEach(l=>{!r3(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),l.addEventListener("focus",u=>s3(u,s),s)}),a}function a3(e){return e==="x"||e==="y"?er[e]?null:(er[e]=!0,()=>{er[e]=!1}):er.x||er.y?null:(er.x=er.y=!0,()=>{er.x=er.y=!1})}const Bj=new Set(["width","height","top","left","right","bottom",...Eo]);let hu;function o3(){hu=void 0}const Ir={now:()=>(hu===void 0&&Ir.set(Bt.isProcessing||sF.useManualTiming?Bt.timestamp:performance.now()),hu),set:e=>{hu=e,queueMicrotask(o3)}};function ox(e,t){e.indexOf(t)===-1&&e.push(t)}function lx(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class cx{constructor(){this.subscriptions=[]}add(t){return ox(this.subscriptions,t),()=>lx(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let a=0;a<s;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ux(e,t){return t?e*(1e3/t):0}const Nb=30,l3=e=>!isNaN(parseFloat(e)),jb={current:void 0};class c3{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const a=Ir.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ir.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=l3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new cx);const r=this.events[t].add(n);return t==="change"?()=>{r(),ct.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return jb.current&&jb.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Ir.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Nb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Nb);return ux(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function as(e,t){return new c3(e,t)}function u3(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,as(n))}function d3(e,t){const n=Zd(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=jF(a[o]);u3(e,o,l)}}function f3(e){return!!(tn(e)&&e.add)}function Im(e,t){const n=e.getValue("willChange");if(f3(n))return n.add(t)}function Hj(e){return e.props[vj]}const Wj=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,h3=1e-7,m3=12;function p3(e,t,n,r,s){let a,o,l=0;do o=t+(n-t)/2,a=Wj(o,r,s)-e,a>0?n=o:t=o;while(Math.abs(a)>h3&&++l<m3);return o}function hc(e,t,n,r){if(e===t&&n===r)return mn;const s=a=>p3(a,0,1,e,n);return a=>a===0||a===1?a:Wj(s(a),t,r)}const qj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Gj=e=>t=>1-e(1-t),Yj=hc(.33,1.53,.69,.99),dx=Gj(Yj),Kj=qj(dx),Qj=e=>(e*=2)<1?.5*dx(e):.5*(2-Math.pow(2,-10*(e-1))),fx=e=>1-Math.sin(Math.acos(e)),Zj=Gj(fx),Xj=qj(fx),Jj=e=>/^0[^.\s]+$/u.test(e);function g3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Jj(e):!0}const fl=e=>Math.round(e*1e5)/1e5,hx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function x3(e){return e==null}const y3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mx=(e,t)=>n=>!!(typeof n=="string"&&y3.test(n)&&n.startsWith(e)||t&&!x3(n)&&Object.prototype.hasOwnProperty.call(n,t)),eC=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(hx);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},v3=e=>Fr(0,255,e),Xf={..._o,transform:e=>Math.round(v3(e))},Ai={test:mx("rgb","red"),parse:eC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Xf.transform(e)+", "+Xf.transform(t)+", "+Xf.transform(n)+", "+fl(Ol.transform(r))+")"};function b3(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Mm={test:mx("#"),parse:b3,transform:Ai.transform},Ia={test:mx("hsl","hue"),parse:eC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Rr.transform(fl(t))+", "+Rr.transform(fl(n))+", "+fl(Ol.transform(r))+")"},Xt={test:e=>Ai.test(e)||Mm.test(e)||Ia.test(e),parse:e=>Ai.test(e)?Ai.parse(e):Ia.test(e)?Ia.parse(e):Mm.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ai.transform(e):Ia.transform(e)},w3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function k3(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(hx))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(w3))===null||n===void 0?void 0:n.length)||0)>0}const tC="number",nC="color",S3="var",N3="var(",Cb="${}",j3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ll(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(j3,c=>(Xt.test(c)?(r.color.push(a),s.push(nC),n.push(Xt.parse(c))):c.startsWith(N3)?(r.var.push(a),s.push(S3),n.push(c)):(r.number.push(a),s.push(tC),n.push(parseFloat(c))),++a,Cb)).split(Cb);return{values:n,split:l,indexes:r,types:s}}function rC(e){return Ll(e).values}function sC(e){const{split:t,types:n}=Ll(e),r=t.length;return s=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],s[o]!==void 0){const l=n[o];l===tC?a+=fl(s[o]):l===nC?a+=Xt.transform(s[o]):a+=s[o]}return a}}const C3=e=>typeof e=="number"?0:e;function T3(e){const t=rC(e);return sC(e)(t.map(C3))}const si={test:k3,parse:rC,createTransformer:sC,getAnimatableNone:T3},E3=new Set(["brightness","contrast","saturate","opacity"]);function _3(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(hx)||[];if(!r)return e;const s=n.replace(r,"");let a=E3.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const A3=/\b([a-z-]*)\(.*?\)/gu,Dm={...si,getAnimatableNone:e=>{const t=e.match(A3);return t?t.map(_3).join(" "):e}},P3={...Zg,color:Xt,backgroundColor:Xt,outlineColor:Xt,fill:Xt,stroke:Xt,borderColor:Xt,borderTopColor:Xt,borderRightColor:Xt,borderBottomColor:Xt,borderLeftColor:Xt,filter:Dm,WebkitFilter:Dm},px=e=>P3[e];function iC(e,t){let n=px(e);return n!==Dm&&(n=si),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const R3=new Set(["auto","none","0"]);function I3(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!R3.has(a)&&Ll(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=iC(n,s)}const Tb=e=>e===_o||e===_e,Eb=(e,t)=>parseFloat(e.split(", ")[t]),_b=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Eb(s[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?Eb(a[1],e):0}},M3=new Set(["x","y","z"]),D3=Eo.filter(e=>!M3.has(e));function O3(e){const t=[];return D3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:_b(4,13),y:_b(5,14)};co.translateX=co.x;co.translateY=co.y;const Bi=new Set;let Om=!1,Lm=!1;function aC(){if(Lm){const e=Array.from(Bi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=O3(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Lm=!1,Om=!1,Bi.forEach(e=>e.complete()),Bi.clear()}function oC(){Bi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Lm=!0)})}function L3(){oC(),aC()}class gx{constructor(t,n,r,s,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Bi.add(this),Om||(Om=!0,ct.read(oC),ct.resolveKeyframes(aC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=s==null?void 0:s.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),s&&o===void 0&&s.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Bi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Bi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const lC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),F3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function V3(e){const t=F3.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function cC(e,t,n=1){const[r,s]=V3(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return lC(o)?parseFloat(o):o}return Qg(s)?cC(s,t,n+1):s}const uC=e=>t=>t.test(e),$3={test:e=>e==="auto",parse:e=>e},dC=[_o,_e,Rr,Is,PF,AF,$3],Ab=e=>dC.find(uC(e));class fC extends gx{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Qg(u))){const f=cC(u,n.current);f!==void 0&&(t[c]=f),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Bj.has(r)||t.length!==2)return;const[s,a]=t,o=Ab(s),l=Ab(a);if(o!==l)if(Tb(o)&&Tb(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)g3(t[s])&&r.push(s);r.length&&I3(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=co[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const o=s.length-1,l=s[o];s[o]=co[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const Pb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(si.test(e)||e==="0")&&!e.startsWith("url("));function z3(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function U3(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=Pb(s,t),l=Pb(a,t);return!o||!l?!1:z3(e)||(n==="spring"||sx(n))&&r}const B3=e=>e!==null;function Xd(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(B3),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const H3=40;class hC{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ir.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>H3?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&L3(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ir.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:a,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!U3(t,r,s,a))if(o)this.options.duration=0;else{c&&c(Xd(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const f=this.initPlayback(t,n);f!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...f},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const kt=(e,t,n)=>e+(t-e)*n;function Jf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function W3({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Jf(c,l,e+1/3),a=Jf(c,l,e),o=Jf(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Hu(e,t){return n=>n>0?t:e}const eh=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},q3=[Mm,Ai,Ia],G3=e=>q3.find(t=>t.test(e));function Rb(e){const t=G3(e);if(!t)return!1;let n=t.parse(e);return t===Ia&&(n=W3(n)),n}const Ib=(e,t)=>{const n=Rb(e),r=Rb(t);if(!n||!r)return Hu(e,t);const s={...n};return a=>(s.red=eh(n.red,r.red,a),s.green=eh(n.green,r.green,a),s.blue=eh(n.blue,r.blue,a),s.alpha=kt(n.alpha,r.alpha,a),Ai.transform(s))},Y3=(e,t)=>n=>t(e(n)),mc=(...e)=>e.reduce(Y3),Fm=new Set(["none","hidden"]);function K3(e,t){return Fm.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Q3(e,t){return n=>kt(e,t,n)}function xx(e){return typeof e=="number"?Q3:typeof e=="string"?Qg(e)?Hu:Xt.test(e)?Ib:J3:Array.isArray(e)?mC:typeof e=="object"?Xt.test(e)?Ib:Z3:Hu}function mC(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>xx(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function Z3(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=xx(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function X3(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][s[o]],c=(n=e.values[l])!==null&&n!==void 0?n:0;r[a]=c,s[o]++}return r}const J3=(e,t)=>{const n=si.createTransformer(t),r=Ll(e),s=Ll(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Fm.has(e)&&!s.values.length||Fm.has(t)&&!r.values.length?K3(e,t):mc(mC(X3(r,s),s.values),n):Hu(e,t)};function pC(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?kt(e,t,n):xx(e)(e,t)}const eV=5;function gC(e,t,n){const r=Math.max(t-eV,0);return ux(n-e(r),t-r)}const Ct={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},th=.001;function tV({duration:e=Ct.duration,bounce:t=Ct.bounce,velocity:n=Ct.velocity,mass:r=Ct.mass}){let s,a,o=1-t;o=Fr(Ct.minDamping,Ct.maxDamping,o),e=Fr(Ct.minDuration,Ct.maxDuration,us(e)),o<1?(s=u=>{const f=u*o,d=f*e,m=f-n,p=Vm(u,o),g=Math.exp(-d);return th-m/p*g},a=u=>{const d=u*o*e,m=d*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-d),x=Vm(Math.pow(u,2),o);return(-s(u)+th>0?-1:1)*((m-p)*g)/x}):(s=u=>{const f=Math.exp(-u*e),d=(u-n)*e+1;return-th+f*d},a=u=>{const f=Math.exp(-u*e),d=(n-u)*(e*e);return f*d});const l=5/e,c=rV(s,a,l);if(e=cs(e),isNaN(c))return{stiffness:Ct.stiffness,damping:Ct.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const nV=12;function rV(e,t,n){let r=n;for(let s=1;s<nV;s++)r=r-e(r)/t(r);return r}function Vm(e,t){return e*Math.sqrt(1-t*t)}const sV=["duration","bounce"],iV=["stiffness","damping","mass"];function Mb(e,t){return t.some(n=>e[n]!==void 0)}function aV(e){let t={velocity:Ct.velocity,stiffness:Ct.stiffness,damping:Ct.damping,mass:Ct.mass,isResolvedFromDuration:!1,...e};if(!Mb(e,iV)&&Mb(e,sV))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*Fr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ct.mass,stiffness:s,damping:a}}else{const n=tV(e);t={...t,...n,mass:Ct.mass},t.isResolvedFromDuration=!0}return t}function xC(e=Ct.visualDuration,t=Ct.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:f,duration:d,velocity:m,isResolvedFromDuration:p}=aV({...n,velocity:-us(n.velocity||0)}),g=m||0,x=u/(2*Math.sqrt(c*f)),y=o-a,v=us(Math.sqrt(c/f)),b=Math.abs(y)<5;r||(r=b?Ct.restSpeed.granular:Ct.restSpeed.default),s||(s=b?Ct.restDelta.granular:Ct.restDelta.default);let w;if(x<1){const S=Vm(v,x);w=C=>{const I=Math.exp(-x*v*C);return o-I*((g+x*v*y)/S*Math.sin(S*C)+y*Math.cos(S*C))}}else if(x===1)w=S=>o-Math.exp(-v*S)*(y+(g+v*y)*S);else{const S=v*Math.sqrt(x*x-1);w=C=>{const I=Math.exp(-x*v*C),E=Math.min(S*C,300);return o-I*((g+x*v*y)*Math.sinh(E)+S*y*Math.cosh(E))/S}}const j={calculatedDuration:p&&d||null,next:S=>{const C=w(S);if(p)l.done=S>=d;else{let I=0;x<1&&(I=S===0?cs(g):gC(w,S,C));const E=Math.abs(I)<=r,N=Math.abs(o-C)<=s;l.done=E&&N}return l.value=l.done?o:C,l},toString:()=>{const S=Math.min(Dj(j),Pm),C=Oj(I=>j.next(S*I).value,S,30);return S+"ms "+C}};return j}function Db({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:f}){const d=e[0],m={done:!1,value:d},p=E=>l!==void 0&&E<l||c!==void 0&&E>c,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)<Math.abs(c-E)?l:c;let x=n*t;const y=d+x,v=o===void 0?y:o(y);v!==y&&(x=v-d);const b=E=>-x*Math.exp(-E/r),w=E=>v+b(E),j=E=>{const N=b(E),k=w(E);m.done=Math.abs(N)<=u,m.value=m.done?v:k};let S,C;const I=E=>{p(m.value)&&(S=E,C=xC({keyframes:[m.value,g(m.value)],velocity:gC(w,E,m.value),damping:s,stiffness:a,restDelta:u,restSpeed:f}))};return I(0),{calculatedDuration:null,next:E=>{let N=!1;return!C&&S===void 0&&(N=!0,j(E),I(E)),S!==void 0&&E>=S?C.next(E-S):(!N&&j(E),m)}}}const oV=hc(.42,0,1,1),lV=hc(0,0,.58,1),yC=hc(.42,0,.58,1),cV=e=>Array.isArray(e)&&typeof e[0]!="number",uV={linear:mn,easeIn:oV,easeInOut:yC,easeOut:lV,circIn:fx,circInOut:Xj,circOut:Zj,backIn:dx,backInOut:Kj,backOut:Yj,anticipate:Qj},Ob=e=>{if(ix(e)){mj(e.length===4);const[t,n,r,s]=e;return hc(t,n,r,s)}else if(typeof e=="string")return uV[e];return e};function dV(e,t,n){const r=[],s=n||pC,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||mn:t;l=mc(c,l)}r.push(l)}return r}function vC(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(mj(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=dV(t,r,s),c=l.length,u=f=>{if(o&&f<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(f<e[d+1]);d++);const m=Ki(e[d],e[d+1],f);return l[d](m)};return n?f=>u(Fr(e[0],e[a-1],f)):u}function fV(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Ki(0,t,r);e.push(kt(n,1,s))}}function bC(e){const t=[0];return fV(t,e.length-1),t}function hV(e,t){return e.map(n=>n*t)}function mV(e,t){return e.map(()=>t||yC).splice(0,e.length-1)}function Wu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=cV(r)?r.map(Ob):Ob(r),a={done:!1,value:t[0]},o=hV(n&&n.length===t.length?n:bC(t),e),l=vC(o,t,{ease:Array.isArray(s)?s:mV(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const pV=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ct.update(t,!0),stop:()=>Lr(t),now:()=>Bt.isProcessing?Bt.timestamp:Ir.now()}},gV={decay:Db,inertia:Db,tween:Wu,keyframes:Wu,spring:xC},xV=e=>e/100;class yx extends hC{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:s,keyframes:a}=this.options,o=(s==null?void 0:s.KeyframeResolver)||gx,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(a,l,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=this.options,l=sx(n)?n:gV[n]||Wu;let c,u;l!==Wu&&typeof t[0]!="number"&&(c=mc(xV,pC(t[0],t[1])),t=[0,100]);const f=l({...this.options,keyframes:t});a==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),f.calculatedDuration===null&&(f.calculatedDuration=Dj(f));const{calculatedDuration:d}=f,m=d+s,p=m*(r+1)-s;return{generator:f,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:d,resolvedDuration:m,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:s,generator:a,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:f,resolvedDuration:d}=r;if(this.startTime===null)return a.next(0);const{delay:m,repeat:p,repeatType:g,repeatDelay:x,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-f/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-m*(this.speed>=0?1:-1),b=this.speed>=0?v<0:v>f;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let w=this.currentTime,j=a;if(p){const E=Math.min(this.currentTime,f)/d;let N=Math.floor(E),k=E%1;!k&&E>=1&&(k=1),k===1&&N--,N=Math.min(N,p+1),!!(N%2)&&(g==="reverse"?(k=1-k,x&&(k-=x/d)):g==="mirror"&&(j=o)),w=Fr(0,1,k)*d}const S=b?{done:!1,value:c[0]}:j.next(w);l&&(S.value=l(S.value));let{done:C}=S;!b&&u!==null&&(C=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return I&&s!==void 0&&(S.value=Xd(c,this.options,s)),y&&y(S.value),I&&this.finish(),S}get duration(){const{resolved:t}=this;return t?us(t.calculatedDuration):0}get time(){return us(this.currentTime)}set time(t){t=cs(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=us(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=pV,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const yV=new Set(["opacity","clipPath","filter","transform"]);function vV(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const f=Fj(l,s);return Array.isArray(f)&&(u.easing=f),e.animate(u,{delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const bV=Bg(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qu=10,wV=2e4;function kV(e){return sx(e.type)||e.type==="spring"||!Lj(e.ease)}function SV(e,t){const n=new yx({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let a=0;for(;!r.done&&a<wV;)r=n.sample(a),s.push(r.value),a+=qu;return{times:void 0,keyframes:s,duration:a-qu,ease:"linear"}}const wC={anticipate:Qj,backInOut:Kj,circInOut:Xj};function NV(e){return e in wC}class Lb extends hC{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:a}=this.options;this.resolver=new fC(a,(o,l)=>this.onKeyframesResolved(o,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:a,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof a=="string"&&Bu()&&NV(a)&&(a=wC[a]),kV(this.options)){const{onComplete:d,onUpdate:m,motionValue:p,element:g,...x}=this.options,y=SV(t,x);t=y.keyframes,t.length===1&&(t[1]=t[0]),r=y.duration,s=y.times,a=y.ease,o="keyframes"}const f=vV(l.owner.current,c,t,{...this.options,duration:r,times:s,ease:a});return f.startTime=u??this.calcStartTime(),this.pendingTimeline?(bb(f,this.pendingTimeline),this.pendingTimeline=void 0):f.onfinish=()=>{const{onComplete:d}=this.options;l.set(Xd(t,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:f,duration:r,times:s,type:o,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return us(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return us(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=cs(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return mn;const{animation:r}=n;bb(r,t)}return mn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:a,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:f,onComplete:d,element:m,...p}=this.options,g=new yx({...p,keyframes:r,duration:s,type:a,ease:o,times:l,isGenerator:!0}),x=cs(this.time);u.setWithVelocity(g.sample(x-qu).value,g.sample(x).value,qu)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:a,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return bV()&&r&&yV.has(r)&&!c&&!u&&!s&&a!=="mirror"&&o!==0&&l!=="inertia"}}const jV={type:"spring",stiffness:500,damping:25,restSpeed:10},CV=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),TV={type:"keyframes",duration:.8},EV={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_V=(e,{keyframes:t})=>t.length>2?TV:fa.has(e)?e.startsWith("scale")?CV(t[1]):jV:EV;function AV({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...f}){return!!Object.keys(f).length}const vx=(e,t,n,r={},s,a)=>o=>{const l=rx(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-cs(c);let f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};AV(l)||(f={...f,..._V(e,f)}),f.duration&&(f.duration=cs(f.duration)),f.repeatDelay&&(f.repeatDelay=cs(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let d=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(f.duration=0,f.delay===0&&(d=!0)),d&&!a&&t.get()!==void 0){const m=Xd(f.keyframes,l);if(m!==void 0)return ct.update(()=>{f.onUpdate(m),f.onComplete()}),new XF([])}return!a&&Lb.supports(f)?new Lb(f):new yx(f)};function PV({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function kC(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;r&&(o=r);const u=[],f=s&&e.animationState&&e.animationState.getState()[s];for(const d in c){const m=e.getValue(d,(a=e.latestValues[d])!==null&&a!==void 0?a:null),p=c[d];if(p===void 0||f&&PV(f,d))continue;const g={delay:n,...rx(o||{},d)};let x=!1;if(window.MotionHandoffAnimation){const v=Hj(e);if(v){const b=window.MotionHandoffAnimation(v,d,ct);b!==null&&(g.startTime=b,x=!0)}}Im(e,d),m.start(vx(d,m,p,e.shouldReduceMotion&&Bj.has(d)?{type:!1}:g,e,x));const y=m.animation;y&&u.push(y)}return l&&Promise.all(u).then(()=>{ct.update(()=>{l&&d3(e,l)})}),u}function $m(e,t,n={}){var r;const s=Zd(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(a=n.transitionOverride);const o=s?()=>Promise.all(kC(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:f=0,staggerChildren:d,staggerDirection:m}=a;return RV(e,t,f+u,d,m,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[u,f]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>f())}else return Promise.all([o(),l(n.delay)])}function RV(e,t,n=0,r=0,s=1,a){const o=[],l=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(IV).forEach((u,f)=>{u.notify("AnimationStart",t),o.push($m(u,t,{...a,delay:n+c(f)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function IV(e,t){return e.sortNodePosition(t)}function MV(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>$m(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=$m(e,t,n);else{const s=typeof t=="function"?Zd(e,t,n.custom):t;r=Promise.all(kC(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const DV=Wg.length;function SC(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?SC(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<DV;n++){const r=Wg[n],s=e.props[r];(Dl(s)||s===!1)&&(t[r]=s)}return t}const OV=[...Hg].reverse(),LV=Hg.length;function FV(e){return t=>Promise.all(t.map(({animation:n,options:r})=>MV(e,n,r)))}function VV(e){let t=FV(e),n=Fb(),r=!0;const s=c=>(u,f)=>{var d;const m=Zd(e,f,c==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(m){const{transition:p,transitionEnd:g,...x}=m;u={...u,...x,...g}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,f=SC(e.parent)||{},d=[],m=new Set;let p={},g=1/0;for(let y=0;y<LV;y++){const v=OV[y],b=n[v],w=u[v]!==void 0?u[v]:f[v],j=Dl(w),S=v===c?b.isActive:null;S===!1&&(g=y);let C=w===f[v]&&w!==u[v]&&j;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),b.protectedKeys={...p},!b.isActive&&S===null||!w&&!b.prevProp||Kd(w)||typeof w=="boolean")continue;const I=$V(b.prevProp,w);let E=I||v===c&&b.isActive&&!C&&j||y>g&&j,N=!1;const k=Array.isArray(w)?w:[w];let A=k.reduce(s(v),{});S===!1&&(A={});const{prevResolvedValues:M={}}=b,L={...M,...A},F=P=>{E=!0,m.has(P)&&(N=!0,m.delete(P)),b.needsAnimating[P]=!0;const T=e.getValue(P);T&&(T.liveStyle=!1)};for(const P in L){const T=A[P],D=M[P];if(p.hasOwnProperty(P))continue;let _=!1;Am(T)&&Am(D)?_=!Ij(T,D):_=T!==D,_?T!=null?F(P):m.add(P):T!==void 0&&m.has(P)?F(P):b.protectedKeys[P]=!0}b.prevProp=w,b.prevResolvedValues=A,b.isActive&&(p={...p,...A}),r&&e.blockInitialAnimation&&(E=!1),E&&(!(C&&I)||N)&&d.push(...k.map(P=>({animation:P,options:{type:v}})))}if(m.size){const y={};m.forEach(v=>{const b=e.getBaseTarget(v),w=e.getValue(v);w&&(w.liveStyle=!0),y[v]=b??null}),d.push({animation:y})}let x=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(d):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(m=>{var p;return(p=m.animationState)===null||p===void 0?void 0:p.setActive(c,u)}),n[c].isActive=u;const d=o(c);for(const m in n)n[m].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Fb(),r=!0}}}function $V(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ij(t,e):!1}function bi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Fb(){return{animate:bi(!0),whileInView:bi(),whileHover:bi(),whileTap:bi(),whileDrag:bi(),whileFocus:bi(),exit:bi()}}class hi{constructor(t){this.isMounted=!1,this.node=t}update(){}}class zV extends hi{constructor(t){super(t),t.animationState||(t.animationState=VV(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Kd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let UV=0;class BV extends hi{constructor(){super(...arguments),this.id=UV++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const HV={animation:{Feature:zV},exit:{Feature:BV}};function Fl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function pc(e){return{point:{x:e.pageX,y:e.pageY}}}const WV=e=>t=>ax(t)&&e(t,pc(t));function hl(e,t,n,r){return Fl(e,t,WV(n),r)}const Vb=(e,t)=>Math.abs(e-t);function qV(e,t){const n=Vb(e.x,t.x),r=Vb(e.y,t.y);return Math.sqrt(n**2+r**2)}class NC{constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=rh(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,p=qV(d.offset,{x:0,y:0})>=3;if(!m&&!p)return;const{point:g}=d,{timestamp:x}=Bt;this.history.push({...g,timestamp:x});const{onStart:y,onMove:v}=this.handlers;m||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=nh(m,this.transformPagePoint),ct.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=rh(d.type==="pointercancel"?this.lastMoveEventInfo:nh(m,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,y),g&&g(d,y)},!ax(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=pc(t),l=nh(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Bt;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,rh(l,this.history)),this.removeListeners=mc(hl(this.contextWindow,"pointermove",this.handlePointerMove),hl(this.contextWindow,"pointerup",this.handlePointerUp),hl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lr(this.updatePoint)}}function nh(e,t){return t?{point:t(e.point)}:e}function $b(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rh({point:e},t){return{point:e,delta:$b(e,jC(t)),offset:$b(e,GV(t)),velocity:YV(t,.1)}}function GV(e){return e[0]}function jC(e){return e[e.length-1]}function YV(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=jC(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>cs(t)));)n--;if(!r)return{x:0,y:0};const a=us(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const CC=1e-4,KV=1-CC,QV=1+CC,TC=.01,ZV=0-TC,XV=0+TC;function Hn(e){return e.max-e.min}function JV(e,t,n){return Math.abs(e-t)<=n}function zb(e,t,n,r=.5){e.origin=r,e.originPoint=kt(t.min,t.max,e.origin),e.scale=Hn(n)/Hn(t),e.translate=kt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=KV&&e.scale<=QV||isNaN(e.scale))&&(e.scale=1),(e.translate>=ZV&&e.translate<=XV||isNaN(e.translate))&&(e.translate=0)}function ml(e,t,n,r){zb(e.x,t.x,n.x,r?r.originX:void 0),zb(e.y,t.y,n.y,r?r.originY:void 0)}function Ub(e,t,n){e.min=n.min+t.min,e.max=e.min+Hn(t)}function e6(e,t,n){Ub(e.x,t.x,n.x),Ub(e.y,t.y,n.y)}function Bb(e,t,n){e.min=t.min-n.min,e.max=e.min+Hn(t)}function pl(e,t,n){Bb(e.x,t.x,n.x),Bb(e.y,t.y,n.y)}function t6(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?kt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?kt(n,e,r.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function n6(e,{top:t,left:n,bottom:r,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,r)}}function Wb(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function r6(e,t){return{x:Wb(e.x,t.x),y:Wb(e.y,t.y)}}function s6(e,t){let n=.5;const r=Hn(e),s=Hn(t);return s>r?n=Ki(t.min,t.max-r,e.min):r>s&&(n=Ki(e.min,e.max-s,t.min)),Fr(0,1,n)}function i6(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const zm=.35;function a6(e=zm){return e===!1?e=0:e===!0&&(e=zm),{x:qb(e,"left","right"),y:qb(e,"top","bottom")}}function qb(e,t,n){return{min:Gb(e,t),max:Gb(e,n)}}function Gb(e,t){return typeof e=="number"?e:e[t]||0}const Yb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ma=()=>({x:Yb(),y:Yb()}),Kb=()=>({min:0,max:0}),Pt=()=>({x:Kb(),y:Kb()});function Gn(e){return[e("x"),e("y")]}function EC({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function o6({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function l6(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function sh(e){return e===void 0||e===1}function Um({scale:e,scaleX:t,scaleY:n}){return!sh(e)||!sh(t)||!sh(n)}function ki(e){return Um(e)||_C(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _C(e){return Qb(e.x)||Qb(e.y)}function Qb(e){return e&&e!=="0%"}function Gu(e,t,n){const r=e-n,s=t*r;return n+s}function Zb(e,t,n,r,s){return s!==void 0&&(e=Gu(e,s,r)),Gu(e,n,r)+t}function Bm(e,t=0,n=1,r,s){e.min=Zb(e.min,t,n,r,s),e.max=Zb(e.max,t,n,r,s)}function AC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}const Xb=.999999999999,Jb=1.0000000000001;function c6(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Oa(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,AC(e,o)),r&&ki(a.latestValues)&&Oa(e,a.latestValues))}t.x<Jb&&t.x>Xb&&(t.x=1),t.y<Jb&&t.y>Xb&&(t.y=1)}function Da(e,t){e.min=e.min+t,e.max=e.max+t}function e0(e,t,n,r,s=.5){const a=kt(e.min,e.max,s);Bm(e,t,n,a,r)}function Oa(e,t){e0(e.x,t.x,t.scaleX,t.scale,t.originX),e0(e.y,t.y,t.scaleY,t.scale,t.originY)}function PC(e,t){return EC(l6(e.getBoundingClientRect(),t))}function u6(e,t,n){const r=PC(e,n),{scroll:s}=t;return s&&(Da(r.x,s.offset.x),Da(r.y,s.offset.y)),r}const RC=({current:e})=>e?e.ownerDocument.defaultView:null,d6=new WeakMap;class f6{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Pt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(pc(f).point)},a=(f,d)=>{const{drag:m,dragPropagation:p,onDragStart:g}=this.getProps();if(m&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=a3(m),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gn(y=>{let v=this.getAxisMotionValue(y).get()||0;if(Rr.test(v)){const{projection:b}=this.visualElement;if(b&&b.layout){const w=b.layout.layoutBox[y];w&&(v=Hn(w)*(parseFloat(v)/100))}}this.originPoint[y]=v}),g&&ct.postRender(()=>g(f,d)),Im(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(f,d)=>{const{dragPropagation:m,dragDirectionLock:p,onDirectionLock:g,onDrag:x}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:y}=d;if(p&&this.currentDirection===null){this.currentDirection=h6(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),x&&x(f,d)},l=(f,d)=>this.stop(f,d),c=()=>Gn(f=>{var d;return this.getAnimationState(f)==="paused"&&((d=this.getAxisMotionValue(f).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new NC(t,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:RC(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&ct.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Gc(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=t6(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&Ra(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=n6(s.layoutBox,n):this.constraints=!1,this.elastic=a6(r),a!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Gn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=i6(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ra(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=u6(r,s.root,this.visualElement.getTransformPagePoint());let o=r6(s.layout.layoutBox,a);if(n){const l=n(o6(o));this.hasMutatedConstraints=!!l,l&&(o=EC(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Gn(f=>{if(!Gc(f,n,this.currentDirection))return;let d=c&&c[f]||{};o&&(d={min:0,max:0});const m=s?200:1e6,p=s?40:1e7,g={type:"inertia",velocity:r?t[f]:0,bounceStiffness:m,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(f,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Im(this.visualElement,t),r.start(vx(t,r,0,n,this.visualElement,!1))}stopAnimation(){Gn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Gn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Gn(n=>{const{drag:r}=this.getProps();if(!Gc(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];a.set(t[n]-kt(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ra(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Gn(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=s6({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Gn(o=>{if(!Gc(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(kt(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;d6.set(this.visualElement,this);const t=this.visualElement.current,n=hl(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Ra(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ct.read(r);const o=Fl(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Gn(f=>{const d=this.getAxisMotionValue(f);d&&(this.originPoint[f]+=c[f].translate,d.set(d.get()+c[f].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=zm,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function Gc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function h6(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class m6 extends hi{constructor(t){super(t),this.removeGroupControls=mn,this.removeListeners=mn,this.controls=new f6(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mn}unmount(){this.removeGroupControls(),this.removeListeners()}}const t0=e=>(t,n)=>{e&&ct.postRender(()=>e(t,n))};class p6 extends hi{constructor(){super(...arguments),this.removePointerDownListener=mn}onPointerDown(t){this.session=new NC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:RC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:t0(t),onStart:t0(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&ct.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=hl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const mu={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function n0(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=n0(e,t.target.x),r=n0(e,t.target.y);return`${n}% ${r}%`}},g6={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=si.parse(e);if(s.length>5)return r;const a=si.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=kt(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};class x6 extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;zF(y6),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),mu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,o=r.projection;return o&&(o.isPresent=a,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||ct.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Gg.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function IC(e){const[t,n]=fj(),r=h.useContext(Vg);return i.jsx(x6,{...e,layoutGroup:r,switchLayoutGroup:h.useContext(bj),isPresent:t,safeToRemove:n})}const y6={borderRadius:{...Vo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vo,borderTopRightRadius:Vo,borderBottomLeftRadius:Vo,borderBottomRightRadius:Vo,boxShadow:g6};function v6(e,t,n){const r=tn(e)?e:as(e);return r.start(vx("",r,t,n)),r.animation}function b6(e){return e instanceof SVGElement&&e.tagName!=="svg"}const w6=(e,t)=>e.depth-t.depth;class k6{constructor(){this.children=[],this.isDirty=!1}add(t){ox(this.children,t),this.isDirty=!0}remove(t){lx(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(w6),this.isDirty=!1,this.children.forEach(t)}}function S6(e,t){const n=Ir.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Lr(r),e(a-t))};return ct.read(r,!0),()=>Lr(r)}const MC=["TopLeft","TopRight","BottomLeft","BottomRight"],N6=MC.length,r0=e=>typeof e=="string"?parseFloat(e):e,s0=e=>typeof e=="number"||_e.test(e);function j6(e,t,n,r,s,a){s?(e.opacity=kt(0,n.opacity!==void 0?n.opacity:1,C6(r)),e.opacityExit=kt(t.opacity!==void 0?t.opacity:1,0,T6(r))):a&&(e.opacity=kt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<N6;o++){const l=`border${MC[o]}Radius`;let c=i0(t,l),u=i0(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||s0(c)===s0(u)?(e[l]=Math.max(kt(r0(c),r0(u),r),0),(Rr.test(u)||Rr.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=kt(t.rotate||0,n.rotate||0,r))}function i0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const C6=DC(0,.5,Zj),T6=DC(.5,.95,mn);function DC(e,t,n){return r=>r<e?0:r>t?1:n(Ki(e,t,r))}function a0(e,t){e.min=t.min,e.max=t.max}function qn(e,t){a0(e.x,t.x),a0(e.y,t.y)}function o0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function l0(e,t,n,r,s){return e-=t,e=Gu(e,1/n,r),s!==void 0&&(e=Gu(e,1/s,r)),e}function E6(e,t=0,n=1,r=.5,s,a=e,o=e){if(Rr.test(t)&&(t=parseFloat(t),t=kt(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=kt(a.min,a.max,r);e===a&&(l-=t),e.min=l0(e.min,t,n,l,s),e.max=l0(e.max,t,n,l,s)}function c0(e,t,[n,r,s],a,o){E6(e,t[n],t[r],t[s],t.scale,a,o)}const _6=["x","scaleX","originX"],A6=["y","scaleY","originY"];function u0(e,t,n,r){c0(e.x,t,_6,n?n.x:void 0,r?r.x:void 0),c0(e.y,t,A6,n?n.y:void 0,r?r.y:void 0)}function d0(e){return e.translate===0&&e.scale===1}function OC(e){return d0(e.x)&&d0(e.y)}function f0(e,t){return e.min===t.min&&e.max===t.max}function P6(e,t){return f0(e.x,t.x)&&f0(e.y,t.y)}function h0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function LC(e,t){return h0(e.x,t.x)&&h0(e.y,t.y)}function m0(e){return Hn(e.x)/Hn(e.y)}function p0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class R6{constructor(){this.members=[]}add(t){ox(this.members,t),t.scheduleRender()}remove(t){if(lx(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function I6(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:f,rotateX:d,rotateY:m,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),f&&(r+=`rotate(${f}deg) `),d&&(r+=`rotateX(${d}deg) `),m&&(r+=`rotateY(${m}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Si={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},il=typeof window<"u"&&window.MotionDebug!==void 0,ih=["","X","Y","Z"],M6={visibility:"hidden"},g0=1e3;let D6=0;function ah(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function FC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Hj(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ct,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&FC(r)}function VC({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=D6++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,il&&(Si.totalNodes=Si.resolvedTargetDeltas=Si.recalculatedProjection=0),this.nodes.forEach(F6),this.nodes.forEach(B6),this.nodes.forEach(H6),this.nodes.forEach(V6),il&&window.MotionDebug.record(Si)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new k6)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new cx),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=b6(o),this.instance=o;const{layoutId:c,layout:u,visualElement:f}=this.options;if(f&&!f.current&&f.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let d;const m=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=S6(m,250),mu.hasAnimatedSinceResize&&(mu.hasAnimatedSinceResize=!1,this.nodes.forEach(y0))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:m,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||K6,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=f.getProps(),b=!this.targetLayout||!LC(this.targetLayout,g)||p,w=!m&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||m&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,w);const j={...rx(x,"layout"),onPlay:y,onComplete:v};(f.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else m||y0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Lr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(W6),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&FC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const d=this.path[f];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(x0);return}this.isUpdating||this.nodes.forEach(z6),this.isUpdating=!1,this.nodes.forEach(U6),this.nodes.forEach(O6),this.nodes.forEach(L6),this.clearAllSnapshots();const l=Ir.now();Bt.delta=Fr(0,1e3/60,l-Bt.timestamp),Bt.timestamp=l,Bt.isProcessing=!0,Qf.update.process(Bt),Qf.preRender.process(Bt),Qf.render.process(Bt),Bt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Gg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($6),this.sharedNodes.forEach(q6)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Pt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!OC(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,f=u!==this.prevTransformTemplateValue;o&&(l||ki(this.latestValues)||f)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),Q6(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return Pt();const c=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Z6))){const{scroll:f}=this.root;f&&(Da(c.x,f.offset.x),Da(c.y,f.offset.y))}return c}removeElementScroll(o){var l;const c=Pt();if(qn(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let u=0;u<this.path.length;u++){const f=this.path[u],{scroll:d,options:m}=f;f!==this.root&&d&&m.layoutScroll&&(d.wasRoot&&qn(c,o),Da(c.x,d.offset.x),Da(c.y,d.offset.y))}return c}applyTransform(o,l=!1){const c=Pt();qn(c,o);for(let u=0;u<this.path.length;u++){const f=this.path[u];!l&&f.options.layoutScroll&&f.scroll&&f!==f.root&&Oa(c,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),ki(f.latestValues)&&Oa(c,f.latestValues)}return ki(this.latestValues)&&Oa(c,this.latestValues),c}removeTransform(o){const l=Pt();qn(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!ki(u.latestValues))continue;Um(u.latestValues)&&u.updateSnapshot();const f=Pt(),d=u.measurePageBox();qn(f,d),u0(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,f)}return ki(this.latestValues)&&u0(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Bt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:m}=this.options;if(!(!this.layout||!(d||m))){if(this.resolvedRelativeTargetAt=Bt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pt(),this.relativeTargetOrigin=Pt(),pl(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),qn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Pt(),this.targetWithTransforms=Pt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),e6(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qn(this.target,this.layout.layoutBox),AC(this.target,this.targetDelta)):qn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pt(),this.relativeTargetOrigin=Pt(),pl(this.relativeTargetOrigin,this.target,p.target),qn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}il&&Si.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Um(this.parent.latestValues)||_C(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Bt.timestamp&&(u=!1),u)return;const{layout:f,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||d))return;qn(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,p=this.treeScale.y;c6(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Pt());const{target:g}=l;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(o0(this.prevProjectionDelta.x,this.projectionDelta.x),o0(this.prevProjectionDelta.y,this.projectionDelta.y)),ml(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==p||!p0(this.projectionDelta.x,this.prevProjectionDelta.x)||!p0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),il&&Si.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ma(),this.projectionDelta=Ma(),this.projectionDeltaWithTransform=Ma()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},f={...this.latestValues},d=Ma();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=Pt(),p=c?c.source:void 0,g=this.layout?this.layout.source:void 0,x=p!==g,y=this.getStack(),v=!y||y.members.length<=1,b=!!(x&&!v&&this.options.crossfade===!0&&!this.path.some(Y6));this.animationProgress=0;let w;this.mixTargetDelta=j=>{const S=j/1e3;v0(d.x,o.x,S),v0(d.y,o.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pl(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),G6(this.relativeTarget,this.relativeTargetOrigin,m,S),w&&P6(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Pt()),qn(w,this.relativeTarget)),x&&(this.animationValues=f,j6(f,u,this.latestValues,S,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Lr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ct.update(()=>{mu.hasAnimatedSinceResize=!0,this.currentAnimation=v6(0,g0,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(g0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:f}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&$C(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Pt();const d=Hn(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+d;const m=Hn(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}qn(l,c),Oa(l,f),ml(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new R6),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&ah("z",o,u,this.animationValues);for(let f=0;f<ih.length;f++)ah(`rotate${ih[f]}`,o,u,this.animationValues),ah(`skew${ih[f]}`,o,u,this.animationValues);o.render();for(const f in u)o.setStaticValue(f,u[f]),this.animationValues&&(this.animationValues[f]=u[f]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return M6;const u={visibility:""},f=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=fu(o==null?void 0:o.pointerEvents)||"",u.transform=f?f(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const x={};return this.options.layoutId&&(x.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,x.pointerEvents=fu(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ki(this.latestValues)&&(x.transform=f?f({},""):"none",this.hasProjected=!1),x}const m=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=I6(this.projectionDeltaWithTransform,this.treeScale,m),f&&(u.transform=f(m,u.transform));const{x:p,y:g}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,d.animationValues?u.opacity=d===this?(c=(l=m.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:u.opacity=d===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const x in Uu){if(m[x]===void 0)continue;const{correct:y,applyTo:v}=Uu[x],b=u.transform==="none"?m[x]:y(m[x],d);if(v){const w=v.length;for(let j=0;j<w;j++)u[v[j]]=b}else u[x]=b}return this.options.layoutId&&(u.pointerEvents=d===this?fu(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(x0),this.root.sharedNodes.clear()}}}function O6(e){e.updateLayout()}function L6(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?Gn(d=>{const m=o?n.measuredBox[d]:n.layoutBox[d],p=Hn(m);m.min=r[d].min,m.max=m.min+p}):$C(a,n.layoutBox,r)&&Gn(d=>{const m=o?n.measuredBox[d]:n.layoutBox[d],p=Hn(r[d]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const l=Ma();ml(l,r,n.layoutBox);const c=Ma();o?ml(c,e.applyTransform(s,!0),n.measuredBox):ml(c,r,n.layoutBox);const u=!OC(l);let f=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:m,layout:p}=d;if(m&&p){const g=Pt();pl(g,n.layoutBox,m.layoutBox);const x=Pt();pl(x,r,p.layoutBox),LC(g,x)||(f=!0),d.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:f})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function F6(e){il&&Si.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function V6(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $6(e){e.clearSnapshot()}function x0(e){e.clearMeasurements()}function z6(e){e.isLayoutDirty=!1}function U6(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function y0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function B6(e){e.resolveTargetDelta()}function H6(e){e.calcProjection()}function W6(e){e.resetSkewAndRotation()}function q6(e){e.removeLeadSnapshot()}function v0(e,t,n){e.translate=kt(t.translate,0,n),e.scale=kt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function b0(e,t,n,r){e.min=kt(t.min,n.min,r),e.max=kt(t.max,n.max,r)}function G6(e,t,n,r){b0(e.x,t.x,n.x,r),b0(e.y,t.y,n.y,r)}function Y6(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const K6={duration:.45,ease:[.4,0,.1,1]},w0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),k0=w0("applewebkit/")&&!w0("chrome/")?Math.round:mn;function S0(e){e.min=k0(e.min),e.max=k0(e.max)}function Q6(e){S0(e.x),S0(e.y)}function $C(e,t,n){return e==="position"||e==="preserve-aspect"&&!JV(m0(t),m0(n),.2)}function Z6(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const X6=VC({attachResizeListener:(e,t)=>Fl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),oh={current:void 0},zC=VC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!oh.current){const e=new X6({});e.mount(window),e.setOptions({layoutScroll:!0}),oh.current=e}return oh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),J6={pan:{Feature:p6},drag:{Feature:m6,ProjectionNode:zC,MeasureLayout:IC}};function N0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&ct.postRender(()=>a(t,pc(t)))}class e$ extends hi{mount(){const{current:t}=this.node;t&&(this.unmount=t3(t,n=>(N0(this.node,n,"Start"),r=>N0(this.node,r,"End"))))}unmount(){}}class t$ extends hi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=mc(Fl(this.node.current,"focus",()=>this.onFocus()),Fl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function j0(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&ct.postRender(()=>a(t,pc(t)))}class n$ extends hi{mount(){const{current:t}=this.node;t&&(this.unmount=i3(t,n=>(j0(this.node,n,"Start"),(r,{success:s})=>j0(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Hm=new WeakMap,lh=new WeakMap,r$=e=>{const t=Hm.get(e.target);t&&t(e)},s$=e=>{e.forEach(r$)};function i$({root:e,...t}){const n=e||document;lh.has(n)||lh.set(n,{});const r=lh.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(s$,{root:e,...t})),r[s]}function a$(e,t,n){const r=i$(t);return Hm.set(e,n),r.observe(e),()=>{Hm.delete(e),r.unobserve(e)}}const o$={some:0,all:1};class l$ extends hi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:o$[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:d}=this.node.getProps(),m=u?f:d;m&&m(c)};return a$(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(c$(t,n))&&this.startObserver()}unmount(){}}function c$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const u$={inView:{Feature:l$},tap:{Feature:n$},focus:{Feature:t$},hover:{Feature:e$}},d$={layout:{ProjectionNode:zC,MeasureLayout:IC}},Wm={current:null},UC={current:!1};function f$(){if(UC.current=!0,!!zg)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Wm.current=e.matches;e.addListener(t),t()}else Wm.current=!1}const h$=[...dC,Xt,si],m$=e=>h$.find(uC(e)),C0=new WeakMap;function p$(e,t,n){for(const r in t){const s=t[r],a=n[r];if(tn(s))e.addValue(r,s);else if(tn(a))e.addValue(r,as(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,as(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const T0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class g${scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=gx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ir.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ct.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:f}=o;this.onUpdate=f,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=Qd(n),this.isVariantNode=yj(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in m){const g=m[p];c[p]!==void 0&&tn(g)&&g.set(c[p],!1)}}mount(t){this.current=t,C0.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),UC.current||f$(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Wm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){C0.delete(this.current),this.projection&&this.projection.unmount(),Lr(this.notifyUpdate),Lr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=fa.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ct.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in lo){const n=lo[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Pt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<T0.length;r++){const s=T0[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=p$(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=as(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(lC(s)||Jj(s))?s=parseFloat(s):!m$(s)&&si.test(n)&&(s=iC(t,n)),this.setBaseTarget(t,tn(s)?s.get():s)),tn(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Kg(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!tn(a)?a:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new cx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class BC extends g${constructor(){super(...arguments),this.KeyframeResolver=fC}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;tn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function x$(e){return window.getComputedStyle(e)}class y$ extends BC{constructor(){super(...arguments),this.type="html",this.renderInstance=Tj}readValueFromInstance(t,n){if(fa.has(n)){const r=px(n);return r&&r.default||0}else{const r=x$(t),s=(Nj(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return PC(t,n)}build(t,n,r){Xg(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return nx(t,n,r)}}class v$ extends BC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(fa.has(n)){const r=px(n);return r&&r.default||0}return n=Ej.has(n)?n:qg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Pj(t,n,r)}build(t,n,r){Jg(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){_j(t,n,r,s)}mount(t){this.isSVGTag=tx(t.tagName),super.mount(t)}}
503const b$=(e,t)=>Yg(e)?new v$(t):new y$(t,{allowProjection:e!==h.Fragment}),w$=QF({...HV,...u$,...J6,...d$},b$),qt=dF(w$);function k$(e,t,n){h.useInsertionEffect(()=>e.on(t,n),[e,t,n])}function HC(e,t){let n;const r=()=>{const{currentTime:s}=t,o=(s===null?0:s.value)/100;n!==o&&e(o),n=o};return ct.update(r,!0),()=>Lr(r)}const pu=new WeakMap;let Ms;function S$(e,t){if(t){const{inlineSize:n,blockSize:r}=t[0];return{width:n,height:r}}else return e instanceof SVGElement&&"getBBox"in e?e.getBBox():{width:e.offsetWidth,height:e.offsetHeight}}function N$({target:e,contentRect:t,borderBoxSize:n}){var r;(r=pu.get(e))===null||r===void 0||r.forEach(s=>{s({target:e,contentSize:t,get size(){return S$(e,n)}})})}function j$(e){e.forEach(N$)}function C$(){typeof ResizeObserver>"u"||(Ms=new ResizeObserver(j$))}function T$(e,t){Ms||C$();const n=$j(e);return n.forEach(r=>{let s=pu.get(r);s||(s=new Set,pu.set(r,s)),s.add(t),Ms==null||Ms.observe(r)}),()=>{n.forEach(r=>{const s=pu.get(r);s==null||s.delete(t),s!=null&&s.size||Ms==null||Ms.unobserve(r)})}}const gu=new Set;let gl;function E$(){gl=()=>{const e={width:window.innerWidth,height:window.innerHeight},t={target:window,size:e,contentSize:e};gu.forEach(n=>n(t))},window.addEventListener("resize",gl)}function _$(e){return gu.add(e),gl||E$(),()=>{gu.delete(e),!gu.size&&gl&&(gl=void 0)}}function A$(e,t){return typeof e=="function"?_$(e):T$(e,t)}const P$=50,E0=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),R$=()=>({time:0,x:E0(),y:E0()}),I$={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function _0(e,t,n,r){const s=n[t],{length:a,position:o}=I$[t],l=s.current,c=n.time;s.current=e[`scroll${o}`],s.scrollLength=e[`scroll${a}`]-e[`client${a}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=Ki(0,s.scrollLength,s.current);const u=r-c;s.velocity=u>P$?0:ux(s.current-l,u)}function M$(e,t,n){_0(e,"x",t,n),_0(e,"y",t,n),t.time=n}function D$(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(r instanceof HTMLElement)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const s=r.getBoundingClientRect();r=r.parentElement;const a=r.getBoundingClientRect();n.x+=s.left-a.left,n.y+=s.top-a.top}else if(r instanceof SVGGraphicsElement){const{x:s,y:a}=r.getBBox();n.x+=s,n.y+=a;let o=null,l=r.parentNode;for(;!o;)l.tagName==="svg"&&(o=l),l=r.parentNode;r=o}else break;return n}const qm={start:0,center:.5,end:1};function A0(e,t,n=0){let r=0;if(e in qm&&(e=qm[e]),typeof e=="string"){const s=parseFloat(e);e.endsWith("px")?r=s:e.endsWith("%")?e=s/100:e.endsWith("vw")?r=s/100*document.documentElement.clientWidth:e.endsWith("vh")?r=s/100*document.documentElement.clientHeight:e=s}return typeof e=="number"&&(r=t*e),n+r}const O$=[0,0];function L$(e,t,n,r){let s=Array.isArray(e)?e:O$,a=0,o=0;return typeof e=="number"?s=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?s=e.split(" "):s=[e,qm[e]?e:"0"]),a=A0(s[0],n,r),o=A0(s[1],t),a-o}const F$={All:[[0,0],[1,1]]},V$={x:0,y:0};function $$(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function z$(e,t,n){const{offset:r=F$.All}=n,{target:s=e,axis:a="y"}=n,o=a==="y"?"height":"width",l=s!==e?D$(s,e):V$,c=s===e?{width:e.scrollWidth,height:e.scrollHeight}:$$(s),u={width:e.clientWidth,height:e.clientHeight};t[a].offset.length=0;let f=!t[a].interpolate;const d=r.length;for(let m=0;m<d;m++){const p=L$(r[m],u[o],c[o],l[a]);!f&&p!==t[a].interpolatorOffsets[m]&&(f=!0),t[a].offset[m]=p}f&&(t[a].interpolate=vC(t[a].offset,bC(r),{clamp:!1}),t[a].interpolatorOffsets=[...t[a].offset]),t[a].progress=Fr(0,1,t[a].interpolate(t[a].current))}function U$(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}function B$(e,t,n,r={}){return{measure:()=>U$(e,r.target,n),update:s=>{M$(e,n,s),(r.offset||r.target)&&z$(e,n,r)},notify:()=>t(n)}}const $o=new WeakMap,P0=new WeakMap,ch=new WeakMap,R0=e=>e===document.documentElement?window:e;function bx(e,{container:t=document.documentElement,...n}={}){let r=ch.get(t);r||(r=new Set,ch.set(t,r));const s=R$(),a=B$(t,e,s,n);if(r.add(a),!$o.has(t)){const l=()=>{for(const m of r)m.measure()},c=()=>{for(const m of r)m.update(Bt.timestamp)},u=()=>{for(const m of r)m.notify()},f=()=>{ct.read(l,!1,!0),ct.read(c,!1,!0),ct.update(u,!1,!0)};$o.set(t,f);const d=R0(t);window.addEventListener("resize",f,{passive:!0}),t!==document.documentElement&&P0.set(t,A$(t,f)),d.addEventListener("scroll",f,{passive:!0})}const o=$o.get(t);return ct.read(o,!1,!0),()=>{var l;Lr(o);const c=ch.get(t);if(!c||(c.delete(a),c.size))return;const u=$o.get(t);$o.delete(t),u&&(R0(t).removeEventListener("scroll",u),(l=P0.get(t))===null||l===void 0||l(),window.removeEventListener("resize",u))}}function H$({source:e,container:t,axis:n="y"}){e&&(t=e);const r={value:0},s=bx(a=>{r.value=a[n].progress*100},{container:t,axis:n});return{currentTime:r,cancel:s}}const uh=new Map;function WC({source:e,container:t=document.documentElement,axis:n="y"}={}){e&&(t=e),uh.has(t)||uh.set(t,{});const r=uh.get(t);return r[n]||(r[n]=Mj()?new ScrollTimeline({source:t,axis:n}):H$({source:t,axis:n})),r[n]}function W$(e){return e.length===2}function qC(e){return e&&(e.target||e.offset)}function q$(e,t){return W$(e)||qC(t)?bx(n=>
503{e(n[t.axis].progress,n)},t):HC(e,WC(t))}function G$(e,t){if(e.flatten(),qC(t))return e.pause(),bx(n=>{e.time=e.duration*n[t.axis].progress},t);{const n=WC(t);return e.attachTimeline?e.attachTimeline(n,r=>(r.pause(),HC(s=>{r.time=r.duration*s},n))):mn}}function Y$(e,{axis:t="y",...n}={}){const r={axis:t,...n};return typeof e=="function"?q$(e,r):G$(e,r)}function I0(e,t){rF(!!(!t||t.current))}const K$=()=>({scrollX:as(0),scrollY:as(0),scrollXProgress:as(0),scrollYProgress:as(0)});function Q$({container:e,target:t,layoutEffect:n=!0,...r}={}){const s=dc(K$);return(n?Ug:h.useEffect)(()=>(I0("target",t),I0("container",e),Y$((o,{x:l,y:c})=>{s.scrollX.set(l.current),s.scrollXProgress.set(l.progress),s.scrollY.set(c.current),s.scrollYProgress.set(c.progress)},{...r,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0})),[e,t,JSON.stringify(r.offset)]),s}class Z${constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const X$=()=>new Z$;function J$(){return dc(X$)}function xs(e){let t=e;!e.includes("?")&&window.location.search&&(t+=window.location.search),!e.includes("#")&&window.location.hash&&(t+=window.location.hash),window.history.pushState({},"",t);const n=e.split("?")[0].split("#")[0],r={"/":"Dashboard - REPSShield","/dashboard":"Dashboard - REPSShield","/activity-ledger":"Activity Ledger - REPSShield","/properties":"Properties - REPSShield","/files":"File Vault - REPSShield","/analytics":"Analytics - REPSShield","/calendar":"Calendar - REPSShield","/team":"Team - REPSShield","/super-admin":"Super Admin - REPSShield","/organization-admin":"Organization - REPSShield"};document.title=r[n]||"REPSShield"}function GC(){window.addEventListener("popstate",e=>{const t=window.location.pathname.split("?")[0].split("#")[0],n={"/":"Dashboard - REPSShield","/dashboard":"Dashboard - REPSShield","/activity-ledger":"Activity Ledger - REPSShield","/properties":"Properties - REPSShield","/files":"File Vault - REPSShield","/analytics":"Analytics - REPSShield","/calendar":"Calendar - REPSShield","/team":"Team - REPSShield","/super-admin":"Super Admin - REPSShield","/organization-admin":"Organization - REPSShield"};document.title=n[t]||"REPSShield"})}function YC(){const e=h.useCallback((l=10)=>{if(typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(l)}catch(c){console.debug("Haptic feedback error:",c)}},[]),t=h.useCallback(()=>e(20),[e]),n=h.useCallback(()=>e([50,50,50]),[e]),r=h.useCallback(()=>e(10),[e]),s=h.useCallback(()=>e(15),[e]),a=h.useCallback(()=>e(25),[e]),o=h.useCallback(()=>e(5),[e]);return{vibrate:e,success:t,error:n,impactLight:r,impactMedium:s,impactHeavy:a,selection:o}}const ez=[{path:"/member/time-entries",label:"Entries",icon:xS},{path:"/member/stats",label:"Stats",icon:pS},{path:"/member/profile",label:"Profile",icon:ao}];function tz(){const[e,t]=pt(),{selection:n}=YC(),r=tc(),s=a=>{n(),t(a),xs(a)};return i.jsx("nav",{className:W("fixed bottom-0 left-0 right-0 z-50","glass-bar bg-white/90 dark:bg-gray-950/90","border-t border-gray-200/50 dark:border-gray-800/50",!r&&"safe-area-bottom pb-safe-area-bottom"),style:r?{paddingBottom:"max(env(safe-area-inset-bottom), 6px)"}:void 0,role:"navigation","aria-label":"Member navigation",children:i.jsx("div",{className:W("flex items-center justify-around px-4",r?"h-[58px]":"h-16"),children:ez.map(a=>{const o=a.icon,l=e===a.path||e.startsWith(`${a.path}/`);return i.jsxs(qt.button,{type:"button",onClick:()=>s(a.path),className:W("relative flex h-full flex-1 flex-col items-center justify-center",r&&"pb-1","touch-target touch-manipulation transition-colors duration-150",l?"text-primary":"text-gray-500 dark:text-gray-400"),whileTap:{scale:.9},transition:{type:"spring",stiffness:400,damping:17},"aria-current":l?"page":void 0,"aria-label":a.label,children:[i.jsx(qt.div,{initial:!1,animate:{scale:l?1.1:1,y:l?-2:0},transition:{type:"spring",stiffness:300,damping:20},children:i.jsx(o,{className:W("h-6 w-6 transition-all duration-150",l&&"stroke-[2.5]")})}),i.jsx("span",{className:W("mt-1 text-[10px] font-medium transition-all duration-150",l?"opacity-100":"opacity-70"),children:a.label}),l&&i.jsx(qt.div,{layoutId:"memberBottomNavIndicator",className:W("absolute h-1 w-1 rounded-full bg-primary",r?"bottom-1.5":"bottom-1"),transition:{type:"spring",stiffness:300,damping:30}})]},a.path)})})})}function nz({children:e}){const[t]=pt(),n=h.useRef(null);return h.useEffect(()=>{requestAnimationFrame(()=>{var r;(r=n.current)==null||r.scrollTo({top:0,left:0,behavior:"auto"}),window.scrollTo({top:0,left:0,behavior:"auto"})})},[t]),i.jsxs("div",{className:"flex h-screen h-[100dvh] flex-col overflow-hidden bg-gray-50 pt-3 dark:bg-gray-900",children:[i.jsx("main",{ref:n,className:"mx-auto flex min-h-0 w-full flex-1 container-mobile flex-col gap-4 overflow-y-auto overscroll-contain px-4 safe-area-left safe-area-right",children:e}),i.jsx(tz,{})]})}const Je=h.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:W("rounded-xl border bg-card text-card-foreground shadow-sm transition-all duration-200",e),...t}));
503Je.displayName="Card";const Yu=h.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:W("flex flex-col space-y-1.5 p-6",e),...t}));Yu.displayName="CardHeader";const Ku=h.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:W("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ku.displayName="CardTitle";const Gm=h.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:W("text-sm text-muted-foreground",e),...t}));Gm.displayName="CardDescription";const rt=h.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:W("p-6 pt-0",e),...t}));rt.displayName="CardContent";const KC=h.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:W("flex items-center p-6 pt-0",e),...t}));KC.displayName="CardFooter";const rz=So("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Mr({className:e,variant:t,...n}){return i.jsx("div",{className:W(rz({variant:t}),e),...n})}function gt({className:e,...t}){return i.jsx("div",{className:W("animate-shimmer bg-muted rounded-md bg-[length:200%_100%]",e),style:{backgroundImage:"linear-gradient(90deg, var(--muted) 25%, var(--accent) 50%, var(--muted) 75%)"},...t})}function st(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Cn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function cn(e,t){const n=st(e);return isNaN(t)?Cn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function cr(e,t){const n=st(e);if(isNaN(t))return Cn(e,NaN);if(!t)return n;const r=n.getDate(),s=Cn(e,n.getTime());s.setMonth(n.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const wx=6048e5,sz=864e5,QC=6e4,ZC=36e5,Kie=43200,Qie=1440;let iz={};function gc(){return iz}function Vr(e,t){var l,c,u,f;const n=gc(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=st(e),a=s.getDay(),o=(a<r?7:0)+a-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Qi(e){return Vr(e,{weekStartsOn:1})}function XC(e){const t=st(e),n=t.getFullYear(),r=Cn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Qi(r),a=Cn(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=Qi(a);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function uo(e){const t=st(e);return t.setHours(0,0,0,0),t}function Qu(e){const t=st(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Tr(e,t){const n=uo(e),r=uo(t),s=+n-Qu(n),a=+r-Qu(r);return Math.round((s-a)/sz)}function az(e){const t=XC(e),n=Cn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Qi(n)}function Ym(e,t){const n=t*7;return cn(e,n)}function oz(e,t){return cr(e,t*12)}function lz(e){let t;return e.forEach(function(n){const r=st(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function cz(e){let t;return e.forEach(n=>{const r=st(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function JC(e){return Cn(e,Date.now())}function nn(e,t){const n=uo(e),r=uo(t);return+n==+r}function kx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function uz(e){if(!kx(e)&&typeof e!="number")return!1;const t=st(e);return!isNaN(Number(t))}function Vl(e,t){const n=st(e),r=st(t),s=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return s*12+a}function dz(e,t,n){const r=Vr(e,n),s=Vr(t,n),a=+r-Qu(r),o=+s-Qu(s);return Math.round((a-o)/wx)}function Sx(e){const t=st(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Nn(e){const t=st(e);return t.setDate(1),t.setHours(0,0,0,0),t}function eT(e){const t=st(e),n=Cn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Nx(e,t){var l,c,u,f;const n=gc(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=st(e),a=s.getDay(),o=(a<r?-7:0)+6-(a-r);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function tT(e){return Nx(e,{weekStartsOn:1}
503)}const fz={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},hz=(e,t,n)=>{let r;const s=fz[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function dh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const mz={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},pz={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gz={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xz={date:dh({formats:mz,defaultWidth:"full"}),time:dh({formats:pz,defaultWidth:"full"}),dateTime:dh({formats:gz,defaultWidth:"full"})},yz={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vz=(e,t,n,r)=>yz[e];function zo(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const bz={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wz={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},kz={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Sz={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Nz={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},jz={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Cz=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Tz={ordinalNumber:Cz,era:zo({values:bz,defaultWidth:"wide"}),quarter:zo({values:wz,defaultWidth:"wide",argumentCallback:e=>e-1}),month:zo({values:kz,defaultWidth:"wide"}),day:zo({values:Sz,defaultWidth:"wide"}),dayPeriod:zo({values:Nz,defaultWidth:"wide",formattingValues:jz,defaultFormattingWidth:"wide"})};function Uo(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const o=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?_z(l,d=>d.test(o)):Ez(l,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=t.slice(o.length);return{value:u,rest:f}}}function Ez(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function _z(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Az(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(s.length);return{value:o,rest:l}}}const Pz=/^(\d+)(th|st|nd|rd)?/i,Rz=/\d+/i,Iz={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Mz={any:[/^b/i,/^(a|c)/i]},Dz={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Oz={any:[/1/i,/2/i,/3/i,/4/i]},Lz={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Fz={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Vz={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$z={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},zz={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Uz={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Bz={ordinalNumber:Az({matchPattern:Pz,parsePattern:Rz,valueCallback:e=>parseInt(e,10)}),era:Uo({matchPatterns:Iz,defaultMatchWidth:"wide",parsePatterns:Mz,defaultParseWidth:"any"}),quarter:Uo({matchPatterns:Dz,defaultMatchWidth:"wide",parsePatterns:Oz,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Uo({matchPatterns:Lz,defaultMatchWidth:"wide",parsePatterns:Fz,defaultParseWidth:"any"}),day:Uo({matchPatterns:Vz,defaultMatchWidth:"wide",parsePatterns:$z,defaultParseWidth:"any"}),dayPeriod:Uo({matchPatterns:zz,defaultMatchWidth:"any",parsePatterns:Uz,defaultParseWidth:"any"})},nT={code:"en-US",formatDistance:hz,formatLong:xz,formatRelative:vz,localize:Tz,match:Bz,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Hz(e){const t=st(e);return Tr(t,eT(t))+1}function rT(e){const t=st(e),n=+Qi(t)-+az(t);return Math.round(n/wx)+1}function sT(e,t){var f,d,m,p;const n=st(e),r=n.getFullYear(),s=gc(),a=(t==null?void 0:t.firstWeekContainsDate)??((d=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(m=s.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=Cn(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);const l=Vr(o,t),c=Cn(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const u=Vr(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Wz(e,t){var l,c,u,f;const n=gc(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=sT(e,t),a=Cn(e,0);return a.setFullYear(s,0,r),a.setHours(0,0,0,0),Vr(a,t)}function iT(e,t){const n=st(e),r=+Vr(n,t)-+Wz(n,t);return Math.round(r/wx)+1}function ft(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ts={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ft(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ft(n+1,2)},d(e,t){return ft(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ft(e.getHours()%12||12,t.length)},H(e,t){return ft(e.getHours(),t.length)},m(e,t){return ft(e.getMinutes(),t.length)},s(e,t){return ft(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return ft(s,t.length)}},Sa={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},M0={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Ts.y(e,t)},Y:function(e,t,n,r){const s=sT(e,r),a=s>0?s:1-s;if(t==="YY"){const o=a%100;return ft(o,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):ft(a,t.length)},R:function(e,t){const n=XC(e);return ft(n,t.length)},u:function(e,t){const n=e.getFullYear();return ft(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ft(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ft(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ts.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ft(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=iT(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ft(s,t.length)},I:function(e,t,n){const r=rT(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ft(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}
503):Ts.d(e,t)},D:function(e,t,n){const r=Hz(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ft(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),a=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return ft(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),a=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return ft(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return ft(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Sa.noon:r===0?s=Sa.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Sa.evening:r>=12?s=Sa.afternoon:r>=4?s=Sa.morning:s=Sa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ts.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ts.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ft(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ft(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ts.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ts.s(e,t)},S:function(e,t){return Ts.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return O0(r);case"XXXX":case"XX":return Ni(r);case"XXXXX":case"XXX":default:return Ni(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return O0(r);case"xxxx":case"xx":return Ni(r);case"xxxxx":case"xxx":default:return Ni(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+D0(r,":");case"OOOO":default:return"GMT"+Ni(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+D0(r,":");
503case"zzzz":default:return"GMT"+Ni(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return ft(r,t.length)},T:function(e,t,n){const r=e.getTime();return ft(r,t.length)}};function D0(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),a=r%60;return a===0?n+String(s):n+String(s)+t+ft(a,2)}function O0(e,t){return e%60===0?(e>0?"-":"+")+ft(Math.abs(e)/60,2):Ni(e,t)}function Ni(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=ft(Math.trunc(r/60),2),a=ft(r%60,2);return n+s+t+a}const L0=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},aT=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},qz=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return L0(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",L0(r,t)).replace("{{time}}",aT(s,t))},Gz={p:aT,P:qz},Yz=/^D+$/,Kz=/^Y+$/,Qz=["D","DD","YY","YYYY"];function Zz(e){return Yz.test(e)}function Xz(e){return Kz.test(e)}function Jz(e,t,n){const r=eU(e,t,n);if(console.warn(r),Qz.includes(e))throw new RangeError(r)}function eU(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const tU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rU=/^'([^]*?)'?$/,sU=/''/g,iU=/[a-zA-Z]/;function Br(e,t,n){var f,d,m,p,g,x,y,v;const r=gc(),s=(n==null?void 0:n.locale)??r.locale??nT,a=(n==null?void 0:n.firstWeekContainsDate)??((d=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((x=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??r.weekStartsOn??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,l=st(e);if(!uz(l))throw new RangeError("Invalid time value");let c=t.match(nU).map(b=>{const w=b[0];if(w==="p"||w==="P"){const j=Gz[w];return j(b,s.formatLong)}return b}).join("").match(tU).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:aU(b)};if(M0[w])return{isToken:!0,value:b};if(w.match(iU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:s};return c.map(b=>{if(!b.isToken)return b.value;const w=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Xz(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Zz(w))&&Jz(w,t,String(e));const j=M0[w[0]];return j(l,w,s.localize,u)}).join("")}function aU(e){const t=e.match(rU);return t?t[1].replace(sU,"'"):e}function oU(e){const t=st(e),n=t.getFullYear(),r=t.getMonth(),s=Cn(e,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function lU(e){return Math.trunc(+st(e)/1e3)}function cU(e){const t=st(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function uU(e,t){return dz(cU(e),Nn(e),t)+1}function Km(e,t){const n=st(e),r=st(t);return n.getTime()>r.getTime()}function oT(e,t){const n=st(e),r=st(t);return+n<+r}function jx(e,t){const n=st(e),r=st(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function dU(e,t){const n=st(e),r=st(t);return n.getFullYear()===r.getFullYear()}function fU(e){return nn(e,JC(e))}function xu(e,t){return cn(e,-t)}function hU(e){return nn(e,xu(JC(e),1))}function lT(e,t){const r=xU(e);let s;if(r.date){const c=yU(r.date,2);s=vU(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const a=s.getTime();let o=0,l;if(r.time&&(o=bU(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(l=wU(r.timezone),isNaN(l))return new Date(NaN)}else{const c=new Date(a+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(a+o+l)}
503const Yc={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},mU=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,pU=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,gU=/^([+-])(\d{2})(?::?(\d{2}))?$/;function xU(e){const t={},n=e.split(Yc.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Yc.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Yc.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const s=Yc.timezone.exec(r);s?(t.time=r.replace(s[1],""),t.timezone=s[1]):t.time=r}return t}function yU(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const s=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?s:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function vU(e,t){if(t===null)return new Date(NaN);const n=e.match(mU);if(!n)return new Date(NaN);const r=!!n[4],s=Bo(n[1]),a=Bo(n[2])-1,o=Bo(n[3]),l=Bo(n[4]),c=Bo(n[5])-1;if(r)return CU(t,l,c)?kU(t,l,c):new Date(NaN);{const u=new Date(0);return!NU(t,a,o)||!jU(t,s)?new Date(NaN):(u.setUTCFullYear(t,a,Math.max(s,o)),u)}}function Bo(e){return e?parseInt(e):1}function bU(e){const t=e.match(pU);if(!t)return NaN;const n=fh(t[1]),r=fh(t[2]),s=fh(t[3]);return TU(n,r,s)?n*ZC+r*QC+s*1e3:NaN}function fh(e){return e&&parseFloat(e.replace(",","."))||0}function wU(e){if(e==="Z")return 0;const t=e.match(gU);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return EU(r,s)?n*(r*ZC+s*QC):NaN}function kU(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const s=r.getUTCDay()||7,a=(t-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+a),r}const SU=[31,null,31,30,31,30,31,31,30,31,30,31];function cT(e){return e%400===0||e%4===0&&e%100!==0}function NU(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(SU[t]||(cT(e)?29:28))}function jU(e,t){return t>=1&&t<=(cT(e)?366:365)}function CU(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function TU(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function EU(e,t){return t>=0&&t<=59}function hh(e,t){const n=st(e),r=n.getFullYear(),s=n.getDate(),a=Cn(e,0);a.setFullYear(r,t,15),a.setHours(0,0,0,0);const o=oU(a);return n.setMonth(t,Math.min(s,o)),n}function F0(e,t){const n=st(e);return isNaN(+n)?Cn(e,NaN):(n.setFullYear(t),n)}var Cx="Progress",Tx=100,[_U]=zt(Cx),[AU,PU]=_U(Cx),uT=h.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:a=RU,...o}=e;(s||s===0)&&!V0(s)&&console.error(IU(`${s}`,"Progress"));const l=V0(s)?s:Tx;r!==null&&!$0(r,l)&&console.error(MU(`${r}`,"Progress"));const c=$0(r,l)?r:null,u=Zu(c)?a(c,l):void 0;return i.jsx(AU,{scope:n,value:c,max:l,children:i.jsx(pe.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Zu(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":hT(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});uT.displayName=Cx;var dT="ProgressIndicator",fT=h.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=PU(dT,n);return i.jsx(pe.div,{"data-state":hT(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});fT.displayName=dT;function RU(e,t){return`${Math.round(e/t*100)}%`}function hT(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Zu(e){return typeof e=="number"}function V0(e){return Zu(e)&&!isNaN(e)&&e>0}function $0(e,t){return Zu(e)&&!isNaN(e)&&e<=t&&e>=0}function IU(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Tx}\`.`}function MU(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
504  - a positive number
505  - less than the value passed to \`max\` (or ${Tx} if no \`max\` prop is set)
506  - \`null\` or \`undefined\` if the progress is indeterminate.
507
508Defaulting to \`null\`.`}var mT=uT,DU=fT;const OU=h.forwardRef(({className:e,value:t,...n},r)=>i.jsx(mT,{ref:r,className:W("relative h-2 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:i.jsx(DU,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));OU.displayName=mT.displayName;function Ex(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Jd="Switch",[LU]=zt(Jd),[FU,_x]=LU(Jd);function VU(e){const{__scopeSwitch:t,checked:n,children:r,defaultChecked:s,disabled:a,form:o,name:l,onCheckedChange:c,required:u,value:f="on",internal_do_not_use_render:d}=e,[m,p]=jn({prop:n,defaultProp:s??!1,onChange:c,caller:Jd}
508),[g,x]=h.useState(null),[y,v]=h.useState(null),b=h.useRef(!1),w=g?!!o||!!g.closest("form"):!0,j={checked:m,setChecked:p,disabled:a,control:g,setControl:x,name:l,form:o,value:f,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:s,isFormControl:w,bubbleInput:y,setBubbleInput:v};return i.jsx(FU,{scope:t,...j,children:$U(d)?d(j):r})}var pT="SwitchTrigger",gT=h.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{const{value:s,disabled:a,checked:o,required:l,setControl:c,setChecked:u,hasConsumerStoppedPropagationRef:f,isFormControl:d,bubbleInput:m}=_x(pT,e),p=Ae(r,c);return i.jsx(pe.button,{type:"button",role:"switch","aria-checked":o,"aria-required":l,"data-state":wT(o),"data-disabled":a?"":void 0,disabled:a,value:s,...n,ref:p,onClick:se(t,g=>{u(x=>!x),m&&d&&(f.current=g.isPropagationStopped(),f.current||g.stopPropagation())})})});gT.displayName=pT;var Ax=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c,onCheckedChange:u,form:f,...d}=e;return i.jsx(VU,{__scopeSwitch:n,checked:s,defaultChecked:a,disabled:l,required:o,onCheckedChange:u,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:m})=>i.jsxs(i.Fragment,{children:[i.jsx(gT,{...d,ref:t,__scopeSwitch:n}),m&&i.jsx(bT,{__scopeSwitch:n})]})})});Ax.displayName=Jd;var xT="SwitchThumb",yT=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=_x(xT,n);return i.jsx(pe.span,{"data-state":wT(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});yT.displayName=xT;var vT="SwitchBubbleInput",bT=h.forwardRef(({__scopeSwitch:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:a,defaultChecked:o,required:l,disabled:c,name:u,value:f,form:d,bubbleInput:m,setBubbleInput:p}=_x(vT,e),g=Ae(n,p),x=Ex(a),y=vg(r);h.useEffect(()=>{const b=m;if(!b)return;const w=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(w,"checked").set,C=!s.current;if(x!==a&&S){const I=new Event("click",{bubbles:C});S.call(b,a),b.dispatchEvent(I)}},[m,x,a,s]);const v=h.useRef(a);return i.jsx(pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??v.current,required:l,disabled:c,name:u,value:f,form:d,...t,tabIndex:-1,ref:g,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});bT.displayName=vT;function $U(e){return typeof e=="function"}function wT(e){return e?"checked":"unchecked"}const $l=h.forwardRef(({className:e,...t},n)=>i.jsx(Ax,{className:W("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:i.jsx(yT,{className:W("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));$l.displayName=Ax.displayName;const Kc=768;function mi(){const[e,t]=h.useState(()=>typeof window<"u"?window.innerWidth<Kc:!1);return h.useEffect(()=>{if(Le()){t(!0);return}const n=window.matchMedia(`(max-width: ${Kc-1}px)`),r=()=>{t(window.innerWidth<Kc)};return n.addEventListener("change",r),t(window.innerWidth<Kc),()=>n.removeEventListener("change",r)},[]),!!e}function zU({children:e}){return mi()?i.jsx(nz,{children:e}):i.jsxs("div",{className:"flex h-screen bg-background",children:[i.jsx(KD,{}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsx(X5,{}),i.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:e})]})]})}const UU=h.lazy(()=>ce(()=>import("./time-entries-CpVpMVvX.js"),__vite__mapDeps([80,1,81,82,24,83,84,85,86,70]))),BU=h.lazy(()=>ce(()=>import("./stats-BJ8-38u-.js"),__vite__mapDeps([87,81,1,11]))),HU=h.lazy(()=>ce(()=>import("./profile-BdW9QXVI.js"),__vite__mapDeps([88,1,82,81,89,90,5,45])));function WU(){return i.jsxs("div",{className:"space-y-4 pt-2",children:[i.jsx("div",{className:"h-7 w-40 animate-pulse rounded-lg bg-gray-200 dark:bg-gray-800"}),i.jsx("div",{className:"grid grid-cols-3 gap-3",children:[1,2,3].map(e=>i.jsx("div",{className:"h-20 animate-pulse rounded-2xl bg-gray-200 dark:bg-gray-800"},e))}),i.jsx("div",{className:"h-64 animate-pulse rounded-2xl bg-gray-200 dark:bg-gray-800"})]})}function qU({user:e,userData:t,location:n}){const r=(t==null?void 0:t.accountOwnerId)!=null;return!e||!r?null:n==="/"||n==="/dashboard"?(window.location.href="/member/time-entries",null):i.jsx(zU,{children:i.jsx(h.Suspense,{fallback:i.jsx(WU,{}),children:i.jsxs(Cu,{children:[i.jsx(We,{path:"/member/time-entries",children:()=>i.jsx(UU,{})}),i.jsx(We,{path:"/member/stats",children:()=>i.jsx(BU,{})}),i.jsx(We,{path:"/member/profile",children:()=>i.jsx(HU,{})})]})})})}function GU({userData:e,location:t,children:n}){var l,c;const r=(e==null?void 0:e.accountOwnerId)!=null,s=!!((c=(l=window.Capacitor)==null?void 0:l.isNativePlatform)!=null&&c.call(l)),a=localStorage.getItem("repshield_onboarding_completed");return s&&!!e&&e.hasCompletedOnboardingForm===!0&&!r&&t!=="/welcome-tour"&&a!=="true"?(window.location.href="/welcome-tour",null):i.jsx(i.Fragment,{children:n})}function he({className:e,...t}){return i.jsx("div",{className:W("animate-pulse rounded-md bg-muted",e),...t})}function YU(){return i.jsxs("header",{children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(he,{className:"h-3 w-32"}),i.jsx(he,{className:"h-7 w-24"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(he,{className:"h-11 w-11 rounded-2xl"}),i.jsx(he,{className:"h-11 w-11 rounded-full"})]})]}),i.jsx("div",{className:"mt-3",children:i.jsx(he,{className:"h-8 w-36 rounded-lg"})})]})}function KU(){return i.jsxs("div",{className:"flex min-h-14 items-center gap-3 rounded-2xl border border-amber-100 bg-amber-50 px-4 py-3 dark:border-amber-900/50 dark:bg-amber-950/40",children:[i.jsx(he,{className:"h-9 w-9 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(he,{className:"h-3 w-40"}),i.jsx(he,{className:"h-3 w-56"})]}),i.jsx(he,{className:"h-5 w-5"})]})}function QU(){return i.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white p-4 shadow-sm dark:border-border dark:bg-card",children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsx(he,{className:"h-3 w-20"}),i.jsx(he,{className:"h-3 w-12"})]}),i.jsxs("div",{className:"flex items-center gap-5",children:[i.jsx(he,{className:"h-28 w-28 rounded-full"}),i.jsxs("div",{className:"flex-1 space-y-3",children:[i.jsx(he,{className:"h-6 w-28"}),i.jsx(he,{className:"h-2 w-full rounded-full"}),i.jsx(he,{className:"h-3 w-32"})]})]})]})}function ZU(){return i.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white p-4 shadow-sm dark:border-border dark:bg-card",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsx(he,{className:"h-3 w-16"}),i.jsx(he,{className:"h-3 w-14"})]}),i.jsxs("div",{className:"rounded-xl border border-gray-100 px-3 py-3 dark:border-border",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsx(he,{className:"h-10 w-10 rounded-full"}),i.jsx(he,{className:"h-3 w-20"}),i.jsx(he,{className:"h-10 w-10 rounded-full"})]}),i.jsx("div",{className:"grid grid-cols-7 gap-1",children:[...Array(7)].map((e,t)=>i.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[i.jsx(he,{className:"h-2 w-3"}),i.jsx(he,{className:"h-8 w-8 rounded-full"}),i.jsx(he,{className:"h-1.5 w-1.5 rounded-full"})]},t))}),i.jsxs("div",{className:"mt-3 flex min-h-11 items-center justify-between border-t border-gray-100 pt-3 dark:border-border",children:[i.jsx(he,{className:"h-2 w-40"}),i.jsx(he,{className:"h-4 w-4"})]})]})]})}function XU(){return i.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white p-4 shadow-sm dark:border-border dark:bg-card",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsx(he,{className:"h-3 w-10"}),i.jsx(he,{className:"h-3 w-14"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(he,{className:"h-10 w-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(he,{className:"h-3 w-32"}),i.jsx(he,{className:"h-3 w-48"})]}
508),i.jsx(he,{className:"h-5 w-14 rounded-full"})]})]})}function JU(){return i.jsxs("div",{className:"overflow-hidden rounded-2xl border border-gray-100 bg-white shadow-sm dark:border-border dark:bg-card",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-border",children:[i.jsx(he,{className:"h-3 w-20"}),i.jsx(he,{className:"h-3 w-12"})]}),[...Array(2)].map((e,t)=>i.jsx("div",{className:W(t>0&&"border-t border-gray-100 dark:border-border"),children:i.jsxs("div",{className:"flex min-h-14 items-center gap-3 px-3 py-2",children:[i.jsx(he,{className:"h-10 w-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(he,{className:"h-3 w-24"}),i.jsx(he,{className:"h-3 w-36"})]}),i.jsx(he,{className:"h-5 w-16 rounded-full"}),i.jsx(he,{className:"h-4 w-4"})]})},t))]})}function eB(){return i.jsxs("div",{className:"overflow-hidden rounded-2xl border border-gray-100 bg-white shadow-sm dark:border-border dark:bg-card",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-border",children:[i.jsx(he,{className:"h-3 w-36"}),i.jsx(he,{className:"h-3 w-12"})]}),i.jsx("div",{className:"p-3",children:i.jsx("div",{className:"h-16 rounded-xl bg-muted"})})]})}function kT(){return i.jsx("div",{className:"min-h-screen bg-gray-50 px-4 pt-3 dark:bg-background","data-testid":"offline-mobile-dashboard",children:i.jsxs("div",{className:"mx-auto flex w-full container-mobile flex-col gap-4",children:[i.jsx(YU,{}),i.jsx(KU,{}),i.jsx(QU,{}),i.jsx(ZU,{}),i.jsx(XU,{}),i.jsx(JU,{}),i.jsx(eB,{})]})})}function tB(){return i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(he,{className:"h-8 w-40 rounded-lg"}),i.jsx(he,{className:"h-10 w-10 rounded-xl"})]})}function nB(){return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(he,{className:"h-10 flex-1 rounded-xl"}),i.jsx(he,{className:"h-10 w-10 rounded-xl"}),i.jsx(he,{className:"h-10 w-10 rounded-xl"})]})}function rB(){return i.jsx(he,{className:"h-10 w-full rounded-xl"})}function z0(){return i.jsxs("div",{children:[i.jsx("div",{className:"bg-gray-100 px-4 py-2",children:i.jsx(he,{className:"h-3 w-24 rounded"})}),i.jsx("div",{className:"divide-y divide-gray-100 bg-white",children:[1,2,3].map(e=>i.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[i.jsx(he,{className:"h-9 w-9 rounded-full flex-shrink-0"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(he,{className:"h-4 w-28 rounded"}),i.jsx(he,{className:"h-3 w-40 rounded"}),i.jsx(he,{className:"h-3 w-56 rounded"})]}),i.jsxs("div",{className:"flex flex-col items-end gap-1.5 flex-shrink-0",children:[i.jsx(he,{className:"h-4 w-8 rounded"}),i.jsx(he,{className:"h-5 w-5 rounded-full"})]})]},e))})]})}function ST(){return i.jsx("div",{className:"min-h-screen bg-gray-50 pt-3 dark:bg-background container-mobile","data-testid":"offline-mobile-activity-ledger",children:i.jsxs("div",{className:"space-y-4 px-4",children:[i.jsx(tB,{}),i.jsx(nB,{}),i.jsx(rB,{}),i.jsxs("div",{className:"mt-3 space-y-0",children:[i.jsx(z0,{}),i.jsx(z0,{})]})]})})}function sB(){return i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(he,{className:"h-8 w-36 rounded-lg"}),i.jsx(he,{className:"h-10 w-10 rounded-xl"})]})}function iB(){return i.jsxs("div",{className:"flex items-center gap-1 rounded-2xl bg-white p-1 shadow-sm border border-gray-100",children:[i.jsx(he,{className:"h-8 w-16 rounded-lg"}),i.jsx(he,{className:"h-8 w-16 rounded-lg"})]})}function aB(){return i.jsxs("div",{className:"flex items-center gap-2 rounded-2xl bg-white px-3 py-2.5 shadow-sm border border-gray-100",children:[i.jsx(he,{className:"h-4 w-4 rounded"}),i.jsx(he,{className:"h-4 flex-1 rounded"})]})}function mh(){return i.jsxs("div",{className:"rounded-3xl border border-gray-100 bg-white shadow-sm overflow-hidden dark:border-gray-800 dark:bg-gray-900",children:[i.jsx(he,{className:"h-44 w-full rounded-none"}),i.jsxs("div",{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsxs("div",{className:"space-y-1.5 flex-1 mr-2",children:[i.jsx(he,{className:"h-5 w-32 rounded"}),i.jsx(he,{className:"h-3 w-48 rounded"})]}),i.jsx(he,{className:"h-9 w-9 rounded-xl"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(he,{className:"h-5 w-20 rounded-full"}),i.jsx(he,{className:"h-5 w-16 rounded-full"})]})]})]})}function NT(){return i.jsx("div",{className:"min-h-screen bg-gray-50 px-4 pt-3 dark:bg-background","data-testid":"offline-mobile-properties",children:i.jsxs("div",{className:"mx-auto flex w-full container-mobile flex-col gap-4",children:[i.jsx(sB,{}),i.jsx(iB,{}),i.jsx(aB,{}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(mh,{}),i.jsx(mh,{}),i.jsx(mh,{})]})]})})}function oB(){return i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(he,{className:"h-8 w-24 rounded-lg"}),i.jsx(he,{className:"h-10 w-10 rounded-xl"})]})}function lB(){return i.jsxs("div",{className:"flex items-center gap-1 rounded-2xl bg-white p-1 shadow-sm border border-gray-100",children:[i.jsx(he,{className:"h-8 w-20 rounded-lg"}),i.jsx(he,{className:"h-8 w-20 rounded-lg"}),i.jsx(he,{className:"h-8 w-20 rounded-lg"})]})}function cB(){return i.jsxs("div",{className:"flex items-center gap-2 rounded-2xl bg-white px-3 py-2.5 shadow-sm border border-gray-100",children:[i.jsx(he,{className:"h-4 w-4 roun
508ded"}),i.jsx(he,{className:"h-4 flex-1 rounded"})]})}function uB(){return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(he,{className:"h-9 w-28 rounded-xl"}),i.jsx(he,{className:"h-9 w-28 rounded-xl"}),i.jsx("div",{className:"flex-1"}),i.jsx(he,{className:"h-9 w-9 rounded-xl"})]})}function U0(){return i.jsx("div",{className:"rounded-2xl border border-gray-100 bg-white p-4 shadow-sm dark:border-gray-800 dark:bg-gray-900",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(he,{className:"h-11 w-11 rounded-xl flex-shrink-0"}),i.jsxs("div",{className:"flex-1 space-y-1.5 min-w-0",children:[i.jsx(he,{className:"h-4 w-full rounded"}),i.jsx(he,{className:"h-3 w-48 rounded"}),i.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[i.jsx(he,{className:"h-5 w-16 rounded-full"}),i.jsx(he,{className:"h-5 w-20 rounded-full"})]})]}),i.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[i.jsx(he,{className:"h-8 w-8 rounded"}),i.jsx(he,{className:"h-8 w-8 rounded"})]})]})})}function B0(){return i.jsxs("div",{children:[i.jsx("div",{className:"bg-gray-100 px-4 py-2",children:i.jsx(he,{className:"h-3 w-28 rounded"})}),i.jsxs("div",{className:"space-y-3 p-4 bg-white",children:[i.jsx(U0,{}),i.jsx(U0,{})]})]})}function jT(){return i.jsx("div",{className:"min-h-screen bg-gray-50 px-4 pt-3 dark:bg-background","data-testid":"offline-mobile-files",children:i.jsxs("div",{className:"mx-auto flex w-full container-mobile flex-col gap-4",children:[i.jsx(oB,{}),i.jsx(lB,{}),i.jsx(cB,{}),i.jsx(uB,{}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(B0,{}),i.jsx(B0,{})]})]})})}function zl(e,[t,n]){return Math.min(n,Math.max(t,e))}var CT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dB="VisuallyHidden",ef=h.forwardRef((e,t)=>i.jsx(pe.span,{...e,ref:t,style:{...CT,...e.style}}));ef.displayName=dB;var fB=ef,hB=[" ","Enter","ArrowUp","ArrowDown"],mB=[" ","Enter"],Zi="Select",[tf,nf,pB]=jo(Zi),[ha]=zt(Zi,[pB,fi]),rf=fi(),[gB,pi]=ha(Zi),[xB,yB]=ha(Zi),vB="SelectProvider";function TT(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:f,autoComplete:d,disabled:m,required:p,form:g,internal_do_not_use_render:x}=e,y=rf(t),[v,b]=h.useState(null),[w,j]=h.useState(null),[S,C]=h.useState(!1),I=oa(u),[E,N]=jn({prop:r,defaultProp:s??!1,onChange:a,caller:Zi}),[k,A]=jn({prop:o,defaultProp:l,onChange:c,caller:Zi}),M=h.useRef(null),L=v?!!g||!!v.closest("form"):!0,[F,V]=h.useState(new Set),U=Ot(),P=Array.from(F).map(G=>G.props.value).join(";"),T=h.useCallback(G=>{V(z=>new Set(z).add(G))},[]),D=h.useCallback(G=>{V(z=>{const R=new Set(z);return R.delete(G),R})},[]),_={required:p,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:j,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:U,value:k,onValueChange:A,open:E,onOpenChange:N,dir:I,triggerPointerDownPosRef:M,disabled:m,name:f,autoComplete:d,form:g,nativeOptions:F,nativeSelectKey:P,isFormControl:L};return i.jsx(Ld,{...y,children:i.jsx(gB,{scope:t,..._,children:i.jsx(tf.Provider,{scope:t,children:i.jsx(xB,{scope:t,onNativeOptionAdd:T,onNativeOptionRemove:D,children:MB(x)?x(_):n})})})})}TT.displayName=vB;var ET=e=>{const{__scopeSelect:t,children:n,...r}=e;return i.jsx(TT,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:s})=>i.jsxs(i.Fragment,{children:[n,s?i.jsx(KT,{__scopeSelect:t}):null]})})};ET.displayName=Zi;var _T="SelectTrigger",Px=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=rf(n),o=pi(_T,n),l=o.disabled||r,c=Ae(t,o.onTriggerChange),u=nf(n),f=h.useRef("touch"),[d,m,p]=QT(x=>{const y=u().filter(w=>!w.disabled),v=y.find(w=>w.value===o.value),b=ZT(y,x,v);b!==void 0&&o.onValueChange(b.value)}),g=x=>{l||(o.onOpenChange(!0),p()),x&&(o.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return i.jsx(ac,{asChild:!0,...a,children:i.jsx(pe.button,{type:"button",role:"combobox","aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sf(o.value)?"":void 0,...s,ref:c,onClick:se(s.onClick,x=>
508{x.currentTarget.focus(),f.current!=="mouse"&&g(x)}),onPointerDown:se(s.onPointerDown,x=>{f.current=x.pointerType;const y=x.target;y.hasPointerCapture(x.pointerId)&&y.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(g(x),x.preventDefault())}),onKeyDown:se(s.onKeyDown,x=>{const y=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&m(x.key),!(y&&x.key===" ")&&hB.includes(x.key)&&(g(),x.preventDefault())})})})});Px.displayName=_T;var AT="SelectValue",PT=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:o="",...l}=e,c=pi(AT,n),{onValueNodeHasChildrenChange:u}=c,f=a!==void 0,d=Ae(t,c.onValueNodeChange);_t(()=>{u(f)},[u,f]);const m=sf(c.value);return i.jsx(pe.span,{...l,asChild:m?!1:l.asChild,ref:d,style:{pointerEvents:"none"},children:i.jsx(h.Fragment,{children:m?o:a},m?"placeholder":"value")})});PT.displayName=AT;var bB="SelectIcon",RT=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(pe.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});RT.displayName=bB;var IT="SelectPortal",[wB,kB]=ha(IT,{forceMount:void 0}),MT=e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return i.jsx(wB,{scope:e.__scopeSelect,forceMount:n,children:i.jsx(ca,{asChild:!0,...r})})};MT.displayName=IT;var ii="SelectContent",Rx=h.forwardRef((e,t)=>{const n=kB(ii,e.__scopeSelect),{forceMount:r=n.forceMount,...s}=e,a=pi(ii,e.__scopeSelect),[o,l]=h.useState();return _t(()=>{l(new DocumentFragment)},[]),i.jsx(Lt,{present:r||a.open,children:({present:c})=>c?i.jsx(LT,{...s,ref:t}):i.jsx(DT,{...s,fragment:o})})});Rx.displayName=ii;var DT=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,fragment:s}=e;return s?sa.createPortal(i.jsx(OT,{scope:n,children:i.jsx(tf.Slot,{scope:n,children:i.jsx("div",{ref:t,children:r})})}),s):null});DT.displayName="SelectContentFragment";var tr=10,[OT,gi]=ha(ii),SB="SelectContentImpl",NB=ti("SelectContent.RemoveScroll"),LT=h.forwardRef((e,t)=>{const{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:m,collisionPadding:p,sticky:g,hideWhenDetached:x,avoidCollisions:y,...v}=e,b=pi(ii,n),[w,j]=h.useState(null),[S,C]=h.useState(null),I=Ae(t,X=>j(X)),[E,N]=h.useState(null),[k,A]=h.useState(null),M=nf(n),[L,F]=h.useState(!1),V=h.useRef(!1);h.useEffect(()=>{if(w)return zd(w)},[w]),Rd();const U=h.useCallback(X=>{const[fe,...ee]=M().map(oe=>oe.ref.current),[te]=ee.slice(-1),ge=document.activeElement;for(const oe of X)if(oe===ge||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===fe&&S&&(S.scrollTop=0),oe===te&&S&&(S.scrollTop=S.scrollHeight),oe==null||oe.focus(),document.activeElement!==ge))return},[M,S]),P=h.useCallback(()=>U([E,w]),[U,E,w]);h.useEffect(()=>{L&&P()},[L,P]);const{onOpenChange:T,triggerPointerDownPosRef:D}=b;h.useEffect(()=>{if(w){let X={x:0,y:0};const fe=te=>{var ge,oe;X={x:Math.abs(Math.round(te.pageX)-(((ge=D.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(te.pageY)-(((oe=D.current)==null?void 0:oe.y)??0))}},ee=te=>{X.x<=10&&X.y<=10?te.preventDefault():te.composedPath().includes(w)||T(!1),document.removeEventListener("pointermove",fe),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",fe),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",fe),document.removeEventListener("pointerup",ee,{capture:!0})}}},[w,T,D]),h.useEffect(()=>{const X=()=>T(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[T]);const[_,G]=QT(X=>{const fe=M().filter(ge=>!ge.disabled),ee=fe.find(ge=>ge.ref.current===document.activeElement),te=ZT(fe,X,ee);te&&setTimeout(()=>{var ge;return(ge=te.ref.current)==null?void 0:ge.focus()})}),z=h.useCallback((X,fe,ee)=>{const te=!V.current&&!ee;(b.value!==void 0&&b.value===fe||te)&&(N(X),te&&(V.current=!0))},[b.value]),R=h.useCallback(()=>w==null?void 0:w.focus(),[w]),q=h.useCallback((X,fe,ee)=>{const te=!V.current&&!ee;(b.value!==void 0&&b.value===fe||te)&&A(X)},[b.value]),Q=r==="popper"?Qm:FT,K=Q===Qm?{side:l,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:m,collisionPadding:p,sticky:g,hideWhenDetached:x,avoidCollisions:y}:{};return i.jsx(OT,{scope:n,content:w,viewport:S,onViewportChange:C,itemRefCallback:z,selectedItem:E,onItemLeave:R,itemTextRefCallback:q,focusSelectedItem:P,selectedItemText:k,position:r,isPositioned:L,searchRef:_,children:i.jsx(lc,{as:NB,allowPinchZoom:!0,children:i.jsx(sc,{asChild:!0,trapped:b.o
508pen,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:se(s,X=>{var fe;(fe=b.trigger)==null||fe.focus({preventScroll:!0}),X.preventDefault()}),children:i.jsx(la,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:i.jsx(Q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:X=>X.preventDefault(),...v,...K,onPlaced:()=>F(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:se(v.onKeyDown,X=>{const fe=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!fe&&X.key.length===1&&G(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let te=M().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(X.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const ge=X.target,oe=te.indexOf(ge);te=te.slice(oe+1)}setTimeout(()=>U(te)),X.preventDefault()}})})})})})})});LT.displayName=SB;var jB="SelectItemAlignedPosition",FT=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=pi(ii,n),o=gi(ii,n),[l,c]=h.useState(null),[u,f]=h.useState(null),d=Ae(t,I=>f(I)),m=nf(n),p=h.useRef(!1),g=h.useRef(!0),{viewport:x,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=o,w=h.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&x&&y&&v){const I=a.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),N=a.valueNode.getBoundingClientRect(),k=v.getBoundingClientRect();if(a.dir!=="rtl"){const ge=k.left-E.left,oe=N.left-ge,Ve=I.left-oe,$e=I.width+Ve,ze=Math.max($e,E.width),qe=window.innerWidth-tr,Oe=zl(oe,[tr,Math.max(tr,qe-ze)]);l.style.minWidth=$e+"px",l.style.left=Oe+"px"}else{const ge=E.right-k.right,oe=window.innerWidth-N.right-ge,Ve=window.innerWidth-I.right-oe,$e=I.width+Ve,ze=Math.max($e,E.width),qe=window.innerWidth-tr,Oe=zl(oe,[tr,Math.max(tr,qe-ze)]);l.style.minWidth=$e+"px",l.style.right=Oe+"px"}const A=m(),M=window.innerHeight-tr*2,L=x.scrollHeight,F=window.getComputedStyle(u),V=parseInt(F.borderTopWidth,10),U=parseInt(F.paddingTop,10),P=parseInt(F.borderBottomWidth,10),T=parseInt(F.paddingBottom,10),D=V+U+L+T+P,_=Math.min(y.offsetHeight*5,D),G=window.getComputedStyle(x),z=parseInt(G.paddingTop,10),R=parseInt(G.paddingBottom,10),q=I.top+I.height/2-tr,Q=M-q,K=y.offsetHeight/2,X=y.offsetTop+K,fe=V+U+X,ee=D-fe;if(fe<=q){const ge=A.length>0&&y===A[A.length-1].ref.current;l.style.bottom="0px";const oe=u.clientHeight-x.offsetTop-x.offsetHeight,Ve=Math.max(Q,K+(ge?R:0)+oe+P),$e=fe+Ve;l.style.height=$e+"px"}else{const ge=A.length>0&&y===A[0].ref.current;l.style.top="0px";const Ve=Math.max(q,V+x.offsetTop+(ge?z:0)+K)+ee;l.style.height=Ve+"px",x.scrollTop=fe-q+x.offsetTop}l.style.margin=`${tr}px 0`,l.style.minHeight=_+"px",l.style.maxHeight=M+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[m,a.trigger,a.valueNode,l,u,x,y,v,a.dir,r]);_t(()=>w(),[w]);const[j,S]=h.useState();_t(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const C=h.useCallback(I=>{I&&g.current===!0&&(w(),b==null||b(),g.current=!1)},[w,b]);return i.jsx(TB,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:i.jsx(pe.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});FT.displayName=jB;var CB="SelectPopperPosition",Qm=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=tr,...a}=e,o=rf(n);return i.jsx(Fd,{...o,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Qm.displayName=CB;var[TB,Ix]=ha(ii,{}),Zm="SelectViewport",VT=h.forwardRef((e,t)=>
508{const{__scopeSelect:n,nonce:r,...s}=e,a=gi(Zm,n),o=Ix(Zm,n),l=Ae(t,a.onViewportChange),c=h.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),i.jsx(tf.Slot,{scope:n,children:i.jsx(pe.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:se(s.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&d){const p=Math.abs(c.current-f.scrollTop);if(p>0){const g=window.innerHeight-tr*2,x=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),v=Math.max(x,y);if(v<g){const b=v+p,w=Math.min(g,b),j=b-w;d.style.height=w+"px",d.style.bottom==="0px"&&(f.scrollTop=j>0?j:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});VT.displayName=Zm;var $T="SelectGroup",[EB,_B]=ha($T),AB=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ot();return i.jsx(EB,{scope:n,id:s,children:i.jsx(pe.div,{role:"group","aria-labelledby":s,...r,ref:t})})});AB.displayName=$T;var zT="SelectLabel",Mx=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=_B(zT,n);return i.jsx(pe.div,{id:s.id,...r,ref:t})});Mx.displayName=zT;var Xu="SelectItem",[PB,UT]=ha(Xu),Dx=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...o}=e,l=pi(Xu,n),c=gi(Xu,n),u=l.value===r,[f,d]=h.useState(a??""),[m,p]=h.useState(!1),g=Ae(t,b=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,b,r,s)}),x=Ot(),y=h.useRef("touch"),v=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};return i.jsx(PB,{scope:n,value:r,disabled:s,textId:x,isSelected:u,onItemTextChange:h.useCallback(b=>{d(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:i.jsx(tf.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:i.jsx(pe.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:g,onFocus:se(o.onFocus,()=>p(!0)),onBlur:se(o.onBlur,()=>p(!1)),onClick:se(o.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:se(o.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:se(o.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:se(o.onPointerMove,b=>{var w;y.current=b.pointerType,s?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:se(o.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:se(o.onKeyDown,b=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&b.key===" "||(mB.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});Dx.displayName=Xu;var al="SelectItemText",BT=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,o=pi(al,n),l=gi(al,n),c=UT(al,n),u=yB(al,n),[f,d]=h.useState(null),m=Ae(t,v=>d(v),c.onItemTextChange,v=>{var b;return(b=l.itemTextRefCallback)==null?void 0:b.call(l,v,c.value,c.disabled)}),p=f==null?void 0:f.textContent,g=h.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:x,onNativeOptionRemove:y}=u;return _t(()=>(x(g),()=>y(g)),[x,y,g]),i.jsxs(i.Fragment,{children:[i.jsx(pe.span,{id:c.textId,...a,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!sf(o.value)?sa.createPortal(a.children,o.valueNode):null]})});BT.displayName=al;var HT="SelectItemIndicator",WT=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return UT(HT,n).isSelected?i.jsx(pe.span,{"aria-hidden":!0,...r,ref:t}):null});WT.displayName=HT;var Xm="SelectScrollUpButton",Ox=h.forwardRef((e,t)=>{const n=gi(Xm,e.__scopeSelect),r=Ix(Xm,e.__scopeSelect),[s,a]=h.useState(!1),o=Ae(t,r.onScrollButtonChange);return _t(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(qT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ox.displayName=Xm;var Jm="SelectScrollDownButton",Lx=h.forwardRef((e,t)=>
508{const n=gi(Jm,e.__scopeSelect),r=Ix(Jm,e.__scopeSelect),[s,a]=h.useState(!1),o=Ae(t,r.onScrollButtonChange);return _t(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;a(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(qT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Lx.displayName=Jm;var qT=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=gi("SelectScrollButton",n),o=h.useRef(null),l=nf(n),c=h.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),_t(()=>{var f;const u=l().find(d=>d.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[l]),i.jsx(pe.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:se(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:se(s.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:se(s.onPointerLeave,()=>{c()})})}),RB="SelectSeparator",Fx=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(pe.div,{"aria-hidden":!0,...r,ref:t})});Fx.displayName=RB;var GT="SelectArrow",IB=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=rf(n);return gi(GT,n).position==="popper"?i.jsx(Vd,{...s,...r,ref:t}):null});IB.displayName=GT;var YT="SelectBubbleInput",KT=h.forwardRef(({__scopeSelect:e,...t},n)=>{const r=pi(YT,e),{value:s,onValueChange:a,required:o,disabled:l,name:c,autoComplete:u,form:f}=r,{nativeOptions:d,nativeSelectKey:m}=r,p=h.useRef(null),g=Ae(n,p),x=s??"",y=Ex(x),v=Array.from(d).some(b=>(b.props.value??"")==="");return h.useEffect(()=>{const b=p.current;if(!b)return;const w=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(w,"value").set;if(y!==x&&S){const C=new Event("change",{bubbles:!0});S.call(b,x),b.dispatchEvent(C)}},[y,x]),i.jsxs(pe.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:u,disabled:l,form:f,onChange:b=>a(b.target.value),...t,style:{...CT,...t.style},ref:g,defaultValue:x,children:[sf(s)&&!v?i.jsx("option",{value:""}):null,Array.from(d)]},m)});KT.displayName=YT;function MB(e){return typeof e=="function"}function sf(e){return e===""||e===void 0}function QT(e){const t=Et(e),n=h.useRef(""),r=h.useRef(0),s=h.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function ZT(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=DB(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function DB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const ai=ET,oi=PT,ys=h.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(Px,{ref:r,className:W("flex h-12 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(RT,{asChild:!0,children:i.jsx(di,{className:"h-4 w-4 opacity-50"})})]}));ys.displayName=Px.displayName;const XT=h.forwardRef(({className:e,...t},n)=>i.jsx(Ox,{ref:n,className:W("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(gD,{className:"h-4 w-4"})}));XT.displayName=Ox.displayName;const JT=h.forwardRef(({className:e,...t},n)=>i.jsx(Lx,{ref:n,className:W("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(di,{className:"h-4 w-4"})}));JT.displayName=Lx.displayName;const vs=h.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(MT,{children:i.jsxs(Rx,{ref:s,className:W("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
508de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(XT,{}),i.jsx(VT,{className:W("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(JT,{})]})}));vs.displayName=Rx.displayName;const OB=h.forwardRef(({className:e,...t},n)=>i.jsx(Mx,{ref:n,className:W("py-3 pl-8 pr-2 text-base font-semibold",e),...t}));OB.displayName=Mx.displayName;const Kt=h.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(Dx,{ref:r,className:W("relative flex w-full cursor-default select-none items-center rounded-sm py-3 pl-8 pr-2 text-base outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(WT,{children:i.jsx(ot,{className:"h-4 w-4"})})}),i.jsx(BT,{children:t})]}));Kt.displayName=Dx.displayName;const LB=h.forwardRef(({className:e,...t},n)=>i.jsx(Fx,{ref:n,className:W("-mx-1 my-1 h-px bg-muted",e),...t}));LB.displayName=Fx.displayName;var[af]=zt("Tooltip",[fi]),of=fi(),eE="TooltipProvider",FB=700,ep="tooltip.open",[VB,Vx]=af(eE),tE=e=>{const{__scopeTooltip:t,delayDuration:n=FB,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,o=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),i.jsx(VB,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:a})};tE.displayName=eE;var Ul="Tooltip",[$B,xc]=af(Ul),nE=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=Vx(Ul,e.__scopeTooltip),u=of(t),[f,d]=h.useState(null),m=Ot(),p=h.useRef(0),g=o??c.disableHoverableContent,x=l??c.delayDuration,y=h.useRef(!1),[v,b]=jn({prop:r,defaultProp:s??!1,onChange:I=>{I?(c.onOpen(),document.dispatchEvent(new CustomEvent(ep))):c.onClose(),a==null||a(I)},caller:Ul}),w=h.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),j=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),S=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),C=h.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},x)},[x,b]);return h.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),i.jsx(Ld,{...u,children:i.jsx($B,{scope:t,contentId:m,open:v,stateAttribute:w,trigger:f,onTriggerChange:d,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?C():j()},[c.isOpenDelayedRef,C,j]),onTriggerLeave:h.useCallback(()=>{g?S():(window.clearTimeout(p.current),p.current=0)},[S,g]),onOpen:j,onClose:S,disableHoverableContent:g,children:n})})};nE.displayName=Ul;var tp="TooltipTrigger",rE=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=xc(tp,n),a=Vx(tp,n),o=of(n),l=h.useRef(null),c=Ae(t,l,s.onTriggerChange),u=h.useRef(!1),f=h.useRef(!1),d=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),i.jsx(ac,{asChild:!0,...o,children:i.jsx(pe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:se(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:se(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:se(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:se(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:se(e.onBlur,s.onClose),onClick:se(e.onClick,s.onClose)})})});rE.displayName=tp;var $x="TooltipPortal",[zB,UB]=af($x,{forceMount:void 0}),sE=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=xc($x,t);return i.jsx(zB,{scope:t,forceMount:n,children:i.jsx(Lt,{present:n||a.open,children:i.jsx(ca,{asChild:!0,container:s,children:r})})})};sE.displayName=$x;var fo="TooltipContent",iE=h.forwardRef((e,t)=>
508{const n=UB(fo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,o=xc(fo,e.__scopeTooltip);return i.jsx(Lt,{present:r||o.open,children:o.disableHoverableContent?i.jsx(aE,{side:s,...a,ref:t}):i.jsx(BB,{side:s,...a,ref:t})})}),BB=h.forwardRef((e,t)=>{const n=xc(fo,e.__scopeTooltip),r=Vx(fo,e.__scopeTooltip),s=h.useRef(null),a=Ae(t,s),[o,l]=h.useState(null),{trigger:c,onClose:u}=n,f=s.current,{onPointerInTransitChange:d}=r,m=h.useCallback(()=>{l(null),d(!1)},[d]),p=h.useCallback((g,x)=>{const y=g.currentTarget,v={x:g.clientX,y:g.clientY},b=YB(v,y.getBoundingClientRect()),w=KB(v,b),j=QB(x.getBoundingClientRect()),S=XB([...w,...j]);l(S),d(!0)},[d]);return h.useEffect(()=>()=>m(),[m]),h.useEffect(()=>{if(c&&f){const g=y=>p(y,f),x=y=>p(y,c);return c.addEventListener("pointerleave",g),f.addEventListener("pointerleave",x),()=>{c.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",x)}}},[c,f,p,m]),h.useEffect(()=>{if(o){const g=x=>{const y=x.target,v={x:x.clientX,y:x.clientY},b=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),w=!ZB(v,o);b?m():w&&(m(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,f,o,u,m]),i.jsx(aE,{...e,ref:a})}),[HB,WB]=af(Ul,{isInside:!1}),qB=SM("TooltipContent"),aE=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=xc(fo,n),u=of(n),{onClose:f}=c;return h.useEffect(()=>(document.addEventListener(ep,f),()=>document.removeEventListener(ep,f)),[f]),h.useEffect(()=>{if(c.trigger){const d=m=>{m.target instanceof Node&&m.target.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),i.jsx(la,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:i.jsxs(Fd,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(qB,{children:r}),i.jsx(HB,{scope:n,isInside:!0,children:i.jsx(fB,{id:c.contentId,role:"tooltip",children:s||r})})]})})});iE.displayName=fo;var oE="TooltipArrow",GB=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=of(n);return WB(oE,n).isInside?null:i.jsx(Vd,{...s,...r,ref:t})});GB.displayName=oE;function YB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function KB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function QB(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function ZB(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,f=l.y,d=c.x,m=c.y;f>r!=m>r&&n<(d-u)*(r-f)/(m-f)+u&&(s=!s)}return s}function XB(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),JB(t)}function JB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var e9=tE,t9=nE,n9=rE,r9=sE,lE=iE;
508const zx=e9,s9=t9,i9=n9,cE=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(r9,{children:i.jsx(lE,{ref:r,sideOffset:t,className:W("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));cE.displayName=lE.displayName;var lf="Dialog",[uE,dE]=zt(lf),[a9,pr]=uE(lf),yc=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=h.useRef(null),c=h.useRef(null),[u,f]=jn({prop:r,defaultProp:s??!1,onChange:a,caller:lf});return i.jsx(a9,{scope:t,triggerRef:l,contentRef:c,contentId:Ot(),titleId:Ot(),descriptionId:Ot(),open:u,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(d=>!d),[f]),modal:o,children:n})};yc.displayName=lf;var fE="DialogTrigger",cf=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pr(fE,n),a=Ae(t,s.triggerRef);return i.jsx(pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Bx(s.open),...r,ref:a,onClick:se(e.onClick,s.onOpenToggle)})});cf.displayName=fE;var Ux="DialogPortal",[o9,hE]=uE(Ux,{forceMount:void 0}),vc=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=pr(Ux,t);return i.jsx(o9,{scope:t,forceMount:n,children:h.Children.map(r,o=>i.jsx(Lt,{present:n||a.open,children:i.jsx(ca,{asChild:!0,container:s,children:o})}))})};vc.displayName=Ux;var Ju="DialogOverlay",ma=h.forwardRef((e,t)=>{const n=hE(Ju,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=pr(Ju,e.__scopeDialog);return a.modal?i.jsx(Lt,{present:r||a.open,children:i.jsx(c9,{...s,ref:t})}):null});ma.displayName=Ju;var l9=ti("DialogOverlay.RemoveScroll"),c9=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pr(Ju,n),a=oO(),o=Ae(t,a);return i.jsx(lc,{as:l9,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(pe.div,{"data-state":Bx(s.open),...r,ref:o,style:{pointerEvents:"auto",...r.style}})})}),ho="DialogContent",pa=h.forwardRef((e,t)=>{const n=hE(ho,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=pr(ho,e.__scopeDialog);return i.jsx(Lt,{present:r||a.open,children:a.modal?i.jsx(u9,{...s,ref:t}):i.jsx(d9,{...s,ref:t})})});pa.displayName=ho;var u9=h.forwardRef((e,t)=>{const n=pr(ho,e.__scopeDialog),r=h.useRef(null),s=Ae(t,n.contentRef,r);return h.useEffect(()=>{const a=r.current;if(a)return zd(a)},[]),i.jsx(mE,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:se(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:se(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:se(e.onFocusOutside,a=>a.preventDefault())})}),d9=h.forwardRef((e,t)=>{const n=pr(ho,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return i.jsx(mE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),mE=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=pr(ho,n);return Rd(),i.jsx(i.Fragment,{children:i.jsx(sc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(la,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Bx(l.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),pE="DialogTitle",Ao=h.forwardRef((e,t)=>
508{const{__scopeDialog:n,...r}=e,s=pr(pE,n);return i.jsx(pe.h2,{id:s.titleId,...r,ref:t})});Ao.displayName=pE;var gE="DialogDescription",Po=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pr(gE,n);return i.jsx(pe.p,{id:s.descriptionId,...r,ref:t})});Po.displayName=gE;var xE="DialogClose",bc=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=pr(xE,n);return i.jsx(pe.button,{type:"button",...r,ref:t,onClick:se(e.onClick,()=>s.onOpenChange(!1))})});bc.displayName=xE;function Bx(e){return e?"open":"closed"}const $r=yc,Zie=cf,f9=vc,yE=h.forwardRef(({className:e,...t},n)=>i.jsx(ma,{ref:n,className:W("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));yE.displayName=ma.displayName;const ur=h.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(f9,{children:[i.jsx(yE,{}),i.jsxs(pa,{ref:r,className:W("fixed inset-x-0 bottom-0 z-50 flex w-full flex-col border-t bg-background p-6 shadow-lg gap-4","rounded-t-2xl max-h-[90vh] overflow-y-auto","safe-area-bottom","duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom","sm:inset-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%]","sm:max-w-lg sm:rounded-lg sm:border sm:max-h-[85vh]","sm:data-[state=closed]:slide-out-to-left-1/2 sm:data-[state=closed]:slide-out-to-top-[48%]","sm:data-[state=open]:slide-in-from-left-1/2 sm:data-[state=open]:slide-in-from-top-[48%]","sm:data-[state=closed]:zoom-out-95 sm:data-[state=open]:zoom-in-95",e),...n,children:[i.jsx("div",{className:"sm:hidden flex justify-center -mt-2 mb-2",children:i.jsx("div",{className:"w-10 h-1 rounded-full bg-gray-300 dark:bg-gray-600"})}
508),t,i.jsxs(bc,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[i.jsx($t,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ur.displayName=pa.displayName;const dr=({className:e,...t})=>i.jsx("div",{className:W("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});dr.displayName="DialogHeader";const Bl=({className:e,...t})=>i.jsx("div",{className:W("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Bl.displayName="DialogFooter";const fr=h.forwardRef(({className:e,...t},n)=>i.jsx(Ao,{ref:n,className:W("text-lg font-semibold leading-none tracking-tight",e),...t}));fr.displayName=Ao.displayName;const li=h.forwardRef(({className:e,...t},n)=>i.jsx(Po,{ref:n,className:W("text-sm text-muted-foreground",e),...t}));li.displayName=Po.displayName;const H0=[{path:"/dashboard",label:"Dashboard",icon:Ad},{path:"/activity-ledger",label:"Activity",icon:wS},{path:"/properties",label:"Properties",icon:ia},{path:"/files",label:"Files",icon:$n}];function np({offline:e=!1,isAuthChecking:t=!1}){const[n,r]=pt(),{selection:s}=YC(),{openDialog:a}=Jk(),o=f=>{s(),r(f),xs(f)},l=()=>{s(),a()},c=Le()||typeof window<"u"&&window.innerWidth<768,u=tc();return c?i.jsxs("nav",{className:W("fixed bottom-0 left-0 right-0 z-50","glass-bar bg-white/90 dark:bg-gray-950/90","border-t border-gray-200/50 dark:border-gray-800/50",!u&&"safe-area-bottom"),style:u?{paddingBottom:"max(env(safe-area-inset-bottom), 6px)"}:void 0,role:"navigation","aria-label":"Main navigation",children:[t&&i.jsxs("div",{className:"w-full bg-primary/10 dark:bg-primary/20 py-1 flex items-center justify-center gap-1.5",children:[i.jsx(Xe,{className:"w-3 h-3 animate-spin text-primary"}),i.jsx("span",{className:"text-[10px] text-primary font-medium",children:"Verifying..."})]}),i.jsxs("div",{className:W("flex items-center justify-around px-2",u?"h-[58px]":"h-16"),children:[H0.slice(0,2).map(f=>{const d=f.icon,m=n===f.path||n.startsWith(f.path+"/");return i.jsxs(qt.button,{onClick:()=>o(f.path),className:W("flex h-full flex-1 flex-col items-center justify-center",u&&"relative pb-1","touch-target touch-manipulation","transition-colors duration-150",m?"text-primary":"text-gray-500 dark:text-gray-400"),whileTap:{scale:.9},transition:{type:"spring",stiffness:400,damping:17},"aria-current":m?"page":void 0,"aria-label":f.label,children:[i.jsx(qt.div,{initial:!1,animate:{scale:m?1.1:1,y:m?-2:0},transition:{type:"spring",stiffness:300,damping:20},children:i.jsx(d,{className:W("w-6 h-6 transition-all duration-150",m&&"stroke-[2.5]")})}),i.jsx("span",{className:W("text-[10px] mt-1 font-medium transition-all duration-150",m?"opacity-100":"opacity-70"),children:f.label}),m&&i.jsx(qt.div,{layoutId:"bottomNavIndicator",className:W("absolute h-1 w-1 rounded-full bg-primary",u?"bottom-1.5":"bottom-1"),transition:{type:"spring",stiffness:300,damping:30}})]},f.path)}),i.jsx(qt.button,{onClick:l,className:W("relative flex h-full flex-1 flex-col items-center justify-center","touch-target touch-manipulation","transition-colors duration-150","text-primary"),whileTap:{scale:.9},transition:{type:"spring",stiffness:400,damping:17},"aria-label":"Create new time entry",children:i.jsx(qt.div,{initial:!1,animate:{scale:1},transition:{type:"spring",stiffness:300,damping:20},className:W("absolute -top-3",u?"h-14 w-14 rounded-full":"w-16 h-16 rounded-full","bg-primary","shadow-lg","flex items-center justify-center","border-4 border-white dark:border-gray-950"),children:i.jsx(io,{className:"w-6 h-6 text-white",strokeWidth:2.5})})}),H0.slice(2).map(f=>{const d=f.icon,m=n===f.path||n.startsWith(f.path+"/");return i.jsxs(qt.button,{onClick:()=>o(f.path),className:W("flex h-full flex-1 flex-col items-center justify-center",u&&"relative pb-1","touch-target touch-manipulation","transition-colors duration-150",m?"text-primary":"text-gray-500 dark:text-gray-400"),whileTap:{scale:.9},transition:{type:"spring",stiffness:400,damping:17},"aria-current":m?"page":void 0,"aria-label":f.label,children:[i.jsx(qt.div,{initial:!1,animate:{scale:m?1.1:1,y:m?-2:0},transition:{type:"spring",stiffness:300,damping:20},children:i.jsx(d,{className:W("w-6 h-6 transition-all duration-150",m&&"stroke-[2.5]")})}),i.jsx("span",{className:W("text-[10px] mt-1 font-medium transition-all duration-150",m?"opacity-100":"opacity-70"),children:f.label}),m&&i.jsx(qt.div,{layoutId:"bottomNavIndicator",className:W("absolute h-1 w-1 rounded-full bg-primary",u?"bottom-1.5":"bottom-1"),transition:{type:"spring",stiffness:300,damping:30}})]},f.path)})]})]}):null}function h9({title:e,showBack:t,onBack:n,rightAction:r,className:s,forceShow:a=!1,transparent:o=!1}){pt();const{scrollY:l}=Q$(),[c,u]=h.useState(!1),[f,d]=h.useState(!1),[m,p]=h.useState(0);return k$(l,"change",g=>{if(a)return;const x=g;u(x>10),x>50&&x>m?d(!0):d(!1),p(x)}),h.useEffect(()=>{a&&(u(!0),d(!1))},[a]),i.jsx(qt.header,{className:W("fixed top-0 left-0 right-0 z-50 h-[60px]","flex items-center justify-between px-4 safe-area-top","transition-all duration-300 ease-in-out",o?"bg-transparent pointer-events-none":c||a?"glass-bar bg-white/80 dark:bg-gray-900/80 pointer-events-auto":"bg-transparent pointer-events-none",s,!mi()&&"hidden"),initial:{y:0},animate:{y:f&&!a?"-100%":0},transition:{duration:.3,ease:"easeInOut"},children:i.jsxs("div",{className:"flex items-center h-full w-full",children:[i.jsx("div",{className:"w-10 flex-shrink-0 pointer-events-auto",children:t&&i.jsx(Z,{variant:"ghost",size:"icon",className:"h-10 w-10 -ml-2 roun
508ded-full active-scale",onClick:()=>n?n():window.history.back(),"aria-label":"Go back",children:i.jsx(aa,{className:"w-6 h-6"})})}),i.jsx("div",{className:"flex-1 flex justify-center items-center overflow-hidden",children:i.jsx(qt.h1,{className:"text-[17px] font-semibold tracking-tight truncate font-system my-0 leading-none",animate:{opacity:c||a?1:0,y:c||a?0:5},children:e})}),i.jsx("div",{className:"w-10 flex justify-end flex-shrink-0 pointer-events-auto",children:r})]})})}let Ho=0,ph="";function m9({open:e,onOpenChange:t,children:n,title:r,showHandle:s=!0,swipeToDismiss:a=!0,handleDragToDismiss:o=!1,className:l,headerClassName:c,handleClassName:u,titleClassName:f,headerActions:d,centerTitle:m=!1}){const p=J$(),g=a||o;h.useEffect(()=>{if(e)return Ho===0&&(ph=document.body.style.overflow,document.body.style.overflow="hidden"),Ho+=1,()=>{Ho=Math.max(0,Ho-1),Ho===0&&(document.body.style.overflow=ph,ph="")}},[e]);const x=(y,v)=>{g&&(v.offset.y>72||v.velocity.y>520)&&t(!1)};return i.jsx(hj,{children:e&&i.jsxs(i.Fragment,{children:[i.jsx(qt.div,{initial:{opacity:0}
508,animate:{opacity:1},exit:{opacity:0},onClick:()=>t(!1),className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-sm [overscroll-behavior:contain]"}),i.jsxs(qt.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:35,stiffness:400,mass:.8},drag:g?"y":!1,dragListener:a,dragControls:p,dragConstraints:{top:0,bottom:140},dragElastic:.08,onDragEnd:x,className:W("fixed inset-x-0 bottom-0 z-[101]","bg-white dark:bg-gray-900","rounded-t-[32px] shadow-2xl","max-h-[90vh] overflow-hidden","flex flex-col","safe-area-bottom",l),children:[s&&i.jsx("button",{type:"button","aria-label":"Drag down to close",className:W("relative z-10 flex touch-none cursor-grab justify-center pt-3 pb-2 active:cursor-grabbing",u),onPointerDown:y=>{o&&!a&&p.start(y.nativeEvent)},children:i.jsx("div",{className:"w-10 h-1 rounded-full bg-gray-300 dark:bg-gray-600"})}),r&&i.jsxs("div",{className:W("relative z-10 border-b border-gray-200 dark:border-gray-700",m?"grid h-[72px] grid-cols-[2.75rem_minmax(0,auto)_2.75rem] items-center px-5 py-0":"flex items-center justify-between px-4 py-3",c),children:[m&&i.jsx("div",{"aria-hidden":"true",className:"h-10 w-10"}),m?i.jsx("div",{className:W("flex h-10 min-w-0 items-center justify-center justify-self-center text-lg font-semibold leading-none text-gray-900 dark:text-white",f),children:r}):i.jsx("h2",{className:W("text-lg font-semibold text-gray-900 dark:text-white",f),children:r}),i.jsxs("div",{className:W("flex items-center gap-1",m&&"h-10 w-10 justify-self-end"),children:[d,i.jsx(qt.button,{onClick:()=>t(!1),className:W("flex items-center justify-center",m?"h-10 w-10 rounded-full":"w-8 h-8 rounded-full","bg-transparent","text-gray-500 dark:text-gray-400","hover:bg-gray-100/70 dark:hover:bg-gray-800/70","transition-colors"),whileTap:{scale:.9},"aria-label":"Close",children:i.jsx($t,{className:"w-5 h-5"})})]})]}),i.jsx("div",{className:"relative z-10 flex flex-col overflow-y-auto scrollbar-hide flex-1",style:{touchAction:"pan-y"},children:n})]})]})})}const dt=h.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:W("flex w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","h-12 sm:h-10","text-base sm:text-sm","rounded-xl sm:rounded-md","touch-manipulation",e),ref:r,...n}));dt.displayName="Input";var p9="Label",vE=h.forwardRef((e,t)=>i.jsx(pe.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));vE.displayName=p9;var bE=vE;const g9=So("text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ge=h.forwardRef(({className:e,...t},n)=>i.jsx(bE,{ref:n,className:W(g9(),e),...t}));Ge.displayName=bE.displayName;const Hr=h.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:W("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-3 ring-offset-background","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","text-base","rounded-xl sm:rounded-md","touch-manipulation","resize-none sm:resize-y",e),ref:n,...t}));Hr.displayName="Textarea";function Hx({value:e,onChange:t,label:n="Hours",required:r=!1,className:s="",disabled:a=!1,readOnly:o=!1,placeholder:l="0.0167",showQuickButtons:c=!0,showConversion:u=!0,suggestedHours:f,onBlur:d,onKeyDown:m,autoFocus:p}){const[g,x]=h.useState("0"),[y,v]=h.useState("0"),b=C=>{const I=parseFloat(C)||0,E=Math.floor(I),N=Math.round((I-E)*60);return{hours:E.toString(),minutes:N.toString()}},w=(C,I)=>{const E=parseInt(C)||0,N=parseInt(I)||0;return(E+N/60).toFixed(3)};h.useEffect(()=>{if(e){const{hours:C,minutes:I}=b(e);x(C),v(I)}},[e]);const j=(C,I)=>{x(C),v(I);const E=w(C,I);t(E)},S=C=>{setTimeout(()=>{var A,M;const I=document.activeElement,E=(M=(A=C.currentTarget)==null?void 0:A.closest)==null?void 0:M.call(A,".space-y-3"),N=E&&E.contains(I),k=(I==null?void 0:I.type)==="number"&&((I==null?void 0:I.placeholder)==="0"||(I==null?void 0:I.min)==="0");!N&&!k&&(d==null||d())},200)};return i.jsxs("div",{className:`space-y-3 ${s}`,children:[n&&i.jsxs(Ge,{className:"flex items-center gap-2 text-sm",children:[i.jsx(yS,{className:"h-4 w-4"}),n,r&&i.jsx("span",{className:"text-red-500",children:"*"}),f&&i.jsxs(Mr,{variant:"outline",className:"text-xs",children:["Suggested: ",f]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"min-w-[70px]",children:[i.jsx(dt,{type:"number",min:"0",max:"23",placeholder:"0",value:g,onChange:C=>j(C.target.value,y),disabled:a,readOnly:o,className:"font-mono text-center",onBlur:S,onKeyDown:m,autoFocus:p}),i.jsx("div",{className:"text-xs text-muted-foreground text-center mt-1",children:"Hours"})]}),i.jsx("div",{className:"text-muted-foreground font-bold text-lg",children:":"}),i.jsxs("div",{className:"min-w-[70px]",children:[i.jsx(dt,{type:"number",min:"0",max:"59",placeholder:"0",value:y,onChange:C=>j(g,C.target.value),disabled:a,readOnly:o,className:"font-mono text-center",onBlur:S,onKeyDown:m}),i.jsx("div",{className:"text-xs text-muted-foreground text-center mt-1",children:"Minutes"})]}),u&&i.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[i.jsx(ls,{className:"h-4 w-4"}),i.jsxs("span",{className:"font-mono",children:[w(g,y)," hrs"]})]})]}),e&&i.jsxs("div",{className:"text-xs text-gray-500",children:[parseFloat(e)<.0167&&i.jsx("span",{className:"text-amber-600",children:"⚠️ Minimum is 1 minute (0.0167 hours)"}),parseFloat(e)>24&&i.jsx("span",{className:"text-red-600",children:"⚠️ Maximum is 24 hours per entry"})]})]})}
508const x9="https://repsshield.com",Js=[{value:"approving-new-tenants",label:"Approving new tenants",duration:"1-2 hours",defaultHours:1.5},{value:"reviewing-tenant-applications",label:"Reviewing tenant applications",duration:"0.5-1 hour",defaultHours:.75},{value:"responding-to-tenant-inquiries",label:"Responding to tenant inquiries",duration:"0.25-0.5 hour",defaultHours:.25},{value:"handling-tenant-complaints",label:"Handling tenant complaints",duration:"0.5-2 hours",defaultHours:1},{value:"handling-tenant-evictions",label:"Handling tenant evictions",duration:"2-4 hours",defaultHours:3},{value:"conducting-tenant-move-in-inspections",label:"Conducting tenant move-in inspections",duration:"1-2 hours",defaultHours:1.5},{value:"conducting-tenant-move-out-inspections",label:"Conducting tenant move-out inspections",duration:"1-2 hours",defaultHours:1.5},{value:"performing-routine-maintenance",label:"Performing routine maintenance",duration:"1-4 hours",defaultHours:2.5},{value:"overseeing-major-repairs",label:"Overseeing major repairs",duration:"2-6 hours",defaultHours:4},{value:"inspecting-properties-for-maintenance-needs",label:"Inspecting properties for maintenance needs",duration:"1-3 hours",defaultHours:2},{value:"arranging-contractors-for-repairs",label:"Arranging contractors for repairs",duration:"0.5-2 hours",defaultHours:1},{value:"collecting-rent-payments",label:"Collecting rent payments",duration:"0.5-1 hour",defaultHours:.75},{value:"preparing-financial-statements",label:"Preparing financial statements",duration:"2-4 hours",defaultHours:3},{value:"reviewing-property-budgets",label:"Reviewing property budgets",duration:"1-2 hours",defaultHours:1.5},{value:"property-visits-for-inspections",label:"Property visits for inspections",duration:"1-3 hours",defaultHours:2},{value:"tenant-communication-phone-calls",label:"Tenant communication phone calls",duration:"0.25-1 hour",defaultHours:.5},{value:"tenant-communication-emails",label:"Tenant communication emails",duration:"0.25-0.5 hour",defaultHours:.25},{value:"marketing-vacant-properties",label:"Marketing vacant properties",duration:"1-3 hours",defaultHours:2},{value:"showing-properties-to-prospects",label:"Showing properties to prospects",duration:"1-2 hours",defaultHours:1.5},{value:"real-estate-education-seminars",label:"Real estate education seminars",duration:"2-8 hours",defaultHours:4},{value:"rental-property-research",label:"Rental property research",duration:"1-4 hours",defaultHours:2.5},{value:"tenant-screening-background-checks",label:"Tenant screening background checks",duration:"0.5-1 hour",defaultHours:.75},{value:"property-management-software-updates",label:"Property management software updates",duration:"0.5-2 hours",defaultHours:1},{value:"insurance-claim-processing",label:"Insurance claim processing",duration:"1-3 hours",defaultHours:2},{value:"legal-consultation-meetings",label:"Legal consultation meetings",duration:"1-2 hours",defaultHours:1.5},{value:"tax-preparation-property-related",label:"Tax preparation property related",duration:"2-6 hours",defaultHours:4},{value:"property-acquisition-analysis",label:"Property acquisition analysis",duration:"2-8 hours",defaultHours:5},{value:"rental-market-analysis",label:"Rental market analysis",duration:"1-4 hours",defaultHours:2.5},{value:"property-photography-listing",label:"Property photography listing",duration:"1-2 hours",defaultHours:1.5},{value:"lease-agreement-preparation",label:"Lease agreement preparation",duration:"0.5-1 hour",defaultHours:.75}],Xie=[{id:1,state:"false",name:"Qualified Non-Material"},{id:2,state:"true",name:"Material Participation Activity"}];function y9(e){const t=Js.find(n=>n.value===e);return t||{value:e,label:e.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase()),duration:"1-2 hours",defaultHours:1.5}}const W0={TOTAL_HOURS:750,MATERIAL_PARTICIPATION_HOURS:100},Jie={"approving-new-tenants":{autoEnable:!1,riskLevel:"moderate",explanation:"Tenant approval typically involves administrative tasks that may not qualify as material participation."},"reviewing-tenant-applications":{autoEnable:!1,riskLevel:"moderate",explanation:"Application review is often administrative and may not qualify for material participation."},"responding-to-tenant-inquiries":{autoEnable:!1,riskLevel:"low",explanation:"Routine inquiries can qualify as material participation if they involve property management decisions."},"handling-tenant-complaints":{autoEnable:!0,riskLevel:"low",explanation:"Resolving tenant complaints typically qualifies as material participation as it involves active property management."},"conducting-tenant-move-in-inspections":{autoEnable:!0,riskLevel:"low",explanation:"Physical property inspections clearly qualify as material participation."},"conducting-tenant-move-out-inspections":{autoEnable:!0,riskLevel:"low",explanation:"Physical property inspections clearly qualify as material participation."},"performing-routine-maintenance":{autoEnable:!0,riskLevel:"low",explanation:"Hands-on maintenance work clearly qualifies as material participation."},"overseeing-major-repairs":{autoEnable:!0,riskLevel:"low",explanation:"Supervising repairs involves active property management and qualifies as material participation."},"property-visits-for-inspections":{autoEnable:!0,riskLevel:"low",explanation:"Physical property visits for inspections clearly qualify as material participation."},"showing-properties-to-prospects":{autoEnable:!0,riskLevel:"low",explanation:"Property showings involve active participation in rental activities."},"marketing-vacant-properties":{autoEnable:!0,riskLevel:"moderate",explanation:"Marketing activities may qualify if they involve substantial management decisions."}};function eae(e,t,n){const r=W0.TOTAL_HOURS,s=n==="shortTerm"?W0.MATERIAL_PARTICIPATION_HOURS:0,a=e/r*100,o=n==="shortTerm"?t/s*100:100,l=Math.min(a,o);return l>=90?{level:"low",color:"green"}:l>=70?{level:"moderate",color:"yellow"}:{level:"high",color:"red"}}
508var q0=1,v9=.9,b9=.8,w9=.17,gh=.1,xh=.999,k9=.9999,S9=.99,N9=/[\\\/_+.#"@\[\(\{&]/,j9=/[\\\/_+.#"@\[\(\{&]/g,C9=/[\s-]/,wE=/[\s-]/g;function rp(e,t,n,r,s,a,o){if(a===t.length)return s===e.length?q0:S9;var l=`${s},${a}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(a),u=n.indexOf(c,s),f=0,d,m,p,g;u>=0;)d=rp(e,t,n,r,u+1,a+1,o),d>f&&(u===s?d*=q0:N9.test(e.charAt(u-1))?(d*=b9,p=e.slice(s,u-1).match(j9),p&&s>0&&(d*=Math.pow(xh,p.length))):C9.test(e.charAt(u-1))?(d*=v9,g=e.slice(s,u-1).match(wE),g&&s>0&&(d*=Math.pow(xh,g.length))):(d*=w9,s>0&&(d*=Math.pow(xh,u-s))),e.charAt(u)!==t.charAt(a)&&(d*=k9)),(d<gh&&n.charAt(u-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(u-1)!==r.charAt(a))&&(m=rp(e,t,n,r,u+1,a+2,o),m*gh>d&&(d=m*gh)),d>f&&(f=d),u=n.indexOf(c,u+1);return o[l]=f,f}function G0(e){return e.toLowerCase().replace(wE," ")}function T9(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,rp(e,t,G0(e),G0(t),0,0,{})}var Wo='[cmdk-group=""]',yh='[cmdk-group-items=""]',E9='[cmdk-group-heading=""]',kE='[cmdk-item=""]',Y0=`${kE}:not([aria-disabled="true"])`,sp="cmdk-item-select",Ta="data-value",_9=(e,t,n)=>T9(e,t,n),SE=h.createContext(void 0),wc=()=>h.useContext(SE),NE=h.createContext(void 0),Wx=()=>h.useContext(NE),jE=h.createContext(void 0),CE=h.forwardRef((e,t)=>{let n=Ea(()=>{var z,R;return{search:"",value:(R=(z=e.value)!=null?z:e.defaultValue)!=null?R:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ea(()=>new Set),s=Ea(()=>new Map),a=Ea(()=>new Map),o=Ea(()=>new Set),l=TE(e),{label:c,children:u,value:f,onValueChange:d,filter:m,shouldFilter:p,loop:g,disablePointerSelection:x=!1,vimBindings:y=!0,...v}=e,b=Ot(),w=Ot(),j=Ot(),S=h.useRef(null),C=$9();Xi(()=>{if(f!==void 0){let z=f.trim();n.current.value=z,I.emit()}},[f]),Xi(()=>{C(6,L)},[]);let I=h.useMemo(()=>({subscribe:z=>(o.current.add(z),()=>o.current.delete(z)),snapshot:()=>n.current,setState:(z,R,q)=>{var Q,K,X,fe;if(!Object.is(n.current[z],R)){if(n.current[z]=R,z==="search")M(),k(),C(1,A);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(j);ee?ee.focus():(Q=document.getElementById(b))==null||Q.focus()}if(C(7,()=>{var ee;n.current.selectedItemId=(ee=F())==null?void 0:ee.id,I.emit()}),q||C(5,L),((K=l.current)==null?void 0:K.value)!==void 0){let ee=R??"";(fe=(X=l.current).onValueChange)==null||fe.call(X,ee);return}}I.emit()}},emit:()=>{o.current.forEach(z=>z())}}),[]),E=h.useMemo(()=>({value:(z,R,q)=>{var Q;R!==((Q=a.current.get(z))==null?void 0:Q.value)&&(a.current.set(z,{value:R,keywords:q}),n.current.filtered.items.set(z,N(R,q)),C(2,()=>{k(),I.emit()}))},item:(z,R)=>(r.current.add(z),R&&(s.current.has(R)?s.current.get(R).add(z):s.current.set(R,new Set([z]))),C(3,()=>{M(),k(),n.current.value||A(),I.emit()}),()=>{a.current.delete(z),r.current.delete(z),n.current.filtered.items.delete(z);let q=F();C(4,()=>{M(),(q==null?void 0:q.getAttribute("id"))===z&&A(),I.emit()})}),group:z=>(s.current.has(z)||s.current.set(z,new Set),()=>{a.current.delete(z),s.current.delete(z)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:j,labelId:w,listInnerRef:S}),[]);function N(z,R){var q,Q;let K=(Q=(q=l.current)==null?void 0:q.filter)!=null?Q:_9;return z?K(z,n.current.search,R):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let z=n.current.filtered.items,R=[];n.current.filtered.groups.forEach(Q=>{let K=s.current.get(Q),X=0;K.forEach(fe=>{let ee=z.get(fe);X=Math.max(ee,X)}),R.push([Q,X])});let q=S.current;V().sort((Q,K)=>{var X,fe;let ee=Q.getAttribute("id"),te=K.getAttribute("id");return((X=z.get(te))!=null?X:0)-((fe=z.get(ee))!=null?fe:0)}).forEach(Q=>{let K=Q.closest(yh);K?K.appendChild(Q.parentElement===K?Q:Q.closest(`${yh} > *`)):q.appendChild(Q.parentElement===q?Q:Q.closest(`${yh} > *`))}),R.sort((Q,K)=>K[1]-Q[1]).forEach(Q=>{var K;let X=(K=S.current)==null?void 0:K.querySelector(`${Wo}[${Ta}="${encodeURIComponent(Q[0])}"]`);X==null||X.parentElement.appendChild(X)})}function A(){let z=V().find(q=>q.getAttribute("aria-disabled")!=="true"),R=z==null?void 0:z.getAttribute(Ta);I.setState("value",R||void 0)}function M(){var z,R,q,Q;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let K=0;for(let X of r.current){let fe=(R=(z=a.current.get(X))==null?void 0:z.value)!=null?R:"",ee=(Q=(q=a.current.get(X))==null?void 0:q.keywords)!=null?Q:[],te=N(fe,ee);n.current.filtered.items.set(X,te),te>0&&K++}for(let[X,fe]of s.current)for(let ee of fe)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=K}function L(){var z,R,q;let Q=F();Q&&(((z=Q.parentElement)==null?void 0:z.firstChild)===Q&&((q=(R=Q.closest(Wo))==null?void 0:R.querySelector(E9))==null||q.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function F(){var z;return(z=S.current)==null?void 0:z.querySelector(`${kE}[aria-selected="true"]`)}function V(){var z;return Array.from(((z=S.current)==null?void 0:z.querySelectorAll(Y0))||[])}function U(z){let R=V()[z];R&&I.setState("value",R.getAttribute(Ta))}function P(z){var R;let q=F(),Q=V(),K=Q.findIndex(fe=>fe===q),X=Q[K+z];(R=l.current)!=null&&R.loop&&(X=K+z<0?Q[Q.length-1]:K+z===Q.length?Q[0]:Q[K+z]),X&&I.setState("value",X.getAttribute(Ta))}function T(z){let R=F(),q=R==null?void 0:R.closest(Wo),Q;for(;q&&!Q;)q=z>0?F9(q,Wo):V9(q,Wo),Q=q==null?void 0:q.querySelector(Y0);Q?I.setState("value",Q.getAttribute(Ta)):P(z)}let D=()=>U(V().length-1),_=z=>{z.preventDefault(),z.metaKey?D():z.altKey?T(1):P(1)},G=z=>{z.preventDefault(),z.metaKey?U(0):z.altKey?T(-1):P(-1)};return h.createElement(pe.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:z=>{var R;(R=v.onKeyDown)==null||R.call(v,z);let q=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||q))switch(z.key){case"n":case"j":{y&&z.ctrlKey&&_(z);break}case"ArrowDown":{_(z);break}case"p":case"k":{y&&z.ctrlKey&&G(z);break}case"ArrowUp":{G(z);break}case"Home":{z.preventDefault(),U(0);break}case"End":{z.preventDefault(),D();break}case"Enter":{z.preventDefault();let Q=F();if(Q){let K=new Event(sp);Q.dispatchEvent(K)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:U9},c),uf(e,z=>h.createElement(NE.Provider,{value:I},h.createElement(SE.Provider,{value:E},z))))}),A9=h.forwardRef((e,t)=>
508{var n,r;let s=Ot(),a=h.useRef(null),o=h.useContext(jE),l=wc(),c=TE(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Xi(()=>{if(!u)return l.item(s,o==null?void 0:o.id)},[u]);let f=EE(s,a,[e.value,e.children,a],e.keywords),d=Wx(),m=ci(C=>C.value&&C.value===f.current),p=ci(C=>u||l.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);h.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(sp,g),()=>C.removeEventListener(sp,g)},[p,e.onSelect,e.disabled]);function g(){var C,I;x(),(I=(C=c.current).onSelect)==null||I.call(C,f.current)}function x(){d.setState("value",f.current,!0)}if(!p)return null;let{disabled:y,value:v,onSelect:b,forceMount:w,keywords:j,...S}=e;return h.createElement(pe.div,{ref:ei(a,t),...S,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!m,"data-disabled":!!y,"data-selected":!!m,onPointerMove:y||l.getDisablePointerSelection()?void 0:x,onClick:y?void 0:g},e.children)}),P9=h.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...a}=e,o=Ot(),l=h.useRef(null),c=h.useRef(null),u=Ot(),f=wc(),d=ci(p=>s||f.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Xi(()=>f.group(o),[]),EE(o,l,[e.value,e.heading,c]);let m=h.useMemo(()=>({id:o,forceMount:s}),[s]);return h.createElement(pe.div,{ref:ei(l,t),...a,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&h.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),uf(e,p=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},h.createElement(jE.Provider,{value:m},p))))}),R9=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=h.useRef(null),a=ci(o=>!o.search);return!n&&!a?null:h.createElement(pe.div,{ref:ei(s,t),...r,"cmdk-separator":"",role:"separator"})}),I9=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,a=Wx(),o=ci(u=>u.search),l=ci(u=>u.selectedItemId),c=wc();return h.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),h.createElement(pe.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:o,onChange:u=>{s||a.setState("search",u.target.value),n==null||n(u.target.value)}})}),M9=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,a=h.useRef(null),o=h.useRef(null),l=ci(u=>u.selectedItemId),c=wc();return h.useEffect(()=>{if(o.current&&a.current){let u=o.current,f=a.current,d,m=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=u.offsetHeight;f.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return m.observe(u),()=>{cancelAnimationFrame(d),m.unobserve(u)}}},[]),h.createElement(pe.div,{ref:ei(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},uf(e,u=>h.createElement("div",{ref:ei(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),D9=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:a,container:o,...l}=e;return h.createElement(yc,{open:n,onOpenChange:r},h.createElement(vc,{container:o},h.createElement(ma,{"cmdk-overlay":"",className:s}),h.createElement(pa,{"aria-label":e.label,"cmdk-dialog":"",className:a},h.createElement(CE,{ref:t,...l}))))}),O9=h.forwardRef((e,t)=>ci(n=>n.filtered.count===0)?h.createElement(pe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),L9=h.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...a}=e;return h.createElement(pe.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uf(e,o=>h.createElement("div",{"aria-hidden":!0},o)))}),En=Object.assign(CE,{List:M9,Item:A9,Input:I9,Group:P9,Separator:R9,Dialog:D9,Empty:O9,Loading:L9});function F9(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function V9(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function TE(e){let t=h.useRef(e);return Xi(()=>{t.current=e}),t}var Xi=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Ea(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function ci(e){let t=Wx(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function EE(e,t,n,r=[]){let s=h.useRef(),a=wc();return Xi(()=>{var o;let l=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());a.value(e,l,c),(o=t.current)==null||o.setAttribute(Ta,l),s.current=l}),s}var $9=()=>{let[e,t]=h.useState(),n=Ea(()=>new Map);return Xi(()=>{n.current.forEach(r=>
508r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function z9(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function uf({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(z9(t),{ref:t.ref},n(t.props.children)):n(t)}var U9={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const _E=h.forwardRef(({className:e,...t},n)=>i.jsx(En,{ref:n,className:W("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));_E.displayName=En.displayName;const AE=h.forwardRef(({className:e,...t},n)=>i.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[i.jsx(Al,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),i.jsx(En.Input,{ref:n,className:W("flex w-full rounded-md bg-transparent text-base placeholder:text-base outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));AE.displayName=En.Input.displayName;const PE=h.forwardRef(({className:e,...t},n)=>i.jsx(En.List,{ref:n,className:W("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));PE.displayName=En.List.displayName;const RE=h.forwardRef((e,t)=>i.jsx(En.Empty,{ref:t,className:"py-6 text-center text-base",...e}));RE.displayName=En.Empty.displayName;const yu=h.forwardRef(({className:e,...t},n)=>i.jsx(En.Group,{ref:n,className:W("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));yu.displayName=En.Group.displayName;const B9=h.forwardRef(({className:e,...t},n)=>i.jsx(En.Separator,{ref:n,className:W("-mx-1 h-px bg-border",e),...t}));B9.displayName=En.Separator.displayName;const vu=h.forwardRef(({className:e,...t},n)=>i.jsx(En.Item,{ref:n,className:W("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-base outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));vu.displayName=En.Item.displayName;var df="Popover",[IE]=zt(df,[fi]),kc=fi(),[H9,xi]=IE(df),ME=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!1}=e,l=kc(t),c=h.useRef(null),[u,f]=h.useState(!1),[d,m]=jn({prop:r,defaultProp:s??!1,onChange:a,caller:df});return i.jsx(Ld,{...l,children:i.jsx(H9,{scope:t,contentId:Ot(),triggerRef:c,open:d,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(p=>!p),[m]),hasCustomAnchor:u,onCustomAnchorAdd:h.useCallback(()=>f(!0),[]),onCustomAnchorRemove:h.useCallback(()=>f(!1),[]),modal:o,children:n})})};ME.displayName=df;var DE="PopoverAnchor",W9=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xi(DE,n),a=kc(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return h.useEffect(()=>(o(),()=>l()),[o,l]),i.jsx(ac,{...a,...r,ref:t})});W9.displayName=DE;var OE="PopoverTrigger",LE=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xi(OE,n),a=kc(n),o=Ae(t,s.triggerRef),l=i.jsx(pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":UE(s.open),...r,ref:o,onClick:se(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(ac,{asChild:!0,...a,children:l})});LE.displayName=OE;var qx="PopoverPortal",[q9,G9]=IE(qx,{forceMount:void 0}),FE=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=xi(qx,t);return i.jsx(q9,{scope:t,forceMount:n,children:i.jsx(Lt,{present:n||a.open,children:i.jsx(ca,{asChild:!0,container:s,children:r})})})};FE.displayName=qx;var mo="PopoverContent",VE=h.forwardRef((e,t)=>{const n=G9(mo,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=xi(mo,e.__scopePopover);return i.jsx(Lt,{present:r||a.open,children:a.modal?i.jsx(K9,{...s,ref:t}):i.jsx(Q9,{...s,ref:t})})});VE.displayName=mo;
508var Y9=ti("PopoverContent.RemoveScroll"),K9=h.forwardRef((e,t)=>{const n=xi(mo,e.__scopePopover),r=h.useRef(null),s=Ae(t,r),a=h.useRef(!1);return h.useEffect(()=>{const o=r.current;if(o)return zd(o)},[]),i.jsx(lc,{as:Y9,allowPinchZoom:!0,children:i.jsx($E,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:se(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:se(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Q9=h.forwardRef((e,t)=>{const n=xi(mo,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return i.jsx($E,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),$E=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...d}=e,m=xi(mo,n),p=kc(n);return Rd(),i.jsx(sc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(la,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:i.jsx(Fd,{"data-state":UE(m.open),role:"dialog",id:m.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),zE="PopoverClose",Z9=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xi(zE,n);return i.jsx(pe.button,{type:"button",...r,ref:t,onClick:se(e.onClick,()=>s.onOpenChange(!1))})});Z9.displayName=zE;var X9="PopoverArrow",J9=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=kc(n);return i.jsx(Vd,{...s,...r,ref:t})});J9.displayName=X9;function UE(e){return e?"open":"closed"}var eH=ME,tH=LE,nH=FE,BE=VE;const Gx=eH,Yx=tH,ff=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>i.jsx(nH,{children:i.jsx(BE,{ref:s,align:t,sideOffset:n,className:W("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));ff.displayName=BE.displayName;function Kx({value:e,onValueChange:t,placeholder:n="Select activity type...",className:r,popoverContentClassName:s,disabled:a=!1}){const[o,l]=h.useState(!1),[c,u]=h.useState(""),[f,d]=h.useState(!1),[m,p]=h.useState(!1),[g,x]=h.useState(null),[y,v]=h.useState(null),[b,w]=h.useState(""),[j,S]=h.useState(!1),C=wt(
508),{data:I=[]}=it({queryKey:["custom-activity-types"],queryFn:async()=>{const P=await fetch("/api/activity-types");if(!P.ok)throw new Error("Failed to fetch custom activity types");return P.json()},staleTime:0,refetchOnWindowFocus:!1,refetchOnMount:!0}),E=h.useMemo(()=>{const P=new Set(Js.map(T=>T.value));return I.filter(T=>!P.has(T.activityType)).map(T=>({id:T.id,label:T.activityType,value:T.activityType,duration:"",defaultHours:0}))},[I]),N=P=>P?y9(P).label:n,k=c.trim()&&!Js.some(P=>P.label.toLowerCase()===c.toLowerCase()||P.value.toLowerCase()===c.toLowerCase())&&!E.some(P=>P.label.toLowerCase()===c.toLowerCase()||P.value.toLowerCase()===c.toLowerCase()),A=P=>{t(P),l(!1),u("")},M=async()=>{if(c.trim()){const P=c.trim().toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-");S(!0);try{if(!(await fetch("/api/activity-types",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({activityType:P})})).ok)throw new Error("Failed to create activity type");await C.invalidateQueries({queryKey:["custom-activity-types"],refetchType:"all"}),A(P)}catch(T){console.error("Error creating activity type:",T),A(P)}finally{S(!1)}}},L=(P,T)=>{P.stopPropagation(),x(I.find(D=>D.id===T.id)||null),w(T.label),d(!0)},F=(P,T)=>{P.stopPropagation(),v(I.find(D=>D.id===T.id)||null),p(!0)},V=async()=>{if(!(!g||!b.trim())){S(!0);try{if(!(await fetch(`/api/activity-types/${g.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({activityType:b.trim()})})).ok)throw new Error("Failed to update activity type");e===g.activityType&&t(b.trim()),await C.invalidateQueries({queryKey:["custom-activity-types"],refetchType:"all"}),d(!1),x(null),w("")}catch(P){console.error("Error updating activity type:",P)}finally{S(!1)}}},U=async()=>{if(y){S(!0);try{if(!(await fetch(`/api/activity-types/${y.id}`,{method:"DELETE"})).ok)throw new Error("Failed to delete activity type");e===y.activityType&&t(""),await C.invalidateQueries({queryKey:["custom-activity-types"],refetchType:"all"}),p(!1),v(null)}catch(P){console.error("Error deleting activity type:",P)}finally{S(!1)}}};return i.jsxs(i.Fragment,{children:[i.jsxs(Gx,{open:o,onOpenChange:l,children:[i.jsx(Yx,{asChild:!0,children:i.jsxs(Z,{variant:"outline",role:"combobox","aria-expanded":o,className:W("w-full justify-between",r),disabled:a,children:[i.jsx("span",{className:"truncate",children:N(e)}),i.jsx(xD,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),i.jsx(ff,{className:W("w-full max-w-[400px] p-0",s),align:"start",sideOffset:4,children:i.jsxs(_E,{children:[i.jsx(AE,{placeholder:"Search activity types...",value:c,onValueChange:u,className:"text-base font-normal h-7 py-1"}),i.jsxs(PE,{children:[i.jsx(RE,{children:c.trim()?i.jsxs("div",{className:"text-center py-4",children:[i.jsx("p",{children:"No activity types found."}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Try typing a custom activity name"})]}):"No activity types found."}),E.length>0&&i.jsx(yu,{heading:"Custom Activity Types",children:E.map(P=>i.jsxs(vu,{value:P.value,onSelect:()=>A(P.value),className:"group",children:[i.jsx(ot,{className:W("mr-2 h-4 w-4",e===P.value?"opacity-100":"opacity-0")}),i.jsxs("div",{className:"flex flex-col flex-1",children:[i.jsx("span",{children:P.label}),i.jsx("span",{className:"text-xs text-muted-foreground",children:P.duration})]}),i.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:T=>L(T,P),children:i.jsx(ug,{className:"h-3 w-3"})}),i.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-destructive hover:text-destructive",onClick:T=>F(T,P),children:i.jsx(CS,{className:"h-3 w-3"})})]})]},P.value))}),i.jsx(yu,{heading:"Predefined Activity Types",children:Js.map(P=>i.jsxs(vu,{value:P.value,onSelect:()=>A(P.value),children:[i.jsx(ot,{className:W("mr-2 h-4 w-4",e===P.value?"opacity-100":"opacity-0")}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{children:P.label}),i.jsx("span",{className:"text-xs text-muted-foreground",children:P.duration})]})]},P.value))}),k&&i.jsx(yu,{heading:"Custom Activity Type",children:i.jsxs(vu,{onSelect:M,value:`add-custom-${c}`,disabled:j,children:[j?i.jsx(io,{className:"mr-2 h-4 w-4 animate-spin"}):i.jsx(io,{className:"mr-2 h-4 w-4"}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{children:j?"Creating...":`Add "${c}" as custom activity`}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Create a new activity type"})]})]})})]})]})})]}),i.jsx($r,{open:f,onOpenChange:d,children:i.jsxs(ur,{children:[i.jsxs(dr,{children:[i.jsx(fr,{children:"Edit Activity Type"}),i.jsx(li,{children:"Update the name of this custom activity type."})]}),i.jsx("div",{className:"py-4",children:i.jsx(dt,{value:b,onChange:P=>w(P.target.value),placeholder:"Activity type name",autoFocus:!0})}),i.jsxs(Bl,{children:[i.jsx(Z,{variant:"outline",onClick:()=>{d(!1),x(null),w("")},disabled:j,children:"Cancel"}),i.jsx(Z,{onClick:V,disabled:!b.trim()||j,children:j?"Saving...":"Save"})]})]})}),i.jsx($r,{open:m,onOpenChange:p,children:i.jsxs(ur,{children:[i.jsxs(dr,{children:[i.jsx(fr,{children:"Delete Activity Type"}),i.jsxs(li,{children:['Are you sure you want to delete "',y==null?void 0:y.activityType,'"? This action cannot be undone.']})]}),i.jsxs(Bl,{children:[i.jsx(Z,{variant:"outline",onClick:()=>{p(!1),v(null)},disabled:j,children:"Cancel"}),i.jsx(Z,{variant:"destructive",onClick:U,disabled:j,children:j?"Deleting...":"Delete"})]})]})})]})}function xn(e){try{window.dataLayer=window.dataLayer||[],e.timestamp||(e.timestamp=new Date().toISOString()),window.dataLayer.push(e)}catch(t){console.warn("Failed to track GA4 event:",t)}}function yn(){try{const e=localStorage.getItem("user");if(e){const t=JSON.parse(e);return t.id||t.email}}catch{}}function HE(e,t){xn({event:e,user_id:(t==null?void 0:t.user_id)||yn(),...t})}function rH(e,t){xn({event:"started_trial",user_id:e||yn(),plan_type:"trial",trial_length_days:30,...t})}function sH(e,t){xn({event:"logged_time",user_id:e||yn(),entry_method:(t==null?void 0:t.entry_method)||"manual",hours_logged:t==null?void 0:t.hours_logged,activity_type:t==null?void 0:t.activity_type,...t})}function iH(e,t){xn({event:"generated_report",user_id:e||yn(),report_type:(t==null?void 0:t.report_type)||"csv_export",entries_count:t==null?void 0:t.entries_count,...t})}function aH(e,t){xn({event:"stopwatch_log_started",user_id:e||yn(),entry_method:"stopwatch",...t})}function oH(e,t){xn({event:"property_added",user_id:e||yn(),property_type:t==null?void 0:t.property_type,...t})}function lH(e,t){xn({event:"import_button_clicked",user_id:e||yn(),import_type:(t==null?void 0:t.import_type)||"csv",...t})}function cH(e,t){xn({event:"export_button_clicked",user_id:e||yn(),export_type:(t==null?void 0:t.export_type)||"csv",...t})}function uH(e,t){xn({event:"ai_enhance_description_time_entry_form",user_id:e||yn(),enhancement_location:"time_entry_form",...t})}function dH(e,t){xn({event:"file_import_data_mapping_success",user_id:e||yn(),file_type:(t==null?void 0:t.file_type)||"csv",rows_imported:t==null?void 0:t.rows_imported,...t})}function fH(e,t,n){xn({event:e,user_id:t||yn(),...n})}function WE(e){xn({event:"cost_seg_estimate_generated",user_id:yn(),address:e.address,property_type:e.propertyType,estimated_value:e.estimatedValue,total_savings_midpoint:e.totalSavings
508Midpoint})}function ip(e){xn({event:"cost_seg_data_edited",user_id:yn(),field:e.field,estimate_id:e.estimateId})}function qE(e){xn({event:"cost_seg_full_estimate_viewed",user_id:yn(),estimate_id:e.estimateId,is_authenticated:e.isAuthenticated})}function GE(e){xn({event:"cost_seg_partner_cta_clicked",user_id:yn(),estimate_id:e.estimateId,partner_id:e.partnerId??"none"})}const tae=Object.freeze(Object.defineProperty({__proto__:null,trackAIEnhanceDescriptionTimeEntryForm:uH,trackCostSegDataEdited:ip,trackCostSegEstimateGenerated:WE,trackCostSegFullEstimateViewed:qE,trackCostSegPartnerCtaClicked:GE,trackCustomEvent:fH,trackExportButtonClicked:cH,trackFileImportDataMappingSuccess:dH,trackGA4Event:HE,trackImportButtonClicked:lH,trackPropertyAdded:oH,trackReportGenerated:iH,trackStopwatchLogStarted:aH,trackTimeLogged:sH,trackTrialStarted:rH},Symbol.toStringTag,{value:"Module"}));var Me=function(){return Me=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Me.apply(this,arguments)};function hH(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function YE(e,t,n){for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Sc(e){return e.mode==="multiple"}function Nc(e){return e.mode==="range"}function hf(e){return e.mode==="single"}var mH={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function pH(e,t){return Br(e,"LLLL y",t)}function gH(e,t){return Br(e,"d",t)}function xH(e,t){return Br(e,"LLLL",t)}function yH(e){return"".concat(e)}function vH(e,t){return Br(e,"cccccc",t)}function bH(e,t){return Br(e,"yyyy",t)}var wH=Object.freeze({__proto__:null,formatCaption:pH,formatDay:gH,formatMonthCaption:xH,formatWeekNumber:yH,formatWeekdayName:vH,formatYearCaption:bH}),kH=function(e,t,n){return Br(e,"do MMMM (EEEE)",n)},SH=function(){return"Month: "},NH=function(){return"Go to next month"},jH=function(){return"Go to previous month"},CH=function(e,t){return Br(e,"cccc",t)},TH=function(e){return"Week n. ".concat(e)},EH=function(){return"Year: "},_H=Object.freeze({__proto__:null,labelDay:kH,labelMonthDropdown:SH,labelNext:NH,labelPrevious:jH,labelWeekNumber:TH,labelWeekday:CH,labelYearDropdown:EH});function AH(){var e="buttons",t=mH,n=nT,r={},s={},a=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:wH,labels:_H,locale:n,modifiersClassNames:r,modifiers:s,numberOfMonths:a,styles:o,today:l,mode:"default"}}function PH(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,s=e.toMonth,a=e.fromDate,o=e.toDate;return r?a=Nn(r):t&&(a=new Date(t,0,1)),s?o=Sx(s):n&&(o=new Date(n,11,31)),{fromDate:a?uo(a):void 0,toDate:o?uo(o):void 0}}var KE=h.createContext(void 0);function RH(e){var t,n=e.initialProps,r=AH(),s=PH(n),a=s.fromDate,o=s.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;l!=="buttons"&&(!a||!o)&&(l="buttons");var c;(hf(n)||Sc(n)||Nc(n))&&(c=n.onSelect);var u=Me(Me(Me({},r),n),{captionLayout:l,classNames:Me(Me({},r.classNames),n.classNames),components:Me({}
508,n.components),formatters:Me(Me({},r.formatters),n.formatters),fromDate:a,labels:Me(Me({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Me(Me({},r.modifiers),n.modifiers),modifiersClassNames:Me(Me({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:Me(Me({},r.styles),n.styles),toDate:o});return i.jsx(KE.Provider,{value:u,children:e.children})}function yt(){var e=h.useContext(KE);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function QE(e){var t=yt(),n=t.locale,r=t.classNames,s=t.styles,a=t.formatters.formatCaption;return i.jsx("div",{className:r.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:n})})}function IH(e){return i.jsx("svg",Me({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:i.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function ZE(e){var t,n,r=e.onChange,s=e.value,a=e.children,o=e.caption,l=e.className,c=e.style,u=yt(),f=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:IH;return i.jsxs("div",{className:l,style:c,children:[i.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),i.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:s,onChange:r,children:a}),i.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[o,i.jsx(f,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function MH(e){var t,n=yt(),r=n.fromDate,s=n.toDate,a=n.styles,o=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,f=n.labels.labelMonthDropdown;if(!r)return i.jsx(i.Fragment,{});if(!s)return i.jsx(i.Fragment,{});var d=[];if(dU(r,s))for(var m=Nn(r),p=r.getMonth();p<=s.getMonth();p++)d.push(hh(m,p));else for(var m=Nn(new Date),p=0;p<=11;p++)d.push(hh(m,p));var g=function(y){var v=Number(y.target.value),b=hh(Nn(e.displayMonth),v);e.onChange(b)},x=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:ZE;return i.jsx(x,{name:"months","aria-label":f(),className:c.dropdown_month,style:a.dropdown_month,onChange:g,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:o}),children:d.map(function(y){return i.jsx("option",{value:y.getMonth(),children:l(y,{locale:o})},y.getMonth())})})}function DH(e){var t,n=e.displayMonth,r=yt(),s=r.fromDate,a=r.toDate,o=r.locale,l=r.styles,c=r.classNames,u=r.components,f=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,m=[];if(!s)return i.jsx(i.Fragment,{});if(!a)return i.jsx(i.Fragment,{});for(var p=s.getFullYear(),g=a.getFullYear(),x=p;x<=g;x++)m.push(F0(eT(new Date),x));var y=function(b){var w=F0(Nn(n),Number(b.target.value));e.onChange(w)},v=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:ZE;return i.jsx(v,{name:"years","aria-label":d(),className:c.dropdown_year,style:l.dropdown_year,onChange:y,value:n.getFullYear(),caption:f(n,{locale:o}),children:m.map(function(b){return i.jsx("option",{value:b.getFullYear(),children:f(b,{locale:o})},b.getFullYear())})})}function OH(e,t){var n=h.useState(e),r=n[0],s=n[1],a=t===void 0?r:t;return[a,s]}function LH(e){var t=e.month,n=e.defaultMonth,r=e.today,s=t||n||r||new Date,a=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(a&&Vl(a,s)<0){var u=-1*(c-1);s=cr(a,u)}return o&&Vl(s,o)<0&&(s=o),Nn(s)}function FH(){var e=yt(),t=LH(e),n=OH(t,e.month),r=n[0],s=n[1],a=function(o){var l;if(!e.disableNavigation){var c=Nn(o);s(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[r,a]}function VH(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,s=Nn(e),a=Nn(cr(s,r)),o=Vl(a,s),l=[],c=0;c<o;c++){var u=cr(s,c);l.push(u)}return n&&(l=l.reverse()),l}function $H(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,s=t.numberOfMonths,a=s===void 0?1:s,o=r?a:1,l=Nn(e);if(!n)return cr(l,o);var c=Vl(n,e);if(!(c<a))return cr(l,o)}}function zH(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,s=t.numberOfMonths,a=s===void 0?1:s,o=r?a:1,l=Nn(e);if(!n)return cr(l,-o);var c=Vl(l,n);if(!(c<=0))return cr(l,-o)}}var XE=h.createContext(void 0);function UH(e){var t=yt(),n=FH(),r=n[0],s=n[1],a=VH(r,t),o=$H(r,t),l=zH(r,t),c=function(d){return a.some(function(m){return jx(d,m)})},u=function(d,m){c(d)||(m&&oT(d,m)?s(cr(d,1+t.numberOfMonths*-1)):s(d))},f={currentMonth:r,displayMonths:a,goToMonth:s,goToDate:u,previousMonth:l,nextMonth:o,isDateDisplayed:c};return i.jsx(XE.Provider,{value:f,children:e.children})}function jc(){var e=h.useContext(XE);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function K0(e){var t,n=yt(),r=n.classNames,s=n.styles,a=n.components,o=jc().goToMonth,l=function(f){o(cr(f,e.displayIndex?-e.dis
508playIndex:0))},c=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:QE,u=i.jsx(c,{id:e.id,displayMonth:e.displayMonth});return i.jsxs("div",{className:r.caption_dropdowns,style:s.caption_dropdowns,children:[i.jsx("div",{className:r.vhidden,children:u}),i.jsx(MH,{onChange:l,displayMonth:e.displayMonth}),i.jsx(DH,{onChange:l,displayMonth:e.displayMonth})]})}function BH(e){return i.jsx("svg",Me({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:i.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function HH(e){return i.jsx("svg",Me({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:i.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var ed=h.forwardRef(function(e,t){var n=yt(),r=n.classNames,s=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var o=a.join(" "),l=Me(Me({},s.button_reset),s.button);return e.style&&Object.assign(l,e.style),i.jsx("button",Me({},e,{ref:t,type:"button",className:o,style:l}))});function WH(e){var t,n,r=yt(),s=r.dir,a=r.locale,o=r.classNames,l=r.styles,c=r.labels,u=c.labelPrevious,f=c.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return i.jsx(i.Fragment,{});var m=u(e.previousMonth,{locale:a}),p=[o.nav_button,o.nav_button_previous].join(" "),g=f(e.nextMonth,{locale:a}),x=[o.nav_button,o.nav_button_next].join(" "),y=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:HH,v=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:BH;return i.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&i.jsx(ed,{name:"previous-month","aria-label":m,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?i.jsx(y,{className:o.nav_icon,style:l.nav_icon}):i.jsx(v,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&i.jsx(ed,{name:"next-month","aria-label":g,className:x,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?i.jsx(v,{className:o.nav_icon,style:l.nav_icon}):i.jsx(y,{className:o.nav_icon,style:l.nav_icon})})]})}function Q0(e){var t=yt().numberOfMonths,n=jc(),r=n.previousMonth,s=n.nextMonth,a=n.goToMonth,o=n.displayMonths,l=o.findIndex(function(g){return jx(e.displayMonth,g)}),c=l===0,u=l===o.length-1,f=t>1&&(c||!u),d=t>1&&(u||!c),m=function(){r&&a(r)},p=function(){s&&a(s)};return i.jsx(WH,{displayMonth:e.displayMonth,hideNext:f,hidePrevious:d,nextMonth:s,previousMonth:r,onPreviousClick:m,onNextClick:p})}function qH(e){var t,n=yt(),r=n.classNames,s=n.disableNavigation,a=n.styles,o=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:QE,u;return s?u=i.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?u=i.jsx(K0,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?u=i.jsxs(i.Fragment,{children:[i.jsx(K0,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),i.jsx(Q0,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=i.jsxs(i.Fragment,{children:[i.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),i.jsx(Q0,{displayMonth:e.displayMonth,id:e.id})]}),i.jsx("div",{className:r.caption,style:a.caption,children:u})}function GH(e){var t=yt(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?i.jsx("tfoot",{className:s,style:r.tfoot,children:i.jsx("tr",{children:i.jsx("td",{colSpan:8,children:n})})}):i.jsx(i.Fragment,{})}function YH(e,t,n){for(var r=n?Qi(new Date):Vr(new Date,{locale:e,weekStartsOn:t}),s=[],a=0;a<7;a++){var o=cn(r,a);s.push(o)}return s}function KH(){var e=yt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,a=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=YH(s,a,o);return i.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&i.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(f,d){return i.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s}),children:l(f,{locale:s})},d)})]})}function QH(){var e,t=yt(),n=t.classNames,r=t.styles,s=t.components,a=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:KH;return i.jsx("thead",{style:r.head,className:n.head,children:i.jsx(a,{})})}function ZH(e){var t=yt(),n=t.locale,r=t.formatters.formatDay;return i.jsx(i.Fragment,{children:r(e.date,{locale:n})})}var Qx=h.createContext(void 0);function XH(e){if(!Sc(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return i.jsx(Qx.Provider,{value:t,children:e.children})}return i.jsx(JH,{initialProps:e.initialProps,children:e.children})}function JH(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,a=t.max,o=function(u,f,d){var m,p;(m=t.onDayClick)===null||m===void 0||m.call(t,u,f,d);var g=!!(f.selected&&s&&(r==null?void 0:r.length)===s);if(!g){var x=!!(!f.selected&&a&&(r==null?void 0:r.length)===a);if(!x){var y=r?YE([],r):[];if(f.selected){var v=y.findIndex(function(b){return nn(u,b)});y.splice(v,1)}else y.push(u);(p=t.onSelect)===null||p===void 0||p.call(t,y,u,f,d)}}},l={disabled:[]};r&&l.disabled.push(function(u){var f=a&&r.length>a-1,d=r.some(function(m){return nn(m,u)});return!!(f&&!d)});var c={selected:r,onDayClick:o,modifiers:l};return i.jsx(Qx.Provider,{value:c,children:n})}function Zx(){var e=h.useContext(Qx);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function e8(e,t){var n=t||{},r=n.from,s=n.to;return r&&s?nn(s,e)&&nn(r,e)?void 0:nn(s,e)?{from:s,to:void 0}:nn(r,e)?void 0:Km(r,e)?{from:e,to:s}:{from:r,to:e}:s?Km(e,s)?{from:s,to:e}:{from:e,to:s}:r?oT(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Xx=h.createContext(void 0);function t8(e){if(!Nc(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return i.jsx(Xx.Provider,{value:t,children:e.children})}return i.jsx(n8,{initialProps:e.initialProps,children:e.children})}function n8(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},a=s.from,o=s.to,l=t.min,c=t.max,u=function(p,g,x){var y,v;(y=t.onDayClick)===null||y===void 0||y.call(t,p,g,x);var b=e8(p,r);(v=t.onSelect)===null||v===void 0||v.call(t,b,p,g,x)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(f.range_start=[a],o?(f.range_end=[o],nn(a,o)||(f.range_middle=[{after:a,before:o}])):f.range_end=[a]):o&&(f.range_start=[o],f.range_end=[o]),l&&(a&&!o&&f.disabled.push({after:xu(a,l-1),before:cn(a,l-1)}),a&&o&&f.disabled.push({after:a,before:cn(a,l-1)}),!a&&o&&f.disabled.push({after:xu(o,l-1),before:cn(o,l-1)})),c){if(a&&!o&&(f.disabled.push({before:cn(a,-c+1)}),f.disabled.push({after:cn(a,c-1)})),a&&o){var d=Tr(o,a)+1,m=c-d;f.disabled.push({before:xu(a,m)}),f.disabled.push({after:cn(o,m)})}!a&&o&&(f.disabled.push({before:cn(o,-c+1)}),f.disabled.push({after:cn(o,c-1)}))}return i.jsx(Xx.Provider,{value:{selected:r,onDayClick:u,modifiers:f},children:n})}function Jx(){var e=h.useContext(Xx);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function bu(e){return Array.isArray(e)?YE([],e):e!==void 0?[e]:[]}function r8(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];t[r]=bu(s)}),t}var hr;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(hr||(hr={}));var s8=hr.Selected,Kr=hr.Disabled,i8=hr.Hidden,a8=hr.Today,vh=hr.RangeEnd,bh=hr.RangeMiddle,wh=hr.RangeStart,o8=hr.Outside;function l8(e,t,n){var r,s=(r={},r[s8]=bu(e.selected),r[Kr]=bu(e.disabled),r[i8]=bu(e.hidden),r[a8]=[e.today],r[vh]=[],r[bh]=[],r[wh]=[],r[o8]=[],r);return e.fromDate&&s[Kr].push({before:e.fromDate}),e.toDate&&s[Kr].push({after:e.toDate}
508),Sc(e)?s[Kr]=s[Kr].concat(t.modifiers[Kr]):Nc(e)&&(s[Kr]=s[Kr].concat(n.modifiers[Kr]),s[wh]=n.modifiers[wh],s[bh]=n.modifiers[bh],s[vh]=n.modifiers[vh]),s}var JE=h.createContext(void 0);function c8(e){var t=yt(),n=Zx(),r=Jx(),s=l8(t,n,r),a=r8(t.modifiers),o=Me(Me({},s),a);return i.jsx(JE.Provider,{value:o,children:e.children})}function e_(){var e=h.useContext(JE);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function u8(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function d8(e){return!!(e&&typeof e=="object"&&"from"in e)}function f8(e){return!!(e&&typeof e=="object"&&"after"in e)}function h8(e){return!!(e&&typeof e=="object"&&"before"in e)}function m8(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function p8(e,t){var n,r=t.from,s=t.to;if(r&&s){var a=Tr(s,r)<0;a&&(n=[s,r],r=n[0],s=n[1]);var o=Tr(e,r)>=0&&Tr(s,e)>=0;return o}return s?nn(s,e):r?nn(r,e):!1}function g8(e){return kx(e)}function x8(e){return Array.isArray(e)&&e.every(kx)}function y8(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(g8(n))return nn(e,n);if(x8(n))return n.includes(e);if(d8(n))return p8(e,n);if(m8(n))return n.dayOfWeek.includes(e.getDay());if(u8(n)){var r=Tr(n.before,e),s=Tr(n.after,e),a=r>0,o=s<0,l=Km(n.before,n.after);return l?o&&a:a||o}return f8(n)?Tr(e,n.after)>0:h8(n)?Tr(n.before,e)>0:typeof n=="function"?n(e):!1})}function ey(e,t,n){var r=Object.keys(t).reduce(function(a,o){var l=t[o];return y8(e,l)&&a.push(o),a},[]),s={};return r.forEach(function(a){return s[a]=!0}),n&&!jx(e,n)&&(s.outside=!0),s}function v8(e,t){for(var n=Nn(e[0]),r=Sx(e[e.length-1]),s,a,o=n;o<=r;){var l=ey(o,t),c=!l.disabled&&!l.hidden;if(!c){o=cn(o,1);continue}if(l.selected)return o;l.today&&!a&&(a=o),s||(s=o),o=cn(o,1)}return a||s}var b8=365;function t_(e,t){var n=t.moveBy,r=t.direction,s=t.context,a=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,d=s.locale,m={day:cn,week:Ym,month:cr,year:oz,startOfWeek:function(y){return s.ISOWeek?Qi(y):Vr(y,{locale:d,weekStartsOn:c})},endOfWeek:function(y){return s.ISOWeek?tT(y):Nx(y,{locale:d,weekStartsOn:c})}},p=m[n](e,r==="after"?1:-1);r==="before"&&u?p=lz([u,p]):r==="after"&&f&&(p=cz([f,p]));var g=!0;if(a){var x=ey(p,a);g=!x.disabled&&!x.hidden}return g?p:l.count>b8?l.lastFocused:t_(p,{moveBy:n,direction:r,context:s,modifiers:a,retry:Me(Me({},l),{count:l.count+1})})}var n_=h.createContext(void 0);function w8(e){var t=jc(),n=e_(),r=h.useState(),s=r[0],a=r[1],o=h.useState(),l=o[0],c=o[1],u=v8(t.displayMonths,n),f=s??(l&&t.isDateDisplayed(l))?l:u,d=function(){c(s),a(void 0)},m=function(y){a(y)},p=yt(),g=function(y,v){if(s){var b=t_(s,{moveBy:y,direction:v,context:p,modifiers:n});nn(s,b)||(t.goToDate(b,s),m(b))}},x={focusedDay:s,focusTarget:f,blur:d,focus:m,focusDayAfter:function(){return g("day","after")},focusDayBefore:function(){return g("day","before")},focusWeekAfter:function(){return g("week","after")},focusWeekBefore:function(){return g("week","before")},focusMonthBefore:function(){return g("month","before")},focusMonthAfter:function(){return g("month","after")},focusYearBefore:function(){return g("year","before")},focusYearAfter:function(){return g("year","after")},focusStartOfWeek:function(){return g("startOfWeek","before")},focusEndOfWeek:function(){return g("endOfWeek","after")}};return i.jsx(n_.Provider,{value:x,children:e.children})}function ty(){var e=h.useContext(n_);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function k8(e,t){var n=e_(),r=ey(e,n,t);return r}var ny=h.createContext(void 0);function S8(e){if(!hf(e.initialProps)){var t={selected:void 0};return i.jsx(ny.Provider,{value:t,children:e.children})}return i.jsx(N8,{initialProps:e.initialProps,children:e.children})}function N8(e){var t=e.initialProps,n=e.children,r=function(a,o,l){var c,u,f;if((c=t.onDayClick)===null||c===void 0||c.call(t,a,o,l),o.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,a,o,l);return}(f=t.onSelect)===null||f===void 0||f.call(t,a,a,o,l)}
508,s={selected:t.selected,onDayClick:r};return i.jsx(ny.Provider,{value:s,children:n})}function r_(){var e=h.useContext(ny);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function j8(e,t){var n=yt(),r=r_(),s=Zx(),a=Jx(),o=ty(),l=o.focusDayAfter,c=o.focusDayBefore,u=o.focusWeekAfter,f=o.focusWeekBefore,d=o.blur,m=o.focus,p=o.focusMonthBefore,g=o.focusMonthAfter,x=o.focusYearBefore,y=o.focusYearAfter,v=o.focusStartOfWeek,b=o.focusEndOfWeek,w=function(P){var T,D,_,G;hf(n)?(T=r.onDayClick)===null||T===void 0||T.call(r,e,t,P):Sc(n)?(D=s.onDayClick)===null||D===void 0||D.call(s,e,t,P):Nc(n)?(_=a.onDayClick)===null||_===void 0||_.call(a,e,t,P):(G=n.onDayClick)===null||G===void 0||G.call(n,e,t,P)},j=function(P){var T;m(e),(T=n.onDayFocus)===null||T===void 0||T.call(n,e,t,P)},S=function(P){var T;d(),(T=n.onDayBlur)===null||T===void 0||T.call(n,e,t,P)},C=function(P){var T;(T=n.onDayMouseEnter)===null||T===void 0||T.call(n,e,t,P)},I=function(P){var T;(T=n.onDayMouseLeave)===null||T===void 0||T.call(n,e,t,P)},E=function(P){var T;(T=n.onDayPointerEnter)===null||T===void 0||T.call(n,e,t,P)},N=function(P){var T;(T=n.onDayPointerLeave)===null||T===void 0||T.call(n,e,t,P)},k=function(P){var T;(T=n.onDayTouchCancel)===null||T===void 0||T.call(n,e,t,P)},A=function(P){var T;(T=n.onDayTouchEnd)===null||T===void 0||T.call(n,e,t,P)},M=function(P){var T;(T=n.onDayTouchMove)===null||T===void 0||T.call(n,e,t,P)},L=function(P){var T;(T=n.onDayTouchStart)===null||T===void 0||T.call(n,e,t,P)},F=function(P){var T;(T=n.onDayKeyUp)===null||T===void 0||T.call(n,e,t,P)},V=function(P){var T;switch(P.key){case"ArrowLeft":P.preventDefault(),P.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":P.preventDefault(),P.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":P.preventDefault(),P.stopPropagation(),u();break;case"ArrowUp":P.preventDefault(),P.stopPropagation(),f();break;case"PageUp":P.preventDefault(),P.stopPropagation(),P.shiftKey?x():p();break;case"PageDown":P.preventDefault(),P.stopPropagation(),P.shiftKey?y():g();break;case"Home":P.preventDefault(),P.stopPropagation(),v();break;case"End":P.preventDefault(),P.stopPropagation(),b();break}(T=n.onDayKeyDown)===null||T===void 0||T.call(n,e,t,P)},U={onClick:w,onFocus:j,onBlur:S,onKeyDown:V,onKeyUp:F,onMouseEnter:C,onMouseLeave:I,onPointerEnter:E,onPointerLeave:N,onTouchCancel:k,onTouchEnd:A,onTouchMove:M,onTouchStart:L};return U}function C8(){var e=yt(),t=r_(),n=Zx(),r=Jx(),s=hf(e)?t.selected:Sc(e)?n.selected:Nc(e)?r.selected:void 0;return s}function T8(e){return Object.values(hr).includes(e)}function E8(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(T8(r)){var a=e.classNames["day_".concat(r)];a&&n.push(a)}}),n}function _8(e,t){var n=Me({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=Me(Me({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}
508function A8(e,t,n){var r,s,a,o=yt(),l=ty(),c=k8(e,t),u=j8(e,c),f=C8(),d=!!(o.onDayClick||o.mode!=="default");h.useEffect(function(){var C;c.outside||l.focusedDay&&d&&nn(l.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[l.focusedDay,e,n,d,c.outside]);var m=E8(o,c).join(" "),p=_8(o,c),g=!!(c.outside&&!o.showOutsideDays||c.hidden),x=(a=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&a!==void 0?a:ZH,y=i.jsx(x,{date:e,displayMonth:t,activeModifiers:c}),v={style:p,className:m,children:y,role:"gridcell"},b=l.focusTarget&&nn(l.focusTarget,e)&&!c.outside,w=l.focusedDay&&nn(l.focusedDay,e),j=Me(Me(Me({},v),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||b?0:-1,r)),u),S={isButton:d,isHidden:g,activeModifiers:c,selectedDays:f,buttonProps:j,divProps:v};return S}function P8(e){var t=h.useRef(null),n=A8(e.date,e.displayMonth,t);return n.isHidden?i.jsx("div",{role:"gridcell"}):n.isButton?i.jsx(ed,Me({name:"day",ref:t},n.buttonProps)):i.jsx("div",Me({},n.divProps))}function R8(e){var t=e.number,n=e.dates,r=yt(),s=r.onWeekNumberClick,a=r.styles,o=r.classNames,l=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(t),{locale:l});if(!s)return i.jsx("span",{className:o.weeknumber,style:a.weeknumber,children:f});var d=c(Number(t),{locale:l}),m=function(p){s(t,n,p)};return i.jsx(ed,{name:"week-number","aria-label":d,className:o.weeknumber,style:a.weeknumber,onClick:m,children:f})}function I8(e){var t,n,r=yt(),s=r.styles,a=r.classNames,o=r.showWeekNumber,l=r.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:P8,u=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:R8,f;return o&&(f=i.jsx("td",{className:a.cell,style:s.cell,children:i.jsx(u,{number:e.weekNumber,dates:e.dates})})),i.jsxs("tr",{className:a.row,style:s.row,children:[f,e.dates.map(function(d){return i.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:i.jsx(c,{displayMonth:e.displayMonth,date:d})},lU(d))})]})}function Z0(e,t,n){for(var r=n!=null&&n.ISOWeek?tT(t):Nx(t,n),s=n!=null&&n.ISOWeek?Qi(e):Vr(e,n),a=Tr(r,s),o=[],l=0;l<=a;l++)o.push(cn(s,l));var c=o.reduce(function(u,f){var d=n!=null&&n.ISOWeek?rT(f):iT(f,n),m=u.find(function(p){return p.weekNumber===d});return m?(m.dates.push(f),u):(u.push({weekNumber:d,dates:[f]}),u)},[]);return c}function M8(e,t){var n=Z0(Nn(e),Sx(e),t);if(t!=null&&t.useFixedWeeks){var r=uU(e,t);if(r<6){var s=n[n.length-1],a=s.dates[s.dates.length-1],o=Ym(a,6-r),l=Z0(Ym(a,1),o,t);n.push.apply(n,l)}}return n}function D8(e){var t,n,r,s=yt(),a=s.locale,o=s.classNames,l=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,d=s.weekStartsOn,m=s.firstWeekContainsDate,p=s.ISOWeek,g=M8(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:p,locale:a,weekStartsOn:d,firstWeekContainsDate:m}),x=(t=f==null?void 0:f.Head)!==null&&t!==void 0?t:QH,y=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:I8,v=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:GH;return i.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&i.jsx(x,{}),i.jsx("tbody",{className:o.tbody,style:l.tbody,children:g.map(function(b){return i.jsx(y,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),i.jsx(v,{displayMonth:e.displayMonth})]})}function O8(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var L8=O8()?h.useLayoutEffect:h.useEffect,kh=!1,F8=0;function X0(){return"react-day-picker-".concat(++F8)}function V8(e){var t,n=e??(kh?X0():null),r=h.useState(n),s=r[0],a=r[1];return L8(function(){s===null&&a(X0())},[]),h.useEffect(function(){kh===!1&&(kh=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function $8(e){var t,n,r=yt(),s=r.dir,a=r.classNames,o=r.styles,l=r.components,c=jc().displayMonths,u=V8(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),f=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[a.month],m=o.month,p=e.displayIndex===0,g=e.displayIndex===c.length-1,x=!p&&!g;s==="rtl"&&(t=[p,g],g=t[0],p=t[1]),p&&(d.push(a.caption_start),m=Me(Me({},m),o.caption_start)),g&&(d.push(a.caption_end),m=Me(Me({},m),o.caption_end)),x&&(d.push(a.caption_between),m=Me(Me({},m),o.caption_between));var y=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:qH;return i.jsxs("div",{className:d.join(" "),style:m,children:[i.jsx(y,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),i.jsx(D8,{id:f,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function z8(e){var t=yt(),n=t.classNames,r=t.styles;return i.jsx("div",{className:n.months,style:r.months,children:e.children})}function U8(e){var t,n,r=e.initialProps,s=yt(),a=ty(),o=jc(),l=h.useState(!1),c=l[0],u=l[1];h.useEffect(function(){s.initialFocus&&a.focusTarget&&(c||(a.focus(a.focusTarget),u(!0)))},[s.initialFocus,c,a.focus,a.focusTarget,a]);var f=[s.classNames.root,s.className];s.numberOfMonths>1&&f.push(s.classNames.multiple_months),s.showWeekNumber&&f.push(s.classNames.with_weeknumber);var d=Me(Me({},s.styles.root),s.style),m=Object.keys(r).filter(function(g){return g.startsWith("data-")}).reduce(function(g,x){var y;return Me(Me({},g),(y={},y[x]=r[x],y))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:z8;return i.jsx("div",Me({className:f.join(" "),style:d,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},m,{children:i.jsx(p,{children:o.displayMonths.map(function(g,x){return i.jsx($8,{displayIndex:x,displayMonth:g},x)})})}))}function B8(e){var t=e.children,n=hH(e,["children"]);return i.jsx(RH,{initialProps:n,children:i.jsx(UH,{children:i.jsx(S8,{initialProps:n,children:i.jsx(XH,{initialProps:n,children:i.jsx(t8,{initialProps:n,children:i.jsx(c8,{children:i.jsx(w8,{children:t})})})})})})})}function H8(e){return i.jsx(B8,Me({},e,{children:i.jsx(U8,{initialProps:e})}))}function W8({className:e,classNames:t,showOutsideDays:n=!0,...r}){return i.jsx(H8,{showOutsideDays:n,className:W("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
508ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:W(Tl({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:W(Tl({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({className:s,...a})=>i.jsx(aa,{className:W("h-4 w-4",s),...a}),IconRight:({className:s,...a})=>i.jsx(Bn,{className:W("h-4 w-4",s),...a})},...r})}W8.displayName="Calendar";var s_="AlertDialog",[q8]=zt(s_,[dE]),Ss=dE(),i_=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ss(t);return i.jsx(yc,{...r,...n,modal:!0})};i_.displayName=s_;var G8="AlertDialogTrigger",a_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ss(n);return i.jsx(cf,{...s,...r,ref:t})});a_.displayName=G8;var Y8="AlertDialogPortal",o_=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ss(t);return i.jsx(vc,{...r,...n})};o_.displayName=Y8;var K8="AlertDialogOverlay",l_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ss(n);return i.jsx(ma,{...s,...r,ref:t})});l_.displayName=K8;var c_="AlertDialogContent",[Q8,Z8]=q8(c_),u_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,a=Ss(n),o=h.useRef(null),l=Ae(t,o),c=h.useRef(null);return i.jsx(Q8,{scope:n,cancelRef:c,children:i.jsx(pa,{role:"alertdialog",...a,...s,ref:l,onOpenAutoFocus:se(s.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=c.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:r})})});u_.displayName=c_;var X8="AlertDialogTitle",d_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ss(n);return i.jsx(Ao,{...s,...r,ref:t})});d_.displayName=X8;var J8="AlertDialogDescription",f_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ss(n);return i.jsx(Po,{...s,...r,ref:t})});f_.displayName=J8;var e7="AlertDialogAction",h_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ss(n);return i.jsx(bc,{...s,...r,ref:t})});h_.displayName=e7;var m_="AlertDialogCancel",p_=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Z8(m_,n),a=Ss(n),o=Ae(t,s);return i.jsx(bc,{...a,...r,ref:o})});p_.displayName=m_;var t7=i_,n7=a_,r7=o_,g_=l_,x_=u_,y_=h_,v_=p_,b_=d_,w_=f_;const s7=t7,nae=n7,i7=r7,k_=h.forwardRef(({className:e,...t},n)=>i.jsx(g_,{className:W("fixed inset-0 z-[10000] bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));k_.displayName=g_.displayName;const S_=h.forwardRef(({className:e,...t},n)=>i.jsxs(i7,{children:[i.jsx(k_,{}),i.jsx(x_,{ref:n,className:W("fixed left-[50%] top-[50%] z-[10001] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
508nded-lg",e),...t})]}));S_.displayName=x_.displayName;const N_=({className:e,...t})=>i.jsx("div",{className:W("flex flex-col space-y-2 text-center sm:text-left",e),...t});N_.displayName="AlertDialogHeader";const j_=({className:e,...t})=>i.jsx("div",{className:W("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});j_.displayName="AlertDialogFooter";const C_=h.forwardRef(({className:e,...t},n)=>i.jsx(b_,{ref:n,className:W("text-lg font-semibold",e),...t}));C_.displayName=b_.displayName;const T_=h.forwardRef(({className:e,...t},n)=>i.jsx(w_,{ref:n,className:W("text-sm text-muted-foreground",e),...t}));T_.displayName=w_.displayName;const E_=h.forwardRef(({className:e,...t},n)=>i.jsx(y_,{ref:n,className:W(Tl(),e),...t}));E_.displayName=y_.displayName;const __=h.forwardRef(({className:e,...t},n)=>i.jsx(v_,{ref:n,className:W(Tl({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));__.displayName=v_.displayName;function a7({onFilesSelected:e,maxFiles:t=5,acceptedFileTypes:n={"image/*":[".png",".jpg",".jpeg"],"application/pdf":[".pdf"]},className:r,initialFiles:s=[]}){const[a,o]=h.useState(!1),l=h.useRef(null),[c,u]=h.useState(s);h.useEffect(()=>{u(s)},[s]);const f=y=>{y.preventDefault(),y.stopPropagation(),y.type==="dragenter"||y.type==="dragover"?o(!0):y.type==="dragleave"&&o(!1)},d=y=>{y.preventDefault(),y.stopPropagation(),o(!1),y.dataTransfer.files&&y.dataTransfer.files.length>0&&m(Array.from(y.dataTransfer.files))},m=y=>{const v=[],b=Object.values(n).flat();if(y.forEach(w=>{var S;const j="."+((S=w.name.split(".").pop())==null?void 0:S.toLowerCase());b.includes(j)&&v.push(w)}),v.length>0){const j=[...c,...v].slice(0,t);u(j),e(j)}},p=y=>{y.target.files&&y.target.files.length>0&&m(Array.from(y.target.files)),l.current&&(l.current.value="")},g=y=>{const v=c.filter((b,w)=>w!==y);u(v),e(v)},x=()=>{var y;(y=l.current)==null||y.click()};return i.jsxs("div",{className:W("w-full space-y-3",r),children:[i.jsxs("div",{className:W("flex flex-col items-center justify-center px-6 py-8 border-2 border-dashed rounded-lg transition-colors cursor-pointer bg-gray-50/50 hover:bg-gray-50",a?"border-primary bg-primary/5":"border-gray-300 hover:border-primary/50"),onDragEnter:f,onDragLeave:f,onDragOver:f,onDrop:d,onClick:x,children:[i.jsx(Pl,{className:"h-10 w-10 text-gray-400 mb-3"}),i.jsxs("div",{className:"text-sm text-center text-gray-600",children:[i.jsx("span",{className:"font-semibold text-primary hover:text-primary/80",children:"Click to upload"})," ","or drag and drop"]}),i.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported formats:"," ",Object.values(n).flat().join(", ")]})]}),c.length>0&&i.jsx("div",{className:"space-y-2",children:c.map((y,v)=>i.jsxs("div",{className:"flex items-center justify-between p-3 bg-white border border-gray-200 rounded-lg shadow-sm",children:[i.jsxs("div",{className:"flex items-center space-x-3 overflow-hidden",children:[i.jsx("div",{className:"p-2 bg-blue-50 rounded-md",children:i.jsx($n,{className:"h-4 w-4 text-blue-600"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-gray-700 truncate",children:y.name}),i.jsxs("p",{className:"text-xs text-gray-500",children:[(y.size/1024).toFixed(1)," KB"]})]})]}),i.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:b=>{b.stopPropagation(),g(v)},className:"text-gray-400 hover:text-red-500 hover:bg-red-50",children:i.jsx($t,{className:"h-4 w-4"})})]},`${y.name}-${v}`))}),i.jsx("input",{ref:l,type:"file",className:"sr-only",multiple:!0,accept:Object.values(n).flat().join(","),onChange:p})]})}var mf="Tabs",[o7]=zt(mf,[$d]),A_=$d(),[l7,ry]=o7(mf),P_=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,f=oa(l),[d,m]=jn({prop:r,onChange:s,defaultProp:a??"",caller:mf});return i.jsx(l7,{scope:n,baseId:Ot(),value:d,onValueChange:m,orientation:o,dir:f,activationMode:c,children:i.jsx(pe.div,{dir:f,"data-orientation":o,...u,ref:t})})});P_.displayName=mf;var R_="TabsList",I_=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,a=ry(R_,n),o=A_(n);return i.jsx(sN,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:i.jsx(pe.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});I_.displayName=R_;var M_="TabsTrigger",D_=h.forwardRef((e,t)=>
508{const{__scopeTabs:n,value:r,disabled:s=!1,...a}=e,o=ry(M_,n),l=A_(n),c=F_(o.baseId,r),u=V_(o.baseId,r),f=r===o.value;return i.jsx(iN,{asChild:!0,...l,focusable:!s,active:f,children:i.jsx(pe.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...a,ref:t,onMouseDown:se(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?o.onValueChange(r):d.preventDefault()}),onKeyDown:se(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&o.onValueChange(r)}),onFocus:se(e.onFocus,()=>{const d=o.activationMode!=="manual";!f&&!s&&d&&o.onValueChange(r)})})})});D_.displayName=M_;var O_="TabsContent",L_=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:a,...o}=e,l=ry(O_,n),c=F_(l.baseId,r),u=V_(l.baseId,r),f=r===l.value,d=h.useRef(f);return h.useEffect(()=>{const m=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(m)},[]),i.jsx(Lt,{present:s||f,children:({present:m})=>i.jsx(pe.div,{"data-state":f?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:m&&a})})});L_.displayName=O_;function F_(e,t){return`${e}-trigger-${t}`}function V_(e,t){return`${e}-content-${t}`}var c7=P_,$_=I_,z_=D_,U_=L_;const rae=c7,u7=h.forwardRef(({className:e,...t},n)=>i.jsx($_,{ref:n,className:W("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));u7.displayName=$_.displayName;const d7=h.forwardRef(({className:e,...t},n)=>i.jsx(z_,{ref:n,className:W("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));d7.displayName=z_.displayName;const f7=h.forwardRef(({className:e,...t},n)=>i.jsx(U_,{ref:n,className:W("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));f7.displayName=U_.displayName;function B_({title:e,subtitle:t,onBack:n,rightAction:r}){return i.jsxs("header",{className:"flex items-center gap-3 py-3",children:[i.jsx(Z,{type:"button",variant:"ghost",size:"icon",onClick:n,className:"h-11 w-11 flex-shrink-0 rounded-full hover:bg-muted active:scale-95","aria-label":"Go back to dashboard",children:i.jsx(aa,{className:"h-6 w-6"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h1",{className:"m-0 truncate text-xl font-bold tracking-tight text-gray-900 dark:text-white",children:e}),t&&i.jsx("p",{className:"truncate text-xs font-medium text-gray-500 dark:text-gray-400",title:t,children:t})]}),r&&i.jsx("div",{className:"flex-shrink-0",children:r})]})}function h7({onBack:e}){return i.jsx("div",{className:"min-h-screen bg-gray-50 pb-24 pt-3 dark:bg-background",children:i.jsxs("div",{className:"mx-auto flex w-full container-mobile flex-col gap-4",children:[i.jsx(B_,{title:"Team",subtitle:"Workspace members and access",onBack:e}),i.jsx("section",{className:"rounded-3xl border border-gray-100 bg-white p-5 shadow-sm dark:border-gray-800 dark:bg-gray-900",children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx(gt,{className:"h-3 w-24 rounded-full"}),i.jsx(gt,{className:"mt-3 h-7 w-44 rounded-xl"}),i.jsx(gt,{className:"mt-3 h-4 w-full rounded-lg"}),i.jsx(gt,{className:"mt-2 h-4 w-3/4 rounded-lg"})]}),i.jsx(gt,{className:"h-12 w-12 rounded-2xl"})]})}),i.jsx("section",{className:"grid grid-cols-3 gap-2",children:[1,2,3].map(t=>i.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white p-4 shadow-sm dark:border-gray-800 dark:bg-gray-900",children:[i.jsx(gt,{className:"h-6 w-14 rounded-full"}),i.jsx(gt,{className:"mt-4 h-8 w-10 rounded-xl"})]},t))}),i.jsx("div",{className:"rounded-2xl bg-gray-200/70 p-1 dark:bg-gray-800/80",children:i.jsx("div",{className:"grid grid-cols-3 gap-1",children:[1,2,3].map(t=>i.jsx(gt,{className:"h-10 rounded-xl"},t))})}),i.jsx("div",{className:"space-y-3",children:[1,2,3].map(t=>i.jsxs("div",{className:"rounded-3xl border border-gray-100 bg-white p-4 shadow-sm dark:border-gray-800 dark:bg-gray-900",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(gt,{className:"h-12 w-12 rounded-2xl"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(gt,{className:"h-5 w-36 rounded-lg"}),i.jsx(gt,{className:"mt-2 h-3 w-52 rounded-lg"}),i.jsxs("div",{className:"mt-4 flex gap-2",children:[i.jsx(gt,{className:"h-6 w-20 rounded-full"}),i.jsx(gt,{className:"h-6 w-16 rounded-full"})]})]})]}),i.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-2",children:[i.jsx(gt,{className:"h-11 rounded-2xl"}),i.jsx(gt,{className:"h-11 rounded-2xl"})]})]},t))})]})})}function m7({onBack:e}){return i.jsx("div",{className:"min-h-screen bg-gray-50 pb-24 pt-3 dark:bg-background",children:i.jsxs("div",{className:"mx-auto flex w-full container-mobile flex-col gap-4",children:[i.jsx(B_,{title:"Settings",subtitle:"Manage your account",onBack:e}),i.jsx("section",{className:"rounded-3xl border border-gray-100 bg-white p-5 shadow-sm dark:border-gray-800 dark:bg-gray-900",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx(gt,{className:"h-20 w-20 rounded-full"}),i.jsx(gt,{className:"mt-4 h-6 w-40 rounded-xl"}),i.jsx(gt,{className:"mt-2 h-4 w-56 rounded-lg"})]})}),i.jsx("section",{className:"space-y-3",children:[1,2,3,4].map(t=>i.jsx("div",{className:"rounded-2xl border border-gray-100 bg-white p-4 shadow-sm dark:border-gray-800 dark:bg-gray-900",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(gt,{className:"h-10 w-10 rounded-xl"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(gt,{className:"h-4 w-32 rounded-lg"}),i.jsx(gt,{className:"mt-1.5 h-3 w-48 rounded-lg"})]}),i.jsx(gt,{className:"h-5 w-5 rounded"})]})},t))}),i.jsxs("section",{className:"rounded-2xl border border-gray-100 bg-white p-4 shadow-sm dark:border-gray-800 dark:bg-gray-900",children:[i.jsx(gt,{className:"h-4 w-28 rounded-lg"}),i.jsxs("div",{className:"mt-3 space-y-2",children:[i.jsx(gt,{className:"h-3 w-full rounded-lg"}),i.jsx(gt,{className:"h-3 w-4/5 rounded-lg"}),i.jsx(gt,{className:"h-3 w-3/5 rounded-lg"})]})]})]})})}const p7=h.lazy(()=>ce(()=>import("./dashboard-kWDBVpCo.js"),__vite__mapDeps([91,1,92,93,94,95,96,97,8,98,45,11,99,100,70,101,102,103,104,105,106,107,108,109,110,111,112,113,6,83,114,115]))),g7=h.lazy(()=>ce(()=>import("./mobile-dashboard-calendar-CcCP3iL7.js"),__vite__mapDeps([116,1,93,94,106,107,95,96,97,8,98,45,11,102,108,109]))),x7=h.lazy(()=>ce(()=>import("./mobile-dashboard-mail-C9e74Znl.js"),__vite__mapDeps([117,1,100,97,98,45,93,94,70,101,
508102,103,104,105,11]))),y7=h.lazy(()=>ce(()=>import("./mobile-sync-settings-B6XkM7dm.js"),__vite__mapDeps([118,1,115,93,94]))),v7=h.lazy(()=>ce(()=>import("./files-D0d35WiI.js"),__vite__mapDeps([119,1,120,84,121,52,83,45,108,12,24]))),b7=h.lazy(()=>ce(()=>import("./file-history-CK-Gx_l6.js"),__vite__mapDeps([122,1,123,45]))),w7=h.lazy(()=>ce(()=>import("./super-admin-B_gLlqAB.js"),__vite__mapDeps([124,1,125,58,113,11,126,127,110,109,70,45,102,128,105,6,41,42,129,12,69,32,26,27,90,130]))),k7=h.lazy(()=>ce(()=>import("./organization-admin-Dk_-H6DN.js"),__vite__mapDeps([131,1,99,86]))),S7=h.lazy(()=>ce(()=>import("./analytics-JOA_m9vc.js"),__vite__mapDeps([132,1,92,70,12,133,41,39,129,42,50]))),N7=h.lazy(()=>ce(()=>import("./properties-new-DhCu9AGM.js"),__vite__mapDeps([134,1,135,136,15]))),j7=h.lazy(()=>ce(()=>import("./PropertyDetailPage-CLJB4tzf.js"),__vite__mapDeps([137,1,135,136,133,70]))),C7=h.lazy(()=>ce(()=>import("./activity-ledger-enhanced-wV0xdVxu.js"),__vite__mapDeps([138,1,102,47,123,109,112,120,84,121,52,83,45,5,85,86,24]))),T7=h.lazy(()=>ce(()=>import("./team-DrGdn2p5.js"),__vite__mapDeps([139,1,67,102,75,34,96,23]))),E7=h.lazy(()=>ce(()=>import("./automation-BTOkvwvP.js"),__vite__mapDeps([140,1,103,104,102,70,130]))),_7=h.lazy(()=>ce(()=>import("./rules-management-BeFNCv0L.js"),__vite__mapDeps([141,1,142,86,97,6,70,75,94]))),A7=h.lazy(()=>ce(()=>import("./rules-management-test-Dsz1JM22.js"),__vite__mapDeps([143,1,142,86,97,6,70,75,94]))),P7=h.lazy(()=>ce(()=>import("./RulesManagementSimplified-ClF6zTCE.js"),__vite__mapDeps([144,1,102,104,70,130]))),R7=h.lazy(()=>ce(()=>import("./TestCalendar-nvC7VkIN.js"),__vite__mapDeps([145,1,107,102,95,96,97,8,98,45,11,109,108])).then(e=>({default:e.TestCalendar}))),I7=h.lazy(()=>ce(()=>import("./test-dashboard-uPuqspfE.js"),__vite__mapDeps([146,1,93,94,97,101,107,102,108,109,70,12,105]))),M7=h.lazy(()=>ce(()=>import("./affiliate-dashboard-DpvQl2Ns.js"),__vite__mapDeps([147,1,34,128,24]))),D7=h.lazy(()=>ce(()=>import("./affiliate-settings-BbRcSi9t.js"),__vite__mapDeps([148,1,6,114,126]))),O7=h.lazy(()=>ce(()=>import("./test-fixes-BWV-Y8J_.js"),__vite__mapDeps([149,1,45]))),L7=h.lazy(()=>ce(()=>import("./file-preview-demo-MxgUIuqc.js"),__vite__mapDeps([150,1,84,121,52,83]))),F7=h.lazy(()=>ce(()=>import("./AcceptInvitePage-Wuqgi1dW.js"),__vite__mapDeps([66,1,67]))),V7=h.lazy(()=>ce(()=>import("./settings-BqNGqJTJ.js"),__vite__mapDeps([151,1,47,12,102,23,24,89,90,127]))),$7=h.lazy(()=>ce(()=>import("./manage-subscription-Bh0p4rVG.js"),__vite__mapDeps([152,1,111,110]))),z7=h.lazy(()=>ce(()=>import("./welcome-tour-D6ksZPF3.js"),__vite__mapDeps([153,1]))),U7=h.lazy(()=>ce(()=>import("./BlogAdminPage-COCm83uq.js"),__vite__mapDeps([125,1,58,113,11,126,127,110])));function B7(){const[e,t]=pt(),n=mi(),r=()=>{t("/dashboard"),xs("/dashboard")};if(n){if(e==="/dashboard")return i.jsx(kT,{});if(e==="/activity-ledger")return i.jsx(ST,{});if(e==="/properties")return i.jsx(NT,{});if(e==="/files")return i.jsx(jT,{});if(e==="/team")return i.jsx(h7,{onBack:r});if(e==="/settings")return i.jsx(m7,{onBack:r})}else return i.jsx("div",{className:"min-h-screen"})}function H7(){const{isAdmin:e,user:t}=At();return i.jsx(h.Suspense,{fallback:i.jsx(B7,{}),children:i.jsxs(Cu,{children:[i.jsx(We,{path:"/dashboard/calendar",component:g7}),i.jsx(We,{path:"/dashboard/mail",component:x7}),i.jsx(We,{path:"/dashboard/sync-settings",component:y7}),i.jsx(We,{path:"/dashboard",component:p7}),i.jsx(We,{path:"/test-dashboard",component:I7}),i.jsx(We,{path:"/properties",component:N7}),i.jsx(We,{path:"/properties/:id",component:j7}),i.jsx(We,{path:"/activity-ledger",component:C7}),i.jsx(We,{path:"/analytics",children:i.jsx(bm,{children:i.jsx(S7,{})})}),i.jsx(We,{path:"/files",component:v7}),i.jsx(We,{path:"/file-history",component:b7}),i.jsx(We,{path:"/team",component:T7}),i.jsx(We,{path:"/accept-invite/:token",component:F7}),i.jsx(We,{path:"/settings",component:V7}),i.jsx(We,{path:"/automation",component:E7}),i.jsx(We,{path:"/rules-management",component:_7}),i.jsx(We,{path:"/rules-management-test",component:A7}),i.jsx(We,{path:"/rules-simplified",component:P7}),i.jsx(We,{path:"/manage-subscription",component:$7}),i.jsx(We,{path:"/affiliate/dashboard",component:M7}),((t==null?void 0:t.role)==="org_admin"||(t==null?void 0:t.role)==="super_admin")&&i.jsx(We,{path:"/organization-admin",component:k7}),e&&i.jsx(We,{path:"/super-admin",component:w7}),e&&i.jsx(We,{path:"/super-admin/affiliate-settings",component:D7}),e&&i.jsx(We,{path:"/admin/blog",component:U7}),i.jsx(We,{path:"/test-fixes",component:O7}),i.jsx(We,{path:"/test-analytics",component:h.lazy(()=>ce(()=>import("./test-analytics-DWZ0gMMZ.js"),__vite__mapDeps([154,1])))}),i.jsx(We,{path:"/test-calendar",component:R7}),i.jsx(We,{path:"/file-preview-demo",component:L7}),i.jsx(We,{path:"/onboarding",children:()=>null}),i.jsx(We,{path:"/welcome-tour",component:z7}
508),i.jsx(We,{component:()=>Le()?i.jsx(el,{to:"/dashboard"}):i.jsx(_S,{})})]})})}const W7=h.lazy(()=>ce(()=>import("./AgenticOnboarding-DtBgazvw.js"),__vite__mapDeps([79,1,11,34])));function J0(){return i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full"})})}function q7({userData:e,isUserDataLoading:t,location:n}){const[r]=pt(),s=n??r;return t||!e?i.jsx(We,{path:"/onboarding",children:()=>i.jsx(J0,{})}):e.hasCompletedOnboardingForm===!0?(s==="/onboarding"&&window.location.replace("/dashboard"),null):i.jsx(We,{path:"/onboarding",children:()=>i.jsx(h.Suspense,{fallback:i.jsx(J0,{}),children:i.jsx(W7,{onComplete:()=>{window.location.href="/dashboard"}})})})}function G7({items:e,isExpanded:t,location:n,setLocation:r}){return i.jsx("nav",{className:"space-y-4 mt-4",role:"navigation",children:e.map(s=>{const a=s.icon,o=n===s.path;return s.disabled?i.jsxs("div",{className:`flex items-center rounded-md text-base font-medium transition-colors group
509                ${t?"px-3 py-2.5":"px-0 py-2 justify-center"}
510                ${o?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100":"text-blue-700 dark:text-blue-200"}
511                opacity-50 cursor-not-allowed
512              `,children:[i.jsx(a,{className:"w-5 h-5 flex-shrink-0"}),t&&i.jsxs("span",{className:"ml-2.5 truncate flex items-center gap-2",children:[s.label,i.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-gray-300 dark:bg-gray-700 rounded-md",children:"Coming Soon"})]})]},s.path):i.jsxs(Ce,{href:s.path,className:`flex items-center rounded-md text-base font-medium transition-colors group ${t?"px-3 py-2.5":"px-0 py-2 justify-center"} ${o?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100 hover:no-underline focus:no-underline":"text-blue-700 hover:bg-blue-50 hover:text-blue-800 dark:text-blue-200 dark:hover:bg-blue-900/50 dark:hover:text-blue-100 hover:no-underline focus:no-underline"}`,onClick:l=>{l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||l.button!==0||(l.preventDefault(),r(s.path),xs(s.path))},"aria-current":o?"page":void 0,"aria-label":t?void 0:s.label,"data-testid":"nav-"+s.path.replace("/","")||"dashboard",title:t?void 0:s.label,children:[i.jsx(a,{className:"w-5 h-5 flex-shrink-0"}),t&&i.jsx("span",{className:"ml-2.5 truncate",children:s.label})]},s.path)})})}const Y7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAD21JREFUeJztnWmUFcUVgL8ZhmVYlAFUREXCorJolBhjREFiYow5RBP33agct4gSzAlRT0KI0bjEJRoFE02MGuMalyxyXDAooLgrsioqioogIDsyzMuP+x5036ru1/1ed795Q33n1NHHdFfdrq6u5da9t8DhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD0aKoqbQAMegGHAAMAXYHdgN6Ak3AtcD4jOW5Cjgf2AQsAOYBbwNTgReANRnL0+KoB34ETEQqtgnIhaQ9MpRt3yKybEQawbXAIUBdhrJVNfXACOBvwErCK1mnEzKUc2RM2T5HnmkE0DZDOauCdsCJwD+BdcSrWG/6ZYYyX1WGnCuAu4EfAK0zlLnZMRi4GVhO9MpbBDwIjMF8CXdlKPtDquyrgZ/mZVsU4TkK6ZP8vVkOXz6yngS2Bo4BRiPjaDE+BR4B/gdMAxZ6/jYEeN7z+1XgZKBrPnXJ/7cb0JAvu2P+2nqk5/GyHumBAFYBjcAypPvW6WGgv+feocBznt89kQnrMOBIoHuEZ50C3Ag8ikwsWxSdgZ8DHxLtK78JqbzagPzqgeMj5JVVOjEvk43a/LPcRLTe4V3gIqBTQH5VxbbAryjeza8AbgUOJPil90Z6jieAtUXyq0Ram5dtdF5WG7X5Z7w1/8xh+S0FfkGVNoSOyKRsGeEP+SxwCsFfzw7ABcB0ii8Dm1uaDowiuPtvD5yKDG9RGkKHgHzKIuk5QC1wOnA5sGPANRuAe4EbgDcsf28HHAuchKyhW8UofxmwGFiCzB8K/78e+CJ/zdq8DE2ef9s2L3tb5MUU/q0dsB3SELt7/r9LDJk2Ac8A9wD35WXR7I10+8cTvExcBFyKTHabYpSfGQciE7GglvwF8FukAm30Qmb2S0Py8KYFwASkofQC2iT+RMG0AXZFdA+3AO9ElHkp8oy9AvLtDlxBuA7kFaSumxXfRFq2TeDlwK8J/mr6I0qSjQH3F1IT8DJwGbBXSs9RDoOAS4AZFB+uNiLP3N+ak9TVeILnCeuROm82PIUp5DpkjdsQcE9fpEvcZLnXm2Yg84Cd0xM/cXog+wQvEv5sm5A66BuQTwNwDfaP66n0xI+HTS9+D8HdXAPwe2QcDqqYzxE9+sAU5c6KAchLDBvaNgDXEfyx9ELqVN8XRZeSOg/gF+rJkGtPQCZlQRUxFziXLROxlkR74BxgDsHPvwTRKQTxpLr+/hTljUQ/RGPmFeq7lut2QLRnQQ8+E9GYBekAWhK1yLO+RXB9PIJ9+Xiouq6R4OEjEyYqgV7HXFr2QZZktgd9D1kLbw0vXlOLPPt72OtmMfaX+5q6bkIWwtrYEXP37mTLdeMxH24DoiHMcunWXGmD1IVtTmQzcjlRXbOO4KV1qvxOCfIB9u1NLfCLyJLJ4WcgYkTirauTLNfVYfYaV2Qk42bqMdW8owOurQEuBiYhE7w4mr2tjVbIRHESUmdBmtpRmKumIHV6KpymBFhGlW5aVCntMVdTp2QpwFRV+LVZFu4AzCH4+fDLk2NPVXCOYJWmIz16Y2pRM5lb3awKfTaLQh1WtAr+xrQLtE3+bDNVRzYci/9dLCdlLeoZlgIznX06fLTBVLKdlmaB01VhN6RZmCMSejI4La2C+mBO/lrCbl21Y5sM9ot6cxwd/PHq93TEZctRWRZgTsSPSaMgvXt1QRqFOEriLPzvxmZrWRb9VQGbEKsXR/OgAXMzaUCUG6MOAdpIYQrwcVTpHKmzHNMQ59gkC5iLv3Wdk2TmjkQ4Bf87mpNUxoNVxo3A9kll7kiMTpgeU18tdlOUIUDPKCcDn8WVzpE6qxDXNC+JDANv4m9VZyWRqSMVtGr49XIz3Bm/k0MTFTI/ckSiI34fgiZgp7Abig0Bh+G3SnkVMVZ0NE9WI7YaBWqwW2lvJkoD8PLfEoRyZIt+R/odRqYO06//gNLlcmTEQPzvbAUhsYjC3MOHIr7rBZYjy7/G8mWMTWckZNwByJjWCfgI8cp9kAQmOyUyOC9XX2S+tCov1zQk6NWKCsn1PuK9XOAgSjAZuwJ/S7ovCcli0oC4Xwd5Hnt138MzlOtbmKsjndYj1lOdM5SrwK1KlstLyeRllcmPk5IuIsMRfUNYJes0kXSDMtYBf4op02IkRlCWjFAyvBw3g06YPn9Zbv4cQekxAx/FjACWBO2Ax0uUaR0SFzArOuDfHGokptm+dkKcl7CAYeyFPQjUQmRYOgY4HHEymYQ9vsAtKcil/SALu6JP5GU5HFHEXIk9GtpaxKI6K7T11nfi3DxO3XxHwsIFUQ/MVmU3IaFlgmLnDEFCq+kKPzJBuY625P9Ovmwb7ZCGoCOFvE06vZONa1TZ4+LcrP3Qz0hYuCB+glnRUXYeeyC9lPe+uSTjhlaHGQNoHtGGxPMxn+e8BGSKwpGq3LC4DT5aIQGdvDfvloKAmtZIN19qzzMY0ygiiQDSJ6k8NwD7xLj/TnV/kBNt0nTD3wOtIuIEeR/8An9GNiFlh6ty1yBh2eKgx+lHE5DrXyrPuPOL7THnNEMTkCsK2o7DaLg2VbAe157L35w2h6rf/0AcIONwk/o9nPJiELQBDlb/9seYeXyGGcolVD+fIFr5Y8xZbA1Aq3uzcjrcT/2eVEIeM5GAigU6UZ7f4kD8ETo/pDRLaL1P/42SJYrHVPU7UgPQF2XVAHRk0VItW98skm8cdJwenXdU9H1RoocngX53B+kLdAPYCQl1XmAN2enZu6nfy0rMZ6n6HXce4aU5yhSH+fitt3YCdvFeoBuADkH6AhLVMgtWqd+lOjnqoMorS8wHZH/dS3OQKQ45igwDugFUavwH09BkF+tVxdH3lWO/qGUqNVppkjLFpawG8ELi4gQzV/0uZam0Df6lThPSDZbKPPyRuQez5dSROAxTvxMz2Y6AfodB2kvqMQM2ZzVWgRlNbDbx4weerfJ4KQG5XlF5xtWK1iArB28exyUgV1Q64N/YayRgKNsPv5AfZCRggW6Y+/5Hxbi/PeaeQBIniY1Tec4h3tFvtrh+XROQKw4zlQz72y7SX8/DWUnnYYKSYTHRl3HaCGI1yfRg2yOrIW/e10W8tydmkOi4iqQk0Oroc20X6cq/NCvpPPTCVJvOwW/epKkDrlf35JDACUlxtSX/cYSryHdHXLe1ert
512nyD1poeMKTrRdpKNUZqWu1JyDWdkrkVPHvD4JbZEhwnZKyesku+1ajyimdDnPISps765jb8QEy2bTMDJBmeIwRMkxQ1/QCrOby3ICqLkDs/IKE5gPkVCp2mLJO2ykcRDjHvm8bWWuRnqqsJPA/pyCTFFpj7++1qF2JAfgFzbrCaCmBgk+GVSZQel9pOtNi95EPx/Im/5A5SOi64mgL6ag3vOuxATQxgjkpRar4CbkDB6tuk2DBiQeX1AP5E2LkJDwzQE9EfSFltVf27iMhQujA2KRPAlRF3uHg/nIKVyViD4+KF/2fPyNoeClezopnfVXImPwv2PfSuZp9cdUggwlRAOikk3T/DsudYhMlfABiMph+N/xZO8f9eTGhX9reeyC/x1vNrbprP7wJe4kj5ZIDeYqpUst5qx5PtIISqE7cuDRa2Sr727pnI0sfSdTuiIph+yveNkNZJbqbRXlHEX2d5XXlVR++VPN1GGquB8oI7/bVV6n1mKafOtt2Tjo/fKxiGVu1psfLYEeSDh47RdRTl1aewB98GM5TqCHYPfpWwh8u4x8tzaOwu4Yu5Lyzgz+IZbeXu93DyujAJCtxo8xhc8Bd+NiDIWxK8EOqO9Svr5jL5XnS2DGm0/iJMqdMd3LC2kZMqlxp4dtoS3wM2RPwVZnz5DMMNqg8l0EZpf9PMGHGMehHXJIdNDp4LMRFfTW3BDaIr6C2iWukDYg2/JJKL06IBpKb/6rAR6zFPwG5dnTexmKuS+uG8LJbF26h46I42jQi88hvgR7J1ReN8zt/hwy3LANW9y/9JjTJyEBOiK+/WFBHz4BfkPp1sDVwADEfU0733rTCuTQyKQ+iJ6YLvc5pEFs7uk7YLqE55D5QZKxd3oDD1nK8aZG4N/IbtU2CZZdKXogFjnTCH/ujcBtJBuH+SBknNdlTcYSMaQd9uGgERmHklTo7JsvSwdQ0GkdolkcSZGIl82MPRELpikEz4EK6UvEACap3hZE7TsW08o7B/yHkIO+WmNq87w3Jq3Q2Qe4i+JRwAppLlJZ5yJeu5W0WgL5KPog8X/GIr1bkNWQrau/HvhKwjJ1xXRpL6QHiDC0FA57trWejxBlQtLsAFyGPdRLsbQE6dL+gtgxnInY6Q3I5xvHhFvTCRlDByMveRRiO3E/oj/RZnRR0gxEu1eKg0kxjkbeUVAvHivOwzBMHUEhPUY61q01yLg1kWBlUilpDVIx8xH9RCFNRyZDhd9vI41wMdI1J1X+W0ico0jHuJRAb6SHDvpAYgWI8tID0QvYMl6N9BTlfGFh1ABfB8YDswJkaM7pFWA0yY7tmvZIz2mzQM4BL5LAh9oa6T6ClnALEWVGWg0BpMv1lrkM8dtL8istNa1Heg7tAPJ4KjUhdEA0h0HzjQ3IkjrRd9IX87DiLBrCwZayCgaNrZFDEr8PXIjY6N2FzAlmA58TzXgzKG1ANmVm5Z/9TqQrPx/xm+jNFk2mdgHLAd9LsiKQZfFYpFsPknkK6Q01gFR+WAjXJciRskXPq4lAK0yHjKnED1rVEVlG9gO+5kn7I+FaCr/3Rl7qjsQ/E7kGU6E2h/IVOjWINvWvBO8VFHrFkWQT0IsGZGwOc4QojIOjKF27d57KbxOiQ2iuDMZc948pMa9BiHNrMT+E1UhQyIosiTsDv8I8Ul6nJmTr8RKiG5x2wRxXK+ldE5Xb8Mv8BdG2wFsh8RmuRlYrxYanVYj/Y6V1IYCMTZcgHkVRxtZFiG3AWQQfdHyzumcF1XFc3XaYB23cbrmuFdKbXYwobsL2B7zpU8T3MAsnmNjUIpOj+4iu3cshs9lJSIs+Dpk8aUXU6Ayfo1wuwhy6TkDsICYguoc4SqSNiGndEWQTZTQRuiKxf5/GrlWMk2ZRRQ+OyKqjgsRNmxAdzBiyCyuXGl0Q6+MHCZ/JBiUdRbQa0CH3o6S1yJd+JtUx3JVEHbLkuhBR8IStaXPI2TvVyiOEP9tKZBt+HGI0m1Uo+c1ksmYsQg3inDIIWSEUUj9k5XA0YixSjWwH3IsEaFiADAuz8v+diexuNgXe7XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwxOX/dU2LFzKT2tUAAAAASUVORK5CYII=",K7="/assets/darkdc-DS6cy02Z.png";function Q7({isExpanded:e,onSupportClick:t}){return i.jsx("div",{className:"mt-auto pt-6",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("button",{className:`flex items-center w-full rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-gray-100 transition-colors group hover:no-underline focus:no-underline ${e?"px-3 py-1.5":"px-0 py-2 justify-center"}`,onClick:t,"data-testid":"button-support-feedback","aria-label":e?void 0:"Submit Bug / Feedback",title:e?void 0:"Submit Bug / Feedback",children:[i.jsx(SS,{className:"w-4 h-4 flex-shrink-0"}),e&&i.jsx("span",{className:"ml-2.5 truncate",children:"Submit Bug / Feedback"})]}),i.jsxs("button",{className:`flex items-center w-full rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-gray-100 transition-colors group hover:no-underline focus:no-underline ${e?"px-3 py-1.5":"px-0 py-2 justify-center"}`,onClick:()=>{window.open(`https://mail.google.com/mail/?view=cm&fs=1&[email protected]&su=${encodeURIComponent("RepsShield App Support")}`,"_blank")},"data-testid":"button-email-support","aria-label":e?void 0:"Email Support",title:e?void 0:"Email Support",children:[i.jsx(lg,{className:"w-4 h-4 flex-shrink-0"}),e&&i.jsx("span",{className:"ml-2.5 truncate",children:"Email Support"})]}),i.jsxs("button",{className:`flex items-center w-full rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-gray-100 transition-colors group hover:no-underline focus:no-underline mb-8 ${e?"px-3 py-1.5":"px-0 py-2 justify-center"}`,onClick:()=>{window.open("https://discord.gg/FG5sCYYXmd","_blank","noopener,noreferrer")},"data-testid":"button-discord-community","aria-label":e?void 0:"Join Discord Community",title:e?void 0:"Join Discord Community",children:[i.jsx("img",{src:Y7,alt:"","aria-hidden":"true",className:"w-4 h-4 flex-shrink-0 dark:hidden"}),i.jsx("img",{src:K7,alt:"","aria-hidden":"true",className:"w-4 h-4 flex-shrink-0 hidden dark:block"}),e&&i.jsx("span",{className:"ml-2.5 truncate",children:"Join Discord Community"}),e&&i.jsx(zi,{className:"w-3 h-3 ml-auto flex-shrink-0"})]}),i.jsxs("a",{href:"/docs/api",target:"_blank",rel:"noopener noreferrer",className:`flex items-center w-full rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-gray-100 transition-colors group hover:no-underline focus:no-underline mb-8 ${e?"px-3 py-1.5":"px-0 py-2 justify-center"}`,"data-testid":"link-api-guide","aria-label":e?void 0:"API Guide",title:e?void 0:"API Guide",children:[i.jsx(kD,{className:"w-4 h-4 flex-shrink-0"}),e&&i.jsx("span",{className:"ml-2.5 truncate",children:"API Guide"}),e&&i.jsx(zi,{className:"w-3 h-3 ml-auto flex-shrink-0"})]}),i.jsxs("a",{href:"/changelog",target:"_blank",rel:"noopener noreferrer",className:`flex items-center w-full rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-gray-100 transition-colors group hover:no-underline focus:no-underline mb-8 ${e?"px-3 py-1.5":"px-0 py-2 justify-center"}`,"data-testid":"link-changelog","aria-label":e?void 0:"Change Log",title:e?void 0:"Change Log",children:[i.jsx($n,{className:"w-4 h-4 flex-shrink-0"}),e&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"ml-2.5 truncate",children:"Change Log"}),i.jsx(zi,{className:"w-3 h-3 ml-auto flex-shrink-0 opacity-50"})]})]})]})})}function Z7({navigationItems:e,isExpanded:t,onToggle:n,showSupportDialog:r,onSupportClick:s,location:a,setLocation:o}){return i.jsxs("aside",{className:`hidden md:flex flex-col bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700 transition-[width] duration-200 overflow-hidden ${t?"w-72":"w-16"}`,children:[i.jsxs("div",{className:"h-16 px-4 flex items-center justify-between border-b border-gray-200 dark:border-gray-700",children:[t&&i.jsxs(Ce,{href:"/dashboard",className:"flex items-center gap-3 min-w-0 hover:opacity-80 transition-opacity hover:no-underline focus:no-underline",onClick:()=>{o("/dashboard"),xs("/dashboard")},children:[i.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield Logo",className:"w-8 h-8 flex-shrink-0"}),i.jsx("span",{className:"font-semibold text-lg text-gray-900 dark:text-white truncate",children:"REPSShield"})]}),i.jsx(Z,{variant:"ghost",size:"icon",className:t?"ml-auto":"mx-auto",onClick:n,"aria-expanded":t,"aria-label":t?"Collapse sidebar":"Expand sidebar","data-testid":"button-sidebar-toggle",children:i.jsx(Pd,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"flex-1 flex flex-col p-4 overflow-y-auto",children:[i.jsx(G7,{items:e,isExpanded:t,location:a,setLocation:o}),i.jsx(Q7,{isExpanded:t,onSupportClick:s})]})]})}const X7=yc,J7=cf,eW=vc,H_=h.forwardRef(({className:e,...t},n)=>i.jsx(ma,{className:W("fixed inset-0 z-[9998] bg-black/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));H_.displayName=ma.displayName;const tW=So("fixed z-[9999] gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),W_=h.forwardRef(({side:e="right",className:t,children:n,...r},s)=>i.jsxs(eW,{children:[i.jsx(H_,{}),i.jsxs(pa,{ref:s,className:W(tW({side:e}),t),...r,children:[n,i.jsxs(bc,{className:"absolute right-4 top-4 roun
512ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[i.jsx($t,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));W_.displayName=pa.displayName;const nW=h.forwardRef(({className:e,...t},n)=>i.jsx(Ao,{ref:n,className:W("text-lg font-semibold text-foreground",e),...t}));nW.displayName=Ao.displayName;const rW=h.forwardRef(({className:e,...t},n)=>i.jsx(Po,{ref:n,className:W("text-sm text-muted-foreground",e),...t}));rW.displayName=Po.displayName;var sW="Separator",ew="horizontal",iW=["horizontal","vertical"],q_=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=ew,...s}=e,a=aW(r)?r:ew,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return i.jsx(pe.div,{"data-orientation":a,...l,...s,ref:t})});q_.displayName=sW;function aW(e){return iW.includes(e)}var G_=q_;const sy=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>i.jsx(G_,{ref:s,decorative:n,orientation:t,className:W("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));sy.displayName=G_.displayName;function Y_({open:e,onOpenChange:t}){const[n,r]=h.useState("bug"),[s,a]=h.useState(""),[o,l]=h.useState(""),[c,u]=h.useState(""),{user:f}=At(),{toast:d}=Ht(),m=Dt({mutationFn:async x=>await Ze("POST","/api/support/feedback",x),onSuccess:()=>{d({title:"Feedback Submitted",description:"Thank you for your feedback! We'll review it and get back to you if needed."}),a(""),l(""),u(""),r("bug"),t(!1)},onError:x=>{d({title:"Submission Failed",description:"Failed to submit feedback. Please try the email option or contact us directly.",variant:"destructive"})}}),p=x=>{if(x.preventDefault(),!s.trim()||!o.trim()){d({title:"Missing Information",description:"Please fill in both the subject and description fields.",variant:"destructive"});return}m.mutate({type:n,subject:s.trim(),description:o.trim(),userEmail:(f==null?void 0:f.email)||c.trim()})},g=x=>{switch(x){case"bug":return i.jsx(Dv,{className:"h-4 w-4"});case"feature_request":return i.jsx(Lv,{className:"h-4 w-4"});case"issue":return i.jsx(ms,{className:"h-4 w-4"});default:return i.jsx(lu,{className:"h-4 w-4"})}};return i.jsx($r,{open:e,onOpenChange:t,children:i.jsxs(ur,{className:"sm:max-w-[500px]","data-testid":"dialog-support-feedback",children:[i.jsx(dr,{children:i.jsxs(fr,{className:"flex items-center gap-2",children:[i.jsx(lu,{className:"h-5 w-5"}),"Submit Bug Report / Feedback"]})}),i.jsxs("form",{onSubmit:p,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ge,{htmlFor:"feedback-type",children:"Type of Feedback"}),i.jsxs(ai,{value:n,onValueChange:x=>r(x),children:[i.jsx(ys,{"data-testid":"select-feedback-type",children:i.jsx(oi,{})}),i.jsxs(vs,{children:[i.jsx(Kt,{value:"bug",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Dv,{className:"h-4 w-4"}),"Bug Report"]})}),i.jsx(Kt,{value:"feature_request",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Lv,{className:"h-4 w-4"}),"Feature Request"]})}),i.jsx(Kt,{value:"issue",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ms,{className:"h-4 w-4"}),"Technical Issue"]})}),i.jsx(Kt,{value:"general_feedback",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(lu,{className:"h-4 w-4"}),"General Feedback"]})})]})]})]}),!(f!=null&&f.email)&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ge,{htmlFor:"contact-email",children:"Your Email"}),i.jsx(dt,{id:"contact-email",type:"email",value:c,onChange:x=>u(x.target.value),placeholder:"[email protected]",required:!(f!=null&&f.email),"data-testid":"input-contact-email"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ge,{htmlFor:"feedback-subject",children:"Subject"}),i.jsx(dt,{id:"feedback-subject",value:s,onChange:x=>a(x.target.value),placeholder:"Brief description of the issue or suggestion",required:!0,"data-testid":"input-feedback-subject"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ge,{htmlFor:"feedback-description",children:"Description"}),i.jsx(Hr,{id:"feedback-description",value:o,onChange:x=>l(x.target.value),placeholder:n==="bug"?"Please describe what happened, what you expected to happen, and steps to reproduce the issue...":"Please provide details about your feedback or suggestion...",className:"min-h-[120px]",required:!0,"data-testid":"textarea-feedback-description"})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[i.jsx(Z,{type:"button",variant:"outline",onClick:()=>t(!1),"data-testid":"button-cancel-feedback",children:"Cancel"}),i.jsx(Z,{type:"submit",disabled:m.isPending,"data-testid":"button-submit-feedback",children:m.isPending?"Submitting...":i.jsxs(i.Fragment,{children:[g(n),"Submit Feedback"]})})]})]})]})})}function oW(){const{user:e}=At(),{showForLogout:t,hide:n}=tS(),[,r]=pt(),s=wt();if(Ne.useEffect(()=>{const o=l=>{};return window.addEventListener("beforeunload",o),()=>{window.removeEventListener("beforeunload",o)}},[]),!e)return null;const a=async o=>{o&&(o.preventDefault(),o.stopPropagation());const l=t();try{if(localStorage.getItem("demoMode")==="true"){await Or(s,{force:!0}),n(l),so("/login");return}await _r("/api/logout",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})}catch{}await Or(s,{force:!0}),n(l),so("/logout-success")};return i.jsxs(Ag,{children:[i.jsx(Pg,{asChild:!0,children:i.jsx("button",{className:"relative h-8 w-8 rounded-full p-0 border-0 bg-transparent cursor-pointer focus:outline-none hover:opacity-80",children:i.jsx(dj,{user:e,size:"sm",className:"border-2 border-[#49b422]"})})}),i.jsxs(qd,{className:"w-56",align:"end",forceMount:!0,children:[i.jsx(Rg,{className:"font-normal",children:i.jsxs("div",{className:"flex flex-col space-y-1",children:[i.jsx("p",{className:"text-sm font-medium leading-none truncate",children:e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.email}),i.jsx("p",{className:"text-xs leading-none text-muted-foreground truncate",children:e.email})]})}),i.jsx($u,{}),i.jsxs(Ui,{onClick:()=>
512r("/team"),children:[i.jsx(HD,{className:"mr-2 h-4 w-4"}),i.jsx("span",{children:"Team"})]}),i.jsxs(Ui,{onClick:()=>r("/settings"),children:[i.jsx(OD,{className:"mr-2 h-4 w-4"}),i.jsx("span",{children:"Settings"})]}),i.jsx($u,{}),i.jsxs(Ui,{onClick:o=>{o.preventDefault(),a(o)},onSelect:o=>{o.preventDefault()},children:[i.jsx(El,{className:"mr-2 h-4 w-4"}),i.jsx("span",{children:"Log out"})]})]})]})}const lW=[{path:"/dashboard",label:"Dashboard",icon:Ad},{path:"/properties",label:"Properties",icon:ia},{path:"/activity-ledger",label:"Activity Ledger",icon:wS},{path:"/files",label:"File Vault",icon:$n}],tw=[{path:"/organization-admin",label:"Organization",icon:ia,requiredRole:"org_admin"},{path:"/super-admin",label:"Super Admin",icon:Qn,requiredRole:"super_admin"},{path:"/admin/blog",label:"Blog",icon:PD,requiredRole:"super_admin"}];function K_(e,t){const n=[...lW];return e&&(e.role==="org_admin"||e.role==="super_admin")&&n.push(tw[0]),t&&n.push(tw[1]),n}function cW({location:e,setLocation:t,showSupportDialog:n=!1,setShowSupportDialog:r}){const s=mi(),[a,o]=h.useState(!1),[l,c]=h.useState(new Set),{user:u,isAdmin:f}=At(),d=K_(u,f);return i.jsx("div",{className:`lg:border-b ${s?"bg-white dark:bg-gray-800":"bg-transparent dark:bg-transparent"} md:bg-white md:dark:bg-gray-800 safe-area-top mobile-optimized z-10 border-b border-gray-100 dark:border-gray-800`,children:i.jsxs("div",{className:"flex min-h-12 sm:min-h-16 items-center container-mobile container-safe",children:[i.jsxs(X7,{open:a,onOpenChange:o,children:[i.jsx(J7,{asChild:!0,children:i.jsx(Z,{variant:"ghost",size:"icon",className:"hidden touch-target",children:i.jsx(Pd,{className:"h-5 w-5"})})}),i.jsx(W_,{side:"left",className:"w-60 sm:w-64 safe-area-left pl-4",children:i.jsxs("div",{className:"flex flex-col h-full py-3",children:[i.jsx("div",{className:"pr-2",children:i.jsxs(Ce,{href:"/dashboard",className:"flex items-center mb-3 cursor-pointer hover:bg-blue-50 dark:hover:bg-blue-900/50 rounded-md py-2 px-2 transition-colors hover:no-underline focus:no-underline",onClick:()=>o(!1),children:[i.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield Logo",className:"w-6 h-6 flex-shrink-0 hover:opacity-80 transition-opacity"}),i.jsx("span",{className:"ml-2.5 font-semibold text-lg hover:text-blue-700 dark:hover:text-blue-100 transition-colors",children:"REPSShield"})]})}),i.jsx("div",{className:"space-y-3",children:d.map(m=>{var v;const p=m.icon,g=l.has(m.path),x=m.subItems&&m.subItems.length>0,y=e===m.path||x&&m.subItems.some(b=>e===b.path);return i.jsxs("div",{children:[x?i.jsxs(Z,{variant:"ghost",className:`w-full justify-start px-4 py-3 text-base font-medium transition-colors touch-target ${y?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100":"text-gray-700 dark:text-gray-200 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/50 dark:hover:text-blue-100"}`,"data-tour":`nav-${m.path.replace("/","")||"dashboard"}`,onClick:()=>{c(b=>{const w=new Set(b);return w.has(m.path)?w.delete(m.path):w.add(m.path),w})},children:[i.jsx(p,{className:"mr-4 h-6 w-6 flex-shrink-0"}),m.label,g?i.jsx(di,{className:"ml-auto h-4 w-4"}):i.jsx(Bn,{className:"ml-auto h-4 w-4"})]}):i.jsxs(Ce,{href:m.path,className:`flex items-center w-full px-4 py-3 rounded-md text-base font-medium transition-colors touch-target  ${y?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100 hover:no-underline focus:no-underline":"text-gray-700 dark:text-gray-200 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/50 dark:hover:text-blue-100 hover:no-underline focus:no-underline"}`,"data-tour":`nav-${m.path.replace("/","")||"dashboard"}`,onClick:b=>{b.metaKey||b.ctrlKey||b.shiftKey||b.altKey||b.button!==0||(b.preventDefault(),t(m.path),xs(m.path),o(!1))},children:[i.jsx(p,{className:"mr-4 h-6 w-6 flex-shrink-0"}),i.jsx("span",{className:"flex-1",children:m.label})]}),x&&g&&i.jsx("div",{className:"ml-9 space-y-2 mt-2",children:(v=m.subItems)==null?void 0:v.map(b=>{const w=b.icon,j=e===b.path;return i.jsxs(Ce,{href:b.path,className:`flex items-center w-full px-3 py-2.5 rounded-md text-base font-medium transition-colors touch-target  ${j?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100 hover:no-underline focus:no-underline":"text-gray-600 dark:text-gray-300 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/50 dark:hover:text-blue-100 hover:no-underline focus:no-underline"}`,onClick:S=>{S.metaKey||S.ctrlKey||S.shiftKey||S.altKey||S.button!==0||(S.preventDefault(),t(b.path),xs(b.path),o(!1))},children:[w?i.jsx(w,{className:"mr-4 h-5 w-5 flex-shrink-0"}):null,i.jsx("span",{className:"flex-1",children:b.label})]},b.path)})})]},m.path)})}),i.jsxs("div",{className:"mt-auto pt-6",children:[i.jsx(sy,{className:"mb-4"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Z,{variant:"ghost",className:"w-full justify-start px-4 py-3 text-base font-medium transition-colors touch-target text-gray-700 dark:text-gray-200 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/50 dark:hover:text-blue-100 hover:no-underline focus:no-underline",onClick:()=>{r==null||r(!0),o(!1)},"data-testid":"button-support-feedback",children:[i.jsx(SS,{className:"mr-4 h-5 w-5 flex-shrink-0"}),i.jsx("span",{className:"flex-1 text-left truncate",children:"Submit Bug / Feedback"})]}),i.jsxs(Z,{variant:"ghost",className:"w-full justify-start px-4 py-3 text-base font-medium transition-colors touch-target text-gray-700 dark:text-gray-200 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/50 dark:hover:text-blue-100 hover:no-underline focus:no-underline",onClick:()=>{window.open(`https://mail.google.com/mail/?view=cm&fs=1&[email protected]&su=${encodeURIComponent("RepsShield App Support")}`,"_blank"),o(!1)},"data-testid":"button-email-support",children:[i.jsx(lg,{className:"mr-4 h-5 w-5 flex-shrink-0"}),i.jsx("span",{className:"flex-1 text-left truncate",children:"Email Support"})]}),i.jsxs(Z,{variant:"ghost",className:"w-full justify-start px-4 py-3 text-base font-medium transition-colors touch-target text-gray-700 dark:text-gray-200 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/50 dark:hover:text-blue-100 hover:no-underline focus:no-underline",onClick:()=>{window.open("https://discord.gg/3xN78P8D","_blank","noopener,noreferrer"),o(!1)},"data-testid":"button-discord-community",children:[i.jsx(yD,{className:"mr-4 h-5 w-5 flex-shrink-0"}),i.jsx("span",{className:"flex-1 text-left truncate",children:"Join Discord Community"}),i.jsx(zi,{className:"ml-2 h-3 w-3 flex-shrink-0"})]})]})]})]})})]}),i.jsx(Y_,{open:n,onOpenChange:r}),i.jsx("div",{className:"ml-2 sm:ml-4"}),i.jsx("div",{className:"ml-auto flex items-center space-x-2 sm:space-x-4",children:i.jsx("div",{className:"touch-target",children:i.jsx(oW,{})})})]})})}function pf(){const{toast:e}
512=Ht(),t=wt(),{user:n}=At(),[r,s]=h.useState(null),[a,o]=h.useState(!1),[l,c]=h.useState(null),u=async U=>new Promise(P=>{let T=0;const D=30,_=()=>{T++;const G=t.getQueryData(["/api/subscription/status"]),z=t.getQueryData(["/api/subscription/freeze-status"]),R=U.freezeActive===void 0||(z==null?void 0:z.freezeActive)===U.freezeActive,q=U.subscriptionStatus===void 0||(G==null?void 0:G.subscriptionStatus)===U.subscriptionStatus;if(R&&q&&G&&z){P();return}if(T>=D){P();return}setTimeout(_,500)};_()}),f=async U=>(t.removeQueries({predicate:P=>{const T=P.queryKey[0];return typeof T=="string"&&(T.includes("subscription")||T.includes("freeze")||T.includes("auth")||T.includes("user")||T.includes("pricing"))}}),await t.invalidateQueries({predicate:P=>{const T=P.queryKey[0];return typeof T=="string"&&(T.includes("subscription")||T.includes("freeze")||T.includes("auth")||T.includes("user")||T.includes("pricing"))}}),await u(U),!0),{data:d,isLoading:m}=it({queryKey:["/api/subscription/status"],retry:!1,enabled:!!n,staleTime:0,gcTime:0,refetchOnWindowFocus:!0,refetchOnMount:!0}),p=r?{...d,subscriptionStatus:r.subscriptionStatus||(d==null?void 0:d.subscriptionStatus),freezeActive:r.freezeActive??(d==null?void 0:d.freezeActive)}:d,g=Dt({mutationFn:async()=>(await Ze("POST","/api/create-subscription")).json(),onSuccess:U=>{U.url&&(window.location.href=U.url)},onError:U=>{e({title:"Subscription Error",description:U.message||"Failed to create subscription",variant:"destructive"})}}),x=Dt({mutationFn:async()=>{if(Le()){const T=await(await Ze("POST","/api/subscription/billing-portal",{mobile:!0,callback_url:"com.repsshield.app://subscription"})).json();if(T.portalUrl)return await rg(T.portalUrl),{handledNatively:!0};throw new Error("Failed to get billing portal URL")}return(await Ze("POST","/api/create-portal-session")).json()},onSuccess:U=>{!Le()&&(U!=null&&U.url)?window.location.href=U.url:Le()&&(t.invalidateQueries({queryKey:["/api/subscription/status"]}),t.invalidateQueries({queryKey:["/api/subscription/freeze-status"]}))},onError:U=>{e({title:"Portal Error",description:U.message||"Failed to open billing portal",variant:"destructive"})}}),{data:y,isLoading:v}=it({queryKey:["/api/subscription/freeze-status"],retry:!1,enabled:!!n,staleTime:0,gcTime:0,refetchOnWindowFocus:!0,refetchOnMount:!0}),b=r?{...y,freezeActive:r.freezeActive??(y==null?void 0:y.freezeActive)}:y,w=Dt({mutationFn:async U=>(s({freezeActive:!0,subscriptionStatus:"suspended",isFrozen:!0}),o(!0),c({freezeActive:!0,subscriptionStatus:"suspended"}),(await Ze("POST","/api/subscription/freeze",U)).json()),onSuccess:async()=>{try{await f({freezeActive:!0,subscriptionStatus:"suspended"}),s(null),o(!1),c(null),e({title:"Subscription Paused",description:"Your subscription has been paused successfully."})}catch(U){console.error("Failed to sync fresh data after freeze:",U),o(!1),c(null)}},onError:U=>{s(null),o(!1),e({title:"Pause Failed",description:U.message||"Failed to pause subscription",variant:"destructive"})}}),j=Dt({mutationFn:async()=>(s({freezeActive:!1,subscriptionStatus:"active",isFrozen:!1}),o(!0),c({freezeActive:!1,subscriptionStatus:"active"}),(await Ze("POST","/api/subscription/resume")).json()),onSuccess:async U=>{try{await f({freezeActive:!1,subscriptionStatus:"active"}),s(null),o(!1),c(null),U.resumeType==="expired_with_credits"?e({title:"Subscription Renewed with Credits",description:U.message||`Your subscription has been renewed for ${U.serviceMonths} months using your available credits.`}):e({title:"Subscription Resumed",description:"Your subscription has been resumed successfully."})}catch(P){console.error("Failed to sync fresh data after resume:",P),o(!1),c(null)}},onError:U=>{s(null),o(!1),e({title:"Resume Failed",description:U.message||"Failed to resume subscription",variant:"destructive"})}}),S=()=>g.mutate(),C=()=>x.mutate(),I=U=>w.mutate(U),E=()=>j.mutate(),N=(b==null?void 0:b.freezeActive)||!1,k=(p==null?void 0:p.isOnTrial)||!1,A=(p==null?void 0:p.isAdmin)||(n==null?void 0:n.isAdmin)||(p==null?void 0:p.hasActiveSubscription)&&!N||(p==null?void 0:p.hasManualPremiumAccess)||k&&!N||!1,M=(p==null?void 0:p.subscriptionTier)==="premium"||(p==null?void 0:p.isAdmin)||(n==null?void 0:n.isAdmin)||(p==null?void 0:p.hasManualPremiumAccess)||k&&!N||!1,L=w.isPending||a,F=j.isPending||a,V=w.isPending||j.isPending||a;return{subscription:p,isLoading:m,hasActiveSubscription:A,canAccessPremiumFeatures:A,hasPremiumTierAccess:M,isAdmin:(p==null?void 0:p.isAdmin)||(n==null?void 0:n.isAdmin)||!1,subscribe:S,manageBilling:C,isSubscribing:g.isPending,isManaging:x.isPending,isOnTrial:k,isFrozen:N,freezeStatus:b,freezeLoading:v,freezeSubscription:I,resumeSubscription:E,isFreezing:L,isResuming:F,isProcessingSubscriptionChange:V}}async function Q_(e){return(await Ze("POST","/api/subscription/preview-upgrade",{priceType:e.priceType,tier:e.tier||"base"})).json()}async function td(){if(Le()){const r=await(await Ze("POST","/api/subscription/billing-portal",{mobile:!0,callback_url:"com.repss
512hield.app://subscription"})).json();if(r.portalUrl){await rg(r.portalUrl);return}throw new Error("Failed to get billing portal URL")}const t=await(await Ze("POST","/api/create-portal-session",{})).json();if(t.url)return t.url;throw new Error("Failed to get billing portal URL")}async function po(e){const t=Le(),r=await(await Ze("POST","/api/subscription/create-checkout",{priceType:e.priceType,tier:e.tier||"base",...t&&{mobile:!0,callback_url:"com.repsshield.app://subscription"},...!t&&e.successUrl&&{successUrl:e.successUrl},...!t&&e.cancelUrl&&{cancelUrl:e.cancelUrl}})).json();if(r.upgraded)return{upgraded:!0,plan:r.plan,message:r.message};if(r.checkoutUrl){if(t){if((await Qk(r.checkoutUrl)).status==="success")return{upgraded:!0,plan:r.plan,message:"Subscription created successfully"};throw new Error("Subscription checkout was cancelled.")}return{upgraded:!1,checkoutUrl:r.checkoutUrl}}throw new Error("Unexpected response from subscription endpoint")}function iy(){return it({queryKey:["/api/pricing"],staleTime:5*60*1e3,gcTime:10*60*1e3,retry:3})}const uW=So("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Hi=h.forwardRef(({className:e,variant:t,...n},r)=>i.jsx("div",{ref:r,role:"alert",className:W(uW({variant:t}),e),...n}));Hi.displayName="Alert";const Z_=h.forwardRef(({className:e,...t},n)=>i.jsx("h5",{ref:n,className:W("mb-1 font-medium leading-none tracking-tight",e),...t}));Z_.displayName="AlertTitle";const za=h.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:W("text-sm [&_p]:leading-relaxed",e),...t}));za.displayName="AlertDescription";function dW(e){return e==="premium"?"Shield Advisor":"Shield Essential"}function fW(e,t){const n=t==="year"||t==="annual"?"Annual":"Monthly";return`${dW(e)} ${n}`}function Qr(e,t="usd"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase(),minimumFractionDigits:2}).format(e)}function nw(e,t){return fW(e,t)}function X_({isOpen:e,onClose:t,targetPriceType:n,targetTier:r,onSuccess:s}){const{toast:a}=Ht(),o=wt(),[l,c]=h.useState(!1),[u,f]=h.useState(null),{data:d,isLoading:m,error:p}=it({queryKey:["subscription","preview-upgrade",n,r],queryFn:()=>Q_({priceType:n,tier:r}),enabled:e,retry:!1,staleTime:0,gcTime:0}),g=p?(p==null?void 0:p.message)||"Unable to calculate plan change preview. Please try again.":null,x=async()=>{if(d){c(!0);try{const A=await po({priceType:n,tier:r,prorationDate:d.prorationDate});if(A.upgraded){const M=d.isDowngrade;a({title:"Plan Updated",description:A.message||(M?"Your subscription has been downgraded.":"Your subscription has been upgraded.")}),t(),s==null||s()}else A.checkoutUrl&&(window.location.href=A.checkoutUrl)}catch(A){if((A==null?void 0:A.status)===402){f((A==null?void 0:A.message)||"Your card was declined.");return}const M=d==null?void 0:d.isDowngrade;a({title:M?"Downgrade Failed":"Upgrade Failed",description:(A==null?void 0:A.message)||"Something went wrong. Please try again.",variant:"destructive"})}finally{c(!1)}}},y=async()=>{try{const A=await td();A?window.location.href=A:window.location.reload()}catch{a({title:"Error",description:"Failed to open billing portal. Please try again.",variant:"destructive"})}},v=()=>{f(null),x()},b=A=>{!A&&!l&&(o.removeQueries({queryKey:["subscription","preview-upgrade",n,r]}),f(null),t())},w=(d==null?void 0:d.preview.currency)??"usd",j=nw(r,n),S=d?nw(d.currentPlan.tier,d.currentPlan.interval):"Current Plan",C=(d==null?void 0:d.isDowngrade)??!1,I=(d==null?void 0:d.isTierDowngrade)??!1,E=(d==null?void 0:d.preview.amountDue)??0,N=(d==null?void 0:d.preview.total)??0,k=(d==null?void 0:d.preview.creditAmount)??0;return i.jsx($r,{open:e,onOpenChange:b,children:i.jsxs(ur,{className:"sm:max-w-[520px] p-0 gap-0 overflow-hidden",children:[i.jsxs("div",{className:`px-6 pt-6 pb-5 ${C?"bg-gradient-to-b from-amber-50/80 to-background dark:from-amber-950/20 dark:to-background":"bg-gradient-to-b from-emerald-50/80 to-background dark:from-emerald-950/20 dark:to-background"}`,children:[i.jsx(dr,{className:"pb-0",children:i.jsxs("div",{className:"flex items-center gap-2.5 mb-1",children:[C?i.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-lg bg-amber-100 dar
512k:bg-amber-900/40",children:i.jsx(UD,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"})}):i.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-lg bg-emerald-100 dark:bg-emerald-900/40",children:i.jsx(Gi,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"})}),i.jsx(fr,{className:"text-lg font-semibold tracking-tight",children:C?"Confirm Plan Change":"Confirm Upgrade"})]})}),i.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[i.jsxs("div",{className:"flex-1 rounded-lg border bg-background/80 backdrop-blur-sm px-3 py-2.5",children:[i.jsx("p",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground/70 mb-0.5",children:"Current"}),i.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:S})]}),i.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-8 h-8 rounded-full border-2 border-dashed border-muted-foreground/20",children:i.jsx(ls,{className:"h-3.5 w-3.5 text-muted-foreground/50"})}),i.jsxs("div",{className:`flex-1 rounded-lg border-2 px-3 py-2.5 ${C?"border-amber-200 bg-amber-50/50 dark:border-amber-800 dark:bg-amber-950/30":"border-emerald-200 bg-emerald-50/50 dark:border-emerald-800 dark:bg-emerald-950/30"}`,children:[i.jsx("p",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground/70 mb-0.5",children:"New Plan"}),i.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:j})]})]})]}),i.jsxs("div",{className:"px-6 pb-6",children:[m&&i.jsxs("div",{className:"py-12 flex flex-col items-center gap-3 text-muted-foreground",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/10 animate-ping"}),i.jsx(Xe,{className:"h-7 w-7 animate-spin relative"})]}),i.jsx("p",{className:"text-sm font-medium",children:"Calculating your proration..."})]}),g&&!m&&i.jsx("div",{className:"py-4",children:i.jsxs(Hi,{variant:"destructive",children:[i.jsx(ms,{className:"h-4 w-4"}),i.jsx(za,{children:g})]})}),u&&!m&&i.jsxs("div",{className:"py-4 space-y-4",children:[i.jsxs(Hi,{variant:"destructive",children:[i.jsx(Ov,{className:"h-4 w-4"}),i.jsx(Z_,{children:"Your card was declined"}),i.jsx(za,{children:u})]}),i.jsxs("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-3",children:[i.jsx(Z,{variant:"outline",onClick:t,className:"w-full sm:w-auto h-11 px-5 text-sm font-medium",children:"Cancel"}),i.jsx(Z,{variant:"outline",onClick:v,disabled:l,className:"w-full sm:w-auto h-11 px-5 text-sm font-medium",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"h-4 w-4 mr-2 animate-spin"}),"Retrying..."]}):i.jsxs(i.Fragment,{children:[i.jsx(_l,{className:"h-4 w-4 mr-2"}),"Try Again"]})}),i.jsxs(Z,{onClick:y,className:"w-full sm:w-auto h-11 px-6 text-sm font-semibold",children:[i.jsx(Ov,{className:"h-4 w-4 mr-2"}),"Update Payment Method"]})]})]}),d&&!m&&!u&&i.jsxs("div",{className:"space-y-5 pt-5",children:[I&&i.jsxs(Hi,{variant:"destructive",className:"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950/50 dark:text-amber-200 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",children:[i.jsx(ms,{className:"h-4 w-4"}),i.jsxs(za,{className:"text-sm",children:["You will lose access to ",i.jsx("span",{className:"font-semibold",children:"Shield Advisor features"})," including AI Tax Advisor immediately after confirming."]})]}),i.jsx("div",{className:"rounded-xl border bg-card px-5 py-5 text-center",children:E===0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground mb-2",children:"No charge today"}),i.jsx("p",{className:"text-4xl font-bold tracking-tight text-foreground",children:"$0.00"}),k>0&&i.jsxs("p",{className:"text-sm text-emerald-600 dark:text-emerald-400 mt-2 font-medium",children:[C?`You'll receive a ${Qr(k,w)} credit`:`${Qr(k,w)} credit applied`,i.jsx("br",{}),i.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"Applied automatically to future invoices"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground mb-2",children:C?"Amount due today":"You'll be charged today"}),i.jsx("p",{className:"text-4xl sm:text-5xl font-bold tracking-tight text-foreground",children:Qr(E,w)}),k>0&&i.jsx("p",{className:"text-sm text-emerald-600 dark:text-emerald-400 mt-2 font-medium",children:C?`Includes ${Qr(k,w)} credit for unused time`:`${Qr(k,w)} credit applied`})]})}),d.preview.lineItems.length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground mb-3",children:"Breakdown"}),i.jsxs("div",{className:"rounded-xl border bg-card divide-y divide-border",children:[d.preview.lineItems.map((A,M)=>i.jsxs("div",{className:"flex items-start justify-between gap-3 px-4 py-3 text-sm",children:[i.jsx("span",{className:"text-muted-foreground leading-snug break-words min-w-0 flex-1",children:A.description}),i.jsx("span",{className:`flex-shrink-0 font-semibold tabular-nums ${A.amount<0?"text-emerald-600 dark:text-emerald-400":"text-foreground"}`,children:A.amount<0?`−${Qr(Math.abs(A.amount),A.currency)}`:Qr(A.amount,A.currency)})]},M)),i.jsx("div",{className:"flex items-center justify-between px-4 py-3 bg-muted/30",children:N<0?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Net credit"}),i.jsx("span",{className:"text-sm tabular-nums font-bold text-emerald-600 dark:text-emerald-400",children:Qr(Math.abs(N),w)})]}):N===0?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Total"}),i.jsx("span",{className:"text-sm tabular-nums font-bold",children:"No charge"})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Total due today"}),i.jsx("span",{className:"text-base tabular-nums font-bold text-foreground",children:Qr(N,w)})]})})]})]}),i.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg bg-muted/30 px-4 py-3",children:[i.jsx(rc,{className:"h-4 w-4 mt-0.5 flex-shrink-0 text-muted-foreground
512/60"}),i.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:C?"Credits apply automatically to future invoices. Your plan changes take effect immediately. You can upgrade again at any time.":"Secured by Stripe. Your billing date won't change. You can adjust your plan anytime from your subscription settings."})]})]}),!u&&i.jsxs("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-3 pt-6",children:[i.jsx(Z,{variant:"outline",onClick:t,disabled:l,className:"w-full sm:w-auto h-11 px-5 text-sm font-medium",children:"Cancel"}),C?i.jsx(Z,{variant:"outline",onClick:x,disabled:!d||m||l||!!g,className:"w-full sm:w-auto h-11 px-6 text-sm font-medium",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"h-4 w-4 mr-2 animate-spin"}),"Processing..."]}):"Confirm Downgrade"}):i.jsx(Z,{onClick:x,disabled:!d||m||l||!!g,className:"w-full sm:w-auto h-11 px-6 text-sm font-semibold bg-emerald-600 hover:bg-emerald-700 text-white shadow-md shadow-emerald-600/20 hover:shadow-lg hover:shadow-emerald-600/30 transition-all",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"h-4 w-4 mr-2 animate-spin"}),"Upgrading..."]}):i.jsxs("span",{className:"inline-flex items-center",children:[i.jsx(Fs,{className:"h-4 w-4 mr-2"}),"Confirm Upgrade"]})})]})]})]})})}function hW({isOpen:e,onClose:t,trialDaysRemaining:n,tier:r}){const[s,a]=h.useState(null),[o,l]=h.useState(null),{toast:c}=Ht(),{data:u,isLoading:f}=iy(),d=async(j,S)=>{const C=`${S}_${j}`;a(C);try{await Q_({priceType:j,tier:S}),a(null),l({priceType:j,tier:S})}catch{try{const E=window.location.origin,N=await po({priceType:j,tier:S,successUrl:`${E}/?payment=success&upgraded=true`,cancelUrl:`${E}/?payment=cancelled`});N.upgraded?(c({title:"Plan Updated",description:N.message}),t(),window.location.reload()):N.checkoutUrl&&(window.location.href=N.checkoutUrl)}catch(E){const N=E;if((N==null?void 0:N.status)===409){c({title:"Already Subscribed",description:"Opening your billing portal…"});try{const k=await td();k?window.location.href=k:window.location.reload();return}catch{}a(null);return}console.error("Upgrade error:",E),c({title:"Upgrade Error",description:(N==null?void 0:N.message)||"Failed to start upgrade process. Please try again.",variant:"destructive"}),a(null)}}},m=["Smart time tracking with AI","Audit-ready documentation","Gmail & Calendar sync","Voice-to-text logging","CSV & evidence exports","Analytics dashboard","REST API — connect your tools"],p=["AI Tax Advisor — ask REPS questions, get answers with IRS citations","Audit readiness score — know your risk before the IRS does","Personalized analysis based on your properties & hours","Full API Integration — build custom workflows and sync with your CPA's tools","Priority support from our team"],g=(u==null?void 0:u.monthlyPrice)??10,x=(u==null?void 0:u.annualPriceMin)??100,y=(u==null?void 0:u.premiumMonthlyPrice)??29,v=(u==null?void 0:u.premiumAnnualPrice)??279,b=y*12-v,w=s!==null;return i.jsxs(i.Fragment,{children:[o&&i.jsx(X_,{isOpen:o!==null,onClose:()=>l(null),targetPriceType:o.priceType,targetTier:o.tier,onSuccess:()=>{l(null),t(),window.location.reload()}}),i.jsx($r,{open:e,onOpenChange:t,children:i.jsxs(ur,{className:"w-full max-w-4xl p-0 max-h-[90vh] flex flex-col",children:[i.jsxs(dr,{className:"p-6 pb-0 flex-shrink-0",children:[i.jsx(fr,{className:"text-2xl font-bold",children:"Choose Your Plan"}),i.jsx(li,{className:"text-base",children:n!==void 0?i.jsx("span",{className:"text-orange-600 font-medium",children:n>0?`${n} days left in your trial • Upgrade now to keep your progress!`:"Your trial has ended • Choose a plan to continue"}):"Select the perfect plan for your real estate tracking needs"})]}),i.jsxs("div",{className:"p-6 overflow-y-auto flex-1 min-h-0",children:[i.jsxs("div",{className:"grid md:grid-cols-2 gap-4 items-stretch",children:[i.jsxs("div",{className:"relative flex flex-col rounded-xl border-2 border-border hover:border-green-300 hover:shadow-md transition-all duration-200 bg-card",children:[i.jsxs("div",{className:"p-5 pb-4 border-b border-border",children:[i.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-1",children:"Shield Essential"}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-baseline gap-1",children:[i.jsx("span",{className:"text-3xl font-bold text-foreground",children:f?"$--":`$${g}`}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:f?"Loading...":`or $${x}/yr`}),i.jsx("p",{className:"text-xs text-muted-foreground pt-1",children:"Track hours, stay organized, and generate audit-ready reports."})]})]}),i.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[i.jsx("ul",{className:"space-y-2.5 flex-grow text-sm mb-5",children:m.map((j,S)=>i.jsxs("li",{className:"flex items-start gap-2.5",children:[i.jsx(Fs,{className:"h-4 w-4 text-green-500 flex-shrink-0 mt-0.5"}),i.jsx("span",{children:j})]},S))}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Z,{variant:"outline",className:"w-full text-sm border-green-600 text-green-700 hover:bg-green-50 dark:hover:bg-green-900/20 whitespace-normal h-auto py-2.5 min-h-[2.5rem]",onClick:()=>d("monthly","base"),disabled:w,children:s==="base_monthly"?"Processing...":`Monthly — $${g}/mo`}),i.jsx(Z,{className:"w-full text-sm bg-green-600 hover:bg-green-700 text-white whitespace-normal h-auto py-2.5 min-h-[2.5rem]",onClick:()=>d("annual","base"),disabled:w,children:s==="base_annual"?"Processing...":`Annual — $${x}/yr`})]})]})]}),i.jsxs("div",{className:"relative flex flex-col rounded-xl border-2 border-green-200 hover:border-green-400 hover:shadow-md transition-all duration-200 bg-gradient-to-br from-green-50/50 to-blue-50/50 dark:from-green-900/10 dark:to-blue-900/10",children:[i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:i.jsxs(Mr,{className:"bg-green-600 text-white px-3 py-0.5 text-xs flex items-center gap-1",children:[i.jsx($D,{className:"h-3 w-3"}),"Most Popular"]})}),i.jsxs("div",{className:"p-5 pb-4 border-b border-green-200 dark:border-green-700 pt-7",children:[i.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-green-700 dark:text-green-400 mb-1",children:"Shield Advisor"}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-baseline gap-1",children:[i.jsx("span",{className:"text-3xl font-bold text-foreground",children:f?"$--":`$${y}`}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),i.jsx("p",{className:"text-xs text-green-600 dark:text-green-400 font-medium",children:f?"Loading...":`or $${v}/yr (save $${b})`}),i.jsx("p",{className:"text-xs text-muted-foreground pt-1",children:"AI advisor + audit scoring — know 
512where you stand before the IRS does."})]})]}),i.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[i.jsx("p",{className:"text-xs font-semibold text-green-700 dark:text-green-400 mb-2.5 uppercase tracking-wide",children:"Everything in Shield Essential, plus:"}),i.jsx("ul",{className:"space-y-2.5 flex-grow text-sm mb-5",children:p.map((j,S)=>i.jsxs("li",{className:"flex items-start gap-2.5",children:[i.jsx("div",{className:"flex items-center justify-center h-5 w-5 rounded-full bg-yellow-400 flex-shrink-0 mt-0.5",children:i.jsx(Gi,{className:"h-3 w-3 text-white"})}),i.jsx("span",{children:j})]},S))}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Z,{variant:"outline",className:"w-full text-sm border-green-300 text-green-700 hover:bg-green-50 dark:hover:bg-green-900/20 whitespace-normal h-auto py-2.5 min-h-[2.5rem]",onClick:()=>d("monthly","premium"),disabled:w,children:s==="premium_monthly"?"Processing...":`Monthly — $${y}/mo`}),i.jsx(Z,{className:"w-full text-sm bg-green-600 hover:bg-green-700 text-white whitespace-normal h-auto py-2.5 min-h-[2.5rem]",onClick:()=>d("annual","premium"),disabled:w,children:s==="premium_annual"?"Processing...":`Annual — $${v}/yr`})]})]})]})]}),i.jsx("div",{className:"mt-6 text-center text-sm text-gray-600",children:i.jsx("p",{children:"✓ Secure payment via Stripe • ✓ Cancel anytime • ✓ No hidden fees"})})]})]})})]})}function mW(){const{user:e}=At(),{subscription:t}=pf(),[n,r]=pt(),[s,a]=h.useState(null),[o,l]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{new URLSearchParams(n.split("?")[1]||"").get("upgrade")==="started"&&!o&&l(!0)},[n,o]),h.useEffect(()=>{const v=new URLSearchParams(n.split("?")[1]||""),b=n.split("?")[0];if(o)v.set("upgrade","started"),r(`${b}?${v.toString()}`);else{v.delete("upgrade");const w=v.toString();r(w?`${b}?${w}`:b)}},[o,r,n]),h.useEffect(()=>{const v=localStorage.getItem("trialBannerDismissed")==="true";u(v)},[]),h.useEffect(()=>{const v=t==null?void 0:t.isOnTrial,b=t==null?void 0:t.trialEndDate;if(v&&b){const w=new Date(b),j=new Date,S=w.getTime()-j.getTime(),C=Math.floor(S/(1e3*60*60*24));a(Math.max(0,C))}else a(null)},[t]);const d=!(t!=null&&t.isOnTrial)&&(t==null?void 0:t.hasUsedTrial)&&!(t!=null&&t.hasActiveSubscription)||s===1?{bgColor:"bg-destructive/10 border-destructive/20",textColor:"text-destructive",buttonColor:"bg-destructive hover:bg-destructive/90",icon:hs,iconColor:"text-destructive"}:s!==null&&s<=3?{bgColor:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/20 dark:border-yellow-800/30",textColor:"text-yellow-800 dark:text-yellow-300",buttonColor:"bg-yellow-600 hover:bg-yellow-700 dark:bg-yellow-700 dark:hover:bg-yellow-600",icon:ms,iconColor:"text-yellow-600 dark:text-yellow-400"}:{bgColor:"bg-blue-50 border-blue-200 dark:bg-blue-950/20 dark:border-blue-800/30",textColor:"text-blue-800 dark:text-blue-300",buttonColor:"bg-blue-600 hover:bg-blue-700 dark:bg-blue-700 dark:hover:bg-blue-600",icon:pD,iconColor:"text-blue-600 dark:text-blue-400"},m=d.icon,p=()=>{u(!0),localStorage.setItem("trialBannerDismissed","true")},g=!(t!=null&&t.isOnTrial)&&(t==null?void 0:t.hasUsedTrial)&&!(t!=null&&t.hasActiveSubscription),x=(t==null?void 0:t.isOnTrial)&&s!==null,y=!(e!=null&&e.isAdmin)&&(x||g)&&!c;return i.jsxs(i.Fragment,{children:[y&&i.jsx("div",{className:`border-b ${d.bgColor}`,children:i.jsx("div",{className:"flex h-16 items-center container-mobile container-safe",children:i.jsxs("div",{className:"flex items-center justify-between w-full",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(m,{className:`h-4 w-4 ${d.iconColor}`}),i.jsx("span",{className:`text-sm font-medium ${d.textColor}`,children:g?"Trial Expired • Choose a plan to continue":`${s} days remaining in your free trial`})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(Z,{size:"sm",onClick:()=>l(!0),className:`${d.buttonColor} text-white font-semibold rounded-md px-4 py-1`,children:[i.jsx(Qn,{className:"h-3 w-3 mr-1"}),"Upgrade Now"]}),i.jsx("button",{onClick:p,className:"p-1 hover:bg-black/5 text-gray-400 hover:text-gray-600 dark:hover:bg-white/5 dark:hover:text-gray-300 rounded transition-colors","aria-label":"Dismiss banner",children:i.jsx($t,{className:"h-4 w-4"})})]})]})})}),i.jsx(hW,{isOpen:o,onClose:()=>l(!1),trialDaysRemaining:g?0:s??void 0})]})}const rw="repsshield-sidebar-expanded";function pW(){const[e,t]=h.useState(()=>{if(typeof window>"u")return!0;const s=localStorage.getItem(rw);return s!==null?JSON.parse(s):!0}),[n,r]=h.useState(!1);return h.useEffect(()=>{localStorage.setItem(rw,JSON.stringify(e))},[e]),{isSidebarExpanded:e,setIsSidebarExpanded:t,showSupportDialog:n,setShowSupportDialog:r}}function gW({children:e,offline:t=!1}){const[n,r]=pt(),s=mi(),a=Le()||s,{user:o,isAdmin:l}=At(),c=h.useRef(null),{isSidebarExpanded:u,setIsSidebarExpanded:f,showSupportDialog:d,setShowSupportDialog:m}=pW();h.useEffect(()=>{GC()},[]),h.useEffect(()=>(document.body.classList.add("app"),document.documentElement.classList.add("app"),()=>{document.body.classList.remove("app"),document.documentElement.classList.remove("app")}),[]),h.useEffect(()=>{a&&requestAnimationFrame(()=>{var g;(g=c.current)==null||g.scrollTo({top:0,left:0,behavior:"auto"}),window.scrollTo({top:0,left:0,behavior:"auto"})})},[a,n]);const p=K_(o,l);return t?i.jsx(np,{}):i.jsxs("div",{className:"flex h-screen w-full overflow-hidden bg-gray-50 dark:bg-gray-900",children:[!a&&i.jsx(Z7,{navigationItems:p,isExpanded:u,onToggle:()=>f(!u),showSupportDialog:d,onSupportClick:()=>m(!0),location:n,setLocation:r}),i.jsxs("main",{className:W("flex-1 flex flex-col min-w-0 min-h-0",a&&"pt-safe-top"),children:[i.jsx(mW,{}),a?null:i.jsx(cW,{location:n,setLocation:r,showSupportDialog:d,setShowSupportDialog:m}),i.jsx("div",{ref:c,className:W("flex-1 overflow-y-auto overflow-x-hidden px-0 pt-0 md:p-4 min-h-0","pb-safe-bottom md:pb-4"),children:e})]}),i.jsx(np,{}),i.jsx(Y_,{open:d,onOpenChange:m})]})}function xW(){var l,c,u,f,d,m;const{toast:e}
512=Ht(),t=wt(),{data:n}=it({queryKey:["/api/auth/user"],refetchInterval:3e4,retry:!1,refetchOnWindowFocus:!0,staleTime:0}),r=n==null?void 0:n.impersonationStatus;h.useEffect(()=>{r!=null&&r.isImpersonating},[n,r]);const s=Dt({mutationFn:async()=>{try{return await Ze("POST","/api/admin/exit-impersonation")}catch(p){throw console.error("Exit impersonation error:",p),p}},onSuccess:p=>{var g;t.invalidateQueries({queryKey:["/api/admin/impersonation-status"]}),t.invalidateQueries({queryKey:["/api/auth/user"]}),e({title:"Impersonation Ended",description:(g=p==null?void 0:p.originalUser)!=null&&g.email?`Returned to ${p.originalUser.email}`:"Successfully exited impersonation"}),setTimeout(()=>{window.location.reload()},1e3)},onError:p=>{console.error("Exit impersonation failed:",p),e({title:"Exit Failed",description:(p==null?void 0:p.message)||"Failed to exit impersonation. Please try again.",variant:"destructive"})}}),a=r;if(!(r!=null&&r.isImpersonating))return null;const o=p=>{const g=new Date(p),y=new Date().getTime()-g.getTime(),v=Math.floor(y/6e4);if(v<60)return`${v} minute${v!==1?"s":""}`;const b=Math.floor(v/60),w=v%60;return`${b} hour${b!==1?"s":""} ${w} minute${w!==1?"s":""}`};return i.jsx("div",{className:"sticky top-0 left-0 right-0 z-[100] bg-amber-50 border-b border-amber-200 shadow-sm mobile-optimized safe-area-top",children:i.jsx("div",{className:"max-w-7xl mx-auto px-2 sm:px-4 lg:px-8",children:i.jsxs(Hi,{className:"border-0 bg-transparent shadow-none p-2 sm:p-3",children:[i.jsxs("div",{className:"flex items-center justify-between sm:hidden",children:[i.jsxs("div",{className:"flex items-center space-x-2 min-w-0 flex-1",children:[i.jsx("div",{className:"bg-amber-100 p-1.5 rounded-full",children:i.jsx(ao,{className:"h-3 w-3 text-amber-600"})}),i.jsx("div",{className:"min-w-0 flex-1",children:i.jsxs("span",{className:"font-medium text-amber-900 text-xs truncate block",children:["Impersonating: ",((l=a.targetUser)==null?void 0:l.firstName)||((c=a.targetUser)==null?void 0:c.email)]})})]}),i.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>s.mutate(),disabled:s.isPending,className:"bg-white hover:bg-amber-50 border-amber-300 text-amber-700 hover:text-amber-800 text-xs px-2 py-1 h-7 ml-2 flex-shrink-0",children:[i.jsx(El,{className:"h-3 w-3 mr-1"}),"Exit"]})]}),i.jsxs("div",{className:"hidden sm:flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx("div",{className:"bg-amber-100 p-2 rounded-full",children:i.jsx(ms,{className:"h-4 w-4 text-amber-600"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ao,{className:"h-4 w-4 text-amber-600"}),i.jsx("span",{className:"font-medium text-amber-900",children:"Impersonating User"})]}),i.jsxs("div",{className:"text-sm text-amber-800",children:["You are logged in as"," ",i.jsx("strong",{children:(u=a.targetUser)!=null&&u.firstName?`${a.targetUser.firstName} ${a.targetUser.lastName||""}`.trim():(f=a.targetUser)==null?void 0:f.email})," ","(",(d=a.targetUser)==null?void 0:d.email,")",a.startedAt&&i.jsxs("span",{className:"ml-2 text-amber-700",children:["• Active for ",o(a.startedAt)]})]})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsxs("div",{className:"text-xs text-amber-700 hidden lg:block",children:["Original: ",(m=a.originalUser)==null?void 0:m.email]}),i.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>s.mutate(),disabled:s.isPending,className:"bg-white hover:bg-amber-50 border-amber-300 text-amber-700 hover:text-amber-800",children:[i.jsx(El,{className:"h-4 w-4 mr-2"}),"Exit Impersonation"]})]})]})]})})})}function yW(){const{isDemoMode:e,demoSubscriptionTier:t,exitDemoMode:n,toggleDemoSubscription:r,resetDemo:s}=zk();return e?i.jsx(Je,{className:"m-4 border-2 border-blue-500 bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-950 dark:to-indigo-950 shadow-lg",children:i.jsxs(rt,{className:"p-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Mr,{variant:"secondary",className:"bg-blue-100 dar
512k:bg-blue-900 text-blue-800 dark:text-blue-200 font-semibold px-3 py-1",children:"🎭 DEMO MODE"}),i.jsx(Mr,{variant:t==="premium"?"default":"outline",className:t==="premium"?"bg-purple-100 dark:bg-purple-900 text-purple-800 dark:text-purple-200":"bg-gray-100 dark:bg-gray-800 text-gray-800 dark:text-gray-200",children:t==="premium"?"💎 Premium User":"🆓 Free User"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ge,{htmlFor:"demo-tier-toggle",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Subscription Tier:"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Free"}),i.jsx($l,{id:"demo-tier-toggle",checked:t==="premium",onCheckedChange:r,className:"data-[state=checked]:bg-purple-600 dark:data-[state=checked]:bg-purple-500"}),i.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Premium"})]})]}),i.jsxs("div",{className:"hidden md:flex items-center gap-3 pl-4 border-l border-blue-200 dark:border-blue-700",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-6 h-6 rounded-full bg-blue-200 dark:bg-blue-800 flex items-center justify-center",children:i.jsx("span",{className:"text-xs font-medium text-blue-800 dark:text-blue-200",children:"SM"})}),i.jsxs("div",{className:"text-sm",children:[i.jsx("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:"Sarah Martinez"}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Real Estate Professional"})]})]}),i.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500 dark:text-gray-400",children:[i.jsx("span",{children:"🏢 12 Properties"}),i.jsx("span",{children:"📊 642 Hours"}),i.jsx("span",{children:"📈 85% REP Goal"})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(Z,{variant:"outline",size:"sm",onClick:s,className:"gap-2 hover:bg-blue-50 dark:hover:bg-blue-900 touch-target",children:[i.jsx(NS,{className:"h-4 w-4"}),"Reset Demo"]}),i.jsxs(Z,{variant:"ghost",size:"sm",onClick:n,className:"gap-2 text-red-600 hover:text-red-700 hover:bg-red-50 dark:text-red-400 dark:hover:text-red-300 dark:hover:bg-red-950 touch-target",children:[i.jsx($t,{className:"h-4 w-4"}),"Exit Demo"]})]})]}),i.jsx("div",{className:"mt-3 p-3 bg-white/50 dark:bg-gray-800/50 rounded-lg border border-blue-200 dark:border-blue-700",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(bS,{className:"h-4 w-4 text-blue-600 dark:text-blue-400 mt-0.5"}),i.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:i.jsxs("p",{children:[i.jsx("strong",{children:"Demo Environment Active:"})," Experiencing REPSShield as Sarah Martinez with rich, realistic data spanning 12 properties and comprehensive time tracking history. Toggle subscription tiers to see feature differences. No real data will be affected."]})})]})})]})}):null}function vW(){fM(),dM();const[e]=pt(),{user:t,isAuthenticated:n,isLoading:r}=At(),s=sg(e),{data:a,isLoading:o}=it({queryKey:["/api/auth/user"],enabled:!!t,retry:!1,refetchOnMount:!1});if(h.useEffect(()=>{const l=Ev(e);document.body.className=n&&!l?"app":"public-site"},[n,e]),n&&!r&&(e==="/login"||e==="/register"||e==="/"))return i.jsx(el,{to:"/dashboard"});if(!r&&!n&&!s){const l=encodeURIComponent(e);return i.jsx(el,{to:`/login?redirectTo=${l}`})}return r&&!s?null:n?i.jsx(h.Suspense,{fallback:i.jsx("div",{className:"min-h-screen"}),children:i.jsxs("div",{className:`bg-gray-50 dark:bg-gray-900 ${t&&a&&a.hasCompletedOnboardingForm!==!0,"min-h-screen"}`,children:[i.jsx(xW,{}),i.jsx(yW,{}),i.jsxs(YD,{user:t,userData:a,location:e,children:[t&&(a==null?void 0:a.accountOwnerId)!=null&&i.jsx(qU,{user:t,userData:a,location:e}),t&&i.jsx(q7,{userData:a,isUserDataLoading:o,location:e}),i.jsx(GU,{userData:a,location:e,children:(!t||!a&&!o||a&&a.hasCompletedOnboardingForm===!0&&!a.accountOwnerId)&&(Ev(e)?i.jsxs(Cu,{children:[Cl.filter(l=>l.isLandingPage).map(({path:l,component:c})=>i.jsx(We,{path:l,component:c},l)),i.jsx(We,{component:()=>Le()?i.jsx(el,{to:"/login"}):i.jsx(_S,{})})]}):i.jsx(gW,{children:i.jsx(H7,{})}))})]})]})}):i.jsx(h.Suspense,{fallback:i.jsx("div",{className:"min-h-screen"}),children:i.jsxs(Cu,{children:[Cl.map(({path:l,component:c})=>i.jsx(We,{path:l,component:c},l)),i.jsx(We,{path:"*",children:()=>i.jsx(el,{to:Le()?"/login":"/"})})]})})}function J_(){return i.jsx(vW,{})}const bW=Object.freeze(Object.defineProperty({__proto__:null,RouterShell:J_},Symbol.toStringTag,{value:"Module"}));function sw(e,t,n){t(n),e("offline")}function wW(e){const{onAuthenticated:t,onUnauthenticated:n,skipInitialCheck:r=!1}=e,s=wt(),[a,o]=h.useState("offline"),[l,c]=h.useState(null),u=h.useRef(!0),f=h.useRef(!1),d=h.useRef(!1),m=h.useRef(!1),p=h.useRef(t),g=h.useRef(n);p.current=t,g.current=n;const x=h.useCallback(async()=>
512{if(!f.current){f.current=!0;try{if(!eg()){d.current=!0,o("unauthenticated"),g.current(),f.current=!1;return}o("validating");const v=await fetch("/api/auth/user",{credentials:"include",cache:"no-cache"});if(!u.current)return;if(v.ok){const b=await v.json().catch(()=>null);b&&s.setQueryData(["/api/auth/user"],b),m.current=!0,o("live"),p.current()}else v.status===401?(await Fk(),d.current=!0,o("unauthenticated"),g.current()):sw(o,c,`Server error: ${v.status}`)}catch(v){if(!u.current)return;sw(o,c,v instanceof Error?v.message:"Network error")}finally{f.current=!1}}},[s]);h.useEffect(()=>{if(!r)return x(),()=>{u.current=!1}},[x,r]),h.useEffect(()=>{const v=()=>d.current||m.current,b=()=>{document.visibilityState==="visible"&&(v()||x())},w=()=>{v()||x()};return document.addEventListener("visibilitychange",b),window.addEventListener("online",w),()=>{document.removeEventListener("visibilitychange",b),window.removeEventListener("online",w)}},[x]);const y=h.useCallback(()=>{o("offline"),c(null),m.current=!1,d.current=!1,setTimeout(x,0)},[x]);return{phase:a,validationError:l,revalidate:y}}function kW({children:e,isAuthChecking:t=!1,showMobileNav:n=!0}){return h.useEffect(()=>{GC()},[]),h.useEffect(()=>(document.body.classList.add("app"),document.documentElement.classList.add("app"),()=>{document.body.classList.remove("app"),document.documentElement.classList.remove("app")}),[]),i.jsxs("div",{className:"flex h-screen w-full overflow-hidden bg-gray-50 dark:bg-gray-900",children:[i.jsx("main",{className:"flex-1 flex flex-col min-w-0 min-h-0 pt-safe-top",children:i.jsx("div",{className:W("flex-1 overflow-y-auto overflow-x-hidden px-0 pt-0 md:p-4 min-h-0","pb-safe-bottom md:pb-4"),children:e})}),n&&i.jsx(np,{offline:!0,isAuthChecking:t})]})}function SW(){return i.jsx("div",{className:"fixed bottom-16 md:bottom-4 left-0 right-0 z-40 pointer-events-none",children:i.jsxs("div",{className:"bg-black/60 backdrop-blur-sm text-white text-sm py-2 px-4 flex items-center justify-center gap-2",children:[i.jsx(NW,{className:"animate-spin h-4 w-4"}),i.jsx("span",{children:"Checking authentication..."})]})})}function NW({className:e}){return i.jsxs("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}),i.jsx("path",{d:"M21 3v5h-5"})]})}function ay(){return i.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-40 pointer-events-none","data-testid":"minimal-loading",role:"status","aria-live":"polite","aria-label":"Loading content",children:i.jsxs("div",{className:"mascot-container",children:[i.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield",className:"bouncing-mascot"}),i.jsx("div",{className:"mascot-shadow"})]})})}var Cc=e=>e.type==="checkbox",Pi=e=>e instanceof Date,Gt=e=>e==null;const eA=e=>typeof e=="object";var St=e=>!Gt(e)&&!Array.isArray(e)&&eA(e)&&!Pi(e),ap=e=>St(e)&&e.target?Cc(e.target)?e.target.checked:e.target.value:e,tA=(e,t)=>t.split(".").some((n,r,s)=>!isNaN(Number(n))&&e.has(s.slice(0,r).join("."))),nA=e=>{const t=e.constructor&&e.constructor.prototype;return St(t)&&t.hasOwnProperty("isPrototypeOf")},gf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Nt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(gf&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(St(e)&&nA(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Nt(e[s]));return r}const Ds={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},sr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},nr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},rA="root",sA=["__proto__","constructor","prototype"],jW=/^\w*$/;var Tc=e=>jW.test(e),xt=e=>e===void 0;const CW=/[.[\]'"]/;var xf=e=>
vendor: 6,078 bytes, line 512
512e.split(CW).filter(Boolean),de=(e,t,n)=>{if(!t||!St(e))return n;const r=Tc(t)?[t]:xf(t);if(r.some(a=>sA.includes(a)))return n;const s=r.reduce((a,o)=>Gt(a)?void 0:a[o],e);return xt(s)||s===e?xt(e[t])?n:e[t]:s},On=e=>typeof e=="boolean",Jt=e=>typeof e=="function",lt=(e,t,n)=>{let r=-1;const s=Tc(t)?[t]:xf(t),a=s.length,o=a-1;for(;++r<a;){const l=s[r];let c=n;if(r!==o){const u=e[l];c=St(u)||Array.isArray(u)?u:isNaN(+s[r+1])?{}:[]}if(sA.includes(l))return;e[l]=c,e=e[l]}};const oy=Ne.createContext(null);oy.displayName="HookFormControlContext";const ly=()=>Ne.useContext(oy);var iA=(e,t,n,r=!0)=>{const s={};for(const a in e)Object.defineProperty(s,a,{get:()=>{const o=a;return t._proxyFormState[o]!==sr.all&&(t._proxyFormState[o]=!r||sr.all),n&&(n[o]=!0),e[o]}});return s};const cy=gf?Ne.useLayoutEffect:Ne.useEffect;function TW(e){const t=ly(),{control:n=t,disabled:r,name:s,exact:a}=e||{},[o,l]=Ne.useState(()=>({...n._formState,defaultValues:n._defaultValues})),c=Ne.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return cy(()=>n._subscribe({name:s,formState:c.current,exact:a,callback:u=>{!r&&l({...n._formState,...u,defaultValues:n._defaultValues})}}),[s,r,a]),Ne.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),Ne.useMemo(()=>iA(o,n,c.current,!1),[o,n])}var en=e=>typeof e=="string",op=(e,t,n,r,s)=>en(e)?(r&&t.watch.add(e),de(n,e,s)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),de(n,a))):(r&&(t.watchAll=!0),n),lp=e=>Gt(e)||!eA(e);const iw=(e,t)=>t.length===0&&!Array.isArray(e)&&!nA(e);function Ln(e,t,n=new WeakMap){if(e===t)return!0;if(lp(e)||lp(t))return Object.is(e,t);if(Pi(e)&&Pi(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(iw(e,r)||iw(t,s))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;const a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{const o=new WeakSet;o.add(t),n.set(e,o)}for(const o of r){const l=e[o];if(!(o in t))return!1;if(o!=="ref"){const c=t[o];if(Pi(l)&&Pi(c)||(St(l)||Array.isArray(l))&&(St(c)||Array.isArray(c))?!Ln(l,c,n):!Object.is(l,c))return!1}}return!0}function aA(e){const t=ly(),{control:n=t,name:r,defaultValue:s,disabled:a,exact:o,compute:l}=e||{},c=Ne.useRef(s),u=Ne.useRef(l),f=Ne.useRef(void 0),d=Ne.useRef(n),m=Ne.useRef(r);u.current=l;const[p,g]=Ne.useState(()=>{const j=n._getWatch(r,c.current);return u.current?u.current(j):j}),x=Ne.useCallback(j=>{const S=op(r,n._names,j||n._formValues,!1,c.current);return u.current?u.current(S):S},[n._formValues,n._names,r]),y=Ne.useCallback(j=>{if(!a){const S=op(r,n._names,j||n._formValues,!1,c.current);if(u.current){const C=u.current(S);Ln(C,f.current)||(g(C),f.current=C)}else g(S)}},[n._formValues,n._names,a,r]);cy(()=>((d.current!==n||!Ln(m.current,r))&&(d.current=n,m.current=r,y()),n._subscribe({name:r,formState:{values:!0},exact:o,callback:j=>{y(j.values)}})),[n,o,r,y]),Ne.useEffect(()=>n._removeUnmounted());const v=d.current!==n,b=m.current,w=Ne.useMemo(()=>{if(a)return null;const j=!v&&!Ln(b,r);return v||j?x():null},[a,v,r,b,x]);return w!==null?w:p}function EW(e){const t=ly(),{name:n,disabled:r,control:s=t,shouldUnregister:a,defaultValue:o,exact:l=!0}=e,c=tA(s._names.array,n),u=Ne.useMemo(()=>de(s._formValues,n,de(s._defaultValues,n,o)),[s,n,o]),f=aA({control:s,name:n,defaultValue:u,exact:l}),d=TW({control:s,name:n,exact:l}),m=Ne.useRef(e),p=Ne.useRef(null),g=Ne.useRef(s.register(n,{...e.rules,value:f,...On(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const x=Ne.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!de(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!de(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!de(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!de(d.validatingFields,n)},error:{enumerable:!0,get:()=>de(d.errors,n)}}),[d,n]),y=Ne.useCallback(j=>{const S=ap(j);return de(s._fields,n)||(g.current=s.register(n,{...m.current.rules,value:S})),g.current.onChange({target:{value:ap(j),name:n},type:Ds.CHANGE})},[n,s]),v=Ne.useCallback(()=>g.current.onBlur({target:{value:de(s._formValues,n),name:n},type:Ds.BLUR}),[n,s._formValues]),b=Ne.useCallback(j=>{j&&(p.current={focus:()=>Jt(j.focus)&&j.focus(),select:()=>Jt(j.select)&&j.select(),setCustomValidity:C=>Jt(j.setCustomValidity)&&j.setCustomValidity(C),reportValidity:()=>Jt(j.reportValidity)&&j.reportValidity()});const S=de(s._fields,n);S&&S._f&&j&&(S._f.ref=p.current)},[s._fields,n]),w=Ne.useMemo(()=>({name:n,value:f,...On(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:y,onBlur:v,ref:b}),[n,r,d.disabled,y,v,b,f]);return Ne.useEffect(()=>{const j=s._options.shouldUnregister||a;s.register(n,{...m.current.rules,...On(m.current.disabled)?{disabled:m.current.disabled}:{}});const S=(C,I)=>{const E=de(s._fields,C);E&&E._f&&(E._f.mount=I)};if(S(n,!0),j){const C=Nt(de(a?s._defaultValues:s._options.values||s._defaultValues,n,de(s._options.defaultValues,n,m.current.defaultValue)));lt(s._defaultValues,n,C),xt(de(s._formValues,n))&&lt(s._formValues,n,C)}if(!c&&s.register(n),p.current){const C=de(s._fields,n);C&&C._f&&(C._f.ref=p.current)}return()=>{(c?j&&!s._state.action:j)?s.unregister(n):S(n,!1)}},[n,s,c,a]),Ne.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),Ne.useMemo(()=>({field:w,formState:d,fieldState:x}),[w,d,x])}const _W=e=>e.render(EW(e)),uy=Ne.createContext(null);uy.displayName="HookFormContext";const AW=()=>Ne.useContext(uy),PW=({children:e,watch:t,getValues:n,getFieldState:r,setError:s,clearErrors:a,setValue:o,setValues:l,trigger:c,formState:u,resetField:f,reset:d,handleSubmit:m,unregister:p,control:g,register:x,setFocus:y,subscribe:v})=>{const b=Ne.useMemo(()=>({watch:t,getValues:n,getFieldState:r,setError:s,clearErrors:a,setValue:o,setValues:l,trigger:c,formState:u,resetField:f,reset:d,handleSubmit:m,unregister:p,control:g,register:x,setFocus:y,subscribe:v}),[a,g,u,r,n,m,x,d,f,s,y,o,l,v,c,p,t]);return Ne.createElement(uy.Provider,{value:b},Ne.createElement(oy.Provider,{value:b.control},e))};
512var oA=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},lA=e=>Array.isArray(e)?e.filter(Boolean):[],wu=e=>Array.isArray(e)?e:[e],aw=()=>{let e=[];return{get observers(){return e},next:s=>{for(const a of e)a.next&&a.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(a=>a!==s)}}),unsubscribe:()=>{e=[]}}};function cA(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],a=t[r];if(s&&St(s)&&a){const o=cA(s,a);St(o)&&(n[r]=o)}else e[r]&&(n[r]=a)}return n}var Wt=e=>St(e)&&!Object.keys(e).length,dy=e=>e.type==="file",nd=e=>{if(!gf)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},uA=e=>e.type==="select-multiple",fy=e=>e.type==="radio",RW=e=>fy(e)||Cc(e),Sh=e=>nd(e)&&e.isConnected;function IW(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;){if(Gt(e)){e=void 0;break}e=e[t[r]],r++}return e}function MW(e){for(const t in e)if(e.hasOwnProperty(t)&&!xt(e[t]))return!1;return!0}function It(e,t){if(en(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:Tc(t)?[t]:xf(t),r=n.length===1?e:IW(e,n),s=n.length-1,a=n[s];return r&&delete r[a],s!==0&&(St(r)&&Wt(r)||Array.isArray(r)&&MW(r))&&It(e,n.slice(0,-1)),e}var DW=e=>{for(const t in e)if(Jt(e[t]))return!0;return!1};function dA(e){return Array.isArray(e)||St(e)&&!DW(e)}function cp(e,t={}){for(const n in e){const r=e[n];dA(r)?(t[n]=Array.isArray(r)?[]:{},cp(r,t[n])):xt(r)||(t[n]=!0)}return t}function up(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(n=>up(n));return t.some(n=>n!==void 0)?t:void 0}if(St(e)){const t={};for(const n in e){const r=up(e[n]);xt(r)||(t[n]=r)}return Object.keys(t).length?t:void 0}}}function ji(e,t,n){n||(n=cp(t));for(const r in e){const s=e[r];if(dA(s))xt(t)||lp(n[r])?n[r]=cp(s,Array.isArray(s)?[]:{}):ji(s,Gt(t)?{}:t[r],n[r]);else{const a=t[r];n[r]=!Ln(s,a)}}return up(n)||{}}const ow={value:!1,isValid:!1},lw={value:!0,isValid:!0};var fA=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!xt(e[0].attributes.value)?xt(e[0].value)||e[0].value===""?lw:{value:e[0].value,isValid:!0}:lw:ow}return ow},hA=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>xt(e)?e:t?e===""?NaN:e&&+e:n&&en(e)?new Date(e):r?r(e):e;const cw={isValid:!1,value:null};var mA=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,cw):cw;function uw(e){const t=e.ref;return dy(t)?t.files:fy(t)?mA(e.refs).value:uA(t)?[...t.selectedOptions].map(({value:n})=>n):Cc(t)?fA(e.refs).value:hA(xt(t.value)?e.ref.value:t.value,e)}var OW=(e,t,n,r)=>{const s={};for(const a of e){const o=de(t,a);o&&lt(s,a,o._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},rd=e=>e instanceof RegExp,qo=e=>xt(e)?e:rd(e)?e.source:St(e)?rd(e.value)?e.value.source:e.value:e,Qc=e=>({isOnSubmit:!e||e===sr.onSubmit,isOnBlur:e===sr.onBlur,isOnChange:e===sr.onChange,isOnAll:e===sr.all,isOnTouch:e===sr.onTouched});const dw="AsyncFunction";var LW=e=>{if(!e||!e.validate)return!1;if(Jt(e.validate))return e.validate.constructor.name===dw;if(St(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===dw)return!0}return!1},FW=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Nh=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const r of t.watch)if(e.startsWith(r)&&e.charAt(r.length)===".")return!0;return!1};const xl=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const a=de(e,s);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(xl(l,t))break}else if(St(l)&&xl(l,t))break}}};function fw(e,t,n){const r=de(e,n);if(r||Tc(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const a=s.join("."),o=de(t,a),l=de(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};if(l&&l.root&&l.root.type)return{name:`${a}.root`,error:l.root};s.pop()}return{name:n}}var VW=(e,t,n,r)=>{n(e);const{name:s,...a}=e,o=Object.keys(a);return!o.length||r&&o.length>=Object.keys(t).length||o.find(l=>t[l]===(!r||sr.all))},$W=(e,t,n)=>!e||!t||e===t||wu(e).some(r=>
vendor: 1,928 bytes, line 512
512r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),zW=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,UW=(e,t)=>!lA(de(e,t)).length&&It(e,t),hw=(e,t,n)=>{const r=de(e,n),s=Array.isArray(r)?r:[];return lt(s,rA,t[n]),lt(e,n,s),e};function mw(e,t,n="validate"){if(en(e)||Array.isArray(e)&&e.every(en)||On(e)&&!e)return{type:n,message:en(e)?e:"",ref:t}}var Na=e=>St(e)&&!rd(e)?e:{value:e,message:""},pw=async(e,t,n,r,s,a)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:f,min:d,max:m,pattern:p,validate:g,name:x,valueAsNumber:y,mount:v}=e._f,b=de(n,x);if(!v||t.has(x))return{};const w=l?l[0]:o,j=M=>{if(s&&w.reportValidity){const L=On(M)?"":M||"";l?l.forEach(F=>F.setCustomValidity(L)):w.setCustomValidity(L),w.reportValidity()}},S={},C=fy(o),I=Cc(o),E=C||I,N=(y||dy(o))&&xt(o.value)&&xt(b)||nd(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length,k=oA.bind(null,x,r,S),A=(M,L,F,V=nr.maxLength,U=nr.minLength)=>{const P=M?L:F;S[x]={type:M?V:U,message:P,ref:o,...k(M?V:U,P)}};if(a?!Array.isArray(b)||!b.length:c&&(!E&&(N||Gt(b))||On(b)&&!b||I&&!fA(l).isValid||C&&!mA(l).isValid)){const{value:M,message:L}=en(c)?{value:!!c,message:c}:Na(c);if(M&&(S[x]={type:nr.required,message:L,ref:w,...k(nr.required,L)},!r))return j(L),S}if(!N&&(!Gt(d)||!Gt(m))){let M,L;const F=Na(m),V=Na(d);if(!Gt(b)&&!isNaN(b)){const U=o.valueAsNumber||b&&+b;Gt(F.value)||(M=U>F.value),Gt(V.value)||(L=U<V.value)}else{const U=o.valueAsDate||new Date(b),P=_=>new Date(new Date().toDateString()+" "+_),T=o.type=="time",D=o.type=="week";en(F.value)&&b&&(M=T?P(b)>P(F.value):D?b>F.value:U>new Date(F.value)),en(V.value)&&b&&(L=T?P(b)<P(V.value):D?b<V.value:U<new Date(V.value))}if((M||L)&&(A(!!M,F.message,V.message,nr.max,nr.min),!r))return j(S[x].message),S}if((u||f)&&!N&&(en(b)||a&&Array.isArray(b))){const M=Na(u),L=Na(f),F=!Gt(M.value)&&b.length>+M.value,V=!Gt(L.value)&&b.length<+L.value;
512if((F||V)&&(A(F,M.message,L.message),!r))return j(S[x].message),S}if(p&&!N&&en(b)){const{value:M,message:L}=Na(p);if(rd(M)&&!b.match(M)&&(S[x]={type:nr.pattern,message:L,ref:o,...k(nr.pattern,L)},!r))return j(L),S}if(g){if(Jt(g)){const M=await g(b,n),L=mw(M,w);if(L&&(S[x]={...L,...k(nr.validate,L.message)},!r))return j(L.message),S}else if(St(g)){let M={};for(const L in g){if(!Wt(M)&&!r)break;const F=mw(await g[L](b,n),w,L);F&&(M={...F,...k(L,F.message)},j(F.message),r&&(S[x]=M))}if(!Wt(M)&&(S[x]={ref:w,...M},!r))return S}}return j(!0),S};const BW={mode:sr.onSubmit,reValidateMode:sr.onChange,shouldFocusError:!0},jh="form",pA={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function HW(e={}){let t={...BW,...e},n={...Nt(pA),isLoading:Jt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},s=St(t.defaultValues)||St(t.values)?Nt(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Nt(s),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0,f=0,d=Qc(t.mode),m=Qc(t.reValidateMode);const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...p};let x={...g};const y={array:aw(),state:aw()},v=t.criteriaMode===sr.all,b=O=>B=>{clearTimeout(u),u=setTimeout(O,B)},w=async O=>{if(!o.keepIsValid&&!t.disabled&&(g.isValid||x.isValid||O)){let B;t.resolver?(B=Wt((await L()).errors),j()):B=await U({fields:r,onlyCheckValid:!0,eventType:Ds.VALID}),B!==n.isValid&&y.state.next({isValid:B})}},j=(O,B)=>{!t.disabled&&(g.isValidating||g.validatingFields||x.isValidating||x.validatingFields)&&((O||Array.from(l.mount)).forEach(H=>{H&&(B?lt(n.validatingFields,H,B):It(n.validatingFields,H))}),y.state.next({validatingFields:n.validatingFields,isValidating:!Wt(n.validatingFields)}))},S=()=>{n.dirtyFields=ji(s,a)},C=(O,B=[],H,J,re=!0,me=!0)=>{if(J&&H&&!t.disabled){if(o.action=!0,me&&Array.isArray(de(r,O))){const ie=H(de(r,O),J.argA,J.argB);re&&lt(r,O,ie)}if(me&&Array.isArray(de(n.errors,O))){const ie=H(de(n.errors,O),J.argA,J.argB);re&&lt(n.errors,O,ie),UW(n.errors,O)}if((g.touchedFields||x.touchedFields)&&me&&Array.isArray(de(n.touchedFields,O))){const ie=H(de(n.touchedFields,O),J.argA,J.argB);re&&lt(n.touchedFields,O,ie)}(g.dirtyFields||x.dirtyFields)&&S(),y.state.next({name:O,isDirty:T(O,B),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else lt(a,O,B)},I=(O,B)=>{lt(n.errors,O,B),n.errors={...n.errors},y.state.next({errors:n.errors})},E=O=>{n.errors=O,y.state.next({errors:n.errors,isValid:!1})},N=O=>{const B=Tc(O)?[O]:xf(O);let H=a,J=s;for(let re=0;re<B.length-1;re++){const me=B[re];if(H=Gt(H)?H:H[me],J=Gt(J)?J:J[me],H===null&&J!==null)return!0}return!1},k=(O,B,H,J)=>{const re=de(r,O);if(re){if(N(O))return;const me=xt(de(a,O)),ie=de(a,O,xt(H)?de(s,O):H);xt(ie)||J&&J.defaultChecked||B?lt(a,O,B?ie:uw(re._f)):G(O,ie),o.mount&&!o.action&&(w(),me&&n.isDirty&&(g.isDirty||x.isDirty)&&(T()||(n.isDirty=!1,y.state.next({...n}))),e.shouldUnregister&&me&&!xt(de(a,O))&&Nh(O,l)&&(o.watch=!0))}},A=(O,B,H,J,re)=>{let me=!1,ie=!1;const xe={name:O};if(!t.disabled){if(!H||J){const je=Ln(de(s,O),B);(g.isDirty||x.isDirty)&&(ie=n.isDirty,n.isDirty=xe.isDirty=!je||T(),me=ie!==xe.isDirty),ie=!!de(n.dirtyFields,O),je!==n.isDirty?n.dirtyFields=ji(s,a):je?It(n.dirtyFields,O):lt(n.dirtyFields,O,!0),xe.dirtyFields=n.dirtyFields,me=me||(g.dirtyFields||x.dirtyFields)&&ie!==!je}if(H){const je=de(n.touchedFields,O);je||(lt(n.touchedFields,O,H),xe.touchedFields=n.touchedFields,me=me||(g.touchedFields||x.touchedFields)&&je!==H)}me&&re&&y.state.next(xe)}return me?xe:{}},M=(O,B,H,J)=>{const re=de(n.errors,O),me=(g.isValid||x.isValid)&&On(B)&&n.isValid!==B;if(t.delayError&&H?(c=b(()=>I(O,H)),c(t.delayError)):(clearTimeout(u),c=null,H?lt(n.errors,O,H):It(n.errors,O),n.errors={...n.errors}),(H?!Ln(re,H):re)||!Wt(J)||me){const ie={...J,...me&&On(B)?{isValid:B}:{},errors:n.errors,name:O};n={...n,...ie},y.state.next(ie)}},L=async O=>(j(O,!0),await t.resolver(a,t.context,OW(O||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),F=async O=>{const{errors:B}=await L(O);if(j(O),O){for(const H of O){const J=de(B,H);J?l.array.has(H)&&St(J)&&!Object.keys(J).some(re=>!Number.isNaN(Number(re)))?hw(n.errors,{[H]:J},H):lt(n.errors,H,J):It(n.errors,H)}n.errors={...n.errors}}else n.errors=B;return B},V=async({name:O,eventType:B})=>{if(e.validate){const H=await e.validate({formValues:a,formState:n,name:O,eventType:B});if(St(H))for(const J in H){const re=H[J];re&&oe(`${jh}.${J}`,{message:en(re.message)?re.message:"",type:re.type||nr.validate})}else en(H)||!H?oe(jh,{message:H||"",type:nr.validate}):ge(jh);return H}return!0},U=async({fields:O,onlyCheckValid:B,name:H,eventType:J,context:re={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(re.runRootValidation=!0,!await V({name:H,eventType:J})&&(re.valid=!1,B)))return re.valid;for(const me in O){const ie=O[me];if(ie){const{_f:xe,...je}=ie;if(xe){const bt=l.array.has(xe.name),Pn=ie._f&&LW(ie._f),ya=g.validatingFields||g.isValidating||x.validatingFields||x.isValidating;Pn&&ya&&j([xe.name],!0);const Gr=await pw(ie,l.disabled,a,v,t.shouldUseNativeValidation&&!B,bt);if(Pn&&ya&&j([xe.name]),Gr[xe.name]&&(re.valid=!1,B)||(!B&&(de(Gr,xe.name)?bt?hw(n.errors,Gr,xe.name):lt(n.errors,xe.name,Gr[xe.name]):It(n.errors,xe.name)),e.shouldUseNativeValidation&&Gr[xe.name]))break}
512!Wt(je)&&await U({context:re,onlyCheckValid:B,fields:je,name:me,eventType:J})}}return re.valid},P=()=>{for(const O of l.unMount){const B=de(r,O);B&&(B._f.refs?B._f.refs.every(H=>!Sh(H)):!Sh(B._f.ref))&&qe(O)}l.unMount=new Set},T=(O,B)=>!t.disabled&&(O&&B&&lt(a,O,B),!Ln(o.mount?a:s,s)),D=(O,B,H)=>op(O,l,{...o.mount?a:xt(B)?s:en(O)?{[O]:B}:B},H,B),_=O=>lA(de(o.mount?a:s,O,t.shouldUnregister?de(s,O,[]):[])),G=(O,B,H={},J=!1,re=!1)=>{const me=de(r,O);let ie=B;if(me){const xe=me._f;xe&&(!xe.disabled&&lt(a,O,hA(B,xe)),ie=nd(xe.ref)&&Gt(B)?"":B,uA(xe.ref)?[...xe.ref.options].forEach(je=>je.selected=ie.includes(je.value)):xe.refs?Cc(xe.ref)?xe.refs.forEach(je=>{(!je.defaultChecked||!je.disabled)&&(Array.isArray(ie)?je.checked=!!ie.find(bt=>bt===je.value):je.checked=ie===je.value||!!ie)}):xe.refs.forEach(je=>je.checked=je.value===ie):dy(xe.ref)?xe.ref.value="":(xe.ref.value=ie,!xe.ref.type&&!re&&y.state.next({name:O,values:J?a:Nt(a)})))}(H.shouldDirty||H.shouldTouch)&&A(O,ie,H.shouldTouch,H.shouldDirty,!re),H.shouldValidate&&fe(O)},z=(O,B,H,J=!1,re=!1)=>{for(const me in B){if(!B.hasOwnProperty(me))return;const ie=B[me],xe=O+"."+me,je=de(r,xe);(l.array.has(O)||St(ie)||je&&!je._f)&&!Pi(ie)?z(xe,ie,H,J,re):G(xe,ie,H,J,re)}},R=(O,B,H,J,re=!1)=>{const me=de(r,O),ie=l.array.has(O),xe=J?B:Nt(B),je=de(a,O),bt=Ln(je,xe);if(bt||lt(a,O,xe),ie)y.array.next({name:O,values:J?a:Nt(a)}),(g.isDirty||g.dirtyFields||x.isDirty||x.dirtyFields)&&H.shouldDirty&&(S(),re||y.state.next({name:O,dirtyFields:n.dirtyFields,isDirty:T(O,xe)}));else{const Pn=Array.isArray(xe)&&!xe.length||Wt(xe);!me||me._f||Gt(xe)||Pn?G(O,xe,H,J,re):z(O,xe,H,J,re)}if(!bt&&!re){const Pn=Nh(O,l),ya=J?a:Nt(a);y.state.next({...Pn&&n,name:o.mount||Pn?O:void 0,values:ya})}},q=(O,B,H={})=>R(O,B,H,!1),Q=(O,B={})=>{const H=Jt(O)?O(a):O;if(!Ln(a,H)){a={...a,...H};for(const J of l.mount)R(J,de(H,J),B,!0,!0);y.state.next({...n,name:void 0,type:void 0,...f?{values:a}:{}}),B.shouldValidate&&w()}},K=async O=>{o.mount=!0;const B=O.target;let H=B.name,J=!0;const re=de(r,H),me=ie=>{J=Number.isNaN(ie)||Pi(ie)&&isNaN(ie.getTime())||Ln(ie,de(a,H,ie))};if(re){let ie,xe;const je=B.type?uw(re._f):ap(O),bt=O.type===Ds.BLUR||O.type===Ds.FOCUS_OUT,Pn=!FW(re._f)&&!e.validate&&!t.resolver&&!de(n.errors,H)&&!re._f.deps,ya=Pn||zW(bt,de(n.touchedFields,H),n.isSubmitted,m,d),Gr=Nh(H,l,bt);lt(a,H,je),bt?(!B||!B.readOnly)&&(re._f.onBlur&&re._f.onBlur(O),c&&c(0)):re._f.onChange&&re._f.onChange(O);const Oo=A(H,je,bt),T2=!Wt(Oo)||Gr;if(!bt&&y.state.next({name:H,type:O.type,...f?{values:Nt(a)}:{}}),ya)return(!Pn||!n.isValid)&&(g.isValid||x.isValid)&&(t.mode==="onBlur"?bt&&w():bt||w()),T2&&y.state.next({name:H,...Gr?{}:Oo});if(!t.resolver&&e.validate&&await V({name:H,eventType:O.type}),!bt&&Gr&&y.state.next({...n}),t.resolver){const{errors:iv}=await L([H]);if(j([H]),me(je),!J){!Wt(Oo)&&y.state.next(Oo);return}const E2=fw(n.errors,r,H),av=fw(iv,r,E2.name||H);ie=av.error,H=av.name,xe=Wt(iv)}else j([H],!0),ie=(await pw(re,l.disabled,a,v,t.shouldUseNativeValidation))[H],j([H]),me(je),J&&(ie?xe=!1:(g.isValid||x.isValid)&&(xe=await U({fields:r,onlyCheckValid:!0,name:H,eventType:O.type})));J&&(re._f.deps&&(!Array.isArray(re._f.deps)||re._f.deps.length>0)&&fe(re._f.deps),M(H,xe,ie,Oo))}},X=(O,B)=>{if(de(n.errors,B)&&O.focus)return O.focus(),1},fe=async(O,B={})=>{let H,J;const re=wu(O);if(t.resolver){const me=await F(xt(O)?O:re);H=Wt(me),J=O?!re.some(ie=>de(me,ie)):H}else O?(J=(await Promise.all(re.map(async me=>{const ie=de(r,me);return await U({fields:ie&&ie._f?{[me]:ie}:ie,eventType:Ds.TRIGGER})}))).every(Boolean),!(!J&&!n.isValid)&&w()):J=H=await U({fields:r,name:O,eventType:Ds.TRIGGER});return y.state.next({...!en(O)||(g.isValid||x.isValid)&&H!==n.isValid?{}:{name:O},...t.resolver||!O?{isValid:H}:{},errors:n.errors}),B.shouldFocus&&!J&&xl(r,X,O?re:l.mount),J},ee=(O,B)=>{let H={...o.mount?a:s};return B&&(H=cA(B.dirtyFields?n.dirtyFields:n.touchedFields,H)),xt(O)?H:en(O)?de(H,O):O.map(J=>de(H,J))},te=(O,B)=>({invalid:!!de((B||n).errors,O),isDirty:!!de((B||n).dirtyFields,O),error:de((B||n).errors,O),isValidating:!!de(n.validatingFields,O),isTouched:!!de((B||n).touchedFields,O)}),ge=O=>{const B=O?wu(O):void 0;B==null||B.forEach(H=>It(n.errors,H)),B?B.forEach(H=>{y.state.next({name:H,errors:n.errors})}):y.state.next({errors:{}})},oe=(O,B,H)=>{const J=(de(r,O,{_f:{}})._f||{}).ref,re=de(n.errors,O)||{},{ref:me,message:ie,type:xe,...je}=re;lt(n.errors,O,{...je,...B,ref:J}),y.state.next({name:O,errors:n.errors,isValid:!1}),H&&H.shouldFocus&&J&&J.focus&&J.focus()},Ve=(O,B)=>{if(Jt(O)){f++;const{unsubscribe:H}=y.state.subscribe({next:re=>"values"in re&&O(re.values||D(void 0,B),re)});let J=!1;return{unsubscribe:()=>{J||(J=!0,f--,H())}}}return D(O,B,!0)},$e=O=>{var B;const H=!!(!((B=O.formState)===null||B===void 0)&&B.values);H&&f++;const{unsubscribe:J}=y.state.subscribe({next:me=>{if($W(O.name,me.name,O.exact)&&VW(me,O.formState||g,Y,O.reRenderRoot)){const ie={...a};O.callback({values:ie,...n,...me,defaultValues:s})}}});if(!H)return J;let re=!1;return()=>{re||(re=!0,f--,J())}},ze=O=>(o.mount=!0,x={...x,...O.formState},$e({...O,formState:{...p,...O.formState}})),qe=(O,B={})=>{for(const H of O?wu(O):l.mount)l.mount.delete(H),l.array.delete(H),B.keepValue||(It(r,H),It(a,H)),!B.keepError&&It(n.errors,H),!B.
512keepDirty&&It(n.dirtyFields,H),!B.keepTouched&&It(n.touchedFields,H),!B.keepIsValidating&&It(n.validatingFields,H),!t.shouldUnregister&&!B.keepDefaultValue&&It(s,H);y.state.next({values:Nt(a)}),y.state.next({...n,...B.keepDirty?{isDirty:T()}:{}}),!B.keepIsValid&&w()},Oe=({disabled:O,name:B})=>{if(On(O)&&o.mount||O||l.disabled.has(B)){const re=l.disabled.has(B)!==!!O;O?l.disabled.add(B):l.disabled.delete(B),re&&o.mount&&!o.action&&w()}},Ft=(O,B={})=>{let H=de(r,O);const J=On(B.disabled)||On(t.disabled),re=!l.registerName.has(O)&&H&&H._f&&!H._f.mount;return lt(r,O,{...H||{},_f:{...H&&H._f?H._f:{ref:{name:O}},name:O,mount:!0,...B}}),l.mount.add(O),H&&!re?Oe({disabled:On(B.disabled)?B.disabled:t.disabled,name:O}):k(O,!0,B.value),{...J?{disabled:B.disabled||t.disabled}:{},...t.progressive?{required:!!B.required,min:qo(B.min),max:qo(B.max),minLength:qo(B.minLength),maxLength:qo(B.maxLength),pattern:qo(B.pattern)}:{},name:O,onChange:K,onBlur:K,ref:me=>{if(me){l.registerName.add(O),Ft(O,B),l.registerName.delete(O),H=de(r,O);const ie=xt(me.value)&&me.querySelectorAll&&me.querySelectorAll("input,select,textarea")[0]||me,xe=RW(ie),je=H._f.refs||[];if(xe?je.find(bt=>bt===ie):ie===H._f.ref)return;lt(r,O,{_f:{...H._f,...xe?{refs:[...je.filter(Sh),ie,...Array.isArray(de(s,O))?[{}]:[]],ref:{type:ie.type,name:O}}:{ref:ie}}}),k(O,!1,void 0,ie)}else H=de(r,O,{}),H._f&&(H._f.mount=!1),(t.shouldUnregister||B.shouldUnregister)&&!(tA(l.array,O)&&o.action)&&l.unMount.add(O)}}},Pe=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&xl(r,X,l.mount),tt=O=>{On(O)&&(y.state.next({disabled:O}),xl(r,(B,H)=>{const J=de(r,H);J&&(B.disabled=J._f.disabled||O,Array.isArray(J._f.refs)&&J._f.refs.forEach(re=>{re.disabled=J._f.disabled||O}))},0,!1))},An=(O,B)=>async H=>{let J;H&&(H.preventDefault&&H.preventDefault(),H.persist&&H.persist());let re=Nt(a);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:me,values:ie}=await L();j(),n.errors=me,re=Nt(ie)}else await U({fields:r,eventType:Ds.SUBMIT});if(l.disabled.size)for(const me of l.disabled)It(re,me);if(It(n.errors,rA),Wt(n.errors)){y.state.next({errors:{}});try{await O(re,H)}catch(me){J=me}}else B&&await B({...n.errors},H),Pe(),setTimeout(Pe);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Wt(n.errors)&&!J,submitCount:n.submitCount+1,errors:n.errors}),J)throw J},xr=(O,B={})=>{de(r,O)&&(xt(B.defaultValue)?q(O,Nt(de(s,O))):(q(O,B.defaultValue),lt(s,O,Nt(B.defaultValue))),B.keepTouched||It(n.touchedFields,O),B.keepDirty||(It(n.dirtyFields,O),n.isDirty=B.defaultValue?T(O,Nt(de(s,O))):T()),B.keepError||(It(n.errors,O),g.isValid&&w()),y.state.next({...n}))},an=(O,B={})=>{const H=O?Nt(O):s,J=Nt(H),re=Wt(O),me=J;if(B.keepDefaultValues||(s=H),!B.keepValues){if(B.keepDirtyValues){const ie=new Set([...l.mount,...Object.keys(ji(s,a))]);for(const xe of Array.from(ie)){const je=de(n.dirtyFields,xe),bt=de(a,xe),Pn=de(me,xe);je&&!xt(bt)?lt(me,xe,bt):!je&&!xt(Pn)&&q(xe,Pn)}}else{if(gf&&xt(O))for(const ie of l.mount){const xe=de(r,ie);if(xe&&xe._f){const je=Array.isArray(xe._f.refs)?xe._f.refs[0]:xe._f.ref;if(nd(je)){const bt=je.closest("form");if(bt){bt.reset();break}}}}if(B.keepFieldsRef)for(const ie of l.mount)q(ie,de(me,ie));else r={}}if(t.shouldUnregister){if(a=B.keepDefaultValues?Nt(s):{},B.keepFieldsRef)for(const ie of l.mount)lt(a,ie,de(me,ie))}else a=Nt(me);y.array.next({values:{...me}}),y.state.next({values:{...me}})}l={mount:B.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!g.isValid||!!B.keepIsValid||!!B.keepDirtyValues||!t.shouldUnregister&&!Wt(me),o.watch=!!t.shouldUnregister,o.keepIsValid=!!B.keepIsValid,o.action=!1,B.keepErrors||(n.errors={}),y.state.next({submitCount:B.keepSubmitCount?n.submitCount:0,isDirty:re?!1:B.keepDirty?n.isDirty:B.keepValues?T():!!(B.keepDefaultValues&&!Ln(O,s)),isSubmitted:B.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:re?{}:B.keepDirtyValues?B.keepDefaultValues&&a?ji(s,a):n.dirtyFields:B.keepDefaultValues&&O?ji(s,O):B.keepDirty?n.dirtyFields:{},touchedFields:B.keepTouched?n.touchedFields:{},errors:B.keepErrors?n.errors:{},isSubmitSuccessful:B.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},yr=(O,B)=>an(Jt(O)?O(a):O,{...t.resetOptions,...B}),Rt=(O,B={})=>{const H=de(r,O),J=H&&H._f;if(J){const re=J.refs?J.refs[0]:J.ref;re.focus&&setTimeout(()=>{re.focus(),B.shouldSelect&&Jt(re.select)&&re.select()})}},Y=O=>{n={...n,...O}},Ie={control:{register:Ft,unregister:qe,getFieldState:te,handleSubmit:An,setError:oe,_subscribe:$e,_runSchema:L,_updateIsValidating:j,_focusError:Pe,_getWatch:D,_getDirty:T,_setValid:w,_setFieldArray:C,_setDisabledField:Oe,_setErrors:E,_getFieldArray:_,_reset:an,_resetDefaultValues:()=>Jt(t.defaultValues)&&t.defaultValues().then(O=>{yr(O,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:tt,_subjects:y,_proxyFormState:g,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(O){o=O},get _defaultValues(){return s},get _names(){return l},set _names(O){l=O},get _formState(){return n},get _options(){return t},set _options(O){t={...t,...O},d=Qc(t.mode),m=Qc(t.reValidateMode)}},subscribe:ze,trigger:fe,register:Ft,handleSubmit:An,watch:Ve,setValue:q,setValues:Q,getValues:ee,reset:yr,resetField:xr,resetDefaultValues:(O,B={})=>
512{if(s=Nt(O),!B.keepDirty){const H=ji(s,a);n.dirtyFields=H,n.isDirty=!Wt(H)}B.keepIsValid||w(),y.state.next({...n,defaultValues:s})},clearErrors:ge,unregister:qe,setError:oe,setFocus:Rt,getFieldState:te};return{...Ie,formControl:Ie}}function hy(e={}){const t=Ne.useRef(void 0),n=Ne.useRef(void 0),r=Ne.useRef(e.formControl),[s,a]=Ne.useState(()=>({...Nt(pA),isLoading:Jt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Jt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!Jt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...c}=HW(e);t.current={...c,formState:s}}const o=t.current.control;return o._options=e,cy(()=>{const l=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return a(c=>({...c,isReady:!0})),o._formState.isReady=!0,l},[o]),Ne.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Ne.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),Ne.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),Ne.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),Ne.useEffect(()=>{if(o._proxyFormState.isDirty){const l=o._getDirty();l!==s.isDirty&&o._subjects.state.next({isDirty:l})}},[o,s.isDirty]),Ne.useEffect(()=>{var l;e.values&&!Ln(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((l=o._options.resetOptions)===null||l===void 0)&&l.keepIsValid||o._setValid(),n.current=e.values,a(c=>({...c}))):o._resetDefaultValues()},[o,e.values]),Ne.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=Ne.useMemo(()=>iA(s,o),[o,s]),t.current}const gw=(e,t,n)=>{if(e&&"reportValidity"in e){const r=de(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},gA=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?gw(r.ref,n,e):r.refs&&r.refs.forEach(s=>gw(s,n,e))}},WW=(e,t)=>{t.shouldUseNativeValidation&&gA(e,t);const n={};for(const r in e){const s=de(t.fields,r),a=Object.assign(e[r]||{},{ref:s&&s.ref});if(qW(t.names||Object.keys(e),r)){const o=Object.assign({},de(n,r));lt(o,"root",a),lt(n,r,o)}else lt(n,r,a)}return n},qW=(e,t)=>e.some(n=>n.startsWith(t+"."));var GW=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,a=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[o]={message:l.message,type:l.code}}else n[o]={message:a,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var c=n[o].types,u=c&&c[r.code];n[o]=oA(o,t,n,s,u?[].concat(u,r.message):r.message)}e.shift()}return n},my=function(e,t,n){return n===void 0&&(n={}),function(r,s,a){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return a.shouldUseNativeValidation&&gA({},a),{errors:{},values:n.raw?r:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(o))return{values:{},errors:WW(GW(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}};const py=PW,xA=h.createContext({}),Vn=({...e})=>i.jsx(xA.Provider,{value:{name:e.name},children:i.jsx(_W,{...e})}),yf=()=>{const e=h.useContext(xA),t=h.useContext(yA),{getFieldState:n,formState:r}=AW(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...s}},yA=h.createContext({}),un=h.forwardRef(({className:e,...t},n)=>{const r=h.useId();return i.jsx(yA.Provider,{value:{id:r},children:i.jsx("div",{ref:n,className:W("space-y-2",e),...t})})});un.displayName="FormItem";const dn=h.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=yf();return i.jsx(Ge,{ref:n,className:W(r&&"text-destructive",e),htmlFor:s,...t})});dn.displayName="FormLabel";const kn=h.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:a}=yf();return i.jsx(sS,{ref:t,id:r,"aria-describedby":n?`${s} ${a}`:`${s}`,"aria-invalid":!!n,...e})});kn.displayName="FormControl";const gy=h.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=yf();return i.jsx("p",{ref:n,id:r,className:W("text-base text-muted-foreground",e),...t})});gy.displayName="FormDescription";const Sn=h.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:a}=yf(),o=s?String((s==null?void 0:s.message)??""):t;return o?i.jsx("p",{ref:r,id:a,className:W("text-base font-medium text-destructive",e),...n,children:o}):null});Sn.displayName="FormMessage";var nt;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of a)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(const o of s)if(a(o))return o}
vendor: 13,149 bytes, line 512
512,e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(nt||(nt={}));var xw;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(xw||(xw={}));const be=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Os=e=>{switch(typeof e){case"undefined":return be.undefined;case"string":return be.string;case"number":return Number.isNaN(e)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(e)?be.array:e===null?be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?be.promise:typeof Map<"u"&&e instanceof Map?be.map:typeof Set<"u"&&e instanceof Set?be.set:typeof Date<"u"&&e instanceof Date?be.date:be.object;default:return be.unknown}},ae=nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),sae=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Xn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(a){return a.message},r={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return s(this),r}static assert(t){if(!(t instanceof Xn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,nt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];n[a]=n[a]||[],n[a].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Xn.create=e=>new Xn(e);const Hl=(e,t)=>{let n;switch(e.code){case ae.invalid_type:e.received===be.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:n=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case ae.invalid_union:n="Invalid input";break;case ae.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case ae.invalid_enum_value:n=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:n="Invalid function arguments";break;case ae.invalid_return_type:n="Invalid function return type";break;case ae.invalid_date:n="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:nt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ae.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ae.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ae.custom:n="Invalid input";break;case ae.invalid_intersection_types:n="Intersection results could not be merged";break;case ae.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:n="Number must be finite";break;default:n=t.defaultError,nt.assertNever(e)}return{message:n}};let vA=Hl;function iae(e){vA=e}function dp(){return vA}const fp=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:a,message:l}},aae=[];function ve(e,t){const n=dp(),r=fp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Hl?void 0:Hl].filter(s=>!!s)});e.common.issues.push(r)}class pn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return Re;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const a=await s.key,o=await s.value;r.push({key:a,value:o})}return pn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return Re;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const Re=Object.freeze({status:"aborted"}),ol=e=>({status:"dirty",value:e}),Tn=e=>({status:"valid",value:e}),yw=e=>e.status==="aborted",vw=e=>e.status==="dirty",go=e=>e.status==="valid",sd=e=>typeof Promise<"u"&&e instanceof Promise;var we;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(we||(we={}));class zr{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const bw=(e,t)=>{if(go(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Xn(e.common.issues);return this._error=n,this._error}}};function Ue(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class Ke{get description(){return this._def.description}_getType(t){return Os(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Os(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new pn,ctx:{common:t.parent.common,data:t.data,parsedType:Os(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(sd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Os(t)},s=this._parseSync({data:t,path:r.path,parent:r});return bw(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Os(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return go(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(s=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(a=>go(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Os(t)},s=this._parse({data:t,path:r.path,parent:r}),a=await(sd(s)?s:Promise.resolve(s));return bw(r,a)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,a)=>{const o=t(s),l=()=>a.addIssue({code:ae.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ws({schema:this,typeName:De.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ds.create(this,this._def)}nullable(){return na.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dr.create(this)}promise(){return ql.create(this,this._def)}or(t){return ld.create([this,t],this._def)}and(t){return cd.create(this,t,this._def)}transform(t){return new ws({...Ue(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new md({...Ue(this._def),innerType:this,defaultValue:n,typeName:De.ZodDefault})}brand(){return new SA({typeName:De.ZodBranded,type:this,...Ue(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new pd({...Ue(this._def),innerType:this,catchValue:n,typeName:De.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return vf.create(this,t)}readonly(){return gd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const YW=/^c[^\s-]{8,}
512$/i,KW=/^[0-9a-z]+$/,QW=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ZW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,XW=/^[a-z0-9_-]{21}$/i,JW=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,eq=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tq=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ch;const rq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,iq=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,aq=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oq=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,lq=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cq=new RegExp(`^${bA}$`);function wA(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function uq(e){return new RegExp(`^${wA(e)}$`)}function dq(e){let t=`${bA}T${wA(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function fq(e,t){return!!((t==="v4"||!t)&&rq.test(e)||(t==="v6"||!t)&&iq.test(e))}function hq(e,t){if(!JW.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function mq(e,t){return!!((t==="v4"||!t)&&sq.test(e)||(t==="v6"||!t)&&aq.test(e))}class Er extends Ke{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==be.string){const a=this._getOrReturnCtx(t);return ve(a,{code:ae.invalid_type,expected:be.string,received:a.parsedType}),Re}const r=new pn;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.length<a.value;(o||l)&&(s=this._getOrReturnCtx(t,s),o?ve(s,{code:ae.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&ve(s,{code:ae.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")tq.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"email",code:ae.invalid_string,message:a.message}),r.dirty());
vendor: 17,384 bytes, line 512
512else if(a.kind==="emoji")Ch||(Ch=new RegExp(nq,"u")),Ch.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"emoji",code:ae.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")ZW.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"uuid",code:ae.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")XW.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"nanoid",code:ae.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")YW.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cuid",code:ae.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")KW.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cuid2",code:ae.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")QW.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"ulid",code:ae.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ve(s,{validation:"url",code:ae.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"regex",code:ae.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?dq(a).test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?cq.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?uq(a).test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?eq.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"duration",code:ae.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?fq(t.data,a.version)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"ip",code:ae.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?hq(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"jwt",code:ae.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?mq(t.data,a.version)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cidr",code:ae.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?oq.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"base64",code:ae.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?lq.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"base64url",code:ae.invalid_string,message:a.message}),r.dirty()):nt.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:ae.invalid_string,...we.errToObj(r)})}_addCheck(t){return new Er({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...we.errToObj(t)})}url(t){return this._addCheck({kind:"url",...we.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...we.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...we.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...we.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...we.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...we.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...we.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...we.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...we.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...we.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...we.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...we.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...we.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...we.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...we.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...we.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...we.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...we.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...we.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...we.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...we.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...we.errToObj(n)})}nonempty(t){return this.min(1,we.errToObj(t))}trim(){return new Er({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Er.create=e=>new Er({checks:[],typeName:De.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ue(e)});function pq(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}class Ji extends Ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==be.number){const a=this._getOrReturnCtx(t);return ve(a,{code:ae.invalid_type,expected:be.number,received:a.parsedType}),Re}let r;const s=new pn;for(const a of this._def.checks)a.kind==="int"?nt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?pq(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_finite,message:a.message}),s.dirty()):nt.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,we.toString(n))}gt(t,n){return this.setLimit("min",t,!1,we.toString(n))}lte(t,n){return this.setLimit("max",t,!0,we.toString(n))}lt(t,n){return this.setLimit("max",t,!1,we.toString(n))}setLimit(t,n,r,s){return new Ji({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:we.toString(s)}]})}_addCheck(t){return new Ji({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:we.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:we.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:we.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:we.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:we.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:we.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:we.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:we.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:we.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&nt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ji.create=e=>new Ji({checks:[],typeName:De.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ue(e)});class ea extends Ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==be.bigint)return this._getInvalidInput(t);let r;const s=new pn;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):nt.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:be.bigint,received:n.parsedType}),Re}gte(t,n){return this.setLimit("min",t,!0,we.toString(n))}gt(t,n){return this.setLimit("min",t,!1,we.toString(n))}lte(t,n){return this.setLimit("max",t,!0,we.toString(n))}lt(t,n){return this.setLimit("max",t,!1,we.toString(n))}setLimit(t,n,r,s){return new ea({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:we.toString(s)}]})}_addCheck(t){return new ea({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:we.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:we.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:we.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:we.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:we.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ea.create=e=>new ea({checks:[],typeName:De.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ue(e)});class id extends Ke{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==be.boolean){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:be.boolean,received:r.parsedType}),Re}return Tn(t.data)}}id.create=e=>new id({typeName:De.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ue(e)});class xo extends Ke{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==be.date){const a=this._getOrReturnCtx(t);return ve(a,{code:ae.invalid_type,expected:be.date,received:a.parsedType}),Re}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return ve(a,{code:ae.invalid_date}),Re}const r=new pn;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):nt.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new xo({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:we.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:we.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}xo.create=e=>new xo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:De.ZodDate,...Ue(e)});class hp extends Ke{_parse(t){if(this._getType(t)!==be.symbol){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:be.symbol,received:r.parsedType}),Re}return Tn(t.data)}}hp.create=e=>new hp({typeName:De.ZodSymbol,...Ue(e)});class ad extends Ke{_parse(t){if(this._getType(t)!==be.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:be.undefined,received:r.parsedType}),Re}return Tn(t.data)}}ad.create=e=>new ad({typeName:De.ZodUndefined,...Ue(e)});class od extends Ke{_parse(t){if(this._getType(t)!==be.null){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:be.null,received:r.parsedType}),Re}return Tn(t.data)}}od.create=e=>new od({typeName:De.ZodNull,...Ue(e)});class Wl extends Ke{constructor(){super(...arguments),this._any=!0}_parse(t){return Tn(t.data)}}Wl.create=e=>new Wl({typeName:De.ZodAny,...Ue(e)});class Ua extends Ke{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Tn(t.data)}}Ua.create=e=>new Ua({typeName:De.ZodUnknown,...Ue(e)});class ui extends Ke{_parse(t){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:be.never,received:n.parsedType}),Re}}ui.create=e=>new ui({typeName:De.ZodNever,...Ue(e)});class mp extends Ke{_parse(t){if(this._getType(t)!==be.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:be.void,received:r.parsedType}),Re}return Tn(t.data)}}mp.create=e=>new mp({typeName:De.ZodVoid,...Ue(e)});class Dr extends Ke{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==be.array)return ve(n,{code:ae.invalid_type,expected:be.array,received:n.parsedType}),Re;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(ve(n,{code:o?ae.too_big:ae.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ve(n,{code:ae.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ve(n,{code:ae.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new zr(n,o,n.path,l)))).then(o=>pn.mergeArray(r,o));const a=[...n.data].map((o,l)=>s.type._parseSync(new zr(n,o,n.path,l)));return pn.mergeArray(r,a)}
512get element(){return this._def.type}min(t,n){return new Dr({...this._def,minLength:{value:t,message:we.toString(n)}})}max(t,n){return new Dr({...this._def,maxLength:{value:t,message:we.toString(n)}})}length(t,n){return new Dr({...this._def,exactLength:{value:t,message:we.toString(n)}})}nonempty(t){return this.min(1,t)}}Dr.create=(e,t)=>new Dr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...Ue(t)});function _a(e){if(e instanceof Tt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ds.create(_a(r))}return new Tt({...e._def,shape:()=>t})}else return e instanceof Dr?new Dr({...e._def,type:_a(e.element)}):e instanceof ds?ds.create(_a(e.unwrap())):e instanceof na?na.create(_a(e.unwrap())):e instanceof bs?bs.create(e.items.map(t=>_a(t))):e}class Tt extends Ke{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=nt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==be.object){const u=this._getOrReturnCtx(t);return ve(u,{code:ae.invalid_type,expected:be.object,received:u.parsedType}),Re}const{status:r,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof ui&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const f=a[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new zr(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof ui){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of l)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(u==="strict")l.length>0&&(ve(s,{code:ae.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of l){const d=s.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new zr(s,d,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of c){const d=await f.key,m=await f.value;u.push({key:d,value:m,alwaysSet:f.alwaysSet})}return u}).then(u=>pn.mergeObjectSync(r,u)):pn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return we.errToObj,new Tt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,o;const s=((o=(a=this._def).errorMap)==null?void 0:o.call(a,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:we.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Tt({...this._def,unknownKeys:"strip"})}passthrough(){return new Tt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Tt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Tt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:De.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Tt({...this._def,catchall:t})}pick(t){const n={};for(const r of nt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Tt({...this._def,shape:()=>n})}omit(t){const n={};for(const r of nt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Tt({...this._def,shape:()=>n})}deepPartial(){return _a(this)}partial(t){const n={};for(const r of nt.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new Tt({...this._def,shape:()=>n})}required(t){const n={};for(const r of nt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof ds;)a=a._def.innerType;n[r]=a}return new Tt({...this._def,shape:()=>n})}keyof(){return kA(nt.objectKeys(this.shape))}}Tt.create=(e,t)=>new Tt({shape:()=>e,unknownKeys:"strip",catchall:ui.create(),typeName:De.ZodObject,...Ue(t)});Tt.strictCreate=(e,t)=>new Tt({shape:()=>e,unknownKeys:"strict",catchall:ui.create(),typeName:De.ZodObject,...Ue(t)});Tt.lazycreate=(e,t)=>new Tt({shape:e,unknownKeys:"strip",catchall:ui.create(),typeName:De.ZodObject,...Ue(t)});class ld extends Ke{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;
vendor: 14,901 bytes, line 512
512const o=a.map(l=>new Xn(l.ctx.common.issues));return ve(n,{code:ae.invalid_union,unionErrors:o}),Re}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},f=c._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new Xn(c));return ve(n,{code:ae.invalid_union,unionErrors:l}),Re}}get options(){return this._def.options}}ld.create=(e,t)=>new ld({options:e,typeName:De.ZodUnion,...Ue(t)});const ts=e=>e instanceof dd?ts(e.schema):e instanceof ws?ts(e.innerType()):e instanceof fd?[e.value]:e instanceof ta?e.options:e instanceof hd?nt.objectValues(e.enum):e instanceof md?ts(e._def.innerType):e instanceof ad?[void 0]:e instanceof od?[null]:e instanceof ds?[void 0,...ts(e.unwrap())]:e instanceof na?[null,...ts(e.unwrap())]:e instanceof SA||e instanceof gd?ts(e.unwrap()):e instanceof pd?ts(e._def.innerType):[];class xy extends Ke{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==be.object)return ve(n,{code:ae.invalid_type,expected:be.object,received:n.parsedType}),Re;const r=this.discriminator,s=n.data[r],a=this.optionsMap.get(s);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(ve(n,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const a of n){const o=ts(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,a)}}return new xy({typeName:De.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ue(r)})}}function pp(e,t){const n=Os(e),r=Os(t);if(e===t)return{valid:!0,data:e};if(n===be.object&&r===be.object){const s=nt.objectKeys(t),a=nt.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=pp(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===be.array&&r===be.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const o=e[a],l=t[a],c=pp(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===be.date&&r===be.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class cd extends Ke{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(a,o)=>{if(yw(a)||yw(o))return Re;const l=pp(a.value,o.value);return l.valid?((vw(a)||vw(o))&&n.dirty(),{status:n.value,value:l.data}):(ve(r,{code:ae.invalid_intersection_types}),Re)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}cd.create=(e,t,n)=>new cd({left:e,right:t,typeName:De.ZodIntersection,...Ue(n)});class bs extends Ke{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.array)return ve(r,{code:ae.invalid_type,expected:be.array,received:r.parsedType}),Re;if(r.data.length<this._def.items.length)return ve(r,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Re;!this._def.rest&&r.data.length>this._def.items.length&&(ve(r,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new zr(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>pn.mergeArray(n,o)):pn.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new bs({...this._def,rest:t})}}bs.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bs({items:e,typeName:De.ZodTuple,rest:null,...Ue(t)})};class ud extends Ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.object)return ve(r,{code:ae.invalid_type,expected:be.object,received:r.parsedType}),Re;const s=[],a=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:a._parse(new zr(r,l,r.path,l)),value:o._parse(new zr(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?pn.mergeObjectAsync(n,s):pn.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ke?new ud({keyType:t,valueType:n,typeName:De.ZodRecord,...Ue(r)}):new ud({keyType:Er.create(),valueType:t,typeName:De.ZodRecord,...Ue(n)})}}class gp extends Ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.map)return ve(r,{code:ae.invalid_type,expected:be.map,received:r.parsedType}),Re;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new zr(r,l,r.path,[u,"key"])),value:a._parse(new zr(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return Re;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(u.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return Re;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(u.value,f.value)}return{status:n.value,value:l}}}}gp.create=(e,t,n)=>new gp({valueType:t,keyType:e,typeName:De.ZodMap,...Ue(n)});class yo extends Ke{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.set)return ve(r,{code:ae.invalid_type,expected:be.set,received:r.parsedType}),Re;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ve(r,{code:ae.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ve(r,{code:ae.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const f of c){if(f.status==="aborted")return Re;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>a._parse(new zr(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new yo({...this._def,minSize:{value:t,message:we.toString(n)}})}max(t,n){return new yo({...this._def,maxSize:{value:t,message:we.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yo.create=(e,t)=>new yo({valueType:e,minSize:null,maxSize:null,typeName:De.ZodSet,...Ue(t)});class yl extends Ke{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==be.function)return ve(n,{code:ae.invalid_type,expected:be.function,received:n.parsedType}),Re;function r(l,c){return fp({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,dp(),Hl].filter(u=>!!u),issueData:{code:ae.invalid_arguments,argumentsError:c}})}function s(l,c){return fp({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,dp(),Hl].filter(u=>!!u),issueData:{code:ae.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof ql){const l=this;return Tn(async function(...c){const u=new Xn([]),f=await l._def.args.parseAsync(c,a).catch(p=>{throw u.addIssue(r(c,p)),u}),d=await Reflect.apply(o,this,f);return await l._def.returns._def.type.parseAsync(d,a).catch(p=>{throw u.addIssue(s(d,p)),u})})}else{const l=this;return Tn(function(...c){const u=l._def.args.safeParse(c,a);if(!u.success)throw new Xn([r(c,u.error)]);const f=Reflect.apply(o,this,u.data),d=l._def.returns.safeParse(f,a);if(!d.success)throw new Xn([s(f,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new yl({...this._def,args:bs.create(t).rest(Ua.create())})}returns(t){return new yl({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new yl({args:t||bs.create([]).rest(Ua.create()),returns:n||Ua.create(),typeName:De.ZodFunction,...Ue(r)})}}class dd extends Ke{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}dd.create=(e,t)=>new dd({getter:e,typeName:De.ZodLazy,...Ue(t)});class fd extends Ke{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ve(n,{received:n.data,code:ae.invalid_literal,expected:this._def.value}),Re}return{status:"valid",value:t.data}}get value(){return this._def.value}}fd.create=(e,t)=>new fd({value:e,typeName:De.ZodLiteral,...Ue(t)});function kA(e,t){return new ta({values:e,typeName:De.ZodEnum,...Ue(t)})}class ta extends Ke{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{expected:nt.joinValues(r),received:n.parsedType,code:ae.invalid_type}),Re}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{received:n.data,code:ae.invalid_enum_value,options:r}),Re}return Tn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ta.create(t,{...this._def,...n})}exclude(t,n=this._def){return ta.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ta.create=kA;class hd extends Ke{_parse(t){const n=nt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==be.string&&r.parsedType!==be.number){const s=nt.objectValues(n);return ve(r,{expected:nt.joinValues(s),received:r.parsedType,code:ae.invalid_type}),Re}if(this._cache||(this._cache=new Set(nt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=nt.objectValues(n);return ve(r,{received:r.data,code:ae.invalid_enum_value,options:s}),Re}return Tn(t.data)}get enum(){return this._def.values}}hd.create=(e,t)=>new hd({values:e,typeName:De.ZodNativeEnum,...Ue(t)});class ql extends Ke{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==be.promise&&n.common.async===!1)return ve(n,{code:ae.invalid_type,expected:be.promise,received:n.parsedType}),Re;const r=n.parsedType===be.promise?n.data:Promise.resolve(n.data);return Tn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ql.create=(e,t)=>new ql({type:e,typeName:De.ZodPromise,...Ue(t)});class ws extends Ke{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{ve(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return Re;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?Re:c.status==="dirty"||n.value==="dirty"?ol(c.value):c});{if(n.value==="aborted")return Re;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?Re:l.status==="dirty"||n.value==="dirty"?ol(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?Re:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?Re:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!go(o))return Re;const l=s.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>go(o)?Promise.resolve(s.transform(o.value,a)).then(l=>({status:n.value,value:l})):Re);nt.assertNever(s)}}ws.create=(e,t,n)=>new ws({schema:e,typeName:De.ZodEffects,effect:t,...Ue(n)});ws.createWithPreprocess=(e,t,n)=>new ws({schema:t,effect:{type:"preprocess",transform:e},typeName:De.ZodEffects,...Ue(n)});class ds extends Ke{_parse(t){return this._getType(t)===be.undefined?Tn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ds.create=(e,t)=>new ds({innerType:e,typeName:De.ZodOptional,...Ue(t)});class na extends Ke{_parse(t){return this._getType(t)===be.null?Tn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}na.create=(e,t)=>new na({innerType:e,typeName:De.ZodNullable,...Ue(t)});class md extends Ke{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}md.create=(e,t)=>new md({innerType:e,typeName:De.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ue(t)});class pd extends Ke{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sd(s)?s.then(a=>
512({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Xn(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Xn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}pd.create=(e,t)=>new pd({innerType:e,typeName:De.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ue(t)});class xp extends Ke{_parse(t){if(this._getType(t)!==be.nan){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:be.nan,received:r.parsedType}),Re}return{status:"valid",value:t.data}}}xp.create=e=>new xp({typeName:De.ZodNaN,...Ue(e)});const oae=Symbol("zod_brand");class SA extends Ke{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vf extends Ke{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Re:a.status==="dirty"?(n.dirty(),ol(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Re:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new vf({in:t,out:n,typeName:De.ZodPipeline})}}class gd extends Ke{_parse(t){const n=this._def.innerType._parse(t),r=s=>(go(s)&&(s.value=Object.freeze(s.value)),s);return sd(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}gd.create=(e,t)=>new gd({innerType:e,typeName:De.ZodReadonly,...Ue(t)});function ww(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function gq(e,t={},n){return e?Wl.create().superRefine((r,s)=>{const a=e(r);if(a instanceof Promise)return a.then(o=>{if(!o){const l=ww(t,r),c=l.fatal??n??!0;
512s.addIssue({code:"custom",...l,fatal:c})}});if(!a){const o=ww(t,r),l=o.fatal??n??!0;s.addIssue({code:"custom",...o,fatal:l})}}):Wl.create()}const lae={object:Tt.lazycreate};var De;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(De||(De={}));const cae=(e,t={message:`Input not instance of ${e.name}`})=>gq(n=>n instanceof e,t),fn=Er.create,xq=Ji.create,uae=xp.create,dae=ea.create,Gl=id.create,fae=xo.create,hae=hp.create,mae=ad.create,pae=od.create,gae=Wl.create,xae=Ua.create,yae=ui.create,vae=mp.create,bae=Dr.create,yy=Tt.create,wae=Tt.strictCreate,kae=ld.create,Sae=xy.create,Nae=cd.create,jae=bs.create,Cae=ud.create,Tae=gp.create,Eae=yo.create,_ae=yl.create,Aae=dd.create,Pae=fd.create,Rae=ta.create,Iae=hd.create,Mae=ql.create,Dae=ws.create,Oae=ds.create,Lae=na.create,Fae=ws.createWithPreprocess,Vae=vf.create,$ae=()=>fn().optional(),zae=()=>xq().optional(),Uae=()=>Gl().optional(),Bae={string:e=>Er.create({...e,coerce:!0}),number:e=>Ji.create({...e,coerce:!0}),boolean:e=>id.create({...e,coerce:!0}),bigint:e=>ea.create({...e,coerce:!0}),date:e=>xo.create({...e,coerce:!0})},Hae=Re,yq=[{href:"/",label:"Home"},{href:"/features",label:"Features",children:[{href:"/features/time-tracking",label:"Time Tracker"},{href:"/features/material-participation",label:"Material Participation"},{href:"/features/audit-ready-reporting",label:"Audit Reports"},{href:"/features/goal-progress-tracker",label:"Goal Tracker"},{href:"/features/multi-property-support",label:"Multi-Property"},{href:"/features/premium-features",label:"AI Features"}]},{href:"/tools",label:"Tools",children:[{href:"/tools/rental-calculator",label:"Rental Calculator"},{href:"/tools/brrr-calculator",label:"BRRR Calculator"},{href:"/tools/rep-status-calculator",label:"REP Status Calculator"},{href:"/tools/rep-status-audit-scan",label:"REP Audit Scan"},{href:"/tools/rep-hours-tracker",label:"REP Hours Tracker"},{href:"/tools/1031-exchange-timer",label:"1031 Exchange Timer"},{href:"/tools/cost-seg-estimator",label:"Cost Seg Estimator"}]},{href:"/pricing",label:"Pricing"},{href:"/why-reps-shield",label:"Why REPSShield?"},{href:"/blog",label:"Blog"},{href:"/about",label:"About"}];function vq(){const[e,t]=h.useState(!1),[n,r]=pt(),a=["/","/login","/register","/forgot-password","/reset-password","/features","/tools","/pricing","/about","/why-reps-shield","/blog","/repstracker-alternative","/terms","/privacy","/privacy-updated","/changelog"].includes(n)||n.startsWith("/features/")||n.startsWith("/tools/"),o=At({enabled:!a}),l=a?!1:o.isAuthenticated,c=()=>{t(!e)},u=()=>{t(!1)};h.useEffect(()=>{window.location.hostname.includes("picard.replit.dev")},[e]);const f=d=>!!(d==="/"&&n==="/"||d!=="/"&&n.startsWith(d));return i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsx(Z,{variant:"ghost",size:"sm",onClick:c,className:"p-2 touch-target","aria-label":"Toggle navigation menu",children:e?i.jsx($t,{className:"h-5 w-5 transition-transform duration-200"}):i.jsx(Pd,{className:"h-5 w-5 transition-transform duration-200"})})}),e&&i.jsxs("div",{className:"fixed inset-0 z-50 safe-area-top",children:[i.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-20 backdrop-blur-sm",onClick:u}),i.jsxs("div",{className:"absolute top-0 left-0 right-0 bg-white dark:bg-gray-900 shadow-lg border-b border-gray-200 dark:border-gray-800 animate-in slide-in-from-top-2 duration-200 container-safe",children:[i.jsxs("div",{className:"flex items-center justify-between spacing-responsive-sm border-b border-gray-100 dark:border-gray-800",children:[i.jsxs(Ce,{href:"/",onClick:u,className:"flex items-center space-x-2",children:[i.jsx("img",{src:"/repsshield-logo-icon.png",alt:"REPSShield",className:"h-5 w-5 sm:h-6 sm:w-6"}),i.jsx("span",{className:"text-responsive-sm font-semibold text-gray-900 dark:text-gray-100",children:"REPSShield"})]}),i.jsx(Z,{variant:"ghost",size:"sm",onClick:u,className:"p-2 touch-target","aria-label":"Close menu",children:i.jsx($t,{className:"h-4 w-4 sm:h-5 sm:w-5"})})]}),i.jsx("nav",{className:"max-h-64 sm:max-h-96 overflow-y-auto",children:i.jsx("ul",{className:"py-2 sm:py-4",children:yq.map((d,m)=>i.jsxs("li",{children:[i.jsx(Ce,{href:d.href,className:`block px-4 sm:px-6 py-2 sm:py-3 text-sm sm:text-base font-medium transition-colors touch-target ${f(d.href)?"text-blue-600 dar
512k:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-r-2 border-blue-600 dark:border-blue-400":"text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800"}`,onClick:p=>{p.metaKey||p.ctrlKey||p.shiftKey||p.altKey||p.button!==0||(p.preventDefault(),r(d.href),xs(d.href),u())},children:d.label}),d.children&&i.jsx("ul",{className:"bg-gray-50 dark:bg-gray-800",children:d.children.map((p,g)=>i.jsx("li",{children:i.jsx(Ce,{href:p.href,className:`block pl-8 sm:pl-12 pr-4 sm:pr-6 py-2 text-xs sm:text-sm transition-colors touch-target ${f(p.href)?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700"}`,onClick:x=>{x.metaKey||x.ctrlKey||x.shiftKey||x.altKey||x.button!==0||(x.preventDefault(),r(p.href),xs(p.href),u())},children:p.label})},p.href))})]},d.href))})}),i.jsx("div",{className:"border-t border-gray-100 dark:border-gray-800 spacing-responsive-sm safe-area-bottom",children:l?i.jsx(Ce,{href:"/dashboard",onClick:u,className:"block",children:i.jsx(Z,{className:"w-full lm-button-primary mb-2 touch-target",children:"Go to Dashboard"})}):i.jsxs(i.Fragment,{children:[i.jsx(Ce,{href:"/login",onClick:u,className:"block",children:i.jsx(Z,{className:"w-full lm-button-primary mb-2 touch-target",children:"Get Started Free"})}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 text-center px-2",children:"Try it free for 14 days. No credit card required to get started."})]})})]})]})]})}function bq({isAuthenticated:e}){return i.jsx("header",{className:"bg-transparent safe-area-top mt-6",children:i.jsx("div",{className:"lm-container",children:i.jsxs("div",{className:"flex justify-between items-center h-16",children:[i.jsxs(Ce,{href:"/",className:"flex items-center hover:opacity-80 transition-opacity",children:[i.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield Logo",className:"h-6 w-6 sm:h-8 sm:w-8 mr-2 sm:mr-3"}),i.jsx("span",{className:"text-base font-semibold",style:{color:"var(--color-text)",margin:0,lineHeight:"1.5"},children:"REPSShield"})]}),i.jsx("nav",{className:"hidden md:flex items-center space-x-6",role:"navigation","aria-label":"Main navigation",children:i.jsxs("ul",{className:"flex items-center space-x-6 list-none m-0 p-0",children:[i.jsxs("li",{className:"relative group",children:[i.jsxs(Ce,{href:"/features",className:"lm-nav-link flex items-center","aria-haspopup":"true","aria-expanded":"false",children:["Features",i.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),i.jsxs("ul",{className:"absolute left-0 mt-2 w-56 bg-white rounded-md shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 border list-none p-2",role:"menu","aria-label":"Features submenu",children:[i.jsx("li",{children:i.jsx(Ce,{href:"/features/time-tracking",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"REP Time Tracking"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/features/material-participation",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"Material Participation Tests"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/features/audit-ready-reporting",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"Audit-Ready Reports"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/features/goal-progress-tracker",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"REP Goal Tracker"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/features/multi-property-support",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"Multi-Property Management"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/features/premium-features",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"AI-Powered Features"})})]})]}),i.jsxs("li",{className:"relative group",children:[i.jsxs(Ce,{href:"/tools",className:"lm-nav-link flex items-center","aria-haspopup":"true","aria-expanded":"false",children:["Tools",i.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),i.jsxs("ul",{className:"absolute left-0 mt-2 w-56 bg-white rounded-md shadow-lg op
512acity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 border list-none p-2",role:"menu","aria-label":"Tools submenu",children:[i.jsx("li",{children:i.jsx(Ce,{href:"/tools/rental-calculator",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"Rental Property Calculator"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/tools/brrr-calculator",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"BRRR Strategy Calculator"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/tools/rep-status-calculator",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"REP Status Calculator"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/tools/rep-status-audit-scan",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"REP Audit Scan"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/tools/rep-hours-tracker",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"REP Hours Tracker"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/tools/1031-exchange-timer",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"1031 Exchange Timer"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/tools/cost-seg-estimator",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded",role:"menuitem",children:"Cost Seg Estimator"})})]})]}),i.jsx("li",{children:i.jsx(Ce,{href:"/pricing",className:"lm-nav-link",children:"Pricing"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/why-reps-shield",className:"lm-nav-link",children:"Why REPSShield?"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/blog",className:"lm-nav-link",children:"Blog"})}),i.jsx("li",{children:i.jsx(Ce,{href:"/about",className:"lm-nav-link",children:"About"})}),i.jsx("li",{children:e?i.jsx(Ce,{href:"/dashboard",children:i.jsx(Z,{className:"border border-[#44958C] text-[#44958C] bg-white hover:bg-[#44958C] hover:text-white transition-colors","aria-label":"Go to your dashboard",children:"Dashboard"})}):i.jsx(Ce,{href:"/login",children:i.jsx(Z,{className:"border border-[#44958C] text-[#44958C] bg-white hover:bg-[#44958C] hover:text-white transition-colors","aria-label":"Sign in to your account",children:"Login"})})})]})}),i.jsx("div",{className:"md:hidden",children:i.jsx(vq,{})})]})})})}const wq=()=>i.jsx("footer",{className:"bg-white border-t mt-12 sm:mt-16 spacing-responsive-lg safe-area-bottom",children:i.jsxs("div",{className:"container-mobile container-safe",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-6 gap-8 lg:gap-12",children:[i.jsxs("div",{className:"lg:col-span-1 max-w-md",children:[i.jsxs("div",{className:"flex items-center mb-3 sm:mb-4",children:[i.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield Logo",className:"h-6 w-6 sm:h-8 sm:w-8 mr-2 sm:mr-3"}),i.jsx("span",{className:"text-responsive-base sm:text-xl font-semibold",style:{color:"var(--color-text)"},children:"REPSShield"})]}),i.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-3 sm:mb-4 text-responsive-xs",children:"Professional time tracking for Real Estate Professional status qualification. IRS-compliant, audit-ready, AI-powered."})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-responsive-sm font-semibold mb-3 sm:mb-4",style:{color:"var(--color-text)"},children:"Features"}),i.jsxs("div",{className:"space-y-1 sm:space-y-2",children:[i.jsx(Ce,{href:"/features/time-tracking",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Time Tracking"}),i.jsx(Ce,{href:"/features/material-participation",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Material Participation"}),i.jsx(Ce,{href:"/features/audit-ready-reporting",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Audit Reports"}),i.jsx(Ce,{href:"/features/goal-progress-tracker",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Goal Tracker"}),i.jsx(Ce,{href:"/features/multi-property-support",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Multi Property"}),i.jsx(Ce,{href:"/features/premium-features",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"AI Features"})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-responsive-sm font-semibold mb-3 sm:mb-4",style:{color:"var(--color-text)"},children:"Tools"}),i.jsxs("div",{className:"space-y-1 sm:space-y-2",children:[i.jsx(Ce,{href:"/tools/rental-calculator",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Rental Calculator"}),i.jsx(Ce,{href:"/tools/brrr-calculator",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"BRRR Calculator"}),i.jsx(Ce,{href:"/tools/rep-status-calculator",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"REP Status Calculator"}),i.jsx(Ce,{href:"/tools/rep-status-audit-scan",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Audit Scan"}),i.jsx(Ce,{href:"/tools/rep-hours-tracker",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Hours Tracker"}),i.jsx(Ce,{href:"/tools/1031-exchange-timer",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"1031 Exchange Timer"})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-responsive-sm font-semibold mb-3 sm:mb-4",style:{color:"var(--color-text)"},children:"Evaluate"}),i.jsx("div",{className:"space-y-1 sm:space-y-2",children:i.jsx(Ce,{href:"/repstracker-alternative",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"REPSTracker Alternative"})})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-responsive-sm font-semibold mb-3 sm:mb-4",style:{color:"var(--color-text)"},children:"Company"}),i.jsxs("div",{className:"space-y-1 sm:space-y-2",children:[i.jsx(Ce,{href:"/about",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"About"}),i.jsx(Ce,{href:"/pricing",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Pricing"}),i.jsx(Ce,{href:"/why-reps-shield",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Why REPSShield?"}),i.jsx(Ce,{href:"/changelog",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Change Log"}),i.jsx(Ce,{href:"/docs/api",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Developer API"}),i.jsx("a",{href:"mailto:[email protected]",className:"block text-gray-600 hover:text-blue-600 text-responsive-xs touch-target",children:"Email"})]})]})]}
512),i.jsx("div",{className:"border-t mt-6 sm:mt-8 pt-6 sm:pt-8 text-center text-gray-500 text-responsive-xs",children:i.jsxs("p",{className:"px-4",children:["© 2025 REPSShield. All rights reserved. |"," ",i.jsx(Ce,{href:"/privacy",className:"hover:text-blue-600 touch-target",children:"Privacy Policy"})," ","|"," ",i.jsx(Ce,{href:"/terms",className:"hover:text-blue-600 touch-target",children:"Terms of Service"})]})})]})});function kq(){const[e,t]=h.useState(""),[,n]=pt(),{isAuthenticated:r}=At();h.useEffect(()=>{},[r]);const s=["Get Started","For Free","Join Us"],[a,o]=h.useState(0),[l,c]=h.useState(!0);h.useEffect(()=>{const f=setInterval(()=>{c(!1),setTimeout(()=>{o(d=>(d+1)%s.length),c(!0)},400)},2e3);return()=>clearInterval(f)},[]);const u=async f=>{f.preventDefault();try{if((await fetch("/api/auth/user",{credentials:"include"})).ok)n("/dashboard");else{const m=new URLSearchParams;e.trim()&&m.set("email",e.trim()),n(`/register${m.toString()?"?"+m.toString():""}`)}}catch{const m=new URLSearchParams;e.trim()&&m.set("email",e.trim()),n(`/register${m.toString()?"?"+m.toString():""}`)}};return i.jsx("section",{className:"py-20 bg-white",children:i.jsx("div",{className:"lm-container",children:i.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[i.jsx("h2",{className:"text-3xl font-semibold text-gray-900 mb-4",children:"Start Your REP Journey Today"}),i.jsx("p",{className:"text-lg text-gray-600 mb-10 leading-relaxed",children:"Join thousands of real estate professionals using our IRS compliance tools. Track hours effortlessly, stay audit-ready, and protect your REP status with confidence."}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-6 mb-10",children:["Effortlessly track hours","Always stay audit-ready","Save time, stress less"].map((f,d)=>i.jsxs("div",{className:"flex items-center justify-center gap-2 text-gray-700 text-sm",children:[i.jsx(Fs,{className:"h-5 w-5 text-green-600"}),i.jsx("span",{children:f})]},d))}),i.jsxs("form",{onSubmit:u,className:"max-w-lg mx-auto w-full space-y-4",children:[i.jsxs("div",{className:"flex w-full gap-3",children:[i.jsx(dt,{type:"email",placeholder:"Enter your email",value:e,onChange:f=>t(f.target.value),className:`h-14 px-4 border border-gray-300 focus:ring-2 focus:ring-green-500 
513                  focus:border-green-500 rounded-lg text-gray-900 placeholder-gray-400 basis-[70%]`,required:!0}),i.jsx(Z,{type:"submit",className:`h-14 bg-green-600 hover:bg-green-700 active:bg-green-800 
514                  text-white font-medium transition-all duration-300 rounded-lg shadow-sm hover:shadow-md 
515                  basis-[30%] flex items-center justify-center`,children:i.jsx("span",{className:`transition-opacity duration-500 ${l?"opacity-100":"opacity-0"}`,children:s[a]})})]}),i.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"14-day free trial • No credit card required • Cancel Anytime"})]})]})})})}function Sq(){const[e]=pt();h.useEffect(()=>{const t=e.startsWith("/tools/cost-seg-estimator/chat"),n=e==="/tools/cost-seg-estimator",r=["/","/login","/forgot-password","/reset-password","/pricing","/about","/features","/why-reps-shield","/tools","/privacy-updated","/privacy","/terms","/repstracker-alternative","/changelog"].includes(e)||e.startsWith("/features")||e.startsWith("/tools");let s="";t||n?s="clean-bg":r?s="wallpaper-bg":e.startsWith("/dashboard")||e.startsWith("/app")||e.startsWith("/analytics")||e.startsWith("/activity-ledger")||e.startsWith("/properties")||e.startsWith("/files")||e.startsWith("/team")||e.startsWith("/settings")?s="app":s="clean-bg",["wallpaper-bg","clean-bg","public-site"].forEach(o=>{o!==s&&document.body.classList.remove(o)}),s&&!document.body.classList.contains(s)&&document.body.classList.add(s)},[e])}function Nq({children:e,hideEmailIntake:t=!1,hideHeader:n=!1,hideFooter:r=!1}){Sq();const{isAuthenticated:s}=At({enabled:!1});return i.jsxs("div",{className:"min-h-screen flex flex-col","data-prerendered":!0,children:[!n&&i.jsx(bq,{isAuthenticated:s}),i.jsx("main",{className:"flex-1",children:e}),!t&&i.jsx(kq,{}),!r&&i.jsx(wq,{})]})}var bf="Collapsible",[jq,NA]=zt(bf),[Cq,vy]=jq(bf),jA=h.forwardRef((e,t)=>
515{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:o,...l}=e,[c,u]=jn({prop:r,defaultProp:s??!1,onChange:o,caller:bf});return i.jsx(Cq,{scope:n,disabled:a,contentId:Ot(),open:c,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),children:i.jsx(pe.div,{"data-state":wy(c),"data-disabled":a?"":void 0,...l,ref:t})})});jA.displayName=bf;var CA="CollapsibleTrigger",TA=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=vy(CA,n);return i.jsx(pe.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":wy(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:se(e.onClick,s.onOpenToggle)})});TA.displayName=CA;var by="CollapsibleContent",EA=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=vy(by,e.__scopeCollapsible);return i.jsx(Lt,{present:n||s.open,children:({present:a})=>i.jsx(Tq,{...r,ref:t,present:a})})});EA.displayName=by;var Tq=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,o=vy(by,n),[l,c]=h.useState(r),u=h.useRef(null),f=Ae(t,u),d=h.useRef(0),m=d.current,p=h.useRef(0),g=p.current,x=o.open||l,y=h.useRef(x),v=h.useRef(void 0);return h.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),_t(()=>{const b=u.current;if(b){v.current=v.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();d.current=w.height,p.current=w.width,y.current||(b.style.transitionDuration=v.current.transitionDuration,b.style.animationName=v.current.animationName),c(r)}},[o.open,r]),i.jsx(pe.div,{"data-state":wy(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!x,...a,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:x&&s})});function wy(e){return e?"open":"closed"}var Eq=jA,_q=TA,Aq=EA,gr="Accordion",Pq=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ky,Rq,Iq]=jo(gr),[wf]=zt(gr,[Iq,NA]),Sy=NA(),_A=h.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,a=r;return i.jsx(ky.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?i.jsx(Lq,{...a,ref:t}):i.jsx(Oq,{...s,ref:t})})});_A.displayName=gr;var[AA,Mq]=wf(gr),[PA,Dq]=wf(gr,{collapsible:!1}),Oq=h.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:a=!1,...o}=e,[l,c]=jn({prop:n,defaultProp:r??"",onChange:s,caller:gr});return i.jsx(AA,{scope:e.__scopeAccordion,value:h.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:h.useCallback(()=>a&&c(""),[a,c]),children:i.jsx(PA,{scope:e.__scopeAccordion,collapsible:a,children:i.jsx(RA,{...o,ref:t})})})}),Lq=h.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...a}=e,[o,l]=jn({prop:n,defaultProp:r??[],onChange:s,caller:gr}),c=h.useCallback(f=>l((d=[])=>[...d,f]),[l]),u=h.useCallback(f=>l((d=[])=>d.filter(m=>m!==f)),[l]);return i.jsx(AA,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:i.jsx(PA,{scope:e.__scopeAccordion,collapsible:!0,children:i.jsx(RA,{...a,ref:t})})})}),[Fq,kf]=wf(gr),RA=h.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:a="vertical",...o}=e,l=h.useRef(null),c=Ae(l,t),u=Rq(n),d=oa(s)==="ltr",m=se(e.onKeyDown,p=>{var E;if(!Pq.includes(p.key))return;const g=p.target,x=u().filter(N=>{var k;return!((k=N.ref.current)!=null&&k.disabled)}),y=x.findIndex(N=>N.ref.current===g),v=x.length;if(y===-1)return;p.preventDefault();let b=y;const w=0,j=v-1,S=()=>{b=y+1,b>j&&(b=w)},C=()=>{b=y-1,b<w&&(b=j)};switch(p.key){case"Home":b=w;break;case"End":b=j;break;case"ArrowRight":a==="horizontal"&&(d?S():C());break;case"ArrowDown":a==="vertical"&&S();break;case"ArrowLeft":a==="horizontal"&&(d?C():S());break;case"ArrowUp":a==="vertical"&&C();break}const I=b%v;(E=x[I].ref.current)==null||E.focus()});return i.jsx(Fq,{scope:n,disabled:r,direction:s,orientation:a,children:i.jsx(ky.Slot,{scope:n,children:i.jsx(pe.div,{...o,"data-orientation":a,ref:c,onKeyDown:r?void 0:m})})})}),xd="AccordionItem",[Vq,Ny]=wf(xd),IA=h.forwardRef((e,t)=>
515{const{__scopeAccordion:n,value:r,...s}=e,a=kf(xd,n),o=Mq(xd,n),l=Sy(n),c=Ot(),u=r&&o.value.includes(r)||!1,f=a.disabled||e.disabled;return i.jsx(Vq,{scope:n,open:u,disabled:f,triggerId:c,children:i.jsx(Eq,{"data-orientation":a.orientation,"data-state":VA(u),...l,...s,ref:t,disabled:f,open:u,onOpenChange:d=>{d?o.onItemOpen(r):o.onItemClose(r)}})})});IA.displayName=xd;var MA="AccordionHeader",DA=h.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=kf(gr,n),a=Ny(MA,n);return i.jsx(pe.h3,{"data-orientation":s.orientation,"data-state":VA(a.open),"data-disabled":a.disabled?"":void 0,...r,ref:t})});DA.displayName=MA;var yp="AccordionTrigger",OA=h.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=kf(gr,n),a=Ny(yp,n),o=Dq(yp,n),l=Sy(n);return i.jsx(ky.ItemSlot,{scope:n,children:i.jsx(_q,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:a.triggerId,...l,...r,ref:t})})});OA.displayName=yp;var LA="AccordionContent",FA=h.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=kf(gr,n),a=Ny(LA,n),o=Sy(n);return i.jsx(Aq,{role:"region","aria-labelledby":a.triggerId,"data-orientation":s.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});FA.displayName=LA;function VA(e){return e?"open":"closed"}var $q=_A,zq=IA,Uq=DA,$A=OA,zA=FA;const Wae=$q,Bq=h.forwardRef(({className:e,...t},n)=>i.jsx(zq,{ref:n,className:W("border-b",e),...t}));Bq.displayName="AccordionItem";const Hq=h.forwardRef(({className:e,children:t,...n},r)=>i.jsx(Uq,{className:"flex",children:i.jsxs($A,{ref:r,className:W("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,i.jsx(di,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Hq.displayName=$A.displayName;const Wq=h.forwardRef(({className:e,children:t,...n},r)=>i.jsx(zA,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:i.jsx("div",{className:W("pb-4 pt-0",e),children:t})}));Wq.displayName=zA.displayName;const qq=({siteKey:e,action:t})=>{const[n,r]=h.useState(!1),[s,a]=h.useState(null),o=h.useRef(!1);return h.useEffect(()=>{var f;if((f=window.grecaptcha)!=null&&f.enterprise&&o.current){r(!0);return}const c=document.querySelector('script[src*="recaptcha"]');if(c&&!o.current){c.addEventListener("load",()=>{var d;(d=window.grecaptcha)!=null&&d.enterprise&&window.grecaptcha.enterprise.ready(()=>{r(!0),o.current=!0})});return}const u=document.createElement("script");return u.src=`https://www.google.com/recaptcha/enterprise.js?render=${e}`,u.async=!0,u.defer=!0,u.onload=()=>{var d;(d=window.grecaptcha)!=null&&d.enterprise?window.grecaptcha.enterprise.ready(()=>{r(!0),o.current=!0}):a("Failed to initialize reCAPTCHA")},u.onerror=()=>{a("Failed to load reCAPTCHA script")},document.head.appendChild(u),()=>{}},[e]),{isLoaded:n,error:s,executeRecaptcha:async()=>{var c;if(!n)return a("reCAPTCHA is not loaded yet"),null;if(!((c=window.grecaptcha)!=null&&c.enterprise))return a("reCAPTCHA is not available"),null;try{const u=await window.grecaptcha.enterprise.execute(e,{action:t});return a(null),u}catch(u){const f=u instanceof Error?u.message:"Failed to execute reCAPTCHA";return a(f),null}}}},Gq=yy({email:fn().min(1,"Email is required").email(),password:fn().min(1,"Password is required"),recaptchaToken:fn().optional()});function Yq(e,t){if(Le()){e(t,{replace:!0});return}setTimeout(()=>{e(t)},100)}function UA(){const[,e]=pt(),t=wt(),{openGoogleAuth:n,openAppleAuth:r,isAuthenticating:s}=YI(),[a,o]=h.useState(!1),[l,c]=h.useState(""),[u,f]=h.useState(!1),[d,m]=h.useState(!1),[p,g]=h.useState({scale:1,height:0}),x=h.useRef(null),y=h.useRef(null),[v,b]=h.useState(null),[w,j]=h.useState(null),[S,C]=h.useState(null),I="6LdyvaorAAAAACV4Fsr2EadWDEICggtxuL2gjdI6",{isLoaded:E,error:N,executeRecaptcha:k}=qq({siteKey:I,action:"LOGIN"}),A=!Le()||eg(),{data:M,isLoading:L}=it({queryKey:["/api/auth/user"],retry:!1,enabled:A&&!d});h.useEffect(()=>{if(!L&&(M!=null&&M.isAuthenticated)&&!d){m(!0);const G=new URLSearchParams(window.location.search).get("redirectTo"),z=G?decodeURIComponent(G):"/dashboard";setTimeout(()=>{e(z)},100)}},[L,M==null?void 0:M.isAuthenticated,d,e]);const F=h.useRef(!1);h.useEffect(()=>{if(F.current||L||M!=null&&M.isAuthenticated||d)return;let _=!1;return F.current=!0,(async()=>{var G;try{const z=await fetch("/api/auth/local-login",{method:"POST",credentials:"include"});if(!z.ok||_)return;const R=await z.json();if(_||!R.success||!((G=R.tokens)!=null&&G.accessToken))return;await Zs(R.tokens.accessToken),R.user&&t.setQueryData(["/api/auth/user"],R.user),m(!0),setTimeout(()=>e("/dashboard"),100)}catch{}})(),()=>{_=!0}},[L,M,d,t,e]),h.useEffect(()=>{const _=new URLSearchParams(window.location.search),G=_.get("error"),z=_.get("plan"),R=_.get("annualPrice");z&&(b(z),R&&j(R));const q=_.get("redirect");if(q&&C(q),G){const fe={google_not_configured:"Google sign-in is currently unavailable. Please use email login or try again later.",google_failed:"Google sign-in failed. This may be due to configuration issues. Please try again or c
515ontact support.",google_no_user:"Unable to retrieve your Google account information. Please try again.",google_callback_error:"There was an error completing Google sign-in. Please try again.",apple_not_configured:"Apple sign-in is currently unavailable. Please use email login or try again later.",apple_failed:"Apple sign-in failed. Please try again.",google:"Google sign-in was unsuccessful. Please try again.",apple:"Apple sign-in was unsuccessful. Please try again."},ee=_.get("message");c(ee||fe[G]||"Authentication failed. Please try again."),window.history.replaceState({},document.title,window.location.pathname)}const Q=_.get("demo"),K=_.get("message");if(Q==="true"&&K==="google_preview_unavailable"&&(c("Google sign-in callback URL needs to be configured in Google Cloud Console for this preview environment."),window.history.replaceState({},document.title,window.location.pathname)),_.get("login")==="success"){m(!0);const fe=new URL(window.location.href);fe.searchParams.delete("login"),window.history.replaceState({},document.title,fe.pathname+fe.search),setTimeout(S==="checkout"&&v?async()=>{try{const ee=window.location.origin,te=await po({priceType:v,successUrl:`${ee}/?payment=success`,cancelUrl:`${ee}/pricing?payment=cancelled`});te.checkoutUrl?window.location.href=te.checkoutUrl:te.upgraded?window.location.href="/dashboard?payment=success":window.location.href="/pricing?error=checkout_failed"}catch(ee){console.error("Checkout redirect error:",ee),window.location.href="/pricing?error=checkout_failed"}}:()=>{e("/dashboard")},100)}},[e]);const V=hy({resolver:my(Gq),defaultValues:{email:"",password:""}}),{showForLogin:U,hide:P}=tS(),T=async _=>{var z;const G=U();f(!0),c("");try{const R=await k();if(!R){console.error("🚨 LOGIN: reCAPTCHA failed",{recaptchaError:N}),c(N||"Security verification failed. Please try again."),P(G),f(!1);return}const q=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_.email,password:_.password,recaptchaToken:R}),credentials:"include"});if(q.ok){const Q=await q.json();if(Q.success){(z=Q.tokens)!=null&&z.accessToken&&await Zs(Q.tokens.accessToken),Q.user&&t.setQueryData(["/api/auth/user"],Q.user),m(!0);const X=new URLSearchParams(window.location.search).get("redirectTo"),fe=X?decodeURIComponent(X):Q.redirectUrl||"/dashboard";Yq(e,fe)}else c(Q.message||"Login failed")}else{const Q=await q.json();c(Q.message||"Login failed. Please try again.")}}catch{c("Network error. Please check your connection and try again.")}finally{P(G),f(!1)}},D=async _=>{if(_==="google"){c(""),sessionStorage.setItem("oauthFlowInitiated","true");const G=Date.now();sessionStorage.setItem("oauthStartTime",G.toString());const R=new URLSearchParams(window.location.search).get("redirectTo");try{await n(R||void 0)}catch(q){q.name==="OAuthCancelledError"||(console.error("Google auth error:",q),c("Failed to open Google authentication. Please try again."))}}else if(_==="apple"){c(""),sessionStorage.setItem("oauthFlowInitiated","true");const z=new URLSearchParams(window.location.search).get("redirectTo");try{await r(z||void 0)}catch(R){R.name==="OAuthCancelledError"||(console.error("Apple auth error:",R),c("Failed to open Apple authentication. Please try again."))}}else if(_==="replit"){m(!0),c(""),sessionStorage.setItem("oauthFlowInitiated","true");const G="https://repsshield.com";window.location.href=`${G}/api/auth/replit`}};return h.useEffect(()=>{const _=G=>{const z=new URLSearchParams(window.location.search);if(z.has("login")||z.has("error")){const R=new URL(window.location.href);R.searchParams.delete("login"),R.searchParams.delete("error"),window.history.replaceState({},document.title,R.pathname+R.search)}};return window.addEventListener("popstate",_),()=>{window.removeEventListener("popstate",_)}},[]),h.useLayoutEffect(()=>{var R,q;let _=0;const G=()=>{cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var Ve;const Q=y.current,K=x.current;if(!Q||!K)return;const X=((Ve=window.visualViewport)==null?void 0:Ve.height)??window.innerHeight,fe=window.getComputedStyle(K),ee=parseFloat(fe.paddingTop||"0")+parseFloat(fe.paddingBottom||"0"),te=Math.max(320,X-ee),ge=Q.scrollHeight,oe=Math.min(1,te/ge);g($e=>Math.abs($e.scale-oe)<.005&&Math.abs($e.height-ge)<1?$e:{scale:oe,height:ge})})},z=typeof ResizeObserver<"u"&&y.current?new ResizeObserver(G):null;return y.current&&(z==null||z.observe(y.current)),G(),window.addEventListener("resize",G),(R=window.visualVie
515wport)==null||R.addEventListener("resize",G),(q=window.visualViewport)==null||q.addEventListener("scroll",G),()=>{var Q,K;cancelAnimationFrame(_),z==null||z.disconnect(),window.removeEventListener("resize",G),(Q=window.visualViewport)==null||Q.removeEventListener("resize",G),(K=window.visualViewport)==null||K.removeEventListener("scroll",G)}},[l,E,N,s,u]),d?null:i.jsx(Nq,{hideHeader:!0,hideEmailIntake:!0,hideFooter:!0,children:i.jsx("div",{ref:x,className:"h-[100dvh] min-h-[100dvh] w-full flex items-center justify-center overflow-hidden px-4 py-3 sm:p-4",style:{background:"transparent",paddingTop:"max(0.75rem, env(safe-area-inset-top))",paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))"},children:i.jsx("div",{className:"w-full max-w-md",style:{height:p.height?`${p.height*p.scale}px`:void 0},children:i.jsxs(Je,{ref:y,className:"w-full shadow-lg border border-gray-200",style:{transform:`scale(${p.scale})`,transformOrigin:"top center"},children:[i.jsxs(Yu,{className:"text-center pb-3 sm:pb-6",children:[i.jsxs("div",{className:"mascot-container login-mascot-container",children:[i.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield",className:"bouncing-mascot login-mascot"}),i.jsx("div",{className:"mascot-shadow"})]}),i.jsx(Ku,{className:"text-2xl sm:text-3xl font-bold",children:"Welcome Back!"})]}),i.jsxs(rt,{className:"space-y-3 sm:space-y-6",children:[l&&i.jsxs(Hi,{variant:"destructive",children:[i.jsx(hs,{className:"h-4 w-4"}),i.jsx(za,{children:l})]}),i.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[i.jsxs(Z,{variant:"outline",className:"w-full",onClick:()=>D("google"),disabled:u||d||s,children:[d||s?i.jsx(Xe,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsxs("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",children:[i.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),i.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),i.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),i.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),d||s?"Authenticating...":"Continue with Google"]}),i.jsxs(Z,{variant:"outline",className:"w-full",onClick:()=>D("apple"),disabled:u||d||s,children:[d||s?i.jsx(Xe,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z",fill:"
515currentColor"})}),d||s?"Authenticating...":"Continue with Apple"]})]}),i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 flex items-center",children:i.jsx(sy,{className:"w-full"})}),i.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:i.jsx("span",{className:"bg-white px-2 text-gray-500",children:"Or continue with email"})})]}),i.jsx(py,{...V,children:i.jsxs("form",{onSubmit:V.handleSubmit(T),className:"space-y-3 sm:space-y-4",children:[i.jsx(Vn,{control:V.control,name:"email",render:({field:_})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Email"}),i.jsx(kn,{children:i.jsx(dt,{type:"email",placeholder:"[email protected]",autoComplete:"email",..._})}),i.jsx(Sn,{})]})}),i.jsx(Vn,{control:V.control,name:"password",render:({field:_})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Password"}),i.jsx(kn,{children:i.jsxs("div",{className:"relative",children:[i.jsx(dt,{type:a?"text":"password",placeholder:"Enter your password",..._}),i.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>o(!a),children:a?i.jsx(ND,{className:"h-4 w-4"}):i.jsx(bS,{className:"h-4 w-4"})})]})}),i.jsx(Sn,{})]})}),i.jsx("div",{className:"text-right",children:i.jsx("button",{type:"button",onClick:()=>e("/forgot-password"),className:"text-sm text-[#44958c] hover:text-[#367068] underline",children:"Forgot password?"})}),i.jsxs("div",{className:"flex items-center justify-center space-x-2 py-1 sm:py-2",children:[N&&i.jsxs(Hi,{variant:"destructive",className:"mb-2",children:[i.jsx(hs,{className:"h-4 w-4"}),i.jsxs(za,{children:["reCAPTCHA Error: ",N]})]}),E?i.jsxs("div",{className:"flex items-center space-x-2 text-green-600",children:[i.jsx(rc,{className:"w-4 h-4"}),i.jsx("span",{className:"text-sm",children:"Protected by reCAPTCHA"})]}):i.jsxs("div",{className:"flex items-center space-x-2 text-gray-400",children:[i.jsx(Xe,{className:"w-4 h-4 animate-spin"}),i.jsx("span",{className:"text-sm",children:"Loading security verification..."})]})]}),i.jsx(Z,{type:"submit",className:"w-full",disabled:u||d,children:u?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"w-4 h-4 mr-2 animate-spin"}),"Signing in..."]}):d?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"w-4 h-4 mr-2 animate-spin"}),"Redirecting..."]}):"Sign In"})]})}),i.jsx("div",{className:"text-center",children:i.jsx("button",{type:"button",onClick:()=>e("/register"),className:"text-sm text-[#44958c] hover:text-[#367068] underline",children:"Don't have an account? Sign up"})})]})]})})})})}const Kq=Object.freeze(Object.defineProperty({__proto__:null,default:UA},Symbol.toStringTag,{value:"Module"})),jy=h.lazy(()=>ce(()=>Promise.resolve().then(()=>bW),void 0).then(e=>({default:e.RouterShell})));function Cy(e){const t=e.split(/[?#]/,1)[0]||"/";return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function ku({onPhaseChange:e,to:t="/login"}){const n=h.useRef(!1);return h.useLayoutEffect(()=>{e==null||e("unauthenticated"),`${window.location.pathname}${window.location.search}`!==t&&(n.current||(n.current=!0,window.history.replaceState(null,"",t),window.dispatchEvent(new PopStateEvent("popstate"))))},[e,t]),i.jsx(UA,{})}function Qq({onPhaseChange:e}){const[t]=pt();return h.useEffect(()=>{e==null||e("unauthenticated")},[e]),Cy(t)==="/login"?i.jsx(ku,{onPhaseChange:e,to:t}):i.jsx(h.Suspense,{fallback:i.jsx(ay,{}),children:i.jsx(jy,{})})}function Zq({onPhaseChange:e}){return h.useEffect(()=>{e==null||e("live")},[e]),i.jsx(h.Suspense,{fallback:i.jsx(ay,{}),children:i.jsx(jy,{})})}function Xq(e){return e==="/activity-ledger"?i.jsx(ST,{}):e==="/properties"?i.jsx(NT,{}):e==="/files"?i.jsx(jT,{}):i.jsx(kT,{})}function Jq({onPhaseChange:e}){const[t,n]=pt(),[r,s]=h.useState(!1),a=h.useRef(!1),o=h.useRef(!1),l=()=>{Le()&&(o.current||(o.current=!0,e==null||e("live"),s(!0),(Cy(t)==="/"||sg(t))&&n("/dashboard",{replace:!0})))},c=()=>{a.current||(a.current=!0,e==null||e("unauthenticated"),Le()&&n("/login",{replace:!0}))},{phase:u}=wW({onAuthenticated:l,onUnauthenticated:c});return h.useEffect(()=>{e==null||e(u)},[u,e]),u==="unauthenticated"?null:r&&u==="live"?i.jsx(h.Suspense,{fallback:i.jsx(ay,{}),children:i.jsx(jy,{})}):i.jsxs(kW,{isAuthChecking:u==="validating",children:[Xq(t),u==="validating"&&i.jsx(SW,{})]})}function eG(e){return i.jsx(tG,{...e})}function tG({onPhaseChange:e}){const[t]=pt(),n=wt(),r=Cy(t),s=eg(),a=n.getQueryData(["/api/auth/user"])!=null;if(!Le())return null;
515if(!s){if(r==="/login")return i.jsx(ku,{onPhaseChange:e,to:t});if(r==="/"||r==="/logout-success")return i.jsx(ku,{onPhaseChange:e,to:"/login"});if(sg(t))return i.jsx(Qq,{onPhaseChange:e});const o=encodeURIComponent(t);return i.jsx(ku,{onPhaseChange:e,to:`/login?redirectTo=${o}`})}return a?i.jsx(Zq,{onPhaseChange:e}):i.jsx(Jq,{onPhaseChange:e})}const BA=({user:e})=>(h.useEffect(()=>{!e||Le()||window.innerWidth<768||window.Tawk_API||(window.Tawk_API=window.Tawk_API||{},window.Tawk_API.visitor={name:e.firstName+" "+e.lastName,email:e.email},window.Tawk_API.customStyle={visibility:{desktop:{xOffset:"10px",yOffset:"10px"}},zIndex:2147483647},window.Tawk_API.onLoad=function(){window.Tawk_API.setAttributes({userId:e.id,plan:e.isOnTrial?"Trial":e.subscriptionPlan||"Paid",isAdmin:e.isAdmin?"Yes":"No",trialStartDate:e.trialStartDate||"N/A",trialEndDate:e.trialEndDate||"N/A"},function(n){})},window.Tawk_LoadStart=new Date,function(){var n=document.createElement("script"),r=document.getElementsByTagName("script")[0];n.async=!0,n.src="https://embed.tawk.to/69323993f66a4c198b426eb1/1jbm31qi4",n.charset="UTF-8",n.setAttribute("crossorigin","*"),r.parentNode.insertBefore(n,r)}())},[e]),null);function nG(e){const t=e.substring(0,10),[n,r,s]=t.split("-").map(Number);return new Date(Date.UTC(n,r-1,s,12,0,0))}function qae(e,t="MMM dd, yyyy"){return e?Br(nG(e),t):""}function Th(e=new Date){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function Gae(e){const t=Math.floor(e),n=Math.round((e-t)*60);return`${t.toString().padStart(1,"0")}:${n.toString().padStart(2,"0")}`}function Yae(e){return e?e.replace(/<[^>]*>/g,""):""}const rG=h.forwardRef(({className:e,...t},n)=>i.jsx("div",{className:"relative w-full",children:i.jsx("table",{ref:n,className:W("w-full caption-bottom text-sm",e),...t})}));rG.displayName="Table";const sG=h.forwardRef(({className:e,...t},n)=>i.jsx("thead",{ref:n,className:W("[&_tr]:border-b",e),...t}));sG.displayName="TableHeader";const iG=h.forwardRef(({className:e,...t},n)=>i.jsx("tbody",{ref:n,className:W("[&_tr:last-child]:border-0",e),...t}));iG.displayName="TableBody";const aG=h.forwardRef(({className:e,...t},n)=>i.jsx("tfoot",{ref:n,className:W("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));aG.displayName="TableFooter";const oG=h.forwardRef(({className:e,...t},n)=>i.jsx("tr",{ref:n,className:W("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));oG.displayName="TableRow";const lG=h.forwardRef(({className:e,...t},n)=>i.jsx("th",{ref:n,className:W("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));lG.displayName="TableHead";const cG=h.forwardRef(({className:e,...t},n)=>i.jsx("td",{ref:n,className:W("p-4 align-middle border-r border-gray-200 dark:border-gray-700 [&:has([role=checkbox])]:pr-0 [&:last-child]:border-r-0",e),...t}));cG.displayName="TableCell";const uG=h.forwardRef(({className:e,...t},n)=>i.jsx("caption",{ref:n,className:W("mt-4 text-sm text-muted-foreground",e),...t}));uG.displayName="TableCaption";var HA={exports:{}};/* @license
516Papa Parse
517v5.5.4
518https://github.com/mholt/PapaParse
519License: MIT
520*/(function(e,t){((n,r)=>{e.exports=r()})(kl,function n(){var r=typeof self<"u"?self:typeof window<"u"?window:r!==void 0?r:{},s,a=!r.document&&!!r.postMessage,o=r.IS_PAPA_WORKER||!1,l={},c=0,u={};function f(N){return N.charCodeAt(0)===65279?N.slice(1):N}function d(N){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(k){var A=C(k);A.chunkSize=parseInt(A.chunkSize),k.step||k.chunk||(A.chunkSize=null),this._handle=new y(A),(this._handle.streamer=this)._config=A}).call(this,N),this.parseChunk=function(k,A){var M=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<M){let F=this._config.newline;F||(L=this._config.quoteChar||'"',F=this._handle.guessLineEndings(k,L)),k=[...k.split(F).slice(M)].join(F)}this.isFirstChunk&&E(this._config.beforeFirstChunk)&&(L=this._config.beforeFirstChunk(k))!==void 0&&(k=L),this.isFirstChunk=!1,this._halted=!1;var M=this._partialLine+k,L=(this._partialLine="",this._handle.parse(M,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(k=L.meta.cursor,M=(this._finished||(this._partialLine=M.substring(k-this._baseIndex),this._baseIndex=k),L&&L.data&&(this._rowCount+=L.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)r.postMessage({results:L,workerId:u.WORKER_ID,finished:M});else if(E(this._config.chunk)&&!A){if(this._config.chunk(L,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=L=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(L.data),this._completeResults.errors=this._completeResults.errors.concat(L.errors),this._completeResults.meta=L.meta),this._completed||!M||!E(this._config.complete)||L&&L.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),M||L&&L.meta.paused||this._nextChunk(),L}this._halted=!0},this._sendError=function(k){E(this._config.error)?this._config.error(k):o&&this._config.error&&r.postMessage({workerId:u.WORKER_ID,error:k,finished:!1})}}function m(N){var k;(N=N||{}).chunkSize||(N.chunkSize=u.RemoteChunkSize),d.call(this,N),this._nextChunk=a?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(A){this._input=A,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(k=new XMLHttpRequest,this._config.withCredentials&&(k.withCredentials=this._config.withCredentials),a||(k.onload=I(this._chunkLoaded,this),k.onerror=I(this._chunkError,this)),k.open(this._config.downloadRequestBody?"POST":"GET",this._input,!a),this._config.downloadRequestHeaders){var A,M=this._config.downloadRequestHeaders;for(A in M)k.setRequestHeader(A,M[A])}var L;this._config.chunkSize&&(L=this._start+this._config.chunkSize-1,k.setRequestHeader("Range","bytes="+this._start+"-"+L));try{k.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}a&&k.status===0&&this._chunkError()}},this._chunkLoaded=function(){k.readyState===4&&(k.status<200||400<=k.status?this._chunkError():(this._start+=this._config.chunkSize||k.responseText.length,this._finished=!this._config.chunkSize||this._start>=(A=>(A=A.getResponseHeader("Content-Range"))!==null?parseInt(A.substring(A.lastIndexOf("/")+1)):-1)(k),this.parseChunk(k.responseText)))},this._chunkError=function(A){A=k.statusText||A,this._sendError(new Error(A))}}function p(N){(N=N||{}).chunkSize||(N.chunkSize=u.LocalChunkSize),d.call(this,N);var k,A,M=typeof FileReader<"u";this.stream=function(L){this._input=L,A=L.slice||L.webkitSlice||L.mozSlice,M?((k=new FileReader).onload=I(this._chunkLoaded,this),k.onerror=I(this._chunkError,this)):k=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var L=this._input,F=(this._config.chunkSize&&(F=Math.min(this._start+this._config.chunkSize,this._input.size),L=A.call(L,this._start,F)),k.readAsText(L,this._config.encoding));M||this._chunkLoaded({target:{result:F}})},this._chunkLoaded=function(L){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(L.target.result)},this._chunkError=function(){this._sendError(k.error)}}function g(N){var k;d.call(this,N=N||{}),this.stream=function(A){return k=A,this._nextChunk()},this._nextChunk=function(){var A,M;if(!this._finished)return A=this._config.chunkSize,k=A?(M=k.substring(0,A),k.substring(A)):(M=k,""),this._finished=!k,this.parseChunk(M)}}function x(N){d.call(this,N=N||{});var k=[],A=!0,M=!1;this.pause=function(){d.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){d.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(L){this._input=L,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){M&&k.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),k.length?this.parseChunk(k.shift()):A=!0},this._streamData=I(function(L){try{k.push(typeof L=="string"?L:L.toString(this._config.encoding)),A&&(A=!1,this._checkIsFinished(),this.parseChunk(k.shift()))}catch(F){this._streamError(F)}},this),this._streamError=I(function(L){this._streamCleanUp(),this._sendError(L)},this),this._streamEnd=I(function(){this._streamCleanUp(),M=!0,this._streamData("")},this),this._streamCleanUp=I(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(N){var k,A,M,L,F=Math.pow(2,53),V=-F,U=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,P=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,T=this,D=0,_=0,G=!1,z=!1,R=[],q={data:[],errors:[],meta:{}};function Q(ee){return N.skipEmptyLines==="greedy"?ee.join("").trim()==="":ee.length===1&&ee[0].length===0}function K(){if(q&&M&&(fe("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),M=!1),N.skipEmptyLines&&(q.data=q.data.filter(function(oe){return!Q(oe)})),X()){let oe=function(Ve,$e){Ve=f(Ve),E(N.transformHeader)&&(Ve=N.transformHeader(Ve,$e)),R.push(Ve)};if(q)if(Array.isArray(q.data[0])){for(var ee=0;X()&&ee<q.data.length;ee++)q.data[ee].forEach(oe);q.data.splice(0,1)}else q.data.forEach(oe)}function te(oe,Ve){for(var $e=N.header?{}:[],ze=0;ze<oe.length;ze++){var qe=ze,Oe=oe[ze],Oe=((Ft,Pe)=>(tt=>(N.dynamicTypingFunction&&N.dynamicTyping[tt]===void 0&&(N.dynamicTyping[tt]=N.dynamicTypingFunction(tt)),(N.dynamicTyping[tt]||N.dynamicTyping)===!0))(Ft)?Pe==="true"||Pe==="TRUE"||Pe!=="false"&&Pe!=="FALSE"&&((tt=>{if(U.test(tt)&&(tt=parseFloat(tt),V<tt&&tt<F))return 1})(Pe)?parseFloat(Pe):P.test(Pe)?new Date(Pe):Pe===""?null:Pe):Pe)(qe=N.header?ze>=R.length?"__parsed_extra":R[ze]:qe,Oe=N.transform?N.transform(Oe,qe):Oe);qe==="__parsed_extra"?($e[qe]=$e[qe]||[],$e[qe].push(Oe)):$e[qe]=Oe}return N.header&&(ze>R.length?fe("FieldMismatch","TooManyFields","Too many fields: expected "+R.length+" fields but parsed "+ze,_+Ve):ze<R.length&&fe("FieldMismatch","TooFewFields","Too few fields: expected "+R.length+" fields but parsed "+ze,_+Ve)),$e}var ge;q&&(N.header||N.dynamicTyping||N.transform)&&(ge=1,!q.data.length||Array.isArray(q.data[0])?(q.data=q.data.map(te),ge=q.data.length):q.data=te(q.data,0),N.header&&q.meta&&(q.meta.fields=R),_+=ge)}function X(){return N.header&&R.length===0}function fe(ee,te,ge,oe){ee={type:ee,code:te,message:ge},oe!==void 0&&(ee.row=oe),q.errors.push(ee)}E(N.step)&&(L=N.step,N.step=function(ee){q=ee,X()?K():(K(),q.data.length!==0&&(D+=ee.data.length,N.preview&&D>N.preview?A.abort():(q.data=q.data[0],L(q,T))))}),this.parse=function(ee,te,ge){var oe=N.quoteChar||'"',oe=(N.newline||(N.newline=this.guessLineEndings(ee,oe)),M=!1,N.delimiter?E(N.delimiter)&&(N.delimiter=N.delimiter(ee),q.meta.delimiter=N.delimiter):((oe=((Ve,$e,ze,qe,Oe)=>{var Ft,Pe,tt,An;Oe=Oe||[",","	","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var xr=0;xr<Oe.length;xr++){for(var an,yr=Oe[xr],Rt=0,Y=0,ne=0,ke=(tt=void 0,new b({comments:qe,delimiter:yr,newline:$e,preview:10}).parse(Ve)),Ie=0;Ie<ke.data.length;Ie++)ze&&Q(ke.data[Ie])?ne++:(an=ke.data[Ie].length,Y+=an,tt===void 0?tt=an:0<an&&(Rt+=Math.abs(an-tt),tt=an));0<ke.data.length&&(Y/=ke.data.length-ne),(Pe===void 0||Rt<=Pe)&&(An===void 0||An<Y)&&1.99<Y&&(Pe=Rt,Ft=yr,An=Y)}return{successful:!!(N.delimiter=Ft),bestDelimiter:Ft}})(ee,N.newline,N.skipEmptyLines,N.comments,N.delimitersToGuess)).successful?N.delimiter=oe.bestDelimiter:(M=!0,N.delimiter=u.DefaultDelimiter),q.meta.delimiter=N.delimiter),C(N));return N.preview&&N.header&&oe.preview++,k=ee,A=new b(oe),q=A.parse(k,te,ge),K(),G?{meta:{paused:!0}}:q||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,A.abort(),k=E(N.chunk)?"":k.substring(A.getCharIndex())},this.resume=function(){T.streamer._halted?(G=!1,T.streamer.parseChunk(k,!0)):setTimeout(T.resume,3)},this.aborted=function(){return z},this.abort=function(){z=!0,A.abort(),q.meta.aborted=!0,E(N.complete)&&N.complete(q),k=""},this.guessLineEndings=function(Ve,oe){Ve=Ve.substring(0,1048576);var oe=new RegExp(v(oe)+"([^]*?)"+v(oe),"gm"),ge=(Ve=Ve.replace(oe,"")).split("\r"),oe=Ve.split(`
521`),Ve=1<oe.length&&oe[0].length<ge[0].length;if(ge.length===1||Ve)return`
522`;for(var $e=0,ze=0;ze<ge.length;ze++)ge[ze][0]===`
523`&&$e++;return $e>=ge.length/2?`\r
524`:"\r"}}function v(N){return N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(N){var k=(N=N||{}).delimiter,A=N.newline,M=N.comments,L=N.step,F=N.preview,V=N.fastMode,U=null,P=!1,T=N.quoteChar==null?'"':N.quoteChar,D=T;if(N.escapeChar!==void 0&&(D=N.escapeChar),(typeof k!="string"||-1<u.BAD_DELIMITERS.indexOf(k))&&(k=","),M===k)throw new Error("Comment character same as delimiter");M===!0?M="#":(typeof M!="string"||-1<u.BAD_DELIMITERS.indexOf(M))&&(M=!1),A!==`
525`&&A!=="\r"&&A!==`\r
526`&&(A=`
527`);var _=0,G=!1;this.parse=function(z,R,q){if(typeof z!="string")throw new Error("Input must be a string");var Q=z.length,K=k.length,X=A.length,fe=M.length,ee=E(L),te=[],ge=[],oe=[],Ve=_=0;if(!z)return Rt();if(V||V!==!1&&z.indexOf(T)===-1){for(var $e=z.split(A),ze=0;ze<$e.length;ze++){if(oe=$e[ze],_+=oe.length,ze!==$e.length-1)_+=A.length;else if(q)return Rt();if(!M||oe.substring(0,fe)!==M){if(ee){if(te=[],An(oe.split(k)),Y(),G)return Rt()}else An(oe.split(k));if(F&&F<=ze)return te=te.slice(0,F),Rt(!0)}}return Rt()}for(var qe=z.indexOf(k,_),Oe=z.indexOf(A,_),Ft=new RegExp(v(D)+v(T),"g"),Pe=z.indexOf(T,_);;)if(z[_]===T)for(Pe=_,_++;;){if((Pe=z.indexOf(T,Pe+1))===-1)return q||ge.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:te.length,index:_}),an();if(Pe===Q-1)return an(z.substring(_,Pe).replace(Ft,T));if(T===D&&z[Pe+1]===D)Pe++;else if(T===D||Pe===0||z[Pe-1]!==D){qe!==-1&&qe<Pe+1&&(qe=z.indexOf(k,Pe+1));var tt=xr((Oe=Oe!==-1&&Oe<Pe+1?z.indexOf(A,Pe+1):Oe)===-1?qe:Math.min(qe,Oe));if(z.substr(Pe+1+tt,K)===k){oe.push(z.substring(_,Pe).replace(Ft,T)),z[_=Pe+1+tt+K]!==T&&(Pe=z.indexOf(T,_)),qe=z.indexOf(k,_),Oe=z.indexOf(A,_);break}if(tt=xr(Oe),z.substring(Pe+1+tt,Pe+1+tt+X)===A){if(oe.push(z.substring(_,Pe).replace(Ft,T)),yr(Pe+1+tt+X),qe=z.indexOf(k,_),Pe=z.indexOf(T,_),ee&&(Y(),G))return Rt();if(F&&te.length>=F)return Rt(!0);break}ge.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:te.length,index:_}),Pe++}}else if(M&&oe.length===0&&z.substring(_,_+fe)===M){if(Oe===-1)return Rt();
527_=Oe+X,Oe=z.indexOf(A,_),qe=z.indexOf(k,_)}else if(qe!==-1&&(qe<Oe||Oe===-1))oe.push(z.substring(_,qe)),_=qe+K,qe=z.indexOf(k,_);else{if(Oe===-1)break;if(oe.push(z.substring(_,Oe)),yr(Oe+X),ee&&(Y(),G))return Rt();if(F&&te.length>=F)return Rt(!0)}return an();function An(ne){te.push(ne),Ve=_}function xr(ne){var ke=0;return ke=ne!==-1&&(ne=z.substring(Pe+1,ne))&&ne.trim()===""?ne.length:ke}function an(ne){return q||(ne===void 0&&(ne=z.substring(_)),oe.push(ne),_=Q,An(oe),ee&&Y()),Rt()}function yr(ne){_=ne,An(oe),oe=[],Oe=z.indexOf(A,_)}function Rt(ne){if(N.header&&!R&&te.length&&!P){var ke=te[0],Ie=Object.create(null),O=new Set(ke);let B=!1;for(let H=0;H<ke.length;H++){let J=f(ke[H]);if(Ie[J=E(N.transformHeader)?N.transformHeader(J,H):J]){let re,me=Ie[J];for(;re=J+"_"+me,me++,O.has(re););O.add(re),ke[H]=re,Ie[J]++,B=!0,(U=U===null?{}:U)[re]=J}else Ie[J]=1,ke[H]=J;O.add(J)}B&&console.warn("Duplicate headers found and renamed."),P=!0}return{data:te,errors:ge,meta:{delimiter:k,linebreak:A,aborted:G,truncated:!!ne,cursor:Ve+(R||0),renamedHeaders:U}}}function Y(){L(Rt()),te=[],ge=[]}},this.abort=function(){G=!0},this.getCharIndex=function(){return _}}function w(N){var k=N.data,A=l[k.workerId],M=!1;if(k.error)A.userError(k.error,k.file);else if(k.results&&k.results.data){var L={abort:function(){M=!0,j(k.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(E(A.userStep)){for(var F=0;F<k.results.data.length&&(A.userStep({data:k.results.data[F],errors:k.results.errors,meta:k.results.meta},L),!M);F++);delete k.results}else E(A.userChunk)&&(A.userChunk(k.results,L,k.file),delete k.results)}k.finished&&!M&&j(k.workerId,k.results)}function j(N,k){var A=l[N];E(A.userComplete)&&A.userComplete(k),A.terminate(),delete l[N]}function S(){throw new Error("Not implemented.")}function C(N){if(typeof N!="object"||N===null)return N;var k,A=Array.isArray(N)?[]:{};for(k in N)A[k]=C(N[k]);return A}function I(N,k){return function(){N.apply(k,arguments)}}function E(N){return typeof N=="function"}return u.parse=function(N,k){var A=(k=k||{}).dynamicTyping||!1;if(E(A)&&(k.dynamicTypingFunction=A,A={}),k.dynamicTyping=A,k.transform=!!E(k.transform)&&k.transform,!k.worker||!u.WORKERS_SUPPORTED)return A=null,u.NODE_STREAM_INPUT,typeof N=="string"?(N=f(N),A=new(k.download?m:g)(k)):N.readable===!0&&E(N.read)&&E(N.on)?A=new x(k):(r.File&&N instanceof File||N instanceof Object)&&(A=new p(k)),A.stream(N);(A=(()=>{var M;return!!u.WORKERS_SUPPORTED&&(M=(()=>{var L=r.URL||r.webkitURL||null,F=n.toString();return u.BLOB_URL||(u.BLOB_URL=L.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",F,")();"],{type:"text/javascript"})))})(),(M=new r.Worker(M)).onmessage=w,M.id=c++,l[M.id]=M)})()).userStep=k.step,A.userChunk=k.chunk,A.userComplete=k.complete,A.userError=k.error,k.step=E(k.step),k.chunk=E(k.chunk),k.complete=E(k.complete),k.error=E(k.error),delete k.worker,A.postMessage({input:N,config:k,workerId:A.id})},u.unparse=function(N,k){var A=!1,M=!0,L=",",F=`\r
528`,V='"',U=V+V,P=!1,T=null,D=!1,_=((()=>{if(typeof k=="object"){if(typeof k.delimiter!="string"||u.BAD_DELIMITERS.filter(function(R){return k.delimiter.indexOf(R)!==-1}).length||(L=k.delimiter),typeof k.quotes!="boolean"&&typeof k.quotes!="function"&&!Array.isArray(k.quotes)||(A=k.quotes),typeof k.skipEmptyLines!="boolean"&&typeof k.skipEmptyLines!="string"||(P=k.skipEmptyLines),typeof k.newline=="string"&&(F=k.newline),typeof k.quoteChar=="string"&&(V=k.quoteChar,U=V+V),typeof k.header=="boolean"&&(M=k.header),Array.isArray(k.columns)){if(k.columns.length===0)throw new Error("Option columns is empty");T=k.columns}k.escapeChar!==void 0&&(U=k.escapeChar+V),k.escapeFormulae instanceof RegExp?D=k.escapeFormulae:typeof k.escapeFormulae=="boolean"&&k.escapeFormulae&&(D=/^[=+\-@\t\r].*$/)}})(),new RegExp(v(V),"g"));if(typeof N=="string"&&(N=JSON.parse(N)),Array.isArray(N)){if(!N.length||Array.isArray(N[0]))return G(null,N,P);
528if(typeof N[0]=="object")return G(T||Object.keys(N[0]),N,P)}else if(typeof N=="object")return typeof N.data=="string"&&(N.data=JSON.parse(N.data)),Array.isArray(N.data)&&(N.fields||(N.fields=N.meta&&N.meta.fields||T),N.fields||(N.fields=Array.isArray(N.data[0])?N.fields:typeof N.data[0]=="object"?Object.keys(N.data[0]):[]),Array.isArray(N.data[0])||typeof N.data[0]=="object"||(N.data=[N.data])),G(N.fields||[],N.data||[],P);throw new Error("Unable to serialize unrecognized input");function G(R,q,Q){var K="",X=(typeof R=="string"&&(R=JSON.parse(R)),typeof q=="string"&&(q=JSON.parse(q)),Array.isArray(R)&&0<R.length),fe=!Array.isArray(q[0]);if(X&&M){for(var ee=0;ee<R.length;ee++)0<ee&&(K+=L),K+=z(R[ee],ee);0<q.length&&(K+=F)}for(var te=0;te<q.length;te++){var ge=(X?R:q[te]).length,oe=!1,Ve=X?Object.keys(q[te]).length===0:q[te].length===0;if(Q&&!X&&(oe=Q==="greedy"?q[te].join("").trim()==="":q[te].length===1&&q[te][0].length===0),Q==="greedy"&&X){for(var $e=[],ze=0;ze<ge;ze++){var qe=fe?R[ze]:ze;$e.push(q[te][qe])}oe=$e.join("").trim()===""}if(!oe){for(var Oe=0;Oe<ge;Oe++){0<Oe&&!Ve&&(K+=L);var Ft=X&&fe?R[Oe]:Oe;K+=z(q[te][Ft],Oe)}te<q.length-1&&(!Q||0<ge&&!Ve)&&(K+=F)}}return K}function z(R,q){var Q,K,X;return R==null?"":R.constructor===Date?JSON.stringify(R).slice(1,25):(X=!1,D&&typeof R=="string"&&D.test(R)&&(R="'"+R,X=!0),K=(Q=R.toString()).replace(_,U),(X=X||A===!0||typeof A=="function"&&A(R,q)||Array.isArray(A)&&A[q]||((fe,ee)=>{for(var te=0;te<ee.length;te++)if(-1<fe.indexOf(ee[te]))return!0;return!1})(K,u.BAD_DELIMITERS)||-1<K.indexOf(L)||-1<Q.indexOf(V)||K.charAt(0)===" "||K.charAt(K.length-1)===" ")?V+K+V:K)}},u.RECORD_SEP="�",u.UNIT_SEP="�",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
529`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!a&&!!r.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=b,u.ParserHandle=y,u.NetworkStreamer=m,u.FileStreamer=p,u.StringStreamer=g,u.ReadableStreamStreamer=x,r.jQuery&&((s=r.jQuery).fn.parse=function(N){var k=N.config||{},A=[];return this.each(function(F){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var V=0;V<this.files.length;V++)A.push({file:this.files[V],inputElem:this,instanceConfig:s.extend({},k)})}),M(),this;function M(){if(A.length===0)E(N.complete)&&N.complete();else{var F,V,U,P,T=A[0];if(E(N.before)){var D=N.before(T.file,T.inputElem);if(typeof D=="object"){if(D.action==="abort")return F="AbortError",V=T.file,U=T.inputElem,P=D.reason,void(E(N.error)&&N.error({name:F},V,U,P));if(D.action==="skip")return void L();typeof D.config=="object"&&(T.instanceConfig=s.extend(T.instanceConfig,D.config))}else if(D==="skip")return void L()}var _=T.instanceConfig.complete;T.instanceConfig.complete=function(G){E(_)&&_(G,T.file,T.inputElem),L()},u.parse(T.file,T.instanceConfig)}}function L(){A.splice(0,1),M()}}),o&&(r.onmessage=function(N){N=N.data,u.WORKER_ID===void 0&&N&&(u.WORKER_ID=N.workerId),typeof N.input=="string"?r.postMessage({workerId:u.WORKER_ID,results:u.parse(N.input,N.config),finished:!0}):(r.File&&N.input instanceof File||N.input instanceof Object)&&(N=u.parse(N.input,N.config))&&r.postMessage({workerId:u.WORKER_ID,results:N,finished:!0})}),(m.prototype=Object.create(d.prototype)).constructor=m,(p.prototype=Object.create(d.prototype)).constructor=p,(g.prototype=Object.create(g.prototype)).constructor=g,(x.prototype=Object.create(d.prototype)).constructor=x,u})})(HA);var dG=HA.exports;const Kae=Gp(dG),fG=[{icon:i.jsx(Gi,{className:"w-4 h-4"}),text:"AI Tax Advisor that answers your REPS questions and cites the exact IRS publications"},{icon:i.jsx(rc,{className:"w-4 h-4"}),text:"Know your audit risk before the IRS does — real-time readiness scoring"},{icon:i.jsx(km,{className:"w-4 h-4"}),text:"Personalized compliance analysis based on your properties and hours"},{icon:i.jsx(ID,{className:"w-4 h-4"}),text:"Full API Integration — build custom workflows and sync with your CPA's tools"},{icon:i.jsx(TD,{className:"w-4 h-4"}),text:"Priority support from our team"}],WA=({isOpen:e,open:t,onClose:n,onOpenChange:r,feature:s,upgradeReason:a,onSubscribe:o,isSubscribing:l,targetTier:c})=>{const u=e??t??!1,f=n||(()=>r==null?void 0:r(!1)),{user:d}=At(),{subscription:m}
529=pf(),{toast:p}=Ht(),[g,x]=h.useState(!1),[y,v]=h.useState("annual"),[b,w]=h.useState(!1),{data:j}=iy(),S=m==null?void 0:m.subscriptionStatus,C=(m==null?void 0:m.subscriptionTier)||"base",E=(S==="active"||S==="suspended")&&C!=="premium",N=(m==null?void 0:m.isOnTrial)||(d==null?void 0:d.isOnTrial),k=c==="premium"?(j==null?void 0:j.premiumMonthlyPrice)||29:(j==null?void 0:j.monthlyPrice)||10,A=c==="premium"?(j==null?void 0:j.premiumAnnualPrice)||279:(j==null?void 0:j.annualPriceMin)||100,M=Math.round(A/12*100)/100,L=k*12-A,F=async T=>{if(!d){p({title:"Authentication Required",description:"Please sign in to start your trial.",variant:"destructive"});return}x(!0);try{const D=window.location.origin,_=await po({priceType:T,tier:c||"base",successUrl:`${D}/?payment=success`,cancelUrl:`${D}/?payment=cancelled`});_.upgraded?(p({title:"Plan Updated",description:_.message}),f(),window.location.reload()):_.checkoutUrl&&(window.location.href=_.checkoutUrl)}catch(D){if((D==null?void 0:D.status)===409){p({title:"Already Subscribed",description:"Opening your billing portal…"});try{const _=await td();_?window.location.href=_:window.location.reload();return}catch{}return}console.error("Checkout error:",D),p({title:"Checkout Error",description:D.message||"Failed to start checkout process. Please try again.",variant:"destructive"})}finally{x(!1)}},V=async()=>{if(!d){p({title:"Authentication Required",description:"Please sign in to upgrade your account.",variant:"destructive"});return}x(!0);try{if(o)await o(y);else{const T=window.location.origin,D=await po({priceType:y,tier:c||"base",successUrl:`${T}/?payment=success`,cancelUrl:`${T}/?payment=cancelled`});D.upgraded?(p({title:"Plan Updated",description:D.message}),f(),window.location.reload()):D.checkoutUrl&&(window.location.href=D.checkoutUrl)}}catch(T){if((T==null?void 0:T.status)===409){p({title:"Already Subscribed",description:"Opening your billing portal…"});try{const D=await td();D?window.location.href=D:window.location.reload();return}catch{}return}console.error("Upgrade error:",T),p({title:"Upgrade Error",description:T.message||"Failed to start upgrade process. Please try again.",variant:"destructive"})}finally{x(!1)}},U=()=>{if(E){w(!0);return}if(N){V();return}d!=null&&d.hasUsedTrial?V():F(y)},P=g||l;return i.jsxs(i.Fragment,{children:[b&&i.jsx(X_,{isOpen:b,onClose:()=>w(!1),targetPriceType:y,targetTier:c||"premium",onSuccess:()=>{w(!1),f(),window.location.reload()}}),i.jsx($r,{open:u,onOpenChange:f,children:i.jsxs(ur,{className:"max-w-md p-0 overflow-hidden gap-0",children:[i.jsx("div",{className:"bg-gradient-to-br from-green-600 to-green-700 px-6 pt-6 pb-5",children:i.jsxs(dr,{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("div",{className:"p-1.5 bg-white/20 rounded-md",children:i.jsx(Qn,{className:"w-4 h-4 text-white"})}),i.jsx(Mr,{className:"bg-white/20 text-white border-0 text-xs font-medium hover:bg-white/20",children:"Shield Advisor"})]}),i.jsx(fr,{className:"text-white text-xl font-semibold leading-snug",children:s?`${s} requires Shield Advisor`:"Upgrade to Shield Advisor"}),a&&i.jsx("p",{className:"text-green-100 text-sm mt-1 leading-relaxed",children:a})]})}),i.jsxs("div",{className:"px-6 py-5 space-y-5",children:[i.jsxs("div",{className:"flex items-center gap-2 p-1 bg-muted rounded-lg",children:[i.jsx("button",{onClick:()=>v("monthly"),className:W("flex-1 text-sm font-medium py-1.5 px-3 rounded-md transition-all duration-150",y==="monthly"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Monthly"}),i.jsxs("button",{onClick:()=>v("annual"),className:W("flex-1 text-sm font-medium py-1.5 px-3 rounded-md transition-all duration-150 flex items-center justify-center gap-1.5",y==="annual"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:["Annual",i.jsxs("span",{className:"text-xs text-green-600 font-semibold",children:["Save $",L]})]})]}),i.jsx("div",{className:"text-center",children:y==="monthly"?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"text-4xl font-bold text-foreground",children:["$",k]}),i.jsx("span",{className:"text-muted-foreground text-sm ml-1",children:"/month"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"text-4xl font-bold text-foreground",children:["$",A]}),i.jsx("span",{className:"text-muted-foreground text-sm ml-1",children:"/year"}),i.jsxs("p",{className:"text-sm text-muted-foreground mt-0.5",children:["$",M,"/mo — billed annually"]})]})}),i.jsxs("div",{className:"space-y-2.5",children:[fG.map((T,D)=>i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex-shrink-0 w-7 h-7 rounded-full bg-green-50 dark:bg-green-900/30 flex items-center justify-center text-green-600 dark:text-green-400",children:T.icon}),i.jsx("span",{className:"text-sm text-foreground",children:T.text})]},D)),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex-shrink-0 w-7 h-7 rounded-full bg-green-50 dark:bg-green-900/30 flex items-center justify-center text-green-600 dark:text-green-400",children:i.jsx(ot,{className:"w-4 h-4"})}),i.jsx("span",{className:"text-sm text-foreground",children:"Everything in Shield Essential, included"})]})]}),i.jsxs("div",{className:"pt-1 space-y-3",children:[i.jsx(Z,{onClick:U,disabled:!!P,className:"w-full bg-green-600 hover:bg-green-700 text-white font-semibold h-11 text-base shadow-sm transition-all duration-150",children:P?"Processing...":E||N?"Upgrade to Shield Advisor":d!=null&&d.hasUsedTrial?"Subscribe Now":"Start 14-Day Free Trial"}),i.jsxs("div",{className:"flex items-center justify-center gap-4 text-xs text-muted-foreground",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(rc,{className:"w-3 h-3"}),"Cancel anytime"]}),!(d!=null&&d.hasUsedTrial)&&!E&&!N&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground
529/40",children:"·"}),i.jsx("span",{children:"No credit card for trial"})]})]})]})]}),i.jsx("div",{className:"px-6 pb-4",children:i.jsx(Z,{variant:"ghost",onClick:f,className:"w-full text-muted-foreground hover:text-foreground text-sm h-9",children:"Maybe later"})})]})})]})};function qA({children:e,tooltipText:t,feature:n,disabled:r=!0,showUpgradeButton:s=!0,customTooltipPosition:a="top",className:o="",onUpgradeClick:l}){const{user:c}=At(),{canAccessPremiumFeatures:u}=pf(),[f,d]=h.useState(!1),[m,p]=h.useState(!1);if(u||c!=null&&c.isOnTrial)return i.jsx(i.Fragment,{children:e});const g=()=>{l?l():d(!0)};return i.jsx(zx,{children:i.jsxs("div",{className:`relative inline-block ${o}`,children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{onClick:g,className:"cursor-pointer",children:e}),i.jsx("div",{className:"absolute top-1 right-1 text-yellow-400 z-10 pointer-events-none",children:i.jsx(Qn,{className:"h-3 w-3 drop-shadow-lg"})}),i.jsx("div",{className:"absolute inset-0 z-20",children:i.jsxs(s9,{children:[i.jsx(i9,{asChild:!0,children:i.jsx("div",{className:"w-full h-full cursor-pointer"})}),i.jsx(cE,{side:a,className:"max-w-xs",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"font-medium",children:n}),i.jsx("p",{className:"text-sm text-gray-600",children:t}),i.jsxs(Z,{size:"sm",onClick:g,className:"w-full bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white",children:[i.jsx(Qn,{className:"h-3 w-3 mr-1"}),"Upgrade to Shield Advisor"]})]})})]})})]}),s&&i.jsxs(Z,{onClick:g,className:"ml-4 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white shadow-md flex items-center gap-2 shrink-0",size:"sm",children:[i.jsx(Qn,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Upgrade to Shield Advisor"}),i.jsx("span",{className:"sm:hidden",children:"Upgrade"})]}),i.jsx(WA,{isOpen:f,onClose:()=>d(!1),onOpenChange:d,feature:n,upgradeReason:t})]})})}function GA({onFilesSelected:e,maxFiles:t=5,acceptedFileTypes:n={"image/*":[".png",".jpg",".jpeg"],"application/pdf":[".pdf"]},className:r}){const[s,a]=h.useState(!1),o=h.useRef(null),[l,c]=h.useState([]),u=x=>{x.preventDefault(),x.stopPropagation(),x.type==="dragenter"||x.type==="dragover"?a(!0):x.type==="dragleave"&&a(!1)},f=x=>{x.preventDefault(),x.stopPropagation(),a(!1),x.dataTransfer.files&&x.dataTransfer.files.length>0&&d(Array.from(x.dataTransfer.files))},d=x=>{const y=[],v=Object.values(n).flat();if(x.forEach(b=>{var j;const w="."+((j=b.name.split(".").pop())==null?void 0:j.toLowerCase());v.includes(w)&&y.push(b)}),y.length>0){const b=[...l,...y].slice(0,t);c(b),e(b)}},m=x=>{x.target.files&&x.target.files.length>0&&d(Array.from(x.target.files))},p=x=>{const y=l.filter((v,b)=>b!==x);c(y),e(y)},g=()=>{var x;(x=o.current)==null||x.click()};return i.jsxs("div",{className:W("w-full space-y-3",r),children:[i.jsxs("div",{className:W("flex flex-col items-center justify-center px-6 py-8 border-2 border-dashed rounded-lg transition-colors cursor-pointer bg-gray-50/50 hover:bg-gray-50",s?"border-primary bg-primary/5":"border-gray-300 hover:border-primary/50"),onDragEnter:u,onDragLeave:u,onDragOver:u,onDrop:f,onClick:g,children:[i.jsx(Pl,{className:"h-10 w-10 text-gray-400 mb-3"}),i.jsxs("div",{className:"text-sm text-center text-gray-600",children:[i.jsx("span",{className:"font-semibold text-primary hover:text-primary/80",children:"Click to upload"})," ","or drag and drop"]}),i.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported formats:"," ",Object.values(n).flat().join(", ")]})]}),l.length>0&&i.jsx("div",{className:"space-y-2",children:l.map((x,y)=>i.jsxs("div",{className:"flex items-center justify-between p-3 bg-white border border-gray-200 rounded-lg shadow-sm",children:[i.jsxs("div",{className:"flex items-center space-x-3 overflow-hidden",children:[i.jsx("div",{className:"p-2 bg-blue-50 rounded-md",children:i.jsx($n,{className:"h-4 w-4 text-blue-600"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-gray-700 truncate",children:x.name}),i.jsxs("p",{className:"text-xs text-gray-500",children:[(x.size/1024).toFixed(1)," KB"]}
529)]})]}),i.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:v=>{v.stopPropagation(),p(y)},className:"text-gray-400 hover:text-red-500 hover:bg-red-50",children:i.jsx($t,{className:"h-4 w-4"})})]},y))}),i.jsx("input",{ref:o,type:"file",className:"sr-only",multiple:!0,accept:Object.values(n).flat().join(","),onChange:m})]})}const hG=yy({date:fn().min(1,"Date is required"),hours:fn().min(1,"Hours is required"),activityType:fn().min(1,"Activity type is required"),description:fn().optional(),propertyId:fn().optional(),isMaterialParticipation:Gl(),isQualifiedNonMaterial:Gl()}).refine(e=>!(e.isMaterialParticipation&&e.isQualifiedNonMaterial),{path:["isQualifiedNonMaterial"],message:"Choose only one classification type"});function Qae({open:e,onClose:t,onSubmit:n,properties:r,entry:s,isSubmitting:a=!1}){const{toast:o}=Ht(),{user:l}=At(),[c,u]=h.useState(!1),[f,d]=h.useState([]),m=(l==null?void 0:l.repType)==="longTerm",p=mi(),g=hy({resolver:my(hG),defaultValues:{date:"",hours:"",activityType:"",description:"",propertyId:"none",isMaterialParticipation:!1,isQualifiedNonMaterial:!1}});h.useEffect(()=>{if(s&&e){const w=s.date?s.date.substring(0,10):"";g.reset({date:w,hours:s.hours.toString(),activityType:s.activityType||"",description:s.description||"",propertyId:s.propertyId?s.propertyId.toString():"none",isMaterialParticipation:s.isMaterialParticipation||!1,isQualifiedNonMaterial:s.isQualifiedNonMaterial||!1})}},[s,e,g]);const x=async()=>{const w=g.getValues("description");if(!(w!=null&&w.trim())){o({title:"No Description",description:"Please enter a description first",variant:"destructive"});return}u(!0);const j=g.getValues("propertyId"),S=r.find(C=>C.id===j);y.mutate({originalDescription:w,activityType:g.getValues("activityType"),propertyNickname:S==null?void 0:S.nickname})},y=Dt({mutationFn:async w=>(await Ze("POST","/api/ai/enhance-description",w)).json(),onSuccess:w=>{w.success&&(g.setValue("description",w.result.enhancedDescription),o({title:"Description Enhanced",description:`AI improvements applied with ${Math.round(w.result.confidence*100)}% confidence`}))},onError:w=>{o({title:"Enhancement Failed",description:w.message||"Failed to enhance description",variant:"destructive"})},onSettled:()=>{u(!1)}}),v=async w=>{if(s)try{const j=parseFloat(w.hours);if(j<.0167||j>24){o({title:"Validation Error",description:"Hours must be between 1 minute and 24 hours",variant:"destructive"});return}await n(s.id,w,f),d([]),t(),o({title:"Success",description:"Time entry updated successfully"})}catch(j){o({title:"Error",description:j.message||"Failed to update entry",variant:"destructive"})}};if(!s)return null;const b=i.jsx(py,{...g,children:i.jsxs("form",{onSubmit:g.handleSubmit(v),className:"min-w-0 max-w-full space-y-4 overflow-x-hidden",children:[i.jsx(Vn,{control:g.control,name:"date",render:({field:w})=>i.jsxs(un,{className:"min-w-0",children:[i.jsx(dn,{children:"Date"}),i.jsx(kn,{children:i.jsx(dt,{type:"date",...w,className:"min-w-0 max-w-full appearance-none overflow-hidden"})}),i.jsx(Sn,{})]})}),i.jsx(Vn,{control:g.control,name:"hours",render:({field:w})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Hours"}),i.jsx(kn,{children:i.jsx(Hx,{value:w.value,onChange:w.onChange,placeholder:"Enter hours (e.g., 2.5)"})}),i.jsx(Sn,{})]})}),i.jsx(Vn,{control:g.control,name:"activityType",render:({field:w})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Activity Type"}),i.jsx(kn,{children:i.jsx(Kx,{value:w.value,onValueChange:w.onChange,placeholder:"Select activity type..."})}),i.jsx(Sn,{})]})}),i.jsx(Vn,{control:g.control,name:"propertyId",render:({field:w})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Property (Optional)"}),i.jsx(kn,{children:i.jsxs(ai,{value:w.value,onValueChange:w.onChange,children:[i.jsx(ys,{children:i.jsx(oi,{placeholder:"Select a property..."})}),i.jsxs(vs,{children:[i.jsx(Kt,{value:"none",children:"No property"}),r.map(j=>{var C;const S=((C=j.id)==null?void 0:C.toString())||`property-fallback-${Date.now()}`;return!S||S===""||S==="undefined"||S==="null"?(console.error("Invalid property ID detected:",j),null):i.jsx(Kt,{value:S,children:j.nickname||j.address||"Unnamed Property"},S)}
529).filter(Boolean)]})]})}),i.jsx(Sn,{})]})}),i.jsx(Vn,{control:g.control,name:"description",render:({field:w})=>i.jsxs(un,{children:[i.jsxs(dn,{className:"flex items-center justify-between text-sm font-normal",children:["Description",w.value&&i.jsx(qA,{feature:"AI Description Enhancement",tooltipText:"Enhance your time entry descriptions with AI to make them IRS audit-ready and professional. Premium feature for compliance.",showUpgradeButton:!1,children:i.jsx(Z,{type:"button",variant:"outline",size:"sm",onClick:x,disabled:c,className:"h-7 px-2 text-xs",children:c?i.jsxs(i.Fragment,{children:[i.jsx(_l,{className:"w-3 h-3 mr-1 animate-spin"}),"Enhancing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(TS,{className:"w-3 h-3 mr-1"}),"Enhance with AI"]})})})]}),i.jsx(kn,{children:i.jsx(Hr,{placeholder:"Briefly describe the activity: type, property address, date & duration, tasks performed, purpose, outcome, and reference any attached documents.",rows:3,...w})}),i.jsx(Sn,{})]})}),i.jsxs(un,{children:[i.jsx(dn,{children:"Category"}),i.jsxs(ai,{value:g.watch("isQualifiedNonMaterial")?"qualified":g.watch("isMaterialParticipation")?"material":"passive",onValueChange:w=>{w==="material"?(g.setValue("isMaterialParticipation",!0),g.setValue("isQualifiedNonMaterial",!1)):w==="qualified"?(g.setValue("isMaterialParticipation",!1),g.setValue("isQualifiedNonMaterial",!0)):(g.setValue("isMaterialParticipation",!1),g.setValue("isQualifiedNonMaterial",!1))},children:[i.jsx(ys,{children:i.jsx(oi,{placeholder:"Select classification"})}),i.jsxs(vs,{children:[i.jsx(Kt,{value:"material",children:"Material Participation"}),m&&i.jsx(Kt,{value:"qualified",children:"Qualified Non-Material"})]})]}),i.jsx(gy,{children:"Select how this activity relates to your REP status."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"font-medium text-sm",children:"Evidence Files"}),s.evidenceFiles&&s.evidenceFiles.length>0&&i.jsxs("div",{className:"space-y-2 mb-4",children:[i.jsx("p",{className:"text-xs text-muted-foreground font-medium uppercase tracking-wider",children:"Attached Files"}),s.evidenceFiles.map((w,j)=>!w.isDeleted&&i.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted/50 rounded-md text-sm border",children:[i.jsxs("div",{className:"flex items-center gap-2 truncate",children:[i.jsx($n,{className:"h-4 w-4 text-blue-500"}),i.jsx("span",{className:"truncate max-w-[200px]",children:w.fileName||w.originalName})]}),i.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>window.open(w.fileUrl,"_blank"),children:i.jsx(zi,{className:"h-3.5 w-3.5"})})]},j))]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground font-medium uppercase tracking-wider mb-2",children:"Upload New Files"}),i.jsx(GA,{onFilesSelected:d,maxFiles:5,acceptedFileTypes:{"image/*":[".png",".jpg",".jpeg"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"]}})]})]}),p?i.jsx("div",{className:"pt-6 pb-safe-bottom",children:i.jsx(Z,{type:"submit",className:"w-full",disabled:a,children:a?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):"Update Entry"})}):i.jsxs(Bl,{children:[i.jsx(Z,{type:"button",variant:"outline",onClick:t,disabled:a,children:"Cancel"}),i.jsx(Z,{type:"submit",disabled:a,children:a?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):"Update Entry"})]})]})});return p?i.jsx(hj,{children:e&&i.jsxs(qt.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:30,stiffness:300,mass:.8},className:"fixed inset-0 z-[60] bg-white dark:bg-gray-950 overflow-hidden flex flex-col",children:[i.jsx(h9,{title:"Modify Entry",showBack:!0,onBack:t,forceShow:!0,className:"bg-white/80 dark:bg-gray-950/80 backdrop-blur-md border-b border-gray-100 dark:border-gray-800"}),i.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-4 pb-safe-bottom pt-[calc(env(safe-area-inset-top)+64px)]",children:b})]})}):i.jsx($r,{open:e,onOpenChange:t,children:i.jsxs(ur,{className:"max-w-2xl w-[95vw] sm:w-full max-h-[90vh] overflow-y-auto overflow-x-hidden",children:[i.jsxs(dr,{children:[i.jsx(fr,{children:"Modify Time Entry"}),i.jsx(li,{children:"Update the details for this time entry."})]}),b]})})}const mG=new Set(["prepareTimeEntry","presentSelectForm","presentQuestionnaire","presentRemediation","presentLogTimeForm","presentAddPropertyForm","presentTaxProfileForm","presentDisplayProperties","presentCostSegEstimate","presentMultiCostSegEstimate","presentRentEstimate","redirectToAdvisor"]);async function pG(e){const t=await e.arrayBuffer(),n=btoa(new Uint8Array(t).reduce((r,s)=>r+String.fromCharCode(s),""));return{type:"file",mediaType:e.type,filename:e.name,url:`data:${e.type};base64,${n}`}}
529function YA(){const[e,t]=h.useState([]),n=h.useRef([]);n.current=e;const[r,s]=h.useState(!1),[a,o]=h.useState(!1),[l,c]=h.useState(null),[u,f]=h.useState(null),[d,m]=h.useState(null),p=h.useRef(null),g=h.useRef(null),x=h.useCallback(async(w,j)=>{var I,E;const S=n.current.find(N=>N.id===w),C=((E=(I=S==null?void 0:S.parts)==null?void 0:I.filter(N=>N.type==="text"))==null?void 0:E.map(N=>N.text).join(""))??"";if(!(!C||!j)){g.current=w,t(N=>N.map(k=>k.id===w?{...k,metadata:{...k.metadata,suggestionsLoading:!0}}:k));try{const N=localStorage.getItem("accessToken"),k={"Content-Type":"application/json"};N&&(k.Authorization=`Bearer ${N}`);const A=p.current??new AbortController;p.current=A;const M=await fetch("/api/agent/suggestions",{method:"POST",headers:k,body:JSON.stringify({fullText:C,userQuery:j,mode:"logger"}),signal:A.signal});if(!M.ok)throw new Error(`Suggestions HTTP ${M.status}`);const F=(await M.json()).suggestions??[];if(g.current!==w)return;t(V=>V.map(U=>U.id===w?{...U,metadata:{...U.metadata,suggestions:F.length>0?F:void 0,suggestionsLoading:!1}}:U))}catch(N){if(N instanceof Error&&N.name==="AbortError")return;console.error("[Agent] Suggestions fetch failed:",N),t(k=>k.map(A=>A.id===w?{...A,metadata:{...A.metadata,suggestionsLoading:!1}}:A))}}},[]),y=h.useCallback(async(w,j)=>{var N;let S=[];j&&j.length>0&&(S=await Promise.all(j.map(pG)));const C={id:`user-${Date.now()}`,role:"user",parts:S.length>0?[...S,{type:"text",text:w}]:[{type:"text",text:w}]};t(k=>[...k,C]),s(!0),o(!0),c(null),f(null),m(null);const I=`assistant-${Date.now()}`,E={id:I,role:"assistant",parts:[],metadata:{status:"streaming"}};t(k=>[...k,E]);try{const k=localStorage.getItem("accessToken"),A={"Content-Type":"application/json"};k&&(A.Authorization=`Bearer ${k}`);const M=await fetch("/api/agent/chat",{method:"POST",headers:A,body:JSON.stringify({messages:n.current.concat(C)})});if(!M.ok)throw new Error(`HTTP error: ${M.status}`);const L=(N=M.body)==null?void 0:N.getReader();if(!L)throw new Error("No response body");const F=new TextDecoder;let V="",U="";for(;;){const{done:P,value:T}=await L.read();if(P)break;V+=F.decode(T,{stream:!0});const D=V.split(`
530
531`);V=D.pop()||"";for(const _ of D){const G=_.split(`
532`);for(const z of G)if(z.startsWith("data: "))try{const R=JSON.parse(z.slice(6));if(R.type==="text")U+=R.content,f(null),m(null),t(q=>q.map(Q=>Q.id===I?{...Q,parts:[...Q.parts.filter(K=>K.type!=="text"),{type:"text",text:U}]}:Q));else if(R.type==="status")f(R.status),m(R.label);else if(R.type==="tool-call"){if(f("tool-call"),m(R.toolName),R.actualToolName&&mG.has(R.actualToolName)){const q={type:`tool-${R.actualToolName}`,toolCallId:R.toolCallId,input:R.input,state:"complete"};t(Q=>Q.map(K=>K.id===I?{...K,parts:[...K.parts,q]}:K))}}else if(R.type==="done"){f(null),m(null);const q=new Date().toISOString();t(Q=>Q.map(K=>K.id===I?{...K,metadata:{...K.metadata,provider:R.provider,mode:R.mode,status:"done",completedAt:q}}:K)),p.current&&(p.current.abort(),p.current=null),x(I,w)}else R.type==="error"&&c(new Error(R.error))}catch(R){console.error("[Agent] Failed to parse SSE data:",R)}}}}catch(k){console.error("[Agent] Stream error:",k),c(k instanceof Error?k:new Error("Stream failed"))}finally{s(!1),o(!1)}},[x]);function v(){t([]),c(null),f(null),m(null)}return{messages:e,isLoading:r,isStreaming:a,error:l,send:y,clearMessages:v,setMessages:t,metadata:{},pipelineStatusLabel:d,pipelineStatus:u}}const gG=new Set(["prepareTimeEntry","presentSelectForm","presentQuestionnaire","presentRemediation","presentLogTimeForm","presentAddPropertyForm","presentTaxProfileForm","presentDisplayProperties","presentCostSegEstimate","presentRentEstimate"]);function KA({mode:e}={}){const t=h.useRef(e);t.current=e;const[n,r]=h.useState([]),s=h.useRef([]);s.current=n;const[a,o]=h.useState(!1),[l,c]=h.useState(!1),[u,f]=h.useState(),[d,m]=h.useState(null),[p,g]=h.useState(null),x=h.useRef(null),y=h.useRef(null),v=h.useCallback(async(j,S,C)=>{var N,k;const I=s.current.find(A=>A.id===j),E=((k=(N=I==null?void 0:I.parts)==null?void 0:N.filter(A=>A.type==="text"))==null?void 0:k.map(A=>A.text).join(""))??"";if(!(!E||!S)){y.current=j,r(A=>A.map(M=>M.id===j?{...M,metadata:{...M.metadata,suggestionsLoading:!0}}
532:M));try{const A=localStorage.getItem("accessToken"),M={"Content-Type":"application/json"};A&&(M.Authorization=`Bearer ${A}`);const L=x.current??new AbortController;x.current=L;const F=await fetch("/api/advisor/suggestions",{method:"POST",headers:M,body:JSON.stringify({fullText:E,userQuery:S,mode:C??"advisor"}),signal:L.signal});if(!F.ok)throw new Error(`Suggestions HTTP ${F.status}`);const U=(await F.json()).suggestions??[];if(y.current!==j)return;r(P=>P.map(T=>T.id===j?{...T,metadata:{...T.metadata,suggestions:U.length>0?U:void 0,suggestionsLoading:!1}}:T))}catch(A){if(A instanceof Error&&A.name==="AbortError")return;console.error("[Advisor] Suggestions fetch failed:",A),r(M=>M.map(L=>L.id===j?{...L,metadata:{...L.metadata,suggestionsLoading:!1}}:L))}}},[]),b=h.useCallback(async j=>{var N;const S=t.current,C={id:`user-${Date.now()}`,role:"user",parts:[{type:"text",text:j}]};r(k=>[...k,C]),o(!0),c(!0),f(void 0),m("streaming"),g("Thinking…");const I=`assistant-${Date.now()}`,E={id:I,role:"assistant",parts:[],metadata:{status:"streaming"}};r(k=>[...k,E]);try{const k=localStorage.getItem("accessToken"),A={"Content-Type":"application/json"};k&&(A.Authorization=`Bearer ${k}`);const M=await fetch("/api/advisor/chat",{method:"POST",headers:A,body:JSON.stringify({messages:s.current.concat(C),mode:S})});if(!M.ok)throw new Error(`HTTP error: ${M.status}`);const L=(N=M.body)==null?void 0:N.getReader();if(!L)throw new Error("No response body");const F=new TextDecoder;let V="",U="";for(;;){const{done:P,value:T}=await L.read();if(P)break;V+=F.decode(T,{stream:!0});const D=V.split(`
533
534`);V=D.pop()||"";for(const _ of D){const G=_.split(`
535`);for(const z of G)if(z.startsWith("data: "))try{const R=JSON.parse(z.slice(6));if(R.type==="text")U+=R.content,m(null),g(null),r(q=>q.map(Q=>Q.id===I?{...Q,parts:[{type:"text",text:U}]}:Q));else if(R.type==="status")m(R.status),g(R.label);else if(R.type==="tool-call"){if(m("tool-call"),g(R.toolName),R.actualToolName&&gG.has(R.actualToolName)){const q={type:`tool-${R.actualToolName}`,toolCallId:R.toolCallId,input:R.input,state:"complete"};r(Q=>Q.map(K=>K.id===I?{...K,parts:[...K.parts,q]}:K))}}else if(R.type==="done"){m(null),g(null);const q=new Date().toISOString();r(Q=>Q.map(K=>K.id===I?{...K,metadata:{...K.metadata,provider:R.provider,traceId:R.traceId,mode:R.mode,status:"done",completedAt:q}}:K)),x.current&&(x.current.abort(),x.current=null),v(I,j,S)}else R.type==="error"&&f(R.error)}catch(R){console.error("[Advisor] Failed to parse SSE data:",R)}}}}catch(k){console.error("[Advisor] Stream error:",k),f(k instanceof Error?k.message:"Stream failed")}finally{o(!1),c(!1)}},[v]);function w(){r([]),f(void 0),m(null),g(null)}return{messages:n,isLoading:a,isStreaming:l,error:u,send:b,clearMessages:w,setMessages:r,metadata:{},pipelineStatusLabel:p,pipelineStatus:d}}async function xG(){return(await Ze("GET","/api/advisor/mode")).json()}async function yG(){return(await Ze("GET","/api/advisor/tax-profile")).json()}async function Ty(e){await Ze("PATCH","/api/advisor/tax-profile",e)}async function vG(e){try{await Ze("PUT","/api/advisor/mode",{mode:e})}catch(t){if(t instanceof Ks){if(t.status===403){const n=t.body;throw new Ks((n==null?void 0:n.error)||"Shield Advisor required for Advisor mode.",403,{requiresUpgrade:!0})}if(t.status===503)throw new Ks("AI Advisor Mode is not currently available.",503,{retryable:!1})}throw t}}async function bG(){const e=await fetch("/api/advisor/tax-profile/suggestions",{credentials:"include"});if(!e.ok)throw new Error("Failed to fetch suggestions");return e.json()}async function wG(e){return(await Ze("POST","/api/advisor/audit/drafts",e)).json()}async function kG(e){return(await Ze("POST",`/api/advisor/audit/drafts/${e}/apply`)).json()}async function SG(e){return(await Ze("POST",`/api/advisor/audit/drafts/${e}/discard`)).json()}async function NG(e){const n=new URLSearchParams().toString(),r=`/api/advisor/audit/drafts${n?`?${n}`:""}`;return(await Ze("GET",r)).json()}const jG={logger:"Quick",advisor:"Advisor",compliance:"Compliance"},kw={logger:"Log time entries, check hours, or manage your properties.",advisor:"Ask about REPS qualification, tax rules, or audit preparation.",compliance:"Review your IRS compliance posture, run audits, and prepare for examinations."},vp={logger:[{text:"Log a time entry"},{text:"Email me IRS Report"},{text:"Show me tax savings"},{text:"What did I log yesterday?"}],advisor:[{text:"Do I qualify for REPS this year?"},{text:"What are the rental comps for my properties?"},{text:"What activities qualify for material participation?"},{text:"Does tenant communication count toward REPS hours?"}],compliance:[{text:"Run a compliance audit on my entries",primary:!0},{text:"What would an IRS examiner flag in my records?"},{text:"Am I ready for an audit this year?"}]},Sw=["/api/advisor/mode"];function CG(){const e=wt(),{data:t,isLoading:n}=it({queryKey:Sw,queryFn:xG,staleTime:5*60*1e3,retry:(s,a)=>a instanceof Error&&/403|503/.test(a.message)?!1:s<1}),r=Dt({mutationFn:vG,onSuccess:(s,a)=>{e.setQueryData(Sw,o=>o?{...o,mode:a}:{mode:a,isPremium:!0})}});return{mode:(t==null?void 0:t.mode)??"logger",isPremium:(t==null?void 0:t.isPremium)??!1,isLoading:n,setMode:r.mutate,isSwitching:r.isPending,error:r.error}}const vo={all:["conversations"],list:e=>["conversations","list",e],messages:e=>["conversations",e,"messages"]};async function Ro(e,t){const n=localStorage.getItem("accessToken"),r={"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{}},s=await fetch(e,{credentials:"include",...t,headers:{...r,...t==null?void 0:t.headers}});if(!s.ok){const a=await s.json().catch(()=>({}));throw Object.assign(new Error(a.message??s.statusText),{status:s.status})}if(s.status!==204)return s.json()}function TG(e=1){return it({queryKey:vo.list(e),queryFn:()=>Ro(`/api/conversations?page=${e}`),staleTime:1e3*30,retry:(t,n)=>{const r=n==null?void 0:n.status;return r===401||r===403?!1:t<2}})}function QA(e){return it({queryKey:vo.messages(e??""),queryFn:()=>Ro(`/api/conversations/${e}/messages`),enabled:!!e,staleTime:1e3*10})}function ZA(){const e=wt();return Dt({mutationFn:()=>Ro("/api/conversations",{method:"POST"}),onSuccess:()=>
535{e.invalidateQueries({queryKey:vo.all})}})}function yd(e){const t=wt();return Dt({mutationFn:({content:n,role:r})=>Ro(`/api/conversations/${e}/messages`,{method:"POST",body:JSON.stringify({content:n,role:r})}),onSuccess:()=>{t.invalidateQueries({queryKey:vo.messages(e)}),t.invalidateQueries({queryKey:vo.all})}})}function EG(){const e=wt();return Dt({mutationFn:t=>Ro(`/api/conversations/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:vo.all})}})}function _G(e,t){return it({queryKey:["conversations","search",e],queryFn:()=>Ro(`/api/conversations/search?q=${encodeURIComponent(e)}`),enabled:t&&e.length>=3,staleTime:1e3*30,retry:(n,r)=>{const s=r==null?void 0:r.status;return s===401||s===403||s===400?!1:n<2}})}function AG(e){let t=-1;for(let s=0;s<e.length;s++){const a=e[s];typeof a.type=="string"&&a.type.startsWith("tool-")&&(t=s)}if(t===-1)return e.filter(s=>s.type==="text").map(s=>s.text).join("");let n=-1;for(let s=t+1;s<e.length;s++)if(e[s].type==="step-start"){n=s;break}const r=n!==-1?n:t;return e.slice(r+1).filter(s=>s.type==="text").map(s=>s.text).join("")}const Nw=/^\[QUESTIONNAIRE_SUBMIT questionnaire_id="([^"]+)" answers=({.*})\]$/s;function PG(e,t){const n=e[t];if(n.role!=="assistant"||n.parts.some(a=>typeof a.type=="string"&&a.type.startsWith("tool-")))return!1;const s=e[t+1];return!s||s.role!=="assistant"?!1:s.parts.some(a=>typeof a.type=="string"&&a.type.startsWith("tool-"))}const RG=/^\[FORM_SUBMIT [\s\S]*\]$/,IG=/^\[REMEDIATION_SUBMIT [^\]]+\]$/,MG=/\[PRESENT_COST_SEG_ESTIMATE propertyId=(\d+) status="(none|pending|complete|failed)"\]/,DG=/\[PRESENT_MULTI_COST_SEG_ESTIMATE propertyIds=(\[[^\]]*\])\]/,OG=/\[PRESENT_RENT_ESTIMATE propertyId=(\d+)\]/;function LG(e){if(Nw.test(e)){const t=e.match(Nw);if(t)return{type:"tool-formSubmit",questionnaireId:t[1]}}if(RG.test(e)){const t=e.match(/form_id="([^"]+)"/);if(t){const n=e.match(/selected_id="([^"]+)"/);return{type:"tool-formSubmit",questionnaireId:t[1],selectedId:n==null?void 0:n[1]}}}return IG.test(e)?{type:"tool-formSubmit",questionnaireId:"remediation"}:null}function FG(e){const t=e.match(MG);return t?{type:"tool-presentCostSegEstimate",toolCallId:"hydrated",state:"complete",input:{propertyId:Number(t[1]),status:t[2]}}:null}function VG(e){const t=e.match(DG);if(!t)return null;try{return{type:"tool-presentMultiCostSegEstimate",toolCallId:"hydrated",state:"complete",input:{propertyIds:JSON.parse(t[1])}}}catch{return null}}function $G(e){const t=e.match(OG);return t?{type:"tool-presentRentEstimate",toolCallId:"hydrated",state:"complete",input:{propertyId:Number(t[1])}}:null}function zG(e){const t=e.role,n={type:"text",text:e.content};if(t==="user"){const r=LG(e.content);if(r)return{id:e.id,role:t,parts:[r,n],content:e.content}}if(t==="assistant"){const r=FG(e.content);if(r)return{id:e.id,role:t,parts:[r],content:e.content,...e.createdAt?{metadata:{completedAt:e.createdAt}}:{}};const s=VG(e.content);if(s)return{id:e.id,role:t,parts:[s],content:e.content,...e.createdAt?{metadata:{completedAt:e.createdAt}}:{}};const a=$G(e.content);if(a)return{id:e.id,role:t,parts:[a],content:e.content,...e.createdAt?{metadata:{completedAt:e.createdAt}}:{}}}return{id:e.id,role:t,parts:[n],content:e.content,...t==="assistant"&&e.createdAt?{metadata:{completedAt:e.createdAt}}:{}}}function UG({activeConversationId:e,onConversationCreated:t}){const n=YA(),r=ZA(),[s,a]=h.useState(null),o=QA(e),l=h.useRef(e),c=h.useRef(0),u=h.useRef(!1);h.useEffect(()=>{l.current=e},[e]),h.useEffect(()=>{var y;if(e===null){s!==null&&(n.clearMessages(),c.current=0,a(null));return}if(e===s||o.isLoading)return;if(o.isError){a(e);return}const x=(((y=o.data)==null?void 0:y.data)??[]).map(zG);n.setMessages(x),c.current=x.length,a(e)},[e,s,o.isLoading,o.isError,o.data]);const f=yd(l.current??""),d=yd(l.current??"");h.useEffect(()=>{var v,b,w;const g=u.current&&!n.isLoading;if(u.current=n.isLoading,!g||!l.current)return;const y=n.messages;for(let j=c.current;j<y.length;j++){const S=y[j];if(S.role!=="assistant"||PG(y,j))continue;const C=S.parts.find(k=>typeof k.type=="string"&&k.type==="tool-presentCostSegEstimate"),I=S.parts.find(k=>typeof k.type=="string"&&k.type==="tool-presentMultiCostSegEstimate"),E=S.parts.find(k=>typeof k.type=="string"&&k.type==="tool-presentRentEstimate");let N;if(C&&((v=C.input)==null?void 0:v.propertyId)!=null){const{propertyId:k,status:A="complete"}=C.input;N=`[PRESENT_COST_SEG_ESTIMATE propertyId=${k} status="${A}"]`}else I&&((b=I.input)==null?void 0:b.propertyIds)!=null?N=`[PRESENT_MULTI_COST_SEG_ESTIMATE propertyIds=${JSON.stringify(I.input.propertyIds)}]`:E&&((w=E.input)==null?void 0:w.propertyId)!=null?N=`[PRESENT_RENT_ESTIMATE propertyId=${E.input.propertyId}]`:N=AG(S.parts);N&&d.mutate({content:N,role:"assistant"})}c.current=y.length},[n.isLoading,n.messages]);const m=h.useCallback(async(g,x)=>{let y=l.current;if(!y)try{y=(await r.mutateAsync()).id,l.current=y,a(y),t(y)}catch{}y&&(f.mutate({content:g,role:"user"}),c.current=n.messages.length),n.send(g,x)},[n,r,t,f]),p=e!==null&&e!==s&&o.isLoading;return{messages:n.messages,isLoading:n.isLoading,isStreaming:n.isStreaming,error:n.error,send:m,clearMessages:n.clearMessages,pipelineStatusLabel:n.pipelineStatusLabel,pipelineStatus:n.pipelineStatus,activeConversationId:l.current,isLoadingSession:p}}function BG(e){let t=-1;for(let s=0;s<e.length;s++){const a=e[s];typeof a.type=="string"&&a.type.startsWith("tool-")&&(t=s)}if(t===-1)return e.filter(s=>s.type==="text").map(s=>s.text).join("");let n=-1;for(let s=t+1;
535s<e.length;s++)if(e[s].type==="step-start"){n=s;break}const r=n!==-1?n:t;return e.slice(r+1).filter(s=>s.type==="text").map(s=>s.text).join("")}const jw=/^\[QUESTIONNAIRE_SUBMIT questionnaire_id="([^"]+)" answers=({.*})\]$/s,HG=/^\[FORM_SUBMIT [\s\S]*\]$/,WG=/^\[REMEDIATION_SUBMIT [^\]]+\]$/,qG=/\[PRESENT_COST_SEG_ESTIMATE propertyId=(\d+) status="(none|pending|complete|failed)"\]/,GG=/\[PRESENT_MULTI_COST_SEG_ESTIMATE propertyIds=(\[[^\]]*\])\]/,YG=/\[PRESENT_RENT_ESTIMATE propertyId=(\d+)\]/;function KG(e){if(jw.test(e)){const t=e.match(jw);if(t)return{type:"tool-formSubmit",questionnaireId:t[1]}}if(HG.test(e)){const t=e.match(/form_id="([^"]+)"/);if(t){const n=e.match(/selected_id="([^"]+)"/);return{type:"tool-formSubmit",questionnaireId:t[1],selectedId:n==null?void 0:n[1]}}}return WG.test(e)?{type:"tool-formSubmit",questionnaireId:"remediation"}:null}function QG(e){const t=e.match(qG);return t?{type:"tool-presentCostSegEstimate",toolCallId:"hydrated",state:"complete",input:{propertyId:Number(t[1]),status:t[2]}}:null}function ZG(e){const t=e.match(GG);if(!t)return null;try{return{type:"tool-presentMultiCostSegEstimate",toolCallId:"hydrated",state:"complete",input:{propertyIds:JSON.parse(t[1])}}}catch{return null}}function XG(e){const t=e.match(YG);return t?{type:"tool-presentRentEstimate",toolCallId:"hydrated",state:"complete",input:{propertyId:Number(t[1])}}:null}function JG(e){const t=e.role,n={type:"text",text:e.content};if(t==="user"){const r=KG(e.content);if(r)return{id:e.id,role:t,parts:[r,n],content:e.content}}if(t==="assistant"){const r=QG(e.content);if(r)return{id:e.id,role:t,parts:[r],content:e.content,...e.createdAt?{metadata:{completedAt:e.createdAt}}:{}};const s=ZG(e.content);if(s)return{id:e.id,role:t,parts:[s],content:e.content,...e.createdAt?{metadata:{completedAt:e.createdAt}}:{}};const a=XG(e.content);if(a)return{id:e.id,role:t,parts:[a],content:e.content,...e.createdAt?{metadata:{completedAt:e.createdAt}}:{}}}return{id:e.id,role:t,parts:[n],content:e.content,...t==="assistant"&&e.createdAt?{metadata:{completedAt:e.createdAt}}:{}}}function eY(e,t){const n=e[t];if(n.role!=="assistant"||n.parts.some(a=>typeof a.type=="string"&&a.type.startsWith("tool-")))return!1;const s=e[t+1];return!s||s.role!=="assistant"?!1:s.parts.some(a=>typeof a.type=="string"&&a.type.startsWith("tool-"))}function Cw({activeConversationId:e,onConversationCreated:t,mode:n}){const r=KA({mode:n}),s=ZA(),[a,o]=h.useState(null),l=QA(e),c=h.useRef(e),u=h.useRef(0),f=h.useRef(!1);h.useEffect(()=>{c.current=e},[e]),h.useEffect(()=>{var v;if(e===null){a!==null&&(r.clearMessages(),u.current=0,o(null));return}if(e===a||l.isLoading)return;if(l.isError){o(e);return}const y=(((v=l.data)==null?void 0:v.data)??[]).map(JG);r.setMessages(y),u.current=y.length,o(e)},[e,a,l.isLoading,l.isError,l.data]);const d=yd(c.current??""),m=yd(c.current??"");h.useEffect(()=>{var b,w,j;const x=f.current&&!r.isLoading;if(f.current=r.isLoading,!x||!c.current)return;const v=r.messages;for(let S=u.current;S<v.length;S++){const C=v[S];if(C.role!=="assistant"||eY(v,S))continue;const I=C.parts.find(A=>typeof A.type=="string"&&A.type==="tool-presentCostSegEstimate"),E=C.parts.find(A=>typeof A.type=="string"&&A.type==="tool-presentMultiCostSegEstimate"),N=C.parts.find(A=>typeof A.type=="string"&&A.type==="tool-presentRentEstimate");let k;if(I&&((b=I.input)==null?void 0:b.propertyId)!=null){const{propertyId:A,status:M="complete"}=I.input;k=`[PRESENT_COST_SEG_ESTIMATE propertyId=${A} status="${M}"]`}else E&&((w=E.input)==null?void 0:w.propertyIds)!=null?k=`[PRESENT_MULTI_COST_SEG_ESTIMATE propertyIds=${JSON.stringify(E.input.propertyIds)}]`:N&&((j=N.input)==null?void 0:j.propertyId)!=null?k=`[PRESENT_RENT_ESTIMATE propertyId=${N.input.propertyId}]`:k=BG(C.parts);k&&m.mutate({content:k,role:"assistant"})}u.current=v.length},[r.isLoading,r.messages]);const p=h.useCallback(async(x,y)=>{let v=c.current;if(!v)try{v=(await s.mutateAsync()).id,c.current=v,o(v),t(v)}catch{}v&&(d.mutate({content:x,role:"user"}),u.current=r.messages.length),r.send(x,y)},[r,s,t,d]),g=e!==null&&e!==a&&l.isLoading;return{messages:r.messages,isLoading:r.isLoading,isStreaming:r.isStreaming,error:r.error,send:p,clearMessages:r.clearMessages,metadata:r.metadata,pipelineStatusLabel:r.pipelineStatusLabel,pipelineStatus:r.pipelineStatus,activeConversationId:c.current,isLoadingSession:g}}function XA(){const e=YA(),t=KA(),{mode:n,isPremium:r,setMode:s,isSwitching:a}=CG(),[o,l]=h.useState(null),[c,u]=h.useState(null),[f,d]=h.useState(null),m=n==="advisor"?c:n==="compliance"?f:o,p=
535h.useCallback(b=>{n==="advisor"?u(b):n==="compliance"?d(b):l(b)},[n]),g=UG({activeConversationId:o,onConversationCreated:l}),x=Cw({activeConversationId:c,onConversationCreated:u,mode:"advisor"}),y=Cw({activeConversationId:f,onConversationCreated:d,mode:"compliance"}),v=h.useCallback(()=>{n==="advisor"?(u(null),x.clearMessages()):n==="compliance"?(d(null),y.clearMessages()):(l(null),g.clearMessages())},[n,x,y,g]);return{agent:e,advisor:t,mode:n,isPremium:r,setMode:s,isSwitching:a,activeConversationId:m,setActiveConversationId:p,startNewConversation:v,loggerConversationId:o,setLoggerConversationId:l,advisorConversationId:c,setAdvisorConversationId:u,complianceConversationId:f,setComplianceConversationId:d,agentWithSession:g,advisorChat:x,complianceChat:y}}function tY(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Ey="ScrollArea",[JA]=zt(Ey),[nY,Jn]=JA(Ey),eP=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:a=600,...o}=e,[l,c]=h.useState(null),[u,f]=h.useState(null),[d,m]=h.useState(null),[p,g]=h.useState(null),[x,y]=h.useState(null),[v,b]=h.useState(0),[w,j]=h.useState(0),[S,C]=h.useState(!1),[I,E]=h.useState(!1),N=Ae(t,A=>c(A)),k=oa(s);return i.jsx(nY,{scope:n,type:r,dir:k,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:f,content:d,onContentChange:m,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:x,onScrollbarYChange:y,scrollbarYEnabled:I,onScrollbarYEnabledChange:E,onCornerWidthChange:b,onCornerHeightChange:j,children:i.jsx(pe.div,{dir:k,...o,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});eP.displayName=Ey;var tP="ScrollAreaViewport",nP=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...a}=e,o=Jn(tP,n),l=h.useRef(null),c=Ae(t,l,o.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx(rY,{nonce:s}),i.jsx(pe.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});nP.displayName=tP;var rY=h.memo(({nonce:e})=>i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e}),(e,t)=>e.nonce===t.nonce),Wr="ScrollAreaScrollbar",_y=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Jn(Wr,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=s,l=e.orientation==="horizontal";return h.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),s.type==="hover"?i.jsx(sY,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(iY,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(rP,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(Ay,{...r,ref:t,"data-state":"visible"}):null});_y.displayName=Wr;var sY=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Jn(Wr,e.__scopeScrollArea),[a,o]=h.useState(!1);return h.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},f=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(Lt,{present:n||a,children:i.jsx(rP,{"data-state":a?"visible":"hidden",...r,ref:t})})}),iY=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Jn(Wr,e.__scopeScrollArea),a=e.orientation==="horizontal",o=Nf(()=>c("SCROLL_END"),100),[l,c]=tY("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),h.useEffect(()=>{const u=s.viewport,f=a?"scrollLeft":"scrollTop";if(u){let d=u[f];const m=()=>{const p=u[f];d!==p&&(c("SCROLL"),o()),d=p};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[s.viewport,a,c,o]),i.jsx(Lt,{present:n||l!=="hidden",children:i.jsx(Ay,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:se(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:se(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),rP=h.forwardRef((e,t)=>
535{const n=Jn(Wr,e.__scopeScrollArea),{forceMount:r,...s}=e,[a,o]=h.useState(!1),l=e.orientation==="horizontal",c=Nf(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?u:f)}},10);return bo(n.viewport,c),bo(n.content,c),i.jsx(Lt,{present:r||a,children:i.jsx(Ay,{"data-state":a?"visible":"hidden",...s,ref:t})})}),Ay=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=Jn(Wr,e.__scopeScrollArea),a=h.useRef(null),o=h.useRef(0),[l,c]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=lP(l.viewport,l.content),f={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>a.current=m,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:m=>o.current=m};function d(m,p){return dY(m,o.current,l,p)}return n==="horizontal"?i.jsx(aY,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const m=s.viewport.scrollLeft,p=Tw(m,l,s.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=d(m,s.dir))}}):n==="vertical"?i.jsx(oY,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const m=s.viewport.scrollTop,p=Tw(m,l);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=d(m))}}):null}),aY=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=Jn(Wr,e.__scopeScrollArea),[o,l]=h.useState(),c=h.useRef(null),u=Ae(t,c,a.onScrollbarXChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(iP,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sf(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,d)=>{if(a.viewport){const m=a.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),uP(m,d)&&f.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:bd(o.paddingLeft),paddingEnd:bd(o.paddingRight)}})}})}),oY=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=Jn(Wr,e.__scopeScrollArea),[o,l]=h.useState(),c=h.useRef(null),u=Ae(t,c,a.onScrollbarYChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(iP,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sf(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,d)=>{if(a.viewport){const m=a.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),uP(m,d)&&f.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:
535a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:bd(o.paddingTop),paddingEnd:bd(o.paddingBottom)}})}})}),[lY,sP]=JA(Wr),iP=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:d,...m}=e,p=Jn(Wr,n),[g,x]=h.useState(null),y=Ae(t,N=>x(N)),v=h.useRef(null),b=h.useRef(""),w=p.viewport,j=r.content-r.viewport,S=Et(f),C=Et(c),I=Nf(d,10);function E(N){if(v.current){const k=N.clientX-v.current.left,A=N.clientY-v.current.top;u({x:k,y:A})}}return h.useEffect(()=>{const N=k=>{const A=k.target;(g==null?void 0:g.contains(A))&&S(k,j)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[w,g,j,S]),h.useEffect(C,[r,C]),bo(g,I),bo(p.content,I),i.jsx(lY,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:Et(a),onThumbPointerUp:Et(o),onThumbPositionChange:C,onThumbPointerDown:Et(l),children:i.jsx(pe.div,{...m,ref:y,style:{position:"absolute",...m.style},onPointerDown:se(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),v.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(N))}),onPointerMove:se(e.onPointerMove,E),onPointerUp:se(e.onPointerUp,N=>{const k=N.target;k.hasPointerCapture(N.pointerId)&&k.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=b.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),vd="ScrollAreaThumb",aP=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=sP(vd,e.__scopeScrollArea);return i.jsx(Lt,{present:n||s.hasThumb,children:i.jsx(cY,{ref:t,...r})})}),cY=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,a=Jn(vd,n),o=sP(vd,n),{onThumbPositionChange:l}=o,c=Ae(t,d=>o.onThumbChange(d)),u=h.useRef(void 0),f=Nf(()=>{u.current&&(u.current(),u.current=void 0)},100);return h.useEffect(()=>{const d=a.viewport;if(d){const m=()=>{if(f(),!u.current){const p=fY(d,l);u.current=p,l()}};return l(),d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[a.viewport,f,l]),i.jsx(pe.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:se(e.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),g=d.clientX-p.left,x=d.clientY-p.top;o.onThumbPointerDown({x:g,y:x})}),onPointerUp:se(e.onPointerUp,o.onThumbPointerUp)})});aP.displayName=vd;var Py="ScrollAreaCorner",oP=h.forwardRef((e,t)=>{const n=Jn(Py,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(uY,{...e,ref:t}):null});oP.displayName=Py;var uY=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Jn(Py,n),[a,o]=h.useState(0),[l,c]=h.useState(0),u=!!(a&&l);return bo(s.scrollbarX,()=>{var d;const f=((d=s.scrollbarX)==null?void 0:d.offsetHeight)||0;s.onCornerHeightChange(f),c(f)}),bo(s.scrollbarY,()=>{var d;const f=((d=s.scrollbarY)==null?void 0:d.offsetWidth)||0;s.onCornerWidthChange(f),o(f)}),u?i.jsx(pe.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function bd(e){return e?parseInt(e,10):0}function lP(e,t){const n=e/t;return isNaN(n)?0:n}function Sf(e){const t=lP(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function dY(e,t,n,r="ltr"){const s=Sf(n),a=s/2,o=t||a,l=s-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,f=n.content-n.viewport,d=r==="ltr"?[0,f]:[f*-1,0];return cP([c,u],d)(e)}function Tw(e,t,n="ltr"){const r=Sf(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-s,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],u=zl(e,c);return cP([0,o],[0,l])(u)}function cP(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function uP(e,t){return e>0&&e<t}var fY=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function Nf(e,t){const n=Et(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function bo(e,t){const n=Et(t);_t(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var dP=eP,hY=nP,mY=oP;const fP=h.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(dP,{ref:r,className:W("relative overflow-hidden",e),...n,children:[i.jsx(hY,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(hP,{}),i.jsx(mY,{})]}));fP.displayName=dP.displayName;const hP=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(_y,{ref:r,orientation:t,className:W("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:i.jsx(aP,{className:"relative flex-1 rounded-full bg-border"})}));hP.displayName=_y.displayName;function mP(e,t){const[n,r]=h.useState(()=>t?0:e.length),s=h.useRef(),a=h.useRef(0),o=h.useRef(t),l=h.useRef(e),c=h.useRef(n),u=h.useRef(t);l.current=e,c.current=n,u.current=t,h.useLayoutEffect(()=>{t&&!o.current&&(r(0),c.current=0,a.current=0),o.current=t},[t]);const f=h.useCallback((m,p)=>{let g=p+1;for(;g<m.length&&m[g]!==" "&&m[g]!==`
536`;)g++;return g<m.length&&(m[g]===" "||m[g]===`
537`)&&g++,Math.min(g,m.length)},[]),d=h.useCallback(m=>{const p=l.current,g=c.current,x=u.current;if(!(g>=p.length&&!x)){if(!x&&g<p.length){let y=g;y=f(p,y),y<p.length&&(y=f(p,y)),y=Math.min(y,p.length),c.current=y,r(y),y<p.length&&(s.current=requestAnimationFrame(d));return}if(x){if(g<p.length){if(m-a.current<30){s.current=requestAnimationFrame(d);return}a.current=m;const y=f(p,g);c.current=y,r(y)}(x||c.current<p.length)&&(s.current=requestAnimationFrame(d))}}},[f]);return h.useEffect(()=>((c.current<e.length||t)&&(cancelAnimationFrame(s.current),s.current=requestAnimationFrame(d)),()=>cancelAnimationFrame(s.current)),[e,t,d]),e.slice(0,n)}function pY(e){let t=-1;for(let s=0;s<e.length;s++){const a=e[s];typeof a.type=="string"&&a.type.startsWith("tool-")&&(t=s)}if(t===-1)return e.filter(s=>s.type==="text").map(s=>s.text).join("");let n=-1;for(let s=t+1;
537s<e.length;s++)if(e[s].type==="step-start"){n=s;break}const r=n!==-1?n:t;return e.slice(r+1).filter(s=>s.type==="text").map(s=>s.text).join("")}const gY=/\[(PRESENT_COST_SEG_ESTIMATE|PRESENT_MULTI_COST_SEG_ESTIMATE|PRESENT_RENT_ESTIMATE)\b[\s\S]*\]/,xY="[EVIDENCE_SCAN_CONTEXT]";function yY(){return i.jsx("span",{className:"inline-block w-[3px] h-[14px] bg-current opacity-80 rounded-sm align-text-bottom ml-0.5",style:{animation:"cursor-blink 1s steps(2) infinite"}})}function vY(){return i.jsx("span",{className:"inline-flex items-center gap-0.5 h-4","aria-label":"Loading",children:[0,1,2].map(e=>i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current opacity-60",style:{animation:`pulse 1.2s ease-in-out ${e*.2}s infinite`}},e))})}function bY(e){return e.replace(/<tools_ready>[\s\S]*?<\/tools_ready>/g,"").replace(/<think>[\s\S]*?<\/think>/g,"").replace(/<\/?function\b[^>]*>/g,"").replace(/<\/?[a-zA-Z][a-zA-Z0-9_-]*(?:\s[^>]*)?\s*\/?>/g,"").replace(/\n{3,}/g,`
538
539`).trim()}function wY({message:e,isStreaming:t=!1}){var f;const n=e.role==="user",r=(n?e.parts.filter(d=>d.type==="text").map(d=>d.text).join(""):pY(e.parts)).replace(/\[ADVISOR_REDIRECT\]\n?/g,"").replace(/\n?\[\/ADVISOR_REDIRECT\]/g,""),s=n?r.split(xY)[0].trim():bY(r),a=mP(s,t),o=n?s:a,l=t||a.length<s.length,c=e.parts.filter(d=>d.type==="file");if(n&&(s.startsWith("[FORM_SUBMIT ")||s.startsWith("[QUESTIONNAIRE_SUBMIT ")||s.startsWith("[REMEDIATION_SUBMIT "))||!n&&gY.test(s)||!s&&c.length===0&&!t)return null;const u=n?"":hS((f=e.metadata)==null?void 0:f.completedAt);return i.jsxs("div",{className:W("flex flex-col",n?"items-end":"items-start"),children:[i.jsxs("div",{className:W("min-w-0 max-w-[92%] text-sm break-words [overflow-wrap:anywhere] overflow-hidden",n?"rounded-2xl bg-gray-200 dark:bg-gray-700 text-foreground px-3.5 py-2 whitespace-pre-wrap":"rounded-2xl bg-gray-100 dark:bg-gray-800 text-foreground px-3.5 py-2"),children:[c.length>0&&i.jsx("div",{className:W("flex flex-wrap gap-1.5",s&&"mb-2"),children:c.map((d,m)=>d.mediaType.startsWith("image/")?i.jsx("img",{src:d.url,alt:d.filename||"Attached image",className:"rounded-md max-h-32 max-w-full object-cover"},m):i.jsxs("div",{className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs bg-gray-100 dark:bg-gray-800",children:[i.jsx($n,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate max-w-[120px]",children:d.filename||"File"})]},m))}),o&&(n?i.jsx("span",{className:"whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:o}):i.jsxs("span",{className:"whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:[o,l&&i.jsx(yY,{})]})),!o&&!n&&t&&i.jsx(vY,{})]}),!n&&!l&&u&&i.jsx("span",{className:"mt-0.5 text-[10px] text-muted-foreground/70 select-none self-end",children:u})]})}function kY(e){var o;const[t,n]=e.split(","),r=((o=t.match(/:(.*?);/))==null?void 0:o[1])||"application/octet-stream",s=atob(n),a=new Uint8Array(s.length);for(let l=0;l<s.length;l++)a[l]=s.charCodeAt(l);return new Blob([a],{type:r})}async function Ew(e,t){if(t&&t.length>0){const n=new FormData;n.append("date",e.date),n.append("hours",String(e.hours)),n.append("activityType",e.activityType),n.append("activityTypeLabel",e.activityTypeLabel),n.append("propertyId",e.propertyId!=null?String(e.propertyId):""),n.append("description",e.description||""),n.append("isMaterialParticipation",String(e.isMaterialParticipation));for(const s of t){const a=kY(s.url);n.append("files",a,s.filename||"file")}return(await Ze("POST","/api/agent/confirm-entry",n)).json()}else return(await Ze("POST","/api/agent/confirm-entry",e)).json()}async function Ry(e){const t=new FormData;for(const r of e)r instanceof File?t.append("files",r):t.append("files",r.blob,r.filename);return(await Ze("POST","/api/evidence-files/extract",t)).json()}const pP=h.createContext(null);function _w({children:e}){const t=h.useRef(new Map),[,n]=h.useState(0),r=h.useCallback(a=>t.current.get(a),[]),s=h.useCallback((a,o)=>{t.current.set(a,o),n(l=>l+1)},[]);return i.jsx(pP.Provider,{value:{getCardState:r,setCardState:s},children:e})}function ga(){const e=h.useContext(pP);return e||{getCardState:()=>{},setCardState:()=>{}}}var at={BOOT:"boot",TERMINATE:"terminate",LOCATION:"location",HTTP:"http",MOTIONCHANGE:"motionchange",PROVIDERCHANGE:"providerchange",HEARTBEAT:"heartbeat",ACTIVITYCHANGE:"activitychange",GEOFENCE:"geofence",GEOFENCESCHANGE:"geofenceschange",SCHEDULE:"schedule",CONNECTIVITYCHANGE:"connectivitychange",ENABLEDCHANGE:"enabledchange",POWERSAVECHANGE:"powersavechange",NOTIFICATIONACTION:"notificationaction",AUTHORIZATION:"authorization"},Aw=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}
539return new(n||(n=Promise))(function(a,o){function l(f){try{u(r.next(f))}catch(d){o(d)}}function c(f){try{u(r.throw(f))}catch(d){o(d)}}function u(f){f.done?a(f.value):s(f.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Pw=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(f){return c([u,f])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ee=mr("BackgroundGeolocation"),SY="debug",NY="notice",jY="info",CY="warn",TY="error",EY=1,_Y=-1;function Go(e,t){return Ee.log({level:e,message:t})}function Eh(e){if(typeof e!="object")return{};if(e.hasOwnProperty("start")&&isNaN(e.start))throw new Error("Invalid SQLQuery.start.  Expected unix timestamp but received: "+e.start);if(e.hasOwnProperty("end")&&isNaN(e.end))throw new Error("Invalid SQLQuery.end.  Expected unix timestamp but received: "+e.end);return e}var AY=function(){function e(){}return Object.defineProperty(e,"ORDER_ASC",{get:function(){return EY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ORDER_DESC",{get:function(){return _Y},enumerable:!1,configurable:!0}),e.debug=function(t){return Go(SY,t)},e.error=function(t){return Go(TY,t)},e.warn=function(t){return Go(CY,t)},e.info=function(t){return Go(jY,t)},e.notice=function(t){return Go(NY,t)},e.getLog=function(t){return t=Eh(t),new Promise(function(n,r){Ee.getLog({options:t}).then(function(s){n(s.log)}).catch(function(s){r(s.message)})})},e.destroyLog=function(){return new Promise(function(t,n){Ee.destroyLog().then(function(){t()}).catch(function(r){n(r.message)})})},e.emailLog=function(t,n){return n=Eh(n),new Promise(function(r,s){Ee.emailLog({email:t,query:n}).then(function(a){r(a)}).catch(function(a){s(a.message)})})},e.uploadLog=function(t,n){return n=Eh(n),new Promise(function(r,s){Ee.uploadLog({url:t,query:n}).then(function(){r()}).catch(function(a){s(a.message)})})},e}(),Rw="http://tracker.transistorsoft.com",Iw="DUMMY_TOKEN",PY={refresh_token:"{refreshToken}"},RY="/api/locations",IY="/api/refresh_token",bp=function(){function e(){}return e.findOrCreate=function(t,n,r){return r===void 0&&(r=Rw),new Promise(function(s,a){Ee.getTransistorToken({org:t,username:n,url:r}).then(function(o){if(o.success){var l=o.token;l.url=r,s(l)}else{if(console.warn("[TransistorAuthorizationToken findOrCreate] ERROR: ",o),o.status=="403"){a(o);return}s({accessToken:Iw,refreshToken:Iw,expires:-1,url:r})}}).catch(function(o){a(o)})})},e.destroy=function(t){return t===void 0&&(t=Rw),new Promise(function(n,r){Ee.destroyTransistorToken({url:t}).then(function(){n()}).catch(function(s){r(s.message)})})},e.applyIf=function(t){if(!t.transistorAuthorizationToken)return t;var n=t.transistorAuthorizationToken;return delete t.transistorAuthorizationToken,t.url=n.url+RY,t.authorization={strategy:"JWT",accessToken:n.accessToken,refreshToken:n.refreshToken,refreshUrl:n.url+IY,refreshPayload:PY,expires:n.expires},t},e}(),MY="IGNORE_BATTERY_OPTIMIZATIONS",DY="POWER_MANAGER",Mw=function(e,t){t.lastSeenAt>0&&(t.lastSeenAt=new Date(t.lastSeenAt)),e(t)},OY=function(){function e(){}return e.isIgnoringBatteryOptimizations=function(){return new Promise(function(t,n){Ee.isIgnoringBatteryOptimizations().then(function(r){t(r.isIgnoringBatteryOptimizations)}).catch(function(r){n(r.message)})})},e.showIgnoreBatteryOptimizations=function(){return new Promise(function(t,n){var r={action:MY};Ee.requestSettings(r).then(function(s){Mw(t,s)}).catch(function(s){n(s.message)})})},e.showPowerManager=function(){return new Promise(function(t,n){var r={action:DY};Ee.requestSettings(r).then(function(s){Mw(t,s)}).catch(function(s){n(s.message)})})},e.show=function(t){return new Promise(function(n,r){var s={action:t.action};Ee.showSettings(s).then(function(){n()}).catch(function(a){r(a.message)})})},e}(),Dw="TSLocationManager",Zr=[],_h=[],LY=function(){function e(t,n,r){this.event=t,this.subscription=n,this.callback=r}return e}(),Ah=function(e){return(e.notificationPriority||e.notificationText||e.notificationTitle||e.notificationChannelName||e.notificationColor||e.notificationSmallIcon||e.notificationLargeIcon)&&(console.warn('[Backgroun
539dGeolocation] WARNING: Config.notification* fields (eg: notificationText) are all deprecated in favor of notification: {title: "My Title", text: "My Text"}  See docs for "Notification" class'),e.notification={text:e.notificationText,title:e.notificationTitle,color:e.notificationColor,channelName:e.notificationChannelName,smallIcon:e.notificationSmallIcon,largeIcon:e.notificationLargeIcon,priority:e.notificationPriority}),e=bp.applyIf(e),e},FY=0,VY=1,$Y=2,zY=3,UY=4,BY=5,HY=-2,WY=-1,qY=10,GY=100,YY=1e3,KY=3e3,QY=0,ZY=1,XY=2,JY=3,eK=4,tK=0,nK=1,rK=-1,sK=2,iK=-2,aK=1,oK=2,lK=3,cK=4,uK=5,dK="Always",fK="WhenInUse",hK="Any",mK=2,pK=1,gK=-1,xK=0,yK=0,vK=1,In=function(){function e(){}return Object.defineProperty(e,"EVENT_BOOT",{get:function(){return at.BOOT},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_TERMINATE",{get:function(){return at.TERMINATE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_LOCATION",{get:function(){return at.LOCATION},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_MOTIONCHANGE",{get:function(){return at.MOTIONCHANGE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_HTTP",{get:function(){return at.HTTP},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_HEARTBEAT",{get:function(){return at.HEARTBEAT},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_PROVIDERCHANGE",{get:function(){return at.PROVIDERCHANGE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_ACTIVITYCHANGE",{get:function(){return at.ACTIVITYCHANGE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_GEOFENCE",{get:function(){return at.GEOFENCE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_GEOFENCESCHANGE",{get:function(){return at.GEOFENCESCHANGE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_ENABLEDCHANGE",{get:function(){return at.ENABLEDCHANGE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_CONNECTIVITYCHANGE",{get:function(){return at.CONNECTIVITYCHANGE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_SCHEDULE",{get:function(){return at.SCHEDULE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_POWERSAVECHANGE",{get:function(){return at.POWERSAVECHANGE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_NOTIFICATIONACTION",{get:function(){return at.NOTIFICATIONACTION},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EVENT_AUTHORIZATION",{get:function(){return at.AUTHORIZATION},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOG_LEVEL_OFF",{get:function(){return FY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOG_LEVEL_ERROR",{get:function(){return VY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOG_LEVEL_WARNING",{get:function(){return $Y},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOG_LEVEL_INFO",{get:function(){return zY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOG_LEVEL_DEBUG",{get:function(){return UY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOG_LEVEL_VERBOSE",{get:function(){return BY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ACTIVITY_TYPE_OTHER",{get:function(){return aK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ACTIVITY_TYPE_AUTOMOTIVE_NAVIGATION",{get:function(){return oK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ACTIVITY_TYPE_FITNESS",{get:function(){return lK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ACTIVITY_TYPE_OTHER_NAVIGATION",{get:function(){return cK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ACTIVITY_TYPE_AIRBORNE",{get:function(){return uK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DESIRED_ACCURACY_NAVIGATION",{get:function(){return HY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DESIRED_ACCURACY_HIGH",{get:function(){return WY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DESIRED_ACCURACY_MEDIUM",{get:function(){return qY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DESIRED_ACCURACY_LOW",{get:function(){return GY}
539,enumerable:!1,configurable:!0}),Object.defineProperty(e,"DESIRED_ACCURACY_VERY_LOW",{get:function(){return YY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DESIRED_ACCURACY_LOWEST",{get:function(){return KY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AUTHORIZATION_STATUS_NOT_DETERMINED",{get:function(){return QY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AUTHORIZATION_STATUS_RESTRICTED",{get:function(){return ZY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AUTHORIZATION_STATUS_DENIED",{get:function(){return XY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AUTHORIZATION_STATUS_ALWAYS",{get:function(){return JY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AUTHORIZATION_STATUS_WHEN_IN_USE",{get:function(){return eK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"NOTIFICATION_PRIORITY_DEFAULT",{get:function(){return tK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"NOTIFICATION_PRIORITY_HIGH",{get:function(){return nK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"NOTIFICATION_PRIORITY_LOW",{get:function(){return rK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"NOTIFICATION_PRIORITY_MAX",{get:function(){return sK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"NOTIFICATION_PRIORITY_MIN",{get:function(){return iK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOCATION_AUTHORIZATION_ALWAYS",{get:function(){return dK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOCATION_AUTHORIZATION_WHEN_IN_USE",{get:function(){return fK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LOCATION_AUTHORIZATION_ANY",{get:function(){return hK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"PERSIST_MODE_ALL",{get:function(){return mK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"PERSIST_MODE_LOCATION",{get:function(){return pK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"PERSIST_MODE_GEOFENCE",{get:function(){return gK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"PERSIST_MODE_NONE",{get:function(){return xK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ACCURACY_AUTHORIZATION_FULL",{get:function(){return yK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ACCURACY_AUTHORIZATION_REDUCED",{get:function(){return vK},enumerable:!1,configurable:!0}),Object.defineProperty(e,"logger",{get:function(){return AY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"deviceSettings",{get:function(){return OY},enumerable:!1,configurable:!0}),e.ready=function(t){return Ee.ready({options:Ah(t)})},e.reset=function(t){return Ee.reset({options:Ah(t)})},e.start=function(){return Ee.start()},e.stop=function(){return Ee.stop()},e.startSchedule=function(){return Ee.startSchedule()},e.stopSchedule=function(){return Ee.stopSchedule()},e.startGeofences=function(){return Ee.startGeofences()},e.setConfig=function(t){return Ee.setConfig({options:Ah(t)})},e.getState=function(){return Ee.getState()},e.changePace=function(t){return new Promise(function(n,r){Ee.changePace({isMoving:t}).then(function(){n()}).catch(function(s){r(s.errorMessage)})})},e.getCurrentPosition=function(t){return t=t||{},new Promise(function(n,r){Ee.getCurrentPosition({options:t}).then(function(s){n(s)}).catch(function(s){r(s.code)})})},e.watchPosition=function(t,n,r){var s=this;return r=r||{},new Promise(function(a,o){return Aw(s,void 0,void 0,function(){var l,c;return Pw(this,function(u){switch(u.label){case 0:return l=function(f){f.hasOwnProperty("error")&&f.error!=null?typeof n=="function"?n(f.error.code):console.warn("[BackgroundGeolocation watchPostion] DEFAULT ERROR HANDLER.  Provide an onError handler to watchPosition to receive this message: ",f.error):t(f)},[4,Ee.addListener("watchposition",l)];case 1:return c=u.sent(),Ee.watchPosition({options:r}).then(function(){_h.push(c),a()}).catch(function(f){c.remove(),o(f.message)}),[2]}})})})},e.stopWatchPosition=function(){for(var t=0;t<_h.length;t++){var n=_h[t];n.remove()}return Ee.stopWatchPosition()},e.requestPermission=function(){return new Promise(function(t,n){Ee.requestPermission().then(function(r){r.success?t(r.status):n(r.status)})})},e.requestTemporaryFullAccuracy=function(t){return new Promise(function(n,r){Ee.requestTemporaryFullAccuracy({purpose:t}).then(function(s){n(s.accuracyAuthorization)}).catch(function(s){r(s.message)})})},e.getProviderState=function(){return Ee.getProviderState()},e.getLocations=function(){return new Promise(function(t,n){Ee.getLocations().then(function(r){t(r.locations)}).catch(function(r){n(r.message)})})},e.insertLocation=function(t){return new Promise(function(n,r){Ee.insertLocation({options:t}).then(function(s){n(s.uuid)}).catch(function(s){r(s.message)})})},e.destroyLocations=function(){return new Promise(function(t,n){Ee.destroyLocations().then(function(){t()}).catch(function(r){n(r.message)})})},e.destroyLocation=function(t){return new Promise(function(n,r){Ee.destroyLocation({uuid:t}).then(function(){n()}).catch(function(s){r(s.message)})})},e.getCount=function(){return new Promise(function(t,n){Ee.getCount().then(function(r){t(r.count)}).catch(function(r){n(r.message)})})},e.sync=function(){return new Promise(function(t,n){Ee.sync().then(function(r){t(r.locations)}).catch(function(r){n(r.message)})})},e.addGeofence=function(t){return new Promise(function(n,r){Ee.addGeofence({o
539ptions:t}).then(function(){n()}).catch(function(s){r(s.message)})})},e.addGeofences=function(t){return new Promise(function(n,r){Ee.addGeofences({options:t}).then(function(){n()}).catch(function(s){r(s.message)})})},e.getGeofences=function(){return new Promise(function(t,n){Ee.getGeofences().then(function(r){t(r.geofences)}).catch(function(r){n(r.message)})})},e.getGeofence=function(t){return new Promise(function(n,r){if(t===null){r("identifier is null");return}Ee.getGeofence({identifier:t}).then(function(s){n(s)}).catch(function(s){r(s.message)})})},e.geofenceExists=function(t){return new Promise(function(n,r){if(t===null){r("identifier is null");return}Ee.geofenceExists({identifier:t}).then(function(s){n(s.exists)}).catch(function(s){r(s.message)})})},e.removeGeofence=function(t){return new Promise(function(n,r){if(t===null){r("identifier is null");return}Ee.removeGeofence({identifier:t}).then(function(){n()}).catch(function(s){r(s.message)})})},e.removeGeofences=function(t){return t=t||[],new Promise(function(n,r){Ee.removeGeofences({identifiers:t}).then(function(){n()}).catch(function(s){r(s.message)})})},e.getOdometer=function(){return new Promise(function(t,n){Ee.getOdometer().then(function(r){t(r.odometer)}).catch(function(r){n(r.message)})})},e.setOdometer=function(t){return new Promise(function(n,r){Ee.setOdometer({odometer:t}).then(function(s){n(s)}).catch(function(s){r(s.message)})})},e.resetOdometer=function(){return e.setOdometer(0)},e.startBackgroundTask=function(){return new Promise(function(t,n){Ee.startBackgroundTask().then(function(r){t(r.taskId)}).catch(function(r){n(r.message)})})},e.stopBackgroundTask=function(t){return new Promise(function(n,r){Ee.stopBackgroundTask({taskId:t}).then(function(){n()}).catch(function(s){r(s.message)})})},e.finish=function(t){return e.stopBackgroundTask(t)},e.getDeviceInfo=function(){return Ee.getDeviceInfo()},e.playSound=function(t){return Ee.playSound({soundId:t})},e.isPowerSaveMode=function(){return new Promise(function(t,n){Ee.isPowerSaveMode().then(function(r){t(r.isPowerSaveMode)}).catch(function(r){n(r.message)})})},e.getSensors=function(){return Ee.getSensors()},e.findOrCreateTransistorAuthorizationToken=function(t,n,r){return bp.findOrCreate(t,n,r)},e.destroyTransistorAuthorizationToken=function(t){return bp.destroy(t)},e.onLocation=function(t,n){return e.addListener(at.LOCATION,t,n)},e.onMotionChange=function(t){return e.addListener(at.MOTIONCHANGE,t)},e.onHttp=function(t){return e.addListener(at.HTTP,t)},e.onHeartbeat=function(t){return e.addListener(at.HEARTBEAT,t)},e.onProviderChange=function(t){return e.addListener(at.PROVIDERCHANGE,t)},e.onActivityChange=function(t){return e.addListener(at.ACTIVITYCHANGE,t)},e.onGeofence=function(t){return e.addListener(at.GEOFENCE,t)},e.onGeofencesChange=function(t){return e.addListener(at.GEOFENCESCHANGE,t)},e.onSchedule=function(t){return e.addListener(at.SCHEDULE,t)},e.onEnabledChange=function(t){return e.addListener(at.ENABLEDCHANGE,t)},e.onConnectivityChange=function(t){return e.addListener(at.CONNECTIVITYCHANGE,t)},e.onPowerSaveChange=function(t){return e.addListener(at.POWERSAVECHANGE,t)},e.onNotificationAction=function(t){return e.addListener(at.NOTIFICATIONACTION,t)},e.onAuthorization=function(t){return e.addListener(at.AUTHORIZATION,t)},e.addListener=function(t,n,r){if(!at[t.toUpperCase()])throw Dw+"#addListener - Unknown event '"+t+"'";var s=function(l){l.hasOwnProperty("value")&&(l=l.value),l.hasOwnProperty("error")&&l.error!=null&&typeof r=="function"?r(l.error):n(l)},a=!1,o={remove:function(){a=!0,console.warn("[BackgroundGeolocation.addListener] Unexpected call to subscription.remove() on subscriptionProxy.  Waiting for NativeModule.addListener to resolve.")}};return Ee.addListener(t,s).then(function(l){var c=new LY(t,l,n);Zr.push(c),o.remove=function(){l.remove(),Zr.indexOf(c)>=0&&Zr.splice(Zr.indexOf(c),1)},a&&o.remove()}),o},e.removeListener=function(t,n){return console.warn(`BackgroundGeolocation.removeListener is deprecated.  Event-listener methods (eg: onLocation) now return a Subscription instance.  Call subscription.remove() on the returned subscription instead.  Eg:
540const subscription = BackgroundGeolocation.onLocation(myLocationHandler)
541...
542subscription.remove()`),new Promise(function(r,s){for(var a=null,o=0,l=Zr.length;o<l;o++){var c=Zr[o];if(c.event===t&&c.callback===n){a=c;break}}a!==null?(Zr.splice(Zr.indexOf(a),1),a.subscription.remove(),r()):(console.warn(Dw+" Failed to find listener for event "+t),s())})},e.removeListeners=function(){var t=this;return new Promise(function(n){return Aw(t,void 0,void 0,function(){return Pw(this,function(r){switch(r.label){case 0:return Zr=[],[4,Ee.removeAllEventListeners()];case 1:return r.sent(),n(),[2]}})})})},e}(),Ow;(function(e){e[e.Sunday=1]="Sunday",e[e.Monday=2]="Monday",e[e.Tuesday=3]="Tuesday",e[e.Wednesday=4]="Wednesday",e[e.Thursday=5]="Thursday",e[e.Friday=6]="Friday",e[e.Saturday=7]="Saturday"})(Ow||(Ow={}));const bK=mr("LocalNotifications",{web:()=>ce(()=>import("./web-BCEY7XFe.js"),__vite__mapDeps([155,1])).then(e=>new e.LocalNotificationsWeb)}),Lw=100,gP="geofence_optin_cache",xP="geofence_properties_cache",Fw="geofence_device_token_cache";function wK(e,t,n,r){const a=u=>u*Math.PI/180,o=a(n-e),l=a(r-t),c=Math.sin(o/2)**2+Math.cos(a(e))*Math.cos(a(n))*Math.sin(l/2)**2;return 6371e3*2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))}let Yo=!1,Xr=null,Jr=null;const wp=new Map,Vw=3e4;function kK(){try{const e=localStorage.getItem(gP);return e!==null?JSON.parse(e):null}catch{return null}}function SK(e){try{localStorage.setItem(gP,JSON.stringify(e))}catch{}}function NK(){try{const e=localStorage.getItem(xP);return e?JSON.parse(e):null}catch{return null}}function jK(e){try{localStorage.setItem(xP,JSON.stringify(e))}catch{}}async function CK(){var e;try{const t=await fetch("/api/user/preferences",{credentials:"include"});if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=await t.json(),r=((e=n==null?void 0:n.preferences)==null?void 0:e.locationTrackingEnabled)===!0;return SK(r),r}catch{const t=kK();return t!==null?(console.log("[GeofenceService] Offline – using cached opt-in preference:",t),t):(console.log("[GeofenceService] Offline and no cached opt-in – defaulting to false."),!1)}}async function $w(){try{const e=await fetch("/api/geofence/properties",{credentials:"include"});if(!e.ok)throw new Error(`Failed to fetch geofenceable properties: ${e.status}`);const t=await e.json();return jK(t),t}catch{const e=NK();return e&&e.length>0?(console.log(`[GeofenceService] Offline – using ${e.length} cached property/properties.`),e):(console.log("[GeofenceService] Offline and no cached properties – no geofences to register."),[])}}async function TK(){try{const e=await fetch("/api/geofence/device-token",{credentials:"include"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=await e.json();return localStorage.setItem(Fw,t.token),t.token}catch{const e=localStorage.getItem(Fw);return e?(console.log("[GeofenceService] Offline – using cached device token."),e):(console.warn("[GeofenceService] No device token available – native HTTP sync disabled."),null)}}async function zw(e){if(e.length===0){console.log("[GeofenceService] No geocoded properties to register.");return}const t=e.map(n=>({identifier:String(n.id),radius:n.radius??Lw,latitude:Number(n.latitude),longitude:Number(n.longitude),notifyOnEntry:!0,notifyOnExit:!0,loiteringDelay:3e4}));await In.addGeofences(t),console.log(`[GeofenceService] Registered ${t.length} geofence(s).`);try{const n=await In.getCurrentPosition({timeout:10,maximumAge:3e4,desiredAccuracy:50,samples:1}),{latitude:r,longitude:s}=n.coords,a=Date.now();for(const o of e){const l=o.radius??Lw,c=wK(r,s,Number(o.latitude),Number(o.longitude));c<=l&&(wp.set(o.id,{eventType:"enter",timestamp:a}),console.log(`[GeofenceService] Already inside property #${o.id} (${c.toFixed(0)}m ≤ ${l}m) — reconciling startup ENTER.`),await EK(o.id,"enter",n.timestamp,{source:"startup-reconciliation",distanceMetres:Math.round(c),radiusMetres:l}))}}catch{console.warn("[GeofenceService] Could not get current position for pre-seeding — spurious ENTERs may occur on re-registration.")}}async function EK(e,t,n,r){try{const s=await fetch("/api/geofence/event",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({propertyId:e,eventType:t,timestamp:n??new Date().toISOString(),rawPayload:r})});if(!s.ok){const o=await s.text().catch(()=>"");console.warn(`[GeofenceService] Startup ${t.toUpperCase()} reconciliation failed for property #${e}: ${s.status} ${o}`);return}const a=await s.json().catch(()=>null);console.log(`[GeofenceService] Startup ${t.toUpperCase()} reconciliation for property #${e}:`,a)}catch(s){console.warn(`[GeofenceService] Startup ${t.toUpperCase()} reconciliation error for property #${e}:`,s)}}async function _K(e){const t=parseInt(e.identifier,10);if(isNaN(t)){console.warn("[GeofenceService] Unknown geofence identifier:",e.identifier);return}const n=e.action==="ENTER"?"enter":"exit",r=Date.now(),s=wp.get(t);if(s&&s.eventType!==n&&r-s.timestamp<Vw){console.log(`[GeofenceService] Oscillation suppressed: ${n.toUpperCase()} for property #${t} arrived ${((r-s.timestamp)/1e3).toFixed(1)}s after ${s.eventType.toUpperCase()} (cooldown: ${Vw/1e3}s).`);return}if(wp.set(t,{eventType:n,timestamp:r}),console.log(`[GeofenceService] ${n.toUpperCase()} → property #${t}
542`),n==="exit")try{await In.changePace(!0)}catch{}}const ll={async start(){if(Yo){console.log("[GeofenceService] Already running.");return}if(!await CK()){console.log("[GeofenceService] Location tracking is disabled. User has not opted in.");return}try{(await bK.requestPermissions()).display!=="granted"&&console.warn("[GeofenceService] Notification permission not granted – foreground service may be killed by Android.");const n=await TK(),r=await In.ready({stopOnTerminate:!1,startOnBoot:!0,foregroundService:!0,notification:{title:"REPSShield",text:"Tracking active - monitoring your properties.",channelName:"REPSShield Location",smallIcon:"ic_stat_notification",sticky:!0},locationAuthorizationRequest:"Always",backgroundPermissionRationale:{title:"Background Location Required",message:"REPSShield uses background location to automatically detect when you arrive at or leave your monitored properties.",positiveAction:"Allow All the Time",negativeAction:"Cancel"},...n?{url:`${x9.replace(/\/$/,"")}/api/geofence/native-sync`,method:"POST",autoSync:!0,autoSyncThreshold:0,batchSync:!1,persistMode:In.PERSIST_MODE_GEOFENCE,httpRootProperty:"location",authorization:{strategy:"JWT",accessToken:n}}:{},desiredAccuracy:In.DESIRED_ACCURACY_HIGH,distanceFilter:25,disableElasticity:!0,locationUpdateInterval:5e3,fastestLocationUpdateInterval:5e3,stopTimeout:60,disableMotionActivityUpdates:!0,geofenceInitialTriggerEntry:!0,preventSuspend:!0,heartbeatInterval:60,logLevel:In.LOG_LEVEL_VERBOSE,debug:!1});await In.requestPermission(),r.enabled||await In.start(),Jr==null||Jr.remove(),Xr==null||Xr.remove(),Jr=null,Xr=null;const s=await $w();await zw(s),Jr=In.onGeofence(_K),Xr=In.onLocation(a=>{ll._lastLocation=a,ll._locationListeners.forEach(o=>o(a))},a=>console.error("[GeofenceService] Location error:",a)),Yo=!0,console.log("[GeofenceService] Started.")}catch(t){throw console.error("[GeofenceService] Failed to start:",t),t}},async stop(){Yo&&(Jr==null||Jr.remove(),Xr==null||Xr.remove(),Jr=null,Xr=null,await In.stop(),Yo=!1,console.log("[GeofenceService] Stopped."))},async refreshGeofences(){try{await In.removeGeofences();const e=await $w();await zw(e),console.log("[GeofenceService] Geofences refreshed.")}catch(e){throw console.error("[GeofenceService] Failed to refresh geofences:",e),e}},get isRunning(){return Yo},_lastLocation:null,_locationListeners:new Set,onLocation(e){return this._locationListeners.add(e),this._lastLocation&&e(this._lastLocation),()=>this._locationListeners.delete(e)},startGeofenceMonitoring:async()=>ll.start(),stopGeofenceMonitoring:async()=>ll.stop()};function AK({onEnabled:e,onDismiss:t}){const{toast:n}=Ht(),r=wt(),[s,a]=h.useState(!1),o=Dt({mutationFn:async()=>{const c=await fetch("/api/user/preferences",{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({locationTrackingEnabled:!0})});if(!c.ok)throw new Error("Failed to update preference");try{localStorage.setItem("geofence_optin_cache",JSON.stringify(!0))}catch{}return c.json()},onSuccess:async()=>{r.invalidateQueries({queryKey:["/api/user/preferences"]}),await ll.start(),n({title:"Visit detection enabled",description:"We'll detect visits to your properties and create pending time entries for your review."}),e==null||e()},onError:()=>{n({title:"Error",description:"Failed to enable visit detection. Please try again.",variant:"destructive"})}});function l(){a(!0),t==null||t()}return i.jsx("div",{className:"mt-2 rounded-lg border border-amber-200 bg-amber-50 dark:border-amber-900/40 dark:bg-amber-950/20 p-3",children:i.jsxs("div",{className:"flex items-start gap-2.5",children:[i.jsx("div",{className:"mt-0.5 shrink-0 rounded-full bg-amber-100 dark:bg-amber-900/30 p-1.5",children:i.jsx(cg,{className:"h-3.5 w-3.5 text-amber-600 dark:text-amber-400"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-xs font-medium text-amber-900 dark:text-amber-100",children:"Enable automatic visit logging?"}),i.jsx("p",{className:"text-[11px] text-amber-700 dark:text-amber-300/80 mt-0.5 leading-relaxed",children:"We'll detect when you arrive at your properties and create pending time entries for your review."}),i.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[i.jsxs(Z,{size:"sm",className:"h-7 px-2.5 text-xs bg-amber-600 hover:bg-amber-700 text-white",onClick:()=>o.mutate(),disabled:o.isPending,children:[o.isPending?i.jsx(Xe,{className:"h-3 w-3 animate-spin mr-1"}):null,"Enable"]}),i.jsx(Z,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-amber-700 dark:text-amber-300 hover:text-amber-900 dark:hover:text-amber-100",onClick:l,disabled:o.isPending,children:"Not now"})]})]})]})})}function wd({title:e="Extracting evidence details",label:t="REPS evidence scan",description:n="Reading your upload to suggest a date, activity type, and description. Hours and property stay ready for you to confirm.",variant:r="full"}){return r==="compact"?i.jsx("div",{className:"rounded-lg border border-border/70 bg-background px-3 py-2 shadow-sm",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsxs("div",{className:"relative mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:[i.jsx(km,{className:"h-4 w-4"}),i.jsx(Gi,{className:"absolute -right-1 -top-1 h-3 w-3 animate-pulse text-primary"})]}),i.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[i.jsx("p",{className:"text-xs font-semibold text-foreground",children:e}),i.jsx("span",{className:"rounded-full border border-primary/20 bg-primary/5 px-2 py-0.5 text-[10px] font-medium leading-none text-primary",children:t})]}),i.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:n}),i.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-muted",children:i.jsx("div",{className:"h-full w-1/2 animate-[evidence-scan_1.4s_ease-in-out_infinite] rounded-full bg-gradient-to-r from-primary via-pink-500 to-blue-500"})})]})]})}):i.jsx("div",{className:"rounded-xl border border-border/70 bg-background p-4 shadow-lg shadow-black/10",children:i.jsxs("div",{className:"space-y-4 text-center",children:[i.jsx("h3",{className:"text-base font-semibold text-foreground",children:e}),i.jsxs("div",{className:"mx-auto w-full max-w-[260px] rounded-lg border border-border bg-muted/30 p-3 text-left",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsxs("div",{className:"relative flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:[i.jsx(km,{className:"h-4 w-4"}),i.jsx(Gi,{className:"absolute -right-1 -top-1 h-3 w-3 animate-pulse text-primary"})]}),i.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[i.jsx("div",{className:"h-2.5 w-24 animate-pulse rounded-full bg-slate-700"}),i.jsx("div",{className:"h-2.5 w-20 animate-pulse rounded-full bg-slate-500"})]})]}),i.jsxs("div",{className:"mt-4 space-y-2",children:[i.jsxs("div",{className:"grid grid-cols-[32px_1fr] items-center gap-2",children:[i.jsx("div",{className:"h-1.5 rounded-full bg-muted-foreground
542/20"}),i.jsx("div",{className:"h-1.5 animate-pulse rounded-full bg-muted-foreground/45"})]}),i.jsxs("div",{className:"grid grid-cols-[32px_1fr] items-center gap-2",children:[i.jsx("div",{className:"h-1.5 rounded-full bg-muted-foreground/20"}),i.jsx("div",{className:"h-1.5 w-4/5 animate-pulse rounded-full bg-muted-foreground/30"})]}),i.jsxs("div",{className:"grid grid-cols-[32px_1fr] items-center gap-2",children:[i.jsx("div",{className:"h-1.5 rounded-full bg-muted-foreground/20"}),i.jsx("div",{className:"h-1.5 animate-pulse rounded-full bg-muted-foreground/45"})]}),i.jsxs("div",{className:"grid grid-cols-[32px_1fr] items-center gap-2",children:[i.jsx("div",{className:"h-1.5 rounded-full bg-muted-foreground/20"}),i.jsx("div",{className:"h-1.5 w-4/5 animate-pulse rounded-full bg-muted-foreground/30"})]})]}),i.jsx("div",{className:"mt-4 flex justify-end",children:i.jsx("div",{className:"h-2.5 w-14 animate-pulse rounded-full bg-slate-600"})}),i.jsx("div",{className:"mt-3 h-1 overflow-hidden rounded-full bg-muted",children:i.jsx("div",{className:"h-full w-1/2 animate-[evidence-scan_1.4s_ease-in-out_infinite] rounded-full bg-gradient-to-r from-primary via-pink-500 to-blue-500"})})]}),i.jsx("div",{className:"inline-flex max-w-full items-center justify-center rounded-full border border-primary/20 bg-primary/5 px-3 py-1 text-xs font-medium text-primary",children:t}),i.jsx("p",{className:"mx-auto max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:n})]})})}function PK({toolCallId:e,entry:t,attachedFiles:n,skipAttachedFileExtraction:r=!1,onCancel:s}){const a=wt(),{getCardState:o,setCardState:l}=ga(),c={date:t.date,hours:String(t.hours),activityType:t.activityType,propertyId:t.propertyId!=null?String(t.propertyId):"none",description:t.description??"",isMaterialParticipation:t.isMaterialParticipation??!0,isQualifiedNonMaterial:!1},u=o(e),f=(u==null?void 0:u.status)??"pending",d=(u==null?void 0:u.editMode)??!1,m=(u==null?void 0:u.editState)??c,p=(u==null?void 0:u.isSaving)??!1,g=(u==null?void 0:u.cardFiles)??[];function x(P){const T=o(e);l(e,{status:(T==null?void 0:T.status)??"pending",editMode:(T==null?void 0:T.editMode)??!1,editState:(T==null?void 0:T.editState)??c,isSaving:(T==null?void 0:T.isSaving)??!1,cardFiles:(T==null?void 0:T.cardFiles)??[],locationTrackingEnabled:T==null?void 0:T.locationTrackingEnabled,visitPromptDismissed:T==null?void 0:T.visitPromptDismissed,isExtractingEvidence:(T==null?void 0:T.isExtractingEvidence)??!1,evidenceExtractionMessage:T==null?void 0:T.evidenceExtractionMessage,extractedFileSignature:T==null?void 0:T.extractedFileSignature,...P})}const{data:y=[]}=it({queryKey:["/api/properties"],staleTime:5*60*1e3,enabled:d}),v=h.useRef(null),b=10,w=10*1024*1024;function j(P){return new Promise((T,D)=>{const _=new FileReader;_.onload=()=>{T({type:"file",mediaType:P.type||"application/octet-stream",url:_.result,filename:P.name})},_.onerror=()=>D(_.error),_.readAsDataURL(P)})}async function S(P){if(!P||P.length===0)return;const T=Array.from(P);v.current&&(v.current.value="");const D=T.find(z=>z.size>w);if(D){alert(`"${D.name}" exceeds the 10 MB limit.`);return}if([...g,...T].length>b){alert(`You can attach at most ${b} files total.`);return}const G=await Promise.all(T.map(j));x({cardFiles:[...g,...G]}),k(T,T.map(z=>`${z.name}:${z.type}:${z.size}:${z.lastModified}`).join("|"))}function C(P){x({cardFiles:g.filter((T,D)=>D!==P)})}const I=(n==null?void 0:n.length)??0;function E(P){var R;const[T,D]=P.split(","),_=((R=T.match(/:(.*?);/))==null?void 0:R[1])||"application/octet-stream",G=atob(D),z=new Uint8Array(G.length);for(let q=0;q<G.length;q++)z[q]=G.charCodeAt(q);return new Blob([z],{type:_})}function N(P){const T=P.mappedFields,D={...m},_=[];return T.date.value&&T.date.confidence>=.65&&(D.date=T.date.value,_.push("date")),T.activityType.value&&T.activityType.confidence>=.7&&(D.activityType=T.activityType.value,_.push("activity")),T.description.value&&T.description.confidence>=.6&&!D.description.trim()&&(D.description=T.description.value,_.push("description")),x(_.length>0?{editMode:!0,editState:D,evidenceExtractionMessage:`Filled ${_.join(", ")} from uploaded evidence.`}:{evidenceExtractionMessage:"Scan complete. Please fill any missing details manually."}),_}async function k(P,T){if(!(P.length===0||f!=="pending")){x({isExtractingEvidence:!0,evidenceExtractionMessage:"Scanning evidence...",extractedFileSignature:T});try{const D=await Ry(P);N(D)}catch(D){console.error("Evidence extraction failed:",D),x({evidenceExtractionMessage:"We couldn't scan this evidence. You can still review and confirm manually."})}finally{x({isExtractingEvidence:!1})}}}h.useEffect(()=>{if(r||!n||n.length===0||f!=="pending")return;const P=n.map(_=>`${_.filename||"file"}:${_.mediaType}:${_.url.length}`).join("|"),T=o(e);if((T==null?void 0:T.extractedFileSignature)===P)return;const D=n.map((_,G)=>({blob:E(_.url),filename:_.filename||`evidence-${G+1}`}));k(D,P)},[n,f,e]);async function A(){x({status:"confirming"});try{const P=[...n??[],...g],T=await Ew({date:t.date,hours:t.hours,activityType:t.activityType,activityTypeLabel:t.activityTypeLabel,propertyId:t.propertyId,description:t.description,isMaterialParticipation:t.isMaterialParticipation??!0},P.length>0?P:void 0);x({status:"confirmed",locationTrackingEnabled:T.locationTrackingEnabled??!1}),V()}catch{x({status:"pending"})}}async function M(){x({isSaving:!0});try{const P=parseFloat(m.hours),T=m.propertyId!=="none"?parseInt(m.propertyId,10):null,D=[...n??[],...g],_=await Ew({date:m.date,hours:isNaN(P)?t.hours:P,activityType:m.activityType,activityTypeLabel:m.activityType,propertyId:T,description:m.description.trim()||void 0,isMaterialParticipation:m.isMaterialParticipation},D.length>0?D:void 0);x({editMode:!1,status:"confirmed",isSaving:!1,locationTrackingEnabled:_.locationTrackingEnabled??!1}),V()}catch{x({isSaving:!1})}}function L(){x({status:"cancelled"}),s()}function F(){x({editMode:!1,editState:c})}function V(){a.invalidateQueries({queryKey:["/api/time-entries"]}),a.invalidateQueries({queryKey:["/api/stats"]}),a.invalidateQueries({queryKey:["/api/stats/rep-progress"]}),a.invalidateQueries({queryKey:["/api/stats/rep-requirements"]})}function U(P,T){x({editState:{...m,[P]:T}})}return d?i.jsx(Je,{children:i.jsxs(rt,{className:"p-4 space-y-3 text-sm",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("p",{className:"font-medium text-sm",children:"Edit Activity"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Z,{size:"sm",variant:"outline",onClick:F,disabled:p,children:"Cancel"}),i.jsx(Z,{size:"sm",onClick:M,disabled:p||!m.date||!m.activityType||!m.hours,className:"bg-primary text-primary-foreground hover:bg-primary/90",children:p?i.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin"}):"Save"})]})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ge,{className:"text-xs text-muted-foreground",children:"(optional)"}),i.jsxs(ai,{value:m.propertyId,onValueChange:P=>U("propertyId",P),children:[i.jsx(ys,{className:"text-xs h-9",children:i.jsx(oi,{placeholder:"Select property..."})}),i.jsxs(vs,{children:[i.jsx(Kt,{value:"none",className:"text-xs",children:"No property"}),y.map(P=>i.jsx(Kt,{value:String(P.id),className:"text-xs",children:P.nickname??P.address??`Property ${P.id}`},P.id))]})]})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ge,{className:"text-xs text-muted-foreground",children:"Date"}),i.jsx(dt,{type:"date",value:m.date,onChange:P=>U("date",P.target.value),className:"h-9 text-xs"})]}),i.jsx(Hx,{value:m.hours,onChange:P=>U("hours",P),label:"Duration (hrs)",showQuickButtons:!1,showConversion:!1}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ge,{className:"text-xs text-muted-foreground",children:"Activity Type"}),i.jsx(Kx,{value:m.activityType,onValueChange:P=>U("activityType",P),placeholder:"Select or type activity type...",className:"text-xs"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx($l,{id:`edit-mp-${e}`,checked:m.isMaterialParticipation,onCheckedChange:P=>{U("isMaterialParticipation",P),P&&U("isQualifiedNonMaterial",!1)}}),i.jsx(Ge,{htmlFor:`edit-mp-${e}`,className:"text-xs font-normal",children:"Material Participation Activity"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx($l,{id:`edit-qnm-${e}`,checked:m.isQualifiedNonMaterial,onCheckedChange:P=>{U("isQualifiedNonMaterial",P),P&&U("isMaterialParticipation",!1)}}),i.jsx(Ge,{htmlFor:`edit-qnm-${e}`,className:"text-xs font-normal",children:"Qualified Non-Material Activity"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ge,{className:"text-xs text-muted-foreground",children:"Description"}),i.jsx(Hr,{value:m.description,onChange:P=>U("description",P.target.value),placeholder:"Describe your activity...",className:"text-xs min-h-[72px] resize-none"})]}),I>0&&i.jsxs("div",{className:"space-y-1",children:[i.jsxs(Ge,{className:"text-xs text-muted-foreground",children:[i.jsx(va,{className:"h-3 w-3 inline mr-1"}),I," file",I!==1?"s":""," from chat"]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:n.map((P,T)=>{const D=P.mediaType.startsWith("image/"),_=P.filename||`File ${T+1}`;return D?i.jsx("img",{src:P.url,alt:_,className:"h-12 w-12 rounded-md object-cover border"},T):i.jsxs("div",{className:"flex items-center gap-1.5 bg-muted rounded-md px-2 py-1 text-xs max-w-[140px]",children:[i.jsx($n,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate",children:_})]},T)})})]}),i.jsxs("div",{className:"space-y-1.5 border-t border-border/50 pt-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(Ge,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[i.jsx(va,{className:"h-3 w-3"}),"Attach Evidence",i.jsx("span",{className:"text-xs text-muted-foreground
542/70",children:"(optional)"})]}),i.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"h-6 px-2 text-xs gap-1",onClick:()=>{var P;return(P=v.current)==null?void 0:P.click()},disabled:p,children:[i.jsx(Pl,{className:"h-3 w-3"}),"Add"]})]}),(u==null?void 0:u.isExtractingEvidence)&&i.jsx("div",{className:"pt-1",children:i.jsx(wd,{title:"Extracting evidence details",label:"Rep Assistant evidence",description:"Reading the attachment to update the preview with a date, activity type, and description before you confirm."})}),!(u!=null&&u.isExtractingEvidence)&&(u==null?void 0:u.evidenceExtractionMessage)&&i.jsx("p",{className:"text-xs text-muted-foreground",children:u.evidenceExtractionMessage}),g.length>0&&i.jsx("div",{className:"space-y-1",children:g.map((P,T)=>{const D=P.mediaType.startsWith("image/"),_=P.filename||`File ${T+1}`;return i.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/60 rounded-md px-2 py-1 text-xs",children:[D?i.jsx(va,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):i.jsx($n,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate flex-1 max-w-[160px]",children:_}),i.jsx("button",{type:"button",onClick:()=>C(T),disabled:p,className:"shrink-0 text-muted-foreground hover:text-destructive transition-colors ml-auto","aria-label":`Remove ${_}`,children:i.jsx($t,{className:"h-3 w-3"})})]},T)})})]})]})}):i.jsx(Je,{className:f==="confirmed"?"border-green-500/50":f==="cancelled"?"opacity-50":"",children:i.jsxs(rt,{className:"p-4 space-y-2 text-sm",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("p",{className:"font-medium",children:"Time Entry Preview"}),f==="pending"&&i.jsx(Z,{size:"sm",variant:"ghost",onClick:()=>x({editMode:!0}),className:"h-7 w-7 p-0 text-muted-foreground hover:text-foreground","aria-label":"Edit entry",children:i.jsx(ug,{className:"h-3.5 w-3.5"})})]}),i.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs",children:[i.jsx("span",{className:"text-muted-foreground",children:"Date"}),i.jsx("span",{children:t.date}),i.jsx("span",{className:"text-muted-foreground",children:"Hours"}),i.jsx("span",{children:t.hours}),i.jsx("span",{className:"text-muted-foreground",children:"Activity"}),i.jsx("span",{children:t.activityTypeLabel}),t.propertyName&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground",children:"Property"}),i.jsxs("span",{children:[t.propertyName,t.propertyAddress?` — ${t.propertyAddress}`:""]})]}),t.description&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground",children:"Description"}),i.jsx("span",{children:t.description})]}),I>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground",children:"Evidence"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(va,{className:"h-3 w-3"}),I," file",I!==1?"s":""," attached"]})]})]}),I>0&&i.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:n.map((P,T)=>{const D=P.mediaType.startsWith("image/"),_=P.filename||`File ${T+1}`;return D?i.jsx("img",{src:P.url,alt:_,className:"h-14 w-14 rounded-md object-cover border"},T):i.jsxs("div",{className:"flex items-center gap-1.5 bg-muted rounded-md px-2 py-1 text-xs max-w-[140px]",children:[i.jsx($n,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate",children:_})]},T)})}),i.jsx("input",{ref:v,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.xls,.xlsx,.csv,.txt",className:"sr-only",onChange:P=>S(P.target.files)}),f==="pending"&&i.jsxs("div",{className:"space-y-2 pt-1 border-t border-border/50",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(va,{className:"h-3.5 w-3.5 text-muted-foreground"}),i.jsx("span",{className:"text-xs font-medium",children:"Attach Evidence"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),i.jsxs(Z,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs gap-1",onClick:()=>{var P;return(P=v.current)==null?void 0:P.click()},children:[i.jsx(Pl,{className:"h-3 w-3"}),"Add Files"]})]}),(u==null?void 0:u.isExtractingEvidence)&&i.jsx("div",{className:"pt-1",children:i.jsx(wd,{title:"Extracting evidence details",label:"Rep Assistant evidence",description:"Reading the attachment to update the preview with a date, activity type, and description before you confirm."})}),!(u!=null&&u.isExtractingEvidence)&&(u==null?void 0:u.evidenceExtractionMessage)&&i.jsx("p",{className:"text-xs text-muted-foreground",children:u.evidenceExtractionMessage}),g.length>0&&i.jsxs("div",{className:"space-y-1",children:[g.some(P=>P.mediaType.startsWith("image/"))&&i.jsx("div",{className:"flex flex-wrap gap-2",children:g.filter(P=>P.mediaType.startsWith("image/")).map((P,T)=>i.jsx("img",{src:P.url,alt:P.filename||`Image ${T+1}
542`,className:"h-14 w-14 rounded-md object-cover border"},T))}),g.map((P,T)=>{const D=P.mediaType.startsWith("image/"),_=P.filename||`File ${T+1}`;return i.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/60 rounded-md px-2 py-1 text-xs",children:[D?i.jsx(va,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):i.jsx($n,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate flex-1 max-w-[160px]",children:_}),i.jsx("button",{type:"button",onClick:()=>C(T),className:"shrink-0 text-muted-foreground hover:text-destructive transition-colors ml-auto","aria-label":`Remove ${_}`,children:i.jsx($t,{className:"h-3 w-3"})})]},T)})]})]}),f==="confirmed"&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-xs text-green-600 flex items-center gap-1",children:[i.jsx(ot,{className:"h-3 w-3"})," Entry created",I+g.length>0?" with evidence":""]}),Le()&&(u==null?void 0:u.locationTrackingEnabled)!==!0&&!(u!=null&&u.visitPromptDismissed)&&i.jsx(AK,{onEnabled:()=>x({locationTrackingEnabled:!0}),onDismiss:()=>x({visitPromptDismissed:!0})})]}),f==="pending"&&i.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[i.jsxs(Z,{size:"sm",onClick:A,className:"bg-green-600 hover:bg-green-700 text-white",children:[i.jsx(ot,{className:"h-3.5 w-3.5 mr-1"})," Confirm"]}),i.jsxs(Z,{size:"sm",variant:"ghost",onClick:L,className:"h-8 px-2 text-xs text-muted-foreground hover:text-foreground",children:[i.jsx($t,{className:"h-3.5 w-3.5 mr-1"})," Cancel"]})]}),f==="confirming"&&i.jsxs("div",{className:"flex items-center gap-2 pt-2 text-xs text-muted-foreground",children:[i.jsx(Xe,{className:"h-3 w-3 animate-spin"})," Creating entry",I+g.length>0?" & uploading evidence":"","..."]})]})})}function kp(e){return`[FORM_SUBMIT form_id="${e.formId}" selected_id="${e.selectedId}" selected_label="${e.selectedLabel}"]`}function jf(e){const t=JSON.stringify(e.answers);return`[QUESTIONNAIRE_SUBMIT questionnaire_id="${e.questionnaireId}" answers=${t}]`}function Uw(e){return`[REMEDIATION_SUBMIT finding_number="${e.findingNumber}" wizard_type="${e.wizardType}" result="${e.result}" reaudit_status="${e.reauditStatus??"unknown"}" entry_id="${e.entryId}"]`}function RK({toolCallId:e,schema:t,onSubmit:n}){const r=h.useId(),{getCardState:s,setCardState:a}=ga(),o=s(e),l=(o==null?void 0:o.query)??"",c=(o==null?void 0:o.selectedId)??null,u=(o==null?void 0:o.status)??"pending";function f(v){const b=s(e);a(e,{query:(b==null?void 0:b.query)??"",selectedId:(b==null?void 0:b.selectedId)??null,status:(b==null?void 0:b.status)??"pending",...v})}const d=t.options.length>8,m=l.trim()?t.options.filter(v=>{var b;return v.label.toLowerCase().includes(l.toLowerCase())||((b=v.description)==null?void 0:b.toLowerCase().includes(l.toLowerCase()))}):t.options,p=t.options.find(v=>v.id===c)??null;function g(){if(!p)return;const v={formId:t.formId,selectedId:p.id,selectedLabel:p.label};f({status:"submitted"}),n(kp(v))}function x(){f({status:"cancelled"}),n("Cancel that selection.")}function y(v){f({selectedId:v})}return u==="submitted"&&p?i.jsx(Je,{className:"border-green-500/50",children:i.jsxs(rt,{className:"p-3 flex items-center gap-2 text-sm",children:[i.jsx(ot,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),i.jsx("span",{className:"text-muted-foreground",children:t.title}),i.jsx("span",{className:"font-medium",children:p.label})]})}):u==="cancelled"?i.jsx(Je,{className:"opacity-50",children:i.jsx(rt,{className:"p-3 text-sm text-muted-foreground",children:"Selection cancelled."})}):i.jsx(Je,{className:"w-full shadow-sm",children:i.jsxs(rt,{className:"p-0",children:[i.jsxs("div",{className:"flex items-start justify-between px-4 pt-4 pb-3 border-b border-border/60",children:[i.jsxs("div",{className:"pr-4",children:[i.jsx("p",{className:"font-semibold text-sm leading-snug",children:t.title}),t.instruction&&i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t.instruction})]}),i.jsx("button",{type:"button","aria-label":"Cancel selection",onClick:x,className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors shrink-0",children:i.jsx($t,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"px-4 py-3 space-y-3",children:[d&&i.jsxs("div",{className:"relative",children:[i.jsx(Al,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}
542),i.jsx(dt,{id:r,value:l,onChange:v=>f({query:v.target.value}),placeholder:"Search…",className:"pl-8 h-8 text-sm","aria-label":"Search options"})]}),i.jsxs("ul",{role:"listbox","aria-label":t.title,className:"space-y-1 max-h-60 overflow-y-auto",children:[m.length===0&&i.jsx("li",{className:"text-xs text-muted-foreground py-2 text-center",children:"No matches"}),m.map((v,b)=>i.jsx(IK,{option:v,number:b+1,isSelected:c===v.id,onSelect:y},v.id))]})]}),i.jsx("div",{className:"flex justify-end px-4 pb-4 pt-1",children:i.jsxs(Z,{size:"sm",disabled:!c,onClick:g,className:"bg-primary hover:bg-primary/90 text-primary-foreground",children:[i.jsx(ot,{className:"h-3.5 w-3.5 mr-1"}),"Select"]})})]})})}function IK({option:e,number:t,isSelected:n,onSelect:r}){return i.jsxs("li",{role:"option","aria-selected":n,tabIndex:0,onClick:()=>r(e.id),onKeyDown:s=>(s.key==="Enter"||s.key===" ")&&r(e.id),className:W("flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm cursor-pointer select-none transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",n?"bg-muted/80 text-foreground":"hover:bg-muted/50 text-foreground"),children:[i.jsx("span",{className:W("shrink-0 h-6 w-6 rounded-full flex items-center justify-center text-xs font-medium transition-colors",n?"bg-foreground text-background":"bg-muted-foreground/15 text-muted-foreground"),"aria-hidden":!0,children:t}),i.jsxs("span",{className:"flex flex-col min-w-0 flex-1",children:[i.jsx("span",{className:"font-medium leading-snug",children:e.label}),e.description&&i.jsx("span",{className:"text-xs text-muted-foreground leading-snug",children:e.description})]}),n&&i.jsx(Bn,{className:"h-4 w-4 text-muted-foreground shrink-0","aria-hidden":!0})]})}function MK({toolCallId:e,schema:t,onSubmit:n}){var V,U;const{toast:r}=Ht(),{getCardState:s,setCardState:a}=ga(),o=s(e),l=(o==null?void 0:o.answers)??{},c=(o==null?void 0:o.stepIndex)??0,u=(o==null?void 0:o.status)??"pending",f=(o==null?void 0:o.numberInput)??"",d=(o==null?void 0:o.textInput)??"",m=(o==null?void 0:o.dateInput)??"",p=(o==null?void 0:o.multiTextInputs)??{};function g(P){const T=s(e);
542a(e,{answers:(T==null?void 0:T.answers)??{},stepIndex:(T==null?void 0:T.stepIndex)??0,status:(T==null?void 0:T.status)??"pending",numberInput:(T==null?void 0:T.numberInput)??"",textInput:(T==null?void 0:T.textInput)??"",dateInput:(T==null?void 0:T.dateInput)??"",multiTextInputs:(T==null?void 0:T.multiTextInputs)??{},...P})}const x=DK(t.steps,l),y=x[c]??null,v=(y==null?void 0:y.type)==="select"&&y.field==="propertyId"&&(((V=y.options)==null?void 0:V.length)??0)===0,{data:b=[],isLoading:w}=it({queryKey:["/api/properties"],enabled:v,staleTime:1e3*60*5,queryFn:async()=>{const P=await fetch("/api/properties",{credentials:"include"});if(!P.ok)throw new Error("Failed to fetch properties");return P.json()}}),j=b.map(P=>({id:String(P.id),label:P.nickname??P.address??`Property ${P.id}`,description:[P.address,P.city,P.state].filter(Boolean).join(", ")})),S=x.length,C=c===S-1,I=c===0;h.useEffect(()=>{if(!y)return;const P=l[y.field];if(y.type==="number")g({numberInput:P!==void 0?String(P):""});else if(y.type==="text")g({textInput:P!==void 0?String(P):""});else if(y.type==="date")g({dateInput:P!==void 0?String(P):""});else if(y.type==="multi-text"&&y.fields){const T={};for(const D of y.fields){const _=l[D.key];T[D.key]=_!==void 0?String(_):""}g({multiTextInputs:T})}},[c]);function E(P){if(!y)return;const T={...l,[y.field]:P};g({answers:T}),C||g({stepIndex:c+1})}function N(){if(y){if(y.type==="number"){const P=parseFloat(f);if(!f||isNaN(P))return;const T=y.min??.25,D=y.max??9999;if(P<T||P>D)return;const _={...l,[y.field]:P};
542if(g({answers:_,numberInput:""}),C){A(_);return}}else if(y.type==="text"){const P=d.trim();if(!P)return;const T={...l,[y.field]:P};if(g({answers:T,textInput:""}),C){A(T);return}}else if(y.type==="date"){const P=m.trim();if(!P)return;const T={...l,[y.field]:P};if(g({answers:T,dateInput:""}),C){A(T);return}}else if(y.type==="multi-text"&&y.fields){if(!y.fields.every(D=>(p[D.key]??"").trim().length>0))return;const T={...l};for(const D of y.fields)T[D.key]=p[D.key].trim();if(g({answers:T,multiTextInputs:{}}),C){A(T);return}}else{if(!l[y.field])return;if(C){A(l);return}}g({stepIndex:c+1})}}function k(){I||g({stepIndex:c-1})}function A(P){g({status:"submitted"}),t.questionnaireId==="taxProfile"&&Ty(P).catch(T=>{console.error("[QuestionnaireCard] Failed to persist tax profile:",T),r({title:"Could not save profile",description:"Your answers were submitted but could not be saved. Please try again.",variant:"destructive"})}),n(jf({questionnaireId:t.questionnaireId,answers:P}))}function M(){g({status:"cancelled"}),n("Cancel that questionnaire.")}if(u==="submitted")return i.jsx(Je,{className:"border-green-500/50",children:i.jsxs(rt,{className:"p-3 flex items-center gap-2 text-sm",children:[i.jsx(ot,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),i.jsxs("span",{className:"font-medium",children:[t.title," — completed"]})]})});if(u==="cancelled")return i.jsx(Je,{className:"opacity-50",children:i.jsx(rt,{className:"p-3 text-sm text-muted-foreground",children:"Questionnaire cancelled."})});if(!y)return null;
542const L=y.type==="select"?l[y.field]??null:null,F=y.type==="number"?OK(f,y.min,y.max):y.type==="text"?d.trim().length>0:y.type==="date"?m.trim().length>0:y.type==="multi-text"?(y.fields??[]).every(P=>(p[P.key]??"").trim().length>0):L!==null;return i.jsx(Je,{className:"w-full shadow-sm",children:i.jsxs(rt,{className:"p-0",children:[i.jsxs("div",{className:"flex items-start justify-between px-4 pt-4 pb-3 border-b border-border/60",children:[i.jsx("p",{className:"font-semibold text-sm leading-snug pr-4",children:t.title}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i.jsx("button",{type:"button","aria-label":"Previous question",disabled:I,onClick:k,className:W("h-6 w-6 flex items-center justify-center rounded transition-colors",I?"text-muted-foreground/30 cursor-not-allowed":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:i.jsx(aa,{className:"h-4 w-4"})}),i.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums min-w-[40px] text-center",children:[c+1," of ",S]}),i.jsx("button",{type:"button","aria-label":"Next question",disabled:!F,onClick:F?N:void 0,className:W("h-6 w-6 flex items-center justify-center rounded transition-colors",F?"text-muted-foreground hover:text-foreground hover:bg-muted/50":"text-muted-foreground/30 cursor-not-allowed"),children:i.jsx(Bn,{className:"h-4 w-4"})}),i.jsx("span",{className:"mx-1 h-4 w-px bg-border/60","aria-hidden":!0}),i.jsx("button",{type:"button","aria-label":"Cancel questionnaire",onClick:M,className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",children:i.jsx($t,{className:"h-4 w-4"})})]})]}),i.jsxs("div",{className:"px-4 py-4 space-y-3",children:[t.instruction&&c===0&&i.jsx("p",{className:"text-xs text-muted-foreground -mt-1",children:t.instruction}),i.jsx("p",{className:"text-sm font-medium",children:y.question}),y.type==="select"&&y.options?i.jsx(LK,{options:y.options,selectedId:L,onSelect:E,allowCustomOption:y.field==="activityType",fallbackOptions:y.field==="propertyId"?j:void 0,isLoadingOptions:y.field==="propertyId"&&w},y.field):y.type==="text"?i.jsx($K,{value:d,onChange:P=>g({textInput:P}),placeholder:y.placeholder,onEnter:F?N:void 0}):y.type==="date"?i.jsx(zK,{value:m,onChange:P=>g({dateInput:P}),onEnter:F?N:void 0}):y.type==="multi-text"&&y.fields?i.jsx(UK,{fields:y.fields,values:p,onChange:(P,T)=>g({multiTextInputs:{...p,[P]:T}}),onEnter:F?N:void 0}):i.jsx(VK,{value:f,onChange:P=>g({numberInput:P}),min:y.min,max:y.max,onEnter:F?N:void 0})]}),(y.type!=="select"||C)&&i.jsxs("div",{className:"flex items-center justify-between px-4 pb-4 pt-1",children:[i.jsx("div",{className:"flex items-center gap-2",children:y.type==="text"&&!((U=y.placeholder)!=null&&U.includes("required"))&&i.jsxs("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>{const P={...l};C?A(P):g({stepIndex:c+1})},children:[i.jsx(ug,{className:"h-3 w-3"}),"Skip"]})}),i.jsx(Z,{size:"sm",disabled:!F,onClick:N,className:"bg-primary hover:bg-primary/90 text-primary-foreground",children:C?i.jsxs(i.Fragment,{children:[i.jsx(ot,{className:"h-3.5 w-3.5 mr-1"}),"Finish"]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Bn,{className:"h-3.5 w-3.5 ml-1"})]})})]})]})})}function DK(e,t){return e.filter(n=>{if(!n.condition)return!0;const r=t[n.condition.field];return r!==void 0&&n.condition.values.includes(String(r))})}function OK(e,t,n){if(!e.trim())return!1;const r=parseFloat(e);return!(isNaN(r)||r<(t??.25)||n!==void 0&&r>n)}function LK({options:e,selectedId:t,onSelect:n,allowCustomOption:r=!1,fallbackOptions:s,isLoadingOptions:a=!1}){const[o,l]=h.useState(""),c=e.length>0?e:s&&s.length>0?s:r?Js.map(x=>({id:x.value,label:x.label,description:x.duration})):e,u=o.trim().toLowerCase(),f=u?c.filter(x=>{var w;const y=x.label.toLowerCase(),v=((w=x.description)==null?void 0:w.toLowerCase())??"",b=x.id.toLowerCase();return y.includes(u)||v.includes(u)||b.includes(u)}):c,d=c.length>8||r,m=c.some(x=>{const y=x.label.toLowerCase(),v=x.id.toLowerCase();return y===u||v===u}),p=FK(o),g=r&&o.trim().length>0&&!m&&p.length>0;return i.jsxs("div",{className:"space-y-2",children:[d&&i.jsxs("div",{className:"relative",children:[i.jsx(Al,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),i.jsx(dt,{value:o,onChange:x=>l(x.target.value),placeholder:r?"Search or type a custom activity...":"Search options...",className:"pl-8 h-8 text-sm","aria-label":"Search options"})]}),i.jsxs("ul",{role:"listbox",className:"space-y-1 max-h-60 overflow-y-auto",children:[f.length===0&&!g&&i.jsx("li",{className:"text-xs text-muted-foreground py-2 text-center",children:a?"Loading options...":"No matches found"}),f.map((x,y)=>i.jsx(Bw,{option:x,number:y+1,isSelected:t===x.id,onSelect:n},x.id)),g&&i.jsx(Bw,{option:{id:p,label:`Use "${o.trim()}"`,description:"Custom activity type"},number:f.length+1,isSelected:t===p,onSelect:n})]})]})}function FK(e){return e.trim().toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}function Bw({option:e,number:t,isSelected:n,onSelect:r}){return i.jsxs("li",{role:"option","aria-selected":n,tabIndex:0,onClick:()=>r(e.id),onKeyDown:s=>(s.key==="Enter"||s.key===" ")&&r(e.id),className:W("flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm cursor-pointer select-none transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",n?"bg-muted/80 text-foreground":"hover:bg-muted/50 text-foreground"),children:[i.jsx("span",{className:W("shrink-0 h-6 w-6 rounded-full flex items-center justify-center text-xs font-medium transition-colors",n?"bg-foreground text-background":"bg-muted-foreground
542/15 text-muted-foreground"),"aria-hidden":!0,children:t}),i.jsxs("span",{className:"flex flex-col min-w-0 flex-1",children:[i.jsx("span",{className:"font-medium leading-snug",children:e.label}),e.description&&i.jsx("span",{className:"text-xs text-muted-foreground leading-snug",children:e.description})]}),n&&i.jsx(Bn,{className:"h-4 w-4 text-muted-foreground shrink-0","aria-hidden":!0})]})}function VK({value:e,onChange:t,min:n,max:r,onEnter:s}){return i.jsx(dt,{type:"number",value:e,onChange:a=>t(a.target.value),onKeyDown:a=>a.key==="Enter"&&(s==null?void 0:s()),min:n,max:r,placeholder:n!==void 0&&r!==void 0?`${n}–${r}`:n!==void 0?`Min ${n}`:"Enter a number",className:"h-9 text-sm w-36","aria-label":"Numeric input",autoFocus:!0})}function $K({value:e,onChange:t,placeholder:n,onEnter:r}){const s=h.useRef(null);return h.useEffect(()=>{const a=setTimeout(()=>{var o;return(o=s.current)==null?void 0:o.focus()},50);return()=>clearTimeout(a)},[]),i.jsx(dt,{ref:s,type:"text",value:e,onChange:a=>t(a.target.value),onKeyDown:a=>a.key==="Enter"&&(r==null?void 0:r()),placeholder:n??"Type your answer…",className:"h-9 text-sm","aria-label":"Text input"})}function zK({value:e,onChange:t,onEnter:n}){const r=h.useRef(null);return h.useEffect(()=>{const s=setTimeout(()=>{var a;return(a=r.current)==null?void 0:a.focus()},50);return()=>clearTimeout(s)},[]),i.jsx(dt,{ref:r,type:"date",value:e,onChange:s=>t(s.target.value),onKeyDown:s=>s.key==="Enter"&&(n==null?void 0:n()),className:"h-9 text-sm w-48","aria-label":"Date input"})}function UK({fields:e,values:t,onChange:n,onEnter:r}){const s=h.useRef(null);return h.useEffect(()=>{const a=setTimeout(()=>{var o;return(o=s.current)==null?void 0:o.focus()},50);return()=>clearTimeout(a)},[]),i.jsx("div",{className:"space-y-2.5",children:e.map((a,o)=>i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:a.label}),i.jsx(dt,{ref:o===0?s:void 0,type:"text",value:t[a.key]??"",onChange:l=>n(a.key,l.target.value),onKeyDown:l=>{l.key==="Enter"&&o===e.length-1&&(r==null||r())},placeholder:a.placeholder??"",className:"h-9 text-sm","aria-label":a.label})]},a.key))})}const Zc=["/api/advisor/audit/drafts"],BK=["/api/advisor/audit/latest"];function HK(){const e=wt(),{toast:t}=Ht(),{data:n,isLoading:r}=it({queryKey:Zc,queryFn:async()=>(await NG()).drafts}),s=Dt({mutationFn:wG,onSuccess:()=>{e.invalidateQueries({queryKey:Zc})},onError:()=>{t({title:"Failed to create draft",variant:"destructive"})}}),a=Dt({mutationFn:kG,onSuccess:c=>{e.invalidateQueries({queryKey:Zc}),e.invalidateQueries({queryKey:BK});const u=c.reauditStatus==="fixed"?"Finding resolved!":c.reauditStatus==="still-flagged"?"Applied, but finding still active. Additional changes may be needed.":"Changes applied. Run a fresh audit to see updated results.";t({title:u})},onError:()=>{t({title:"Failed to apply draft",variant:"destructive"})}}),o=Dt({mutationFn:SG,onSuccess:()=>{e.invalidateQueries({queryKey:Zc}),t({title:"Draft discarded"})},onError:()=>{t({title:"Failed to discard draft",variant:"destructive"})}});async function l(c){try{const f=(await s.mutateAsync(c)).draft.id;return await a.mutateAsync(f)}catch{return}}return{drafts:n??[],isLoading:r,createAndApply:l,create:c=>s.mutate(c),apply:c=>a.mutate(c),discard:c=>o.mutate(c),isCreating:s.isPending,isApplying:a.isPending,isCreatingAndApplying:s.isPending||a.isPending,isDiscarding:o.isPending,lastApplyResult:a.data??null}}function WK(e){return e==="CRITICAL"?"border-transparent bg-red-100 text-red-800 dark:bg-red-900/20 dark:text-red-400":e==="WARNING"?"border-transparent bg-amber-100 text-amber-800 dark:bg-amber-900/20 dark:text-amber-400":"border-transparent bg-blue-100 text-blue-800 dark:bg-blue-900/20 dark:text-blue-400"}function qK(e){return e==="CRITICAL"?"Critical":e==="WARNING"?"Warning":"Info"}const GK={"approving-new-tenants":"Approving new tenants","reviewing-tenant-applications":"Reviewing tenant applications","responding-to-tenant-inquiries":"Responding to tenant inquiries","handling-tenant-complaints":"Handling tenant complaints","handling-tenant-evictions":"Handling tenant evictions","conducting-tenant-move-in-inspections":"Conducting tenant move-in inspections","conducting-tenant-move-out-inspections":"Conducting tenant move-out inspections","performing-routine-maintenance":"Performing routine maintenance","overseeing-major-repairs":"Over
542seeing major repairs","inspecting-properties-for-maintenance-needs":"Inspecting properties for maintenance needs","arranging-contractors-for-repairs":"Arranging contractors for repairs","collecting-rent-payments":"Collecting rent payments","preparing-financial-statements":"Preparing financial statements","reviewing-property-budgets":"Reviewing property budgets","property-visits-for-inspections":"Property visits for inspections","tenant-communication-phone-calls":"Tenant communication phone calls","tenant-communication-emails":"Tenant communication emails","marketing-vacant-properties":"Marketing vacant properties","showing-properties-to-prospects":"Showing properties to prospects","real-estate-education-seminars":"Real estate education seminars","rental-property-research":"Rental property research","tenant-screening-background-checks":"Tenant screening background checks","property-management-software-updates":"Property management software updates","insurance-claim-processing":"Insurance claim processing","legal-consultation-meetings":"Legal consultation meetings","tax-preparation-property-related":"Tax preparation property related","property-acquisition-analysis":"Property acquisition analysis","rental-market-analysis":"Rental market analysis","property-photography-listing":"Property photography listing","lease-agreement-preparation":"Lease agreement preparation"},YK=Object.entries(GK).map(([e,t])=>({slug:e,label:t}));function KK({toolCallId:e,schema:t,onSubmit:n}){const{getCardState:r,setCardState:s}=ga(),{createAndApply:a,isCreatingAndApplying:o}=HK(),l=r(e),c=(l==null?void 0:l.status)??"pending",u=(l==null?void 0:l.errorMessage)??null,f=(l==null?void 0:l.reauditStatus)??void 0,d=(l==null?void 0:l.panelData)??{},m=(l==null?void 0:l.panelValid)??!1;function p(b){const w=r(e);s(e,{status:(w==null?void 0:w.status)??"pending",errorMessage:(w==null?void 0:w.errorMessage)??null,reauditStatus:(w==null?void 0:w.reauditStatus)??void 0,panelData:(w==null?void 0:w.panelData)??{},panelValid:(w==null?void 0:w.panelValid)??!1,...b})}async function g(){if(!m)return;p({status:"submitting",errorMessage:null});const b=await a({findingNumber:t.findingNumber,entryId:t.entryId,draftType:t.wizardType,proposedChanges:d,auditTraceId:t.auditTraceId}),w={findingNumber:t.findingNumber,wizardType:t.wizardType,entryId:t.entryId,result:b?"applied":"failed",reauditStatus:b==null?void 0:b.reauditStatus};b?(p({reauditStatus:b.reauditStatus,status:"submitted"}),n(Uw(w))):p({status:"failed",errorMessage:"The fix could not be applied. Please try again."})}function x(){p({status:"cancelled"}),n(Uw({findingNumber:t.findingNumber,wizardType:t.wizardType,entryId:t.entryId,result:"cancelled"}))}function y(){p({status:"pending",errorMessage:null})}if(c==="submitted"){const b=f==="fixed"?"Finding resolved":f==="still-flagged"?"Applied — finding still active":"Applied";return i.jsx(Je,{className:"border-green-500/50",children:i.jsxs(rt,{className:"p-3 flex items-center gap-2 text-sm",children:[i.jsx(ot,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),i.jsxs("span",{className:"font-medium",children:["Finding #",t.findingNumber," — ",b]})]})})}if(c==="cancelled")return i.jsx(Je,{className:"opacity-50",children:i.jsx(rt,{className:"p-3 text-sm text-muted-foreground",children:"Remediation cancelled."})});const v=c==="submitting"||o;return i.jsx(Je,{className:W("w-full shadow-sm",c==="failed"&&"border-red-500/50"),children:i.jsxs(rt,{className:"p-0",children:[i.jsxs("div",{className:"flex items-start justify-between px-4 pt-4 pb-3 border-b border-border/60",children:[i.jsxs("div",{className:"flex flex-col gap-1.5 pr-4 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx(Mr,{variant:"outline",className:W("text-[10px] font-semibold px-1.5 py-0",WK(t.severity)),children:qK(t.severity)}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["Finding #",t.findingNumber]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:t.entryDate}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.entryHours,"h"]}),t.propertyName&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:t.propertyName})]})]}),i.jsx("p",{className:"text-sm font-semibold leading-snug",children:t.violationSummary}),i.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:t.recommendation})]}),i.jsx("button",{type:"button","aria-label":"Cancel remediation",onClick:x,disabled:v,className:"h-6 w-6 shrink-0 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:i.jsx($t,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"px-4 py-4",children:[t.wizardType==="enhance_description"&&i.jsx(QK,{currentDescription:t.currentDescription??null,onChange:(b,w)=>{p({panelData:b,panelValid:w})}}),t.wizardType==="adjust_duration"&&i.jsx(ZK,{currentHours:t.entryHours,onChange:(b,w)=>{p({panelData:b,panelValid:w})}}),t.wizardType==="reclassify_activity"&&i.jsx(XK,{currentActivityType:t.activityType,currentActivityTypeLabel:t.activityTypeLabel,onChange:(b,w)=>{p({panelData:b,panelValid:w})}}),t.wizardType==="add_evidence"&&i.jsx(JK,{entryId:t.entryId,onChange:(b,w)=>{p({panelData:b,panelValid:w})}}),c==="failed"&&u&&i.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-red-600 dark:text-red-400",children:[i.jsx(ms,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:u})]})]}),i.jsxs("div",{className:"flex items-center justify-between px-4 pb-4 pt-1",children:[i.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:x,disabled:v,className:"text-muted-foreground hover:text-foreground",children:"Cancel"}),i.jsxs("div",{className:"flex items-center gap-2",children:[c==="failed"&&i.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:y,className:"gap-1.5",children:[i.jsx(NS,{className:"h-3.5 w-3.5"}),"Retry"]}),i.jsx(Z,{type:"button",size:"sm",disabled:!m||v,onClick:g,className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1.5",children:v?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin"}),"Applying..."]}):i.jsxs(i.Fragment,{children:[i.jsx(ot,{className:"h-3.5 w-3.5"}),"Apply Fix"]})})]})]})]})})}function QK({currentDescription:e,onChange:t}){const[n,r]=h.useState(""),[s,a]=h.useState("append");function o(l,c){const u=l.trim().length>0;t({newDescription:l,mode:c},u)}return i.jsxs("div",{className:"space-y-3",children:[e&&i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ge,{className:"text-xs text-muted-foreground",children:"Current description"}),i.jsx("p",{className:"text-xs bg-muted/50 rounded-md px-3 py-2 text-foreground leading-relaxed",children:e})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:"new-description",className:"text-sm font-medium",children:s==="append"?"Additional detail to add":"New description"}),i.jsx(Hr,{id:"new-description",value:n,onChange:l=>{r(l.target.value),o(l.target.value,s)},placeholder:"Describe the activity with specifics: what you did, which property, outcome...",className:"text-sm min-h-[80px] resize-none",autoFocus:!0})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Mode:"}),i.jsx("button",{type:"button",onClick:()=>{a("append"),o(n,"append")},className:W("text-xs px-2.5 py-1 rounded-full border transition-colors",s==="append"?"bg-primary/10 border-primary/30 text-primary font-medium":"border-border text-muted-foreground hover:text-foreground"),children:"Append"}),i.jsx("button",{type:"button",onClick:()=>{a("replace"),o(n,"replace")},className:W("text-xs px-2.5 py-1 rounded-full border transition-colors",s==="replace"?"bg-primary/10 border-primary/30 text-primary font-medium":"border-border text-muted-foreground hover:text-foreground"),children:"Replace"})]})]})}function ZK({currentHours:e,onChange:t}){const[n,r]=h.useState(String(e)),[s,a]=h.useState("");function o(u,f){const d=parseFloat(u),m=!isNaN(d)&&d>0&&d<=24&&d!==e&&f.trim().length>0;isNaN(d)?t({newHours:e,justification:f},!1):t({newHours:d,justification:f},m)}const l=parseFloat(n),c=n!==""&&!isNaN(l)&&l===e?"New duration must differ from the current hours.":null;return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Current:"}),i.jsxs("span",{className:"font-semibold text-base",children:[e,"h"]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:"new-hours",className:"text-sm font-medium",children:"Corrected hours"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("input",{id:"new-hours",type:"number",min:.25,max:24,step:.25,value:n,onChange:u=>{r(u.target.value),o(u.target.value,s)},className:"w-24 h-9 rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",autoFocus:!0}),i.jsx("input",{type:"range",min:.25,max:24,step:.25,value:isNaN(l)?e:l,onCh
542ange:u=>{r(u.target.value),o(u.target.value,s)},className:"flex-1 accent-primary","aria-label":"Duration slider"})]}),c&&i.jsx("p",{className:"text-xs text-red-600 dark:text-red-400",children:c})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs(Ge,{htmlFor:"duration-justification",className:"text-sm font-medium",children:["Justification ",i.jsx("span",{className:"text-muted-foreground font-normal",children:"(required)"})]}),i.jsx(Hr,{id:"duration-justification",value:s,onChange:u=>{a(u.target.value),o(n,u.target.value)},placeholder:"Explain why the duration is being adjusted (e.g. original entry included travel time)...",className:"text-sm min-h-[72px] resize-none"})]})]})}function XK({currentActivityType:e,currentActivityTypeLabel:t,onChange:n}){const[r,s]=h.useState(""),[a,o]=h.useState(""),l=YK.filter(u=>u.slug!==e);function c(u,f){const d=u.length>0&&u!==e&&f.trim().length>0;n({newActivityType:u,justification:f},d)}return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Current:"}),i.jsx("span",{className:"font-medium",children:t})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:"new-activity-type",className:"text-sm font-medium",children:"New activity type"}),i.jsxs(ai,{value:r,onValueChange:u=>{s(u),c(u,a)},children:[i.jsx(ys,{id:"new-activity-type",className:"text-sm h-9",children:i.jsx(oi,{placeholder:"Select a new activity type..."})}),i.jsx(vs,{children:l.map(u=>i.jsx(Kt,{value:u.slug,className:"text-sm",children:u.label},u.slug))})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs(Ge,{htmlFor:"reclassify-justification",className:"text-sm font-medium",children:["Justification ",i.jsx("span",{className:"text-muted-foreground font-normal",children:"(required)"})]}),i.jsx(Hr,{id:"reclassify-justification",value:a,onChange:u=>{o(u.target.value),c(r,u.target.value)},placeholder:"Explain why this activity was misclassified and what it actually represents...",className:"text-sm min-h-[72px] resize-none"})]})]})}function JK({entryId:e,onChange:t}){const[n,r]=h.useState([]),[s,a]=h.useState(""),o=h.useRef(null);function l(d,m){t({evidenceFileIds:[],note:m,uploadedFiles:d},d.length>0)}function c(d){const m=Array.from(d.target.files??[]);if(m.length>0){const p=[...n,...m];r(p),l(p,s)}o.current&&(o.current.value="")}function u(d){const m=n.filter((p,g)=>g!==d);r(m),l(m,s)}function f(d){a(d),l(n,d)}return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx(Ge,{className:"text-xs font-medium text-muted-foreground",children:"Upload evidence files"}),i.jsx("input",{ref:o,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.xls,.xlsx,.csv,.txt,.eml",className:"hidden",onChange:c}),i.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"w-full mt-1.5",onClick:()=>{var d;return(d=o.current)==null?void 0:d.click()},children:[i.jsx(Pl,{className:"h-4 w-4 mr-2"}),"Choose Files"]}),n.length>0&&i.jsx("div",{className:"space-y-1 mt-2 border rounded-md p-2",children:n.map((d,m)=>i.jsxs("div",{className:"flex items-center gap-2 text-xs p-1",children:[i.jsx(CD,{className:"h-3 w-3 text-muted-foreground shrink-0"}),i.jsx("span",{className:"truncate flex-1",children:d.name}),i.jsx("button",{type:"button",className:"text-muted-foreground hover:text-destructive text-xs",onClick:()=>u(m),children:"Remove"})]},m))})]}),i.jsxs("div",{children:[i.jsx(Ge,{className:"text-xs font-medium text-muted-foreground",children:"Note (optional)"}),i.jsx(Hr,{placeholder:"Describe how this evidence supports the activity...",value:s,onChange:d=>f(d.target.value),rows:2,className:"mt-1 text-sm"})]})]})}const eQ={logTime:{heading:"Time Entry Logged",summary:"Your time entry has been recorded."},addProperty:{heading:"Property Added",summary:"The new property has been added to your account."},taxProfile:{heading:"Tax Profile Updated",summary:"Your tax profile has been saved."}};function tQ({questionnaireId:e}){const t=eQ[e]??{heading:"Form Submitted",summary:"Your information has been recorded."};return i.jsx(Je,{className:"border-green-500/50 shadow-sm mt-1",children:i.jsxs(rt,{className:"p-2.5 flex items-start gap-2",children:[i.jsx("div",{className:"mt-0.5 shrink-0",children:i.jsx(ot,{className:"h-3.5 w-3.5 text-green-600"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-semibold",children:t.heading}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t.summary})]})]})})}async function nQ(){const e=await fetch("/api/activity-types");if(!e.ok)throw new Error("Failed to fetch custom activity types");return e.json()}function rQ(){const e=wt(),{data:t=[],isLoading:n,refetch:r}=it({queryKey:["custom-activity-types"],queryFn:nQ,staleTime:0,refetchOnWindowFocus:!1,refetchOnMount:!0});async function s(a){const o=a.trim().toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-");if(!(await fetch("/api/activity-types",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({activityType:o})})).ok)throw new Error("Failed to create custom activity type");
542return await e.invalidateQueries({queryKey:["custom-activity-types"],refetchType:"all"}),o}return{customTypes:t,isLoading:n,refetch:r,createCustomType:s}}const Ph={zero:0,a:1,an:1,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fifty:50,sixty:60,half:.5,quarter:.25};function sQ(e){let t=e.toLowerCase().trim();return t=t.replace(/\bhalf\s+(?:an?\s+)?hour\b/g,"0.5 hours"),t=t.replace(/\bquarter\s+(?:of\s+an?\s+)?hour\b/g,"0.25 hours"),t=t.replace(/\b(twenty|thirty|forty|fifty|sixty)\s+(one|two|three|four|five|six|seven|eight|nine)\b/g,(n,r,s)=>{const a=Ph[r]??0,o=Ph[s]??0;return String(a+o)}),t=t.replace(/\b(zero|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty|sixty|half|quarter)\b/g,n=>{const r=Ph[n];return r!==void 0?String(r):n}),t}function Aa(e){return isNaN(e)||e<.0167||e>24?null:e}function Hw(e){return e.match(/^\s*\.?(\d+\.?\d*|\.\d+)\s*$/)?Aa(parseFloat(e.trim())):null}function Ww(e){const t=/^\s*(\d*\.\d+)\s*h(?:r|rs|our|ours)?\s*$/i,n=e.match(t);if(n)return Aa(parseFloat(n[1]));const r=/^\s*(\d+(?:\.\d+)?)\s*h(?:r|rs|our|ours)?\s*(?:and\s+)?(\d+(?:\.\d+)?)?\s*m(?:in|ins|inute|inutes)?\s*$/i,s=e.match(r);if(s){const d=parseFloat(s[1]),m=s[2]!==void 0?parseFloat(s[2]):0;return Aa(d+m/60)}const a=/^\s*(\d+(?:\.\d+)?)\s*h(?:r|rs|our|ours)?\s*$/i,o=e.match(a);if(o)return Aa(parseFloat(o[1]));const l=/^\s*(\d+(?:\.\d+)?)\s*m(?:in|ins|inute|inutes)?\s*$/i,c=e.match(l);if(c)return Aa(parseFloat(c[1])/60);const u=/^\s*(\d+(?:\.\d+)?)\s*h(?:r|rs|our|ours)?\s+(\d+(?:\.\d+)?)\s*$/i,f=e.match(u);if(f){const d=parseFloat(f[1]),m=parseFloat(f[2]);return Aa(d+m/60)}return null}function Sp(e){if(!e||e.trim()==="")return null;const t=e.trim(),n=Hw(t);if(n!==null)return n;const r=Ww(t);if(r!==null)return r;const s=sQ(t);if(s!==t){const a=Hw(s);if(a!==null)return a;const o=Ww(s);if(o!==null)return o}return null}const ja=[{key:"basic",label:"Basic Info",icon:yS},{key:"activity",label:"Activity",icon:AD},{key:"property",label:"Property",icon:ia},{key:"details",label:"Details",icon:$n}];function iQ(e,t){if(e==="basic"){const r=Sp(t.hours.trim())!==null;return t.date.trim()!==""&&r}return e==="activity"?t.activityType!=="":e==="property"?!0:e==="details"?t.description.trim()!=="":!0}function aQ(e){return e.trim().toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-")}function qw({label:e,options:t,selectedId:n,onSelect:r,isLoading:s=!1,placeholder:a="Search…",allowCustomCreate:o=!1,onCreateCustom:l,isCreating:c=!1}){const[u,f]=h.useState(""),d=u.trim()?t.filter(g=>{var x;return g.label.toLowerCase().includes(u.toLowerCase())||(((x=g.description)==null?void 0:x.toLowerCase().includes(u.toLowerCase()))??!1)}):t,m=t.some(g=>g.label.toLowerCase()===u.toLowerCase()||g.id.toLowerCase()===u.toLowerCase()),p=o&&u.trim()&&!m&&l;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{className:"text-xs font-medium text-foreground/80",children:e}),s?i.jsxs("div",{className:"flex items-center gap-2 h-9 text-xs text-muted-foreground",children:[i.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin"}),"Loading…"]}):i.jsxs("div",{className:"space-y-1.5",children:[t.length>6&&i.jsx(dt,{value:u,onChange:g=>f(g.target.value),placeholder:a,className:"h-8 text-xs"}),i.jsxs("div",{className:"max-h-44 overflow-y-auto space-y-0.5 rounded-md border border-border/50 p-1",children:[d.length===0&&!p&&i.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:"No matches"}),d.map(g=>i.jsxs("button",{type:"button",onClick:()=>r(g.id),className:W("w-full text-left px-2.5 py-1.5 rounded text-xs transition-colors",n===g.id?"bg-primary/10 text-primary font-medium":"hover:bg-muted/60 text-foreground"),children:[i.jsx("span",{className:"block font-medium leading-snug",children:g.label}),g.description&&i.jsx("span",{className:"text-muted-foreground text-[10px] leading-snug",children:g.description})]},g.id)),p&&i.jsx("button",{type:"button",onClick:()=>
542l(u.trim()),disabled:c,className:W("w-full text-left px-2.5 py-1.5 rounded text-xs transition-colors flex items-center gap-1.5",c?"text-muted-foreground cursor-not-allowed":"text-primary hover:bg-primary/10 font-medium"),children:c?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"h-3 w-3 animate-spin shrink-0"}),"Creating…"]}):i.jsxs(i.Fragment,{children:['+ Create "',u.trim(),'"']})})]})]})]})}function yP({toolCallId:e,onSubmit:t,defaultDate:n,defaults:r}){const s=new Date().toISOString().split("T")[0],{getCardState:a,setCardState:o}=ga(),{toast:l}=Ht(),{customTypes:c,isLoading:u,createCustomType:f}=rQ(),d=h.useRef(null),m={date:(r==null?void 0:r.date)??n??s,hours:(r==null?void 0:r.hours)!==void 0?String(r.hours):"",activityType:(r==null?void 0:r.activityType)??"",propertyId:(r==null?void 0:r.propertyId)!==void 0?String(r.propertyId):"",description:(r==null?void 0:r.description)??""},p=a(e),g=(p==null?void 0:p.currentStep)??0,x=(p==null?void 0:p.formStatus)??"idle",y=(p==null?void 0:p.submittedValues)??null,v=(p==null?void 0:p.values)??m;function b(D){const _=a(e);o(e,{currentStep:(_==null?void 0:_.currentStep)??0,formStatus:(_==null?void 0:_.formStatus)??"idle",submittedValues:(_==null?void 0:_.submittedValues)??null,values:(_==null?void 0:_.values)??m,...D})}const{data:w=[],isLoading:j}=it({queryKey:["/api/properties"],staleTime:5*60*1e3}),S=h.useMemo(()=>new Set(Js.map(D=>D.value)),[]),I=[...c.filter(D=>!S.has(D.activityType)).map(D=>({id:D.activityType,label:D.activityType.split("-").map(_=>_.charAt(0).toUpperCase()+_.slice(1)).join(" "),description:"Custom"})),...Js.map(D=>({id:D.value,label:D.label,description:D.duration}))],E=w.map(D=>({id:String(D.id),label:D.nickname??D.address??`Property ${D.id}`,description:[D.address,D.city,D.state].filter(Boolean).join(", ")})),N=ja[g].key,k=iQ(N,v),A=g===ja.length-1,M=ja[g].icon,L=h.useCallback((D,_)=>{const G=a(e),z=(G==null?void 0:G.values)??m;b({values:{...z,[D]:_}})},[e]);h.useEffect(()=>{var R;const D=(R=r==null?void 0:r.customActivityLabel)==null?void 0:R.trim();if(!D||v.activityType||u)return;const _=aQ(D);if(!_||d.current===_)return;const G=Js.find(q=>q.value===_||q.label.toLowerCase()===D.toLowerCase());if(G){L("activityType",G.value);return}const z=c.find(q=>q.activityType===_||q.activityType.toLowerCase()===D.toLowerCase());if(z){L("activityType",z.activityType);return}d.current=_,f(D).then(q=>{L("activityType",q)}).catch(q=>{console.error("Failed to create evidence custom activity type:",q),L("activityType",_)})},[f,c,r==null?void 0:r.customActivityLabel,L,u,v.activityType]);const[F,V]=h.useState(!1),U=async D=>{V(!0);try{const _=await f(D);L("activityType",_)}catch{l({title:"Failed to create activity type",description:"Please try again.",variant:"destructive"})}finally{V(!1)}};async function P(){if(k)if(A){b({formStatus:"submitting"});const D=Sp(v.hours.trim())??0,_={date:v.date,hours:D,activityType:v.activityType,description:v.description.trim()};v.propertyId&&(_.propertyId=v.propertyId),t(jf({questionnaireId:"logTime",answers:_})),b({submittedValues:v,formStatus:"submitted"})}else b({currentStep:g+1})}function T(){g>0&&b({currentStep:g-1})}return x==="submitted"||y?i.jsx(Je,{className:"border-green-500/50 shadow-sm",children:i.jsxs(rt,{className:"p-3 flex items-center gap-2 text-sm",children:[i.jsx(ot,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),i.jsx("span",{className:"font-medium",children:"Time entry logged"})]})}):i.jsx(Je,{className:"w-full shadow-sm",children:i.jsxs(rt,{className:"p-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(M,{className:"h-4 w-4 text-muted-foreground shrink-0"}),i.jsx("p",{className:"font-semibold text-sm",children:"Log Time Entry"})]}),i.jsx("div",{className:"flex items-center gap-1.5",children:ja.map((D,_)=>i.jsx("div",{className:W("h-1 flex-1 rounded-full transition-colors",_<=g?"bg-primary":"bg-border")},D.key))}),i.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Step ",g+1," of ",ja.length,":"," ",i.jsx("span",{className:"font-medium text-foreground",children:ja[g].label})]}),N==="basic"&&i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:"lt-date",className:"text-xs font-medium text-foreground
542/80",children:"Date"}),i.jsx(dt,{id:"lt-date",type:"date",value:v.date,onChange:D=>L("date",D.target.value),className:"h-9 text-sm"})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:"lt-hours",className:"text-xs font-medium text-foreground/80",children:"Hours"}),i.jsx(dt,{id:"lt-hours",type:"text",value:v.hours,onChange:D=>L("hours",D.target.value),placeholder:"e.g. 2h30m or 45 min",className:"h-9 text-sm"}),v.hours.trim()!==""&&Sp(v.hours.trim())===null&&i.jsx("p",{className:"text-xs text-destructive mt-1",children:'Unrecognised format — try "2h 30m", "45 min", or "1.5"'})]})]}),N==="activity"&&i.jsx(qw,{label:"Activity Type",options:I,selectedId:v.activityType,onSelect:D=>L("activityType",D),isLoading:u,placeholder:"Search activity types…",allowCustomCreate:!0,onCreateCustom:U,isCreating:F}),N==="property"&&i.jsxs(i.Fragment,{children:[j||w.length>0?i.jsx(qw,{label:"Property (optional)",options:E,selectedId:v.propertyId,onSelect:D=>L("propertyId",D),isLoading:j,placeholder:"Search properties…"}):i.jsx("p",{className:"text-xs text-muted-foreground italic py-2",children:"No properties found. Skip this step if not applicable."}),i.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>{L("propertyId",""),b({currentStep:g+1})},className:"text-xs",children:"Skip — no property"})]}),N==="details"&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:"lt-desc",className:"text-xs font-medium text-foreground/80",children:"Description"}),i.jsx(dt,{id:"lt-desc",type:"text",value:v.description,onChange:D=>L("description",D.target.value),placeholder:"e.g. Coordinated HVAC repair with contractor",className:"h-9 text-sm"})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[i.jsxs(Z,{variant:"ghost",size:"sm",onClick:T,disabled:g===0,className:"h-8 px-2 text-xs",children:[i.jsx(aa,{className:"h-3.5 w-3.5 mr-0.5"}),"Back"]}),i.jsx(Z,{size:"sm",onClick:P,disabled:!k||x==="submitting",className:"h-8 px-3 text-xs",children:x==="submitting"?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Saving…"]}):A?i.jsxs(i.Fragment,{children:[i.jsx(ot,{className:"h-3.5 w-3.5 mr-1.5"}),"Submit"]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Bn,{className:"h-3.5 w-3.5 ml-0.5"})]})})]})]})})}const oQ=[{id:"smart",title:"Smart Assistant",description:"Upload evidence (optional) and our scanner will pre-fill the date, activity, and description for you.",icon:MD},{id:"manual",title:"Manual Entry",description:"Type the details yourself. AI Enhance stays available for your description, and you can attach evidence files — nothing is auto-filled from them.",icon:RD}];function lQ({onSelect:e}){return i.jsxs("div",{className:"space-y-3","data-testid":"log-entry-mode-chooser",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-semibold",children:"Log Time Entry"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose how you want to log this activity."})]}),oQ.map(t=>{const n=t.icon;return i.jsx("button",{type:"button",onClick:()=>e(t.id),"data-mode":t.id,className:W("group w-full text-left rounded-lg border border-border/70 bg-card p-3 transition-colors","hover:border-primary/50 hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:i.jsxs("span",{className:"flex items-start gap-3",children:[i.jsx("span",{className:"mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted text-muted-foreground transition-colors group-hover:text-primary",children:i.jsx(n,{className:"h-4 w-4"})}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"block text-sm font-medium",children:t.title}),i.jsx("span",{className:"mt-0.5 block text-xs leading-snug text-muted-foreground",children:t.description})]})]})},t.id)})]})}function cQ({onClick:e}){return i.jsxs("button",{type:"button",onClick:e,className:"inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[i.jsx(ag,{className:"h-3.5 w-3.5"}),"Entry methods"]})}const Rh=[{key:"logger",label:"Quick",subtitle:"For simple logging and basic questions",icon:ES,requiresPremium:!1}
542,{key:"advisor",label:"Advisor",subtitle:"For tax-aware guidance and cited answers",icon:VD,requiresPremium:!0},{key:"compliance",label:"Compliance",subtitle:"For compliance and defensibility",icon:LD,requiresPremium:!0}];function uQ({mode:e,isPremium:t,isSwitching:n,isStreaming:r,onModeChange:s,onUpgradeClick:a,onPreviewMode:o}){const[l,c]=h.useState(!1),u=r||n,f=Rh.find(m=>m.key===e)??Rh[0];function d(m){if(m.requiresPremium&&!t){c(!1),o?o(m.key):a();return}e!==m.key&&s(m.key),c(!1)}return i.jsxs(Gx,{open:l,onOpenChange:m=>!u&&c(m),children:[i.jsx(Yx,{asChild:!0,children:i.jsxs("button",{type:"button",disabled:u,"aria-label":`Current mode: ${f.label}. Click to change.`,className:W("inline-flex items-center gap-1 rounded-full px-3 py-1 text-xs font-medium","bg-muted/60 hover:bg-muted border border-border/60","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",u&&"opacity-50 pointer-events-none"),children:[i.jsx("span",{children:f.label}),i.jsx(di,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),i.jsxs(ff,{align:"end",sideOffset:8,className:"w-72 p-1 overflow-hidden",children:[!t&&i.jsxs("button",{type:"button",onClick:()=>{c(!1),a()},className:"w-full flex items-center justify-between gap-2 px-3 py-1.5 mb-1 rounded-md text-xs font-medium text-primary-foreground bg-primary hover:bg-primary/90 transition-colors",children:[i.jsx("span",{children:"Unlock Pro modes"}),i.jsx(ls,{className:"h-3 w-3 shrink-0"})]}),Rh.map(m=>{const p=e===m.key,g=m.requiresPremium&&!t,x=m.icon;return i.jsxs("button",{type:"button",onClick:()=>d(m),className:W("w-full flex items-center gap-2 px-3 py-2 rounded-md text-left","hover:bg-muted/70 transition-colors duration-100","focus-visible:outline-none focus-visible:bg-muted/70",p&&"bg-muted/50"),children:[i.jsx(x,{className:W("h-3.5 w-3.5 shrink-0 mt-0.5",p?"text-primary":"text-muted-foreground")}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:W("block text-sm leading-none",p?"text-foreground":"text-foreground/75"),children:m.label}),i.jsx("span",{className:"block text-[10px] leading-tight text-muted-foreground mt-0.5",children:m.subtitle})]}),p?i.jsx(ot,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):g?i.jsx(kS,{className:"h-3 w-3 shrink-0 text-muted-foreground/50"}):null]},m.key)})]})]})}const dQ=10*1024*1024,Gw=10,fQ="[EVIDENCE_SCAN_CONTEXT]";function hQ(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function vP(e,t){const n=e.mappedFields,r=[n.date.value?`date: ${n.date.value} (${Math.round(n.date.confidence*100)}% confidence)`:null,n.activityType.value?`activity type: ${n.activityType.value} (${Math.round(n.activityType.confidence*100)}% confidence)`:null,n.customActivityLabel.value?`custom activity label: ${n.customActivityLabel.value} (${Math.round(n.customActivityLabel.confidence*100)}% confidence)`:null,n.description.value?`description: ${n.description.value} (${Math.round(n.description.confidence*100)}% confidence)`:null].filter(Boolean),s=n.unmappedFields.map(a=>`${a.label}: ${a.value}`).join("; ");return[t||"Evidence attached for a time entry.",fQ,"Gemini scanned the upload for time-entry details.",r.length>0?`Suggested fields: ${r.join("; ")}.`:null,s?`Other details found, but leave these for manual review if there is no matching field: ${s}.`:null,"Continue to the time log entry flow. Use confident scan results where helpful. If there is a custom activity label, pass it as customActivityLabel so the form can create and select it. Ask me to fill any missing required fields such as hours or property."].filter(Boolean).join(`
543`)}function mQ({onSubmit:e,isLoading:t,placeholder:n="How can I help you today?",showFileUpload:r=!0,mode:s,isPremium:a,isSwitching:o,onModeToggle:l,onUpgradeClick:c,onPreviewMode:u,onFilesChange:f,onEvidenceScanChange:d,autoSubmitEvidenceUploads:m=!1}){const[p,g]=h.useState(""),[x,y]=h.useState([]),[v,b]=h.useState(null),w=h.useRef(null),j=h.useRef(null),S=h.useRef(0),C=h.useCallback(()=>{const V=w.current;V&&(V.style.height="auto",V.style.height=`${Math.min(V.scrollHeight,64)}px`)},[]);h.useEffect(()=>{C()},[p,C]),h.useEffect(()=>{C()},[C]);function I(){S.current+=1,g(""),y([]),f==null||f(!1),d==null||d("idle"),b(null),requestAnimationFrame(()=>{var V;w.current&&(w.current.style.height="auto"),(V=w.current)==null||V.focus()})}async function E(V,U){const P=S.current+1;S.current=P,d==null||d("scanning");try{const T=await Ry(V);if(P!==S.current)return;
543d==null||d("complete"),m&&(e(vP(T,U),V),I())}catch(T){if(console.error("Chat evidence scan failed:",T),P!==S.current)return;d==null||d("failed"),m&&(e(U||"Create a time log entry from the attached evidence. If the scan missed anything, ask me to fill it in.",V),I())}}function N(V){if(!V)return;b(null);const U=Array.from(V),P=U.find(D=>D.size>dQ);if(P){b(`${P.name} exceeds 10MB limit`);return}const T=[...x,...U];if(T.length>Gw){b(`Maximum ${Gw} files allowed`);return}y(T),f==null||f(T.length>0),m&&E(T,p.trim()),j.current&&(j.current.value="")}function k(V){const U=x.filter((P,T)=>T!==V);y(U),f==null||f(U.length>0),U.length===0&&(S.current+=1,d==null||d("idle")),b(null)}function A(V){V==null||V.preventDefault();const U=p.trim();!U&&x.length===0||t||(e(U||"Attached files",x.length>0?x:void 0),I())}function M(V){V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),A())}const L=V=>V.type.startsWith("image/"),F=p.trim().length>0||x.length>0;return i.jsxs("div",{className:"pt-0 space-y-0 shrink-0",children:[v&&i.jsx("p",{className:"text-xs text-destructive",children:v}),i.jsxs("form",{onSubmit:A,children:[r&&i.jsx("input",{ref:j,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.xls,.xlsx,.csv,.txt",className:"hidden",onChange:V=>N(V.target.files)}),i.jsxs("div",{className:"rounded-2xl border bg-muted/40 transition-colors duration-200 border-input focus-within:border-ring",children:[x.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5 px-4 pt-2 pb-1",children:x.map((V,U)=>i.jsxs("div",{className:"flex items-center gap-1.5 bg-background rounded-md px-2 py-1 text-xs max-w-[180px] border",children:[L(V)?i.jsx(ED,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):i.jsx($n,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate",children:V.name}),i.jsx("span",{className:"text-muted-foreground shrink-0",children:hQ(V.size)}),i.jsx("button",{type:"button",onClick:()=>k(U),className:"shrink-0 text-muted-foreground hover:text-destructive transition-colors",children:i.jsx($t,{className:"h-3 w-3"})})]},`${V.name}-${U}`))}),i.jsx(Hr,{ref:w,value:p,onChange:V=>g(V.target.value),onKeyDown:M,placeholder:n,disabled:t,rows:1,style:{height:"28px"},className:"w-full border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent !min-h-0 px-4 pt-2 pb-1 !resize-none text-base"}),i.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1 pt-0",children:[i.jsx("div",{className:"flex items-center gap-1",children:r&&i.jsx("button",{type:"button",className:"flex items-center justify-center h-7 w-7 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors disabled:opacity-40",onClick:()=>{var V;return(V=j.current)==null?void 0:V.click()},disabled:t,title:"Attach files",children:i.jsx(io,{className:"h-4 w-4"})})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(uQ,{mode:s,isPremium:a,isSwitching:o,isStreaming:t,onModeChange:l,onUpgradeClick:c,onPreviewMode:u}),i.jsx(Z,{type:"submit",className:W("!h-7 !w-7 rounded-full transition-colors bg-primary hover:bg-primary/90 text-primary-foreground shrink-0",(!F||t)&&"opacity-40"),disabled:t||!F,children:i.jsx(lu,{className:"h-3.5 w-3.5"})})]})]})]})]})]})}const pQ=e=>`${e}:logTimeMode`;function gQ({toolCallId:e,defaults:t,onSubmit:n}){const{getCardState:r,setCardState:s}=ga(),{toast:a}=Ht(),o=pQ(e),l=r(o)??{mode:"chooser"},c=l.mode,u=l.scanStatus??"idle",f=m=>{const p=r(o)??{mode:"chooser"};s(o,{...p,...m})},d={toolCallId:e,onSubmit:m=>n(m),defaults:t};return c==="manual"?i.jsx(yP,{...d}):c==="smart"?i.jsx(Je,{className:"w-full shadow-sm",children:i.jsxs(rt,{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("p",{className:"font-semibold text-sm",children:"Smart Assistant"}),i.jsx(cQ,{onClick:()=>f({mode:"chooser",scanStatus:"idle"})})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload evidence (optional) and our scanner will pre-fill the date, activity, and description for you to review."}),i.jsx(a7,{onFilesSelected:async m=>{if(m.length!==0){f({scanStatus:"scanning"});try{const p=await Ry(m);f({scanStatus:"complete"}),n(vP(p,""),m)}catch(p){console.error("Chat log-time evidence scan failed:",p),f({scanStatus:"failed"}),a({title:"Evidence scan failed",description:"We couldn't scan this evidence. You can still log the entry manually.",variant:"destructive"})}}},maxFiles:5,acceptedFileTypes:{"image/*":[".png",".jpg",".jpeg"],"application/pdf":[".pdf"]}}),u==="scanning"&&i.jsx(wd,{title:"Extracting evidence details",label:"Time entry evidence",description:"Reading your upload to suggest a date, activity type, and description."}),u==="complete"&&i.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600",children:[i.jsx(gS,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:"Evidence scanned — opening your pre-filled form to review."})]}),u==="failed"&&i.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-600",children:[i.jsx(ms,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:"We couldn't scan this evidence. You can still log the entry manually."})]}),u!=="scanning"&&i.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:()=>f({mode:"manual"}),children:"Skip evidence — type the details manually"})]})}):i.jsx(lQ,{onSelect:m=>f({mode:m,scanStatus:"idle"})})}function xQ(e){return e?!["hours","activityType","customActivityLabel","description","propertyId"].some(n=>{const r=e[n];return r!=null&&r!==""}):!0}const Iy={alabama:"AL",alaska:"AK",arizona:"AZ",arkansas:"AR",california:"
543CA",colorado:"CO",connecticut:"CT",delaware:"DE",florida:"FL",georgia:"GA",hawaii:"HI",idaho:"ID",illinois:"IL",indiana:"IN",iowa:"IA",kansas:"KS",kentucky:"KY",louisiana:"LA",maine:"ME",maryland:"MD",massachusetts:"MA",michigan:"MI",minnesota:"MN",mississippi:"MS",missouri:"MO",montana:"MT",nebraska:"NE",nevada:"NV","new hampshire":"NH","new jersey":"NJ","new mexico":"NM","new york":"NY","north carolina":"NC","north dakota":"ND",ohio:"OH",oklahoma:"OK",oregon:"OR",pennsylvania:"PA","rhode island":"RI","south carolina":"SC","south dakota":"SD",tennessee:"TN",texas:"TX",utah:"UT",vermont:"VT",virginia:"VA",washington:"WA","west virginia":"WV",wisconsin:"WI",wyoming:"WY","district of columbia":"DC"},yQ=Object.fromEntries(Object.entries(Iy).map(([e,t])=>[t,e])),vQ=new Set(["aly","alley","ave","avenue","blvd","boulevard","cir","circle","ct","court","cv","cove","dr","drive","hwy","highway","ln","lane","loop","pkwy","parkway","pl","place","rd","road","st","street","ter","terrace","trl","trail","way"]),Vs=e=>(e==null?void 0:e.replace(/\s+/g," ").trim())??"",bQ=(e,t)=>{const n=Vs(e).toUpperCase();if(/^[A-Z]{2}$/.test(n))return n;const r=Vs(t).toLowerCase();return Iy[r]??""},Yw=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),wQ=(e,t)=>{const n=yQ[t],r=[t,n].filter(Boolean).map(Yw),s=r.length?r.join("|"):Object.entries(Iy).flatMap(([o,l])=>[o,l]).map(Yw).join("|");return Array.from(e.matchAll(new RegExp(`\\b(${s})\\b(?=\\s+\\d{5}(?:-\\d{4})?\\b|\\s*$)`,"gi"))).at(-1)},kQ=e=>e.split(" ").map(t=>/^[A-Z]{2}$/.test(t)?t:t===t.toLowerCase()||t===t.toUpperCase()?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():t).join(" "),SQ=(e,t)=>{const n=Vs(e.replace(/,/g," "));if(!n)return"";const r=wQ(n,t);if(!r||r.index===void 0)return"";const a=n.slice(0,r.index).trim().split(/\s+/).filter(Boolean),o=a.map(l=>l.replace(/\./g,"").toLowerCase()).findLastIndex(l=>vQ.has(l));return o<0||o>=a.length-1?"":kQ(a.slice(o+1).join(" "))},NQ=(e,t)=>{const n=e.properties,r=bQ(n.state_code,n.state);return{address:Vs(n.address_line1)||Vs([n.housenumber,n.street].filter(Boolean).join(" "))||Vs(n.formatted),city:Vs(n.city)||SQ(t,r),state:r,zipCode:Vs(n.postcode)}};function jQ({value:e,onChange:t,onSelect:n,required:r=!1}){const[s,a]=h.useState([]),[o,l]=h.useState(!1),c=h.useRef(null),u=h.useRef(null);h.useEffect(()=>{const p=g=>{u.current&&!u.current.contains(g.target)&&l(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const f=async p=>{const g=window.__GEOAPIFY_KEY__??"068184098df04e2e8460f461097031d0"??"";if(!g||p.length<5){a([]);return}try{const x=`https://api.geoapify.com/v1/geocode/autocomplete?text=${encodeURIComponent(p)}&filter=countrycode:us&format=geojson&limit=6&apiKey=${g}`,y=await fetch(x);if(!y.ok)return;const v=await y.json();a(v.features??[])}catch{a([])}},d=p=>{const g=p.target.value;t(g),l(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{f(g)},280)},m=p=>{const g=NQ(p,e);t(g.address),a([]),l(!1),n(g)};return i.jsxs("div",{ref:u,className:"relative",children:[i.jsx(Ge,{htmlFor:"address",children:"Address *"}),i.jsx(dt,{id:"address",value:e,onChange:d,onFocus:()=>s.length>0&&l(!0),placeholder:"123 Main Street, Springfield, IL",required:r,autoComplete:"off"}),o&&s.length>0&&i.jsx("ul",{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-56 overflow-y-auto",children:s.map((p,g)=>i.jsx("li",{className:"px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-900 dark:text-gray-100",onMouseDown:()=>m(p),children:p.properties.formatted},g))})]})}const CQ=["Long-term Rental","Short-term Rental"],Ca=[{key:"basic",label:"Basic Info",icon:ia},{key:"type",label:"Property Type",icon:Ad}];function TQ(e,t){return e==="basic"?t.nickname.trim()!==""&&t.address.trim()!=="":!0}function EQ({onSubmit:e}){const[t,n]=h.useState(0),[r,s]=h.useState("idle"),[a,o]=h.useState(null),[l,c]=h.useState({nickname:"",address:"",city:"",state:"",zipCode:"",propertyType:"Long-term Rental"}),u=Ca[t].key,f=TQ(u,l),d=t===Ca.length-1,m=Ca[t].icon,p=h.useCallback((v,b)=>{c(w=>({...w,[v]:b}))},[]),g=h.useCallback(v=>{c(b=>({...b,address:v.address,city:v.city,state:v.state,zipCode:v.zipCode}))},[]);
543function x(){if(f)if(d){s("submitted");const v={nickname:l.nickname.trim(),address:l.address.trim(),city:l.city.trim(),state:l.state.trim().toUpperCase(),zipCode:l.zipCode.trim(),propertyType:l.propertyType};e(jf({questionnaireId:"addProperty",answers:v})),o(l)}else n(v=>v+1)}function y(){t>0&&n(v=>v-1)}return r==="submitted"||a?i.jsx(Je,{className:"border-green-500/50 shadow-sm",children:i.jsxs(rt,{className:"p-3 flex items-center gap-2 text-sm",children:[i.jsx(ot,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),i.jsx("span",{className:"font-medium",children:"Property added"})]})}):i.jsx(Je,{className:"w-full shadow-sm",children:i.jsxs(rt,{className:"p-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(m,{className:"h-4 w-4 text-muted-foreground shrink-0"}),i.jsx("p",{className:"font-semibold text-sm",children:"Add a New Property"})]}),i.jsx("div",{className:"flex items-center gap-1.5",children:Ca.map((v,b)=>i.jsx("div",{className:W("h-1 flex-1 rounded-full transition-colors",b<=t?"bg-primary":"bg-border")},v.key))}),i.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Step ",t+1," of ",Ca.length,":"," ",i.jsx("span",{className:"font-medium text-foreground",children:Ca[t].label})]}),u==="basic"&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:"ap-nickname",className:"text-xs font-medium text-foreground/80",children:"Property Nickname"}),i.jsx(dt,{id:"ap-nickname",type:"text",value:l.nickname,onChange:v=>p("nickname",v.target.value),placeholder:"e.g. Beach House",className:"h-9 text-sm"})]}),i.jsx(jQ,{value:l.address,onChange:v=>p("address",v),onSelect:g,required:!0}),(l.city||l.state||l.zipCode)&&i.jsx("p",{className:"text-xs text-muted-foreground -mt-1",children:[l.city,l.state,l.zipCode].filter(Boolean).join(", ")})]}),u==="type"&&i.jsx("div",{className:"space-y-3",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{className:"text-xs font-medium text-foreground/80",children:"Property Type"}),i.jsx("div",{className:"flex gap-2",children:CQ.map(v=>i.jsx("button",{type:"button",onClick:()=>p("propertyType",v),className:W("flex-1 text-xs px-3 py-3 rounded border transition-colors text-center font-medium",l.propertyType===v?"bg-primary/10 border-primary/50 text-primary":"border-border text-muted-foreground hover:bg-muted/50"),children:v==="Long-term Rental"?"🏠 Long-term Rental (LTR)":"🏄 Short-term Rental (STR)"},v))})]})}),i.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[i.jsxs(Z,{variant:"ghost",size:"sm",onClick:y,disabled:t===0,className:"h-8 px-2 text-xs",children:[i.jsx(aa,{className:"h-3.5 w-3.5 mr-0.5"}),"Back"]}),i.jsx(Z,{size:"sm",onClick:x,disabled:!f,className:"h-8 px-3 text-xs",children:d?i.jsxs(i.Fragment,{children:[i.jsx(ot,{className:"h-3.5 w-3.5 mr-1.5"}),"Add Property"]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Bn,{className:"h-3.5 w-3.5 ml-0.5"})]})})]})]})})}const Kw=["/api/advisor/tax-profile"],_Q=600;function AQ(e=!0){const t=wt(),n=h.useRef(null),{data:r,isLoading:s,isError:a,refetch:o}=it({queryKey:Kw,queryFn:yG,enabled:e,staleTime:1e3*60*5}),l=Dt({mutationFn:f=>Ty(f),onSuccess:()=>{t.invalidateQueries({queryKey:Kw})}}),c=h.useCallback((f,d)=>{l.mutate({[f]:d})},[l]),u=h.useCallback((f,d)=>{n.current!==null&&clearTimeout(n.current),n.current=setTimeout(()=>{l.mutate({[f]:d}),n.current=null},_Q)},[l]);return{profile:(r==null?void 0:r.profile)??null,completeness:(r==null?void 0:r.completeness)??null,isLoading:s,isError:a,refetch:o,updateField:c,debouncedUpdateField:u,isUpdating:l.isPending}}const PQ=["/api/advisor/tax-profile/suggestions"];function Zae(e=!0){const{data:t,isLoading:n}=it({queryKey:PQ,queryFn:bG,enabled:e,staleTime:3e5});return{suggestions:t??null,isLoading:n}}const Xc=[{key:"filing",label:"Tax Filing"},{key:"employment",label:"Employment & Hours"},{key:"involvement",label:"Real Estate Involvement"},{key:"goals",label:"Goals & History"},{key:"preferences",label:"Advisor Preferences"}],Np=[{key:"taxYearGoal",label:"Tax Year Goal",type:"select",group:"filing",options:[{value:"current_year",label:"Current Year"},{value:"retroactive",label:"Retroactive Claim"},{value:"future_planning",label:"Future Planning"}]},{key:"filingStatus",label:"Filing Status",type:"select",group:"filing",options:[{value:"single",label:"Single"},{value:"mfj",label:"Married Filing Jointly"},{value:"mfs",label:"Married Filing Separately"},{value:"hoh",label:"Head of Household"}]},{key:"agiRange",label:"Adjusted Gross Income Range",type:"select",group:"filing",options:[{value:"under_100k",label:"Under $100K"},{value:"100k_150k",label:"$100K – $150K"},{value:"150k_250k",label:"$150K – $250K"},{value:"over_250k",label:"Over $250K"}]},{key:"employmentType",label:"Employment Type",type:"select",group:"employment",options:[{value:"w2",label:"W-2 Employee"}
543,{value:"self_employed",label:"Self-Employed"},{value:"business_owner",label:"Business Owner"},{value:"retired",label:"Retired"},{value:"full_time_re",label:"Full-Time Real Estate"}]},{key:"w2HoursPerWeek",label:"W-2 Hours Per Week",type:"number",group:"employment",min:1,max:168,placeholder:"e.g. 40",condition:{field:"employmentType",values:["w2"]}},{key:"otherWorkHoursPerWeek",label:"Other Work Hours Per Week",type:"number",group:"employment",min:0,placeholder:"e.g. 20",condition:{field:"employmentType",values:["self_employed","business_owner"]}},{key:"spouseEmploymentStatus",label:"Spouse Employment Status",type:"select",group:"employment",options:[{value:"full_time",label:"Full-Time"},{value:"part_time",label:"Part-Time"},{value:"not_employed",label:"Not Employed"},{value:"na",label:"N/A"}],condition:{field:"filingStatus",values:["mfj"]}},{key:"spouseHoursPerWeek",label:"Spouse Work Hours Per Week",type:"number",group:"employment",min:1,max:168,placeholder:"e.g. 40",condition:{field:"spouseEmploymentStatus",values:["full_time","part_time"]}},{key:"involvementStyle",label:"Involvement Style",type:"select",group:"involvement",options:[{value:"self_manage",label:"Self-Managed"},{value:"hybrid",label:"Hybrid (Self + PM)"},{value:"pm_runs_most",label:"PM Runs Most Operations"},{value:"mostly_passive",label:"Mostly Passive"}]},{key:"pmHoursEstimate",label:"PM Hours Estimate (Weekly)",type:"number",group:"involvement",min:0,placeholder:"e.g. 10",condition:{field:"involvementStyle",values:["hybrid","pm_runs_most"]}},{key:"netRentalIncomeLoss",label:"Net Rental Income / Loss",type:"select",group:"involvement",options:[{value:"significant_losses",label:"Significant Losses"},{value:"small_losses",label:"Small Losses"},{value:"break_even",label:"Break Even"},{value:"net_income",label:"Net Income"},{value:"varies",label:"Varies by Property"}]},{key:"primaryGoal",label:"Primary Goal",type:"select",group:"goals",options:[{value:"qualify_this_year",label:"Qualify This Year"},{value:"defend_prior_year",label:"Defend Prior Year"},{value:"optimize_tax_strategy",label:"Optimize Tax Strategy"},{value:"explore_options",label:"Explore Options"}]},{key:"priorityFocus",label:"Priority Focus",type:"select",group:"goals",options:[{value:"qualify",label:"Qualify for REPS"},{value:"document",label:"Document Hours"},{value:"audit_risk",label:"Minimize Audit Risk"}]},{key:"trackingHabit",label:"Time Tracking Habit",type:"select",group:"goals",options:[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"quarterly",label:"Quarterly"},{value:"starting_now",label:"Starting Now"}]},{key:"priorYearRepsQualified",label:"Previously Qualified as REP?",type:"boolean",group:"goals"},{key:"primaryQualifier",label:"Primary REPS Qualifier",type:"select",group:"goals",options:[{value:"self",label:"Self"},{value:"spouse",label:"Spouse"},{value:"both_independently",label:"Both Independently"}],condition:{field:"filingStatus",values:["mfj"]}},{key:"hasActiveCpa",label:"Have an Active CPA?",type:"boolean",group:"preferences"},{key:"allowPushback",label:"Allow AI Pushback",type:"boolean",group:"preferences",description:"When enabled, the AI advisor will proactively flag activities that may not hold up under audit."}];function RQ(e,t){if(!e.condition)return!0;const n=t[e.condition.field];return e.condition.values.includes(n)}function bP(e,t){return Np.filter(n=>n.group===e&&RQ(n,t))}function Xae(e,t){const n=bP(e,t);return{answered:n.filter(s=>{const a=t[s.key];return!(a==null||typeof a=="string"&&a.trim()==="")}).length,total:n.length}}const IQ=[bD,mD,ia,zD,DD];function MQ({field:e,value:t,onChange:n}){var r;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:e.key,className:"text-xs font-medium text-foreground/80",children:e.label}),i.jsxs(ai,{value:t??"",onValueChange:s=>n(e.key,s),children:[i.jsx(ys,{id:e.key,className:"h-8 text-sm w-full",children:i.jsx(oi,{placeholder:"Select…"})}),i.jsx(vs,{children:(r=e.options)==null?void 0:r.map(s=>i.jsx(Kt,{value:s.value,children:s.label},s.value))})]})]})}function DQ({field:e,value:t,onChange:n}){return i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ge,{htmlFor:e.key,className:"text-xs font-medium text-foreground
543/80",children:e.label}),i.jsx(dt,{id:e.key,type:"number",min:e.min,max:e.max,value:t??"",placeholder:e.placeholder??"",onChange:r=>{const s=r.target.value;if(s==="")return;const a=parseInt(s,10);isNaN(a)||n(e.key,a)},className:"h-8 text-sm"})]})}function OQ({field:e,value:t,onChange:n}){return i.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-border/50 bg-muted/20 px-3 py-2.5",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx(Ge,{htmlFor:e.key,className:"text-xs font-medium leading-snug cursor-pointer",children:e.label}),e.description&&i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:e.description})]}),i.jsx($l,{id:e.key,checked:t??!1,onCheckedChange:r=>n(e.key,r),className:"shrink-0 mt-0.5"})]})}const LQ={filing:["taxYearGoal","filingStatus","agiRange"],employment:["employmentType"],involvement:["involvementStyle"],goals:["primaryGoal"],preferences:[]};function FQ(e,t){return(LQ[e]??[]).every(r=>{const s=t[r];return s!=null&&s!==""})}function VQ({onSubmit:e}){const{profile:t,isLoading:n,updateField:r}=AQ(),[s,a]=h.useState(0),[o,l]=h.useState("idle"),[c,u]=h.useState(null),f=h.useRef(!1),[d,m]=h.useState(()=>{const S={};return Np.forEach(C=>{S[C.key]=null}),S});h.useEffect(()=>{if(!t||f.current)return;f.current=!0;const S={};Np.forEach(C=>{S[C.key]=t[C.key]??null}),m(S)},[t]);const p=Xc[s],g=bP(p.key,d),x=FQ(p.key,d),y=s===Xc.length-1,v=IQ[s],b=h.useCallback((S,C)=>{m(I=>({...I,[S]:C})),r(S,C)},[r]);async function w(){if(x)if(y){l("submitting");const S={};for(const[I,E]of Object.entries(d))E!==null&&(S[I]=E);let C=!1;try{await Ty(S)}catch(I){C=!0,console.error("[TaxProfileForm] patchTaxProfile failed:",I)}e(jf({questionnaireId:"taxProfile",answers:S})),u(d),l(C?"save-failed":"submitted")}else a(S=>S+1)}function j(){s>0&&a(S=>S-1)}return o==="submitted"||c?i.jsx(Je,{className:"border-green-500/50 shadow-sm",children:i.jsxs(rt,{className:"p-3 flex items-center gap-2 text-sm",children:[i.jsx(ot,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),i.jsx("span",{className:"font-medium",children:"Tax profile updated"})]})}):o==="save-failed"?i.jsx(Je,{className:"border-amber-500/50 shadow-sm",children:i.jsxs(rt,{className:"p-3 flex items-center gap-2 text-sm",children:[i.jsx(ot,{className:"h-3.5 w-3.5 text-amber-600 shrink-0"}),i.jsx("span",{className:"font-medium",children:"Profile update submitted — could not save directly."})]})}):n?i.jsx(Je,{className:"shadow-sm",children:i.jsxs(rt,{className:"p-4 flex items-center justify-center gap-2",children:[i.jsx(Xe,{className:"h-4 w-4 animate-spin text-muted-foreground"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading profile…"})]})}):i.jsx(Je,{className:"w-full shadow-sm",children:i.jsxs(rt,{className:"p-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(v,{className:"h-4 w-4 text-muted-foreground shrink-0"}),i.jsx("p",{className:"font-semibold text-sm",children:"Your Tax Profile"})]}),i.jsx("div",{className:"flex items-center gap-1.5",children:Xc.map((S,C)=>i.jsx("div",{className:W("h-1 flex-1 rounded-full transition-colors",C<=s?"bg-primary":"bg-border")},S.key))}),i.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Step ",s+1," of ",Xc.length,":"," ",i.jsx("span",{className:"font-medium text-foreground",children:p.label})]}),i.jsxs("div",{className:"space-y-3",children:[g.map(S=>{const C=d[S.key];return S.type==="boolean"?i.jsx(OQ,{field:S,value:C,onChange:b},S.key):S.type==="number"?i.jsx(DQ,{field:S,value:C,onChange:b},S.key):i.jsx(MQ,{field:S,value:C,onChange:b},S.key)}),g.length===0&&i.jsx("p",{className:"text-xs text-muted-foreground italic py-2",children:"No fields apply based on your previous answers."})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[i.jsxs(Z,{variant:"ghost",size:"sm",onClick:j,disabled:s===0,className:"h-8 px-2 text-xs",children:[i.jsx(aa,{className:"h-3.5 w-3.5 mr-0.5"}),"Back"]}),i.jsx(Z,{size:"sm",onClick:w,disabled:!x||o==="submitting",className:"h-8 px-3 text-xs",children:o==="submitting"?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Saving…"]}):y?i.jsxs(i.Fragment,{children:[i.jsx(ot,{className:"h-3.5 w-3.5 mr-1.5"}),"Save Profile"]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Bn,{className:"h-3.5 w-3.5 ml-0.5"})]})})]})]})})}function $Q({formId:e,onSubmit:t,mode:n="single"}){const[r,s]=h.useState(null),[a,o]=h.useState(new Set),l=e!=null&&e.toLowerCase().includes("rent")?"Show Rental Comps":"Show Cost Seg Estimates",{data:c=[],isLoading:u}=it({queryKey:["/api/properties"],staleTime:5*60*1e3});function f(x){if(!e||!t)return;const y=String(x.id);s(y),t(kp({formId:e,selectedId:y,selectedLabel:x.nickname??x.address??`Property ${x.id}`}))}function d(x){o(y=>{const v=new Set(y);return v.has(x)?v.delete(x):v.add(x),v})}const m=c.length>0&&a.size===c.length;function p(){o(m?new Set:new Set(c.map(x=>x.id)))}function g(){if(!e||!t||a.size===0)return;const x=[...a],y=c.filter(v=>a.has(v.id)).map(v=>v.nickname??v.address??`Property ${v.id}`).join(", ");t(kp({formId:e,selectedId:JSON.stringify(x),selectedLabel:y}))}return i.jsx(Je,{className:"w-full shadow-sm",children:i.jsxs(rt,{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ia,{className:"h-4 w-4 text-muted-foreground shrink-0"}),i.jsx("p",{className:"font-semibold text-sm",children:"Your Properties"})]}),u?i.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin"}),"Loading…"]}):c.length===0?i.jsx("p",{className:"text-xs text-muted-foreground",children:"No properties found. Add one to get started."}):i.jsxs(i.Fragment,{children:[n==="multi"&&e&&i.jsxs("button",{type:"button",onClick:p,className:"w-full flex items-center gap-2.5 p-2 rounded-lg text-xs font-medium text-muted-foreground hover:bg-muted/50 transition-colors",children:[m?i.jsx(Fv,{className:"h-4 w-4 text-primary shrink-0"}):i.jsx(Vv,{className:"h-4 w-4 shrink-0"}),m?"Deselect All":"Select All"]}),i.jsx("div",{className:"space-y-1.5",children:c.map(x=>{const y=n==="multi"?a.has(x.id):r===String(x.id);return i.jsx("button",{type:"button",disabled:!e,onClick:()=>{n==="multi"?d(x.id):f(x)},className:W("w-full text-left p-2.5 rounded-lg border text-xs transition-colors",e?"cursor-pointer hover:bg-muted/60":"cursor-default",y?"bg-primary/10 border-primary/40":"border-border/60"),children:i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[n==="multi"&&e&&i.jsx("span",{className:"mt-0.5 shrink-0",children:y?i.jsx(Fv,{className:"h-3.5 w-3.5 text-primary"}):i.jsx(Vv,{className:"h-3.5 w-3.5 text-muted-foreground"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"font-medium text-foreground leading-snug",children:x.nickname??"Unnamed Property"}),x.address&&i.jsxs("p",{className:"text-muted-foreground flex items-center gap-1 mt-0.5",children:[i.jsx(cg,{className:"h-3 w-3 shrink-0"}
543),[x.address,x.city,x.state].filter(Boolean).join(", ")]})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[i.jsx("span",{className:"text-[10px] text-muted-foreground bg-muted/60 rounded px-1.5 py-0.5",children:x.propertyType==="Short-term Rental"?"STR":"LTR"}),n==="single"&&y&&i.jsx(ot,{className:"h-3.5 w-3.5 text-primary"})]})]})},x.id)})}),n==="multi"&&e&&i.jsxs(Z,{size:"sm",className:"w-full mt-1",disabled:a.size===0,onClick:g,children:[l,a.size>0&&i.jsx("span",{className:"ml-1.5 bg-primary-foreground/20 text-primary-foreground rounded px-1.5 py-0.5 text-[10px] font-semibold",children:a.size})]})]})]})})}const Jae={nickname:"",address:"",city:"",state:"",zipCode:"",propertyType:"Long-term Rental"};async function eoe(e){return Ze("POST","/api/properties",e)}async function toe(e){const t=await fetch(`/api/properties/${e}`,{credentials:"include"});if(!t.ok)throw new Error("Failed to fetch property");return t.json()}async function noe(e,t){return Ze("PATCH",`/api/properties/${e}`,t)}async function wP(e,t){const n=t!=null?JSON.stringify({purchasePrice:t}):void 0,r=await fetch(`/api/properties/${e}/cost-seg`,{method:"POST",credentials:"include",headers:n?{"Content-Type":"application/json"}:void 0,body:n});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.message??"Cost seg failed")}return r.json()}async function roe(e,t,n){return Ze("PATCH",`/api/properties/${e}/enrichment/${t}`,{value:n})}async function kP(e){const t=await fetch(`/api/properties/${e}/cost-seg-estimate`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.message??"Failed to fetch estimate")}return t.json()}async function soe(e){const t=await fetch(`/api/properties/${e}/geocode`,{method:"POST",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.message??"Geocoding failed")}return t.json()}async function ioe(e){const t=await fetch(`/api/properties/${e}`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.message??"Failed to delete property")}}async function zQ(e,t=!1){const n=`/api/properties/${e}/rent-estimate${t?"?force=true":""}`,r=await fetch(n,{credentials:"include"});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.message??"Failed to fetch rent estimate")}return r.json()}const UQ=.24,BQ=.37;function HQ(e){const{propertyValue:t,landShare:n,classification:r,bonusDepreciationRate:s,stateConfig:a}=e,o=t*(1-n),l=o*r.baselineReclass,c=o*r.upperReclass,u=l*s,f=c*s,d=(o-l)/27.5/2,m=(o-c)/27.5/2,p=u+d,g=f+m,x=Math.round(p*UQ),y=Math.round(g*BQ),v=Math.round((x+y)/2);let b=0,w=0;a.conformity==="full"?(b=Math.round(p*a.topRate),w=Math.round(g*a.topRate)):a.conformity==="partial"&&(b=Math.round(p*.85*a.topRate),w=Math.round(g*.85*a.topRate));const j=Math.round((b+w)/2);return{depreciableBasis:Math.round(o),reclassifiedBasisBaseline:Math.round(l),reclassifiedBasisUpper:Math.round(c),totalYr1DeductionBaseline:Math.round(p),totalYr1DeductionUpper:Math.round(g),federalSavings:{low:x,high:y,midpoint:v},stateSavings:{low:b,high:w,midpoint:j},totalSavings:{low:x+b,high:y+w,midpoint:v+j},bonusDepreciationRate:s,landShare:n,conformityStatus:a.conformity}}function WQ(e){return e>=2025?1:e===2024?.6:e===2023?.8:e>=2017&&e<=2022?1:0}function Qt(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}function qQ({input:e,onSubmit:t,prefillAddress:n}){const[r,s]=h.useState(""),[a,o]=h.useState([]),[l,c]=h.useState(!1),[u,f]=h.useState(!1),d=h.useRef(null),m=h.useRef(!1),p=h.useRef(t);h.useEffect(()=>{p.current=t},[t]),h.useEffect(()=>{const b=n==null?void 0:n.trim();if(!b||m.current)return;m.current=!0,s(b);const w=setTimeout(()=>{f(!0),c(!1),p.current(b)},140);return()=>clearTimeout(w)},[n]);const g=async b=>{const w=window.__GEOAPIFY_KEY__??"068184098df04e2e8460f461097031d0"??"";if(!w||b.length<5){o([]);return}try{const j=`https://api.geoapify.com/v1/geocode/autocomplete?text=${encodeURIComponent(b)}&filter=countrycode:us&format=geojson&limit=6&apiKey=${w}`,S=await fetch(j);if(!S.ok)return;const C=await S.json();o(C.features??[]),c(!0)}catch{o([])}},x=b=>{const w=b.target.value;s(w),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>g(w),300)},y=b=>{s(b.properties.formatted),o([]),c(!1)},v=()=>{r.trim()&&(f(!0),c(!1),t(r.trim()))};return i.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white shadow-sm p-5 max-w-lg w-full",children:[i.jsx("p",{className:"text-base font-semibold text-gray-900 mb-1",children:e.headline??"Enter your property address"}),e.subtext&&i.jsx("p",{className:"text-sm text-gray-500 mb-3",children:e.subtext}),i.jsxs("div",{className:"relative",children:[i.jsx(dt,{value:r,onChange:x,onFocus:()=>a.length>0&&c(!0),onBlur:()=>setTimeout(()=>c(!1),150),placeholder:"726 N River Blvd, Independence, MO 64050",className:"pr-4",onKeyDown:b=>b.key==="Enter"&&v(),disabled:u}),l&&a.length>0&&i.jsx("ul",{className:"absolute z-50 w-full bg-white border border-gray-200 rounded-lg mt-1 
543shadow-lg overflow-hidden",children:a.map(b=>i.jsx("li",{className:"px-4 py-2 text-sm text-gray-800 hover:bg-green-50 cursor-pointer",onMouseDown:()=>y(b),children:b.properties.formatted},b.properties.formatted))})]}),i.jsx(Z,{className:"mt-3 w-full bg-green-600 hover:bg-green-700 text-white font-semibold",onClick:v,disabled:!r.trim()||u,children:u?"Looking up…":"Get My Estimate"})]})}function GQ({input:e,onViewFullEstimate:t}){const n=e,r=n.result??e,s=r&&r.sourcedData&&r.classification&&r.calculation?r:null,a=(typeof n.estimateId=="number"?n.estimateId:null)??null,o={low:0,high:0,midpoint:0},l=s??{sourcedData:{address:"Unknown address",propertyType:null,estimatedValue:0},classification:{label:"Unknown"},calculation:{totalSavings:o},yearPlacedInService:new Date().getFullYear()},c=l.calculation.totalSavings??o,[u,f]=h.useState(l.sourcedData.estimatedValue),[d,m]=h.useState(l.yearPlacedInService),[p,g]=h.useState(null),x=h.useRef(!1);h.useEffect(()=>{x.current||s&&(x.current=!0,WE({address:l.sourcedData.address,propertyType:l.sourcedData.propertyType??l.classification.label,estimatedValue:l.sourcedData.estimatedValue,totalSavingsMidpoint:c.midpoint}))},[s,c.midpoint,l.sourcedData.address,l.sourcedData.propertyType,l.classification.label,l.sourcedData.estimatedValue]),h.useEffect(()=>{if(!s){g(null);return}const b=s.calculation.conformityStatus,w=["full","partial","none","no_tax"].includes(b)?b:"none",j=HQ({propertyValue:u,landShare:s.landShare,classification:{baselineReclass:s.classification.baselineReclass,upperReclass:s.classification.upperReclass,label:s.classification.label},bonusDepreciationRate:WQ(d),stateConfig:{conformity:w,topRate:s.calculation.stateSavings.high?s.calculation.stateSavings.high/s.calculation.totalYr1DeductionUpper:0}});g(j)},[u,d,s]);const v=(p??l.calculation).totalSavings??c;return s?i.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white shadow-sm p-5 max-w-lg w-full",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("p",{className:"text-sm font-medium text-gray-500 truncate max-w-xs",children:s.sourcedData.address}),i.jsx("span",{className:"text-xs bg-green-100 text-green-700 font-semibold px-2 py-0.5 rounded-full",children:s.classification.label})]}),i.jsxs("div",{className:"bg-green-50 rounded-xl p-4 text-center mb-4",children:[i.jsx("p",{className:"text-xs font-semibold text-green-600 uppercase tracking-wide mb-1",children:"Estimated Year-1 Tax Savings"}),i.jsx("p",{className:"text-4xl font-black text-green-700",children:Qt(v.midpoint)}),i.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["Range: ",Qt(v.low)," – ",Qt(v.high)]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[i.jsxs("div",{children:[i.jsx(Ge,{className:"text-xs text-gray-500 mb-1 block",children:"Property Value"}),i.jsx(dt,{type:"number",value:u,onChange:b=>{f(Number(b.target.value)),ip({field:"propertyValue",estimateId:a})},className:"text-sm"})]}),i.jsxs("div",{children:[i.jsx(Ge,{className:"text-xs text-gray-500 mb-1 block",children:"Year Placed in Service"}),i.jsx(dt,{type:"number",min:2017,max:2030,value:d,onChange:b=>{m(Number(b.target.value)),ip({field:"yearPlacedInService",estimateId:a})},className:"text-sm"})]})]}),i.jsx(Z,{className:"w-full bg-green-600 hover:bg-green-700 text-white font-semibold",onClick:t,children:"View Full Estimate"}),i.jsx("p",{className:"text-xs text-gray-400 text-center mt-2",children:"Editing updates savings instantly — no page reload needed."})]}):i.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50 shadow-sm p-5 max-w-lg w-full",children:[i.jsx("p",{className:"text-sm font-semibold text-red-700",children:"Preview data unavailable"}),i.jsx("p",{className:"text-sm text-red-600 mt-1",children:"We couldn't render the savings preview from this tool response. Please try the address again."})]})}function YQ({input:e,onSubmit:t}){const[n,r]=h.useState(""),[s,a]=h.useState(!1),[o,l]=h.useState(""),c=()=>{const u=n.trim();if(!u||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u)){l("Please enter a valid email address.");return}l(""),a(!0),t(u)};return i.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white shadow-sm p-5 max-w-lg w-full",children:[i.jsx("p",{className:"text-base font-semibold text-gray-900 mb-1",children:"Unlock Your Full Breakdown"}),i.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"Enter your email to see the complete cost segregation analysis — we'll also send you a copy."}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(dt,{type:"email",value:n,onChange:u=>{r(u.target.value),l("")},placeholder:"[email protected]",onKeyDown:u=>u.key==="Enter"&&c(),disabled:s}),o&&i.jsx("p",{className:"text-xs text-red-500",children:o})]}),i.jsx(Z,{className:"mt-3 w-full bg-green-600 hover:bg-green-700 text-white font-semibold",onClick:c,disabled:!n.trim()||s,children:s?"Sending…":"See My Full Estimate"}),i.jsx("p",{className:"text-xs text-gray-400 text-center mt-2",children:"No spam. Unsubscribe anytime."})]})}function Es({label:e,value:t}){return i.jsxs("div",{className:"flex justify-between items-baseline gap-3 py-2 border-b border-gray-100 last:border-0",children:[i.jsx("span",{className:"text-sm text-gray-600 min-w-0 leading-snug",children:e}),i.jsx("span",{className:"text-sm font-semibold text-gray-900 shrink-0 text-right leading-snug",children:t})]})}function jp({input:e,isAuthenticated:t=!1,context:n}){const r=e,s=r.result??e,a=s&&s.sourcedData&&s.classification&&s.calculation?s:null,o=typeof r.stateNote=="string"?r.stateNote:"",l=typeof r.estimateId=="number"?r.estimateId:null,c={low:0,high:0,midpoint:0},u=a??{classification:{baselineReclass:0,upperReclass:0},calculation:{depreciableBasis:0,reclassifiedBasisBaseline:0,reclassifiedBasisUpper:0,totalYr1DeductionBaseline:0,totalYr1DeductionUpper:0,federalSavings:c,stateSavings:c,totalSavings:c,bonusDepreciationRate:0,disclaimerText:""},yearPlacedInService:new Date().getFullYear()},f=u.calculation,d=h.useRef(!1);h.useEffect(()=>{a&&(d.current||(d.current=!0,qE({estimateId:l,isAuthenticated:t})))},[l,t,a]);const m=Math.round(f.bonusDepreciationRate*100),p=Math.round(u.classification.baselineReclass*100),g=Math.round(u.classification.upperReclass*100);return a?i.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white shadow-sm p-3 sm:p-5 w-full",children:[i.jsx("div",{className:"flex items-center justify-end gap-2 mb-1",children:i.jsx("span",{className:"text-xs bg-green-100 text-green-700 font-semibold px-2 py-0.5 rounded-full shrink-0",children:a.classification.label})}),i.jsx("p",{className:"text-sm text-gray-400 mb-4 truncate",children:a.sourcedData.address}),i.jsxs("div",{className:"bg-green-50 rounded-xl p-4 text-center mb-4",children:[i.jsx("p",{className:"text-xs font-semibold text-green-600 uppercase tracking-wide mb-1",children:"Total Year-1 Tax Savings"}),i.jsx("p",{className:"text-4xl font-black text-green-700",children:Qt(f.totalSavings.midpoint)}),i.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[Qt(f.totalSavings.low)," – ",Qt(f.totalSavings.high)]})]}),i.jsxs("div",{className:"mb-4",children:[i.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"Calculation Steps"}),i.jsx(Es,{label:"Property Value",value:Qt(a.sourcedData.estimatedValue)}),i.jsx(Es,{label:"Land Share",value:`${Math.round(a.landShare*100)}%`}),i.jsx(Es,{label:"Depreciable Basis",value:Qt(f.depreciableBasis)}),i.jsx(Es,{label:"Reclassified Basis",value:`${Qt(f.reclassifiedBasisBaseline)} – ${Qt(f.reclassifiedBasisUpper)}`}),i.jsx(Es,{label:"Reclassification %",value:`${p}% – ${g}%`}),i.jsx(Es,{label:`Bonus Depreciation (${m}%)`,value:`${Qt(f.totalYr1DeductionBaseline)} – ${Qt(f.totalYr1DeductionUpper)}`}),i.jsx(Es,{label:"Federal Savings (24%–37%)",value:`${Qt(f.federalSavings.low)} – ${Qt(f.federalSavings.high)}`}
543),i.jsx(Es,{label:"State Savings",value:`${Qt(f.stateSavings.low)} – ${Qt(f.stateSavings.high)}`})]}),o&&i.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3 mb-4 text-xs text-amber-800",children:o}),i.jsx(Z,{className:"w-full bg-green-600 hover:bg-green-700 text-white font-semibold mb-2",onClick:()=>{GE({estimateId:l}),window.open("https://rentalpropertyrefund.com/?rfsn=8928736.a5e206","_blank")},children:"Get a Formal Cost Seg Study"}),n!=="property-tab"&&i.jsx(Z,{variant:"outline",className:"w-full border-green-600 text-green-700 hover:bg-green-50 font-semibold",onClick:()=>window.open("https://repsshield.com/register","_blank"),children:"Track REPS Hours with REPSShield"}),i.jsx("p",{className:"text-xs text-gray-400 mt-4 leading-relaxed",children:f.disclaimerText})]}):i.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50 shadow-sm p-5 w-full",children:[i.jsx("p",{className:"text-sm font-semibold text-red-700",children:"Estimate data unavailable"}),i.jsx("p",{className:"text-sm text-red-600 mt-1",children:"We couldn't render the full estimate from this tool response."})]})}function aoe({type:e,input:t,onAddressSubmit:n,onViewFullEstimate:r,onEmailSubmit:s,isAuthenticated:a=!1,autoSubmitAddress:o}){return e==="tool-showAddressInput"?i.jsx(qQ,{input:t,onSubmit:n,prefillAddress:o}):e==="tool-showPreviewCard"?i.jsx(GQ,{input:t,onViewFullEstimate:r}):e==="tool-showEmailGate"?i.jsx(YQ,{input:t,onSubmit:s}):e==="tool-showFullEstimate"?i.jsx(jp,{input:t,isAuthenticated:a}):null}const KQ="No property value found";function QQ(e){const t=e.calculationResult;return{estimateId:e.id,addressHash:e.addressHash,sourcedData:e.sourcedData,classification:e.classification??{},calculation:t,stateNote:t.stateNote??"",landShare:t.landShare??0,bonusDepreciationRate:t.bonusDepreciationRate??0,yearPlacedInService:new Date().getFullYear()}}function Cf({propertyId:e,propertyNickname:t,status:n}){var m;const{toast:r}=Ht(),s=h.useRef(!1),[a,o]=h.useState(!1),[l,c]=h.useState(""),u=it({queryKey:["costSegEstimate",e],queryFn:()=>kP(e),enabled:n==="complete",staleTime:5*60*1e3,retry:1}),f=Dt({mutationFn:p=>wP(e,p),onSuccess:()=>{o(!1),c("")},onError:p=>{p.message.includes(KQ)?o(!0):r({title:"Cost segregation failed",description:p.message||"Something went wrong. Please try again.",variant:"destructive"})}});if(h.useEffect(()=>{s.current||(n==="none"||n==="failed")&&(s.current=!0,f.mutate(void 0))},[n]),n==="complete"){if(u.isLoading)return i.jsxs("div",{className:"rounded-xl border bg-card p-5 flex flex-col items-center gap-3 text-muted-foreground",children:[t&&i.jsx("p",{className:"text-xs font-medium text-foreground self-start",children:t}),i.jsx(Xe,{className:"h-7 w-7 animate-spin"}),i.jsx("p",{className:"text-sm",children:"Loading estimate…"})]});if(u.isError||!u.data)return i.jsxs("div",{className:"rounded-xl border bg-card p-5 flex flex-col items-center gap-3",children:[t&&i.jsx("p",{className:"text-xs font-medium text-foreground self-start",children:t}),i.jsx(hs,{className:"h-7 w-7 text-destructive"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load the cost segregation estimate."}),i.jsx(Z,{variant:"outline",size:"sm",onClick:()=>u.refetch(),className:"gap-2",children:"Retry"})]});const p=QQ(u.data);return i.jsxs("div",{className:"space-y-3",children:[t&&i.jsxs("p",{className:"text-xs font-medium text-foreground",children:[t," — Tax Savings Estimate"]}),i.jsx(jp,{input:{result:p,stateNote:p.stateNote,estimateId:p.estimateId??null},isAuthenticated:!0,context:"property-tab"})]})}if(f.isPending||n==="pending")return i.jsxs("div",{className:"rounded-xl border bg-card p-5 flex flex-col items-center gap-3 text-muted-foreground",children:[t&&i.jsx("p",{className:"text-xs font-medium text-foreground self-start",children:t}),i.jsx(Xe,{className:"h-7 w-7 animate-spin"}),i.jsx("p",{className:"text-sm",children:"Running cost segregation estimate…"}),i.jsx("p",{className:"text-xs text-muted-foreground/70",children:"This typically takes 10–20 seconds."})]});if(a){const p=g=>{g.preventDefault();const x=parseFloat(l.replace(/[^0-9.]/g,""));if(!x||x<=0){r({title:"Invalid price",description:"Please enter a valid purchase price.",variant:"destructive"});return}f.mutate(x)};return i.jsxs("div",{className:"rounded-xl border bg-card p-5 flex flex-col items-center gap-4 max-w-sm",children:[t&&i.jsx("p",{className:"text-xs font-medium text-foreground self-start",children:t}),i.jsx("div",{className:"flex items-center justify-center h-11 w-11 rounded-full bg-amber-100 dar
543k:bg-amber-900/30",children:i.jsx(vS,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"})}),i.jsxs("div",{className:"text-center space-y-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"Purchase price required"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"We couldn't find a property value. Enter the purchase price to run the estimate."})]}),i.jsxs("form",{onSubmit:p,className:"w-full space-y-3",children:[i.jsxs("div",{children:[i.jsx(Ge,{htmlFor:"costseg-purchase-price",children:"Purchase Price"}),i.jsxs("div",{className:"relative mt-1",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground text-sm",children:"$"}),i.jsx(dt,{id:"costseg-purchase-price",type:"text",inputMode:"numeric",value:l,onChange:g=>c(g.target.value),placeholder:"1,500,000",className:"pl-7",required:!0})]})]}),i.jsx(Z,{type:"submit",className:"w-full",disabled:f.isPending,children:f.isPending?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"h-4 w-4 mr-2 animate-spin"}),"Running…"]}):"Run Cost Seg Estimate"})]})]})}if(n==="failed"&&!f.data)return i.jsxs("div",{className:"rounded-xl border bg-card p-5 flex flex-col items-center gap-3",children:[t&&i.jsx("p",{className:"text-xs font-medium text-foreground self-start",children:t}),i.jsx(hs,{className:"h-7 w-7 text-destructive"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"The cost segregation estimate failed."}),i.jsx(Z,{variant:"outline",size:"sm",onClick:()=>f.mutate(void 0),className:"gap-2",children:"Retry"}),i.jsx("button",{type:"button",className:"text-xs text-muted-foreground/70 hover:text-muted-foreground underline",onClick:()=>o(!0),children:"Enter purchase price manually"})]});const d=((m=f.data)==null?void 0:m.costSegResult)??null;return d?i.jsxs("div",{className:"space-y-3",children:[t&&i.jsxs("p",{className:"text-xs font-medium text-foreground",children:[t," — Tax Savings Estimate"]}),i.jsx(jp,{input:{result:d,stateNote:d.stateNote,estimateId:d.estimateId??null},isAuthenticated:!0,context:"property-tab"})]}):i.jsxs("div",{className:"rounded-xl border bg-card p-5 flex flex-col items-center gap-3 text-muted-foreground",children:[i.jsx(Xe,{className:"h-7 w-7 animate-spin"}),i.jsx("p",{className:"text-sm",children:"Loading estimate…"})]})}const kd=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0});function SP(e,t){return`${kd.format(e)} – ${kd.format(t)}`}function ZQ(e){const t=e.calculationResult,n=t==null?void 0:t.totalSavings;if(!n)return null;const r=Number(n.low),s=Number(n.high),a=Number(n.midpoint??(r+s)/2);return isNaN(r)||isNaN(s)?null:{low:r,high:s,midpoint:a}}function NP(e){var d,m;const t=h.useRef(!1),{data:n=[]}=it({queryKey:["/api/properties"],staleTime:5*60*1e3}),r=n.find(p=>p.id===e)??null,s=(r==null?void 0:r.costSegStatus)??"none",a=(r==null?void 0:r.nickname)??(r==null?void 0:r.address)??`Property ${e}`,o=it({queryKey:["costSegEstimate",e],queryFn:()=>kP(e),enabled:s==="complete",staleTime:5*60*1e3,retry:1}),l=Dt({mutationFn:()=>wP(e)});h.useEffect(()=>{t.current||(s==="none"||s==="failed")&&(t.current=!0,l.mutate())},[s]);let c=null,u=!1,f=!1;if(s==="complete")u=o.isLoading,f=o.isError,o.data&&(c=ZQ(o.data));else if(s==="pending"||l.isPending)u=!0;else if(l.isSuccess){const p=l.data,g=(m=(d=p==null?void 0:p.costSegResult)==null?void 0:d.calculation)==null?void 0:m.totalSavings;if(g){const x=Number(g.low),y=Number(g.high),v=Number(g.midpoint??(x+y)/2);!isNaN(x)&&!isNaN(y)&&(c={low:x,high:y,midpoint:v})}}else l.isError&&(f=!0);return{displayName:a,status:s,savings:c,isLoading:u,isError:f}}function XQ({propertyId:e}){const{data:t=[]}=it({queryKey:["/api/properties"],staleTime:3e5}),n=t.find(a=>a.id===e)??null,r=(n==null?void 0:n.costSegStatus)??"none",s=(n==null?void 0:n.nickname)??(n==null?void 0:n.address)??void 0;return i.jsx(Cf,{propertyId:e,status:r,propertyNickname:s})}function JQ({propertyId:e,isExpanded:t,onToggle:n}){const{displayName:r,status:s,savings:a,isLoading:o,isError:l}=NP(e);return i.jsxs(i.Fragment,{children:[i.jsxs("tr",{className:"border-b border-border/40 last:border-0 hover:bg-muted/30 transition-colors cursor-pointer select-none",onClick:n,"aria-expanded":t,children:[i.jsx("td",{className:"py-3 px-4 text-sm font-medium text-foreground",children:i.jsxs("span",{className:"flex items-center gap-1.5",children:[t?i.jsx(di,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):i.jsx(Bn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),r]})}),i.jsx("td",{className:"py-3 px-4 text-sm text-muted-foreground",children:o?i.jsx(Xe,{className:"h-4 w-4 animate-spin text-muted-foreground"}):l?i.jsxs("span",{className:"text-destructive text-xs flex items-center gap-1",children:[i.jsx(hs,{className:"h-3.5 w-3.5"}),"Failed"]}):a?SP(a.low,a.high):i.jsx("span",{className:"text-muted-foreground
543/50 text-xs",children:"—"})}),i.jsx("td",{className:"py-3 px-4 text-sm font-semibold text-emerald-600 dark:text-emerald-400",children:o?"…":l?"—":a?kd.format(a.midpoint):"—"})]}),t&&i.jsx("tr",{className:"border-b border-border/40",children:i.jsx("td",{colSpan:3,className:"px-4 py-4 bg-muted/20",children:i.jsx(Cf,{propertyId:e,status:s,propertyNickname:r})})})]})}function eZ({propertyId:e,isExpanded:t,onToggle:n}){const{displayName:r,status:s,savings:a,isLoading:o,isError:l}=NP(e);return i.jsxs("div",{className:"rounded-lg border border-border/60 overflow-hidden",children:[i.jsxs("button",{type:"button",className:"w-full p-3 text-left space-y-2 hover:bg-muted/30 transition-colors",onClick:n,"aria-expanded":t,children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:r}),t?i.jsx(di,{className:"h-4 w-4 text-muted-foreground shrink-0"}):i.jsx(Bn,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),o?i.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin"}),"Calculating…"]}):l?i.jsxs("p",{className:"text-xs text-destructive flex items-center gap-1",children:[i.jsx(hs,{className:"h-3.5 w-3.5"}),"Estimate failed"]}):a?i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide font-medium",children:"Range"}),i.jsx("p",{className:"text-xs text-foreground",children:SP(a.low,a.high)})]}),i.jsxs("div",{className:"text-right",children:[i.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide font-medium",children:"Est. Value"}),i.jsx("p",{className:"text-sm font-semibold text-emerald-600 dark:text-emerald-400",children:kd.format(a.midpoint)})]})]}):i.jsx("p",{className:"text-xs text-muted-foreground",children:"No data"})]}),t&&i.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-border/40 bg-muted/20",children:i.jsx(Cf,{propertyId:e,status:s,propertyNickname:r})})]})}function Qw({propertyIds:e}){const[t,n]=h.useState(null);if(e.length===0)return null;if(e.length===1)return i.jsx(XQ,{propertyId:e[0]});function r(s){n(a=>a===s?null:s)}return i.jsx(Je,{className:"w-full shadow-sm overflow-hidden",children:i.jsxs(rt,{className:"p-0",children:[i.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border/40",children:[i.jsx(BD,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400 shrink-0"}),i.jsx("p",{className:"font-semibold text-sm",children:"Cost Segregation Estimates"})]}),i.jsx("div",{className:"hidden sm:block",children:i.jsxs("table",{className:"w-full text-left",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/40 bg-muted/30",children:[i.jsx("th",{className:"py-2 px-4 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Property"}),i.jsx("th",{className:"py-2 px-4 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Estimated Range"}),i.jsx("th",{className:"py-2 px-4 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Estimated Value"})]})}),i.jsx("tbody",{children:e.map(s=>i.jsx(JQ,{propertyId:s,isExpanded:t===s,onToggle:()=>r(s)},s))})]})}),i.jsx("div",{className:"sm:hidden p-3 space-y-2",children:e.map(s=>i.jsx(eZ,{propertyId:s,isExpanded:t===s,onToggle:()=>r(s)},s))}),i.jsx("p",{className:"px-4 py-2.5 text-[10px] text-muted-foreground/60 border-t border-border/30",children:"Estimates are illustrative only and not tax advice. Consult a qualified CPA or cost seg specialist."})]})})}function Ko(e){return e==null?"—":"$"+e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}function tZ(e){return e==null?"—":e<.1?(e*5280).toFixed(0)+" ft":e.toFixed(1)+" mi"}function Zw({propertyId:e,propertyNickname:t}){const{data:n,isLoading:r,isError:s,error:a,refetch:o}=it({queryKey:["/api/properties",e,"rent-estimate"],queryFn:()=>zQ(e),staleTime:1/0});if(r)return i.jsx(Je,{className:"max-w-md",children:i.jsxs(rt,{className:"flex items-center justify-center py-10 gap-3",children:[i.jsx(Xe,{className:"h-5 w-5 animate-spin text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading rent estimate…"})]})});if(s)return i.jsx(Je,{className:"max-w-md",children:i.jsxs(rt,{className:"flex flex-col items-center gap-3 py-8",children:[i.jsx(hs,{className:"h-6 w-6 text-destructive"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:(a==null?void 0:a.message)??"Failed to load rent estimate."}),i.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>o(),className:"gap-2",children:[i.jsx(_l,{className:"h-4 w-4"}),"Retry"]})]})});const l=!n||n.comps.length===0,c=n&&n.rent==null&&n.rentRangeLow==null&&n.rentRangeHigh==null;if(l&&c)return i.jsx(Je,{className:"max-w-md",children:i.jsxs(rt,{className:"flex flex-col items-center gap-3 py-8",children:[i.jsx(cg,{className:"h-8 w-8 text-muted-foreground
543/50"}),i.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Not enough market data to generate a rent estimate for this property."}),i.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>o(),className:"gap-2",children:[i.jsx(_l,{className:"h-4 w-4"}),"Retry"]})]})});const u=(n==null?void 0:n.comps)??[],f=(n==null?void 0:n.rent)??null,d=(n==null?void 0:n.rentRangeLow)??null,m=(n==null?void 0:n.rentRangeHigh)??null;return i.jsxs(Je,{className:"max-w-md overflow-hidden",children:[i.jsxs("div",{className:"flex items-start gap-3 p-4",children:[i.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/30",children:i.jsx(vS,{className:"h-5 w-5 text-green-600 dark:text-green-400"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[t&&i.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:t}),i.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-0.5",children:"Estimated Rent Range"}),i.jsx("p",{className:"text-lg font-bold text-foreground break-words leading-tight",children:d!=null&&m!=null?`${Ko(d)} – ${Ko(m)} / month`:f!=null?`${Ko(f)} / month`:"—"}),f!=null&&(d!=null||m!=null)&&i.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Median: ",Ko(f)," / month"]})]})]}),u.length>0&&i.jsxs("div",{className:"border-t",children:[i.jsx("div",{className:"px-4 pt-3 pb-2",children:i.jsxs("p",{className:"text-xs font-semibold text-foreground",children:["Comparable Properties (",u.length,")"]})}),i.jsx("div",{className:"overflow-x-auto max-h-48",children:i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-muted/50 text-left text-muted-foreground font-medium",children:[i.jsx("th",{className:"px-4 py-1.5",children:"Address"}),i.jsx("th",{className:"px-2 py-1.5 text-right",children:"Dist"}),i.jsx("th",{className:"px-2 py-1.5 text-right",children:"Beds"}),i.jsx("th",{className:"px-2 py-1.5 text-right hidden sm:table-cell",children:"Baths"}),i.jsx("th",{className:"px-2 py-1.5 text-right hidden sm:table-cell",children:"Sqft"}),i.jsx("th",{className:"px-4 py-1.5 text-right",children:"Rent"})]})}),i.jsx("tbody",{className:"divide-y divide-border",children:u.map((p,g)=>i.jsxs("tr",{className:"text-foreground",children:[i.jsx("td",{className:"max-w-[120px] truncate px-4 py-1.5",title:p.formattedAddress,children:p.formattedAddress||"—"}),i.jsx("td",{className:"whitespace-nowrap px-2 py-1.5 text-right",children:tZ(p.distance)}),i.jsx("td",{className:"px-2 py-1.5 text-right",children:p.bedrooms!=null?p.bedrooms:"—"}),i.jsx("td",{className:"px-2 py-1.5 text-right hidden sm:table-cell",children:p.bathrooms!=null?p.bathrooms:"—"}),i.jsx("td",{className:"px-2 py-1.5 text-right hidden sm:table-cell",children:p.squareFootage!=null?p.squareFootage.toLocaleString():"—"}),i.jsx("td",{className:"whitespace-nowrap px-4 py-1.5 text-right font-medium",children:Ko(p.price)})]},p.formattedAddress||g))})]})})]})]})}function nZ({message:e,isPremium:t,onSwitchToAdvisor:n,onUpgradeClick:r}){return i.jsxs(Je,{className:"border-border/30 bg-muted/70 shadow-sm w-full text-foreground",children:[i.jsx(rt,{className:"pt-3 sm:pt-4 pb-2 px-3 sm:px-4",children:i.jsx("div",{className:"text-xs sm:text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:e})}),i.jsx(KC,{className:"px-3 sm:px-4 pb-3 sm:pb-4 pt-1 flex-col sm:flex-row gap-2 sm:gap-0",children:t?i.jsxs(Z,{size:"sm",variant:"default",className:"gap-1.5 w-full sm:w-auto",onClick:n,children:[i.jsx(ls,{className:"h-3.5 w-3.5 sm:hidden"}),"Switch to Advisor",i.jsx(ls,{className:"h-3.5 w-3.5 hidden sm:inline-block"})]}):i.jsxs(Z,{size:"sm",variant:"default",className:"gap-1.5 w-full sm:w-auto text-xs sm:text-sm whitespace-normal h-auto min-h-[2rem] sm:min-h-0 py-1.5 sm:py-1",onClick:r,children:[i.jsx(Qn,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate sm:whitespace-normal",children:"Upgrade to Shield Advisor & Switch"}),i.jsx(ls,{className:"h-3.5 w-3.5 shrink-0"})]})})]})}function rZ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const sZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aZ={};function Xw(e,t){return(aZ.jsx?iZ:sZ).test(e)}const oZ=/[ \t\n\f\r]/g;function lZ(e){return typeof e=="object"?e.type==="text"?Jw(e.value):!1:Jw(e)}function Jw(e){return e.replace(oZ,"")===""}class Ec{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ec.prototype.normal={};Ec.prototype.property={};Ec.prototype.space=void 0;function jP(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ec(n,r,t)}function Cp(e){return e.toLowerCase()}class _n{constructor(t,n){this.attribute=n,this.property=t}}_n.prototype.attribute="";_n.prototype.booleanish=!1;_n.prototype.boolean=!1;_n.prototype.commaOrSpaceSeparated=!1;_n.prototype.commaSeparated=!1;_n.prototype.defined=!1;_n.prototype.mustUseProperty=!1;_n.prototype.number=!1;_n.prototype.overloadedBoolean=!1;_n.prototype.property="";_n.prototype.spaceSeparated=!1;_n.prototype.space=void 0;let cZ=0;const Fe=xa(),Mt=xa(),Tp=xa(),le=xa(),ht=xa(),Wi=xa(),Rn=xa();function xa(){return 2**++cZ}const Ep=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:Mt,commaOrSpaceSeparated:Rn,commaSeparated:Wi,number:le,overloadedBoolean:Tp,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),Ih=Object.keys(Ep);class My extends _n{constructor(t,n,r,s){let a=-1;if(super(t,n),e1(this,"space",s),typeof r=="number")for(;++a<Ih.length;){const o=Ih[a];e1(this,Ih[a],(r&Ep[o])===Ep[o])}}}My.prototype.defined=!0;function e1(e,t,n){n&&(e[t]=n)}function Io(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new My(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Cp(r)]=r,n[Cp(a.attribute)]=r}return new Ec(t,n,e.space)}const CP=Io({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControl
vendor: 4,114 bytes, line 543
543s:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:ht,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:le,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:ht,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:Mt,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function TP(e,t){return t in e?e[t]:t}function EP(e,t){return TP(e,t.toLowerCase())}const uZ=Io({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wi,acceptCharset:ht,accessKey:ht,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alpha:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:ht,autoFocus:Fe,autoPlay:Fe,blocking:ht,capture:null,charSet:null,checked:Fe,cite:null,className:ht,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:Mt,controls:Fe,controlsList:ht,coords:le|Wi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:Tp,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:ht,height:le,hidden:Tp,high:le,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:ht,itemRef:ht,itemScope:Fe,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Fe,optimum:le,pattern:null,ping:ht,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:ht,required:Fe,reversed:Fe,rows:le,rowSpan:le,sandbox:ht,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootCustomElementRegistry:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shadowRootSerializable:Fe,shape:null,size:le,sizes:null,slot:null,span:le,spell
543Check:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:Fe,useMap:null,value:Mt,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Fe,disablePictureInPicture:Fe,disableRemotePlayback:Fe,exportParts:Wi,part:ht,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:EP}),dZ=Io({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
543-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Rn,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:ht,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:Fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wi,g2:Wi,glyphName:Wi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:Rn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 5,302 bytes, lines 543-544
543Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Rn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Rn,rev:Rn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Rn,requiredFeatures:Rn,requiredFonts:Rn,requiredFormats:Rn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:Rn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Rn,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Rn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:TP}),_P=Io({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),AP=Io({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:EP}),PP=Io({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),fZ={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},hZ=/[A-Z]/g,t1=/-[a-z]/g,mZ=/^data[-\w.:]+$/i;function pZ(e,t){const n=Cp(t);let r=t,s=_n;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&mZ.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(t1,xZ);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!t1.test(a)){let o=a.replace(hZ,gZ);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=My}return new s(r,t)}function gZ(e){return"-"+e.toLowerCase()}function xZ(e){return e.charAt(1).toUpperCase()}const yZ=jP([CP,uZ,_P,AP,PP],"html"),Dy=jP([CP,dZ,_P,AP,PP],"svg");function vZ(e){return e.join(" ").trim()}var Oy={},n1=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,bZ=/\n/g,wZ=/^\s*/,kZ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,SZ=/^:\s*/,NZ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,jZ=/^[;\s]*/,CZ=/^\s+|\s+$/g,TZ=`
544`,r1="/",s1="*",Ti="",EZ="comment",_Z="declaration";function AZ(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(g){var x=g.match(bZ);x&&(n+=x.length);var y=g.lastIndexOf(TZ);r=~y?g.length-y:r+g.length}function a(){var g={line:n,column:r};return function(x){return x.position=new o(g),u(),x}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(g){var x=new Error(t.source+":"+n+":"+r+": "+g);if(x.reason=g,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function c(g){var x=g.exec(e);if(x){var y=x[0];return s(y),e=e.slice(y.length),x}}function u(){c(wZ)}function f(g){var x;for(g=g||[];x=d();)x!==!1&&g.push(x);return g}function d(){var g=a();if(!(r1!=e.charAt(0)||s1!=e.charAt(1))){for(var x=2;Ti!=e.charAt(x)&&(s1!=e.charAt(x)||r1!=e.charAt(x+1));)++x;if(x+=2,Ti===e.charAt(x-1))return l("End of comment missing");var y=e.slice(2,x-2);return r+=2,s(y),e=e.slice(x),r+=2,g({type:EZ,comment:y})}}function m(){var g=a(),x=c(kZ);if(x){if(d(),!c(SZ))return l("property missing ':'");var y=c(NZ),v=g({type:_Z,property:i1(x[0].replace(n1,Ti)),value:y?i1(y[0].replace(n1,Ti)):Ti});return c(jZ),v}}function p(){var g=[];f(g);for(var x;x=m();)x!==!1&&(g.push(x),f(g));return g}return u(),p()}function i1(e){return e?e.replace(CZ,Ti):Ti}var PZ=AZ,RZ=kl&&kl.__importDefault||function(e){return e&&e.__esMo
544dule?e:{default:e}};Object.defineProperty(Oy,"__esModule",{value:!0});Oy.default=MZ;const IZ=RZ(PZ);function MZ(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,IZ.default)(e),s=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:l}=a;s?t(o,l,a):l&&(n=n||{},n[o]=l)}),n}var Tf={};Object.defineProperty(Tf,"__esModule",{value:!0});Tf.camelCase=void 0;var DZ=/^--[a-zA-Z0-9_-]+$/,OZ=/-([a-z])/g,LZ=/^[^-]+$/,FZ=/^-(webkit|moz|ms|o|khtml)-/,VZ=/^-(ms)-/,$Z=function(e){return!e||LZ.test(e)||DZ.test(e)},zZ=function(e,t){return t.toUpperCase()},a1=function(e,t){return"".concat(t,"-")},UZ=function(e,t){return t===void 0&&(t={}),$Z(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(VZ,a1):e=e.replace(FZ,a1),e.replace(OZ,zZ))};Tf.camelCase=UZ;var BZ=kl&&kl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},HZ=BZ(Oy),WZ=Tf;function _p(e,t){var n={};return!e||typeof e!="string"||(0,HZ.default)(e,function(r,s){r&&s&&(n[(0,WZ.camelCase)(r,t)]=s)}),n}_p.default=_p;var qZ=_p;const GZ=Gp(qZ),RP=IP("end"),Ly=IP("start");function IP(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function YZ(e){const t=Ly(e),n=RP(e);if(t&&n)return{start:t,end:n}}function vl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?o1(e.position):"start"in e||"end"in e?o1(e):"line"in e||"column"in e?Ap(e):""}function Ap(e){return l1(e&&e.line)+":"+l1(e&&e.column)}function o1(e){return Ap(e&&e.start)+"-"+Ap(e&&e.end)}function l1(e){return e&&typeof e=="number"?e:1}
544class sn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=vl(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sn.prototype.file="";sn.prototype.name="";sn.prototype.reason="";sn.prototype.message="";sn.prototype.stack="";sn.prototype.column=void 0;sn.prototype.line=void 0;sn.prototype.ancestors=void 0;sn.prototype.cause=void 0;sn.prototype.fatal=void 0;sn.prototype.place=void 0;sn.prototype.ruleId=void 0;sn.prototype.source=void 0;const Fy={}.hasOwnProperty,KZ=new Map,QZ=/[A-Z]/g,ZZ=new Set(["table","tbody","thead","tfoot","tr"]),XZ=new Set(["td","th"]),MP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function JZ(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=oX(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 108,346 bytes, lines 544-569
544if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=aX(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Dy:yZ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=DP(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function DP(e,t,n){if(t.type==="element")return eX(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tX(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rX(e,t,n);if(t.type==="mdxjsEsm")return nX(e,t);if(t.type==="root")return sX(e,t,n);if(t.type==="text")return iX(e,t)}function eX(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Dy,e.schema=s),e.ancestors.push(t);const a=LP(e,t.tagName,!1),o=lX(e,t);let l=$y(e,t);return ZZ.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!lZ(c):!0})),OP(e,o,a,t),Vy(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function tX(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Yl(e,t.position)}function nX(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Yl(e,t.position)}function rX(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Dy,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:LP(e,t.name,!0),o=cX(e,t),l=$y(e,t);return OP(e,o,a,t),Vy(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function sX(e,t,n){const r={};return Vy(r,$y(e,t)),e.create(t,e.Fragment,r,n)}function iX(e,t){return t.value}function OP(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Vy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function aX(e,t,n){return r;function r(s,a,o,l){const u=Array.isArray(o.children)?n:t;return l?u(a,o,l):u(a,o)}}function oX(e,t){return n;function n(r,s,a,o){const l=Array.isArray(a.children),c=Ly(r);return t(s,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function lX(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Fy.call(t.properties,s)){const a=uX(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&XZ.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function cX(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Yl(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Yl(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function $y(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:KZ;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=s.get(c)||0;o=c+"-"+u,s.set(c,u+1)}}const l=DP(e,a,o);l!==void 0&&n.push(l)}return n}function uX(e,t,n){const r=pZ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?rZ(n):vZ(n)),r.property==="style"){let s=typeof n=="object"?n:dX(e,String(n));return e.stylePropertyNameCase==="css"&&(s=fX(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?fZ[r.property]||r.property:r.attribute,n]}}function dX(e,t){try{return GZ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new sn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=MP+"#cannot-parse-style-attribute",s}}function LP(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,o;for(;++a<s.length;){const l=Xw(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=Xw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Fy.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yl(e)}function Yl(e,t){const n=new sn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=MP+"#cannot-handle-mdx-estrees-without-createevaluater",n}function fX(e){const t={};let n;for(n in e)Fy.call(e,n)&&(t[hX(n)]=e[n]);return t}function hX(e){let t=e.replace(QZ,mX);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mX(e){return"-"+e.toLowerCase()}const Mh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},pX={};function zy(e,t){const n=pX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return FP(e,r,s)}function FP(e,t,n){if(gX(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return c1(e.children,t,n)}return Array.isArray(e)?c1(e,t,n):""}function c1(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=FP(e[s],t,n);return r.join("")}function gX(e){return!!(e&&typeof e=="object")}const u1=document.createElement("i");function Uy(e){const t="&"+e+";";u1.innerHTML=t;const n=u1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Un(e,t,n,r){const s=e.length;let a=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Kn(e,t){return e.length>0?(Un(e,e.length,0,t),e):t}const d1={}.hasOwnProperty;function VP(e){const t={};let n=-1;for(;++n<e.length;)xX(t,e[n]);return t}function xX(e,t){let n;for(n in t){const s=(d1.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){d1.call(s,o)||(s[o]=[]);const l=a[o];yX(s[o],Array.isArray(l)?l:l?[l]:[])}}}function yX(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Un(e,0,0,r)}function $P(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ar(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=yi(/[A-Za-z]/),rn=yi(/[\dA-Za-z]/),vX=yi(/[#-'*+\--9=?A-Z^-~]/);function Sd(e){return e!==null&&(e<32||e===127)}const Pp=yi(/\d/),bX=yi(/[\dA-Fa-f]/),wX=yi(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function mt(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const Ef=yi(new RegExp("\\p{P}|\\p{S}","u")),ra=yi(/\s/);function yi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Mo(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&rn(e.charCodeAt(n+1))&&rn(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function et(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Ye(c)?(e.enter(n),l(c)):t(c)}function l(c){return Ye(c)&&a++<s?(e.consume(c),l):(e.exit(n),t(c))}}const kX={tokenize:SX};function SX(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),et(e,t,"linePrefix")}function s(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Te(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const NX={tokenize:jX},f1={tokenize:CX};function jX(e){const t=this,n=[];let r=0,s,a,o;return l;function l(w){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&b();const j=t.events.length;let S=j,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){C=t.events[S][1].end;break}v(r);let I=j;for(;I<t.events.length;)t.events[I][1].end={...C},I++;return Un(t.events,S+1,0,t.events.slice(j)),t.events.length=I,u(w)}return l(w)}function u(w){if(r===n.length){if(!s)return m(w);if(s.currentConstruct&&s.currentConstruct.concrete)return g(w);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(f1,f,d)(w)}function f(w){return s&&b(),v(r),m(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(w)}function m(w){return t.containerState={},e.attempt(f1,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),m(w)}function g(w){if(w===null){s&&b(),v(0),e.consume(w);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),x(w)}function x(w){if(w===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return Te(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),x)}function y(w,j){const S=t.sliceStream(w);if(j&&S.push(null),w.previous=a,a&&(a.next=w),a=w,s.defineSkip(w.start),s.write(S),t.parser.lazy[w.start.line]){let C=s.events.length;for(;C--;)if(s.events[C][1].start.offset<o&&(!s.events[C][1].end||s.events[C][1].end.offset>o))return;const I=t.events.length;let E=I,N,k;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(N){k=t.events[E][1].end;break}N=!0}for(v(r),C=I;C<t.events.length;)t.events[C][1].end={...k},C++;Un(t.events,E+1,0,t.events.slice(I)),t.events.length=C}}function v(w){let j=n.length;for(;j-- >w;){const S=n[j];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function b(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function CX(e,t,n){return et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wo(e){if(e===null||mt(e)||ra(e))return 1;if(Ef(e))return 2}function _f(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Rp={name:"attention",resolveAll:TX,tokenize:EX};function TX(e,t){let n=-1,r,s,a,o,l,c,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},m={...e[n][1].start};h1(d,-c),h1(m,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Kn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Kn(u,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=Kn(u,_f(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Kn(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Kn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Un(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function EX(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=wo(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const u=e.exit("attentionSequence"),f=wo(c),d=!f||f===2&&s||n.includes(c),m=!s||s===2&&f||n.includes(r);return u._open=!!(a===42?d:d&&(s||!m)),u._close=!!(a===42?m:m&&(f||!d)),t(c)}}function h1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _X={name:"autolink",tokenize:AX};function AX(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return hn(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||rn(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||rn(p))&&r++<32?(e.consume(p),l):(r=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Sd(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),f):vX(p)?(e.consume(p),u):n(p)}function f(p){return rn(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||rn(p))&&r++<63){const g=p===45?m:d;return e.consume(p),g}return n(p)}}const _c={partial:!0,tokenize:PX};function PX(e,t,n){return r;function r(a){return Ye(a)?et(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Te(a)?t(a):n(a)}}const zP={continuation:{tokenize:IX},exit:MX,name:"blockQuote",tokenize:RX};function RX(e,t,n){const r=this;return s;function s(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return Ye(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function IX(e,t,n){const r=this;return s;function s(o){return Ye(o)?et(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(zP,t,n)(o)}}function MX(e){e.exit("blockQuote")}const UP={name:"characterEscape",tokenize:DX};function DX(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return wX(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const BP={name:"characterReference",tokenize:OX};function OX(e,t,n){const r=this;let s=0,a,o;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,o=rn,f(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=bX,f):(e.enter("characterReferenceValue"),a=7,o=Pp,f(d))}function f(d){if(d===59&&s){const m=e.exit("characterReferenceValue");return o===rn&&!Uy(r.sliceSerialize(m))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&s++<a?(e.consume(d),f):n(d)}}const m1={partial:!0,tokenize:FX},p1={concrete:!0,name:"codeFenced",tokenize:LX};function LX(e,t,n){const r=this,s={partial:!0,tokenize:S};let a=0,o=0,l;return c;function c(C){return u(C)}function u(C){const I=r.events[r.events.length-1];return a=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===l?(o++,e.consume(C),f):o<3?n(C):(e.exit("codeFencedFenceSequence"),Ye(C)?et(e,d,"whitespace")(C):d(C))}function d(C){return C===null||Te(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(m1,x,j)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||Te(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):Ye(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,p,"whitespace")(C)):C===96&&C===l?n(C):(e.consume(C),m)}function p(C){return C===null||Te(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||Te(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===l?n(C):(e.consume(C),g)}function x(C){return e.attempt(s,j,y)(C)}function y(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),v}function v(C){return a>0&&Ye(C)?et(e,b,"linePrefix",a+1)(C):b(C)}function b(C){return C===null||Te(C)?e.check(m1,x,j)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||Te(C)?(e.exit("codeFlowValue"),b(C)):(e.consume(C),w)}function j(C){return e.exit("codeFenced"),t(C)}function S(C,I,E){let N=0;return k;function k(V){return C.enter("lineEnding"),C.consume(V),C.exit("lineEnding"),A}function A(V){return C.enter("codeFencedFence"),Ye(V)?et(C,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):M(V)}function M(V){return V===l?(C.enter("codeFencedFenceSequence"),L(V)):E(V)}function L(V){return V===l?(N++,C.consume(V),L):N>=o?(C.exit("codeFencedFenceSequence"),Ye(V)?et(C,F,"whitespace")(V):F(V)):E(V)}function F(V){return V===null||Te(V)?(C.exit("codeFencedFence"),I(V)):E(V)}}}function FX(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Dh={name:"codeIndented",tokenize:$X},VX={partial:!0,tokenize:zX};function $X(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),et(e,a,"linePrefix",5)(u)}function a(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Te(u)?e.attempt(VX,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Te(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function zX(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Te(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):et(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Te(o)?s(o):n(o)}}const UX={name:"codeText",previous:HX,resolve:BX,tokenize:WX};function BX(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function HX(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function WX(e,t,n){let r=0,s,a;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(a=e.enter("codeTextSequence"),s=0,f(d)):Te(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Te(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),s++,f):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}class qX{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Qo(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Qo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Qo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qo(this.left,n.reverse())}}}function Qo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function HP(e){const t={};let n=-1,r,s,a,o,l,c,u;const f=new qX(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,GX(f,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(o=f.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(f.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...f.get(s)[1].start},l=f.slice(s,n),l.unshift(r),f.splice(s,n-s+1,l))}}return Un(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function GX(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let f,d,m=-1,p=n,g=0,x=0;const y=[x];for(;p;){for(;e.get(++s)[1]!==p;);a.push(s),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(f),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(x=m+1,y.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),m=y.length;m--;){const v=l.slice(y[m],y[m+1]),b=a.pop();c.push([b,b+v.length-1]),e.splice(b,2,v)}for(c.reverse(),m=-1;++m<c.length;)u[g+c[m][0]]=g+c[m][1],g+=c[m][1]-c[m][0]-1;return u}const YX={resolve:QX,tokenize:ZX},KX={partial:!0,tokenize:XX};function QX(e){return HP(e),e}function ZX(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?a(l):Te(l)?e.check(KX,o,a)(l):(e.consume(l),s)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function XX(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),et(e,a,"linePrefix")}function a(o){if(o===null||Te(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function WP(e,t,n,r,s,a,o,l,c){const u=c||Number.POSITIVE_INFINITY;let f=0;return d;function d(v){return v===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(v),e.exit(a),m):v===null||v===32||v===41||Sd(v)?n(v):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(v))}function m(v){return v===62?(e.enter(a),e.consume(v),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(l),m(v)):v===null||v===60||Te(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function x(v){return!f&&(v===null||v===41||mt(v))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(v)):f<u&&v===40?(e.consume(v),f++,x):v===41?(e.consume(v),f--,x):v===null||v===32||v===40||Sd(v)?n(v):(e.consume(v),v===92?y:x)}function y(v){return v===40||v===41||v===92?(e.consume(v),x):x(v)}}function qP(e,t,n,r,s,a){const o=this;let l=0,c;return u;function u(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(a),f}function f(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(a),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):Te(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Te(p)||l++>999?(e.exit("chunkString"),f(p)):(e.consume(p),c||(c=!Ye(p)),p===92?m:d)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function GP(e,t,n,r,s,a){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),o=m===40?41:m,c):n(m)}function c(m){return m===o?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):(e.enter(a),u(m))}function u(m){return m===o?(e.exit(a),c(o)):m===null?n(m):Te(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),et(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===o||m===null||Te(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?d:f)}function d(m){return m===o||m===92?(e.consume(m),f):f(m)}}function bl(e,t){let n;return r;function r(s){return Te(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Ye(s)?et(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const JX={name:"definition",tokenize:tJ},eJ={partial:!0,tokenize:nJ};function tJ(e,t,n){const r=this;let s;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return qP.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=ar(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return mt(p)?bl(e,u)(p):u(p)}function u(p){return WP(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(eJ,d,d)(p)}function d(p){return Ye(p)?et(e,m,"whitespace")(p):m(p)}function m(p){return p===null||Te(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function nJ(e,t,n){return r;function r(l){return mt(l)?bl(e,s)(l):n(l)}function s(l){return GP(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Ye(l)?et(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Te(l)?t(l):n(l)}}const rJ={name:"hardBreakEscape",tokenize:sJ};function sJ(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Te(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const iJ={name:"headingAtx",resolve:aJ,tokenize:oJ};function aJ(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Un(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function oJ(e,t,n){let r=0;return s;function s(f){return e.enter("atxHeading"),a(f)}function a(f){return e.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(e.consume(f),o):f===null||mt(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),c(f)):f===null||Te(f)?(e.exit("atxHeading"),t(f)):Ye(f)?et(e,l,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function c(f){return f===35?(e.consume(f),c):(e.exit("atxHeadingSequence"),l(f))}function u(f){return f===null||f===35||mt(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),u)}}const lJ=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],g1=["pre","script","style","textarea"],cJ={concrete:!0,name:"htmlFlow",resolveTo:fJ,tokenize:hJ},uJ={partial:!0,tokenize:pJ},dJ={partial:!0,tokenize:mJ};function fJ(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function hJ(e,t,n){const r=this;let s,a,o,l,c;return u;function u(R){return f(R)}function f(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),m):R===47?(e.consume(R),a=!0,x):R===63?(e.consume(R),s=3,r.interrupt?t:_):hn(R)?(e.consume(R),o=String.fromCharCode(R),y):n(R)}function m(R){return R===45?(e.consume(R),s=2,p):R===91?(e.consume(R),s=5,l=0,g):hn(R)?(e.consume(R),s=4,r.interrupt?t:_):n(R)}function p(R){return R===45?(e.consume(R),r.interrupt?t:_):n(R)}function g(R){const q="CDATA[";return R===q.charCodeAt(l++)?(e.consume(R),l===q.length?r.interrupt?t:M:g):n(R)}function x(R){return hn(R)?(e.consume(R),o=String.fromCharCode(R),y):n(R)}function y(R){if(R===null||R===47||R===62||mt(R)){const q=R===47,Q=o.toLowerCase();return!q&&!a&&g1.includes(Q)?(s=1,r.interrupt?t(R):M(R)):lJ.includes(o.toLowerCase())?(s=6,q?(e.consume(R),v):r.interrupt?t(R):M(R)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):a?b(R):w(R))}return R===45||rn(R)?(e.consume(R),o+=String.fromCharCode(R),y):n(R)}function v(R){return R===62?(e.consume(R),r.interrupt?t:M):n(R)}function b(R){return Ye(R)?(e.consume(R),b):k(R)}function w(R){return R===47?(e.consume(R),k):R===58||R===95||hn(R)?(e.consume(R),j):Ye(R)?(e.consume(R),w):k(R)}function j(R){return R===45||R===46||R===58||R===95||rn(R)?(e.consume(R),j):S(R)}function S(R){return R===61?(e.consume(R),C):Ye(R)?(e.consume(R),S):w(R)}function C(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),c=R,I):Ye(R)?(e.consume(R),C):E(R)}function I(R){return R===c?(e.consume(R),c=null,N):R===null||Te(R)?n(R):(e.consume(R),I)}function E(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||mt(R)?S(R):(e.consume(R),E)}function N(R){return R===47||R===62||Ye(R)?w(R):n(R)}function k(R){return R===62?(e.consume(R),A):n(R)}function A(R){return R===null||Te(R)?M(R):Ye(R)?(e.consume(R),A):n(R)}function M(R){return R===45&&s===2?(e.consume(R),U):R===60&&s===1?(e.consume(R),P):R===62&&s===4?(e.consume(R),G):R===63&&s===3?(e.consume(R),_):R===93&&s===5?(e.consume(R),D):Te(R)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(uJ,z,L)(R)):R===null||Te(R)?(e.exit("htmlFlowData"),L(R)):(e.consume(R),M)}function L(R){return e.check(dJ,F,z)(R)}function F(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),V}function V(R){return R===null||Te(R)?L(R):(e.enter("htmlFlowData"),M(R))}function U(R){return R===45?(e.consume(R),_):M(R)}function P(R){return R===47?(e.consume(R),o="",T):M(R)}function T(R){if(R===62){const q=o.toLowerCase();return g1.includes(q)?(e.consume(R),G):M(R)}return hn(R)&&o.length<8?(e.consume(R),o+=String.fromCharCode(R),T):M(R)}function D(R){return R===93?(e.consume(R),_):M(R)}function _(R){return R===62?(e.consume(R),G):R===45&&s===2?(e.consume(R),_):M(R)}function G(R){return R===null||Te(R)?(e.exit("htmlFlowData"),z(R)):(e.consume(R),G)}function z(R){return e.exit("htmlFlow"),t(R)}}function mJ(e,t,n){const r=this;return s;function s(o){return Te(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function pJ(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(_c,t,n)}}const gJ={name:"htmlText",tokenize:xJ};function xJ(e,t,n){const r=this;let s,a,o;return l;function l(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),c}function c(_){return _===33?(e.consume(_),u):_===47?(e.consume(_),S):_===63?(e.consume(_),w):hn(_)?(e.consume(_),E):n(_)}function u(_){return _===45?(e.consume(_),f):_===91?(e.consume(_),a=0,g):hn(_)?(e.consume(_),b):n(_)}function f(_){return _===45?(e.consume(_),p):n(_)}function d(_){return _===null?n(_):_===45?(e.consume(_),m):Te(_)?(o=d,P(_)):(e.consume(_),d)}function m(_){return _===45?(e.consume(_),p):d(_)}function p(_){return _===62?U(_):_===45?m(_):d(_)}function g(_){const G="CDATA[";return _===G.charCodeAt(a++)?(e.consume(_),a===G.length?x:g):n(_)}function x(_){return _===null?n(_):_===93?(e.consume(_),y):Te(_)?(o=x,P(_)):(e.consume(_),x)}function y(_){return _===93?(e.consume(_),v):x(_)}function v(_){return _===62?U(_):_===93?(e.consume(_),v):x(_)}function b(_){return _===null||_===62?U(_):Te(_)?(o=b,P(_)):(e.consume(_),b)}function w(_){return _===null?n(_):_===63?(e.consume(_),j):Te(_)?(o=w,P(_)):(e.consume(_),w)}function j(_){return _===62?U(_):w(_)}function S(_){return hn(_)?(e.consume(_),C):n(_)}function C(_){return _===45||rn(_)?(e.consume(_),C):I(_)}function I(_){return Te(_)?(o=I,P(_)):Ye(_)?(e.consume(_),I):U(_)}function E(_){return _===45||rn(_)?(e.consume(_),E):_===47||_===62||mt(_)?N(_):n(_)}function N(_){return _===47?(e.consume(_),U):_===58||_===95||hn(_)?(e.consume(_),k):Te(_)?(o=N,P(_)):Ye(_)?(e.consume(_),N):U(_)}function k(_){return _===45||_===46||_===58||_===95||rn(_)?(e.consume(_),k):A(_)}function A(_){return _===61?(e.consume(_),M):Te(_)?(o=A,P(_)):Ye(_)?(e.consume(_),A):N(_)}function M(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),s=_,L):Te(_)?(o=M,P(_)):Ye(_)?(e.consume(_),M):(e.consume(_),F)}function L(_){return _===s?(e.consume(_),s=void 0,V):_===null?n(_):Te(_)?(o=L,P(_)):(e.consume(_),L)}function F(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||mt(_)?N(_):(e.consume(_),F)}function V(_){return _===47||_===62||mt(_)?N(_):n(_)}function U(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function P(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),T}function T(_){return Ye(_)?et(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):D(_)}function D(_){return e.enter("htmlTextData"),o(_)}}const By={name:"labelEnd",resolveAll:wJ,resolveTo:kJ,tokenize:SJ},yJ={tokenize:NJ},vJ={tokenize:jJ},bJ={tokenize:CJ};function wJ(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Un(e,0,e.length,n),e}function kJ(e,t){let n=e.length,r=0,s,a,o,l;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},f={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=Kn(l,e.slice(a+1,a+r+3)),l=Kn(l,[["enter",f,t]]),l=Kn(l,_f(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=Kn(l,[["exit",f,t],e[o-2],e[o-1],["exit",u,t]]),l=Kn(l,e.slice(o+1)),l=Kn(l,[["exit",c,t]]),Un(e,a,e.length,l),e}function SJ(e,t,n){const r=this;let s=r.events.length,a,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return l;function l(m){return a?a._inactive?d(m):(o=r.parser.defined.includes(ar(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),c):n(m)}function c(m){return m===40?e.attempt(yJ,f,o?f:d)(m):m===91?e.attempt(vJ,f,o?u:d)(m):o?f(m):d(m)}function u(m){return e.attempt(bJ,f,d)(m)}function f(m){return t(m)}function d(m){return a._balanced=!0,n(m)}}function NJ(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),s}function s(d){return mt(d)?bl(e,a)(d):a(d)}function a(d){return d===41?f(d):WP(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return mt(d)?bl(e,c)(d):f(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?GP(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return mt(d)?bl(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function jJ(e,t,n){const r=this;return s;function s(l){return qP.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(ar(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function CJ(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const TJ={name:"labelStartImage",resolveAll:By.resolveAll,tokenize:EJ};function EJ(e,t,n){const r=this;return s;function s(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const _J={name:"labelStartLink",resolveAll:By.resolveAll,tokenize:AJ};function AJ(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Oh={name:"lineEnding",tokenize:PJ};function PJ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,t,"linePrefix")}}const Su={name:"thematicBreak",tokenize:RJ};function RJ(e,t,n){let r=0,s;return a;function a(u){return e.enter("thematicBreak"),o(u)}function o(u){return s=u,l(u)}function l(u){return u===s?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Te(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Ye(u)?et(e,l,"whitespace")(u):l(u))}}const vn={continuation:{tokenize:OJ},exit:FJ,name:"list",tokenize:DJ},IJ={partial:!0,tokenize:VJ},MJ={partial:!0,tokenize:LJ};function DJ(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Pp(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Su,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Pp(p)&&++o<10?(e.consume(p),c):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(_c,r.interrupt?n:f,e.attempt(IJ,m,d))}function f(p){return r.containerState.initialBlankLine=!0,a++,m(p)}function d(p){return Ye(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function OJ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_c,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Ye(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(MJ,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(vn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function LJ(e,t,n){const r=this;return et(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function FJ(e){e.exit(this.containerState.type)}function VJ(e,t,n){const r=this;return et(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!Ye(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const x1={name:"setextUnderline",resolveTo:$J,tokenize:zJ};function $J(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function zJ(e,t,n){const r=this;let s;return a;function a(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Ye(u)?et(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Te(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const UJ={tokenize:BJ};function BJ(e){const t=this,n=e.attempt(_c,r,e.attempt(this.parser.constructs.flowInitial,s,et(e,e.attempt(this.parser.constructs.flow,s,e.attempt(YX,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const HJ={resolveAll:KP()},WJ=YP("string"),qJ=YP("text");function YP(e){return{resolveAll:KP(e==="text"?GJ:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,o,l);return o;function o(f){return u(f)?a(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),c}function c(f){return u(f)?(n.exit("data"),a(f)):(n.consume(f),c)}function u(f){if(f===null)return!0;const d=s[f];let m=-1;if(d)for(;++m<d.length;){const p=d[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function KP(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function GJ(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,o=-1,l=0,c;for(;a--;){const u=s[a];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const YJ={42:vn,43:vn,45:vn,48:vn,49:vn,50:vn,51:vn,52:vn,53:vn,54:vn,55:vn,56:vn,57:vn,62:zP},KJ={91:JX},QJ={[-2]:Dh,[-1]:Dh,32:Dh},ZJ={35:iJ,42:Su,45:[x1,Su],60:cJ,61:x1,95:Su,96:p1,126:p1},XJ={38:BP,92:UP},JJ={[-5]:Oh,[-4]:Oh,[-3]:Oh,33:TJ,38:BP,42:Rp,60:[_X,gJ],91:_J,92:[rJ,UP],93:By,95:Rp,96:UX},eee={null:[Rp,HJ]},tee={null:[42,95]},nee={null:[]},ree=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:tee,contentInitial:KJ,disable:nee,document:YJ,flow:ZJ,flowInitial:QJ,insideSpan:eee,string:XJ,text:JJ},Symbol.toStringTag,{value:"Module"}));function see(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let o=[],l=[];const c={attempt:I(S),check:I(C),consume:b,enter:w,exit:j,interrupt:I(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:g,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:d};let f=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function d(A){return o=Kn(o,A),y(),o[o.length-1]!==null?[]:(E(t,0),u.events=_f(a,u.events,u),u.events)}function m(A,M){return aee(p(A),M)}function p(A){return iee(o,A)}function g(){const{_bufferIndex:A,_index:M,line:L,column:F,offset:V}=r;return{_bufferIndex:A,_index:M,line:L,column:F,offset:V}}function x(A){s[A.line]=A.column,k()}function y(){let A;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<M.length;)v(M.charCodeAt(r._bufferIndex));else v(M)}}function v(A){f=f(A)}function b(A){Te(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,k()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=A}function w(A,M){const L=M||{};return L.type=A,L.start=g(),u.events.push(["enter",L,u]),l.push(L),L}function j(A){const M=l.pop();return M.end=g(),u.events.push(["exit",M,u]),M}function S(A,M){E(A,M.from)}function C(A,M){M.restore()}function I(A,M){return L;function L(F,V,U){let P,T,D,_;return Array.isArray(F)?z(F):"tokenize"in F?z([F]):G(F);function G(K){return X;function X(fe){const ee=fe!==null&&K[fe],te=fe!==null&&K.null,ge=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(te)?te:te?[te]:[]];return z(ge)(fe)}}function z(K){return P=K,T=0,K.length===0?U:R(K[T])}function R(K){return X;function X(fe){return _=N(),D=K,K.partial||(u.currentConstruct=K),K.name&&u.parser.constructs.disable.null.includes(K.name)?Q():K.tokenize.call(M?Object.assign(Object.create(u),M):u,c,q,Q)(fe)}}function q(K){return A(D,_),V}function Q(K){return _.restore(),++T<P.length?R(P[T]):U}}}function E(A,M){A.resolveAll&&!a.includes(A)&&a.push(A),A.resolve&&Un(u.events,M,u.events.length-M,A.resolve(u.events.slice(M),u)),A.resolveTo&&(u.events=A.resolveTo(u.events,u))}function N(){const A=g(),M=u.previous,L=u.currentConstruct,F=u.events.length,V=Array.from(l);return{from:F,restore:U};function U(){r=A,u.previous=M,u.currentConstruct=L,u.events.length=F,l=V,k()}}function k(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function iee(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,a)];else{if(o=e.slice(n,s),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function aee(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
545`;break}case-3:{o=`\r
546`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(a)}s=a===-2,r.push(o)}return r.join("")}function oee(e){const r={constructs:VP([ree,...(e||{}).extensions||[]]),content:s(kX),defined:[],document:s(NX),flow:s(UJ),lazy:{},string:s(WJ),text:s(qJ)};return r;function s(a){return o;function o(l){return see(r,a,l)}}}function lee(e){for(;!HP(e););return e}const y1=/[\0\t\n\r]/g;function cee(){let e=1,t="",n=!0,r;return s;function s(a,o,l){const c=[];let u,f,d,m,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(y1.lastIndex=d,u=y1.exec(a),m=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(m),!u){t=a.slice(d);break}if(p===10&&d===m&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<m&&(c.push(a.slice(d,m)),e+=m-d),p){case 0:{c.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,c.push(-2);e++<f;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=m+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const uee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dee(e){return e.replace(uee,fee)}function fee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return $P(n.slice(a?2:1),a?16:10)}return Uy(n)||e}const QP={}.hasOwnProperty;function hee(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),mee(n)(lee(oee(n).document().write(cee()(e,t,!0))))}function mee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Pe),autolinkProtocol:N,autolinkEmail:N,atxHeading:a(ze),blockQuote:a(te),characterEscape:N,characterReference:N,codeFenced:a(ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ge,o),codeText:a(oe,o),codeTextData:N,data:N,codeFlowValue:N,definition:a(Ve),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a($e),hardBreakEscape:a(qe),hardBreakTrailing:a(qe),htmlFlow:a(Oe,o),htmlFlowData:N,htmlText:a(Oe,o),htmlTextData:N,image:a(Ft),label:o,link:a(Pe),listItem:a(An),listItemValue:m,listOrdered:a(tt,d),listUnordered:a(tt),paragraph:a(xr),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ze),strong:a(an),thematicBreak:a(Rt)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:ee,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:K,characterReference:X,codeFenced:c(y),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:k,codeIndented:c(v),codeText:c(V),codeTextData:k,data:k,definition:c(),definitionDestinationString:j,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c(L),htmlFlowData:k,htmlText:c(F),htmlTextData:k,image:c(P),label:D,labelText:T,lineEnding:A,link:c(U),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:q,resourceDestinationString:_,resourceTitleString:G,resource:z,setextHeading:c(E),setextHeadingLineSequence:I,setextHeadingText:C,strong:c(),thematicBreak:c()}};ZP(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let ne={type:"root",children:[]};const ke={stack:[ne],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:f,data:n},Ie=[];let O=-1;for(;++O<Y.length;)if(Y[O][1].type==="listOrdered"||Y[O][1].type==="listUnordered")if(Y[O][0]==="enter")Ie.push(O);else{const B=Ie.pop();O=s(Y,B,O)}for(O=-1;++O<Y.length;){const B=t[Y[O][0]];QP.call(B,Y[O][1].type)&&B[Y[O][1].type].call(Object.assign({sliceSerialize:Y[O][2].sliceSerialize},ke),Y[O][1])}if(ke.tokenStack.length>0){const B=ke.tokenStack[ke.tokenStack.length-1];(B[1]||v1).call(ke,void 0,B[0])}for(ne.position={start:_s(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:_s(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},O=-1;++O<t.transforms.length;)ne=t.transforms[O](ne)||ne;return ne}function s(Y,ne,ke){let Ie=ne-1,O=-1,B=!1,H,J,re,me;for(;++Ie<=ke;){const ie=Y[Ie];switch(ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ie[0]==="enter"?O++:O--,me=void 0;break}case"lineEndingBlank":{ie[0]==="enter"&&(H&&!me&&!O&&!re&&(re=Ie),me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:me=void 0}if(!O&&ie[0]==="enter"&&ie[1].type==="listItemPrefix"||O===-1&&ie[0]==="exit"&&(ie[1].type==="listUnordered"||ie[1].type==="listOrdered")){if(H){let xe=Ie;for(J=void 0;xe--;){const je=Y[xe];if(je[1].type==="lineEnding"||je[1].type==="lineEndingBlank"){if(je[0]==="exit")continue;J&&(Y[J][1].type="lineEndingBlank",B=!0),je[1].type="lineEnding",J=xe}else if(!(je[1].type==="linePrefix"||je[1].type==="blockQuotePrefix"||je[1].type==="blockQuotePrefixWhitespace"||je[1].type==="blockQuoteMarker"||je[1].type==="listItemIndent"))break}re&&(!J||re<J)&&(H._spread=!0),H.end=Object.assign({},J?Y[J][1].start:ie[1].end),Y.splice(J||Ie,0,["exit",H,ie[2]]),Ie++,ke++}if(ie[1].type==="listItemPrefix"){const xe={type:"listItem",_spread:!1,start:Object.assign({},ie[1].start),end:void 0};H=xe,Y.splice(Ie,0,["enter",xe,ie[2]]),Ie++,ke++,re=void 0,me=!0}}}return Y[ne][1]._spread=B,ke}function a(Y,ne){return ke;function ke(Ie){l.call(this,Y(Ie),Ie),ne&&ne.call(this,Ie)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(Y,ne,ke){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([ne,ke||void 0]),Y.position={start:_s(ne.start),end:void 0}}function c(Y){return ne;function ne(ke){Y&&Y.call(this,ke),u.call(this,ke)}}function u(Y,ne){const ke=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==Y.type&&(ne?ne.call(this,Y,Ie[0]):(Ie[1]||v1).call(this,Y,Ie[0]));else throw new Error("Cannot close `"+Y.type+"` ("+vl({start:Y.start,end:Y.end})+"): it’s not open");ke.position.end=_s(Y.end)}function f(){return zy(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function m(Y){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function p(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=Y}function g(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=Y}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Y.replace(/(\r?\n|\r)$/g,"")}function b(Y){const ne=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ne,ke.identifier=ar(this.sliceSerialize(Y)).toLowerCase()}function w(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.title=Y}function j(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.url=Y}function S(Y){const ne=this.stack[this.stack.length-1];if(!ne.depth){const ke=this.sliceSerialize(Y).length;ne.depth=ke}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function I(Y){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function N(Y){const ke=this.stack[this.stack.length-1].children;let Ie=ke[ke.length-1];(!Ie||Ie.type!=="text")&&(Ie=yr(),Ie.position={start:_s(Y.start),end:void 0},ke.push(Ie)),this.stack.push(Ie)}function k(Y){const ne=this.stack.pop();ne.value+=this.sliceSerialize(Y),ne.position.end=_s(Y.end)}function A(Y){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=ne.children[ne.children.length-1];ke.position.end=_s(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(N.call(this,Y),k.call(this,Y))}function M(){this.data.atHardBreak=!0}function L(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Y}function F(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Y}function V(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Y}function U(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ne,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function P(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ne,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function T(Y){const ne=this.sliceSerialize(Y),ke=this.stack[this.stack.length-2];ke.label=dee(ne),ke.identifier=ar(ne).toLowerCase()}function D(){const Y=this.stack[this.stack.length-1],ne=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Ie=Y.children;ke.children=Ie}else ke.alt=ne}function _(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.url=Y}function G(){const Y=this.resume(),ne=this.stack[this.stack.length-1];ne.title=Y}function z(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function q(Y){const ne=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ne,ke.identifier=ar(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function Q(Y){this.data.characterReferenceType=Y.type}function K(Y){const ne=this.sliceSerialize(Y),ke=this.data.characterReferenceType;let Ie;ke?(Ie=$P(ne,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=Uy(ne);const O=this.stack[this.stack.length-1];O.value+=Ie}function X(Y){const ne=this.stack.pop();ne.position.end=_s(Y.end)}function fe(Y){k.call(this,Y);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(Y)}function ee(Y){k.call(this,Y);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(Y)}function te(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function Ve(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $e(){return{type:"emphasis",children:[]}}function ze(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function Oe(){return{type:"html",value:""}}function Ft(){return{type:"image",title:null,url:"",alt:null}}function Pe(){return{type:"link",title:null,url:"",children:[]}}function tt(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function An(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function xr(){return{type:"paragraph",children:[]}}function an(){return{type:"strong",children:[]}}function yr(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function _s(e){return{line:e.line,column:e.column,offset:e.offset}}function ZP(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ZP(e,r):pee(e,r)}}function pee(e,t){let n;for(n in t)if(QP.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function v1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vl({start:t.start,end:t.end})+") is still open")}function gee(e){const t=this;t.parser=n;function n(r){return hee(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function xee(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function yee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
547`}]}function vee(e,t){const n=t.value?t.value+`
548`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function bee(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kee(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Mo(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function See(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nee(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function XP(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function jee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XP(e,t);const s={src:Mo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function Cee(e,t){const n={src:Mo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Tee(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Eee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XP(e,t);const s={href:Mo(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function _ee(e,t){const n={href:Mo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Aee(e,t,n){const r=e.all(t),s=n?Pee(n):JP(t),a={},o=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(s||l!==0||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
549`}),f.type==="element"&&f.tagName==="p"&&!s?o.push(...f.children):o.push(f)}const c=r[r.length-1];c&&(s||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
550`});const u={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,u),e.applyData(t,u)}function Pee(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=JP(n[r])}return t}function JP(e){const t=e.spread;return t??e.children.length>1}function Ree(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Iee(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mee(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Dee(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oee(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Ly(t.children[1]),c=RP(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function Lee(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const d=t.children[c],m={},p=o?o[c]:void 0;p&&(m.align=p);let g={type:"element",tagName:a,properties:m,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),u.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function Fee(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const b1=9,w1=32;function Vee(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(k1(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(k1(t.slice(s),s>0,!1)),a.join("")}function k1(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===b1||a===w1;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===b1||a===w1;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function $ee(e,t){const n={type:"text",value:Vee(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zee(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Uee={blockquote:xee,break:yee,code:vee,delete:bee,emphasis:wee,footnoteReference:kee,heading:See,html:Nee,imageReference:jee,image:Cee,inlineCode:Tee,linkReference:Eee,link:_ee,listItem:Aee,list:Ree,paragraph:Iee,root:Mee,strong:Dee,table:Oee,tableCell:Fee,tableRow:Lee,text:$ee,thematicBreak:zee,toml:Jc,yaml:Jc,definition:Jc,footnoteDefinition:Jc};function Jc(){}const eR=-1,Af=0,wl=1,Nd=2,Hy=3,Wy=4,qy=5,Gy=6,tR=7,nR=8,Bee=typeof self=="object"?self:globalThis,S1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Bee[e](t)},Hee=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case Af:case eR:return n(o,s);case wl:{const l=n([],s);for(const c of o)l.push(r(c));return l}case Nd:{const l=n({},s);for(const[c,u]of o)l[r(c)]=r(u);return l}case Hy:return n(new Date(o),s);case Wy:{const{source:l,flags:c}=o;return n(new RegExp(l,c),s)}case qy:{const l=n(new Map,s);for(const[c,u]of o)l.set(r(c),r(u));return l}case Gy:{const l=n(new Set,s);for(const c of o)l.add(r(c));return l}case tR:{const{name:l,message:c}=o;return n(S1(l,c),s)}case nR:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(S1(a,o),s)};return r},N1=e=>Hee(new Map,e)(0),Ci="",{toString:Wee}={},{keys:qee}=Object,Zo=e=>{const t=typeof e;if(t!=="object"||!e)return[Af,t];const n=Wee.call(e).slice(8,-1);switch(n){case"Array":return[wl,Ci];case"Object":return[Nd,Ci];case"Date":return[Hy,Ci];case"RegExp":return[Wy,Ci];case"Map":return[qy,Ci];case"Set":return[Gy,Ci];case"DataView":return[wl,n]}return n.includes("Array")?[wl,n]:n.includes("Error")?[tR,n]:[Nd,n]},eu=([e,t])=>e===Af&&(t==="function"||t==="symbol"),Gee=(e,t,n,r)=>{const s=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=Zo(o);switch(l){case Af:{let f=o;switch(c){case"bigint":l=nR,f=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);f=null;break;case"undefined":return s([eR],o)}return s([l,f],o)}case wl:{if(c){let m=o;return c==="DataView"?m=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(o)),s([c,[...m]],o)}const f=[],d=s([l,f],o);for(const m of o)f.push(a(m));return d}case Nd:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const f=[],d=s([l,f],o);for(const m of qee(o))(e||!eu(Zo(o[m])))&&f.push([a(m),a(o[m])]);return d}case Hy:return s([l,isNaN(o.getTime())?Ci:o.toISOString()],o);case Wy:{const{source:f,flags:d}=o;return s([l,{source:f,flags:d}],o)}case qy:{const f=[],d=s([l,f],o);for(const[m,p]of o)(e||!(eu(Zo(m))||eu(Zo(p))))&&f.push([a(m),a(p)]);return d}case Gy:{const f=[],d=s([l,f],o);for(const m of o)(e||!eu(Zo(m)))&&f.push(a(m));return d}}const{message:u}=o;return s([l,{name:c,message:u}],o)};return a},j1=(e,{json:t,lossy:n}={})=>{const r=[];return Gee(!(t||n),!!t,new Map,r)(e),r},jd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?N1(j1(e,t)):structuredClone(e):(e,t)=>N1(j1(e,t));function Yee(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Kee(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Qee(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Yee,r=e.options.footnoteBackLabel||Kee,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const f=e.all(u),d=String(u.identifier).toUpperCase(),m=Mo(d.toLowerCase());let p=0;const g=[],x=e.footnoteCounts.get(d);for(;x!==void 0&&++p<=x;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=f[f.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else f.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(f,!0)};e.patch(u,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...jd(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
551`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
552`}]}}const Pf=function(e){if(e==null)return ete;if(typeof e=="function")return Rf(e);if(typeof e=="object")return Array.isArray(e)?Zee(e):Xee(e);if(typeof e=="string")return Jee(e);throw new Error("Expected function, string, or object as test")};function Zee(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Pf(e[n]);return Rf(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function Xee(e){const t=e;return Rf(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function Jee(e){return Rf(t);function t(n){return n&&n.type===e}}function Rf(e){return t;function t(n,r,s){return!!(tte(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function ete(){return!0}function tte(e){return e!==null&&typeof e=="object"&&"type"in e}const rR=[],nte=!0,Ip=!1,rte="skip";function sR(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=Pf(s),o=r?-1:1;l(e,void 0,[])();function l(c,u,f){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return m;function m(){let p=rR,g,x,y;if((!t||a(c,u,f[f.length-1]||void 0))&&(p=ste(n(c,f)),p[0]===Ip))return p;if("children"in c&&c.children){const v=c;if(v.children&&p[0]!==rte)for(x=(r?v.children.length:-1)+o,y=f.concat(v);x>-1&&x<v.children.length;){const b=v.children[x];if(g=l(b,x,y)(),g[0]===Ip)return g;x=typeof g[1]=="number"?g[1]:x+o}}return p}}}function ste(e){return Array.isArray(e)?e:typeof e=="number"?[nte,e]:e==null?rR:[e]}function Yy(e,t,n,r){let s,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,s=n):(a=t,o=n,s=r),sR(e,a,l,s);function l(c,u){const f=u[u.length-1],d=f?f.children.indexOf(c):void 0;return o(c,d,f)}}const Mp={}.hasOwnProperty,ite={};function ate(e,t){const n=t||ite,r=new Map,s=new Map,a=new Map,o={...Uee,...n.handlers},l={all:u,applyData:lte,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:ote,wrap:ute};return Yy(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:s,m=String(f.identifier).toUpperCase();d.has(m)||d.set(m,f)}}),l;function c(f,d){const m=f.type,p=l.handlers[m];if(Mp.call(l.handlers,m)&&p)return p(l,f,d);if(l.options.passThrough&&l.options.passThrough.includes(m)){if("children"in f){const{children:x,...y}=f,v=jd(y);return v.children=l.all(f),v}return jd(f)}return(l.options.unknownHandler||cte)(l,f,d)}function u(f){const d=[];if("children"in f){const m=f.children;let p=-1;for(;++p<m.length;){const g=l.one(m[p],f);if(g){if(p&&m[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=C1(g.value)),!Array.isArray(g)&&g.type==="element")){const x=g.children[0];x&&x.type==="text"&&(x.value=C1(x.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function ote(e,t){e.position&&(t.position=YZ(e))}function lte(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,jd(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function cte(e,t){const n=t.data||{},r="value"in t&&!(Mp.call(n,"hProperties")||Mp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ute(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
553`});++r<e.length;)r&&n.push({type:"text",value:`
554`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
555`}),n}function C1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function T1(e,t){const n=ate(e,t),r=n.one(e,void 0),s=Qee(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
556`},s),a}function dte(e,t){return e&&"run"in e?async function(n,r){const s=T1(n,{file:r,...t});await e.run(s,r)}:function(n,r){return T1(n,{file:r,...e||t})}}function E1(e){if(e)throw e}var Nu=Object.prototype.hasOwnProperty,iR=Object.prototype.toString,_1=Object.defineProperty,A1=Object.getOwnPropertyDescriptor,P1=function(t){return typeof Array.isArray=="function"?Array.isArray(t):iR.call(t)==="[object Array]"},R1=function(t){if(!t||iR.call(t)!=="[object Object]")return!1;var n=Nu.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Nu.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Nu.call(t,s)},I1=function(t,n){_1&&n.name==="__proto__"?_1(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},M1=function(t,n){if(n==="__proto__")if(Nu.call(t,n)){if(A1)return A1(t,n).value}else return;return t[n]},fte=function e(){var t,n,r,s,a,o,l=arguments[0],c=1,u=arguments.length,f=!1;for(typeof l=="boolean"&&(f=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=M1(l,n),s=M1(t,n),l!==s&&(f&&s&&(R1(s)||(a=P1(s)))?(a?(a=!1,o=r&&P1(r)?r:[]):o=r&&R1(r)?r:{},I1(l,{name:n,newValue:e(f,o,s)})):typeof s<"u"&&I1(l,{name:n,newValue:s}));return l};const Lh=Gp(fte);function Dp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function hte(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(c,...u){const f=e[++a];let d=-1;if(c){o(c);return}for(;++d<s.length;)(u[d]===null||u[d]===void 0)&&(u[d]=s[d]);s=u,f?mte(f,l)(...u):o(null,...u)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function mte(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(s);try{c=e.apply(this,o)}catch(u){const f=u;if(l&&n)throw f;return s(f)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,s):c instanceof Error?s(c):a(c))}function s(o,...l){n||(n=!0,t(o,...l))}function a(o){s(null,o)}}const br={basename:pte,dirname:gte,extname:xte,join:yte,sep:"/"};function pte(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ac(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function gte(e){if(Ac(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function xte(e){Ac(e);let t=e.length,n=-1,r=0,s=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function yte(...e){let t=-1,n;for(;++t<e.length;)Ac(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":vte(n)}function vte(e){Ac(e);const t=e.codePointAt(0)===47;let n=bte(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function bte(e,t){let n="",r=0,s=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||a===1))if(s!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",r=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function Ac(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wte={cwd:kte};function kte(){return"/"}function Op(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ste(e){if(typeof e=="string")e=new URL(e);else if(!Op(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Nte(e)}function Nte(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Fh=["history","path","basename","stem","extname","dirname"];class aR{constructor(t){let n;t?Op(t)?n={path:t}:typeof t=="string"||jte(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":wte.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Fh.length;){const a=Fh[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Fh.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?br.basename(this.path):void 0}set basename(t){$h(t,"basename"),Vh(t,"basename"),this.path=br.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?br.dirname(this.path):void 0}set dirname(t){D1(this.basename,"dirname"),this.path=br.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?br.extname(this.path):void 0}set extname(t){if(Vh(t,"extname"),D1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=br.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Op(t)&&(t=Ste(t)),$h(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?br.basename(this.path,this.extname):void 0}set stem(t){$h(t,"stem"),Vh(t,"stem"),this.path=br.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new sn(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Vh(e,t){if(e&&e.includes(br.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+br.sep+"`")}function $h(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function D1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function jte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Cte=function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},Tte={}.hasOwnProperty;class Ky extends Cte{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=hte()}copy(){const t=new Ky;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Lh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Bh("data",this.frozen),this.namespace[t]=n,this):Tte.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=tu(t),r=this.parser||this.Parser;return zh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),zh("process",this.parser||this.Parser),Uh("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,o){const l=tu(t),c=r.parse(l);r.run(c,l,function(f,d,m){if(f||!d||!m)return u(f);const p=d,g=r.stringify(p,m);Ate(g)?m.value=g:m.result=g,u(f,m)});function u(f,d){f||!d?o(f):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),zh("processSync",this.parser||this.Parser),Uh("processSync",this.compiler||this.Compiler),this.process(t,s),L1("processSync","process",n),r;function s(a,o){n=!0,E1(a),r=o}}run(t,n,r){O1(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const c=tu(n);s.run(t,c,u);function u(f,d,m){const p=d||t;f?l(f):o?o(p):r(void 0,p,m)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),L1("runSync","run",r),s;function a(o,l){E1(o),s=l,r=!0}}stringify(t,n){this.freeze();const r=tu(n),s=this.compiler||this.Compiler;return Uh("stringify",s),O1(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Bh("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...d]=u;c(f,d)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(s.settings=Lh(!0,s.settings,u.settings))}function l(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const d=u[f];a(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,f){let d=-1,m=-1;for(;++d<r.length;)if(r[d][0]===u){m=d;break}if(m===-1)r.push([u,...f]);else if(f.length>0){let[p,...g]=f;const x=r[m][1];Dp(x)&&Dp(p)&&(p=Lh(!0,x,p)),r[m]=[u,p,...g]}}}}const Ete=new Ky().freeze();function zh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Uh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function O1(e){if(!Dp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function L1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tu(e){return _te(e)?e:new aR(e)}function _te(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ate(e){return typeof e=="string"||Pte(e)}function Pte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Rte="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",F1=[],V1={allowDangerousHtml:!0},Ite=/^(https?|ircs?|mailto|xmpp)$/i,Mte=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function oR(e){const t=Dte(e),n=Ote(e);return Lte(t.runSync(t.parse(n),n),e)}function Dte(e){const t=e.rehypePlugins||F1,n=e.remarkPlugins||F1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...V1}:V1;return Ete().use(gee).use(n).use(dte,r).use(t)}function Ote(e){const t=e.children||"",n=new aR;return typeof t=="string"&&(n.value=t),n}function Lte(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||Fte;for(const f of Mte)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Rte+f.id,void 0);return Yy(e,u),JZ(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function u(f,d,m){if(f.type==="raw"&&m&&typeof d=="number")return o?m.children.splice(d,1):m.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let p;for(p in Mh)if(Object.hasOwn(Mh,p)&&Object.hasOwn(f.properties,p)){const g=f.properties[p],x=Mh[p];(x===null||x.includes(f.tagName))&&(f.properties[p]=c(String(g||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):a?a.includes(f.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(f,d,m)),p&&m&&typeof d=="number")return l&&f.children?m.children.splice(d,1,...f.children):m.children.splice(d,1),d}}}function Fte(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||Ite.test(e.slice(0,t))?e:""}function $1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function Vte(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $te(e,t,n){const s=Pf((n||{}).ignore||[]),a=zte(t);let o=-1;for(;++o<a.length;)sR(e,"text",l);function l(u,f){let d=-1,m;for(;++d<f.length;){const p=f[d],g=m?m.children:void 0;if(s(p,g?g.indexOf(p):void 0,m))return;m=p}if(m)return c(u,f)}function c(u,f){const d=f[f.length-1],m=a[o][0],p=a[o][1];let g=0;const y=d.children.indexOf(u);let v=!1,b=[];m.lastIndex=0;let w=m.exec(u.value);for(;w;){const j=w.index,S={index:w.index,input:w.input,stack:[...f,u]};let C=p(...w,S);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?m.lastIndex=j+1:(g!==j&&b.push({type:"text",value:u.value.slice(g,j)}),Array.isArray(C)?b.push(...C):C&&b.push(C),g=j+w[0].length,v=!0),!m.global)break;w=m.exec(u.value)}return v?(g<u.value.length&&b.push({type:"text",value:u.value.slice(g)}),d.children.splice(y,1,...b)):b=[u],y+b.length}}function zte(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([Ute(s[0]),Bte(s[1])])}return t}function Ute(e){return typeof e=="string"?new RegExp(Vte(e),"g"):e}function Bte(e){return typeof e=="function"?e:function(){return e}}const Hh="phrasing",Wh=["autolink","link","image","label"];function Hte(){return{transforms:[Zte],enter:{literalAutolink:qte,literalAutolinkEmail:qh,literalAutolinkHttp:qh,literalAutolinkWww:qh},exit:{literalAutolink:Qte,literalAutolinkEmail:Kte,literalAutolinkHttp:Gte,literalAutolinkWww:Yte}}}function Wte(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Hh,notInConstruct:Wh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Hh,notInConstruct:Wh},{character:":",before:"[ps]",after:"\\/",inConstruct:Hh,notInConstruct:Wh}]}}function qte(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qh(e){this.config.enter.autolinkProtocol.call(this,e)}function Gte(e){this.config.exit.autolinkProtocol.call(this,e)}function Yte(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Kte(e){this.config.exit.autolinkEmail.call(this,e)}function Qte(e){this.exit(e)}function Zte(e){$te(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Xte],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Jte]],{ignore:["link","linkReference"]})}function Xte(e,t,n,r,s){let a="";if(!lR(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!ene(n)))return!1;const o=tne(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function Jte(e,t,n,r){return!lR(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ene(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function tne(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=$1(e,"(");let a=$1(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function lR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ra(n)||Ef(n))&&(!t||n!==47)}cR.peek=une;function nne(){this.buffer()}function rne(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function sne(){this.buffer()}function ine(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ane(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ar(this.sliceSerialize(e)).toLowerCase(),n.label=t}function one(e){this.exit(e)}function lne(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ar(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cne(e){this.exit(e)}function une(){return"["}function cR(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=s.move("]"),a}function dne(){return{enter:{gfmFootnoteCallString:nne,gfmFootnoteCall:rne,gfmFootnoteDefinitionLabelString:sne,gfmFootnoteDefinition:ine},exit:{gfmFootnoteCallString:ane,gfmFootnoteCall:one,gfmFootnoteDefinitionLabelString:lne,gfmFootnoteDefinition:cne}}}function fne(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,o){const l=a.createTracker(o);let c=l.move("[^");const u=a.enter("footnoteDefinition"),f=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),f(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
557`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?uR:hne))),u(),c}}function hne(e,t,n){return t===0?e:uR(e,t,n)}function uR(e,t,n){return(n?"":"    ")+e}const mne=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];dR.peek=vne;function pne(){return{canContainEols:["delete"],enter:{strikethrough:xne},exit:{strikethrough:yne}}}function gne(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mne}],handlers:{delete:dR}}}function xne(e){this.enter({type:"delete",children:[]},e)}function yne(e){this.exit(e)}function dR(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),a(),o}function vne(){return"~"}function bne(e){return e.length}function wne(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||bne,a=[],o=[],l=[],c=[];let u=0,f=-1;for(;++f<e.length;){const x=[],y=[];let v=-1;for(e[f].length>u&&(u=e[f].length);++v<e[f].length;){const b=kne(e[f][v]);if(n.alignDelimiters!==!1){const w=s(b);y[v]=w,(c[v]===void 0||w>c[v])&&(c[v]=w)}x.push(b)}o[f]=x,l[f]=y}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)a[d]=z1(r[d]);else{const x=z1(r);for(;++d<u;)a[d]=x}d=-1;const m=[],p=[];for(;++d<u;){const x=a[d];let y="",v="";x===99?(y=":",v=":"):x===108?y=":":x===114&&(v=":");let b=n.alignDelimiters===!1?1:Math.max(1,c[d]-y.length-v.length);const w=y+"-".repeat(b)+v;n.alignDelimiters!==!1&&(b=y.length+b+v.length,b>c[d]&&(c[d]=b),p[d]=b),m[d]=w}o.splice(1,0,m),l.splice(1,0,p),f=-1;const g=[];for(;++f<o.length;){const x=o[f],y=l[f];d=-1;const v=[];for(;++d<u;){const b=x[d]||"";let w="",j="";if(n.alignDelimiters!==!1){const S=c[d]-(y[d]||0),C=a[d];C===114?w=" ".repeat(S):C===99?S%2?(w=" ".repeat(S/2+.5),j=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),j=w):j=" ".repeat(S)}n.delimiterStart!==!1&&!d&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||d)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(b),n.alignDelimiters!==!1&&v.push(j),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||d!==u-1)&&v.push("|")}g.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return g.join(`
558`)}function kne(e){return e==null?"":String(e)}function z1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Sne(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),Nne);return s(),o}function Nne(e,t,n){return">"+(n?"":" ")+e}function jne(e,t){return U1(e,t.inConstruct,!0)&&!U1(e,t.notInConstruct,!1)}function U1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function B1(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
559`&&jne(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
560`}function Cne(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>o&&(o=a):a=1,s=r+t.length,r=n.indexOf(t,s);return o}function Tne(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Ene(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function _ne(e,t,n,r){const s=Ene(n),a=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(Tne(e,n)){const d=n.enter("codeIndented"),m=n.indentLines(a,Ane);return d(),m}const l=n.createTracker(r),c=s.repeat(Math.max(Cne(a,s)+1,3)),u=n.enter("codeFenced");let f=l.move(c);if(e.lang){const d=n.enter(`codeFencedLang${o}`);f+=l.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);f+=l.move(" "),f+=l.move(n.safe(e.meta,{before:f,after:`
561`,encode:["`"],...l.current()})),d()}return f+=l.move(`
562`),a&&(f+=l.move(a+`
563`)),f+=l.move(c),u(),f}function Ane(e,t,n){return(n?"":"    ")+e}function Qy(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Pne(e,t,n,r){const s=Qy(n),a=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
564`,...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),l()),o(),u}function Rne(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Kl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Cd(e,t,n){const r=wo(e),s=wo(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}fR.peek=Ine;function fR(e,t,n,r){const s=Rne(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(s);let c=o.move(n.containerPhrasing(e,{after:s,before:l,...o.current()}));const u=c.charCodeAt(0),f=Cd(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(c=Kl(u)+c.slice(1));const d=c.charCodeAt(c.length-1),m=Cd(r.after.charCodeAt(0),d,s);m.inside&&(c=c.slice(0,-1)+Kl(d));const p=o.move(s);return a(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},l+c+p}function Ine(e,t,n){return n.options.emphasis||"*"}function Mne(e,t){let n=!1;return Yy(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ip}),!!((!e.depth||e.depth<3)&&zy(e)&&(t.options.setext||n))}function Dne(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Mne(e,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),m=n.containerPhrasing(e,{...a.current(),before:`
565`,after:`
566`});return d(),f(),m+`
567`+(s===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
568`))+1))}const o="#".repeat(s),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
569`,...a.current()});return/^[\t ]/.test(u)&&(u=Kl(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}hR.peek=One;function hR(e){return e.value||""}function One(){return"<"}mR.peek=Lne;function mR(e,t,n,r){const s=Qy(n),a=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),l()),u+=c.move(")"),o(),u}function Lne(){return"!"}pR.peek=Fne;function pR(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const f=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=f,a(),s==="full"||!u||u!==d?c+=l.move(d+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Fne(){return"!"}gR.peek=Vne;function gR(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return s+r+s}function Vne(){return"`"}function xR(e,t){const n=zy(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yR.peek=$ne;function yR(e,t,n,r){const s=Qy(n),a=s==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(xR(e,n)){const f=n.stack;n.stack=[],l=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">
569"),l(),n.stack=f,d}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),u+=o.move(" "+s),u+=o.move(n.safe(e.title,{before:u,after:s,...o.current()})),u+=o.move(s),c()),u+=o.move(")"),l(),u}function $ne(e,t,n){return xR(e,n)?"<":"["}vR.peek=zne;function vR(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const f=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=f,a(),s==="full"||!u||u!==d?c+=l.move(d+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function zne(){return"["}function Zy(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Une(e){const t=Zy(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Bne(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function bR(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Hne(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?Bne(n):Zy(n);const l=e.ordered?o==="."?")":".":Une(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),bR(n)===o&&f){let d=-1;for(;++d<e.children.length;){const m=e.children[d];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,s(),u}function Wne(e){const t=e.options.listItemIndent||"one";
vendor: 19,461 bytes, lines 569-571
569if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function qne(e,t,n,r){const s=Wne(n);let a=n.bulletCurrent||Zy(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),f);return c(),u;function f(d,m,p){return m?(p?"":" ".repeat(o))+d:(p?a:a+" ".repeat(o-a.length))+d}}function Gne(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),s(),o}const Yne=Pf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Kne(e,t,n,r){return(e.children.some(function(o){return Yne(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Qne(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wR.peek=Zne;function wR(e,t,n,r){const s=Qne(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(s+s);let c=o.move(n.containerPhrasing(e,{after:s,before:l,...o.current()}));const u=c.charCodeAt(0),f=Cd(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(c=Kl(u)+c.slice(1));const d=c.charCodeAt(c.length-1),m=Cd(r.after.charCodeAt(0),d,s);m.inside&&(c=c.slice(0,-1)+Kl(d));const p=o.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},l+c+p}function Zne(e,t,n){return n.options.strong||"*"}function Xne(e,t,n,r){return n.safe(e.value,r)}function Jne(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ere(e,t,n){const r=(bR(n)+(n.options.ruleSpaces?" ":"")).repeat(Jne(n));return n.options.ruleSpaces?r.slice(0,-1):r}const kR={blockquote:Sne,break:B1,code:_ne,definition:Pne,emphasis:fR,hardBreak:B1,heading:Dne,html:hR,image:mR,imageReference:pR,inlineCode:gR,link:yR,linkReference:vR,list:Hne,listItem:qne,paragraph:Gne,root:Kne,strong:wR,text:Xne,thematicBreak:ere};function tre(){return{enter:{table:nre,tableData:H1,tableHeader:H1,tableRow:sre},exit:{codeText:ire,table:rre,tableData:Gh,tableHeader:Gh,tableRow:Gh}}}function nre(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function rre(e){this.exit(e),this.data.inTable=void 0}function sre(e){this.enter({type:"tableRow",children:[]},e)}function Gh(e){this.exit(e)}function H1(e){this.enter({type:"tableCell",children:[]},e)}function ire(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,are));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function are(e,t){return t==="|"?t:e}function ore(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
570`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:o,tableCell:c,tableRow:l}};function o(p,g,x,y){return u(f(p,x,y),p.align)}function l(p,g,x,y){const v=d(p,x,y),b=u([v]);return b.slice(0,b.indexOf(`
571`))}function c(p,g,x,y){const v=x.enter("tableCell"),b=x.enter("phrasing"),w=x.containerPhrasing(p,{...y,before:a,after:a});return b(),v(),w}function u(p,g){return wne(p,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function f(p,g,x){const y=p.children;let v=-1;const b=[],w=g.enter("table");for(;++v<y.length;)b[v]=d(y[v],g,x);return w(),b}function d(p,g,x){const y=p.children;let v=-1;const b=[],w=g.enter("tableRow");for(;++v<y.length;)b[v]=c(y[v],p,g,x);return w(),b}function m(p,g,x){let y=kR.inlineCode(p,g,x);return x.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function lre(){return{exit:{taskListCheckValueChecked:W1,taskListCheckValueUnchecked:W1,paragraph:ure}}}function cre(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dre}}}function W1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function ure(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,o;for(;++a<s.length;){const l=s[a];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function dre(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(o);let c=kR.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(f){return f+o}}function fre(){return[Hte(),dne(),pne(),tre(),lre()]}function hre(e){return{extensions:[Wte(),fne(e),gne(),ore(e),cre()]}}const mre={tokenize:bre,partial:!0},SR={tokenize:wre,partial:!0},NR={tokenize:kre,partial:!0},jR={tokenize:Sre,partial:!0},pre={tokenize:Nre,partial:!0},CR={name:"wwwAutolink",tokenize:yre,previous:ER},TR={name:"protocolAutolink",tokenize:vre,previous:_R},Ns={name:"emailAutolink",tokenize:xre,previous:AR},qr={};function gre(){return{text:qr}}let wi=48;for(;wi<123;)qr[wi]=Ns,wi++,wi===58?wi=65:wi===91&&(wi=97);qr[43]=Ns;qr[45]=Ns;qr[46]=Ns;qr[95]=Ns;qr[72]=[Ns,TR];qr[104]=[Ns,TR];qr[87]=[Ns,CR];qr[119]=[Ns,CR];function xre(e,t,n){const r=this;let s,a;return o;function o(d){return!Lp(d)||!AR.call(r,r.previous)||Xy(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return Lp(d)?(e.consume(d),l):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(pre,f,u)(d):d===45||d===95||rn(d)?(a=!0,e.consume(d),c):f(d)}function u(d){return e.consume(d),s=!0,c}function f(d){return a&&s&&hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function yre(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!ER.call(r,r.previous)||Xy(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(mre,e.attempt(SR,e.attempt(NR,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function vre(e,t,n){const r=this;let s="",a=!1;return o;function o(d){return(d===72||d===104)&&_R.call(r,r.previous)&&!Xy(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(hn(d)&&s.length<5)return s+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const m=s.toLowerCase();if(m==="http"||m==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),a?u:(a=!0,c)):n(d)}function u(d){return d===null||Sd(d)||mt(d)||ra(d)||Ef(d)?n(d):e.attempt(SR,e.attempt(NR,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function bre(e,t,n){let r=0;return s;function s(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),s):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function wre(e,t,n){let r,s,a;return o;function o(u){return u===46||u===95?e.check(jR,c,l)(u):u===null||mt(u)||ra(u)||u!==45&&Ef(u)?c(u):(a=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(s=r,r=void 0),e.consume(u),o}function c(u){return s||r||!a?n(u):t(u)}}function kre(e,t){let n=0,r=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(jR,t,a)(o):o===null||mt(o)||ra(o)?t(o):(e.consume(o),s)}function a(o){return o===41&&r++,e.consume(o),s}}function Sre(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),a):l===93?(e.consume(l),s):l===60||l===null||mt(l)||ra(l)?t(l):n(l)}function s(l){return l===null||l===40||l===91||mt(l)||ra(l)?t(l):r(l)}function a(l){return hn(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):hn(l)?(e.consume(l),o):n(l)}}function Nre(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return rn(a)?n(a):t(a)}}function ER(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||mt(e)}function _R(e){return!hn(e)}function AR(e){return!(e===47||Lp(e))}function Lp(e){return e===43||e===45||e===46||e===95||rn(e)}function Xy(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const jre={tokenize:Ire,partial:!0};function Cre(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Are,continuation:{tokenize:Pre},exit:Rre}},text:{91:{name:"gfmFootnoteCall",tokenize:_re},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Tre,resolveTo:Ere}}}}function Tre(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=ar(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Ere(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function _re(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(a>999||d===93&&!o||d===null||d===91||mt(d))return n(d);if(d===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return s.includes(ar(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return mt(d)||(o=!0),a++,e.consume(d),d===92?f:u}function f(d){return d===91||d===92||d===93?(e.consume(d),a++,u):u(d)}}function Are(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(g)}function f(g){if(o>999||g===93&&!l||g===null||g===91||mt(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=ar(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return mt(g)||(l=!0),o++,e.consume(g),g===92?d:f}function d(g){return g===91||g===92||g===93?(e.consume(g),o++,f):f(g)}function m(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),s.includes(a)||s.push(a),et(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function Pre(e,t,n){return e.check(_c,t,e.attempt(jre,t,n))}function Rre(e){e.exit("gfmFootnoteDefinition")}function Ire(e,t,n){const r=this;return et(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function Mre(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},d={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},m=[["enter",f,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",d,l]],p=l.parser.constructs.insideSpan.null;p&&Un(m,m.length,0,_f(p,o.slice(u+1,c),l)),Un(m,m.length,0,[["exit",d,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",f,l]]),Un(o,u-1,c-u+3,m),c=u+m.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function a(o,l,c){const u=this.previous,f=this.events;let d=0;return m;function m(g){return u===126&&f[f.length-1][1].type!=="characterEscape"?c(g):(o.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const x=wo(u);if(g===126)return d>1?c(g):(o.consume(g),d++,p);if(d<2&&!n)return c(g);const y=o.exit("strikethroughSequenceTemporary"),v=wo(g);return y._open=!v||v===2&&!!x,y._close=!x||x===2&&!!v,l(g)}}}class Dre{constructor(){this.map=[]}add(t,n,r){Ore(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function Ore(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function Lre(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Fre(){return{flow:{null:{name:"table",tokenize:Vre,resolveAll:$re}}}}function Vre(e,t,n){const r=this;let s=0,a=0,o;return l;function l(k){let A=r.events.length-1;for(;A>-1;){const F=r.events[A][1].type;if(F==="lineEnding"||F==="linePrefix")A--;else break}const M=A>-1?r.events[A][1].type:null,L=M==="tableHead"||M==="tableRow"?C:c;return L===C&&r.parser.lazy[r.now().line]?n(k):L(k)}function c(k){return e.enter("tableHead"),e.enter("tableRow"),u(k)}function u(k){return k===124||(o=!0,a+=1),f(k)}function f(k){return k===null?n(k):Te(k)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),p):n(k):Ye(k)?et(e,f,"whitespace")(k):(a+=1,o&&(o=!1,s+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),o=!0,f):(e.enter("data"),d(k)))}function d(k){return k===null||k===124||mt(k)?(e.exit("data"),f(k)):(e.consume(k),k===92?m:d)}function m(k){return k===92||k===124?(e.consume(k),d):d(k)}function p(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(k):(e.enter("tableDelimiterRow"),o=!1,Ye(k)?et(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):g(k))}function g(k){return k===45||k===58?y(k):k===124?(o=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),x):S(k)}function x(k){return Ye(k)?et(e,y,"whitespace")(k):y(k)}function y(k){return k===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),v):k===45?(a+=1,v(k)):k===null||Te(k)?j(k):S(k)}function v(k){return k===45?(e.enter("tableDelimiterFiller"),b(k)):S(k)}function b(k){return k===45?(e.consume(k),b):k===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(k))}function w(k){return Ye(k)?et(e,j,"whitespace")(k):j(k)}function j(k){return k===124?g(k):k===null||Te(k)?!o||s!==a?S(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):S(k)}function S(k){return n(k)}function C(k){return e.enter("tableRow"),I(k)}function I(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),I):k===null||Te(k)?(e.exit("tableRow"),t(k)):Ye(k)?et(e,I,"whitespace")(k):(e.enter("data"),E(k))}function E(k){return k===null||k===124||mt(k)?(e.exit("data"),I(k)):(e.consume(k),k===92?N:E)}function N(k){return k===92||k===124?(e.consume(k),E):E(k)}}function $re(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,f,d;const m=new Dre;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(q1(m,t,c,u,f),f=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",f,t]])),s=g.type==="tableDelimiterRow"?2:f?3:1):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=nu(m,t,a,s,void 0,d),a=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=nu(m,t,a,s,void 0,d)),a=o,o=[a[1],n,0,0])):g.type==="tableHead"?(l=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],d=nu(m,t,a,s,n,d)):o[1]!==0&&(
571d=nu(m,t,o,s,n,d)),s=0):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&q1(m,t,c,u,f),m.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=Lre(t.events,n))}return e}function nu(e,t,n,r,s,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Pa(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Pa(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=Pa(t.events,n[2]),f=Pa(t.events,n[3]),d={type:l,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;e.add(g,x,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return s!==void 0&&(a.end=Object.assign({},Pa(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function q1(e,t,n,r,s){const a=[],o=Pa(t.events,n);s&&(s.end=Object.assign({},o),a.push(["exit",s,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function Pa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const zre={name:"tasklistCheck",tokenize:Bre};function Ure(){return{text:{91:zre}}}function Bre(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return mt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Te(c)?t(c):Ye(c)?e.check({tokenize:Hre},t,n)(c):n(c)}}function Hre(e,t,n){return et(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function Wre(e){return VP([gre(),Cre(),Mre(e),Fre(),Ure()])}const qre={};function PR(e){const t=this,n=e||qre,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(Wre(n)),a.push(fre()),o.push(hre(n))}const G1={kb:{bg:"bg-blue-100 hover:bg-blue-200 dark:bg-blue-900/40 dark:hover:bg-blue-900/60",text:"text-blue-700 dark:text-blue-300",icon:jS},"web-trusted":{bg:"bg-green-100 hover:bg-green-200 dark:bg-green-900/40 dark:hover:bg-green-900/60",text:"text-green-700 dark:text-green-300",icon:og},"web-other":{bg:"bg-amber-100 hover:bg-amber-200 dark:bg-amber-900/40 dark:hover:bg-amber-900/60",text:"text-amber-700 dark:text-amber-300",icon:Iu}};function Gre({number:e,citation:t}){const n=G1[t.chipColor]??G1.kb,r=n.icon;return i.jsxs(Gx,{children:[i.jsx(Yx,{asChild:!0,children:i.jsxs("button",{type:"button",className:W("inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[10px] font-medium leading-none cursor-pointer transition-colors align-top",n.bg,n.text),children:[i.jsx(r,{className:"h-2.5 w-2.5"}),e]})}),i.jsxs(ff,{side:"top",align:"start",className:"w-72 text-xs space-y-2",children:[i.jsx("p",{className:"font-semibold text-sm leading-tight",children:t.title}),i.jsx("p",{className:"text-muted-foreground",children:t.source}),t.citation&&i.jsx("p",{className:"italic text-muted-foreground",children:t.citation}),t.url&&i.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["View source ",i.jsx(zi,{className:"h-3 w-3"})]})]})]})}function Yre(e,t){const n=e.matchAll(/\[(\d+(?:\s*,\s*\d+)*)\]/g),r=new Set;for(const s of n){const a=s[1].split(/\s*,\s*/);for(const o of a){const l=parseInt(o,10);t[l]&&r.add(l)}}return Array.from(r).sort((s,a)=>s-a)}const Kre={kb:jS,"web-trusted":og,"web-other":Iu},Qre={kb:"Knowledge Base","web-trusted":"Trusted Source","web-other":"Web Source"};function Zre({citations:e,messageText:t}){const[n,r]=h.useState(!1),s=Yre(t,e);return s.length===0?null:i.jsxs("div",{className:"mt-2",children:[i.jsxs("button",{type:"button",onClick:()=>r(!n),className:W("inline-flex items-center gap-1.5 text-xs font-medium transition-colors rounded-md px-2 py-1","text-muted-foreground hover:text-foreground hover:bg-muted/60"),
571children:[i.jsx(Iu,{className:"h-3 w-3"}),s.length," ",s.length===1?"source":"sources"]}),n&&i.jsx("div",{className:"mt-1.5 rounded-lg border bg-muted/30 p-2 space-y-1.5 max-h-48 overflow-y-auto",children:s.map(a=>{const o=e[a];if(!o)return null;const l=Kre[o.chipColor]??Iu,c=Qre[o.chipColor]??"Source";return i.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[i.jsxs("span",{className:"shrink-0 mt-0.5 text-muted-foreground font-mono text-[10px] w-4 text-right",children:["[",a,"]"]}),i.jsx(l,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-muted-foreground"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-foreground leading-tight truncate",children:o.title}),i.jsxs("p",{className:"text-muted-foreground truncate",children:[o.source," · ",c]})]}),o.url&&i.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 mt-0.5 text-muted-foreground hover:text-primary transition-colors",children:i.jsx(zi,{className:"h-3 w-3"})})]},a)})})]})}function Xre({suggestions:e,onSelect:t,disabled:n=!1}){if(n||e.length===0)return null;const r=mi();return i.jsx("div",{className:`mt-3 flex flex-row flex-wrap gap-2 ${r?"flex-col w-full":""}`,"aria-label":"Follow-up suggestions",children:e.map(s=>i.jsx(Z,{variant:"outline",size:"sm",className:"h-auto justify-start gap-1.5 whitespace-normal py-1.5 px-2 text-left text-[0.70rem] font-normal text-foreground hover:text-foreground hover:bg-muted/60 transition-colors max-w-full",onClick:()=>t(s),children:i.jsx("span",{children:s})},s))})}function Jre(e){let t=-1;for(let s=0;s<e.length;s++){const a=e[s];typeof a.type=="string"&&a.type.startsWith("tool-")&&(t=s)}if(t===-1)return e.filter(s=>s.type==="text").map(s=>s.text).join("");let n=-1;for(let s=t+1;
571s<e.length;s++)if(e[s].type==="step-start"){n=s;break}const r=n!==-1?n:t;return e.slice(r+1).filter(s=>s.type==="text").map(s=>s.text).join("")}function ese(){return i.jsx("span",{className:"inline-block w-[3px] h-[14px] bg-current opacity-80 rounded-sm align-text-bottom ml-0.5",style:{animation:"cursor-blink 1s steps(2) infinite"}})}function tse(){return i.jsx("span",{className:"inline-flex items-center gap-0.5 h-4","aria-label":"Loading",children:[0,1,2].map(e=>i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current opacity-60",style:{animation:`pulse 1.2s ease-in-out ${e*.2}s infinite`}},e))})}function Y1(e,t){return e.split(/(\[\d+(?:\s*,\s*\d+)*\])/g).flatMap((r,s)=>{const a=r.match(/^\[(\d+(?:\s*,\s*\d+)*)\]$/);return a?a[1].split(/\s*,\s*/).map(Number).map((l,c)=>{const u=t[l];return u?i.jsx(Gre,{number:l,citation:u},`${s}-${c}`):null}):[r]})}const RR=({href:e,children:t})=>i.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:text-primary/80 break-all [overflow-wrap:anywhere]",children:t}),nse={h1:({children:e})=>i.jsx("p",{className:"font-bold text-sm mt-3 mb-1 text-inherit",children:e}),h2:({children:e})=>i.jsx("p",{className:"font-bold text-sm mt-3 mb-1 text-inherit",children:e}),h3:({children:e})=>i.jsx("p",{className:"font-semibold text-sm mt-2 mb-1 text-inherit",children:e}),h4:({children:e})=>i.jsx("p",{className:"font-semibold text-sm mt-2 mb-1 text-inherit",children:e}),h5:({children:e})=>i.jsx("p",{className:"font-medium text-sm mt-1.5 mb-0.5 text-inherit",children:e}),h6:({children:e})=>i.jsx("p",{className:"font-medium text-sm mt-1.5 mb-0.5 text-inherit",children:e})};function As(e,t){return e&&(typeof e=="string"?Y1(e,t):Array.isArray(e)?e.map((n,r)=>typeof n=="string"?i.jsx("span",{children:Y1(n,t)},r):n):e)}const rse=h.memo(function({text:t,citations:n}){const r=h.useMemo(()=>({h1:({children:s})=>{const a=As(s,n);return i.jsx("p",{className:"font-bold text-sm mt-3 mb-1 text-inherit",children:a})},h2:({children:s})=>{const a=As(s,n);return i.jsx("p",{className:"font-bold text-sm mt-3 mb-1 text-inherit",children:a})},h3:({children:s})=>{const a=As(s,n);return i.jsx("p",{className:"font-semibold text-sm mt-2 mb-1 text-inherit",children:a})},h4:({children:s})=>{const a=As(s,n);return i.jsx("p",{className:"font-semibold text-sm mt-2 mb-1 text-inherit",children:a})},h5:({children:s})=>{const a=As(s,n);return i.jsx("p",{className:"font-medium text-sm mt-1.5 mb-0.5 text-inherit",children:a})},h6:({children:s})=>{const a=As(s,n);return i.jsx("p",{className:"font-medium text-sm mt-1.5 mb-0.5 text-inherit",children:a})},p:({children:s})=>{const a=As(s,n);return i.jsx("p",{className:"my-3 text-inherit leading-relaxed",children:a})},li:({children:s})=>{const a=As(s,n);return i.jsx("li",{className:"text-sm text-inherit",children:a})},ul:({children:s})=>i.jsx("ul",{className:"list-disc list-inside pl-2 my-3 space-y-1",children:s}),ol:({children:s})=>i.jsx("ol",{className:"list-decimal list-inside pl-2 my-3 space-y-1",children:s}),strong:({children:s})=>i.jsx("strong",{className:"font-semibold text-inherit",children:s}),a:RR,table:({children:s})=>i.jsx("table",{className:"text-xs border-collapse w-full my-2",children:s}),th:({children:s})=>i.jsx("th",{className:"border border-border/50 px-2 py-1 text-left font-semibold bg-muted/30",children:s}),td:({children:s})=>i.jsx("td",{className:"border border-border/50 px-2 py-1",children:s}),hr:()=>i.jsx("hr",{className:"my-2 border-border/30"}),blockquote:({children:s})=>i.jsx("blockquote",{className:"border-l-2 border-border/50 pl-3 my-1.5 text-muted-foreground italic",children:s})}),[n]);return i.jsx(oR,{remarkPlugins:[PR],components:r,children:t})});function sse(e){return e.replace(/<tools_ready>[\s\S]*?<\/tools_ready>/g,"").replace(/<think>[\s\S]*?<\/think>/g,"").replace(/<\/?function\b[^>]*>/g,"").replace(/<\/?[a-zA-Z][a-zA-Z0-9_-]*(?:\s[^>]*)?\s*\/?>/g,"").replace(/\n{3,}/g,`
572
573`).trim()}const ise={...nse,p:({children:e})=>i.jsx("p",{className:"my-1 text-inherit",children:e}),ul:({children:e})=>i.jsx("ul",{className:"list-disc list-inside pl-2 my-1.5 space-y-0.5",children:e}),ol:({children:e})=>i.jsx("ol",{className:"list-decimal list-inside pl-2 my-1.5 space-y-0.5",children:e}),li:({children:e})=>i.jsx("li",{className:"text-sm text-inherit",children:e}),strong:({children:e})=>i.jsx("strong",{className:"font-semibold text-inherit",children:e}),a:RR,table:({children:e})=>i.jsx("table",{className:"text-xs border-collapse w-full my-2",children:e}),th:({children:e})=>i.jsx("th",{className:"border border-border/50 px-2 py-1 text-left font-semibold bg-muted/30",children:e}),td:({children:e})=>i.jsx("td",{className:"border border-border/50 px-2 py-1",children:e}),hr:()=>i.jsx("hr",{className:"my-2 border-border/30"}),blockquote:({children:e})=>i.jsx("blockquote",{className:"border-l-2 border-border/50 pl-3 my-1.5 text-muted-foreground italic",children:e})};function ase({message:e,citations:t,isStreaming:n=!1,onSuggestionSelect:r}){var g,x,y;const s=sse(Jre(e.parts)),a=mP(s,n),o=n||a.length<s.length,l=o?a:s,c=Object.keys(t).length>0,u=hS((g=e.metadata)==null?void 0:g.completedAt),f=!o&&r?(x=e.metadata)==null?void 0:x.suggestions:void 0,d=s,m=l,p=s.length>0;return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[(p||o)&&i.jsx("div",{className:"flex min-w-0 max-w-full justify-start",children:i.jsx("div",{className:"min-w-0 max-w-[92%] overflow-hidden rounded-2xl rounded-bl-md bg-muted/70 border border-border/30 px-4 py-2.5 text-sm text-foreground break-words [overflow-wrap:anywhere] leading-relaxed shadow-sm",children:i.jsxs("div",{className:"min-w-0 text-sm break-words [overflow-wrap:anywhere] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:[o?i.jsx("span",{className:"whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:m}):c?i.jsx(rse,{text:d,citations:t}):i.jsx(oR,{remarkPlugins:[PR],components:ise,children:d}),o&&!s&&i.jsx(tse,{}),o&&s&&i.jsx(ese,{}),!o&&c&&i.jsx(Zre,{citations:t,messageText:d})]})})}),!o&&u&&i.jsx("span",{className:"mt-0.5 text-[10px] text-muted-foreground
573/70 select-none self-start ml-1",children:u}),!f&&((y=e.metadata)==null?void 0:y.suggestionsLoading)&&r&&!o&&i.jsx("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:i.jsx("span",{children:"Generating suggestions…"})}),f&&f.length>0&&r&&!o&&i.jsx(Xre,{suggestions:f,onSelect:r})]})}const ose={"evidence-substantiation":"Add Evidence","contemporaneous-documentation":"Enhance Description","reasonableness-patterns":"Adjust Duration","activity-classification":"Reclassify Activity","material-participation":"Reclassify Activity","hour-threshold":"Review Hours",corroboration:"Add Evidence"};function lse(e){return ose[e]??"Fix Issue"}function cse(e){return e==="CRITICAL"?"border-red-400/60 hover:border-red-500 hover:bg-red-50 dark:hover:bg-red-950/30":e==="WARNING"?"border-amber-400/60 hover:border-amber-500 hover:bg-amber-50 dark:hover:bg-amber-950/30":"border-blue-400/60 hover:border-blue-500 hover:bg-blue-50 dark:hover:bg-blue-950/30"}function use(e){return e==="CRITICAL"?"bg-red-500":e==="WARNING"?"bg-amber-400":"bg-blue-400"}const K1=5;function dse({findings:e,downloadUrl:t,onSend:n}){const r=e.filter(l=>l.severity==="CRITICAL"||l.severity==="WARNING"),s=r.slice(0,K1),a=r.length-K1,o=r.length>1;return r.length===0&&!t?null:i.jsxs("div",{className:"mt-3 space-y-2",children:[i.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Quick actions"}),i.jsxs("div",{className:"flex flex-wrap gap-2 overflow-x-auto pb-0.5 -mx-0.5 px-0.5",children:[s.map(l=>i.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:()=>n(`fix finding #${l.findingNumber}`),className:W("h-7 text-xs gap-1.5 whitespace-nowrap shrink-0 transition-colors",cse(l.severity)),children:[i.jsx("span",{className:W("h-1.5 w-1.5 rounded-full shrink-0",use(l.severity)),"aria-hidden":"true"}),"Fix #",l.findingNumber,": ",lse(l.domain)]},l.findingNumber)),a>0&&i.jsxs("span",{className:"inline-flex items-center h-7 px-2.5 text-xs text-muted-foreground border border-dashed border-border rounded-md shrink-0",children:["+",a," more"]}),o&&i.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:()=>n("fix all"),className:"h-7 text-xs gap-1.5 whitespace-nowrap shrink-0 border-primary/40 hover:border-primary hover:bg-primary/5",children:[i.jsx(WD,{className:"h-3 w-3"}),"Fix All"]}),t&&i.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:l=>{l.preventDefault(),window.open(t,"_blank","noopener,noreferrer")},className:"h-7 text-xs gap-1.5 whitespace-nowrap shrink-0 border-border text-muted-foreground hover:text-foreground",children:[i.jsx(jD,{className:"h-3 w-3"}),"PDF Report"]})]})]})}const fse="[EVIDENCE_SCAN_CONTEXT]";function hse(e){const t=[];for(const n of e)if(n.role==="user")for(const r of n.parts)r.type==="file"&&t.push(r);return t}function mse(e){return e.some(t=>t.role!=="user"?!1:t.parts.some(n=>n.type==="text"&&n.text.includes(fse)))}function pse(e){const t=e.selectedId;if(!t)return[];if(t.trim().startsWith("["))try{const r=JSON.parse(t);if(Array.isArray(r))return r.map(s=>Number(s)).filter(s=>Number.isFinite(s))}catch{return[]}const n=Number(t);return Number.isFinite(n)?[n]:[]}function gse(e,t){return e.slice(t+1).some(n=>n.parts.some(r=>typeof r.type=="string"&&(r.type==="tool-presentCostSegEstimate"||r.type==="tool-presentMultiCostSegEstimate"||r.type==="tool-presentRentEstimate")))}function xse(e,t){const n=e[t];if(n.role!=="assistant"||n.parts.some(a=>typeof a.type=="string"&&a.type.startsWith("tool-")))return!1;const s=e[t+1];return!s||s.role!=="assistant"?!1:s.parts.some(a=>typeof a.type=="string"&&a.type.startsWith("tool-"))}function yse({messages:e,mode:t,citations:n,isLoading:r,isStreaming:s,error:a,send:o,pipelineStatusLabel:l,isMobile:c=!1,isPremium:u,onRedirectSwitchToAdvisor:f,onRedirectUpgradeClick:d}){const m=h.useRef(null),p=hse(e),g=mse(e),{getCardState:x}=ga(),y=w=>{const j=x(`${w}:logTimeMode`);return(j==null?void 0:j.mode)==="manual"||(j==null?void 0:j.mode)==="smart"};h.useEffect(()=>{var k;const w=(k=m.current)==null?void 0:k.querySelector("[data-radix-scroll-area-viewport]");if(!w)return;const j=()=>{w&&(w.scrollTop=w.scrollHeight)};j();let S=null;const C=()=>{S&&clearTimeout(S),S=setTimeout(()=>{E.disconnect(),N&&clearInterval(N)},500)};let I=null;const E=new MutationObserver(()=>{I!==null&&cancelAnimationFrame(I),I=requestAnimationFrame(j),C()});E.observe(w,{childList:!0,subtree:!0,characterData:!0}
573);const N=setInterval(j,16);return C(),()=>{E.disconnect(),I!==null&&cancelAnimationFrame(I),S&&clearTimeout(S),clearInterval(N)}},[e]);const v=(()=>{for(let w=e.length-1;w>=0;w--)if(e[w].role==="assistant")return w;return-1})(),b=typeof(a==null?void 0:a.message)=="string"?a.message:typeof a=="string"?a:"";return i.jsx(fP,{ref:m,className:W("flex-1 min-h-0"),children:i.jsxs("div",{className:"space-y-4 py-4 px-4 w-full",children:[e.map((w,j)=>{const S=j===v,C=s&&S,I=xse(e,j);return i.jsxs("div",{children:[w.role==="user"?i.jsx(wY,{message:w}):I?null:i.jsx("div",{className:"flex justify-start min-w-0 w-full",children:i.jsx("div",{className:"min-w-0 w-full max-w-full break-words text-foreground text-sm leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:i.jsx(ase,{message:w,citations:n,isStreaming:C,onSuggestionSelect:S?o:void 0})})}),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-prepareTimeEntry"&&E.state!=="input-streaming"&&E.input!=null).map(E=>i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(PK,{toolCallId:E.toolCallId,entry:E.input,attachedFiles:p,skipAttachedFileExtraction:g,onCancel:()=>o("Cancel that entry.")})},`tool-${w.id}-${E.toolCallId}`)),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentSelectForm"&&E.state!=="input-streaming"&&E.input!=null).map(E=>i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(RK,{toolCallId:E.toolCallId,schema:E.input,onSubmit:o})},`form-${w.id}-${E.toolCallId}`)),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentQuestionnaire"&&E.state!=="input-streaming"&&E.input!=null).map(E=>i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(MK,{toolCallId:E.toolCallId,schema:E.input,onSubmit:o})},`questionnaire-${w.id}-${E.toolCallId}`)),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentRemediation"&&E.state!=="input-streaming"&&E.input!=null).map(E=>i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(KK,{toolCallId:E.toolCallId,schema:E.input,onSubmit:o})},`remediation-${w.id}-${E.toolCallId}`)),w.parts.filter(E=>E.type==="tool-formSubmit").map(E=>{const N=String(E.questionnaireId??""),k=N.toLowerCase(),A=pse(E),M=A.length>0&&(k.includes("rent")||k.includes("cost")),L=gse(e,j),F=M&&!L;return M&&L?null:F&&k.includes("rent")?i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden space-y-2",children:A.map(V=>i.jsx(Zw,{propertyId:V},V))},`formsubmit-rent-${w.id}`):F&&k.includes("cost")?i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(Qw,{propertyIds:A})},`formsubmit-costseg-${w.id}`):i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(tQ,{questionnaireId:N})},`formsubmit-${w.id}`)}),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentLogTimeForm"&&E.state!=="input-streaming").map(E=>{const N=E.toolCallId,k=E.input,A=y(N)||xQ(k)&&!g;return i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:A?i.jsx(gQ,{toolCallId:N,defaults:k,onSubmit:o}):i.jsx(yP,{toolCallId:N,onSubmit:o,defaults:k})},`logtime-${w.id}-${N}`)}),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentAddPropertyForm"&&E.state!=="input-streaming").map(E=>i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(EQ,{onSubmit:o})},`addprop-${w.id}-${E.toolCallId}`)),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentTaxProfileForm"&&E.state!=="input-streaming").map(E=>i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(VQ,{onSubmit:o})},`taxprofile-${w.id}-${E.toolCallId}`)),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentDisplayProperties"&&E.state!=="input-streaming").map(E=>{const N=E.input;return i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx($Q,{formId:N==null?void 0:N.formId,onSubmit:N!=null&&N.formId?o:void 0,mode:N==null?void 0:N.mode})},`displayprops-${w.id}-${E.toolCallId}`)}),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentCostSegEstimate"&&E.state!=="input-streaming"&&E.input!=null).map(E=>{const N=E.input;return i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(Cf,{propertyId:N.propertyId,propertyNickname:N.propertyNickname,status:N.status})},`costseg-${w.id}-${E.toolCallId}`)}),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentMultiCostSegEstimate"&&E.state!=="input-streaming"&&E.input!=null).map(E=>{const N=E.input;return i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(Qw,{propertyIds:N.propertyIds})},`multicostseg-${w.id}-${E.toolCallId}`)}),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-redirectToAdvisor"&&E.state!=="input-streaming"&&E.input!=null).map(E=>{const N=E.input;return i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(nZ,{message:N.message,isPremium:N.isPremium,onSwitchToAdvisor:f,onUpgradeClick:d})},`redirect-${w.id}-${E.toolCallId}`)}),w.parts.filter(E=>typeof E.type=="string"&&E.type==="tool-presentRentEstimate"&&E.state!=="input-streaming"&&E.input!=null).map(E=>{const N=E.input;return i.jsx("div",{className:"mt-2 max-w-[90%] overflow-hidden",children:i.jsx(Zw,{propertyId:N.propertyId,propertyNickname:N.propertyNickname})},`rent-${w.id}-${E.toolCallId}`)}),S&&(()=>{const E=w.parts.find(A=>typeof A.type=="string"&&A.type==="tool-runComplianceAudit"&&A.state==="output-available");if(!E)return null;const N=E.output;if(!(N!=null&&N.success))return null;
573const k=(N.findings??[]).map(A=>{var M,L;return{findingNumber:A.findingNumber,severity:A.severity,domain:A.domain??((L=(M=A.violations)==null?void 0:M[0])==null?void 0:L.domain)??"unknown"}});return i.jsx(dse,{findings:k,downloadUrl:N.downloadUrl??null,onSend:o},`audit-actions-${w.id}`)})()]},w.id)}),a&&i.jsx("p",{className:"text-xs text-destructive",children:t==="advisor"||t==="compliance"?b.includes("403")?"Shield Advisor subscription required for this mode.":b.includes("429")?"Rate limit reached. Please wait a moment.":b.includes("503")?"AI Advisor is temporarily unavailable. Please try again later.":"Something went wrong. Please try again.":"Something went wrong. Please try again."})]})})}function vse(){const e=new Date().getHours();return e<12?"Good morning":e<17?"Good afternoon":"Good evening"}function bse(e,t){if(e==="advisor"&&t)return"I can give you much better guidance once I know your tax situation. Set up your profile to get personalized advice, or ask any question right away.";const n=e in kw?e:"logger";return kw[n]}function wse({userName:e,mode:t,profileIncomplete:n}){const r=vse(),s=e||"there",a=bse(t,n);return i.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[i.jsx("img",{src:"https://repsshield.com/api/assets/logo.png",alt:"REPSShield",className:"h-10 w-10 shrink-0"}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("h2",{className:"text-lg font-medium text-foreground",children:[r,", ",s]}),i.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:a})]})]})}function kse(e){const t=["Do I qualify for REPS this year?","What are the rental comps for my properties?","What are my audit risk factors?"];if(!e||e.length===0)return[...t,"How do I get started with REPS tracking?"];const n=e.some(s=>s.propertyType==="Short-term Rental"),r=e.some(s=>s.propertyType==="Long-term Rental");return n&&r?t.push("Compare LTR and STR tax rules for my properties"):n?t.push("Explain STR tax rules for my properties"):t.push("Explain LTR material participation rules for my properties"),t}function Sse(e){const t=vp.compliance.map(o=>o.text);if(!e||e.length===0)return t;const n=[],r=e.slice(0,2);for(const o of r){const l=o.address||o.nickname||o.propertyType||"my property";n.push(`Audit my ${l} entries for compliance issues`)}const s=new Set(e.map(o=>o.state).filter(Boolean)),a=Array.from(s);return a.length===1?n.push(`Check if my ${a[0]} properties have any state-specific risks`):a.length>1&&n.push("Check my properties for state-specific compliance risks"),[t[0],...n,...t.slice(1)]}function Nse(e){return e==="advisor"?"Ask a tax compliance question...":e==="compliance"?"Ask about your IRS compliance posture...":"How can I help you today?"}function Q1({session:e,isExpanded:t,hideHeader:n=!1}){const{user:r}=At(),s=XA(),a=e??s,{agent:o,mode:l,isPremium:c,setMode:u,isSwitching:f}=a,{agentWithSession:d,advisorChat:m,complianceChat:p}=a,g=l==="compliance"?p:m,[x,y]=h.useState(!1),[v,b]=h.useState(null),[w,j]=h.useState(!1),[S,C]=h.useState("idle");h.useEffect(()=>{!c&&(l==="advisor"||l==="compliance")&&u("logger")},[c,l,u]);const{data:I}=it({queryKey:["/api/properties"],enabled:!!r,staleTime:1e3*60*5}),E=h.useMemo(()=>kse(I??[]),[I]),N=h.useMemo(()=>Sse(I??[]),[I]),k=h.useRef(0),A=l==="advisor"||l==="compliance",M=c?d:o,L=A?g:M,F=A?g.metadata.citations??{}:{},V=A?g.pipelineStatusLabel??void 0:M.pipelineStatusLabel??void 0,U=M.isLoading||m.isLoading||p.isLoading,P=L.isStreaming,T=L.messages.length===0&&!g.isLoadingSession&&!(c&&!A&&d.isLoadingSession),{data:D}=it({queryKey:["/api/advisor/tax-profile"],enabled:!!r&&l==="advisor"&&T,staleTime:1e3*60*5}),_=D!==void 0&&D.completeness.score<50;h.useEffect(()=>{k.current=M.messages.length},[M.messages.length]),h.useEffect(()=>{!T&&v!==null&&b(null)},[T,v]);function G(ee){if(!T){y(!0);return}b(te=>te===ee?null:ee)}function z(){y(!0)}function R(){const te=[...M.messages].reverse().find(oe=>oe.role==="user"),ge=te?te.parts.filter(oe=>oe.type==="text").map(oe=>oe.text).join(""):"";u("advisor"),ge&&setTimeout(()=>g.send(ge),100)}function q(ee,te){A?g.send(ee,te):c?d.send(ee,te):o.send(ee,te)}function Q(){if(l==="advisor")return[..._?[{text:"Help me set up my tax profile",primary:!0}]:[],...E.map(ge=>({text:ge}))];if(l==="compliance")return N.map((te,ge)=>({text:te,primary:ge===0}));const ee=[];return(r==null?void 0:r.hasCompletedOnboardingForm)===!0&&((I??[]).length===0&&ee.push({text:"Add my first property",primary:!0}),r!=null&&r.filingStatus||ee.push({text:"Set up my tax profile"})),[...ee,...vp.logger]}const K=Q(),X=v?vp[v]:[];function fe(ee,te){const ge=(te==null?void 0:te.disabled)??!1,oe=(te==null?void 0:te.placement)??"input",Ve=oe==="empty"?"hidden md:flex flex-wrap justify-center gap-3 px-4 pt-4":"-mx-1 pt-3 pb-2 overflow-x-auto scrollbar-hide [-webkit-overflow-scrolling:touch] md:hidden",$e=oe==="empty"?"contents":"flex w-max min-w-full gap-2 px-1";return i.jsx("div",{className:W(Ve,ge&&"opacity-50 pointer-events-none select-none"),children:i.jsx("div",{className:$e,children:ee.map(ze=>i.jsx(Z,{variant:ze.primary?"default":"outline",size:"sm",className:"h-9 shrink-0 rounded-full px-4 text-xs font-medium whitespace-nowrap border-border/70 shadow-sm",onClick:()=>q(ze.text),tabIndex:ge?-1:void 0,children:ze.text},ze.text))})})}return i.jsxs("div",{className:"relative flex flex-col flex-1 min-h-0",children:[!c&&i.jsx("div",{className:"flex justify-center py-2.5 border-b border-border/50",children:i.jsxs("button",{type:"button",onClick:()=>y(!0),className:"group inline-flex items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 shadow-sm hover:bg-muted/50 transition-colors duration-150",children:[i.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-green-500 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-white leading-none",children:[i.jsx(Qn,{className:"h-2.5 w-2.5"}),"Premium"]}
573),i.jsx("span",{className:"text-sm text-foreground/80 group-hover:text-foreground transition-colors",children:"Upgrade to access Advisor & Compliance modes"}),i.jsx(Bn,{className:"h-3.5 w-3.5 text-muted-foreground group-hover:text-foreground transition-colors"})]})}),!n&&i.jsx("div",{className:"flex items-center justify-between pb-2 mb-0.5  border-border/50",children:i.jsx("div",{className:"flex items-center gap-1.5 flex-1",children:!T&&A&&g.metadata.webFallbackTriggered&&i.jsxs(Mr,{variant:"outline",className:"text-[10px] gap-1 px-1.5 py-0",children:[i.jsx(og,{className:"h-3 w-3"}),"Web sources used"]})})}),g.isLoadingSession||c&&!A&&d.isLoadingSession?i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsx(Xe,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):T?i.jsxs("div",{className:"flex-1 min-h-0 flex flex-col justify-center",children:[!w&&i.jsx(wse,{userName:[r==null?void 0:r.firstName,r==null?void 0:r.lastName].filter(Boolean).join(" ")||void 0,mode:l,profileIncomplete:_}),!w&&!v&&K.length>0&&fe(K,{placement:"empty"}),!w&&v&&X.length>0&&fe(X,{placement:"empty",disabled:!0})]}):i.jsx(yse,{messages:L.messages,mode:l,citations:F,isLoading:L.isLoading,isStreaming:P,error:L.error??null,send:q,pipelineStatusLabel:V,isMobile:!0,isPremium:c,onRedirectSwitchToAdvisor:R,onRedirectUpgradeClick:z}),S==="scanning"&&i.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-10 bottom-24 z-10 flex items-center justify-center px-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsx(wd,{title:"Preparing evidence scan",label:"Rep Assistant evidence",description:"Reading the upload so Rep Assistant can suggest a date, activity type, and description."})})}),T&&v&&i.jsx("div",{className:"flex flex-col gap-2 pb-2",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/40 px-3 py-2",children:[i.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[i.jsx(Qn,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),i.jsxs("span",{className:"text-xs font-medium text-foreground truncate",children:["Unlock ",jG[v]," with Pro"]})]}),i.jsx(Z,{size:"sm",className:"text-xs h-6 px-2.5 shrink-0",onClick:()=>{b(null),y(!0)},children:"Upgrade"})]})}),i.jsx(mQ,{onSubmit:q,isLoading:U,placeholder:Nse(l),showFileUpload:!0,mode:l,isPremium:c,isSwitching:f,onModeToggle:u,onUpgradeClick:()=>y(!0),onPreviewMode:c?void 0:G,onFilesChange:j,onEvidenceScanChange:C,autoSubmitEvidenceUploads:l==="logger"}),T&&!w&&!v&&K.length>0&&fe(K),T&&!w&&v&&fe(X,{disabled:!0}),A?i.jsx("p",{className:"text-[10px] text-muted-foreground text-center px-2 pt-1 leading-relaxed",children:"Educational guidance only — not tax, legal, or financial advice. Consult a qualified CPA or tax attorney."}):i.jsx("div",{className:"pt-6"}),i.jsx(WA,{isOpen:x,onClose:()=>y(!1),feature:"Advisor & Compliance Mode",targetTier:"premium"})]})}const Z1={async getPreferences(){const e=await fetch("/api/user/preferences");if(!e.ok)throw new Error("Failed to fetch user preferences");return(await e.json()).preferences},async updatePreferences(e){const t=await fetch("/api/user/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to update user preferences");return(await t.json()).preferences},async getChatViewMode(){const e=await fetch("/api/user/chat-view-mode");if(!e.ok)throw new Error("Failed to fetch chat view mode");return e.json()},async updateChatViewMode(e){if(!(await fetch("/api/user/chat-view-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e})})).ok)throw new Error("Failed to update chat view mode")}},X1=["/api/user/chat-view-mode"];function jse(){const e=wt(),{data:t,isLoading:n}=it({queryKey:X1,queryFn:()=>Z1.getChatViewMode(),staleTime:5*60*1e3}),r=Dt({mutationFn:s=>Z1.updateChatViewMode(s),onSuccess:(s,a)=>{e.setQueryData(X1,{mode:a})}});return{viewMode:(t==null?void 0:t.mode)??"hybrid",isLoading:n,setViewMode:r.mutate,isSaving:r.isPending}}function Cse(e){const t=lT(e);return fU(t)?"Today":hU(t)?"Yesterday":Br(t,"MMM d")}function Tse({item:e,isActive:t,onSelect:n,onDelete:r}
573){const s=e.title??`Chat — ${Cse(e.lastMessageAt)}`;return i.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:a=>a.key==="Enter"&&n(),className:W("group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm cursor-pointer transition-colors select-none",t?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[i.jsx("span",{className:"flex-1 truncate",children:s}),i.jsx("button",{type:"button","aria-label":"Delete conversation",onClick:a=>{a.stopPropagation(),r()},className:"shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:i.jsx(CS,{className:"h-3 w-3"})})]})}function Ese({isPremium:e,activeConversationId:t,onSelectConversation:n,onNewChat:r}){var C,I,E;const{data:s,isLoading:a}=TG(1),o=EG(),[l,c]=h.useState(null),[u,f]=h.useState(!1),[d,m]=h.useState(""),[p,g]=h.useState(""),x=h.useRef(null),{data:y,isFetching:v}=_G(p,p.length>=3);function b(){l&&(o.mutate(l),l===t&&r(),c(null))}function w(N){N.preventDefault(),d.trim().length>=3&&g(d.trim())}function j(){m(""),g(""),f(!1)}if(!e)return i.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[i.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Upgrade to Shield Advisor to save and resume advisor conversations."}),i.jsxs(Z,{variant:"outline",size:"sm",className:"w-full gap-1.5 text-xs",disabled:!0,children:[i.jsx(Qn,{className:"h-3.5 w-3.5 text-amber-500"}),"Shield Advisor only"]})]});const S=p.length>=3;return i.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 pt-3 pb-2 shrink-0",children:[i.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"History"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button","aria-label":"New chat",onClick:r,className:"inline-flex items-center justify-center h-6 w-6 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",children:i.jsx(vD,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button","aria-label":"Search conversations",onClick:()=>{f(N=>!N),u||setTimeout(()=>{var N;return(N=x.current)==null?void 0:N.focus()},50)},className:"inline-flex items-center justify-center h-6 w-6 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",children:i.jsx(Al,{className:"h-3.5 w-3.5"})})]})]}),u&&i.jsx("form",{onSubmit:w,className:"px-2 pb-2 shrink-0",children:i.jsxs("div",{className:"relative",children:[i.jsx(Al,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),i.jsx("input",{ref:x,type:"text",value:d,onChange:N=>m(N.target.value),placeholder:"Search… (min 3 chars)",className:"w-full pl-6 pr-6 py-1 text-xs rounded-md border border-border bg-background focus:outline-none focus:ring-1 focus:ring-ring"}),d&&i.jsx("button",{type:"button",onClick:j,className:"absolute right-1.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:i.jsx($t,{className:"h-3 w-3"})})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-2 space-y-0.5",children:[S&&i.jsxs(i.Fragment,{children:[v&&i.jsx("div",{className:"flex justify-center py-4",children:i.jsx(Xe,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!v&&((C=y==null?void 0:y.data)==null?void 0:C.length)===0&&i.jsx("p",{className:"text-[11px] text-muted-foreground px-2 py-2",children:"No results."}),!v&&((I=y==null?void 0:y.data)==null?void 0:I.map(N=>i.jsxs("div",{role:"button",tabIndex:0,onClick:()=>n(N.conversationId),onKeyDown:k=>k.key==="Enter"&&n(N.conversationId),className:W("group flex flex-col gap-0.5 rounded-md px-2 py-1.5 text-xs cursor-pointer transition-colors select-none",N.conversationId===t?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[i.jsx("span",{className:"font-medium truncate",children:N.title??`Chat — ${Br(lT(N.lastMessageAt),"MMM d")}`}),i.jsx("span",{className:"text-[10px] line-clamp-2 opacity-75",children:N.snippet})]},N.messageId)))]}),!S&&i.jsxs(i.Fragment,{children:[a&&i.jsx("div",{className:"flex justify-center py-4",children:i.jsx(Xe,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!a&&(!(s!=null&&s.data)||s.data.length===0)&&i.jsx("p",{className:"text-[11px] text-muted-foreground px-2 py-2",children:"No conversations yet."}),(E=s==null?void 0:s.data)==null?void 0:E.map(N=>i.jsx(Tse,{item:N,isActive:N.id===t,onSelect:()=>n(N.id),onDelete:()=>c(N.id)},N.id))]})]}),i.jsx(s7,{open:l!==null,onOpenChange:N=>!N&&c(null),children:i.jsxs(S_,{children:[i.jsxs(N_,{children:[i.jsx(C_,{children:"Delete conversation?"}),i.jsx(T_,{children:"This conversation will be permanently deleted. This action cannot be undone."})]}),i.jsxs(j_,{children:[i.jsx(__,{children:"Cancel"}),i.jsx(E_,{className:"bg-destructive hover:bg-destructive/90",onClick:b,children:"Delete"})]})]})})]})}const _se=yy({date:fn().min(1,"Date is required"),hours:fn().min(1,"Hours is required"),activityType:fn().min(1,"Activity type is required"),description:fn().optional(),propertyId:fn().optional(),isMaterialParticipation:Gl(),isQualifiedNonMaterial:Gl(),category:fn().optional()}).refine(e=>!(e.isMaterialParticipation&&e.isQualifiedNonMaterial),{path:["isQualifiedNonMaterial"],message:"Choose only one classification type"});function Ase({open:e,onClose:t,onSubmit:n,properties:r,isSubmitting:s=!1,initialValues:a,isDuplicate:o=!1}){var P;const{toast:l}=Ht(),{user:c}=At(),[u,f]=h.useState(!1),[d,m]=h.useState(!1),p=(c==null?void 0:c.repType)==="longTerm",g=new Date().getFullYear(),x=mi(),[y,v]=h.useState([]),[b,w]=h.useState(o?"form":"agent"),j=XA(),{viewMode:S}=jse(),C=S==="ai-only",I=S==="classic-only",[E,N]=h.useState("chat");h.useEffect(()=>{e&&(w(o||I?"form":"agent"),N("chat"))},[e,o,I]);const k=hy({resolver:my(_se),defaultValues:{date:((P=a==null?void 0:a.date)==null?void 0:P.substring(0,10))||Th(),hours:(a==null?void 0:a.hours)||"",activityType:(a==null?void 0:a.activityType)||"",description:(a==null?void 0:a.description)||"",propertyId:(a==null?void 0:a.propertyId)||"none",isMaterialParticipation:(a==null?void 0:a.isMaterialParticipation)??!1,isQualifiedNonMaterial:(a==null?void 0:a.isQualifiedNonMaterial)??!1,category:(a==null?void 0:a.category)||"passive"}}),A=aA({control:k.control,name:"date"});h.useEffect(()=>{var T;if(e&&a){const D=((T=a.date)==null?void 0:T.substring(0,10))||Th(),_=a.hours||"";k.setValue("date",D),k.setValue("hours",_),k.setValue("activityType",a.activityType||""),k.setValue("description",a.description||""),k.setValue("propertyId",a.propertyId||"none"),k.setValue("isMaterialParticipation",a.isMaterialParticipation??!1),k.setValue("isQualifiedNonMaterial",a.isQualifiedNonMaterial??!1),k.setValue("category",a.category||"passive")}},[e,a,k]),h.useEffect(()=>{if(A){const D=new Date(A).getFullYear();D<g?(m(!0),l({title:"Previous Tax Year Selected",description:`You are logging hours for ${D}. These will not count toward your current ${g} goals.`})):m(!1)}},[A,g,l]);const M=async()=>{const T=k.getValues("description");if(!(T!=null&&T.trim())){l({title:"No Description",description:"Please enter a description first",variant:"destructive"});return}f(!0);const D=k.getValues("propertyId"),_=r.find(G=>
573G.id===D);L.mutate({originalDescription:T,activityType:k.getValues("activityType"),propertyNickname:_==null?void 0:_.nickname})},L=Dt({mutationFn:async T=>(await Ze("POST","/api/ai/enhance-description",T)).json(),onSuccess:T=>{T.success&&(k.setValue("description",T.result.enhancedDescription),l({title:"Description Enhanced",description:`AI improvements applied with ${Math.round(T.result.confidence*100)}% confidence`}))},onError:T=>{l({title:"Enhancement Failed",description:T.message||"Failed to enhance description",variant:"destructive"})},onSettled:()=>{f(!1)}}),F=async T=>{try{const D=parseFloat(T.hours);if(D<.0167||D>24){l({title:"Validation Error",description:"Hours must be between 1 minute and 24 hours",variant:"destructive"});return}await n(T,y),v([]),k.reset({date:Th(),hours:"",activityType:"",description:"",propertyId:"none",isMaterialParticipation:!1,isQualifiedNonMaterial:!1,category:"passive"})}catch(D){console.error("Error creating entry:",D)}};h.useEffect(()=>{Object.keys(k.formState.errors).length>0},[k.formState.errors]);const V=i.jsx(py,{...k,children:i.jsxs("form",{onSubmit:k.handleSubmit(F),className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsx(Vn,{control:k.control,name:"date",render:({field:T})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Date"}),i.jsx(kn,{children:i.jsx(dt,{type:"date",...T})}),i.jsx(Sn,{})]})}),d&&i.jsxs("div",{className:"md:col-span-2 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 flex items-start gap-3",children:[i.jsx(ms,{className:"h-5 w-5 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-semibold text-amber-800 dark:text-amber-200 text-sm mb-1",children:"Previous Tax Year Selected"}),i.jsxs("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["You are logging hours for a previous tax year. These hours will not count toward your current ",g," goals. You can view previous year data using the Tax Year selector on the dashboard."]})]})]}),i.jsx(Vn,{control:k.control,name:"hours",render:({field:T})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Hours"}),i.jsx(kn,{children:i.jsx(Hx,{value:T.value,onChange:T.onChange,placeholder:"0.0167",showQuickButtons:!0})}),i.jsx(Sn,{})]})})]}),i.jsx(Vn,{control:k.control,name:"activityType",render:({field:T})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Activity Type"}),i.jsx(kn,{children:i.jsx("div",{className:"min-h-[44px]",children:i.jsx(Kx,{value:T.value,onValueChange:T.onChange,placeholder:"Select or type activity type..."})})}),i.jsx(Sn,{})]})}),i.jsx(Vn,{control:k.control,name:"propertyId",render:({field:T})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Property (Optional)"}),i.jsxs(ai,{value:T.value,onValueChange:T.onChange,children:[i.jsx(kn,{children:i.jsx(ys,{children:i.jsx(oi,{placeholder:"Select a property..."})})}),i.jsxs(vs,{children:[i.jsx(Kt,{value:"none",children:"No property"}),r.map(D=>{var G;const _=((G=D.id)==null?void 0:G.toString())||`property-fallback-${Date.now()}`;return!_||_===""||_==="undefined"||_==="null"?(console.error("Invalid property ID detected:",D),null):i.jsx(Kt,{value:_,children:D.nickname||D.address||"Unnamed Property"},_)}).filter(Boolean)]})]}),i.jsx(Sn,{})]})}),i.jsx(Vn,{control:k.control,name:"description",render:({field:T})=>i.jsxs(un,{children:[i.jsxs(dn,{className:"flex items-center justify-between text-sm font-normal",children:["Description",T.value&&i.jsx(qA,{feature:"AI Description Enhancement",tooltipText:"Enhance your time entry descriptions with AI to make them IRS audit-ready and professional. Premium feature for compliance.",showUpgradeButton:!1,children:i.jsx(Z,{type:"button",variant:"outline",size:"sm",onClick:M,disabled:u,className:"h-7 px-2 text-xs",children:u?i.jsxs(i.Fragment,{children:[i.jsx(_l,{className:"w-3 h-3 mr-1 animate-spin"}),"Enhancing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(TS,{className:"w-3 h-3 mr-1"}),"Enhance with AI"]})})})]}),i.jsx(kn,{children:i.jsx(Hr,{placeholder:"Briefly describe the activity: type, property address, date & duration, tasks performed, purpose, outcome, and reference any attached documents.",rows:3,...T})}),i.jsx(Sn,{})]})}),i.jsx(Vn,{control:k.control,name:"category",render:({field:T})=>i.jsxs(un,{children:[i.jsx(dn,{children:"Category"}),i.jsxs(ai,{onValueChange:D=>{T.onChange(D),D==="material"?(k.setValue("isMaterialParticipation",!0),k.setValue("isQualifiedNonMaterial",!1)):D==="qualified"?(k.setValue("isMaterialParticipation",!1),k.setValue("isQualifiedNonMaterial",!0)):(k.setValue("isMaterialParticipation",!1),k.setValue("isQualifiedNonMaterial",!1))},value:T.value,children:[i.jsx(kn,{children:i.jsx(ys,{children:i.jsx(oi,{placeholder:"Select classification"})})}),i.jsxs(vs,{children:[i.jsx(Kt,{value:"material",children:"Material Participation"}
573),p&&i.jsx(Kt,{value:"qualified",children:"Qualified Non-Material"})]})]}),i.jsx(gy,{children:"Select how this activity relates to your REP status."}),i.jsx(Sn,{})]})}),i.jsxs("div",{className:"space-y-3 pt-2",children:[i.jsx("h3",{className:"font-medium text-sm",children:"Evidence Files"}),i.jsx(GA,{onFilesSelected:v,maxFiles:5,acceptedFileTypes:{"image/*":[".png",".jpg",".jpeg"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"]}})]}),x?i.jsx("div",{className:"pt-6 pb-safe-bottom",children:i.jsx(Z,{type:"submit",className:"w-full",disabled:s,children:s?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Duplicating...":"Creating..."]}):i.jsxs(i.Fragment,{children:[i.jsx(io,{className:"mr-2 h-4 w-4"}),o?"Create Duplicate Entry":"Create Entry"]})})}):i.jsxs(Bl,{children:[i.jsx(Z,{type:"button",variant:"outline",onClick:t,disabled:s,children:"Cancel"}),i.jsx(Z,{type:"submit",disabled:s,children:s?i.jsxs(i.Fragment,{children:[i.jsx(Xe,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Duplicating...":"Creating..."]}):i.jsxs(i.Fragment,{children:[i.jsx(io,{className:"mr-2 h-4 w-4"}),o?"Create Duplicate Entry":"Create Entry"]})})]})]})}),U=!o&&!C&&!I&&i.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-gray-200 dark:border-gray-700 p-0.5 bg-gray-50 dark:bg-gray-900",children:[i.jsxs("button",{type:"button",onClick:()=>w("agent"),className:`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-all ${b==="agent"?"bg-white dark:bg-gray-800 shadow-sm text-gray-900 dark:text-gray-100":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:[i.jsx(hD,{className:"h-3.5 w-3.5"}),"AI Agent"]}),i.jsxs("button",{type:"button",onClick:()=>w("form"),className:`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-all ${b==="form"?"bg-white dark:bg-gray-800 shadow-sm text-gray-900 dark:text-gray-100":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:[i.jsx(_D,{className:"h-3.5 w-3.5"}),"Classic Form"]})]});if(x){const T=i.jsxs(Ag,{children:[i.jsx(Pg,{asChild:!0,children:i.jsxs("button",{type:"button",className:"inline-flex h-10 items-center gap-2 rounded-md px-3 text-lg font-semibold leading-none text-gray-900 transition-colors hover:bg-white/50 dark:text-white",children:[E==="chat"?"Chat":"History",i.jsx(di,{className:"h-5 w-5"})]})}),i.jsxs(qd,{align:"center",className:"w-36",children:[i.jsx(Ui,{onClick:()=>N("chat"),children:"Chat"}),i.jsx(Ui,{onClick:()=>N("history"),children:"History"})]})]});return i.jsx(m9,{open:e,onOpenChange:D=>!D&&t(),title:b==="agent"?T:o?"Duplicate Entry":"Add New Entry",showHandle:!0,swipeToDismiss:b!=="agent",handleDragToDismiss:b==="agent",className:b==="agent"?["h-[100dvh] max-h-[100dvh] rounded-t-[28px] shadow-2xl"].join(" "):void 0,headerClassName:b==="agent"?"overflow-hidden border-cyan-100/80 bg-gradient-to-r from-cyan-50 via-sky-50 to-emerald-50 shadow-[0_22px_48px_-30px_rgba(34,211,238,0.70)] dark:border-cyan-400/20 dark:from-cyan-950/40 dark:via-slate-950 dark:to-emerald-950/30":void 0,handleClassName:b==="agent"?"rounded-t-[28px] bg-gradient-to-r from-cyan-50 via-sky-50 to-emerald-50 dark:from-cyan-950/40 dark:via-slate-950 dark:to-emerald-950/30":void 0,centerTitle:b==="agent",children:i.jsxs("div",{className:W("flex flex-col min-h-0",b==="agent"?"flex-1":"h-[calc(90vh-80px)]"),children:[!o&&b!=="agent"&&i.jsx("div",{className:W("sticky top-0 z-10 flex justify-center px-4 pt-3 pb-1 shrink-0",b==="agent"?"bg-white/82 backdrop-blur dark:bg-gray-900/84":"bg-white dark:bg-gray-900"),children:U}),b==="agent"?i.jsx("div",{className:"flex flex-1 min-h-0 flex-col overflow-hidden",children:E==="chat"?i.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-4 pt-3",children:i.jsx(_w,{children:i.jsx(Q1,{session:j,hideHeader:!0})})}):i.jsx("div",{className:"flex-1 min-h-0 bg-muted/40",children:i.jsx(Ese,{isPremium:j.isPremium,activeConversationId:j.activeConversationId,onSelectConversation:D=>
573{j.setActiveConversationId(D),N("chat")},onNewChat:()=>{j.startNewConversation(),N("chat")}})})}):i.jsx("div",{className:"px-4 pb-4",children:V})]})})}return i.jsx($r,{open:e,onOpenChange:t,children:i.jsxs(ur,{className:`max-w-2xl w-[95vw] sm:w-full flex flex-col ${b==="agent"?"h-[80vh]":""}`,children:[i.jsx(dr,{className:"shrink-0",children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx(fr,{children:o?"Duplicate Time Entry":"Add New Time Entry"}),i.jsx(li,{className:"mt-1",children:o?"Modify the duplicated entry details and save as a new entry.":b==="agent"?"Describe what you did and the agent will log it for you.":"Create a new time entry for your real estate activities."})]}),U]})}),b==="agent"?i.jsx(_w,{children:i.jsx("div",{className:"flex-1 min-h-0",children:i.jsx(Q1,{session:j})})}):V]})})}function IR(){const{isOpen:e,closeDialog:t,onEntryCreated:n}=Jk(),{toast:r}=Ht();At();const{data:s=[]}=it({queryKey:["/api/properties"],retry:!1}),[a,o]=Ne.useState(!1),l=async(c,u)=>{o(!0);try{const f=await Ze("POST","/api/time-entries",c);if(f.ok){const d=await f.json();if(u&&u.length>0&&d.id)try{const m=new FormData;u.forEach(p=>{m.append("files",p)}),await Ze("POST",`/api/evidence-files/${d.id}`,m),r({title:"Evidence Attached",description:`${u.length} file(s) uploaded successfully`})}catch(m){console.error("File upload failed",m),r({title:"Evidence Upload Failed",description:"Entry created but files failed to upload",variant:"destructive"})}r({title:"Entry Created",description:"Time entry has been successfully created"}),n(),t()}else throw new Error("Failed to create entry")}catch(f){throw r({title:"Error",description:"Failed to create time entry",variant:"destructive"}),f}finally{o(!1)}};return i.jsx(Ase,{open:e,onClose:t,onSubmit:l,properties:s,isSubmitting:a})}var MR=["PageUp","PageDown"],DR=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],OR={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Do="Slider",[Fp,Pse,Rse]=jo(Do),[Jy]=zt(Do,[Rse]),[Ise,Pc]=Jy(Do),ev=h.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:a=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:f,onValueChange:d=()=>{},onValueCommit:m=()=>{},inverted:p=!1,form:g,...x}=e,y=h.useRef(new Set),v=h.useRef(0),b=h.useRef(!1),j=o==="horizontal"?Mse:Dse,[S=[],C]=jn({prop:f,defaultProp:u,onChange:M=>{var F;(F=[...y.current][v.current])==null||F.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,d(M)}}),I=h.useRef(S);function E(M){const L=Vse(S,M);A(M,L)}function N(M){A(M,v.current)}function k(){const M=I.current[v.current];S[v.current]!==M&&m(S)}function A(M,L,{commit:F}={commit:!1}){const V=Bse(a),U=Hse(Math.round((M-r)/a)*a+r,V),P=zl(U,[r,s]);C((T=[])=>{const D=Lse(T,P,L);if(Use(D,c*a)){v.current=D.indexOf(P);const _=String(D)!==String(T);return _&&F&&m(D),_?D:T}else return T})}return i.jsx(Ise,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:v,thumbs:y.current,values:S,orientation:o,form:g,children:i.jsx(Fp.Provider,{scope:e.__scopeSlider,children:i.jsx(Fp.Slot,{scope:e.__scopeSlider,children:i.jsx(j,{"aria-disabled":l,"data-disabled":l?"":void 0,...x,ref:t,onPointerDown:se(x.onPointerDown,()=>{l||(I.current=S,b.current=!1)}),min:r,max:s,inverted:p,onSlideStart:l?void 0:E,onSlideMove:l?void 0:N,onSlideEnd:l?void 0:k,onHomeKeyDown:()=>{l||(b.current=!0,A(r,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,A(s,S.length-1,{commit:!0}))},onStepKeyDown:({event:M,direction:L})=>{if(!l){b.current=!0;const U=MR.includes(M.key)||M.shiftKey&&DR.includes(M.key)?10:1,P=v.current,T=S[P],D=a*U*L;A(T+D,P,{commit:!0})}}})})})})});ev.displayName=Do;var[LR,FR]=Jy(Do,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Mse=h.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...f}=e,[d,m]=h.useState(null),p=Ae(t,w=>m(w)),g=h.useRef(void 0),x=oa(s),y=x==="ltr",v=y&&!a||!y&&a;function b(w){const j=g.current||d.getBoundingClientRect(),S=[0,j.width],I=tv(S,v?[n,r]:[r,n]);return g.current=j,I(w-j.left)}
573return i.jsx(LR,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:i.jsx(VR,{dir:x,"data-orientation":"horizontal",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const j=b(w.clientX);o==null||o(j)},onSlideMove:w=>{const j=b(w.clientX);l==null||l(j)},onSlideEnd:()=>{g.current=void 0,c==null||c()},onStepKeyDown:w=>{const S=OR[v?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:S?-1:1})}})})}),Dse=h.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,f=h.useRef(null),d=Ae(t,f),m=h.useRef(void 0),p=!s;function g(x){const y=m.current||f.current.getBoundingClientRect(),v=[0,y.height],w=tv(v,p?[r,n]:[n,r]);return m.current=y,w(x-y.top)}return i.jsx(LR,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:i.jsx(VR,{"data-orientation":"vertical",...u,ref:d,style:{...u.
573style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const y=g(x.clientY);a==null||a(y)},onSlideMove:x=>{const y=g(x.clientY);o==null||o(y)},onSlideEnd:()=>{m.current=void 0,l==null||l()},onStepKeyDown:x=>{const v=OR[p?"from-bottom":"from-top"].includes(x.key);c==null||c({event:x,direction:v?-1:1})}})})}),VR=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,f=Pc(Do,n);return i.jsx(pe.span,{...u,ref:t,onKeyDown:se(e.onKeyDown,d=>{d.key==="Home"?(o(d),d.preventDefault()):d.key==="End"?(l(d),d.preventDefault()):MR.concat(DR).includes(d.key)&&(c(d),d.preventDefault())}),onPointerDown:se(e.onPointerDown,d=>{const m=d.target;m.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):r(d)}),onPointerMove:se(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&s(d)}),onPointerUp:se(e.onPointerUp,d=>{const m=d.target;m.hasPointerCapture(d.pointerId)&&(m.releasePointerCapture(d.pointerId),a(d))})})}),$R="SliderTrack",zR=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Pc($R,n);return i.jsx(pe.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});zR.displayName=$R;var Vp="SliderRange",UR=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Pc(Vp,n),a=FR(Vp,n),o=h.useRef(null),l=Ae(t,o),c=s.values.length,u=s.values.map(m=>ZR(m,s.min,s.max)),f=c>1?Math.min(...u):0,d=100-Math.max(...u);return i.jsx(pe.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...e.style,[a.startEdge]:f+"%",[a.endEdge]:d+"%"}})});UR.displayName=Vp;var BR="SliderThumb",[Ose,HR]=Jy(BR),WR="SliderThumbProvider";function qR(e){const{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:s}=e,a=Pc(WR,t),o=Pse(t),[l,c]=h.useState(null),u=h.useMemo(()=>l?o().findIndex(y=>y.ref.current===l):-1,[o,l]),f=vg(l),d=l?!!a.form||!!l.closest("form"):!0,m=a.values[u],p=n??(a.name?a.name+(a.values.length>1?"[]":""):void 0),g=m===void 0?0:ZR(m,a.min,a.max);h.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]);const x={value:m,name:p,form:a.form,isFormControl:d,index:u,thumb:l,onThumbChange:c,percent:g,size:f};return i.jsx(Ose,{scope:t,...x,children:Wse(s)?s(x):r})}qR.displayName=WR;var ju="SliderThumbTrigger",GR=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Pc(ju,n),a=FR(ju,n),{index:o,value:l,percent:c,size:u,onThumbChange:f}=HR(ju,n),d=Ae(t,x=>f(x)),m=Fse(o,s.values.length),p=u==null?void 0:u[a.size],g=p?$se(p,c,a.direction):0;return i.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${c}% + ${g}px)`},children:i.jsx(Fp.ItemSlot,{scope:n,children:i.jsx(pe.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":l,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...r,ref:d,style:l===void 0?{display:"none"}:e.style,onFocus:se(e.onFocus,()=>{s.valueIndexToChangeRef.current=o})})})})});GR.displayName=ju;var YR=h.forwardRef((e,t)=>{const{__scopeSlider:n,name:r,...s}=e;return i.jsx(qR,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:a,isFormControl:o})=>i.jsxs(i.Fragment,{children:[i.jsx(GR,{...s,ref:t,__scopeSlider:n}),o?i.jsx(QR,{__scopeSlider:n},a):null]})})});YR.displayName=BR;var KR="SliderBubbleInput",QR=h.forwardRef(({__scopeSlider:e,...t},n)=>{const{value:r,name:s,form:a}=HR(KR,e),o=h.useRef(null),l=Ae(o,n),c=Ex(r);return h.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==r&&m){const p=new Event("input",{bubbles:!0});m.call(u,r),u.dispatchEvent(p)}},[c,r]),i.jsx(pe.input,{style:{display:"none"},name:s,form:a,...t,ref:l,defaultValue:r})});QR.displayName=KR;function Lse(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,a)=>s-a)}function ZR(e,t,n){const a=100/(n-t)*(e-t);return zl(a,[0,100])}function Fse(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Vse(e,t){if(e.length===1)return 0;const n=e.map(s=>
573Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function $se(e,t,n){const r=e/2,a=tv([0,50],[0,r]);return(r-a(t)*n)*n}function zse(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Use(e,t){if(t>0){const n=zse(e);return Math.min(...n)>=t}return!0}function tv(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Bse(e){if(!Number.isFinite(e))return 0;const t=e.toString();if(t.includes("e")){const[r,s]=t.split("e"),a=r.split(".")[1]||"",o=Number(s);return Math.max(0,a.length-o)}const n=t.split(".")[1];return n?n.length:0}function Hse(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}function Wse(e){return typeof e=="function"}const XR=h.forwardRef(({className:e,...t},n)=>i.jsxs(ev,{ref:n,className:W("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(zR,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:i.jsx(UR,{className:"absolute h-full bg-primary"})}),i.jsx(YR,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));XR.displayName=ev.displayName;function JR({isVisible:e,subscriptionStatus:t,trialEndDate:n,onUpgrade:r}){const[,s]=pt(),{toast:a}=Ht(),o=wt(),{data:l,isLoading:c,error:u}=iy(),[f,d]=h.useState(!1),[m,p]=h.useState(null),[g,x]=h.useState(!1),[y,v]=h.useState([100]);h.useEffect(()=>{l!=null&&l.annualPriceMin&&v([l.annualPriceMin])},[l]);const b=async F=>{p(F);try{const V=window.location.origin,U=await po({priceType:F,successUrl:`${V}/?payment=success&upgraded=true`,cancelUrl:`${V}/?payment=cancelled`});U.upgraded?(a({title:"Plan Updated",description:U.message}),window.location.reload()):U.checkoutUrl&&(window.location.href=U.checkoutUrl)}catch(V){if((V==null?void 0:V.status)===409){a({title:"Already Subscribed",description:"Opening your billing portal…"});try{const P=await(await Ze("POST","/api/create-portal-session",{})).json();if(P.url){window.location.href=P.url;return}}catch{}p(null);return}console.error("Upgrade error:",V),a({title:"Upgrade Error",description:V.message||"Failed to start upgrade process. Please try again.",variant:"destructive"}),p(null)}},w=async()=>{x(!0);try{await Ze("POST","/api/logout",{})}catch(F){console.error("Logout error:",F)}finally{await Or(o,{force:!0}),x(!1),so("/logout-success")}};if(!e)return null;const j=["⏱ Advanced time tracking with real-time stopwatch","📊 Comprehensive audit-ready reports and analytics","📅 Google Calendar sync with automated time logging","🔔 Smart lease expiry and milestone reminders","📄 Professional CSV exports for tax preparation","🤖 AI-powered voice-to-text activity logging","📧 Gmail integration for email time tracking","📁 Smart evidence management with AI analysis","🎯 Material participation tracking for Short-term REP","📈 Progress forecasting and completion analytics","🔌 REST API — connect your tools and automate workflows","🛡️ Enterprise-grade security and data protection","📞 Priority customer support and onboarding"],C=l?((F,V,U)=>{if(!l)return j.slice(0,6);const P=(F-V)/(U-V),T=3,D=j.length,_=Math.round(T+P*(D-T));return j.slice(0,_)})(y[0],l.annualPriceMin,l.annualPriceMax):[],I=l==null?void 0:l.monthlyPrice,E=l==null?void 0:l.annualPriceMin,N=l==null?void 0:l.annualPriceMax,k=()=>t==="trial_expired"||t==="trialing"&&n&&new Date(n)<new Date?{title:"Free Trial Expired",description:"Your 14-day free trial has ended. Upgrade to continue accessing all features.",buttonText:"UPGRADE NOW"}:["past_due","canceled","unpaid","incomplete_expired","expired"].includes(t)?{title:"Subscription Expired",description:"Your subscription has expired. Reactivate to restore full access to your account.",buttonText:"REACTIVATE SUBSCRIPTION"}:{title:"Access Restricted",description:"Your account access is currently limited. Please check your subscription status.",buttonText:"REACTIVATE SUBSCRIPTION"},{title:A,description:M,buttonText:L}=k();return i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[i.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),i.jsx(Je,{className:"relative w-full max-w-md bg-white dark:bg-gray-900 shadow-2xl rounded-xl",children:i.jsxs("div",{className:"p-6 sm:p-8",children:[i.jsx("div",{className:"flex justify-center mb-6",children:i.jsx("div",{className:"relative inline-block",children:i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-yellow-400 to-orange-500 rounded-full flex items-center justify-center shadow-lg",children:i.jsx(kS,{className:"w-8 h-8 text-white"})})})}),i.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white text-center mb-3",children:A}),i.jsx("p",{className:"text-gray-600 dark:text-gray-300 text-center mb-6 leading-relaxed",children:M}),i.jsxs(Z,{onClick:()=>d(!0),className:`w-full bg-blue-600 hover:bg-blue-7
57400 text-white font-semibold py-3 px-4 rounded-lg text-sm flex items-center justify-center gap-2 mb-6`,children:[i.jsx(Qn,{className:"w-4 h-4"}),L,i.jsx(ls,{className:"w-4 h-4"})]}),i.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-4 mb-6",children:[i.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 text-sm",children:"Unlock Shield Advisor Features:"}),i.jsxs("ul",{className:"text-sm text-blue-600 dark:text-blue-400 space-y-2",children:[i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(ot,{className:"w-4 h-4 flex-shrink-0"}),"Unlimited time tracking"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(ot,{className:"w-4 h-4 flex-shrink-0"}),"Advanced analytics & reports"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(ot,{className:"w-4 h-4 flex-shrink-0"}),"Calendar integration"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(ot,{className:"w-4 h-4 flex-shrink-0"}),"AI-powered insights"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(ot,{className:"w-4 h-4 flex-shrink-0"}),"REST API — connect your tools"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(ot,{className:"w-4 h-4 flex-shrink-0"}),"Priority support"]})]})]}),i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("div",{className:"flex gap-2 w-full",children:[i.jsxs(Z,{variant:"outline",className:"flex-1 text-blue-600 border-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:border-blue-400 dark:hover:bg-blue-900/20 font-medium text-sm flex items-center justify-center gap-1 px-2",onClick:()=>s("/manage-subscription"),children:[i.jsx(ao,{className:"w-4 h-4 flex-shrink-0"}),"MANAGE"]}),i.jsxs(Z,{variant:"outline",className:"flex-1 text-green-600 border-green-600 hover:bg-green-50 dark:text-green-400 dark:border-green-400 dark:hover:bg-green-900/20 font-medium text-sm flex items-center justify-center gap-1 px-2",onClick:()=>s("/contact"),children:[i.jsx(lg,{className:"w-4 h-4 flex-shrink-0"}),"SUPPORT"]})]}),i.jsxs(Z,{variant:"outline",className:"w-full text-red-600 border-red-600 hover:bg-red-50 dark:text-red-400 dark:border-red-400 dark:hover:bg-red-900/20 font-medium text-sm flex items-center justify-center gap-2",onClick:w,disabled:g,children:[i.jsx(El,{className:"w-4 h-4"}),g?"LOGGING OUT...":"LOG OUT"]})]})]})}),i.jsx($r,{open:f,onOpenChange:d,children:i.jsxs(ur,{className:"max-w-4xl p-0 overflow-hidden",children:[i.jsxs(dr,{className:"p-6 pb-0",children:[i.jsx(fr,{className:"text-2xl font-bold",children:"Choose Your Plan"}),i.jsx(li,{className:"text-base",children:i.jsx("span",{className:"text-red-600 font-medium",children:t==="trial_expired"||t==="trialing"&&n&&new Date(n)<new Date?"Your trial has ended • Choose a plan to continue":"Your subscription has expired • Reactivate to restore access"})})]}),i.jsxs("div",{className:"p-6",children:[i.jsxs("div",{className:"grid md:grid-cols-2 gap-6 items-stretch",children:[i.jsxs(Je,{className:"border-2 hover:border-blue-500 transition-colors flex flex-col",children:[i.jsxs(Yu,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(Ku,{className:"text-xl",children:"Monthly Plan"}),i.jsx(ES,{className:"h-5 w-5 text-blue-500"})]}),i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"text-3xl font-bold",children:c?"$--":`$${I}`}),i.jsx("span",{className:"text-gray-600",children:"/month"})]}),i.jsx(Gm,{children:"Flexible monthly billing • Cancel anytime"})]}),i.jsxs(rt,{className:"space-y-4 flex flex-col h-full",children:[i.jsx("ul",{className:"space-y-2 flex-grow",children:j.slice(0,3).map((F,V)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx(ot,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:F})]},V))}),i.jsx("div",{className:"mt-auto pt-4",children:i.jsx(Z,{className:"w-full",onClick:()=>b("monthly"),disabled:m!==null,children:m==="monthly"?"Processing...":"Choose Monthly"})})]})]}),i.jsxs(Je,{className:"border-2 border-green-500 relative flex flex-col",children:[i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:i.jsx(Mr,{className:"bg-green-500 text-white",children:"SAVE 17%"})}),i.jsxs(Yu,{className:"pt-8",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(Ku,{className:"text-xl",children:"Annual Plan"}),i.jsx(Qn,{className:"h-5 w-5 text-green-500"})]}),i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsxs("span",{className:"text-3xl font-bold",children:["$",y[0]]}),i.jsx("span",{className:"text-gray-600",children:"/year"}),i.jsxs(Mr,{variant:"outline",className:"ml-2",children:["$",(y[0]/12).toFixed(2),"/mo"]})]}),i.jsx(Gm,{children:"Flexible annual pricing — choose what feels right for your business."}),c?i.jsx("div",{className:"mt-4",children:i.jsxs("div",{className:"animate-pulse",children:[i.jsx("div",{className:"h-4 bg-gray-200 rounded mb-4"}),i.jsx("div",{className:"h-6 bg-gray-300 rounded"})]})}):l&&E&&N?i.jsxs("div",{className:"mt-4",children:[i.jsxs("div",{className:"flex justify-between text-sm text-gray-500 dark:text-gray-400 mb-2",children:[i.jsxs("span",{children:["$",E,"/year"]}),i.jsxs("span",{children:["$",N,"/year"]})]}),i.jsx(XR,{value:y,onValueChange:v,max:N,min:E,step:10,className:"w-full"}),i.jsx("div",{className:"flex justify-center mt-3",children:i.jsxs(Mr,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-600 dark:text-green-400",children:["$",y[0],"/year selected"]})}),i.jsx("div",{className:"text-center mt-2",children:i.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[C.length," of ",j.length," ","features unlocked at this price"]})})]}):null]}),i.jsxs(rt,{className:"space-y-4 flex flex-col flex-grow",children:[i.jsx("ul",{className:"space-y-2 flex-grow",children:C.map((F,V)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx(ot,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:F})]},V))}),i.jsx("div",{className:"mt-auto pt-4",children:i.jsx(Z,{className:"w-full bg-green-600 hover:bg-green-700",onClick:()=>b("annual"),disabled:m!==null,children:m==="annual"?"Processing...":"Choose Annual"})})]})]})]}),i.jsx("div",{className:"mt-6 text-center text-sm text-gray-600",children:i.jsx("p",{children:"✓ Secure payment via Stripe • ✓ Cancel anytime • ✓ No hidden fees"})})]})]})})]})}function e2(){const{user:e}=At(),{subscription:t}=pf(),[n]=pt(),r=["/","/login","/register","/forgot-password","/reset-password","/logout-success","/pricing","/features","/about","/why-reps-shield","/affiliate-program","/affiliate-signup","/tools","/privacy-policy","/terms-of-service"],s=["/manage-subscription","/logout-success"],a=r.some(g=>n===g||(n==null?void 0:n.startsWith(g+"/"))||(n==null?void 0:n.startsWith(g+"?"))),o=s.some(g=>n===g||(n==null?void 0:n.startsWith(g+"/"))||(n==null?void 0:n.startsWith(g+"?")));if(a)return{shouldShowOverlay:!1,subscriptionStatus:"public",isTrialExpired:!1,isSubscriptionExpired:!1};if(!e)return{shouldShowOverlay:!1,subscriptionStatus:"unknown",isTrialExpired:!1,isSubscriptionExpired:!1};if(o)return{shouldShowOverlay:!1,subscriptionStatus:(t==null?void 0:t.subscriptionStatus)||e.subscriptionStatus||"unknown",trialEndDate:e.trialEndDate,isTrialExpired:!1,isSubscriptionExpired:!1};if(e.isAdmin)return{shouldShowOverlay:!1,subscriptionStatus:e.subscriptionStatus||"admin",isTrialExpired:!1,isSubscriptionExpired:!1};const l=(t==null?void 0:t.subscriptionStatus)||e.subscriptionStatus||"unknown",c=e.trialEndDate,u=e.subscriptionEndDate,f=new Date,d=l==="trialing"&&c&&new Date(c)<f,m=l==="expired"&&u&&new Date(u)<f;return{shouldShowOverlay:d||m,subscriptionStatus:l,trialEndDate:c,isTrialExpired:d,isSubscriptionExpired:m}}var nv="ToastProvider",[rv,qse,Gse]=jo("Toast"),[t2]=zt("Toast",[Gse]),[Yse,If]=t2(nv),n2=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:a=50,announcerContainer:o,children:l}=e,[c,u]=h.useState(null),[f,d]=h.useState(0),m=h.useRef(!1),p=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${nv}\`. Expected non-empty \`string\`.`),i.jsx(rv.Provider,{scope:t,children:i.jsx(Yse,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:a,toastCount:f,viewport:c,onViewportChange:u,onToastAdd:h.useCallback(()=>d(g=>g+1),[]),onToastRemove:h.useCallback(()=>d(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:p,announcerContainer:o,children:l})})};n2.displayName=nv;var r2="ToastViewport",Kse=["F8"],$p="toast.viewportPause",zp="toast.viewportResume",s2=h.forwardRef((e,t)=>
574{const{__scopeToast:n,hotkey:r=Kse,label:s="Notifications ({hotkey})",...a}=e,o=If(r2,n),l=qse(n),c=h.useRef(null),u=h.useRef(null),f=h.useRef(null),d=h.useRef(null),m=Ae(t,d,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;h.useEffect(()=>{const y=v=>{var w;r.length!==0&&r.every(j=>v[j]||v.code===j)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),h.useEffect(()=>{const y=c.current,v=d.current;if(g&&y&&v){const b=()=>{if(!o.isClosePausedRef.current){const C=new CustomEvent($p);v.dispatchEvent(C),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const C=new CustomEvent(zp);v.dispatchEvent(C),o.isClosePausedRef.current=!1}},j=C=>{!y.contains(C.relatedTarget)&&w()},S=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",b),y.addEventListener("focusout",j),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",S),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",j),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[g,o.isClosePausedRef]);const x=h.useCallback(({tabbingDirection:y})=>{const b=l().map(w=>{const j=w.ref.current,S=[j,...lie(j)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?b.reverse():b).flat()},[l]);return h.useEffect(()=>{const y=d.current;if(y){const v=b=>{var S,C,I;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const E=document.activeElement,N=b.shiftKey;if(b.target===y&&N){(S=u.current)==null||S.focus();return}const M=x({tabbingDirection:N?"backwards":"forwards"}),L=M.findIndex(F=>F===E);Yh(M.slice(L+1))?b.preventDefault():N?(C=u.current)==null||C.focus():(I=f.current)==null||I.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[l,x]),i.jsxs(dO,{ref:c,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&i.jsx(Up,{ref:u,onFocusFromOutsideViewport:()=>{const y=x({tabbingDirection:"forwards"});Yh(y)}}),i.jsx(rv.Slot,{scope:n,children:i.jsx(pe.ol,{tabIndex:-1,...a,ref:m})}),g&&i.jsx(Up,{ref:f,onFocusFromOutsideViewport:()=>{const y=x({tabbingDirection:"backwards"});Yh(y)}})]})});s2.displayName=r2;var i2="ToastFocusProxy",Up=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,a=If(i2,n);return i.jsx(ef,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});Up.displayName=i2;var Rc="Toast",Qse="toast.swipeStart",Zse="toast.swipeMove",Xse="toast.swipeCancel",Jse="toast.swipeEnd",a2=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:a,...o}=e,[l,c]=jn({prop:r,defaultProp:s??!0,onChange:a,caller:Rc});return i.jsx(Lt,{present:n||l,children:i.jsx(nie,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Et(e.onPause),onResume:Et(e.onResume),onSwipeStart:se(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:se(e.onSwipeMove,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:se(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:se(e.onSwipeEnd,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),c(!1)})})})});a2.displayName=Rc;var[eie,tie]=t2(Rc,{onClose(){}}),nie=h.forwardRef((e,t)=>
574{const{__scopeToast:n,type:r="foreground",duration:s,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:d,onSwipeCancel:m,onSwipeEnd:p,...g}=e,x=If(Rc,n),[y,v]=h.useState(null),b=Ae(t,F=>v(F)),w=h.useRef(null),j=h.useRef(null),S=s||x.duration,C=h.useRef(0),I=h.useRef(S),E=h.useRef(0),{onToastAdd:N,onToastRemove:k}=x,A=Et(()=>{var V;(y==null?void 0:y.contains(document.activeElement))&&((V=x.viewport)==null||V.focus()),o()}),M=h.useCallback(F=>{!F||F===1/0||(window.clearTimeout(E.current),C.current=new Date().getTime(),E.current=window.setTimeout(A,F))},[A]);h.useEffect(()=>{const F=x.viewport;if(F){const V=()=>{M(I.current),u==null||u()},U=()=>{const P=new Date().getTime()-C.current;I.current=I.current-P,window.clearTimeout(E.current),c==null||c()};return F.addEventListener($p,U),F.addEventListener(zp,V),()=>{F.removeEventListener($p,U),F.removeEventListener(zp,V)}}},[x.viewport,S,c,u,M]),h.useEffect(()=>{a&&!x.isClosePausedRef.current&&M(S)},[a,S,x.isClosePausedRef,M]),h.useEffect(()=>(N(),()=>k()),[N,k]);const L=h.useMemo(()=>y?h2(y):null,[y]);return x.viewport?i.jsxs(i.Fragment,{children:[L&&i.jsx(rie,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:L}),i.jsx(eie,{scope:n,onClose:A,children:sa.createPortal(i.jsx(rv.ItemSlot,{scope:n,children:i.jsx(uO,{asChild:!0,onEscapeKeyDown:se(l,()=>{x.isFocusedToastEscapeKeyDownRef.current||A(),x.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(pe.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":x.swipeDirection,...g,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:se(e.onKeyDown,F=>{F.key==="Escape"&&(l==null||l(F.nativeEvent),F.nativeEvent.defaultPrevented||(x.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:se(e.onPointerDown,F=>{F.button===0&&(w.current={x:F.clientX,y:F.clientY})}),onPointerMove:se(e.onPointerMove,F=>{if(!w.current)return;const V=F.clientX-w.current.x,U=F.clientY-w.current.y,P=!!j.current,T=["left","right"].includes(x.swipeDirection),D=["left","up"].includes(x.swipeDirection)?Math.min:Math.max,_=T?D(0,V):0,G=T?0:D(0,U),z=F.pointerType==="touch"?10:2,R={x:_,y:G},q={originalEvent:F,delta:R};P?(j.current=R,ru(Zse,d,q,{discrete:!1})):J1(R,x.swipeDirection,z)?(j.current=R,ru(Qse,f,q,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(V)>z||Math.abs(U)>z)&&(w.current=null)}),onPointerUp:se(e.onPointerUp,F=>{const V=j.current,U=F.target;if(U.hasPointerCapture(F.pointerId)&&U.releasePointerCapture(F.pointerId),j.current=null,w.current=null,V){const P=F.currentTarget,T={originalEvent:F,delta:V};J1(V,x.swipeDirection,x.swipeThreshold)?ru(Jse,p,T,{discrete:!0}):ru(Xse,m,T,{discrete:!0}),P.addEventListener("click",D=>D.preventDefault(),{once:!0})}})})})}),x.viewport)})]}):null}),rie=e=>{const{__scopeToast:t,children:n,...r}=e,s=If(Rc,t),[a,o]=h.useState(!1),[l,c]=h.useState(!1);return aie(()=>o(!0)),h.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:i.jsx(ca,{asChild:!0,container:s.announcerContainer||void 0,children:i.jsx(ef,{...r,children:a&&i.jsxs(i.Fragment,{children:[s.label," ",n]})})})},sie="ToastTitle",o2=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(pe.div,{...r,ref:t})});o2.displayName=sie;var iie="ToastDescription",l2=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(pe.div,{...r,ref:t})});l2.displayName=iie;var c2="ToastAction",u2=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?i.jsx(f2,{altText:n,asChild:!0,children:i.jsx(sv,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${c2}\`. Expected non-empty \`string\`.`),null)});u2.displayName=c2;var d2="ToastClose",sv=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=tie(d2,n);return i.jsx(f2,{asChild:!0,children:i.jsx(pe.button,{type:"button",...r,ref:t,onClick:se(e.onClick,s.onClose)})})});sv.displayName=d2;var f2=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return i.jsx(pe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function h2(e){const t=[];
574return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),oie(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...h2(r))}}),t}function ru(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?dg(s,a):s.dispatchEvent(a)}var J1=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),a=r>s;return t==="left"||t==="right"?a&&r>n:!a&&s>n};function aie(e=()=>{}){const t=Et(e);_t(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function oie(e){return e.nodeType===e.ELEMENT_NODE}function lie(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Yh(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var cie=n2,m2=s2,p2=a2,g2=o2,x2=l2,y2=u2,v2=sv;const uie=cie,b2=h.forwardRef(({className:e,...t},n)=>i.jsx(m2,{ref:n,className:W("fixed top-0 z-[11000] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));b2.displayName=m2.displayName;const die=So("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),w2=h.forwardRef(({className:e,variant:t,...n},r)=>i.jsx(p2,{ref:r,className:W(die({variant:t}),e),...n}));w2.displayName=p2.displayName;const fie=h.forwardRef(({className:e,...t},n)=>i.jsx(y2,{ref:n,className:W("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));fie.displayName=y2.displayName;const k2=h.forwardRef(({className:e,...t},n)=>i.jsx(v2,{ref:n,className:W("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:i.jsx($t,{className:"h-4 w-4"})}));k2.displayName=v2.displayName;const S2=h.forwardRef(({className:e,...t},n)=>i.jsx(g2,{ref:n,className:W("text-sm font-semibold",e),...t}));S2.displayName=g2.displayName;const N2=h.forwardRef(({className:e,...t},n)=>i.jsx(x2,{ref:n,className:W("text-sm opacity-90",e),...t}));N2.displayName=x2.displayName;function j2(){const{toasts:e}=Ht();return i.jsxs(uie,{children:[e.map(function({id:t,title:n,description:r,action:s,...a}){return i.jsxs(w2,{...a,children:[i.jsxs("div",{className:"grid gap-1",children:[n&&i.jsx(S2,{children:n}),r&&i.jsx(N2,{children:r})]}),s,i.jsx(k2,{})]},t)}),i.jsx(b2,{})]})}const hie="mobile_reward_granted_banner";function mie(){return Ok()?"android":tc()?"ios":null}function Kh(e,t){var n,r;HE(e,t),(r=(n=window.amplitude)==null?void 0:n.track)==null||r.call(n,e,t)}function pie(e){h.useEffect(()=>{if(!e||!Le())return;const t=mie();if(!t)return;const n=e,r=`mobile_session_tracked:${n.id}:${t}`,s=`mobile_reward_checked:${n.id}:${t}`;let a=!1;async function o(){if(sessionStorage.getItem(r)!=="1"&&(await Ze("POST","/api/mobile/session",{platform:t,appVersion:void 0}),sessionStorage.setItem(r,"1")),sessionStorage.getItem(s)==="1")return;Kh("mobile_login",{user_id:n.id,platform:t,subscription_tier:n.subscriptionStatus});const c=await(await Ze("POST","/api/mobile/rewards/check",{platform:t,appVersion:void 0})).json();if(a)return;sessionStorage.setItem(s,"1");const u=!!n.stripeSubscriptionId&&(n.subscriptionStatus==="active"||n.subscriptionStatus==="trialing"),f={user_id:n.id,platform:t,subscription_tier:n.subscriptionStatus,campaign_ke
574y:c.campaignKey,eligibility_reason:c.reason,credit_amount:c.creditAmountCents,currency:c.currency};if(c.granted){if(Kh("mobile_reward_granted",f),u)try{localStorage.setItem(`${hie}:${n.id}`,"1")}catch{}return}Kh(c.eligible?"mobile_reward_already_granted":"mobile_reward_ineligible",f)}return o().catch(l=>{console.warn("Mobile reward check failed:",l)}),()=>{a=!0}},[e])}const os=mr("PushNotifications",{});let Qh=null,Xo=null,ek=!1;function C2(){const e=ro.getPlatform();return e==="ios"||e==="android"||e==="web"?e:"unknown"}async function gie(){try{return(await _d.getInfo()).version??null}catch{return null}}async function xie(e,t){await Ze("POST","/api/push-notifications/tokens",{token:e,platform:C2(),appVersion:await gie(),permissionStatus:t})}async function yie(){if(C2()==="android")try{await os.createChannel({id:"geofence_visits",name:"Property visit updates",description:"Notifications when geofence visits are logged.",importance:4,visibility:1,sound:"default",vibration:!0})}catch(e){console.warn("[PushNotifications] Failed to create Android channel:",e)}}async function vie(e){try{await xie(e.value,"granted"),console.log("[PushNotifications] Device token registered.")}catch(t){console.error("[PushNotifications] Failed to persist token:",t)}}function bie(e){return new Promise(t=>setTimeout(t,e))}async function wie(){let e=await os.checkPermissions();if(console.log("[PushNotifications] Permission check:",e.receive),e.receive==="prompt"&&(e=await os.requestPermissions(),console.log("[PushNotifications] Permission request:",e.receive)),e.receive==="granted")return"granted";for(const t of[500,1500])if(await bie(t),e=await os.checkPermissions(),console.log("[PushNotifications] Permission re-check:",e.receive),e.receive==="granted")return"granted";return e.receive}function kie(){ek||(ek=!0,os.addListener("registration",vie),os.addListener("registrationError",e=>{console.error("[PushNotifications] Registration error:",e.error)}),os.addListener("pushNotificationReceived",e=>{console.log("[PushNotifications] Received:",e)}),os.addListener("pushNotificationActionPerformed",e=>{const t=e.notification.data??{};if(t.type==="geofence_visit_logged"){const n=typeof t.route=="string"?t.route:t.recipientRole==="team_member"?"/member/time-entries":"/dashboard";window.location.assign(n)}}))}const tk={async start(e){if(!(!Le()||!e)&&Qh!==e&&Xo!==e){Xo=e;try{kie(),await yie();const t=await wie();if(t!=="granted"){console.warn("[PushNotifications] Permission not granted:",t);return}await os.register(),Qh=e}finally{Xo===e&&(Xo=null)}}},reset(){Qh=null,Xo=null}};function Sie({isOpen:e,onComplete:t}){const[,n]=pt(),[r,s]=h.useState(!1);h.useEffect(()=>{if(e){s(!0);const o=setTimeout(()=>s(!1),3e3);return()=>clearTimeout(o)}},[e]);const a=()=>{localStorage.setItem("repshield_onboarding_completed","true"),n("/dashboard"),t()};return i.jsx($r,{open:e,onOpenChange:o=>!o&&t(),children:i.jsxs(ur,{className:"sm:max-w-md",children:[i.jsxs(dr,{className:"text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/20",children:i.jsx(Fs,{className:"h-10 w-10 text-green-600 dark:text-green-400"})}),i.jsxs(fr,{className:"text-2xl font-bold text-green-600 dark:text-green-400 flex items-center justify-center gap-2",children:[i.jsx(Gi,{className:"h-6 w-6"}),"Congratulations! 🎉",i.jsx(Gi,{className:"h-6 w-6"})]}),i.jsxs(li,{className:"text-base text-gray-600 dark:text-gray-400 space-y-3 mt-4",children:[i.jsx("p",{className:"font-semibold",children:"You've successfully completed the REPSShield tour!"}),i.jsx("p",{children:"You now know how to use all the key features to track your real estate activities across:"}),i.jsxs("ul",{className:"text-left space-y-1 max-w-xs mx-auto",children:[i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(Fs,{className:"h-4 w-4 text-green-500 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:"Dashboard & Progress Tracking"})]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(Fs,{className:"h-4 w-4 text-green-500 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:"Activity Ledger Management"})]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(Fs,{className:"h-4 w-4 text-green-500 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:"Analytics & Insights"})]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(Fs,{className:"h-4 w-4 text-green-500 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:"File Vault & Organization"})]})]}),i.jsx("p",{className:"text-sm font-medium",children:"Remember, you can restart this tour anytime from the help menu."})]})]}),i.jsx("div",{className:"flex justify-center mt-6",children:i.jsxs(Z,{onClick:a,className:"bg-green-600 hover:bg-green-700 text-white px-6 py-2 rounded-lg font-semibold flex items-center gap-2 transition-colors",children:["Start Tracking Your REP Hours",i.jsx(ls,{className:"h-4 w-4"})]})}),r&&i.jsx("div",{className:"fixed inset-0 pointer-events-none z-50",children:i.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[i.jsx("div",{className:"animate-bounce",children:"🎊"}),i.jsx("div",{className:"animate-pulse delay-100",children:"✨"}),i.jsx("div",{className:"animate-bounce delay-200",children:"🎉"}),i.jsx("div",{className:"animate-pulse delay-300",children:"⭐"}),i.jsx("div",{className:"animate-bounce delay-500",children:"🌟"})]})})]})})}const Nie=()=>
574{const{isActive:e,currentStep:t,steps:n,nextStep:r,prevStep:s,skipTour:a,endTour:o}=nM(),[l,c]=h.useState(null),[u,f]=h.useState({top:0,left:0}),[d,m]=h.useState(!1),p=n[t];return h.useEffect(()=>{if(!e||!p)return;if(p.showCompletionDialog){m(!0);return}p.action&&setTimeout(()=>{var S;(S=p.action)==null||S.call(p)},300),p.openChatbot&&setTimeout(()=>{const S=document.querySelector('button[data-tour="ai-chatbot"]');S&&S.offsetParent!==null&&S.click()},500),p.openStopwatch&&setTimeout(()=>{const S=document.querySelector('button[data-tour="stopwatch"]');S&&S.offsetParent!==null&&S.click()},500);const g=()=>{if(!p.targetSelector)return;let S=null;if(S=document.querySelector(p.targetSelector),S){c(S),S.scrollIntoView({behavior:"smooth",block:"center"});const C=S.getBoundingClientRect(),I=window.scrollY,E=window.scrollX;let N=C.top+I,k=C.left+E;switch(p.position){case"bottom":N=C.bottom+I+10,k=C.left+E+C.width/2-200;break;case"top":N=C.top+I-220,k=C.left+E+C.width/2-200;break;case"right":N=C.top+I,k=C.right+E+10;break;case"left":N=C.top+I,k=C.left+E-410;break;case"center":N=window.innerHeight/2+I-100,k=window.innerWidth/2-200;break;default:N=C.bottom+I+10,k=C.left+E}const A=window.innerWidth,M=window.innerHeight,L=Math.min(384,A-40),F=200,V=A-L-20,U=I+M-F-20,P=I+20;f({top:Math.max(P,Math.min(N,U)),left:Math.max(20,Math.min(k,V))}),S.style.backgroundColor="white",S.style.border="3px solid #3b82f6",S.style.borderRadius="12px",S.style.boxShadow="0 0 0 4px rgba(59, 130, 246, 0.3)",S.style.zIndex="1050",S.style.padding="16px",S.setAttribute("data-tour-highlighted","true")}else{const C=window.scrollY;f({top:window.innerHeight/2+C-100,left:window.innerWidth/2-192})}};g();const x=setTimeout(g,100),y=setTimeout(g,500),v=setTimeout(g,1e3),b=setTimeout(g,2e3);let w,j;return(p.openChatbot||p.openStopwatch)&&(w=setTimeout(g,800),j=setTimeout(g,1200)),()=>{clearTimeout(x),clearTimeout(y),clearTimeout(v),clearTimeout(b),w&&clearTimeout(w),j&&clearTimeout(j),l&&(l.style.zIndex="",l.style.outline="",l.style.outlineOffset="",l.style.borderRadius="",l.style.border="",l.style.backgroundColor="",l.style.boxShadow="",l.style.padding="",l.removeAttribute("data-tour-highlighted"))}},[e,t,p,l]),h.useEffect(()=>()=>{l&&(l.style.zIndex="",l.style.outline="",l.style.outlineOffset="",l.style.borderRadius="",l.style.border="",l.style.backgroundColor="",l.style.boxShadow="",l.style.padding="",l.removeAttribute("data-tour-highlighted"))},[l]),!e||!p?null:d?i.jsx(Sie,{isOpen:d,onComplete:()=>{m(!1),o()}}):i.jsx(i.Fragment,{children:i.jsx(Je,{className:"fixed z-[9999] w-96 max-w-[calc(100vw-40px)] shadow-xl border-2 border-primary",style:{top:`${u.top}px`,left:`${u.left}px`},children:i.jsxs(rt,{className:"p-4",children:[i.jsxs("div",{className:"flex items-start justify-between mb-3",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("div",{className:"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center text-sm font-bold",children:t+1}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:[t+1," of ",n.length]})]}),i.jsx(Z,{variant:"ghost",size:"sm",onClick:o,children:i.jsx($t,{className:"h-4 w-4"})})]}),i.jsx("h3",{className:"font-semibold text-lg mb-2",children:p.title}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:p.description}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs(Z,{variant:"outline",size:"sm",onClick:s,disabled:t===0,children:[i.jsx(ag,{className:"h-4 w-4 mr-1"}),"Back"]}),i.jsxs(Z,{variant:"outline",size:"sm",onClick:a,children:[i.jsx(FD,{className:"h-4 w-4 mr-1"}),"Skip Tour"]})]}),i.jsxs(Z,{size:"sm",onClick:r,children:[t===n.length-1?"Finish":"Next",t<n.length-1&&i.jsx(ls,{className:"h-4 w-4 ml-1"})]})]})]})})})};var Bp;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(Bp||(Bp={}));var nk;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(nk||(nk={}));const Zh=mr("StatusBar"),jie={idle:"",checking:"Checking for updates",downloading:"Updating app",ready:"Restart app for updates",failed:"Update paused"};function Cie({status:e}){return e==="ready"?i.jsx(gS,{className:"h-5 w-5 text-emerald-600"}):e==="failed"?i.jsx(hs,{className:"h-5 w-5 text-amber-600"}):e==="downloading"?i.jsx(SD,{className:"h-5 w-5 text-primary"}):i.jsx(Xe,{className:"h-5 w-5 animate-spin text-primary"})}function Tie({state:e}){if(e.status==="idle")return null;const t=e.status==="checking"||e.status==="downloading",n=jie[e.status],r=Math.max(0,Math.min(100,e.percent||0)),s=e.status==="downloading"&&r>0,a=s?{background:`conic-gradient(hsl(var(--primary)) ${r*3.6}deg, hsl(var(--muted)) 0deg)`}:void 0;return i.jsxs("div",{role:"status","aria-live":"polite","aria-label":e.message||n,className:"pointer-events-none fixed bottom-[calc(env(safe-area-inset-bottom)+5rem)] right-4 z-[70]",children:[i.jsxs("div",{className:W("absolute right-[calc(100%+0.5rem)] top-1/2 max-w-[11rem] -translate-y-1/2 roun
574ded-full border bg-background/95 px-3 py-2 text-xs font-medium leading-tight text-foreground shadow-lg backdrop-blur",e.status==="failed"?"border-amber-200 text-amber-900 shadow-amber-950/10 dark:text-amber-200":"border-border shadow-black/10"),children:[i.jsx("span",{className:"block whitespace-nowrap",children:n}),s&&i.jsxs("span",{className:"mt-0.5 block text-[10px] font-semibold text-muted-foreground",children:[r,"% downloaded"]})]}),i.jsx("div",{className:W("relative flex h-14 w-14 items-center justify-center rounded-full p-0.5 shadow-lg backdrop-blur",e.status==="failed"?"bg-amber-100 shadow-amber-950/10":"bg-muted shadow-black/10"),style:a,children:i.jsxs("div",{className:"relative flex h-full w-full items-center justify-center rounded-full border border-border bg-background/95 text-foreground",children:[i.jsx(Cie,{status:e.status}),t&&i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-3 w-3 rounded-full border-2 border-background bg-primary"}),s&&i.jsxs("span",{className:"absolute -bottom-1 rounded-full bg-primary px-1.5 py-0.5 text-[9px] font-semibold leading-none text-primary-foreground shadow-sm",children:[r,"%"]})]})})]})}const Eie="__capgo_keep_url_path_after_reload",Xh="__capgo_history_stack__",rk=100,_ie=typeof window<"u"&&typeof document<"u"&&typeof history<"u";if(_ie){const e=window;if(!e.__capgoHistoryPatched){e.__capgoHistoryPatched=!0;const t=()=>{try{if(e.__capgoKeepUrlPathAfterReload)return!0}catch{}try{return window.localStorage.getItem(Eie)==="1"}catch{return!1}},n=()=>{try{const S=window.sessionStorage.getItem(Xh);if(!S)return{stack:[],index:-1};const C=JSON.parse(S);return!C||!Array.isArray(C.stack)||typeof C.index!="number"?{stack:[],index:-1}:C}catch{return{stack:[],index:-1}}},r=(S,C)=>{try{window.sessionStorage.setItem(Xh,JSON.stringify({stack:S,index:C}))}catch{}},s=()=>{try{window.sessionStorage.removeItem(Xh)}catch{}},a=S=>{try{const C=S??window.location.href,I=new URL(C instanceof URL?C.toString():C,window.location.href);return`${I.pathname}${I.search}${I.hash}`}catch{return null}},o=(S,C)=>{if(S.length<=rk)return{stack:S,index:C};const I=S.length-rk,E=S.slice(I),N=Math.max(0,C-I);return{stack:E,index:N}},l=S=>{document.readyState==="complete"||document.readyState==="interactive"?S():window.addEventListener("DOMContentLoaded",S,{once:!0})};let c=!1,u=!1,f=!1;const d=()=>{if(!c)return;const S=n(),C=a();if(C){if(S.stack.length===0){S.stack.push(C),S.index=0,r(S.stack,S.index);return}(S.index<0||S.index>=S.stack.length)&&(S.index=S.stack.length-1),S.stack[S.index]!==C&&(S.stack[S.index]=C,r(S.stack,S.index))}},m=(S,C)=>{if(!c||u)return;const I=a(S);if(!I)return;let{stack:E,index:N}=n();E.length===0?(E.push(I),N=E.length-1):C?((N<0||N>=E.length)&&(N=E.length-1),E[N]=I):N>=E.length-1?(E.push(I),N=E.length-1):(E=E.slice(0,N+1),E.push(I),N=E.length-1),{stack:E,index:N}=o(E,N),r(E,N)},p=()=>{if(!c||u)return;const S=n();if(S.stack.length===0){d();return}const C=S.index>=0&&S.index<S.stack.length?S.index:S.stack.length-1,I=a();if(S.stack.length===1&&I===S.stack[0])return;const E=S.stack[0];if(!E)return;u=!0;try{history.replaceState(history.state,document.title,E);for(let A=1;A<S.stack.length;A+=1)history.pushState(history.state,document.title,S.stack[A])}catch{u=!1;return}u=!1;const N=S.stack.length-1,k=C-N;k!==0?history.go(k):(history.replaceState(history.state,document.title,S.stack[C]),window.dispatchEvent(new PopStateEvent("popstate")))},g=()=>{!c||f||(f=!0,l(()=>{f=!1,p()}))};let x=null,y=null;const v=()=>{if(!c||u)return;const S=a();if(!S)return;const C=n(),I=C.stack.lastIndexOf(S);I>=0?C.index=I:(C.stack.push(S),C.index=C.stack.length-1);const E=o(C.stack,C.index);r(E.stack,E.index)},b=()=>{x&&y||(x=history.pushState,y=history.replaceState,history.pushState=function(C,I,E){const N=x==null?void 0:x.call(history,C,I,E);return m(E,!1),N},history.replaceState=function(C,I,E){const N=y==null?void 0:y.call(history,C,I,E);return m(E,!0),N},window.addEventListener("popstate",v))},w=()=>
574{x&&(history.pushState=x,x=null),y&&(history.replaceState=y,y=null),window.removeEventListener("popstate",v)},j=S=>{if(c===S){c&&(d(),g());return}c=S,c?(b(),d(),g()):(w(),s())};window.addEventListener("CapacitorUpdaterKeepUrlPathAfterReload",S=>{var C;const I=S,E=(C=I==null?void 0:I.detail)===null||C===void 0?void 0:C.enabled;typeof E=="boolean"?(e.__capgoKeepUrlPathAfterReload=E,j(E)):(e.__capgoKeepUrlPathAfterReload=!0,j(!0))}),j(t())}}var sk;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.UPDATE_NOT_AVAILABLE=1]="UPDATE_NOT_AVAILABLE",e[e.UPDATE_AVAILABLE=2]="UPDATE_AVAILABLE",e[e.UPDATE_IN_PROGRESS=3]="UPDATE_IN_PROGRESS"})(sk||(sk={}));var ik;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.PENDING=1]="PENDING",e[e.DOWNLOADING=2]="DOWNLOADING",e[e.INSTALLING=3]="INSTALLING",e[e.INSTALLED=4]="INSTALLED",e[e.FAILED=5]="FAILED",e[e.CANCELED=6]="CANCELED",e[e.DOWNLOADED=11]="DOWNLOADED"})(ik||(ik={}));var ak;(function(e){e[e.OK=0]="OK",e[e.CANCELED=1]="CANCELED",e[e.FAILED=2]="FAILED",e[e.NOT_AVAILABLE=3]="NOT_AVAILABLE",e[e.NOT_ALLOWED=4]="NOT_ALLOWED",e[e.INFO_MISSING=5]="INFO_MISSING"})(ak||(ak={}));const Ei=mr("CapacitorUpdater",{web:()=>ce(()=>import("./web-ITOxpK7a.js"),__vite__mapDeps([156,1])).then(e=>new e.CapacitorUpdaterWeb)});let ok=!1,Jh=!1,Ls=null,Jo=null;const Aie="https://repslive.chanlabs.dev/api/latest",Pie=6e3;function Nr(e,t){Jo&&(clearTimeout(Jo),Jo=null),e(t),(t.status==="ready"||t.status==="failed")&&(Jo=setTimeout(()=>{e({status:"idle",percent:0}),Jo=null},Pie))}function Rie(e){if(!ok){if(ok=!0,!ro.isNativePlatform()){console.log("[LiveUpdate] Skipped: not native platform");return}Ei.notifyAppReady(),Ei.addListener("download",t=>{const n=Math.round(t.percent??0);Nr(e,{status:"downloading",percent:n,message:`Downloading update ${n}%`}),console.log("[LiveUpdate] Download progress:",t)}),Ei.addListener("downloadComplete",t=>{Nr(e,{status:"ready",percent:100,message:"Update downloaded. It will apply when you reopen the app."}),console.log("[LiveUpdate] Download complete:",t)}),Ei.addListener("downloadFailed",t=>{Nr(e,{status:"failed",percent:0,message:"Update download failed. We will try again later."}),console.error("[LiveUpdate] Download failed:",t)}),lk(e),_d.addListener("appStateChange",async t=>{if(t.isActive){await lk(e);return}if(!t.isActive&&(Ls!=null&&Ls.id))try{console.log("[LiveUpdate] Applying update:",Ls),await Ei.set({id:Ls.id}),Ls=null}catch(n){console.error("[LiveUpdate] Failed to apply update:",n),Nr(e,{status:"failed",percent:0,message:"Update failed to apply."})}})}}async function lk(e){var t;if(!Jh){Jh=!0;try{Nr(e,{status:"checking",percent:0,message:"Checking for updates..."}),console.log("[LiveUpdate] Checking latest update...");const n=await Ei.current();console.log("[LiveUpdate] Current:",n);const s=await(await fetch(Aie,{cache:"no-store"})).json();if(console.log("[LiveUpdate] Latest:",s),!(s!=null&&s.version)||!(s!=null&&s.url)){console.log("[LiveUpdate] No update available"),Nr(e,{status:"idle",percent:0});return}const a=((t=n.bundle)==null?void 0:t.version)??"builtin";if(a===s.version){console.log("[LiveUpdate] Already latest version:",a),Nr(e,{status:"idle",percent:0});return}Nr(e,{status:"downloading",percent:0,message:`Downloading update ${s.version}...`}),console.log("[LiveUpdate] Downloading update:",s.version),Ls=await Ei.download({version:s.version,url:s.url,checksum:s.checksum}),console.log("[LiveUpdate] Download complete:",Ls),Nr(e,{status:"ready",percent:100,message:"Update downloaded. Close and reopen the app to apply it."})}catch(n){console.error("[LiveUpdate] Check/download failed:",n),Nr(e,{status:"failed",percent:0,message:"Update check failed. We will try again later."})}finally{Jh=!1}}}function Iie(){const{user:e}=At(),t=e2(),[,n]=pt();return i.jsxs(zx,{children:[i.jsx(J_,{}),i.jsx(BA,{user:e}),i.jsx(IR,{}),e&&t.shouldShowOverlay&&i.jsx(JR,{isVisible:t.shouldShowOverlay,subscriptionStatus:t.subscriptionStatus,trialEndDate:t.trialEndDate,onUpgrade:()=>n("/manage-subscription")}),i.jsx(j2,{}),i.jsx(Nie,{})]})}function Mie(){const{user:e}=At(),t=e2(),[,n]=pt();return pie(e),h.useEffect(()=>{const r=e!=null&&e.id?String(e.id):null;if(!r){tk.reset();return}tk.start(r).catch(s=>{console.error("[PushNotifications] Failed to start:",s)})},[e==null?void 0:e.id]),i.jsxs(i.Fragment,{children:[i.jsx(BA,{user:e}),i.jsx(IR,{}),e&&t.shouldShowOverlay&&i.jsx(JR,{isVisible:t.shouldShowOverlay,subscriptionStatus:t.subscriptionStatus,trialEndDate:t.trialEndDate,onUpgrade:()=>n("/manage-subscription")})]})}function Die(){const[e,t]=h.useState("offline");return h.useEffect(()=>{Le()&&(Zh.setOverlaysWebView({overlay:!1}).catch(()=>{}
574),Zh.setBackgroundColor({color:"#ffffff"}).catch(()=>{}),Zh.setStyle({style:Bp.Light}).catch(()=>{}))},[]),i.jsxs(zx,{children:[i.jsx(eG,{onPhaseChange:t}),e==="live"&&i.jsx(Mie,{}),i.jsx(j2,{})]})}function Oie(){return Le()?i.jsx(Die,{}):i.jsx(Iie,{})}function em(){const[e,t]=h.useState({status:"idle",percent:0});return h.useEffect(()=>{Rie(t)},[]),h.useEffect(()=>{},[]),i.jsxs(lM,{children:[i.jsx(Oie,{}),i.jsx(Tie,{state:e})]})}const Lie=new Set(["/api/auth/refresh","/api/logout","/api/force-logout"]);function Fie(e){try{return new URL(e,window.location.origin).pathname}catch{return e}}const su=window.fetch.bind(window);window.fetch=function(...e){const[t,n]=e;let r;if(typeof t=="string"?r=t:t instanceof URL?r=t.toString():r=t.url,!(r.startsWith("/api/")||r.includes("/api/")))return su(...e);const a=cl(r),o=Fie(a),l=Lie.has(o),c=nc("accessToken"),u=n?{...n}:{},f=new Headers(u.headers||{});if(c&&!l&&!f.has("Authorization")&&f.set("Authorization",`Bearer ${c}`),c&&!l&&Le())try{new URL(a,window.location.origin).origin!==window.location.origin&&(u.credentials="omit")}catch{}return u.headers=f,typeof t=="string"?su(a,u):t instanceof URL?su(new URL(a),u):su(new Request(a,t),u)};"caches"in window&&caches.keys().then(e=>{e.forEach(t=>caches.delete(t))});"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(t=>t.unregister())});typeof window<"u"&&!window.__vite_plugin_react_preamble_installed__&&(window.__vite_plugin_react_preamble_installed__=!0);function Vie(){if(!Le())return;const e=window.location.pathname||"/";(e==="/"||e==="/index.html"||e.endsWith("/index.html"))&&window.history.replaceState(null,"","/login")}function $ie(e){Le()&&(e.innerHTML="",e.removeAttribute("data-prerendered"),e.removeAttribute("style"),e.setAttribute("data-native-startup-cleared","true"))}function Hp(){Vie();const e=document.getElementById("root");if(!e){console.error("Main.tsx: Root element not found"),setTimeout(()=>{document.getElementById("root")?Hp():(console.error("Main.tsx: Root element still not found, redirecting to login"),window.location.href="/login")},100);return}try{if((e.hasAttribute("data-prerendered")||e.hasAttribute("data-ssr"))&&e.innerHTML.trim().length>0&&!Le())try{kk(e,i.jsx(em,{}))}catch(n){console.error("Main.tsx: React hydration failed, falling back to full render:",n),e.innerHTML="",tm(e).render(i.jsx(em,{}))}else{$ie(e);const n=tm(e);try{n.render(i.jsx(em,{}))}catch(r){console.error("Main.tsx: React render failed:",r),e.innerHTML='<div style="padding: 20px; background: red; color: white;">ERROR: Failed to render React app!</div>';return}}setTimeout(()=>{document.dispatchEvent(new Event("app-rendered"))},500),window.__APP_INITIALIZED__=!0,setTimeout(()=>{const n=Array.from(document.querySelectorAll("*")).filter(s=>{const a=window.getComputedStyle(s);return a.display==="none"||a.visibility==="hidden"||a.opacity==="0"});e.style.cssText="visibility: visible !important; opacity: 1 !important; display: block !important; position: relative !important; z-index: 1 !important; min-height: 100vh !important;",document.body.style.cssText="visibility: visible !important; opacity: 1 !important; display: block !important; margin: 0 !important;";const r=document.getElementById("loading-indicator");r&&r.remove(),e.children.length===0?(console.error("React rendered but root has no children!"),e.innerHTML='<div style="padding: 20px; background: red; color: white;">ERROR: React rendered but no content appeared!</div>'):Array.from(e.children).forEach(s=>{s.style&&(s.style.visibility="visible",s.style.opacity="1",s.style.display="block")})},1e3)}catch(t){console.error("Main.tsx: React initialization failed:",t),window.location.href="/login"}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Hp):Hp();const zie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{ys as $,ls as A,Z as B,Je as C,SD as D,rae as E,$n as F,u7 as G,Ad as H,d7 as I,f7 as J,dt as K,Ge as L,SS as M,sy as N,Lv as O,Nq as P,Hi as Q,za as R,$D as S,zD as T,HD as U,ms as V,Gi as W,$t as X,Pl as Y,ES as Z,ai as _,Ht as a,dr as a$,oi as a0,vs as a1,Kt as a2,zi as a3,cn as a4,Br as a5,Km as a6,oT as a7,st as a8,Tr as a9,kS as aA,og as aB,Dt as aC,Hr as aD,pf as aE,_l as aF,hj as aG,qt as aH,W as aI,wt as aJ,mi as aK,B_ as aL,OD as aM,xs as aN,Gm as aO,rG as aP,sG as aQ,oG as aR,lG as aS,iG as aT,cG as aU,ao as aV,zx as aW,Iu as aX,gS as aY,$r as aZ,ur as a_,hD as aa,Al as ab,Xe as ac,he as ad,ag as ae,Bn as af,oR as ag,PR as ah,qq as ai,po as aj,hy as ak,tS as al,hs as am,ND as an,bS as ao,my as ap,yy as aq,fn as ar,lg as as,py as at,Vn as au,un as av,dn as aw,kn as ax,Sn as ay,Ze as az,Yu as b,ko as b$,fr as b0,li as b1,fP as b2,Bl as b3,xu as b4,wS as b5,aa as b6,Gx as b7,Yx as b8,ff as b9,Ae as bA,se as bB,Ex as bC,vg as bD,zt as bE,a7 as bF,Kx as bG,m9 as bH,Zie as bI,Ov as bJ,X_ as bK,dW as bL,nM as bM,Le as bN,s9 as bO,i9 as bP,cE as bQ,UD as bR,hP as bS,s7 as bT,S_ as bU,N_ as bV,C_ as bW,T_ as bX,j_ as bY,__ as bZ,E_ as b_,ce as ba,CD as bb,Jp as bc,sk as bd,cg as be,LD as bf,kD as bg,io as bh,CS as bi,$l as bj,OU as bk,cz as bl,oS as bm,Z_ as bn,El as bo,dj as bp,gt as bq,ll as br,_r as b
574s,Or as bt,so as bu,YI as bv,HI as bw,Lt as bx,pe as by,jn as bz,Ku as c,Jie as c$,Vt as c0,Tu as c1,Nk as c2,J2 as c3,lI as c4,dI as c5,pI as c6,fI as c7,hI as c8,ln as c9,ID as cA,qie as cB,bm as cC,jQ as cD,ioe as cE,MK as cF,xS as cG,mP as cH,di as cI,lu as cJ,_w as cK,nae as cL,yD as cM,km as cN,aoe as cO,vD as cP,YC as cQ,va as cR,zk as cS,Eq as cT,TA as cU,EA as cV,gD as cW,Th as cX,Hx as cY,Js as cZ,y9 as c_,xI as ca,yv as cb,mI as cc,Ar as cd,iN as ce,$d as cf,oa as cg,sN as ch,So as ci,Sx as cj,Vl as ck,NS as cl,Wie as cm,WA as cn,Sq as co,lT as cp,h9 as cq,ug as cr,dc as cs,as as ct,$g as cu,Ug as cv,Lr as cw,ct as cx,vC as cy,jb as cz,rt as d,ws as d$,W8 as d0,uz as d1,Nn as d2,roe as d3,wP as d4,jp as d5,kP as d6,zQ as d7,noe as d8,soe as d9,Kae as dA,TS as dB,DD as dC,H5 as dD,Gae as dE,Yae as dF,Xie as dG,Jk as dH,Qae as dI,Ase as dJ,oae as dK,ol as dL,aae as dM,Re as dN,Hae as dO,Tn as dP,pn as dQ,Ke as dR,Wl as dS,Dr as dT,ea as dU,id as dV,SA as dW,pd as dX,xo as dY,md as dZ,xy as d_,toe as da,nT as db,Qu as dc,Qie as dd,Kie as de,gc as df,JC as dg,Gl as dh,gy as di,RD as dj,KC as dk,bae as dl,Rae as dm,xq as dn,BI as dp,Ag as dq,Pg as dr,qd as ds,Ui as dt,wD as du,ED as dv,Rg as dw,$u as dx,bD as dy,qae as dz,Mr as e,$ae as e$,ta as e0,Xn as e1,De as e2,yl as e3,cd as e4,ae as e5,dd as e6,fd as e7,gp as e8,xp as e9,dq as eA,Hl as eB,Sae as eC,Dae as eD,_ae as eE,dp as eF,Os as eG,cae as eH,Nae as eI,yw as eJ,sd as eK,vw as eL,go as eM,lae as eN,Aae as eO,Pae as eP,fp as eQ,Tae as eR,uae as eS,Iae as eT,yae as eU,pae as eV,Lae as eW,xw as eX,Uae as eY,zae as eZ,Oae as e_,hd as ea,ui as eb,od as ec,na as ed,Ji as ee,Tt as ef,ds as eg,be as eh,vf as ei,ql as ej,gd as ek,ud as el,yo as em,Er as en,hp as eo,bs as ep,ad as eq,ld as er,Ua as es,mp as et,ve as eu,gae as ev,dae as ew,Bae as ex,gq as ey,fae as ez,ot as f,Vae as f0,Fae as f1,Mae as f2,sae as f3,Cae as f4,Eae as f5,iae as f6,wae as f7,hae as f8,jae as f9,vc as fA,ma as fB,pa as fC,bc as fD,Q1 as fE,Ese as fF,AQ as fG,Zae as fH,Xc as fI,Xae as fJ,bP as fK,jse as fL,XA as fM,lH as fN,dH as fO,tae as fP,mae as fa,kae as fb,xae as fc,nt as fd,vae as fe,cr as ff,sH as fg,Vv as fh,aH as fi,Vr as fj,Nx as fk,nn as fl,fU as fm,jx as fn,eae as fo,Jae as fp,eoe as fq,oH as fr,cH as fs,iH as ft,qA as fu,uH as fv,Ry as fw,wd as fx,lQ as fy,cQ as fz,rc as g,Fs as h,yS as i,i as j,Qn as k,At as l,pD as m,it as n,pS as o,Wae as p,Bq as q,Hq as r,Wq as s,fH as t,iy as u,BD as v,ia as w,vS as x,ue as y,mD as z};

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.