PageSourceSearch

https://www.homeboost.com/assets/index-A3eEUkhh.js

js homeboost.com collected 2026-10-01 11:35:39 UTC 616,385 bytes, 66 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Index-DUgWI3WF.js","assets/index.esm-BBsvENNw.js","assets/button-DstMwZvi.js","assets/utils-C8Vw9WGG.js","assets/arrow-left-Du97bjyC.js","assets/createLucideIcon-DGKgIs5Z.js","assets/building-2-B5L7lYuV.js","assets/trending-down-C4Z4GRF2.js","assets/app-report-BSX5NXPQ.js","assets/react-dom-CJjqsjXY.js","assets/thermal-scan-D27_XBen.js","assets/useBlogPosts-Di8GPDRK.js","assets/ForHomeowners-CyXNI8Xx.js","assets/assessment-vs-traditional-T5BJKZjY.js","assets/FAQSchema-WJSak_sT.js","assets/VimeoEmbed-kY2KbObr.js","assets/ForPros-BBN5L0l4.js","assets/clipboard-check-DWKkk5Ni.js","assets/map-pin-Ba-oMQd8.js","assets/ProInvite-3Fw5GHW7.js","assets/ForCoops-D7adL3ZE.js","assets/heart-BjeD6J2J.js","assets/send-DWx1qQyW.js","assets/trophy-TVy31w9C.js","assets/HowItWorks-D79-7ZuF.js","assets/About-B9XGuLt-.js","assets/PrivacyPolicy-k4AkAJLy.js","assets/TermsOfService-a8nhEz0e.js","assets/RefundPolicy-Cu6DJ9Ym.js","assets/Contact-B1OCdAZj.js","assets/mail-BR_B1a8_.js","assets/CaseStudyCentralHudson-SLwHTiet.js","assets/Blog-CBSTTD1t.js","assets/BlogPostCard-DjYd4UGT.js","assets/badge-CEhrvJNz.js","assets/blogUtils-Dt42nJBK.js","assets/blogContent-RFlS-NA_.js","assets/BlogPost-PLOaupB2.js","assets/BlogCategory-DuLVAwfO.js","assets/News-QcTPaWWV.js","assets/useQuery-BN21v1xM.js","assets/NewsArticle-B4KgIkBY.js","assets/DiscoverLeaks-DaCx9oIA.js","assets/dist-DOD413F0.js","assets/smartphone-DGxyMIU9.js","assets/Download-DgybBS1V.js","assets/camera-D91J-sal.js","assets/Organization-DgiNTxyQ.js","assets/lightbulb-DirYvPl9.js","assets/KeepInTouch-BcsMjifG.js","assets/ContestPage-B4keF6ou.js","assets/SweepstakesRules-BnAE3VXo.js","assets/ContactBGEContractor-7Ly_0hN0.js","assets/circle-help-sWDofcUm.js","assets/LibraryProgram-BqP7mC85.js","assets/CancellationPolicy-CKBRSasl.js","assets/Security-q7yajwxg.js","assets/award-NswFFOP7.js","assets/SecurityWallOfFame-CCBTLLG8.js","assets/HomeEnergyAuditSavings-_MTn4eD7.js","assets/NotFound-26eI0Fcu.js"])))=>i.map(i=>d[i]);
2import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./index.esm-BBsvENNw.js";import{t as l}from"./react-dom-CJjqsjXY.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as _,t as v}from"./dist-DOD413F0.js";import{i as y,n as b,r as x,t as S}from"./button-DstMwZvi.js";import{n as C,t as w}from"./utils-C8Vw9WGG.js";import{t as T}from"./createLucideIcon-DGKgIs5Z.js";import{i as ee,n as te,r as E,t as D}from"./tslib.es6-CUa3Lc-A.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var O=e((e=>{var t=l();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),k=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(){}},A={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ne=new class{#e=A;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function re(e){setTimeout(e,0)}var ie=typeof window>`u`||`Deno`in globalThis;function j(){}function ae(e,t){return typeof e==`function`?e(t):e}function oe(e){return typeof e==`number`&&e>=0&&e!==1/0}function se(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ce(e,t){return typeof e==`function`?e(t):e}function le(e,t){return typeof e==`function`?e(t):e}function ue(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==fe(o,t.options))return!1}else if(!me(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function de(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(pe(t.options.mutationKey)!==pe(a))return!1}else if(!me(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function fe(e,t){return(t?.queryKeyHashFn||pe)(e)}function pe(e){return JSON.stringify(e,(e,t)=>ye(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function me(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>me(e[n],t[n])):!1}var he=Object.prototype.hasOwnProperty;function ge(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ve(e)&&ve(t);if(!r&&!(ye(e)&&ye(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:he.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ge(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function _e(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ve(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ye(e){if(!be(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!be(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function be(e){return Object.prototype.toString.call(e)===`[object Object]`}function xe(e){return new Promise(t=>{ne.setTimeout(t,e)})}function Se(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ge(e,t)}function Ce(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function we(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Te=Symbol();function Ee(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Te?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function De(e,t){return typeof e==`function`?e(...t):!!e}function Oe(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ke=new class extends k{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ie&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();
2this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function Ae(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var je=re;function Me(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=je,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Ne=Me(),Pe=new class extends k{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ie&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Fe(e){return Math.min(1e3*2**e,3e4)}function Ie(e){return(e??`online`)===`online`?Pe.isOnline():!0}var Le=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Re(e){let t=!1,n=0,r,i=Ae(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Le(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ke.isFocused()&&(e.networkMode===`always`||Pe.isOnline())&&e.canRun(),u=()=>Ie(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ie?0:3),o=e.retryDelay??Fe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),xe(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var ze=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oe(this.gcTime)&&(this.#e=ne.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ie?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(ne.clearTimeout(this.#e),void 0)}},Be=class extends ze{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Ue(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ue(this.options);e.data!==void 0&&(this.setState(He(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=Se(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(j).catch(j):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>le(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Te||this.state.dataUpdateCount+this.state.errorUpdate
2Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ce(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!se(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=Ee(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Re({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Le&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Le){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ve(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...He(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),Ne.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Ve(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ie(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function He(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ue(e){let 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
2Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function We(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Oe(e,()=>t.signal,()=>n=!0)},u=Ee(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?we:Ce;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ke:Ge,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ge(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ge(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ke(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var qe=class extends ze{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Je(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Re({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPau
2sed:!1,status:`error`}}})(this.state),Ne.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Je(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ye=class extends k{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new qe({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Xe(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Xe(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Xe(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Xe(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>
vendor: 5,627 bytes, line 2
2t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Ne.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>de(t,e))}findAll(e={}){return this.getAll().filter(t=>de(e,t))}notify(e){Ne.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Ne.batch(()=>Promise.all(e.map(e=>e.continue().catch(j))))}};function Xe(e){return e.options.scope?.id}var Ze=class extends k{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??fe(r,t),a=this.get(i);return a||(a=new Be({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Ne.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ue(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ue(e,t)):t}notify(e){Ne.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ne.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ne.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ze,this.#t=e.mutationCache||new Ye,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ke.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Pe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ce(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ae(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ne.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Ne.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Ne.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Ne.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(j).catch(j)}invalidateQueries(e,t={}){return Ne.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ne.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(j)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(j)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ce(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(j).catch(j)}fetchInfiniteQuery(e){return e.behavior=We(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(j).catch(j)}ensureInfiniteQueryData(e){return e.behavior=We(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pe.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(pe(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{me(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(pe(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{me(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=fe(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===Te&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}}
2,M=r(n(),1),N=o(),$e=M.createContext(void 0),et=e=>{let t=M.useContext($e);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},tt=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,N.jsx)($e.Provider,{value:e,children:t})),nt=O(),rt=r(l());function it(){return it=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},it.apply(this,arguments)}var at;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(at||={});var ot=`popstate`;function st(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return ft(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:pt(t)}return ht(t,n,null,e)}function ct(e,t){if(e===!1||e==null)throw Error(t)}function lt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ut(){return Math.random().toString(36).substr(2,8)}function dt(e,t){return{usr:e.state,key:e.key,idx:t}}function ft(e,t,n,r){return n===void 0&&(n=null),it({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?mt(t):t,{state:n,key:t&&t.key||r||ut()})}function pt(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function mt(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ht(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=at.Pop,c=null,l=u();l??(l=0,o.replaceState(it({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=at.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=at.Push;let r=ft(h.location,e,t);n&&n(r,e),l=u()+1;let d=dt(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=at.Replace;let r=ft(h.location,e,t);n&&n(r,e),l=u();let i=dt(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:pt(e);return n=n.replace(/ $/,`%20`),ct(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ot,d),c=e,()=>{i.removeEventListener(ot,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var gt;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(gt||={});function _t(e,t,n){return n===void 0&&(n=`/`),vt(e,t,n,!1)}function vt(e,t,n,r){let i=Ft((typeof t==`string`?mt(t):t).pathname||`/`,n);if(i==null)return null;let a=yt(e);xt(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=Pt(i);o=jt(a[e],t,r)}return o}function yt(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(ct(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Wt([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(ct(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),yt(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:kt(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of bt(e.path))i(e,t,n)}),t}function bt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=bt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function xt(e){e.sort((e,t)=>
vendor: 4,123 bytes, line 2
2e.score===t.score?At(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var St=/^:[\w-]+$/,Ct=3,wt=2,Tt=1,Et=10,Dt=-2,Ot=e=>e===`*`;function kt(e,t){let n=e.split(`/`),r=n.length;return n.some(Ot)&&(r+=Dt),t&&(r+=wt),n.filter(e=>!Ot(e)).reduce((e,t)=>e+(St.test(t)?Ct:t===``?Tt:Et),r)}function At(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function jt(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=Mt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Mt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Wt([a,u.pathname]),pathnameBase:Gt(Wt([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Wt([a,u.pathnameBase]))}return o}function Mt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Nt(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Nt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),lt(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Pt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return lt(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function Ft(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var It=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lt=e=>It.test(e);function Rt(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?mt(e):e,a;if(n)if(Lt(n))a=n;else{if(n.includes(`//`)){let e=n;n=n.replace(/\/\/+/g,`/`),lt(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?zt(n.substring(1),`/`):zt(n,t)}else a=t;return{pathname:a,search:Kt(r),hash:qt(i)}}function zt(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Bt(e,t,n,r){return`Cannot include a '`+e+`' character in a manually specified `+("`to."+t+"` field ["+JSON.stringify(r)+`].  Please separate it out to the `)+("`to."+n+"` field. Alternatively you may provide the full path as ")+`a string in <Link to="..."> and the router will parse it for you.`}function Vt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ht(e,t){let n=Vt(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Ut(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=mt(e):(i=it({},e),ct(!i.pathname||!i.pathname.includes(`?`),Bt(`?`,`pathname`,`search`,i)),ct(!i.pathname||!i.pathname.includes(`#`),Bt(`#`,`pathname`,`hash`,i)),ct(!i.search||!i.search.includes(`#`),Bt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;
2if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Rt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Wt=e=>e.join(`/`).replace(/\/\/+/g,`/`),Gt=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Kt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,qt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function Jt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yt.apply(this,arguments)}var Xt=M.createContext(null),Zt=M.createContext(null),Qt=M.createContext(null),$t=M.createContext(null),en=M.createContext({outlet:null,matches:[],isDataRoute:!1}),tn=M.createContext(null);function nn(e,t){let{relative:n}=t===void 0?{}:t;!rn()&&ct(!1);let{basename:r,navigator:i}=M.useContext(Qt),{hash:a,pathname:o,search:s}=un(e,{relative:n}),c=o;return r!==`/`&&(c=o===`/`?r:Wt([r,o])),i.createHref({pathname:c,search:s,hash:a})}function rn(){return M.useContext($t)!=null}function an(){return!rn()&&ct(!1),M.useContext($t).location}function on(e){M.useContext(Qt).static||M.useLayoutEffect(e)}function sn(){let{isDataRoute:e}=M.useContext(en);return e?Tn():cn()}function cn(){!rn()&&ct(!1);let e=M.useContext(Xt),{basename:t,future:n,navigator:r}=M.useContext(Qt),{matches:i}=M.useContext(en),{pathname:a}=an(),o=JSON.stringify(Ht(i,n.v7_relativeSplatPath)),s=M.useRef(!1);return on(()=>{s.current=!0}),M.useCallback(function(n,i){if(i===void 0&&(i={}),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Ut(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Wt([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}function ln(){let{matches:e}=M.useContext(en),t=e[e.length-1];return t?t.params:{}}function un(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=M.useContext(Qt),{matches:i}=M.useContext(en),{pathname:a}=an(),o=JSON.stringify(Ht(i,r.v7_relativeSplatPath));return M.useMemo(()=>Ut(e,JSON.parse(o),a,n===`path`),[e,o,a,n])}function dn(e,t){return fn(e,t)}function fn(e,t,n,r){!rn()&&ct(!1);let{navigator:i}=M.useContext(Qt),{matches:a}=M.useContext(en),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=an(),u;if(t){let e=typeof t==`string`?mt(t):t;!(c===`/`||e.pathname?.startsWith(c))&&ct(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=_t(e,{pathname:f}),m=_n(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Wt([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Wt([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?M.createElement($t.Provider,{value:{location:Yt({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:at.Pop}},m):m}function pn(){let e=wn(),t=Jt(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return M.createElement(M.Fragment,null,M.createElement(`h2`,null,`Unexpected Application Error!`),M.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?M.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var mn=M.createElement(pn,null),hn=class extends M.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:M.createElement(en.Provider,{value:this.props.routeContext},M.createElement(tn.Provider,{value:this.state.error,children:this.props.component}))}};
2function gn(e){let{routeContext:t,match:n,children:r}=e,i=M.useContext(Xt);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),M.createElement(en.Provider,{value:t},r)}function _n(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);!(e>=0)&&ct(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||mn,s&&(c<0&&i===0?(Dn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?M.createElement(r.route.Component,null):r.route.element?r.route.element:e,M.createElement(gn,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?M.createElement(hn,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var vn=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(vn||{}),yn=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(yn||{});function bn(e){let t=M.useContext(Xt);return!t&&ct(!1),t}function xn(e){let t=M.useContext(Zt);return!t&&ct(!1),t}function Sn(e){let t=M.useContext(en);return!t&&ct(!1),t}function Cn(e){let t=Sn(e),n=t.matches[t.matches.length-1];return!n.route.id&&ct(!1),n.route.id}function wn(){let e=M.useContext(tn),t=xn(yn.UseRouteError),n=Cn(yn.UseRouteError);return e===void 0?t.errors?.[n]:e}function Tn(){let{router:e}=bn(vn.UseNavigateStable),t=Cn(yn.UseNavigateStable),n=M.useRef(!1);return on(()=>{n.current=!0}),M.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,Yt({fromRouteId:t},i)))},[e,t])}var En={};function Dn(e,t,n){!t&&!En[e]&&(En[e]=!0)}var On=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function kn(e,t){e?.v7_startTransition===void 0&&On(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&On(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&On(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&On(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&On(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&On(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}M.startTransition;function An(e){let{to:t,replace:n,state:r,relative:i}=e;!rn()&&ct(!1);let{future:a,static:o}=M.useContext(Qt),{matches:s}=M.useContext(en),{pathname:c}=an(),l=sn(),u=Ut(t,Ht(s,a.v7_relativeSplatPath),c,i===`path`),d=JSON.stringify(u);return M.useEffect(()=>l(JSON.parse(d),{replace:n,state:r,relative:i}),[l,d,i,n,r]),null}function P(e){ct(!1)}function jn(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=at.Pop,navigator:a,static:o=!1,future:s}=e;rn()&&ct(!1);let c=t.replace(/^\/*/,`/`),l=M.useMemo(()=>({basename:c,navigator:a,static:o,future:Yt({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=mt(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=M.useMemo(()=>{let e=Ft(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:M.createElement(Qt.Provider,{value:l},M.createElement($t.Provider,{children:n,value:h}))}function Mn(e){let{children:t,location:n}=e;return dn(Nn(t),n)}new Promise(()=>{});function Nn(e,t){t===void 0&&(t=[]);let n=[];
2return M.Children.forEach(e,(e,r)=>{if(!M.isValidElement(e))return;let i=[...t,r];if(e.type===M.Fragment){n.push.apply(n,Nn(e.props.children,i));return}e.type!==P&&ct(!1),!(!e.props.index||!e.props.children)&&ct(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Nn(e.props.children,i)),n.push(a)}),n}function Pn(){return Pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(this,arguments)}function Fn(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function In(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ln(e,t){return e.button===0&&(!t||t===`_self`)&&!In(e)}var Rn=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`viewTransition`],zn=`6`;try{window.__reactRouterVersion=zn}catch{}var Bn=M.startTransition;rt.flushSync,M.useId;function Vn(e){let{basename:t,children:n,future:r,window:i}=e,a=M.useRef();a.current??=st({window:i,v5Compat:!0});let o=a.current,[s,c]=M.useState({action:o.action,location:o.location}),{v7_startTransition:l}=r||{},u=M.useCallback(e=>{l&&Bn?Bn(()=>c(e)):c(e)},[c,l]);return M.useLayoutEffect(()=>o.listen(u),[o,u]),M.useEffect(()=>kn(r),[r]),M.createElement(jn,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var Hn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Un=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,F=M.forwardRef(function(e,t){let{onClick:n,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,viewTransition:u}=e,d=Fn(e,Rn),{basename:f}=M.useContext(Qt),p,m=!1;if(typeof c==`string`&&Un.test(c)&&(p=c,Hn))try{let e=new URL(window.location.href),t=c.startsWith(`//`)?new URL(e.protocol+c):new URL(c),n=Ft(t.pathname,f);t.origin===e.origin&&n!=null?c=n+t.search+t.hash:m=!0}catch{}let h=nn(c,{relative:r}),g=Kn(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,viewTransition:u});function _(e){n&&n(e),e.defaultPrevented||g(e)}return M.createElement(`a`,Pn({},d,{href:p||h,onClick:m||i?n:_,ref:t,target:s}))}),Wn;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(Wn||={});var Gn;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(Gn||={});function Kn(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,c=sn(),l=an(),u=un(e,{relative:o});return M.useCallback(t=>{Ln(t,n)&&(t.preventDefault(),c(e,{replace:r===void 0?pt(l)===pt(u):r,state:i,preventScrollReset:a,relative:o,viewTransition:s}))},[l,c,u,r,i,n,e,a,o,s])}var qn=[`light`,`dark`],Jn=`(prefers-color-scheme: dark)`,Yn=M.createContext(void 0),Xn={setTheme:e=>{},themes:[]},Zn=()=>M.useContext(Yn)??Xn;M.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,attrs:s,nonce:c})=>{let l=a===`system`,u=n===`class`?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(e=>`'${e}'`).join(`,`)})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?qn.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:`if(e==='light'||e==='dark')d.style.colorScheme=e`:``,f=(e,t=!1,r=!0)=>{let a=o?o[e]:e,s=t?e+`|| ''`:`'${a}'`,c=``;return i&&r&&!t&&qn.includes(e)&&(c+=`d.style.colorScheme = '${e}';`),n===`class`?t||a?c+=`c.add(${s})`:c+=`null`:a&&(c+=`d[s](n,${s})`),c},p=e?`!function(){${u}${f(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${Jn}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f(`dark`)}}else{${f(`light`)}}}else if(e){${o?`var x=${JSON.stringify(o)};`:``}${f(o?`x[e]`:`e`,!0)}}${l?``:`else{`+f(a,!1,!1)+`}`}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:``}${f(o?`x[e]`:`e`,!0)}}else{${f(a,!1,!1)};}${d}}catch(t){}}();`;return M.createElement(`script`,{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var Qn=e=>{switch(e){case`success`:return tr;case`info`:return rr;case`warning`:return nr;case`error`:return ir;default:return null}},$n=Array(12).fill(0),er=({visible:e,className:t})=>M.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(
2Boolean).join(` `),"data-visible":e},M.createElement(`div`,{className:`sonner-spinner`},$n.map((e,t)=>M.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),tr=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},M.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),nr=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},M.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),rr=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},M.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ir=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},M.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ar=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},M.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),M.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),or=()=>{let[e,t]=M.useState(document.hidden);return M.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},sr=1,cr=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:sr++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>
2this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=e instanceof Promise?e:e(),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],M.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ur(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:n,type:`error`,message:r,description:a})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`success`,message:r,description:a})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`error`,message:r,description:a})}}).finally(()=>{var e;i&&(this.dismiss(n),n=void 0),(e=t.finally)==null||e.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||sr++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},lr=(e,t)=>{let n=t?.id||sr++;return cr.addToast({title:e,...t,id:n}),n},ur=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,dr=lr,fr=Object.assign(dr,{success:cr.success,info:cr.info,warning:cr.warning,error:cr.error,custom:cr.custom,message:cr.message,promise:cr.promise,dismiss:cr.dismiss,loading:cr.loading},{getHistory:()=>cr.toasts,getToasts:()=>cr.getActiveToasts()});function pr(e,{insertAt:t}={}){if(!e||typeof document>`u`)return;let n=document.head||document.getElementsByTagName(`head`)[0],r=document.createElement(`style`);r.type=`text/css`,t===`top`&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}pr(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
2left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
2:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
2--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
3`);function mr(e){return e.label!==void 0}var hr=3,gr=`32px`,_r=`16px`,vr=4e3,yr=356,br=14,xr=20,Sr=200;function Cr(...e){return e.filter(Boolean).join(` `)}function wr(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Tr=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,loadingIcon:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:ee=`Close toast`,pauseWhenPageIsHidden:te}
3=e,[E,D]=M.useState(null),[O,k]=M.useState(null),[A,ne]=M.useState(!1),[re,ie]=M.useState(!1),[j,ae]=M.useState(!1),[oe,se]=M.useState(!1),[ce,le]=M.useState(!1),[ue,de]=M.useState(0),[fe,pe]=M.useState(0),me=M.useRef(n.duration||y||vr),he=M.useRef(null),ge=M.useRef(null),_e=c===0,ve=c+1<=o,ye=n.type,be=n.dismissible!==!1,xe=n.className||``,Se=n.descriptionClassName||``,Ce=M.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),we=M.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Te=M.useMemo(()=>n.duration||y||vr,[n.duration,y]),Ee=M.useRef(0),De=M.useRef(0),Oe=M.useRef(0),ke=M.useRef(null),[Ae,je]=b.split(`-`),Me=M.useMemo(()=>s.reduce((e,t,n)=>n>=Ce?e:e+t.height,0),[s,Ce]),Ne=or(),Pe=n.invert||t,Fe=ye===`loading`;De.current=M.useMemo(()=>Ce*x+Me,[Ce,Me]),M.useEffect(()=>{me.current=Te},[Te]),M.useEffect(()=>{ne(!0)},[]),M.useEffect(()=>{let e=ge.current;if(e){let t=e.getBoundingClientRect().height;return pe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),M.useLayoutEffect(()=>{if(!A)return;let e=ge.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,pe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id]);let Ie=M.useCallback(()=>{ie(!0),de(De.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Sr)},[n,d,a,De]);M.useEffect(()=>{if(n.promise&&ye===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||te&&Ne?(()=>{if(Oe.current<Ee.current){let e=new Date().getTime()-Ee.current;me.current-=e}Oe.current=new Date().getTime()})():me.current!==1/0&&(Ee.current=new Date().getTime(),e=setTimeout(()=>{var e;(e=n.onAutoClose)==null||e.call(n,n),Ie()},me.current)),()=>clearTimeout(e)},[u,i,n,ye,te,Ne,Ie]),M.useEffect(()=>{n.delete&&Ie()},[Ie,n.delete]);function Le(){return T!=null&&T.loading?M.createElement(`div`,{className:Cr(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ye===`loading`},T.loading):S?M.createElement(`div`,{className:Cr(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ye===`loading`},S):M.createElement(er,{className:Cr(w?.loader,n?.classNames?.loader),visible:ye===`loading`})}return M.createElement(`li`,{tabIndex:0,ref:ge,className:Cr(_,xe,w?.toast,n?.classNames?.toast,w?.default,w?.[ye],n?.classNames?.[ye]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ce,"data-removed":re,"data-visible":ve,"data-y-position":Ae,"data-x-position":je,"data-index":c,"data-front":_e,"data-swiping":j,"data-dismissible":be,"data-type":ye,"data-invert":Pe,"data-swipe-out":oe,"data-swipe-direction":O,"data-expanded":!!(u||C&&A),style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${re?ue:De.current}px`,"--initial-height":C?`auto`:`${fe}px`,...m,...n.style},onDragEnd:()=>{ae(!1),D(null),ke.current=null},onPointerDown:e=>{Fe||!be||(he.current=new Date,de(De.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ae(!0),ke.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e;if(oe||!be)return;ke.current=null;let t=Number(ge.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),r=Number(ge.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),i=new Date().getTime()-he.current?.getTime(),a=E===`x`?t:r,o=Math.abs(a)/i;if(Math.abs(a)>=xr||o>.11){de(De.current),(e=n.onDismiss)==null||e.call(n,n),k(E===`x`?t>0?`right`:`left`:r>0?`down`:`up`),Ie(),se(!0),le(!1);return}ae(!1),D(null)},onPointerMove:t=>{var n,r;if(!ke.current||!be||window.getSelection()?.toString().length>0)return;let i=t.clientY-ke.current.y,a=t.clientX-ke.current.x,o=e.swipeDirections??wr(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0};E===`y`?(o.includes(`top`)||o.includes(`bottom`))&&(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)&&(s.y=i):E===`x`&&(o.includes(`left`)||o.includes(`right`))&&(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)&&(s.x=a),(Math.abs(s.x)>0||Math.abs(s.y)>0)&&le(!0),(n=ge.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ge.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},we&&!n.jsx?M.createElement(`button`,{"aria-label":ee,"data-disabled":Fe,"data-close-button":!0,onClick:Fe||!be?()=>{}:()=>{var e;Ie(),(e=n.onDismiss)==null||e.call(n,n)},className:Cr(w?.closeButton,n?.classNames?.closeButton)},T?.close??ar):null,n.jsx||(0,M.isValidElement)(n.title)?n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title:M.createElement(M.Fragment,null,ye||n.icon||n.promise?M.createElement(`div`,{"data-icon":``,className:Cr(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Le():null,n.type===`loading`?null:n.icon||T?.[ye]||Qn(ye)):null,M.createElement(`div`,{"data-content":``,className:Cr(w?.content,n?.classNames?.content)},M.createElement(`div`,{"data-title":``,className:Cr(w?.title,n?.classNames?.title)},typeof n.title==`function`?n.title():n.title),n.description?M.createElement(`div`,{"data-description":``,className:Cr(v,Se,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),(0,M.isValidElement)(n.
3cancel)?n.cancel:n.cancel&&mr(n.cancel)?M.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{var t,r;mr(n.cancel)&&be&&((r=(t=n.cancel).onClick)==null||r.call(t,e),Ie())},className:Cr(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,(0,M.isValidElement)(n.action)?n.action:n.action&&mr(n.action)?M.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{var t,r;mr(n.action)&&((r=(t=n.action).onClick)==null||r.call(t,e),!e.defaultPrevented&&Ie())},className:Cr(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null))};function Er(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Dr(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?_r:gr;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Or=(0,M.forwardRef)(function(e,t){let{invert:n,position:r=`bottom-right`,hotkey:i=[`altKey`,`KeyT`],expand:a,closeButton:o,className:s,offset:c,mobileOffset:l,theme:u=`light`,richColors:d,duration:f,style:p,visibleToasts:m=hr,toastOptions:h,dir:g=Er(),gap:_=br,loadingIcon:v,icons:y,containerAriaLabel:b=`Notifications`,pauseWhenPageIsHidden:x}=e,[S,C]=M.useState([]),w=M.useMemo(()=>Array.from(new Set([r].concat(S.filter(e=>e.position).map(e=>e.position)))),[S,r]),[T,ee]=M.useState([]),[te,E]=M.useState(!1),[D,O]=M.useState(!1),[k,A]=M.useState(u===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:u),ne=M.useRef(null),re=i.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ie=M.useRef(null),j=M.useRef(!1),ae=M.useCallback(e=>{C(t=>{var n;return(n=t.find(t=>t.id===e.id))!=null&&n.delete||cr.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return M.useEffect(()=>cr.subscribe(e=>{if(e.dismiss){C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t));return}setTimeout(()=>{rt.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),M.useEffect(()=>{if(u!==`system`){A(u);return}if(u===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?A(`dark`):A(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{A(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{A(e?`dark`:`light`)}catch(e){console.error(e)}})}},[u]),M.useEffect(()=>{S.length<=1&&E(!1)},[S]),M.useEffect(()=>{let e=e=>{var t,n;i.every(t=>e[t]||e.code===t)&&(E(!0),(t=ne.current)==null||t.focus()),e.code===`Escape`&&(document.activeElement===ne.current||(n=ne.current)!=null&&n.contains(document.activeElement))&&E(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]),M.useEffect(()=>{if(ne.current)return()=>{ie.current&&(ie.current.focus({preventScroll:!0}),ie.current=null,j.current=!1)}},[ne.current]),M.createElement(`section`,{ref:t,"aria-label":`${b} ${re}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,r)=>{let[i,u]=t.split(`-`);return S.length?M.createElement(`ol`,{key:t,dir:g===`auto`?Er():g,tabIndex:-1,ref:ne,className:s,"data-sonner-toaster":!0,"data-theme":k,"data-y-position":i,"data-lifted":te&&S.length>1&&!a,"data-x-position":u,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${yr}px`,"--gap":`${_}px`,...p,...Dr(c,l)},onBlur:e=>{j.current&&!e.currentTarget.contains(e.relatedTarget)&&(j.current=!1,ie.current&&=(ie.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`fal
3se`||j.current||(j.current=!0,ie.current=e.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{D||E(!1)},onDragEnd:()=>E(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||O(!0)},onPointerUp:()=>O(!1)},S.filter(e=>!e.position&&r===0||e.position===t).map((r,i)=>M.createElement(Tr,{key:r.id,icons:y,index:i,toast:r,defaultRichColors:d,duration:h?.duration??f,className:h?.className,descriptionClassName:h?.descriptionClassName,invert:n,visibleToasts:m,closeButton:h?.closeButton??o,interacting:D,position:t,style:h?.style,unstyled:h?.unstyled,classNames:h?.classNames,cancelButtonStyle:h?.cancelButtonStyle,actionButtonStyle:h?.actionButtonStyle,removeToast:ae,toasts:S.filter(e=>e.position==r.position),heights:T.filter(e=>e.position==r.position),setHeights:ee,expandByDefault:a,gap:_,loadingIcon:v,expanded:te,pauseWhenPageIsHidden:x,swipeDirections:e.swipeDirections}))):null}))}),kr=({...e})=>{let{theme:t=`system`}=Zn();return(0,N.jsx)(Or,{theme:t,className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`}},...e})},Ar=1,jr=1e6,Mr=0;function Nr(){return Mr=(Mr+1)%(2**53-1),Mr.toString()}var Pr=new Map,Fr=e=>{if(Pr.has(e))return;let t=setTimeout(()=>{Pr.delete(e),zr({type:`REMOVE_TOAST`,toastId:e})},jr);Pr.set(e,t)},Ir=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,Ar)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?Fr(n):e.toasts.forEach(e=>{Fr(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},Lr=[],Rr={toasts:[]};function zr(e){Rr=Ir(Rr,e),Lr.forEach(e=>{e(Rr)})}function Br({...e}){let t=Nr(),n=e=>zr({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>zr({type:`DISMISS_TOAST`,toastId:t});return zr({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function Vr(){let[e,t]=M.useState(Rr);return M.useEffect(()=>(Lr.push(t),()=>{let e=Lr.indexOf(t);e>-1&&Lr.splice(e,1)}),[e]),{...e,toast:Br,dismiss:e=>zr({type:`DISMISS_TOAST`,toastId:e})}}function Hr(e){let t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...e)=>t.current?.(...e),[])}function Ur(e,t=globalThis?.document){let n=Hr(e);M.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Wr=`DismissableLayer`,Gr=`dismissableLayer.update`,Kr=`dismissableLayer.pointerDownOutside`,qr=`dismissableLayer.focusOutside`,Jr,Yr=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xr=M.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=M.useContext(Yr),[d,f]=M.useState(null),m=d?.ownerDocument??globalThis?.document,[,h]=M.useState({}),g=y(t,e=>f(e)),_=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=_.indexOf(v),x=d?_.indexOf(d):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=$r(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!C||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},m),T=ei(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},m);return Ur(e=>{x===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},m),M.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Jr=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),ti(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Jr)}},[d,m,n,l]),M.useEffect(()=>()=>
vendor: 4,337 bytes, line 3
3{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),ti())},[d,l]),M.useEffect(()=>{let e=()=>h({});return document.addEventListener(Gr,e),()=>document.removeEventListener(Gr,e)},[]),(0,N.jsx)(u.div,{...c,ref:g,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:p(e.onFocusCapture,T.onFocusCapture),onBlurCapture:p(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:p(e.onPointerDownCapture,w.onPointerDownCapture)})});Xr.displayName=Wr;var Zr=`DismissableLayerBranch`,Qr=M.forwardRef((e,t)=>{let n=M.useContext(Yr),r=M.useRef(null),i=y(t,r);return M.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,N.jsx)(u.div,{...e,ref:i})});Qr.displayName=Zr;function $r(e,t=globalThis?.document){let n=Hr(e),r=M.useRef(!1),i=M.useRef(()=>{});return M.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ni(Kr,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ei(e,t=globalThis?.document){let n=Hr(e),r=M.useRef(!1);return M.useEffect(()=>{let e=e=>{e.target&&!r.current&&ni(qr,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ti(){let e=new CustomEvent(Gr);document.dispatchEvent(e)}function ni(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?h(i,a):i.dispatchEvent(a)}var ri=Xr,ii=Qr,ai=`Portal`,oi=M.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=M.useState(!1);f(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?rt.createPortal((0,N.jsx)(u.div,{...r,ref:t}),o):null});oi.displayName=ai;function si(e,t){return M.useReducer((e,n)=>t[e][n]??e,e)}var ci=e=>{let{present:t,children:n}=e,r=li(t),i=typeof n==`function`?n({present:r.isPresent}):M.Children.only(n),a=y(r.ref,di(i));return typeof n==`function`||r.isPresent?M.cloneElement(i,{ref:a}):null};ci.displayName=`Presence`;function li(e){let[t,n]=M.useState(),r=M.useRef(null),i=M.useRef(e),a=M.useRef(`none`),[o,s]=si(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return M.useEffect(()=>{let e=ui(r.current);a.current=o===`mounted`?e:`none`},[o]),f(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=ui(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),f(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=ui(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=ui(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:M.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function ui(e){return e?.animationName||`none`}function di(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fi=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`}),pi=`VisuallyHidden`,mi=M.forwardRef((e,t)=>
vendor: 12,797 bytes, line 3
3(0,N.jsx)(u.span,{...e,ref:t,style:{...fi,...e.style}}));mi.displayName=pi;var hi=mi,gi=`ToastProvider`,[_i,vi,yi]=_(`Toast`),[bi,xi]=d(`Toast`,[yi]),[Si,Ci]=bi(gi),wi=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=M.useState(null),[l,u]=M.useState(0),d=M.useRef(!1),f=M.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${gi}\`. Expected non-empty \`string\`.`),(0,N.jsx)(_i.Provider,{scope:t,children:(0,N.jsx)(Si,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:M.useCallback(()=>u(e=>e+1),[]),onToastRemove:M.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};wi.displayName=gi;var Ti=`ToastViewport`,Ei=[`F8`],Di=`toast.viewportPause`,Oi=`toast.viewportResume`,ki=M.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=Ei,label:i=`Notifications ({hotkey})`,...a}=e,o=Ci(Ti,n),s=vi(n),c=M.useRef(null),l=M.useRef(null),d=M.useRef(null),f=M.useRef(null),p=y(t,f,o.onViewportChange),m=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),h=o.toastCount>0;M.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&f.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),M.useEffect(()=>{let e=c.current,t=f.current;if(h&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(Di);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(Oi);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[h,o.isClosePausedRef]);let g=M.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...na(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return M.useEffect(()=>{let e=f.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=g({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);ra(i.slice(a+1))?t.preventDefault():r?l.current?.focus():d.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,g]),(0,N.jsxs)(ii,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,m),tabIndex:-1,style:{pointerEvents:h?void 0:`none`},children:[h&&(0,N.jsx)(ji,{ref:l,onFocusFromOutsideViewport:()=>{ra(g({tabbingDirection:`forwards`}))}}),(0,N.jsx)(_i.Slot,{scope:n,children:(0,N.jsx)(u.ol,{tabIndex:-1,...a,ref:p})}),h&&(0,N.jsx)(ji,{ref:d,onFocusFromOutsideViewport:()=>{ra(g({tabbingDirection:`backwards`}))}})]})});ki.displayName=Ti;var Ai=`ToastFocusProxy`,ji=M.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Ci(Ai,n);return(0,N.jsx)(mi,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});ji.displayName=Ai;var Mi=`Toast`,Ni=`toast.swipeStart`,Pi=`toast.swipeMove`,Fi=`toast.swipeCancel`,Ii=`toast.swipeEnd`,Li=M.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=g({prop:r,defaultProp:i??!0,onChange:a,caller:Mi});return(0,N.jsx)(ci,{present:n||s,children:(0,N.jsx)(Bi,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Hr(e.onPause),onResume:Hr(e.onResume),onSwipeStart:p(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:p(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:p(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:p(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});Li.displayName=Mi;var[Ri,zi]=bi(Mi,{onClose(){}}),Bi=M.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:h,...g}=e,_=Ci(Mi,n),[v,b]=M.useState(null),x=y(t,e=>b(e)),S=M.useRef(null),C=M.useRef(null),w=i||_.duration,T=M.useRef(0),ee=M.useRef(w),te=M.useRef(0),{onToastAdd:E,onToastRemove:D}=_,O=Hr(()=>{v?.contains(document.activeElement)&&_.viewport?.focus(),o()}),k=M.useCallback(e=>{!e||e===1/0||(window.clearTimeout(te.current),T.current=new Date().getTime(),te.current=window.setTimeout(O,e))},[O]);M.useEffect(()=>{let e=_.viewport;if(e){let t=()=>{k(ee.current),l?.()},n=()=>{let e=new Date().getTime()-T.current;ee.current-=e,window.clearTimeout(te.current),c?.()};return e.addEventListener(Di,n),e.addEventListener(Oi,t),()=>{e.removeEventListener(Di,n),e.removeEventListener(Oi,t)}}},[_.viewport,w,c,l,k]),M.useEffect(()=>{a&&!_.isClosePausedRef.current&&k(w)},[a,w,_.isClosePausedRef,k]),M.useEffect(()=>(E(),()=>D()),[E,D]);let A=M.useMemo(()=>v?Zi(v):null,[v]);return _.viewport?(0,N.jsxs)(N.Fragment,{children:[A&&(0,N.jsx)(Vi,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:A}),(0,N.jsx)(Ri,{scope:n,onClose:O,children:rt.createPortal((0,N.jsx)(_i.ItemSlot,{scope:n,children:(0,N.jsx)(ri,{asChild:!0,onEscapeKeyDown:p(s,()=>{_.isFocusedToastEscapeKeyDownRef.current||O(),_.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,N.jsx)(u.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":_.swipeDirection,...g,ref:x,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:p(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(_.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:p(e.onPointerDown,e=>{e.button===0&&(S.current={x:e.clientX,y:e.clientY})}),onPointerMove:p(e.onPointerMove,e=>{if(!S.current)return;let t=e.clientX-S.current.x,n=e.clientY-S.current.y,r=!!C.current,i=[`left`,`right`].includes(_.swipeDirection),a=[`left`,`up`].includes(_.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},u={originalEvent:e,delta:l};r?(C.current=l,Qi(Pi,f,u,{discrete:!1})):$i(l,_.swipeDirection,c)?(C.current=l,Qi(Ni,d,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(S.current=null)}),onPointerUp:p(e.onPointerUp,e=>{let t=C.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),C.current=null,S.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};$i(t,_.swipeDirection,_.swipeThreshold)?Qi(Ii,h,r,{discrete:!0}):Qi(Fi,m,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),_.viewport)})]}):null}),Vi=e=>{let{__scopeToast:t,children:n,...r}=e,i=Ci(Mi,t),[a,o]=M.useState(!1),[s,c]=M.useState(!1);return ea(()=>o(!0)),M.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,N.jsx)(oi,{asChild:!0,children:(0,N.jsx)(mi,{...r,children:a&&(0,N.jsxs)(N.Fragment,{children:[i.label,` `,n]})})})},Hi=`ToastTitle`,Ui=M.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,N.jsx)(u.div,{...r,ref:t})});Ui.displayName=Hi;var Wi=`ToastDescription`,Gi=M.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,N.jsx)(u.div,{...r,ref:t})});Gi.displayName=Wi;var Ki=`ToastAction`,qi=M.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,N.jsx)(Xi,{altText:n,asChild:!0,children:(0,N.jsx)(Yi,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ki}\`. Expected non-empty \`string\`.`),null)});qi.displayName=Ki;var Ji=`ToastClose`,Yi=M.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=zi(Ji,n);return(0,N.jsx)(Xi,{asChild:!0,children:(0,N.jsx)(u.button,{type:`button`,...r,ref:t,onClick:p(e.onClick,i.onClose)})})});Yi.displayName=Ji;var Xi=M.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,N.jsx)(u.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Zi(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),ta(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Zi(e))}}),t}function Qi(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?h(i,a):i.dispatchEvent(a)}var $i=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function ea(e=()=>{}){let t=Hr(e);f(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function ta(e){return e.nodeType===e.ELEMENT_NODE}function na(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ra(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var ia=wi,aa=ki,oa=Li,sa=Ui,ca=Gi,la=qi,ua=Yi,da=T(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),fa=T(`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`}]]),pa=T(`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`}]]),ma=T(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ha=T(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ga=T(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),_a=T(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),va=T(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ya=T(`CirclePlay`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polygon`,{points:`10 8 16 12 10 16 10 8`,key:`1cimsy`}]]),ba=T(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),xa=T(`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`}]]),Sa=T(`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`}]]),Ca=T(`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`}]]),wa=T(`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`}]]),Ta=T(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ea=T(`Library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),Da=T(`Menu`,[[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9
3i`}],[`line`,{x1:`4`,x2:`20`,y1:`6`,y2:`6`,key:`1owob3`}],[`line`,{x1:`4`,x2:`20`,y1:`18`,y2:`18`,key:`yk5zj1`}]]),Oa=T(`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`}]]),ka=T(`Package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7`,key:`yx3hmr`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Aa=T(`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`}]]),ja=T(`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`}]]),Ma=T(`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`}]]),Na=T(`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`}]]),Pa=T(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Fa=T(`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`}]]),Ia=ia,La=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(aa,{ref:n,className:w(`fixed top-0 z-[100] 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}));La.displayName=aa.displayName;var Ra=C(`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`}}),za=M.forwardRef(({className:e,variant:t,...n},r)=>(0,N.jsx)(oa,{ref:r,className:w(Ra({variant:t}),e),...n}));za.displayName=oa.displayName;var Ba=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(la,{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 group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50`,e),...t}));Ba.displayName=la.displayName;var Va=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(ua,{ref:n,className:w(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,N.jsx)(Pa,{className:`h-4 w-4`})}));Va.displayName=ua.displayName;var Ha=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(sa,{ref:n,className:w(`text-sm font-semibold`,e),...t}));Ha.displayName=sa.displayName;var Ua=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(ca,{ref:n,className:w(`text-sm opacity-90`,e),...t}));Ua.displayName=ca.displayName;function Wa(){let{toasts:e}=Vr();
vendor: 5,878 bytes, line 3
3return(0,N.jsxs)(Ia,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,N.jsxs)(za,{...i,children:[(0,N.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,N.jsx)(Ha,{children:t}),n&&(0,N.jsx)(Ua,{children:n})]}),r,(0,N.jsx)(Va,{})]},e)}),(0,N.jsx)(La,{})]})}var Ga=[`top`,`right`,`bottom`,`left`],Ka=Math.min,qa=Math.max,Ja=Math.round,Ya=Math.floor,Xa=e=>({x:e,y:e}),Za={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Qa(e,t,n){return qa(e,Ka(t,n))}function $a(e,t){return typeof e==`function`?e(t):e}function eo(e){return e.split(`-`)[0]}function to(e){return e.split(`-`)[1]}function no(e){return e===`x`?`y`:`x`}function ro(e){return e===`y`?`height`:`width`}function io(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ao(e){return no(io(e))}function oo(e,t,n){n===void 0&&(n=!1);let r=to(e),i=ao(e),a=ro(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=go(o)),[o,go(o)]}function so(e){let t=go(e);return[co(e),t,co(t)]}function co(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var lo=[`left`,`right`],uo=[`right`,`left`],fo=[`top`,`bottom`],po=[`bottom`,`top`];function mo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?uo:lo:t?lo:uo;case`left`:case`right`:return t?fo:po;default:return[]}}function ho(e,t,n,r){let i=to(e),a=mo(eo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(co)))),a}function go(e){let t=eo(e);return Za[t]+e.slice(t.length)}function _o(e){return{top:0,right:0,bottom:0,left:0,...e}}function vo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_o(e)}function yo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bo(e,t,n){let{reference:r,floating:i}=e,a=io(t),o=ao(t),s=ro(o),c=eo(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(to(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function xo(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=$a(t,e),p=vo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=yo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=yo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var So=50,Co=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<So&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=bo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},wo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=$a(e,t)||{};if(l==null)return{};let d=vo(u),f={x:n,y:r},p=ao(i),m=ro(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Ka(d[_],T),te=Ka(d[v],T),E=ee,D=C-h[m]-te,O=C/2-h[m]/2+w,k=Qa(E,O,D),A=!c.arrow&&to(i)!=null&&O!==k&&a.reference[m]/2-(O<E?ee:te)-h[m]/2<0,ne=A?O<E?O-E:O-D:0;return{[p]:f[p]+ne,data:{[p]:k,centerOffset:O-k-ne,...A&&{alignmentOffset:ne}},reset:A}}}),To=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=$a(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=eo(r),_=io(o),v=eo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[go(o)]:so(o)),x=p!==`none`;!d&&x&&b.push(...ho(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=oo(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==io(t))||T.every(e=>io(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>
vendor: 5,964 bytes, line 3
3e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=io(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Eo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Do(e){return Ga.some(t=>e[t]>=0)}var Oo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=$a(e,t);switch(i){case`referenceHidden`:{let e=Eo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Do(e)}}}case`escaped`:{let e=Eo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Do(e)}}}default:return{}}}}},ko=new Set([`left`,`top`]);async function Ao(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=eo(n),s=to(n),c=io(n)===`y`,l=ko.has(o)?-1:1,u=a&&c?-1:1,d=$a(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var jo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ao(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Mo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=$a(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=io(eo(i)),p=no(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Qa(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Qa(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},No=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=$a(e,t),u={x:n,y:r},d=io(i),f=no(d),p=u[f],m=u[d],h=$a(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ko.has(eo(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Po=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=$a(e,t),u=await o.detectOverflow(t,l),d=eo(i),f=to(i),p=io(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ka(h-u[g],v),x=Ka(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=qa(u.left,0),t=qa(u.right,0),n=qa(u.top,0),r=qa(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:qa(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:qa(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Fo(){return typeof window<`u`}function Io(e){return zo(e)?(e.nodeName||``).toLowerCase():`#document`}function Lo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ro(e){return((zo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function zo(e){return Fo()?e instanceof Node||e instanceof Lo(e).Node:!1}function Bo(e){return Fo()?e instanceof Element||e instanceof Lo(e).Element:!1}function Vo(e){return Fo()?e instanceof HTMLElement||e instanceof Lo(e).HTMLElement:!1}function Ho(e){return!Fo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Lo(e).ShadowRoot}function Uo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=es(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Wo(e){return/^(table|td|th)$/.test(Io(e))}function Go(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ko=/transform|translate|scale|rotate|perspective|filter/,qo=/paint|layout|strict|content/,Jo=e=>!!e&&e!==`none`,Yo;function Xo(e){let t=Bo(e)?es(e):e;return Jo(t.transform)||Jo(t.translate)||Jo(t.scale)||Jo(t.rotate)||Jo(t.perspective)||!Qo()&&(Jo(t.backdropFilter)||Jo(t.filter))||Ko.test(t.willChange||``)||qo.test(t.contain||``)}function Zo(e){let t=ns(e);for(;Vo(t)&&!$o(t);){if(Xo(t))return t;if(Go(t))return null;t=ns(t)}return null}function Qo(){return Yo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Yo}function $o(e){return/^(html|body|#document)$/.test(Io(e))}function es(e){return Lo(e).getComputedStyle(e)}function ts(e){return Bo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ns(e){if(Io(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ho(e)&&e.host||Ro(e);return Ho(t)?t.host:t}function rs(e){let t=ns(e);return $o(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vo(t)&&Uo(t)?t:rs(t)}function is(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rs(e),i=r===e.ownerDocument?.body,a=Lo(r);if(i){let e=as(a);
vendor: 6,486 bytes, line 3
3return t.concat(a,a.visualViewport||[],Uo(r)?r:[],e&&n?is(e):[])}else return t.concat(r,is(r,[],n))}function as(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function os(e){let t=es(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Vo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ja(n)!==a||Ja(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ss(e){return Bo(e)?e:e.contextElement}function cs(e){let t=ss(e);if(!Vo(t))return Xa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=os(t),o=(a?Ja(n.width):n.width)/r,s=(a?Ja(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ls=Xa(0);function us(e){let t=Lo(e);return!Qo()||!t.visualViewport?ls:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ds(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Lo(e)?!1:t}function fs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ss(e),o=Xa(1);t&&(r?Bo(r)&&(o=cs(r)):o=cs(e));let s=ds(a,n,r)?us(a):Xa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Lo(a),t=r&&Bo(r)?Lo(r):r,n=e,i=as(n);for(;i&&r&&t!==n;){let e=cs(i),t=i.getBoundingClientRect(),r=es(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Lo(i),i=as(n)}}return yo({width:u,height:d,x:c,y:l})}function ps(e,t){let n=ts(e).scrollLeft;return t?t.left+n:fs(Ro(e)).left+n}function ms(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ps(e,n),y:n.top+t.scrollTop}}function hs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ro(r),s=t?Go(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Xa(1),u=Xa(0),d=Vo(r);if((d||!d&&!a)&&((Io(r)!==`body`||Uo(o))&&(c=ts(r)),d)){let e=fs(r);l=cs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ms(o,c):Xa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function gs(e){return Array.from(e.getClientRects())}function _s(e){let t=Ro(e),n=ts(e),r=e.ownerDocument.body,i=qa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=qa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ps(e),s=-n.scrollTop;return es(r).direction===`rtl`&&(o+=qa(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var vs=25;function ys(e,t){let n=Lo(e),r=Ro(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Qo();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ps(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=vs&&(a-=o)}else l<=vs&&(a+=l);return{width:a,height:o,x:s,y:c}}function bs(e,t){let n=fs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Vo(e)?cs(e):Xa(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function xs(e,t,n){let r;if(t===`viewport`)r=ys(e,n);else if(t===`document`)r=_s(Ro(e));else if(Bo(t))r=bs(t,n);else{let n=us(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yo(r)}function Ss(e,t){let n=ns(e);return n===t||!Bo(n)||$o(n)?!1:es(n).position===`fixed`||Ss(n,t)}function Cs(e,t){let n=t.get(e);if(n)return n;let r=is(e,[],!1).filter(e=>Bo(e)&&Io(e)!==`body`),i=null,a=es(e).position===`fixed`,o=a?ns(e):e;for(;Bo(o)&&!$o(o);){let t=es(o),n=Xo(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Uo(o)&&!n&&Ss(e,o))?r=r.filter(e=>e!==o):i=t,o=ns(o)}return t.set(e,r),r}function ws(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Go(t)?[]:Cs(t,this._c):[].concat(n),r],o=xs(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=xs(t,a[e],i);s=qa(n.top,s),c=Ka(n.right,c),l=Ka(n.bottom,l),u=qa(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ts(e){let{width:t,height:n}=os(e);return{width:t,height:n}}function Es(e,t,n){let r=Vo(t),i=Ro(t),a=n===`fixed`,o=fs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Xa(0);function l(){c.x=ps(i)}if(r||!r&&!a)if((Io(t)!==`body`||Uo(i))&&(s=ts(t)),r){let e=fs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?ms(i,s):Xa(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ds(e){return es(e).position===`static`}function Os(e,t){if(!Vo(e)||es(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ro(e)===n&&(n=n.ownerDocument.body),n}function ks(e,t){let n=Lo(e);if(Go(e))return n;if(!Vo(e)){let t=ns(e);for(;t&&!$o(t);){if(Bo(t)&&!Ds(t))return t;t=ns(t)}return n}let r=Os(e,t);for(;r&&Wo(r)&&Ds(r);)r=Os(r,t);return r&&$o(r)&&Ds(r)&&!Xo(r)?n:r||Zo(e)||n}var As=async function(e){let t=this.getOffsetParent||ks,n=this.getDimensions,r=await n(e.floating);return{reference:Es(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function js(e){return es(e).direction===`rtl`}var Ms={convertOffsetParentRelativeRectToViewportRelativeRect:hs,getDocumentElement:Ro,getClippingRect:ws,getOffsetParent:ks,getElementRects:As,getClientRects:gs,getDimensions:Ts,getScale:cs,isElement:Bo,isRTL:js};function Ns(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ps(e,t){let n=null,r,i=Ro(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Ya(d),h=Ya(i.clientWidth-(u+f)),g=Ya(i.clientHeight-(d+p)),_=Ya(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:qa(0,Ka(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ns(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Fs(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ss(e),u=i||a?[...l?is(l):[],...t?is(t):[]]:[];
vendor: 4,876 bytes, line 3
3u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ps(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?fs(e):null;c&&g();function g(){let t=fs(e);h&&!Ns(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Is=jo,Ls=Mo,Rs=To,zs=Po,Bs=Oo,Vs=wo,Hs=No,Us=(e,t,n)=>{let r=new Map,i={platform:Ms,...n},a={...i.platform,_c:r};return Co(e,t,{...i,platform:a})},Ws=typeof document<`u`?M.useLayoutEffect:function(){};function Gs(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,i;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(!Gs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Gs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ks(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qs(e,t){let n=Ks(e);return Math.round(t*n)/n}function Js(e){let t=M.useRef(e);return Ws(()=>{t.current=e}),t}function Ys(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=M.useState(r);Gs(f,r)||p(r);let[m,h]=M.useState(null),[g,_]=M.useState(null),v=M.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=M.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=M.useRef(null),C=M.useRef(null),w=M.useRef(u),T=c!=null,ee=Js(c),te=Js(i),E=Js(l),D=M.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),Us(S.current,C.current,e).then(e=>{let t={...e,isPositioned:E.current!==!1};O.current&&!Gs(w.current,t)&&(w.current=t,rt.flushSync(()=>{d(t)}))})},[f,t,n,te,E]);Ws(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let O=M.useRef(!1);Ws(()=>(O.current=!0,()=>{O.current=!1}),[]),Ws(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,D);D()}},[b,x,D,ee,T]);let k=M.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=M.useMemo(()=>({reference:b,floating:x}),[b,x]),ne=M.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=qs(A.floating,u.x),r=qs(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ks(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:D,refs:k,elements:A,floatingStyles:ne}),[u,D,k,A,ne])}var Xs=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Vs({element:r.current,padding:i}).fn(n):r?Vs({element:r,padding:i}).fn(n):{}}}},Zs=(e,t)=>{let n=Is(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qs=(e,t)=>{let n=Ls(e);return{name:n.name,fn:n.fn,options:[e,t]}},$s=(e,t)=>({fn:Hs(e).fn,options:[e,t]}),ec=(e,t)=>{let n=Rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},tc=(e,t)=>{let n=zs(e);return{name:n.name,fn:n.fn,options:[e,t]}},nc=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},rc=(e,t)=>{let n=Xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ic=`Arrow`,ac=M.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,N.jsx)(u.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,N.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ac.displayName=ic;var oc=ac;function sc(e){let[t,n]=M.useState(void 0);return f(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var cc=`Popper`,[lc,uc]=d(cc),[dc,fc]=lc(cc),pc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=M.useState(null);return(0,N.jsx)(dc,{scope:t,anchor:r,onAnchorChange:i,children:n})};pc.displayName=cc;var mc=`PopperAnchor`,hc=M.forwardRef((e,t)=>
vendor: 4,180 bytes, line 3
3{let{__scopePopper:n,virtualRef:r,...i}=e,a=fc(mc,n),o=M.useRef(null),s=y(t,o),c=M.useRef(null);return M.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,N.jsx)(u.div,{...i,ref:s})});hc.displayName=mc;var gc=`PopperContent`,[_c,vc]=lc(gc),yc=M.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=fc(gc,n),[b,x]=M.useState(null),S=y(t,e=>x(e)),[C,w]=M.useState(null),T=sc(C),ee=T?.width??0,te=T?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Cc),altBoundary:k},{refs:ne,floatingStyles:re,placement:ie,isPositioned:j,middlewareData:ae}=Ys({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Fs(...e,{animationFrame:h===`always`}),elements:{reference:v.anchor},middleware:[Zs({mainAxis:i+te,alignmentAxis:o}),c&&Qs({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?$s():void 0,...A}),c&&ec({...A}),tc({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),C&&rc({element:C,padding:s}),wc({arrowWidth:ee,arrowHeight:te}),m&&nc({strategy:`referenceHidden`,...A})]}),[oe,se]=Tc(ie),ce=Hr(g);f(()=>{j&&ce?.()},[j,ce]);let le=ae.arrow?.x,ue=ae.arrow?.y,de=ae.arrow?.centerOffset!==0,[fe,pe]=M.useState();return f(()=>{b&&pe(window.getComputedStyle(b).zIndex)},[b]),(0,N.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:j?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:fe,"--radix-popper-transform-origin":[ae.transformOrigin?.x,ae.transformOrigin?.y].join(` `),...ae.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,N.jsx)(_c,{scope:n,placedSide:oe,onArrowChange:w,arrowX:le,arrowY:ue,shouldHideArrow:de,children:(0,N.jsx)(u.div,{"data-side":oe,"data-align":se,..._,ref:S,style:{..._.style,animation:j?void 0:`none`}})})})});yc.displayName=gc;var bc=`PopperArrow`,xc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Sc=M.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=vc(bc,n),a=xc[i.placedSide];return(0,N.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,N.jsx)(oc,{...r,ref:t,style:{...r.style,display:`block`}})})});Sc.displayName=bc;function Cc(e){return e!==null}var wc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Tc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Tc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ec=pc,Dc=hc,Oc=yc,kc=Sc,Ac=Symbol(`radix.slottable`);function jc(e){let t=({children:e})=>(0,N.jsx)(N.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Ac,t}var[Mc,Nc]=d(`Tooltip`,[uc]),Pc=uc(),Fc=`TooltipProvider`,Ic=700,Lc=`tooltip.open`,[Rc,zc]=Mc(Fc),Bc=e=>{let{__scopeTooltip:t,delayDuration:n=Ic,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=M.useRef(!0),s=M.useRef(!1),c=M.useRef(0);return M.useEffect(()=>
vendor: 4,250 bytes, line 3
3{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,N.jsx)(Rc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:M.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:M.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:M.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Bc.displayName=Fc;var Vc=`Tooltip`,[Hc,Uc]=Mc(Vc),Wc=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=zc(Vc,e.__scopeTooltip),l=Pc(t),[u,d]=M.useState(null),f=m(),p=M.useRef(0),h=o??c.disableHoverableContent,_=s??c.delayDuration,v=M.useRef(!1),[y,b]=g({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Lc))):c.onClose(),a?.(e)},caller:Vc}),x=M.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=M.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,b(!0)},[b]),C=M.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),w=M.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,b(!0),p.current=0},_)},[_,b]);return M.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,N.jsx)(Ec,{...l,children:(0,N.jsx)(Hc,{scope:t,contentId:f,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:M.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:M.useCallback(()=>{h?C():(window.clearTimeout(p.current),p.current=0)},[C,h]),onOpen:S,onClose:C,disableHoverableContent:h,children:n})})};Wc.displayName=Vc;var Gc=`TooltipTrigger`,Kc=M.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Uc(Gc,n),a=zc(Gc,n),o=Pc(n),s=y(t,M.useRef(null),i.onTriggerChange),c=M.useRef(!1),l=M.useRef(!1),d=M.useCallback(()=>c.current=!1,[]);return M.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,N.jsx)(Dc,{asChild:!0,...o,children:(0,N.jsx)(u.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:p(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:p(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:p(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:p(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:p(e.onBlur,i.onClose),onClick:p(e.onClick,i.onClose)})})});Kc.displayName=Gc;var qc=`TooltipPortal`,[Jc,Yc]=Mc(qc,{forceMount:void 0}),Xc=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Uc(qc,t);return(0,N.jsx)(Jc,{scope:t,forceMount:n,children:(0,N.jsx)(ci,{present:n||a.open,children:(0,N.jsx)(oi,{asChild:!0,container:i,children:r})})})};Xc.displayName=qc;var Zc=`TooltipContent`,Qc=M.forwardRef((e,t)=>{let n=Yc(Zc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Uc(Zc,e.__scopeTooltip);return(0,N.jsx)(ci,{present:r||o.open,children:o.disableHoverableContent?(0,N.jsx)(rl,{side:i,...a,ref:t}):(0,N.jsx)($c,{side:i,...a,ref:t})})}),$c=M.forwardRef((e,t)=>{let n=Uc(Zc,e.__scopeTooltip),r=zc(Zc,e.__scopeTooltip),i=M.useRef(null),a=y(t,i),[o,s]=M.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=M.useCallback(()=>{s(null),d(!1)},[d]),p=M.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=sl(r,ol(r,n.getBoundingClientRect())),a=cl(t.getBoundingClientRect());s(ul([...i,...a])),d(!0)},[d]);return M.useEffect(()=>()=>f(),[f]),M.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),M.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ll(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,N.jsx)(rl,{...e,ref:a})}),[el,tl]=Mc(Vc,{isInside:!1}),nl=jc(`TooltipContent`),rl=M.forwardRef((e,t)=>
vendor: 4,367 bytes, line 3
3{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Uc(Zc,n),l=Pc(n),{onClose:u}=c;return M.useEffect(()=>(document.addEventListener(Lc,u),()=>document.removeEventListener(Lc,u)),[u]),M.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,N.jsx)(Xr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,N.jsxs)(Oc,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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:[(0,N.jsx)(nl,{children:r}),(0,N.jsx)(el,{scope:n,isInside:!0,children:(0,N.jsx)(hi,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Qc.displayName=Zc;var il=`TooltipArrow`,al=M.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Pc(n);return tl(il,n).isInside?null:(0,N.jsx)(kc,{...i,...r,ref:t})});al.displayName=il;function ol(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function sl(e,t,n=5){let 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 cl(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ll(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ul(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),dl(t)}function dl(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 fl=Bc,pl=Qc,ml=fl,hl=M.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,N.jsx)(pl,{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`,e),...n}));hl.displayName=pl.displayName;function gl({className:e,...t}){return(0,N.jsx)(`div`,{className:w(`animate-pulse rounded-md bg-muted`,e),...t})}var _l=`/assets/homeboost-logo-Cq_QL4My.svg`,vl=[{title:`For Homeowners`,description:`Understand and improve your home's energy use`,icon:wa,overviewPath:`/homeowners`,links:[]},{title:`For Pros`,description:`Turn insights into jobs and grow your business`,icon:Na,overviewPath:`/pro`,links:[]},{title:`For Utilities`,description:`Scale energy efficiency programs with modern tools`,icon:Fa,overviewPath:`/utilities`,links:[]},{title:`For Co-ops`,description:`Help your cooperative serve more members, faster`,icon:Ma,overviewPath:`/coops`,links:[]}],yl=[{title:`How It Works`,description:`See the HomeBoost process step by step`,icon:ya,path:`/how-it-works`},{title:`About Us`,description:`Meet the team behind HomeBoost`,icon:Ta,path:`/about-us`},{title:`Audit Savings Calculator`,description:`Estimate how much a home energy audit can save you`,icon:Ca,path:`/home-energy-audit-savings`}
3,{title:`Blog`,description:`Tips, guides, and energy-saving insights`,icon:fa,path:`/blog`},{title:`In the News`,description:`Announcements, press, and partner updates`,icon:Oa,path:`/news`},{title:`Library Program`,description:`Borrow a Boost Box from your local library`,icon:fa,path:`/library`},{title:`Case Studies`,description:`Real results from real programs`,icon:Ca,path:`/case-studies/central-hudson`}];function bl({link:e,onClick:t}){let n=`text-[13px] text-muted-foreground hover:text-primary transition-colors flex items-center gap-1`;return e.external?(0,N.jsxs)(`a`,{href:e.path,target:`_blank`,rel:`noopener noreferrer`,className:n,onClick:t,children:[e.label,(0,N.jsx)(Sa,{size:11,className:`opacity-50`})]}):(0,N.jsx)(F,{to:e.path,className:n,onClick:t,children:e.label})}function xl({show:e,children:t,className:n=``}){let[r,i]=(0,M.useState)(e);return(0,M.useEffect)(()=>{e&&i(!0)},[e]),r?(0,N.jsx)(`div`,{className:n,style:{opacity:e?1:0,transform:e?`translateY(0)`:`translateY(8px)`,transition:`opacity 0.18s ease-out, transform 0.18s ease-out`,pointerEvents:e?`auto`:`none`},onTransitionEnd:()=>{e||i(!1)},children:t}):null}function Sl({open:e,children:t}){return(0,N.jsx)(`div`,{style:{display:`grid`,gridTemplateRows:e?`1fr`:`0fr`,opacity:e?1:0,transition:`grid-template-rows 0.2s ease, opacity 0.2s ease`},children:(0,N.jsx)(`div`,{style:{overflow:`hidden`},children:t})})}var Cl=()=>{let[e,t]=(0,M.useState)(!1),[n,r]=(0,M.useState)(null),[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(!1),c=(0,M.useRef)(null),l=(0,M.useRef)(null),u=(0,M.useRef)(),d=an();(0,M.useEffect)(()=>{r(null),t(!1),a(!1),s(!1)},[d.pathname]),(0,M.useEffect)(()=>(e?document.body.style.overflow=`hidden`:document.body.style.overflow=``,()=>{document.body.style.overflow=``}),[e]);let f=(0,M.useCallback)(e=>{clearTimeout(u.current),r(e)},[]),p=(0,M.useCallback)(()=>{u.current=setTimeout(()=>r(null),120)},[]),m=[`/homeowners`,`/utilities`,`/pro`,`/coops`].some(e=>d.pathname===e),h=[`/how-it-works`,`/about-us`,`/blog`,`/library`,`/case-studies/central-hudson`].some(e=>d.pathname.startsWith(e)),g=(e,t)=>`text-sm font-medium transition-colors px-1 py-1 inline-flex items-center gap-1 ${e||t?`text-foreground`:`text-muted-foreground hover:text-foreground`}`,_=()=>d.pathname===`/pro`?(0,N.jsx)(`a`,{href:`https://partners.homeboost.com/book-a-demo`,target:`_blank`,rel:`noopener noreferrer`,children:(0,N.jsx)(S,{size:`sm`,className:`rounded-full px-5`,children:`Book a Demo →`})}):d.pathname===`/utilities`?(0,N.jsx)(F,{to:`/policies/contact-information`,children:(0,N.jsx)(S,{size:`sm`,className:`rounded-full px-5`,children:`Request a Pilot →`})}):d.pathname===`/coops`?(0,N.jsx)(`a`,{href:`https://partners.homeboost.com/coops`,target:`_blank`,rel:`noopener noreferrer`,children:(0,N.jsx)(S,{size:`sm`,className:`rounded-full px-5`,children:`Request a Pilot →`})}):(0,N.jsx)(`a`,{href:`https://www.homeboost.com/products/boostbox`,target:`_blank`,rel:`noopener noreferrer`,children:(0,N.jsx)(S,{size:`sm`,className:`rounded-full px-5`,children:`Get DIY Kit`})});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`nav`,{className:`fixed top-0 z-50 w-full border-b border-border/60 bg-background/95 backdrop-blur-md`,role:`navigation`,"aria-label":`Main navigation`,children:(0,N.jsxs)(`div`,{className:`mx-auto flex h-14 max-w-7xl items-center justify-between px-5 lg:px-8`,children:[(0,N.jsx)(F,{to:`/`,className:`flex items-center shrink-0`,children:(0,N.jsx)(`img`,{src:_l,alt:`HomeBoost home page`,className:`h-6`})}),(0,N.jsxs)(`div`,{className:`hidden md:flex items-center gap-1 ml-10`,children:[(0,N.jsx)(F,{to:`/`,className:`text-sm font-medium transition-colors px-3 py-2 rounded-lg ${d.pathname===`/`?`text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:`Home Energy Assessment`}),(0,N.jsxs)(`div`,{ref:c,className:`relative`,onMouseEnter:()=>f(`solutions`),onMouseLeave:p,children:[(0,N.jsxs)(`button`,{className:`${g(m,n===`solutions`)} px-3 py-2 rounded-lg hover:bg-secondary/60`,onClick:()=>r(e=>e===`solutions`?null:`solutions`),"aria-expanded":n===`solutions`,"aria-haspopup":`true`,children:[`Solutions`,(0,N.jsx)(ha,{size:14,className:`transition-transform duration-200 ${n===`solutions`?`rotate-180`:``}`})]}),(0,N.jsx)(xl,{show:n===`solutions`,className:`fixed inset-x-0 top-14 pt-2 z-50 flex justify-center`,children:(0,N.jsx)(`div`,{className:`rounded-xl border border-border/60 bg-background shadow-xl p-2`,onMouseEnter:()=>f(`solutions`),onMouseLeave:p,role:`menu`,children:(0,N.jsx)(`div`,{className:`grid grid-cols-2 gap-1 w-[640px]`,children:vl.map(e=>{let t=e.icon,n=d.pathname===e.overviewPath;return(0,N.jsxs)(F,{to:e.overviewPath,className:`group flex gap-3 rounded-lg p-4 transition-colors hover:bg-secondary/70 ${n?`bg-secondary/50`:``}`,role:`menuitem`,children:[(0,N.jsx)(`div`,{className:`shrink-0 mt-0.5`,children:(0,N.jsx)(`div`,{className:`w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center group-hover:bg-primary/15 transition-colors`,children:(0,N.jsx)(t,{size:18,className:`text-primary`})})}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 min-w-0`,children:[(0,N.jsxs)(`span`,{className:`text-sm font-semibold text-foreground group-hover:text-primary transition-colors flex items-center gap-1`,children:[e.title,(0,N.jsx)(ga,{size:13,className:`opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200 text-primary`})]}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground leading-relaxed`,children:e.description}),e.links.length>0&&(0,N.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-0.5 mt-1`,children:e.links.map(e=>(0,N.jsx)(bl,{link:e},e.label))})]})]},e.title)})})})})]}),(0,N.jsxs)(`div`,{ref:l,className:`relative`,onMouseEnter:()=>f(`learn`),onMouseLeave:p,children:[(0,N.jsxs)(`button`,{className:`${g(h,n===`learn`)} px-3 py-2 rounded-lg hover:bg-secondary/60`,onClick:()=>r(e=>e===`learn`?null:`learn`),"aria-expanded":n===`learn`,"aria-haspopup":`true`,children:[`Learn`,(0,N.jsx)(ha,{size:14,className:`transition-transform duration-200 ${n===`learn`?`rotate-180`:``}`})]}),(0,N.jsx)(xl,{show:n===`learn`,className:`absolute left-1/2 -translate-x-1/2 top-full pt-2 z-50`,children:(0,N.jsx)(`div`,{className:`rounded-xl border border-border/60 bg-background shadow-xl p-2 w-[320px]`,onMouseEnter:()=>f(`learn`),onMouseLeave:p,role:`menu`,children:(0,N.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:yl.map(e=>{let t=e.icon,n=!e.external&&d.pathname.startsWith(e.path),r=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`shrink-0 mt-0.5`,children:(0,N.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center group-hover:bg-primary/15 transition-colors`,children:(0,N.jsx)(t,{size:16,className:`text-primary`})})}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,N.jsxs)(`span`,{className:`text-sm font-semibold text-foreground group-hover:text-primary transition-colors flex items-center gap-1`,children:[e.title,e.external&&(0,N.jsx)(Sa,{size:11,className:`opacity-60`})]}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground leading-relaxed`,children:e.description})]})]}),i=`group flex gap-3 rounded-lg p-3 transition-colors hover:bg-secondary/70 ${n?`bg-secondary/50`:``}`;return e.external?(0,N.jsx)(`a`,{href:e.path,target:`_blank`,rel:`noopener noreferrer`,className:i,role:`menuitem`,children:r},e.title):(0,N.jsx)(F,{to:e.path,className:i,role:`menuitem`,children:r},e.title)})})})})]})]}),(0,N.jsx)(`div`,{className:`hidden md:block shrink-0`,children:(0,N.jsx)(_,{})}),(0,N.jsx)(`button`,{onClick:()=>t(!e),className:`md:hidden p-3 min-w-[48px] min-h-[48px] flex items-center justify-center rounded-lg hover:bg-secondary transition-colors`,"aria-label":e?`Close menu`:`Open menu`,"aria-expanded":e,children:e?(0,N.jsx)(Pa,{size:22}):(0,N.jsx)(Da,{size:22})})]})}),e&&(0,N.jsxs)(`div`,{className:`fixed inset-0 top-14 z-40 bg-background md:hidden flex flex-col`,style:{animation:`fadeIn 0.2s ease-out`},children:[(0,N.jsx)(`style`,{children:`@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }`}),(0,N.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-5 py-4`,children:(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 max-w-lg mx-auto`,children:[(0,N.jsx)(F,{to:`/`,onClick:()=>t(!1),className:`py-3.5 px-4 min-h-[48px] flex items-center rounded-xl text-base font-medium transition-colors ${d.pathname===`/`?`text-foreground bg-secondary`:`text-foreground hover:bg-secondary/60`}`,children:`Home Energy Assessment`}),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`button`,{onClick:()=>a(e=>!e),className:`py-3.5 px-4 min-h-[48px] rounded-xl text-base font-medium flex items-center justify-between w-full transition-colors ${m?`text-foreground bg-secondary`:`text-foreground hover:bg-secondary/60`}`,"aria-expanded":i,children:[`Solutions`,(0,N.jsx)(ha,{size:18,className:`text-muted-foreground transition-transform duration-200 ${i?`rotate-180`:``}`})]}),(0,N.jsx)(Sl,{open:i,children:(0,N.jsx)(`div`,{className:`py-2 px-2 flex flex-col gap-1`,children:vl.map(e=>{let n=e.icon,r=d.pathname===e.overviewPath;return(0,N.jsxs)(`div`,{className:`flex flex-col`,children:[(0,N.jsxs)(F,{to:e.overviewPath,onClick:()=>t(!1),className:`flex items-center gap-3 py-3 px-3 min-h-[48px] rounded-xl transition-colors ${r?`bg-secondary`:`hover:bg-secondary/60`}`,children:[(0,N.jsx)(`div`,{className:`w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0`,children:(0,N.jsx)(n,{size:18,className:`text-primary`})}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,N.jsx)(`span`,{className:`text-[15px] font-semibold text-foreground`,children:e.title}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground leading-snug`,children:e.description})]}),(0,N.jsx)(ga,{size:16,className:`text-muted-foreground shrink-0 ml-auto`})]}),e.links.length>0&&(0,N.jsx)(`div`,{className:`ml-[52px] flex flex-col gap-0.5 pb-1`,children:e.links.map(e=>(0,N.jsx)(`div`,{className:`py-2 px-2 min-h-[44px] flex items-center`,children:(0,N.jsx)(bl,{link:e,onClick:()=>t(!1)})},e.label))})]},e.title)})})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`button`,{onClick:()=>s(e=>!e),className:`py-3.5 px-4 min-h-[48px] rounded-xl text-base font-medium flex items-center justify-between w-full transition-colors ${h?`text-foreground bg-secondary`:`text-foreground hover:bg-secondary/60`}`,"aria-expanded":o,children:[`Learn`,(0,N.jsx)(ha,{size:18,className:`text-muted-foreground transition-transform duration-200 ${o?`rotate-180`:``}`})]}),(0,N.jsx)(Sl,{open:o,children:(0,N.jsx)(`div`,{className:`py-2 px-2 flex flex-col gap-0.5`,children:yl.map(e=>{let n=e.icon,r=`flex items-center gap-3 py-3 px-3 min-h-[48px] rounded-xl transition-colors ${!e.external&&d.pathname.startsWith(e.path)?`bg-secondary`:`hover:bg-secondary/60`}`,i=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0`,children:(0,N.jsx)(n,{size:18,className:`text-primary`})}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,N.jsxs)(`span`,{className:`text-[15px] font-semibold text-foreground flex items-center gap-1`,children:[e.title,e.external&&(0,N.jsx)(Sa,{size:12,className:`opacity-60`})]}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground leading-snug`,children:e.description})]}),(0,N.jsx)(ga,{size:16,className:`text-muted-foreground shrink-0 ml-auto`})]});return e.external?(0,N.jsx)(`a`,{href:e.path,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>t(!1),className:r,children:i},e.title):(0,N.jsx)(F,{to:e.path,onClick:()=>t(!1),className:r,children:i},e.title)})})})]})]})}),(0,N.jsx)(`div`,{className:`shrink-0 border-t border-border/60 px-5 py-4 bg-background`,children:(0,N.jsx)(`div`,{className:`max-w-lg mx-auto`,children:d.pathname===`/pro`?(0,N.jsx)(`a`,{href:`https://partners.homeboost.com/book-a-demo`,target:`_blank`,rel:`noopener noreferrer`,children:(0,N.jsx)(S,{className:`w-full rounded-full`,size:`lg`,children:`Book a Demo →`})}):d.pathname===`/utilities`?(0,N.jsx)(F,{to:`/policies/contact-information`,onClick:()=>t(!1),children:(0,N.jsx)(S,{className:`w-full rounded-full`,size:`lg`,children:`Request a Pilot →`})}):d.pathname===`/coops`?(0,N.jsx)(`a`,{href:`https://partners.homeboost.com/coops`,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>t(!1),children:(0,N.jsx)(S,{className:`w-full rounded-full`,size:`lg`,children:`Request a Pilot →`})}):(0,N.jsx)(`a`,{href:`https://www.homeboost.com/products/boostbox`,target:`_blank`,rel:`noopener noreferrer`,children:(0,N.jsx)(S,{className:`w-full rounded-full`,size:`lg`,children:`Get DIY Kit`})})})})]})]})},wl=()=>{let{pathname:e,hash:t}=an();return(0,M.useEffect)(()=>
3{if(t){let e=document.querySelector(t);if(e){e.scrollIntoView({behavior:`smooth`});return}}window.scrollTo(0,0)},[e,t]),null};function Tl(e){let t=M.useRef({value:e,previous:e});return M.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var El=`Switch`,[Dl,Ol]=d(El),[kl,Al]=Dl(El),jl=M.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:d,...f}=e,[m,h]=M.useState(null),_=y(t,e=>h(e)),v=M.useRef(!1),b=m?d||!!m.closest(`form`):!0,[x,S]=g({prop:i,defaultProp:a??!1,onChange:l,caller:El});return(0,N.jsxs)(kl,{scope:n,checked:x,disabled:s,children:[(0,N.jsx)(u.button,{type:`button`,role:`switch`,"aria-checked":x,"aria-required":o,"data-state":Il(x),"data-disabled":s?``:void 0,disabled:s,value:c,...f,ref:_,onClick:p(e.onClick,e=>{S(e=>!e),b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),b&&(0,N.jsx)(Fl,{control:m,bubbles:!v.current,name:r,value:c,checked:x,required:o,disabled:s,form:d,style:{transform:`translateX(-100%)`}})]})});jl.displayName=El;var Ml=`SwitchThumb`,Nl=M.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Al(Ml,n);return(0,N.jsx)(u.span,{"data-state":Il(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});Nl.displayName=Ml;var Pl=`SwitchBubbleInput`,Fl=M.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=M.useRef(null),s=y(o,a),c=Tl(n),l=sc(t);return M.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,N.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Fl.displayName=Pl;function Il(e){return e?`checked`:`unchecked`}var Ll=jl,Rl=Nl,zl=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(Ll,{className:w(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input 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`,e),...t,ref:n,children:(0,N.jsx)(Rl,{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`)})}));zl.displayName=Ll.displayName;var Bl=`hb_cookie_consent`,Vl={essential:!0,analytics:!1,marketing:!1,updatedAt:new Date().toISOString(),gpcDetected:!1};function Hl(){try{return!!navigator.globalPrivacyControl}catch{return!1}}function Ul(){try{let e=localStorage.getItem(Bl);return e?JSON.parse(e):null}catch{return null}}function Wl(e){let t=Hl(),n={...Vl,...e,essential:!0,gpcDetected:t,analytics:t?!1:e.analytics??!1,marketing:t?!1:e.marketing??!1,updatedAt:new Date().toISOString()};return localStorage.setItem(Bl,JSON.stringify(n)),Kl(n),n}function Gl(){return Ul()!==null}function Kl(e){typeof window>`u`||(window.gtag&&window.gtag(`consent`,`update`,{analytics_storage:e.analytics?`granted`:`denied`,ad_storage:`denied`,ad_user_data:`denied`,ad_personalization:`denied`}),e.analytics||document.cookie.split(`;`).forEach(e=>{let t=e.trim().split(`=`)[0];(t.startsWith(`_ga`)||t.startsWith(`_gid`))&&(document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${window.location.hostname}`,document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`)}),e.marketing&&Jl())}var ql=!1;function Jl(){if(ql)return;ql=!0;let e=Math.random().toString(36).substring(7),t=document.createElement(`script`);t.src=`https://assets.apollo.io/micro/website-tracker/tracker.iife.js?nocache=`+e,t.async=!0,t.defer=!0,t.onload=function(){window.trackingFunctions?.onLoad({appId:`68efa8369179550021055dfa`})},document.head.appendChild(t)}function Yl(){let e=Hl(),t=Ul();return t?(t.marketing===void 0&&(t.marketing=!1),e&&(t.analytics||t.marketing)?Wl({...t,anal
3ytics:!1,marketing:!1}):(Kl(t),t)):e?Wl({analytics:!1,marketing:!1}):Vl}var Xl=`hb:open-cookie-preferences`;function Zl(){window.dispatchEvent(new CustomEvent(Xl))}var Ql=()=>{let[e,t]=(0,M.useState)(!1),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(!1),c=Hl();(0,M.useEffect)(()=>{let e=Yl();a(e.analytics),s(e.marketing),Gl()||t(!0);let n=()=>{let e=Ul();a(e?.analytics??!1),s(e?.marketing??!1),r(!0),t(!1)};return window.addEventListener(Xl,n),()=>window.removeEventListener(Xl,n)},[]);let l=(0,M.useCallback)(()=>{let e=Wl({analytics:!0,marketing:!0});a(e.analytics),s(e.marketing),t(!1)},[]),u=(0,M.useCallback)(()=>{Wl({analytics:!1,marketing:!1}),a(!1),s(!1),t(!1)},[]),d=(0,M.useCallback)(()=>{Wl({analytics:i,marketing:o}),r(!1),t(!1)},[i,o]);return e&&!n?(0,N.jsx)(`div`,{className:`fixed bottom-0 left-0 right-0 z-50 p-4 md:p-6`,children:(0,N.jsxs)(`div`,{className:`max-w-2xl mx-auto bg-card border border-border rounded-2xl shadow-lg p-5 md:p-6`,children:[(0,N.jsxs)(`div`,{className:`flex items-start gap-3 mb-4`,children:[(0,N.jsx)(Aa,{className:`h-5 w-5 text-primary flex-shrink-0 mt-0.5`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold mb-1`,children:`This website uses cookies`}),(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:[`We use our own and third-party cookies and similar technologies to enhance and personalize your experience, analyze use of our website, and conduct marketing. For more information, please see our`,` `,(0,N.jsx)(F,{to:`/policies/privacy-policy`,className:`underline hover:text-foreground`,onClick:()=>t(!1),children:`Privacy Policy`}),`. To change your preferences click`,` `,(0,N.jsx)(`button`,{type:`button`,className:`underline hover:text-foreground`,onClick:()=>{r(!0),t(!1)},children:`here`}),`.`,c&&(0,N.jsx)(`span`,{className:`block mt-1 font-medium text-foreground`,children:`Global Privacy Control signal detected. Analytics cookies are disabled by default.`})]})]})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,N.jsx)(S,{size:`sm`,variant:`outline`,className:`rounded-full min-w-[140px]`,onClick:l,children:`Accept All`}),(0,N.jsx)(S,{size:`sm`,variant:`outline`,className:`rounded-full min-w-[140px]`,onClick:u,children:`Necessary Only`})]})]})}):n?(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,children:(0,N.jsxs)(`div`,{className:`bg-card border border-border rounded-2xl shadow-xl max-w-md w-full p-6 relative`,children:[(0,N.jsx)(`button`,{className:`absolute top-4 right-4 text-muted-foreground hover:text-foreground`,onClick:()=>r(!1),"aria-label":`Close`,children:(0,N.jsx)(Pa,{className:`h-5 w-5`})}),(0,N.jsx)(`h3`,{className:`text-lg font-semibold mb-4`,children:`Cookie Preferences`}),c&&(0,N.jsx)(`div`,{className:`bg-primary/5 border border-primary/20 rounded-lg p-3 mb-4`,children:(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,N.jsx)(`strong`,{className:`text-foreground`,children:`Global Privacy Control detected.`}),` `,`Analytics and marketing cookies have been automatically disabled in accordance with your browser settings.`]})}),(0,N.jsxs)(`div`,{className:`space-y-4 mb-6`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-medium`,children:`Essential Cookies`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Required for core site functionality.`})]}),(0,N.jsx)(zl,{checked:!0,disabled:!0,"aria-label":`Essential cookies (always on)`})]}),(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-medium`,children:`Analytics Cookies`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Help us understand site usage via Google Analytics.`})]}),(0,N.jsx)(zl,{checked:i,onCheckedChange:a,disabled:c,"aria-label":`Analytics cookies`})]}),(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-medium`,children:`Marketing Cookies`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Used to deliver relevant ads and track campaign effectiveness.`})]}),(0,N.jsx)(zl,{checked:o,onCheckedChange:s,disabled:c,"aria-label":`Mar
3keting cookies`})]})]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(S,{className:`rounded-full flex-1`,onClick:d,children:`Save Preferences`}),(0,N.jsx)(S,{variant:`outline`,className:`rounded-full`,onClick:()=>r(!1),children:`Cancel`})]})]})}):null},$l=[{label:`Facebook`,href:`https://www.facebook.com/homeboost.tips`,icon:(0,N.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:`w-5 h-5`,children:(0,N.jsx)(`path`,{d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`})})},{label:`Instagram`,href:`https://www.instagram.com/homeboost.tips`,icon:(0,N.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:`w-5 h-5`,children:(0,N.jsx)(`path`,{d:`M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z`})})},{label:`TikTok`,href:`https://www.tiktok.com/@homeboost.tips`,icon:(0,N.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:`w-5 h-5`,children:(0,N.jsx)(`path`,{d:`M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z`})})},{label:`LinkedIn`,href:`https://www.linkedin.com/company/homeboost`,icon:(0,N.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:`w-5 h-5`,children:(0,N.jsx)(`path`,{d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`})})},{label:`YouTube`,href:`https://www.youtube.com/@HomeBoost_tips/shorts`,icon:(0,N.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:`w-5 h-5`,children:(0,N.jsx)(`path`,{d:`M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`})})}],eu=()=>(0,N.jsx)(`footer`,{className:`bg-brand-dark text-background`,children:(0,N.jsxs)(`div`,{className:`container-narrow 
3section-padding`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-8 mb-12`,children:[(0,N.jsxs)(`div`,{className:`col-span-2 md:col-span-1`,children:[(0,N.jsx)(`div`,{className:`mb-4`,children:(0,N.jsx)(`img`,{src:_l,alt:`HomeBoost`,className:`h-5 brightness-0 invert`})}),(0,N.jsx)(`p`,{className:`text-sm opacity-60 leading-relaxed mb-4`,children:`We tackle energy affordability.`}),(0,N.jsx)(`div`,{className:`flex items-center gap-3`,children:$l.map(e=>(0,N.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,"aria-label":e.label,className:`opacity-50 hover:opacity-100 transition-opacity`,children:e.icon},e.label))})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`font-semibold text-sm mb-3 opacity-80`,children:`For Homeowners`}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-0`,children:[(0,N.jsx)(F,{to:`/homeowners`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`DIY Energy Assessment`}),(0,N.jsx)(F,{to:`/how-it-works`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`How It Works`}),(0,N.jsx)(F,{to:`/home-energy-audit-savings`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`Audit Savings Calculator`}),(0,N.jsx)(`a`,{href:`https://www.homeboost.com/products/boostbox`,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`Order DIY Kit`})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`font-semibold text-sm mb-3 opacity-80`,children:`Partners`}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-0`,children:[(0,N.jsx)(F,{to:`/utilities`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`For Utilities`}),(0,N.jsx)(F,{to:`/coops`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`For Co-ops`}),(0,N.jsx)(F,{to:`/pro`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`For Pros`}),(0,N.jsx)(`a`,{href:`https://partners.homeboost.com/book-a-demo`,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`Book a Demo`})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`font-semibold text-sm mb-3 opacity-80`,children:`Company`}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-0`,children:[(0,N.jsx)(F,{to:`/about-us`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`About Us`}),(0,N.jsx)(F,{to:`/blog`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`Blog`}),(0,N.jsx)(F,{to:`/news`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`In the News`}),(0,N.jsx)(F,{to:`/policies/contact-information`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`Contact Us`}),(0,N.jsx)(`a`,{href:`https://www.homeboost.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm min-h-[48px] md:min-h-0 md:py-1 flex items-center opacity-50 hover:opacity-100 transition-opacity`,children:`homeboost.com`})]})]})]}),(0,N.jsxs)(`div`,{className:`border-t border-background/10 pt-6 flex flex-col md:flex-row justify-between items-center gap-4`,children:[(0,N.jsxs)(`p`,{className:`text-sm opacity-40`,children:[`© `,new Date().getFullYear(),` HomeBoost. All rights reserved.`]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 md:gap-4`,children:[(0,N.jsx)(F,{to:`/policies/privacy-policy`,className:`text-sm min-h-[48px] md:min-
3h-0 flex items-center opacity-40 hover:opacity-80 transition-opacity px-1`,children:`Privacy Policy`}),(0,N.jsx)(F,{to:`/policies/terms-of-service`,className:`text-sm min-h-[48px] md:min-h-0 flex items-center opacity-40 hover:opacity-80 transition-opacity px-1`,children:`Terms of Service`}),(0,N.jsx)(F,{to:`/policies/refund-policy`,className:`text-sm min-h-[48px] md:min-h-0 flex items-center opacity-40 hover:opacity-80 transition-opacity px-1`,children:`Refund Policy`}),(0,N.jsx)(F,{to:`/policies/cancellation-policy`,className:`text-sm min-h-[48px] md:min-h-0 flex items-center opacity-40 hover:opacity-80 transition-opacity px-1`,children:`Cancellation Policy`}),(0,N.jsx)(`button`,{type:`button`,onClick:Zl,className:`text-sm min-h-[48px] md:min-h-0 flex items-center opacity-40 hover:opacity-80 transition-opacity px-1 text-left`,children:`Manage Cookies`}),(0,N.jsx)(F,{to:`/security`,className:`text-sm min-h-[48px] md:min-h-0 flex items-center opacity-40 hover:opacity-80 transition-opacity px-1`,children:`Security`})]})]})]})}),tu=({to:e})=>((0,M.useEffect)(()=>{let t=window.setTimeout(()=>{window.location.pathname!==e&&window.location.replace(e)},50);return()=>window.clearTimeout(t)},[e]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(c,{children:[(0,N.jsx)(`meta`,{httpEquiv:`refresh`,content:`0; url=${e}`}),(0,N.jsx)(`link`,{rel:`canonical`,href:e}),(0,N.jsx)(`meta`,{name:`robots`,content:`noindex, follow`})]}),(0,N.jsxs)(`main`,{className:`container-narrow px-6 md:px-8 py-16`,children:[(0,N.jsx)(`h1`,{className:`text-2xl font-semibold mb-4`,children:`Redirecting…`}),(0,N.jsxs)(`p`,{className:`text-base`,children:[`This page has moved.`,` `,(0,N.jsxs)(`a`,{href:e,className:`underline text-primary`,children:[`Continue to `,e]}),`.`]})]}),(0,N.jsx)(An,{to:e,replace:!0})]})),nu=(0,M.createContext)({});function ru(e){let t=(0,M.useRef)(null);return t.current===null&&(t.current=e()),t.current}var iu=typeof window<`u`?M.useLayoutEffect:M.useEffect,au=(0,M.createContext)(null);function ou(e,t){e.indexOf(t)===-1&&e.push(t)}function su(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var cu=(e,t,n)=>n>t?t:n<e?e:n,lu={},uu=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function du(e){return typeof e==`object`&&!!e}var fu=e=>/^0[^.\s]+$/u.test(e);function pu(e){let t;return()=>(t===void 0&&(t=e()),t)}var mu=e=>e,hu=(e,t)=>n=>t(e(n)),gu=(...e)=>e.reduce(hu),_u=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},vu=class{constructor(){this.subscriptions=[]}add(e){return ou(this.subscriptions,e),()=>su(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},yu=e=>e*1e3,bu=e=>e/1e3;function xu(e,t){return t?1e3/t*e:0}var Su=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cu=1e-7,wu=12;function Tu(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Su(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Cu&&++s<wu);return o}function Eu(e,t,n,r){if(e===t&&n===r)return mu;let i=t=>Tu(t,0,1,e,n);return e=>e===0||e===1?e:Su(i(e),t,r)}var Du=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ou=e=>t=>1-e(1-t),ku=Eu(.33,1.53,.69,.99),Au=Ou(ku),ju=Du(Au),Mu=e=>e>=1?1:(e*=2)<1?.5*Au(e):.5*(2-2**(-10*(e-1))),Nu=e=>1-Math.sin(Math.acos(e)),Pu=Ou(Nu),Fu=Du(Nu),Iu=Eu(.42,0,1,1),Lu=Eu(0,0,.58,1),Ru=Eu(.42,0,.58,1),zu=e=>Array.isArray(e)&&typeof e[0]!=`number`,Bu=e=>Array.isArray(e)&&typeof e[0]==`number`,Vu={linear:mu,easeIn:Iu,easeInOut:Ru,easeOut:Lu,circIn:Nu,circInOut:Fu,circOut:Pu,backIn:Au,backInOut:ju,backOut:ku,anticipate:Mu},Hu=e=>typeof e==`string`,Uu=e=>{if(Bu(e)){e.length;let[t,n,r,i]=e;return Eu(t,n,r,i)}else if(Hu(e))return Vu[e],`${e}`,Vu[e];return e},Wu=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Gu={value:null,addProjectionMetrics:null};function Ku(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;
3n=r,r=o,n.forEach(l),t&&Gu.value&&Gu.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var qu=40;function Ju(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Wu.reduce((e,n)=>(e[n]=Ku(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=lu.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,qu),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Wu.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Wu.length;t++)o[Wu[t]].cancel(e)},state:i,steps:o}}var{schedule:I,cancel:Yu,state:Xu,steps:Zu}=Ju(typeof requestAnimationFrame<`u`?requestAnimationFrame:mu,!0),Qu;function $u(){Qu=void 0}var ed={now:()=>(Qu===void 0&&ed.set(Xu.isProcessing||lu.useManualTiming?Xu.timestamp:performance.now()),Qu),set:e=>{Qu=e,queueMicrotask($u)}},td={layout:0,mainThread:0,waapi:0},nd=e=>t=>typeof t==`string`&&t.startsWith(e),rd=nd(`--`),id=nd(`var(--`),ad=e=>id(e)?od.test(e.split(`/*`)[0].trim()):!1,od=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function sd(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var cd={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},ld={...cd,transform:e=>cu(0,1,e)},ud={...cd,default:1},dd=e=>Math.round(e*1e5)/1e5,fd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function pd(e){return e==null}var md=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,hd=(e,t)=>n=>!!(typeof n==`string`&&md.test(n)&&n.startsWith(e)||t&&!pd(n)&&Object.prototype.hasOwnProperty.call(n,t)),gd=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(fd);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},_d=e=>cu(0,255,e),vd={...cd,transform:e=>Math.round(_d(e))},yd={test:hd(`rgb`,`red`),parse:gd(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+vd.transform(e)+`, `+vd.transform(t)+`, `+vd.transform(n)+`, `+dd(ld.transform(r))+`)`};function bd(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var xd={test:hd(`#`),parse:bd,transform:yd.transform},Sd=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Cd=Sd(`deg`),wd=Sd(`%`),L=Sd(`px`),Td=Sd(`vh`),Ed=Sd(`vw`),Dd={...wd,parse:e=>wd.parse(e)/100,transform:e=>wd.transform(e*100)},Od={test:hd(`hsl`,`hue`),parse:gd(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+wd.transform(dd(t))+`, `+wd.transform(dd(n))+`, `+dd(ld.transform(r))+`)`},kd={test:e=>yd.test(e)||xd.test(e)||Od.test(e),parse:e=>yd.test(e)?yd.parse(e):Od.test(e)?Od.parse(e):xd.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?yd.transform(e):Od.transform(e),getAnimatableNone:e=>{let t=kd.parse(e);return t.alpha=0,kd.transform(t)}},Ad=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jd(e){return isNaN(e)&&typeof e==`string`&&(e.match(fd)?.length||0)+(e.match(Ad)?.length||0)>0}var Md=`number`,Nd=`color`,Pd=`var`,Fd=`var(`,Id="${}",Ld=/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 Rd(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Ld,e=>(kd.test(e)?(r.color.push(a),i.push(Nd),n.push(kd.parse(e))):e.startsWith(Fd)?(r.var.push(a),i.push(Pd),n.push(e)):(r.number.push(a),i.push(Md),n.push(parseFloat(e))),++a,Id)).split(Id),indexes:r,types:i}}function zd(e){return Rd(e).values}function Bd({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===Md?i+=dd(r[a]):e===Nd?i+=kd.transform(r[a]):i+=r[a]}return i}}function Vd(e){return Bd(Rd(e))}var Hd=e=>typeof e==`number`?0:kd.test(e)?kd.getAnimatableNone(e):e,Ud=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Hd(e);function Wd(e){let t=Rd(e);return Bd(t)(t.values.map((e,n)=>Ud(e,t.split[n])))}var Gd={test:jd,parse:zd,createTransformer:Vd,getAnimatableNone:Wd};function Kd(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qd({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Kd(s,r,e+1/3),a=Kd(s,r,e),o=Kd(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Jd(e,t){return n=>n>0?t:e}var R=(e,t,n)=>e+(t-e)*n,Yd=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Xd=[xd,yd,Od],Zd=e=>Xd.find(t=>t.test(e));function Qd(e){let t=Zd(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Od&&(n=qd(n)),n}var $d=(e,t)=>{let n=Qd(e),r=Qd(t);if(!n||!r)return Jd(e,t);let i={...n};return e=>(i.red=Yd(n.red,r.red,e),i.green=Yd(n.green,r.green,e),i.blue=Yd(n.blue,r.blue,e),i.alpha=R(n.alpha,r.alpha,e),yd.transform(i))},ef=new Set([`none`,`hidden`]);function tf(e,t){return ef.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function nf(e,t){return n=>R(e,t,n)}function rf(e){return typeof e==`number`?nf:typeof e==`string`?ad(e)?Jd:kd.test(e)?$d:cf:Array.isArray(e)?af:typeof e==`object`?kd.test(e)?$d:of:Jd}function af(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>rf(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function of(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=rf(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function sf(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var cf=(e,t)=>
3{let n=Gd.createTransformer(t),r=Rd(e),i=Rd(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ef.has(e)&&!i.values.length||ef.has(t)&&!r.values.length?tf(e,t):gu(af(sf(r,i),i.values),n):(`${e}${t}`,Jd(e,t))};function lf(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?R(e,t,n):rf(e)(e,t)}var uf=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>I.update(t,e),stop:()=>Yu(t),now:()=>Xu.isProcessing?Xu.timestamp:ed.now()}},df=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},ff=2e4;function pf(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function mf(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(pf(r),ff);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:bu(i)}}var z={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};function hf(e,t){return e*Math.sqrt(1-t*t)}var gf=12;function _f(e,t,n){let r=n;for(let n=1;n<gf;n++)r-=e(r)/t(r);return r}var vf=.001;function yf({duration:e=z.duration,bounce:t=z.bounce,velocity:n=z.velocity,mass:r=z.mass}){let i,a;yu(z.maxDuration);let o=1-t;o=cu(z.minDamping,z.maxDamping,o),e=cu(z.minDuration,z.maxDuration,bu(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=hf(t,o),c=Math.exp(-i);return vf-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=hf(t**2,o);return(-i(t)+vf>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-vf+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=_f(i,a,s);if(e=yu(e),isNaN(c))return{stiffness:z.stiffness,damping:z.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var bf=[`duration`,`bounce`],xf=[`stiffness`,`damping`,`mass`];function Sf(e,t){return t.some(t=>e[t]!==void 0)}function Cf(e){let t={velocity:z.velocity,stiffness:z.stiffness,damping:z.damping,mass:z.mass,isResolvedFromDuration:!1,...e};if(!Sf(e,xf)&&Sf(e,bf))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*cu(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:z.mass,stiffness:i,damping:a}}else{let n=yf({...e,velocity:0});t={...t,...n,mass:z.mass},t.isResolvedFromDuration=!0}return t}function wf(e=z.visualDuration,t=z.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Cf({...n,velocity:-bu(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=bu(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?z.restSpeed.granular:z.restSpeed.default,i||=v?z.restDelta.granular:z.restDelta.default;let y,b,x,S,C,w;if(h<1)x=hf(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>yu(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=yu(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=yu(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(pf(T),ff),t=df(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}wf.applyToOptions=e=>{let t=mf(e,100,wf);return e.ease=t.ease,e.duration=yu(t.duration),e.type=`keyframes`,e};var Tf=5;function Ef(e,t,n){let r=Math.max(t-Tf,0);return xu(n-e(r),t-r)}function Df({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=
3500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=wf({keyframes:[f.value,m(f.value)],velocity:Ef(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Of(e,t,n){let r=[],i=n||lu.mix||lf,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=gu(Array.isArray(t)?t[n]||mu:t,a)),r.push(a)}return r}function kf(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Of(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=_u(e[r],e[r+1],n);return s[r](i)};return n?t=>l(cu(e[0],e[a-1],t)):l}function Af(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=_u(0,t,r);e.push(R(n,1,i))}}function jf(e){let t=[0];return Af(t,e.length-1),t}function Mf(e,t){return e.map(e=>e*t)}function Nf(e,t){return e.map(()=>t||Ru).splice(0,e.length-1)}function Pf({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=zu(r)?r.map(Uu):Uu(r),a={done:!1,value:t[0]},o=kf(Mf(n&&n.length===t.length?n:jf(t),e),t,{ease:Array.isArray(i)?i:Nf(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Ff=e=>e!==null;function If(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Ff),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Lf={decay:Df,inertia:Df,tween:Pf,keyframes:Pf,spring:wf};function Rf(e){typeof e.type==`string`&&(e.type=Lf[e.type])}var zf=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Bf=e=>e/100,Vf=class extends zf{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==ed.now()&&this.tick(ed.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},td.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Rf(e);let{type:t=Pf,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Pf;s!==Pf&&typeof o[0]!=`number`&&(this.mixKeyframes=gu(Bf,lf(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=pf(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=cu(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);
3return S&&p!==Df&&(b.value=If(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return bu(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+bu(e)}get time(){return bu(this.currentTime)}set time(e){e=yu(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Ef(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ed.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=bu(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=uf,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(ed.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,td.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Hf(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Uf=e=>e*180/Math.PI,Wf=e=>Kf(Uf(Math.atan2(e[1],e[0]))),Gf={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Wf,rotateZ:Wf,skewX:e=>Uf(Math.atan(e[1])),skewY:e=>Uf(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Kf=e=>(e%=360,e<0&&(e+=360),e),qf=Wf,Jf=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Yf=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Xf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Jf,scaleY:Yf,scale:e=>(Jf(e)+Yf(e))/2,rotateX:e=>Kf(Uf(Math.atan2(e[6],e[5]))),rotateY:e=>Kf(Uf(Math.atan2(-e[2],e[0]))),rotateZ:qf,rotate:qf,skewX:e=>Uf(Math.atan(e[4])),skewY:e=>Uf(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Zf(e){return e.includes(`scale`)?1:0}function Qf(e,t){if(!e||e===`none`)return Zf(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Xf,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Gf,i=t}if(!i)return Zf(t);let a=r[t],o=i[1].split(`,`).map(ep);return typeof a==`function`?a(o):o[a]}var $f=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Qf(n,t)};function ep(e){return parseFloat(e.trim())}var tp=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],np=new Set(tp),rp=e=>e===cd||e===L,ip=new Set([`x`,`y`,`z`]),ap=tp.filter(e=>!ip.has(e));function op(e){let t=[];return ap.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var sp={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-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:(e,{transform:t})=>Qf(t,`x`),y:(e,{transform:t})=>Qf(t,`y`)};sp.translateX=sp.x,sp.translateY=sp.y;var cp=new Set,lp=!1,up=!1,dp=!1;function fp(){if(up){let e=Array.from(cp).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;
3t.forEach(e=>{let t=op(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}up=!1,lp=!1,cp.forEach(e=>e.complete(dp)),cp.clear()}function pp(){cp.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(up=!0)})}function mp(){dp=!0,pp(),fp(),dp=!1}var hp=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(cp.add(this),lp||(lp=!0,I.read(pp),I.resolveKeyframes(fp))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Hf(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),cp.delete(this)}cancel(){this.state===`scheduled`&&(cp.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},gp=e=>e.startsWith(`--`);function _p(e,t,n){gp(t)?e.style.setProperty(t,n):e.style[t]=n}var vp={};function yp(e,t){let n=pu(e);return()=>vp[t]??n()}var bp=yp(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),xp=yp(()=>{try{document.createElement(`div`).animate({opacity:0}
3,{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Sp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Cp={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Sp([0,.65,.55,1]),circOut:Sp([.55,0,1,.45]),backIn:Sp([.31,.01,.66,-.59]),backOut:Sp([.33,1.53,.69,.99])};function wp(e,t){if(e)return typeof e==`function`?xp()?df(e,t):`ease-out`:Bu(e)?Sp(e):Array.isArray(e)?e.map(e=>wp(e,t)||Cp.easeOut):Cp[e]}function Tp(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=wp(s,i);Array.isArray(d)&&(u.easing=d),Gu.value&&td.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Gu.value&&p.finished.finally(()=>{td.waapi--}),p}function Ep(e){return typeof e==`function`&&`applyToOptions`in e}function Dp({type:e,...t}){return Ep(e)&&xp()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Op=class extends zf{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Dp(e);this.animation=Tp(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=If(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),_p(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return bu(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+bu(e)}get time(){return bu(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=yu(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`f
3inished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&bp()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),mu):r(this)}},kp={anticipate:Mu,backInOut:ju,circInOut:Fu};function Ap(e){return e in kp}function jp(e){typeof e.ease==`string`&&Ap(e.ease)&&(e.ease=kp[e.ease])}var Mp=10,Np=class extends Op{constructor(e){jp(e),Rf(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Vf({...a,autoplay:!1}),s=Math.max(Mp,ed.now()-this.startTime),c=cu(0,Mp,s-Mp),l=o.sample(s).value,{name:u}=this.options;i&&u&&_p(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Pp=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Gd.test(e)||e===`0`)&&!e.startsWith(`url(`));function Fp(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ip(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Pp(i,t),s=Pp(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Fp(e)||(n===`spring`||Ep(n))&&r}function Lp(e){e.duration=0,e.type=`keyframes`}var Rp=new Set([`opacity`,`clipPath`,`filter`,`transform`]),zp=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Bp(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&zp.test(e[t]))return!0;return!1}var Vp=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Hp=pu(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Up(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return Hp()&&n&&(Rp.has(n)||Vp.has(n)&&Bp(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Wp=40,Gp=class extends zf{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ed.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||hp)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=ed.now();let u=!0;Ip(e,i,a,o)||(u=!1,(lu.instantAnimations||!s)&&l?.(If(e,n,t)),e[0]=e[e.length-1],Lp(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Wp?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Up(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Np({...d,element:p})}catch{m=new Vf(d)}else m=new Vf(d);m.finished.then(()=>{this.notifyFinished()}).catch(mu),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),mp()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Kp(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>
3e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var qp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jp(e){let t=qp.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Yp(e,t,n=1){`${e}`;let[r,i]=Jp(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return uu(e)?parseFloat(e):e}return ad(i)?Yp(i,t,n+1):i}var Xp={type:`spring`,stiffness:500,damping:25,restSpeed:10},Zp=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Qp={type:`keyframes`,duration:.8},$p={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},em=(e,{keyframes:t})=>t.length>2?Qp:np.has(e)?e.startsWith(`scale`)?Zp(t[1]):Xp:$p;function tm(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function nm(e,t){let n=e?.[t]??e?.default??e;return n===e?n:tm(n,e)}var rm=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function im(e){for(let t in e)if(!rm.has(t))return!0;return!1}var am=(e,t,n,r={},i,a)=>o=>{let s=nm(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=yu(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};im(s)||Object.assign(u,em(e,u)),u.duration&&=yu(u.duration),u.repeatDelay&&=yu(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Lp(u),u.delay===0&&(d=!0)),(lu.instantAnimations||lu.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Lp(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=If(u.keyframes,s);if(e!==void 0){I.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Vf(u):new Gp(u)};function om(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function sm(e,t,n,r){if(typeof t==`function`){let[i,a]=om(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=om(r);t=t(n===void 0?e.custom:n,i,a)}return t}function cm(e,t,n){let r=e.getProps();return sm(r,t,n===void 0?r.custom:n,e)}var lm=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...tp]),um=30,dm=e=>!isNaN(parseFloat(e)),fm={current:void 0},pm=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=ed.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ed.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=dm(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new vu);let n=this.events[e].add(t);return e===`change`?()=>{n(),I.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return fm.current&&fm.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=ed.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>um)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,um);return xu(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function mm(e,t){return new pm(e,t)}var hm=e=>Array.isArray(e);function gm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,mm(n))}function _m(e){return hm(e)?e[e.length-1]||0:e}function vm(e,t){let{transitionEnd:n={},transition:r={},...i}=cm(e,t)||{};i={...i,...n};for(let t in i)gm(e,t,_m(i[t]))}var ym=e=>!!(e&&e.getVelocity);function bm(e){return!!(ym(e)&&e.add)}function xm(e,t){let n=e.getValue(`willChange`);if(bm(n))return n.add(t);if(!n&&lu.WillChange){let n=new lu.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Sm(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Cm=`data-`+Sm(`framerAppearId`);function wm(e){return e.props[Cm]}function Tm({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Em(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?tm(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&Tm(d,t))continue;let o={delay:n,...nm(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){I.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=wm(e);if(n){let e=window.MotionHandoffAnimation(n,t,I);e!==null&&(o.startTime=e,f=!0)}}xm(e,t);let p=l??e.shouldReduceMotion;r.start(am(t,r,i,p&&lm.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>I.update(()=>{o&&vm(e,o)});u.length?Promise.all(u).then(t):t()}return u}function Dm(e,t,n={}){let r=cm(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Em(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Om(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;
3if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Om(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Dm(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Kp(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function km(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Dm(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Dm(e,t,n);else{let i=typeof t==`function`?cm(e,t,n.custom):t;r=Promise.all(Em(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Am={test:e=>e===`auto`,parse:e=>e},jm=e=>t=>t.test(e),Mm=[cd,L,wd,Cd,Ed,Td,Am],Nm=e=>Mm.find(jm(e));function Pm(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||fu(e)}var Fm=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Im(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(fd)||[];if(!r)return e;let i=n.replace(r,``),a=Fm.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var Lm=/\b([a-z-]*)\(.*?\)/gu,Rm={...Gd,getAnimatableNone:e=>{let t=e.match(Lm);return t?t.map(Im).join(` `):e}},zm={...Gd,getAnimatableNone:e=>{let t=Gd.parse(e);return Gd.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Bm={...cd,transform:Math.round},Vm={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,fontSize:L,backgroundPositionX:L,backgroundPositionY:L,rotate:Cd,rotateX:Cd,rotateY:Cd,rotateZ:Cd,scale:ud,scaleX:ud,scaleY:ud,scaleZ:ud,skew:Cd,skewX:Cd,skewY:Cd,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:ld,originX:Dd,originY:Dd,originZ:L,zIndex:Bm,fillOpacity:ld,strokeOpacity:ld,numOctaves:Bm},Hm={...Vm,color:kd,backgroundColor:kd,outlineColor:kd,fill:kd,stroke:kd,borderColor:kd,borderTopColor:kd,borderRightColor:kd,borderBottomColor:kd,borderLeftColor:kd,filter:Rm,WebkitFilter:Rm,mask:zm,WebkitMask:zm},Um=e=>Hm[e],Wm=new Set([Rm,zm]);function Gm(e,t){let n=Um(e);return Wm.has(n)||(n=Gd),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Km=new Set([`auto`,`none`,`0`]);function qm(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Km.has(t)&&Rd(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Gm(n,i)}var Jm=class extends hp{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),ad(r))){let i=Yp(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!lm.has(n)||e.length!==2)return;let[r,i]=e,a=Nm(r),o=Nm(i);if(sd(r)!==sd(i)&&sp[n]){this.needsMeasurement=!0;return}if(a!==o)if(rp(a)&&rp(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else sp[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Pm(e[t]))&&n.push(t);n.length&&qm(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=sp[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=sp[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEac
3h(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function Ym(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Xm=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Zm(e){return du(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:Qm,cancel:$m}=Ju(queueMicrotask,!1),eh={x:!1,y:!1};function th(){return eh.x||eh.y}function nh(e){return e===`x`||e===`y`?eh[e]?null:(eh[e]=!0,()=>{eh[e]=!1}):eh.x||eh.y?null:(eh.x=eh.y=!0,()=>{eh.x=eh.y=!1})}function rh(e,t){let n=Ym(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ih(e){return!(e.pointerType===`touch`||th())}function ah(e,t,n={}){let[r,i,a]=rh(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!ih(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var oh=(e,t)=>t?e===t?!0:oh(e,t.parentElement):!1,sh=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,ch=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function lh(e){return ch.has(e.tagName)||e.isContentEditable===!0}var uh=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function dh(e){return uh.has(e.tagName)||e.isContentEditable===!0}var fh=new WeakSet;function ph(e){return t=>{t.key===`Enter`&&e(t)}}function mh(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var hh=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ph(()=>{if(fh.has(n))return;mh(n,`down`);let e=ph(()=>{mh(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>mh(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function gh(e){return sh(e)&&!th()}var _h=new WeakSet;function vh(e,t,n={}){let[r,i,a]=rh(e,n),o=e=>{let r=e.currentTarget;if(!gh(e)||_h.has(e))return;fh.add(r),n.stopPropagation&&_h.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),fh.has(r)&&fh.delete(r),gh(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||oh(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Zm(e)&&(e.addEventListener(`focus`,e=>hh(e,i)),!lh(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function yh(e){return du(e)&&`ownerSVGElement`in e}var bh=new WeakMap,xh,Sh=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:yh(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Ch=Sh(`inline`,`width`,`offsetWidth`),wh=Sh(`block`,`height`,`offsetHeight`);function Th({target:e,borderBoxSize:t}){bh.get(e)?.forEach(n=>{n(e,{get width(){return Ch(e,t)},get height(){return wh(e,t)}})})}function Eh(e){e.forEach(Th)}function Dh(){typeof ResizeObserver>`u`||(xh=new ResizeObserver(Eh))}function Oh(e,t){xh||Dh();let n=Ym(e);return n.forEach(e=>{let n=bh.get(e);n||(n=new Set,bh.set(e,n)),n.add(t),xh?.observe(e)}),()=>{n.forEach(e=>{let n=bh.get(e);n?.delete(t),n?.size||xh?.unobserve(e)})}}var kh=new Set,Ah;function jh(){Ah=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};
3kh.forEach(t=>t(e))},window.addEventListener(`resize`,Ah)}function Mh(e){return kh.add(e),Ah||jh(),()=>{kh.delete(e),!kh.size&&typeof Ah==`function`&&(window.removeEventListener(`resize`,Ah),Ah=void 0)}}function Nh(e,t){return typeof e==`function`?Mh(e):Oh(e,t)}function Ph(e){return yh(e)&&e.tagName===`svg`}var Fh=[...Mm,kd,Gd],Ih=e=>Fh.find(jm(e)),Lh=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rh=()=>({x:Lh(),y:Lh()}),zh=()=>({min:0,max:0}),Bh=()=>({x:zh(),y:zh()}),Vh=new WeakMap;function Hh(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Uh(e){return typeof e==`string`||Array.isArray(e)}var Wh=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Gh=[`initial`,...Wh];function Kh(e){return Hh(e.animate)||Gh.some(t=>Uh(e[t]))}function qh(e){return!!(Kh(e)||e.variants)}function Jh(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ym(i))e.addValue(r,i);else if(ym(a))e.addValue(r,mm(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,mm(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Yh={current:null},Xh={current:!1},Zh=typeof window<`u`;function Qh(){if(Xh.current=!0,Zh)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Yh.current=e.matches;e.addEventListener(`change`,t),t()}else Yh.current=!1}var $h=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],eg={};function tg(e){eg=e}function ng(){return eg}var rg=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=hp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=()=>{let e=ed.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,I.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Kh(t),this.isVariantNode=qh(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&ym(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Vh.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Xh.current||Qh(),this.shouldReduceMotion=Yh.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Yu(this.notifyUpdate),Yu(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Rp.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Op({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:yu(o
3)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=np.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&I.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in eg){let t=eg[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Bh()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<$h.length;t++){let n=$h[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Jh(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=mm(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(uu(n)||fu(n))?n=parseFloat(n):!Ih(n)&&Gd.test(t)&&(n=Gm(e,t)),this.setBaseTarget(e,ym(n)?n.get():n)),ym(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=sm(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!ym(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new vu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Qm.render(this.render)}},ig=class extends rg{constructor(){super(...arguments),this.KeyframeResolver=Jm}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ym(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},ag=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function og({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function sg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cg(e,t){if(!t)return e;let 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 lg(e){return e===void 0||e===1}function ug({scale:e,scaleX:t,scaleY:n}){return!lg(e)||!lg(t)||!lg(n)}function dg(e){return ug(e)||fg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function fg(e){return pg(e.x)||pg(e.y)}function pg(e){return e&&e!==`0%`}function mg(e,t,n){return n+t*(e-n)}function hg(e,t,n,r,i){return i!==void 0&&(e=mg(e,i,r)),mg(e,n,r)+t}function gg(e,t=0,n=1,r,i){e.min=hg(e.min,t,n,r,i),e.max=hg(e.max,t,n,r,i)}function _g(e,{x:t,y:n}){gg(e.x,t.translate,t.scale,t.originPoint),gg(e.y,n.translate,n.scale,n.originPoint)}var vg=.999999999999,yg=1.0000000000001;function bg(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(xg(e.x,-a.scroll.offset.x),xg(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,_g(e,o)),r&&dg(a.latestValues)&&wg(e,a.latestValues,a.layout?.layoutBox))}t.x<yg&&t.x>vg&&(t.x=1),t.y<yg&&t.y>vg&&(t.y=1)}function xg(e,t){e.min+=t,e.max+=t}function Sg(e,t,n,r,i=.5){gg(e,t,n,R(e.min,e.max,i),r)}function Cg(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function wg(e,t,n){let r=n??e;Sg(e.x,Cg(t.x,r.x),t.scaleX,t.scale,t.originX),Sg(e.y,Cg(t.y,r.y),t.scaleY,t.scale,t.originY)}function Tg(e,t){return og(cg(e.getBoundingClientRect(),t))}function Eg(e,t,n){let r=Tg(e,n),{scroll:i}=t;return i&&(xg(r.x,i.offset.x),xg(r.y,i.offset.y)),r}var Dg={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Og=tp.length;function kg(e,t,n){let r=``,i=!0;for(let a=0;a<Og;a++){let o=tp[a],s=e[o];if(s===void 0)continue;let c=!0;
3if(typeof s==`number`)c=s===(o.startsWith(`scale`)?1:0);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Xm(s,Vm[o]);if(!c){i=!1;let t=Dg[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ag(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(np.has(e)){o=!0;continue}else if(rd(e)){i[e]=n;continue}else{let t=Xm(n,Vm[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=kg(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function jg(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Mg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ng={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(L.test(e))e=parseFloat(e);else return e;return`${Mg(e,t.target.x)}% ${Mg(e,t.target.y)}%`}},Pg={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Gd.parse(e);if(i.length>5)return r;let a=Gd.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=R(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Fg={borderRadius:{...Ng,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Ng,borderTopRightRadius:Ng,borderBottomLeftRadius:Ng,borderBottomRightRadius:Ng,boxShadow:Pg};function Ig(e,{layout:t,layoutId:n}){return np.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Fg[e]||e===`opacity`)}function Lg(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(ym(r[t])||i&&ym(i[t])||Ig(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Rg(e){return window.getComputedStyle(e)}var zg=class extends ig{constructor(){super(...arguments),this.type=`html`,this.renderInstance=jg}readValueFromInstance(e,t){if(np.has(t))return this.projection?.isProjecting?Zf(t):$f(e,t);{let n=Rg(e),r=(rd(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Tg(e,t)}build(e,t,n){Ag(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Lg(e,t,n)}},Bg={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Vg={offset:`strokeDashoffset`,array:`strokeDasharray`};function Hg(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Bg:Vg;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Ug=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Wg(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ag(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Ug)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Hg(d,i,a,o,!1)}var Gg=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`]),Kg=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function qg(e,t,n,r){jg(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Gg.has(n)?n:Sm(n),t.attrs[n])}function Jg(e,t,n){let r=Lg(e,t,n);for(let n in e)if(ym(e[n])||ym(t[n])){let t=tp.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Yg=class extends ig{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Bh}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(np.has(t)){let e=Um(t);return e&&e.default||0}return t=Gg.has(t)?t:Sm(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Jg(e,t,n)}
3build(e,t,n){Wg(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){qg(e,t,n,r)}mount(e){this.isSVGTag=Kg(e.tagName),super.mount(e)}},Xg=Gh.length;function Zg(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Zg(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Xg;n++){let r=Gh[n],i=e.props[r];(Uh(i)||i===!1)&&(t[r]=i)}return t}function Qg(e,t){if(!Array.isArray(t))return!1;let 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}var $g=[...Wh].reverse(),e_=Wh.length;function t_(e){return t=>Promise.all(t.map(({animation:t,options:n})=>km(e,t,n)))}function n_(e){let t=t_(e),n=a_(),r=!0,i=!1,a=t=>(n,r)=>{let i=cm(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Zg(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<e_;t++){let p=$g[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Uh(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Hh(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=r_(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},ee=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=hm(t)&&hm(n)?!Qg(t,n):t!==n,r?t==null?u.add(e):ee(e):t!==void 0&&u.has(e)?ee(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let te=v&&y;b&&(!te||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!te&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=cm(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Kp(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=cm(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=a_(),i=!0}}}function r_(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Qg(t,e):!1}function i_(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function a_(){return{animate:i_(!0),whileInView:i_(),whileHover:i_(),whileTap:i_(),whileDrag:i_(),whileFocus:i_(),exit:i_()}}function o_(e,t){e.min=t.min,e.max=t.max}function s_(e,t){o_(e.x,t.x),o_(e.y,t.y)}function c_(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var l_=1e-4,u_=1-l_,d_=1+l_,f_=.01,p_=0-f_,m_=0+f_;function h_(e){return e.max-e.min}function g_(e,t,n){return Math.abs(e-t)<=n}function __(e,t,n,r=.5){e.origin=r,e.originPoint=R(t.min,t.max,e.origin),e.scale=h_(n)/h_(t),e.translate=R(n.min,n.max,e.origin)-e.originPoint,(e.scale>=u_&&e.scale<=d_||isNaN(e.scale))&&(e.scale=1),(e.translate>=p_&&e.translate<=m_||isNaN(e.translate))&&(e.translate=0)}function v_(e,t,n,r){__(e.x,t.x,n.x,r?r.originX:void 0),__(e.y,t.y,n.y,r?r.originY:void 0)}function y_(e,t,n,r=0){e.min=(r?R(n.min,n.max,r):n.min)+t.min,e.max=e.min+h_(t)}function b_(e,t,n,r){y_(e.x,t.x,n.x,r?.x),y_(e.y,t.y,n.y,r?.y)}function x_(e,t,n,r=0){let i=r?R(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+h_(t)}function S_(e,t,n,r){x_(e.x,t.x,n.x,r?.x),x_(e.y,t.y,n.y,r?.y)}function C_(e,t,n,r,i){return e-=t,e=mg(e,1/n,r),i!==void 0&&(e=mg(e,1/i,r)),e}function w_(e,t=0,n=1,r=.5,i,a=e,o=e){if(wd.test(t)&&(t=parseFloat(t),t=R(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=R(a.min,a.max,r);e===a&&(s-=t),e.min=C_(e.min,t,n,s,i),e.max=C_(e.max,t,n,s,i)}function T_(e,t,[n,r,i],a,o){w_(e,t[n],t[r],t[i],t.scale,a,o)}var E_=[`x`,`scaleX`,`originX`],D_=[`y`,`scaleY`,`originY`];function O_(e,t,n,r){T_(e.x,t,E_,n?n.x:void 0,r?r.x:void 0),T_(e.y,t,D_,n?n.y:void 0,r?r.y:void 0)}function k_(e){return e.translate===0&&e.scale===1}function A_(e){return k_(e.x)&&k_(e.y)}function j_(e,t){return e.min===t.min&&e.max===t.max}function M_(e,t){return j_(e.x,t.x)&&j_(e.y,t.y)}function N_(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function P_(e,t){return N_(e.x,t.x)&&N_(e.y,t.y)}function F_(e){return h_(e.x)/h_(e.y)}function I_(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function L_(e){return[e(`x`),e(`y`)]}function R_(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var z_=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],B_=z_.length,V_=e=>typeof e==`string`?parseFloat(e):e,H_=e=>typeof e==`number`||L.test(e);function U_(e,t,n,r,i,a){i?(e.opacity=R(0,n.opacity??1,G_(r)),e.o
3pacityExit=R(t.opacity??1,0,K_(r))):a&&(e.opacity=R(t.opacity??1,n.opacity??1,r));for(let i=0;i<B_;i++){let a=z_[i],o=W_(t,a),s=W_(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||H_(o)===H_(s)?(e[a]=Math.max(R(V_(o),V_(s),r),0),(wd.test(s)||wd.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=R(t.rotate||0,n.rotate||0,r))}function W_(e,t){return e[t]===void 0?e.borderRadius:e[t]}var G_=q_(0,.5,Pu),K_=q_(.5,.95,mu);function q_(e,t,n){return r=>r<e?0:r>t?1:n(_u(e,t,r))}function J_(e,t,n){let r=ym(e)?e:mm(e);return r.start(am(``,r,t,n)),r.animation}function Y_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var X_=(e,t)=>e.depth-t.depth,Z_=class{constructor(){this.children=[],this.isDirty=!1}add(e){ou(this.children,e),this.isDirty=!0}remove(e){su(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(X_),this.isDirty=!1,this.children.forEach(e)}};function Q_(e,t){let n=ed.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Yu(r),e(a-t))};return I.setup(r,!0),()=>Yu(r)}function $_(e){return ym(e)?e.get():e}var ev=class{constructor(){this.members=[]}add(e){ou(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(su(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(su(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},tv={hasAnimatedSinceResize:!0,hasEverUpdated:!1},nv={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},rv=[``,`X`,`Y`,`Z`],iv=1e3,av=0;function ov(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function sv(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=wm(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,I,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&sv(r)}function cv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=av++,this.animationId=0,this.animationCommitId=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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Gu.value&&(nv.nodes=nv.calculatedTargetDeltas=nv.calculatedProjections=0),this.nodes.forEach(dv),this.nodes.forEach(bv),this.nodes.forEach(xv),this.nodes.forEach(fv),Gu.addProjectionMetrics&&Gu.addProjectionMetrics(nv)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Z_)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new vu),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=yh(t)&&!Ph(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;I.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Q_(i,250),tv.hasAnimatedSinceResize&&(tv.hasAnimatedSinceResize=!1,this.nodes.forEac
3h(yv)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Ov,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!P_(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...nm(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||yv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Yu(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(Sv),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sv(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(hv),this.nodes.forEach(mv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(gv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(_v),this.nodes.forEach(vv),this.nodes.forEach(lv),this.nodes.forEach(uv)):this.nodes.forEach(gv),this.clearAllSnapshots();let e=ed.now();Xu.delta=cu(0,1e3/60,e-Xu.timestamp),Xu.timestamp=e,Xu.isProcessing=!0,Zu.update.process(Xu),Zu.preRender.process(Xu),Zu.render.process(Xu),Xu.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(pv),this.sharedNodes.forEach(Cv)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,I.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){I.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!h_(this.snapshot.measuredBox.x)&&!h_(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Bh(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!A_(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||dg(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Mv(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Bh();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Pv))){let{scroll:e}=this.root;e&&(xg(t.x,e.offset.x),xg(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Bh();if(s_(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&s_(t,e),xg(t.x,i.offset.x),xg(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Bh();s_(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(xg(r.x,-n.scroll.offset.x),xg(r.y,-n.scroll.offset.y)),dg(n.latestValues)&&wg(r,n.latestValues,n.layout?.layoutBox)}return dg(this.latestValues)&&wg(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Bh();s_(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!dg(n.latestValues))continue;let r;n.instance&&(ug(n.latestValues)&&n.updateSnapshot(),r=Bh(),s_(r,n.measurePageBox())),O_(t,n.latestValues,n.snapshot?.layoutBox,r)}return dg(this.latestValues)&&O_(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}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!==Xu.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;
3if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Xu.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Bh(),this.targetWithTransforms=Bh()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),b_(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):s_(this.target,this.layout.layoutBox),_g(this.target,this.targetDelta)):s_(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Gu.value&&nv.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||ug(this.parent.latestValues)||fg(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Bh(),this.relativeTargetOrigin=Bh(),S_(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),s_(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Xu.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;s_(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;bg(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Bh());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(c_(this.prevProjectionDelta.x,this.projectionDelta.x),c_(this.prevProjectionDelta.y,this.projectionDelta.y)),v_(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!I_(this.projectionDelta.x,this.prevProjectionDelta.x)||!I_(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Gu.value&&nv.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Rh(),this.projectionDelta=Rh(),this.projectionDeltaWithTransform=Rh()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Rh();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=Bh(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Dv));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;wv(a.x,e.x,n),wv(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(S_(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ev(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&M_(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=Bh(),s_(d,this.relativeTarget)),s&&(this.animationValues=i,U_(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Yu(this.pendingAnimation),void 0),this.pendingAnimation=I.update(()=>{tv.hasAnimatedSinceResize=!0,td.layout++,this.motionValue||=mm(0),this.motionValue.jump(0,!1),this.currentAnimation=J_(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{td.layout--},onComplete:()=>{td.layout--,e.onComplete&&e.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);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(iv),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Nv(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Bh();let t=h_(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=h_(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}s_(t,n),wg(t,i),v_(this.projectionDeltaWithTransform,this.layoutCorrected,t,i
3)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ev),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&ov(`z`,e,r,this.animationValues);for(let t=0;t<rv.length;t++)ov(`rotate${rv[t]}`,e,r,this.animationValues),ov(`skew${rv[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=$_(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=$_(t?.pointerEvents)||``),this.hasProjected&&!dg(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=R_(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Fg){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Fg[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?$_(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(mv),this.root.sharedNodes.clear()}}}function lv(e){e.updateLayout()}function uv(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)L_(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=h_(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;o_(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Nv(i,t.layoutBox,n)&&L_(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=h_(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Rh();v_(o,n,t.layoutBox);let s=Rh();a?v_(s,e.applyTransform(r,!0),t.measuredBox):v_(s,n,t.layoutBox);let c=!A_(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Bh();S_(s,t.layoutBox,i.layoutBox,o);let c=Bh();S_(c,n,a.layoutBox,o),P_(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function dv(e){Gu.value&&nv.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function fv(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function pv(e){e.clearSnapshot()}function mv(e){e.clearMeasurements()}function hv(e){e.isLayoutDirty=!0,e.updateLayout()}
3function gv(e){e.isLayoutDirty=!1}function _v(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function vv(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function yv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bv(e){e.resolveTargetDelta()}function xv(e){e.calcProjection()}function Sv(e){e.resetSkewAndRotation()}function Cv(e){e.removeLeadSnapshot()}function wv(e,t,n){e.translate=R(t.translate,0,n),e.scale=R(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Tv(e,t,n,r){e.min=R(t.min,n.min,r),e.max=R(t.max,n.max,r)}function Ev(e,t,n,r){Tv(e.x,t.x,n.x,r),Tv(e.y,t.y,n.y,r)}function Dv(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Ov={duration:.45,ease:[.4,0,.1,1]},kv=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Av=kv(`applewebkit/`)&&!kv(`chrome/`)?Math.round:mu;function jv(e){e.min=Av(e.min),e.max=Av(e.max)}function Mv(e){jv(e.x),jv(e.y)}function Nv(e,t,n){return e===`position`||e===`preserve-aspect`&&!g_(F_(t),F_(n),.2)}function Pv(e){return e!==e.root&&e.scroll?.wasRoot}var Fv=cv({attachResizeListener:(e,t)=>Y_(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Iv={current:void 0},Lv=cv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Iv.current){let e=new Fv({});e.mount(window),e.setOptions({layoutScroll:!0}),Iv.current=e}return Iv.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Rv=(0,M.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function zv(e=!0){let t=(0,M.useContext)(au);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,M.useId)();(0,M.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,M.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Bv=(0,M.createContext)({strict:!1}),Vv={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`]},Hv=!1;function Uv(){if(Hv)return;let e={};for(let t in Vv)e[t]={isEnabled:e=>Vv[t].some(t=>!!e[t])};tg(e),Hv=!0}function Wv(){return Uv(),ng()}function Gv(e){let t=Wv();for(let n in e)t[n]={...t[n],...e[n]};tg(t)}var Kv=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.propagate.ignoreStrict.viewport`.split(`.`));function qv(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Kv.has(e)}var Jv=s({default:()=>Yv}),Yv,Xv=a((()=>{throw Yv={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),Zv=e=>!qv(e);function Qv(e){typeof e==`function`&&(Zv=t=>t.startsWith(`on`)?!qv(t):e(t))}try{Qv((Xv(),t(Jv)).default)}catch{}function $v(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||ym(e[i])||(Zv(i)||n===!0&&qv(i)||!t&&!qv(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var ey=(0,M.createContext)({});function ty(e,t){if(Kh(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Uh(t)?t:void 0,animate:Uh(n)?n:void 0}}return e.inherit===!1?{}:t}function ny(e){let{initial:t,animate:n}=ty(e,(0,M.useContext)(ey));return(0,M.useMemo)(()=>({initial:t,animate:n}),[ry(t),ry(n)])}function ry(e){return Array.isArray(e)?e.join(` `):e}var iy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});
3function ay(e,t,n){for(let r in t)!ym(t[r])&&!Ig(r,n)&&(e[r]=t[r])}function oy({transformTemplate:e},t){return(0,M.useMemo)(()=>{let n=iy();return Ag(n,t,e),Object.assign({},n.vars,n.style)},[t])}function sy(e,t){let n=e.style||{},r={};return ay(r,n,e),Object.assign(r,oy(e,t)),r}function cy(e,t){let n={},r=sy(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}var ly=()=>({...iy(),attrs:{}});function uy(e,t,n,r){let i=(0,M.useMemo)(()=>{let n=ly();return Wg(n,t,Kg(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};ay(t,e.style,e),i.style={...t,...i.style}}return i}var dy=[`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 fy(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(dy.indexOf(e)>-1||/[A-Z]/u.test(e))}function py(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??fy(e)?uy:cy)(t,r,i,e),c=$v(t,typeof e==`string`,a),l=e===M.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,M.useMemo)(()=>ym(u)?u.get():u,[u]);return(0,M.createElement)(e,{...l,children:d})}function my({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:hy(n,r,i,e),renderState:t()}}function hy(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=$_(a[e]);let{initial:o,animate:s}=e,c=Kh(e),l=qh(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Hh(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=sm(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var gy=e=>(t,n)=>{let r=(0,M.useContext)(ey),i=(0,M.useContext)(au),a=()=>my(e,t,r,i);return n?a():ru(a)},_y=gy({scrapeMotionValuesFromProps:Lg,createRenderState:iy}),vy=gy({scrapeMotionValuesFromProps:Jg,createRenderState:ly}),yy=Symbol.for(`motionComponentSymbol`);function by(e,t,n){let r=(0,M.useRef)(n);(0,M.useInsertionEffect)(()=>{r.current=n});let i=(0,M.useRef)(null);return(0,M.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var xy=(0,M.createContext)({});function Sy(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Cy(e,t,n,r,i,a){let{visualElement:o}=(0,M.useContext)(ey),s=(0,M.useContext)(Bv),c=(0,M.useContext)(au),l=(0,M.useContext)(Rv),u=l.reducedMotion,d=l.skipAnimations,f=(0,M.useRef)(null),p=(0,M.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,M.useContext)(xy);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&wy(f.current,n,i,h);let g=(0,M.useRef)(!1);(0,M.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Cm],v=(0,M.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return iu(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,M.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function wy(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Ty(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Sy(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Ty(e){if(e)return e.options.allowProjection===!1?Ty(e.parent):e.projection}function Ey(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Gv(r);
3let a=n?n===`svg`:fy(e),o=a?vy:_y;function s(n,s){let c,l={...(0,M.useContext)(Rv),...n,layoutId:Dy(n)},{isStatic:u}=l,d=ny(n),f=o(n,u);if(!u&&typeof window<`u`){Oy(l,r);let t=ky(l);c=t.MeasureLayout,d.visualElement=Cy(e,f,l,i,t.ProjectionNode,a)}return(0,N.jsxs)(ey.Provider,{value:d,children:[c&&d.visualElement?(0,N.jsx)(c,{visualElement:d.visualElement,...l}):null,py(e,n,by(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,M.forwardRef)(s);return c[yy]=e,c}function Dy({layoutId:e}){let t=(0,M.useContext)(nu).id;return t&&e!==void 0?t+`-`+e:e}function Oy(e,t){(0,M.useContext)(Bv).strict}function ky(e){let{drag:t,layout:n}=Wv();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Ay(e,t){if(typeof Proxy>`u`)return Ey;let n=new Map,r=(n,r)=>Ey(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Ey(a,void 0,e,t)),n.get(a))})}var jy=(e,t)=>t.isSVG??fy(e)?new Yg(t):new zg(t,{allowProjection:e!==M.Fragment}),My=class extends ag{constructor(e){super(e),e.animationState||=n_(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Hh(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Ny=0,Py={animation:{Feature:My},exit:{Feature:class extends ag{constructor(){super(...arguments),this.id=Ny++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=cm(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Fy(e){return{point:{x:e.pageX,y:e.pageY}}}var Iy=e=>t=>sh(t)&&e(t,Fy(t));function Ly(e,t,n,r){return Y_(e,t,Iy(n),r)}var Ry=({current:e})=>e?e.ownerDocument.defaultView:null,zy=(e,t)=>Math.abs(e-t);function By(e,t){let n=zy(e.x,t.x),r=zy(e.y,t.y);return Math.sqrt(n**2+r**2)}var Vy=new Set([`auto`,`scroll`]),Hy=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Uy(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Gy(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=By(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Xu;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Uy(t,this.transformPagePoint),I.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Gy(e.type===`pointercancel`?this.lastMoveEventInfo:Uy(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!sh(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Uy(Fy(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Xu;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Gy(s,this.history)),this.removeListeners=gu(Ly(this.contextWindow,`pointermove`,this.handlePointerMove),Ly(this.contextWindow,`pointerup`,this.handlePointerUp),Ly(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Vy.has(e.overflowX)||Vy.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),I.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Yu(this.updatePoint)}};function Uy(e,t){return t?{point:t(e.point)}:e}function Wy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Gy({point:e},t){return{point:e,delta:Wy(e,qy(t)),offset:Wy(e,Ky(t)),velocity:Jy(t,.1)}}function Ky(e){return e[0]}function qy(e){return e[e.length-1]}function Jy(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=qy(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>yu(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>yu(t)*2&&(r=e[1]);let a=bu(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Yy(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?R(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?R(n,e,r.max):Math.min(e,n)),e}function Xy(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Zy(e,{top:t,left:n,bottom:r,right:i}){return{x:Xy(e.x,n,i),y:Xy(e.y,t,r)}}function Qy(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 $y(e,t){return{x:Qy(e.x,t.x),y:Qy(e.y,t.y)}}function eb(e,t){let n=.5,r=h_(e),i=h_(t);return i>r?n=_u(t.min,t.max-r,e.min):r>i&&(n=_u(e.min,e.max-i,t.min)),cu(0,1,n)}function tb(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var nb=.35;function rb(e=nb){return e===!1?e=0:e===!0&&(e=nb),{x:ib(e,`left`,`right`),y:ib(e,`top`,`bottom`)}}function ib(e,t,n){return{min:ab(e,t),max:ab(e,n)}}function ab(e,t){return typeof e==`number`?e:e[t]||0}var ob=new WeakMap,sb=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Bh(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Fy(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=nh(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),L_(e=>{let t=this.getAxisMotionValue(e).get()||0;if(wd.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=h_(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&I.update(()=>i(e,t),!1,!0),xm(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=db(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&I.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Hy(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Ry(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&I.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!ub(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Yy(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Sy(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Zy(n.layoutBox,e):this.constraints=!1,this.elastic=rb(t),r!==this.constraints&&!Sy(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&L_(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=tb(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Sy(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Eg(n,r.root,this.visualElement.getTransformPagePoint()),a=$y(r.layout.layoutBox,i);if(t){let e=t(sg(a));this.hasMutatedConstraints=!!e,e&&(a=og(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=L_(o=>{if(!ub(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return xm(this.visualElement,e),n.start(am(e,n,0,t,this.visualElement,!1))}stopAnimation(){L_(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){L_(t=>{let{drag:n}=this.getProps();if(!ub(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-R(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Sy(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};L_(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=eb({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),L_(t=>{if(!ub(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(R(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ob.set(this.visualElement,this);let e=this.visualElement.current,t=Ly(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&dh(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Sy(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=lb(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),I.read(r);let o=Y_(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(L_(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=nb,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function cb(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function lb(e,t,n){let r=Nh(e,cb(n)),i=Nh(t,cb(n));return()=>{r(),i()}}function ub(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function db(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var fb=class extends ag{constructor(e){super(e),this.removeGroupControls=mu,this.removeListeners=mu,this.controls=new sb(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mu}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},pb=e=>(t,n)=>{e&&I.update(()=>e(t,n),!1,!0)},mb=class extends ag{constructor(){super(...arguments),this.removePointerDownListener=mu}onPointerDown(e){this.session=new Hy(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ry(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:pb(e),onStart:pb(t),onMove:pb(n),onEnd:(e,t)=>{delete this.session,r&&I.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Ly(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},hb=!1,gb=class extends M.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),hb&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{t
3his.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),tv.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),hb=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||I.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Qm.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;hb=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function _b(e){let[t,n]=zv(),r=(0,M.useContext)(nu);return(0,N.jsx)(gb,{...e,layoutGroup:r,switchLayoutGroup:(0,M.useContext)(xy),isPresent:t,safeToRemove:n})}var vb={pan:{Feature:mb},drag:{Feature:fb,ProjectionNode:Lv,MeasureLayout:_b}};function yb(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&I.postRender(()=>i(t,Fy(t)))}var bb=class extends ag{mount(){let{current:e}=this.node;e&&(this.unmount=ah(e,(e,t)=>(yb(this.node,t,`Start`),e=>yb(this.node,e,`End`))))}unmount(){}},xb=class extends ag{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!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=gu(Y_(this.node.current,`focus`,()=>this.onFocus()),Y_(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Sb(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&I.postRender(()=>i(t,Fy(t)))}var Cb=class extends ag{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=vh(e,(e,t)=>(Sb(this.node,t,`Start`),(e,{success:t})=>Sb(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},wb=new WeakMap,Tb=new WeakMap,Eb=e=>{let t=wb.get(e.target);t&&t(e)},Db=e=>{e.forEach(Eb)};function Ob({root:e,...t}){let n=e||document;Tb.has(n)||Tb.set(n,{});let r=Tb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Db,{root:e,...t})),r[i]}function kb(e,t,n){let r=Ob(t);return wb.set(e,n),r.observe(e),()=>{wb.delete(e),r.unobserve(e)}}var Ab={some:0,all:1},jb=class extends ag{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ab[r]};this.stopObserver=kb(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Mb(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Mb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Nb={inView:{Feature:jb},tap:{Feature:Cb},focus:{Feature:xb},hover:{Feature:bb}},Pb={layout:{ProjectionNode:Lv,MeasureLayout:_b}},Fb=Ay({...Py,...Nb,...vb,...Pb},jy),Ib=M.forwardRef(({className:e,type:t,...n},r)=>(0,N.jsx)(`input`,{type:t,className:w(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base 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 md:text-sm`,e),ref:r,...n}));Ib.displayName=`Input`;var Lb=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(`textarea`,{className:w(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
3ing-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`,e),ref:n,...t}));Lb.displayName=`Textarea`;var Rb=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=b(`Primitive.${t}`),r=M.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,N.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),zb=`Label`,Bb=M.forwardRef((e,t)=>(0,N.jsx)(Rb.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Bb.displayName=zb;var Vb=Bb,Hb=C(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Ub=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(Vb,{ref:n,className:w(Hb(),e),...t}));Ub.displayName=Vb.displayName;function Wb(e,[t,n]){return Math.min(n,Math.max(t,e))}var Gb=0;function Kb(){M.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??qb()),document.body.insertAdjacentElement(`beforeend`,e[1]??qb()),Gb++,()=>{Gb===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Gb--}},[])}function qb(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Jb=`focusScope.autoFocusOnMount`,Yb=`focusScope.autoFocusOnUnmount`,Xb={bubbles:!1,cancelable:!0},Zb=`FocusScope`,Qb=M.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=M.useState(null),l=Hr(i),d=Hr(a),f=M.useRef(null),p=y(t,e=>c(e)),m=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:ax(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ax(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ax(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),M.useEffect(()=>{if(s){ox.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Jb,Xb);s.addEventListener(Jb,l),s.dispatchEvent(t),t.defaultPrevented||($b(lx(tx(s)),{select:!0}),document.activeElement===e&&ax(s))}return()=>{s.removeEventListener(Jb,l),setTimeout(()=>{let t=new CustomEvent(Yb,Xb);s.addEventListener(Yb,d),s.dispatchEvent(t),t.defaultPrevented||ax(e??document.body,{select:!0}),s.removeEventListener(Yb,d),ox.remove(m)},0)}}},[s,l,d,m]);let h=M.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ex(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ax(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ax(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,N.jsx)(u.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})});Qb.displayName=Zb;function $b(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ax(r,{select:t}),document.activeElement!==n)return}function ex(e){let t=tx(e);return[nx(t,e),nx(t.reverse(),e)]}function tx(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nx(e,t){for(let n of e)if(!rx(n,{upTo:t}))return n}function rx(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 ix(e){return e instanceof HTMLInputElement&&`select`in e}function ax(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ix(e)&&t&&e.select()}}var ox=sx();function sx(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=cx(e,t),e.unshift(t)},remove(t){e=cx(e,t),e[0]?.resume()}}}function cx(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lx(e){return e.filter(e=>e.tagName!==`A`)}
vendor: 4,141 bytes, line 3
3function ux(e){let t=dx(e),n=M.forwardRef((e,n)=>{let{children:r,...i}=e,a=M.Children.toArray(r),o=a.find(px);if(o){let e=o.props.children,r=a.map(t=>t===o?M.Children.count(e)>1?M.Children.only(null):M.isValidElement(e)?e.props.children:null:t);return(0,N.jsx)(t,{...i,ref:n,children:M.isValidElement(e)?M.cloneElement(e,void 0,r):null})}return(0,N.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function dx(e){let t=M.forwardRef((e,t)=>{let{children:n,...r}=e;if(M.isValidElement(n)){let e=hx(n),i=mx(r,n.props);return n.type!==M.Fragment&&(i.ref=t?x(t,e):e),M.cloneElement(n,i)}return M.Children.count(n)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fx=Symbol(`radix.slottable`);function px(e){return M.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===fx}function mx(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function hx(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gx=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},_x=new WeakMap,vx=new WeakMap,yx={},bx=0,xx=function(e){return e&&(e.host||xx(e.parentNode))},Sx=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=xx(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Cx=function(e,t,n,r){var i=Sx(t,Array.isArray(e)?e:[e]);yx[n]||(yx[n]=new WeakMap);var a=yx[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(_x.get(e)||0)+1,l=(a.get(e)||0)+1;_x.set(e,c),a.set(e,l),o.push(e),c===1&&i&&vx.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),bx++,function(){o.forEach(function(e){var t=_x.get(e)-1,i=a.get(e)-1;_x.set(e,t),a.set(e,i),t||(vx.has(e)||e.removeAttribute(r),vx.delete(e)),i||e.removeAttribute(n)}),bx--,bx||(_x=new WeakMap,_x=new WeakMap,vx=new WeakMap,yx={})}},wx=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||gx(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Cx(r,i,n,`aria-hidden`)):function(){return null}},Tx=`right-scroll-bar-position`,Ex=`width-before-scroll-bar`,Dx=`with-scroll-bars-hidden`,Ox=`--removed-body-scroll-bar-size`;function kx(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ax(e,t){var n=(0,M.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var jx=typeof window<`u`?M.useLayoutEffect:M.useEffect,Mx=new WeakMap;function Nx(e,t){var n=Ax(t||null,function(t){return e.forEach(function(e){return kx(e,t)})});return jx(function(){var t=Mx.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||kx(e,null)}),i.forEach(function(e){r.has(e)||kx(e,a)})}Mx.set(n,e)},[e]),n}function Px(e){return e}function Fx(e,t){t===void 0&&(t=Px);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;
vendor: 7,476 bytes, lines 3-43
3n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ix(e){e===void 0&&(e={});var t=Fx(null);return t.options=D({async:!0,ssr:!1},e),t}var Lx=function(e){var t=e.sideCar,n=E(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return M.createElement(r,D({},n))};Lx.isSideCarExport=!0;function Rx(e,t){return e.useMedium(t),Lx}var zx=Ix(),Bx=function(){},Vx=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:Bx,onWheelCapture:Bx,onTouchMoveCapture:Bx}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=E(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Nx([n,t]),C=D(D({},b),i);return M.createElement(M.Fragment,null,u&&M.createElement(x,{sideCar:zx,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?M.cloneElement(M.Children.only(s),D(D({},C),{ref:S})):M.createElement(v,D({},C,{className:c,ref:S}),s))});Vx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Vx.classNames={fullWidth:Ex,zeroRight:Tx};var Hx,Ux=function(){if(Hx)return Hx;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Wx(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ux();return t&&e.setAttribute(`nonce`,t),e}function Gx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Kx(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var qx=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wx())&&(Gx(t,n),Kx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jx=function(){var e=qx();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Yx=function(){var e=Jx();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Xx={left:0,top:0,right:0,gap:0},Zx=function(e){return parseInt(e||``,10)||0},Qx=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Zx(n),Zx(r),Zx(i)]},$x=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Xx;var t=Qx(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])}},eS=Yx(),tS=`data-scroll-locked`,nS=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
4  .${Dx} {
5   overflow: hidden ${r};
6   padding-right: ${s}px ${r};
7  }
8  body[${tS}] {
9    overflow: hidden ${r};
10    overscroll-behavior: contain;
11    ${[t&&`position: relative ${r};`,n===`margin`&&`
12    padding-left: ${i}px;
13    padding-top: ${a}px;
14    padding-right: ${o}px;
15    margin-left:0;
16    margin-top:0;
17    margin-right: ${s}px ${r};
18    `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
19  }
20  
21  .${Tx} {
22    right: ${s}px ${r};
23  }
24  
25  .${Ex} {
26    margin-right: ${s}px ${r};
27  }
28  
29  .${Tx} .${Tx} {
30    right: 0 ${r};
31  }
32  
33  .${Ex} .${Ex} {
34    margin-right: 0 ${r};
35  }
36  
37  body[${tS}] {
38    ${Ox}: ${s}px;
39  }
40`},rS=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},iS=function(){M.useEffect(function(){return document.body.setAttribute(tS,(rS()+1).toString()),function(){var e=rS()-1;e<=0?document.body.removeAttribute(tS):document.body.setAttribute(tS,e.toString())}},[])},aS=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;iS();var a=M.useMemo(function(){return $x(i)},[i]);return M.createElement(eS,{styles:nS(a,!t,i,n?``:`!important`)})},oS=!1;if(typeof window<`u`)try{var sS=Object.defineProperty({},`passive`,{get:function(){return oS=!0,!0}});window.addEventListener(`test`,sS,sS),window.removeEventListener(`test`,sS,sS)}catch{oS=!1}var cS=oS?{passive:!1}:!1,lS=function(e){return e.tagName===`TEXTAREA`},uS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!lS(e)&&n[t]===`visible`)},dS=function(e){return uS(e,`overflowY`)},fS=function(e){return uS(e,`overflowX`)},pS=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),gS(e,r)){var i=_S(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mS=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},hS=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},gS=function(e,t){return e===`v`?dS(t):fS(t)},_S=function(e,t){return e===`v`?mS(t):hS(t)},vS=function(e,t){return e===`h`&&t===`rtl`?-1:1},yS=function(e,t,n,r,i){var a=vS(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=_S(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&gS(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},bS=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xS=function(e){return[e.deltaX,e.deltaY]},SS=function(e){return e&&`current`in e?e.current:e},CS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wS=function(e){return`
41  .block-interactivity-${e} {pointer-events: none;}
42  .allow-interactivity-${e} {pointer-events: all;}
43`},TS=0,ES=[];function DS(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(TS++)[0],a=M.useState(Yx)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ee([e.lockRef.current],(e.shards||[]).map(SS),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=M.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=bS(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=pS(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=pS(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return yS(h,t,e,h===`h`?s:c,!0)},[]),c=M.useCallback(function(e){var n=e;if(!(!ES.length||ES[ES.length-1]!==a)){var r=`deltaY`in n?xS(n):bS(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&CS(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}
vendor: 4,124 bytes, line 43
43if(!i){var c=(o.current.shards||[]).map(SS).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=M.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:OS(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=M.useCallback(function(e){n.current=bS(e),r.current=void 0},[]),d=M.useCallback(function(t){l(t.type,xS(t),t.target,s(t,e.lockRef.current))},[]),f=M.useCallback(function(t){l(t.type,bS(t),t.target,s(t,e.lockRef.current))},[]);M.useEffect(function(){return ES.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,cS),document.addEventListener(`touchmove`,c,cS),document.addEventListener(`touchstart`,u,cS),function(){ES=ES.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,cS),document.removeEventListener(`touchmove`,c,cS),document.removeEventListener(`touchstart`,u,cS)}},[]);var p=e.removeScrollBar,m=e.inert;return M.createElement(M.Fragment,null,m?M.createElement(a,{styles:wS(i)}):null,p?M.createElement(aS,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function OS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var kS=Rx(zx,DS),AS=M.forwardRef(function(e,t){return M.createElement(Vx,D({},e,{ref:t,sideCar:kS}))});AS.classNames=Vx.classNames;var jS=[` `,`Enter`,`ArrowUp`,`ArrowDown`],MS=[` `,`Enter`],NS=`Select`,[PS,FS,IS]=_(NS),[LS,RS]=d(NS,[IS,uc]),zS=uc(),[BS,VS]=LS(NS),[HS,US]=LS(NS),WS=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:h}=e,_=zS(t),[y,b]=M.useState(null),[x,S]=M.useState(null),[C,w]=M.useState(!1),T=v(l),[ee,te]=g({prop:r,defaultProp:i??!1,onChange:a,caller:NS}),[E,D]=g({prop:o,defaultProp:s,onChange:c,caller:NS}),O=M.useRef(null),k=y?h||!!y.closest(`form`):!0,[A,ne]=M.useState(new Set),re=Array.from(A).map(e=>e.props.value).join(`;`);return(0,N.jsx)(Ec,{..._,children:(0,N.jsxs)(BS,{required:p,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:m(),value:E,onValueChange:D,open:ee,onOpenChange:te,dir:T,triggerPointerDownPosRef:O,disabled:f,children:[(0,N.jsx)(PS.Provider,{scope:t,children:(0,N.jsx)(HS,{scope:e.__scopeSelect,onNativeOptionAdd:M.useCallback(e=>{ne(t=>new Set(t).add(e))},[]),onNativeOptionRemove:M.useCallback(e=>{ne(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),k?(0,N.jsxs)(zC,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:E,onChange:e=>D(e.target.value),disabled:f,form:h,children:[E===void 0?(0,N.jsx)(`option`,{value:``}):null,Array.from(A)]},re):null]})})};WS.displayName=NS;var GS=`SelectTrigger`,KS=M.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=zS(n),o=VS(GS,n),s=o.disabled||r,c=y(t,o.onTriggerChange),l=FS(n),d=M.useRef(`touch`),[f,m,h]=VC(e=>{let t=l().filter(e=>!e.disabled),n=HC(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,N.jsx)(Dc,{asChild:!0,...a,children:(0,N.jsx)(u.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":BC(o.value)?``:void 0,...i,ref:c,onClick:p(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:p(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:p(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&jS.includes(e.ke
vendor: 15,081 bytes, line 43
43y)&&(g(),e.preventDefault())})})})});KS.displayName=GS;var qS=`SelectValue`,JS=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=VS(qS,n),{onValueNodeHasChildrenChange:l}=c,d=a!==void 0,p=y(t,c.onValueNodeChange);return f(()=>{l(d)},[l,d]),(0,N.jsx)(u.span,{...s,ref:p,style:{pointerEvents:`none`},children:BC(c.value)?(0,N.jsx)(N.Fragment,{children:o}):a})});JS.displayName=qS;var YS=`SelectIcon`,XS=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,N.jsx)(u.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});XS.displayName=YS;var ZS=`SelectPortal`,QS=e=>(0,N.jsx)(oi,{asChild:!0,...e});QS.displayName=ZS;var $S=`SelectContent`,eC=M.forwardRef((e,t)=>{let n=VS($S,e.__scopeSelect),[r,i]=M.useState();if(f(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?rt.createPortal((0,N.jsx)(nC,{scope:e.__scopeSelect,children:(0,N.jsx)(PS.Slot,{scope:e.__scopeSelect,children:(0,N.jsx)(`div`,{children:e.children})})}),t):null}return(0,N.jsx)(oC,{...e,ref:t})});eC.displayName=$S;var tC=10,[nC,rC]=LS($S),iC=`SelectContentImpl`,aC=ux(`SelectContent.RemoveScroll`),oC=M.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_,...v}=e,b=VS($S,n),[x,S]=M.useState(null),[C,w]=M.useState(null),T=y(t,e=>S(e)),[ee,te]=M.useState(null),[E,D]=M.useState(null),O=FS(n),[k,A]=M.useState(!1),ne=M.useRef(!1);M.useEffect(()=>{if(x)return wx(x)},[x]),Kb();let re=M.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,C]),ie=M.useCallback(()=>re([ee,x]),[re,ee,x]);M.useEffect(()=>{k&&ie()},[k,ie]);let{onOpenChange:j,triggerPointerDownPosRef:ae}=b;M.useEffect(()=>{if(x){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(ae.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ae.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||j(!1),document.removeEventListener(`pointermove`,t),ae.current=null};return ae.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,j,ae]),M.useEffect(()=>{let e=()=>j(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[j]);let[oe,se]=VC(e=>{let t=O().filter(e=>!e.disabled),n=HC(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ce=M.useCallback((e,t,n)=>{let r=!ne.current&&!n;(b.value!==void 0&&b.value===t||r)&&(te(e),r&&(ne.current=!0))},[b.value]),le=M.useCallback(()=>x?.focus(),[x]),ue=M.useCallback((e,t,n)=>{let r=!ne.current&&!n;(b.value!==void 0&&b.value===t||r)&&D(e)},[b.value]),de=r===`popper`?uC:cC,fe=de===uC?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_}:{};return(0,N.jsx)(nC,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:ce,selectedItem:ee,onItemLeave:le,itemTextRefCallback:ue,focusSelectedItem:ie,selectedItemText:E,position:r,isPositioned:k,searchRef:oe,children:(0,N.jsx)(AS,{as:aC,allowPinchZoom:!0,children:(0,N.jsx)(Qb,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:p(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,N.jsx)(Xr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,N.jsx)(de,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...v,...fe,onPlaced:()=>A(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:p(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&se(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>re(t)),e.preventDefault()}})})})})})})});oC.displayName=iC;var sC=`SelectItemAlignedPosition`,cC=M.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=VS($S,n),o=rC($S,n),[s,c]=M.useState(null),[l,d]=M.useState(null),p=y(t,e=>d(e)),m=FS(n),h=M.useRef(!1),g=M.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=o,S=M.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&b){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-tC,d=Wb(a,[tC,Math.max(tC,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-tC,d=Wb(a,[tC,Math.max(tC,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-tC*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),y=parseInt(d.paddingBottom,10),x=f+p+u+y+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),ee=e.top+e.height/2-tC,te=c-ee,E=v.offsetHeight/2,D=v.offsetTop+E,O=f+p+D,k=x-O;if(O<=ee){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=O+Math.max(te,E+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(ee,f+_.offsetTop+(e?w:0)+E)+k;s.style.height=t+`px`,_.scrollTop=O-ee+_.offsetTop}s.style.margin=`${tC}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,s,l,_,v,b,a.dir,r]);f(()=>S(),[S]);let[C,w]=M.useState();return f(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]),(0,N.jsx)(dC,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:M.useCallback(e=>{e&&g.current===!0&&(S(),x?.(),g.current=!1)},[S,x]),children:(0,N.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,N.jsx)(u.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});cC.displayName=sC;var lC=`SelectPopperPosition`,uC=M.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=tC,...a}=e,o=zS(n);return(0,N.jsx)(Oc,{...o,...a,ref:t,align:r,collisionPadding:i,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)`}})});uC.displayName=lC;var[dC,fC]=LS($S,{}),pC=`SelectViewport`,mC=M.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=rC(pC,n),o=fC(pC,n),s=y(t,a.onViewportChange),c=M.useRef(0);return(0,N.jsxs)(N.Fragment,{children:[(0,N.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}),(0,N.jsx)(PS.Slot,{scope:n,children:(0,N.jsx)(u.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:p(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-tC*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});mC.displayName=pC;var hC=`SelectGroup`,[gC,_C]=LS(hC),vC=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=m();return(0,N.jsx)(gC,{scope:n,id:i,children:(0,N.jsx)(u.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});vC.displayName=hC;var yC=`SelectLabel`,bC=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=_C(yC,n);return(0,N.jsx)(u.div,{id:i.id,...r,ref:t})});bC.displayName=yC;var xC=`SelectItem`,[SC,CC]=LS(xC),wC=M.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=VS(xC,n),c=rC(xC,n),l=s.value===r,[d,f]=M.useState(a??``),[h,g]=M.useState(!1),_=y(t,e=>c.itemRefCallback?.(e,r,i)),v=m(),b=M.useRef(`touch`),x=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,N.jsx)(SC,{scope:n,value:r,disabled:i,textId:v,isSelected:l,onItemTextChange:M.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,N.jsx)(PS.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:(0,N.jsx)(u.div,{role:`option`,"aria-labelledby":v,"data-highlighted":h?``:void 0,"aria-selected":l&&h,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:p(o.onFocus,()=>g(!0)),onBlur:p(o.onBlur,()=>g(!1)),onClick:p(o.onClick,()=>{b.current!==`mouse`&&x()}),onPointerUp:p(o.onPointerUp,()=>{b.current===`mouse`&&x()}),onPointerDown:p(o.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:p(o.onPointerMove,e=>{b.current=e.pointerType,i?c.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:p(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:p(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(MS.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})});wC.displayName=xC;var TC=`SelectItemText`,EC=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=VS(TC,n),s=rC(TC,n),c=CC(TC,n),l=US(TC,n),[d,p]=M.useState(null),m=y(t,e=>p(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),h=d?.textContent,g=M.useMemo(()=>(0,N.jsx)(`option`,{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=l;return f(()=>(_(g),()=>v(g)),[_,v,g]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(u.span,{id:c.textId,...a,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?rt.createPortal(a.children,o.valueNode):null]})});EC.displayName=TC;var DC=`SelectItemIndicator`,OC=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return CC(DC,n).isSelected?(0,N.jsx)(u.span,{"aria-hidden":!0,...r,ref:t}):null});OC.displayName=DC;var kC=`SelectScrollUpButton`,AC=M.forwardRef((e,t)=>{let n=rC(kC,e.__scopeSelect),r=fC(kC,e.__scopeSelect),[i,a]=M.useState(!1),o=y(t,r.onScrollButtonChange);return f(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,N.jsx)(NC,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});AC.displayName=kC;var jC=`SelectScrollDownButton`,MC=M.forwardRef((e,t)=>{let n=rC(jC,e.__scopeSelect),r=fC(jC,e.__scopeSelect),[i,a]=M.useState(!1),o=y(t,r.onScrollButtonChange);return f(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,N.jsx)(NC,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});MC.displayName=jC;var NC=M.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=rC(`SelectScrollButton`,n),o=M.useRef(null),s=FS(n),c=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>c(),[c]),f(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,N.jsx)(u.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:p(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:p(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:p(i.onPointerLeave,()=>{c()})})}),PC=`SelectSeparator`,FC=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,N.jsx)(u.div,{"aria-hidden":!0,...r,ref:t})});FC.displayName=PC;var IC=`SelectArrow`,LC=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=zS(n),a=VS(IC,n),o=rC(IC,n);return a.open&&o.position===`popper`?(0,N.jsx)(kc,{...i,...r,ref:t}):null});LC.displayName=IC;var RC=`SelectBubbleInput`,zC=M.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=M.useRef(null),a=y(r,i),o=Tl(t);return M.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,N.jsx)(u.select,{...n,style:{...fi,...n.style},ref:a,defaultValue:t})});zC.displayName=RC;function BC(e){return e===``||e===void 0}function VC(e){let t=Hr(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function HC(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=UC(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function UC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var WC=WS,GC=KS,KC=JS,qC=XS,JC=QS,YC=eC,XC=mC,ZC=bC,QC=wC,$C=EC,ew=OC,tw=AC,nw=MC,rw=FC,iw=WC,aw=KC,ow=M.forwardRef(({className:e,children:t,...n},r)=>(0,N.jsxs)(GC,{ref:r,className:w(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
43ing-offset-background 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,(0,N.jsx)(qC,{asChild:!0,children:(0,N.jsx)(ha,{className:`h-4 w-4 opacity-50`})})]}));ow.displayName=GC.displayName;var sw=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(tw,{ref:n,className:w(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,N.jsx)(_a,{className:`h-4 w-4`})}));sw.displayName=tw.displayName;var cw=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(nw,{ref:n,className:w(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,N.jsx)(ha,{className:`h-4 w-4`})}));cw.displayName=nw.displayName;var lw=M.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,N.jsx)(JC,{children:(0,N.jsxs)(YC,{ref:i,className:w(`relative z-50 max-h-96 min-w-[8rem] overflow-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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,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:[(0,N.jsx)(sw,{}),(0,N.jsx)(XC,{className:w(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,N.jsx)(cw,{})]})}));lw.displayName=YC.displayName;var uw=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(ZC,{ref:n,className:w(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));uw.displayName=ZC.displayName;var dw=M.forwardRef(({className:e,children:t,...n},r)=>(0,N.jsxs)(QC,{ref:r,className:w(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),...n,children:[(0,N.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,N.jsx)(ew,{children:(0,N.jsx)(ma,{className:`h-4 w-4`})})}),(0,N.jsx)($C,{children:t})]}));dw.displayName=QC.displayName;var fw=M.forwardRef(({className:e,...t},n)=>(0,N.jsx)(rw,{ref:n,className:w(`-mx-1 my-1 h-px bg-muted`,e),...t}));fw.displayName=rw.displayName;var pw=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),mw=class extends Error{constructor(e,t=`FunctionsError`,n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}},hw=class extends mw{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},gw=class extends mw{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},_w=class extends mw{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},vw;(function(e){e.Any=`any`,e.ApNortheast1=`ap-northeast-1`,e.ApNortheast2=`ap-northeast-2`,e.ApSouth1=`ap-south-1`,e.ApSoutheast1=`ap-southeast-1`,e.ApSoutheast2=`ap-southeast-2`,e.CaCentral1=`ca-central-1`,e.EuCentral1=`eu-central-1`,e.EuWest1=`eu-west-1`,e.EuWest2=`eu-west-2`,e.EuWest3=`eu-west-3`,e.SaEast1=`sa-east-1`,e.UsEast1=`us-east-1`,e.UsWest1=`us-west-1`,e.UsWest2=`us-west-2`})(vw||={});var yw=class{constructor(e,{headers:t={},customFetch:n,region:r=vw.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=pw(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return te(this,arguments,void 0,function*(e,t={}){let n,r;try{let{headers:i,method:a,body:o,signal:s,timeout:c}=t,l={},{region:u}=t;u||=this.region;let d=new URL(`${this.url}/${e}`);u&&u!==`any`&&(l[`x-region`]=u,d.searchParams.set(`forceFunctionRegion`,u));let f;o&&(i&&!Object.prototype.hasOwnProperty.call(i,`Content-Type`)||!i)?typeof Blob<`u`&&o instanceof Blob||o instanceof ArrayBuffer?(l[`Content-Type`]=`application/octet-stream`,f=o):typeof o==`string`?(l[`Content-Type`]=`text/plain`,f=o):typeof FormData<`u`&&o instanceof FormData?f=o:(l[`Content-Type`]=`application/json`,f=JSON.stringify(o)):f=o&&typeof o!=`string`&&!(typeof Blob<`u`&&o instanceof Blob)&&!(o instanceof ArrayBuffer)&&!(typeof FormData<`u`&&o instanceof FormData)?JSON.stringify(o):o;let p=s;c&&(r=new AbortController,n=setTimeout(()=>r.abort(),c),s?(p=r.signal,s.addEventListener(`abort`,()=>r.abort())):p=r.signal);let m=yield this.fetch(d.toString(),{method:a||`POST`,headers:Object.assign(Object.assign(Object.assign({},l),this.headers),i),body:f,signal:p}).catch(e=>{throw new hw(e)}),h=m.headers.get(`x-relay-error`);if(h&&h===`true`)throw new gw(m);if(!m.ok)throw new _w(m);let g=(m.headers.get(`Content-Type`)??`text/plain`).split(`;`)[0].trim(),_;return _=g===`application/json`?yield m.json():g===`application/octet-stream`||g===`application/pdf`?yield m.blob():g===`text/event-stream`?m:g===`multipart/form-data`?yield m.formData():yield m.text(),{data:_,error:null,response:m}}catch(e){return{data:null,error:e,response:e instanceof _w||e instanceof gw?e.context:void 0}}finally{n&&clearTimeout(n)}})}},bw=3,xw=e=>Math.min(1e3*2**e,3e4),Sw=[520,503],Cw=[`GET`,`HEAD`,`OPTIONS`],ww=class extends 
43Error{constructor(e){super(e.message),this.name=`PostgrestError`,this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Tw(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t?.addEventListener(`abort`,i)})}function Ew(e,t,n,r){return!(!r||n>=bw||!Cw.includes(e)||!Sw.includes(t))}var Dw=class{constructor(e){this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError??!1,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle??!1,this.shouldStripNulls=e.shouldStripNulls??!1,this.urlLengthLimit=e.urlLengthLimit??8e3,this.retryEnabled=e.retry??!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get(`Accept`)===`text/csv`)throw Error(`stripNulls() cannot be used with csv()`);return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||([`GET`,`HEAD`].includes(this.method)?this.headers.set(`Accept-Profile`,this.schema):this.headers.set(`Content-Profile`,this.schema)),this.method!==`GET`&&this.method!==`HEAD`&&this.headers.set(`Content-Type`,`application/json`),this.shouldStripNulls){let e=this.headers.get(`Accept`);e===`application/vnd.pgrst.object+json`?this.headers.set(`Accept`,`application/vnd.pgrst.object+json;nulls=stripped`):(!e||e===`application/json`)&&this.headers.set(`Accept`,`application/vnd.pgrst.array+json;nulls=stripped`)}let r=this.fetch,i=(async()=>{let e=0;for(;;){let t=new Headers(n.headers);e>0&&t.set(`X-Retry-Count`,String(e));let i;try{i=await r(n.url.toString(),{method:n.method,headers:t,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal})}catch(t){if(t?.name===`AbortError`||t?.code===`ABORT_ERR`||!Cw.includes(n.method))throw t;if(n.retryEnabled&&e<bw){let t=xw(e);e++,await Tw(t,n.signal);continue}throw t}if(Ew(n.method,i.status,e,n.retryEnabled)){let t=i.headers?.get(`Retry-After`)??null,r=t===null?xw(e):Math.max(0,parseInt(t,10)||0)*1e3;await i.text(),e++,await Tw(r,n.signal);continue}return await n.processResponse(i)}})();return this.shouldThrowOnError||(i=i.catch(e=>{let t=``,n=``,r=``,i=e?.cause;if(i){let n=i?.message??``,r=i?.code??``;t=`${e?.name??`FetchError`}: ${e?.message}`,t+=`\n\nCaused by: ${i?.name??`Error`}: ${n}`,r&&(t+=` (${r})`),i?.stack&&(t+=`\n${i.stack}`)}else t=e?.stack??``;let a=this.url.toString().length;return e?.name===`AbortError`||e?.code===`ABORT_ERR`?(r=``,n=`Request was aborted (timeout or manual cancellation)`,a>this.urlLengthLimit&&(n+=`. Note: Your request URL is ${a} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(i?.name===`HeadersOverflowError`||i?.code===`UND_ERR_HEADERS_OVERFLOW`)&&(r=``,n=`HTTP headers exceeded server limits (typically 16KB)`,a>this.urlLengthLimit&&(n+=`. Your request URL is ${a} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${e?.name??`FetchError`}: ${e?.message}`,details:t,hint:n,code:r},data:null,count:null,status:0,statusText:``}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,i=null,a=e.status,o=e.statusText;if(e.ok){if(t.method!==`HEAD`){let n=await e.text();n===``||(r=t.headers.get(`Accept`)===`text/csv`||t.headers.get(`Accept`)&&t.headers.get(`Accept`)?.includes(`application/vnd.pgrst.plan+text`)?n:JSON.parse(n))}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);s&&c&&c.length>1&&(i=parseInt(c[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:`PGRST116`,details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:`JSON object requested, multiple (or no) rows returned`},r=null,i=null,a=406,o=`Not Acceptable`):r=r.length===1?r[0]:null)}else{let i=await e.text();try{n=JSON.parse(i),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o=`OK`)}
vendor: 9,923 bytes, line 43
43catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new ww(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},Ow=class extends Dw{select(e){let t=!1,n=(e??`*`).split(``).map(e=>/\s/.test(e)&&!t?``:(e===`"`&&(t=!t),e)).join(``);return this.url.searchParams.set(`select`,n),this.headers.append(`Prefer`,`return=representation`),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){let a=i?`${i}.order`:`order`,o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:``}${e}.${t?`asc`:`desc`}${n===void 0?``:n?`.nullsfirst`:`.nullslast`}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){let r=n===void 0?`limit`:`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){let i=r===void 0?`offset`:`${r}.offset`,a=r===void 0?`limit`:`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set(`Accept`,`application/vnd.pgrst.object+json`),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set(`Accept`,`text/csv`),this}geojson(){return this.headers.set(`Accept`,`application/geo+json`),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:a=`text`}={}){let o=[e?`analyze`:null,t?`verbose`:null,n?`settings`:null,r?`buffers`:null,i?`wal`:null].filter(Boolean).join(`|`),s=this.headers.get(`Accept`)??`application/json`;return this.headers.set(`Accept`,`application/vnd.pgrst.plan+${a}; for="${s}"; options=${o};`),this}rollback(){return this.headers.append(`Prefer`,`tx=rollback`),this}returns(){return this}maxAffected(e){return this.headers.append(`Prefer`,`handling=strict`),this.headers.append(`Prefer`,`max-affected=${e}`),this}},kw=RegExp(`[,()]`),Aw=class extends Ow{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(`,`)}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(`,`)}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(`,`)}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(`,`)}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&kw.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&kw.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t==`string`?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(`,`)}}`),this}textSearch(e,t,{config:n,type:r}={}){let i=``;r===`plain`?i=`pl`:r===`phrase`?i=`ph`:r===`websearch`&&(i=`w`);let a=n===void 0?``:`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){let r=n?`${n}.or`:`or`;return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},jw=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:n=!1,count:r}=t??{},i=n?`HEAD`:`GET`,a=!1,o=(e??`*`).split(``).map(e=>/\s/.test(e)&&!a?``:(e===`"`&&(a=!a),e)).join(``),{url:s,headers:c}=this.cloneRequestState();return s.searchParams.set(`select`,o),r&&c.append(`Prefer`,`count=${r}`),new Aw({method:i,url:s,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){let{url:r,headers:i}=this.cloneRequestState();if(t&&i.append(`Prefer`,`count=${t}`),n||i.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);r.searchParams.set(`columns`,e.join(`,`))}}return new Aw({method:`POST`,url:r,headers:i,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){let{url:a,headers:o}=this.cloneRequestState();if(o.append(`Prefer`,`resolution=${n?`ignore`:`merge`}-duplicates`),t!==void 0&&a.searchParams.set(`on_conflict`,t),r&&o.append(`Prefer`,`count=${r}`),i||o.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set(`columns`,e.join(`,`))}}return new Aw({method:`POST`,url:a,headers:o,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){let{url:n,headers:r}=this.cloneRequestState();return t&&r.append(`Prefer`,`count=${t}`),new Aw({method:`PATCH`,url:n,headers:r,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){let{url:t,headers:n}=this.cloneRequestState();return e&&n.append(`Prefer`,`count=${e}`),new Aw({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Mw(e){"@babel/helpers - typeof";return Mw=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Mw(e)}function Nw(e,t){if(Mw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Mw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pw(e){var t=Nw(e,`string`);return Mw(t)==`symbol`?t:t+``}function Fw(e,t,n){return(t=Pw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Iw(Object(n),!0).forEach(function(t){Fw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Rw=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=a;let s=r??globalThis.fetch;i!==void 0&&i>0?this.fetch=(e,t)=>{let n=new AbortController,r=setTimeout(()=>n.abort(),i),a=t?.signal;if(a){if(a.aborted)return clearTimeout(r),s(e,t);let i=()=>{clearTimeout(r),n.abort()};return a.addEventListener(`abort`,i,{once:!0}),s(e,Lw(Lw({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,Lw(Lw({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:this.fetch=s,this.retry=o}from(e){if(!e||typeof e!=`string`||e.trim()===``)throw Error(`Invalid relation name: relation must be a non-empty string.`);return new jw(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){let a,o=new URL(`${this.url}/rpc/${e}`),s,c=e=>typeof e==`object`&&!!e&&(!Array.isArray(e)||e.some(c)),l=n&&Object.values(t).some(c);l?(a=`POST`,s=t):n||r?(a=n?`HEAD`:`GET`,Object.entries(t).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(`,`)}}`:`${t}
43`]).forEach(([e,t])=>{o.searchParams.append(e,t)})):(a=`POST`,s=t);let u=new Headers(this.headers);return l?u.set(`Prefer`,i?`count=${i},return=minimal`:`return=minimal`):i&&u.set(`Prefer`,`count=${i}`),new Aw({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},zw=class{constructor(){}static detectEnvironment(){if(typeof WebSocket<`u`)return{type:`native`,constructor:WebSocket};if(typeof globalThis<`u`&&globalThis.WebSocket!==void 0)return{type:`native`,constructor:globalThis.WebSocket};if(typeof global<`u`&&global.WebSocket!==void 0)return{type:`native`,constructor:global.WebSocket};if(typeof globalThis<`u`&&globalThis.WebSocketPair!==void 0&&globalThis.WebSocket===void 0)return{type:`cloudflare`,error:`Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.`,workaround:`Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime.`};if(typeof globalThis<`u`&&globalThis.EdgeRuntime||typeof navigator<`u`&&navigator.userAgent?.includes(`Vercel-Edge`))return{type:`unsupported`,error:`Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.`,workaround:`Use serverless functions or a different deployment target for WebSocket functionality.`};let e=globalThis.process;if(e){let t=e.versions;if(t&&t.node){let e=t.node,n=parseInt(e.replace(/^v/,``).split(`.`)[0]);return n>=22?globalThis.WebSocket===void 0?{type:`unsupported`,error:`Node.js ${n} detected but native WebSocket not found.`,workaround:`Provide a WebSocket implementation via the transport option.`}:{type:`native`,constructor:globalThis.WebSocket}:{type:`unsupported`,error:`Node.js ${n} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
44import ws from "ws"
45new RealtimeClient(url, { transport: ws })`}}}return{type:`unsupported`,error:`Unknown JavaScript runtime without WebSocket support.`,workaround:`Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation.`}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||`WebSocket not supported in this environment.`;throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return e.type===`native`||e.type===`ws`}catch{return!1}}},Bw=`realtime-js/2.104.0`,Vw=`1.0.0`,Hw=`2.0.0`,Uw=Hw,Ww=1e4,Gw={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},Kw={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},qw={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},Jw=class{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT=`broadcast`,this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event==`string`)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){return this._isArrayBuffer(e.payload?.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){let t=e.payload?.payload??new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,t)}_encodeJsonUserBroadcastPush(e){let t=e.payload?.payload??{},n=new TextEncoder().encode(JSON.stringify(t)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,n)}_encodeUserBroadcastPush(e,t,n){let r=e.topic,i=e.ref??``,a=e.join_ref??``,o=e.payload.event,s=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},c=Object.keys(s).length===0?``:JSON.stringify(s);if(a.length>255)throw Error(`joinRef length ${a.length} exceeds maximum of 255`);if(i.length>255)throw Error(`ref length ${i.length} exceeds maximum of 255`);if(r.length>255)throw Error(`topic length ${r.length} exceeds maximum of 255`);if(o.length>255)throw Error(`userEvent length ${o.length} exceeds maximum of 255`);if(c.length>255)throw Error(`metadata length ${c.length} exceeds maximum of 255`);let l=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+i.length+r.length+o.length+c.length,u=new ArrayBuffer(this.HEADER_LENGTH+l),d=new DataView(u),f=0;d.setUint8(f++,this.KINDS.userBroadcastPush),d.setUint8(f++,a.length),d.setUint8(f++,i.length),d.setUint8(f++,r.length),d.setUint8(f++,o.length),d.setUint8(f++,c.length),d.setUint8(f++,t),Array.from(a,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(i,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(r,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(o,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(c,e=>d.setUint8(f++,e.charCodeAt(0)));var p=new Uint8Array(u.byteLength+n.byteLength);return p.set(new Uint8Array(u),0),p.set(new Uint8Array(n),u.byteLength),p.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if(typeof e==`string`){let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,r)}}_decodeUserBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+4,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength),f=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,p={type:this.BROADCAST_EVENT,event:l,payload:f};return a>0&&(p.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){return e instanceof ArrayBuffer||e?.constructor?.name===`ArrayBuffer`}_pick(e,t){return!e||typeof e!=`object`?{}:Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e)))}},B;(function(e){e.abstime=`abstime`,e.bool=`bool`,e.date=`date`,e.daterange=`daterange`,e.float4=`float4`,e.float8=`float8`,e.int2=`int2`,e.int4=`int4`,e.int4range=`int4range`,e.int8=`int8`,e.int8range=`int8range`,e.json=`json`,e.jsonb=`jsonb`,e.money=`money`,e.numeric=`numeric`,e.oid=`oid`,e.reltime=`reltime`,e.text=`text`,e.time=`time`,e.timestamp=`timestamp`,e.timestamptz=`timestamptz`,e.timetz=`timetz`,e.tsrange=`tsrange`,e.tstzrange=`tstzrange`})(B||={});var Yw=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=Xw(i,e,t,r),n),{}):{}},Xw=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?Zw(i,a):Qw(a)},Zw=(e,t)=>
vendor: 10,572 bytes, line 45
45{if(e.charAt(0)===`_`)return nT(t,e.slice(1,e.length));switch(e){case B.bool:return $w(t);case B.float4:case B.float8:case B.int2:case B.int4:case B.int8:case B.numeric:case B.oid:return eT(t);case B.json:case B.jsonb:return tT(t);case B.timestamp:return rT(t);case B.abstime:case B.date:case B.daterange:case B.int4range:case B.int8range:case B.money:case B.reltime:case B.text:case B.time:case B.timestamptz:case B.timetz:case B.tsrange:case B.tstzrange:return Qw(t);default:return Qw(t)}},Qw=e=>e,$w=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},eT=e=>{if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},tT=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},nT=(e,t)=>{if(typeof e!=`string`)return e;let n=e.length-1,r=e[n];if(e[0]===`{`&&r===`}`){let r,i=e.slice(1,n);try{r=JSON.parse(`[`+i+`]`)}catch{r=i?i.split(`,`):[]}return r.map(e=>Zw(t,e))}return e},rT=e=>typeof e==`string`?e.replace(` `,`T`):e,iT=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,`http`),t.pathname=t.pathname.replace(/\/+$/,``).replace(/\/socket\/websocket$/i,``).replace(/\/socket$/i,``).replace(/\/websocket$/i,``),t.pathname===``||t.pathname===`/`?t.pathname=`/api/broadcast`:t.pathname+=`/api/broadcast`,t.href},aT=e=>typeof e==`function`?e:function(){return e},oT=typeof self<`u`?self:null,sT=typeof window<`u`?window:null,cT=oT||sT||globalThis,lT=`2.0.0`,uT=1e4,dT=1e3,fT={connecting:0,open:1,closing:2,closed:3},pT={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},mT={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},hT={longpoll:`longpoll`,websocket:`websocket`},gT={complete:4},_T=`base64url.bearer.phx.`,vT=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived(`timeout`)||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger(`timeout`,{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},yT=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries+=1,this.callback()},this.timerCalc(this.tries+1))}},bT=class{constructor(e,t,n){this.state=pT.closed,this.topic=e,this.params=aT(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new vT(this,mT.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new yT(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive(`ok`,()=>{this.state=pT.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,e=>{this.state=pT.errored,this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log(`channel`,`close ${this.topic}`),this.state=pT.closed,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=pT.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive(`timeout`,()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`timeout ${this.topic}`,this.joinPush.timeout),new vT(this,mT.leave,aT({}),this.timeout).send(),this.state=pT.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(mT.reply,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw Error(`tried to join multiple times. 'join' can only be called a single time per channel instance`);return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=pT.closed,this.bindings=[]}onClose(e){this.on(mT.close,e)}onError(e){return this.on(mT.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(t===void 0||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t||={},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new vT(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=pT.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(mT.close,`leave`)},n=new vT(this,mT.leave,aT({}),e);return n.receive(`ok`,()=>t()).receive(`timeout`,()=>t()),n.send(),this.canPush()||n.trigger(`ok`,{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic===e?r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(`channel`,`dropping outdated message`,{topic:e,event:t,payload:n,joinRef:r}),!1):!0:!1}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=pT.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw Error(`channel onMessage callbacks must return the payload, modified or unmodified`);let a=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let e=0;e<a.length;e++)a[e].callback(i,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===pT.closed}isErrored(){return this.state===pT.errored}isJoined(){return this.state===pT.joined}isJoining(){return this.state===pT.joining}isLeaving(){return this.state===pT.leaving}},xT=class{static request(e,t,n,r,i,a,o){if(cT.XDomainRequest){let n=new cT.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,a,o)}else if(cT.XMLHttpRequest){let s=new cT.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,i,a,o)}else if(cT.fetch&&cT.AbortController)return this.fetchRequest(e,t,n,r,i,a,o);else throw Error(`No suitable XMLHttpRequest implementation found`)}static fetchRequest(e,t,n,r,i,a,o){let s={method:e,headers:n,body:r},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),s.signal=c.signal),cT.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{e.name===`AbortError`&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,i,a,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,o,s){e.open(t,n,!0),e.timeout=a;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{e.readyState===gT.complete&&s&&s(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||e===``)return null;try{return JSON.parse(e)}catch{return console&&console.log(`failed to parse JSON response`,e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?`${t}[${r}]`:r,a=e[r];typeof a==`object`?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+`=`+encodeURIComponent(a))}return n.join(`&`)}static appendParams(e,t){return Object.keys(t).length===0?e:`${e}${e.match(/\?/)?`&`:`?`}${this.serialize(t)}`}},ST=e=>{let t=``,n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)},CT=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(_T)&&(this.authToken=atob(t[1].slice(_T.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=fT.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+hT.websocket),`$1/`+hT.longpoll)}endpointURL(){return xT.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=fT.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===fT.open||this.readyState===fT.connecting}poll(){let e={Accept:`application/json`};this.authToken&&(e[`X-Phoenix-AuthToken`]=this.authToken),this.ajax(`GET`,e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,`session_gone`,!1);return}this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=fT.open,this.onopen({}),this.poll();break;
45case 403:this.onerror(403),this.close(1008,`forbidden`,!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,`internal server error`,500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){typeof e!=`string`&&(e=ST(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},e.join(`
46`),()=>this.onerror(`timeout`),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,`internal server error`,!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=fT.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<`u`?this.onclose(new CloseEvent(`close`,r)):this.onclose(r)}ajax(e,t,n,r,i){let a;a=xT.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(a),r()},e=>{this.reqs.delete(a),this.isActive()&&i(e)}),this.reqs.add(a)}},wT=class e{constructor(t,n={}){let r=n.events||{state:`presence_state`,diff:`presence_diff`};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let i=this.clone(e),a={},o={};return this.map(i,(e,n)=>{t[e]||(o[e]=n)}),this.map(t,(e,t)=>{let n=i[e];if(n){let r=t.metas.map(e=>e.phx_ref),i=n.metas.map(e=>e.phx_ref),s=t.metas.filter(e=>i.indexOf(e.phx_ref)<0),c=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);s.length>0&&(a[e]=t,a[e].metas=s),c.length>0&&(o[e]=this.clone(n),o[e].metas=c)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},n,r)}static syncDiff(e,t,n,r){let{joins:i,leaves:a}=this.clone(t);return n||=function(){},r||=function(){},this.map(i,(t,r)=>{let i=e[t];if(e[t]=this.clone(r),i){let n=e[t].metas.map(e=>e.phx_ref),r=i.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,i,r)}),this.map(a,(t,n)=>{let i=e[t];if(!i)return;let a=n.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>a.indexOf(e.phx_ref)<0),r(t,i,n),i.metas.length===0&&delete e[t]}),e}static list(e,t){return t||=function(e,t){return t},this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},TT={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,o=this.META_LENGTH+t.length+n.length+i.length+r.length,s=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(s),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,i.length),c.setUint8(l++,r.length),Array.from(t,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(n,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(i,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(r,e=>c.setUint8(l++,e.charCodeAt(0)));var u=new Uint8Array(s.byteLength+a.byteLength);return u.set(new Uint8Array(s),0),u.set(new Uint8Array(a),s.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}}
vendor: 12,929 bytes, line 46
46,decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(o,o+r));o+=r;let c=n.decode(e.slice(o,o+i));o+=i;let l=n.decode(e.slice(o,o+a));return o+=a,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=n.decode(e.slice(s,s+o));s+=o;let f={status:d,response:e.slice(s,e.byteLength)};return{join_ref:c,ref:l,topic:u,event:mT.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a+=r;let s=n.decode(e.slice(a,a+i));return a+=i,{join_ref:null,ref:null,topic:o,event:s,payload:e.slice(a,e.byteLength)}}},ET=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||uT,this.transport=t.transport||cT.WebSocket||CT,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||cT&&cT.sessionStorage,this.establishedConnections=0,this.defaultEncoder=TT.encode.bind(TT),this.defaultDecoder=TT.decode.bind(TT),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||`arraybuffer`,this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport===CT?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let n=null;sT&&sT.addEventListener&&(sT.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),n=this.connectClock)}),sT.addEventListener(`pageshow`,e=>{n===this.connectClock&&(n=null,this.connect())}),sT.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=aT(t.params||{}),this.endPoint=`${e}/${hT.websocket}`,this.vsn=t.vsn||lT,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new yT(()=>{if(this.pageHidden){this.log(`Not reconnecting as page is hidden!`),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return CT}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&=(this.conn.close(),null),this.transport=e}protocol(){return location.protocol.match(/^https/)?`wss`:`ws`}endPointURL(){let e=xT.appendParams(xT.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)===`/`?e.charAt(1)===`/`?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`:e}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log(`passing params to connect is deprecated. Instead pass :params to the Socket constructor`),this.params=aT(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==CT?this.connectWithFallback(CT,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case CT:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${_T}${btoa(this.authToken).replace(/=/g,``)}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,a=this.transportName(e),o=t=>{this.log(`transport`,`falling back to ${a}...`,t),this.off([void 0,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o(`memorized`);this.fallbackTimer=setTimeout(o,t),i=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(`transport`,`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks(`open`)}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log(`transport`,`heartbeat timeout. Attempting to re-establish connection`);try{this.heartbeatCallback(`timeout`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),dT,`heartbeat timeout`)}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();let r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||``):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===fT.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log(`transport`,`close`,e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks(`close`,e)}onConnError(e){this.hasLogger()&&this.log(`transport`,e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks(`error`,e,t,n),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(mT.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case fT.connecting:return`connecting`;case fT.open:return`open`;case fT.closing:return`closing`;default:return`closed`}}isConnected(){return this.connectionState()===`open`}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>e.indexOf(t)===-1)}channel(e,t={}){let n=new bT(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback(`disconnected`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback(`sent`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status===`ok`?`ok`:`error`,e)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`.trim(),r);for(let e=0;e<this.channels.length;e++){let o=this.channels[e];o.isMember(t,n,r,a)&&o.trigger(n,r,i,a)}this.triggerStateCallbacks(`message`,e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(t){this.log(`error`,`error in ${e} callback`,t)}})}catch(t){this.log(`error`,`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},DT=class e{constructor(t,n){let r=AT(n);this.presence=new wT(t.getChannel(),r),this.presence.onJoin((n,r,i)=>{let a=e.onJoinPayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onLeave((n,r,i)=>{let a=e.onLeavePayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onSync(()=>{t.getChannel().trigger(`presence`,{event:`sync`})})}get state(){return e.transformState(this.presence.state)}static transformState(e){return e=kT(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=OT(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:jT(t),newPresences:OT(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:jT(t),leftPresences:OT(n)}}};function OT(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function kT(e){return JSON.parse(JSON.stringify(e))}function AT(e){return e?.events&&{events:e.events}}function jT(e){return e?.metas?OT(e):[]}var MT;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(MT||={});var NT=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new DT(this.channel.channelAdapter,t)}},PT=class{constructor(e,t,n){let r=FT(n);this.channel=e.getSocket().channel(t,r),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}
46push(e,t,n){let r;try{r=this.channel.push(e,t,n)}catch{throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log(`channel`,`discarded push due to buffer overflow: ${e.event}`,e.payload())}return r}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===Gw.joined}isJoined(){return this.state===Gw.joined}isJoining(){return this.state===Gw.joining}isClosed(){return this.state===Gw.closed}isLeaving(){return this.state===Gw.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function FT(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var IT;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(IT||={});var LT;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(LT||={});var RT;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(RT||={});var zT=class e{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},n){if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,``),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},t.config),this.channelAdapter=new PT(this.socket.socketAdapter,e,this.params),this.presence=new NT(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=iT(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&this.params.config?.broadcast?.replay)throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:n,presence:r,private:i}}=this.params,a=this.bindings.postgres_changes?.map(e=>e.filter)??[],o=!!this.bindings[LT.PRESENCE]&&this.bindings[LT.PRESENCE].length>0||this.params.config.presence?.enabled===!0,s={},c={broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:o}),postgres_changes:a,private:i};this.socket.accessTokenValue&&(s.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(RT.CHANNEL_ERROR,t)}),this._onClose(()=>e?.(RT.CLOSED)),this.updateJoinPayload(Object.assign({config:c},s)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(RT.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=Gw.errored,e?.(RT.CHANNEL_ERROR,Error(JSON.stringify(Object.values(t).join(`, `)||`error`)))}).receive(`timeout`,()=>{e?.(RT.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){let r=this.bindings.postgres_changes,i=r?.length??0,a=[];for(let o=0;o<i;o++){let i=r[o],{filter:{event:s,schema:c,table:l,filter:u}}=i,d=t&&t[o];if(d&&d.event===s&&e.isFilterValueEqual(d.schema,c)&&e.isFilterValueEqual(d.table,l)&&e.isFilterValueEqual(d.filter,u))a.push(Object.assign(Object.assign({},i),{id:d.id}));else{this.unsubscribe(),this.state=Gw.errored,n?.(RT.CHANNEL_ERROR,Error(`mismatch between server and client bindings for postgres changes`));return}}this.bindings.postgres_changes=a,this.state!=Gw.errored&&n&&n(RT.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:`presence`,event:`track`,payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:`presence`,event:`untrack`},e)}on(e,t,n){let r=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===LT.PRESENCE||e===LT.POSTGRES_CHANGES;if(r&&i)throw this.socket.log(`channel`,`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,n)}async httpSend(e,t,n={}){if(t==null)return Promise.reject(Error(`Payload is required for httpSend()`));let r={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":`application/json`};this.socket.accessTokenValue&&(r.Authorization=`Bearer ${this.socket.accessTokenValue}`);let i={method:`POST`,headers:r,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,i,n.timeout??this.timeout);if(a.status===202)return{success:!0};let o=a.statusText;
46try{let e=await a.json();o=e.error||e.message||o}catch{}return Promise.reject(Error(o))}async send(e,t={}){if(!this.channelAdapter.canPush()&&e.type===`broadcast`){console.warn(`Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.`);let{event:n,payload:r}=e,i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a={method:`POST`,headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:r,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,a,t.timeout??this.timeout);return await e.body?.cancel(),e.ok?`ok`:`error`}catch(e){return e.name===`AbortError`?`timed out`:`error`}}else return new Promise(n=>{let r=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type===`broadcast`&&!this.params?.config?.broadcast?.ack&&n(`ok`),r.receive(`ok`,()=>n(`ok`)),r.receive(`error`,()=>n(`error`)),r.receive(`timeout`,()=>n(`timed out`))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive(`ok`,()=>t(`ok`)).receive(`timeout`,()=>t(`timed out`)).receive(`error`,()=>t(`error`))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),a}_on(e,t,n){let r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:n,ref:this.channelAdapter.on(e,n)};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{let r=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(r,n))return!1;let i=this.bindings[r]?.find(t=>t.ref===e.ref);if(!i)return!0;if([`broadcast`,`presence`,`postgres_changes`].includes(r))if(`id`in i){let e=i.id,n=i.filter?.event;return e&&t.ids?.includes(e)&&(n===`*`||n?.toLocaleLowerCase()===t.data?.type.toLocaleLowerCase())}else{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}else return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=Kw;return t&&[n,r,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t==`object`&&`ids`in t){let e=t.data,{schema:n,table:r,commit_timestamp:i,type:a,errors:o}=e,s={schema:n,table:r,commit_timestamp:i,eventType:a,new:{},old:{},errors:o};return Object.assign(Object.assign({},s),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error(`cannot copy bindings into joined channel`);for(let t in e.bindings)for(let n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=Yw(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=Yw(e.columns,e.old_record)),t}},BT=class{constructor(e,t){this.socket=new ET(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i(`timeout`),r),this.socket.disconnect(()=>{e(),i(`ok`)},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==qw.connecting}isDisconnecting(){return this.socket.connectionState()==qw.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},VT={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},HT=[1e3,2e3,5e3,1e4],UT=1e4,WT=`
47  addEventListener("message", (e) => {
48    if (e.data.event === "start") {
49      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
50    }
51  });`,GT=class{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint=``,this.headers={},this.params={}
51,this.ref=0,this.serializer=new Jw,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!t?.params?.apikey)throw Error(`API key is required to connect to Realtime`);this.apiKey=t.params.apikey,this.socketAdapter=new BT(e,this._initializeOptions(t)),this.httpEndpoint=iT(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(`connect`),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let t=e.message;throw t.includes(`Node.js`)?Error(`${t}\n\nTo use Realtime in Node.js, you need to provide a WebSocket implementation:
52
53Option 1: Use Node.js 22+ which has native WebSocket support
54Option 2: Install and provide the "ws" package:
55
56  npm install ws
57
58  import ws from "ws"
59  const client = new RealtimeClient(url, {
60    ...options,
61    transport: ws
62  })`):Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this.isDisconnecting()?`ok`:await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return t===`ok`&&e.teardown(),this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||qw.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{let n=new zT(`realtime:${e}`,t,this);return this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let n={access_token:t,version:Bw};t&&e.updateJoinPayload(n),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(Kw.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=`general`){this._isManualToken()||this.setAuth().catch(t=>{this.log(`error`,`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log(`error`,`error waiting for auth on connect`,e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t==`sent`&&this._setAuthSafely(),e&&e(t,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log(`worker`,`starting worker for from ${this.workerUrl}`):this.log(`worker`,`starting default worker`);let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log(`worker`,`worker error`,e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{e.data.event===`keepAlive`&&this.sendHeartbeat()},this.workerRef.postMessage({event:`start`,interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&=(this.log(`worker`,`terminating worker`),this.workerRef.terminate(),void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([WT],{type:`application/javascript`});t=URL.createObjectURL(e)}return t}_initializeOptions(e){this.worker=e?.worker??!1,this.accessToken=e?.accessToken??null;let t={};t.timeout=e?.timeout??Ww,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??VT.HEARTBEAT_INTERVAL,t.transport=e?.transport??zw.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>HT[e-1]||UT);let n,r,i=e?.vsn??Uw;switch(i){case Vw:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case Hw:n=this.serializer.encode.bind(this.serializer),r=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${t.vsn}`)}if(t.vsn=i,t.encode=e?.encode??n,t.decode=e?.decode??r,t.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,t.params=Object.assign(Object.assign({},t.params),{log_level:this.logLevel})),this.worker){if(typeof window<`u`&&!window.Worker)throw Error(`Web Worker is not supported`);this.workerUrl=e?.workerUrl,t.autoSendHeartbeat=!this.worker}return t}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
vendor: 4,828 bytes, line 62
62,KT=class extends Error{constructor(e,t){super(e),this.name=`IcebergError`,this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType===`CommitStateUnknownException`||[500,502,504].includes(t.status)&&t.icebergType?.includes(`CommitState`)===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function qT(e,t,n){let r=new URL(t,e);if(n)for(let[e,t]of Object.entries(n))t!==void 0&&r.searchParams.set(e,t);return r.toString()}async function JT(e){return!e||e.type===`none`?{}:e.type===`bearer`?{Authorization:`Bearer ${e.token}`}:e.type===`header`?{[e.name]:e.value}:e.type===`custom`?await e.getHeaders():{}}function YT(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=qT(e.baseUrl,r,i),c=await JT(e.auth),l=await t(s,{method:n,headers:{...a?{"Content-Type":`application/json`}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await l.text(),d=(l.headers.get(`content-type`)||``).includes(`application/json`),f=d&&u?JSON.parse(u):u;if(!l.ok){let e=d?f:void 0,t=e?.error;throw new KT(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:f}}}}function XT(e){return e.join(`�`)}var ZT=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:XT(e.namespace)}:void 0;return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${XT(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${XT(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${XT(e.namespace)}`}),!0}catch(e){if(e instanceof KT&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof KT&&e.status===409)return;throw e}}};function QT(e){return e.join(`�`)}var $T=class{constructor(e,t=``,n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${QT(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let n={};return this.accessDelegation&&(n[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${QT(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){let n=await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${QT(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data[`metadata-location`],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${QT(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${QT(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation);try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${QT(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof KT&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof KT&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},eE=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`),this.client=YT({baseUrl:e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new ZT(this.client,t),this.tableOps=new $T(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
62async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function tE(e){"@babel/helpers - typeof";return tE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},tE(e)}function nE(e,t){if(tE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(tE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rE(e){var t=nE(e,`string`);return tE(t)==`symbol`?t:t+``}function iE(e,t,n){return(t=rE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?aE(Object(n),!0).forEach(function(t){iE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var oE=class extends Error{constructor(e,t=`storage`,n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t===`vectors`?`StorageVectorsError`:`StorageError`,this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function sE(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var cE=class extends oE{constructor(e,t,n,r=`storage`){super(e,r,t,n),this.name=r===`vectors`?`StorageVectorsApiError`:`StorageApiError`,this.status=t,this.statusCode=n}toJSON(){return V({},super.toJSON())}},lE=class extends oE{constructor(e,t,n=`storage`){super(e,n),this.name=n===`vectors`?`StorageVectorsUnknownError`:`StorageUnknownError`,this.originalError=t}};function uE(e,t,n){let r=V({},e),i=t.toLowerCase();for(let e of Object.keys(r))e.toLowerCase()===i&&delete r[e];return r[i]=n,r}function dE(e){let t={};for(let[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}var fE=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),pE=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},mE=e=>{if(Array.isArray(e))return e.map(e=>mE(e));if(typeof e==`function`||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,n])=>{let r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,``));t[r]=mE(n)}),t},hE=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),gE=e=>e.msg||e.message||e.error_description||(typeof e.error==`string`?e.error:e.error?.message)||JSON.stringify(e),_E=async(e,t,n,r)=>{if(typeof e==`object`&&e&&typeof e.json==`function`){let n=e,i=parseInt(n.status,10);Number.isFinite(i)||(i=500),n.json().then(e=>{let n=e?.statusCode||e?.code||i+``;t(new cE(gE(e),i,n,r))}).catch(()=>{let e=i+``;t(new cE(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new lE(gE(e),e,r))},vE=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return V(V({},i),n);if(pE(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=uE(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),V(V({},i),n)};async function yE(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,vE(t,r,i,a)).then(e=>{if(!e.ok)throw e;if(r?.noResolveJson)return e;if(o===`vectors`){let t=e.headers.get(`content-type`);if(e.headers.get(`content-length`)===`0`||e.status===204||!t||!t.includes(`application/json`))return{}}return e.json()}).then(e=>s(e)).catch(e=>_E(e,c,r,o))})}function bE(e=`storage`){return{get:async(t,n,r,i)=>yE(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>yE(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>yE(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>yE(t,`HEAD`,n,V(V({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>yE(t,`DELETE`,n,i,a,r,e)}}var{get:xE,post:SE,put:CE,head:wE,remove:TE}=bE(`storage`),EE=bE(`vectors`),DE=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=dE(t),this.fetch=fE(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=uE(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(sE(e))return{data:null,error:e};throw e}}},OE=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(sE(t))return{data:null,error:t};throw t}}},kE=Symbol.toStringTag,AE=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[kE]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new OE(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(sE(t))return{data:null,error:t};throw t}}},jE={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},ME={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},NE=class extends DE{constructor(e,t={},n,r){super(e,t,r,`storage`),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a,o=V(V({},ME),r),s=V(V({},i.headers),e===`POST`&&{"x-upsert":String(o.upsert)}),c=o.metadata;if(typeof Blob<`u`&&n instanceof Blob?(a=new FormData,a.append(`cacheControl`,o.cacheControl),c&&a.append(`metadata`,i.encodeMetadata(c)),a.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(a=n,a.has(`cacheControl`)||a.append(`cacheControl`,o.cacheControl),c&&!a.has(`metadata`)&&a.append(`metadata`,i.encodeMetadata(c))):(a=n,s[`cache-control`]=`max-age=${o.cacheControl}`,s[`content-type`]=o.contentType,c&&(s[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&a instanceof ReadableStream||a&&typeof a==`object`&&`pipe`in a&&typeof a.pipe==`function`)&&!o.duplex&&(o.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))s=uE(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?CE:SE)(i.fetch,`${i.url}/object/${u}`,a,V({headers:s},o?.duplex?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate(`POST`,e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;let a=i._removeEmptyFolders(e),o=i._getFinalPath(a),s=new URL(i.url+`/object/upload/sign/${o}`);return s.searchParams.set(`token`,t),i.handleOperation(async()=>{let e,t=V(V({},ME),r),o=V(V({},i.headers),{"x-upsert":String(t.upsert)});return typeof Blob<`u`&&n instanceof Blob?(e=new FormData,e.append(`cacheControl`,t.cacheControl),e.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(e=n,e.append(`cacheControl`,t.cacheControl)):(e=n,o[`cache-control`]=`max-age=${t.cacheControl}`,o[`content-type`]=t.contentType),{path:a,fullPath:(await CE(i.fetch,s.toString(),e,{headers:o})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e),i=V({},n.headers);t?.upsert&&(i[`x-upsert`]=`true`);let a=await SE(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(n.url+a.url),s=o.searchParams.get(`token`);if(!s)throw new oE(`No token returned by API`);return{signedUrl:o.toString(),path:e,token:s}})}async update(e,t,n){return this.uploadOrUpdate(`PUT`,e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await SE(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
62stinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await SE(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,o=await SE(r.fetch,`${r.url}/object/sign/${i}`,V({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers}),s=new URLSearchParams;n?.download&&s.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&s.set(`cacheNonce`,String(n.cacheNonce));let c=s.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:``}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{let i=await SE(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n?.download&&a.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&a.set(`cacheNonce`,String(n.cacheNonce));let o=a.toString();return i.map(e=>V(V({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${o?`&${o}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new AE(()=>xE(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;let n=t._getFinalPath(e);return t.handleOperation(async()=>mE(await xE(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await wE(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(sE(e)){let t=e instanceof cE?e.status:e instanceof lE?e.originalError?.status:void 0;if(t!==void 0&&[400,404].includes(t))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let n=this._getFinalPath(e),r=new URLSearchParams;t?.download&&r.set(`download`,t.download===!0?``:t.download),t?.transform&&this.applyTransformOptsToQuery(r,t.transform),t?.cacheNonce!=null&&r.set(`cacheNonce`,String(t.cacheNonce));let i=r.toString(),a=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image`:`object`;return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(i?`?${i}`:``)}}}async remove(e){var t=this;return t.handleOperation(async()=>await TE(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{let i=V(V(V({},jE),t),{},{prefix:e||``});return await SE(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{let r=V({},e);return await SE(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,``)}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)}applyTransformOptsToQuery(e,t){return t.width&&e.set(`width`,t.width.toString()),t.height&&e.set(`height`,t.height.toString()),t.resize&&e.set(`resize`,t.resize),t.format&&e.set(`format`,t.format),t.quality&&e.set(`quality`,t.quality.toString()),e}},PE=`2.104.0`,FE={"X-Client-Info":`storage-js/${PE}`},IE=class extends DE{constructor(e,t={},n,r){let i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes(`storage.supabase.`)&&(i.hostname=i.hostname.replace(`supabase.`,`storage.supabase.`));let a=i.href.replace(/\/$/,``),o=V(V({},FE),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await xE(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await xE(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await SE(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await CE(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await SE(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await TE(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){let t={};return e&&(`limit`in e&&(t.limit=String(e.limit)),`offset`in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>
620?`?`+new URLSearchParams(t).toString():``}},LE=class extends DE{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=V(V({},FE),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await SE(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=new URLSearchParams;e?.limit!==void 0&&n.set(`limit`,e.limit.toString()),e?.offset!==void 0&&n.set(`offset`,e.offset.toString()),e?.sortColumn&&n.set(`sortColumn`,e.sortColumn),e?.sortOrder&&n.set(`sortOrder`,e.sortOrder),e?.search&&n.set(`search`,e.search);let r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await xE(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await TE(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!hE(e))throw new oE(`Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.`);let n=new eE({baseUrl:this.url,catalogName:e,auth:{type:`custom`,getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){let n=e[t];return typeof n==`function`?async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}}:n}})}},RE=class extends DE{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=V(V({},FE),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await EE.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await EE.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},zE=class extends DE{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=V(V({},FE),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error(`Vector batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw Error(`segmentCount must be between 1 and 16`);if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error(`Keys batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},BE=class extends DE{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=V(V({},FE),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await EE.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},VE=class extends BE{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new HE(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},HE=class extends RE{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,V(V({},e),{},{vectorBucketName:n.vectorBucketName}))}
62async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,V(V({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new UE(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},UE=class extends zE{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,V(V({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,V(V({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,V(V({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,V(V({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,V(V({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},WE=class extends IE{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new NE(this.url,this.headers,e,this.fetch)}get vectors(){return new VE(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new LE(this.url+`/iceberg`,this.headers,this.fetch)}},GE=`2.104.0`,KE=30*1e3,qE=3*KE,JE=`http://localhost:9999`,YE=`supabase.auth.token`,XE={"X-Client-Info":`gotrue-js/${GE}`},ZE=`X-Supabase-Api-Version`,QE={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},$E=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,eD=class extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name=`AuthError`,this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};function H(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}var tD=class extends eD{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function nD(e){return H(e)&&e.name===`AuthApiError`}var rD=class extends eD{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},iD=class extends eD{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},aD=class extends iD{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function oD(e){return H(e)&&e.name===`AuthSessionMissingError`}var sD=class extends iD{constructor(){super(`Auth session or user missing`,`AuthInvalidToken
62ResponseError`,500,void 0)}},cD=class extends iD{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},lD=class extends iD{constructor(e,t=null){super(e,`AuthImplicitGrantRedirectError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};function uD(e){return H(e)&&e.name===`AuthImplicitGrantRedirectError`}var dD=class extends iD{constructor(e,t=null){super(e,`AuthPKCEGrantCodeExchangeError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}},fD=class extends iD{constructor(){super(`PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.`,`AuthPKCECodeVerifierMissingError`,400,`pkce_code_verifier_not_found`)}},pD=class extends iD{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function mD(e){return H(e)&&e.name===`AuthRetryableFetchError`}var hD=class extends iD{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},gD=class extends iD{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},_D=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),vD=` 	
63\r=`.split(``),yD=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<vD.length;t+=1)e[vD[t].charCodeAt(0)]=-2;for(let t=0;t<_D.length;t+=1)e[_D[t].charCodeAt(0)]=t;return e})();function bD(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(_D[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue<<=6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(_D[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function xD(e,t,n){let r=yD[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(r===-2)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function SD(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{TD(e,r,n)};for(let t=0;t<e.length;t+=1)xD(e.charCodeAt(t),i,a);return t.join(``)}function CD(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function wD(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|t)+65536,n+=1}CD(r,t)}}function TD(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw Error(`Invalid UTF-8 sequence`);--t.utf8seq}else if(t.utf8seq>0){if(e<=127)throw Error(`Invalid UTF-8 sequence`);t.codepoint=t.codepoint<<6|e&63,--t.utf8seq,t.utf8seq===0&&n(t.codepoint)}}function ED(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)xD(e.charCodeAt(t),n,r);return new Uint8Array(t)}function DD(e){let t=[];return wD(e,e=>t.push(e)),new Uint8Array(t)}function OD(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>bD(e,n,r)),bD(null,n,r),t.join(``)}function kD(e){return Math.round(Date.now()/1e3)+e}function AD(){return Symbol(`auth-callback`)}var jD=()=>typeof window<`u`&&typeof document<`u`,MD={tested:!1,writable:!1},ND=()=>{if(!jD())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(MD.tested)return MD.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),MD.tested=!0,MD.writable=!0}catch{MD.tested=!0,MD.writable=!1}return MD.writable};function PD(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEac
63h((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var FD=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),ID=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,LD=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},RD=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},zD=async(e,t)=>{await e.removeItem(t)},BD=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};BD.promiseConstructor=Promise;function VD(e){let t=e.split(`.`);if(t.length!==3)throw new gD(`Invalid JWT structure`);for(let e=0;e<t.length;e++)if(!$E.test(t[e]))throw new gD(`JWT not in base64url format`);return{header:JSON.parse(SD(t[0])),payload:JSON.parse(SD(t[1])),signature:ED(t[2]),raw:{header:t[0],payload:t[1]}}}async function HD(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function UD(e,t){return new Promise((n,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{let r=await e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})()})}function WD(e){return(`0`+e.toString(16)).substr(-2)}function GD(){let e=new Uint32Array(56);if(typeof crypto>`u`){let e=``;for(let t=0;t<56;t++)e+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`.charAt(Math.floor(Math.random()*66));return e}return crypto.getRandomValues(e),Array.from(e,WD).join(``)}async function KD(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join(``)}async function qD(e){if(!(typeof crypto<`u`&&crypto.subtle!==void 0&&typeof TextEncoder<`u`))return console.warn(`WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.`),e;let t=await KD(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function JD(e,t,n=!1){let r=GD(),i=r;n&&(i+=`/PASSWORD_RECOVERY`),await LD(e,`${t}-code-verifier`,i);let a=await qD(r);return[a,r===a?`plain`:`s256`]}var YD=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function XD(e){let t=e.headers.get(ZE);if(!t||!t.match(YD))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function ZD(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function QD(e){switch(e){case`RS256`:return{name:`RSASSA-PKCS1-v1_5`,hash:{name:`SHA-256`}};case`ES256`:return{name:`ECDSA`,namedCurve:`P-256`,hash:{name:`SHA-256`}};default:throw Error(`Invalid alg claim`)}}var $D=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function eO(e){if(!$D.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function tO(){return new Proxy({},{get:(e,t)=>{if(t===`__isUserNotAvailableProxy`)return!0;if(typeof t==`symbol`){let e=t.toString();if(e===`Symbol(Symbol.toPrimitive)`||e===`Symbol(Symbol.toStringTag)`||e===`Symbol(util.inspect.custom)`)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function nO(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;if(typeof n==`symbol`){let t=n.toString();if(t===`Symbol(Symbol.toPrimitive)`||t===`Symbol(Symbol.toStringTag)`||t===`Symbol(util.inspect.custom)`||t===`Symbol(nodejs.util.inspect.custom)`)return Reflect.get(e,n,r)}return!t.value&&typeof n==`string`&&(console.warn(`Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server.`),t.value=!0),Reflect.get(e,n,r)}})}function rO(e){return JSON.parse(JSON.stringify(e))}var iO=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),aO=[502,503,504,520,521,522,523,524,530];async function oO(e){if(!ID(e))throw new pD(iO(e),0);if(aO.includes(e.status))throw new pD(iO(e),e.status);let t;try{t=await e.json()}catch(e){throw new rD(iO(e),e)}let n,r=XD(e);if(r&&r.getTime()>=QE[`2024-01-01`].timestamp&&typeof t==`object`&&t&&typeof t.code==`string`?n=t.code:typeof t==`object`&&t&&typeof t.error_code==`string`&&(n=t.error_code),!n){if(typeof t==`object`&&t&&typeof t.weak_password==`object`&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((e,t)=>
63e&&typeof t==`string`,!0))throw new hD(iO(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new hD(iO(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new aD;throw new tD(iO(t),e.status||500,n)}var sO=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};return e===`GET`?i:(i.headers=Object.assign({"Content-Type":`application/json;charset=UTF-8`},t?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function U(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[ZE]=QE[`2024-01-01`].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);let a=r?.query??{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let o=await cO(e,t,n+(Object.keys(a).length?`?`+new URLSearchParams(a).toString():``),{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(o):{data:Object.assign({},o),error:null}}async function cO(e,t,n,r,i,a){let o=sO(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw console.error(e),new pD(iO(e),0)}if(s.ok||await oO(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await oO(e)}}function lO(e){let t=null;hO(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=kD(e.expires_in)));let n=e.user??e;return{data:{session:t,user:n},error:null}}function uO(e){let t=lO(e);return!t.error&&e.weak_password&&typeof e.weak_password==`object`&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message==`string`&&e.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0)&&(t.data.weak_password=e.weak_password),t}function dO(e){return{data:{user:e.user??e},error:null}}function fO(e){return{data:e,error:null}}function pO(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=E(e,[`action_link`,`email_otp`,`hashed_token`,`redirect_to`,`verification_type`]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},user:Object.assign({},o)},error:null}}function mO(e){return e}function hO(e){return e.access_token&&e.refresh_token&&e.expires_in}var gO=[`global`,`local`,`others`],_O=class{constructor({url:e=``,headers:t={},fetch:n}){this.url=e,this.headers=t,this.fetch=FD(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(e,t=gO[0]){if(gO.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${gO.join(`, `)}`);try{return await U(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(H(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await U(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:dO})}catch(e){if(H(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=E(e,[`options`]),r=Object.assign(Object.assign({},n),t);return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await U(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:pO,redirectTo:t?.redirectTo})}catch(e){if(H(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await U(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:dO})}catch(e){if(H(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await U(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:mO});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>
630&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(H(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){eO(e);try{return await U(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:dO})}catch(e){if(H(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){eO(e);try{return await U(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:dO})}catch(e){if(H(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){eO(e);try{return await U(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:dO})}catch(e){if(H(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){eO(e.userId);try{let{data:t,error:n}=await U(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(H(e))return{data:null,error:e};throw e}}async _deleteFactor(e){eO(e.userId),eO(e.id);try{return{data:await U(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(H(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await U(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:mO});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(H(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await U(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(H(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await U(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(H(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await U(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(H(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await U(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(H(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await U(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(H(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await U(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(H(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await U(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(H(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await U(this.fetch,`GET`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(H(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await U(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(H(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await U(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(H(e))return{data:null,error:e};throw e}}};function vO(e={}){return{getItem:t=>
63e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}var yO={debug:!!(globalThis&&ND()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`)===`true`)},bO=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}},xO=class extends bO{};async function SO(e,t,n){yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquire lock`,e,t);let r=new globalThis.AbortController,i;t>0&&(i=setTimeout(()=>{r.abort(),yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock acquire timed out`,e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:`exclusive`,ifAvailable:!0}:{mode:`exclusive`,signal:r.signal},async r=>{if(r){clearTimeout(i),yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquired`,e,r.name);try{return await n()}finally{yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock: released`,e,r.name)}}else if(t===0)throw yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock: not immediately available`,e),new xO(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);else{if(yO.debug)try{let e=await globalThis.navigator.locks.query();console.log(`@supabase/gotrue-js: Navigator LockManager state`,JSON.stringify(e,null,`  `))}catch(e){console.warn(`@supabase/gotrue-js: Error when querying Navigator LockManager state`,e)}return console.warn(`@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request`),clearTimeout(i),await n()}})}catch(a){if(t>0&&clearTimeout(i),a?.name===`AbortError`&&t>0){if(r.signal.aborted)return yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock`,e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:`exclusive`,steal:!0},async t=>{if(t){yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock: recovered (stolen)`,e,t.name);try{return await n()}finally{yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock: released (stolen)`,e,t.name)}}else return console.warn(`@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true`),await n()}));throw yO.debug&&console.log(`@supabase/gotrue-js: navigatorLock: lock was stolen by another request`,e),new xO(`Lock "${e}" was released because another request stole it`)}throw a}}function CO(){if(typeof globalThis!=`object`)try{Object.defineProperty(Object.prototype,`__magic__`,{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<`u`&&(self.globalThis=self)}}function wO(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function TO(e){return parseInt(e,16)}function EO(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function DO(e){let{chainId:t,domain:n,expirationTime:r,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:s,resources:c,scheme:l,uri:u,version:d}=e;if(!Number.isInteger(t))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw Error(`@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.`);if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!u)throw Error(`@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.`);if(d!==`1`)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(e.statement?.includes(`
64`))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=wO(e.address),p=`${l?`${l}://${n}`:n} wants you to sign in with your Ethereum account:\n${f}\n\n${e.statement?`${e.statement}\n`:``}`,m=`URI: ${u}\nVersion: ${d}\nChain ID: ${t}${a?`\nNonce: ${a}`:``}\nIssued At: ${i.toISOString()}`;if(r&&(m+=`\nExpiration Time: ${r.toISOString()}`),o&&(m+=`\nNot Before: ${o.toISOString()}`),s&&(m+=`\nRequest ID: ${s}`),c){let e=`
65Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}
65var OO=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=r??(n instanceof Error?n.name:void 0)??`Unknown Error`,this.code=t}},kO=class extends OO{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function AO({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new OO({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new OO({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new OO({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new OO({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new OO({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new OO({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new OO({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new OO({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!LO(t))return new OO({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new OO({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new OO({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new OO({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new OO({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function jO({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new OO({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new OO({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!LO(t))return new OO({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new OO({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new OO({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new OO({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var MO=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}};function NO(e){if(!e)throw Error(`Credential creation options are required`);if(typeof PublicKeyCredential<`u`&&`parseCreationOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==`function`)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:n,excludeCredentials:r}=e,i=E(e,[`challenge`,`user`,`excludeCredentials`]),a=ED(t).buffer,o=Object.assign(Object.assign({},n),{id:ED(n.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){s.excludeCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];s.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:ED(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return s}function PO(e){if(!e)throw Error(`Credential request options are required`);if(typeof PublicKeyCredential<`u`&&`parseRequestOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON==`function`)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:n}=e,r=E(e,[`challenge`,`allowCredentials`]),i=ED(t).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];a.allowCredentials[e]=Object.assign(Object.assign({},t),{id:ED(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return a}function FO(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e;return{id:e.id,rawId:e.id,response:{attestationObject:OD(new Uint8Array(e.response.attestationObject)),clientDataJSON:OD(new Uint8Array(e.response.clientDataJSON))},type:`public-key`,clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment??void 0}}function IO(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e,n=e.getClientExtensionResults(),r=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:OD(new Uint8Array(r.authenticatorData)),clientDataJSON:OD(new Uint8Array(r.clientDataJSON)),signature:OD(new Uint8Array(r.signature)),userHandle:r.userHandle?OD(new Uint8Array(r.userHandle)):void 0},type:`public-key`,clientExtensionResults:n,authenticatorAttachment:t.authenticatorAttachment??void 0}}function LO(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function RO(){return!!(jD()&&`PublicKeyCredential`in window&&window.PublicKeyCredential&&`credentials`in navigator&&typeof(navigator==null?void 0:navigator.credentials)?.create==`function`&&typeof(navigator==null?void 0:navigator.credentials)?.get==`function`)}async function zO(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new kO(`Browser returned unexpected credential type`,t)}:{data:null,error:new kO(`Empty credential response`,t)}}
65catch(t){return{data:null,error:AO({error:t,options:e})}}}async function BO(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new kO(`Browser returned unexpected credential type`,t)}:{data:null,error:new kO(`Empty credential response`,t)}}catch(t){return{data:null,error:jO({error:t,options:e})}}}var VO={hints:[`security-key`],authenticatorSelection:{authenticatorAttachment:`cross-platform`,requireResidentKey:!1,userVerification:`preferred`,residentKey:`discouraged`},attestation:`direct`},HO={userVerification:`preferred`,hints:[`security-key`],attestation:`direct`};function UO(...e){let t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0)if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];t(n)?r[e]=UO(n,a):r[e]=UO(a)}else r[e]=a}return r}function WO(e,t){return UO(VO,e,t||{})}function GO(e,t){return UO(HO,e,t||{})}var KO=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:`webauthn`}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},i){try{let{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};let s=r??MO.createNewAbortSignal();if(a.webauthn.type===`create`){let{user:e}=a.webauthn.credential_options.publicKey;if(!e.name){let t=n;if(t)e.name=`${e.id}:${t}`;else{let t=(await this.client.getUser()).data.user,n=t?.user_metadata?.name||t?.email||t?.id||`User`;e.name=`${e.id}:${n}`}}e.displayName||=e.name}switch(a.webauthn.type){case`create`:{let{data:t,error:n}=await zO({publicKey:WO(a.webauthn.credential_options.publicKey,i?.create),signal:s});return t?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case`request`:{let t=GO(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await BO(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:t,signal:s}));return n?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(e){return H(e)?{data:null,error:e}:{data:null,error:new rD(`Unexpected error in challenge`,e)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new eD(`rpId is required for WebAuthn authentication`)};try{if(!RO())return{data:null,error:new rD(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!a)return{data:null,error:o};let{webauthn:s}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:s.type,rpId:t,rpOrigins:n,credential_response:s.credential_response}})}catch(e){return H(e)?{data:null,error:e}:{data:null,error:new rD(`Unexpected error in authenticate`,e)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new eD(`rpId is required for WebAuthn registration`)};try{if(!RO())return{data:null,error:new rD(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(t=>t.data?.all.find(t=>t.factor_type===`webauthn`&&t.friendly_name===e&&t.status!==`unverified`)).then(e=>e?this.client.mfa.unenroll({factorId:e?.id}):void 0),{data:null,error:o};let{data:s,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return s?this._verify({factorId:a.id,challengeId:s.challengeId,webauthn:{rpId:t,rpOrigins:n,type:s.webauthn.type,credential_response:s.webauthn.credential_response}}):{data:null,error:c}}catch(e){return H(e)?{data:null,error:e}:{data:null,error:new rD(`Unexpected error in register`,e)}}}};CO();var qO={url:JE,storageKey:YE,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:XE,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function JO(e,t,n){return await n()}var YO={},XO=class e{get jwks(){return YO[this.storageKey]?.jwks??{keys:[]}}set jwks(e){YO[this.storageKey]=Object.assign(Object.assign({},YO[this.storageKey]),{jwks:e})}get jwks_cached_at(){return YO[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){YO[this.storageKey]=Object.assign(Object.assign({},YO[this.storageKey]),{cachedAt:e})}constructor(t){var n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let r=Object.assign(Object.assign({},qO),t);if(this.storageKey=r.storageKey,this.instanceID=e.nextInstanceID[this.storageKey]??0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug==`function`&&(this.logger=r.debug),this.instanceID>0&&jD()){let e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.admin=new _O({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=FD(r.fetch),this.lock=r.lock||JO,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock?this.lock=r.lock:this.persistSession&&jD()&&(globalThis==null?void 0:globalThis.navigator)?.locks?this.lock=SO:this.lock=JO,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new KO(this)}
65,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:ND()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=vO(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=vO(this.memoryStorage)),jD()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error(`Failed to create a new BroadcastChannel, multi-tab state changes will not be available`,e)}(n=this.broadcastChannel)==null||n.addEventListener(`message`,async e=>{this._debug(`received broadcast notification from other tab or client`,e);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug(`#broadcastChannel`,`error`,e)}})}r.skipAutoInitialize||this.initialize().catch(e=>{this._debug(`#initialize()`,`error`,e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${GE}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise}async _initialize(){try{let e={},t=`none`;if(jD()&&(e=PD(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),jD()&&this.detectSessionInUrl&&t!==`none`){let{data:n,error:r}=await this._getSessionFromURL(e,t);if(r){if(this._debug(`#_initialize()`,`error detecting session from URL`,r),uD(r)){let e=r.details?.code;if(e===`identity_already_exists`||e===`identity_not_found`||e===`single_identity_not_deletable`)return{error:r}}return{error:r}}let{session:i,redirectType:a}=n;return this._debug(`#_initialize()`,`detected session in URL`,i,`redirect type`,a),await this._saveSession(i),setTimeout(async()=>{a===`recovery`?await this._notifyAllSubscribers(`PASSWORD_RECOVERY`,i):await this._notifyAllSubscribers(`SIGNED_IN`,i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return H(e)?this._returnResult({error:e}):this._returnResult({error:new rD(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await U(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:lO});if(n||!t)return this._returnResult({data:{user:null,session:null},error:n});let r=t.session,i=t.user;return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,r)),this._returnResult({data:{user:i,session:r},error:null})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await JD(this.storage,this.storageKey)),t=await U(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:{email:n,password:r,data:i?.data??{},gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},xform:lO})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await U(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:n,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:lO})}else throw new cD(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r||!n)return await zD(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:r});let i=n.session,a=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,i)),this._returnResult({data:{user:a,session:i},error:null})}catch(e){if(await zD(this.storage,`${this.storageKey}-code-verifier`),H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e;t=await U(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:uO})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await U(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:uO})}else throw new cD(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){let e=new sD;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!jD()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`ethereum`in e&&typeof e.ethereum==`object`&&`request`in e.ethereum&&typeof e.ethereum.request==`function`)s=e.ethereum;else throw Error(`@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href),l=await s.request({method:`eth_requestAccounts`}).then(e=>e).catch(()=>{throw Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`)});if(!l||l.length===0)throw Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);let u=wO(l[0]),d=o?.signInWithEthereum?.chainId;d||=TO(await s.request({method:`eth_chainId`})),t=DO({domain:c.host,address:u,statement:a,uri:c.href,version:`1`,chainId:d,nonce:o?.signInWithEthereum?.nonce,issuedAt:o?.signInWithEthereum?.issuedAt??new Date,expirationTime:o?.signInWithEthereum?.expirationTime,notBefore:o?.signInWithEthereum?.notBefore,requestId:o?.signInWithEthereum?.requestId,resources:o?.signInWithEthereum?.resources}),n=await s.request({method:`personal_sign`,params:[EO(t),u]})}try{let{data:r,error:i}=await U(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`ethereum`,message:t,signature:n},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:lO});if(i)throw i;if(!r||!r.session||!r.user){let e=new sD;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!jD()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`solana`in e&&typeof e.solana==`object`&&(`signIn`in e.solana&&typeof e.solana.signIn==`function`||`signMessage`in e.
65solana&&typeof e.solana.signMessage==`function`))s=e.solana;else throw Error(`@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href);if(`signIn`in s&&s.signIn){let e=await s.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},o?.signInWithSolana),{version:`1`,domain:c.host,uri:c.href}),a?{statement:a}:null)),r;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`)r=e[0];else if(e&&typeof e==`object`&&`signedMessage`in e&&`signature`in e)r=e;else throw Error(`@supabase/auth-js: Wallet method signIn() returned unrecognized value`);if(`signedMessage`in r&&`signature`in r&&(typeof r.signedMessage==`string`||r.signedMessage instanceof Uint8Array)&&r.signature instanceof Uint8Array)t=typeof r.signedMessage==`string`?r.signedMessage:new TextDecoder().decode(r.signedMessage),n=r.signature;else throw Error(`@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields`)}else{if(!(`signMessage`in s)||typeof s.signMessage!=`function`||!(`publicKey`in s)||typeof s!=`object`||!s.publicKey||!(`toBase58`in s.publicKey)||typeof s.publicKey.toBase58!=`function`)throw Error(`@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API`);t=[`${c.host} wants you to sign in with your Solana account:`,s.publicKey.toBase58(),...a?[``,a,``]:[``],`Version: 1`,`URI: ${c.href}`,`Issued At: ${o?.signInWithSolana?.issuedAt??new Date().toISOString()}`,...o?.signInWithSolana?.notBefore?[`Not Before: ${o.signInWithSolana.notBefore}`]:[],...o?.signInWithSolana?.expirationTime?[`Expiration Time: ${o.signInWithSolana.expirationTime}`]:[],...o?.signInWithSolana?.chainId?[`Chain ID: ${o.signInWithSolana.chainId}`]:[],...o?.signInWithSolana?.nonce?[`Nonce: ${o.signInWithSolana.nonce}`]:[],...o?.signInWithSolana?.requestId?[`Request ID: ${o.signInWithSolana.requestId}`]:[],...o?.signInWithSolana?.resources?.length?[`Resources`,...o.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join(`
66`);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await U(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:OD(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:lO});if(i)throw i;if(!r||!r.session||!r.user){let e=new sD;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await RD(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new fD;let{data:r,error:i}=await U(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:lO});if(await zD(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new sD;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await zD(this.storage,`${this.storageKey}-code-verifier`),H(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await U(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:lO});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new sD;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await JD(this.storage,this.storageKey));let{error:a}=await U(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await U(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new cD(`You must provide either an email or phone number.`)}catch(e){if(await zD(this.storage,`${this.storageKey}-code-verifier`),H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await U(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:lO});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await JD(this.storage,this.storageKey));let r=await U(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:fO});return r.data?.url&&jD()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await zD(this.storage,`${this.storageKey}-code-verifier`),H(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new aD;let{error:r}=await U(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,{error:a}=await U(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},redirectTo:i?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await U(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new cD(`You must provide either an email or phone number and a type`)}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lockAcquired||this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await RD(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not val
66id`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<qE:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await RD(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=tO()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=nO(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:r},error:null})}finally{this._debug(`#__loadSession()`,`end`)}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await U(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:dO}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new aD}:await U(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:dO})})}catch(e){if(H(e))return oD(e)&&(await this._removeSession(),await zD(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new aD;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await JD(this.storage,this.storageKey));let{data:c,error:l}=await U(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:dO});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await zD(this.storage,`${this.storageKey}-code-verifier`),H(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new aD;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=VD(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers(`SIGNED_IN`,i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(H(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new aD;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!jD())throw new lD(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new lD(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new dD(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new lD(`Not a valid implicit grant flow url.`);break;default:}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new dD(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);
66if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new lD(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(H(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await RD(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let{data:n,error:r}=t;if(r&&!oD(r))return this._returnResult({error:r});let i=n.session?.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(nD(t)&&(t.status===404||t.status===401||t.status===403)||oD(t)))return this._returnResult({error:t})}return e!==`others`&&(await this._removeSession(),await zD(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=AD(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),oD(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;this.flowType===`pkce`&&([n,r]=await JD(this.storage,this.storageKey,!0));try{return await U(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await zD(this.storage,`${this.storageKey}-code-verifier`),H(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await U(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return jD()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(H(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await U(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:lO});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new sD}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await zD(this.storage,`${this.storageKey}-code-verifier`),H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await U(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,`begin`);try{let n=Date.now();return await UD(async n=>(n>0&&await HD(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await U(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:lO})),(e,t)=>{let r=200*2**e;return t&&mD(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),H(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),jD()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await RD(this.storage,this.storageKey);if(t&&this.userStorage){let e=await RD(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await LD(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??tO()}else if(t&&!t.user&&!t.user){let e=await RD(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await zD(this.storage,this.storageKey+`-user`),await LD(this.storage,this.storageKey,t)):t.user=tO()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not val
66id`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now()<qE;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${qE}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(console.error(n),mD(n)||(this._debug(e,`refresh failed with a non-retryable error, removing the session`,n),await this._removeSession()))}}else if(t.user&&t.user.__isUserNotAvailableProxy===!0)try{let{data:n,error:r}=await this._getUser(t.access_token);!r&&n?.user?(t.user=n.user,await this._saveSession(t),await this._notifyAllSubscribers(`SIGNED_IN`,t)):this._debug(e,`could not get user data, skipping SIGNED_IN notification`)}catch(t){console.error(`Error getting user data:`,t),this._debug(e,`error getting user data, skipping SIGNED_IN notification`,t)}else await this._notifyAllSubscribers(`SIGNED_IN`,t)}catch(t){this._debug(e,`error`,t),console.error(t);return}finally{this._debug(e,`end`)}}async _callRefreshToken(e){var t,n;if(!e)throw new aD;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let r=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(r,`begin`);try{this.refreshingDeferred=new BD;let{data:t,error:n}=await this._refreshAccessToken(e);if(n)throw n;if(!t.session)throw new aD;await this._saveSession(t.session),await this._notifyAllSubscribers(`TOKEN_REFRESHED`,t.session);let r={data:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(e){if(this._debug(r,`error`,e),H(e)){let n={data:null,error:e};return mD(e)||await this._removeSession(),(t=this.refreshingDeferred)==null||t.resolve(n),n}throw(n=this.refreshingDeferred)==null||n.reject(e),e}finally{this.refreshingDeferred=null,this._debug(r,`end`)}}async _notifyAllSubscribers(e,t,n=!0){let r=`#_notifyAllSubscribers(${e})`;this._debug(r,`begin`,t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,`end`)}}async _saveSession(e){this._debug(`#_saveSession()`,e),this.suppressGetSessionWarning=!0,await zD(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),n=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&t.user&&await LD(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=rO(e);await LD(this.storage,this.storageKey,r)}else{let e=rO(t);await LD(this.storage,this.storageKey,e)}}async _removeSession(){this._debug(`#_removeSession()`),this.suppressGetSessionWarning=!1,await zD(this.storage,this.storageKey),await zD(this.storage,this.storageKey+`-code-verifier`),await zD(this.storage,this.storageKey+`-user`),this.userStorage&&await zD(this.userStorage,this.storageKey+`-user`),await this._notifyAllSubscribers(`SIGNED_OUT`,null)}_removeVisibilityChangedCallback(){this._debug(`#_removeVisibilityChangedCallback()`);let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&jD()&&window!=null&&window.removeEventListener&&window.removeEventListener(`visibilitychange`,e)}catch(e){console.error(`removing visibilitychange callback failed`,e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(`#_startAutoRefresh()`);let e=setInterval(()=>this._autoRefreshTokenTick(),KE);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug(`#_autoRefreshTokenTick()`,`begin`);try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/KE);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${KE}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e.isAcquireTimeout||e instanceof bO)this._debug(`auto refresh token tick lock not available`);else throw e}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!jD()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`?(this.autoRefreshToken&&this._startAutoRefresh(),e||(
66await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==`visible`){this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`);return}await this._recoverAndRefresh()}))):document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await JD(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await U(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await U(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?FO(e.webauthn.credential_response):IO(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await U(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers(`MFA_CHALLENGE_VERIFIED`,a),this._returnResult({data:a,error:o}))})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await U(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;if(a.type!==`webauthn`)return{data:a,error:null};switch(a.webauthn.type){case`create`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:NO(a.webauthn.credential_options.publicKey)})})}),error:null};case`request`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:PO(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=VD(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}
66=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=VD(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await U(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new aD})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new aD});let a=await U(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&jD()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new aD});let a=await U(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&jD()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await U(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new aD})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await U(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new aD})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await U(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}
66=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=VD(n);t?.allowExpired||ZD(i.exp);let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=QD(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,DD(`${o}.${s}`)))throw new gD(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}};XO.nextInstanceID={};var ZO=XO,QO=`2.104.0`,$O=``;$O=typeof Deno<`u`?`deno`:typeof document<`u`?`web`:typeof navigator<`u`&&navigator.product===`ReactNative`?`react-native`:`node`;var ek={headers:{"X-Client-Info":`supabase-js-${$O}/${QO}`}},tk={schema:`public`},nk={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},rk={};function ik(e){"@babel/helpers - typeof";return ik=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ik(e)}function ak(e,t){if(ik(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ik(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ok(e){var t=ak(e,`string`);return ik(t)==`symbol`?t:t+``}function sk(e,t,n){return(t=ok(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ck(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ck(Object(n),!0).forEach(function(t){sk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ck(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var uk=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),dk=()=>Headers,fk=(e,t,n)=>{let r=uk(n),i=dk();return async(n,a)=>{let o=await t()??e,s=new i(a?.headers);return s.has(`apikey`)||s.set(`apikey`,e),s.has(`Authorization`)||s.set(`Authorization`,`Bearer ${o}`),r(n,lk(lk({},a),{},{headers:s}))}};function pk(e){return e.endsWith(`/`)?e:e+`/`}function mk(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u={db:lk(lk({},o),n),auth:lk(lk({},s),r),realtime:lk(lk({},c),i),storage:{},global:lk(lk(lk({},l),a),{},{headers:lk(lk({},l?.headers??{}),a?.headers??{})}),accessToken:async()=>``};return e.accessToken?u.accessToken=e.accessToken:delete u.accessToken,u}function hk(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(pk(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var gk=class extends ZO{constructor(e){super(e)}},_k=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=hk(e);if(!t)throw Error(`supabaseKey is required.`);this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:tk,realtime:rk,auth:lk(lk({},nk),{},{storageKey:i}),global:ek},o=mk(n??{},a);this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=fk(t,this._getAccessToken.bind(this),o.global.fetch),this.realtime=this._initRealtimeClient(lk({headers:this.headers,accessToken:this._getAccessToken.bind(this)},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new Rw(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new WE(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new yw(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}
66channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l},u,d){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new gk({url:this.authUrl.href,headers:lk(lk({},f),u),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new GT(this.realtimeUrl.href,lk(lk({},e),{},{params:lk(lk({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`)&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e===`SIGNED_OUT`&&(this.realtime.setAuth(),t==`STORAGE`&&this.auth.signOut(),this.changedAccessToken=void 0)}},vk=(e,t,n)=>new _k(e,t,n);function yk(){if(typeof window<`u`)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}yk()&&console.warn(`⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217`);function bk(){if(typeof window>`u`)return;let e=location.hostname,t=[`lovableproject.com`,`lovableproject-dev.com`,`lovable.app`,`gpt-eng.com`,`gptengineer.run`].some(t=>e===t||e.endsWith(`.`+t)),n=`[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}`,r=t?e.match(RegExp(`^(?:id-preview(?:-[a-z0-9]+)?|project)--(`+n+`)(?:-dev)?(?=\\.|$)`,`i`))?.[1]??e.match(RegExp(`^(`+n+`)(?=[.-])`,`i`))?.[1]:void 0,i=window.parent&&window.parent!==window;if(!r||!i)return localStorage;let a=e.endsWith(`.lovableproject-dev.com`)||e.endsWith(`.gpt-eng.com`),o=a?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,s=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:``),c=s&&o.test(s)?[s]:a?[`https://lovable.dev`,`http://localhost:3000`]:[`https://lovable.dev`],l=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),u=(e,t,n)=>new Promise(i=>{let a=l(),o=!1,s,u=e=>{o||(o=!0,clearTimeout(s),window.removeEventListener(`message`,d),i(e))},d=e=>{if(c.indexOf(e.origin)<0)return;let t=e.data;t&&t.type===`lovable-preview-auth:result`&&t.requestId===a&&u(t)};window.addEventListener(`message`,d);let f={type:e,requestId:a,projectId:r,key:t};n!==void 0&&(f.value=n);for(let e of c)window.parent.postMessage(f,e);s=setTimeout(()=>u(null),2e3)}),d=!0;return{getItem:async e=>{let t=await u(`lovable-preview-auth:get`,e);return!t&&d&&(await new Promise(e=>setTimeout(e,250)),t=await u(`lovable-preview-auth:get`,e)),d=!1,t&&t.ok&&typeof t.value==`string`?t.value===``?(localStorage.removeItem(e),null):t.value:localStorage.getItem(e)},setItem:(e,t)=>(localStorage.setItem(e,t),u(`lovable-preview-auth:set`,e,t).then(()=>void 0)),removeItem:e=>(localStorage.removeItem(e),u(`lovable-preview-auth:remove`,e).then(()=>void 0))}}
vendor: 13,440 bytes, line 66
66var xk=vk(`https://phoeocgixntlqiooqqmj.supabase.co`,`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBob2VvY2dpeG50bHFpb29xcW1qIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM4NDY4NDMsImV4cCI6MjA4OTQyMjg0M30.-yftN3gu_y5PUACVGAocprCH6KC-xv_xAwBabvjb9To`,{auth:{storage:bk(),persistSession:!0,autoRefreshToken:!0}}),W;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(W||={});var Sk;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Sk||={});var G=W.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Ck=e=>{switch(typeof e){case`undefined`:return G.undefined;case`string`:return G.string;case`number`:return Number.isNaN(e)?G.nan:G.number;case`boolean`:return G.boolean;case`function`:return G.function;case`bigint`:return G.bigint;case`symbol`:return G.symbol;case`object`:return Array.isArray(e)?G.array:e===null?G.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?G.promise:typeof Map<`u`&&e instanceof Map?G.map:typeof Set<`u`&&e instanceof Set?G.set:typeof Date<`u`&&e instanceof Date?G.date:G.object;default:return G.unknown}},K=W.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`]),wk=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,W.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};wk.create=e=>new wk(e);var Tk=(e,t)=>{let n;switch(e.code){case K.invalid_type:n=e.received===G.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,W.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${W.joinValues(e.keys,`, `)}`;break;case K.invalid_union:n=`Invalid input`;break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${W.joinValues(e.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${W.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:n=`Invalid function arguments`;break;case K.invalid_return_type:n=`Invalid function return type`;break;case K.invalid_date:n=`Invalid date`;break;case K.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}"`:W.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case K.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case K.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case K.custom:n=`Invalid input`;break;case K.invalid_intersection_types:n=`Intersection results could not be merged`;break;case K.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,W.assertNever(e)}return{message:n}},Ek=Tk;function Dk(){return Ek}var Ok=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function q(e,t){let n=Dk(),r=Ok({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Tk?void 0:Tk].filter(e=>!!e)});e.common.issues.push(r)}var kk=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return J;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return J;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},J=Object.freeze({status:`aborted`}),Ak=e=>({status:`dirty`,value:e}),jk=e=>({status:`valid`,value:e}),Mk=e=>e.status===`aborted`,Nk=e=>e.status===`dirty`,Pk=e=>e.status===`valid`,Fk=e=>typeof Promise<`u`&&e instanceof Promise,Y;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(Y||={});var Ik=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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}},Lk=(e,t)=>{if(Pk(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new wk(e.common.issues),this._error}}};function X(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Z=class{get description(){return this._def.description}_getType(e){return Ck(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ck(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new kk,ctx:{common:e.parent.common,data:e.data,parsedType:Ck(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Fk(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ck(e)};return Lk(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ck(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Pk(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Pk(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ck(e)},r=this._parse({data:e,path:n.path,parent:n});return Lk(n,await(Fk(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:K.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new BA({schema:this,typeName:Q.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:e=>this[`~validate`](e)}}optional(){return VA.create(this,this._def)}nullable(){return HA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xA.create(this)}promise(){return zA.create(this,this._def)}or(e){return wA.create([this,e],this._def)}and(e){return OA.create(this,e,this._def)}transform(e){return new BA({...X(this._def),schema:this,typeName:Q.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new UA({...X(this._def),innerType:this,defaultValue:t,typeName:Q.ZodDefault})}brand(){return new KA({typeName:Q.ZodBranded,type:this,...X(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new WA({...X(this._def),innerType:this,catchValue:t,typeName:Q.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return qA.create(this,e)}readonly(){return JA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Rk=/^c[^\s-]{8,}
vendor: 39,220 bytes, line 66
66$/i,zk=/^[0-9a-z]+$/,Bk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vk=/^[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,Hk=/^[a-z0-9_-]{21}$/i,Uk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Wk=/^[-+]?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)?)??$/,Gk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kk=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,qk,Jk=/^(?:(?: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])$/,Yk=/^(?:(?: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])$/,Xk=/^(([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]))$/,Zk=/^(([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])$/,Qk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$k=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,eA=`((\\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])))`,tA=RegExp(`^${eA}$`);function nA(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function rA(e){return RegExp(`^${nA(e)}$`)}function iA(e){let t=`${eA}T${nA(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function aA(e,t){return!!((t===`v4`||!t)&&Jk.test(e)||(t===`v6`||!t)&&Xk.test(e))}function oA(e,t){if(!Uk.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function sA(e,t){return!!((t===`v4`||!t)&&Yk.test(e)||(t===`v6`||!t)&&Zk.test(e))}var cA=class e extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==G.string){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.string,received:t.parsedType}),J}let t=new kk,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:K.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:K.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?q(n,{code:K.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&q(n,{code:K.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Gk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`email`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)qk||=new RegExp(Kk,`u`),qk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`emoji`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Vk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`uuid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Hk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`nanoid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Rk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`cuid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)zk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`cuid2`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Bk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`ulid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),q(n,{validation:`url`,code:K.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`regex`,code:K.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?iA(r).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?tA.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?rA(r).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:K.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Wk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`duration`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?aA(e.data,r.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`ip`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?oA(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`jwt`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?sA(e.data,r.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`cidr`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Qk.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`base64`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?$k.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:`base64url`,code:K.invalid_string,message:r.message}),t.dirty()):W.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:K.invalid_string,...Y.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...Y.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...Y.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...Y.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...Y.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...Y.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...Y.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...Y.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...Y.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...Y.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...Y.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...Y.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...Y.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...Y.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Y.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...Y.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...Y.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...Y.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...Y.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...Y.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...Y.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...Y.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...Y.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...Y.errToObj(t)})}nonempty(e){return this.min(1,Y.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};cA.create=e=>new cA({checks:[],typeName:Q.ZodString,coerce:e?.coerce??!1,...X(e)});function lA(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var uA=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==G.number){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.number,received:t.parsedType}),J}let t,n=new kk;for(let r of this._def.checks)r.kind===`int`?W.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),q(t,{code:K.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?lA(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),q(t,{code:K.not_finite,message:r.message}),n.dirty()):W.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Y.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Y.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Y.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Y.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Y.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:Y.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Y.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Y.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Y.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Y.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&W.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};uA.create=e=>new uA({checks:[],typeName:Q.ZodNumber,coerce:e?.coerce||!1,...X(e)});var dA=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==G.bigint)return this._getInvalidInput(e);let t,n=new kk;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),q(t,{code:K.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):W.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.bigint,received:t.parsedType}),J}gte(e,t){return this.setLimit(`min`,e,!0,Y.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Y.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Y.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Y.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Y.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Y.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};dA.create=e=>new dA({checks:[],typeName:Q.ZodBigInt,coerce:e?.coerce??!1,...X(e)});var fA=class extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==G.boolean){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.boolean,received:t.parsedType}),J}return jk(e.data)}};fA.create=e=>new fA({typeName:Q.ZodBoolean,coerce:e?.coerce||!1,...X(e)});var pA=class e extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==G.date){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.date,received:t.parsedType}),J}if(Number.isNaN(e.data.getTime()))return q(this._getOrReturnCtx(e),{code:K.invalid_date}),J;let t=new kk,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:K.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:K.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):W.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Y.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Y.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};pA.create=e=>new pA({checks:[],coerce:e?.coerce||!1,typeName:Q.ZodDate,...X(e)});var mA=class extends Z{_parse(e){if(this._getType(e)!==G.symbol){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.symbol,received:t.parsedType}),J}return jk(e.data)}};mA.create=e=>new mA({typeName:Q.ZodSymbol,...X(e)});var hA=class extends Z{_parse(e){if(this._getType(e)!==G.undefined){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.undefined,received:t.parsedType}),J}return jk(e.data)}};hA.create=e=>new hA({typeName:Q.ZodUndefined,...X(e)});var gA=class extends Z{_parse(e){if(this._getType(e)!==G.null){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.null,received:t.parsedType}),J}return jk(e.data)}};gA.create=e=>new gA({typeName:Q.ZodNull,...X(e)});var _A=class extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return jk(e.data)}};_A.create=e=>new _A({typeName:Q.ZodAny,...X(e)});var vA=class extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jk(e.data)}};vA.create=e=>new vA({typeName:Q.ZodUnknown,...X(e)});var yA=class extends Z{_parse(e){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.never,received:t.parsedType}),J}};yA.create=e=>new yA({typeName:Q.ZodNever,...X(e)});var bA=class extends Z{_parse(e){if(this._getType(e)!==G.undefined){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.void,received:t.parsedType}),J}return jk(e.data)}};bA.create=e=>new bA({typeName:Q.ZodVoid,...X(e)});var xA=class e extends Z{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==G.array)return q(t,{code:K.invalid_type,expected:G.array,received:t.parsedType}),J;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(q(t,{code:e?K.too_big:K.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(q(t,{code:K.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(q(t,{code:K.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Ik(t,e,t.path,n)))).then(e=>kk.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Ik(t,e,t.path,n)));return kk.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Y.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Y.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Y.toString(n)}})}nonempty(e){return this.min(1,e)}};xA.create=(e,t)=>new xA({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Q.ZodArray,...X(t)});function SA(e){if(e instanceof CA){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=VA.create(SA(r))}return new CA({...e._def,shape:()=>t})}else if(e instanceof xA)return new xA({...e._def,type:SA(e.element)});else if(e instanceof VA)return VA.create(SA(e.unwrap()));else if(e instanceof HA)return HA.create(SA(e.unwrap()));else if(e instanceof kA)return kA.create(e.items.map(e=>SA(e)));else return e}var CA=class e extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:W.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==G.object){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.object,received:t.parsedType}),J}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof yA&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Ik(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof yA){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(q(n,{code:K.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Ik(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>kk.mergeObjectSync(t,e)):kk.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Y.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:Y.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of W.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of W.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return SA(this)}partial(t){let n={};for(let e of W.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of W.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof VA;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return IA(W.objectKeys(this.shape))}};CA.create=(e,t)=>new CA({shape:()=>e,unknownKeys:`strip`,catchall:yA.create(),typeName:Q.ZodObject,...X(t)}),CA.strictCreate=(e,t)=>new CA({shape:()=>e,unknownKeys:`strict`,catchall:yA.create(),typeName:Q.ZodObject,...X(t)}),CA.lazycreate=(e,t)=>new CA({shape:e,unknownKeys:`strip`,catchall:yA.create(),typeName:Q.ZodObject,...X(t)});var wA=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new wk(e.ctx.common.issues));return q(t,{code:K.invalid_union,unionErrors:n}),J}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new wk(e));return q(t,{code:K.invalid_union,unionErrors:i}),J}}get options(){return this._def.options}};wA.create=(e,t)=>new wA({options:e,typeName:Q.ZodUnion,...X(t)});var TA=e=>e instanceof PA?TA(e.schema):e instanceof BA?TA(e.innerType()):e instanceof FA?[e.value]:e instanceof LA?e.options:e instanceof RA?W.objectValues(e.enum):e instanceof UA?TA(e._def.innerType):e instanceof hA?[void 0]:e instanceof gA?[null]:e instanceof VA?[void 0,...TA(e.unwrap())]:e instanceof HA?[null,...TA(e.unwrap())]:e instanceof KA||e instanceof JA?TA(e.unwrap()):e instanceof WA?TA(e._def.innerType):[],EA=class e extends Z{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==G.object)return q(t,{code:K.invalid_type,expected:G.object,received:t.parsedType}),J;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(q(t,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=TA(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:Q.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...X(r)})}};function DA(e,t){let n=Ck(e),r=Ck(t);if(e===t)return{valid:!0,data:e};if(n===G.object&&r===G.object){let n=W.objectKeys(t),r=W.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=DA(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===G.array&&r===G.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=DA(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===G.date&&r===G.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var OA=class extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Mk(e)||Mk(r))return J;let i=DA(e.value,r.value);return i.valid?((Nk(e)||Nk(r))&&t.dirty(),{status:t.value,value:i.data}):(q(n,{code:K.invalid_intersection_types}),J)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};OA.create=(e,t,n)=>new OA({left:e,right:t,typeName:Q.ZodIntersection,...X(n)});var kA=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==G.array)return q(n,{code:K.invalid_type,expected:G.array,received:n.parsedType}),J;if(n.data.length<this._def.items.length)return q(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),J;!this._def.rest&&n.data.length>this._def.items.length&&(q(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Ik(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>kk.mergeArray(t,e)):kk.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};kA.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new kA({items:e,typeName:Q.ZodTuple,rest:null,...X(t)})};var AA=class e extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==G.object)return q(n,{code:K.invalid_type,expected:G.object,received:n.parsedType}),J;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Ik(n,e,n.path,e)),value:a._parse(new Ik(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?kk.mergeObjectAsync(t,r):kk.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Z?new e({keyType:t,valueType:n,typeName:Q.ZodRecord,...X(r)}):new e({keyType:cA.create(),valueType:t,typeName:Q.ZodRecord,...X(n)})}},jA=class extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==G.map)return q(n,{code:K.invalid_type,expected:G.map,received:n.parsedType}),J;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Ik(n,e,n.path,[a,`key`])),value:i._parse(new Ik(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return J;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return J;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};jA.create=(e,t,n)=>new jA({valueType:t,keyType:e,typeName:Q.ZodMap,...X(n)});var MA=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==G.set)return q(n,{code:K.invalid_type,expected:G.set,received:n.parsedType}),J;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(q(n,{code:K.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(q(n,{code:K.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return J;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Ik(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:Y.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Y.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};MA.create=(e,t)=>new MA({valueType:e,minSize:null,maxSize:null,typeName:Q.ZodSet,...X(t)});var NA=class e extends Z{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==G.function)return q(t,{code:K.invalid_type,expected:G.function,received:t.parsedType}),J;function n(e,n){return Ok({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dk(),Tk].filter(e=>!!e),issueData:{code:K.invalid_arguments,argumentsError:n}})}function r(e,n){return Ok({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dk(),Tk].filter(e=>!!e),issueData:{code:K.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof zA){let e=this;return jk(async function(...t){let o=new wk([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return jk(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new wk([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new wk([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:kA.create(t).rest(vA.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||kA.create([]).rest(vA.create()),returns:n||vA.create(),typeName:Q.ZodFunction,...X(r)})}},PA=class extends Z{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};PA.create=(e,t)=>new PA({getter:e,typeName:Q.ZodLazy,...X(t)});var FA=class extends Z{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return q(t,{received:t.data,code:K.invalid_literal,expected:this._def.value}),J}return{status:`valid`,value:e.data}}get value(){return this._def.value}};FA.create=(e,t)=>new FA({value:e,typeName:Q.ZodLiteral,...X(t)});function IA(e,t){return new LA({values:e,typeName:Q.ZodEnum,...X(t)})}var LA=class e extends Z{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return q(t,{expected:W.joinValues(n),received:t.parsedType,code:K.invalid_type}),J}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return q(t,{received:t.data,code:K.invalid_enum_value,options:n}),J}return jk(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};LA.create=IA;var RA=class extends Z{_parse(e){let t=W.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==G.string&&n.parsedType!==G.number){let e=W.objectValues(t);return q(n,{expected:W.joinValues(e),received:n.parsedType,code:K.invalid_type}),J}if(this._cache||=new Set(W.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=W.objectValues(t);return q(n,{received:n.data,code:K.invalid_enum_value,options:e}),J}return jk(e.data)}get enum(){return this._def.values}};RA.create=(e,t)=>new RA({values:e,typeName:Q.ZodNativeEnum,...X(t)});var zA=class extends Z{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==G.promise&&t.common.async===!1?(q(t,{code:K.invalid_type,expected:G.promise,received:t.parsedType}),J):jk((t.parsedType===G.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};zA.create=(e,t)=>new zA({type:e,typeName:Q.ZodPromise,...X(t)});var BA=class extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{q(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return J;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?J:r.status===`dirty`||t.value===`dirty`?Ak(r.value):r});{if(t.value===`aborted`)return J;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?J:r.status===`dirty`||t.value===`dirty`?Ak(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?J:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?J:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Pk(e))return J;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Pk(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):J);W.assertNever(r)}};
66BA.create=(e,t,n)=>new BA({schema:e,typeName:Q.ZodEffects,effect:t,...X(n)}),BA.createWithPreprocess=(e,t,n)=>new BA({schema:t,effect:{type:`preprocess`,transform:e},typeName:Q.ZodEffects,...X(n)});var VA=class extends Z{_parse(e){return this._getType(e)===G.undefined?jk(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};VA.create=(e,t)=>new VA({innerType:e,typeName:Q.ZodOptional,...X(t)});var HA=class extends Z{_parse(e){return this._getType(e)===G.null?jk(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};HA.create=(e,t)=>new HA({innerType:e,typeName:Q.ZodNullable,...X(t)});var UA=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===G.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};UA.create=(e,t)=>new UA({innerType:e,typeName:Q.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...X(t)});var WA=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Fk(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new wk(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new wk(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};WA.create=(e,t)=>new WA({innerType:e,typeName:Q.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...X(t)});var GA=class extends Z{_parse(e){if(this._getType(e)!==G.nan){let t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.nan,received:t.parsedType}),J}return{status:`valid`,value:e.data}}};GA.create=e=>new GA({typeName:Q.ZodNaN,...X(e)});var KA=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},qA=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?J:e.status===`dirty`?(t.dirty(),Ak(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?J:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:Q.ZodPipeline})}},JA=class extends Z{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Pk(e)&&(e.value=Object.freeze(e.value)),e);return Fk(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};JA.create=(e,t)=>new JA({innerType:e,typeName:Q.ZodReadonly,...X(t)}),CA.lazycreate;var Q;(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`})(Q||={});var YA=cA.create;uA.create,GA.create,dA.create,fA.create,pA.create,mA.create,hA.create,gA.create,_A.create,vA.create,yA.create,bA.create,xA.create;var XA=CA.create;CA.strictCreate,wA.create,EA.create,OA.create,kA.create,AA.create,jA.create,MA.create,NA.create,PA.create;var ZA=FA.create;LA.create,RA.create,zA.create,BA.create,VA.create,HA.create,BA.createWithPreprocess,qA.create;var QA=XA({full_name:YA().trim().min(1,`Name is required`).max(100),email:YA().trim().email(`Please enter a valid email`).max(255),company:YA().trim().min(1,`Company / utility name is required`).max(200),job_title:YA().trim().max(100).optional().or(ZA(``)),phone:YA().trim().max(30).optional().or(ZA(``)),utility_size:YA().optional().or(ZA(``)),message:YA().trim().max(2e3).optional().or(ZA(``))}),$A=()=>{let[e,t]=(0,M.useState)({full_name:``,email:``,company:``,job_title:``,phone:``,utility_size:``,message:``}),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)({}),c=(e,n)=>{t(t=>({...t,[e]:n})),o[e]&&s(t=>({...t,[e]:``}))};return i?(0,N.jsxs)(`div`,{className:`text-center py-12`,children:[(0,N.jsx)(`div`,{className:`w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-6`,children:(0,N.jsx)(va,{size:32,className:`text-primary`})}),(0,N.jsx)(`h3`,{className:`text-2xl font-bold mb-3`,children:`Thank you for your interest!`}),(0,N.jsx)(`p`,{className:`text-muted-foreground max-w-md mx-auto`,children:`We've received your pilot request and our team will be in touch within 1–2 business days.`})]}):(0,N.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),s({});let n=QA.safeParse(e);if(!n.success){let e={};for(let t of n.error.issues){let n=t.path[0];e[n]||(e[n]=t.message)}s(e);return}r(!0);try{let{error:e}=await xk.from(`pilot_requests`).insert({full_name:n.data.full_name,email:n.data.email,company:n.data.company,job_title:n.data.job_title||null,phone:n.data.phone||null,utility_size:n.data.utility_size||null,message:n.data.message||null});if(e)throw e;let{error:t}=await xk.functions.invoke(`send-contact-email`,{body:{full_name:n.data.full_name,email:n.data.email,company:n.data.company,job_title:n.data.job_title||``,phone:n.data.phone||``,utility_size:n.data.utility_size||``,message:n.data.message||``}});t&&console.error(`Email notification failed:`,t),a(!0),fr.success(`Your pilot request has been submitted!`)}catch{fr.error(`Something went wrong. Please try again or email us directly.`)}finally{r(!1)}},className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-6`,children:[(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(Ub,{htmlFor:`full_name`,children:`Full Name *`}),(0,N.jsx)(Ib,{id:`full_name`,value:e.full_name,onChange:e=>c(`full_name`,e.target.value),placeholder:`Jane Smith`}),o.full_name&&(0,N.jsx)(`p`,{className:`text-sm text-destructive`,children:o.full_name})]}),(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(Ub,{htmlFor:`email`,children:`Work Email *`}),(0,N.jsx)(Ib,{id:`email`,type:`email`,value:e.email,onChange:e=>c(`email`,e.target.value),placeholder:`[email protected]`}),o.email&&(0,N.jsx)(`p`,{className:`text-sm text-destructive`,children:o.email})]})]}),(0,N.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-6`,children:[(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(Ub,{htmlFor:`company`,children:`Company / Utility Name *`}),(0,N.jsx)(Ib,{id:`company`,value:e.company,onChange:e=>c(`company`,e.target.value),placeholder:`Acme Energy`}),o.company&&(0,N.jsx)(`p`,{className:`text-sm text-destructive`,children:o.company})]}),(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(Ub,{htmlFor:`job_title`,children:`Job Title`}),(0,N.jsx)(Ib,{id:`job_title`,value:e.job_title,onChange:e=>c(`job_title`,e.target.value),placeholder:`Program Manager`})]})]}),(0,N.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-6`,children:[(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(Ub,{htmlFor:`phone`,children:`Phone`}),(0,N.jsx)(Ib,{id:`phone`,type:`tel`,value:e.phone,onChange:e=>c(`phone`,e.target.value),placeholder:`(555) 123-4567`})]}),(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(Ub,{htmlFor:`utility_size`,children:`Utility Size`}),(0,N.jsxs)(iw,{value:e.utility_size,onValueChange:e=>c(`utility_size`,e),children:[(0,N.jsx)(ow,{id:`utility_size`,children:(0,N.jsx)(aw,{placeholder:`Select customer base size`})}),(0,N.jsxs)(lw,{children:[(0,N.jsx)(dw,{value:`under-50k`,children:`Under 50,000 customers`}),(0,N.jsx)(dw,{value:`50k-250k`,children:`50,000 – 250,000 customers`}),(0,N.jsx)(dw,{value:`250k-1m`,children:`250,000 – 1,000,000 customers`}),(0,N.jsx)(dw,{value:`over-1m`,children:`Over 1,000,000 customers`})]})]})]})]}),(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(Ub,{htmlFor:`message`,children:`Tell us about your goals`}),(0,N.jsx)(Lb,{id:`message`,value:e.message,onChange:e=>c(`message`,e.target.value),placeholder:`What programs are you looking to launch or improve? Any specific challenges or goals?`,rows:4})]}
66),(0,N.jsxs)(S,{type:`submit`,variant:`accent`,size:`xl`,disabled:n,className:`w-full md:w-auto`,children:[n?`Submitting…`:`Submit Pilot Request`,` `,(0,N.jsx)(da,{size:18})]})]})},ej=({children:e,className:t=``,id:n,style:r})=>{let i=(0,M.useRef)(null),[a,o]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{let e=i.current;if(!e)return;if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){o(!0);return}let t=new IntersectionObserver(([e])=>{e.isIntersecting&&(o(!0),t.disconnect())},{threshold:0,rootMargin:`200px 0px`});t.observe(e);let n=setTimeout(()=>o(!0),1500);return()=>{t.disconnect(),clearTimeout(n)}},[]),(0,N.jsx)(`section`,{ref:i,id:n,className:`section-padding ${t}`,style:{...r,opacity:a?1:0,transform:a?`translateY(0)`:`translateY(20px)`,transition:`opacity 0.5s cubic-bezier(0.2,0,0,1), transform 0.5s cubic-bezier(0.2,0,0,1)`},children:(0,N.jsx)(`div`,{className:`container-narrow`,children:e})})},tj=`/assets/consumers-energy-B0IjiNvq.webp`,nj=`/assets/nicor-peoples-northshore-C-29uvos.webp`,rj=`data:image/webp;base64,UklGRvALAABXRUJQVlA4IOQLAADwVACdASrkAdAAPm02mEikIyKhIvTpaIANiWlu4XShH856ke1n2P7YZP/Uv9QH23eopuAP1m9cD0Lf9H1AOkU59H2Zf3L9KrVLfG/9b7V/7x9rv+3uTj5J9pPzH9l/bT8xuf3gBfkn8t/x+/CgA/P/7P/tvCC1TcgD8o+OS9E9gD+a/1v9d/Xr+rPQH+e/5j/0/6X4Cv5j/bv+j2TPSHGDov0RFsf2cVB1awj9nFQdWsI/ZxUHVrCP2cVB1awj9nFQdWsI/ZxUHVrCP2cVB1awj9nFQdWsI/ZxUHVrCP2cVB1awj9nFQdWsI/YhbTuMCrNvD09OnW9Jiy5s4geU/CPnkzy6rd/DSBCWo8raUXSg8XEF/Cu/Q7lVRox4RLO6dMHaKg9FVdW26KOef+mh7CpywFYfdEJcdNXjji1wdkyVy1V/3S1WbcsXq9Xey9F5oi+PZgdjdbBTPgyjJt7Db1SWO9Ez4F6To1j14+dkABP+FRmdozOkC/BDWbamYUJZQwmnHNZCBRKDU27OHjEVzMIyKlhietK+4bB8BjQCKWrNLdZrrb+l+J0g7U35/v6eRBBTgZWkJovzz589+ef+mK8B5eTWfIygZIVCZ4/I5zbTPxqEEJpGHaDAc45fKZ9CSQjyOBJ0ChJnsFqGKHBZTzhW/OgSPtNFUQYUlijlT4gICgo/gqtN0tNp9emZpMoqjqFU44/FVxeUhbsYU1SPqsaBrVrNNrF7CWnkOgXF5iKJokEiunJbPOb+5xmeljZqTDYj0v0wDRiIJLDNHp06hawuPOudnilLxoE0m3tE0PByyP7zkyJxXcDxmXzxrhgbt3h1awj+Eb0HjzHc1fmO5q/MT0RFsf2cVB1awj9nFQdWsI/ZxUHVrCP2cVB1awj9nFQdWsI/ZxUHVrCP2cVB1XgAP7/ncgAAAAA1dQ2OcNRXhHz+/t7zJl2yfzoTBfbwWaUYJ6Y+j5+LTVIV3nC4zpiBbR4761P8LuDnrpwKsxFTUkpiSo8FzYi//xf6dv7wtuQtqlMAek7bb8nId1CRjSH01VLHDeHcmR+HgHlBFaoxyD2EDf38ossFrHf+Z/lVEPLfzZKwpSGKvgCJFUA/4SvPusRHJyvLbEIvoP/mz/3wyRDRB8oGO8DsQwKbWQ+qfH1aHgFqE+d0ryqaF8mLAi50UIWiFjWb8g+Zz2VSKmgfslBGa7LpE6xJRD4xvYn+GrvXRdspLZPHwXj9XrEOOZe9FsijiO/a32NWhjMsu9MPhxWN/A1JvVS0groKrYW+c22ZV04WAFzDJipWu5s6e5dJEK2W1i2i56bIKrHp8NshMvMK+JT//DftdXN1GSDn4aAPj6+j3BO4DDzon7rPjm/T0buxBO/FsAV12kgecqOWu0XKqo+vwH57VNgjGRMkKMzgb9wq2OIhREWzZrm9FnoRU5eIHdRnSJ6F+ARZ/3/M6zsXguLHd6JffT/+eLNu8r/8/6Uu51wu9xZ2NqzaTjNE9Lx/WMBJZRNJRQbC3dz9JCDPIlwXUelQR4KBPe8x25/lYfFlaYNlAxIlRxe8VG6kqnBZw47dc5z6PuVbpZhq2Hk17xojfKdT4OL6/z6t8TYxEWCv0v3eOuJ6/DLJ3D++CV01CYkvrMWTeGCgXztyy/hsqhrQFVBX3Jg0f9s8uClsxPekJXV8Zd1nTGmqiZ+bRyJ9LTpcduFJHSTJdRVoJJMOzTe+x8+OI0H23iHqOVIh/2Ye5kd4PQARsSB8/ZyRyd9+pZYH2WnPQT/q+xUcXvUQx21/0/6p5ZTgst4qs/mYxovXjgXkwOv6RLQc5AS0VHv2SktqRhcYvAUM/NsGL1uK06kccQ/DOcO4YAvFyMvGcAmO4eIOwmkaprtjGPZm5AQ9SBj0pZA3nakGf5TydKs/jNooOWFxc2PtWpMsiBv2BrtH8ixf6YkkZCxfw6xX/+095iT/S7vOnwVdInlqbusEDsThmnDpNeZuCSIylnVzfqsdbIX57lLbiGJ8Ktul7zrcXJW9vnFC7IcrY8x2hT705T8/r5pukS+ZMMoJr3WvKpTpVpwPgjT66Adml41PWVLbhNO+VRx7/2QN2zYyn9DvQcZcasMVt1FyfglwXtDXXZ+gdPVbNGvBdAUJh7CTFAPgZSijUEl17qALZcAIq5oEzQODxZUXmTkJucg7980SCNMzrBI+LoadcAmJgp9J2qa0mwazq8PKQFRL1/TXubn3CvhH1qbUhazrg7H0HVvtepXojy0+4DgFCtKFL/bLJRSzNK8DgHagcq/+G71l0myR4qWNL9pW5M/lbE/1/NXM07ZUjuKrE5N6CekVC6Op4niNfgfGkOjKE2u4d6yjZMofCAl2rmDt/8DJhjLSlZLjr9pI8zd4kFvRA5+79pM6WBu2Ah/qCsK3gMPhFbQR7/jYTrw17Hp934uK8iFhbGt+P9eOEvkFSejzi9ITjEIjNh/Rss4M5yKDxpf6yOyN5+Hpq/r/8kEazlDrx5gAsNxY/J2Op/lmnjXI51/iiaNwCzysiFd0e6uxf7x6DqZrJ9ywP9X7fp4RZyrR/ROxp3c8GnghG/+szW6aj/gs3yy6P9WeF/Kjh1aiQOVHxgGwoPP+kh0Ij2A63pQuMCf74Dy9kB+A0ufH/x8ytFsU/c59YFHQ/8pVSIu+vardOO4g0NZRMK27Wa86uP/zK9umnn+VWih/hr6gB2DMTLN5+EfiVgjs+nOvJyjMKF4KV60vY9NWf+6IpuC2bWqmRHTx1mGKhHNEvTR7RvFNixLLBnaY4mU0FgMnffxcmPLdhKD41XP1KnJgC3hiSAFYr4bIg9SLZzwjwoFCJ2aRSRSO+x7jkOS3PGyDirHsnybB65fw14gP8EicnjHnAV346OQsEytstVu+rfy1zu1vAxyNUnDVWcvYf1PNxj2V2IEpvx3MW0CJjKTHKtMMAyUmRuoQqMtPce2CJnw7H3J8o1/Lk2j/haW9wt/vS/UjJbt55Dx6P2e1MQUEzBDsTYMqClFxTyhOf/+rP6IA0smnGJzeNGEnJlsIoFIrzDezEm/ypTnCDqoEHJky83lF/aX9VeELwE
66hE1tgBagyOQ2RJTv/JREgalaR4pBXFcxx8L9W5g/z9lp5j29FJrSuIjeYxwIIMH7sUzy2CaB/lPQbC/EK7EVcDAIKhq388jrO4f824Ht4vBF8yqvPrTVxW8TVAUZi28zejiOGb9GMlo9BkfsYFz58ULkhKxrUWwQMs+8Z/jQh7pQroe1W5fvN2gglyflz/I6y+Nwi9ZAp2OMH7GhKrNGRlQj+Jq3OyTsQMbLJMwys8YcVUSn+mm1siHmO3/wVYkbzAUSiNsaiOmz/8OqpErUPY9TxH9maxuh8Zbl0J7FTT56Lm1aIXHbc85Q0C9ipE+DN/e5Msergx5/SunNHTkG45+7/7RUnWN0nJnwIeHRcnQpjzSUkgsKrhDCmKNMZSVoHnwBZRL2JnS+RQWKoZlnyex3d+jKT/G2Y6dqO2w+LU83X3nPzodkbnYLsw4WHSMvklG9T5KbdRYPqcN4K8ZmhirkfxmaGl0UAIH5I8cbmWnq8J6W65bV7NOL2kO2uiATMv418QADd1PBWdL++beX0E+fk+9mC/D+icuQh2Xn//q9H+wi+dlADN8yeOQuPeerC0evS19HC+O93xKLMKBfisuvRFope2NqZfnfDOJdwNNu/3iq0cMQj1hcvzd/R14snU9W0sk+0CUBCM0o5fCBMNnnm3h6424dv7YogZmncM3RJZMUwjt9eFfIFrD2XcCqMBzMfdbxkGA/Mm8SrUxBAFnw/9JeXp8sXqqGD6mfAAz3kC3KPr/KwjlL9F5i0j3eGtoSb4mRmQSgqEVTKCEKtR9Q8eZicbx4/i39Ro13mSRXniiksPAH9ynXKdpO42MqlSgIeHz0Jli/NY7VqvFan3axFRvIZwlXYoQOcjhDIbxydC9GPPUsrAJ7owWahVrZ2y5lmLy7KReau4bXZomPi/maq9YDzN60WlJjlCtF99ies6iDzlAWnxUyp2IEvRkWlOPluJY06VukgjPhAAAAAAAAAAA==`,ij=`/assets/bge-BlqZBkQZ.webp`,aj=`/assets/orange-rockland-DYUTHi9u.webp`,oj=`/assets/avista-Bj6crZ0G.webp`,sj=`/assets/central-hudson-DXWUVMgF.webp`,cj=[{name:`Consumers Energy`,logo:tj},{name:`Nicor Gas · Peoples Gas · North Shore Gas`,logo:nj},{name:`BGE`,logo:ij},{name:`Eversource`,logo:rj},{name:`Orange & Rockland`,logo:aj},{name:`Avista Corp.`,logo:oj},{name:`OPPD`,logo:`/assets/oppd-EHoVHLKo.webp`},{name:`Central Hudson`,logo:sj},{name:`Dominion Energy`,logo:`/assets/dominion-energy-Cb2VUIaE.webp`}],lj=({partner:e})=>(0,N.jsx)(`div`,{className:`flex items-center justify-center h-20 px-10 shrink-0`,children:e.logo?(0,N.jsx)(`img`,{src:e.logo,alt:e.name,className:`h-10 md:h-14 w-auto object-contain opacity-60 hover:opacity-100 transition-opacity duration-300`}):(0,N.jsx)(`span`,{className:`text-lg md:text-xl font-bold tracking-tight text-muted-foreground/40 hover:text-muted-foreground/80 transition-colors duration-300 whitespace-nowrap`,children:e.name})}),uj=()=>(0,N.jsxs)(`section`,{className:`py-10 md:py-14 bg-secondary/20 overflow-hidden`,children:[(0,N.jsx)(`p`,{className:`text-center text-sm font-semibold uppercase tracking-widest text-muted-foreground mb-8 px-6`,children:`Trusted by leading utilities across the country`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 w-20 md:w-32 bg-gradient-to-r from-white to-transparent z-10 pointer-events-none`}),(0,N.jsx)(`div`,{className:`absolute right-0 top-0 bottom-0 w-20 md:w-32 bg-gradient-to-l from-white to-transparent z-10 pointer-events-none`}),(0,N.jsx)(`div`,{className:`flex animate-scroll-logos hover:[animation-play-state:paused]`,children:[...cj,...cj].map((e,t)=>(0,N.jsx)(lj,{partner:e},`${e.name}-${t}`))})]})]}),dj=({src:e,alt:t=``,className:n,wrapperClassName:r,priority:i=!1,aspectRatio:a,style:o,...s})=>{let[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(!0),f=(0,M.useRef)(null);(0,M.useEffect)(()=>{window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&d(!1),f.current?.complete&&f.current?.naturalWidth>0&&l(!0)},[]);let p={...a?{aspectRatio:a}:{}};return(0,N.jsxs)(`div`,{className:w(`relative overflow-hidden`,r),style:p,children:[!c&&(0,N.jsx)(`div`,{className:`absolute inset-0 bg-muted animate-pulse rounded-[inherit]`}),(0,N.jsx)(`img`,{ref:f,src:e,alt:t,loading:i?`eager`:`lazy`,decoding:i?`sync`:`async`,...i?{fetchPriority:`high`}:{},onLoad:()=>l(!0),className:w(`transition-opacity duration-500 ease-out`,u&&!c?`opacity-0`:`opacity-100`,n),style:o,...s})]})},fj=`https://www.homeboost.com`,pj=`https://storage.googleapis.com/gpt-engineer-file-uploads/9KK4Xs2SFcVcAwaAPBfFJJrTAM02/social-images/social-1773931652354-homeboost_socialcover.webp`,mj=({title:e,description:t,path:n,image:r=pj,noindex:i=!1})=>{let a=`${fj}${n}`;return(0,N.jsxs)(c,{children:[(0,N.jsx)(`title`,{children:e}),(0,N.jsx)(`meta`,{name:`description`,content:t}),(0,N.jsx)(`link`,{rel:`canonical`,href:a}),i&&(0,N.jsx)(`meta`,{name:`robots`,content:`noindex, nofollow`}),i&&(0,N.jsx)(`meta`,{name:`googlebot`,content:`noindex, nofollow`}),(0,N.jsx)(`meta`,{property:`og:type`,content:`website`}),(0,N.jsx)(`meta`,{property:`og:url`,content:a}),(0,N.jsx)(`meta`,{property:`og:title`,content:e}),(0,N.jsx)(`meta`,{property:`og:description`,content:t}),(0,N.jsx)(`meta`,{property:`og:image`,content:r}),(0,N.jsx)(`meta`,{name:`twitter:card`,content:`summary_large_image`}),(0,N.jsx)(`meta`,{name:`twitter:url`,content:a}),(0,N.jsx)(`meta`,{name:`twitter:title`,content:e}),(0,N.jsx)(`meta`,{name:`twitter:description`,content:t}),(0,N.jsx)(`meta`,{name:`twitter:image`,content:r})]})},hj=`/assets/grid-visualization-CpeyGVMv.webp`,gj=`/assets/boostbox-rugged-DwE1y4ii.webp`,_j=()=>(0,N.jsxs)(`main`,{className:`pt-0`,children:[(0,N.jsx)(mj,{title:`HomeBoost for Utilities — Affordable Energy Programs`,description:`Launch affordable, customer-loved energy assessment programs. DIY, Pro, and Library solutions that drive action and reach every customer segment.`,path:`/utilities`}),(0,N.jsxs)(`section`,{className:`px-6 py-12 md:px-8 md:py-16 lg:py-20 relative overflow-hidden min-h-[45vh] flex items-center`,children:[(0,N.jsxs)(`div`,{className:`absolute inset-0`,children:[(0,N.jsx)(dj,{priority:!0,src:hj,alt:`Smart energy grid visualization representing utility infrastru
66cture`,className:`w-full h-full object-cover opacity-30`,wrapperClassName:`w-full h-full`}),(0,N.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-r from-background via-background/95 to-background/70`})]}),(0,N.jsx)(`div`,{className:`container-narrow relative z-10`,children:(0,N.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,N.jsx)(`h1`,{className:`text-display mb-6`,children:`Modernize your energy efficiency programs`}),(0,N.jsx)(`p`,{className:`text-body-lg mb-8`,children:`HomeBoost helps utilities increase homeowner engagement, lower program costs, and deliver measurable energy savings at scale — with tools & software people love.`}),(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,N.jsx)(S,{variant:`accent`,size:`xl`,asChild:!0,children:(0,N.jsxs)(`a`,{href:`#request-pilot`,children:[`Request a Pilot `,(0,N.jsx)(da,{size:18})]})}),(0,N.jsx)(S,{variant:`hero-outline`,size:`xl`,asChild:!0,children:(0,N.jsx)(`a`,{href:`#library-program`,children:`Learn about Library Programs`})})]}),(0,N.jsxs)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:[`New to HomeBoost? `,(0,N.jsx)(F,{to:`/how-it-works`,className:`text-primary underline underline-offset-2`,children:`See how it works`}),` for homeowners and utilities.`]})]})})]}),(0,N.jsx)(uj,{}),(0,N.jsx)(`div`,{className:`border-b border-border`}),(0,N.jsxs)(ej,{className:`bg-secondary/30`,children:[(0,N.jsxs)(`div`,{className:`text-center mb-12`,children:[(0,N.jsx)(`div`,{className:`inline-flex items-center gap-2 bg-primary/10 text-primary rounded-full px-4 py-1.5 text-sm font-semibold mb-4`,children:`Comprehensive Coverage`}),(0,N.jsxs)(`h2`,{className:`text-headline mb-4`,children:[(0,N.jsx)(`span`,{className:`text-primary`,children:`The HomeBoost approach.`}),` Three programs. Every customer segment.`]}),(0,N.jsx)(`p`,{className:`text-body-lg max-w-3xl mx-auto`,children:`HomeBoost delivers a comprehensive, customer-loved, and affordable energy assessment platform — purpose-built to reach homeowners, field professionals, and community members through your existing channels.`})]}),(0,N.jsx)(`div`,{className:`grid md:grid-cols-3 gap-8`,children:[{icon:(0,N.jsx)(wa,{size:28}),title:`DIY Program`,tagline:`Empower the homeowner`,desc:`Put scientifically accurate, basic home energy assessments directly in customers' hands. Ship a DIY Kit with professional-grade tools — customers scan their own homes and receive expert-reviewed reports with personalized recommendations and local rebate info.`,highlights:[`Professional thermal & diagnostic tools`,`Expert-reviewed reports`,`Personalized rebate guidance`],link:{label:`Learn about DIY Kits`,path:`/homeowners`}},{icon:(0,N.jsx)(Na,{size:28}),title:`Pro Program`,tagline:`Arm your field assessors`,desc:`Equip your energy assessors with the #1 home energy assessment software — certified by the DOE as BPI 2400 compliant. HomeBoost saves an average of 25% of time in the house and 80% of time creating reports.`,highlights:[`BPI 2400 certified by the DOE`,`25% faster in-home assessments`,`80% faster report generation`],link:{label:`Learn about Pro tools`,path:`/pro`}},{icon:(0,N.jsx)(Ea,{size:28}),title:`Library Program`,tagline:`Integrate into the community`,desc:`Partner with local libraries to lend HomeBoost DIY Energy kits to patrons — just like borrowing a book. Extend your program's reach into the community through a trusted, accessible channel.`,highlights:[`Kits circulate like library items`,`No staff training needed`,`< 3 business day turnaround`],link:{label:`Learn about Library Programs`,path:`#library-program`}}].map(e=>(0,N.jsxs)(Fb.div,{whileHover:{y:-6},transition:{type:`spring`,stiffness:400,damping:30},className:`ceramic-card p-8 flex flex-col`,children:[(0,N.jsx)(`div`,{className:`w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mb-5 text-primary`,children:e.icon}),(0,N.jsx)(`div`,{className:`text-xs font-semibold text-primary uppercase tracking-wider mb-1`,children:e.tagline}),(0,N.jsx)(`h3`,{className:`font-bold text-xl mb-3`,children:e.title}),(0,N.jsx)(`p`,{className:`text-muted-foreground text-sm mb-5 flex-1`,children:e.desc}),(0,N.jsx)(`div`,{className:`space-y-2 mb-6`,children:e.highlights.map(e=>(0,N.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,N.jsx)(va,{size:14,className:`text-primary shrink-0`}),(0,N.jsx)(`span`,{children:e})]},e))}),(0,N.jsx)(S,{variant:`outline`,size:`sm`,className:`w-full mt-auto`,asChild:!0,children:e.link.path.startsWith(`#`)?(0,N.jsxs)(`a`,{href:e.link.path,children:[e.link.label,` `,(0,N.jsx)(da,{size:14})]}):(0,N.jsxs)(F,{to:e.link.path,children:[e.link.label,` `,(0,N.jsx)(da,{size:14})]})})]},e.title))}),(0,N.jsx)(`div`,{className:`text-center mt-10`,children:(0,N.jsx)(S,{variant:`accent`,
66size:`xl`,asChild:!0,children:(0,N.jsxs)(`a`,{href:`#request-pilot`,children:[`Request a Pilot `,(0,N.jsx)(da,{size:18})]})})})]}),(0,N.jsxs)(ej,{className:`bg-secondary/30`,children:[(0,N.jsxs)(`div`,{className:`text-center mb-12`,children:[(0,N.jsx)(`div`,{className:`inline-flex items-center gap-2 bg-primary/10 text-primary rounded-full px-4 py-1.5 text-sm font-semibold mb-4`,children:`Self-Reported Customer Study`}),(0,N.jsx)(`h2`,{className:`text-headline mb-4`,children:`HomeBoost is loved — and drives real action`}),(0,N.jsx)(`p`,{className:`text-body-lg max-w-2xl mx-auto mb-6`,children:`Customers don't just read their reports — they act on them. Here's what our study found.`}),(0,N.jsx)(S,{variant:`accent`,size:`lg`,asChild:!0,children:(0,N.jsxs)(`a`,{href:`#request-pilot`,children:[`Request a Pilot `,(0,N.jsx)(da,{size:16})]})})]}),(0,N.jsx)(`div`,{className:`grid md:grid-cols-2 lg:grid-cols-4 gap-6`,children:[{num:`55`,label:`Net Promoter Score — customers love the experience`,icon:(0,N.jsx)(ja,{size:24}),suffix:`NPS`},{num:`90%`,label:`of people took action based on their report`,icon:(0,N.jsx)(Fa,{size:24}),detail:`64% completed contractor projects · 84% completed DIY projects`},{num:`100%`,label:`plan to do more energy projects in the near future`,icon:(0,N.jsx)(pa,{size:24})},{num:`53%`,label:`used rebates — saving up to $8,000 on projects`,icon:(0,N.jsx)(xa,{size:24})}].map(e=>(0,N.jsxs)(Fb.div,{whileHover:{y:-8},transition:{type:`spring`,stiffness:400,damping:30},className:`ceramic-card p-8 text-center`,children:[(0,N.jsx)(`div`,{className:`w-12 h-12 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-4 text-primary`,children:e.icon}),(0,N.jsxs)(`div`,{className:`text-4xl font-bold text-foreground tabular-nums mb-1`,children:[e.num,e.suffix&&(0,N.jsx)(`span`,{className:`text-lg font-semibold text-primary ml-1`,children:e.suffix})]}),(0,N.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e.label}),e.detail&&(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground/70 mt-2`,children:e.detail})]},e.label))})]}),(0,N.jsxs)(ej,{id:`library-program`,className:`bg-primary/5 border-t-4 border-primary`,children:[(0,N.jsxs)(`div`,{className:`grid lg:grid-cols-2 gap-12 items-center mb-16`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`inline-flex items-center gap-2 bg-primary/10 text-primary rounded-full px-4 py-1.5 text-sm font-semibold mb-6`,children:[(0,N.jsx)(Ea,{size:16}),`Featured Program`]}),(0,N.jsx)(`h2`,{className:`text-headline mb-6`,children:`Library DIY Energy Assessment Program`}),(0,N.jsx)(`p`,{className:`text-body-lg mb-6`,children:`A turnkey program that empowers libraries to lend HomeBoost DIY Energy kits to patrons — just like borrowing a book. Patrons scan their homes, receive expert-reviewed reports in under 3 business days, and take action on energy savings.`}),(0,N.jsx)(`div`,{className:`space-y-3`,children:[`Kits circulate like any library item — no staff training needed`,`Each patron gets a personalized energy report with local rebate info`,`Reports reviewed by professional energy auditors`,`Libraries become community hubs for energy education`].map(e=>(0,N.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,N.jsx)(va,{size:18,className:`text-primary mt-0.5 shrink-0`}),(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:e})]},e))})]}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(dj,{src:gj,alt:`HomeBoost DIY Kit for library lending`,className:`rounded-3xl shadow-lg w-full max-w-sm mx-auto`,wrapperClassName:`max-w-sm mx-auto rounded-3xl`,aspectRatio:`9/16`}),(0,N.jsxs)(`div`,{className:`absolute -bottom-4 -right-4 bg-primary text-primary-foreground rounded-2xl p-4 shadow-lg`,children:[(0,N.jsx)(`div`,{className:`text-2xl font-bold`,children:`<3 days`}),(0,N.jsx)(`div`,{className:`text-sm opacity-80`,children:`Business day turnaround`})]})]})]}),(0,N.jsxs)(`div`,{className:`mb-16`,children:[(0,N.jsx)(`h3`,{className:`text-headline text-center mb-10`,children:`How to launch a Library Program`}),(0,N.jsx)(`div`,{className:`grid md:grid-cols-4 gap-6`,children:[{step:`1`,title:`Initial Conversation`,desc:`We meet with your team to understand your region, goals, patron needs, and any funding or reporting requirements.`,icon:(0,N.jsx)(Ma,{size:20})},{step:`2`,title:`Program Scoping & Proposal`,desc:`We tailor the program to your library system — number of branches, patron demand, local rebates, co-branding, and reporting needs.`,icon:(0,N.jsx)(fa,{size:20})},{step:`3`,title:`Kit Assembly & Shipping`,desc:`Each branch receives 3 DIY Energy kits (Android, iPhone USB-C, iPhone Lightning) — each with a blacklight, thermal camera, and instructions.`,icon:(0,N.jsx)(ka,{size:20})},{step:`4`,title:`Launch & Lend`,desc:`Patrons check out the kit like any library item, scan their home with the app, and receive their expert report in under 3 business days.`,icon:(0,N.jsx)(va,{size:20})}].map(e=>(0,N.jsxs)(Fb.div,{whileHover:{y:-6},transition:{type:`spring`,stiffness:400,damping:30},className:`ceramic-card p-6 relative`,children:[(0,N.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold mb-4`,children:e.step}),(0,N.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mb-3 text-primary`,children:e.icon}),(0,N.jsx)(`h4`,{className:`font-bold mb-2`,children:e.title}),(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.desc})]},e.step))})]}),(0,N.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-8 mb-12`,children:[(0,N.jsxs)(`div`,{className:`ceramic-card p-8`,children:[(0,N.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mb-4 text-primary`,children:(0,N.jsx)(ba,{size:20})}),(0,N.jsx)(`h4`,{className:`font-bold text-lg mb-4`,children:`Launch Timeline`}),(0,N.jsx)(`div`,{className:`space-y-3`,children:[{label:`Kit assembly`,time:`2–3 weeks`},{label:`Shipping to branches`,time:`3–5 days`},{label:`Total lead time`,time:`~3–4 weeks from approval`}].map(e=>(0,N.jsxs)(`div`,{className:`flex justify-between items-center border-b border-border pb-2 last:border-0`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,N.jsx)(`span`,{className:`font-semibold`,children:e.time})]},e.label))})]}),(0,N.jsxs)(`div`,{className:`ceramic-card p-8`,children:[(0,N.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mb-4 text-primary`,children:(0,N.jsx)(xa,{size:20})}),(0,N.jsx)(`h4`,{className:`font-bold text-lg mb-4`,children:`Simple, Transparent Pricing`}),(0,N.jsxs)(`div`,{className:`space-y-4`,children:[(0,N.jsxs)(`div`,{className:`bg-primary/5 rounded-2xl p-4`,children:[(0,N.jsx)(`div`,{className:`text-sm text-muted-foreground mb-1`,children:`Setup (3 DIY Energy kits per branch)`}),(0,N.jsxs)(`div`,{className:`text-2xl font-bold text-primary`,children:[`$1,000 `,(0,N.jsx)(`span`,{className:`text-sm font-normal text-muted-foreground`,children:`one-time per branch`})]})]}),(0,N.jsxs)(`div`,{className:`bg-primary/5 rounded-2xl p-4`,children:[(0,N.jsx)(`div`,{className:`text-sm text-muted-foreground mb-1`,children:`Per completed asse
66ssment`}),(0,N.jsxs)(`div`,{className:`text-2xl font-bold text-primary`,children:[`$75 `,(0,N.jsx)(`span`,{className:`text-sm font-normal text-muted-foreground`,children:`per patron report`})]})]})]})]})]}),(0,N.jsx)(`div`,{className:`ceramic-card p-8 md:p-10 bg-background border-2 border-primary/20 rounded-3xl mb-12`,children:(0,N.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-8 items-center`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`inline-flex items-center gap-2 bg-primary/10 text-primary rounded-full px-4 py-1.5 text-xs font-semibold uppercase tracking-wider mb-4`,children:`Case Study`}),(0,N.jsx)(`h3`,{className:`text-2xl font-bold mb-3`,children:`Central Hudson × Mid-Hudson Library System`}),(0,N.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:`See how Central Hudson partnered with HomeBoost and 20 library branches to deliver free DIY energy assessments — achieving a 63 NPS score and driving real community engagement.`}),(0,N.jsx)(F,{to:`/case-studies/central-hudson`,children:(0,N.jsxs)(S,{variant:`hero`,size:`lg`,children:[`Read the Case Study `,(0,N.jsx)(da,{size:16})]})})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,N.jsxs)(`div`,{className:`bg-primary/5 rounded-2xl p-5 text-center`,children:[(0,N.jsx)(`div`,{className:`text-3xl font-bold text-primary`,children:`20`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Library branches`})]}),(0,N.jsxs)(`div`,{className:`bg-primary/5 rounded-2xl p-5 text-center`,children:[(0,N.jsx)(`div`,{className:`text-3xl font-bold text-primary`,children:`63`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`NPS Score`})]}),(0,N.jsxs)(`div`,{className:`bg-primary/5 rounded-2xl p-5 text-center`,children:[(0,N.jsx)(`div`,{className:`text-3xl font-bold text-primary`,children:`300K`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Customer reach`})]}),(0,N.jsxs)(`div`,{className:`bg-primary/5 rounded-2xl p-5 text-center`,children:[(0,N.jsx)(`div`,{className:`text-3xl font-bold text-primary`,children:`<3`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Day turnaround`})]})]})]})})]}),(0,N.jsx)(ej,{id:`request-pilot`,className:`bg-secondary/30`,children:(0,N.jsxs)(`div`,{className:`max-w-3xl mx-auto`,children:[(0,N.jsxs)(`div`,{className:`text-center mb-10`,children:[(0,N.jsx)(`h2`,{className:`text-headline mb-4`,children:`Request a Pilot`}),(0,N.jsx)(`p`,{className:`text-body-lg text-muted-foreground max-w-xl mx-auto`,children:`Tell us about your utility and goals — our team will follow up within 1–2 business days to discu
66ss a tailored pilot.`})]}),(0,N.jsx)(`div`,{className:`ceramic-card p-8 md:p-10`,children:(0,N.jsx)($A,{})})]})})]}),vj=`modulepreload`,yj=function(e){return`/`+e},bj={},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=yj(t,n),t in bj)return;bj[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:vj,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},xj=()=>(0,N.jsx)(`div`,{className:`min-h-screen`,"aria-busy":`true`,"aria-label":`Loading page`,children:(0,N.jsxs)(`div`,{className:`container-narrow px-6 md:px-8 py-16 space-y-6`,children:[(0,N.jsx)(gl,{className:`h-10 w-2/3 max-w-xl`}),(0,N.jsx)(gl,{className:`h-5 w-full max-w-2xl`}),(0,N.jsx)(gl,{className:`h-5 w-5/6 max-w-2xl`}),(0,N.jsxs)(`div`,{className:`grid sm:grid-cols-2 lg:grid-cols-3 gap-6 pt-8`,children:[(0,N.jsx)(gl,{className:`h-48 w-full`}),(0,N.jsx)(gl,{className:`h-48 w-full`}),(0,N.jsx)(gl,{className:`h-48 w-full`})]})]})}),Sj=(0,M.lazy)(()=>$(()=>import(`./Index-DUgWI3WF.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Cj=(0,M.lazy)(()=>$(()=>import(`./ForHomeowners-CyXNI8Xx.js`),__vite__mapDeps([12,1,2,3,13,5,8,9,10,14,15]))),wj=(0,M.lazy)(()=>$(()=>import(`./ForPros-BBN5L0l4.js`),__vite__mapDeps([16,1,2,3,5,17,18]))),Tj=(0,M.lazy)(()=>$(()=>import(`./ProInvite-3Fw5GHW7.js`),__vite__mapDeps([19,1,5]))),Ej=(0,M.lazy)(()=>$(()=>import(`./ForCoops-D7adL3ZE.js`),__vite__mapDeps([20,1,2,3,5,17,21,22,23,9]))),Dj=(0,M.lazy)(()=>$(()=>import(`./HowItWorks-D79-7ZuF.js`),__vite__mapDeps([24,1,2,3,5,6,9,15]))),Oj=(0,M.lazy)(()=>$(()=>import(`./About-B9XGuLt-.js`),__vite__mapDeps([25,1,2,3,5,21,9]))),kj=(0,M.lazy)(()=>$(()=>import(`./PrivacyPolicy-k4AkAJLy.js`),__vite__mapDeps([26,1]))),Aj=(0,M.lazy)(()=>$(()=>import(`./TermsOfService-a8nhEz0e.js`),__vite__mapDeps([27,1]))),jj=(0,M.lazy)(()=>$(()=>import(`./RefundPolicy-Cu6DJ9Ym.js`),__vite__mapDeps([28,1]))),Mj=(0,M.lazy)(()=>$(()=>import(`./Contact-B1OCdAZj.js`),__vite__mapDeps([29,1,2,3,5,30,18]))),Nj=(0,M.lazy)(()=>$(()=>import(`./CaseStudyCentralHudson-SLwHTiet.js`),__vite__mapDeps([31,1,2,3,5,4,9]))),Pj=(0,M.lazy)(()=>$(()=>import(`./Blog-CBSTTD1t.js`),__vite__mapDeps([32,1,2,3,5,9,33,34,11,35,36]))),Fj=(0,M.lazy)(()=>$(()=>import(`./BlogPost-PLOaupB2.js`),__vite__mapDeps([37,1,2,3,4,5,9,34,11,36,35]))),Ij=(0,M.lazy)(()=>$(()=>import(`./BlogCategory-DuLVAwfO.js`),__vite__mapDeps([38,1,2,3,4,5,9,33,34,11,35]))),Lj=(0,M.lazy)(()=>$(()=>import(`./News-QcTPaWWV.js`),__vite__mapDeps([39,1,40,9,34,3]))),Rj=(0,M.lazy)(()=>$(()=>import(`./NewsArticle-B4KgIkBY.js`),__vite__mapDeps([41,1,40,4,5,9,34,3]))),zj=(0,M.lazy)(()=>$(()=>import(`./DiscoverLeaks-DaCx9oIA.js`),__vite__mapDeps([42,1,43,2,3,9,13,5,44,8,14]))),Bj=(0,M.lazy)(()=>$(()=>import(`./Download-DgybBS1V.js`),__vite__mapDeps([45,1,2,3,46,5,44]))),Vj=(0,M.lazy)(()=>$(()=>import(`./Organization-DgiNTxyQ.js`),__vite__mapDeps([47,1,2,3,5,48,9]))),Hj=(0,M.lazy)(()=>$(()=>import(`./KeepInTouch-BcsMjifG.js`),__vite__mapDeps([49,1,2,3,5,30]))),Uj=(0,M.lazy)(()=>$(()=>import(`./ContestPage-B4keF6ou.js`),__vite__mapDeps([50,1,2,3,5,17,23,9]))),Wj=(0,M.lazy)(()=>$(()=>import(`./SweepstakesRules-BnAE3VXo.js`),__vite__mapDeps([51,1,9]))),Gj=(0,M.lazy)(()=>$(()=>import(`./ContactBGEContractor-7Ly_0hN0.js`),__vite__mapDeps([52,1,43,2,3,9,5,53,21,22]))),Kj=(0,M.lazy)(()=>$(()=>import(`./LibraryProgram-BqP7mC85.js`),__vite__mapDeps([54,1,2,3,5,46,48,18,44]))),qj=(0,M.lazy)(()=>$(()=>import(`./CancellationPolicy-CKBRSasl.js`),__vite__mapDeps([55,1]))),Jj=(0,M.lazy)(()=>$(()=>import(`./Security-q7yajwxg.js`),__vite__mapDeps([56,1,2,3,5,57,30,9]))),Yj=(0,M.lazy)(()=>$(()=>import(`./SecurityWallOfFame-CCBTLLG8.js`),__vite__mapDeps([58,1,2,3,4,5,57,9]))),Xj=(0,M.lazy)(()=>$(()=>import(`./HomeEnergyAuditSavings-_MTn4eD7.js`),__vite__mapDeps([59,1,2,3,5,7,9,14]))),Zj=(0,M.lazy)(()=>$(()=>import(`./NotFound-26eI0Fcu.js`),__vite__mapDeps([60,1,53,5,9]))),Qj=new Qe;(0,nt.createRoot)(document.getElementById(`root`)).render((0,N.jsx)(()=>(0,N.jsx)(i,{children:(0,N.jsx)(tt,{client:Qj,children:(0,N.jsxs)(ml,{children:[(0,N.jsx)(Wa,{}),(0,N.jsx)(kr,{}),(0,N.jsxs)(Vn,{children:[(0,N.jsx)(wl,{}),(0,N.jsx)(Cl,{}),(0,N.jsx)(`div`,{className:`pt-14`,children:(0,N.jsx)(M.Suspense,{fallback:(0,N.jsx)(xj,{}),children:(0,N.jsxs)(Mn,{children:[(0,N.jsx)(P,{path:`/`,element:(0,N.jsx)(Sj,{})}),(0,N.jsx)(P,{path:`/case-studies`,element:(0,N.jsx)(tu,{to:`/blog/category/case-studies`})}),(0,N.jsx)(P,{path:`/case-studies/centralhudson`,element:(0,N.jsx)(tu,{to:`/case-studies/central-hudson`})}),(0,N.jsx)(P,{path:`/homeowners`,element:(0,N.jsx)(Cj,{})}),(0,N.jsx)(P,{path:`/utilities`,element:(0,N.jsx)(_j,{})}),(0,N.jsx)(P,{path:`/pro`,element:(0,N.jsx)(wj,{})}),(0,N.jsx)(P,{path:`/pro-invite`,element:(0,N.jsx)(Tj,{})}),(0,N.jsx)(P,{path:`/coops`,element:(0,N.jsx)(Ej,{})}),(0,N.jsx)(P,{path:`/how-it-works`,element:(0,N.jsx)(Dj,{})}),(0,N.jsx)(P,{path:`/about-us`,element:(0,N.jsx)(Oj,{})}),(0,N.jsx)(P,{path:`/policies/privacy-policy`,element:(0,N.jsx)(kj,{})}),(0,N.jsx)(P,{path:`/policies/terms-of-service`,element:(0,N.jsx)(Aj,{})}),(0,N.jsx)(P,{path:`/policies/refund-policy`,element:(0,N.jsx)(jj,{})}),(0,N.jsx)(P,{path:`/policies/cancellation-policy`,element:(0,N.jsx)(qj,{})}),(0,N.jsx)(P,{path:`/policies/contact-information`,element:(0,N.jsx)(Mj,{})}),(0,N.jsx)(P,{path:`/case-studies/central-hudson`,element:(0,N.jsx)(Nj,{})}),(0,N.jsx)(P,{path:`/blog`,element:(0,N.jsx)(Pj,{})}),(0,N.jsx)(P,{path:`/blog/:slug`,element:(0,N.jsx)(Fj,{})}),(0,N.jsx)(P,{path:`/blog/category/:category`,element:(0,N.jsx)(Ij,{})}),(0,N.jsx)(P,{path:`/news`,element:(0,N.jsx)(Lj,{})}),(0,N.jsx)(P,{path:`/news/:slug`,element:(0,N.jsx)(Rj,{})}),(0,N.jsx)(P,{path:`/homeboost-discover-the-leaks-in-your-home`,element:(0,N.jsx)(zj,{})}),(0,N.jsx)(P,{path:`/download`,element:(0,N.jsx)(Bj,{})}),(0,N.jsx)(P,{path:`/organization`,element:(0,N.jsx)(Vj,{})}),(0,N.jsx)(P,{path:`/lets-keep-in-touch`,element:(0,N.jsx)(Hj,{})}),(0,N.jsx)(P,{path:`/energy-audit-repair-contest`,element:(0,N.jsx)(Uj,{})}),(0,N.jsx)(P,{path:`/homeboost-sweepstakes-official-rules-and-terms-of-service`,element:(0,N.jsx)(Wj,{})}),(0,N.jsx)(P,{path:`/contact-your-bge-contractor`,element:(0,N.jsx)(Gj,{})}),(0,N.jsx)(P,{path:`/library`,element:(0,N.jsx)(Kj,{})}),(0,N.jsx)(P,{path:`/security`,element:(0,N.jsx)(Jj,{})}),(0,N.jsx)(P,{path:`/security/wall-of-fame`,element:(0,N.jsx)(Yj,{})}),(0,N.jsx)(P,{path:`/home-energy-audit-savings`,element:(0,N.jsx)(Xj,{})}),(0,N.jsx)(P,{path:`*`,element:(0,N.jsx)(Zj,{})})]})})}),(0,N.jsx)(eu,{}),(0,N.jsx)(Ql,{})]})]})})}),{}));export{ke as $,Ea as A,pa as B,Fa as C,Aa as D,ja as E,ba as F,fr as G,da as H,va as I,ln as J,F as K,ga as L,Ca as M,Sa as N,ka as O,xa as P,Ae as Q,ha as R,sc as S,Ma as T,ci as U,fa as V,Vr as W,Ve as X,et as Y,Ne as Z,Ib as _,ej as a,ce as at,_l as b,YA as c,se as ct,lw as d,ie as et,dw as f,Lb as g,Ub as h,sj as i,le as it,wa as j,Oa as k,xk as l,ne as lt,aw as m,mj as n,j as nt,ZA as o,_e as ot,ow as p,an as q,dj as r,Se as rt,XA as s,De as st,gj as t,oe as tt,iw as u,k as ut,Fb as v,Na as w,gl as x,Tl as y,ma 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.