PageSourceSearch

https://scapely.io/assets/index-BbEMlEPL.js

js scapely.io collected 2026-09-24 13:09:59 UTC 1,405,408 bytes, 372 lines download raw bytes

1function Q6(e,t){for(var s=0;s<t.length;s++){const r=t[s];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(r,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();var aG=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tm={exports:{}},ic={};var fw;function Z6(){if(fw)return ic;fw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,o,c){var d=null;if(c!==void 0&&(d=""+c),o.key!==void 0&&(d=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:e,type:r,key:d,ref:o!==void 0?o:null,props:c}}return ic.Fragment=t,ic.jsx=s,ic.jsxs=s,ic}var mw;function X6(){return mw||(mw=1,Tm.exports=Z6()),Tm.exports}var n=X6(),Am={exports:{}},oc={},Rm={exports:{}},Om={};var gw;function J6(){return gw||(gw=1,(function(e){function t(I,V){var H=I.length;I.push(V);e:for(;0<H;){var se=H-1>>>1,R=I[se];if(0<o(R,V))I[se]=V,I[H]=R,H=se;else break e}}function s(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var V=I[0],H=I.pop();if(H!==V){I[0]=H;e:for(var se=0,R=I.length,Q=R>>>1;se<Q;){var oe=2*(se+1)-1,ne=I[oe],le=oe+1,fe=I[le];if(0>o(ne,H))le<R&&0>o(fe,ne)?(I[se]=fe,I[le]=H,se=le):(I[se]=ne,I[oe]=H,se=oe);else if(le<R&&0>o(fe,H))I[se]=fe,I[le]=H,se=le;else break e}}return V}function o(I,V){var H=I.sortIndex-V.sortIndex;return H!==0?H:I.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var p=[],f=[],m=1,x=null,y=3,v=!1,j=!1,k=!1,S=!1,N=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function O(I){for(var V=s(f);V!==null;){if(V.callback===null)r(f);else if(V.startTime<=I)r(f),V.sortIndex=V.expirationTime,t(p,V);else break;V=s(f)}}function P(I){if(k=!1,O(I),!j)if(s(p)!==null)j=!0,M||(M=!0,G());else{var V=s(f);V!==null&&te(P,V.startTime-I)}}var M=!1,B=-1,A=5,L=-1;function U(){return S?!0:!(e.unstable_now()-L<A)}function K(){if(S=!1,M){var I=e.unstable_now();L=I;var V=!0;try{e:{j=!1,k&&(k=!1,C(B),B=-1),v=!0;var H=y;try{t:{for(O(I),x=s(p);x!==null&&!(x.expirationTime>I&&U());){var se=x.callback;if(typeof se=="function"){x.callback=null,y=x.priorityLevel;var R=se(x.expirationTime<=I);if(I=e.unstable_now(),typeof R=="function"){x.callback=R,O(I),V=!0;break t}x===s(p)&&r(p),O(I)}else r(p);x=s(p)}if(x!==null)V=!0;else{var Q=s(f);Q!==null&&te(P,Q.startTime-I),V=!1}}break e}finally{x=null,y=H,v=!1}V=void 0}}finally{V?G():M=!1}}}var G;if(typeof E=="function")G=function(){E(K)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ee=W.port2;W.port1.onmessage=K,G=function(){ee.postMessage(null)}}else G=function(){N(K,0)};function te(I,V){B=N(function(){I(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.
1callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(I){switch(y){case 1:case 2:case 3:var V=3;break;default:V=y}var H=y;y=V;try{return I()}finally{y=H}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(I,V){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var H=y;y=I;try{return V()}finally{y=H}},e.unstable_scheduleCallback=function(I,V,H){var se=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?se+H:se):H=se,I){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=H+R,I={id:m++,callback:V,priorityLevel:I,startTime:H,expirationTime:R,sortIndex:-1},H>se?(I.sortIndex=H,t(f,I),s(p)===null&&I===s(f)&&(k?(C(B),B=-1):k=!0,te(P,H-se))):(I.sortIndex=R,t(p,I),j||v||(j=!0,M||(M=!0,G()))),I},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(I){var V=y;return function(){var H=y;y=V;try{return I.apply(this,arguments)}finally{y=H}}}})(Om)),Om}var xw;function eE(){return xw||(xw=1,Rm.exports=J6()),Rm.exports}var Pm={exports:{}},$e={};var yw;function tE(){if(yw)return $e;yw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),x=Symbol.iterator;function y(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,k={};function S(R,Q,oe){this.props=R,this.context=Q,this.refs=k,this.updater=oe||v}S.prototype.isReactComponent={},S.prototype.setState=function(R,Q){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,Q,"setState")},S.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function N(){}N.prototype=S.prototype;function C(R,Q,oe){this.props=R,this.context=Q,this.refs=k,this.updater=oe||v}var E=C.prototype=new N;E.constructor=C,j(E,S.prototype),E.isPureReactComponent=!0;var O=Array.isArray,P={H:null,A:null,T:null,S:null,V:null},M=Object.prototype.hasOwnProperty;function B(R,Q,oe,ne,le,fe){return oe=fe.ref,{$$typeof:e,type:R,key:Q,ref:oe!==void 0?oe:null,props:fe}}function A(R,Q){return B(R.type,Q,void 0,void 0,void 0,R.props)}function L(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function U(R){var Q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(oe){return Q[oe]})}var K=/\/+/g;function G(R,Q){return typeof R=="object"&&R!==null&&R.key!=null?U(""+R.key):Q.toString(36)}function W(){}function ee(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(W,W):(R.status="pending",R.then(function(Q){R.status==="pending"&&(R.status="fulfilled",R.value=Q)},function(Q){R.status==="pending"&&(R.status="rejected",R.reason=Q)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function te(R,Q,oe,ne,le){var fe=typeof R;(fe==="undefined"||fe==="boolean")&&(R=null);var he=!1;if(R===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(R.$$typeof){case e:case t:he=!0;break;case m:return he=R._init,te(he(R._payload),Q,oe,ne,le)}}if(he)return le=le(R),he=ne===""?"."+G(R,0):ne,O(le)?(oe="",he!=null&&(oe=he.replace(K,"$&/")+"/"),te(le,Q,oe,"",function(ue){return ue})):le!=null&&(L(le)&&(le=A(le,oe+(le.key==null||R&&R.key===le.key?"":(""+le.key).replace(K,"$&/")+"/")+he)),Q.push(le)),1;he=0;var Ne=ne===""?".":ne+":";if(O(R))for(var J=0;J<R.length;J++)ne=R[J],fe=Ne+G(ne,J),he+=te(ne,Q,oe,fe,le);else if(J=y(R),typeof J=="function")for(R=J.call(R),J=0;!(ne=R.next()).done;)ne=ne.value,fe=Ne+G(ne,J++),he+=te(ne,Q,oe,fe,le);else if(fe==="object"){if(typeof R.then=="function")return te(ee(R),Q,oe,ne,le);throw Q=String(R),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return he}function I(R,Q,oe){if(R==null)return R;var ne=[],le=0;return te(R,ne,"","",function(fe){return Q.call(oe,fe,le++)}),ne}function V(R){if(R._status===-1){var Q=R._result;Q=Q(),Q.then(function(oe){(R._status===0||R._status===-1)&&(R._status=1,R._result=oe)},function(oe){(R._status===0||R._status===-1)&&(R._status=2,R._result=oe)}),R._status===-1&&(R._status=0,R._result=Q)}if(R._status===1)return R._result.default;throw R._result}var H=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function se(){}
1return $e.Children={map:I,forEach:function(R,Q,oe){I(R,function(){Q.apply(this,arguments)},oe)},count:function(R){var Q=0;return I(R,function(){Q++}),Q},toArray:function(R){return I(R,function(Q){return Q})||[]},only:function(R){if(!L(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},$e.Component=S,$e.Fragment=s,$e.Profiler=o,$e.PureComponent=C,$e.StrictMode=r,$e.Suspense=p,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,$e.__COMPILER_RUNTIME={__proto__:null,c:function(R){return P.H.useMemoCache(R)}},$e.cache=function(R){return function(){return R.apply(null,arguments)}},$e.cloneElement=function(R,Q,oe){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ne=j({},R.props),le=R.key,fe=void 0;if(Q!=null)for(he in Q.ref!==void 0&&(fe=void 0),Q.key!==void 0&&(le=""+Q.key),Q)!M.call(Q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&Q.ref===void 0||(ne[he]=Q[he]);var he=arguments.length-2;if(he===1)ne.children=oe;else if(1<he){for(var Ne=Array(he),J=0;J<he;J++)Ne[J]=arguments[J+2];ne.children=Ne}return B(R.type,le,void 0,void 0,fe,ne)},$e.createContext=function(R){return R={$$typeof:d,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:c,_context:R},R},$e.createElement=function(R,Q,oe){var ne,le={},fe=null;if(Q!=null)for(ne in Q.key!==void 0&&(fe=""+Q.key),Q)M.call(Q,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(le[ne]=Q[ne]);var he=arguments.length-2;if(he===1)le.children=oe;else if(1<he){for(var Ne=Array(he),J=0;J<he;J++)Ne[J]=arguments[J+2];le.children=Ne}if(R&&R.defaultProps)for(ne in he=R.defaultProps,he)le[ne]===void 0&&(le[ne]=he[ne]);return B(R,fe,void 0,void 0,null,le)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(R){return{$$typeof:h,render:R}},$e.isValidElement=L,$e.lazy=function(R){return{$$typeof:m,_payload:{_status:-1,_result:R},_init:V}},$e.memo=function(R,Q){return{$$typeof:f,type:R,compare:Q===void 0?null:Q}},$e.startTransition=function(R){var Q=P.T,oe={};P.T=oe;try{var ne=R(),le=P.S;le!==null&&le(oe,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(se,H)}catch(fe){H(fe)}finally{P.T=Q}},$e.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},$e.use=function(R){return P.H.use(R)},$e.useActionState=function(R,Q,oe){return P.H.useActionState(R,Q,oe)},$e.useCallback=function(R,Q){return P.H.useCallback(R,Q)},$e.useContext=function(R){return P.H.useContext(R)},$e.useDebugValue=function(){},$e.useDeferredValue=function(R,Q){return P.H.useDeferredValue(R,Q)},$e.useEffect=function(R,Q,oe){var ne=P.H;if(typeof oe=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ne.useEffect(R,Q)},$e.useId=function(){return P.H.useId()},$e.useImperativeHandle=function(R,Q,oe){return P.H.useImperativeHandle(R,Q,oe)},$e.useInsertionEffect=function(R,Q){return P.H.useInsertionEffect(R,Q)},$e.useLayoutEffect=function(R,Q){return P.H.useLayoutEffect(R,Q)},$e.useMemo=function(R,Q){return P.H.useMemo(R,Q)},$e.useOptimistic=function(R,Q){return P.H.useOptimistic(R,Q)},$e.useReducer=function(R,Q,oe){return P.H.useReducer(R,Q,oe)},$e.useRef=function(R){return P.H.useRef(R)},$e.useState=function(R){return P.H.useState(R)},$e.useSyncExternalStore=function(R,Q,oe){return P.H.useSyncExternalStore(R,Q,oe)},$e.useTransition=function(){return P.H.useTransition()},$e.version="19.1.0",$e}var bw;function Ih(){return bw||(bw=1,Pm.exports=tE()),Pm.exports}var Mm={exports:{}},gs={};var vw;function sE(){if(vw)return gs;vw=1;var e=Ih();function t(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+p+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(p,f,m){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:p,containerInfo:f,implementation:m}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return gs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,gs.createPortal=function(p,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return c(p,f,null,m)},gs.flushSync=function(p){var f=d.T,m=r.p;try{if(d.T=null,r.p=2,p)return p()}finally{d.T=f,r.p=m,r.d.f()}},gs.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(p,f))},gs.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},gs.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var m=f.as,x=h(m,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:x,integrity:y,fetchPriority:v}):m==="script"&&r.d.X(p,{crossOrigin:x,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},gs.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=h(f.as,f.crossOrigin);r.d.M(p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(p)},gs.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,x=h(m,f.crossOrigin);r.d.L(p,m,{crossOrigin:x,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},gs.preloadModule=function(p,f){if(typeof p=="string")if(f){var m=h(f.as,f.crossOrigin);r.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(p)},gs.requestFormReset=function(p){r.d.r(p)},gs.unstable_batchedUpdates=function(p,f){return p(f)},gs.useFormState=function(p,f,m){return d.H.useFormState(p,f,m)},gs.useFormStatus=function(){return d.H.useHostTransitionStatus()},gs.version="19.1.0",gs}var ww;function jj(){if(ww)return Mm.exports;ww=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Mm.exports=sE(),Mm.exports}var jw;function nE(){if(jw)return oc;jw=1;var e=eE(),t=Ih(),s=jj();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function c(a){var i=a,l=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(l=i.return),a=i.return;while(a)}return i.tag===3?l:null}function d(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}
vendor: 17,140 bytes, lines 1-8
1function h(a){if(c(a)!==a)throw Error(r(188))}function p(a){var i=a.alternate;if(!i){if(i=c(a),i===null)throw Error(r(188));return i!==a?null:a}for(var l=a,u=i;;){var g=l.return;if(g===null)break;var b=g.alternate;if(b===null){if(u=g.return,u!==null){l=u;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===l)return h(g),a;if(b===u)return h(g),i;b=b.sibling}throw Error(r(188))}if(l.return!==u.return)l=g,u=b;else{for(var _=!1,T=g.child;T;){if(T===l){_=!0,l=g,u=b;break}if(T===u){_=!0,u=g,l=b;break}T=T.sibling}if(!_){for(T=b.child;T;){if(T===l){_=!0,l=b,u=g;break}if(T===u){_=!0,u=b,l=g;break}T=T.sibling}if(!_)throw Error(r(189))}}if(l.alternate!==u)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?a:i}function f(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=f(a),i!==null)return i;a=a.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function G(a){return a===null||typeof a!="object"?null:(a=K&&a[K]||a["@@iterator"],typeof a=="function"?a:null)}var W=Symbol.for("react.client.reference");function ee(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===W?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case j:return"Fragment";case S:return"Profiler";case k:return"StrictMode";case P:return"Suspense";case M:return"SuspenseList";case L:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case E:return(a.displayName||"Context")+".Provider";case C:return(a._context.displayName||"Context")+".Consumer";case O:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case B:return i=a.displayName||null,i!==null?i:ee(a.type)||"Memo";case A:i=a._payload,a=a._init;try{return ee(a(i))}catch{}}return null}var te=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},se=[],R=-1;function Q(a){return{current:a}}function oe(a){0>R||(a.current=se[R],se[R]=null,R--)}function ne(a,i){R++,se[R]=a.current,a.current=i}var le=Q(null),fe=Q(null),he=Q(null),Ne=Q(null);function J(a,i){switch(ne(he,i),ne(fe,a),ne(le,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?q1(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=q1(i),a=V1(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}oe(le),ne(le,a)}function ue(){oe(le),oe(fe),oe(he)}function ye(a){a.memoizedState!==null&&ne(Ne,a);var i=le.current,l=V1(i,a.type);i!==l&&(ne(fe,a),ne(le,l))}function Le(a){fe.current===a&&(oe(le),oe(fe)),Ne.current===a&&(oe(Ne),tc._currentValue=H)}var ot=Object.prototype.hasOwnProperty,Je=e.unstable_scheduleCallback,jt=e.unstable_cancelCallback,Ia=e.unstable_shouldYield,Is=e.unstable_requestPaint,Wt=e.unstable_now,oa=e.unstable_getCurrentPriorityLevel,la=e.unstable_ImmediatePriority,Ss=e.unstable_UserBlockingPriority,pe=e.unstable_NormalPriority,Qe=e.unstable_LowPriority,rs=e.unstable_IdlePriority,Yt=e.log,We=e.unstable_setDisableYieldValue,gt=null,lt=null;function Et(a){if(typeof Yt=="function"&&We(a),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(gt,a)}catch{}}var ct=Math.clz32?Math.clz32:$a,fs=Math.log,$s=Math.LN2;function $a(a){return a>>>=0,a===0?32:31-(fs(a)/$s|0)|0}var Ns=256,dt=4194304;function Qt(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function ut(a,i,l){var u=a.pendingLanes;if(u===0)return 0;var g=0,b=a.suspendedLanes,_=a.pingedLanes;a=a.warmLanes;var T=u&134217727;return T!==0?(u=T&~b,u!==0?g=Qt(u):(_&=T,_!==0?g=Qt(_):l||(l=T&~a,l!==0&&(g=Qt(l))))):(T=u&~b,T!==0?g=Qt(T):_!==0?g=Qt(_):l||(l=u&~a,l!==0&&(g=Qt(l)))),g===0?0:i!==0&&i!==g&&(i&b)===0&&(b=g&-g,l=i&-i,b>=l||b===32&&(l&4194048)!==0)?i:g}function ys(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function Cs(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ln(){var a=Ns;return Ns<<=1,(Ns&4194048)===0&&(Ns=256),a}function Es(){var a=dt;return dt<<=1,(dt&62914560)===0&&(dt=4194304),a}function Ts(a){for(var i=[],l=0;31>l;l++)i.push(a);return i}function de(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Xe(a,i,l,u,g,b){var _=a.pendingLanes;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=l,a.entangledLanes&=l,a.errorRecoveryDisabledLanes&=l,a.shellSuspendCounter=0;var T=a.entanglements,D=a.expirationTimes,F=a.hiddenUpdates;for(l=_&~l;0<l;){var ae=31-ct(l),ie=1<<ae;T[ae]=0,D[ae]=-1;var Y=F[ae];if(Y!==null)for(F[ae]=null,ae=0;ae<Y.length;ae++){var X=Y[ae];X!==null&&(X.lane&=-536870913)}l&=~ie}u!==0&&is(a,u,0),b!==0&&g===0&&a.tag!==0&&(a.suspendedLanes|=b&~(_&~i))}function is(a,i,l){a.pendingLanes|=i,a.suspendedLanes&=~i;var u=31-ct(i);a.entangledLanes|=i,a.entanglements[u]=a.entanglements[u]|1073741824|l&4194090}function Dt(a,i){var l=a.entangledLanes|=i;for(a=a.entanglements;l;){var u=31-ct(l),g=1<<u;g&i|a[u]&i&&(a[u]|=i),l&=~g}}function Ua(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Si(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function ul(){var a=V.p;return a!==0?a:(a=window.event,a===void 0?32:lw(a.type))}function Z(a,i){var l=V.p;try{return V.p=a,i()}finally{V.p=l}}var ce=Math.random().toString(36).slice(2),Ie="__reactFiber$"+ce,He="__reactProps$"+ce,St="__reactContainer$"+ce,Us="__reactEvents$"+ce,Ni="__reactListeners$"+ce,hl="__reactHandles$"+ce,Ci="__reactResources$"+ce,Pr="__reactMarker$"+ce;function st(a){delete a[Ie],delete a[He],delete a[Us],delete a[Ni],delete a[hl]}function Sn(a){var i=a[Ie];if(i)return i;for(var l=a.parentNode;l;){if(i=l[St]||l[Ie]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(a=K1(a);a!==null;){if(l=a[Ie])return l;a=K1(a)}return i}a=l,l=a.parentNode}return null}function Ei(a){if(a=a[Ie]||a[St]){var i=a.tag;if(i===5||i===6||i===13||i===26||i===27||i===3)return a}return null}function pl(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function Ti(a){var i=a[Ci];return i||(i=a[Ci]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Zt(a){a[Pr]=!0}var Ry=new Set,Oy={};function Mr(a,i){Ai(a,i),Ai(a+"Capture",i)}function Ai(a,i){for(Oy[a]=i,a=0;a<i.length;a++)Ry.add(i[a])}var qN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Py={},My={};function VN(a){return ot.call(My,a)?!0:ot.call(Py,a)?!1:qN.test(a)?My[a]=!0:(Py[a]=!0,!1)}function dd(a,i,l){if(VN(i))if(l===null)a.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+l)}}function ud(a,i,l){if(l===null)a.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+l)}}function ca(a,i,l,u){if(u===null)a.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttributeNS(i,l,""+u)}}var jp,Ly;function Ri(a){if(jp===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);jp=i&&i[1]||"",Ly=-1<l.stack.indexOf(`
2    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3`+jp+a+Ly}var kp=!1;function _p(a,i){if(!a||kp)return"";kp=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(X){var Y=X}Reflect.construct(a,[],ie)}else{try{ie.call()}catch(X){Y=X}a.call(ie.prototype)}}else{try{throw Error()}catch(X){Y=X}(ie=a())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(X){if(X&&Y&&typeof X.stack=="string")return[X.stack,Y.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=u.DetermineComponentFrameRoot(),_=b[0],T=b[1];if(_&&T){var D=_.split(`
4`),F=T.split(`
5`);for(g=u=0;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;for(;g<F.length&&!F[g].includes("DetermineComponentFrameRoot");)g++;if(u===D.length||g===F.length)for(u=D.length-1,g=F.length-1;1<=u&&0<=g&&D[u]!==F[g];)g--;for(;1<=u&&0<=g;u--,g--)if(D[u]!==F[g]){if(u!==1||g!==1)do if(u--,g--,0>g||D[u]!==F[g]){var ae=`
6`+D[u].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),ae}while(1<=u&&0<=g);break}}}finally{kp=!1,Error.prepareStackTrace=l}return(l=a?a.displayName||a.name:"")?Ri(l):""}function zN(a){switch(a.tag){case 26:case 27:case 5:return Ri(a.type);case 16:return Ri("Lazy");case 13:return Ri("Suspense");case 19:return Ri("SuspenseList");case 0:case 15:return _p(a.type,!1);case 11:return _p(a.type.render,!1);case 1:return _p(a.type,!0);case 31:return Ri("Activity");default:return""}}function Dy(a){try{var i="";do i+=zN(a),a=a.return;while(a);return i}catch(l){return`
7Error generating stack: `+l.message+`
8`+l.stack}}function cn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function By(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function FN(a){var i=By(a)?"checked":"value",l=Object.getOwnPropertyDescriptor(a.constructor.prototype,i),u=""+a[i];if(!a.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var g=l.get,b=l.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return g.call(this)},set:function(_){u=""+_,b.call(this,_)}}),Object.defineProperty(a,i,{enumerable:l.enumerable}),{getValue:function(){return u},setValue:function(_){u=""+_},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function hd(a){a._valueTracker||(a._valueTracker=FN(a))}function Iy(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var l=i.getValue(),u="";return a&&(u=By(a)?a.checked?"true":"false":a.value),a=u,a!==l?(i.setValue(a),!0):!1}function pd(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var GN=/[\n"\\]/g;function dn(a){return a.replace(GN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Sp(a,i,l,u,g,b,_,T){a.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?a.type=_:a.removeAttribute("type"),i!=null?_==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+cn(i)):a.value!==""+cn(i)&&(a.value=""+cn(i)):_!=="submit"&&_!=="reset"||a.removeAttribute("value"),i!=null?Np(a,_,cn(i)):l!=null?Np(a,_,cn(l)):u!=null&&a.removeAttribute("value"),g==null&&b!=null&&(a.defaultChecked=!!b),g!=null&&(a.checked=g&&typeof g!="function"&&typeof g!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?a.name=""+cn(T):a.removeAttribute("name")}function $y(a,i,l,u,g,b,_,T){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(a.type=b),i!=null||l!=null){if(!(b!=="submit"&&b!=="reset"||i!=null))return;l=l!=null?""+cn(l):"",i=i!=null?""+cn(i):l,T||i===a.value||(a.value=i),a.defaultValue=i}u=u??g,u=typeof u!="function"&&typeof u!="symbol"&&!!u,a.checked=T?a.checked:!!u,a.defaultChecked=!!u,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(a.name=_)}function Np(a,i,l){i==="number"&&pd(a.ownerDocument)===a||a.defaultValue===""+l||(a.defaultValue=""+l)}function Oi(a,i,l,u){if(a=a.options,i){i={};for(var g=0;g<l.length;g++)i["$"+l[g]]=!0;for(l=0;l<a.length;l++)g=i.hasOwnProperty("$"+a[l].value),a[l].selected!==g&&(a[l].selected=g),g&&u&&(a[l].defaultSelected=!0)}else{for(l=""+cn(l),i=null,g=0;g<a.length;g++){if(a[g].value===l){a[g].selected=!0,u&&(a[g].defaultSelected=!0);return}i!==null||a[g].disabled||(i=a[g])}i!==null&&(i.selected=!0)}}function Uy(a,i,l){if(i!=null&&(i=""+cn(i),i!==a.value&&(a.value=i),l==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=l!=null?""+cn(l):""}function Hy(a,i,l,u){if(i==null){if(u!=null){if(l!=null)throw Error(r(92));if(te(u)){if(1<u.length)throw Error(r(93));u=u[0]}l=u}l==null&&(l=""),i=l}l=cn(i),a.defaultValue=l,u=a.textContent,u===l&&u!==""&&u!==null&&(a.value=u)}function Pi(a,i){if(i){var l=a.firstChild;if(l&&l===a.lastChild&&l.nodeType===3){l.nodeValue=i;return}}a.textContent=i}var KN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qy(a,i,l){var u=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":u?a.setProperty(i,l):typeof l!="number"||l===0||KN.has(i)?i==="float"?a.cssFloat=l:a[i]=(""+l).trim():a[i]=l+"px"}function Vy(a,i,l){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?a.setProperty(u,""):u==="float"?a.cssFloat="":a[u]="");for(var g in i)u=i[g],i.hasOwnProperty(g)&&l[g]!==u&&qy(a,g,u)}else for(var b in i)i.hasOwnProperty(b)&&qy(a,b,i[b])}function Cp(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var WN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
8dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),YN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function fd(a){return YN.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var Ep=null;function Tp(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Mi=null,Li=null;function zy(a){var i=Ei(a);if(i&&(a=i.stateNode)){var l=a[He]||null;e:switch(a=i.stateNode,i.type){case"input":if(Sp(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=a;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+dn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var u=l[i];if(u!==a&&u.form===a.form){var g=u[He]||null;if(!g)throw Error(r(90));Sp(u,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<l.length;i++)u=l[i],u.form===a.form&&Iy(u)}break e;case"textarea":Uy(a,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Oi(a,!!l.multiple,i,!1)}}}var Ap=!1;function Fy(a,i,l){if(Ap)return a(i,l);Ap=!0;try{var u=a(i);return u}finally{if(Ap=!1,(Mi!==null||Li!==null)&&(Jd(),Mi&&(i=Mi,a=Li,Li=Mi=null,zy(i),a)))for(i=0;i<a.length;i++)zy(a[i])}}function fl(a,i){var l=a.stateNode;if(l===null)return null;var u=l[He]||null;if(u===null)return null;l=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(a=a.type,u=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!u;break e;default:a=!1}if(a)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rp=!1;if(da)try{var ml={};Object.defineProperty(ml,"passive",{get:function(){Rp=!0}}),window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{Rp=!1}var Ha=null,Op=null,md=null;function Gy(){if(md)return md;var a,i=Op,l=i.length,u,g="value"in Ha?Ha.value:Ha.textContent,b=g.length;for(a=0;a<l&&i[a]===g[a];a++);var _=l-a;for(u=1;u<=_&&i[l-u]===g[b-u];u++);return md=g.slice(a,1<u?1-u:void 0)}function gd(a){var i=a.keyCode;
vendor: 7,313 bytes, line 8
8return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function xd(){return!0}function Ky(){return!1}function As(a){function i(l,u,g,b,_){this._reactName=l,this._targetInst=g,this.type=u,this.nativeEvent=b,this.target=_,this.currentTarget=null;for(var T in a)a.hasOwnProperty(T)&&(l=a[T],this[T]=l?l(b):b[T]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?xd:Ky,this.isPropagationStopped=Ky,this}return m(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=xd)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=xd)},persist:function(){},isPersistent:xd}),i}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yd=As(Lr),gl=m({},Lr,{view:0,detail:0}),QN=As(gl),Pp,Mp,xl,bd=m({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dp,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==xl&&(xl&&a.type==="mousemove"?(Pp=a.screenX-xl.screenX,Mp=a.screenY-xl.screenY):Mp=Pp=0,xl=a),Pp)},movementY:function(a){return"movementY"in a?a.movementY:Mp}}),Wy=As(bd),ZN=m({},bd,{dataTransfer:0}),XN=As(ZN),JN=m({},gl,{relatedTarget:0}),Lp=As(JN),eC=m({},Lr,{animationName:0,elapsedTime:0,pseudoElement:0}),tC=As(eC),sC=m({},Lr,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),nC=As(sC),aC=m({},Lr,{data:0}),Yy=As(aC),rC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iC={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},oC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lC(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=oC[a])?!!i[a]:!1}function Dp(){return lC}var cC=m({},gl,{key:function(a){if(a.key){var i=rC[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=gd(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?iC[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dp,charCode:function(a){return a.type==="keypress"?gd(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?gd(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),dC=As(cC),uC=m({},bd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qy=As(uC),hC=m({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dp}),pC=As(hC),fC=m({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),mC=As(fC),gC=m({},bd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),xC=As(gC),yC=m({},Lr,{newState:0,oldState:0}),bC=As(yC),vC=[9,13,27,32],Bp=da&&"CompositionEvent"in window,yl=null;da&&"documentMode"in document&&(yl=document.documentMode);var wC=da&&"TextEvent"in window&&!yl,Zy=da&&(!Bp||yl&&8<yl&&11>=yl),Xy=" ",Jy=!1;function eb(a,i){switch(a){case"keyup":return vC.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Di=!1;function jC(a,i){switch(a){case"compositionend":return tb(i);case"keypress":return i.which!==32?null:(Jy=!0,Xy);case"textInput":return a=i.data,a===Xy&&Jy?null:a;default:return null}}function kC(a,i){if(Di)return a==="compositionend"||!Bp&&eb(a,i)?(a=Gy(),md=Op=Ha=null,Di=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Zy&&i.locale!=="ko"?null:i.data;default:return null}}var _C={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sb(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!_C[a.type]:i==="textarea"}function nb(a,i,l,u){Mi?Li?Li.push(u):Li=[u]:Mi=u,i=ru(i,"onChange"),0<i.length&&(l=new yd("onChange","change",null,l,u),a.push({event:l,listeners:i}))}var bl=null,vl=null;function SC(a){B1(a,0)}function vd(a){var i=pl(a);if(Iy(i))return a}function ab(a,i){if(a==="change")return i}var rb=!1;if(da){var Ip;if(da){var $p="oninput"in document;if(!$p){var ib=document.createElement("div");ib.setAttribute("oninput","return;"),$p=typeof ib.oninput=="function"}Ip=$p}else Ip=!1;rb=Ip&&(!document.documentMode||9<document.documentMode)}function ob(){bl&&(bl.detachEvent("onpropertychange",lb),vl=bl=null)}function lb(a){if(a.propertyName==="value"&&vd(vl)){var i=[];nb(i,vl,a,Tp(a)),Fy(SC,i)}}function NC(a,i,l){a==="focusin"?(ob(),bl=i,vl=l,bl.attachEvent("onpropertychange",lb)):a==="focusout"&&ob()}function CC(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return vd(vl)}function EC(a,i){if(a==="click")return vd(i)}function TC(a,i){if(a==="input"||a==="change")return vd(i)}function AC(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var Hs=typeof Object.is=="function"?Object.is:AC;function wl(a,i){if(Hs(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var l=Object.keys(a),u=Object.keys(i);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var g=l[u];if(!ot.call(i,g)||!Hs(a[g],i[g]))return!1}return!0}function cb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function db(a,i){var l=cb(a);a=0;for(var u;l;){if(l.nodeType===3){if(u=a+l.textContent.length,a<=i&&u>=i)return{node:l,offset:i-a};a=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=cb(l)}}function ub(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?ub(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function hb(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=pd(a.document);i instanceof a.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}
vendor: 44,272 bytes, line 8
8if(l)a=i.contentWindow;else break;i=pd(a.document)}return i}function Up(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}var RC=da&&"documentMode"in document&&11>=document.documentMode,Bi=null,Hp=null,jl=null,qp=!1;function pb(a,i,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;qp||Bi==null||Bi!==pd(u)||(u=Bi,"selectionStart"in u&&Up(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),jl&&wl(jl,u)||(jl=u,u=ru(Hp,"onSelect"),0<u.length&&(i=new yd("onSelect","select",null,i,l),a.push({event:i,listeners:u}),i.target=Bi)))}function Dr(a,i){var l={};return l[a.toLowerCase()]=i.toLowerCase(),l["Webkit"+a]="webkit"+i,l["Moz"+a]="moz"+i,l}var Ii={animationend:Dr("Animation","AnimationEnd"),animationiteration:Dr("Animation","AnimationIteration"),animationstart:Dr("Animation","AnimationStart"),transitionrun:Dr("Transition","TransitionRun"),transitionstart:Dr("Transition","TransitionStart"),transitioncancel:Dr("Transition","TransitionCancel"),transitionend:Dr("Transition","TransitionEnd")},Vp={},fb={};da&&(fb=document.createElement("div").style,"AnimationEvent"in window||(delete Ii.animationend.animation,delete Ii.animationiteration.animation,delete Ii.animationstart.animation),"TransitionEvent"in window||delete Ii.transitionend.transition);function Br(a){if(Vp[a])return Vp[a];if(!Ii[a])return a;var i=Ii[a],l;for(l in i)if(i.hasOwnProperty(l)&&l in fb)return Vp[a]=i[l];return a}var mb=Br("animationend"),gb=Br("animationiteration"),xb=Br("animationstart"),OC=Br("transitionrun"),PC=Br("transitionstart"),MC=Br("transitioncancel"),yb=Br("transitionend"),bb=new Map,zp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");zp.push("scrollEnd");function Nn(a,i){bb.set(a,i),Mr(i,[a])}var vb=new WeakMap;function un(a,i){if(typeof a=="object"&&a!==null){var l=vb.get(a);return l!==void 0?l:(i={value:a,source:i,stack:Dy(i)},vb.set(a,i),i)}return{value:a,source:i,stack:Dy(i)}}var hn=[],$i=0,Fp=0;function wd(){for(var a=$i,i=Fp=$i=0;i<a;){var l=hn[i];hn[i++]=null;var u=hn[i];hn[i++]=null;var g=hn[i];hn[i++]=null;var b=hn[i];if(hn[i++]=null,u!==null&&g!==null){var _=u.pending;_===null?g.next=g:(g.next=_.next,_.next=g),u.pending=g}b!==0&&wb(l,g,b)}}function jd(a,i,l,u){hn[$i++]=a,hn[$i++]=i,hn[$i++]=l,hn[$i++]=u,Fp|=u,a.lanes|=u,a=a.alternate,a!==null&&(a.lanes|=u)}function Gp(a,i,l,u){return jd(a,i,l,u),kd(a)}function Ui(a,i){return jd(a,null,null,i),kd(a)}function wb(a,i,l){a.lanes|=l;var u=a.alternate;u!==null&&(u.lanes|=l);for(var g=!1,b=a.return;b!==null;)b.childLanes|=l,u=b.alternate,u!==null&&(u.childLanes|=l),b.tag===22&&(a=b.stateNode,a===null||a._visibility&1||(g=!0)),a=b,b=b.return;return a.tag===3?(b=a.stateNode,g&&i!==null&&(g=31-ct(l),a=b.hiddenUpdates,u=a[g],u===null?a[g]=[i]:u.push(i),i.lane=l|536870912),b):null}function kd(a){if(50<Kl)throw Kl=0,Jf=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var Hi={};function LC(a,i,l,u){this.tag=a,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qs(a,i,l,u){return new LC(a,i,l,u)}function Kp(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ua(a,i){var l=a.alternate;return l===null?(l=qs(a.tag,i,a.key,a.mode),l.elementType=a.elementType,l.type=a.type,l.stateNode=a.stateNode,l.alternate=a,a.alternate=l):(l.pendingProps=i,l.type=a.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=a.flags&65011712,l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,i=a.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=a.sibling,l.index=a.index,l.ref=a.ref,l.refCleanup=a.refCleanup,l}function jb(a,i){a.flags&=65011714;var l=a.alternate;return l===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,i=l.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function _d(a,i,l,u,g,b){var _=0;if(u=a,typeof a=="function")Kp(a)&&(_=1);else if(typeof a=="string")_=B6(a,l,le.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case L:return a=qs(31,l,i,g),a.elementType=L,a.lanes=b,a;case j:return Ir(l.children,g,b,i);case k:_=8,g|=24;break;case S:return a=qs(12,l,i,g|2),a.elementType=S,a.lanes=b,a;case P:return a=qs(13,l,i,g),a.elementType=P,a.lanes=b,a;case M:return a=qs(19,l,i,g),a.elementType=M,a.lanes=b,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:case E:_=10;break e;case C:_=9;break e;case O:_=11;break e;case B:_=14;break e;case A:_=16,u=null;break e}_=29,l=Error(r(130,a===null?"null":typeof a,"")),u=null}return i=qs(_,l,i,g),i.elementType=a,i.type=u,i.lanes=b,i}function Ir(a,i,l,u){return a=qs(7,a,u,i),a.lanes=l,a}function Wp(a,i,l){return a=qs(6,a,null,i),a.lanes=l,a}function Yp(a,i,l){return i=qs(4,a.children!==null?a.children:[],a.key,i),i.lanes=l,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var qi=[],Vi=0,Sd=null,Nd=0,pn=[],fn=0,$r=null,ha=1,pa="";function Ur(a,i){qi[Vi++]=Nd,qi[Vi++]=Sd,Sd=a,Nd=i}function kb(a,i,l){pn[fn++]=ha,pn[fn++]=pa,pn[fn++]=$r,$r=a;var u=ha;a=pa;var g=32-ct(u)-1;u&=~(1<<g),l+=1;var b=32-ct(i)+g;if(30<b){var _=g-g%5;b=(u&(1<<_)-1).toString(32),u>>=_,g-=_,ha=1<<32-ct(i)+g|l<<g|u,pa=b+a}else ha=1<<b|l<<g|u,pa=a}function Qp(a){a.return!==null&&(Ur(a,1),kb(a,1,0))}function Zp(a){for(;a===Sd;)Sd=qi[--Vi],qi[Vi]=null,Nd=qi[--Vi],qi[Vi]=null;for(;a===$r;)$r=pn[--fn],pn[fn]=null,pa=pn[--fn],pn[fn]=null,ha=pn[--fn],pn[fn]=null}var bs=null,Tt=null,tt=!1,Hr=null,Vn=!1,Xp=Error(r(519));function qr(a){var i=Error(r(418,""));throw Sl(un(i,a)),Xp}function _b(a){var i=a.stateNode,l=a.type,u=a.memoizedProps;switch(i[Ie]=a,i[He]=u,l){case"dialog":Ke("cancel",i),Ke("close",i);break;case"iframe":case"object":case"embed":Ke("load",i);break;case"video":case"audio":for(l=0;l<Yl.length;l++)Ke(Yl[l],i);break;case"source":Ke("error",i);break;case"img":case"image":case"link":Ke("error",i),Ke("load",i);break;case"details":Ke("toggle",i);break;case"input":Ke("invalid",i),$y(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0),hd(i);break;case"select":Ke("invalid",i);break;case"textarea":Ke("invalid",i),Hy(i,u.value,u.defaultValue,u.children),hd(i)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||u.suppressHydrationWarning===!0||H1(i.textContent,l)?(u.popover!=null&&(Ke("beforetoggle",i),Ke("toggle",i)),u.onScroll!=null&&Ke("scroll",i),u.onScrollEnd!=null&&Ke("scrollend",i),u.onClick!=null&&(i.onclick=iu),i=!0):i=!1,i||qr(a)}function Sb(a){for(bs=a.return;bs;)switch(bs.tag){case 5:case 13:Vn=!1;return;case 27:case 3:Vn=!0;return;default:bs=bs.return}}function kl(a){if(a!==bs)return!1;if(!tt)return Sb(a),tt=!0,!1;var i=a.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=a.type,l=!(l!=="form"&&l!=="button")||mm(a.type,a.memoizedProps)),l=!l),l&&Tt&&qr(a),Sb(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));e:{for(a=a.nextSibling,i=0;a;){if(a.nodeType===8)if(l=a.data,l==="/$"){if(i===0){Tt=En(a.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++;a=a.nextSibling}Tt=null}}else i===27?(i=Tt,nr(a.type)?(a=bm,bm=null,Tt=a):Tt=i):Tt=bs?En(a.stateNode.nextSibling):null;return!0}function _l(){Tt=bs=null,tt=!1}function Nb(){var a=Hr;return a!==null&&(Ps===null?Ps=a:Ps.push.apply(Ps,a),Hr=null),a}function Sl(a){Hr===null?Hr=[a]:Hr.push(a)}var Jp=Q(null),Vr=null,fa=null;function qa(a,i,l){ne(Jp,i._currentValue),i._currentValue=l}function ma(a){a._currentValue=Jp.current,oe(Jp)}function ef(a,i,l){for(;a!==null;){var u=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),a===l)break;a=a.return}}function tf(a,i,l,u){var g=a.child;for(g!==null&&(g.return=a);g!==null;){var b=g.dependencies;if(b!==null){var _=g.child;b=b.firstContext;e:for(;b!==null;){var T=b;b=g;for(var D=0;D<i.length;D++)if(T.context===i[D]){b.lanes|=l,T=b.alternate,T!==null&&(T.lanes|=l),ef(b.return,l,a),u||(_=null);break e}b=T.next}}else if(g.tag===18){if(_=g.return,_===null)throw Error(r(341));_.lanes|=l,b=_.alternate,b!==null&&(b.lanes|=l),ef(_,l,a),_=null}else _=g.child;if(_!==null)_.return=g;else for(_=g;_!==null;){if(_===a){_=null;break}if(g=_.sibling,g!==null){g.return=_.return,_=g;break}_=_.return}g=_}}function Nl(a,i,l,u){a=null;for(var g=i,b=!1;g!==null;){if(!b){if((g.flags&524288)!==0)b=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var _=g.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var T=g.type;Hs(g.pendingProps.value,_.value)||(a!==null?a.push(T):a=[T])}}else if(g===Ne.current){if(_=g.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(a!==null?a.push(tc):a=[tc])}g=g.return}a!==null&&tf(i,a,l,u),i.flags|=262144}function Cd(a){for(a=a.firstContext;a!==null;){if(!Hs(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function zr(a){Vr=a,fa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ms(a){return Cb(Vr,a)}function Ed(a,i){return Vr===null&&zr(a),Cb(a,i)}function Cb(a,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},fa===null){if(a===null)throw Error(r(308));fa=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else fa=fa.next=i;return l}var DC=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(l,u){a.push(u)}};this.abort=function(){i.aborted=!0,a.forEach(function(l){return l()})}},BC=e.unstable_scheduleCallback,IC=e.unstable_NormalPriority,Vt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sf(){return{controller:new DC,data:new Map,refCount:0}}function Cl(a){a.refCount--,a.refCount===0&&BC(IC,function(){a.controller.abort()})}var El=null,nf=0,zi=0,Fi=null;function $C(a,i){if(El===null){var l=El=[];nf=0,zi=im(),Fi={status:"pending",value:void 0,then:function(u){l.push(u)}}}return nf++,i.then(Eb,Eb),i}function Eb(){if(--nf===0&&El!==null){Fi!==null&&(Fi.status="fulfilled");var a=El;El=null,zi=0,Fi=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function UC(a,i){var l=[],u={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return a.then(function(){u.status="fulfilled",u.value=i;for(var g=0;g<l.length;g++)(0,l[g])(i)},function(g){for(u.status="rejected",u.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),u}var Tb=I.S;I.S=function(a,i){typeof i=="object"&&i!==null&&typeof i.then=="function"&&$C(a,i),Tb!==null&&Tb(a,i)};var Fr=Q(null);function af(){var a=Fr.current;return a!==null?a:xt.pooledCache}function Td(a,i){i===null?ne(Fr,Fr.current):ne(Fr,i.pool)}function Ab(){var a=af();return a===null?null:{parent:Vt._currentValue,pool:a}}var Tl=Error(r(460)),Rb=Error(r(474)),Ad=Error(r(542)),rf={then:function(){}};function Ob(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Rd(){}function Pb(a,i,l){switch(l=a[l],l===void 0?a.push(i):l!==i&&(i.then(Rd,Rd),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,Lb(a),a;default:if(typeof i.status=="string")i.then(Rd,Rd);else{if(a=xt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(u){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=u}},function(u){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,Lb(a),a}throw Al=i,Tl}}var Al=null;function Mb(){if(Al===null)throw Error(r(459));var a=Al;return Al=null,a}function Lb(a){if(a===Tl||a===Ad)throw Error(r(483))}var Va=!1;function of(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lf(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function za(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Fa(a,i,l){var u=a.updateQueue;if(u===null)return null;if(u=u.shared,(at&2)!==0){var g=u.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),u.pending=i,i=kd(a),wb(a,null,l),i}return jd(a,u,i,l),kd(a)}function Rl(a,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var u=i.lanes;u&=a.pendingLanes,l|=u,i.lanes=l,Dt(a,l)}}function cf(a,i){var l=a.updateQueue,u=a.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var g=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var _={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?g=b=_:b=b.next=_,l=l.next}while(l!==null);b===null?g=b=i:b=b.next=i}else g=b=i;l={baseState:u.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:u.shared,callbacks:u.callbacks},a.updateQueue=l;return}a=l.lastBaseUpdate,a===null?l.firstBaseUpdate=i:a.next=i,l.lastBaseUpdate=i}var df=!1;function Ol(){if(df){var a=Fi;if(a!==null)throw a}}function Pl(a,i,l,u){df=!1;var g=a.updateQueue;Va=!1;var b=g.firstBaseUpdate,_=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var D=T,F=D.next;D.next=null,_===null?b=F:_.next=F,_=D;var ae=a.alternate;ae!==null&&(ae=ae.updateQueue,T=ae.lastBaseUpdate,T!==_&&(T===null?ae.firstBaseUpdate=F:T.next=F,ae.lastBaseUpdate=D))}if(b!==null){var ie=g.baseState;_=0,ae=F=D=null,T=b;do{var Y=T.lane&-536870913,X=Y!==T.lane;if(X?(Ze&Y)===Y:(u&Y)===Y){Y!==0&&Y===zi&&(df=!0),ae!==null&&(ae=ae.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var Pe=a,Re=T;Y=i;var ft=l;switch(Re.tag){case 1:if(Pe=Re.payload,typeof Pe=="function"){ie=Pe.call(ft,ie,Y);break e}ie=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=Re.payload,Y=typeof Pe=="function"?Pe.call(ft,ie,Y):Pe,Y==null)break e;ie=m({},ie,Y);break e;case 2:Va=!0}}Y=T.callback,Y!==null&&(a.flags|=64,X&&(a.flags|=8192),X=g.callbacks,X===null?g.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ae===null?(F=ae=X,D=ie):ae=ae.next=X,_|=Y;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;X=T,T=X.next,X.next=null,g.lastBaseUpdate=X,g.shared.pending=null}}while(!0);ae===null&&(D=ie),g.baseState=D,g.firstBaseUpdate=F,g.lastBaseUpdate=ae,b===null&&(g.shared.lanes=0),Ja|=_,a.lanes=_,a.memoizedState=ie}}function Db(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function Bb(a,i){var l=a.callbacks;if(l!==null)for(a.callbacks=null,a=0;a<l.length;a++)Db(l[a],i)}var Gi=Q(null),Od=Q(0);function Ib(a,i){a=ja,ne(Od,a),ne(Gi,i),ja=a|i.baseLanes}function uf(){ne(Od,ja),ne(Gi,Gi.current)}function hf(){ja=Od.current,oe(Gi),oe(Od)}var Ga=0,Ve=null,ht=null,Bt=null,Pd=!1,Ki=!1,Gr=!1,Md=0,Ml=0,Wi=null,HC=0;function Pt(){throw Error(r(321))}function pf(a,i){if(i===null)return!1;for(var l=0;l<i.length&&l<a.length;l++)if(!Hs(a[l],i[l]))return!1;return!0}function ff(a,i,l,u,g,b){return Ga=b,Ve=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,I.H=a===null||a.memoizedState===null?wv:jv,Gr=!1,b=l(u,g),Gr=!1,Ki&&(b=Ub(i,l,u,g)),$b(a),b}function $b(a){I.H=Ud;var i=ht!==null&&ht.next!==null;if(Ga=0,Bt=ht=Ve=null,Pd=!1,Ml=0,Wi=null,i)throw Error(r(300));a===null||Xt||(a=a.dependencies,a!==null&&Cd(a)&&(Xt=!0))}function Ub(a,i,l,u){Ve=a;var g=0;do{if(Ki&&(Wi=null),Ml=0,Ki=!1,25<=g)throw Error(r(301));if(g+=1,Bt=ht=null,a.updateQueue!=null){var b=a.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}I.H=WC,b=i(l,u)}while(Ki);return b}function qC(){var a=I.H,i=a.useState()[0];return i=typeof i.then=="function"?Ll(i):i,a=a.useState()[0],(ht!==null?ht.memoizedState:null)!==a&&(Ve.flags|=1024),i}function mf(){var a=Md!==0;return Md=0,a}function gf(a,i,l){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~l}function xf(a){if(Pd){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}Pd=!1}Ga=0,Bt=ht=Ve=null,Ki=!1,Ml=Md=0,Wi=null}function Rs(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ve.memoizedState=Bt=a:Bt=Bt.next=a,Bt}function It(){if(ht===null){var a=Ve.alternate;a=a!==null?a.memoizedState:null}else a=ht.next;var i=Bt===null?Ve.memoizedState:Bt.next;if(i!==null)Bt=i,ht=a;else{if(a===null)throw Ve.alternate===null?Error(r(467)):Error(r(310));ht=a,a={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Bt===null?Ve.memoizedState=Bt=a:Bt=Bt.next=a}return Bt}function yf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ll(a){var i=Ml;return Ml+=1,Wi===null&&(Wi=[]),a=Pb(Wi,a,i),i=Ve,(Bt===null?i.memoizedState:Bt.next)===null&&(i=i.alternate,I.H=i===null||i.memoizedState===null?wv:jv),a}function Ld(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Ll(a);if(a.$$typeof===E)return ms(a)}throw Error(r(438,String(a)))}function bf(a){var i=null,l=Ve.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var u=Ve.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=yf(),Ve.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(a),u=0;u<a;u++)l[u]=U;return i.index++,l}function ga(a,i){return typeof i=="function"?i(a):i}function Dd(a){var i=It();return vf(i,ht,a)}function vf(a,i,l){var u=a.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=l;var g=a.baseQueue,b=u.pending;if(b!==null){if(g!==null){var _=g.next;g.next=b.next,b.next=_}i.baseQueue=g=b,u.pending=null}if(b=a.baseState,g===null)a.memoizedState=b;else{i=g.next;var T=_=null,D=null,F=i,ae=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(Ze&ie)===ie:(Ga&ie)===ie){var Y=F.revertLane;if(Y===0)D!==null&&(D=D.next={lane:0,revertLane:0,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ie===zi&&(ae=!0);else if((Ga&Y)===Y){F=F.next,Y===zi&&(ae=!0);continue}else ie={lane:0,revertLane:F.revertLane,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(T=D=ie,_=b):D=D.next=ie,Ve.lanes|=Y,Ja|=Y;ie=F.action,Gr&&l(b,ie),b=F.hasEagerState?F.eagerState:l(b,ie)}else Y={lane:ie,revertLane:F.revertLane,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(T=D=Y,_=b):D=D.next=Y,Ve.lanes|=ie,Ja|=ie;F=F.next}while(F!==null&&F!==i);if(D===null?_=b:D.next=T,!Hs(b,a.memoizedState)&&(Xt=!0,ae&&(l=Fi,l!==null)))throw l;a.memoizedState=b,a.baseState=_,a.baseQueue=D,u.lastRenderedState=b}return g===null&&(u.lanes=0),[a.memoizedState,u.dispatch]}function wf(a){var i=It(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=a;var u=l.dispatch,g=l.pending,b=i.memoizedState;if(g!==null){l.pending=null;var _=g=g.next;do b=a(b,_.action),_=_.next;while(_!==g);Hs(b,i.memoizedState)||(Xt=!0),i.memoizedState=b,i.baseQueue===null&&(i.baseState=b),l.lastRenderedState=b}return[b,u]}function Hb(a,i,l){var u=Ve,g=It(),b=tt;if(b){if(l===void 0)throw Error(r(407));l=l()}else l=i();var _=!Hs((ht||g).memoizedState,l);_&&(g.memoizedState=l,Xt=!0),g=g.queue;var T=zb.bind(null,u,g,a);if(Dl(2048,8,T,[a]),g.getSnapshot!==i||_||Bt!==null&&Bt.memoizedState.tag&1){if(u.flags|=2048,Yi(9,Bd(),Vb.bind(null,u,g,l,i),null),xt===null)throw Error(r(349));b||(Ga&124)!==0||qb(u,i,l)}return l}function qb(a,i,l){a.flags|=16384,a={getSnapshot:i,value:l},i=Ve.updateQueue,i===null?(i=yf(),Ve.updateQueue=i,i.stores=[a]):(l=i.stores,l===null?i.stores=[a]:l.push(a))}function Vb(a,i,l,u){i.value=l,i.getSnapshot=u,Fb(i)&&Gb(a)}function zb(a,i,l){return l(function(){Fb(i)&&Gb(a)})}function Fb(a){var i=a.getSnapshot;a=a.value;try{var l=i();return!Hs(a,l)}catch{return!0}}function Gb(a){var i=Ui(a,2);i!==null&&Ks(i,a,2)}function jf(a){var i=Rs();if(typeof a=="function"){var l=a;if(a=l(),Gr){Et(!0);try{l()}finally{Et(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:a},i}function Kb(a,i,l,u){return a.baseState=l,vf(a,ht,typeof u=="function"?u:ga)}function VC(a,i,l,u,g){if($d(a))throw Error(r(485));if(a=i.action,a!==null){var b={payload:g,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){b.listeners.push(_)}};I.T!==null?l(!0):b.isTransition=!1,u(b),l=i.pending,l===null?(b.next=i.pending=b,Wb(i,b)):(b.next=l.next,i.pending=l.next=b)}}function Wb(a,i){var l=i.action,u=i.payload,g=a.state;if(i.isTransition){var b=I.T,_={};I.T=_;try{var T=l(g,u),D=I.S;D!==null&&D(_,T),Yb(a,i,T)}catch(F){kf(a,i,F)}finally{I.T=b}}else try{b=l(g,u),Yb(a,i,b)}catch(F){kf(a,i,F)}}function Yb(a,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Qb(a,i,u)},function(u){return kf(a,i,u)}):Qb(a,i,l)}function Qb(a,i,l){i.status="fulfilled",i.value=l,Zb(i),a.state=l,i=a.pending,i!==null&&(l=i.next,l===i?a.pending=null:(l=l.next,i.next=l,Wb(a,l)))}function kf(a,i,l){var u=a.pending;if(a.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=l,Zb(i),i=i.next;while(i!==u)}a.action=null}function Zb(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function Xb(a,i){return i}function Jb(a,i){if(tt){var l=xt.formState;if(l!==null){e:{var u=Ve;if(tt){if(Tt){t:{for(var g=Tt,b=Vn;g.nodeType!==8;){if(!b){g=null;break t}if(g=En(g.nextSibling),g===null){g=null;break t}}b=g.data,g=b==="F!"||b==="F"?g:null}if(g){Tt=En(g.nextSibling),u=g.data==="F!";break e}}qr(u)}u=!1}u&&(i=l[0])}}return l=Rs(),l.memoizedState=l.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xb,lastRenderedState:i},l.queue=u,l=yv.bind(null,Ve,u),u.dispatch=l,u=jf(!1),b=Ef.bind(null,Ve,!1,u.queue),u=Rs(),g={state:i,dispatch:null,action:a,pending:null},u.queue=g,l=VC.bind(null,Ve,g,b,l),g.dispatch=l,u.memoizedState=a,[i,l,!1]}function ev(a){var i=It();return tv(i,ht,a)}function tv(a,i,l){if(i=vf(a,i,Xb)[0],a=Dd(ga)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=Ll(i)}catch(_){throw _===Tl?Ad:_}else u=i;i=It();var g=i.queue,b=g.dispatch;return l!==i.memoizedState&&(Ve.flags|=2048,Yi(9,Bd(),zC.bind(null,g,l),null)),[u,b,a]}function zC(a,i){a.action=i}function sv(a){var i=It(),l=ht;if(l!==null)return tv(i,l,a);It(),i=i.memoizedState,l=It();var u=l.queue.dispatch;return l.memoizedState=a,[i,u,!1]}function Yi(a,i,l,u){return a={tag:a,create:l,deps:u,inst:i,next:null},i=Ve.updateQueue,i===null&&(i=yf(),Ve.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=a.next=a:(u=l.next,l.next=a,a.next=u,i.lastEffect=a),a}function Bd(){return{destroy:void 0,resource:void 0}}function nv(){return It().memoizedState}function Id(a,i,l,u){var g=Rs();u=u===void 0?null:u,Ve.flags|=a,g.memoizedState=Yi(1|i,Bd(),l,u)}function Dl(a,i,l,u){var g=It();u=u===void 0?null:u;var b=g.memoizedState.inst;ht!==null&&u!==null&&pf(u,ht.memoizedState.deps)?g.memoizedState=Yi(i,b,l,u):(Ve.flags|=a,g.memoizedState=Yi(1|i,b,l,u))}function av(a,i){Id(8390656,8,a,i)}function rv(a,i){Dl(2048,8,a,i)}function iv(a,i){return Dl(4,2,a,i)}function ov(a,i){return Dl(4,4,a,i)}function lv(a,i){if(typeof i=="function"){a=a();var l=i(a);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function cv(a,i,l){l=l!=null?l.concat([a]):null,Dl(4,4,lv.bind(null,i,a),l)}function _f(){}function dv(a,i){var l=It();i=i===void 0?null:i;var u=l.memoizedState;return i!==null&&pf(i,u[1])?u[0]:(l.memoizedState=[a,i],a)}function uv(a,i){var l=It();i=i===void 0?null:i;var u=l.memoizedState;if(i!==null&&pf(i,u[1]))return u[0];if(u=a(),Gr){Et(!0);try{a()}finally{Et(!1)}}return l.memoizedState=[u,i],u}function Sf(a,i,l){return l===void 0||(Ga&1073741824)!==0?a.memoizedState=i:(a.memoizedState=l,a=f1(),Ve.lanes|=a,Ja|=a,l)}function hv(a,i,l,u){return Hs(l,i)?l:Gi.current!==null?(a=Sf(a,l,u),Hs(a,i)||(Xt=!0),a):(Ga&42)===0?(Xt=!0,a.memoizedState=l):(a=f1(),Ve.lanes|=a,Ja|=a,i)}function pv(a,i,l,u,g){var b=V.p;V.p=b!==0&&8>b?b:8;var _=I.T,T={};I.T=T,Ef(a,!1,i,l);try{var D=g(),F=I.S;if(F!==null&&F(T,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ae=UC(D,u);Bl(a,i,ae,Gs(a))}else Bl(a,i,u,Gs(a))}catch(ie){Bl(a,i,{then:function(){},status:"rejected",reason:ie},Gs())}finally{V.p=b,I.T=_}}function FC(){}function Nf(a,i,l,u){if(a.tag!==5)throw Error(r(476));var g=fv(a).queue;pv(a,g,i,H,l===null?FC:function(){return mv(a),l(u)})}function fv(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:H},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:l},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function mv(a){var i=fv(a).next.queue;Bl(a,i,{},Gs())}function Cf(){return ms(tc)}function gv(){return It().memoizedState}function xv(){return It().memoizedState}function GC(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var l=Gs();a=za(l);var u=Fa(i,a,l);u!==null&&(Ks(u,i,l),Rl(u,i,l)),i={cache:sf()},a.payload=i;return}i=i.return}}function KC(a,i,l){var u=Gs();l={lane:u,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},$d(a)?bv(i,l):(l=Gp(a,i,l,u),l!==null&&(Ks(l,a,u),vv(l,i,u)))}function yv(a,i,l){var u=Gs();Bl(a,i,l,u)}function Bl(a,i,l,u){var g={lane:u,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if($d(a))bv(i,g);else{var b=a.alternate;if(a.lanes===0&&(b===null||b.lanes===0)&&(b=i.lastRenderedReducer,b!==null))try{var _=i.lastRenderedState,T=b(_,l);if(g.hasEagerState=!0,g.eagerState=T,Hs(T,_))return jd(a,i,g,0),xt===null&&wd(),!1}catch{}if(l=Gp(a,i,g,u),l!==null)return Ks(l,a,u),vv(l,i,u),!0}return!1}function Ef(a,i,l,u){if(u={lane:2,revertLane:im(),action:u,hasEagerState:!1,eagerState:null,next:null},$d(a)){if(i)throw Error(r(479))}else i=Gp(a,l,u,2),i!==null&&Ks(i,a,2)}function $d(a){var i=a.alternate;return a===Ve||i!==null&&i===Ve}function bv(a,i){Ki=Pd=!0;var l=a.pending;l===null?i.next=i:(i.next=l.next,l.next=i),a.pending=i}function vv(a,i,l){if((l&4194048)!==0){var u=i.lanes;u&=a.pendingLanes,l|=u,i.lanes=l,Dt(a,l)}}var Ud={readContext:ms,use:Ld,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt},wv={readContext:ms,use:Ld,useCallback:function(a,i){return Rs().memoizedState=[a,i===void 0?null:i],a},useContext:ms,useEffect:av,useImperativeHandle:function(a,i,l){l=l!=null?l.concat([a]):null,Id(4194308,4,lv.bind(null,i,a),l)},useLayoutEffect:function(a,i){return Id(4194308,4,a,i)},useInsertionEffect:function(a,i){Id(4,2,a,i)},useMemo:function(a,i){var l=Rs();i=i===void 0?null:i;var u=a();if(Gr){Et(!0);try{a()}finally{Et(!1)}}return l.memoizedState=[u,i],u},useReducer:function(a,i,l){var u=Rs();if(l!==void 0){var g=l(i);if(Gr){Et(!0);try{l(i)}finally{Et(!1)}}}else g=i;return u.memoizedState=u.baseState=g,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:g},u.queue=a,a=a.dispatch=KC.bind(null,Ve,a),[u.memoizedState,a]},useRef:function(a){var i=Rs();return a={current:a},i.memoizedState=a},useState:function(a){a=jf(a);var i=a.queue,l=yv.bind(null,Ve,i);return i.dispatch=l,[a.memoizedState,l]},useDebugValue:_f,useDeferredValue:function(a,i){var l=Rs();return Sf(l,a,i)},useTransition:function(){var a=jf(!1);return a=pv.bind(null,Ve,a.queue,!0,!1),Rs().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,l){var u=Ve,g=Rs();if(tt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),xt===null)throw Error(r(349));(Ze&124)!==0||qb(u,i,l)}g.memoizedState=l;var b={value:l,getSnapshot:i};return g.queue=b,av(zb.bind(null,u,b,a),[a]),u.flags|=2048,Yi(9,Bd(),Vb.bind(null,u,b,l,i),null),l},useId:function(){var a=Rs(),i=xt.identifierPrefix;if(tt){var l=pa,u=ha;l=(u&~(1<<32-ct(u)-1)).toString(32)+l,i="«"+i+"R"+l,l=Md++,0<l&&(i+="H"+l.toString(32)),i+="»"}else l=HC++,i="«"+i+"r"+l.toString(32)+"»";return a.memoizedState=i},useHostTransitionStatus:Cf,useFormState:Jb,useActionState:Jb,useOptimistic:function(a){var i=Rs();i.memoizedState=i.baseState=a;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Ef.bind(null,Ve,!0,l),l.dispatch=i,[a,i]},useMemoCache:bf,useCacheRefresh:function(){return Rs().memoizedState=GC.bind(null,Ve)}},jv={readContext:ms,use:Ld,useCallback:dv,useContext:ms,useEffect:rv,useImperativeHandle:cv,useInsertionEffect:iv,useLayoutEffect:ov,useMemo:uv,useReducer:Dd,useRef:nv,useState:function(){return Dd(ga)},useDebugValue:_f,useDeferredValue:function(a,i){var l=It();return hv(l,ht.memoizedState,a,i)},useTransition:function(){var a=Dd(ga)[0],i=It().memoizedState;return[typeof a=="boolean"?a:Ll(a),i]},useSyncExternalStore:Hb,useId:gv,useHostTransitionStatus:Cf,useFormState:ev,useActionState:ev,useOptimistic:function(a,i){var l=It();return Kb(l,ht,a,i)},useMemoCache:bf,useCacheRefresh:xv},WC={readContext:ms,use:Ld,useCallback:dv,useContext:ms,useEffect:rv,useImperativeHandle:cv,useInsertionEffect:iv,useLayoutEffect:ov,useMemo:uv,useReducer:wf,useRef:nv,useState:function(){return wf(ga)},useDebugValue:_f,useDeferredValue:function(a,i){var l=It();return ht===null?Sf(l,a,i):hv(l,ht.memoizedState,a,i)},useTransition:function(){var a=wf(ga)[0],i=It().memoizedState;return[typeof a=="boolean"?a:Ll(a),i]},useSyncExternalStore:Hb,useId:gv,useHostTransitionStatus:Cf,useFormState:sv,useActionState:sv,useOptimistic:function(a,i){var l=It();return ht!==null?Kb(l,ht,a,i):(l.baseState=a,[a,l.queue.dispatch])},useMemoCache:bf,useCacheRefresh:xv},Qi=null,Il=0;function Hd(a){var i=Il;return Il+=1,Qi===null&&(Qi=[]),Pb(Qi,a,i)}function $l(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function qd(a,i){throw i.$$typeof===x?Error(r(525)):(a=Object.prototype.toString.call(i),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function kv(a){var i=a._init;return i(a._payload)}function _v(a){function i(q,$){if(a){var z=q.deletions;z===null?(q.deletions=[$],q.flags|=16):z.push($)}}function l(q,$){if(!a)return null;for(;$!==null;)i(q,$),$=$.sibling;return null}function u(q){for(var $=new Map;q!==null;)q.key!==null?$.set(q.key,q):$.set(q.index,q),q=q.sibling;return $}function g(q,$){return q=ua(q,$),q.index=0,q.sibling=null,q}function b(q,$,z){return q.index=z,a?(z=q.alternate,z!==null?(z=z.index,z<$?(q.flags|=67108866,$):z):(q.flags|=67108866,$)):(q.flags|=1048576,$)}function _(q){return a&&q.alternate===null&&(q.flags|=67108866),q}function T(q,$,z,re){return $===null||$.tag!==6?($=Wp(z,q.mode,re),$.return=q,$):($=g($,z),$.return=q,$)}function D(q,$,z,re){var be=z.type;return be===j?ae(q,$,z.props.children,re,z.key):$!==null&&($.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===A&&kv(be)===$.type)?($=g($,z.props),$l($,z),$.return=q,$):($=_d(z.type,z.key,z.props,null,q.mode,re),$l($,z),$.return=q,$)}function F(q,$,z,re){return $===null||$.tag!==4||$.stateNode.containerInfo!==z.containerInfo||$.stateNode.implementation!==z.implementation?($=Yp(z,q.mode,re),$.return=q,$):($=g($,z.children||[]),$.return=q,$)}function ae(q,$,z,re,be){return $===null||$.tag!==7?($=Ir(z,q.mode,re,be),$.return=q,$):($=g($,z),$.return=q,$)}function ie(q,$,z){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Wp(""+$,q.mode,z),$.return=q,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case y:return z=_d($.type,$.key,$.props,null,q.mode,z),$l(z,$),z.return=q,z;case v:return $=Yp($,q.mode,z),$.return=q,$;case A:var re=$._init;return $=re($._payload),ie(q,$,z)}if(te($)||G($))return $=Ir($,q.mode,z,null),$.return=q,$;if(typeof $.then=="function")return ie(q,Hd($),z);if($.$$typeof===E)return ie(q,Ed(q,$),z);qd(q,$)}return null}function Y(q,$,z,re){var be=$!==null?$.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return be!==null?null:T(q,$,""+z,re);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case y:return z.key===be?D(q,$,z,re):null;case v:return z.key===be?F(q,$,z,re):null;case A:return be=z._init,z=be(z._payload),Y(q,$,z,re)}if(te(z)||G(z))return be!==null?null:ae(q,$,z,re,null);if(typeof z.then=="function")return Y(q,$,Hd(z),re);if(z.$$typeof===E)return Y(q,$,Ed(q,z),re);qd(q,z)}return null}function X(q,$,z,re,be){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return q=q.get(z)||null,T($,q,""+re,be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case y:return q=q.get(re.key===null?z:re.key)||null,D($,q,re,be);case v:return q=q.get(re.key===null?z:re.key)||null,F($,q,re,be);case A:var Fe=re._init;return re=Fe(re._payload),X(q,$,z,re,be)}if(te(re)||G(re))return q=q.get(z)||null,ae($,q,re,be,null);if(typeof re.then=="function")return X(q,$,z,Hd(re),be);if(re.$$typeof===E)return X(q,$,z,Ed($,re),be);qd($,re)}return null}function Pe(q,$,z,re){for(var be=null,Fe=null,Ee=$,Oe=$=0,es=null;Ee!==null&&Oe<z.length;Oe++){Ee.index>Oe?(es=Ee,Ee=null):es=Ee.sibling;var et=Y(q,Ee,z[Oe],re);if(et===null){Ee===null&&(Ee=es);break}a&&Ee&&et.alternate===null&&i(q,Ee),$=b(et,$,Oe),Fe===null?be=et:Fe.sibling=et,Fe=et,Ee=es}if(Oe===z.length)return l(q,Ee),tt&&Ur(q,Oe),be;if(Ee===null){for(;Oe<z.length;Oe++)Ee=ie(q,z[Oe],re),Ee!==null&&($=b(Ee,$,Oe),Fe===null?be=Ee:Fe.sibling=Ee,Fe=Ee);return tt&&Ur(q,Oe),be}for(Ee=u(Ee);Oe<z.length;Oe++)es=X(Ee,q,Oe,z[Oe],re),es!==null&&(a&&es.alternate!==null&&Ee.delete(es.key===null?Oe:es.key),$=b(es,$,Oe),Fe===null?be=es:Fe.sibling=es,Fe=es);return a&&Ee.forEach(function(lr){return i(q,lr)}),tt&&Ur(q,Oe),be}function Re(q,$,z,re){if(z==null)throw Error(r(151));for(var be=null,Fe=null,Ee=$,Oe=$=0,es=null,et=z.next();Ee!==null&&!et.done;Oe++,et=z.next()){Ee.index>Oe?(es=Ee,Ee=null):es=Ee.sibling;var lr=Y(q,Ee,et.value,re);if(lr===null){Ee===null&&(Ee=es);break}a&&Ee&&lr.alternate===null&&i(q,Ee),$=b(lr,$,Oe),Fe===null?be=lr:Fe.sibling=lr,Fe=lr,Ee=es}if(et.done)return l(q,Ee),tt&&Ur(q,Oe),be;if(Ee===null){for(;!et.done;Oe++,et=z.next())et=ie(q,et.value,re),et!==null&&($=b(et,$,Oe),Fe===null?be=et:Fe.sibling=et,Fe=et);return tt&&Ur(q,Oe),be}for(Ee=u(Ee);!et.done;Oe++,et=z.next())et=X(Ee,q,Oe,et.value,re),et!==null&&(a&&et.alternate!==null&&Ee.delete(et.key===null?Oe:et.key),$=b(et,$,Oe),Fe===null?be=et:Fe.sibling=et,Fe=et);return a&&Ee.forEach(function(Y6){return i(q,Y6)}),tt&&Ur(q,Oe),be}function ft(q,$,z,re){if(typeof z=="object"&&z!==null&&z.type===j&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case y:e:{for(var be=z.key;$!==null;){if($.key===be){if(be=z.type,be===j){if($.tag===7){l(q,$.sibling),re=g($,z.props.children),re.return=q,q=re;break e}}else if($.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===A&&kv(be)===$.type){l(q,$.sibling),re=g($,z.props),$l(re,z),re.return=q,q=re;break e}l(q,$);break}else i(q,$);$=$.sibling}z.type===j?(re=Ir(z.props.children,q.mode,re,z.key),re.return=q,q=re):(re=_d(z.type,z.key,z.props,null,q.mode,re),$l(re,z),re.return=q,q=re)}return _(q);case v:e:{for(be=z.key;$!==null;){if($.key===be)if($.tag===4&&$.stateNode.containerInfo===z.containerInfo&&$.stateNode.implementation===z.implementation){l(q,$.sibling),re=g($,z.children||[]),re.return=q,q=re;break e}else{l(q,$);break}else i(q,$);$=$.sibling}re=Yp(z,q.mode,re),re.return=q,q=re}return _(q);case A:return be=z._init,z=be(z._payload),ft(q,$,z,re)}if(te(z))return Pe(q,$,z,re);if(G(z)){if(be=G(z),typeof be!="function")throw Error(r(150));return z=be.call(z),Re(q,$,z,re)}if(typeof z.then=="function")return ft(q,$,Hd(z),re);if(z.$$typeof===E)return ft(q,$,Ed(q,z),re);qd(q,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,$!==null&&$.tag===6?(l(q,$.sibling),re=g($,z),re.return=q,q=re):(l(q,$),re=Wp(z,q.mode,re),re.return=q,q=re),_(q)):l(q,$)}return function(q,$,z,re){try{Il=0;var be=ft(q,$,z,re);return Qi=null,be}catch(Ee){if(Ee===Tl||Ee===Ad)throw Ee;var Fe=qs(29,Ee,null,q.mode);return Fe.lanes=re,Fe.return=q,Fe}}}var Zi=_v(!0),Sv=_v(!1),mn=Q(null),zn=null;function Ka(a){var i=a.alternate;ne(zt,zt.current&1),ne(mn,a),zn===null&&(i===null||Gi.current!==null||i.memoizedState!==null)&&(zn=a)}function Nv(a){if(a.tag===22){if(ne(zt,zt.current),ne(mn,a),zn===null){var i=a.alternate;i!==null&&i.memoizedState!==null&&(zn=a)}}else Wa()}function Wa(){ne(zt,zt.current),ne(mn,mn.current)}function xa(a){oe(mn),zn===a&&(zn=null),oe(zt)}var zt=Q(0);function Vd(a){for(var i=a;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||ym(l)))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}function Tf(a,i,l,u){i=a.memoizedState,l=l(u,i),l=l==null?i:m({},i,l),a.memoizedState=l,a.lanes===0&&(a.updateQueue.baseState=l)}var Af={enqueueSetState:function(a,i,l){a=a._reactInternals;var u=Gs(),g=za(u);g.payload=i,l!=null&&(g.callback=l),i=Fa(a,g,u),i!==null&&(Ks(i,a,u),Rl(i,a,u))},enqueueReplaceState:function(a,i,l){a=a._reactInternals;var u=Gs(),g=za(u);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=Fa(a,g,u),i!==null&&(Ks(i,a,u),Rl(i,a,u))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var l=Gs(),u=za(l);u.tag=2,i!=null&&(u.callback=i),i=Fa(a,u,l),i!==null&&(Ks(i,a,l),Rl(i,a,l))}};function Cv(a,i,l,u,g,b,_){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(u,b,_):i.prototype&&i.prototype.isPureReactComponent?!wl(l,u)||!wl(g,b):!0}function Ev(a,i,l,u){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,u),i.state!==a&&Af.enqueueReplaceState(i,i.state,null)}function Kr(a,i){var l=i;if("ref"in i){l={};for(var u in i)u!=="ref"&&(l[u]=i[u])}if(a=a.defaultProps){l===i&&(l=m({},l));for(var g in a)l[g]===void 0&&(l[g]=a[g])}return l}var zd=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function Tv(a){zd(a)}function Av(a){console.error(a)}function Rv(a){zd(a)}function Fd(a,i){try{var l=a.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Ov(a,i,l){try{var u=a.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Rf(a,i,l){return l=za(l),l.tag=3,l.payload={element:null},l.callback=function(){Fd(a,i)},l}function Pv(a){return a=za(a),a.tag=3,a}function Mv(a,i,l,u){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var b=u.value;a.payload=function(){return g(b)},a.callback=function(){Ov(i,l,u)}}var _=l.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(a.callback=function(){Ov(i,l,u),typeof g!="function"&&(er===null?er=new Set([this]):er.add(this));var T=u.stack;this.componentDidCatch(u.value,{componentStack:T!==null?T:""})})}function YC(a,i,l,u,g){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=l.alternate,i!==null&&Nl(i,l,g,!0),l=mn.current,l!==null){switch(l.tag){case 13:return zn===null?tm():l.alternate===null&&At===0&&(At=3),l.flags&=-257,l.flags|=65536,l.lanes=g,u===rf?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([u]):i.add(u),nm(a,u,g)),!1;case 22:return l.flags|=65536,u===rf?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([u]):l.add(u)),nm(a,u,g)),!1}throw Error(r(435,l.tag))}return nm(a,u,g),tm(),!1}if(tt)return i=mn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,u!==Xp&&(a=Error(r(422),{cause:u}),Sl(un(a,l)))):(u!==Xp&&(i=Error(r(423),{cause:u}),Sl(un(i,l))),a=a.current.alternate,a.flags|=65536,g&=-g,a.lanes|=g,u=un(u,l),g=Rf(a.stateNode,u,g),cf(a,g),At!==4&&(At=2)),!1;var b=Error(r(520),{cause:u});if(b=un(b,l),Gl===null?Gl=[b]:Gl.push(b),At!==4&&(At=2),i===null)return!0;u=un(u,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,a=g&-g,l.lanes|=a,a=Rf(l.stateNode,u,a),cf(l,a),!1;case 1:if(i=l.type,b=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(er===null||!er.has(b))))return l.flags|=65536,g&=-g,l.lanes|=g,g=Pv(g),Mv(g,a,l,u),cf(l,g),!1}l=l.return}while(l!==null);return!1}var Lv=Error(r(461)),Xt=!1;function os(a,i,l,u){i.child=a===null?Sv(i,null,l,u):Zi(i,a.child,l,u)}function Dv(a,i,l,u,g){l=l.render;var b=i.ref;if("ref"in u){var _={};for(var T in u)T!=="ref"&&(_[T]=u[T])}else _=u;return zr(i),u=ff(a,i,l,_,b,g),T=mf(),a!==null&&!Xt?(gf(a,i,g),ya(a,i,g)):(tt&&T&&Qp(i),i.flags|=1,os(a,i,u,g),i.child)}function Bv(a,i,l,u,g){if(a===null){var b=l.type;return typeof b=="function"&&!Kp(b)&&b.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=b,Iv(a,i,b,u,g)):(a=_d(l.type,null,u,i,i.mode,g),a.ref=i.ref,a.return=i,i.child=a)}if(b=a.child,!$f(a,g)){var _=b.memoizedProps;if(l=l.compare,l=l!==null?l:wl,l(_,u)&&a.ref===i.ref)return ya(a,i,g)}return i.flags|=1,a=ua(b,u),a.ref=i.ref,a.return=i,i.child=a}function Iv(a,i,l,u,g){if(a!==null){var b=a.memoizedProps;if(wl(b,u)&&a.ref===i.ref)if(Xt=!1,i.pendingProps=u=b,$f(a,g))(a.flags&131072)!==0&&(Xt=!0);else return i.lanes=a.lanes,ya(a,i,g)}return Of(a,i,l,u,g)}function $v(a,i,l){var u=i.pendingProps,g=u.children,b=a!==null?a.memoizedState:null;if(u.mode==="hidden"){if((i.flags&128)!==0){if(u=b!==null?b.baseLanes|l:l,a!==null){for(g=i.child=a.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;i.childLanes=b&~u}else i.childLanes=0,i.child=null;return Uv(a,i,u,l)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&Td(i,b!==null?b.cachePool:null),b!==null?Ib(i,b):uf(),Nv(i);else return i.lanes=i.childLanes=536870912,Uv(a,i,b!==null?b.baseLanes|l:l,l)}
8else b!==null?(Td(i,b.cachePool),Ib(i,b),Wa(),i.memoizedState=null):(a!==null&&Td(i,null),uf(),Wa());return os(a,i,g,l),i.child}function Uv(a,i,l,u){var g=af();return g=g===null?null:{parent:Vt._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},a!==null&&Td(i,null),uf(),Nv(i),a!==null&&Nl(a,i,u,!0),null}function Gd(a,i){var l=i.ref;if(l===null)a!==null&&a.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(a===null||a.ref!==l)&&(i.flags|=4194816)}}function Of(a,i,l,u,g){return zr(i),l=ff(a,i,l,u,void 0,g),u=mf(),a!==null&&!Xt?(gf(a,i,g),ya(a,i,g)):(tt&&u&&Qp(i),i.flags|=1,os(a,i,l,g),i.child)}function Hv(a,i,l,u,g,b){return zr(i),i.updateQueue=null,l=Ub(i,u,l,g),$b(a),u=mf(),a!==null&&!Xt?(gf(a,i,b),ya(a,i,b)):(tt&&u&&Qp(i),i.flags|=1,os(a,i,l,b),i.child)}function qv(a,i,l,u,g){if(zr(i),i.stateNode===null){var b=Hi,_=l.contextType;typeof _=="object"&&_!==null&&(b=ms(_)),b=new l(u,b),i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Af,i.stateNode=b,b._reactInternals=i,b=i.stateNode,b.props=u,b.state=i.memoizedState,b.refs={},of(i),_=l.contextType,b.context=typeof _=="object"&&_!==null?ms(_):Hi,b.state=i.memoizedState,_=l.getDerivedStateFromProps,typeof _=="function"&&(Tf(i,l,_,u),b.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(_=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),_!==b.state&&Af.enqueueReplaceState(b,b.state,null),Pl(i,u,b,g),Ol(),b.state=i.memoizedState),typeof b.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(a===null){b=i.stateNode;var T=i.memoizedProps,D=Kr(l,T);b.props=D;var F=b.context,ae=l.contextType;_=Hi,typeof ae=="object"&&ae!==null&&(_=ms(ae));var ie=l.getDerivedStateFromProps;ae=typeof ie=="function"||typeof b.getSnapshotBeforeUpdate=="function",T=i.pendingProps!==T,ae||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(T||F!==_)&&Ev(i,b,u,_),Va=!1;var Y=i.memoizedState;b.state=Y,Pl(i,u,b,g),Ol(),F=i.memoizedState,T||Y!==F||Va?(typeof ie=="function"&&(Tf(i,l,ie,u),F=i.memoizedState),(D=Va||Cv(i,l,D,u,Y,F,_))?(ae||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(i.flags|=4194308)):(typeof b.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=F),b.props=u,b.state=F,b.context=_,u=D):(typeof b.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{b=i.stateNode,lf(a,i),_=i.memoizedProps,ae=Kr(l,_),b.props=ae,ie=i.pendingProps,Y=b.context,F=l.contextType,D=Hi,typeof F=="object"&&F!==null&&(D=ms(F)),T=l.getDerivedStateFromProps,(F=typeof T=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(_!==ie||Y!==D)&&Ev(i,b,u,D),Va=!1,Y=i.memoizedState,b.state=Y,Pl(i,u,b,g),Ol();var X=i.memoizedState;_!==ie||Y!==X||Va||a!==null&&a.dependencies!==null&&Cd(a.dependencies)?(typeof T=="function"&&(Tf(i,l,T,u),X=i.memoizedState),(ae=Va||Cv(i,l,ae,u,Y,X,D)||a!==null&&a.dependencies!==null&&Cd(a.dependencies))?(F||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(u,X,D),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(u,X,D)),typeof b.componentDidUpdate=="function"&&(i.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof b.componentDidUpdate!="function"||_===a.memoizedProps&&Y===a.memoizedState||(i.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&Y===a.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=X),b.props=u,b.state=X,b.context=D,u=ae):(typeof b.componentDidUpdate!="function"||_===a.memoizedProps&&Y===a.memoizedState||(i.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&Y===a.memoizedState||(i.flags|=1024),u=!1)}return b=u,Gd(a,i),u=(i.flags&128)!==0,b||u?(b=i.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:b.render(),i.flags|=1,a!==null&&u?(i.child=Zi(i,a.child,null,g),i.child=Zi(i,null,l,g)):os(a,i,l,g),i.memoizedState=b.state,a=i.child):a=ya(a,i,g),a}function Vv(a,i,l,u){return _l(),i.flags|=256,os(a,i,l,u),i.child}var Pf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mf(a){return{baseLanes:a,cachePool:Ab()}}function Lf(a,i,l){return a=a!==null?a.childLanes&~l:0,i&&(a|=gn),a}function zv(a,i,l){var u=i.pendingProps,g=!1,b=(i.flags&128)!==0,_;if((_=b)||(_=a!==null&&a.memoizedState===null?!1:(zt.current&2)!==0),_&&(g=!0,i.flags&=-129),_=(i.flags&32)!==0,i.flags&=-33,a===null){if(tt){if(g?Ka(i):Wa(),tt){var T=Tt,D;if(D=T){e:{for(D=T,T=Vn;D.nodeType!==8;){if(!T){T=null;break e}if(D=En(D.nextSibling),D===null){T=null;break e}}T=D}T!==null?(i.memoizedState={dehydrated:T,treeContext:$r!==null?{id:ha,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},D=qs(18,null,null,0),D.stateNode=T,D.return=i,i.child=D,bs=i,Tt=null,D=!0):D=!1}D||qr(i)}if(T=i.memoizedState,T!==null&&(T=T.dehydrated,T!==null))return ym(T)?i.lanes=32:i.lanes=536870912,null;xa(i)}return T=u.children,u=u.fallback,g?(Wa(),g=i.mode,T=Kd({mode:"hidden",children:T},g),u=Ir(u,g,l,null),T.return=i,u.return=i,T.sibling=u,i.child=T,g=i.child,g.memoizedState=Mf(l),g.childLanes=Lf(a,_,l),i.memoizedState=Pf,u):(Ka(i),Df(i,T))}if(D=a.memoizedState,D!==null&&(T=D.dehydrated,T!==null)){if(b)i.flags&256?(Ka(i),i.flags&=-257,i=Bf(a,i,l)):i.memoizedState!==null?(Wa(),i.child=a.child,i.flags|=128,i=null):(Wa(),g=u.fallback,T=i.mode,u=Kd({mode:"visible",children:u.children},T),g=Ir(g,T,l,null),g.flags|=2,u.return=i,g.return=i,u.sibling=g,i.child=u,Zi(i,a.child,null,l),u=i.child,u.memoizedState=Mf(l),u.childLanes=Lf(a,_,l),i.memoizedState=Pf,i=g);else if(Ka(i),ym(T)){if(_=T.nextSibling&&T.nextSibling.dataset,_)var F=_.dgst;_=F,u=Error(r(419)),u.stack="",u.digest=_,Sl({value:u,source:null,stack:null}),i=Bf(a,i,l)}else if(Xt||Nl(a,i,l,!1),_=(l&a.childLanes)!==0,Xt||_){if(_=xt,_!==null&&(u=l&-l,u=(u&42)!==0?1:Ua(u),u=(u&(_.suspendedLanes|l))!==0?0:u,u!==0&&u!==D.retryLane))throw D.retryLane=u,Ui(a,u),Ks(_,a,u),Lv;T.data==="$?"||tm(),i=Bf(a,i,l)}else T.data==="$?"?(i.flags|=192,i.child=a.child,i=null):(a=D.treeContext,Tt=En(T.nextSibling),bs=i,tt=!0,Hr=null,Vn=!1,a!==null&&(pn[fn++]=h
vendor: 47,615 bytes, line 8
8a,pn[fn++]=pa,pn[fn++]=$r,ha=a.id,pa=a.overflow,$r=i),i=Df(i,u.children),i.flags|=4096);return i}return g?(Wa(),g=u.fallback,T=i.mode,D=a.child,F=D.sibling,u=ua(D,{mode:"hidden",children:u.children}),u.subtreeFlags=D.subtreeFlags&65011712,F!==null?g=ua(F,g):(g=Ir(g,T,l,null),g.flags|=2),g.return=i,u.return=i,u.sibling=g,i.child=u,u=g,g=i.child,T=a.child.memoizedState,T===null?T=Mf(l):(D=T.cachePool,D!==null?(F=Vt._currentValue,D=D.parent!==F?{parent:F,pool:F}:D):D=Ab(),T={baseLanes:T.baseLanes|l,cachePool:D}),g.memoizedState=T,g.childLanes=Lf(a,_,l),i.memoizedState=Pf,u):(Ka(i),l=a.child,a=l.sibling,l=ua(l,{mode:"visible",children:u.children}),l.return=i,l.sibling=null,a!==null&&(_=i.deletions,_===null?(i.deletions=[a],i.flags|=16):_.push(a)),i.child=l,i.memoizedState=null,l)}function Df(a,i){return i=Kd({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function Kd(a,i){return a=qs(22,a,null,i),a.lanes=0,a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},a}function Bf(a,i,l){return Zi(i,a.child,null,l),a=Df(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function Fv(a,i,l){a.lanes|=i;var u=a.alternate;u!==null&&(u.lanes|=i),ef(a.return,i,l)}function If(a,i,l,u,g){var b=a.memoizedState;b===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:g}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=u,b.tail=l,b.tailMode=g)}function Gv(a,i,l){var u=i.pendingProps,g=u.revealOrder,b=u.tail;if(os(a,i,u.children,l),u=zt.current,(u&2)!==0)u=u&1|2,i.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Fv(a,l,i);else if(a.tag===19)Fv(a,l,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}u&=1}switch(ne(zt,u),g){case"forwards":for(l=i.child,g=null;l!==null;)a=l.alternate,a!==null&&Vd(a)===null&&(g=l),l=l.sibling;l=g,l===null?(g=i.child,i.child=null):(g=l.sibling,l.sibling=null),If(i,!1,g,l,b);break;case"backwards":for(l=null,g=i.child,i.child=null;g!==null;){if(a=g.alternate,a!==null&&Vd(a)===null){i.child=g;break}a=g.sibling,g.sibling=l,l=g,g=a}If(i,!0,l,null,b);break;case"together":If(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function ya(a,i,l){if(a!==null&&(i.dependencies=a.dependencies),Ja|=i.lanes,(l&i.childLanes)===0)if(a!==null){if(Nl(a,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(r(153));if(i.child!==null){for(a=i.child,l=ua(a,a.pendingProps),i.child=l,l.return=i;a.sibling!==null;)a=a.sibling,l=l.sibling=ua(a,a.pendingProps),l.return=i;l.sibling=null}return i.child}function $f(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&Cd(a)))}function QC(a,i,l){switch(i.tag){case 3:J(i,i.stateNode.containerInfo),qa(i,Vt,a.memoizedState.cache),_l();break;case 27:case 5:ye(i);break;case 4:J(i,i.stateNode.containerInfo);break;case 10:qa(i,i.type,i.memoizedProps.value);break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(Ka(i),i.flags|=128,null):(l&i.child.childLanes)!==0?zv(a,i,l):(Ka(i),a=ya(a,i,l),a!==null?a.sibling:null);Ka(i);break;case 19:var g=(a.flags&128)!==0;if(u=(l&i.childLanes)!==0,u||(Nl(a,i,l,!1),u=(l&i.childLanes)!==0),g){if(u)return Gv(a,i,l);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),ne(zt,zt.current),u)break;return null;case 22:case 23:return i.lanes=0,$v(a,i,l);case 24:qa(i,Vt,a.memoizedState.cache)}return ya(a,i,l)}function Kv(a,i,l){if(a!==null)if(a.memoizedProps!==i.pendingProps)Xt=!0;else{if(!$f(a,l)&&(i.flags&128)===0)return Xt=!1,QC(a,i,l);Xt=(a.flags&131072)!==0}else Xt=!1,tt&&(i.flags&1048576)!==0&&kb(i,Nd,i.index);switch(i.lanes=0,i.tag){case 16:e:{a=i.pendingProps;var u=i.elementType,g=u._init;if(u=g(u._payload),i.type=u,typeof u=="function")Kp(u)?(a=Kr(u,a),i.tag=1,i=qv(null,i,u,a,l)):(i.tag=0,i=Of(null,i,u,a,l));else{if(u!=null){if(g=u.$$typeof,g===O){i.tag=11,i=Dv(null,i,u,a,l);break e}else if(g===B){i.tag=14,i=Bv(null,i,u,a,l);break e}}throw i=ee(u)||u,Error(r(306,i,""))}}return i;case 0:return Of(a,i,i.type,i.pendingProps,l);case 1:return u=i.type,g=Kr(u,i.pendingProps),qv(a,i,u,g,l);case 3:e:{if(J(i,i.stateNode.containerInfo),a===null)throw Error(r(387));u=i.pendingProps;var b=i.memoizedState;g=b.element,lf(a,i),Pl(i,u,null,l);var _=i.memoizedState;if(u=_.cache,qa(i,Vt,u),u!==b.cache&&tf(i,[Vt],l,!0),Ol(),u=_.element,b.isDehydrated)if(b={element:u,isDehydrated:!1,cache:_.cache},i.updateQueue.baseState=b,i.memoizedState=b,i.flags&256){i=Vv(a,i,u,l);break e}else if(u!==g){g=un(Error(r(424)),i),Sl(g),i=Vv(a,i,u,l);break e}else for(a=i.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,Tt=En(a.firstChild),bs=i,tt=!0,Hr=null,Vn=!0,l=Sv(i,null,u,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(_l(),u===g){i=ya(a,i,l);break e}os(a,i,u,l)}i=i.child}return i;case 26:return Gd(a,i),a===null?(l=Z1(i.type,null,i.pendingProps,null))?i.memoizedState=l:tt||(l=i.type,a=i.pendingProps,u=ou(he.current).createElement(l),u[Ie]=i,u[He]=a,cs(u,l,a),Zt(u),i.stateNode=u):i.memoizedState=Z1(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return ye(i),a===null&&tt&&(u=i.stateNode=W1(i.type,i.pendingProps,he.current),bs=i,Vn=!0,g=Tt,nr(i.type)?(bm=g,Tt=En(u.firstChild)):Tt=g),os(a,i,i.pendingProps.children,l),Gd(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&tt&&((g=u=Tt)&&(u=_6(u,i.type,i.pendingProps,Vn),u!==null?(i.stateNode=u,bs=i,Tt=En(u.firstChild),Vn=!1,g=!0):g=!1),g||qr(i)),ye(i),g=i.type,b=i.pendingProps,_=a!==null?a.memoizedProps:null,u=b.children,mm(g,b)?u=null:_!==null&&mm(g,_)&&(i.flags|=32),i.memoizedState!==null&&(g=ff(a,i,qC,null,null,l),tc._currentValue=g),Gd(a,i),os(a,i,u,l),i.child;case 6:return a===null&&tt&&((a=l=Tt)&&(l=S6(l,i.pendingProps,Vn),l!==null?(i.stateNode=l,bs=i,Tt=null,a=!0):a=!1),a||qr(i)),null;case 13:return zv(a,i,l);case 4:return J(i,i.stateNode.containerInfo),u=i.pendingProps,a===null?i.child=Zi(i,null,u,l):os(a,i,u,l),i.child;case 11:return Dv(a,i,i.type,i.pendingProps,l);case 7:return os(a,i,i.pendingProps,l),i.child;case 8:return os(a,i,i.pendingProps.children,l),i.child;case 12:return os(a,i,i.pendingProps.children,l),i.child;case 10:return u=i.pendingProps,qa(i,i.type,u.value),os(a,i,u.children,l),i.child;case 9:return g=i.type._context,u=i.pendingProps.children,zr(i),g=ms(g),u=u(g),i.flags|=1,os(a,i,u,l),i.child;case 14:return Bv(a,i,i.type,i.pendingProps,l);case 15:return Iv(a,i,i.type,i.pendingProps,l);case 19:return Gv(a,i,l);case 31:return u=i.pendingProps,l=i.mode,u={mode:u.mode,children:u.children},a===null?(l=Kd(u,l),l.ref=i.ref,i.child=l,l.return=i,i=l):(l=ua(a.child,u),l.ref=i.ref,i.child=l,l.return=i,i=l),i;case 22:return $v(a,i,l);case 24:return zr(i),u=ms(Vt),a===null?(g=af(),g===null&&(g=xt,b=sf(),g.pooledCache=b,b.refCount++,b!==null&&(g.pooledCacheLanes|=l),g=b),i.memoizedState={parent:u,cache:g},of(i),qa(i,Vt,g)):((a.lanes&l)!==0&&(lf(a,i),Pl(i,null,null,l),Ol()),g=a.memoizedState,b=i.memoizedState,g.parent!==u?(g={parent:u,cache:u},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),qa(i,Vt,u)):(u=b.cache,qa(i,Vt,u),u!==g.cache&&tf(i,[Vt],l,!0))),os(a,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function ba(a){a.flags|=4}function Wv(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!sw(i)){if(i=mn.current,i!==null&&((Ze&4194048)===Ze?zn!==null:(Ze&62914560)!==Ze&&(Ze&536870912)===0||i!==zn))throw Al=rf,Rb;a.flags|=8192}}function Wd(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?Es():536870912,a.lanes|=i,to|=i)}function Ul(a,i){if(!tt)switch(a.tailMode){case"hidden":i=a.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?a.tail=null:l.sibling=null;break;case"collapsed":l=a.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:u.sibling=null}}function Nt(a){var i=a.alternate!==null&&a.alternate.child===a.child,l=0,u=0;if(i)for(var g=a.child;g!==null;)l|=g.lanes|g.childLanes,u|=g.subtreeFlags&65011712,u|=g.flags&65011712,g.return=a,g=g.sibling;else for(g=a.child;g!==null;)l|=g.lanes|g.childLanes,u|=g.subtreeFlags,u|=g.flags,g.return=a,g=g.sibling;return a.subtreeFlags|=u,a.childLanes=l,i}function ZC(a,i,l){var u=i.pendingProps;switch(Zp(i),i.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return l=i.stateNode,u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),ma(Vt),ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(a===null||a.child===null)&&(kl(i)?ba(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Nb())),Nt(i),null;case 26:return l=i.memoizedState,a===null?(ba(i),l!==null?(Nt(i),Wv(i,l)):(Nt(i),i.flags&=-16777217)):l?l!==a.memoizedState?(ba(i),Nt(i),Wv(i,l)):(Nt(i),i.flags&=-16777217):(a.memoizedProps!==u&&ba(i),Nt(i),i.flags&=-16777217),null;case 27:Le(i),l=he.current;var g=i.type;if(a!==null&&i.stateNode!=null)a.memoizedProps!==u&&ba(i);else{if(!u){if(i.stateNode===null)throw Error(r(166));return Nt(i),null}a=le.current,kl(i)?_b(i):(a=W1(g,u,l),i.stateNode=a,ba(i))}return Nt(i),null;case 5:if(Le(i),l=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==u&&ba(i);else{if(!u){if(i.stateNode===null)throw Error(r(166));return Nt(i),null}if(a=le.current,kl(i))_b(i);else{switch(g=ou(he.current),a){case 1:a=g.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:a=g.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":a=g.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":a=g.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":a=g.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof u.is=="string"?g.createElement("select",{is:u.is}):g.createElement("select"),u.multiple?a.multiple=!0:u.size&&(a.size=u.size);break;default:a=typeof u.is=="string"?g.createElement(l,{is:u.is}):g.createElement(l)}}a[Ie]=i,a[He]=u;e:for(g=i.child;g!==null;){if(g.tag===5||g.tag===6)a.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===i)break e;for(;g.sibling===null;){if(g.return===null||g.return===i)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}i.stateNode=a;e:switch(cs(a,l,u),l){case"button":case"input":case"select":case"textarea":a=!!u.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ba(i)}}return Nt(i),i.flags&=-16777217,null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==u&&ba(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(r(166));if(a=he.current,kl(i)){if(a=i.stateNode,l=i.memoizedProps,u=null,g=bs,g!==null)switch(g.tag){case 27:case 5:u=g.memoizedProps}a[Ie]=i,a=!!(a.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||H1(a.nodeValue,l)),a||qr(i)}else a=ou(a).createTextNode(u),a[Ie]=i,i.stateNode=a}return Nt(i),null;case 13:if(u=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(g=kl(i),u!==null&&u.dehydrated!==null){if(a===null){if(!g)throw Error(r(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[Ie]=i}else _l(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),g=!1}else g=Nb(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(xa(i),i):(xa(i),null)}if(xa(i),(i.flags&128)!==0)return i.lanes=l,i;if(l=u!==null,a=a!==null&&a.memoizedState!==null,l){u=i.child,g=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(g=u.alternate.memoizedState.cachePool.pool);var b=null;u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),b!==g&&(u.flags|=2048)}return l!==a&&l&&(i.child.flags|=8192),Wd(i,i.updateQueue),Nt(i),null;case 4:return ue(),a===null&&dm(i.stateNode.containerInfo),Nt(i),null;case 10:return ma(i.type),Nt(i),null;case 19:if(oe(zt),g=i.memoizedState,g===null)return Nt(i),null;if(u=(i.flags&128)!==0,b=g.rendering,b===null)if(u)Ul(g,!1);else{if(At!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(b=Vd(a),b!==null){for(i.flags|=128,Ul(g,!1),a=b.updateQueue,i.updateQueue=a,Wd(i,a),i.subtreeFlags=0,a=l,l=i.child;l!==null;)jb(l,a),l=l.sibling;return ne(zt,zt.current&1|2),i.child}a=a.sibling}g.tail!==null&&Wt()>Zd&&(i.flags|=128,u=!0,Ul(g,!1),i.lanes=4194304)}else{if(!u)if(a=Vd(b),a!==null){if(i.flags|=128,u=!0,a=a.updateQueue,i.updateQueue=a,Wd(i,a),Ul(g,!0),g.tail===null&&g.tailMode==="hidden"&&!b.alternate&&!tt)return Nt(i),null}else 2*Wt()-g.renderingStartTime>Zd&&l!==536870912&&(i.flags|=128,u=!0,Ul(g,!1),i.lanes=4194304);g.isBackwards?(b.sibling=i.child,i.child=b):(a=g.last,a!==null?a.sibling=b:i.child=b,g.last=b)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=Wt(),i.sibling=null,a=zt.current,ne(zt,u?a&1|2:a&1),i):(Nt(i),null);case 22:case 23:return xa(i),hf(),u=i.memoizedState!==null,a!==null?a.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(l&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),l=i.updateQueue,l!==null&&Wd(i,l.retryQueue),l=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==l&&(i.flags|=2048),a!==null&&oe(Fr),null;case 24:return l=null,a!==null&&(l=a.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),ma(Vt),Nt(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function XC(a,i){switch(Zp(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return ma(Vt),ue(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return Le(i),null;case 13:if(xa(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));_l()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return oe(zt),null;case 4:return ue(),null;case 10:return ma(i.type),null;case 22:case 23:return xa(i),hf(),a!==null&&oe(Fr),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return ma(Vt),null;case 25:return null;default:return null}}function Yv(a,i){switch(Zp(i),i.tag){case 3:ma(Vt),ue();break;case 26:case 27:case 5:Le(i);break;case 4:ue();break;case 13:xa(i);break;case 19:oe(zt);break;case 10:ma(i.type);break;case 22:case 23:xa(i),hf(),a!==null&&oe(Fr);break;case 24:ma(Vt)}}function Hl(a,i){try{var l=i.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var g=u.next;l=g;do{if((l.tag&a)===a){u=void 0;var b=l.create,_=l.inst;u=b(),_.destroy=u}l=l.next}while(l!==g)}}catch(T){mt(i,i.return,T)}}function Ya(a,i,l){try{var u=i.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var b=g.next;u=b;do{if((u.tag&a)===a){var _=u.inst,T=_.destroy;if(T!==void 0){_.destroy=void 0,g=i;var D=l,F=T;try{F()}catch(ae){mt(g,D,ae)}}}u=u.next}while(u!==b)}}catch(ae){mt(i,i.return,ae)}}function Qv(a){var i=a.updateQueue;if(i!==null){var l=a.stateNode;try{Bb(i,l)}catch(u){mt(a,a.return,u)}}}function Zv(a,i,l){l.props=Kr(a.type,a.memoizedProps),l.state=a.memoizedState;try{l.componentWillUnmount()}catch(u){mt(a,i,u)}}function ql(a,i){try{var l=a.ref;if(l!==null){switch(a.tag){case 26:case 27:case 5:var u=a.stateNode;break;case 30:u=a.stateNode;break;default:u=a.stateNode}typeof l=="function"?a.refCleanup=l(u):l.current=u}}catch(g){mt(a,i,g)}}function Fn(a,i){var l=a.ref,u=a.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(g){mt(a,i,g)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){mt(a,i,g)}else l.current=null}function Xv(a){var i=a.type,l=a.memoizedProps,u=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(g){mt(a,a.return,g)}}function Uf(a,i,l){try{var u=a.stateNode;b6(u,a.type,l,i),u[He]=i}catch(g){mt(a,a.return,g)}}function Jv(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&nr(a.type)||a.tag===4}function Hf(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Jv(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&nr(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function qf(a,i,l){var u=a.tag;if(u===5||u===6)a=a.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(a,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(a),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=iu));else if(u!==4&&(u===27&&nr(a.type)&&(l=a.stateNode,i=null),a=a.child,a!==null))for(qf(a,i,l),a=a.sibling;a!==null;)qf(a,i,l),a=a.sibling}function Yd(a,i,l){var u=a.tag;if(u===5||u===6)a=a.stateNode,i?l.insertBefore(a,i):l.appendChild(a);else if(u!==4&&(u===27&&nr(a.type)&&(l=a.stateNode),a=a.child,a!==null))for(Yd(a,i,l),a=a.sibling;a!==null;)Yd(a,i,l),a=a.sibling}function e1(a){var i=a.stateNode,l=a.memoizedProps;try{for(var u=a.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);cs(i,u,l),i[Ie]=a,i[He]=l}catch(b){mt(a,a.return,b)}}var va=!1,Mt=!1,Vf=!1,t1=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function JC(a,i){if(a=a.containerInfo,pm=pu,a=hb(a),Up(a)){if("selectionStart"in a)var l={start:a.selectionStart,end:a.selectionEnd};else e:{l=(l=a.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var g=u.anchorOffset,b=u.focusNode;u=u.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var _=0,T=-1,D=-1,F=0,ae=0,ie=a,Y=null;t:for(;;){for(var X;ie!==l||g!==0&&ie.nodeType!==3||(T=_+g),ie!==b||u!==0&&ie.nodeType!==3||(D=_+u),ie.nodeType===3&&(_+=ie.nodeValue.length),(X=ie.firstChild)!==null;)Y=ie,ie=X;for(;;){if(ie===a)break t;if(Y===l&&++F===g&&(T=_),Y===b&&++ae===u&&(D=_),(X=ie.nextSibling)!==null)break;ie=Y,Y=ie.parentNode}ie=X}l=T===-1||D===-1?null:{start:T,end:D}}else l=null}l=l||{start:0,end:0}}else l=null;for(fm={focusedElem:a,selectionRange:l},pu=!1,Jt=i;Jt!==null;)if(i=Jt,a=i.child,(i.subtreeFlags&1024)!==0&&a!==null)a.return=i,Jt=a;else for(;Jt!==null;){switch(i=Jt,b=i.alternate,a=i.flags,i.tag){case 0:break;case 11:case 15:break;case 1:if((a&1024)!==0&&b!==null){a=void 0,l=i,g=b.memoizedProps,b=b.memoizedState,u=l.stateNode;try{var Pe=Kr(l.type,g,l.elementType===l.type);a=u.getSnapshotBeforeUpdate(Pe,b),u.__reactInternalSnapshotBeforeUpdate=a}catch(Re){mt(l,l.return,Re)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,l=a.nodeType,l===9)xm(a);else if(l===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":xm(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=i.sibling,a!==null){a.return=i.return,Jt=a;break}Jt=i.return}}function s1(a,i,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:Qa(a,l),u&4&&Hl(5,l);break;case 1:if(Qa(a,l),u&4)if(a=l.stateNode,i===null)try{a.componentDidMount()}catch(_){mt(l,l.return,_)}else{var g=Kr(l.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(g,i,a.__reactInternalSnapshotBeforeUpdate)}catch(_){mt(l,l.return,_)}}u&64&&Qv(l),u&512&&ql(l,l.return);break;case 3:if(Qa(a,l),u&64&&(a=l.updateQueue,a!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Bb(a,i)}catch(_){mt(l,l.return,_)}}break;case 27:i===null&&u&4&&e1(l);case 26:case 5:Qa(a,l),i===null&&u&4&&Xv(l),u&512&&ql(l,l.return);break;case 12:Qa(a,l);break;case 13:Qa(a,l),u&4&&r1(a,l),u&64&&(a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(l=l6.bind(null,l),N6(a,l))));break;case 22:if(u=l.memoizedState!==null||va,!u){i=i!==null&&i.memoizedState!==null||Mt,g=va;var b=Mt;va=u,(Mt=i)&&!b?Za(a,l,(l.subtreeFlags&8772)!==0):Qa(a,l),va=g,Mt=b}break;case 30:break;default:Qa(a,l)}}function n1(a){var i=a.alternate;i!==null&&(a.alternate=null,n1(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&st(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var kt=null,Os=!1;function wa(a,i,l){for(l=l.child;l!==null;)a1(a,i,l),l=l.sibling}function a1(a,i,l){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount(gt,l)}catch{}switch(l.tag){case 26:Mt||Fn(l,i),wa(a,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Mt||Fn(l,i);var u=kt,g=Os;nr(l.type)&&(kt=l.stateNode,Os=!1),wa(a,i,l),Zl(l.stateNode),kt=u,Os=g;break;case 5:Mt||Fn(l,i);case 6:if(u=kt,g=Os,kt=null,wa(a,i,l),kt=u,Os=g,kt!==null)if(Os)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(l.stateNode)}catch(b){mt(l,i,b)}else try{kt.removeChild(l.stateNode)}catch(b){mt(l,i,b)}break;case 18:kt!==null&&(Os?(a=kt,G1(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,l.stateNode),rc(a)):G1(kt,l.stateNode));break;case 4:u=kt,g=Os,kt=l.stateNode.containerInfo,Os=!0,wa(a,i,l),kt=u,Os=g;break;case 0:case 11:case 14:case 15:Mt||Ya(2,l,i),Mt||Ya(4,l,i),wa(a,i,l);break;case 1:Mt||(Fn(l,i),u=l.stateNode,typeof u.componentWillUnmount=="function"&&Zv(l,i,u)),wa(a,i,l);break;case 21:wa(a,i,l);break;case 22:Mt=(u=Mt)||l.memoizedState!==null,wa(a,i,l),Mt=u;break;default:wa(a,i,l)}}function r1(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{rc(a)}catch(l){mt(i,i.return,l)}}function e6(a){switch(a.tag){case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new t1),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new t1),i;default:throw Error(r(435,a.tag))}}function zf(a,i){var l=e6(a);i.forEach(function(u){var g=c6.bind(null,a,u);l.has(u)||(l.add(u),u.then(g,g))})}function Vs(a,i){var l=i.deletions;if(l!==null)for(var u=0;u<l.length;u++){var g=l[u],b=a,_=i,T=_;e:for(;T!==null;){switch(T.tag){case 27:if(nr(T.type)){kt=T.stateNode,Os=!1;break e}break;case 5:kt=T.stateNode,Os=!1;break e;case 3:case 4:kt=T.stateNode.containerInfo,Os=!0;break e}T=T.return}if(kt===null)throw Error(r(160));a1(b,_,g),kt=null,Os=!1,b=g.alternate,b!==null&&(b.return=null),g.return=null}if(i.subtreeFlags&13878)for(i=i.child;i!==null;)i1(i,a),i=i.sibling}var Cn=null;function i1(a,i){var l=a.alternate,u=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Vs(i,a),zs(a),u&4&&(Ya(3,a,a.return),Hl(3,a),Ya(5,a,a.return));break;case 1:Vs(i,a),zs(a),u&512&&(Mt||l===null||Fn(l,l.return)),u&64&&va&&(a=a.updateQueue,a!==null&&(u=a.callbacks,u!==null&&(l=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var g=Cn;if(Vs(i,a),zs(a),u&512&&(Mt||l===null||Fn(l,l.return)),u&4){var b=l!==null?l.memoizedState:null;if(u=a.memoizedState,l===null)if(u===null)if(a.stateNode===null){e:{u=a.type,l=a.memoizedProps,g=g.ownerDocument||g;t:switch(u){case"title":b=g.getElementsByTagName("title")[0],(!b||b[Pr]||b[Ie]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=g.createElement(u),g.head.insertBefore(b,g.querySelector("head > title"))),cs(b,u,l),b[Ie]=a,Zt(b),u=b;break e;case"link":var _=ew("link","href",g).get(u+(l.href||""));if(_){for(var T=0;T<_.length;T++)if(b=_[T],b.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&b.getAttribute("rel")===(l.rel==null?null:l.rel)&&b.getAttribute("title")===(l.title==null?null:l.title)&&b.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){_.splice(T,1);break t}}b=g.createElement(u),cs(b,u,l),g.head.appendChild(b);break;case"meta":if(_=ew("meta","content",g).get(u+(l.content||""))){for(T=0;T<_.length;T++)if(b=_[T],b.getAttribute("content")===(l.content==null?null:""+l.content)&&b.getAttribute("name")===(l.name==null?null:l.name)&&b.getAttribute("property")===(l.property==null?null:l.property)&&b.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&b.getAttribute("charset")===(l.charSet==null?null:l.charSet)){_.splice(T,1);break t}}b=g.createElement(u),cs(b,u,l),g.head.appendChild(b);break;default:throw Error(r(468,u))}b[Ie]=a,Zt(b),u=b}a.stateNode=u}else tw(g,a.type,a.stateNode);else a.stateNode=J1(g,u,a.memoizedProps);else b!==u?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,u===null?tw(g,a.type,a.stateNode):J1(g,u,a.memoizedProps)):u===null&&a.stateNode!==null&&Uf(a,a.memoizedProps,l.memoizedProps)}break;case 27:Vs(i,a),zs(a),u&512&&(Mt||l===null||Fn(l,l.return)),l!==null&&u&4&&Uf(a,a.memoizedProps,l.memoizedProps);break;case 5:if(Vs(i,a),zs(a),u&512&&(Mt||l===null||Fn(l,l.return)),a.flags&32){g=a.stateNode;try{Pi(g,"")}catch(X){mt(a,a.return,X)}}u&4&&a.stateNode!=null&&(g=a.memoizedProps,Uf(a,g,l!==null?l.memoizedProps:g)),u&1024&&(Vf=!0);break;case 6:if(Vs(i,a),zs(a),u&4){if(a.stateNode===null)throw Error(r(162));u=a.memoizedProps,l=a.stateNode;try{l.nodeValue=u}catch(X){mt(a,a.return,X)}}break;case 3:if(du=null,g=Cn,Cn=lu(i.containerInfo),Vs(i,a),Cn=g,zs(a),u&4&&l!==null&&l.memoizedState.isDehydrated)try{rc(i.containerInfo)}catch(X){mt(a,a.return,X)}Vf&&(Vf=!1,o1(a));break;case 4:u=Cn,Cn=lu(a.stateNode.containerInfo),Vs(i,a),zs(a),Cn=u;break;case 12:Vs(i,a),zs(a);break;case 13:Vs(i,a),zs(a),a.child.flags&8192&&a.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Qf=Wt()),u&4&&(u=a.updateQueue,u!==null&&(a.updateQueue=null,zf(a,u)));break;case 22:g=a.memoizedState!==null;var D=l!==null&&l.memoizedState!==null,F=va,ae=Mt;if(va=F||g,Mt=ae||D,Vs(i,a),Mt=ae,va=F,zs(a),u&8192)e:for(i=a.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(l===null||D||va||Mt||Wr(a)),l=null,i=a;;){if(i.tag===5||i.tag===26){if(l===null){D=l=i;try{if(b=D.stateNode,g)_=b.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{T=D.stateNode;var ie=D.memoizedProps.style,Y=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;T.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(X){mt(D,D.return,X)}}}else if(i.tag===6){if(l===null){D=i;try{D.stateNode.nodeValue=g?"":D.memoizedProps}catch(X){mt(D,D.return,X)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=a.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,zf(a,l))));break;case 19:Vs(i,a),zs(a),u&4&&(u=a.updateQueue,u!==null&&(a.updateQueue=null,zf(a,u)));break;case 30:break;case 21:break;default:Vs(i,a),zs(a)}}function zs(a){var i=a.flags;if(i&2){try{for(var l,u=a.return;u!==null;){if(Jv(u)){l=u;break}u=u.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var g=l.stateNode,b=Hf(a);Yd(a,b,g);break;case 5:var _=l.stateNode;l.flags&32&&(Pi(_,""),l.flags&=-33);var T=Hf(a);Yd(a,T,_);break;case 3:case 4:var D=l.stateNode.containerInfo,F=Hf(a);qf(a,F,D);break;default:throw Error(r(161))}}catch(ae){mt(a,a.return,ae)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function o1(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;o1(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function Qa(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)s1(a,i.alternate,i),i=i.sibling}function Wr(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:Ya(4,i,i.return),Wr(i);break;case 1:Fn(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Zv(i,i.return,l),Wr(i);break;case 27:Zl(i.stateNode);case 26:case 5:Fn(i,i.return),Wr(i);break;case 22:i.memoizedState===null&&Wr(i);break;case 30:Wr(i);break;default:Wr(i)}a=a.sibling}}function Za(a,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,g=a,b=i,_=b.flags;switch(b.tag){case 0:case 11:case 15:Za(g,b,l),Hl(4,b);break;case 1:if(Za(g,b,l),u=b,g=u.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(F){mt(u,u.return,F)}if(u=b,g=u.updateQueue,g!==null){var T=u.stateNode;try{var D=g.shared.hiddenCallbacks;if(D!==null)for(g.shared.hiddenCallbacks=null,g=0;g<D.length;g++)Db(D[g],T)}catch(F){mt(u,u.return,F)}}l&&_&64&&Qv(b),ql(b,b.return);break;case 27:e1(b);case 26:case 5:Za(g,b,l),l&&u===null&&_&4&&Xv(b),ql(b,b.return);break;case 12:Za(g,b,l);break;case 13:Za(g,b,l),l&&_&4&&r1(g,b);break;case 22:b.memoizedState===null&&Za(g,b,l),ql(b,b.return);break;case 30:break;default:Za(g,b,l)}i=i.sibling}}function Ff(a,i){var l=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==l&&(a!=null&&a.refCount++,l!=null&&Cl(l))}function Gf(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Cl(a))}function Gn(a,i,l,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)l1(a,i,l,u),i=i.sibling}function l1(a,i,l,u){var g=i.flags;switch(i.tag){case 0:case 11:case 15:Gn(a,i,l,u),g&2048&&Hl(9,i);break;case 1:Gn(a,i,l,u);break;case 3:Gn(a,i,l,u),g&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Cl(a)));break;case 12:if(g&2048){Gn(a,i,l,u),a=i.stateNode;try{var b=i.memoizedProps,_=b.id,T=b.onPostCommit;typeof T=="function"&&T(_,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(D){mt(i,i.return,D)}}else Gn(a,i,l,u);break;case 13:Gn(a,i,l,u);break;case 23:break;case 22:b=i.stateNode,_=i.alternate,i.memoizedState!==null?b._visibility&2?Gn(a,i,l,u):Vl(a,i):b._visibility&2?Gn(a,i,l,u):(b._visibility|=2,Xi(a,i,l,u,(i.subtreeFlags&10256)!==0)),g&2048&&Ff(_,i);break;case 24:Gn(a,i,l,u),g&2048&&Gf(i.alternate,i);break;default:Gn(a,i,l,u)}}function Xi(a,i,l,u,g){for(g=g&&(i.subtreeFlags&10256)!==0,i=i.child;i!==null;){var b=a,_=i,T=l,D=u,F=_.flags;switch(_.tag){case 0:case 11:case 15:Xi(b,_,T,D,g),Hl(8,_);break;case 23:break;case 22:var ae=_.stateNode;_.memoizedState!==null?ae._visibility&2?Xi(b,_,T,D,g):Vl(b,_):(ae._visibility|=2,Xi(b,_,T,D,g)),g&&F&2048&&Ff(_.alternate,_);break;case 24:Xi(b,_,T,D,g),g&&F&2048&&Gf(_.alternate,_);break;default:Xi(b,_,T,D,g)}i=i.sibling}}function Vl(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=a,u=i,g=u.flags;switch(u.tag){case 22:Vl(l,u),g&2048&&Ff(u.alternate,u);break;case 24:Vl(l,u),g&2048&&Gf(u.alternate,u);break;default:Vl(l,u)}i=i.sibling}}var zl=8192;function Ji(a){if(a.subtreeFlags&zl)for(a=a.child;a!==null;)c1(a),a=a.sibling}function c1(a){switch(a.tag){case 26:Ji(a),a.flags&zl&&a.memoizedState!==null&&$6(Cn,a.memoizedState,a.memoizedProps);break;case 5:Ji(a);break;case 3:case 4:var i=Cn;Cn=lu(a.stateNode.containerInfo),Ji(a),Cn=i;break;case 22:a.memoizedState===null&&(i=a.alternate,i!==null&&i.memoizedState!==null?(i=zl,zl=16777216,Ji(a),zl=i):Ji(a));break;default:Ji(a)}}function d1(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function Fl(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];Jt=u,h1(u,a)}d1(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)u1(a),a=a.sibling}function u1(a){switch(a.tag){case 0:case 11:case 15:Fl(a),a.flags&2048&&Ya(9,a,a.return);break;case 3:Fl(a);break;case 12:Fl(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,Qd(a)):Fl(a);break;default:Fl(a)}}function Qd(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];Jt=u,h1(u,a)}d1(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:Ya(8,i,i.return),Qd(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Qd(i));break;default:Qd(i)}a=a.sibling}}function h1(a,i){for(;Jt!==null;){var l=Jt;switch(l.tag){case 0:case 11:case 15:Ya(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Cl(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Jt=u;else e:for(l=a;Jt!==null;){u=Jt;var g=u.sibling,b=u.return;if(n1(u),u===l){Jt=null;break e}if(g!==null){g.return=b,Jt=g;break e}Jt=b}}}var t6={getCacheForType:function(a){var i=ms(Vt),l=i.data.get(a);return l===void 0&&(l=a(),i.data.set(a,l)),l}},s6=typeof WeakMap=="function"?WeakMap:Map,at=0,xt=null,Ge=null,Ze=0,rt=0,Fs=null,Xa=!1,eo=!1,Kf=!1,ja=0,At=0,Ja=0,Yr=0,Wf=0,gn=0,to=0,Gl=null,Ps=null,Yf=!1,Qf=0,Zd=1/0,Xd=null,er=null,ls=0,tr=null,so=null,no=0,Zf=0,Xf=null,p1=null,Kl=0,Jf=null;function Gs(){if((at&2)!==0&&Ze!==0)return Ze&-Ze;if(I.T!==null){var a=zi;return a!==0?a:im()}return ul()}function f1(){gn===0&&(gn=(Ze&536870912)===0||tt?ln():536870912);var a=mn.current;return a!==null&&(a.flags|=32),gn}function Ks(a,i,l){(a===xt&&(rt===2||rt===9)||a.cancelPendingCommit!==null)&&(ao(a,0),sr(a,Ze,gn,!1)),de(a,l),((at&2)===0||a!==xt)&&(a===xt&&((at&2)===0&&(Yr|=l),At===4&&sr(a,Ze,gn,!1)),Kn(a))}function m1(a,i,l){if((at&6)!==0)throw Error(r(327));var u=!l&&(i&124)===0&&(i&a.expiredLanes)===0||ys(a,i),g=u?r6(a,i):sm(a,i,!0),b=u;do{if(g===0){eo&&!u&&sr(a,i,0,!1);break}else{if(l=a.current.alternate,b&&!n6(l)){g=sm(a,i,!1),b=!1;continue}if(g===2){if(b=i,a.errorRecoveryDisabledLanes&b)var _=0;else _=a.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){i=_;e:{var T=a;g=Gl;var D=T.current.memoizedState.isDehydrated;if(D&&(ao(T,_).flags|=256),_=sm(T,_,!1),_!==2){if(Kf&&!D){T.errorRecoveryDisabledLanes|=b,Yr|=b,g=4;break e}b=Ps,Ps=g,b!==null&&(Ps===null?Ps=b:Ps.push.apply(Ps,b))}g=_}if(b=!1,g!==2)continue}}if(g===1){ao(a,0),sr(a,i,0,!0);break}e:{switch(u=a,b=g,b){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:sr(u,i,gn,!Xa);break e;case 2:Ps=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(g=Qf+300-Wt(),10<g)){if(sr(u,i,gn,!Xa),ut(u,0,!0)!==0)break e;u.timeoutHandle=z1(g1.bind(null,u,l,Ps,Xd,Yf,i,gn,Yr,to,Xa,b,2,-0,0),g);break e}g1(u,l,Ps,Xd,Yf,i,gn,Yr,to,Xa,b,0,-0,0)}}break}while(!0);Kn(a)}function g1(a,i,l,u,g,b,_,T,D,F,ae,ie,Y,X){if(a.timeoutHandle=-1,ie=i.subtreeFlags,(ie&8192||(ie&16785408)===16785408)&&(ec={stylesheets:null,count:0,unsuspend:I6},c1(i),ie=U6(),ie!==null)){a.cancelPendingCommit=ie(k1.bind(null,a,i,b,l,u,g,_,T,D,ae,1,Y,X)),sr(a,b,_,!F);return}k1(a,i,b,l,u,g,_,T,D)}function n6(a){for(var i=a;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var g=l[u],b=g.getSnapshot;g=g.value;try{if(!Hs(b(),g))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function sr(a,i,l,u){i&=~Wf,i&=~Yr,a.suspendedLanes|=i,a.pingedLanes&=~i,u&&(a.warmLanes|=i),u=a.expirationTimes;for(var g=i;0<g;){var b=31-ct(g),_=1<<b;u[b]=-1,g&=~_}l!==0&&is(a,l,i)}function Jd(){return(at&6)===0?(Wl(0),!1):!0}function em(){if(Ge!==null){if(rt===0)var a=Ge.return;else a=Ge,fa=Vr=null,xf(a),Qi=null,Il=0,a=Ge;for(;a!==null;)Yv(a.alternate,a),a=a.return;Ge=null}}function ao(a,i){var l=a.timeoutHandle;l!==-1&&(a.timeoutHandle=-1,w6(l)),l=a.cancelPendingCommit,l!==null&&(a.cancelPendingCommit=null,l()),em(),xt=a,Ge=l=ua(a.current,null),Ze=i,rt=0,Fs=null,Xa=!1,eo=ys(a,i),Kf=!1,to=gn=Wf=Yr=Ja=At=0,Ps=Gl=null,Yf=!1,(i&8)!==0&&(i|=i&32);var u=a.entangledLanes;if(u!==0)for(a=a.entanglements,u&=i;0<u;){var g=31-ct(u),b=1<<g;i|=a[g],u&=~b}return ja=i,wd(),l}function x1(a,i){Ve=null,I.H=Ud,i===Tl||i===Ad?(i=Mb(),rt=3):i===Rb?(i=Mb(),rt=4):rt=i===Lv?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Fs=i,Ge===null&&(At=1,Fd(a,un(i,a.current)))}function y1(){var a=I.H;return I.H=Ud,a===null?Ud:a}function b1(){var a=I.A;return I.A=t6,a}function tm(){At=4,Xa||(Ze&4194048)!==Ze&&mn.current!==null||(eo=!0),(Ja&134217727)===0&&(Yr&134217727)===0||xt===null||sr(xt,Ze,gn,!1)}function sm(a,i,l){var u=at;at|=2;var g=y1(),b=b1();(xt!==a||Ze!==i)&&(Xd=null,ao(a,i)),i=!1;var _=At;e:do try{if(rt!==0&&Ge!==null){var T=Ge,D=Fs;switch(rt){case 8:em(),_=6;break e;case 3:case 2:case 9:case 6:mn.current===null&&(i=!0);var F=rt;if(rt=0,Fs=null,ro(a,T,D,F),l&&eo){_=0;break e}break;default:F=rt,rt=0,Fs=null,ro(a,T,D,F)}}a6(),_=At;break}catch(ae){x1(a,ae)}while(!0);return i&&a.shellSuspendCounter++,fa=Vr=null,at=u,I.H=g,I.A=b,Ge===null&&(xt=null,Ze=0,wd()),_}function a6(){for(;Ge!==null;)v1(Ge)}function r6(a,i){var l=at;at|=2;var u=y1(),g=b1();xt!==a||Ze!==i?(Xd=null,Zd=Wt()+500,ao(a,i)):eo=ys(a,i);e:do try{if(rt!==0&&Ge!==null){i=Ge;var b=Fs;t:switch(rt){case 1:rt=0,Fs=null,ro(a,i,b,1);break;case 2:case 9:if(Ob(b)){rt=0,Fs=null,w1(i);break}i=function(){rt!==2&&rt!==9||xt!==a||(rt=7),Kn(a)},b.then(i,i);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:Ob(b)?(rt=0,Fs=null,w1(i)):(rt=0,Fs=null,ro(a,i,b,7));break;case 5:var _=null;switch(Ge.tag){case 26:_=Ge.memoizedState;case 5:case 27:var T=Ge;if(!_||sw(_)){rt=0,Fs=null;var D=T.sibling;if(D!==null)Ge=D;else{var F=T.return;F!==null?(Ge=F,eu(F)):Ge=null}break t}}rt=0,Fs=null,ro(a,i,b,5);break;case 6:rt=0,Fs=null,ro(a,i,b,6);break;case 8:em(),At=6;break e;default:throw Error(r(462))}}i6();break}catch(ae){x1(a,ae)}while(!0);return fa=Vr=null,I.H=u,I.A=g,at=l,Ge!==null?0:(xt=null,Ze=0,wd(),At)}function i6(){for(;Ge!==null&&!Ia();)v1(Ge)}function v1(a){var i=Kv(a.alternate,a,ja);a.memoizedProps=a.pendingProps,i===null?eu(a):Ge=i}function w1(a){var i=a,l=i.alternate;switch(i.tag){case 15:case 0:i=Hv(l,i,i.pendingProps,i.type,void 0,Ze);break;case 11:i=Hv(l,i,i.pendingProps,i.type.render,i.ref,Ze);break;case 5:xf(i);default:Yv(l,i),i=Ge=jb(i,ja),i=Kv(l,i,ja)}a.memoizedProps=a.pendingProps,i===null?eu(a):Ge=i}function ro(a,i,l,u){fa=Vr=null,xf(i),Qi=null,Il=0;var g=i.return;try{if(YC(a,g,i,l,Ze)){At=1,Fd(a,un(l,a.current)),Ge=null;return}}catch(b){if(g!==null)throw Ge=g,b;At=1,Fd(a,un(l,a.current)),Ge=null;return}i.flags&32768?(tt||u===1?a=!0:eo||(Ze&536870912)!==0?a=!1:(Xa=a=!0,(u===2||u===9||u===3||u===6)&&(u=mn.current,u!==null&&u.tag===13&&(u.flags|=16384))),j1(i,a)):eu(i)}function eu(a){var i=a;do{if((i.flags&32768)!==0){j1(i,Xa);return}a=i.return;var l=ZC(i.alternate,i,ja);if(l!==null){Ge=l;return}if(i=i.sibling,i!==null){Ge=i;return}Ge=i=a}while(i!==null);At===0&&(At=5)}function j1(a,i){do{var l=XC(a.alternate,a);if(l!==null){l.flags&=32767,Ge=l;return}if(l=a.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(a=a.sibling,a!==null)){Ge=a;return}Ge=a=l}while(a!==null);At=6,Ge=null}function k1(a,i,l,u,g,b,_,T,D){a.cancelPendingCommit=null;do tu();while(ls!==0);if((at&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(b=i.lanes|i.childLanes,b|=Fp,Xe(a,l,b,_,T,D),a===xt&&(Ge=xt=null,Ze=0),so=i,tr=a,no=l,Zf=b,Xf=g,p1=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,d6(pe,function(){return E1(),null})):(a.callbackNode=null,a.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=I.T,I.T=null,g=V.p,V.p=2,_=at,at|=4;try{JC(a,i,l)}finally{at=_,V.p=g,I.T=u}}ls=1,_1(),S1(),N1()}}function _1(){if(ls===1){ls=0;var a=tr,i=so,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=I.T,I.T=null;var u=V.p;V.p=2;var g=at;at|=4;try{i1(i,a);var b=fm,_=hb(a.containerInfo),T=b.focusedElem,D=b.selectionRange;if(_!==T&&T&&T.ownerDocument&&ub(T.ownerDocument.documentElement,T)){if(D!==null&&Up(T)){var F=D.start,ae=D.end;if(ae===void 0&&(ae=F),"selectionStart"in T)T.selectionStart=F,T.selectionEnd=Math.min(ae,T.value.length);else{var ie=T.ownerDocument||document,Y=ie&&ie.defaultView||window;if(Y.getSelection){var X=Y.getSelection(),Pe=T.textContent.length,Re=Math.min(D.start,Pe),ft=D.end===void 0?Re:Math.min(D.end,Pe);!X.extend&&Re>ft&&(_=ft,ft=Re,Re=_);var q=db(T,Re),$=db(T,ft);if(q&&$&&(X.rangeCount!==1||X.anchorNode!==q.node||X.anchorOffset!==q.offset||X.focusNode!==$.node||X.focusOffset!==$.offset)){var z=ie.createRange();z.setStart(q.node,q.offset),X.removeAllRanges(),Re>ft?(X.addRange(z),X.extend($.node,$.offset)):(z.setEnd($.node,$.offset),X.addRange(z))}}}}for(ie=[],X=T;X=X.parentNode;)X.nodeType===1&&ie.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ie.length;T++){var re=ie[T];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}pu=!!pm,fm=pm=null}finally{at=g,V.p=u,I.T=l}}a.current=i,ls=2}}function S1(){if(ls===2){ls=0;var a=tr,i=so,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=I.T,I.T=null;var u=V.p;V.p=2;var g=at;at|=4;try{s1(a,i.alternate,i)}finally{at=g,V.p=u,I.T=l}}ls=3}}function N1(){if(ls===4||ls===3){ls=0,Is();var a=tr,i=so,l=no,u=p1;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?ls=5:(ls=0,so=tr=null,C1(a,a.pendingLanes));var g=a.pendingLanes;if(g===0&&(er=null),Si(l),i=i.stateNode,lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(gt,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=I.T,g=V.p,V.p=2,I.T=null;try{for(var b=a.onRecoverableError,_=0;_<u.length;_++){var T=u[_];b(T.value,{componentStack:T.stack})}}finally{I.T=i,V.p=g}}(no&3)!==0&&tu(),Kn(a),g=a.pendingLanes,(l&4194090)!==0&&(g&42)!==0?a===Jf?Kl++:(Kl=0,Jf=a):Kl=0,Wl(0)}}function C1(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,Cl(i)))}function tu(a){return _1(),S1(),N1(),E1()}function E1(){if(ls!==5)return!1;var a=tr,i=Zf;Zf=0;var l=Si(no),u=I.T,g=V.p;try{V.p=32>l?32:l,I.T=null,l=Xf,Xf=null;var b=tr,_=no;if(ls=0,so=tr=null,no=0,(at&6)!==0)throw Error(r(331));var T=at;if(at|=4,u1(b.current),l1(b,b.current,_,l),at=T,Wl(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(gt,b)}catch{}return!0}finally{V.p=g,I.T=u,C1(a,i)}}function T1(a,i,l){i=un(l,i),i=Rf(a.stateNode,i,2),a=Fa(a,i,2),a!==null&&(de(a,2),Kn(a))}function mt(a,i,l){if(a.tag===3)T1(a,a,l);else for(;i!==null;){if(i.tag===3){T1(i,a,l);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(er===null||!er.has(u))){a=un(l,a),l=Pv(2),u=Fa(i,l,2),u!==null&&(Mv(l,u,i,a),de(u,2),Kn(u));break}}i=i.return}}function nm(a,i,l){var u=a.pingCache;if(u===null){u=a.pingCache=new s6;var g=new Set;u.set(i,g)}else g=u.get(i),g===void 0&&(g=new Set,u.set(i,g));g.has(l)||(Kf=!0,g.add(l),a=o6.bind(null,a,i,l),i.then(a,a))}function o6(a,i,l){var u=a.pingCache;u!==null&&u.delete(i),a.pingedLanes|=a.suspendedLanes&l,a.warmLanes&=~l,xt===a&&(Ze&l)===l&&(At===4||At===3&&(Ze&62914560)===Ze&&300>Wt()-Qf?(at&2)===0&&ao(a,0):Wf|=l,to===Ze&&(to=0)),Kn(a)}function A1(a,i){i===0&&(i=Es()),a=Ui(a,i),a!==null&&(de(a,i),Kn(a))}function l6(a){var i=a.memoizedState,l=0;i!==null&&(l=i.retryLane),A1(a,l)}function c6(a,i){var l=0;switch(a.tag){case 13:var u=a.stateNode,g=a.memoizedState;g!==null&&(l=g.retryLane);break;case 19:u=a.stateNode;break;case 22:u=a.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(i),A1(a,l)}function d6(a,i){return Je(a,i)}var su=null,io=null,am=!1,nu=!1,rm=!1,Qr=0;function Kn(a){a!==io&&a.next===null&&(io===null?su=io=a:io=io.next=a),nu=!0,am||(am=!0,h6())}function Wl(a,i){if(!rm&&nu){rm=!0;do for(var l=!1,u=su;u!==null;){if(a!==0){var g=u.pendingLanes;if(g===0)var b=0;else{var _=u.suspendedLanes,T=u.pingedLanes;b=(1<<31-ct(42|a)+1)-1,b&=g&~(_&~T),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,M1(u,b))}else b=Ze,b=ut(u,u===xt?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(b&3)===0||ys(u,b)||(l=!0,M1(u,b));u=u.next}while(l);rm=!1}}function u6(){R1()}function R1(){nu=am=!1;var a=0;Qr!==0&&(v6()&&(a=Qr),Qr=0);for(var i=Wt(),l=null,u=su;u!==null;){var g=u.next,b=O1(u,i);b===0?(u.next=null,l===null?su=g:l.next=g,g===null&&(io=l)):(l=u,(a!==0||(b&3)!==0)&&(nu=!0)),u=g}Wl(a)}function O1(a,i){for(var l=a.suspendedLanes,u=a.pingedLanes,g=a.expirationTimes,b=a.pendingLanes&-62914561;0<b;){var _=31-ct(b),T=1<<_,D=g[_];D===-1?((T&l)===0||(T&u)!==0)&&(g[_]=Cs(T,i)):D<=i&&(a.expiredLanes|=T),b&=~T}if(i=xt,l=Ze,l=ut(a,a===i?l:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),u=a.callbackNode,l===0||a===i&&(rt===2||rt===9)||a.cancelPendingCommit!==null)return u!==null&&u!==null&&jt(u),a.callbackNode=null,a.callbackPriority=0;if((l&3)===0||ys(a,l)){if(i=l&-l,i===a.callbackPriority)return i;switch(u!==null&&jt(u),Si(l)){case 2:case 8:l=Ss;break;case 32:l=pe;break;case 268435456:l=rs;break;default:l=pe}return u=P1.bind(null,a),l=Je(l,u),a.callbackPriority=i,a.callbackNode=l,i}return u!==null&&u!==null&&jt(u),a.callbackPriority=2,a.callbackNode=null,2}function P1(a,i){if(ls!==0&&ls!==5)return a.callbackNode=null,a.callbackPriority=0,null;var l=a.callbackNode;if(tu()&&a.callbackNode!==l)return null;var u=Ze;return u=ut(a,a===xt?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),u===0?null:(m1(a,u,i),O1(a,Wt()),a.callbackNode!=null&&a.callbackNode===l?P1.bind(null,a):null)}function M1(a,i){if(tu())return null;m1(a,i,!0)}function h6(){j6(function(){(at&6)!==0?Je(la,u6):R1()})}function im(){return Qr===0&&(Qr=ln()),Qr}function L1(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:fd(""+a)}function D1(a,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,a.id&&l.setAttribute("form",a.id),i.parentNode.insertBefore(l,i),a=new FormData(a),l.parentNode.removeChild(l),a}function p6(a,i,l,u,g){if(i==="submit"&&l&&l.stateNode===g){var b=L1((g[He]||null).action),_=u.submitter;_&&(i=(i=_[He]||null)?L1(i.formAction):_.getAttribute("formAction"),i!==null&&(b=i,_=null));var T=new yd("action","action",null,u,g);a.push({event:T,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Qr!==0){var D=_?D1(g,_):new FormData(g);Nf(l,{pending:!0,data:D,method:g.method,action:b},null,D)}}else typeof b=="function"&&(T.preventDefault(),D=_?D1(g,_):new FormData(g),Nf(l,{pending:!0,data:D,method:g.method,action:b},b,D))},currentTarget:g}]})}}for(var om=0;om<zp.length;om++){var lm=zp[om],f6=lm.toLowerCase(),m6=lm[0].toUpperCase()+lm.slice(1);Nn(f6,"on"+m6)}Nn(mb,"onAnimationEnd"),Nn(gb,"onAnimationIteration"),Nn(xb,"onAnimationStart"),Nn("dblclick","onDoubleClick"),Nn("focusin","onFocus"),Nn("focusout","onBlur"),Nn(OC,"onTransitionRun"),Nn(PC,"onTransitionStart"),Nn(MC,"onTransitionCancel"),Nn(yb,"onTransitionEnd"),Ai("onMouseEnter",["mouseout","mouseover"]),Ai("onMouseLeave",["mouseout","mouseover"]),Ai("onPointerEnter",["pointerout","pointerover"]),Ai("onPointerLeave",["pointerout","pointerover"]),Mr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mr("onSelect","focusout contextmenu dragend focu
8sin keydown keyup mousedown mouseup selectionchange".split(" ")),Mr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),g6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yl));function B1(a,i){i=(i&4)!==0;for(var l=0;l<a.length;l++){var u=a[l],g=u.event;u=u.listeners;e:{var b=void 0;if(i)for(var _=u.length-1;0<=_;_--){var T=u[_],D=T.instance,F=T.currentTarget;if(T=T.listener,D!==b&&g.isPropagationStopped())break e;b=T,g.currentTarget=F;try{b(g)}catch(ae){zd(ae)}g.currentTarget=null,b=D}else for(_=0;_<u.length;_++){if(T=u[_],D=T.instance,F=T.currentTarget,T=T.listener,D!==b&&g.isPropagationStopped())break e;b=T,g.currentTarget=F;try{b(g)}catch(ae){zd(ae)}g.currentTarget=null,b=D}}}}function Ke(a,i){var l=i[Us];l===void 0&&(l=i[Us]=new Set);var u=a+"__bubble";l.has(u)||(I1(i,a,2,!1),l.add(u))}function cm(a,i,l){var u=0;i&&(u|=4),I1(l,a,u,i)}var au="_reactListening"+Math.random().toString(36).slice(2);function dm(a){if(!a[au]){a[au]=!0,Ry.forEach(function(l){l!=="selectionchange"&&(g6.has(l)||cm(l,!1,a),cm(l,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[au]||(i[au]=!0,cm("selectionchange",!1,i))}}function I1(a,i,l,u){switch(lw(i)){case 2:var g=V6;break;case 8:g=z6;break;default:g=_m}l=g.bind(null,i,l,a),g=void 0,!Rp||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),u?g!==void 0?a.addEventListener(i,l,{capture:!0,passive:g}):a.addEventListener(i,l,!0):g!==void 0?a.addEventListener(i,l,{passive:g}):a.addEventListener(i,l,!1)}function um(a,i,l,u,g){var b=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var _=u.tag;if(_===3||_===4){var T=u.stateNode.containerInfo;if(T===g)break;if(_===4)for(_=u.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===g)return;_=_.return}for(;T!==null;){if(_=Sn(T),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){u=b=_;continue e}T=T.parentNode}}u=u.return}Fy(function(){var F=b,ae=Tp(l),ie=[];e:{var Y=bb.get(a);if(Y!==void 0){var X=yd,Pe=a;switch(a){case"keypress":if(gd(l)===0)break e;case"keydown":case"keyup":X=dC;break;case"focusin":Pe="focus",X=Lp;break;case"focusout":Pe="blur",X=Lp;break;case"beforeblur":case"afterblur":X=Lp;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=Wy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=XN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=pC;break;case mb:case gb:case xb:X=tC;break;case yb:X=mC;break;case"scroll":case"scrollend":X=QN;break;case"wheel":X=xC;break;case"copy":case"cut":case"paste":X=nC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Qy;break;case"toggle":case"beforetoggle":X=bC}var Re=(i&4)!==0,ft=!Re&&(a==="scroll"||a==="scrollend"),q=Re?Y!==null?Y+"Capture":null:Y;Re=[];for(var $=F,z;$!==null;){var re=$;if(z=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||z===null||q===null||(re=fl($,q),re!=null&&Re.push(Ql($,re,z))),ft)break;$=$.return}0<Re.length&&(Y=new X(Y,Pe,null,l,ae),ie.push({event:Y,listeners:Re}))}}if((i&7)===0){e:{if(Y=a==="mouseover"||a==="pointerover",X=a==="mouseout"||a==="pointerout",Y&&l!==Ep&&(Pe=l.relatedTarget||l.fromElement)&&(Sn(Pe)||Pe[St]))break e;if((X||Y)&&(Y=ae.window===ae?ae:(Y=ae.ownerDocument)?Y.defaultView||Y.parentWindow:window,X?(Pe=l.relatedTarget||l.toElement,X=F,Pe=Pe?Sn(Pe):null,Pe!==null&&(ft=c(Pe),Re=Pe.tag,Pe!==ft||Re!==5&&Re!==27&&Re!==6)&&(Pe=null)):(X=null,Pe=F),X!==Pe)){if(Re=Wy,re="onMouseLeave",q="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(Re=Qy,re="onPointerLeave",q="onPointerEnter",$="pointer"),ft=X==null?Y:pl(X),z=Pe==null?Y:pl(Pe),Y=new Re(re,$+"leave",X,l,ae),Y.target=ft,Y.relatedTarget=z,re=null,Sn(ae)===F&&(Re=new Re(q,$+"enter",Pe,l,ae),Re.target=z,Re.relatedTarget=ft,re=Re),ft=re,X&&Pe)t:{for(Re=X,q=Pe,$=0,z=Re;z;z=oo(z))$++;for(z=0,re=q;re;re=oo(re))z++;for(;0<$-z;)Re=oo(Re),$--;for(;0<z-$;)q=oo(q),z--;for(;$--;){if(Re===q||q!==null&&Re===q.alternate)break t;Re=oo(Re),q=oo(q)}Re=null}else Re=null;X!==null&&$1(ie,Y,X,Re,!1),Pe!==null&&ft!==null&&$1(ie,ft,Pe,Re,!0)}}
vendor: 5,218 bytes, lines 8-9
8e:{if(Y=F?pl(F):window,X=Y.nodeName&&Y.nodeName.toLowerCase(),X==="select"||X==="input"&&Y.type==="file")var be=ab;else if(sb(Y))if(rb)be=TC;else{be=CC;var Fe=NC}else X=Y.nodeName,!X||X.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?F&&Cp(F.elementType)&&(be=ab):be=EC;if(be&&(be=be(a,F))){nb(ie,be,l,ae);break e}Fe&&Fe(a,Y,F),a==="focusout"&&F&&Y.type==="number"&&F.memoizedProps.value!=null&&Np(Y,"number",Y.value)}switch(Fe=F?pl(F):window,a){case"focusin":(sb(Fe)||Fe.contentEditable==="true")&&(Bi=Fe,Hp=F,jl=null);break;case"focusout":jl=Hp=Bi=null;break;case"mousedown":qp=!0;break;case"contextmenu":case"mouseup":case"dragend":qp=!1,pb(ie,l,ae);break;case"selectionchange":if(RC)break;case"keydown":case"keyup":pb(ie,l,ae)}var Ee;if(Bp)e:{switch(a){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else Di?eb(a,l)&&(Oe="onCompositionEnd"):a==="keydown"&&l.keyCode===229&&(Oe="onCompositionStart");Oe&&(Zy&&l.locale!=="ko"&&(Di||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Di&&(Ee=Gy()):(Ha=ae,Op="value"in Ha?Ha.value:Ha.textContent,Di=!0)),Fe=ru(F,Oe),0<Fe.length&&(Oe=new Yy(Oe,a,null,l,ae),ie.push({event:Oe,listeners:Fe}),Ee?Oe.data=Ee:(Ee=tb(l),Ee!==null&&(Oe.data=Ee)))),(Ee=wC?jC(a,l):kC(a,l))&&(Oe=ru(F,"onBeforeInput"),0<Oe.length&&(Fe=new Yy("onBeforeInput","beforeinput",null,l,ae),ie.push({event:Fe,listeners:Oe}),Fe.data=Ee)),p6(ie,a,F,l,ae)}B1(ie,i)})}function Ql(a,i,l){return{instance:a,listener:i,currentTarget:l}}function ru(a,i){for(var l=i+"Capture",u=[];a!==null;){var g=a,b=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||b===null||(g=fl(a,l),g!=null&&u.unshift(Ql(a,g,b)),g=fl(a,i),g!=null&&u.push(Ql(a,g,b))),a.tag===3)return u;a=a.return}return[]}function oo(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function $1(a,i,l,u,g){for(var b=i._reactName,_=[];l!==null&&l!==u;){var T=l,D=T.alternate,F=T.stateNode;if(T=T.tag,D!==null&&D===u)break;T!==5&&T!==26&&T!==27||F===null||(D=F,g?(F=fl(l,b),F!=null&&_.unshift(Ql(l,F,D))):g||(F=fl(l,b),F!=null&&_.push(Ql(l,F,D)))),l=l.return}_.length!==0&&a.push({event:i,listeners:_})}var x6=/\r\n?/g,y6=/\u0000|\uFFFD/g;function U1(a){return(typeof a=="string"?a:""+a).replace(x6,`
9`).replace(y6,"")}function H1(a,i){return i=U1(i),U1(a)===i}function iu(){}function pt(a,i,l,u,g,b){switch(l){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||Pi(a,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&Pi(a,""+u);break;case"className":ud(a,"class",u);break;case"tabIndex":ud(a,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ud(a,l,u);break;case"style":Vy(a,u,b);break;case"data":if(i!=="object"){ud(a,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||l!=="href")){a.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){a.removeAttribute(l);break}u=fd(""+u),a.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){a.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(l==="formAction"?(i!=="input"&&pt(a,i,"name",g.name,g,null),pt(a,i,"formEncType",g.formEncType,g,null),pt(a,i,"formMethod",g.formMethod,g,null),pt(a,i,"formTarget",g.formTarget,g,null)):(pt(a,i,"encType",g.encType,g,null),pt(a,i,"method",g.method,g,null),pt(a,i,"target",g.target,g,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){a.removeAttribute(l);break}u=fd(""+u),a.setAttribute(l,u);break;case"onClick":u!=null&&(a.onclick=iu);break;case"onScroll":u!=null&&Ke("scroll",a);break;case"onScrollEnd":u!=null&&Ke("scrollend",a);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(g.children!=null)throw Error(r(60));a.innerHTML=l}}break;case"multiple":a.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":a.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){a.removeAttribute("xlink:href");break}l=fd(""+u),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(l,""+u):a.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
9ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(l,""):a.removeAttribute(l);break;case"capture":case"download":u===!0?a.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(l,u):a.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?a.setAttribute(l,u):a.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?a.removeAttribute(l):a.setAttribute(l,u);break;case"popover":Ke("beforetoggle",a),Ke("toggle",a),dd(a,"popover",u);break;case"xlinkActuate":ca(a,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":ca(a,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":ca(a,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":ca(a,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":ca(a,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":ca(a,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":ca(a,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":ca(a,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":ca(a,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":dd(a,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=WN.get(l)||l,dd(a,l,u))}}function hm(a,i,l,u,g,b){switch(l){case"style":Vy(a,u,b);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(g.children!=null)throw Error(r(60));a.innerHTML=l}}break;case"children":typeof u=="string"?Pi(a,u):(typeof u=="number"||typeof u=="bigint")&&Pi(a,""+u);break;case"onScroll":u!=null&&Ke("scroll",a);break;case"onScrollEnd":u!=null&&Ke("scrollend",a);break;case"onClick":u!=null&&(a.onclick=iu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oy.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),i=l.slice(2,g?l.length-7:void 0),b=a[He]||null,b=b!=null?b[l]:null,typeof b=="function"&&a.removeEventListener(i,b,g),typeof u=="function")){typeof b!="function"&&b!==null&&(l in a?a[l]=null:a.hasAttribute(l)&&a.removeAttribute(l)),a.addEventListener(i,u,g);break e}l in a?a[l]=u:u===!0?a.setAttribute(l,""):dd(a,l,u)}}}function cs(a,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",a),Ke("load",a);var u=!1,g=!1,b;for(b in l)if(l.hasOwnProperty(b)){var _=l[b];if(_!=null)switch(b){case"src":u=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:pt(a,i,b,_,l,null)}}g&&pt(a,i,"srcSet",l.srcSet,l,null),u&&pt(a,i,"src",l.src,l,null);return;case"input":Ke("invalid",a);var T=b=_=g=null,D=null,F=null;for(u in l)if(l.hasOwnProperty(u)){var ae=l[u];if(ae!=null)switch(u){case"name":g=ae;break;case"type":_=ae;break;case"checked":D=ae;break;case"defaultChecked":F=ae;break;case"value":b=ae;break;case"defaultValue":T=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,i));break;default:pt(a,i,u,ae,l,null)}}$y(a,b,T,D,F,_,g,!1),hd(a);return;case"select":Ke("invalid",a),u=_=b=null;for(g in l)if(l.hasOwnProperty(g)&&(T=l[g],T!=null))switch(g){case"value":b=T;break;case"defaultValue":_=T;break;case"multiple":u=T;default:pt(a,i,g,T,l,null)}i=b,l=_,a.multiple=!!u,i!=null?Oi(a,!!u,i,!1):l!=null&&Oi(a,!!u,l,!0);return;case"textarea":Ke("invalid",a),b=g=u=null;for(_ in l)if(l.hasOwnProperty(_)&&(T=l[_],T!=null))switch(_){case"value":u=T;break;case"defaultValue":g=T;break;case"children":b=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:pt(a,i,_,T,l,null)}Hy(a,u,g,b),hd(a);return;case"option":for(D in l)l.hasOwnProperty(D)&&(u=l[D],u!=null)&&(D==="selected"?a.selected=u&&typeof u!="function"&&typeof u!="symbol":pt(a,i,D,u,l,null));return;
vendor: 1,857 bytes, line 9
9case"dialog":Ke("beforetoggle",a),Ke("toggle",a),Ke("cancel",a),Ke("close",a);break;case"iframe":case"object":Ke("load",a);break;case"video":case"audio":for(u=0;u<Yl.length;u++)Ke(Yl[u],a);break;case"image":Ke("error",a),Ke("load",a);break;case"details":Ke("toggle",a);break;case"embed":case"source":case"link":Ke("error",a),Ke("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(u=l[F],u!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:pt(a,i,F,u,l,null)}return;default:if(Cp(i)){for(ae in l)l.hasOwnProperty(ae)&&(u=l[ae],u!==void 0&&hm(a,i,ae,u,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(u=l[T],u!=null&&pt(a,i,T,u,l,null))}function b6(a,i,l,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,b=null,_=null,T=null,D=null,F=null,ae=null;for(X in l){var ie=l[X];if(l.hasOwnProperty(X)&&ie!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":D=ie;default:u.hasOwnProperty(X)||pt(a,i,X,null,u,ie)}}for(var Y in u){var X=u[Y];if(ie=l[Y],u.hasOwnProperty(Y)&&(X!=null||ie!=null))switch(Y){case"type":b=X;break;case"name":g=X;break;case"checked":F=X;break;case"defaultChecked":ae=X;break;case"value":_=X;break;case"defaultValue":T=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,i));break;default:X!==ie&&pt(a,i,Y,X,u,ie)}}Sp(a,_,T,D,F,ae,b,g);return;case"select":X=_=T=Y=null;for(b in l)if(D=l[b],l.hasOwnProperty(b)&&D!=null)switch(b){case"value":break;case"multiple":X=D;default:u.hasOwnProperty(b)||pt(a,i,b,null,u,D)}for(g in u)if(b=u[g],D=l[g],u.hasOwnProperty(g)&&(b!=null||D!=null))switch(g){case"value":Y=b;break;case"defaultValue":T=b;break;case"multiple":_=b;
9default:b!==D&&pt(a,i,g,b,u,D)}i=T,l=_,u=X,Y!=null?Oi(a,!!l,Y,!1):!!u!=!!l&&(i!=null?Oi(a,!!l,i,!0):Oi(a,!!l,l?[]:"",!1));return;case"textarea":X=Y=null;for(T in l)if(g=l[T],l.hasOwnProperty(T)&&g!=null&&!u.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:pt(a,i,T,null,u,g)}for(_ in u)if(g=u[_],b=l[_],u.hasOwnProperty(_)&&(g!=null||b!=null))switch(_){case"value":Y=g;break;case"defaultValue":X=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==b&&pt(a,i,_,g,u,b)}Uy(a,Y,X);return;case"option":for(var Pe in l)Y=l[Pe],l.hasOwnProperty(Pe)&&Y!=null&&!u.hasOwnProperty(Pe)&&(Pe==="selected"?a.selected=!1:pt(a,i,Pe,null,u,Y));for(D in u)Y=u[D],X=l[D],u.hasOwnProperty(D)&&Y!==X&&(Y!=null||X!=null)&&(D==="selected"?a.selected=Y&&typeof Y!="function"&&typeof Y!="symbol":pt(a,i,D,Y,u,X));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in l)Y=l[Re],l.hasOwnProperty(Re)&&Y!=null&&!u.hasOwnProperty(Re)&&pt(a,i,Re,null,u,Y);for(F in u)if(Y=u[F],X=l[F],u.hasOwnProperty(F)&&Y!==X&&(Y!=null||X!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,i));break;default:pt(a,i,F,Y,u,X)}return;default:if(Cp(i)){for(var ft in l)Y=l[ft],l.hasOwnProperty(ft)&&Y!==void 0&&!u.hasOwnProperty(ft)&&hm(a,i,ft,void 0,u,Y);for(ae in u)Y=u[ae],X=l[ae],!u.hasOwnProperty(ae)||Y===X||Y===void 0&&X===void 0||hm(a,i,ae,Y,u,X);return}}for(var q in l)Y=l[q],l.hasOwnProperty(q)&&Y!=null&&!u.hasOwnProperty(q)&&pt(a,i,q,null,u,Y);for(ie in u)Y=u[ie],X=l[ie],!u.hasOwnProperty(ie)||Y===X||Y==null&&X==null||pt(a,i,ie,Y,u,X)}var pm=null,fm=null;function ou(a){return a.nodeType===9?a:a.ownerDocument}function q1(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function V1(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function mm(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var gm=null;function v6(){var a=window.event;return a&&a.type==="popstate"?a===gm?!1:(gm=a,!0):(gm=null,!1)}var z1=typeof setTimeout=="function"?setTimeout:void 0,w6=typeof clearTimeout=="function"?clearTimeout:void 0,F1=typeof Promise=="function"?Promise:void 0,j6=typeof queueMicrotask=="function"?queueMicrotask:typeof F1<"u"?function(a){return F1.resolve(null).then(a).catch(k6)}:z1;function k6(a){setTimeout(function(){throw a})}function nr(a){return a==="head"}function G1(a,i){var l=i,u=0,g=0;do{var b=l.nextSibling;if(a.removeChild(l),b&&b.nodeType===8)if(l=b.data,l==="/$"){if(0<u&&8>u){l=u;var _=a.ownerDocument;if(l&1&&Zl(_.documentElement),l&2&&Zl(_.body),l&4)for(l=_.head,Zl(l),_=l.firstChild;_;){var T=_.nextSibling,D=_.nodeName;_[Pr]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&_.rel.toLowerCase()==="stylesheet"||l.removeChild(_),_=T}}if(g===0){a.removeChild(b),rc(i);return}g--}else l==="$"||l==="$?"||l==="$!"?g++:u=l.charCodeAt(0)-48;else u=0;l=b}while(l);rc(i)}function xm(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":xm(l),st(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}a.removeChild(l)}}function _6(a,i,l,u){for(;a.nodeType===1;){var g=l;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(u){if(!a[Pr])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(b=a.getAttribute("rel"),b==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(b!==g.rel||a.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||a.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||a.getAttribute("title")!==(g.title==null?null:g.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(b=a.getAttribute("src"),(b!==(g.src==null?null:g.src)||a.getAttribute("type")!==(g.type==null?null:g.type)||a.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&b&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var b=g.name==null?null:""+g.name;if(g.type==="hidden"&&a.getAttribute("name")===b)return a}else return a;
vendor: 13,969 bytes, line 9
9if(a=En(a.nextSibling),a===null)break}return null}function S6(a,i,l){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!l||(a=En(a.nextSibling),a===null))return null;return a}function ym(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState==="complete"}function N6(a,i){var l=a.ownerDocument;if(a.data!=="$?"||l.readyState==="complete")i();else{var u=function(){i(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),a._reactRetry=u}}function En(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="F!"||i==="F")break;if(i==="/$")return null}}return a}var bm=null;function K1(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var l=a.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return a;i--}else l==="/$"&&i++}a=a.previousSibling}return null}function W1(a,i,l){switch(i=ou(l),a){case"html":if(a=i.documentElement,!a)throw Error(r(452));return a;case"head":if(a=i.head,!a)throw Error(r(453));return a;case"body":if(a=i.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Zl(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);st(a)}var xn=new Map,Y1=new Set;function lu(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ka=V.d;V.d={f:C6,r:E6,D:T6,C:A6,L:R6,m:O6,X:M6,S:P6,M:L6};function C6(){var a=ka.f(),i=Jd();return a||i}function E6(a){var i=Ei(a);i!==null&&i.tag===5&&i.type==="form"?mv(i):ka.r(a)}var lo=typeof document>"u"?null:document;function Q1(a,i,l){var u=lo;if(u&&typeof i=="string"&&i){var g=dn(i);g='link[rel="'+a+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),Y1.has(g)||(Y1.add(g),a={rel:a,crossOrigin:l,href:i},u.querySelector(g)===null&&(i=u.createElement("link"),cs(i,"link",a),Zt(i),u.head.appendChild(i)))}}function T6(a){ka.D(a),Q1("dns-prefetch",a,null)}function A6(a,i){ka.C(a,i),Q1("preconnect",a,i)}function R6(a,i,l){ka.L(a,i,l);var u=lo;if(u&&a&&i){var g='link[rel="preload"][as="'+dn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+dn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+dn(l.imageSizes)+'"]')):g+='[href="'+dn(a)+'"]';var b=g;switch(i){case"style":b=co(a);break;case"script":b=uo(a)}xn.has(b)||(a=m({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:a,as:i},l),xn.set(b,a),u.querySelector(g)!==null||i==="style"&&u.querySelector(Xl(b))||i==="script"&&u.querySelector(Jl(b))||(i=u.createElement("link"),cs(i,"link",a),Zt(i),u.head.appendChild(i)))}}function O6(a,i){ka.m(a,i);var l=lo;if(l&&a){var u=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+dn(u)+'"][href="'+dn(a)+'"]',b=g;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=uo(a)}if(!xn.has(b)&&(a=m({rel:"modulepreload",href:a},i),xn.set(b,a),l.querySelector(g)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Jl(b)))return}u=l.createElement("link"),cs(u,"link",a),Zt(u),l.head.appendChild(u)}}}function P6(a,i,l){ka.S(a,i,l);var u=lo;if(u&&a){var g=Ti(u).hoistableStyles,b=co(a);i=i||"default";var _=g.get(b);if(!_){var T={loading:0,preload:null};if(_=u.querySelector(Xl(b)))T.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":i},l),(l=xn.get(b))&&vm(a,l);var D=_=u.createElement("link");Zt(D),cs(D,"link",a),D._p=new Promise(function(F,ae){D.onload=F,D.onerror=ae}),D.addEventListener("load",function(){T.loading|=1}),D.addEventListener("error",function(){T.loading|=2}),T.loading|=4,cu(_,i,u)}_={type:"stylesheet",instance:_,count:1,state:T},g.set(b,_)}}}function M6(a,i){ka.X(a,i);var l=lo;if(l&&a){var u=Ti(l).hoistableScripts,g=uo(a),b=u.get(g);b||(b=l.querySelector(Jl(g)),b||(a=m({src:a,async:!0},i),(i=xn.get(g))&&wm(a,i),b=l.createElement("script"),Zt(b),cs(b,"link",a),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(g,b))}}function L6(a,i){ka.M(a,i);var l=lo;if(l&&a){var u=Ti(l).hoistableScripts,g=uo(a),b=u.get(g);b||(b=l.querySelector(Jl(g)),b||(a=m({src:a,async:!0,type:"module"},i),(i=xn.get(g))&&wm(a,i),b=l.createElement("script"),Zt(b),cs(b,"link",a),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(g,b))}}function Z1(a,i,l,u){var g=(g=he.current)?lu(g):null;if(!g)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=co(l.href),l=Ti(g).hoistableStyles,u=l.get(i),u||(u={type:"style",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){a=co(l.href);var b=Ti(g).hoistableStyles,_=b.get(a);if(_||(g=g.ownerDocument||g,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(a,_),(b=g.querySelector(Xl(a)))&&!b._p&&(_.instance=b,_.state.loading=5),xn.has(a)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},xn.set(a,l),b||D6(g,a,l,_.state))),i&&u===null)throw Error(r(528,""));return _}if(i&&u!==null)throw Error(r(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=uo(l),l=Ti(g).hoistableScripts,u=l.get(i),u||(u={type:"script",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function co(a){return'href="'+dn(a)+'"'}function Xl(a){return'link[rel="stylesheet"]['+a+"]"}function X1(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function D6(a,i,l,u){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=a.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),cs(i,"link",l),Zt(i),a.head.appendChild(i))}function uo(a){return'[src="'+dn(a)+'"]'}function Jl(a){return"script[async]"+a}function J1(a,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var u=a.querySelector('style[data-href~="'+dn(l.href)+'"]');if(u)return i.instance=u,Zt(u),u;var g=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(a.ownerDocument||a).createElement("style"),Zt(u),cs(u,"style",g),cu(u,l.precedence,a),i.instance=u;case"stylesheet":g=co(l.href);var b=a.querySelector(Xl(g));if(b)return i.state.loading|=4,i.instance=b,Zt(b),b;u=X1(l),(g=xn.get(g))&&vm(u,g),b=(a.ownerDocument||a).createElement("link"),Zt(b);var _=b;return _._p=new Promise(function(T,D){_.onload=T,_.onerror=D}),cs(b,"link",u),i.state.loading|=4,cu(b,l.precedence,a),i.instance=b;case"script":return b=uo(l.src),(g=a.querySelector(Jl(b)))?(i.instance=g,Zt(g),g):(u=l,(g=xn.get(b))&&(u=m({},l),wm(u,g)),a=a.ownerDocument||a,g=a.createElement("script"),Zt(g),cs(g,"link",u),a.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,cu(u,l.precedence,a));return i.instance}function cu(a,i,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=u.length?u[u.length-1]:null,b=g,_=0;_<u.length;_++){var T=u[_];if(T.dataset.precedence===i)b=T;else if(b!==g)break}b?b.parentNode.insertBefore(a,b.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(a,i.firstChild))}function vm(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function wm(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var du=null;function ew(a,i,l){if(du===null){var u=new Map,g=du=new Map;g.set(l,u)}else g=du,u=g.get(l),u||(u=new Map,g.set(l,u));if(u.has(a))return u;for(u.set(a,null),l=l.getElementsByTagName(a),g=0;g<l.length;g++){var b=l[g];if(!(b[Pr]||b[Ie]||a==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var _=b.getAttribute(i)||"";_=a+_;var T=u.get(_);T?T.push(b):u.set(_,[b])}}return u}function tw(a,i,l){a=a.ownerDocument||a,a.head.insertBefore(l,i==="title"?a.querySelector("head > title"):null)}function B6(a,i,l){if(l===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(a=i.disabled,typeof i.precedence=="string"&&a==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function sw(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}var ec=null;function I6(){}function $6(a,i,l){if(ec===null)throw Error(r(475));var u=ec;if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var g=co(l.href),b=a.querySelector(Xl(g));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(u.count++,u=uu.bind(u),a.then(u,u)),i.state.loading|=4,i.instance=b,Zt(b);return}b=a.ownerDocument||a,l=X1(l),(g=xn.get(g))&&vm(l,g),b=b.createElement("link"),Zt(b);var _=b;_._p=new Promise(function(T,D){_.onload=T,_.onerror=D}),cs(b,"link",l),i.instance=b}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(u.count++,i=uu.bind(u),a.addEventListener("load",i),a.addEventListener("error",i))}}function U6(){if(ec===null)throw Error(r(475));var a=ec;return a.stylesheets&&a.count===0&&jm(a,a.stylesheets),0<a.count?function(i){var l=setTimeout(function(){if(a.stylesheets&&jm(a,a.stylesheets),a.unsuspend){var u=a.unsuspend;a.unsuspend=null,u()}},6e4);return a.unsuspend=i,function(){a.unsuspend=null,clearTimeout(l)}}:null}function uu(){if(this.count--,this.count===0){if(this.stylesheets)jm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var hu=null;function jm(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,hu=new Map,i.forEach(H6,a),hu=null,uu.call(a))}function H6(a,i){if(!(i.state.loading&4)){var l=hu.get(a);if(l)var u=l.get(null);else{l=new Map,hu.set(a,l);for(var g=a.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<g.length;b++){var _=g[b];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(l.set(_.dataset.precedence,_),u=_)}u&&l.set(null,u)}g=i.instance,_=g.getAttribute("data-precedence"),b=l.get(_)||u,b===u&&l.set(null,g),l.set(_,g),this.count++,u=uu.bind(this),g.addEventListener("load",u),g.addEventListener("error",u),b?b.parentNode.insertBefore(g,b.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(g,a.firstChild)),i.state.loading|=4}}var tc={$$typeof:E,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function q6(a,i,l,u,g,b,_,T){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ts(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ts(0),this.hiddenUpdates=Ts(null),this.identifierPrefix=u,this.onUncaughtError=g,this.onCaughtError=b,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function nw(a,i,l,u,g,b,_,T,D,F,ae,ie){return a=new q6(a,i,l,_,T,D,F,ie),i=1,b===!0&&(i|=24),b=qs(3,null,null,i),a.current=b,b.stateNode=a,i=sf(),i.refCount++,a.pooledCache=i,i.refCount++,b.memoizedState={element:u,isDehydrated:l,cache:i},of(b),a}function aw(a){return a?(a=Hi,a):Hi}function rw(a,i,l,u,g,b){g=aw(g),u.context===null?u.context=g:u.pendingContext=g,u=za(i),u.payload={element:l},b=b===void 0?null:b,b!==null&&(u.callback=b),l=Fa(a,u,i),l!==null&&(Ks(l,a,i),Rl(l,a,i))}function iw(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var l=a.retryLane;a.retryLane=l!==0&&l<i?l:i}}function km(a,i){iw(a,i),(a=a.alternate)&&iw(a,i)}function ow(a){if(a.tag===13){var i=Ui(a,67108864);i!==null&&Ks(i,a,67108864),km(a,67108864)}}var pu=!0;function V6(a,i,l,u){var g=I.T;I.T=null;var b=V.p;try{V.p=2,_m(a,i,l,u)}finally{V.p=b,I.T=g}}function z6(a,i,l,u){var g=I.T;I.T=null;var b=V.p;try{V.p=8,_m(a,i,l,u)}finally{V.p=b,I.T=g}}function _m(a,i,l,u){if(pu){var g=Sm(u);if(g===null)um(a,i,u,fu,l),cw(a,u);else if(G6(g,a,i,l,u))u.stopPropagation();else if(cw(a,u),i&4&&-1<F6.indexOf(a)){for(;g!==null;){var b=Ei(g);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var _=Qt(b.pendingLanes);if(_!==0){var T=b;for(T.pendingLanes|=2,T.entangledLanes|=2;_;){var D=1<<31-ct(_);T.entanglements[1]|=D,_&=~D}Kn(b),(at&6)===0&&(Zd=Wt()+500,Wl(0))}}break;case 13:T=Ui(b,2),T!==null&&Ks(T,b,2),Jd(),km(b,2)}if(b=Sm(u),b===null&&um(a,i,u,fu,l),b===g)break;g=b}g!==null&&u.stopPropagation()}else um(a,i,u,null,l)}}function Sm(a){return a=Tp(a),Nm(a)}var fu=null;function Nm(a){if(fu=null,a=Sn(a),a!==null){var i=c(a);if(i===null)a=null;else{var l=i.tag;if(l===13){if(a=d(i),a!==null)return a;a=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return fu=a,null}function lw(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close"
vendor: 4,109 bytes, line 9
9:case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(oa()){case la:return 2;case Ss:return 8;case pe:case Qe:return 32;case rs:return 268435456;default:return 32}default:return 32}}var Cm=!1,ar=null,rr=null,ir=null,sc=new Map,nc=new Map,or=[],F6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function cw(a,i){switch(a){case"focusin":case"focusout":ar=null;break;case"dragenter":case"dragleave":rr=null;break;case"mouseover":case"mouseout":ir=null;break;case"pointerover":case"pointerout":sc.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(i.pointerId)}}function ac(a,i,l,u,g,b){return a===null||a.nativeEvent!==b?(a={blockedOn:i,domEventName:l,eventSystemFlags:u,nativeEvent:b,targetContainers:[g]},i!==null&&(i=Ei(i),i!==null&&ow(i)),a):(a.eventSystemFlags|=u,i=a.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),a)}function G6(a,i,l,u,g){switch(i){case"focusin":return ar=ac(ar,a,i,l,u,g),!0;case"dragenter":return rr=ac(rr,a,i,l,u,g),!0;case"mouseover":return ir=ac(ir,a,i,l,u,g),!0;case"pointerover":var b=g.pointerId;return sc.set(b,ac(sc.get(b)||null,a,i,l,u,g)),!0;case"gotpointercapture":return b=g.pointerId,nc.set(b,ac(nc.get(b)||null,a,i,l,u,g)),!0}return!1}function dw(a){var i=Sn(a.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=d(l),i!==null){a.blockedOn=i,Z(a.priority,function(){if(l.tag===13){var u=Gs();u=Ua(u);var g=Ui(l,u);g!==null&&Ks(g,l,u),km(l,u)}});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){a.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}a.blockedOn=null}function mu(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var l=Sm(a.nativeEvent);if(l===null){l=a.nativeEvent;var u=new l.constructor(l.type,l);Ep=u,l.target.dispatchEvent(u),Ep=null}else return i=Ei(l),i!==null&&ow(i),a.blockedOn=l,!1;i.shift()}return!0}function uw(a,i,l){mu(a)&&l.delete(i)}function K6(){Cm=!1,ar!==null&&mu(ar)&&(ar=null),rr!==null&&mu(rr)&&(rr=null),ir!==null&&mu(ir)&&(ir=null),sc.forEach(uw),nc.forEach(uw)}function gu(a,i){a.blockedOn===i&&(a.blockedOn=null,Cm||(Cm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,K6)))}var xu=null;function hw(a){xu!==a&&(xu=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){xu===a&&(xu=null);for(var i=0;i<a.length;i+=3){var l=a[i],u=a[i+1],g=a[i+2];if(typeof u!="function"){if(Nm(u||l)===null)continue;break}var b=Ei(l);b!==null&&(a.splice(i,3),i-=3,Nf(b,{pending:!0,data:g,method:l.method,action:u},u,g))}}))}function rc(a){function i(D){return gu(D,a)}ar!==null&&gu(ar,a),rr!==null&&gu(rr,a),ir!==null&&gu(ir,a),sc.forEach(i),nc.forEach(i);for(var l=0;l<or.length;l++){var u=or[l];u.blockedOn===a&&(u.blockedOn=null)}for(;0<or.length&&(l=or[0],l.blockedOn===null);)dw(l),l.blockedOn===null&&or.shift();if(l=(a.ownerDocument||a).$$reactFormReplay,l!=null)for(u=0;
9u<l.length;u+=3){var g=l[u],b=l[u+1],_=g[He]||null;if(typeof b=="function")_||hw(l);else if(_){var T=null;if(b&&b.hasAttribute("formAction")){if(g=b,_=b[He]||null)T=_.formAction;else if(Nm(g)!==null)continue}else T=_.action;typeof T=="function"?l[u+1]=T:(l.splice(u,3),u-=3),hw(l)}}}function Em(a){this._internalRoot=a}yu.prototype.render=Em.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var l=i.current,u=Gs();rw(l,u,a,i,null,null)},yu.prototype.unmount=Em.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;rw(a.current,2,null,a,null,null),Jd(),i[St]=null}};function yu(a){this._internalRoot=a}yu.prototype.unstable_scheduleHydration=function(a){if(a){var i=ul();a={blockedOn:null,target:a,priority:i};for(var l=0;l<or.length&&i!==0&&i<or[l].priority;l++);or.splice(l,0,a),l===0&&dw(a)}};var pw=t.version;if(pw!=="19.1.0")throw Error(r(527,pw,"19.1.0"));V.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=p(i),a=a!==null?f(a):null,a=a===null?null:a.stateNode,a};var W6={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bu.isDisabled&&bu.supportsFiber)try{gt=bu.inject(W6),lt=bu}catch{}}return oc.createRoot=function(a,i){if(!o(a))throw Error(r(299));var l=!1,u="",g=Tv,b=Av,_=Rv,T=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(b=i.onCaughtError),i.onRecoverableError!==void 0&&(_=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(T=i.unstable_transitionCallbacks)),i=nw(a,1,!1,null,null,l,u,g,b,_,T,null),a[St]=i.current,dm(a),new Em(i)},oc.hydrateRoot=function(a,i,l){if(!o(a))throw Error(r(299));var u=!1,g="",b=Tv,_=Av,T=Rv,D=null,F=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(D=l.unstable_transitionCallbacks),l.formState!==void 0&&(F=l.formState)),i=nw(a,1,!0,i,l??null,u,g,b,_,T,D,F),i.context=aw(null),l=i.current,u=Gs(),u=Ua(u),g=za(u),g.callback=null,Fa(l,g,u),l=u,i.current.lanes=l,de(i,l),Kn(i),a[St]=i.current,dm(a),new yu(i)},oc.version="19.1.0",oc}var kw;function aE(){if(kw)return Am.exports;kw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Am.exports=nE(),Am.exports}var rE=aE(),w=Ih();const Ce=Ko(w),kj=Q6({__proto__:null,default:Ce},[w]);function iE(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var s,r,o,c,d=[],h="",p=e.split("/");for(p[0]||p.shift();o=p.shift();)s=o[0],s==="*"?(d.push(s),h+=o[1]==="?"?"(?:/(.*))?":"/(.*)"):s===":"?(r=o.indexOf("?",1),c=o.indexOf(".",1),d.push(o.substring(1,~r?r:~c?c:o.length)),h+=~r&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(h+=(~r?"?":"")+"\\"+o.substring(c))):h+="/"+o;return{keys:d,pattern:new RegExp("^"+h+(t?"(?=$|/)":"/?$"),"i")}}var Lm={exports:{}},Dm={};var _w;function oE(){if(_w)return Dm;_w=1;var e=Ih();function t(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y}var s=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function h(x,y){var v=y(),j=r({inst:{value:v,getSnapshot:y}}),k=j[0].inst,S=j[1];return c(function(){k.value=v,k.getSnapshot=y,p(k)&&S({inst:k})},[x,v,y]),o(function(){return p(k)&&S({inst:k}),x(function(){p(k)&&S({inst:k})})},[x]),d(v),v}function p(x){var y=x.getSnapshot;x=x.value;try{var v=y();return!s(x,v)}catch{return!0}}function f(x,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:h;return Dm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Dm}var Sw;function lE(){return Sw||(Sw=1,Lm.exports=oE()),Lm.exports}var _j=lE();const cE=kj.useInsertionEffect,dE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",uE=dE?w.useLayoutEffect:w.useEffect,hE=cE||uE,Sj=e=>{const t=w.useRef([e,(...s)=>t[0](...s)]).current;return hE(()=>{t[0]=e}),t[1]},pE="popstate",ex="pushState",tx="replaceState",fE="hashchange",Nw=[pE,ex,tx,fE],mE=e=>{for(const t of Nw)addEventListener(t,e);return()=>{for(const t of Nw)removeEventListener(t,e)}},Nj=(e,t)=>_j.useSyncExternalStore(mE,e,t),Cw=()=>location.search,gE=({ssrSearch:e}={})=>Nj(Cw,e!=null?()=>e:Cw),Ew=()=>location.pathname,xE=({ssrPath:e}={})=>Nj(Ew,e!=null?()=>e:Ew),yE=(e,{replace:t=!1,state:s=null}={})=>history[t?tx:ex](s,"",e),bE=(e={})=>[xE(e),yE],Tw=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Tw]>"u"){for(const e of[ex,tx]){const t=history[e];history[e]=function(){const s=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),s}}Object.defineProperty(window,Tw,{value:!0})}const vE=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",Cj=(e="")=>e==="/"?"":e,wE=(e,t)=>e[0]==="~"?e.slice(1):Cj(t)+e,jE=(e="",t)=>vE(Aw(Cj(e)),Aw(t)),Aw=e=>{try{return decodeURI(e)}catch{return e}},Ej={hook:bE,searchHook:gE,parser:iE,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,s)=>e(t,s)}
9,Tj=w.createContext(Ej),Wo=()=>w.useContext(Tj),Aj={},Rj=w.createContext(Aj),kE=()=>w.useContext(Rj),$h=e=>{const[t,s]=e.hook(e);return[jE(e.base,t),Sj((r,o)=>e.aroundNav(s,wE(r,e.base),o))]},Uh=()=>$h(Wo()),sx=(e,t,s,r)=>{const{pattern:o,keys:c}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),d=o.exec(s)||[],[h,...p]=d;return h!==void 0?[!0,(()=>{const f=c!==!1?Object.fromEntries(c.map((x,y)=>[x,p[y]])):d.groups;let m={...p};return f&&Object.assign(m,f),m})(),...r?[h]:[]]:[!1,null]},Hh=e=>sx(Wo().parser,e,Uh()[0]),Oj=({children:e,...t})=>{const s=Wo(),r=t.hook?Ej:s;let o=r;const[c,d=t.ssrSearch??""]=t.ssrPath?.split("?")??[];c&&(t.ssrSearch=d,t.ssrPath=c),t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let h=w.useRef({}),p=h.current,f=p;for(let m in r){const x=m==="base"?r[m]+(t[m]??""):t[m]??r[m];p===f&&x!==f[m]&&(h.current=f={...f}),f[m]=x,(x!==r[m]||x!==o[m])&&(o=f)}return w.createElement(Tj.Provider,{value:o,children:e})},Rw=({children:e,component:t},s)=>t?w.createElement(t,{params:s}):typeof e=="function"?e(s):e,_E=e=>{let t=w.useRef(Aj);const s=t.current;return t.current=Object.keys(e).length!==Object.keys(s).length||Object.entries(e).some(([r,o])=>o!==s[r])?e:s},it=({path:e,nest:t,match:s,...r})=>{const o=Wo(),[c]=$h(o),[d,h,p]=s??sx(o.parser,e,c,t),f=_E({...kE(),...h});if(!d)return null;const m=p?w.createElement(Oj,{base:p},Rw(r,f)):Rw(r,f);return w.createElement(Rj.Provider,{value:f,children:m})},Be=w.forwardRef((e,t)=>{const s=Wo(),[r,o]=$h(s),{to:c="",href:d=c,onClick:h,asChild:p,children:f,className:m,replace:x,state:y,transition:v,...j}=e,k=Sj(N=>{N.ctrlKey||N.metaKey||N.altKey||N.shiftKey||N.button!==0||(h?.(N),N.defaultPrevented||(N.preventDefault(),o(d,e)))}),S=s.hrefs(d[0]==="~"?d.slice(1):s.base+d,s);return p&&w.isValidElement(f)?w.cloneElement(f,{onClick:k,href:S}):w.createElement("a",{...j,onClick:k,href:S,className:m?.call?m(r===d):m,children:f,ref:t})}),Pj=e=>Array.isArray(e)?e.flatMap(t=>Pj(t&&t.type===w.Fragment?t.props.children:t)):[e],SE=({children:e,location:t})=>{const s=Wo(),[r]=$h(s);for(const o of Pj(e)){let c=0;if(w.isValidElement(o)&&(c=sx(s.parser,o.props.path,t||r,o.props.nest))[0])return w.cloneElement(o,{match:c})}return null};var Yo=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(){}},NE={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},CE=class{#e=NE;#t=!1;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)}},ui=new CE;function EE(e){setTimeout(e,0)}var xi=typeof window>"u"||"Deno"in globalThis;function vs(){}function TE(e,t){return typeof e=="function"?e(t):e}function U0(e){return typeof e=="number"&&e>=0&&e!==1/0}function Mj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function br(e,t){return typeof e=="function"?e(t):e}function yn(e,t){return typeof e=="function"?e(t):e}function Ow(e,t){const{type:s="all",exact:r,fetchStatus:o,predicate:c,queryKey:d,stale:h}=e;if(d){if(r){if(t.queryHash!==nx(d,t.options))return!1}else if(!Tc(t.queryKey,d))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof h=="boolean"&&t.isStale()!==h||o&&o!==t.state.fetchStatus||c&&!c(t))}function Pw(e,t){const{exact:s,status:r,predicate:o,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(yi(t.options.mutationKey)!==yi(c))return!1}else if(!Tc(t.options.mutationKey,c))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function nx(e,t){return(t?.queryKeyHashFn||yi)(e)}function yi(e){return JSON.stringify(e,(t,s)=>H0(s)?Object.keys(s).sort().reduce((r,o)=>(r[o]=s[o],r),{}):s)}function Tc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Tc(e[s],t[s])):!1}var AE=Object.prototype.hasOwnProperty;function Lj(e,t,s=0){if(e===t)return e;if(s>500)return t;const r=Mw(e)&&Mw(t);if(!r&&!(H0(e)&&H0(t)))return t;const c=(r?e:Object.keys(e)).length,d=r?t:Object.keys(t),h=d.length,p=r?new Array(h):{};let f=0;for(let m=0;m<h;m++){const x=r?m:d[m],y=e[x],v=t[x];if(y===v){p[x]=y,(r?m<c:AE.call(e,x))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){p[x]=v;continue}const j=Lj(y,v,s+1);p[x]=j,j===y&&f++}return c===h&&f===c?e:p}function ph(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Mw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function H0(e){if(!Lw(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Lw(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Lw(e){return Object.prototype.toString.call(e)==="[object Object]"}function RE(e){return new Promise(t=>{ui.setTimeout(t,e)})}function q0(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Lj(e,t):t}function OE(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function PE(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var ax=Symbol();function Dj(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ax?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rx(e,t){return typeof e=="function"?e(...t):!!e}function ME(e,t,s){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),e}var LE=class extends Yo{#e;#t;#s;constructor(){super(),this.#s=e=>{if(!xi&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();
9this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ix=new LE;function V0(){let e,t;const s=new Promise((o,c)=>{e=o,t=c});s.status="pending",s.catch(()=>{});function r(o){Object.assign(s,o),delete s.resolve,delete s.reject}return s.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},s.reject=o=>{r({status:"rejected",reason:o}),t(o)},s}var DE=EE;function BE(){let e=[],t=0,s=h=>{h()},r=h=>{h()},o=DE;const c=h=>{t?e.push(h):o(()=>{s(h)})},d=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{s(p)})})})};return{batch:h=>{let p;t++;try{p=h()}finally{t--,t||d()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{o=h}}}var Gt=BE(),IE=class extends Yo{#e=!0;#t;#s;constructor(){super(),this.#s=e=>{if(!xi&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#e}},fh=new IE;function $E(e){return Math.min(1e3*2**e,3e4)}function Bj(e){return(e??"online")==="online"?fh.isOnline():!0}var z0=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Ij(e){let t=!1,s=0,r;const o=V0(),c=()=>o.status!=="pending",d=k=>{if(!c()){const S=new z0(k);y(S),e.onCancel?.(S)}},h=()=>{t=!0},p=()=>{t=!1},f=()=>ix.isFocused()&&(e.networkMode==="always"||fh.isOnline())&&e.canRun(),m=()=>Bj(e.networkMode)&&e.canRun(),x=k=>{c()||(r?.(),o.resolve(k))},y=k=>{c()||(r?.(),o.reject(k))},v=()=>new Promise(k=>{r=S=>{(c()||f())&&k(S)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),j=()=>{if(c())return;let k;const S=s===0?e.initialPromise:void 0;try{k=S??e.fn()}catch(N){k=Promise.reject(N)}Promise.resolve(k).then(x).catch(N=>{if(c())return;const C=e.retry??(xi?0:3),E=e.retryDelay??$E,O=typeof E=="function"?E(s,N):E,P=C===!0||typeof C=="number"&&s<C||typeof C=="function"&&C(s,N);if(t||!P){y(N);return}s++,e.onFail?.(s,N),RE(O).then(()=>f()?void 0:v()).then(()=>{t?y(N):j()})})};return{promise:o,status:()=>o.status,cancel:d,continue:()=>(r?.(),o),cancelRetry:h,continueRetry:p,canStart:m,start:()=>(m()?j():v().then(j),o)}}var $j=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),U0(this.gcTime)&&(this.#e=ui.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xi?1/0:300*1e3))}clearGcTimeout(){this.#e&&(ui.clearTimeout(this.#e),this.#e=void 0)}},UE=class extends $j{#e;#t;#s;#a;#n;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#s=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Bw(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Bw(this.options);t.data!==void 0&&(this.setState(Dw(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,t){const s=q0(this.state.data,e,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#r({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(vs).catch(vs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>yn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ax||this.state.dataUpdateCount+this.state.errorUpdate
9Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>br(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:!Mj(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.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.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},o=()=>{const h=Dj(this.options,t),f=(()=>{const m={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(m),m})();return this.#o=!1,this.options.persister?this.options.persister(h,f,this):h(f)},d=(()=>{const h={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return r(h),h})();this.options.behavior?.onFetch(d,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#r({type:"fetch",meta:d.fetchOptions?.meta}),this.#n=Ij({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:h=>{h instanceof z0&&h.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(h,p)=>{this.#r({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const h=await this.#n.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#s.config.onSuccess?.(h,this),this.#s.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof z0){if(h.silent)return this.#n.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#r({type:"error",error:h}),this.#s.config.onError?.(h,this),this.#s.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#r(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Uj(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...Dw(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),Gt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function Uj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bj(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Dw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdate
9Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var HE=class extends Yo{constructor(e,t){super(),this.options=t,this.#e=e,this.#r=null,this.#o=V0(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#s=void 0;#a=void 0;#n;#i;#o;#r;#m;#h;#p;#c;#d;#l;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Iw(this.#t,this.options)?this.#u():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return F0(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return F0(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#t.setOptions(this.options),t._defaulted&&!ph(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&$w(this.#t,s,this.options,t)&&this.#u(),this.updateResult(),r&&(this.#t!==s||yn(this.options.enabled,this.#t)!==yn(t.enabled,this.#t)||br(this.options.staleTime,this.#t)!==br(t.staleTime,this.#t))&&this.#g();const o=this.#x();r&&(this.#t!==s||yn(this.options.enabled,this.#t)!==yn(t.enabled,this.#t)||o!==this.#l)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(t,e);return VE(this,s)&&(this.#a=s,this.#i=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#a}trackResult(e,t){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#u({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#u(e){this.#j();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(vs)),t}#g(){this.#v();const e=br(this.options.staleTime,this.#t);if(xi||this.#a.isStale||!U0(e))return;const s=Mj(this.#a.dataUpdatedAt,e)+1;this.#c=ui.setTimeout(()=>{this.#a.isStale||this.updateResult()},s)}#x(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(xi||yn(this.options.enabled,this.#t)===!1||!U0(this.#l)||this.#l===0)&&(this.#d=ui.setInterval(()=>{(this.options.refetchIntervalInBackground||ix.isFocused())&&this.#u()},this.#l))}#b(){this.#g(),this.#y(this.#x())}#v(){this.#c&&(ui.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#d&&(ui.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const s=this.#t,r=this.options,o=this.#a,c=this.#n,d=this.#i,p=e!==s?e.state:this.#s,{state:f}=e;let m={...f},x=!1,y;if(t._optimisticResults){const A=this.hasListeners(),L=!A&&Iw(e,t),U=A&&$w(e,s,t,r);(L||U)&&(m={...m,...Uj(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:j,status:k}=m;y=m.data;let S=!1;if(t.placeholderData!==void 0&&y===void 0&&k==="pending"){let A;o?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(A=o.data,S=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,A!==void 0&&(k="success",y=q0(o?.data,A,t),x=!0)}if(t.select&&y!==void 0&&!S)if(o&&y===c?.data&&t.select===this.#m)y=this.#h;
9else try{this.#m=t.select,y=t.select(y),y=q0(o?.data,y,t),this.#h=y,this.#r=null}catch(A){this.#r=A}this.#r&&(v=this.#r,y=this.#h,j=Date.now(),k="error");const N=m.fetchStatus==="fetching",C=k==="pending",E=k==="error",O=C&&N,P=y!==void 0,B={status:k,fetchStatus:m.fetchStatus,isPending:C,isSuccess:k==="success",isError:E,isInitialLoading:O,isLoading:O,data:y,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:j,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>p.dataUpdateCount||m.errorUpdateCount>p.errorUpdateCount,isFetching:N,isRefetching:N&&!C,isLoadingError:E&&!P,isPaused:m.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:E&&P,isStale:ox(e,t),refetch:this.refetch,promise:this.#o,isEnabled:yn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=B.data!==void 0,L=B.status==="error"&&!A,U=W=>{L?W.reject(B.error):A&&W.resolve(B.data)},K=()=>{const W=this.#o=B.promise=V0();U(W)},G=this.#o;switch(G.status){case"pending":e.queryHash===s.queryHash&&U(G);break;case"fulfilled":(L||B.data!==G.value)&&K();break;case"rejected":(!L||B.error!==G.reason)&&K();break}}return B}updateResult(){const e=this.#a,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#i=this.options,this.#n.data!==void 0&&(this.#p=this.#t),ph(t,e))return;this.#a=t;const s=()=>
9{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#f.size)return!0;const c=new Set(o??this.#f);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(d=>{const h=d;return this.#a[h]!==e[h]&&c.has(h)})};this.#k({listeners:s()})}#j(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#s=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#k(e){Gt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function qE(e,t){return yn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Iw(e,t){return qE(e,t)||e.state.data!==void 0&&F0(e,t,t.refetchOnMount)}function F0(e,t,s){if(yn(t.enabled,e)!==!1&&br(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&ox(e,t)}return!1}function $w(e,t,s,r){return(e!==t||yn(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&ox(e,s)}function ox(e,t){return yn(t.enabled,e)!==!1&&e.isStaleByTime(br(t.staleTime,e))}function VE(e,t){return!ph(e.getCurrentResult(),t)}function Uw(e){return{onFetch:(t,s)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const f=async()=>{let m=!1;const x=j=>{ME(j,()=>t.signal,()=>m=!0)},y=Dj(t.options,t.fetchOptions),v=async(j,k,S)=>{if(m)return Promise.reject();if(k==null&&j.pages.length)return Promise.resolve(j);const C=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:k,direction:S?"backward":"forward",meta:t.options.meta};return x(M),M})(),E=await y(C),{maxPages:O}=t.options,P=S?PE:OE;return{pages:P(j.pages,E,O),pageParams:P(j.pageParams,k,O)}};if(o&&c.length){const j=o==="backward",k=j?zE:Hw,S={pages:c,pageParams:d},N=k(r,S);h=await v(S,N,j)}else{const j=e??c.length;do{const k=p===0?d[0]??r.initialPageParam:Hw(r,h);if(p>0&&k==null)break;h=await v(h,k),p++}while(p<j)}return h};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=f}}}function Hw(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function zE(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var FE=class extends $j{#e;#t;#s;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#s=e.mutationCache,this.#t=[],this.state=e.state||Hj(),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.#s.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=Ij({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#n({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const r=this.state.status==="pending",o=!this.#a.canStart();try{if(r)t();else{this.#n({type:"pending",variables:e,isPaused:o}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#n({type:"pending",context:d,variables:e,isPaused:o})}const c=await this.#a.start();return await this.#s.config.onSuccess?.(c,e,this.state.context,this,s),await this.options.onSuccess?.(c,e,this.state.context,s),await this.#s.config.onSettled?.(c,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(c,null,e,this.state.context,s),this.#n({type:"success",data:c}),c}catch(c){try{await this.#s.config.onError?.(c,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#s.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#n({type:"error",error:c}),c}finally{this.#s.runNext(this)}}#n(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};
9case"pending":return{...s,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{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Gt.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function Hj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var GE=class extends Yo{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(e,t,s){const r=new FE({client:e,mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#e.add(e);const t=vu(e);if(typeof t=="string"){const s=this.#t.get(t);s?s.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=vu(e);if(typeof t=="string"){const s=this.#t.get(t);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=vu(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=vu(e);return typeof t=="string"?this.#t.get(t)?.find(r=>
9r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Gt.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){const t={exact:!0,...e};return this.getAll().find(s=>Pw(t,s))}findAll(e={}){return this.getAll().filter(t=>Pw(e,t))}notify(e){Gt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Gt.batch(()=>Promise.all(e.map(t=>t.continue().catch(vs))))}};function vu(e){return e.options.scope?.id}var KE=class extends Yo{#e;#t=void 0;#s;#a;constructor(t,s){super(),this.#e=t,this.setOptions(s),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#e.defaultMutationOptions(t),ph(this.options,s)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),s?.mutationKey&&this.options.mutationKey&&yi(s.mutationKey)!==yi(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#i()}mutate(t,s){return this.#a=s,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#n(){const t=this.#s?.state??Hj();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Gt.batch(()=>{if(this.#a&&this.hasListeners()){const s=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#a.onSuccess?.(t.data,s,r,o)}catch(c){Promise.reject(c)}try{this.#a.onSettled?.(t.data,null,s,r,o)}catch(c){Promise.reject(c)}}else if(t?.type==="error"){try{this.#a.onError?.(t.error,s,r,o)}catch(c){Promise.reject(c)}try{this.#a.onSettled?.(void 0,t.error,s,r,o)}catch(c){Promise.reject(c)}}}this.listeners.forEach(s=>{s(this.#t)})})}},WE=class extends Yo{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){const r=t.queryKey,o=t.queryHash??nx(r,t);let c=this.get(o);return c||(c=new UE({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Gt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Ow(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Ow(e,s)):t}notify(e){Gt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},YE=class{#e;#t;#s;#a;#n;#i;#o;#r;constructor(e={}){this.#e=e.queryCache||new WE,this.#t=e.mutationCache||new GE,this.#s=e.defaultOptions||{},this.#a=new Map,this.#n=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=ix.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#r=fh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#r?.(),this.#r=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#e.build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(br(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(r.queryHash)?.state.data,d=TE(t,c);if(d!==void 0)return this.#e.build(this,r).setData(d,{...s,manual:!0})}
9setQueriesData(e,t,s){return Gt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Gt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#e;return Gt.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=Gt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(s)));return Promise.all(r).then(vs).catch(vs)}invalidateQueries(e,t={}){return Gt.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=Gt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,s);return s.throwOnError||(c=c.catch(vs)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(r).then(vs)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t);return s.isStaleByTime(br(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vs).catch(vs)}fetchInfiniteQuery(e){return e.behavior=Uw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vs).catch(vs)}ensureInfiniteQueryData(e){return e.behavior=Uw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fh.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(e){this.#s=e}setQueryDefaults(e,t){this.#a.set(yi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],s={};return t.forEach(r=>{Tc(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){this.#n.set(yi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],s={};return t.forEach(r=>{Tc(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#s.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=nx(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===ax&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#s.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},qj=w.createContext(void 0),Yc=e=>{const t=w.useContext(qj);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QE=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),n.jsx(qj.Provider,{value:e,children:t})),Vj=w.createContext(!1),ZE=()=>w.useContext(Vj);Vj.Provider;function XE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var JE=w.createContext(XE()),eT=()=>w.useContext(JE),tT=(e,t,s)=>{const r=s?.state.error&&typeof e.throwOnError=="function"?rx(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},sT=e=>{w.useEffect(()=>{e.clearReset()},[e])},nT=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||rx(s,[e.error,r])),aT=e=>{if(e.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>s(r(...o)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},rT=(e,t)=>e.isLoading&&e.isFetching&&!t,iT=(e,t)=>e?.suspense&&t.isPending,qw=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function oT(e,t,s){const r=ZE(),o=eT(),c=Yc(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const h=c.getQueryCache().get(d.queryHash);d._optimisticResults=r?"isRestoring":"optimistic",aT(d),tT(d,o,h),sT(o);const p=!c.getQueryCache().get(d.queryHash),[f]=w.useState(()=>new t(c,d)),m=f.getOptimisticResult(d),x=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(y=>
9{const v=x?f.subscribe(Gt.batchCalls(y)):vs;return f.updateResult(),v},[f,x]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),w.useEffect(()=>{f.setOptions(d)},[d,f]),iT(d,m))throw qw(d,f,o);if(nT({result:m,errorResetBoundary:o,throwOnError:d.throwOnError,query:h,suspense:d.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!xi&&rT(m,r)&&(p?qw(d,f,o):h?.promise)?.catch(vs).finally(()=>{f.updateResult()}),d.notifyOnChangeProps?m:f.trackResult(m)}function vr(e,t){return oT(e,HE)}function vc(e,t){const s=Yc(),[r]=w.useState(()=>new KE(s,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const o=w.useSyncExternalStore(w.useCallback(d=>r.subscribe(Gt.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),c=w.useCallback((d,h)=>{r.mutate(d,h).catch(vs)},[r]);if(o.error&&rx(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}const lT=1,cT=1e6;let Bm=0;function dT(){return Bm=(Bm+1)%Number.MAX_SAFE_INTEGER,Bm.toString()}const Im=new Map,Vw=e=>{if(Im.has(e))return;const t=setTimeout(()=>{Im.delete(e),wc({type:"REMOVE_TOAST",toastId:e})},cT);Im.set(e,t)},uT=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,lT)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=t;return s?Vw(s):e.toasts.forEach(r=>{Vw(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===s||s===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)}}},Ju=[];let eh={toasts:[]};function wc(e){eh=uT(eh,e),Ju.forEach(t=>{t(eh)})}function hT({...e}){const t=dT(),s=o=>wc({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>wc({type:"DISMISS_TOAST",toastId:t});return wc({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:s}}function pT(){const[e,t]=w.useState(eh);return w.useEffect(()=>(Ju.push(t),()=>{const s=Ju.indexOf(t);s>-1&&Ju.splice(s,1)}),[e]),{...e,toast:hT,dismiss:s=>wc({type:"DISMISS_TOAST",toastId:s})}}var Qo=jj();const fT=Ko(Qo);function Kt(e,t,{checkForDefaultPrevented:s=!0}={}){return function(o){if(e?.(o),s===!1||!o.defaultPrevented)return t?.(o)}}function zw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zj(...e){return t=>{let s=!1;const r=e.map(o=>{const c=zw(o,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let o=0;o<r.length;o++){const c=r[o];typeof c=="function"?c():zw(e[o],null)}}}}function Bn(...e){return w.useCallback(zj(...e),e)}function qh(e,t=[]){let s=[];function r(c,d){const h=w.createContext(d),p=s.length;s=[...s,d];const f=x=>{const{scope:y,children:v,...j}=x,k=y?.[e]?.[p]||h,S=w.useMemo(()=>j,Object.values(j));return n.jsx(k.Provider,{value:S,children:v})};f.displayName=c+"Provider";function m(x,y){const v=y?.[e]?.[p]||h,j=w.useContext(v);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${x}\` must be used within \`${c}\``)}return[f,m]}const o=()=>{const c=s.map(d=>w.createContext(d));return function(h){const p=h?.[e]||c;return w.useMemo(()=>({[`__scope${e}`]:{...h,[e]:p}}),[h,p])}};return o.scopeName=e,[r,mT(o,...t)]}function mT(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const d=r.reduce((h,{useScope:p,scopeName:f})=>{const x=p(c)[`__scope${f}`];return{...h,...x}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}function G0(e){const t=gT(e),s=w.forwardRef((r,o)=>{const{children:c,...d}=r,h=w.Children.toArray(c),p=h.find(yT);if(p){const f=p.props.children,m=h.map(x=>x===p?w.Children.count(f)>1?w.Children.only(null):w.isValidElement(f)?f.props.children:null:x);return n.jsx(t,{...d,ref:o,children:w.isValidElement(f)?w.cloneElement(f,void 0,m):null})}return n.jsx(t,{...d,ref:o,children:c})});return s.displayName=`${e}.Slot`,s}function gT(e){const t=w.forwardRef((s,r)=>{const{children:o,...c}=s;if(w.isValidElement(o)){const d=vT(o),h=bT(c,o.props);return o.type!==w.Fragment&&(h.ref=r?zj(r,d):d),w.cloneElement(o,h)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fj=Symbol("radix.slottable");function xT(e){const t=({children:s})=>n.jsx(n.Fragment,{children:s});return t.displayName=`${e}.Slottable`,t.__radixId=Fj,t}function yT(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fj}function bT(e,t){const s={...t};for(const r in t){const o=e[r],c=t[r];/^on[A-Z]/.test(r)?o&&c?s[r]=(...h)=>{const p=c(...h);return o(...h),p}:o&&(s[r]=o):r==="style"?s[r]={...o,...c}
9:r==="className"&&(s[r]=[o,c].filter(Boolean).join(" "))}return{...e,...s}}function vT(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function wT(e){const t=e+"CollectionProvider",[s,r]=qh(t),[o,c]=s(t,{collectionRef:{current:null},itemMap:new Map}),d=k=>{const{scope:S,children:N}=k,C=Ce.useRef(null),E=Ce.useRef(new Map).current;return n.jsx(o,{scope:S,itemMap:E,collectionRef:C,children:N})};d.displayName=t;const h=e+"CollectionSlot",p=G0(h),f=Ce.forwardRef((k,S)=>{const{scope:N,children:C}=k,E=c(h,N),O=Bn(S,E.collectionRef);return n.jsx(p,{ref:O,children:C})});f.displayName=h;const m=e+"CollectionItemSlot",x="data-radix-collection-item",y=G0(m),v=Ce.forwardRef((k,S)=>{const{scope:N,children:C,...E}=k,O=Ce.useRef(null),P=Bn(S,O),M=c(m,N);return Ce.useEffect(()=>(M.itemMap.set(O,{ref:O,...E}),()=>{M.itemMap.delete(O)})),n.jsx(y,{[x]:"",ref:P,children:C})});v.displayName=m;function j(k){const S=c(e+"CollectionConsumer",k);return Ce.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const E=Array.from(C.querySelectorAll(`[${x}]`));return Array.from(S.itemMap.values()).sort((M,B)=>E.indexOf(M.ref.current)-E.indexOf(B.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:d,Slot:f,ItemSlot:v},j,r]}var jT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Bs=jT.reduce((e,t)=>{const s=G0(`Primitive.${t}`),r=w.forwardRef((o,c)=>{const{asChild:d,...h}=o,p=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(p,{...h,ref:c})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gj(e,t){e&&Qo.flushSync(()=>e.dispatchEvent(t))}function jr(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...s)=>t.current?.(...s),[])}function kT(e,t=globalThis?.document){const s=jr(e);w.useEffect(()=>{const r=o=>{o.key==="Escape"&&s(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[s,t])}var _T="DismissableLayer",K0="dismissableLayer.update",ST="dismissableLayer.pointerDownOutside",NT="dismissableLayer.focusOutside",Fw,Kj=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lx=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:d,onDismiss:h,...p}=e,f=w.useContext(Kj),[m,x]=w.useState(null),y=m?.ownerDocument??globalThis?.document,[,v]=w.useState({}),j=Bn(t,B=>x(B)),k=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=k.indexOf(S),C=m?k.indexOf(m):-1,E=f.layersWithOutsidePointerEventsDisabled.size>0,O=C>=N,P=ET(B=>{const A=B.target,L=[...f.branches].some(U=>U.contains(A));!O||L||(o?.(B),d?.(B),B.defaultPrevented||h?.())},y),M=TT(B=>{const A=B.target;[...f.branches].some(U=>U.contains(A))||(c?.(B),d?.(B),B.defaultPrevented||h?.())},y);return kT(B=>{C===f.layers.size-1&&(r?.(B),!B.defaultPrevented&&h&&(B.preventDefault(),h()))},y),w.useEffect(()=>{if(m)return s&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Fw=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),Gw(),()=>{s&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=Fw)}},[m,y,s,f]),w.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),Gw())},[m,f]),w.useEffect(()=>{const B=()=>v({});return document.addEventListener(K0,B),()=>document.removeEventListener(K0,B)},[]),n.jsx(Bs.div,{...p,ref:j,style:{pointerEvents:E?O?"auto":"none":void 0,...e.style},onFocusCapture:Kt(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Kt(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Kt(e.onPointerDownCapture,P.onPointerDownCapture)})});lx.displayName=_T;var CT="DismissableLayerBranch",Wj=w.forwardRef((e,t)=>{const s=w.useContext(Kj),r=w.useRef(null),o=Bn(t,r);return w.useEffect(()=>{const c=r.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),n.jsx(Bs.div,{...e,ref:o})});Wj.displayName=CT;function ET(e,t=globalThis?.document){const s=jr(e),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const c=h=>{if(h.target&&!r.current){let p=function(){Yj(ST,s,f,{discrete:!0})};const f={originalEvent:h};h.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=p,t.addEventListener("click",o.current,{once:!0})):p()}else t.removeEventListener("click",o.current);r.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",o.current)}},[t,s]),{onPointerDownCapture:()=>r.current=!0}}function TT(e,t=globalThis?.document){const s=jr(e),r=w.useRef(!1);return w.useEffect(()=>{const o=c=>{c.target&&!r.current&&Yj(NT,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,s]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Gw(){const e=new CustomEvent(K0);document.dispatchEvent(e)}function Yj(e,t,s,{discrete:r}){const o=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&o.addEventListener(e,t,{once:!0}),r?Gj(o,c):o.dispatchEvent(c)}var AT=lx,RT=Wj,kr=globalThis?.document?w.useLayoutEffect:()=>{},OT="Portal",cx=w.forwardRef((e,t)=>
9{const{container:s,...r}=e,[o,c]=w.useState(!1);kr(()=>c(!0),[]);const d=s||o&&globalThis?.document?.body;return d?fT.createPortal(n.jsx(Bs.div,{...r,ref:t}),d):null});cx.displayName=OT;function PT(e,t){return w.useReducer((s,r)=>t[s][r]??s,e)}var Vh=e=>{const{present:t,children:s}=e,r=MT(t),o=typeof s=="function"?s({present:r.isPresent}):w.Children.only(s),c=Bn(r.ref,LT(o));return typeof s=="function"||r.isPresent?w.cloneElement(o,{ref:c}):null};Vh.displayName="Presence";function MT(e){const[t,s]=w.useState(),r=w.useRef(null),o=w.useRef(e),c=w.useRef("none"),d=e?"mounted":"unmounted",[h,p]=PT(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const f=wu(r.current);c.current=h==="mounted"?f:"none"},[h]),kr(()=>{const f=r.current,m=o.current;if(m!==e){const y=c.current,v=wu(f);e?p("MOUNT"):v==="none"||f?.display==="none"?p("UNMOUNT"):p(m&&y!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),kr(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,x=v=>{const k=wu(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&k&&(p("ANIMATION_END"),!o.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},y=v=>{v.target===t&&(c.current=wu(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:w.useCallback(f=>{r.current=f?getComputedStyle(f):null,s(f)},[])}}function wu(e){return e?.animationName||"none"}function LT(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var DT=kj[" useInsertionEffect ".trim().toString()]||kr;function BT({prop:e,defaultProp:t,onChange:s=()=>{},caller:r}){const[o,c,d]=IT({defaultProp:t,onChange:s}),h=e!==void 0,p=h?e:o;{const m=w.useRef(e!==void 0);w.useEffect(()=>{const x=m.current;x!==h&&console.warn(`${r} is changing from ${x?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=h},[h,r])}const f=w.useCallback(m=>{if(h){const x=$T(m)?m(e):m;x!==e&&d.current?.(x)}else c(m)},[h,e,c,d]);return[p,f]}function IT({defaultProp:e,onChange:t}){const[s,r]=w.useState(e),o=w.useRef(s),c=w.useRef(t);return DT(()=>{c.current=t},[t]),w.useEffect(()=>{o.current!==s&&(c.current?.(s),o.current=s)},[s,o]),[s,r,c]}function $T(e){return typeof e=="function"}var UT=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"}),HT="VisuallyHidden",zh=w.forwardRef((e,t)=>n.jsx(Bs.span,{...e,ref:t,style:{...UT,...e.style}}));zh.displayName=HT;var qT=zh,dx="ToastProvider",[ux,VT,zT]=wT("Toast"),[Qj]=qh("Toast",[zT]),[FT,Fh]=Qj(dx),Zj=e=>{const{__scopeToast:t,label:s="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:c=50,children:d}=e,[h,p]=w.useState(null),[f,m]=w.useState(0),x=w.useRef(!1),y=w.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${dx}\`. Expected non-empty \`string\`.`),n.jsx(ux.Provider,{scope:t,children:n.jsx(FT,{scope:t,label:s,duration:r,swipeDirection:o,swipeThreshold:c,toastCount:f,viewport:h,onViewportChange:p,onToastAdd:w.useCallback(()=>m(v=>v+1),[]),onToastRemove:w.useCallback(()=>m(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:y,children:d})})};Zj.displayName=dx;var Xj="ToastViewport",GT=["F8"],W0="toast.viewportPause",Y0="toast.viewportResume",Jj=w.forwardRef((e,t)=>
9{const{__scopeToast:s,hotkey:r=GT,label:o="Notifications ({hotkey})",...c}=e,d=Fh(Xj,s),h=VT(s),p=w.useRef(null),f=w.useRef(null),m=w.useRef(null),x=w.useRef(null),y=Bn(t,x,d.onViewportChange),v=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=d.toastCount>0;w.useEffect(()=>{const S=N=>{r.length!==0&&r.every(E=>N[E]||N.code===E)&&x.current?.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),w.useEffect(()=>{const S=p.current,N=x.current;if(j&&S&&N){const C=()=>{if(!d.isClosePausedRef.current){const M=new CustomEvent(W0);N.dispatchEvent(M),d.isClosePausedRef.current=!0}},E=()=>{if(d.isClosePausedRef.current){const M=new CustomEvent(Y0);N.dispatchEvent(M),d.isClosePausedRef.current=!1}},O=M=>{!S.contains(M.relatedTarget)&&E()},P=()=>{S.contains(document.activeElement)||E()};return S.addEventListener("focusin",C),S.addEventListener("focusout",O),S.addEventListener("pointermove",C),S.addEventListener("pointerleave",P),window.addEventListener("blur",C),window.addEventListener("focus",E),()=>{S.removeEventListener("focusin",C),S.removeEventListener("focusout",O),S.removeEventListener("pointermove",C),S.removeEventListener("pointerleave",P),window.removeEventListener("blur",C),window.removeEventListener("focus",E)}}},[j,d.isClosePausedRef]);const k=w.useCallback(({tabbingDirection:S})=>{const C=h().map(E=>{const O=E.ref.current,P=[O,...r8(O)];return S==="forwards"?P:P.reverse()});return(S==="forwards"?C.reverse():C).flat()},[h]);return w.useEffect(()=>{const S=x.current;if(S){const N=C=>{const E=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!E){const P=document.activeElement,M=C.shiftKey;if(C.target===S&&M){f.current?.focus();return}const L=k({tabbingDirection:M?"backwards":"forwards"}),U=L.findIndex(K=>K===P);$m(L.slice(U+1))?C.preventDefault():M?f.current?.focus():m.current?.focus()}};return S.addEventListener("keydown",N),()=>S.removeEventListener("keydown",N)}},[h,k]),n.jsxs(RT,{ref:p,role:"region","aria-label":o.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&n.jsx(Q0,{ref:f,onFocusFromOutsideViewport:()=>{const S=k({tabbingDirection:"forwards"});$m(S)}}),n.jsx(ux.Slot,{scope:s,children:n.jsx(Bs.ol,{tabIndex:-1,...c,ref:y})}),j&&n.jsx(Q0,{ref:m,onFocusFromOutsideViewport:()=>{const S=k({tabbingDirection:"backwards"});$m(S)}})]})});Jj.displayName=Xj;var ek="ToastFocusProxy",Q0=w.forwardRef((e,t)=>{const{__scopeToast:s,onFocusFromOutsideViewport:r,...o}=e,c=Fh(ek,s);return n.jsx(zh,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:d=>{const h=d.relatedTarget;!c.viewport?.contains(h)&&r()}})});Q0.displayName=ek;var Qc="Toast",KT="toast.swipeStart",WT="toast.swipeMove",YT="toast.swipeCancel",QT="toast.swipeEnd",tk=w.forwardRef((e,t)=>{const{forceMount:s,open:r,defaultOpen:o,onOpenChange:c,...d}=e,[h,p]=BT({prop:r,defaultProp:o??!0,onChange:c,caller:Qc});return n.jsx(Vh,{present:s||h,children:n.jsx(JT,{open:h,...d,ref:t,onClose:()=>p(!1),onPause:jr(e.onPause),onResume:jr(e.onResume),onSwipeStart:Kt(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Kt(e.onSwipeMove,f=>{const{x:m,y:x}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:Kt(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Kt(e.onSwipeEnd,f=>{const{x:m,y:x}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),p(!1)})})})});tk.displayName=Qc;var[ZT,XT]=Qj(Qc,{onClose(){}}),JT=w.forwardRef((e,t)=>
9{const{__scopeToast:s,type:r="foreground",duration:o,open:c,onClose:d,onEscapeKeyDown:h,onPause:p,onResume:f,onSwipeStart:m,onSwipeMove:x,onSwipeCancel:y,onSwipeEnd:v,...j}=e,k=Fh(Qc,s),[S,N]=w.useState(null),C=Bn(t,ee=>N(ee)),E=w.useRef(null),O=w.useRef(null),P=o||k.duration,M=w.useRef(0),B=w.useRef(P),A=w.useRef(0),{onToastAdd:L,onToastRemove:U}=k,K=jr(()=>{S?.contains(document.activeElement)&&k.viewport?.focus(),d()}),G=w.useCallback(ee=>{!ee||ee===1/0||(window.clearTimeout(A.current),M.current=new Date().getTime(),A.current=window.setTimeout(K,ee))},[K]);w.useEffect(()=>{const ee=k.viewport;if(ee){const te=()=>{G(B.current),f?.()},I=()=>{const V=new Date().getTime()-M.current;B.current=B.current-V,window.clearTimeout(A.current),p?.()};return ee.addEventListener(W0,I),ee.addEventListener(Y0,te),()=>{ee.removeEventListener(W0,I),ee.removeEventListener(Y0,te)}}},[k.viewport,P,p,f,G]),w.useEffect(()=>{c&&!k.isClosePausedRef.current&&G(P)},[c,P,k.isClosePausedRef,G]),w.useEffect(()=>(L(),()=>U()),[L,U]);const W=w.useMemo(()=>S?lk(S):null,[S]);return k.viewport?n.jsxs(n.Fragment,{children:[W&&n.jsx(e8,{__scopeToast:s,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:W}),n.jsx(ZT,{scope:s,onClose:K,children:Qo.createPortal(n.jsx(ux.ItemSlot,{scope:s,children:n.jsx(AT,{asChild:!0,onEscapeKeyDown:Kt(h,()=>{k.isFocusedToastEscapeKeyDownRef.current||K(),k.isFocusedToastEscapeKeyDownRef.current=!1}),children:n.jsx(Bs.li,{tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":k.swipeDirection,...j,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Kt(e.onKeyDown,ee=>{ee.key==="Escape"&&(h?.(ee.nativeEvent),ee.nativeEvent.defaultPrevented||(k.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:Kt(e.onPointerDown,ee=>{ee.button===0&&(E.current={x:ee.clientX,y:ee.clientY})}),onPointerMove:Kt(e.onPointerMove,ee=>{if(!E.current)return;const te=ee.clientX-E.current.x,I=ee.clientY-E.current.y,V=!!O.current,H=["left","right"].includes(k.swipeDirection),se=["left","up"].includes(k.swipeDirection)?Math.min:Math.max,R=H?se(0,te):0,Q=H?0:se(0,I),oe=ee.pointerType==="touch"?10:2,ne={x:R,y:Q},le={originalEvent:ee,delta:ne};V?(O.current=ne,ju(WT,x,le,{discrete:!1})):Kw(ne,k.swipeDirection,oe)?(O.current=ne,ju(KT,m,le,{discrete:!1}),ee.target.setPointerCapture(ee.pointerId)):(Math.abs(te)>oe||Math.abs(I)>oe)&&(E.current=null)}),onPointerUp:Kt(e.onPointerUp,ee=>{const te=O.current,I=ee.target;if(I.hasPointerCapture(ee.pointerId)&&I.releasePointerCapture(ee.pointerId),O.current=null,E.current=null,te){const V=ee.currentTarget,H={originalEvent:ee,delta:te};Kw(te,k.swipeDirection,k.swipeThreshold)?ju(QT,v,H,{discrete:!0}):ju(YT,y,H,{discrete:!0}),V.addEventListener("click",se=>se.preventDefault(),{once:!0})}})})})}),k.viewport)})]}):null}),e8=e=>{const{__scopeToast:t,children:s,...r}=e,o=Fh(Qc,t),[c,d]=w.useState(!1),[h,p]=w.useState(!1);return n8(()=>d(!0)),w.useEffect(()=>{const f=window.setTimeout(()=>p(!0),1e3);return()=>window.clearTimeout(f)},[]),h?null:n.jsx(cx,{asChild:!0,children:n.jsx(zh,{...r,children:c&&n.jsxs(n.Fragment,{children:[o.label," ",s]})})})},t8="ToastTitle",sk=w.forwardRef((e,t)=>{const{__scopeToast:s,...r}=e;return n.jsx(Bs.div,{...r,ref:t})});sk.displayName=t8;var s8="ToastDescription",nk=w.forwardRef((e,t)=>{const{__scopeToast:s,...r}=e;return n.jsx(Bs.div,{...r,ref:t})});nk.displayName=s8;var ak="ToastAction",rk=w.forwardRef((e,t)=>{const{altText:s,...r}=e;return s.trim()?n.jsx(ok,{altText:s,asChild:!0,children:n.jsx(hx,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ak}\`. Expected non-empty \`string\`.`),null)});rk.displayName=ak;var ik="ToastClose",hx=w.forwardRef((e,t)=>{const{__scopeToast:s,...r}=e,o=XT(ik,s);return n.jsx(ok,{asChild:!0,children:n.jsx(Bs.button,{type:"button",...r,ref:t,onClick:Kt(e.onClick,o.onClose)})})});hx.displayName=ik;var ok=w.forwardRef((e,t)=>{const{__scopeToast:s,altText:r,...o}=e;return n.jsx(Bs.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function lk(e){const t=[];
9return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),a8(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",c=r.dataset.radixToastAnnounceExclude==="";if(!o)if(c){const d=r.dataset.radixToastAnnounceAlt;d&&t.push(d)}else t.push(...lk(r))}}),t}function ju(e,t,s,{discrete:r}){const o=s.originalEvent.currentTarget,c=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:s});t&&o.addEventListener(e,t,{once:!0}),r?Gj(o,c):o.dispatchEvent(c)}var Kw=(e,t,s=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),c=r>o;return t==="left"||t==="right"?c&&r>s:!c&&o>s};function n8(e=()=>{}){const t=jr(e);kr(()=>{let s=0,r=0;return s=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(r)}},[t])}function a8(e){return e.nodeType===e.ELEMENT_NODE}function r8(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function $m(e){const t=document.activeElement;return e.some(s=>s===t?!0:(s.focus(),document.activeElement!==t))}var i8=Zj,ck=Jj,dk=tk,uk=sk,hk=nk,pk=rk,fk=hx;function mk(e){var t,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=mk(e[t]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function gk(){for(var e,t,s=0,r="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=mk(e))&&(r&&(r+=" "),r+=t);return r}const Ww=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yw=gk,o8=(e,t)=>s=>{var r;if(t?.variants==null)return Yw(e,s?.class,s?.className);const{variants:o,defaultVariants:c}=t,d=Object.keys(o).map(f=>{const m=s?.[f],x=c?.[f];if(m===null)return null;const y=Ww(m)||Ww(x);return o[f][y]}),h=s&&Object.entries(s).reduce((f,m)=>{let[x,y]=m;return y===void 0||(f[x]=y),f},{}),p=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:x,className:y,...v}=m;return Object.entries(v).every(j=>{let[k,S]=j;return Array.isArray(S)?S.includes({...c,...h}[k]):{...c,...h}[k]===S})?[...f,x,y]:f},[]);return Yw(e,d,p,s?.class,s?.className)};const l8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,r)=>r?r.toUpperCase():s.toLowerCase()),Qw=e=>{const t=c8(e);return t.charAt(0).toUpperCase()+t.slice(1)},xk=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim(),d8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var u8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const h8=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:o="",children:c,iconNode:d,...h},p)=>w.createElement("svg",{ref:p,...u8,width:t,height:t,stroke:e,strokeWidth:r?Number(s)*24/Number(t):s,className:xk("lucide",o),...!c&&!d8(h)&&{"aria-hidden":"true"},...h},[...d.map(([f,m])=>w.createElement(f,m)),...Array.isArray(c)?c:[c]]));const me=(e,t)=>{const s=w.forwardRef(({className:r,...o},c)=>w.createElement(h8,{ref:c,iconNode:t,className:xk(`lucide-${l8(Qw(e))}`,`lucide-${e}`,r),...o}));return s.displayName=Qw(e),s};const p8=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Zw=me("activity",p8);const f8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Xw=me("arrow-left",f8);const m8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],px=me("arrow-right",m8);const g8=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Z0=me("arrow-up-right",g8);const x8=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],y8=me("bell-ring",x8);const b8=[["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"}]],v8=me("book-open",b8);const w8=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}
9],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],Zo=me("building-2",w8);const j8=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],$o=me("calculator",j8);const k8=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],yk=me("calendar-plus",k8);const _8=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],S8=me("camera",_8);const N8=[["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"}]],fx=me("chart-column",N8);const C8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mx=me("check",C8);const E8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zc=me("chevron-down",E8);const T8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_r=me("chevron-left",T8);const A8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gh=me("chevron-right",A8);const R8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],en=me("circle-alert",R8);const O8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Tr=me("circle-check",O8);const P8=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],M8=me("circle-check-big",P8);const L8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],bk=me("circle-question-mark",L8);const D8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],gx=me("circle-x",D8);const B8=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],xx=me("clock",B8);const I8=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],$8=me("coins",I8);const U8=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],H8=me("compass",U8);const q8=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Jw=me("credit-card",q8);const V8=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],X0=me("database",V8);const z8=[["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"}]],Um=me("dollar-sign",z8);const F8=[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]],yx=me("droplet",F8);const G8=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],K8=me("droplets",G8);const W8=[["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"}]],In=me("external-link",W8);const Y8=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],Kh=me("file-down",Y8);const Q8=[["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"}]],Z8=me("file-text",Q8);const X8=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],J8=me("git-branch",X8);const e7=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],t7=me("heart",e7);const s7=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],vk=me("history",s7);const n7=[["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-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],wk=me("house",n7);const a7=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],bx=me("info",a7);const r7=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Wh=me("key-round",r7);const i7=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],jk=me("landmark",i7);const o7=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],l7=me("layout-dashboard",o7);const c7=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Yh=me("layers",c7);const d7=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],u7=me("layout-grid",d7);const h7=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}
9]],p7=me("leaf",h7);const f7=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],m7=me("life-buoy",f7);const g7=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Me=me("loader-circle",g7);const x7=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Qh=me("log-out",x7);const y7=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Aa=me("lock",y7);const b7=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],kk=me("mail",b7);const v7=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Xo=me("map-pin",v7);const w7=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],vx=me("map",w7);const j7=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Ac=me("moon",j7);const k7=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Hm=me("pencil",k7);const _7=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],S7=me("plus",_7);const N7=[["path",{d:"M18 7c0-5.333-8-5.333-8 0",key:"1prm2n"}],["path",{d:"M10 7v14",key:"18tmcs"}],["path",{d:"M6 21h12",key:"4dkmi1"}],["path",{d:"M6 13h10",key:"ybwr4a"}]],Jo=me("pound-sterling",N7);const C7=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],_k=me("radar",C7);const E7=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],Zh=me("receipt",E7);const T7=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],sn=me("refresh-cw",T7);const A7=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],R7=me("rotate-cw",A7);const O7=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ra=me("search",O7);const P7=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Sk=me("send",P7);const M7=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],L7=me("settings",M7);const D7=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],B7=me("share-2",D7);const I7=[["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",ke
vendor: 9,503 bytes, line 9
9y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],mh=me("shield-alert",I7);const $7=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wx=me("shield-check",$7);const U7=[["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"}]],jx=me("shield",U7);const H7=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],na=me("sparkles",H7);const q7=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],V7=me("star",q7);const z7=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Rc=me("sun",z7);const F7=[["rect",{width:"16",height:"16",x:"4",y:"3",rx:"2",key:"1wxw4b"}],["path",{d:"M4 11h16",key:"mpoxn0"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"m8 19-2 3",key:"13i0xs"}],["path",{d:"m18 22-2-3",key:"1p0ohu"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M16 15h.01",key:"rnfrdf"}]],kx=me("tram-front",F7);const G7=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Xh=me("trash-2",G7);const K7=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],W7=me("trending-down",K7);const Y7=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],an=me("trending-up",Y7);const Q7=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],el=me("triangle-alert",Q7);const Z7=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],bi=me("users",Z7);const X7=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],J7=me("user",X7);const eA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ar=me("x",eA);const tA=[["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"}]],kn=me("zap",tA),sA=(e,t)=>{const s=new Array(e.length+t.length);for(let r=0;r<e.length;r++)s[r]=e[r];for(let r=0;r<t.length;r++)s[e.length+r]=t[r];return s},nA=(e,t)=>({classGroupId:e,validator:t}),Nk=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),gh="-",e2=[],aA="arbitrary..",rA=e=>{const t=oA(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return iA(d);const h=d.split(gh),p=h[0]===""&&h.length>1?1:0;return Ck(h,p,t)},getConflictingClassGroupIds:(d,h)=>{if(h){const p=r[d],f=s[d];return p?f?sA(f,p):p:f||e2}return s[d]||e2}}},Ck=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const o=e[t],c=s.nextPart.get(o);if(c){const f=Ck(e,t+1,c);if(f)return f}const d=s.validators;if(d===null)return;const h=t===0?e.join(gh):e.slice(t).join(gh),p=d.length;for(let f=0;f<p;f++){const m=d[f];if(m.validator(h))return m.classGroupId}},iA=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?aA+r:void 0})(),oA=e=>{const{theme:t,classGroups:s}=e;return lA(s,t)},lA=(e,t)=>{const s=Nk();for(const r in e){const o=e[r];_x(o,s,r,t)}return s},_x=(e,t,s,r)=>{const o=e.length;for(let c=0;c<o;c++){const d=e[c];cA(d,t,s,r)}},cA=(e,t,s,r)=>{if(typeof e=="string"){dA(e,t,s);return}if(typeof e=="function"){uA(e,t,s,r);return}hA(e,t,s,r)},dA=(e,t,s)=>{const r=e===""?t:Ek(t,e);r.classGroupId=s},uA=(e,t,s,r)=>{if(pA(e)){_x(e(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push(nA(s,e))},hA=(e,t,s,r)=>{const o=Object.entries(e),c=o.length;for(let d=0;d<c;d++){const[h,p]=o[d];_x(p,Ek(t,h),s,r)}},Ek=(e,t)=>{let s=e;const r=t.split(gh),o=r.length;for(let c=0;c<o;c++){const d=r[c];let h=s.nextPart.get(d);h||(h=Nk(),s.nextPart.set(d,h)),s=h}return s},pA=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,fA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const o=(c,d)=>{s[c]=d,t++,t>e&&(t=0,r=s,s=Object.create(null))};return{get(c){let d=s[c];if(d!==void 0)return d;if((d=r[c])!==void 0)return o(c,d),d},set(c,d){c in s?s[c]=d:o(c,d)}}},J0="!",t2=":",mA=[],s2=(e,t,s,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:o}),gA=e=>{const{prefix:t,experimentalParseClassName:s}=e;let r=o=>{const c=[];let d=0,h=0,p=0,f;const m=o.length;for(let k=0;k<m;k++){const S=o[k];if(d===0&&h===0){if(S===t2){c.push(o.slice(p,k)),p=k+1;continue}if(S==="/"){f=k;continue}}S==="["?d++:S==="]"?d--:S==="("?h++:S===")"&&h--}const x=c.length===0?o:o.slice(p);let y=x,v=!1;x.endsWith(J0)?(y=x.slice(0,-1),v=!0):x.startsWith(J0)&&(y=x.slice(1),v=!0);const j=f&&f>p?f-p:void 0;return s2(c,v,y,j)};if(t){const o=t+t2,c=r;r=d=>d.startsWith(o)?c(d.slice(o.length)):s2(mA,!1,d,void 0,!0)}if(s){const o=r;r=c=>s({className:c,parseClassName:o})}return r},xA=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let o=[];for(let c=0;c<s.length;c++){const d=s[c],h=d[0]==="[",p=t.has(d);h||p?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(d)):o.push(d)}return o.length>0&&(o.sort(),r.push(...o)),r}},yA=e=>({cache:fA(e.cacheSize),parseClassName:gA(e),sortModifiers:xA(e),...rA(e)}),bA=/\s+/,vA=(e,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:c}=t,d=[],h=e.trim().split(bA);let p="";for(let f=h.length-1;f>=0;f-=1){const m=h[f],{isExternal:x,modifiers:y,hasImportantModifier:v,baseClassName:j,maybePostfixModifierPosition:k}=s(m);if(x){p=m+(p.length>0?" "+p:p);continue}let S=!!k,N=r(S?j.substring(0,k):j);if(!N){if(!S){p=m+(p.length>0?" "+p:p);continue}if(N=r(j),!N){p=m+(p.length>0?" "+p:p);continue}S=!1}const C=y.length===0?"":y.length===1?y[0]:c(y).join(":"),E=v?C+J0:C,O=E+N;if(d.indexOf(O)>-1)continue;d.push(O);const P=o(N,S);for(let M=0;M<P.length;++M){const B=P[M];d.push(E+B)}p=m+(p.length>0?" "+p:p)}return p},wA=(...e)=>{let t=0,s,r,o="";for(;t<e.length;)(s=e[t++])&&(r=Tk(s))&&(o&&(o+=" "),o+=r);return o},Tk=e=>{if(typeof e=="string")return e;let t,s="";for(let r=0;r<e.length;r++)e[r]&&(t=Tk(e[r]))&&(s&&(s+=" "),s+=t);return s},jA=(e,...t)=>{let s,r,o,c;const d=p=>{const f=t.reduce((m,x)=>x(m),e());return s=yA(f),r=s.cache.get,o=s.cache.set,c=h,h(p)},h=p=>{const f=r(p);if(f)return f;const m=vA(p,s);return o(p,m),m};return c=d,(...p)=>c(wA(...p))},kA=[],Ft=e=>{const t=s=>s[e]||kA;return t.isThemeGetter=!0,t},Ak=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_A=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,SA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,CA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,TA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cr=e=>_A.test(e),ze=e=>!!e&&!Number.isNaN(Number(e)),dr=e=>!!e&&Number.isInteger(Number(e)),qm=e=>e.endsWith("%")&&ze(e.slice(0,-1)),_a=e=>SA.test(e),Ok=()=>!0,AA=e=>NA.test(e)&&!CA.test(e),Sx=()=>!1,RA=e=>EA.test(e),OA=e=>TA.test(e),PA=e=>!ve(e)&&!_e(e),MA=e=>Rr(e,Lk,Sx),ve=e=>Ak.test(e),Zr=e=>Rr(e,Dk,AA),n2=e=>Rr(e,qA,ze),LA=e=>Rr(e,Ik,Ok),DA=e=>Rr(e,Bk,Sx),a2=e=>Rr(e,Pk,Sx),BA=e=>Rr(e,Mk,OA),ku=e=>Rr(e,$k,RA),_e=e=>Rk.test(e),lc=e=>ki(e,Dk),IA=e=>ki(e,Bk),r2=e=>ki(e,Pk),$A=e=>ki(e,Lk),UA=e=>ki(e,Mk),_u=e=>ki(e,$k,!0),HA=e=>ki(e,Ik,!0),Rr=(e,t,s)=>{const r=Ak.exec(e);return r?r[1]?t(r[1]):s(r[2]):!1},ki=(e,t,s=!1)=>{const r=Rk.exec(e);return r?r[1]?t(r[1]):s:!1},Pk=e=>e==="position"||e==="percentage",Mk=e=>e==="image"||e==="url",Lk=e=>e==="length"||e==="size"||e==="bg-size",Dk=e=>e==="length",qA=e=>e==="number",Bk=e=>e==="family-name",Ik=e=>e==="number"||e==="weight",$k=e=>e==="shadow",VA=()=>
vendor: 8,565 bytes, line 9
9{const e=Ft("color"),t=Ft("font"),s=Ft("text"),r=Ft("font-weight"),o=Ft("tracking"),c=Ft("leading"),d=Ft("breakpoint"),h=Ft("container"),p=Ft("spacing"),f=Ft("radius"),m=Ft("shadow"),x=Ft("inset-shadow"),y=Ft("text-shadow"),v=Ft("drop-shadow"),j=Ft("blur"),k=Ft("perspective"),S=Ft("aspect"),N=Ft("ease"),C=Ft("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...O(),_e,ve],M=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],A=()=>[_e,ve,p],L=()=>[cr,"full","auto",...A()],U=()=>[dr,"none","subgrid",_e,ve],K=()=>["auto",{span:["full",dr,_e,ve]},dr,_e,ve],G=()=>[dr,"auto",_e,ve],W=()=>["auto","min","max","fr",_e,ve],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...A()],V=()=>[cr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],H=()=>[cr,"screen","full","dvw","lvw","svw","min","max","fit",...A()],se=()=>[cr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],R=()=>[e,_e,ve],Q=()=>[...O(),r2,a2,{position:[_e,ve]}],oe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",$A,MA,{size:[_e,ve]}],le=()=>[qm,lc,Zr],fe=()=>["","none","full",f,_e,ve],he=()=>["",ze,lc,Zr],Ne=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[ze,qm,r2,a2],ye=()=>["","none",j,_e,ve],Le=()=>["none",ze,_e,ve],ot=()=>["none",ze,_e,ve],Je=()=>[ze,_e,ve],jt=()=>[cr,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_a],breakpoint:[_a],color:[Ok],container:[_a],"drop-shadow":[_a],ease:["in","out","in-out"],font:[PA],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_a],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_a],shadow:[_a],spacing:["px",ze],text:[_a],"text-shadow":[_a],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cr,ve,_e,S]}],container:["container"],columns:[{columns:[ze,ve,_e,h]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[dr,"auto",_e,ve]}],basis:[{basis:[cr,"full","auto",h,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,cr,"auto","initial","none",ve]}],grow:[{grow:["",ze,_e,ve]}],shrink:[{shrink:["",ze,_e,ve]}],order:[{order:[dr,"first","last","none",_e,ve]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mbs:[{mbs:I()}],mbe:[{mbe:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[h,"screen",...V()]}],"min-w":[{"min-w":[h,"screen","none",...V()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",s,lc,Zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,HA,LA]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qm,ve]}],"font-family":[{font:[IA,DA,t]}],"font-features":[{"font-features":[ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,_e,ve]}],"line-clamp":[{"line-clamp":[ze,"none",_e,n2]}],leading:[{leading:[c,...A()]}],"list-image":[{"list-image":["none",_e,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",_e,Zr]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[ze,"auto",_e,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_e,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Q()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dr,_e,ve],radial:["",_e,ve],conic:[dr,_e,ve]},UA,BA]}
9],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}
vendor: 5,755 bytes, line 9
9],"divide-color":[{divide:R()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,_e,ve]}],"outline-w":[{outline:["",ze,lc,Zr]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",m,_u,ku]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",x,_u,ku]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[ze,Zr]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",y,_u,ku]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[ze,_e,ve]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[_e,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Q()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,ve]}],filter:[{filter:["","none",_e,ve]}],blur:[{blur:ye()}],brightness:[{brightness:[ze,_e,ve]}],contrast:[{contrast:[ze,_e,ve]}],"drop-shadow":[{"drop-shadow":["","none",v,_u,ku]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",ze,_e,ve]}],"hue-rotate":[{"hue-rotate":[ze,_e,ve]}],invert:[{invert:["",ze,_e,ve]}],saturate:[{saturate:[ze,_e,ve]}],sepia:[{sepia:["",ze,_e,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,ve]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[ze,_e,ve]}],"backdrop-contrast":[{"backdrop-contrast":[ze,_e,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,_e,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,_e,ve]}],"backdrop-invert":[{"backdrop-invert":["",ze,_e,ve]}],"backdrop-opacity":[{"backdrop-opacity":[ze,_e,ve]}],"backdrop-saturate":[{"backdrop-saturate":[ze,_e,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,_e,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_e,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",_e,ve]}],ease:[{ease:["linear","initial",N,_e,ve]}],delay:[{delay:[ze,_e,ve]}],animate:[{animate:["none",C,_e,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,_e,ve]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:ot()}],"scale-x":[{"scale-x":ot()}],"scale-y":[{"scale-y":ot()}],"scale-z":[{"scale-z":ot()}],"scale-3d":["scale-3d"],skew:[{skew:Je()}],"skew-x":[{"skew-x":Je()}],"skew-y":[{"skew-y":Je()}],transform:[{transform:[_e,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:jt()}],"translate-x":[{"translate-x":jt()}],"translate-y":[{"translate-y":jt()}],"translate-z":[{"translate-z":jt()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}
9],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_e,ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_e,ve]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[ze,lc,Zr,n2]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},zA=jA(VA);function rn(...e){return zA(gk(e))}const FA=i8,Uk=w.forwardRef(({className:e,...t},s)=>n.jsx(ck,{ref:s,className:rn("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}));Uk.displayName=ck.displayName;const GA=o8("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"}}),Hk=w.forwardRef(({className:e,variant:t,...s},r)=>n.jsx(dk,{ref:r,className:rn(GA({variant:t}),e),...s}));Hk.displayName=dk.displayName;const KA=w.forwardRef(({className:e,...t},s)=>n.jsx(pk,{ref:s,className:rn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));KA.displayName=pk.displayName;const qk=w.forwardRef(({className:e,...t},s)=>n.jsx(fk,{ref:s,className:rn("absolute right-2 top-2 rounded-md p-1 text-foreground
9/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:n.jsx(Ar,{className:"h-4 w-4"})}));qk.displayName=fk.displayName;const Vk=w.forwardRef(({className:e,...t},s)=>n.jsx(uk,{ref:s,className:rn("text-sm font-semibold",e),...t}));Vk.displayName=uk.displayName;const zk=w.forwardRef(({className:e,...t},s)=>n.jsx(hk,{ref:s,className:rn("text-sm opacity-90",e),...t}));zk.displayName=hk.displayName;function WA(){const{toasts:e}=pT();return n.jsxs(FA,{children:[e.map(function({id:t,title:s,description:r,action:o,...c}){return n.jsxs(Hk,{...c,children:[n.jsxs("div",{className:"grid gap-1",children:[s&&n.jsx(Vk,{children:s}),r&&n.jsx(zk,{children:r})]}),o,n.jsx(qk,{})]},t)}),n.jsx(Uk,{})]})}const Fk=["top","right","bottom","left"],i2=["start","end"],o2=Fk.reduce((e,t)=>e.concat(t,t+"-"+i2[0],t+"-"+i2[1]),[]),Sr=Math.min,Qs=Math.max,xh=Math.round,Su=Math.floor,ta=e=>({x:e,y:e}),YA={left:"right",right:"left",bottom:"top",top:"bottom"};function eg(e,t,s){return Qs(e,Sr(t,s))}function aa(e,t){return typeof e=="function"?e(t):e}function $n(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function Nx(e){return e==="x"?"y":"x"}function Cx(e){return e==="y"?"height":"width"}function ea(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ex(e){return Nx(ea(e))}function Gk(e,t,s){s===void 0&&(s=!1);const r=Ln(e),o=Ex(e),c=Cx(o);let d=o==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(d=bh(d)),[d,bh(d)]}function QA(e){const t=bh(e);return[yh(e),t,yh(t)]}function yh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const l2=["left","right"],c2=["right","left"],ZA=["top","bottom"],XA=["bottom","top"];
9function JA(e,t,s){switch(e){case"top":case"bottom":return s?t?c2:l2:t?l2:c2;case"left":case"right":return t?ZA:XA;default:return[]}}function e9(e,t,s,r){const o=Ln(e);let c=JA($n(e),s==="start",r);return o&&(c=c.map(d=>d+"-"+o),t&&(c=c.concat(c.map(yh)))),c}function bh(e){const t=$n(e);return YA[t]+e.slice(t.length)}function t9(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kk(e){return typeof e!="number"?t9(e):{top:e,right:e,bottom:e,left:e}}function vh(e){const{x:t,y:s,width:r,height:o}=e;return{width:r,height:o,top:s,left:t,right:t+r,bottom:s+o,x:t,y:s}}function d2(e,t,s){let{reference:r,floating:o}=e;const c=ea(t),d=Ex(t),h=Cx(d),p=$n(t),f=c==="y",m=r.x+r.width/2-o.width/2,x=r.y+r.height/2-o.height/2,y=r[h]/2-o[h]/2;let v;switch(p){case"top":v={x:m,y:r.y-o.height};break;case"bottom":v={x:m,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:x};break;case"left":v={x:r.x-o.width,y:x};break;default:v={x:r.x,y:r.y}}switch(Ln(t)){case"start":v[d]-=y*(s&&f?-1:1);break;case"end":v[d]+=y*(s&&f?-1:1);break}return v}async function s9(e,t){var s;t===void 0&&(t={});const{x:r,y:o,platform:c,rects:d,elements:h,strategy:p}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:x="floating",altBoundary:y=!1,padding:v=0}=aa(t,e),j=Kk(v),S=h[y?x==="floating"?"reference":"floating":x],N=vh(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(S)))==null||s?S:S.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(h.floating)),boundary:f,rootBoundary:m,strategy:p})),C=x==="floating"?{x:r,y:o,width:d.floating.width,height:d.floating.height}:d.reference,E=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),O=await(c.isElement==null?void 0:c.isElement(E))?await(c.getScale==null?void 0:c.getScale(E))||{x:1,y:1}:{x:1,y:1},P=vh(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:C,offsetParent:E,strategy:p}):C);return{top:(N.top-P.top+j.top)/O.y,bottom:(P.bottom-N.bottom+j.bottom)/O.y,left:(N.left-P.left+j.left)/O.x,right:(P.right-N.right+j.right)/O.x}}const n9=50,a9=async(e,t,s)=>{const{placement:r="bottom",strategy:o="absolute",middleware:c=[],platform:d}=s,h=d.detectOverflow?d:{...d,detectOverflow:s9},p=await(d.isRTL==null?void 0:d.isRTL(t));let f=await d.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:x}=d2(f,r,p),y=r,v=0;const j={};for(let k=0;k<c.length;k++){const S=c[k];if(!S)continue;const{name:N,fn:C}=S,{x:E,y:O,data:P,reset:M}=await C({x:m,y:x,initialPlacement:r,placement:y,strategy:o,middlewareData:j,rects:f,platform:h,elements:{reference:e,floating:t}});m=E??m,x=O??x,j[N]={...j[N],...P},M&&v<n9&&(v++,typeof M=="object"&&(M.placement&&(y=M.placement),M.rects&&(f=M.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:o}):M.rects),{x:m,y:x}=d2(f,y,p)),k=-1)}return{x:m,y:x,placement:y,strategy:o,middlewareData:j}},r9=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:r,placement:o,rects:c,platform:d,elements:h,middlewareData:p}=t,{element:f,padding:m=0}=aa(e,t)||{};if(f==null)return{};const x=Kk(m),y={x:s,y:r},v=Ex(o),j=Cx(v),k=await d.getDimensions(f),S=v==="y",N=S?"top":"left",C=S?"bottom":"right",E=S?"clientHeight":"clientWidth",O=c.reference[j]+c.reference[v]-y[v]-c.floating[j],P=y[v]-c.reference[v],M=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f));let B=M?M[E]:0;(!B||!await(d.isElement==null?void 0:d.isElement(M)))&&(B=h.floating[E]||c.floating[j]);const A=O/2-P/2,L=B/2-k[j]/2-1,U=Sr(x[N],L),K=Sr(x[C],L),G=U,W=B-k[j]-K,ee=B/2-k[j]/2+A,te=eg(G,ee,W),I=!p.arrow&&Ln(o)!=null&&ee!==te&&c.reference[j]/2-(ee<G?U:K)-k[j]/2<0,V=I?ee<G?ee-G:ee-W:0;return{[v]:y[v]+V,data:{[v]:te,centerOffset:ee-te-V,...I&&{alignmentOffset:V}},reset:I}}});function i9(e,t,s){return(e?[...s.filter(o=>Ln(o)===e),...s.filter(o=>Ln(o)!==e)]:s.filter(o=>$n(o)===o)).filter(o=>e?Ln(o)===e||(t?yh(o)!==o:!1):!0)}const o9=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var s,r,o;const{rects:c,middlewareData:d,placement:h,platform:p,elements:f}=t,{crossAxis:m=!1,alignment:x,allowedPlacements:y=o2,autoAlignment:v=!0,...j}=aa(e,t),k=x!==void 0||y===o2?i9(x||null,v,y):y,S=await p.detectOverflow(t,j),N=((s=d.autoPlacement)==null?void 0:s.index)||0,C=k[N];if(C==null)return{};const E=Gk(C,c,await(p.isRTL==null?void 0:p.isRTL(f.floating)));if(h!==C)return{reset:{placement:k[0]}};const O=[S[$n(C)],S[E[0]],S[E[1]]],P=[...((r=d.autoPlacement)==null?void 0:r.overflows)||[],{placement:C,overflows:O}],M=k[N+1];if(M)return{data:{index:N+1,overflows:P},reset:{placement:M}};const B=P.map(U=>{const K=Ln(U.placement);return[U.placement,K&&m?U.overflows.slice(0,2).reduce((G,W)=>G+W,0):U.overflows[0],U.overflows]}).sort((U,K)=>U[1]-K[1]),L=((o=B.filter(U=>
9U[2].slice(0,Ln(U[0])?2:3).every(K=>K<=0))[0])==null?void 0:o[0])||B[0][0];return L!==h?{data:{index:N+1,overflows:P},reset:{placement:L}}:{}}}},l9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,r;const{placement:o,middlewareData:c,rects:d,initialPlacement:h,platform:p,elements:f}=t,{mainAxis:m=!0,crossAxis:x=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:k=!0,...S}=aa(e,t);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const N=$n(o),C=ea(h),E=$n(h)===h,O=await(p.isRTL==null?void 0:p.isRTL(f.floating)),P=y||(E||!k?[bh(h)]:QA(h)),M=j!=="none";!y&&M&&P.push(...e9(h,k,j,O));const B=[h,...P],A=await p.detectOverflow(t,S),L=[];let U=((r=c.flip)==null?void 0:r.overflows)||[];if(m&&L.push(A[N]),x){const ee=Gk(o,d,O);L.push(A[ee[0]],A[ee[1]])}if(U=[...U,{placement:o,overflows:L}],!L.every(ee=>ee<=0)){var K,G;const ee=(((K=c.flip)==null?void 0:K.index)||0)+1,te=B[ee];if(te&&(!(x==="alignment"?C!==ea(te):!1)||U.every(H=>ea(H.placement)===C?H.overflows[0]>0:!0)))return{data:{index:ee,overflows:U},reset:{placement:te}};let I=(G=U.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:G.placement;if(!I)switch(v){case"bestFit":{var W;const V=(W=U.filter(H=>{if(M){const se=ea(H.placement);return se===C||se==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(se=>se>0).reduce((se,R)=>se+R,0)]).sort((H,se)=>H[1]-se[1])[0])==null?void 0:W[0];V&&(I=V);break}case"initialPlacement":I=h;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function u2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function h2(e){return Fk.some(t=>e[t]>=0)}const c9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:s,platform:r}=t,{strategy:o="referenceHidden",...c}=aa(e,t);switch(o){case"referenceHidden":{const d=await r.detectOverflow(t,{...c,elementContext:"reference"}),h=u2(d,s.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:h2(h)}}}case"escaped":{const d=await r.detectOverflow(t,{...c,altBoundary:!0}),h=u2(d,s.floating);return{data:{escapedOffsets:h,escaped:h2(h)}}}default:return{}}}}},Wk=new Set(["left","top"]);async function d9(e,t){const{placement:s,platform:r,elements:o}=e,c=await(r.isRTL==null?void 0:r.isRTL(o.floating)),d=$n(s),h=Ln(s),p=ea(s)==="y",f=Wk.has(d)?-1:1,m=c&&p?-1:1,x=aa(t,e);let{mainAxis:y,crossAxis:v,alignmentAxis:j}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return h&&typeof j=="number"&&(v=h==="end"?j*-1:j),p?{x:v*m,y:y*f}:{x:y*f,y:v*m}}const u9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,r;const{x:o,y:c,placement:d,middlewareData:h}=t,p=await d9(t,e);return d===((s=h.offset)==null?void 0:s.placement)&&(r=h.arrow)!=null&&r.alignmentOffset?{}:{x:o+p.x,y:c+p.y,data:{...p,placement:d}}}}},h9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:r,placement:o,platform:c}=t,{mainAxis:d=!0,crossAxis:h=!1,limiter:p={fn:N=>{let{x:C,y:E}=N;return{x:C,y:E}}},...f}=aa(e,t),m={x:s,y:r},x=await c.detectOverflow(t,f),y=ea($n(o)),v=Nx(y);let j=m[v],k=m[y];if(d){const N=v==="y"?"top":"left",C=v==="y"?"bottom":"right",E=j+x[N],O=j-x[C];j=eg(E,j,O)}if(h){const N=y==="y"?"top":"left",C=y==="y"?"bottom":"right",E=k+x[N],O=k-x[C];k=eg(E,k,O)}const S=p.fn({...t,[v]:j,[y]:k});return{...S,data:{x:S.x-s,y:S.y-r,enabled:{[v]:d,[y]:h}}}}}},p9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:s,y:r,placement:o,rects:c,middlewareData:d}=t,{offset:h=0,mainAxis:p=!0,crossAxis:f=!0}=aa(e,t),m={x:s,y:r},x=ea(o),y=Nx(x);let v=m[y],j=m[x];const k=aa(h,t),S=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:0,crossAxis:0,...k};if(p){const E=y==="y"?"height":"width",O=c.reference[y]-c.floating[E]+S.mainAxis,P=c.reference[y]+c.reference[E]-S.mainAxis;v<O?v=O:v>P&&(v=P)}if(f){var N,C;const E=y==="y"?"width":"height",O=Wk.has($n(o)),P=c.reference[x]-c.floating[E]+(O&&((N=d.offset)==null?void 0:N[x])||0)+(O?0:S.crossAxis),M=c.reference[x]+c.reference[E]+(O?0:((C=d.offset)==null?void 0:C[x])||0)-(O?S.crossAxis:0);j<P?j=P:j>M&&(j=M)}return{[y]:v,[x]:j}}}},f9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var s,r;const{placement:o,rects:c,platform:d,elements:h}=t,{apply:p=()=>{},...f}=aa(e,t),m=await d.detectOverflow(t,f),x=$n(o),y=Ln(o),v=ea(o)==="y",{width:j,height:k}=c.floating;let S,N;x==="top"||x==="bottom"?(S=x,N=y===(await(d.isRTL==null?void 0:d.isRTL(h.floating))?"start":"end")?"left":"right"):(N=x,S=y==="end"?"top":"bottom");const C=k-m.top-m.bottom,E=j-m.left-m.right,O=Sr(k-m[S],C),P=Sr(j-m[N],E),M=!t.middlewareData.shift;let B=O,A=P;if((s=t.middlewareData.shift)!=null&&s.enabled.x&&(A=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(B=C),M&&!y){const U=Qs(m.left,0),K=Qs(m.right,0),G=Qs(m.top,0),W=Qs(m.bottom,0);v?A=j-2*(U!==0||K!==0?U+K:Qs(m.left,m.right)):B=k-2*(G!==0||W!==0?G+W:Qs(m.top,m.bottom))}await p({...t,availableWidth:A,availableHeight:B});const L=await d.getDimensions(h.floating);return j!==L.width||k!==L.height?{reset:{rects:!0}}:{}}}};function Jh(){return typeof window<"u"}function tl(e){return Yk(e)?(e.nodeName||"").toLowerCase():"#document"}function tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ia(e){var t;return(t=(Yk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yk(e){return Jh()?e instanceof Node||e instanceof tn(e).Node:!1}function Un(e){return Jh()?e instanceof Element||e instanceof tn(e).Element:!1}function La(e){return Jh()?e instanceof HTMLElement||e instanceof tn(e).HTMLElement:!1}function p2(e){return!Jh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tn(e).ShadowRoot}function Xc(e){const{overflow:t,overflowX:s,overflowY:r,display:o}=Hn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+s)&&o!=="inline"&&o!=="contents"}function m9(e){return/^(table|td|th)$/.test(tl(e))}function ep(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const g9=/transform|translate|scale|rotate|perspective|filter/,x9=/paint|layout|strict|content/,Xr=e=>!!e&&e!=="none";let Vm;function Tx(e){const t=Un(e)?Hn(e):e;return Xr(t.transform)||Xr(t.translate)||Xr(t.scale)||Xr(t.rotate)||Xr(t.perspective)||!Ax()&&(Xr(t.backdropFilter)||Xr(t.filter))||g9.test(t.willChange||"")||x9.test(t.contain||"")}function y9(e){let t=Nr(e);for(;La(t)&&!Uo(t);){if(Tx(t))return t;if(ep(t))return null;t=Nr(t)}return null}function Ax(){return Vm==null&&(Vm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Vm}function Uo(e){return/^(html|body|#document)$/.test(tl(e))}function Hn(e){return tn(e).getComputedStyle(e)}function tp(e){return Un(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nr(e){if(tl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||p2(e)&&e.host||ia(e);return p2(t)?t.host:t}function Qk(e){const t=Nr(e);return Uo(t)?e.ownerDocument?e.ownerDocument.body:e.body:La(t)&&Xc(t)?t:Qk(t)}function Oc(e,t,s){var r;t===void 0&&(t=[]),s===void 0&&(s=!0);const o=Qk(e),c=o===((r=e.ownerDocument)==null?void 0:r.body),d=tn(o);if(c){const h=tg(d);
9return t.concat(d,d.visualViewport||[],Xc(o)?o:[],h&&s?Oc(h):[])}else return t.concat(o,Oc(o,[],s))}function tg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zk(e){const t=Hn(e);let s=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=La(e),c=o?e.offsetWidth:s,d=o?e.offsetHeight:r,h=xh(s)!==c||xh(r)!==d;return h&&(s=c,r=d),{width:s,height:r,$:h}}function Rx(e){return Un(e)?e:e.contextElement}function Do(e){const t=Rx(e);if(!La(t))return ta(1);const s=t.getBoundingClientRect(),{width:r,height:o,$:c}=Zk(t);let d=(c?xh(s.width):s.width)/r,h=(c?xh(s.height):s.height)/o;return(!d||!Number.isFinite(d))&&(d=1),(!h||!Number.isFinite(h))&&(h=1),{x:d,y:h}}const b9=ta(0);function Xk(e){const t=tn(e);return!Ax()||!t.visualViewport?b9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function v9(e,t,s){return t===void 0&&(t=!1),!s||t&&s!==tn(e)?!1:t}function vi(e,t,s,r){t===void 0&&(t=!1),s===void 0&&(s=!1);const o=e.getBoundingClientRect(),c=Rx(e);let d=ta(1);t&&(r?Un(r)&&(d=Do(r)):d=Do(e));const h=v9(c,s,r)?Xk(c):ta(0);let p=(o.left+h.x)/d.x,f=(o.top+h.y)/d.y,m=o.width/d.x,x=o.height/d.y;if(c){const y=tn(c),v=r&&Un(r)?tn(r):r;let j=y,k=tg(j);for(;k&&r&&v!==j;){const S=Do(k),N=k.getBoundingClientRect(),C=Hn(k),E=N.left+(k.clientLeft+parseFloat(C.paddingLeft))*S.x,O=N.top+(k.clientTop+parseFloat(C.paddingTop))*S.y;p*=S.x,f*=S.y,m*=S.x,x*=S.y,p+=E,f+=O,j=tn(k),k=tg(j)}}return vh({width:m,height:x,x:p,y:f})}function sp(e,t){const s=tp(e).scrollLeft;return t?t.left+s:vi(ia(e)).left+s}function Jk(e,t){const s=e.getBoundingClientRect(),r=s.left+t.scrollLeft-sp(e,s),o=s.top+t.scrollTop;return{x:r,y:o}}function w9(e){let{elements:t,rect:s,offsetParent:r,strategy:o}=e;const c=o==="fixed",d=ia(r),h=t?ep(t.floating):!1;if(r===d||h&&c)return s;let p={scrollLeft:0,scrollTop:0},f=ta(1);const m=ta(0),x=La(r);if((x||!x&&!c)&&((tl(r)!=="body"||Xc(d))&&(p=tp(r)),x)){const v=vi(r);f=Do(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const y=d&&!x&&!c?Jk(d,p):ta(0);return{width:s.width*f.x,height:s.height*f.y,x:s.x*f.x-p.scrollLeft*f.x+m.x+y.x,y:s.y*f.y-p.scrollTop*f.y+m.y+y.y}}function j9(e){return Array.from(e.getClientRects())}function k9(e){const t=ia(e),s=tp(e),r=e.ownerDocument.body,o=Qs(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),c=Qs(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let d=-s.scrollLeft+sp(e);const h=-s.scrollTop;return Hn(r).direction==="rtl"&&(d+=Qs(t.clientWidth,r.clientWidth)-o),{width:o,height:c,x:d,y:h}}const f2=25;function _9(e,t){const s=tn(e),r=ia(e),o=s.visualViewport;let c=r.clientWidth,d=r.clientHeight,h=0,p=0;if(o){c=o.width,d=o.height;const m=Ax();(!m||m&&t==="fixed")&&(h=o.offsetLeft,p=o.offsetTop)}const f=sp(r);if(f<=0){const m=r.ownerDocument,x=m.body,y=getComputedStyle(x),v=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,j=Math.abs(r.clientWidth-x.clientWidth-v);j<=f2&&(c-=j)}else f<=f2&&(c+=f);return{width:c,height:d,x:h,y:p}}function S9(e,t){const s=vi(e,!0,t==="fixed"),r=s.top+e.clientTop,o=s.left+e.clientLeft,c=La(e)?Do(e):ta(1),d=e.clientWidth*c.x,h=e.clientHeight*c.y,p=o*c.x,f=r*c.y;return{width:d,height:h,x:p,y:f}}function m2(e,t,s){let r;if(t==="viewport")r=_9(e,s);else if(t==="document")r=k9(ia(e));else if(Un(t))r=S9(t,s);else{const o=Xk(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return vh(r)}function e4(e,t){const s=Nr(e);return s===t||!Un(s)||Uo(s)?!1:Hn(s).position==="fixed"||e4(s,t)}function N9(e,t){const s=t.get(e);if(s)return s;let r=Oc(e,[],!1).filter(h=>Un(h)&&tl(h)!=="body"),o=null;const c=Hn(e).position==="fixed";let d=c?Nr(e):e;for(;Un(d)&&!Uo(d);){const h=Hn(d),p=Tx(d);!p&&h.position==="fixed"&&(o=null),(c?!p&&!o:!p&&h.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Xc(d)&&!p&&e4(e,d))?r=r.filter(m=>m!==d):o=h,d=Nr(d)}return t.set(e,r),r}function C9(e){let{element:t,boundary:s,rootBoundary:r,strategy:o}=e;const d=[...s==="clippingAncestors"?ep(t)?[]:N9(t,this._c):[].concat(s),r],h=m2(t,d[0],o);let p=h.top,f=h.right,m=h.bottom,x=h.left;for(let y=1;y<d.length;y++){const v=m2(t,d[y],o);p=Qs(v.top,p),f=Sr(v.right,f),m=Sr(v.bottom,m),x=Qs(v.left,x)}return{width:f-x,height:m-p,x,y:p}}function E9(e){const{width:t,height:s}=Zk(e);return{width:t,height:s}}
9function T9(e,t,s){const r=La(t),o=ia(t),c=s==="fixed",d=vi(e,!0,c,t);let h={scrollLeft:0,scrollTop:0};const p=ta(0);function f(){p.x=sp(o)}if(r||!r&&!c)if((tl(t)!=="body"||Xc(o))&&(h=tp(t)),r){const v=vi(t,!0,c,t);p.x=v.x+t.clientLeft,p.y=v.y+t.clientTop}else o&&f();c&&!r&&o&&f();const m=o&&!r&&!c?Jk(o,h):ta(0),x=d.left+h.scrollLeft-p.x-m.x,y=d.top+h.scrollTop-p.y-m.y;return{x,y,width:d.width,height:d.height}}function zm(e){return Hn(e).position==="static"}function g2(e,t){if(!La(e)||Hn(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return ia(e)===s&&(s=s.ownerDocument.body),s}function t4(e,t){const s=tn(e);if(ep(e))return s;if(!La(e)){let o=Nr(e);for(;o&&!Uo(o);){if(Un(o)&&!zm(o))return o;o=Nr(o)}return s}let r=g2(e,t);for(;r&&m9(r)&&zm(r);)r=g2(r,t);return r&&Uo(r)&&zm(r)&&!Tx(r)?s:r||y9(e)||s}const A9=async function(e){const t=this.getOffsetParent||t4,s=this.getDimensions,r=await s(e.floating);return{reference:T9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function R9(e){return Hn(e).direction==="rtl"}const O9={convertOffsetParentRelativeRectToViewportRelativeRect:w9,getDocumentElement:ia,getClippingRect:C9,getOffsetParent:t4,getElementRects:A9,getClientRects:j9,getDimensions:E9,getScale:Do,isElement:Un,isRTL:R9};function s4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function P9(e,t){let s=null,r;const o=ia(e);function c(){var h;clearTimeout(r),(h=s)==null||h.disconnect(),s=null}function d(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),c();const f=e.getBoundingClientRect(),{left:m,top:x,width:y,height:v}=f;if(h||t(),!y||!v)return;const j=Su(x),k=Su(o.clientWidth-(m+y)),S=Su(o.clientHeight-(x+v)),N=Su(m),E={rootMargin:-j+"px "+-k+"px "+-S+"px "+-N+"px",threshold:Qs(0,Sr(1,p))||1};let O=!0;function P(M){const B=M[0].intersectionRatio;if(B!==p){if(!O)return d();B?d(!1,B):r=setTimeout(()=>{d(!1,1e-7)},1e3)}B===1&&!s4(f,e.getBoundingClientRect())&&d(),O=!1}try{s=new IntersectionObserver(P,{...E,root:o.ownerDocument})}catch{s=new IntersectionObserver(P,E)}s.observe(e)}return d(!0),c}function sg(e,t,s,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:p=!1}=r,f=Rx(e),m=o||c?[...f?Oc(f):[],...t?Oc(t):[]]:[];m.forEach(N=>{o&&N.addEventListener("scroll",s,{passive:!0}),c&&N.addEventListener("resize",s)});const x=f&&h?P9(f,s):null;let y=-1,v=null;d&&(v=new ResizeObserver(N=>{let[C]=N;C&&C.target===f&&v&&t&&(v.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(t)})),s()}),f&&!p&&v.observe(f),t&&v.observe(t));let j,k=p?vi(e):null;p&&S();function S(){const N=vi(e);k&&!s4(k,N)&&s(),k=N,j=requestAnimationFrame(S)}return s(),()=>{var N;m.forEach(C=>{o&&C.removeEventListener("scroll",s),c&&C.removeEventListener("resize",s)}),x?.(),(N=v)==null||N.disconnect(),v=null,p&&cancelAnimationFrame(j)}}const M9=u9,L9=o9,D9=h9,B9=l9,I9=f9,$9=c9,x2=r9,U9=p9,H9=(e,t,s)=>{const r=new Map,o={platform:O9,...s},c={...o.platform,_c:r};return a9(e,t,{...o,platform:c})};var q9=typeof document<"u",V9=function(){},th=q9?w.useLayoutEffect:V9;function wh(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 s,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(r=s;r--!==0;)if(!wh(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=s;r--!==0;){const c=o[r];if(!(c==="_owner"&&e.$$typeof)&&!wh(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function n4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function y2(e,t){const s=n4(e);return Math.round(t*s)/s}function Fm(e){const t=w.useRef(e);return th(()=>{t.current=e}),t}function ng(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:r=[],platform:o,elements:{reference:c,floating:d}={},transform:h=!0,whileElementsMounted:p,open:f}=e,[m,x]=w.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[y,v]=w.useState(r);wh(y,r)||v(r);const[j,k]=w.useState(null),[S,N]=w.useState(null),C=w.useCallback(H=>{H!==M.current&&(M.current=H,k(H))},[]),E=w.useCallback(H=>{H!==B.current&&(B.current=H,N(H))},[]),O=c||j,P=d||S,M=w.useRef(null),B=w.useRef(null),A=w.useRef(m),L=p!=null,U=Fm(p),K=Fm(o),G=Fm(f),W=w.useCallback(()=>
9{if(!M.current||!B.current)return;const H={placement:t,strategy:s,middleware:y};K.current&&(H.platform=K.current),H9(M.current,B.current,H).then(se=>{const R={...se,isPositioned:G.current!==!1};ee.current&&!wh(A.current,R)&&(A.current=R,Qo.flushSync(()=>{x(R)}))})},[y,t,s,K,G]);th(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,x(H=>({...H,isPositioned:!1})))},[f]);const ee=w.useRef(!1);th(()=>(ee.current=!0,()=>{ee.current=!1}),[]),th(()=>{if(O&&(M.current=O),P&&(B.current=P),O&&P){if(U.current)return U.current(O,P,W);W()}},[O,P,W,U,L]);const te=w.useMemo(()=>({reference:M,floating:B,setReference:C,setFloating:E}),[C,E]),I=w.useMemo(()=>({reference:O,floating:P}),[O,P]),V=w.useMemo(()=>{const H={position:s,left:0,top:0};if(!I.floating)return H;const se=y2(I.floating,m.x),R=y2(I.floating,m.y);return h?{...H,transform:"translate("+se+"px, "+R+"px)",...n4(I.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:se,top:R}},[s,h,I.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:W,refs:te,elements:I,floatingStyles:V}),[m,W,te,I,V])}const z9=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:r,padding:o}=typeof e=="function"?e(s):e;return r&&t(r)?r.current!=null?x2({element:r.current,padding:o}).fn(s):{}:r?x2({element:r,padding:o}).fn(s):{}}}},ag=(e,t)=>{const s=M9(e);return{name:s.name,fn:s.fn,options:[e,t]}},a4=(e,t)=>{const s=D9(e);return{name:s.name,fn:s.fn,options:[e,t]}},F9=(e,t)=>({fn:U9(e).fn,options:[e,t]}),r4=(e,t)=>{const s=B9(e);return{name:s.name,fn:s.fn,options:[e,t]}},G9=(e,t)=>
9{const s=I9(e);return{name:s.name,fn:s.fn,options:[e,t]}},K9=(e,t)=>{const s=L9(e);return{name:s.name,fn:s.fn,options:[e,t]}},W9=(e,t)=>{const s=$9(e);return{name:s.name,fn:s.fn,options:[e,t]}},i4=(e,t)=>{const s=z9(e);return{name:s.name,fn:s.fn,options:[e,t]}};var Y9="Arrow",o4=w.forwardRef((e,t)=>{const{children:s,width:r=10,height:o=5,...c}=e;return n.jsx(Bs.svg,{...c,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});o4.displayName=Y9;var Q9=o4;function Z9(e){const[t,s]=w.useState(void 0);return kr(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const c=o[0];let d,h;if("borderBoxSize"in c){const p=c.borderBoxSize,f=Array.isArray(p)?p[0]:p;d=f.inlineSize,h=f.blockSize}else d=e.offsetWidth,h=e.offsetHeight;s({width:d,height:h})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else s(void 0)},[e]),t}var l4="Popper",[c4,d4]=qh(l4),[iG,u4]=c4(l4),h4="PopperAnchor",p4=w.forwardRef((e,t)=>{const{__scopePopper:s,virtualRef:r,...o}=e,c=u4(h4,s),d=w.useRef(null),h=Bn(t,d),p=w.useRef(null);return w.useEffect(()=>{const f=p.current;p.current=r?.current||d.current,f!==p.current&&c.onAnchorChange(p.current)}),r?null:n.jsx(Bs.div,{...o,ref:h})});p4.displayName=h4;var Ox="PopperContent",[X9,J9]=c4(Ox),f4=w.forwardRef((e,t)=>{const{__scopePopper:s,side:r="bottom",sideOffset:o=0,align:c="center",alignOffset:d=0,arrowPadding:h=0,avoidCollisions:p=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:x="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:j,...k}=e,S=u4(Ox,s),[N,C]=w.useState(null),E=Bn(t,Ne=>C(Ne)),[O,P]=w.useState(null),M=Z9(O),B=M?.width??0,A=M?.height??0,L=r+(c!=="center"?"-"+c:""),U=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},K=Array.isArray(f)?f:[f],G=K.length>0,W={padding:U,boundary:K.filter(tR),altBoundary:G},{refs:ee,floatingStyles:te,placement:I,isPositioned:V,middlewareData:H}=ng({strategy:"fixed",placement:L,whileElementsMounted:(...Ne)=>sg(...Ne,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[ag({mainAxis:o+A,alignmentAxis:d}),p&&a4({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?F9():void 0,...W}),p&&r4({...W}),G9({...W,apply:({elements:Ne,rects:J,availableWidth:ue,availableHeight:ye})=>{const{width:Le,height:ot}=J.reference,Je=Ne.floating.style;Je.setProperty("--radix-popper-available-width",`${ue}px`),Je.setProperty("--radix-popper-available-height",`${ye}px`),Je.setProperty("--radix-popper-anchor-width",`${Le}px`),Je.setProperty("--radix-popper-anchor-height",`${ot}px`)}}),O&&i4({element:O,padding:h}),sR({arrowWidth:B,arrowHeight:A}),y&&W9({strategy:"referenceHidden",...W})]}),[se,R]=x4(I),Q=jr(j);kr(()=>{V&&Q?.()},[V,Q]);const oe=H.arrow?.x,ne=H.arrow?.y,le=H.arrow?.centerOffset!==0,[fe,he]=w.useState();return kr(()=>{N&&he(window.getComputedStyle(N).zIndex)},[N]),n.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:V?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(X9,{scope:s,placedSide:se,onArrowChange:P,arrowX:oe,arrowY:ne,shouldHideArrow:le,children:n.jsx(Bs.div,{"data-side":se,"data-align":R,...k,ref:E,style:{...k.style,animation:V?void 0:"none"}})})})});f4.displayName=Ox;var m4="PopperArrow",eR={top:"bottom",right:"left",bottom:"top",left:"right"},g4=w.forwardRef(function(t,s){const{__scopePopper:r,...o}=t,c=J9(m4,r),d=eR[c.placedSide];return n.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:n.jsx(Q9,{...o,ref:s,style:{...o.style,display:"block"}})})});g4.displayName=m4;function tR(e){return e!==null}var sR=e=>({name:"transformOrigin",options:e,fn(t){const{placement:s,rects:r,middlewareData:o}=t,d=o.arrow?.centerOffset!==0,h=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[f,m]=x4(s),x={start:"0%",center:"50%",end:"100%"}[m],y=(o.arrow?.x??0)+h/2,v=(o.arrow?.y??0)+p/2;let j="",k="";return f==="bottom"?(j=d?x:`${y}px`,k=`${-p}px`):f==="top"?(j=d?x:`${y}px`,k=`${r.floating.height+p}px`):f==="right"?(j=`${-p}px`,k=d?x:`${v}px`):f==="left"&&(j=`${r.floating.width+p}px`,k=d?x:`${v}px`),{data:{x:j,y:k}}}});function x4(e){const[t,s="center"]=e.split("-");return[t,s]}var nR=p4,aR=f4,rR=g4,[np]=qh("Tooltip",[d4]),Px=d4(),y4="TooltipProvider",iR=700,b2="tooltip.open",[oR,b4]=np(y4),v4=e=>{const{__scopeTooltip:t,delayDuration:s=iR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:c}=e,d=w.useRef(!0),h=w.useRef(!1),p=w.useRef(0);return w.useEffect(()=>{const f=p.current;return()=>window.clearTimeout(f)},[]),n.jsx(oR,{scope:t,isOpenDelayedRef:d,delayDuration:s,onOpen:w.useCallback(()=>{window.clearTimeout(p.current),d.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.current=!0,r)},[r]),isPointerInTransitRef:h,onPointerInTransitChange:w.useCallback(f=>{h.current=f},[]),disableHoverableContent:o,children:c})};v4.displayName=y4;var w4="Tooltip",[oG,Jc]=np(w4),rg="TooltipTrigger",lR=w.forwardRef((e,t)=>
9{const{__scopeTooltip:s,...r}=e,o=Jc(rg,s),c=b4(rg,s),d=Px(s),h=w.useRef(null),p=Bn(t,h,o.onTriggerChange),f=w.useRef(!1),m=w.useRef(!1),x=w.useCallback(()=>f.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),n.jsx(nR,{asChild:!0,...d,children:n.jsx(Bs.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:p,onPointerMove:Kt(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!c.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Kt(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Kt(e.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Kt(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:Kt(e.onBlur,o.onClose),onClick:Kt(e.onClick,o.onClose)})})});lR.displayName=rg;var Mx="TooltipPortal",[cR,dR]=np(Mx,{forceMount:void 0}),j4=e=>{const{__scopeTooltip:t,forceMount:s,children:r,container:o}=e,c=Jc(Mx,t);return n.jsx(cR,{scope:t,forceMount:s,children:n.jsx(Vh,{present:s||c.open,children:n.jsx(cx,{asChild:!0,container:o,children:r})})})};j4.displayName=Mx;var Ho="TooltipContent",k4=w.forwardRef((e,t)=>{const s=dR(Ho,e.__scopeTooltip),{forceMount:r=s.forceMount,side:o="top",...c}=e,d=Jc(Ho,e.__scopeTooltip);return n.jsx(Vh,{present:r||d.open,children:d.disableHoverableContent?n.jsx(_4,{side:o,...c,ref:t}):n.jsx(uR,{side:o,...c,ref:t})})}),uR=w.forwardRef((e,t)=>{const s=Jc(Ho,e.__scopeTooltip),r=b4(Ho,e.__scopeTooltip),o=w.useRef(null),c=Bn(t,o),[d,h]=w.useState(null),{trigger:p,onClose:f}=s,m=o.current,{onPointerInTransitChange:x}=r,y=w.useCallback(()=>{h(null),x(!1)},[x]),v=w.useCallback((j,k)=>{const S=j.currentTarget,N={x:j.clientX,y:j.clientY},C=gR(N,S.getBoundingClientRect()),E=xR(N,C),O=yR(k.getBoundingClientRect()),P=vR([...E,...O]);h(P),x(!0)},[x]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(p&&m){const j=S=>v(S,m),k=S=>v(S,p);return p.addEventListener("pointerleave",j),m.addEventListener("pointerleave",k),()=>{p.removeEventListener("pointerleave",j),m.removeEventListener("pointerleave",k)}}},[p,m,v,y]),w.useEffect(()=>{if(d){const j=k=>{const S=k.target,N={x:k.clientX,y:k.clientY},C=p?.contains(S)||m?.contains(S),E=!bR(N,d);C?y():E&&(y(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[p,m,d,f,y]),n.jsx(_4,{...e,ref:c})}),[hR,pR]=np(w4,{isInside:!1}),fR=xT("TooltipContent"),_4=w.forwardRef((e,t)=>{const{__scopeTooltip:s,children:r,"aria-label":o,onEscapeKeyDown:c,onPointerDownOutside:d,...h}=e,p=Jc(Ho,s),f=Px(s),{onClose:m}=p;return w.useEffect(()=>(document.addEventListener(b2,m),()=>document.removeEventListener(b2,m)),[m]),w.useEffect(()=>{if(p.trigger){const x=y=>{y.target?.contains(p.trigger)&&m()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[p.trigger,m]),n.jsx(lx,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:n.jsxs(aR,{"data-state":p.stateAttribute,...f,...h,ref:t,style:{...h.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:[n.jsx(fR,{children:r}),n.jsx(hR,{scope:s,isInside:!0,children:n.jsx(qT,{id:p.contentId,role:"tooltip",children:o||r})})]})})});k4.displayName=Ho;var S4="TooltipArrow",mR=w.forwardRef((e,t)=>{const{__scopeTooltip:s,...r}=e,o=Px(s);return pR(S4,s).isInside?null:n.jsx(rR,{...o,...r,ref:t})});mR.displayName=S4;function gR(e,t){const s=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),c=Math.abs(t.left-e.x);switch(Math.min(s,r,o,c)){case c:return"left";case o:return"right";case s:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function xR(e,t,s=5){const r=[];switch(t){case"top":r.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":r.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":r.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":r.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return r}function yR(e){const{top:t,right:s,bottom:r,left:o}=e;return[{x:o,y:t},{x:s,y:t},{x:s,y:r},{x:o,y:r}]}function bR(e,t){const{x:s,y:r}=e;let o=!1;for(let c=0,d=t.length-1;c<t.length;d=c++){const h=t[c],p=t[d],f=h.x,m=h.y,x=p.x,y=p.y;m>r!=y>r&&s<(x-f)*(r-m)/(y-m)+f&&(o=!o)}return o}function vR(e){const t=e.slice();return t.sort((s,r)=>s.x<r.x?-1:s.x>r.x?1:s.y<r.y?-1:s.y>r.y?1:0),wR(t)}function wR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const c=t[t.length-1],d=t[t.length-2];if((c.x-d.x)*(o.y-d.y)>=(c.y-d.y)*(o.x-d.x))t.pop();else break}t.push(o)}t.pop();const s=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;s.length>=2;){const c=s[s.length-1],d=s[s.length-2];if((c.x-d.x)*(o.y-d.y)>=(c.y-d.y)*(o.x-d.x))s.pop();else break}s.push(o)}return s.pop(),t.length===1&&s.length===1&&t[0].x===s[0].x&&t[0].y===s[0].y?t:t.concat(s)}var jR=v4,kR=j4,N4=k4;const _R=jR,SR=w.forwardRef(({className:e,sideOffset:t=4,...s},r)=>
9n.jsx(kR,{children:n.jsx(N4,{ref:r,sideOffset:t,className:rn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...s})}));SR.displayName=N4.displayName;const Lx=w.createContext({});function ap(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const NR=typeof window<"u",Dx=NR?w.useLayoutEffect:w.useEffect,rp=w.createContext(null);function Bx(e,t){e.indexOf(t)===-1&&e.push(t)}function qo(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const ra=(e,t,s)=>s>t?t:s<e?e:s;let Ix=()=>{};const Oa={},C4=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function E4(e){return typeof e=="object"&&e!==null}const T4=e=>/^0[^.\s]+$/u.test(e);function A4(e){let t;return()=>(t===void 0&&(t=e()),t)}const wn=e=>e,CR=(e,t)=>s=>t(e(s)),ed=(...e)=>e.reduce(CR),Vo=(e,t,s)=>{const r=t-e;return r===0?1:(s-e)/r};class $x{constructor(){this.subscriptions=[]}add(t){return Bx(this.subscriptions,t),()=>qo(this.subscriptions,t)}notify(t,s,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,s,r);else for(let c=0;c<o;c++){const d=this.subscriptions[c];d&&d(t,s,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const jn=e=>e*1e3,vn=e=>e/1e3;function R4(e,t){return t?e*(1e3/t):0}const ER=(e,t,s)=>{const r=t-e;return((s-e)%r+r)%r+e},O4=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,TR=1e-7,AR=12;function RR(e,t,s,r,o){let c,d,h=0;do d=t+(s-t)/2,c=O4(d,r,o)-e,c>0?s=d:t=d;while(Math.abs(c)>TR&&++h<AR);return d}function td(e,t,s,r){if(e===t&&s===r)return wn;const o=c=>RR(c,0,1,e,s);return c=>c===0||c===1?c:O4(o(c),t,r)}const P4=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,M4=e=>t=>1-e(1-t),L4=td(.33,1.53,.69,.99),Ux=M4(L4),D4=P4(Ux),B4=e=>(e*=2)<1?.5*Ux(e):.5*(2-Math.pow(2,-10*(e-1))),Hx=e=>1-Math.sin(Math.acos(e)),I4=M4(Hx),$4=P4(Hx),OR=td(.42,0,1,1),PR=td(0,0,.58,1),U4=td(.42,0,.58,1),H4=e=>Array.isArray(e)&&typeof e[0]!="number";function q4(e,t){return H4(e)?e[ER(0,e.length,t)]:e}const V4=e=>Array.isArray(e)&&typeof e[0]=="number",MR={linear:wn,easeIn:OR,easeInOut:U4,easeOut:PR,circIn:Hx,circInOut:$4,circOut:I4,backIn:Ux,backInOut:D4,backOut:L4,anticipate:B4},LR=e=>typeof e=="string",v2=e=>{if(V4(e)){Ix(e.length===4);const[t,s,r,o]=e;return td(t,s,r,o)}else if(LR(e))return MR[e];return e},Nu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function DR(e,t){let s=new Set,r=new Set,o=!1,c=!1;const d=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function p(m){d.has(m)&&(f.schedule(m),e()),m(h)}const f={schedule:(m,x=!1,y=!1)=>{const j=y&&o?s:r;return x&&d.add(m),j.has(m)||j.add(m),m},cancel:m=>{r.delete(m),d.delete(m)},process:m=>{if(h=m,o){c=!0;return}o=!0,[s,r]=[r,s],s.forEach(p),s.clear(),o=!1,c&&(c=!1,f.process(m))}};return f}const BR=40;function z4(e,t){let s=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},c=()=>s=!0,d=Nu.reduce((E,O)=>(E[O]=DR(c),E),{}),{setup:h,read:p,resolveKeyframes:f,preUpdate:m,update:x,preRender:y,render:v,postRender:j}=d,k=()=>{const E=Oa.useManualTiming?o.timestamp:performance.now();s=!1,Oa.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(E-o.timestamp,BR),1)),o.timestamp=E,o.isProcessing=!0,h.process(o),p.process(o),f.process(o),m.process(o),x.process(o),y.process(o),v.process(o),j.process(o),o.isProcessing=!1,s&&t&&(r=!1,e(k))},S=()=>{s=!0,r=!0,o.isProcessing||e(k)};return{schedule:Nu.reduce((E,O)=>{const P=d[O];return E[O]=(M,B=!1,A=!1)=>(s||S(),P.schedule(M,B,A)),E},{}),cancel:E=>{for(let O=0;O<Nu.length;O++)d[Nu[O]].cancel(E)},state:o,steps:d}}const{schedule:vt,cancel:Cr,state:hs,steps:Gm}=z4(typeof requestAnimationFrame<"u"?requestAnimationFrame:wn,!0);let sh;function IR(){sh=void 0}const ks={now:()=>(sh===void 0&&ks.set(hs.isProcessing||Oa.useManualTiming?hs.timestamp:performance.now()),sh),set
vendor: 4,145 bytes, line 9
9:e=>{sh=e,queueMicrotask(IR)}},F4=e=>t=>typeof t=="string"&&t.startsWith(e),G4=F4("--"),$R=F4("var(--"),qx=e=>$R(e)?UR.test(e.split("/*")[0].trim()):!1,UR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function w2(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const sl={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Pc={...sl,transform:e=>ra(0,1,e)},Cu={...sl,default:1},jc=e=>Math.round(e*1e5)/1e5,Vx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function HR(e){return e==null}const qR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zx=(e,t)=>s=>!!(typeof s=="string"&&qR.test(s)&&s.startsWith(e)||t&&!HR(s)&&Object.prototype.hasOwnProperty.call(s,t)),K4=(e,t,s)=>r=>{if(typeof r!="string")return r;const[o,c,d,h]=r.match(Vx);return{[e]:parseFloat(o),[t]:parseFloat(c),[s]:parseFloat(d),alpha:h!==void 0?parseFloat(h):1}},VR=e=>ra(0,255,e),Km={...sl,transform:e=>Math.round(VR(e))},hi={test:zx("rgb","red"),parse:K4("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:r=1})=>"rgba("+Km.transform(e)+", "+Km.transform(t)+", "+Km.transform(s)+", "+jc(Pc.transform(r))+")"};function zR(e){let t="",s="",r="",o="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,s+=s,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ig={test:zx("#"),parse:zR,transform:hi.transform},sd=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ur=sd("deg"),sa=sd("%"),we=sd("px"),FR=sd("vh"),GR=sd("vw"),j2={...sa,parse:e=>sa.parse(e)/100,transform:e=>sa.transform(e*100)},To={test:zx("hsl","hue"),parse:K4("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:r=1})=>"hsla("+Math.round(e)+", "+sa.transform(jc(t))+", "+sa.transform(jc(s))+", "+jc(Pc.transform(r))+")"},Ht={test:e=>hi.test(e)||ig.test(e)||To.test(e),parse:e=>hi.test(e)?hi.parse(e):To.test(e)?To.parse(e):ig.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?hi.transform(e):To.transform(e),getAnimatableNone:e=>{const t=Ht.parse(e);return t.alpha=0,Ht.transform(t)}},KR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function WR(e){return isNaN(e)&&typeof e=="string"&&(e.match(Vx)?.length||0)+(e.match(KR)?.length||0)>0}const W4="number",Y4="color",YR="var",QR="var(",k2="${}",ZR=/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 Mc(e){const t=e.toString(),s=[],r={color:[],number:[],var:[]},o=[];let c=0;const h=t.replace(ZR,p=>(Ht.test(p)?(r.color.push(c),o.push(Y4),s.push(Ht.parse(p))):p.startsWith(QR)?(r.var.push(c),o.push(YR),s.push(p)):(r.number.push(c),o.push(W4),s.push(parseFloat(p))),++c,k2)).split(k2);return{values:s,split:h,indexes:r,types:o}}function Q4(e){return Mc(e).values}function Z4(e){const{split:t,types:s}=Mc(e),r=t.length;return o=>{let c="";for(let d=0;d<r;d++)if(c+=t[d],o[d]!==void 0){const h=s[d];h===W4?c+=jc(o[d]):h===Y4?c+=Ht.transform(o[d]):c+=o[d]}return c}}const XR=e=>typeof e=="number"?0:Ht.test(e)?Ht.getAnimatableNone(e):e;function JR(e){const t=Q4(e);return Z4(e)(t.map(XR))}const Dn={test:WR,parse:Q4,createTransformer:Z4,getAnimatableNone:JR};function Wm(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function eO({hue:e,saturation:t,lightness:s,alpha:r}){e/=360,t/=100,s/=100;let o=0,c=0,d=0;if(!t)o=c=d=s;else{const h=s<.5?s*(1+t):s+t-s*t,p=2*s-h;o=Wm(p,h,e+1/3),c=Wm(p,h,e),d=Wm(p,h,e-1/3)}return{red:Math.round(o*255),green:Math.round(c*255),blue:Math.round(d*255),alpha:r}}function jh(e,t){return s=>s>0?t:e}const _t=(e,t,s)=>e+(t-e)*s,Ym=(e,t,s)=>{const r=e*e,o=s*(t*t-r)+r;return o<0?0:Math.sqrt(o)},tO=[ig,hi,To],sO=e=>
9tO.find(t=>t.test(e));function _2(e){const t=sO(e);if(!t)return!1;let s=t.parse(e);return t===To&&(s=eO(s)),s}const S2=(e,t)=>{const s=_2(e),r=_2(t);if(!s||!r)return jh(e,t);const o={...s};return c=>(o.red=Ym(s.red,r.red,c),o.green=Ym(s.green,r.green,c),o.blue=Ym(s.blue,r.blue,c),o.alpha=_t(s.alpha,r.alpha,c),hi.transform(o))},og=new Set(["none","hidden"]);function nO(e,t){return og.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function aO(e,t){return s=>_t(e,t,s)}function Fx(e){return typeof e=="number"?aO:typeof e=="string"?qx(e)?jh:Ht.test(e)?S2:oO:Array.isArray(e)?X4:typeof e=="object"?Ht.test(e)?S2:rO:jh}function X4(e,t){const s=[...e],r=s.length,o=e.map((c,d)=>Fx(c)(c,t[d]));return c=>{for(let d=0;d<r;d++)s[d]=o[d](c);return s}}function rO(e,t){const s={...e,...t},r={};for(const o in s)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Fx(e[o])(e[o],t[o]));return o=>{for(const c in r)s[c]=r[c](o);return s}}function iO(e,t){const s=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const c=t.types[o],d=e.indexes[c][r[c]],h=e.values[d]??0;s[o]=h,r[c]++}return s}const oO=(e,t)=>{const s=Dn.createTransformer(t),r=Mc(e),o=Mc(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?og.has(e)&&!o.values.length||og.has(t)&&!r.values.length?nO(e,t):ed(X4(iO(r,o),o.values),s):jh(e,t)};function J4(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?_t(e,t,s):Fx(e)(e,t)}const lO=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>vt.update(t,s),stop:()=>Cr(t),now:()=>hs.isProcessing?hs.timestamp:ks.now()}},e_=(e,t,s=10)=>{let r="";const o=Math.max(Math.round(t/s),2);for(let c=0;c<o;c++)r+=Math.round(e(c/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},kh=2e4;function Gx(e){let t=0;const s=50;let r=e.next(t);for(;!r.done&&t<kh;)t+=s,r=e.next(t);return t>=kh?1/0:t}function t_(e,t=100,s){const r=s({...e,keyframes:[0,t]}),o=Math.min(Gx(r),kh);return{type:"keyframes",ease:c=>r.next(o*c).value/t,duration:vn(o)}}const cO=5;function s_(e,t,s){const r=Math.max(t-cO,0);return R4(s-e(r),t-r)}const Ot={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},Qm=.001;function dO({duration:e=Ot.duration,bounce:t=Ot.bounce,velocity:s=Ot.velocity,mass:r=Ot.mass}){let o,c,d=1-t;d=ra(Ot.minDamping,Ot.maxDamping,d),e=ra(Ot.minDuration,Ot.maxDuration,vn(e)),d<1?(o=f=>{const m=f*d,x=m*e,y=m-s,v=lg(f,d),j=Math.exp(-x);return Qm-y/v*j},c=f=>{const x=f*d*e,y=x*s+s,v=Math.pow(d,2)*Math.pow(f,2)*e,j=Math.exp(-x),k=lg(Math.pow(f,2),d);return(-o(f)+Qm>0?-1:1)*((y-v)*j)/k}):(o=f=>{const m=Math.exp(-f*e),x=(f-s)*e+1;return-Qm+m*x},c=f=>{const m=Math.exp(-f*e),x=(s-f)*(e*e);return m*x});const h=5/e,p=hO(o,c,h);if(e=jn(e),isNaN(p))return{stiffness:Ot.stiffness,damping:Ot.damping,duration:e};{const f=Math.pow(p,2)*r;return{stiffness:f,damping:d*2*Math.sqrt(r*f),duration:e}}}const uO=12;function hO(e,t,s){let r=s;for(let o=1;o<uO;o++)r=r-e(r)/t(r);return r}function lg(e,t){return e*Math.sqrt(1-t*t)}const pO=["duration","bounce"],fO=["stiffness","damping","mass"];function N2(e,t){return t.some(s=>e[s]!==void 0)}function mO(e){let t={velocity:Ot.velocity,stiffness:Ot.stiffness,damping:Ot.damping,mass:Ot.mass,isResolvedFromDuration:!1,...e};if(!N2(e,fO)&&N2(e,pO))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,r=2*Math.PI/(s*1.2),o=r*r,c=2*ra(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ot.mass,stiffness:o,damping:c}}else{const s=dO({...e,velocity:0});t={...t,...s,mass:Ot.mass},t.isResolvedFromDuration=!0}return t}function Lc(e=Ot.visualDuration,t=Ot.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=s;const c=s.keyframes[0],d=s.keyframes[s.keyframes.length-1],h={done:!1,value:c},{stiffness:p,damping:f,mass:m,duration:x,velocity:y,isResolvedFromDuration:v}=mO({...s,velocity:-vn(s.velocity||0)}),j=y||0,k=f/(2*Math.sqrt(p*m)),S=d-c,N=vn(Math.sqrt(p/m)),C=Math.abs(S)<5;r||(r=C?Ot.restSpeed.granular:Ot.restSpeed.default),o||(o=C?Ot.restDelta.granular:Ot.restDelta.default);let E;if(k<1){const P=lg(N,k);E=M=>{const B=Math.exp(-k*N*M);return d-B*((j+k*N*S)/P*Math.sin(P*M)+S*Math.cos(P*M))}}else if(k===1)E=P=>d-Math.exp(-N*P)*(S+(j+N*S)*P);else{const P=N*Math.sqrt(k*k-1);E=M=>{const B=Math.exp(-k*N*M),A=Math.min(P*M,300);return d-B*((j+k*N*S)*Math.sinh(A)+P*S*Math.cosh(A))/P}}
9const O={calculatedDuration:v&&x||null,next:P=>{const M=E(P);if(v)h.done=P>=x;else{let B=P===0?j:0;k<1&&(B=P===0?jn(j):s_(E,P,M));const A=Math.abs(B)<=r,L=Math.abs(d-M)<=o;h.done=A&&L}return h.value=h.done?d:M,h},toString:()=>{const P=Math.min(Gx(O),kh),M=e_(B=>O.next(P*B).value,P,30);return P+"ms "+M},toTransition:()=>{}};return O}Lc.applyToOptions=e=>{const t=t_(e,100,Lc);return e.ease=t.ease,e.duration=jn(t.duration),e.type="keyframes",e};function cg({keyframes:e,velocity:t=0,power:s=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:c=500,modifyTarget:d,min:h,max:p,restDelta:f=.5,restSpeed:m}){const x=e[0],y={done:!1,value:x},v=A=>h!==void 0&&A<h||p!==void 0&&A>p,j=A=>h===void 0?p:p===void 0||Math.abs(h-A)<Math.abs(p-A)?h:p;let k=s*t;const S=x+k,N=d===void 0?S:d(S);N!==S&&(k=N-x);const C=A=>-k*Math.exp(-A/r),E=A=>N+C(A),O=A=>{const L=C(A),U=E(A);y.done=Math.abs(L)<=f,y.value=y.done?N:U};let P,M;const B=A=>{v(y.value)&&(P=A,M=Lc({keyframes:[y.value,j(y.value)],velocity:s_(E,A,y.value),damping:o,stiffness:c,restDelta:f,restSpeed:m}))};return B(0),{calculatedDuration:null,next:A=>{let L=!1;return!M&&P===void 0&&(L=!0,O(A),B(A)),P!==void 0&&A>=P?M.next(A-P):(!L&&O(A),y)}}}function gO(e,t,s){const r=[],o=s||Oa.mix||J4,c=e.length-1;for(let d=0;d<c;d++){let h=o(e[d],e[d+1]);if(t){const p=Array.isArray(t)?t[d]||wn:t;h=ed(p,h)}r.push(h)}return r}function xO(e,t,{clamp:s=!0,ease:r,mixer:o}={}){const c=e.length;if(Ix(c===t.length),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const d=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const h=gO(t,r,o),p=h.length,f=m=>{if(d&&m<e[0])return t[0];let x=0;if(p>1)for(;x<e.length-2&&!(m<e[x+1]);x++);const y=Vo(e[x],e[x+1],m);return h[x](y)};return s?m=>f(ra(e[0],e[c-1],m)):f}function n_(e,t){const s=e[e.length-1];for(let r=1;r<=t;r++){const o=Vo(0,t,r);e.push(_t(s,1,o))}}function a_(e){const t=[0];return n_(t,e.length-1),t}function yO(e,t){return e.map(s=>s*t)}function bO(e,t){return e.map(()=>t||U4).splice(0,e.length-1)}function kc({duration:e=300,keyframes:t,times:s,ease:r="easeInOut"}){const o=H4(r)?r.map(v2):v2(r),c={done:!1,value:t[0]},d=yO(s&&s.length===t.length?s:a_(t),e),h=xO(d,t,{ease:Array.isArray(o)?o:bO(t,o)});return{calculatedDuration:e,next:p=>(c.value=h(p),c.done=p>=e,c)}}const vO=e=>e!==null;function Kx(e,{repeat:t,repeatType:s="loop"},r,o=1){const c=e.filter(vO),h=o<0||t&&s!=="loop"&&t%2===1?0:c.length-1;return!h||r===void 0?c[h]:r}const wO={decay:cg,inertia:cg,tween:kc,keyframes:kc,spring:Lc};function r_(e){typeof e.type=="string"&&(e.type=wO[e.type])}class Wx{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const jO=e=>e/100;class Yx extends Wx{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==ks.now()&&this.tick(ks.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;r_(t);const{type:s=kc,repeat:r=0,repeatDelay:o=0,repeatType:c,velocity:d=0}=t;let{keyframes:h}=t;const p=s||kc;p!==kc&&typeof h[0]!="number"&&(this.mixKeyframes=ed(jO,J4(h[0],h[1])),h=[0,100]);const f=p({...t,keyframes:h});c==="mirror"&&(this.mirroredGenerator=p({...t,keyframes:[...h].reverse(),velocity:-d})),f.calculatedDuration===null&&(f.calculatedDuration=Gx(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=f}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:r,totalDuration:o,mixKeyframes:c,mirroredGenerator:d,resolvedDuration:h,calculatedDuration:p}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:m,repeat:x,repeatType:y,repeatDelay:v,type:j,onUpdate:k,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const N=this.currentTime-f*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?N<0:N>o;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let E=this.currentTime,O=r;if(x){const A=Math.min(this.currentTime,o)/h;let L=Math.floor(A),U=A%1;!U&&A>=1&&(U=1),U===1&&L--,L=Math.min(L,x+1),L%2&&(y==="reverse"?(U=1-U,v&&(U-=v/h)):y==="mirror"&&(O=d)),E=ra(0,1,U)*h}const P=C?{done:!1,value:m[0]}:O.next(E);c&&!C&&(P.value=c(P.value));let{done:M}=P;!C&&p!==null&&(M=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return B&&j!==cg&&(P.value=Kx(m,this.options,S,this.speed)),k&&k(P.value),B&&this.finish(),P}then(t,s){return this.finished.then(t,s)}get duration(){return vn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+vn(t)}get time(){return vn(this.currentTime)}set time(t){t=jn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(ks.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=vn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=lO,startTime:s}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s??r),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(ks.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}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function kO(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const pi=e=>e*180/Math.PI,dg=e=>{const t=pi(Math.atan2(e[1],e[0]));return ug(t)},_O={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dg,rotateZ:dg,skewX:e=>pi(Math.atan(e[1])),skewY:e=>pi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ug=e=>(e=e%360,e<0&&(e+=360),e),C2=dg,E2=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),T2=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),SO={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:E2,scaleY:T2,scale:e=>(E2(e)+T2(e))/2,rotateX:e=>ug(pi(Math.atan2(e[6],e[5]))),rotateY:e=>ug(pi(Math.atan2(-e[2],e[0]))),rotateZ:C2,rotate:C2,skewX:e=>pi(Math.atan(e[4])),skewY:e=>pi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hg(e){return e.includes("scale")?1:0}function pg(e,t){if(!e||e==="none")return hg(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(s)r=SO,o=s;else{const h=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_O,o=h}if(!o)return hg(t);const c=r[t],d=o[1].split(",").map(CO);return typeof c=="function"?c(d):d[c]}const NO=(e,t)=>
9{const{transform:s="none"}=getComputedStyle(e);return pg(s,t)};function CO(e){return parseFloat(e.trim())}const nl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],al=new Set(nl),A2=e=>e===sl||e===we,EO=new Set(["x","y","z"]),TO=nl.filter(e=>!EO.has(e));function AO(e){const t=[];return TO.forEach(s=>{const r=e.getValue(s);r!==void 0&&(t.push([s,r.get()]),r.set(s.startsWith("scale")?1:0))}),t}const xr={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),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})=>pg(t,"x"),y:(e,{transform:t})=>pg(t,"y")};xr.translateX=xr.x;xr.translateY=xr.y;const mi=new Set;let fg=!1,mg=!1,gg=!1;function i_(){if(mg){const e=Array.from(mi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),s=new Map;t.forEach(r=>{const o=AO(r);o.length&&(s.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=s.get(r);o&&o.forEach(([c,d])=>{r.getValue(c)?.set(d)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}mg=!1,fg=!1,mi.forEach(e=>e.complete(gg)),mi.clear()}function o_(){mi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(mg=!0)})}function RO(){gg=!0,o_(),i_(),gg=!1}class Qx{constructor(t,s,r,o,c,d=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=r,this.motionValue=o,this.element=c,this.isAsync=d}scheduleResolve(){this.state="scheduled",this.isAsync?(mi.add(this),fg||(fg=!0,vt.read(o_),vt.resolveKeyframes(i_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:r,motionValue:o}=this;if(t[0]===null){const c=o?.get(),d=t[t.length-1];if(c!==void 0)t[0]=c;else if(r&&s){const h=r.readValue(s,d);h!=null&&(t[0]=h)}t[0]===void 0&&(t[0]=d),o&&c===void 0&&o.set(t[0])}kO(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),mi.delete(this)}cancel(){this.state==="scheduled"&&(mi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const OO=e=>e.startsWith("--");function l_(e,t,s){OO(t)?e.style.setProperty(t,s):e.style[t]=s}const PO={};function c_(e,t){const s=A4(e);return()=>PO[t]??s()}const MO=c_(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),d_=c_(()=>{try{document.createElement("div").animate({opacity:0}
9,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),gc=([e,t,s,r])=>`cubic-bezier(${e}, ${t}, ${s}, ${r})`,R2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:gc([0,.65,.55,1]),circOut:gc([.55,0,1,.45]),backIn:gc([.31,.01,.66,-.59]),backOut:gc([.33,1.53,.69,.99])};function u_(e,t){if(e)return typeof e=="function"?d_()?e_(e,t):"ease-out":V4(e)?gc(e):Array.isArray(e)?e.map(s=>u_(s,t)||R2.easeOut):R2[e]}function LO(e,t,s,{delay:r=0,duration:o=300,repeat:c=0,repeatType:d="loop",ease:h="easeOut",times:p}={},f=void 0){const m={[t]:s};p&&(m.offset=p);const x=u_(h,o);Array.isArray(x)&&(m.easing=x);const y={delay:r,duration:o,easing:Array.isArray(x)?"linear":x,fill:"both",iterations:c+1,direction:d==="reverse"?"alternate":"normal"};return f&&(y.pseudoElement=f),e.animate(m,y)}function Zx(e){return typeof e=="function"&&"applyToOptions"in e}function DO({type:e,...t}){return Zx(e)&&d_()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class h_ extends Wx{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:r,keyframes:o,pseudoElement:c,allowFlatten:d=!1,finalKeyframe:h,onComplete:p}=t;this.isPseudoElement=!!c,this.allowFlatten=d,this.options=t,Ix(typeof t.type!="string");const f=DO(t);this.animation=LO(s,r,o,f,c),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const m=Kx(o,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(m),l_(s,r,m),this.animation.cancel()}p?.(),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;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return vn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+vn(t)}get time(){return vn(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=jn(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:r,observe:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&MO()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),r&&(this.animation.rangeEnd=r),wn):o(this)}}const p_={anticipate:B4,backInOut:D4,circInOut:$4};function BO(e){return e in p_}function IO(e){typeof e.ease=="string"&&BO(e.ease)&&(e.ease=p_[e.ease])}const Zm=10;class $O extends h_{constructor(t){IO(t),r_(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:r,onComplete:o,element:c,...d}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const h=new Yx({...d,autoplay:!1}),p=Math.max(Zm,ks.now()-this.startTime),f=ra(0,Zm,p-Zm),m=h.sample(p).value,{name:x}=this.options;c&&x&&l_(c,x,m),s.setWithVelocity(h.sample(Math.max(0,p-f)).value,m,f),h.stop()}}const O2=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Dn.test(e)||e==="0")&&!e.startsWith("url("));function UO(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function HO(e,t,s,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const c=e[e.length-1],d=O2(o,t),h=O2(c,t);
9return!d||!h?!1:UO(e)||(s==="spring"||Zx(s))&&r}function xg(e){e.duration=0,e.type="keyframes"}const qO=new Set(["opacity","clipPath","filter","transform"]),VO=A4(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function zO(e){const{motionValue:t,name:s,repeatDelay:r,repeatType:o,damping:c,type:d}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:f}=t.owner.getProps();return VO()&&s&&qO.has(s)&&(s!=="transform"||!f)&&!p&&!r&&o!=="mirror"&&c!==0&&d!=="inertia"}const FO=40;class GO extends Wx{constructor({autoplay:t=!0,delay:s=0,type:r="keyframes",repeat:o=0,repeatDelay:c=0,repeatType:d="loop",keyframes:h,name:p,motionValue:f,element:m,...x}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ks.now();const y={autoplay:t,delay:s,type:r,repeat:o,repeatDelay:c,repeatType:d,name:p,motionValue:f,element:m,...x},v=m?.KeyframeResolver||Qx;this.keyframeResolver=new v(h,(j,k,S)=>this.onKeyframesResolved(j,k,y,!S),p,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,s,r,o){this.keyframeResolver=void 0;const{name:c,type:d,velocity:h,delay:p,isHandoff:f,onUpdate:m}=r;this.resolvedAt=ks.now(),HO(t,c,d,h)||((Oa.instantAnimations||!p)&&m?.(Kx(t,r,s)),t[0]=t[t.length-1],xg(r),r.repeat=0);const y={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>FO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...r,keyframes:t},v=!f&&zO(y),j=y.motionValue?.owner?.current,k=v?new $O({...y,element:j}):new Yx(y);k.finished.then(()=>{this.notifyFinished()}).catch(wn),this.pendingTimeline&&(this.stopTimeline=k.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=k}get finished(){return this._animation?this.animation.finished:this._finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),RO()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class KO{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,s){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=s}attachTimeline(t){const s=this.animations.map(r=>r.attachTimeline(t));return()=>{s.forEach((r,o)=>{r&&r(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return P2(this.animations,"duration")}get iterationDuration(){return P2(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(s=>s[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function P2(e,t){let s=0;for(let r=0;r<e.length;r++){const o=e[r][t];o!==null&&o>s&&(s=o)}return s}class WO extends KO{then(t,s){return this.finished.finally(t).then(()=>{})}}function f_(e,t,s,r=0,o=1){const c=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),d=e.size,h=(d-1)*r;return typeof s=="function"?s(c,d):o===1?c*r:h-c*r}const YO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function QO(e){const t=YO.exec(e);if(!t)return[,];const[,s,r,o]=t;return[`--${s??r}`,o]}function m_(e,t,s=1){const[r,o]=QO(e);if(!r)return;const c=window.getComputedStyle(t).getPropertyValue(r);if(c){const d=c.trim();return C4(d)?parseFloat(d):d}return qx(o)?m_(o,t,s+1):o}const ZO={type:"spring",stiffness:500,damping:25,restSpeed:10},XO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),JO={type:"keyframes",duration:.8},eP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tP=(e,{keyframes:t})=>t.length>2?JO:al.has(e)?e.startsWith("scale")?XO(t[1]):ZO:eP,sP=e=>e!==null;function nP(e,{repeat:t,repeatType:s="loop"},r){const o=e.filter(sP),c=t&&s!=="loop"&&t%2===1?0:o.length-1;return o[c]}function g_(e,t){if(e?.inherit&&t){const{inherit:s,...r}=e;return{...t,...r}}return e}function Xx(e,t){const s=e?.[t]??e?.default??e;return s!==e?g_(s,e):s}function aP({when:e,delay:t,delayChildren:s,staggerChildren:r,staggerDirection:o,repeat:c,repeatType:d,repeatDelay:h,from:p,elapsed:f,...m}){return!!Object.keys(m).length}const Jx=(e,t,s,r={},o,c)=>d=>{const h=Xx(r,e)||{},p=h.delay||r.delay||0;let{elapsed:f=0}=r;f=f-jn(p);const m={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...h,delay:-f,onUpdate:y=>{t.set(y),h.onUpdate&&h.onUpdate(y)},onComplete:()=>{d(),h.onComplete&&h.onComplete()},name:e,motionValue:t,element:c?void 0:o};aP(h)||Object.assign(m,tP(e,m)),m.duration&&(m.duration=jn(m.duration)),m.repeatDelay&&(m.repeatDelay=jn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let x=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(xg(m),m.delay===0&&(x=!0)),(Oa.instantAnimations||Oa.skipAnimations||o?.shouldSkipAnimations)&&(x=!0,xg(m),m.delay=0),m.allowFlatten=!h.type&&!h.ease,x&&!c&&t.get()!==void 0){const y=nP(m.keyframes,h);if(y!==void 0){vt.update(()=>{m.onUpdate(y),m.onComplete()});return}}return h.isSync?new Yx(m):new GO(m)};function M2(e){const t=[{},{}];
9return e?.values.forEach((s,r)=>{t[0][r]=s.get(),t[1][r]=s.getVelocity()}),t}function ey(e,t,s,r){if(typeof t=="function"){const[o,c]=M2(r);t=t(s!==void 0?s:e.custom,o,c)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,c]=M2(r);t=t(s!==void 0?s:e.custom,o,c)}return t}function Bo(e,t,s){const r=e.getProps();return ey(r,t,s!==void 0?s:r.custom,e)}const x_=new Set(["width","height","top","left","right","bottom",...nl]),L2=30,rP=e=>!isNaN(parseFloat(e));class iP{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=ks.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=ks.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=rP(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new $x);const r=this.events[t].add(s);return t==="change"?()=>{r(),vt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,r){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ks.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>L2)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,L2);return R4(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),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 wi(e,t){return new iP(e,t)}const yg=e=>Array.isArray(e);function oP(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,wi(s))}function lP(e){return yg(e)?e[e.length-1]||0:e}function ty(e,t){const s=Bo(e,t);let{transitionEnd:r={},transition:o={},...c}=s||{};c={...c,...r};for(const d in c){const h=lP(c[d]);oP(e,d,h)}}const ns=e=>!!(e&&e.getVelocity);function cP(e){return!!(ns(e)&&e.add)}function bg(e,t){const s=e.getValue("willChange");if(cP(s))return s.add(t);if(!s&&Oa.WillChange){const r=new Oa.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function sy(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const dP="framerAppearId",y_="data-"+sy(dP);function b_(e){return e.props[y_]}function uP({protectedKeys:e,needsAnimating:t},s){const r=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,r}function ny(e,t,{delay:s=0,transitionOverride:r,type:o}={}){let{transition:c,transitionEnd:d,...h}=t;const p=e.getDefaultTransition();c=c?g_(c,p):p;const f=c?.reduceMotion;r&&(c=r);const m=[],x=o&&e.animationState&&e.animationState.getState()[o];for(const y in h){const v=e.getValue(y,e.latestValues[y]??null),j=h[y];if(j===void 0||x&&uP(x,y))continue;const k={delay:s,...Xx(c||{},y)},S=v.get();if(S!==void 0&&!v.isAnimating&&!Array.isArray(j)&&j===S&&!k.velocity)continue;let N=!1;if(window.MotionHandoffAnimation){const O=b_(e);if(O){const P=window.MotionHandoffAnimation(O,y,vt);P!==null&&(k.startTime=P,N=!0)}}bg(e,y);const C=f??e.shouldReduceMotion;
9v.start(Jx(y,v,j,C&&x_.has(y)?{type:!1}:k,e,N));const E=v.animation;E&&m.push(E)}if(d){const y=()=>vt.update(()=>{d&&ty(e,d)});m.length?Promise.all(m).then(y):y()}return m}function vg(e,t,s={}){const r=Bo(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};s.transitionOverride&&(o=s.transitionOverride);const c=r?()=>Promise.all(ny(e,r,s)):()=>Promise.resolve(),d=e.variantChildren&&e.variantChildren.size?(p=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:x}=o;return hP(e,t,p,f,m,x,s)}:()=>Promise.resolve(),{when:h}=o;if(h){const[p,f]=h==="beforeChildren"?[c,d]:[d,c];return p().then(()=>f())}else return Promise.all([c(),d(s.delay)])}function hP(e,t,s=0,r=0,o=0,c=1,d){const h=[];for(const p of e.variantChildren)p.notify("AnimationStart",t),h.push(vg(p,t,{...d,delay:s+(typeof r=="function"?0:r)+f_(e.variantChildren,p,r,o,c)}).then(()=>p.notify("AnimationComplete",t)));return Promise.all(h)}function v_(e,t,s={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(c=>vg(e,c,s));r=Promise.all(o)}else if(typeof t=="string")r=vg(e,t,s);else{const o=typeof t=="function"?Bo(e,t,s.custom):t;r=Promise.all(ny(e,o,s))}return r.then(()=>{e.notify("AnimationComplete",t)})}const pP={test:e=>e==="auto",parse:e=>e},w_=e=>t=>t.test(e),j_=[sl,we,sa,ur,GR,FR,pP],D2=e=>j_.find(w_(e));function fP(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||T4(e):!0}const mP=new Set(["brightness","contrast","saturate","opacity"]);function gP(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=s.match(Vx)||[];if(!r)return e;const o=s.replace(r,"");let c=mP.has(t)?1:0;return r!==s&&(c*=100),t+"("+c+o+")"}const xP=/\b([a-z-]*)\(.*?\)/gu,wg={...Dn,getAnimatableNone:e=>{const t=e.match(xP);return t?t.map(gP).join(" "):e}},jg={...Dn,getAnimatableNone:e=>{const t=Dn.parse(e);return Dn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},B2={...sl,transform:Math.round},yP={rotate:ur,rotateX:ur,rotateY:ur,rotateZ:ur,scale:Cu,scaleX:Cu,scaleY:Cu,scaleZ:Cu,skew:ur,skewX:ur,skewY:ur,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:Pc,originX:j2,originY:j2,originZ:we},ay={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,inset:we,insetBlock:we,insetBlockStart:we,insetBlockEnd:we,insetInline:we,insetInlineStart:we,insetInlineEnd:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,paddingBlock:we,paddingBlockStart:we,paddingBlockEnd:we,paddingInline:we,paddingInlineStart:we,paddingInlineEnd:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,marginBlock:we,marginBlockStart:we,marginBlockEnd:we,marginInline:we,marginInlineStart:we,marginInlineEnd:we,fontSize:we,backgroundPositionX:we,backgroundPositionY:we,...yP,zIndex:B2,fillOpacity:Pc,strokeOpacity:Pc,numOctaves:B2},bP={...ay,color:Ht,backgroundColor:Ht,outlineColor:Ht,fill:Ht,stroke:Ht,borderColor:Ht,borderTopColor:Ht,borderRightColor:Ht,borderBottomColor:Ht,borderLeftColor:Ht,filter:wg,WebkitFilter:wg,mask:jg,WebkitMask:jg},k_=e=>bP[e],vP=new Set([wg,jg]);function __(e,t){let s=k_(e);return vP.has(s)||(s=Dn),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const wP=new Set(["auto","none","0"]);function jP(e,t,s){let r=0,o;for(;r<e.length&&!o;){const c=e[r];typeof c=="string"&&!wP.has(c)&&Mc(c).values.length&&(o=e[r]),r++}if(o&&s)for(const c of t)e[c]=__(s,o)}class kP extends Qx{constructor(t,s,r,o,c){super(t,s,r,o,c,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:r}=this;if(!s||!s.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let x=t[m];if(typeof x=="string"&&(x=x.trim(),qx(x))){const y=m_(x,s.current);y!==void 0&&(t[m]=y),m===t.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!x_.has(r)||t.length!==2)return;const[o,c]=t,d=D2(o),h=D2(c),p=w2(o),f=w2(c);if(p!==f&&xr[r]){this.needsMeasurement=!0;return}if(d!==h)if(A2(d)&&A2(h))for(let m=0;m<t.length;m++){const x=t[m];
9typeof x=="string"&&(t[m]=parseFloat(x))}else xr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||fP(t[o]))&&r.push(o);r.length&&jP(t,r,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const o=s[s.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:s,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(s);o&&o.jump(this.measuredOrigin,!1);const c=r.length-1,d=r[c];r[c]=xr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),d!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=d),this.removedTransforms?.length&&this.removedTransforms.forEach(([h,p])=>{t.getValue(h).set(p)}),this.resolveNoneKeyframes()}}const _P=new Set(["opacity","clipPath","filter","transform"]);function ip(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const o=s?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const S_=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function kg(e){return E4(e)&&"offsetHeight"in e}const{schedule:ry}=z4(queueMicrotask,!1),Pn={x:!1,y:!1};function N_(){return Pn.x||Pn.y}function SP(e){return e==="x"||e==="y"?Pn[e]?null:(Pn[e]=!0,()=>{Pn[e]=!1}):Pn.x||Pn.y?null:(Pn.x=Pn.y=!0,()=>{Pn.x=Pn.y=!1})}function C_(e,t){const s=ip(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[s,o,()=>r.abort()]}function NP(e){return!(e.pointerType==="touch"||N_())}function CP(e,t,s={}){const[r,o,c]=C_(e,s);return r.forEach(d=>{let h=!1,p=!1,f;const m=()=>{d.removeEventListener("pointerleave",j)},x=S=>{f&&(f(S),f=void 0),m()},y=S=>{h=!1,window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),p&&(p=!1,x(S))},v=()=>{h=!0,window.addEventListener("pointerup",y,o),window.addEventListener("pointercancel",y,o)},j=S=>{if(S.pointerType!=="touch"){if(h){p=!0;return}x(S)}},k=S=>{if(!NP(S))return;p=!1;const N=t(d,S);typeof N=="function"&&(f=N,d.addEventListener("pointerleave",j,o))};d.addEventListener("pointerenter",k,o),d.addEventListener("pointerdown",v,o)}),c}const E_=(e,t)=>t?e===t?!0:E_(e,t.parentElement):!1,iy=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,EP=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function TP(e){return EP.has(e.tagName)||e.isContentEditable===!0}const AP=new Set(["INPUT","SELECT","TEXTAREA"]);function RP(e){return AP.has(e.tagName)||e.isContentEditable===!0}const nh=new WeakSet;function I2(e){return t=>{t.key==="Enter"&&e(t)}}function Xm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const OP=(e,t)=>{const s=e.currentTarget;if(!s)return;const r=I2(()=>{if(nh.has(s))return;Xm(s,"down");const o=I2(()=>{Xm(s,"up")}),c=()=>Xm(s,"cancel");s.addEventListener("keyup",o,t),s.addEventListener("blur",c,t)});s.addEventListener("keydown",r,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",r),t)};function $2(e){return iy(e)&&!N_()}const U2=new WeakSet;function PP(e,t,s={}){const[r,o,c]=C_(e,s),d=h=>{const p=h.currentTarget;if(!$2(h)||U2.has(h))return;nh.add(p),s.stopPropagation&&U2.add(h);const f=t(p,h),m=(v,j)=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",y),nh.has(p
9)&&nh.delete(p),$2(v)&&typeof f=="function"&&f(v,{success:j})},x=v=>{m(v,p===window||p===document||s.useGlobalTarget||E_(p,v.target))},y=v=>{m(v,!1)};window.addEventListener("pointerup",x,o),window.addEventListener("pointercancel",y,o)};return r.forEach(h=>{(s.useGlobalTarget?window:h).addEventListener("pointerdown",d,o),kg(h)&&(h.addEventListener("focus",f=>OP(f,o)),!TP(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),c}function op(e){return E4(e)&&"ownerSVGElement"in e}const ah=new WeakMap;let rh;const T_=(e,t,s)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:op(r)&&"getBBox"in r?r.getBBox()[t]:r[s],MP=T_("inline","width","offsetWidth"),LP=T_("block","height","offsetHeight");function DP({target:e,borderBoxSize:t}){ah.get(e)?.forEach(s=>{s(e,{get width(){return MP(e,t)},get height(){return LP(e,t)}})})}function BP(e){e.forEach(DP)}function IP(){typeof ResizeObserver>"u"||(rh=new ResizeObserver(BP))}function $P(e,t){rh||IP();const s=ip(e);return s.forEach(r=>{let o=ah.get(r);o||(o=new Set,ah.set(r,o)),o.add(t),rh?.observe(r)}),()=>{s.forEach(r=>{const o=ah.get(r);o?.delete(t),o?.size||rh?.unobserve(r)})}}const ih=new Set;let Ao;function UP(){Ao=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ih.forEach(t=>t(e))},window.addEventListener("resize",Ao)}function HP(e){return ih.add(e),Ao||UP(),()=>{ih.delete(e),!ih.size&&typeof Ao=="function"&&(window.removeEventListener("resize",Ao),Ao=void 0)}}function H2(e,t){return typeof e=="function"?HP(e):$P(e,t)}function A_(e){return op(e)&&e.tagName==="svg"}const qP=[...j_,Ht,Dn],VP=e=>qP.find(w_(e)),q2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ro=()=>({x:q2(),y:q2()}),V2=()=>({min:0,max:0}),$t=()=>({x:V2(),y:V2()}),Dc=new WeakMap;function lp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Bc(e){return typeof e=="string"||Array.isArray(e)}const oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ly=["initial",...oy];function cp(e){return lp(e.animate)||ly.some(t=>Bc(e[t]))}function R_(e){return!!(cp(e)||e.variants)}function zP(e,t,s){for(const r in t){const o=t[r],c=s[r];if(ns(o))e.addValue(r,o);else if(ns(c))e.addValue(r,wi(o,{owner:e}));else if(c!==o)if(e.hasValue(r)){const d=e.getValue(r);d.liveStyle===!0?d.jump(o):d.hasAnimated||d.set(o)}else{const d=e.getStaticValue(r);e.addValue(r,wi(d!==void 0?d:o,{owner:e}))}}for(const r in s)t[r]===void 0&&e.removeValue(r);return t}const _g={current:null},O_={current:!1},FP=typeof window<"u";function GP(){if(O_.current=!0,!!FP)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_g.current=e.matches;e.addEventListener("change",t),t()}else _g.current=!1}const z2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let _h={};function P_(e){_h=e}function KP(){return _h}class M_{scrapeMotionValuesFromProps(t,s,r){return{}}constructor({parent:t,props:s,presenceContext:r,reducedMotionConfig:o,skipAnimations:c,blockInitialAnimation:d,visualState:h},p={}){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=Qx,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=()=>{const v=ks.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,vt.render(this.render,!1,!0))};const{latestValues:f,renderState:m}=h;this.latestValues=f,this.baseTarget={...f},this.initialValues=s.initial?{...f}:{},this.renderState=m,this.parent=t,this.props=s,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=c,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=cp(s),this.isVariantNode=R_(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:x,...y}=this.scrapeMotionValuesFromProps(s,{},this);for(const v in y){const j=y[v];f[v]!==void 0&&ns(j)&&j.set(f[v])}}mount(t){if(this.hasBeenMounted)for(const s in this.initialValues)this.values.get(s)?.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,Dc.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
9h((s,r)=>this.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(O_.current||GP(),this.shouldReduceMotion=_g.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(),Cr(this.notifyUpdate),Cr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&_P.has(t)&&this.current instanceof HTMLElement){const{factory:d,keyframes:h,times:p,ease:f,duration:m}=s.accelerate,x=new h_({element:this.current,name:t,keyframes:h,times:p,ease:f,duration:jn(m)}),y=d(x);this.valueSubscriptions.set(t,()=>{y(),x.cancel()});return}const r=al.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=s.on("change",d=>{this.latestValues[t]=d,this.props.onUpdate&&vt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let c;typeof window<"u"&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{o(),c&&c(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in _h){const s=_h[t];if(!s)continue;const{isEnabled:r,Feature:o}=s;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const c=this.features[t];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$t()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let r=0;r<z2.length;r++){const o=z2[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const c="on"+o,d=t[c];d&&(this.propEventSubscriptions[o]=this.on(o,d))}this.prevMotionValues=zP(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const r=this.values.get(t);s!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&s!==void 0&&(r=wi(s===null?void 0:s,{owner:this}),this.addValue(t,r)),r}readValue(t,s){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(C4(r)||T4(r))?r=parseFloat(r):!VP(r)&&Dn.test(s)&&(r=__(t,s)),this.setBaseTarget(t,ns(r)?r.get():r)),ns(r)?r.get():r}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){const{initial:s}=this.props;let r;if(typeof s=="string"||typeof s=="object"){const c=ey(this.props,s,this.presenceContext?.custom);c&&(r=c[t])}if(s&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!ns(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new $x),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){ry.render(this.render)}}class L_ extends M_{constructor(){super(...arguments),this.KeyframeResolver=kP}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const r=t.style;return r?r[s]:void 0}removeValueFromRenderState(t,{vars:s,style:r}){delete s[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ns(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Or{constructor(t){this.isMounted=!1,this.node=t}update(){}}function D_({top:e,left:t,right:s,bottom:r}){return{x:{min:t,max:s},y:{min:e,max:r}}}function WP({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function YP(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:r.y,right:r.x}}function Jm(e){return e===void 0||e===1}function Sg({scale:e,scaleX:t,scaleY:s}){return!Jm(e)||!Jm(t)||!Jm(s)}function li(e){return Sg(e)||B_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function B_(e){return F2(e.x)||F2(e.y)}function F2(e){return e&&e!=="0%"}function Sh(e,t,s){const r=e-s,o=t*r;return s+o}function G2(e,t,s,r,o){return o!==void 0&&(e=Sh(e,o,r)),Sh(e,s,r)+t}function Ng(e,t=0,s=1,r,o){e.min=G2(e.min,t,s,r,o),e.max=G2(e.max,t,s,r,o)}function I_(e,{x:t,y:s}){Ng(e.x,t.translate,t.scale,t.originPoint),Ng(e.y,s.translate,s.scale,s.originPoint)}const K2=.999999999999,W2=1.0000000000001;function QP(e,t,s,r=!1){const o=s.length;if(!o)return;t.x=t.y=1;let c,d;for(let h=0;h<o;h++){c=s[h],d=c.projectionDelta;const{visualElement:p}=c.options;p&&p.props.style&&p.props.style.display==="contents"||(r&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Po(e,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),d&&(t.x*=d.x.scale,t.y*=d.y.scale,I_(e,d)),r&&li(c.latestValues)&&Po(e,c.latestValues))}t.x<W2&&t.x>K2&&(t.x=1),t.y<W2&&t.y>K2&&(t.y=1)}function Oo(e,t){e.min=e.min+t,e.max=e.max+t}function Y2(e,t,s,r,o=.5){const c=_t(e.min,e.max,o);Ng(e,t,s,c,r)}function Q2(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Po(e,t){Y2(e.x,Q2(t.x,e.x),t.scaleX,t.scale,t.originX),Y2(e.y,Q2(t.y,e.y),t.scaleY,t.scale,t.originY)}function $_(e,t){return D_(YP(e.getBoundingClientRect(),t))}
9function ZP(e,t,s){const r=$_(e,s),{scroll:o}=t;return o&&(Oo(r.x,o.offset.x),Oo(r.y,o.offset.y)),r}const XP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JP=nl.length;function eM(e,t,s){let r="",o=!0;for(let c=0;c<JP;c++){const d=nl[c],h=e[d];if(h===void 0)continue;let p=!0;if(typeof h=="number")p=h===(d.startsWith("scale")?1:0);else{const f=parseFloat(h);p=d.startsWith("scale")?f===1:f===0}if(!p||s){const f=S_(h,ay[d]);if(!p){o=!1;const m=XP[d]||d;r+=`${m}(${f}) `}s&&(t[d]=f)}}return r=r.trim(),s?r=s(t,o?"":r):o&&(r="none"),r}function cy(e,t,s){const{style:r,vars:o,transformOrigin:c}=e;let d=!1,h=!1;for(const p in t){const f=t[p];if(al.has(p)){d=!0;continue}else if(G4(p)){o[p]=f;continue}else{const m=S_(f,ay[p]);p.startsWith("origin")?(h=!0,c[p]=m):r[p]=m}}if(t.transform||(d||s?r.transform=eM(t,e.transform,s):r.transform&&(r.transform="none")),h){const{originX:p="50%",originY:f="50%",originZ:m=0}=c;r.transformOrigin=`${p} ${f} ${m}`}}function U_(e,{style:t,vars:s},r,o){const c=e.style;let d;for(d in t)c[d]=t[d];o?.applyProjectionStyles(c,r);for(d in s)c.setProperty(d,s[d])}function Z2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const cc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(we.test(e))e=parseFloat(e);else return e;const s=Z2(e,t.target.x),r=Z2(e,t.target.y);return`${s}% ${r}%`}},tM={correct:(e,{treeScale:t,projectionDelta:s})=>{const r=e,o=Dn.parse(e);if(o.length>5)return r;const c=Dn.createTransformer(e),d=typeof o[0]!="number"?1:0,h=s.x.scale*t.x,p=s.y.scale*t.y;o[0+d]/=h,o[1+d]/=p;const f=_t(h,p,.5);return typeof o[2+d]=="number"&&(o[2+d]/=f),typeof o[3+d]=="number"&&(o[3+d]/=f),c(o)}},Cg={borderRadius:{...cc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:cc,borderTopRightRadius:cc,borderBottomLeftRadius:cc,borderBottomRightRadius:cc,boxShadow:tM};function H_(e,{layout:t,layoutId:s}){return al.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!Cg[e]||e==="opacity")}function dy(e,t,s){const r=e.style,o=t?.style,c={};if(!r)return c;for(const d in r)(ns(r[d])||o&&ns(o[d])||H_(d,e)||s?.getValue(d)?.liveStyle!==void 0)&&(c[d]=r[d]);return c}function sM(e){return window.getComputedStyle(e)}class q_ extends L_{constructor(){super(...arguments),this.type="html",this.renderInstance=U_}readValueFromInstance(t,s){if(al.has(s))return this.projection?.isProjecting?hg(s):NO(t,s);{const r=sM(t),o=(G4(s)?r.getPropertyValue(s):r[s])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:s}){return $_(t,s)}build(t,s,r){cy(t,s,r.transformTemplate)}scrapeMotionValuesFromProps(t,s,r){return dy(t,s,r)}}function nM(e,t){return e in t}class aM extends M_{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,s){if(nM(s,t)){const r=t[s];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,s){delete s.output[t]}measureInstanceViewportBox(){return $t()}build(t,s){Object.assign(t.output,s)}renderInstance(t,{output:s}){Object.assign(t,s)}sortInstanceNodePosition(){return 0}}const rM={offset:"stroke-dashoffset",array:"stroke-dasharray"},iM={offset:"strokeDashoffset",array:"strokeDasharray"};function oM(e,t,s=1,r=0,o=!0){e.pathLength=1;const c=o?rM:iM;e[c.offset]=`${-r}`,e[c.array]=`${t} ${s}`}const lM=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function V_(e,{attrX:t,attrY:s,attrScale:r,pathLength:o,pathSpacing:c=1,pathOffset:d=0,...h},p,f,m){if(cy(e,h,f),p){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:x,style:y}=e;x.transform&&(y.transform=x.transform,delete x.transform),(y.transform||x.transformOrigin)&&(y.transformOrigin=x.transformOrigin??"50% 50%",delete x.transformOrigin),y.transform&&(y.transformBox=m?.transformBox??"fill-box",delete x.transformBox);for(const v of lM)x[v]!==void 0&&(y[v]=x[v],delete x[v]);t!==void 0&&(x.x=t),s!==void 0&&(x.y=s),r!==void 0&&(x.scale=r),o!==void 0&&oM(x,o,c,d,!1)}const z_=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"]),F_=e=>typeof e=="string"&&e.toLowerCase()==="svg";function cM(e,t,s,r){U_(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(z_.has(o)?o:sy(o),t.attrs[o])}function G_(e,t,s){const r=dy(e,t,s);
9for(const o in e)if(ns(e[o])||ns(t[o])){const c=nl.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[c]=e[o]}return r}class K_ extends L_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$t}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(al.has(s)){const r=k_(s);return r&&r.default||0}return s=z_.has(s)?s:sy(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,r){return G_(t,s,r)}build(t,s,r){V_(t,s,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,s,r,o){cM(t,s,r,o)}mount(t){this.isSVGTag=F_(t.tagName),super.mount(t)}}const dM=ly.length;function W_(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?W_(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<dM;s++){const r=ly[s],o=e.props[r];(Bc(o)||o===!1)&&(t[r]=o)}return t}function Y_(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(t[r]!==e[r])return!1;return!0}const uM=[...oy].reverse(),hM=oy.length;function pM(e){return t=>Promise.all(t.map(({animation:s,options:r})=>v_(e,s,r)))}function fM(e){let t=pM(e),s=X2(),r=!0,o=!1;const c=f=>(m,x)=>{const y=Bo(e,x,f==="exit"?e.presenceContext?.custom:void 0);if(y){const{transition:v,transitionEnd:j,...k}=y;m={...m,...k,...j}}return m};function d(f){t=f(e)}function h(f){const{props:m}=e,x=W_(e.parent)||{},y=[],v=new Set;let j={},k=1/0;for(let N=0;N<hM;N++){const C=uM[N],E=s[C],O=m[C]!==void 0?m[C]:x[C],P=Bc(O),M=C===f?E.isActive:null;M===!1&&(k=N);let B=O===x[C]&&O!==m[C]&&P;if(B&&(r||o)&&e.manuallyAnimateOnMount&&(B=!1),E.protectedKeys={...j},!E.isActive&&M===null||!O&&!E.prevProp||lp(O)||typeof O=="boolean")continue;if(C==="exit"&&E.isActive&&M!==!0){E.prevResolvedValues&&(j={...j,...E.prevResolvedValues});continue}const A=mM(E.prevProp,O);let L=A||C===f&&E.isActive&&!B&&P||N>k&&P,U=!1;const K=Array.isArray(O)?O:[O];let G=K.reduce(c(C),{});M===!1&&(G={});const{prevResolvedValues:W={}}=E,ee={...W,...G},te=H=>{L=!0,v.has(H)&&(U=!0,v.delete(H)),E.needsAnimating[H]=!0;const se=e.getValue(H);se&&(se.liveStyle=!1)};for(const H in ee){const se=G[H],R=W[H];if(j.hasOwnProperty(H))continue;let Q=!1;yg(se)&&yg(R)?Q=!Y_(se,R):Q=se!==R,Q?se!=null?te(H):v.add(H):se!==void 0&&v.has(H)?te(H):E.protectedKeys[H]=!0}E.prevProp=O,E.prevResolvedValues=G,E.isActive&&(j={...j,...G}),(r||o)&&e.blockInitialAnimation&&(L=!1);const I=B&&A;L&&(!I||U)&&y.push(...K.map(H=>{const se={type:C};if(typeof H=="string"&&(r||o)&&!I&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,Q=Bo(R,H);if(R.enteringChildren&&Q){const{delayChildren:oe}=Q.transition||{};se.delay=f_(R.enteringChildren,e,oe)}}return{animation:H,options:se}}))}if(v.size){const N={};if(typeof m.initial!="boolean"){const C=Bo(e,Array.isArray(m.initial)?m.initial[0]:m.initial);C&&C.transition&&(N.transition=C.transition)}v.forEach(C=>{const E=e.getBaseTarget(C),O=e.getValue(C);O&&(O.liveStyle=!0),N[C]=E??null}),y.push({animation:N})}let S=!!y.length;return r&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,o=!1,S?t(y):Promise.resolve()}function p(f,m){if(s[f].isActive===m)return Promise.resolve();e.variantChildren?.forEach(y=>y.animationState?.setActive(f,m)),s[f].isActive=m;const x=h(f);for(const y in s)s[y].protectedKeys={};return x}return{animateChanges:h,setActive:p,setAnimateFunction:d,getState:()=>s,reset:()=>{s=X2(),o=!0}}}function mM(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Y_(t,e):!1}function Jr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function X2(){return{animate:Jr(!0),whileInView:Jr(),whileHover:Jr(),whileTap:Jr(),whileDrag:Jr(),whileFocus:Jr(),exit:Jr()}}function J2(e,t){e.min=t.min,e.max=t.max}function Tn(e,t){J2(e.x,t.x),J2(e.y,t.y)}function e5(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Q_=1e-4,gM=1-Q_,xM=1+Q_,Z_=.01,yM=0-Z_,bM=0+Z_;function _s(e){return e.max-e.min}function vM(e,t,s){return Math.abs(e-t)<=s}function t5(e,t,s,r=.5){e.origin=r,e.originPoint=_t(t.min,t.max,e.origin),e.scale=_s(s)/_s(t),e.translate=_t(s.min,s.max,e.origin)-e.originPoint,(e.scale>=gM&&e.scale<=xM||isNaN(e.scale))&&(e.scale=1),(e.translate>=yM&&e.translate<=bM||isNaN(e.translate))&&(e.translate=0)}function _c(e,t,s,r){t5(e.x,t.x,s.x,r?r.originX:void 0),t5(e.y,t.y,s.y,r?r.originY:void 0)}function s5(e,t,s){e.min=s.min+t.min,e.max=e.min+_s(t)}function wM(e,t,s){s5(e.x,t.x,s.x),s5(e.y,t.y,s.y)}function n5(e,t,s){e.min=t.min-s.min,e.max=e.min+_s(t)}function Nh(e,t,s){n5(e.x,t.x,s.x),n5(e.y,t.y,s.y)}function a5(e,t,s,r,o){return e-=t,e=Sh(e,1/s,r),o!==void 0&&(e=Sh(e,1/o,r)),e}function jM(e,t=0,s=1,r=.5,o,c=e,d=e){if(sa.test(t)&&(t=parseFloat(t),t=_t(d.min,d.max,t/100)-d.min),typeof t!="number")return;let h=_t(c.min,c.max,r);e===c&&(h-=t),e.min=a5(e.min,t,s,h,o),e.max=a5(e.max,t,s,h,o)}function r5(e,t,[s,r,o],c,d){jM(e,t[s],t[r],t[o],t.scale,c,d)}const kM=["x","scaleX","originX"],_M=["y","scaleY","originY"];function i5(e,t,s,r){r5(e.x,t,kM,s?s.x:void 0,r?r.x:void 0),r5(e.y,t,_M,s?s.y:void 0,r?r.y:void 0)}function o5(e){return e.translate===0&&e.scale===1}function X_(e){return o5(e.x)&&o5(e.y)}function l5(e,t){return e.min===t.min&&e.max===t.max}function SM(e,t){return l5(e.x,t.x)&&l5(e.y,t.y)}function c5(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function J_(e,t){return c5(e.x,t.x)&&c5(e.y,t.y)}function d5(e){return _s(e.x)/_s(e.y)}function u5(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Zn(e){return[e("x"),e("y")]}function NM(e,t,s){let r="";
9const o=e.x.translate/t.x,c=e.y.translate/t.y,d=s?.z||0;if((o||c||d)&&(r=`translate3d(${o}px, ${c}px, ${d}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:f,rotate:m,rotateX:x,rotateY:y,skewX:v,skewY:j}=s;f&&(r=`perspective(${f}px) ${r}`),m&&(r+=`rotate(${m}deg) `),x&&(r+=`rotateX(${x}deg) `),y&&(r+=`rotateY(${y}deg) `),v&&(r+=`skewX(${v}deg) `),j&&(r+=`skewY(${j}deg) `)}const h=e.x.scale*t.x,p=e.y.scale*t.y;return(h!==1||p!==1)&&(r+=`scale(${h}, ${p})`),r||"none"}const eS=["TopLeft","TopRight","BottomLeft","BottomRight"],CM=eS.length,h5=e=>typeof e=="string"?parseFloat(e):e,p5=e=>typeof e=="number"||we.test(e);function EM(e,t,s,r,o,c){o?(e.opacity=_t(0,s.opacity??1,TM(r)),e.opacityExit=_t(t.opacity??1,0,AM(r))):c&&(e.opacity=_t(t.opacity??1,s.opacity??1,r));for(let d=0;d<CM;d++){const h=`border${eS[d]}Radius`;let p=f5(t,h),f=f5(s,h);if(p===void 0&&f===void 0)continue;p||(p=0),f||(f=0),p===0||f===0||p5(p)===p5(f)?(e[h]=Math.max(_t(h5(p),h5(f),r),0),(sa.test(f)||sa.test(p))&&(e[h]+="%")):e[h]=f}(t.rotate||s.rotate)&&(e.rotate=_t(t.rotate||0,s.rotate||0,r))}function f5(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const TM=tS(0,.5,I4),AM=tS(.5,.95,wn);function tS(e,t,s){return r=>r<e?0:r>t?1:s(Vo(e,t,r))}function sS(e,t,s){const r=ns(e)?e:wi(e);return r.start(Jx("",r,t,s)),r.animation}function Ic(e,t,s,r={passive:!0}){return e.addEventListener(t,s,r),()=>e.removeEventListener(t,s)}const RM=(e,t)=>e.depth-t.depth;class OM{constructor(){this.children=[],this.isDirty=!1}add(t){Bx(this.children,t),this.isDirty=!0}remove(t){qo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(RM),this.isDirty=!1,this.children.forEach(t)}}function PM(e,t){const s=ks.now(),r=({timestamp:o})=>{const c=o-s;c>=t&&(Cr(r),e(c-t))};return vt.setup(r,!0),()=>Cr(r)}function oh(e){return ns(e)?e.get():e}class MM{constructor(){this.members=[]}add(t){Bx(this.members,t);for(let s=this.members.length-1;s>=0;s--){const r=this.members[s];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(qo(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(qo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,s){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:c}=t.options;(o===void 0||o!==c)&&(t.resumeFrom=r,s&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const lh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},e0=["","X","Y","Z"],LM=1e3;let DM=0;function t0(e,t,s,r){const{latestValues:o}=t;o[e]&&(s[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function nS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=b_(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:o,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",vt,!(o||c))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&nS(r)}function aS({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(d={},h=t?.()){this.id=DM++,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=()=>
9{this.projectionUpdateScheduled=!1,this.nodes.forEach($M),this.nodes.forEach(VM),this.nodes.forEach(zM),this.nodes.forEach(UM)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let p=0;p<this.path.length;p++)this.path[p].shouldResetTransform=!0;this.root===this&&(this.nodes=new OM)}addEventListener(d,h){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new $x),this.eventHandlers.get(d).add(h)}notifyListeners(d,...h){const p=this.eventHandlers.get(d);p&&p.notify(...h)}hasListeners(d){return this.eventHandlers.has(d)}mount(d){if(this.instance)return;this.isSVG=op(d)&&!A_(d),this.instance=d;const{layoutId:h,layout:p,visualElement:f}=this.options;if(f&&!f.current&&f.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(p||h)&&(this.isLayoutDirty=!0),e){let m,x=0;const y=()=>this.root.updateBlockedByResize=!1;vt.read(()=>{x=window.innerWidth}),e(d,()=>{const v=window.innerWidth;v!==x&&(x=v,this.root.updateBlockedByResize=!0,m&&m(),m=PM(y,250),lh.hasAnimatedSinceResize&&(lh.hasAnimatedSinceResize=!1,this.nodes.forEach(x5)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&f&&(h||p)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:x,hasRelativeLayoutChanged:y,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||f.getDefaultTransition()||YM,{onLayoutAnimationStart:k,onLayoutAnimationComplete:S}=f.getProps(),N=!this.targetLayout||!J_(this.targetLayout,v),C=!x&&y;if(this.options.layoutRoot||this.resumeFrom||C||x&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const E={...Xx(j,"layout"),onPlay:k,onComplete:S};(f.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E),this.setAnimationOrigin(m,C)}else x||x5(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Cr(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(FM),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&nS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const x=this.path[m];x.shouldResetTransform=!0,x.updateScroll("snapshot"),x.options.layoutRoot&&x.willUpdate(!1)}const{layoutId:h,layout:p}=this.options;if(h===void 0&&!p)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(m5);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(g5);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qM),this.nodes.forEach(BM),this.nodes.forEach(IM)):this.nodes.forEach(g5),this.clearAllSnapshots();const h=ks.now();hs.delta=ra(0,1e3/60,h-hs.timestamp),hs.timestamp=h,hs.isProcessing=!0,Gm.update.process(hs),Gm.preRender.process(hs),Gm.render.process(hs),hs.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ry.read(this.scheduleUpdate))}
9clearAllSnapshots(){this.nodes.forEach(HM),this.sharedNodes.forEach(GM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,vt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_s(this.snapshot.measuredBox.x)&&!_s(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 p=0;p<this.path.length;p++)this.path[p].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=$t(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(h=!1),h&&this.instance){const p=r(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:p,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:p}}}resetTransform(){if(!o)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!X_(this.projectionDelta),p=this.getTransformTemplate(),f=p?p(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;d&&this.instance&&(h||li(this.latestValues)||m)&&(o(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const h=this.measurePageBox();let p=this.removeElementScroll(h);return d&&(p=this.removeTransform(p)),QM(p),{animationId:this.root.animationId,measuredBox:h,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:d}=this.options;if(!d)return $t();const h=d.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ZM))){const{scroll:f}=this.root;f&&(Oo(h.x,f.offset.x),Oo(h.y,f.offset.y))}return h}removeElementScroll(d){const h=$t();if(Tn(h,d),this.scroll?.wasRoot)return h;for(let p=0;p<this.path.length;p++){const f=this.path[p],{scroll:m,options:x}=f;f!==this.root&&m&&x.layoutScroll&&(m.wasRoot&&Tn(h,d),Oo(h.x,m.offset.x),Oo(h.y,m.offset.y))}return h}applyTransform(d,h=!1){const p=$t();Tn(p,d);for(let f=0;f<this.path.length;f++){const m=this.path[f];!h&&m.options.layoutScroll&&m.scroll&&m!==m.root&&Po(p,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),li(m.latestValues)&&Po(p,m.latestValues)}return li(this.latestValues)&&Po(p,this.latestValues),p}removeTransform(d){const h=$t();Tn(h,d);for(let p=0;p<this.path.length;p++){const f=this.path[p];if(!f.instance||!li(f.latestValues))continue;Sg(f.latestValues)&&f.updateSnapshot();const m=$t(),x=f.measurePageBox();Tn(m,x),i5(h,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,m)}return li(this.latestValues)&&i5(h,this.latestValues),h}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==hs.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const p=!!this.resumingFrom||this!==h;if(!(d||p&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:x}=this.options;if(!this.layout||!(m||x))return;this.resolvedRelativeTargetAt=hs.timestamp;const y=this.getClosestProjectingParent();y&&this.linkedParentVersion!==y.layoutVersion&&!y.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(y&&y.layout?this.createRelativeTarget(y,this.layout.layoutBox,y.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=$t(),this.targetWithTransforms=$t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Tn(this.target,this.layout.layoutBox),I_(this.target,this.targetDelta)):Tn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?this.createRelativeTarget(y,this.target,y.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Sg(this.parent.latestValues)||B_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(d,h,p){this.relativeParent=d,this.linkedParentVersion=d.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$t(),this.relativeTargetOrigin=$t(),Nh(this.relativeTargetOrigin,h,p),Tn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const d=this.getLead(),h=!!this.resumingFrom||this!==d;let p=!0;
9if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(p=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(p=!1),this.resolvedRelativeTargetAt===hs.timestamp&&(p=!1),p)return;const{layout:f,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||m))return;Tn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,y=this.treeScale.y;QP(this.layoutCorrected,this.treeScale,this.path,h),d.layout&&!d.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(d.target=d.layout.layoutBox,d.targetWithTransforms=$t());const{target:v}=d;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(e5(this.prevProjectionDelta.x,this.projectionDelta.x),e5(this.prevProjectionDelta.y,this.projectionDelta.y)),_c(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==y||!u5(this.projectionDelta.x,this.prevProjectionDelta.x)||!u5(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){if(this.options.visualElement?.scheduleRender(),d){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ro(),this.projectionDelta=Ro(),this.projectionDeltaWithTransform=Ro()}setAnimationOrigin(d,h=!1){const p=this.snapshot,f=p?p.latestValues:{},m={...this.latestValues},x=Ro();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const y=$t(),v=p?p.source:void 0,j=this.layout?this.layout.source:void 0,k=v!==j,S=this.getStack(),N=!S||S.members.length<=1,C=!!(k&&!N&&this.options.crossfade===!0&&!this.path.some(WM));this.animationProgress=0;let E;this.mixTargetDelta=O=>{const P=O/1e3;y5(x.x,d.x,P),y5(x.y,d.y,P),this.setTargetDelta(x),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Nh(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),KM(this.relativeTarget,this.relativeTargetOrigin,y,P),E&&SM(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=$t()),Tn(E,this.relativeTarget)),k&&(this.animationValues=m,EM(m,f,this.latestValues,P,C,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Cr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vt.update(()=>{lh.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=wi(0)),this.motionValue.jump(0,!1),this.currentAnimation=sS(this.motionValue,[0,1e3],{...d,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),d.onUpdate&&d.onUpdate(h)},onStop:()=>{},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(LM),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:h,target:p,layout:f,latestValues:m}=d;if(!(!h||!p||!f)){if(this!==d&&this.layout&&f&&rS(this.options.animationType,this.layout.layoutBox,f.layoutBox)){p=this.target||$t();const x=_s(this.layout.layoutBox.x);p.x.min=d.target.x.min,p.x.max=p.x.min+x;const y=_s(this.layout.layoutBox.y);p.y.min=d.target.y.min,p.y.max=p.y.min+y}Tn(h,p),Po(h,m),_c(this.projectionDeltaWithTransform,this.layoutCorrected,h,m)}}registerSharedNode(d,h){this.sharedNodes.has(d)||this.sharedNodes.set(d,new MM),this.sharedNodes.get(d).add(h);const f=h.options.initialPromotionConfig;h.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(h):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){const{layoutId:d}=this.options;
9return d?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:d}=this.options;return d?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:h,preserveFollowOpacity:p}={}){const f=this.getStack();f&&f.promote(this,p),d&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let h=!1;const{latestValues:p}=d;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(h=!0),!h)return;const f={};p.z&&t0("z",d,f,this.animationValues);for(let m=0;m<e0.length;m++)t0(`rotate${e0[m]}`,d,f,this.animationValues),t0(`skew${e0[m]}`,d,f,this.animationValues);d.render();for(const m in f)d.setStaticValue(m,f[m]),this.animationValues&&(this.animationValues[m]=f[m]);d.scheduleRender()}applyProjectionStyles(d,h){if(!this.instance||this.isSVG)return;if(!this.isVisible){d.visibility="hidden";return}const p=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,d.visibility="",d.opacity="",d.pointerEvents=oh(h?.pointerEvents)||"",d.transform=p?p(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(d.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,d.pointerEvents=oh(h?.pointerEvents)||""),this.hasProjected&&!li(this.latestValues)&&(d.transform=p?p({},""):"none",this.hasProjected=!1);return}d.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let x=NM(this.projectionDeltaWithTransform,this.treeScale,m);p&&(x=p(m,x)),d.transform=x;const{x:y,y:v}=this.projectionDelta;d.transformOrigin=`${y.origin*100}% ${v.origin*100}% 0`,f.animationValues?d.opacity=f===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:d.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const j in Cg){if(m[j]===void 0)continue;const{correct:k,applyTo:S,isCSSVariable:N}=Cg[j],C=x==="none"?m[j]:k(m[j],f);if(S){const E=S.length;for(let O=0;O<E;O++)d[S[O]]=C}else N?this.options.visualElement.renderState.vars[j]=C:d[j]=C}this.options.layoutId&&(d.pointerEvents=f===this?oh(h?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>d.currentAnimation?.stop()),this.root.nodes.forEach(m5),this.root.sharedNodes.clear()}}}function BM(e){e.updateLayout()}function IM(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=e.layout,{animationType:o}=e.options,c=t.source!==e.layout.source;o==="size"?Zn(m=>{const x=c?t.measuredBox[m]:t.layoutBox[m],y=_s(x);x.min=s[m].min,x.max=x.min+y}):rS(o,t.layoutBox,s)&&Zn(m=>{const x=c?t.measuredBox[m]:t.layoutBox[m],y=_s(s[m]);x.max=x.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+y)});const d=Ro();_c(d,s,t.layoutBox);const h=Ro();c?_c(h,e.applyTransform(r,!0),t.measuredBox):_c(h,s,t.layoutBox);const p=!X_(d);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:x,layout:y}=m;if(x&&y){const v=$t();Nh(v,t.layoutBox,x.layoutBox);const j=$t();Nh(j,s,y.layoutBox),J_(v,j)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=j,e.relativeTargetOrigin=v,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:h,layoutDelta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function $M(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function UM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function HM(e){e.clearSnapshot()}function m5(e){e.clearMeasurements()}function g5(e){e.isLayoutDirty=!1}function qM(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function x5(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}
9function VM(e){e.resolveTargetDelta()}function zM(e){e.calcProjection()}function FM(e){e.resetSkewAndRotation()}function GM(e){e.removeLeadSnapshot()}function y5(e,t,s){e.translate=_t(t.translate,0,s),e.scale=_t(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function b5(e,t,s,r){e.min=_t(t.min,s.min,r),e.max=_t(t.max,s.max,r)}function KM(e,t,s,r){b5(e.x,t.x,s.x,r),b5(e.y,t.y,s.y,r)}function WM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const YM={duration:.45,ease:[.4,0,.1,1]},v5=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),w5=v5("applewebkit/")&&!v5("chrome/")?Math.round:wn;function j5(e){e.min=w5(e.min),e.max=w5(e.max)}function QM(e){j5(e.x),j5(e.y)}function rS(e,t,s){return e==="position"||e==="preserve-aspect"&&!vM(d5(t),d5(s),.2)}function ZM(e){return e!==e.root&&e.scroll?.wasRoot}const XM=aS({attachResizeListener:(e,t)=>Ic(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),s0={current:void 0},iS=aS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!s0.current){const e=new XM({});e.mount(window),e.setOptions({layoutScroll:!0}),s0.current=e}return s0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),uy=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function k5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function JM(...e){return t=>{let s=!1;const r=e.map(o=>{const c=k5(o,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let o=0;o<r.length;o++){const c=r[o];typeof c=="function"?c():k5(e[o],null)}}}}function eL(...e){return w.useCallback(JM(...e),e)}class tL extends w.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(s&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=s.offsetParent,o=kg(r)&&r.offsetWidth||0,c=kg(r)&&r.offsetHeight||0,d=this.props.sizeRef.current;d.height=s.offsetHeight||0,d.width=s.offsetWidth||0,d.top=s.offsetTop,d.left=s.offsetLeft,d.right=o-d.width-d.left,d.bottom=c-d.height-d.top}return null}componentDidUpdate(){}render(){return this.props.children}}function sL({children:e,isPresent:t,anchorX:s,anchorY:r,root:o,pop:c}){const d=w.useId(),h=w.useRef(null),p=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=w.useContext(uy),m=e.props?.ref??e?.ref,x=eL(h,m);return w.useInsertionEffect(()=>{const{width:y,height:v,top:j,left:k,right:S,bottom:N}=p.current;if(t||c===!1||!h.current||!y||!v)return;const C=s==="left"?`left: ${k}`:`right: ${S}`,E=r==="bottom"?`bottom: ${N}`:`top: ${j}`;h.current.dataset.motionPopId=d;const O=document.createElement("style");f&&(O.nonce=f);const P=o??document.head;return P.appendChild(O),O.sheet&&O.sheet.insertRule(`
10          [data-motion-pop-id="${d}"] {
11            position: absolute !important;
12            width: ${y}px !important;
13            height: ${v}px !important;
14            ${C}px !important;
15            ${E}px !important;
16          }
17        `),()=>{P.contains(O)&&P.removeChild(O)}},[t]),n.jsx(tL,{isPresent:t,childRef:h,sizeRef:p,pop:c,children:c===!1?e:w.cloneElement(e,{ref:x})})}const nL=({children:e,initial:t,isPresent:s,onExitComplete:r,custom:o,presenceAffectsLayout:c,mode:d,anchorX:h,anchorY:p,root:f})=>{const m=ap(aL),x=w.useId();let y=!0,v=w.useMemo(()=>(y=!1,{id:x,initial:t,isPresent:s,custom:o,onExitComplete:j=>{m.set(j,!0);for(const k of m.values())if(!k)return;r&&r()},register:j=>(m.set(j,!1),()=>m.delete(j))}),[s,m,r]);return c&&y&&(v={...v}),w.useMemo(()=>{m.forEach((j,k)=>m.set(k,!1))},[s]),w.useEffect(()=>{!s&&!m.size&&r&&r()},[s]),e=n.jsx(sL,{pop:d==="popLayout",isPresent:s,anchorX:h,anchorY:p,root:f,children:e}),n.jsx(rp.Provider,{value:v,children:e})};function aL(){return new Map}function oS(e=!0){const t=w.useContext(rp);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:r,register:o}=t,c=w.useId();w.useEffect(()=>{if(e)return o(c)},[e]);const d=w.useCallback(()=>e&&r&&r(c),[c,r,e]);return!s&&r?[!1,d]:[!0]}const Eu=e=>e.key||"";function _5(e){const t=[];
17return w.Children.forEach(e,s=>{w.isValidElement(s)&&t.push(s)}),t}const rL=({children:e,custom:t,initial:s=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:c="sync",propagate:d=!1,anchorX:h="left",anchorY:p="top",root:f})=>{const[m,x]=oS(d),y=w.useMemo(()=>_5(e),[e]),v=d&&!m?[]:y.map(Eu),j=w.useRef(!0),k=w.useRef(y),S=ap(()=>new Map),N=w.useRef(new Set),[C,E]=w.useState(y),[O,P]=w.useState(y);Dx(()=>{j.current=!1,k.current=y;for(let A=0;A<O.length;A++){const L=Eu(O[A]);v.includes(L)?(S.delete(L),N.current.delete(L)):S.get(L)!==!0&&S.set(L,!1)}},[O,v.length,v.join("-")]);const M=[];if(y!==C){let A=[...y];for(let L=0;L<O.length;L++){const U=O[L],K=Eu(U);v.includes(K)||(A.splice(L,0,U),M.push(U))}return c==="wait"&&M.length&&(A=M),P(_5(A)),E(y),null}const{forceRender:B}=w.useContext(Lx);return n.jsx(n.Fragment,{children:O.map(A=>{const L=Eu(A),U=d&&!m?!1:y===O||v.includes(L),K=()=>{if(N.current.has(L))return;if(N.current.add(L),S.has(L))S.set(L,!0);else return;let G=!0;S.forEach(W=>{W||(G=!1)}),G&&(B?.(),P(k.current),d&&x?.(),r&&r())};return n.jsx(nL,{isPresent:U,initial:!j.current||s?void 0:!1,custom:t,presenceAffectsLayout:o,mode:c,root:f,onExitComplete:U?void 0:K,anchorX:h,anchorY:p,children:A},L)})})},lS=w.createContext({strict:!1}),S5={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"]};let N5=!1;function iL(){if(N5)return;const e={};for(const t in S5)e[t]={isEnabled:s=>S5[t].some(r=>!!s[r])};P_(e),N5=!0}function cS(){return iL(),KP()}function oL(e){const t=cS();for(const s in e)t[s]={...t[s],...e[s]};P_(t)}const lL=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"]);function Ch(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||lL.has(e)}let dS=e=>!Ch(e);function cL(e){typeof e=="function"&&(dS=t=>t.startsWith("on")?!Ch(t):e(t))}try{cL(require("@emotion/is-prop-valid").default)}catch{}function dL(e,t,s){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(dS(o)||s===!0&&Ch(o)||!t&&!Ch(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const dp=w.createContext({});function uL(e,t){if(cp(e)){const{initial:s,animate:r}=e;return{initial:s===!1||Bc(s)?s:void 0,animate:Bc(r)?r:void 0}}return e.inherit!==!1?t:{}}function hL(e){const{initial:t,animate:s}=uL(e,w.useContext(dp));return w.useMemo(()=>({initial:t,animate:s}),[C5(t),C5(s)])}function C5(e){return Array.isArray(e)?e.join(" "):e}const hy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function uS(e,t,s){for(const r in t)!ns(t[r])&&!H_(r,s)&&(e[r]=t[r])}function pL({transformTemplate:e},t){return w.useMemo(()=>{const s=hy();return cy(s,t,e),Object.assign({},s.vars,s.style)},[t])}function fL(e,t){const s=e.style||{},r={};return uS(r,s,e),Object.assign(r,pL(e,t)),r}function mL(e,t){const s={},r=fL(e,t);return e.drag&&e.dragListener!==!1&&(s.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)&&(s.tabIndex=0),s.style=r,s}const hS=()=>({...hy(),attrs:{}});function gL(e,t,s,r){const o=w.useMemo(()=>{const c=hS();return V_(c,t,F_(r),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[t]);if(e.style){const c={};uS(c,e.style,e),o.style={...c,...o.style}}return o}const xL=["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 py(e){return typeof e!="string"||e.includes("-")?!1:!!(xL.indexOf(e)>-1||/[A-Z]/u.test(e))}function yL(e,t,s,{latestValues:r},o,c=!1,d){const p=(d??py(e)?gL:mL)(t,r,o,e),f=dL(t,typeof e=="string",c),m=e!==w.Fragment?{...f,...p,ref:s}:{},{children:x}=t,y=w.useMemo(()=>ns(x)?x.get():x,[x]);return w.createElement(e,{...m,children:y})}function bL({scrapeMotionValuesFromProps:e,createRenderState:t},s,r,o){return{latestValues:vL(s,r,o,e),renderState:t()}}function vL(e,t,s,r){const o={},c=r(e,{});for(const y in c)o[y]=oh(c[y]);let{initial:d,animate:h}=e;const p=cp(e),f=R_(e);
17t&&f&&!p&&e.inherit!==!1&&(d===void 0&&(d=t.initial),h===void 0&&(h=t.animate));let m=s?s.initial===!1:!1;m=m||d===!1;const x=m?h:d;if(x&&typeof x!="boolean"&&!lp(x)){const y=Array.isArray(x)?x:[x];for(let v=0;v<y.length;v++){const j=ey(e,y[v]);if(j){const{transitionEnd:k,transition:S,...N}=j;for(const C in N){let E=N[C];if(Array.isArray(E)){const O=m?E.length-1:0;E=E[O]}E!==null&&(o[C]=E)}for(const C in k)o[C]=k[C]}}}return o}const pS=e=>(t,s)=>{const r=w.useContext(dp),o=w.useContext(rp),c=()=>bL(e,t,r,o);return s?c():ap(c)},wL=pS({scrapeMotionValuesFromProps:dy,createRenderState:hy}),jL=pS({scrapeMotionValuesFromProps:G_,createRenderState:hS}),kL=Symbol.for("motionComponentSymbol");function _L(e,t,s){const r=w.useRef(s);w.useInsertionEffect(()=>{r.current=s});const o=w.useRef(null);return w.useCallback(c=>{c&&e.onMount?.(c);const d=r.current;if(typeof d=="function")if(c){const h=d(c);typeof h=="function"&&(o.current=h)}else o.current?(o.current(),o.current=null):d(c);else d&&(d.current=c);t&&(c?t.mount(c):t.unmount())},[t])}const fS=w.createContext({});function jo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function SL(e,t,s,r,o,c){const{visualElement:d}=w.useContext(dp),h=w.useContext(lS),p=w.useContext(rp),f=w.useContext(uy),m=f.reducedMotion,x=f.skipAnimations,y=w.useRef(null),v=w.useRef(!1);r=r||h.renderer,!y.current&&r&&(y.current=r(e,{visualState:t,parent:d,props:s,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:m,skipAnimations:x,isSVG:c}),v.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const j=y.current,k=w.useContext(fS);j&&!j.projection&&o&&(j.type==="html"||j.type==="svg")&&NL(y.current,s,o,k);const S=w.useRef(!1);w.useInsertionEffect(()=>{j&&S.current&&j.update(s,p)});const N=s[y_],C=w.useRef(!!N&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(N)&&window.MotionHasOptimisedAnimation?.(N));return Dx(()=>{v.current=!0,j&&(S.current=!0,window.MotionIsMounted=!0,j.updateFeatures(),j.scheduleRenderMicrotask(),C.current&&j.animationState&&j.animationState.animateChanges())}),w.useEffect(()=>{j&&(!C.current&&j.animationState&&j.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(N)}),C.current=!1),j.enteringChildren=void 0)}),j}function NL(e,t,s,r){const{layoutId:o,layout:c,drag:d,dragConstraints:h,layoutScroll:p,layoutRoot:f,layoutCrossfade:m}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:mS(e.parent)),e.projection.setOptions({layoutId:o,layout:c,alwaysMeasureLayout:!!d||h&&jo(h),visualElement:e,animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:p,layoutRoot:f})}function mS(e){if(e)return e.options.allowProjection!==!1?e.projection:mS(e.parent)}function n0(e,{forwardMotionProps:t=!1,type:s}={},r,o){r&&oL(r);const c=s?s==="svg":py(e),d=c?jL:wL;function h(f,m){let x;const y={...w.useContext(uy),...f,layoutId:CL(f)},{isStatic:v}=y,j=hL(f),k=d(f,v);if(!v&&typeof window<"u"){EL();const S=TL(y);x=S.MeasureLayout,j.visualElement=SL(e,k,y,o,S.ProjectionNode,c)}return n.jsxs(dp.Provider,{value:j,children:[x&&j.visualElement?n.jsx(x,{visualElement:j.visualElement,...y}):null,yL(e,f,_L(k,j.visualElement,m),k,v,t,c)]})}h.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const p=w.forwardRef(h);return p[kL]=e,p}function CL({layoutId:e}){const t=w.useContext(Lx).id;return t&&e!==void 0?t+"-"+e:e}function EL(e,t){w.useContext(lS).strict}function TL(e){const t=cS(),{drag:s,layout:r}=t;if(!s&&!r)return{};const o={...s,...r};return{MeasureLayout:s?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function AL(e,t){if(typeof Proxy>"u")return n0;const s=new Map,r=(c,d)=>n0(c,d,e,t),o=(c,d)=>r(c,d);return new Proxy(o,{get:(c,d)=>d==="create"?r:(s.has(d)||s.set(d,n0(d,void 0,e,t)),s.get(d))})}const RL=(e,t)=>t.isSVG??py(e)?new K_(t):new q_(t,{allowProjection:e!==w.Fragment});class OL extends Or{constructor(t){super(t),t.animationState||(t.animationState=fM(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();lp(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let PL=0;class ML extends Or{constructor(){super(...arguments),this.id=PL++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);s&&!t&&o.then(()=>{s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};
17s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const LL={animation:{Feature:OL},exit:{Feature:ML}};function nd(e){return{point:{x:e.pageX,y:e.pageY}}}const DL=e=>t=>iy(t)&&e(t,nd(t));function Sc(e,t,s,r){return Ic(e,t,DL(s),r)}const gS=({current:e})=>e?e.ownerDocument.defaultView:null,E5=(e,t)=>Math.abs(e-t);function BL(e,t){const s=E5(e.x,t.x),r=E5(e.y,t.y);return Math.sqrt(s**2+r**2)}const T5=new Set(["auto","scroll"]);class xS{constructor(t,s,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:c=!1,distanceThreshold:d=3,element:h}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=r0(this.lastMoveEventInfo,this.history),j=this.startEvent!==null,k=BL(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!j&&!k)return;const{point:S}=v,{timestamp:N}=hs;this.history.push({...S,timestamp:N});const{onStart:C,onMove:E}=this.handlers;j||(C&&C(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,v)},this.handlePointerMove=(v,j)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=a0(j,this.transformPagePoint),vt.update(this.updatePoint,!0)},this.handlePointerUp=(v,j)=>{this.end();const{onEnd:k,onSessionEnd:S,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=r0(v.type==="pointercancel"?this.lastMoveEventInfo:a0(j,this.transformPagePoint),this.history);this.startEvent&&k&&k(v,C),S&&S(v,C)},!iy(t))return;this.dragSnapToOrigin=c,this.handlers=s,this.transformPagePoint=r,this.distanceThreshold=d,this.contextWindow=o||window;const p=nd(t),f=a0(p,this.transformPagePoint),{point:m}=f,{timestamp:x}=hs;this.history=[{...m,timestamp:x}];const{onSessionStart:y}=s;y&&y(t,r0(f,this.history)),this.removeListeners=ed(Sc(this.contextWindow,"pointermove",this.handlePointerMove),Sc(this.contextWindow,"pointerup",this.handlePointerUp),Sc(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let s=t.parentElement;for(;s;){const r=getComputedStyle(s);(T5.has(r.overflowX)||T5.has(r.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.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(t){const s=this.scrollPositions.get(t);if(!s)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},c={x:o.x-s.x,y:o.y-s.y};c.x===0&&c.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(t,o),vt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Cr(this.updatePoint)}}function a0(e,t){return t?{point:t(e.point)}:e}function A5(e,t){return{x:e.x-t.x,y:e.y-t.y}}function r0({point:e},t){return{point:e,delta:A5(e,yS(t)),offset:A5(e,IL(t)),velocity:$L(t,.1)}}function IL(e){return e[0]}function yS(e){return e[e.length-1]}function $L(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,r=null;const o=yS(e);for(;s>=0&&(r=e[s],!(o.timestamp-r.timestamp>jn(t)));)s--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>jn(t)*2&&(r=e[1]);const c=vn(o.timestamp-r.timestamp);if(c===0)return{x:0,y:0};const d={x:(o.x-r.x)/c,y:(o.y-r.y)/c};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}function UL(e,{min:t,max:s},r){return t!==void 0&&e<t?e=r?_t(t,e,r.min):Math.max(e,t):s!==void 0&&e>s&&(e=r?_t(s,e,r.max):Math.min(e,s)),e}function R5(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function HL(e,{top:t,left:s,bottom:r,right:o}){return{x:R5(e.x,s,o),y:R5(e.y,t,r)}}function O5(e,t){let s=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,r]=[r,s]),{min:s,max:r}}function qL(e,t){return{x:O5(e.x,t.x),y:O5(e.y,t.y)}}function VL(e,t){let s=.5;const r=_s(e),o=_s(t);return o>r?s=Vo(t.min,t.max-r,e.min):r>o&&(s=Vo(e.min,e.max-o,t.min)),ra(0,1,s)}function zL(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const Eg=.35;function FL(e=Eg){return e===!1?e=0:e===!0&&(e=Eg),{x:P5(e,"left","right"),y:P5(e,"to
17p","bottom")}}function P5(e,t,s){return{min:M5(e,t),max:M5(e,s)}}function M5(e,t){return typeof e=="number"?e:e[t]||0}const GL=new WeakMap;class KL{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$t(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const c=x=>{s&&this.snapToCursor(nd(x).point),this.stopAnimation()},d=(x,y)=>{const{drag:v,dragPropagation:j,onDragStart:k}=this.getProps();if(v&&!j&&(this.openDragLock&&this.openDragLock(),this.openDragLock=SP(v),!this.openDragLock))return;this.latestPointerEvent=x,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zn(N=>{let C=this.getAxisMotionValue(N).get()||0;if(sa.test(C)){const{projection:E}=this.visualElement;if(E&&E.layout){const O=E.layout.layoutBox[N];O&&(C=_s(O)*(parseFloat(C)/100))}}this.originPoint[N]=C}),k&&vt.update(()=>k(x,y),!1,!0),bg(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},h=(x,y)=>{this.latestPointerEvent=x,this.latestPanInfo=y;const{dragPropagation:v,dragDirectionLock:j,onDirectionLock:k,onDrag:S}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:N}=y;if(j&&this.currentDirection===null){this.currentDirection=YL(N),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",y.point,N),this.updateAxis("y",y.point,N),this.visualElement.render(),S&&vt.update(()=>S(x,y),!1,!0)},p=(x,y)=>{this.latestPointerEvent=x,this.latestPanInfo=y,this.stop(x,y),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:x}=this.getProps();(x||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new xS(t,{onSessionStart:c,onStart:d,onMove:h,onSessionEnd:p,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:gS(this.visualElement),element:this.visualElement.current})}stop(t,s){const r=t||this.latestPointerEvent,o=s||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!o||!r)return;const{velocity:d}=o;this.startAnimation(d);const{onDragEnd:h}=this.getProps();h&&vt.postRender(()=>h(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,r){const{drag:o}=this.getProps();if(!r||!Tu(t,o,this.currentDirection))return;const c=this.getAxisMotionValue(t);let d=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(d=UL(d,this.constraints[t],this.elastic[t])),c.set(d)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&jo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=HL(r.layoutBox,t):this.constraints=!1,this.elastic=FL(s),o!==this.constraints&&!jo(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Zn(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=zL(r.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!jo(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const c=ZP(r,o.root,this.visualElement.getTransformPagePoint());let d=qL(o.layout.layoutBox,c);if(s){const h=s(WP(d));this.hasMutatedConstraints=!!h,h&&(d=D_(h))}return d}startAnimation(t){const{drag:s,dragMomentum:r,dragElastic:o,dragTransition:c,dragSnapToOrigin:d,onDragTransitionEnd:h}=this.getProps(),p=this.constraints||{},f=Zn(m=>{if(!Tu(m,s,this.currentDirection))return;let x=p&&p[m]||{};d&&(x={min:0,max:0});const y=o?200:1e6,v=o?40:1e7,j={type:"inertia",velocity:r?t[m]:0,bounceStiffness:y,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...c,...x};return this.startAxisValueAnimation(m,j)});return Promise.all(f).then(h)}startAxisValueAnimation(t,s){const r=this.getAxisMotionValue(t);return bg(this.visualElement,t),r.start(Jx(t,r,0,s,this.visualElement,!1))}stopAnimation(){Zn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[s];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Zn(s=>{const{drag:r}=this.getProps();if(!Tu(s,r,this.currentDirection))return;const{projection:o}=this.visualElement,c=this.getAxisMotionValue(s);if(o&&o.layout){const{min:d,max:h}=o.layout.layoutBox[s],p=c.get()||0;c.set(t[s]-_t(d,h,.5)+p)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:r}=this.visualElement;if(!jo(s)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Zn(d=>{const h=this.getAxisMotionValue(d);if(h&&this.constraints!==!1){const p=h.get();o[d]=VL({min:p,max:p},this.constraints[d])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Zn(d=>
17{if(!Tu(d,t,null))return;const h=this.getAxisMotionValue(d),{min:p,max:f}=this.constraints[d];h.set(_t(p,f,o[d]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;GL.set(this.visualElement,this);const t=this.visualElement.current,s=Sc(t,"pointerdown",f=>{const{drag:m,dragListener:x=!0}=this.getProps(),y=f.target,v=y!==t&&RP(y);m&&x&&!v&&this.start(f)});let r;const o=()=>{const{dragConstraints:f}=this.getProps();jo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=WL(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,d=c.addEventListener("measure",o);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),vt.read(o);const h=Ic(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(Zn(x=>{const y=this.getAxisMotionValue(x);y&&(this.originPoint[x]+=f[x].translate,y.set(y.get()+f[x].translate))}),this.visualElement.render())}));return()=>{h(),s(),d(),p&&p(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:c=!1,dragElastic:d=Eg,dragMomentum:h=!0}=t;return{...t,drag:s,dragDirectionLock:r,dragPropagation:o,dragConstraints:c,dragElastic:d,dragMomentum:h}}}function L5(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function WL(e,t,s){const r=H2(e,L5(s)),o=H2(t,L5(s));return()=>{r(),o()}}function Tu(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function YL(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class QL extends Or{constructor(t){super(t),this.removeGroupControls=wn,this.removeListeners=wn,this.controls=new KL(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||wn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const i0=e=>(t,s)=>{e&&vt.update(()=>e(t,s),!1,!0)};class ZL extends Or{constructor(){super(...arguments),this.removePointerDownListener=wn}onPointerDown(t){this.session=new xS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:i0(t),onStart:i0(s),onMove:i0(r),onEnd:(c,d)=>{delete this.session,o&&vt.postRender(()=>o(c,d))}}}mount(){this.removePointerDownListener=Sc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let o0=!1;class XL extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r,layoutId:o}=this.props,{projection:c}=t;c&&(s.group&&s.group.add(c),r&&r.register&&o&&r.register(c),o0&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:r,drag:o,isPresent:c}=this.props,{projection:d}=r;return d&&(d.isPresent=c,t.layoutDependency!==s&&d.setOptions({...d.options,layoutDependency:s}),o0=!0,o||t.layoutDependency!==s||s===void 0||t.isPresent!==c?d.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?d.promote():d.relegate()||vt.postRender(()=>{const h=d.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ry.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r}=this.props,{projection:o}=t;o0=!0,o&&(o.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bS(e){const[t,s]=oS(),r=w.useContext(Lx);return n.jsx(XL,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(fS),isPresent:t,safeToRemove:s})}const JL={pan:{Feature:ZL},drag:{Feature:QL,ProjectionNode:iS,MeasureLayout:bS}};function D5(e,t,s){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",s==="Start");const o="onHover"+s,c=r[o];c&&vt.postRender(()=>c(t,nd(t)))}class eD extends Or{mount(){const{current:t}=this.node;t&&(this.unmount=CP(t,(s,r)=>(D5(this.node,r,"Start"),o=>D5(this.node,o,"End"))))}unmount(){}}class tD extends Or{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ed(Ic(this.node.current,"focus",()=>this.onFocus()),Ic(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function B5(e,t,s){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",s==="Start");const o="onTap"+(s==="End"?"":s),c=r[o];c&&vt.postRender(()=>c(t,nd(t)))}class sD extends Or{mount(){const{current:t}=this.node;if(!t)return;
17const{globalTapTarget:s,propagate:r}=this.node.props;this.unmount=PP(t,(o,c)=>(B5(this.node,c,"Start"),(d,{success:h})=>B5(this.node,d,h?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:r?.tap===!1})}unmount(){}}const Tg=new WeakMap,l0=new WeakMap,nD=e=>{const t=Tg.get(e.target);t&&t(e)},aD=e=>{e.forEach(nD)};function rD({root:e,...t}){const s=e||document;l0.has(s)||l0.set(s,{});const r=l0.get(s),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(aD,{root:e,...t})),r[o]}function iD(e,t,s){const r=rD(t);return Tg.set(e,s),r.observe(e),()=>{Tg.delete(e),r.unobserve(e)}}const oD={some:0,all:1};class lD extends Or{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:s,margin:r,amount:o="some",once:c}=t,d={root:s?s.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:oD[o]},h=p=>{const{isIntersecting:f}=p;if(this.isInView===f||(this.isInView=f,c&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:x}=this.node.getProps(),y=f?m:x;y&&y(p)};return iD(this.node.current,d,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(cD(t,s))&&this.startObserver()}unmount(){}}function cD({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const dD={inView:{Feature:lD},tap:{Feature:sD},focus:{Feature:tD},hover:{Feature:eD}},uD={layout:{ProjectionNode:iS,MeasureLayout:bS}},hD={...LL,...dD,...JL,...uD},Se=AL(hD,RL);function pD(e){e.values.forEach(t=>t.stop())}function Ag(e,t){[...t].reverse().forEach(r=>{const o=e.getVariant(r);o&&ty(e,o),e.variantChildren&&e.variantChildren.forEach(c=>{Ag(c,t)})})}function fD(e,t){if(Array.isArray(t))return Ag(e,t);if(typeof t=="string")return Ag(e,[t]);ty(e,t)}function mD(){const e=new Set,t={subscribe(s){return e.add(s),()=>{e.delete(s)}},start(s,r){const o=[];return e.forEach(c=>{o.push(v_(c,s,{transitionOverride:r}))}),Promise.all(o)},set(s){return e.forEach(r=>{fD(r,s)})},stop(){e.forEach(s=>{pD(s)})},mount(){return()=>{t.stop()}}};return t}function fy(e){return typeof e=="object"&&!Array.isArray(e)}function vS(e,t,s,r){return e==null?[]:typeof e=="string"&&fy(t)?ip(e,s,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(o=>o!=null):[e]}function gD(e,t,s){return e*(t+1)}function I5(e,t,s,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?s:t.startsWith("<")?Math.max(0,s+parseFloat(t.slice(1))):r.get(t)??e}function xD(e,t,s){for(let r=0;r<e.length;r++){const o=e[r];o.at>t&&o.at<s&&(qo(e,o),r--)}}function yD(e,t,s,r,o,c){xD(e,o,c);for(let d=0;d<t.length;
17d++)e.push({value:t[d],at:_t(o,c,r[d]),easing:q4(s,d)})}function bD(e,t){for(let s=0;s<e.length;s++)e[s]=e[s]/(t+1)}function vD(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const wD="easeInOut";function jD(e,{defaultTransition:t={},...s}={},r,o){const c=t.duration||.3,d=new Map,h=new Map,p={},f=new Map;let m=0,x=0,y=0;for(let v=0;v<e.length;v++){const j=e[v];if(typeof j=="string"){f.set(j,x);continue}else if(!Array.isArray(j)){f.set(j.name,I5(x,j.at,m,f));continue}let[k,S,N={}]=j;N.at!==void 0&&(x=I5(x,N.at,m,f));let C=0;const E=(O,P,M,B=0,A=0)=>{const L=kD(O),{delay:U=0,times:K=a_(L),type:G=t.type||"keyframes",repeat:W,repeatType:ee,repeatDelay:te=0,...I}=P;let{ease:V=t.ease||"easeOut",duration:H}=P;const se=typeof U=="function"?U(B,A):U,R=L.length,Q=Zx(G)?G:o?.[G||"keyframes"];if(R<=2&&Q){let fe=100;if(R===2&&ND(L)){const J=L[1]-L[0];fe=Math.abs(J)}const he={...t,...I};H!==void 0&&(he.duration=jn(H));const Ne=t_(he,fe,Q);V=Ne.ease,H=Ne.duration}H??(H=c);const oe=x+se;K.length===1&&K[0]===0&&(K[1]=1);const ne=K.length-L.length;if(ne>0&&n_(K,ne),L.length===1&&L.unshift(null),W){H=gD(H,W);const fe=[...L],he=[...K];V=Array.isArray(V)?[...V]:[V];const Ne=[...V];for(let J=0;J<W;J++){L.push(...fe);for(let ue=0;ue<fe.length;ue++)K.push(he[ue]+(J+1)),V.push(ue===0?"linear":q4(Ne,ue-1))}bD(K,W)}const le=oe+H;yD(M,L,V,K,oe,le),C=Math.max(se+H,C),y=Math.max(le,y)};if(ns(k)){const O=$5(k,h);E(S,N,U5("default",O))}else{const O=vS(k,S,r,p),P=O.length;for(let M=0;M<P;M++){S=S,N=N;const B=O[M],A=$5(B,h);for(const L in S)E(S[L],_D(N,L),U5(L,A),M,P)}}m=x,x+=C}return h.forEach((v,j)=>{for(const k in v){const S=v[k];S.sort(vD);const N=[],C=[],E=[];for(let B=0;B<S.length;B++){const{at:A,value:L,easing:U}=S[B];N.push(L),C.push(Vo(0,y,A)),E.push(U||"easeOut")}C[0]!==0&&(C.unshift(0),N.unshift(N[0]),E.unshift(wD)),C[C.length-1]!==1&&(C.push(1),N.push(null)),d.has(j)||d.set(j,{keyframes:{},transition:{}});const O=d.get(j);O.keyframes[k]=N;const{type:P,...M}=t;O.transition[k]={...M,duration:y,ease:E,times:C,...s}}}),d}function $5(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function U5(e,t){return t[e]||(t[e]=[]),t[e]}function kD(e){return Array.isArray(e)?e:[e]}function _D(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const SD=e=>typeof e=="number",ND=e=>e.every(SD);function CD(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},s=op(e)&&!A_(e)?new K_(t):new q_(t);s.mount(e),Dc.set(e,s)}function ED(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},s=new aM(t);s.mount(e),Dc.set(e,s)}function TD(e,t){return ns(e)||typeof e=="number"||typeof e=="string"&&!fy(t)}function wS(e,t,s,r){const o=[];if(TD(e,t))o.push(sS(e,fy(t)&&t.default||t,s&&(s.default||s)));else{if(e==null)return o;const c=vS(e,t,r),d=c.length;for(let h=0;h<d;h++){const p=c[h],f=p instanceof Element?CD:ED;Dc.has(p)||f(p);const m=Dc.get(p),x={...s};"delay"in x&&typeof x.delay=="function"&&(x.delay=x.delay(h,d)),o.push(...ny(m,{...t,transition:x},{}))}}return o}function AD(e,t,s){const r=[],o=e.map(d=>{if(Array.isArray(d)&&typeof d[0]=="function"){const h=d[0],p=wi(0);return p.on("change",h),d.length===1?[p,[0,1]]:d.length===2?[p,[0,1],d[1]]:[p,d[1],d[2]]}return d});return jD(o,t,s,{spring:Lc}).forEach(({keyframes:d,transition:h},p)=>{r.push(...wS(p,d,h))}),r}function RD(e){return Array.isArray(e)&&e.some(Array.isArray)}function OD(e={}){const{scope:t,reduceMotion:s}=e;function r(o,c,d){let h=[],p;if(RD(o)){const{onComplete:m,...x}=c||{};typeof m=="function"&&(p=m),h=AD(o,s!==void 0?{reduceMotion:s,...x}:x,t)}else{const{onComplete:m,...x}=d||{};typeof m=="function"&&(p=m),h=wS(o,c,s!==void 0?{reduceMotion:s,...x}:x,t)}const f=new WO(h);return p&&f.finished.then(p),t&&(t.animations.push(f),f.finished.then(()=>{qo(t.animations,f)})),f}return r}const jS=OD();function PD(){const e=ap(mD);return Dx(e.mount,[]),e}const MD=PD,LD={some:0,all:1};function DD(e,t,{root:s,margin:r,amount:o="some"}={}){const c=ip(e),d=new WeakMap,h=f=>{f.forEach(m=>{const x=d.get(m.target);if(m.isIntersecting!==!!x)if(m.isIntersecting){const y=t(m.target,m);typeof y=="function"?d.set(m.target,y):p.unobserve(m.target)}else typeof x=="function"&&(x(m),d.delete(m.target))})},p=new IntersectionObserver(h,{root:s,rootMargin:r,threshold:typeof o=="number"?o:LD[o]});
17return c.forEach(f=>p.observe(f)),()=>p.disconnect()}function BD(e,{root:t,margin:s,amount:r,once:o=!1,initial:c=!1}={}){const[d,h]=w.useState(c);return w.useEffect(()=>{if(!e.current||o&&d)return;const p=()=>(h(!0),o?void 0:()=>h(!1)),f={root:t&&t.current||void 0,margin:s,amount:r};return DD(e.current,p,f)},[t,e,s,o,r]),d}const Rg="scapely-site-theme",kS=w.createContext(null);function ID(e){if(typeof window>"u")return e;try{const t=new URLSearchParams(window.location.search).get("theme");if(t==="light"||t==="dark")return t}catch{}try{const t=window.localStorage.getItem("scapely-home-theme");if(t==="light"||t==="dark")return window.localStorage.setItem(Rg,t),window.localStorage.removeItem("scapely-home-theme"),t}catch{}try{const t=window.localStorage.getItem(Rg);if(t==="light"||t==="dark")return t}catch{}return e}function _S({children:e,defaultTheme:t="dark"}){const[s,r]=w.useState(()=>ID(t)),o=d=>{r(d);try{window.localStorage.setItem(Rg,d)}catch{}},c=()=>o(s==="dark"?"light":"dark");return n.jsx(kS.Provider,{value:{theme:s,setTheme:o,toggleTheme:c},children:e})}function Da(){const e=w.useContext(kS);if(!e)throw new Error("useSiteTheme must be used within a SiteThemeProvider");return e}function $D({ctaLabel:e="Create account",surface:t="dark"}){const s=t==="light"?"border border-slate-900 bg-transparent text-slate-900 hover:bg-slate-900 hover:text-white":"border border-white bg-transparent text-white hover:bg-white hover:text-[#06081c]";return n.jsx("div",{className:"inline-flex flex-col items-stretch gap-3 sm:flex-row sm:items-center",children:n.jsxs(Be,{href:"/pricing","data-testid":"button-submit",className:`group inline-flex h-14 w-full items-center justify-center gap-2 rounded-full px-8 text-[15px] font-semibold transition active:scale-[0.98] sm:w-auto ${s}`,children:[e,n.jsx(px,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5"})]})})}function _i(){w.useEffect(()=>{const e="data-scapely-noindex";let t=document.head.querySelector(`meta[${e}]`);const s=!t;return t||(t=document.createElement("meta"),t.setAttribute("name","robots"),t.setAttribute(e,"true"),document.head.appendChild(t)),t.setAttribute("content","noindex, nofollow"),()=>{s&&t&&t.parentNode&&t.parentNode.removeChild(t)}},[])}function ps({meta:e}){return w.useEffect(()=>{const t=document.title;document.title=e.title;const s=(d,h,p)=>{let f=document.head.querySelector(`meta[${d}="${h}"]`);f||(f=document.createElement("meta"),f.setAttribute(d,h),document.head.appendChild(f)),f.setAttribute("content",p)},r=(d,h)=>{let p=document.head.querySelector(`link[rel="${d}"]`);p||(p=document.createElement("link"),p.setAttribute("rel",d),document.head.appendChild(p)),p.setAttribute("href",h)};s("name","description",e.description),r("canonical",e.canonical),s("property","og:title",e.title),s("property","og:description",e.description),s("property","og:url",e.canonical),s("property","og:image",e.ogImage),s("property","og:type","website"),s("name","twitter:card","summary_large_image"),s("name","twitter:title",e.title),s("name","twitter:description",e.description),s("name","twitter:image",e.ogImage);const o="scapely-jsonld";let c=document.getElementById(o);return c||(c=document.createElement("script"),c.id=o,c.type="application/ld+json",document.head.appendChild(c)),c.textContent=JSON.stringify(e.jsonLd),()=>{document.title=t}},[e]),null}const nn=[{slug:"city-of-london",name:"City of London Corporation",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:3500},{slug:"westminster",name:"City of Westminster",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:3400},{slug:"camden",name:"London Borough of Camden",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:3200},{slug:"islington",name:"London Borough of Islington",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:3100},{slug:"hackney",name:"London Borough of Hackney",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:2900},{slug:"tower-hamlets",name:"London Borough of Tower Hamlets",regi
17on:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:3e3},{slug:"greenwich",name:"Royal Borough of Greenwich",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2700},{slug:"lewisham",name:"London Borough of Lewisham",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2700},{slug:"southwark",name:"London Borough of Southwark",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:3e3},{slug:"lambeth",name:"London Borough of Lambeth",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:2950},{slug:"wandsworth",name:"London Borough of Wandsworth",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2850},{slug:"hammersmith-and-fulham",name:"London Borough of Hammersmith and Fulham",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:3100},{slug:"kensington-and-chelsea",name:"Royal Borough of Kensington and Chelsea",region:"Greater London",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:3500},{slug:"waltham-forest",name:"London Borough of Waltham Forest",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2700},{slug:"redbridge",name:"London Borough of Redbridge",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2600},{slug:"havering",name:"London Borough of Havering",region:"Greater London",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2500},{slug:"barking-and-dagenham",name:"London Borough of Barking and Dagenham",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2500},{slug:"newham",name:"London Borough of Newham",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2700},{slug:"bexley",name:"London Borough of Bexley",region:"Greater London",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2500},{slug:"bromley",name:"London Borough of Bromley",region:"Greater London",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2600},{slug:"croydon",name:"London Borough of Croydon",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2650},{slug:"sutton",name:"London Borough of Sutton",region:"Greater London",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2550},{slug:"merton",name:"London Borough of Merton",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2700},{slug:"kingston-upon-thames",name:"Royal Borough of Kingston upon Thames",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2750},{slug:"richmond-upon-thames",name:"London Borough of Richmond upon Thames",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2850},{slug:"hounslow",name:"London Borough of Hounslow",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2700},{slug:"hillingdon",name:"London Borough of Hillingdon",region:"Greater London",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2500},{slug:"ealing",name:"London Borough of Ealing",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2750},{slug:"brent",name:"London Borough of Brent",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2700},{slug:"harrow",name:"London Borough of Harrow",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2650},{slug:"barnet",name:"London Borough of Barnet",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2700},{slug:"haringey",name:"London Borough of Haringey",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2750},{slug:"enfield",name:"London Borough of Enfield",region:"Greater London",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2600},{slug:"manchester-city",name:"Manchester City Council",region:"North West",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2150},{slug:"salford",name:"Salford City Council",region:"North West",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2050}
17,{slug:"liverpool-city",name:"Liverpool City Council",region:"North West",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1900},{slug:"bolton",name:"Bolton Council",region:"North West",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1900},{slug:"stockport",name:"Stockport Metropolitan Borough Council",region:"North West",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2e3},{slug:"leeds-city",name:"Leeds City Council",region:"Yorkshire",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1950},{slug:"sheffield-city",name:"Sheffield City Council",region:"Yorkshire",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:1950},{slug:"york",name:"City of York Council",region:"Yorkshire",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2150},{slug:"hull",name:"Hull City Council",region:"Yorkshire",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1800},{slug:"bradford",name:"City of Bradford Metropolitan District Council",region:"Yorkshire",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1850},{slug:"newcastle-city",name:"Newcastle City Council",region:"North East",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1850},{slug:"sunderland",name:"Sunderland City Council",region:"North East",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1800},{slug:"birmingham-city",name:"Birmingham City Council",region:"West Midlands",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:2100},{slug:"coventry",name:"Coventry City Council",region:"West Midlands",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:1950},{slug:"wolverhampton",name:"City of Wolverhampton Council",region:"West Midlands",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1900},{slug:"nottingham-city",name:"Nottingham City Council",region:"East Midlands",gateway_status:"Gateway 3",article_4_active:!0,avg_build_cost_sqm:2050},{slug:"leicester",name:"Leicester City Council",region:"East Midlands",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:1900},{slug:"derby",name:"Derby City Council",region:"East Midlands",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1900},{slug:"bristol-city",name:"Bristol City Council",region:"South West",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2300},{slug:"bath",name:"Bath and North East Somerset Council",region:"South West",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2400},{slug:"plymouth",name:"Plymouth City Council",region:"South West",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1950},{slug:"exeter",name:"Exeter City Council",region:"South West",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2100},{slug:"bournemouth",name:"Bournemouth, Christchurch and Poole Council",region:"South West",gateway_status:"Gateway 2",article_4_active:!1,avg_build_cost_sqm:2150},{slug:"brighton-and-hove",name:"Brighton & Hove City Council",region:"South East",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2500},{slug:"southampton",name:"Southampton City Council",region:"South East",gateway_status:"Gateway 2",article_4_active:!1,avg_build_cost_sqm:2150},{slug:"portsmouth",name:"Portsmouth City Council",region:"South East",gateway_status:"Gateway 2",article_4_active:!1,avg_build_cost_sqm:2100},{slug:"reading",name:"Reading Borough Council",region:"South East",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2400},{slug:"oxford",name:"Oxford City Council",region:"South East",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2650},{slug:"milton-keynes",name:"Milton Keynes City Council",region:"South East",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2200},{slug:"cambridge",name:"Cambridge City Council",region:"East of England",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2600},{slug:"norwich",name:"Norwich City Council",region:"East of England",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:2050},{slug:"peterborough",name:"Peterborough City Council",region:"East of England",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1950},{slug:"cardiff",name:"Cardiff Council",region:"Wales",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:1900},{slug:"swansea",name:"Swansea Council",region:"Wales",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1850},{slug:"glasgow-city",name:"Glasgow City Council",region:"Scotland",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:1950},{slug:"edinburgh-city",name:"City of Edinburgh Council",region:"Scotland",gateway_status:"Gateway 2",article_4_active:!0,avg_build_cost_sqm:2150},{slug:"aberdeen",name:"Aberdeen City Council",region:"Scotland",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1900},{slug:"dundee",name:"Dundee City Council",region:"Scotland",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1850},{slug:"belfast",name:"Belfast City Council",region:"Northern Ireland",gateway_status:"Gateway 1",article_4_active:!1,avg_build_cost_sqm:1850}],Pa=[{slug:"hmo-conversions",title:"HMO Conversions",intent:"How to convert to HMO and beat Article 4",feature_upsell:"HMO Saturation & Article 4 Radar"},{slug:"commercial-to-residential",title:"Commercial to Residential (Class MA)",intent:"Permitted development and Class MA prior approval rules",feature_upsell:"Class MA Eligibility Checker"},{slug:"title-splitting",title:"Title Splitting & Flipping",intent:"Legal requirements for splitting property titles",feature_upsell:"Boundary & Land Registry Data"},{slug:"permitted-development",title:"Permitted Development Extensions",intent:"Maximum extension sizes without planning permission",feature_upsell:"AI Objection Risk Analyzer"},{slug:"land-assembly",title:"Land Assembly & Site Aggregation",intent:"Combining adjacent plots into developable sites",feature_upsell:"Adjacent-Title & Boundary Lookup"},{slug:"listed-building-conversion",title:"Listed Building Conversion",intent:"Converting Grade I and Grade II listed buildings",feature_upsell:"Heritage Constraint Overlay"},{slug:"brownfield-development",title:"Brownfield & Industrial Conversion",intent:"Reclaiming former industrial sites for housing",feature_upsell:"Contamination & Remediation Risk Score"},{slug:"build-to-rent",title:"Build-to-Rent (BTR) Schemes",intent:"Institutional residential rental developments",feature_upsell:"Rental Yield & Demand Comparator"},{slug:"student-accommodation",title:"Purpose-Built Student Accommodation (PBSA)",intent:"Student housing development opportunities",feature_upsell:"University Pipeline Tracker"},{slug:"air-rights",title:"Airspace & Rooftop Development",intent:"Adding floors above existing buildings",feature_upsell:"Roof-Loading & PD Eligibility Check"},{slug:"modular-construction",title:"Modular & Volumetric Construction",intent:"Off-site manufacturing for faster delivery",feature_upsell:"Programme & Build-Cost Modeller"},{slug:"green-belt-release",title:"Green Belt & Grey Belt Release",intent:"Unlocking development on policy-designated land",feature_upsell:"Local Plan Allocation Tracker"},{slug:"co-living",title:"Co-Living Developments",intent:"Single-occupancy units with shared amenity space",feature_upsell:"Co-Living Use Class Eligibility"},{slug:"retirement-living",title:"Retirement Living & Later-Living Schemes",intent:"Age-restr
17icted housing and assisted living developments",feature_upsell:"Demographic Catchment Modeller"},{slug:"self-build-plots",title:"Self-Build & Custom Build Plots",intent:"Single-plot developments under Right to Build legislation",feature_upsell:"Right to Build Register Tracker"},{slug:"heritage-refurbishment",title:"Heritage Refurbishment & Grant-Funded Restoration",intent:"Historic England grants and conservation-led restoration",feature_upsell:"Heritage Grant Eligibility Scanner"}],Ma=[{code:"E1",area:"Whitechapel & Spitalfields",city:"London",region:"Greater London",council_slug:"tower-hamlets",character:"Inner East London — strong rental demand from City workers",avg_property_value_gbp:575e3,avg_yield_pct:4.6,hot_strategies:["commercial-to-residential","build-to-rent","co-living"]},{code:"E14",area:"Canary Wharf & Isle of Dogs",city:"London",region:"Greater London",council_slug:"tower-hamlets",character:"Financial district — high-rise residential and BTR territory",avg_property_value_gbp:625e3,avg_yield_pct:4.4,hot_strategies:["build-to-rent","air-rights","co-living"]},{code:"E20",area:"Stratford & Olympic Park",city:"London",region:"Greater London",council_slug:"newham",character:"Olympic legacy regeneration — masterplanned BTR opportunity",avg_property_value_gbp:53e4,avg_yield_pct:4.8,hot_strategies:["build-to-rent","student-accommodation","land-assembly"]},{code:"SE1",area:"Borough, Bermondsey & Southbank",city:"London",region:"Greater London",council_slug:"southwark",character:"Riverside London Bridge frontier — high-density mixed use",avg_property_value_gbp:72e4,avg_yield_pct:4.1,hot_strategies:["commercial-to-residential","air-rights","build-to-rent"]},{code:"SE16",area:"Rotherhithe & Canada Water",city:"London",region:"Greater London",council_slug:"southwark",character:"Canada Water masterplan area — major regeneration zone",avg_property_value_gbp:555e3,avg_yield_pct:4.5,hot_strategies:["land-assembly","build-to-rent","brownfield-development"]},{code:"SW8",area:"Nine Elms & Vauxhall",city:"London",region:"Greater London",council_slug:"lambeth",character:"Nine Elms regeneration — embassy quarter and tall-building zone",avg_property_value_gbp:695e3,avg_yield_pct:4.2,hot_strategies:["build-to-rent","air-rights","commercial-to-residential"]},{code:"SW16",area:"Streatham & Norbury",city:"London",region:"Greater London",council_slug:"lambeth",character:"Outer South London commuter belt — strong HMO demand",avg_property_value_gbp:485e3,avg_yield_pct:5.2,hot_strategies:["hmo-conversions","title-splitting","permitted-development"]},{code:"SW18",area:"Wandsworth Town & Earlsfield",city:"London",region:"Greater London",council_slug:"wandsworth",character:"Established residential — strong family demand and conversions",avg_property_value_gbp:695e3,avg_yield_pct:4,hot_strategies:["title-splitting","permitted-development","hmo-conversions"]}
17,{code:"N1",area:"Islington & Hoxton",city:"London",region:"Greater London",council_slug:"islington",character:"Inner-north prime — Georgian terraces and Class MA hotspot",avg_property_value_gbp:825e3,avg_yield_pct:3.9,hot_strategies:["commercial-to-residential","title-splitting","listed-building-conversion"]},{code:"N7",area:"Holloway & Tufnell Park",city:"London",region:"Greater London",council_slug:"islington",character:"Established conversion territory — Victorian terrace stock",avg_property_value_gbp:645e3,avg_yield_pct:4.3,hot_strategies:["title-splitting","hmo-conversions","permitted-development"]},{code:"N16",area:"Stoke Newington & Stamford Hill",city:"London",region:"Greater London",council_slug:"hackney",character:"Trendy inner-east — strong BTR and conversion demand",avg_property_value_gbp:685e3,avg_yield_pct:4.1,hot_strategies:["title-splitting","build-to-rent","permitted-development"]},{code:"NW1",area:"Camden Town & Regent's Park",city:"London",region:"Greater London",council_slug:"camden",character:"Prime central — listed-building heavy, premium yields",avg_property_value_gbp:875e3,avg_yield_pct:3.7,hot_strategies:["listed-building-conversion","commercial-to-residential","air-rights"]},{code:"NW10",area:"Willesden, Harlesden & Park Royal",city:"London",region:"Greater London",council_slug:"brent",character:"Park Royal industrial estate — major brownfield conversion zone",avg_property_value_gbp:525e3,avg_yield_pct:4.7,hot_strategies:["brownfield-development","land-assembly","modular-construction"]},{code:"W2",area:"Paddington & Bayswater",city:"London",region:"Greater London",council_slug:"westminster",character:"Prime central — Paddington Basin commercial-to-resi hotspot",avg_property_value_gbp:925e3,avg_yield_pct:3.6,hot_strategies:["commercial-to-residential","listed-building-conversion","air-rights"]},{code:"W12",area:"Shepherd's Bush & White City",city:"London",region:"Greater London",council_slug:"hammersmith-and-fulham",character:"White City Opportunity Area — BBC site regeneration",avg_property_value_gbp:685e3,avg_yield_pct:4,hot_strategies:["build-to-rent","land-assembly","student-accommodation"]},{code:"CR0",area:"Croydon Town Centre",city:"Croydon",region:"Greater London",council_slug:"croydon",character:"Major opportunity area — Westfield-led town-centre regeneration",avg_property_value_gbp:365e3,avg_yield_pct:5.5,hot_strategies:["commercial-to-residential","build-to-rent","air-rights"]},{code:"M1",area:"Manchester City Centre",city:"Manchester",region:"North West",council_slug:"manchester-city",character:"Northern Quarter & city centre — high-density BTR core",avg_property_value_gbp:285e3,avg_yield_pct:5.8,hot_strategies:["build-to-rent","commercial-to-residential","air-rights"]},{code:"M14",area:"Fallowfield & Rusholme",city:"Manchester",region:"North West",council_slug:"manchester-city",character:"Manchester student belt — premier HMO and PBSA territory",avg_property_value_gbp:245e3,avg_yield_pct:7.2,hot_strategies:["hmo-conversions","student-accommodation","title-splitting"]},{code:"M16",area:"Old Trafford & Whalley Range",city:"Manchester",region:"North West",council_slug:"manchester-city",character:"Trafford boundary — strong yield play with regeneration upside",avg_property_value_gbp:235e3,avg_yield_pct:6.8,hot_strategies:["hmo-conversions","title-splitting","permitted-development"]},{code:"B1",area:"Birmingham City Centre",city:"Birmingham",region:"West Midlands",council_slug:"birmingham-city",character:"Big City Plan core — BTR towers and Class MA conversions",avg_property_value_gbp:245e3,avg_yield_pct:6,hot_strategies:["commercial-to-residential","build-to-rent","air-rights"]},{code:"B12",area:"Balsall Heath & Sparkbrook",city:"Birmingham",region:"West Midlands",council_slug:"birmingham-city",character:"Inner-city HMO heartland — high-yield conversion stock",avg_property_value_gbp:175e3,avg_yield_pct:7.5,hot_strategies:["hmo-conversions","title-splitting","permitted-development"]},{code:"B15",area:"Edgbaston & Five Ways",city:"Birmingham",region:"West Midlands",council_slug:"birmingham-city",character:"Edgbaston University quarter — premium PBSA and BTR territory",avg_property_value_gbp:295e3,avg_yield_pct:5.5,hot_strategies:["student-accommodation","build-to-rent","co-living"]},{code:"L1",area:"Liverpool City Centre",city:"Liverpool",region:"North West",council_slug:"liverpool
17-city",character:"Ropewalks & Baltic Triangle — creative-quarter regeneration",avg_property_value_gbp:195e3,avg_yield_pct:6.4,hot_strategies:["commercial-to-residential","build-to-rent","brownfield-development"]},{code:"L8",area:"Toxteth & Dingle",city:"Liverpool",region:"North West",council_slug:"liverpool-city",character:"Inner-south Liverpool — Georgian terrace stock and HMO yield",avg_property_value_gbp:145e3,avg_yield_pct:7.8,hot_strategies:["hmo-conversions","title-splitting","listed-building-conversion"]},{code:"LS1",area:"Leeds City Centre",city:"Leeds",region:"Yorkshire",council_slug:"leeds-city",character:"Office-to-resi epicentre — South Bank regeneration core",avg_property_value_gbp:215e3,avg_yield_pct:6.1,hot_strategies:["commercial-to-residential","build-to-rent","air-rights"]},{code:"LS6",area:"Headingley & Hyde Park",city:"Leeds",region:"Yorkshire",council_slug:"leeds-city",character:"Leeds student belt — Article 4 restricted HMO territory",avg_property_value_gbp:235e3,avg_yield_pct:7,hot_strategies:["hmo-conversions","student-accommodation","title-splitting"]},{code:"S1",area:"Sheffield City Centre",city:"Sheffield",region:"Yorkshire",council_slug:"sheffield-city",character:"Heart of the City regeneration zone — mixed-use BTR",avg_property_value_gbp:175e3,avg_yield_pct:6.5,hot_strategies:["commercial-to-residential","build-to-rent","student-accommodation"]},{code:"BS1",area:"Bristol City Centre & Harbourside",city:"Bristol",region:"South West",council_slug:"bristol-city",character:"Harbourside regeneration — premium BTR and Class MA",avg_property_value_gbp:365e3,avg_yield_pct:5.2,hot_strategies:["commercial-to-residential","build-to-rent","co-living"]},{code:"NG1",area:"Nottingham City Centre",city:"Nottingham",region:"East Midlands",council_slug:"nottingham-city",character:"Lace Market & Hockley — boutique conversion territory",avg_property_value_gbp:195e3,avg_yield_pct:6.3,hot_strategies:["commercial-to-residential","student-accommodation","build-to-rent"]},{code:"G1",area:"Glasgow City Centre & Merchant City",city:"Glasgow",region:"Scotland",council_slug:"glasgow-city",character:"Merchant City heritage stock — Victorian conversion focus",avg_property_value_gbp:175e3,avg_yield_pct:6.6,hot_strategies:["listed-building-conversion","commercial-to-residential","build-to-rent"]},{code:"EH1",area:"Edinburgh Old Town & Royal Mile",city:"Edinburgh",region:"Scotland",council_slug:"edinburgh-city",character:"World Heritage Site — short-let regulated, listed-heavy",avg_property_value_gbp:425e3,avg_yield_pct:4.8,hot_strategies:["listed-building-conversion","heritage-refurbishment","title-splitting"]},{code:"EH3",area:"Edinburgh New Town & West End",city:"Edinburgh",region:"Scotland",council_slug:"edinburgh-city",character:"Georgian New Town — premium listed-conversion territory",avg_property_value_gbp:525e3,avg_yield_pct:4.5,hot_strategies:["listed-building-conversion","title-splitting","commercial-to-residential"]},{code:"CF10",area:"Cardiff City Centre & Cardiff Bay",city:"Cardiff",region:"Wales",council_slug:"cardiff",character:"Cardiff Bay regeneration — waterside BTR core",avg_property_value_gbp:215e3,avg_yield_pct:5.8,hot_strategies:["build-to-rent","commercial-to-residential","student-accommodation"]},{code:"BN1",area:"Brighton Centre & North Laine",city:"Brighton",region:"South East",council_slug:"brighton-and-hove",character:"Brighton core — Article 4 HMO restrictions, premium yields",avg_property_value_gbp:425e3,avg_yield_pct:5.1,hot_strategies:["title-splitting","commercial-to-residential","listed-building-conversion"]},{code:"CB1",area:"Cambridge City Centre",city:"Cambridge",region:"East of England",council_slug:"cambridge",character:"University core — listed conservation and PBSA territory",avg_property_value_gbp:525e3,avg_yield_pct:4.4,hot_strategies:["student-accommodation","listed-building-conversion","co-living"]},{code:"OX1",area:"Oxford City Centre",city:"Oxford",region:"South East",council_slug:"oxford",character:"Oxford historic core — heavily listed, PBSA-led regeneration",avg_property_value_gbp:565e3,avg_yield_pct:4.3,hot_strategies:["student-accommodation","listed-building-conversion","heritage-refurbishment"]}],UD=e=>Ma.find(t=>t.code.toLowerCase()===e.toLowerCase()),up=e=>nn.find(t=>t.slug===e),hp=e=>Pa.find(t=>t.slug===e),HD={};var qD={};const ji=[{term:"Article 4 Direction",slug:"article-4",definition:"A council-issued planning direction that removes specified Permitted Development rights in a defined area — most commonly used to require full planning permission for HMO conversions or office-to-residential schemes."},{term:"Building Safety Act Gateway",slug:"bsa-gateway",definition:"The three-stage approval regime under the Building Safety Act 2022 for higher-risk buildings (typically 18m+ or 7 storeys+). Gateway 1 is planning, Gateway 2 is pre-construction, Gateway 3 is completion sign-off by the Building Safety Regulator."},{term:"Class MA",slug:"class-ma",definition:"The Permitted Development right under Class MA of the Town & Country Planning (General Permitted Development) Order allowing change of use from Class E (commercial) to C3 (dwelling) without a full planning application — subject to prior approval."}
17,{term:"CIL (Community Infrastructure Levy)",slug:"cil",definition:"A charge that local authorities can levy on new developments per square metre of net additional floorspace. Rates vary by council and use class — Scapely surfaces local CIL rates as part of its build-cost calculations."},{term:"Commercial-to-Residential",slug:"commercial-to-residential",definition:"Converting a commercial property (typically Class E offices, shops or light industrial) into residential use. Often done via Class MA Permitted Development to bypass full planning, subject to floor-area, daylight and contamination criteria."},{term:"EPC (Energy Performance Certificate)",slug:"epc",definition:"A statutory rating of a property's energy efficiency, A (best) to G (worst). Required to market a property and increasingly material for buy-to-let — minimum E for new tenancies, with proposals to raise to C."},{term:"Freehold vs Leasehold",slug:"freehold-vs-leasehold",definition:"Freehold means outright ownership of the land and building indefinitely. Leasehold means time-limited ownership of a unit (typically a flat) under a lease from the freeholder, with ground rent and service charges payable."},{term:"HMO (House in Multiple Occupation)",slug:"hmo",definition:"A property rented by three or more unrelated tenants forming two or more households who share kitchen or bathroom facilities. Large HMOs (5+ tenants) are mandatorily licensed; smaller HMOs may need additional or selective licensing."},{term:"Land Assembly",slug:"land-assembly",definition:"Combining adjacent plots — often under different owners — into a single developable site. Typically requires options agreements, conditional contracts or a strategic acquisition campaign."},{term:"Listed Building",slug:"listed-building",definition:"A building protected under the Planning (Listed Buildings and Conservation Areas) Act 1990 because of its architectural or historic significance. Grade I, II*, II — alterations require Listed Building Consent."},{term:"Permitted Development (PD)",slug:"permitted-development",definition:"Specific categories of development that can proceed without a full planning application under the General Permitted Development Order. Includes minor extensions, certain change-of-use cases and householder works."},{term:"Prior Approval",slug:"prior-approval",definition:"A lighter-touch planning consent process for some PD rights (e.g. Class MA, larger householder extensions). The council can only refuse on specified grounds — not on principle."},{term:"PTAL (Public Transport Accessibility Level)",slug:"ptal",definition:"A 0–6b score used in London to measure how well a site is served by public transport. Critical for planning policy compliance, density and parking standards."},{term:"S106 (Section 106 Agreement)",slug:"s106",definition:"A planning obligation under Section 106 of the Town & Country Planning Act 1990, used to secure affordable housing, public-realm contributions or transport improvements as a condition of planning consent."},{term:"Title Splitting",slug:"title-splitting",definition:"Dividing a single property title into multiple Land Registry titles — typically when converting a house into flats or a HMO. Requires separate leases, freehold management structure and Land Registry approval."},{term:"Title Register",slug:"title-register",definition:"The official HM Land Registry record of a property's ownership, tenure type, charges, restrictions and (where relevant) lease terms. Each register costs £3 from HM Land Registry and is the only authoritative source of tenure information."},{term:"BTR (Build-to-Rent)",slug:"btr",definition:"Purpose-built rental developments owned and managed long-term by a single institutional landlord, with shared amenities and on-site management — distinct from buy-to-let or PRS."},{term:"PBSA (Purpose-Built Student Accommodation)",slug:"pbsa",definition:"Student housing developed and operated specifically for the student market. Often falls under sui generis use class with bespoke planning policy in university cities."},{term:"Use Class",slug:"use-class",definition:"The Town & Country Planning (Use Classes) Order classification system: C3 (dwelling), C4 (small HMO), Class E (commercial, business, services), F1/F2 (community), Sui Generis (one-off uses like HMO 7+)."},{term:"Conservation Area",slug:"conservation-area",definition:"Areas designated by councils for special architectural or historic interest. PD rights are restricted (Article 4 commonly applied), demolition needs consent, and tree works are controlled."},{term:"Green Belt",slug:"green-belt",definition:"Statutory open land around major UK cities where development is restricted to protect against urban sprawl. The 2024 NPPF reforms introduced a 'grey belt' concept to allow limited release of lower-quality green-belt land."},{term:"Air Rights / Airspace Development",slug:"air-rights",definition:"Building additional floors above existing buildings — typically permitted under Class AA (homes) or Class AC/AD PD rights subject to height, daylight and structural-feasibility checks."},{term:"Brownfield",slug:"brownfield",definition:"Previously developed land — typically former industrial, commercial or institutional sites. National policy strongly supports brownfield-first development to ease pressure on greenfield/Green Belt."},{term:"Density (dph)",slug:"density",definition:"Dwellings per hectare — the principal density metric for residential schemes. London Plan and most local plans set density ranges by PTAL and town-centre tier."}
17,{term:"Right to Build",slug:"right-to-build",definition:"Self-Build and Custom Housebuilding Act 2015 obligation requiring councils to maintain a register of demand and to grant sufficient planning permissions to meet that demand."}],pp=[{question:"What is Scapely?",answer:"Scapely is a UK property intelligence dashboard for buyers, developers and investors. Search any address and Scapely returns a development appraisal, EPC and MEES position, planning and heritage constraints, permitted development eligibility, flood and PTAL scores, sale history and Companies House owner intel — all in one screen, with a one-click PDF report. A companion Chrome extension brings the same overlay to portal listings."},{question:"How much does Scapely cost?",answer:"Scapely Free gives you 3 development appraisals per month with the core data set — EPC, planning constraints, flood, tenure and heritage. Scapely Pro is £29.99/month for 50 appraisals, build-cost modelling, objection-risk scoring, HMO saturation, PTAL, owner intel and a 7-day appraisal history per property. Scapely Enterprise is £59.99/month for 200 appraisals plus all Pro features and priority support."},{question:"What does the dashboard actually show?",answer:"Per property: the development appraisal (GDV, build cost, fees, finance, profit on cost), EPC band and MEES 2027 status, planning and heritage flags (Article 4, conservation areas, listed buildings, AONB/SSSI), a permitted development verdict across the key classes, HM Land Registry sale history and comparables, plot intelligence (footprint, area, height) on a map, flood and PTAL scores, Companies House owner intel where the owner is a company, and HMO saturation, CIL and business rates where they apply."},{question:"Which permitted development routes does Scapely check?",answer:"The dashboard runs eligibility checks for the routes that matter most to buyers and developers: Class MA (commercial to residential), Class Q (agricultural to residential), Class L (C3 to C4 small HMO), Part 1 Class A house extensions, Class AA upward additions on houses, and Part 20 Class AA upward additions on flats and commercial buildings. Each check produces a plain-English verdict with the reason."},{question:"How does the development appraisal work?",answer:"Pick a strategy — refurbishment, extension, new build, HMO conversion, Class MA conversion — and Scapely builds a full end-to-end appraisal: indicative GDV from local comparables, build cost from current UK benchmarks tuned per strategy, fees, finance and CIL, ending in profit on cost and profit on GDV. The same numbers feed the investment view's yield and ROI projections."},{question:"Where does the comparable evidence come from?",answer:"Sale history and comparables are pulled from HM Land Registry Price Paid data — real transacted prices on the same street and postcode, not portal asking prices. Scapely deliberately does not scrape listing prices from property portals."},{question:"What planning and heritage layers does Scapely cover?",answer:"Article 4 directions, conservation areas, statutory listed buildings, AONBs, National Parks, the Broads, World Heritage Sites, SSSIs, SPAs, SACs, Ramsar sites and Scheduled Monuments. Each constraint is flagged with severity and a link to the source record where one exists."},{question:"Does Scapely cover EPC and the 2027 MEES rules?",answer:"Yes. Every property shows its current EPC band, expiry date and the cheapest credible route to band C, with cost ranges per measure. The dashboard flags lets that would fall foul of the proposed band C minimum from 2027 with a clear 'cannot legally be let' warning when relevant."},{question:"What is the owner intel on Enterprise?",answer:"When the registered owner is a company, Scapely pulls the live Companies House record into the dashboard — company profile, registered office, directors, persons with significant control, charges, and other companies registered at the same address. Useful for tracking down off-market opportunities and stress-testing counter-party risk."},{question:"How accurate is Scapely's tenure data?",answer:"Tenure (freehold vs leasehold) is only authoritative when sourced from HM Land Registry's Title Register. Scapely offers an optional £5 verified Title Register lookup that pulls the official record. Without that, tenure isn't guessed — it's left blank with a Verify CTA."},{question:"What about flood risk and transport?",answer:"Flood risk uses the Environment Agency river, sea and surface-water flood-zone datasets — the same data insurers and lenders rely on. For London properties Scapely shows the TfL PTAL public-transport accessibility score from 0 (poor) to 6b (excellent), which is the metric planners use for density and parking arguments."},{question:"Does Scapely work for commercial and mixed-use property?",answer:"Yes. The dashboard surfaces Class MA eligibility, CIL liability, MEES 2027 commercial obligations, Biodiversity Net Gain risk and a Valuation Office Agency business-rates estimate for any commercial floorspace on site."},{question:"Can I save properties and revisit them?",answer:"Yes. Every property can be added to your watchlist, which appears as a horizontal carousel along the bottom of the dashboard. Appraisals are cached for 7 days per property and strategy — re-opening a saved property within that window is instant and does not consume a monthly scan, even on the Free tier."},{question:"Can I export a report?",answer:"Yes. The Generate Report button produces the full Scapely PDF — cover, appraisal, intel, planning, EPC and comparables — entirely in your browser using pdfmake. Nothing leaves the device during generation, so the report is safe to share with solicitors, brokers or partners."},{question:"What does the Chrome extension add?",answer:"The extension is a companion to the dashboard. When you visit a listing on Rightmove, Zoopla, OnTheMarket, Realla, Allsop or Savills auctions, it overlays Scapely's appraisal, EPC and ke
17y planning flags inline so you can triage portal listings without opening the web dashboard for each one."},{question:"Does Scapely cover Scotland, Wales and Northern Ireland?",answer:"Yes. Scapely covers all four UK nations including Glasgow, Edinburgh, Aberdeen, Cardiff, Swansea and Belfast, with planning-regime context appropriate to each jurisdiction (Scottish Planning Policy, Planning (Wales) Act, Northern Ireland LDPs)."},{question:"Is Scapely a replacement for a planning consultant?",answer:"No. Scapely is a screening and underwriting tool — it tells you within seconds whether a property is worth pursuing and what the major risks are. Once a deal moves into legal due diligence or detailed planning strategy, you should still engage a qualified planning consultant or solicitor."},{question:"Where does Scapely's data come from?",answer:"Scapely aggregates open data from HM Land Registry, Companies House, planning.data.gov.uk, the Environment Agency, Historic England, Natural England, Ordnance Survey NGD, the Valuation Office Agency, EPC Open Data Communities, TfL Unified API and Google Maps. Title Register data is purchased on demand from HM Land Registry."}],SS=[{name:"PropertyData",positioning:"Web-app comp/yield database — analyst desk tool",pricing:"From £29/month",best_for:"Desk research, comparable evidence, area heatmaps",vs_scapely:"PropertyData is a strong area-research tool but stops at the data — no appraisal, no permitted-development verdict, no objection-risk scoring. Scapely's dashboard returns a full development appraisal plus EPC, MEES 2027, Article 4, the full PD matrix, Companies House owner intel, sale comparables and a one-click PDF report, and the Scapely Panel brings the same overlay onto Rightmove, Zoopla and OnTheMarket listings as you browse."},{name:"Nimbus Maps",positioning:"Map-based property and site-sourcing platform",pricing:"From ~£100/month",best_for:"Map-led sourcing, ownership tracing, sites assembly",vs_scapely:"Nimbus is map-first: brilliant for finding the site, less suited to underwriting one. Scapely is property-first: you start from an address and get a development appraisal, planning and heritage constraints, EPC and MEES position, sale history and owner intel in one screen — at a fraction of the seat cost, with a free tier to try."},{name:"Searchland",positioning:"Planning, ownership and land database",pricing:"Quote-based (typically £2k+/year)",best_for:"Planning team workflows, land sourcing pipelines",vs_scapely:"Searchland is built for in-house land and planning teams running long sourcing pipelines. Scapely is built for the buyer, developer or investor sizing up one specific property in seconds — with the Panel meeting you on the portal listing and the dashboard ready when you want the full appraisal and PDF report."},{name:"LandTech (LandInsight + LandFund)",positioning:"Map-based site sourcing for strategic land",pricing:"From ~£3,500/year",best_for:"Strategic land acquisition, land assembly, master-planning",vs_scapely:"LandTech remains the gold standard for strategic-land teams sweeping for promotion sites. Scapely is the complement on the live market — the live listings LandTech doesn't surface — pricing each one in seconds with a development appraisal, the permitted-development matrix and live owner intel from Companies House."},{name:"OnTheMarket Pro",positioning:"Agent CRM + lead-management platform",pricing:"Quote-based",best_for:"Agency operations, lead routing, listing management",vs_scapely:"OnTheMarket Pro is built for agencies marketing properties; Scapely is built for the buyer-side — developers, investors and home-buyers underwriting them. Different side of the table, different tool."},{name:"Spreadsheet underwriting",positioning:"Manual Excel models",pricing:"Your time",best_for:"Bespoke high-value deals where every assumption is curated",vs_scapely:"A custom model still wins on bespoke high-value deals. For the first 90% of screening — kill the bad deals fast — Scapely cuts a half-hour lookup cycle to seconds, with the dashboard for in-depth work and the Panel for on-portal tri
17age. Export the finished view as a PDF to drop into the spreadsheet when a deal makes the shortlist."}],ch=typeof import.meta<"u"&&HD?.VITE_SITE_ORIGIN||typeof process<"u"&&qD?.VITE_SITE_ORIGIN||"https://scapely.io",Ye="Scapely",qt="/opengraph.jpg";function xe(e){const t=e.startsWith("/")?e:`/${e}`;return`${ch}${t}`}function Ta(e){const t=e.split(/\s+/)[0]??"";return t.length>1&&t===t.toUpperCase()?e:e[0].toLowerCase()+e.slice(1)}function my(e){return e==="Gateway 1"?"low Building Safety Act friction":e==="Gateway 2"?"moderate Gateway 2 fire-safety scrutiny":"intensive Gateway 3 sign-off and HRB oversight"}function gy(){return{title:"Scapely — UK Property Intelligence for Buyers, Developers & Investors",description:"UK property intelligence in one click. EPC ratings, planning risk, build cost, flood data, ownership and land data for property buyers, developers and investors — on every major UK property portal.",canonical:xe("/"),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"Organization",name:Ye,url:xe("/"),description:"UK property intelligence platform for property buyers, developers and investors — EPC, planning, flood, ownership and land data, in one click."}}}function NS(){const e="/investors";return{title:`UK Property Investment Intelligence for Investors | ${Ye}`,description:"Property investor due diligence in one click — yield, EPC, planning risk, ownership and tenure for every UK property listing. Built for buy-to-let, HMO, BTR and serviced-accommodation investors.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"WebPage",name:"UK Property Investment Intelligence",url:xe(e),about:["UK property investment","property investors","buy-to-let","HMO investment"],publisher:{"@type":"Organization",name:Ye}}}}function CS(){const e="/property-data";return{title:`UK Property Data — EPC, Planning, Flood, Ownership & Land Data | ${Ye}`,description:"One-click access to UK property and land data: EPC ratings, planning history, flood risk, Article 4, Title Register, Companies House owner intel and more — across every UK postcode.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"Dataset",name:"Scapely UK Property Data",description:"Aggregated UK property and land data — EPC, planning, flood risk, Title Register, Companies House owner data and Ordnance Survey geospatial layers — surfaced in one click.",url:xe(e),keywords:["UK property data","land data","EPC data","planning data","property risk","Title Register"],creator:{"@type":"Organization",name:Ye},license:xe("/terms")}}}function ES(){const e="/councils";return{title:`UK Council Property Development Guides | ${Ye}`,description:`Build cost benchmarks, Article 4 status and Building Safety Gateway risk for ${nn.length} major UK councils. Free property developer intelligence from Scapely.`,canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"CollectionPage",name:"UK Council Property Development Guides",url:xe(e),hasPart:nn.map(t=>({"@type":"WebPage",name:t.name,url:xe(`/councils/${t.slug}`)}))}}}function TS(e){const t=`/councils/${e.slug}`,s=e.article_4_active?"with active Article 4 directions":"without active Article 4 directions";return{title:`Property Development in ${e.name} — Build Costs, Article 4 & Planning | ${Ye}`,description:`Average build cost £${e.avg_build_cost_sqm}/sqm in ${e.name}. ${e.gateway_status} Building Safety regime, ${s}. Live planning intelligence for property developers in the ${e.region}.`,canonical:xe(t),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"Article",headline:`Property Development in ${e.name}`,about:e.name,url:xe(t),publisher:{"@type":"Organization",name:Ye}}}}function AS(){const e="/strategies";return{title:`UK Property Development Strategies | ${Ye}`,description:"HMO conversions, Class MA commercial-to-residential, title splitting and permitted development extensions — practical playbooks for UK property developers.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"CollectionPage",name:"UK Property Development Strategies",url:xe(e),hasPart:Pa.map(t=>({"@type":"WebPage",name:t.title,url:xe(`/strategies/${t.slug}`)}))}}}function RS(e){const t=`/strategies/${e.slug}`;return{title:`${e.title} in the UK — Developer Playbook | ${Ye}`,description:`${e.intent}. ${e.title} viability checks, planning risk and Scapely's ${e.feature_upsell} for UK property developers.`,canonical:xe(t),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"Article",headline:`${e.title} in the UK`,about:e.title,url:xe(t),publisher:{"@type":"Organization",name:Ye}}}}function OS(e,t){const s=`/councils/${e.slug}/strategies/${t.slug}`,r=e.article_4_active?"Article 4 directions active":"no Article 4 restrictions";return{title:`${t.title} in ${e.name} — Costs, Risk & Article 4 | ${Ye}`,description:`${t.title} in ${e.name}: build cost £${e.avg_build_cost_sqm}/sqm, ${my(e.gateway_status)}, ${r}. Free Scapely development intelligence.`,canonical:xe(s),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"Article",headline:`${t.title} in ${e.name}`,about:[t.title,e.name],url:xe(s),publisher:{"@type":"Organization",name:Ye}}}}function PS(){const e="/glossary";return{title:`UK Property Development Glossary | ${Ye}`,description:`Plain-English definitions of ${ji.length} UK property-development terms — Article 4, Class MA, BSA Gateway, CIL, S106, HMO, title splitting and more.`,canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"DefinedTermSet",name:"UK Property Development Glossary",url:xe(e),hasDefinedTerm:ji.map(t=>({"@type":"DefinedTerm","@id":xe(`/glossary#${t.slug}`),name:t.term,description:t.definition,inDefinedTermSet:xe(e)}))}}}function MS(){const e="/faq";return{title:`Scapely FAQ — UK Property Intelligence Dashboard | ${Ye}`,description:"Answers to the most common questions about the Scapely dashboard — pricing, development appraisals, planning constraints, permitted development, EPC and MEES 2027, owner intel and exportable reports.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"FAQPage",url:xe(e),mainEntity:pp.map(t=>
17({"@type":"Question",name:t.question,acceptedAnswer:{"@type":"Answer",text:t.answer}}))}}}function LS(){const e="/alternatives";return{title:`Scapely vs PropertyData, Nimbus, Searchland & LandTech | ${Ye}`,description:"How the Scapely dashboard and Panel extension compare to PropertyData, Nimbus Maps, Searchland, LandTech, OnTheMarket Pro and DIY spreadsheets — for UK buyers, developers and investors underwriting properties in seconds.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"Article",headline:"Scapely vs the alternatives",url:xe(e),publisher:{"@type":"Organization",name:Ye}}}}function DS(){const e="/postcodes";return{title:`UK Property Development Postcode Hot-Spots | ${Ye}`,description:`Yield benchmarks, planning context and hot strategies for ${Ma.length} of the UK's most active property-development postcode districts — SW16, M14, B15, E20 and more.`,canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"CollectionPage",name:"UK Property Development Postcode Hot-Spots",url:xe(e),hasPart:Ma.map(t=>({"@type":"WebPage",name:`${t.code} — ${t.area}`,url:xe(`/postcodes/${t.code.toLowerCase()}`)}))}}}function BS(e){const t=`/postcodes/${e.code.toLowerCase()}`;return{title:`${e.code} ${e.area} — Property Development & Yields | ${Ye}`,description:`${e.code} (${e.area}, ${e.city}): avg property value £${(e.avg_property_value_gbp/1e3).toFixed(0)}k, gross yield ${e.avg_yield_pct}%. ${e.character}. Hot-spot strategies and live planning intel from Scapely.`,canonical:xe(t),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"Article",headline:`${e.code} ${e.area} — Property Development`,about:[e.code,e.area,e.city],url:xe(t),publisher:{"@type":"Organization",name:Ye}}}}function ke(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function VD(){return`
18    <h1>UK property investment intelligence — for investors</h1>
19    <p>Scapely gives UK property investors one-click due diligence on every listing: yield context, EPC rating, planning risk, ownership and tenure — pulled live from official UK data sources.</p>
20    <h2>Built for the way investors screen deals</h2>
21    <p>Whether you run a buy-to-let portfolio, an HMO operation, a serviced-accommodation business or a build-to-rent vehicle, deal-screening time is the bottleneck. Scapely cuts a 30-minute manual lookup cycle to under 10 seconds per property — across Rightmove, Zoopla, OnTheMarket and the major auction houses.</p>
22    <h2>What investors see at a glance</h2>
23    <ul>
24      <li><strong>Yield context</strong> — local rental comps and gross yield benchmarks by postcode.</li>
25      <li><strong>EPC rating &amp; MEES exposure</strong> — current EPC plus the regulatory uplift cost to hit the proposed minimum-C standard.</li>
26      <li><strong>Planning risk</strong> — Article 4 status, conservation area, listed-building flags and HMO licensing regime.</li>
27      <li><strong>Ownership intel</strong> — Companies House director links, charges and registered owner history (Pro/Enterprise).</li>
28      <li><strong>Tenure</strong> — verified Title Register lookup so freehold vs leasehold isn't a guess.</li>
29      <li><strong>Flood risk</strong> — Environment Agency Zone 1/2/3 classification used by lenders and insurers.</li>
30    </ul>
31    <h2>Investor strategies covered</h2>
32    <ul>
33      <li>Buy-to-let (BTL) and high-yield HMO conversions</li>
34      <li>Serviced accommodation (SA) and short-let viability</li>
35      <li>Build-to-rent (BTR) and PBSA opportunity scoring</li>
36      <li>Title splitting and refurb-to-revalue plays</li>
37      <li>Class MA commercial-to-residential conversion</li>
38    </ul>
39    <p><a href="/strategies">See all UK property development strategies</a> · <a href="/property-data">Browse the underlying property data</a> · <a href="/pricing">Pricing</a></p>`}function zD(){return`
40    <h1>UK property data — EPC, planning, flood, ownership & land data</h1>
41    <p>Scapely aggregates the open UK property and land data sources every developer, investor and buyer needs into a single one-click overlay — so you stop tab-juggling between EPC registers, planning portals, flood maps and Land Registry.</p>
42    <h2>The UK property data we surface</h2>
43    <ul>
44      <li><strong>EPC data</strong> — current and potential energy ratings via the EPC Open Data Communities register, plus MEES uplift cost modelling.</li>
45      <li><strong>Planning data</strong> — live planning history, Article 4 directions, conservation areas, listed buildings and policy designations from planning.data.gov.uk.</li>
46      <li><strong>Flood &amp; environmental risk</strong> — Environment Agency flood-zone classification, plus heritage and protected-tree overlays.</li>
47      <li><strong>Land data &amp; geospatial</strong> — Ordnance Survey premium tiles, OpenStreetMap context, postcode and PTAL lookups.</li>
48      <li><strong>Ownership &amp; corporate intel</strong> — Companies House director, PSC and charges data for property-holding entities.</li>
49      <li><strong>Title Register</strong> — on-demand HM Land Registry tenure verification for freehold vs leasehold confidence.</li>
50      <li><strong>Build-cost benchmarks</strong> — council-level £/sqm benchmarks reconciled against CIL and Building Safety Act exposure.</li>
51    </ul>
52    <h2>Who uses Scapely's property data</h2>
53    <p>UK property buyers, property investors, property developers, BTL landlords, planning consultants and small house
53-builders use Scapely to cut deal-screening from half an hour to under ten seconds per listing.</p>
54    <p><a href="/councils">Explore councils</a> · <a href="/postcodes">Postcode hot-spots</a> · <a href="/glossary">Glossary</a> · <a href="/investors">For investors</a></p>`}function FD(){return`
55    <h1>UK Council Property Development Guides</h1>
56    <p>Live build cost benchmarks, Article 4 directions and Building Safety Gateway status for ${nn.length} major UK councils. Pick a council to see how its planning regime affects HMO conversions, Class MA commercial-to-residential and permitted development.</p>
57    <ul>
58      ${nn.map(e=>`<li><a href="/councils/${e.slug}">${ke(e.name)}</a> — ${ke(e.region)}, ${ke(e.gateway_status)}, ${e.article_4_active?"Article 4 active":"no Article 4"}, £${e.avg_build_cost_sqm}/sqm avg build cost</li>`).join("")}
59    </ul>`}function GD(e){const t=e.article_4_active?`<strong>Article 4 directions are active in ${ke(e.name)}.</strong> Permitted development rights have been removed in defined zones, which means HMO conversions, office-to-resi schemes and other PD plays require a full planning application. Always check the council's Article 4 map before committing.`:`<strong>${ke(e.name)} does not currently operate Article 4 directions on residential PD.</strong> HMO conversions and Class MA prior approval routes generally remain available, subject to the usual prior-approval criteria.`;return`
60    <h1>Property Development in ${ke(e.name)}</h1>
61    <p>${ke(e.name)} sits in the ${ke(e.region)} and operates a <strong>${ke(e.gateway_status)}</strong> Building Safety regime — meaning ${my(e.gateway_status)} for higher-risk schemes.</p>
62    <h2>Build cost benchmark</h2>
63    <p>The Scapely cost model puts the typical build cost in ${ke(e.name)} at <strong>£${e.avg_build_cost_sqm}/sqm</strong> for a standard residential conversion or new-build, before professional fees and contingency. Use this as a rule-of-thumb when stress-testing a deal — Scapely Pro produces a per-property estimate from CIL, footprint and access constraints.</p>
64    <h2>Article 4 directions</h2>
65    <p>${t}</p>
66    <h2>Strategies for ${ke(e.name)}</h2>
67    <ul>
68      ${Pa.map(s=>`<li><a href="/councils/${e.slug}/strategies/${s.slug}">${ke(s.title)} in ${ke(e.name)}</a></li>`).join("")}
69    </ul>`}function KD(){return`
70    <h1>UK Property Development Strategies</h1>
71    <p>Practical playbooks for the four highest-ROI development strategies in the UK market. Each guide covers the planning route, the typical numbers and the most common reasons schemes get refused — drawn from live Scapely scans across UK councils.</p>
72    <ul>
73      ${Pa.map(e=>`<li><a href="/strategies/${e.slug}">${ke(e.title)}</a> — ${ke(e.intent)}</li>`).join("")}
74    </ul>`}function WD(e){return`
75    <h1>${ke(e.title)} in the UK</h1>
76    <p>${ke(e.intent)}. This guide walks through the planning route, the most common refusal reasons, and how Scapely's <strong>${ke(e.feature_upsell)}</strong> de-risks the deal at scan-time.</p>
77    <h2>${ke(e.title)} by council</h2>
78    <p>The viability of ${ke(Ta(e.title))} swings sharply with local Article 4 designations, Gateway status and build cost. See council-specific guidance below:</p>
79    <ul>
80      ${nn.map(t=>`<li><a href="/councils/${t.slug}/strategies/${e.slug}">${ke(e.title)} in ${ke(t.name)}</a> — £${t.avg_build_cost_sqm}/sqm, ${ke(t.gateway_status)}${t.article_4_active?", Article 4 active":""}</li>`).join("")}
81    </ul>`}function YD(e,t){const s=e.article_4_active?`<p><strong>Heads up:</strong> ${ke(e.name)} operates Article 4 directions, so ${ke(Ta(t.title))} that would normally be permitted development will likely require a full planning application here. Build that into your timeline and risk model.</p>`:`<p>${ke(e.name)} does not currently operate Article 4 on residential PD, so ${ke(Ta(t.title))} can proceed via the standard prior-approval route in most cases.</p>`;return`
82    <h1>${ke(t.title)} in ${ke(e.name)}</h1>
83    <p>${ke(t.intent)} — applied to ${ke(e.name)} in the ${ke(e.region)}. With ${my(e.gateway_status)} and an average build cost of <strong>£${e.avg_build_cost_sqm}/sqm</strong>, the deal arithmetic for ${ke(Ta(t.title))} here is distinct from neighbouring boroughs.</p>
84    <h2>Local planning context</h2>
85    ${s}
86    <h2>How Scapely helps</h2>
87    <p>Run any ${ke(e.region)} listing through Scapely to get a property-specific build cost, council objection-risk score and the <strong>${ke(t.feature_upsell)}</strong> overlay applied to ${ke(e.name)}
87's policy environment.</p>
88    <p><a href="/strategies/${t.slug}">More on ${ke(t.title)}</a> · <a href="/councils/${e.slug}">More on ${ke(e.name)}</a></p>`}function QD(){return`
89    <h1>UK Property Development Glossary</h1>
90    <p>Plain-English definitions of the ${ji.length} terms property developers, investors and BTL landlords meet most often when underwriting UK deals — Article 4, Class MA, BSA Gateway, CIL, S106, HMO, title splitting, Right to Build and more.</p>
91    <dl>
92      ${ji.map(e=>`<dt id="${ke(e.slug)}"><strong>${ke(e.term)}</strong></dt><dd>${ke(e.definition)}</dd>`).join("")}
93    </dl>`}function ZD(){return`
94    <h1>Frequently Asked Questions</h1>
95    <p>Answers to the questions UK property developers most commonly ask about Scapely, planning regimes, HMO licensing, flood risk and Title Register lookups.</p>
96    ${pp.map(e=>`<section><h2>${ke(e.question)}</h2><p>${ke(e.answer)}</p></section>`).join("")}`}function XD(){return`
97    <h1>Scapely vs the alternatives</h1>
98    <p>Scapely isn't the only UK property-data tool. Here's an honest take on how it compares to the products UK developers most often evaluate alongside it.</p>
99    ${SS.map(e=>`
100      <section>
101        <h2>Scapely vs ${ke(e.name)}</h2>
102        <p><strong>Positioning:</strong> ${ke(e.positioning)}</p>
103        <p><strong>Pricing:</strong> ${ke(e.pricing)}</p>
104        <p><strong>Best for:</strong> ${ke(e.best_for)}</p>
105        <p><strong>How they compare:</strong> ${ke(e.vs_scapely)}</p>
106      </section>`).join("")}
107    <p><a href="/pricing">See Scapely pricing</a> · <a href="/faq">More questions answered</a></p>`}function JD(){return`
108    <h1>UK Property Development Postcode Hot-Spots</h1>
109    <p>The ${Ma.length} postcode districts where the highest-volume UK property-development activity is happening right now — covering inner-London regeneration zones, regional city centres and the established HMO and student belts.</p>
110    <ul>
111      ${Ma.map(e=>`<li><a href="/postcodes/${e.code.toLowerCase()}"><strong>${ke(e.code)}</strong> — ${ke(e.area)}, ${ke(e.city)}</a> — avg £${(e.avg_property_value_gbp/1e3).toFixed(0)}k, gross yield ${e.avg_yield_pct}%</li>`).join("")}
112    </ul>`}function eB(e){const t=up(e.council_slug),s=e.hot_strategies.map(o=>hp(o)).filter(o=>!!o),r=t?`<p><strong>Local authority:</strong> <a href="/councils/${t.slug}">${ke(t.name)}</a> — ${ke(t.gateway_status)}, ${t.article_4_active?"Article 4 active":"no Article 4"}, average build cost £${t.avg_build_cost_sqm}/sqm.</p>`:"";return`
113    <h1>${ke(e.code)} ${ke(e.area)} — Property Development</h1>
114    <p>${ke(e.code)} covers ${ke(e.area)} in ${ke(e.city)} (${ke(e.region)}). ${ke(e.character)}.</p>
115    <h2>Local market snapshot</h2>
116    <ul>
117      <li>Average property value: <strong>£${e.avg_property_value_gbp.toLocaleString("en-GB")}</strong></li>
118      <li>Indicative gross rental yield: <strong>${e.avg_yield_pct}%</strong></li>
119      <li>Council planning regime: <strong>${t?ke(t.gateway_status):"varies"}</strong></li>
120    </ul>
121    ${r}
122    ${s.length?`<h2>Hot strategies in ${ke(e.code)}</h2><ul>${s.map(o=>`<li><a href="/strategies/${o.slug}">${ke(o.title)}</a> — ${ke(o.intent)}</li>`).join("")}</ul>`:""}
123    <p><a href="/postcodes">All postcode hot-spots</a> · <a href="/glossary">Property development glossary</a></p>`}function tB(){const e="/pricing";return{title:`Pricing — Free, Pro & Enterprise | ${Ye}`,description:"Scapely pricing — start free with 3 development appraisals per month, upgrade to Pro at £29.99/month for 50 appraisals, or Enterprise at £59.99/month for 200 appraisals. Every feature included on both paid tiers. No card required to start.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"SoftwareApplication",name:`${Ye} — UK Property Intelligence`,url:xe(e),applicationCategory:"BusinessApplication",operatingSystem:"Web-based",offers:[{"@type":"Offer",name:"Free",price:"0",priceCurrency:"GBP",availability:"https://schema.org/InStock",url:xe(e)},{"@type":"Offer",name:"Pro",price:"29.99",priceCurrency:"GBP",availability:"https://schema.org/InStock",url:xe(e)},{"@type":"Offer",name:"Enterprise",price:"59.99",priceCurrency:"GBP",availability:"https://schema.org/InStock",url:xe(e)}]}}}function sB(){const e="/resources";return{title:`Resources — Property Development Playbooks & Data | ${Ye}`,description:"Thought-leadership guides for UK property developers — strategy playbooks, council intelligence, postcode benchmarks, a development glossary and the data behind Scapely's appraisals. Free for everyone.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"CollectionPage",name:`${Ye} Resources`,url:xe(e)}}}function nB(){const e="/contact";return{title:`Contact Scapely — Support, Sales & Enterprise Enquiries | ${Ye}`,description:"Get in touch with Scapely — product support, enterprise sales, data partnerships and press enquiries. UK-based team, replies within one working day.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"ContactPage",name:`Contact ${Ye}`,url:xe(e)}}}function aB(){const e="/privacy";return{title:`Privacy Policy | ${Ye}`,description:"How Scapely collects, stores and processes personal data — UK GDPR compliant, data minimisation by default, no resale of personal information.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"WebPage",name:`${Ye} Privacy Policy`,url:xe(e)}}}function rB(){const e="/dashboard-features";return{title:`Dashboard Features — UK Property Appraisal in One View | ${Ye}`,description:"See every feature inside the Scapely dashboard — real-time feasibility, AI objection-risk analyser, Article 4 and Class MA flags, EPC + MEES uplift, flood risk, PTAL, plot intelligence and Companies House owner intel — all on a single UK property appraisal screen.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"WebPage",name:`${Ye} Dashboard Features`,url:xe(e),about:["UK property appraisal","build cost","planning risk","EPC","Article 4","Class MA","flood risk","PTAL"],publisher:{"@type":"Organization",name:Ye}}}}function iB(){const e="/demo-report";return{title:`Sample Property Report — Full Development Appraisal | ${Ye}`,description:"See a complete Scapely development appraisal report — EPC rating, planning constraints, permitted development options, owner intelligence and AI appraisal for a real London property.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"WebPage",name:`${Ye} Sample Report`,url:xe(e),description:"Sample UK property development appraisal report — EPC, planning, permitted development, owner intel and AI appraisal.",publisher:{"@type":"Organization",name:Ye}}}}function oB(){const e="/terms";return{title:`Terms of Service | ${Ye}`,description:"Scapely terms of service — acceptable use, subscription terms, data accuracy disclaimers and cancellation policy for the Scapely UK property intelligence platform.",canonical:xe(e),ogImage:xe(qt),jsonLd:{"@context":"https://schema.org","@type":"WebPage",name:`${Ye} Terms of Service`,url:xe(e)}}}function lB(){return`
124    <h1>Scapely dashboard — every UK property feature in one view</h1>
125    <p>The Scapely dashboard turns a UK address into a full development-grade appraisal in under a minute. No tab-juggling between EPC registers, planning portals, flood maps and Land Registry — every signal a buyer, developer or investor needs sits on one screen.</p>
126    <h2>Three pillars. Zero guesswork.</h2>
127    <ul>
128      <li><strong>Real-time feasibility</strong> — April 2026 regional build benchmarks (£/sqm) applied to the property's footprint, with fees and contingency buffers so you see the real all-in cost.</li>
129      <li><strong>AI objection-risk analyser</strong> — council-by-council planning-objection scoring with the key themes (massing, daylight, parking, conservation) likely to drive refusal.</li>
130      <li><strong>One intelligent dashboard</strong> — replaces a dozen open tabs with a single appraisal canvas.</li>
131    </ul>
132    <h2>Every feature on the dashboard</h2>
133    <ul>
134      <li><strong>EPC rating &amp; MEES uplift</strong> — current and potential energy rating from the EPC Open Data Communities register, plus the modelled cost to reach the proposed minimum-C standard.</li>
135      <li><strong>Planning history</strong> — every application on the site and neighbouring properties, with status and date.</li>
136      <li><strong>Article 4 &amp; Class MA flags</strong> — whether permitted-development rights have been removed and whether office-to-resi prior approval is still available.</li>
137      <li><strong>Flood risk</strong> — Environment Agency Zone 1/2/3 classification with surface-water context.</li>
138      <li><strong>PTAL &amp; access</strong> — TfL PTAL score for London plus walk-time and station context.</li>
139      <li><strong>Plot intelligence</strong> — Ordnance Survey footprint, boundary, frontage and aerial imagery for sizing schemes.</li>
140      <li><strong>Owner intelligence</strong> — Companies House director, PSC and charges data for property-holding entities (Enterprise).</li>
141      <li><strong>Title Register</strong> — on-demand HM Land Registry tenure lookup so freehold vs leasehold isn't a guess.</li>
142      <li><strong>Build-cost model</strong> — council-level £/sqm reconciled against CIL and Building Safety Act exposure.</li>
143      <li><strong>Client-side PDF report</strong> — exportable property report generated entirely in the browser for data privacy.</li>
144    </ul>
145    <h2>Who it's for</h2>
146    <p>UK property buyers doing serious due diligence, investors running buy-to-let, HMO, serviced-accommodation or BTR portfolios, small house
146-builders hunting refurb-and-flip sites, and planning consultants pre-screening client briefs.</p>
147    <p><a href="/pricing">See pricing</a> · <a href="/strategies">Development strategies</a> · <a href="/councils">UK council guides</a> · <a href="/property-data">Data sources</a> · <a href="/faq">FAQ</a></p>`}function cB(){return`
148    <h1>Scapely — UK property intelligence for buyers, developers and investors</h1>
149    <p>Scapely is an AI-powered UK property intelligence platform. We overlay developer-grade appraisals — build cost, planning risk, HMO viability, Article 4 status, flood risk, EPC rating and ownership — on every listing across Rightmove, Zoopla, OnTheMarket and the major UK auction houses, and surface the same data through a web dashboard and Chrome extension.</p>
150    <h2>What Scapely tells you in one click</h2>
151    <ul>
152      <li><strong>Build cost</strong> — council-level £/sqm benchmark reconciled against CIL, BSA Gateway exposure and access constraints.</li>
153      <li><strong>Planning risk</strong> — Article 4 directions, conservation areas, listed buildings, recent planning history.</li>
154      <li><strong>EPC &amp; MEES</strong> — current rating plus the uplift cost to hit the proposed minimum-C standard.</li>
155      <li><strong>Flood risk</strong> — Environment Agency Zone 1/2/3 classification used by lenders and insurers.</li>
156      <li><strong>Ownership intel</strong> — Companies House director, PSC and charges data on Pro and Enterprise.</li>
157      <li><strong>PTAL &amp; access</strong> — TfL PTAL score and walk-time context for London properties.</li>
158    </ul>
159    <h2>Built for the way UK property professionals screen deals</h2>
160    <p>Whether you are an investor running a buy-to-let or HMO portfolio, a small house-builder hunting refurb-and-flip sites, a planning consultant pre-screening client briefs, or a buyer doing serious due diligence on a single home — Scapely cuts a 30-minute manual lookup cycle to under 10 seconds per listing.</p>
161    <p><a href="/pricing">See pricing</a> · <a href="/strategies">Browse development strategies</a> · <a href="/councils">UK council guides</a> · <a href="/property-data">The data behind Scapely</a> · <a href="/faq">FAQ</a></p>`}function dB(){return`
162    <h1>Pricing — start free, upgrade when you need more</h1>
163    <p>Scapely pricing is simple. Every new account gets a week-long Pro trial to explore the full dashboard — no card required. Upgrade to Pro for 50 development appraisals per month, or Enterprise for 200. Every feature is included on both paid tiers.</p>
164    <h2>Free — £0</h2>
165    <p>Three full development appraisals per calendar month. Build-cost estimates, planning-risk scoring, EPC rating, flood risk, Article 4 and Class MA eligibility flags. No credit card required. Open the dashboard to start.</p>
166    <h2>Pro — £29.99 / month</h2>
167    <p>Fifty development appraisals per month. Full planning history, build-cost modelling, HMO viability, MEES uplift cost, PTAL score, council objection-risk score with key themes, Companies House owner intel and exportable PDF reports. Cancel anytime.</p>
168    <h2>Enterprise — £59.99 / month</h2>
169    <p>Two hundred development appraisals per month — every feature in Pro, scaled for property funds, brokerages and planning consultancies running high volumes. Cancel anytime.</p>
170    <p>All payments are processed by Stripe for Scapely Ltd. Pricing in GBP. VAT additional where applicable.</p>
171    <p><a href="/faq">FAQ</a> · <a href="/property-data">Data sources</a> · <a href="/terms">Terms</a> · <a href="/privacy">Privacy</a></p>`}function uB(){return`
172    <h1>Resources — thought-leadership for UK property developers</h1>
173    <p>A curated library of playbooks, market benchmarks and reference material — written by the same team that builds Scapely's appraisal engine. Free for everyone on every tier, no signup required.</p>
174    <h2>Strategy playbooks</h2>
175    <p>Step-by-step playbooks for the strategies UK developers actually run — <a href="/strategies">HMO conversion, Class MA office-to-resi, BTL, BTR, PBSA, refurb-and-flip and more</a>. Each playbook covers planning route, build-cost benchmark, finance structure and exit comparables.</p>
176    <h2>Council intelligence</h2>
177    <p>Per-council guides covering build cost, Article 4, planning history and CIL rates for <a href="/councils">${nn.length} major UK local authorities</a> — plus the long-tail combinations such as "HMO conversion in Manchester" or "Class MA in Birmingham".</p>
178    <h2>Postcode benchmarks</h2>
179    <p>Postcode-level <a href="/postcodes">development opportunity scoring</a> across England, Scotland, Wales and Northern Ireland — yield context, planning friction and EPC stock by area.</p>
180    <h2>Reference material</h2>
181    <p>The <a href="/glossary">UK property development glossary</a> (Article 4, Class MA, BSA Gateway, CIL, MEES, HMO, GDV and more), the <a href="/faq">Scapely FAQ</a> and a full <a href="/property-data">inventory of the data sources</a> behind every appraisal.</p>
182    <p><a href="/dashboard">Open the live dashboard</a> · <a href="/pricing">Pricing</a></p>`}function hB(){return`
183    <h1>Contact Scapely</h1>
184    <p>Scapely is built and supported by a UK-based team. We reply to every enquiry within one working day.</p>
185    <h2>Product support</h2>
186    <p>Question about an appraisal, an account or a billing issue? Email <a href="mailto:[email protected]">[email protected]</a> and we'll get back to you the same working day.</p>
187    <h2>Enterprise sales &amp; data partnerships</h2>
188    <p>
188If you are a property fund, brokerage, planning consultancy or proptech building on top of UK property data, we offer bespoke Enterprise pricing, API access and Companies House owner intelligence. Email <a href="mailto:[email protected]">[email protected]</a>.</p>
189    <h2>Press &amp; media</h2>
190    <p>For press enquiries, embargoed data and commentary on the UK property market, email <a href="mailto:[email protected]">[email protected]</a>.</p>
191    <p><a href="/pricing">Pricing</a> · <a href="/faq">FAQ</a> · <a href="/privacy">Privacy</a> · <a href="/terms">Terms</a></p>`}function pB(){return`
192    <h1>Privacy Policy</h1>
193    <p>Scapely is committed to UK GDPR-compliant data handling. This page summarises what personal data we collect, why we collect it, how long we keep it and the rights you have over it. The Scapely web app loads the full, legally-binding policy.</p>
194    <h2>What we collect</h2>
195    <ul>
196      <li><strong>Account data</strong> — email address and authentication identifiers, stored against your Supabase auth record.</li>
197      <li><strong>Usage data</strong> — which appraisals you ran, retained for the seven-day cache window plus operational logging.</li>
198      <li><strong>Billing data</strong> — handled by Stripe. We never see or store full card numbers.</li>
199    </ul>
200    <h2>What we don't do</h2>
201    <p>We do not sell personal data. We do not scrape listing prices from third-party portals. We do not share your appraisal history with third parties beyond the sub-processors strictly needed to run the service (Supabase, Stripe, Resend, hosting).</p>
202    <h2>Your rights</h2>
203    <p>You can request export or deletion of your account data at any time by emailing <a href="mailto:[email protected]">[email protected]</a>.</p>
204    <p><a href="/terms">Terms of service</a> · <a href="/contact">Contact</a></p>`}function fB(){return`
205    <h1>Terms of Service</h1>
206    <p>These terms govern your use of Scapely. The Scapely web app loads the full, legally-binding terms; this prerendered summary exists so search engines and AI crawlers can index the key points.</p>
207    <h2>Acceptable use</h2>
208    <p>Scapely is licensed for property due diligence by buyers, investors, developers and the professionals advising them. You may not bulk-scrape the service, resell raw appraisals, or use the product to populate a competing dataset.</p>
209    <h2>Subscriptions and cancellation</h2>
210    <p>Paid subscriptions are billed monthly via Stripe. Cancel any time from the billing page — your subscription remains active until the end of the current billing period and you keep access until then.</p>
211    <h2>Data accuracy</h2>
212    <p>Scapely aggregates third-party open data (planning.data.gov.uk, EPC Open Data Communities, Environment Agency, Ordnance Survey, Companies House, HM Land Registry and others). We make every reasonable effort to keep the data current but it is provided "as is" — always verify with the source register before committing capital.</p>
213    <h2>Liability</h2>
214    <p>Scapely is a decision-support tool, not investment, planning or legal advice. We are not liable for losses arising from reliance on appraisal outputs.</p>
215    <p><a href="/privacy">Privacy policy</a> · <a href="/contact">Contact</a></p>`}function mB(){const e=[];e.push({path:"/",meta:gy(),contentHtml:cB()}),e.push({path:"/pricing",meta:tB(),contentHtml:dB()}),e.push({path:"/resources",meta:sB(),contentHtml:uB()}),e.push({path:"/contact",meta:nB(),contentHtml:hB()}),e.push({path:"/privacy",meta:aB(),contentHtml:pB()}),e.push({path:"/terms",meta:oB(),contentHtml:fB()}),e.push({path:"/dashboard-features",meta:rB(),contentHtml:lB()}),e.push({path:"/investors",meta:NS(),contentHtml:VD()}),e.push({path:"/property-data",meta:CS(),contentHtml:zD()}),e.push({path:"/councils",meta:ES(),contentHtml:FD()}),e.push({path:"/strategies",meta:AS(),contentHtml:KD()}),e.push({path:"/postcodes",meta:DS(),contentHtml:JD()}),e.push({path:"/glossary",meta:PS(),contentHtml:QD()}),e.push({path:"/faq",meta:MS(),contentHtml:ZD()}),e.push({path:"/alternatives",meta:LS(),contentHtml:XD()});
215for(const t of nn)e.push({path:`/councils/${t.slug}`,meta:TS(t),contentHtml:GD(t)});for(const t of Pa)e.push({path:`/strategies/${t.slug}`,meta:RS(t),contentHtml:WD(t)});for(const t of Ma)e.push({path:`/postcodes/${t.code.toLowerCase()}`,meta:BS(t),contentHtml:eB(t)});for(const t of nn)for(const s of Pa)e.push({path:`/councils/${t.slug}/strategies/${s.slug}`,meta:OS(t,s),contentHtml:YD(t,s)});return e}const gB="/assets/Landscape_1778868907447-Biu83Ri6.webp",xB="/assets/LightLaptop_1781767743237-BUj-_i0j.webp",yB="/assets/panel_1781886565924-BNUvnLD4.png",bB="/assets/Lighttheme_animation_1781770346993-DnhlmR60.mp4";function vB(){return n.jsxs("div",{className:"relative h-full w-full overflow-hidden",children:[n.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 bg-[#0a0e2a] bg-cover bg-center bg-no-repeat bg-blend-overlay",style:{backgroundImage:`url(${gB})`}}),n.jsx("div",{className:"absolute inset-0 mix-blend-color","aria-hidden":!0,style:{background:"linear-gradient(180deg, rgba(10,14,42,0.35) 0%, rgba(34,211,238,0.10) 60%, rgba(217,70,239,0.10) 100%)"}}),n.jsx("div",{className:"absolute inset-x-0 top-0 h-40","aria-hidden":!0,style:{background:"linear-gradient(to bottom, rgba(7,10,32,0.85), rgba(7,10,32,0))"}}),n.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-24","aria-hidden":!0,style:{background:"linear-gradient(to bottom, transparent, rgba(10,14,42,0.85) 65%, #06081c)"}})]})}function wB({className:e=""}){return n.jsxs("div",{className:`pointer-events-none relative mx-auto w-full max-w-[820px] ${e}`,children:[n.jsx(Se.img,{src:xB,alt:"","aria-hidden":!0,initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.7,delay:.2},className:"block w-full drop-shadow-[0_30px_60px_rgba(0,0,0,0.35)]"}),n.jsx("video",{src:bB,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,"aria-hidden":!0,preload:"auto",className:"pointer-events-none absolute",style:{top:"calc(48.7% + 24px)",left:"calc(56.5% - 3.05px)",width:"18.1%"}}),n.jsx(jB,{className:"absolute -left-[10px] top-[14%] hidden w-[260px] sm:block lg:left-0 lg:w-[290px]"})]})}function jB({className:e=""}){const t="Scapely live appraisal: 225 Sanford St, SE14 6JQ — Estimated GDV £450,000, 2027 MEES Compliant, Risk Score Low (Approved)",s={initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.6,delay:.45,ease:"easeOut"}};return n.jsx("div",{className:e,children:n.jsx(Se.img,{src:yB,alt:t,...s,className:"pointer-events-auto block h-auto w-full drop-shadow-[0_20px_40px_rgba(0,0,0,0.25)]"})})}function kB({from:e,to:t}){const[s,r]=w.useState(e);return w.useEffect(()=>{const o=jS(e,t,{duration:2.4,ease:"easeOut",repeat:1/0,repeatType:"reverse",repeatDelay:1.2,onUpdate:c=>r(c)});return()=>o.stop()},[e,t]),n.jsxs(n.Fragment,{children:["£",Math.round(s).toLocaleString("en-GB")]})}function _B(){return n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4",children:[n.jsxs(Se.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{delay:.05,duration:.5},className:"rounded-xl border border-cyan-200 bg-white p-3.5 shadow-sm dark:border-cyan-400/20 dark:bg-[#06081c]/70 dark:shadow-none",children:[n.jsxs("div",{className:"flex items-center gap-2 font-mono text-[9px] uppercase tracking-[0.2em] text-cyan-700 dark:text-cyan-400",children:[n.jsx(_k,{className:"h-3 w-3"}),"Live Scan"]}),n.jsx("div",{className:"mt-1.5 text-[13px] font-semibold text-slate-900 dark:text-white",children:"SE15 4AB · Peckham"}),n.jsx("div",{className:"mt-1 font-mono text-[10px] text-slate-500 dark:text-slate-400",children:"142m² plot · GIA est. 168m²"}),n.jsx("div",{className:"mt-2 flex h-1 w-full overflow-hidden rounded-full bg-slate-200 dark:bg-white/10",children:n.jsx(Se.div,{initial:{width:0},animate:{width:["0%","100%","0%"]},transition:{duration:2.4,repeat:1/0},className:"h-full bg-gradient-to-r from-cyan-400 to-fuchsia-400"})})]}),n.jsxs(Se.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{delay:.15,duration:.5},className:"rounded-xl border border-emerald-200 bg-white p-3.5 shadow-sm dark:border-emerald-400/20 dark:bg-[#06081c]/70 dark:shadow-none",children:[n.jsxs("div",{className:"flex items-center gap-2 font-mono text-[9px] uppercase tracking-[0.2em] text-emerald-700 dark:text-emerald-400",children:[n.jsx(wx,{className:"h-3 w-3"}),"Council Risk"]}),n.jsxs("div",{className:"mt-1.5 flex items-baseline gap-2",children:[n.jsx("span",{className:"text-[20px] font-semibold text-slate-900 dark:text-white",children:"2.1%"}),n.jsx(Se.span,{animate:{boxShadow:["0 0 0 0 rgba(52,211,153,0)","0 0 0 3px rgba(52,211,153,0.2)","0 0 0 0 rgba(52,211,153,0)"]},transition:{duration:2.2,repeat:1/0,ease:"easeInOut"},className:"rounded bg-emerald-100 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider text-emerald-700 dark:bg-emerald-400/15 dark:text-emerald-300",children:"Low"})]}),n.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-slate-500 dark:text-slate-400",children:"Article 4 · clear"}),n.jsxs("div",{className:"relative mt-2 h-1 w-full overflow-hidden rounded-full bg-slate-200 dark:bg-white/10",children:[n.jsx(Se.div,{initial:{x:"-40%"},animate:{x:["-40%","120%"]},transition:{duration:2.4,repeat:1/0,ease:"linear"},className:"absolute inset-y-0 w-1/3 bg-gradient-to-r from-transparent via-emerald-400/50 to-transparent"}
215),n.jsx(Se.div,{animate:{opacity:[.55,1,.55]},transition:{duration:1.6,repeat:1/0,ease:"easeInOut"},className:"absolute inset-y-0 left-[2.1%] w-[3px] rounded-full bg-emerald-500 shadow-[0_0_6px_rgba(52,211,153,0.6)]"})]})]}),n.jsxs(Se.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{delay:.25,duration:.5},className:"rounded-xl border border-fuchsia-200 bg-white p-3.5 shadow-sm dark:border-fuchsia-400/20 dark:bg-[#06081c]/70 dark:shadow-none",children:[n.jsxs("div",{className:"flex items-center gap-2 font-mono text-[9px] uppercase tracking-[0.2em] text-fuchsia-700 dark:text-fuchsia-400",children:[n.jsx(an,{className:"h-3 w-3"}),"Estimated GDV"]}),n.jsx("div",{className:"mt-1.5 text-[20px] font-semibold tabular-nums text-slate-900 dark:text-white",children:n.jsx(kB,{from:485400,to:612400})}),n.jsxs("div",{className:"mt-0.5 flex items-center gap-1 font-mono text-[10px] text-emerald-600 dark:text-emerald-300",children:[n.jsx(Se.span,{animate:{y:[0,-2,0],opacity:[.7,1,.7]},transition:{duration:1.8,repeat:1/0,ease:"easeInOut"},className:"inline-block",children:"▲"}),"+£127k vs. listing"]})]}),n.jsxs(Se.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{delay:.35,duration:.5},className:"rounded-xl border border-cyan-200 bg-white p-3.5 shadow-sm dark:border-cyan-400/20 dark:bg-[#06081c]/70 dark:shadow-none",children:[n.jsxs("div",{className:"flex items-center gap-2 font-mono text-[9px] uppercase tracking-[0.2em] text-cyan-700 dark:text-cyan-400",children:[n.jsx(kn,{className:"h-3 w-3"}),"EPC Uplift"]}),n.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[n.jsx(Se.span,{animate:{opacity:[1,.4,1],scale:[1,.96,1]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},className:"rounded bg-amber-100 px-1.5 py-0.5 font-mono text-[10px] font-bold text-amber-700 dark:bg-amber-400/15 dark:text-amber-300",children:"D"}),n.jsx(Se.span,{animate:{x:[0,3,0],opacity:[.6,1,.6]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},className:"text-slate-400 dark:text-slate-500",children:"→"}),n.jsx(Se.span,{animate:{opacity:[.55,1,.55],scale:[.96,1.06,.96],boxShadow:["0 0 0 0 rgba(52,211,153,0)","0 0 0 4px rgba(52,211,153,0.2)","0 0 0 0 rgba(52,211,153,0)"]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},className:"rounded bg-emerald-100 px-1.5 py-0.5 font-mono text-[10px] font-bold text-emerald-700 dark:bg-emerald-400/15 dark:text-emerald-300",children:"B"})]}),n.jsx("div",{className:"mt-1 font-mono text-[10px] text-emerald-600 dark:text-emerald-300",children:"+£18k value add"})]})]})}const fp="/assets/ScapelyLogotype_1781768423088-C0I-OCun.svg",_n="/assets/ScapelyLogotype_white_1781768423088-CZCzeYbO.svg",zo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAB5FJREFUeAHtnet12zYUx691OkA2CDqB3QnCTJBM0CgTxJ3AygRxB+iRM0GcCaRMYHsCKhPY/d72X1wDtEAQlPgCCVD4nQOTMkXxcXkfAC7AMwocAK/k4kKX17IIXV4ZxeTJKvey/JRlx+Xs7OyeAueMAkMKQcjFe1nOZclICWBICkF9l2UbopCCEIoURCYXb0gJ46LhbjtrWVBoj6Dmv7OV5asU0JYCYDKhaLO0lOUdKY1wUTzVD3rJ5UnevB01P4bQhYV9rpeiZpcdKQF9bnqMWcA3SpYrWR7hZiPLpdYeX+cgZFnK8u3Aeax9nkMQ6BuxPiKIVzQB8rjvZbk5cG4ZzYkDmsGfr2Vp6kO8Y2hQDrfmCIod/QS6hLGaSiuackA4VxQj+onbxCgMmxrh5FFpTY12fIvqIhzoByo+rZEn+cXxRGU0E2oswF2QDxyUM984tCMqU9UUh9bkQQlGPz25cYJsui5p5tRc93uaGseJ8XowIa5v9PXfWVoz3QPJN98hEEEnCFR9y2T8AMChIXdz9R9NcfiZ8TQmCaQeh2A+kG+SQI7jEIxfH4ty2JsngbixfEzuzddCNSr6P9BMgKqn+bMoUO0/JoISB4GqUOfGPftCQ+HwI7OvGA6FvndmO2BGQ4Byx9SaEq2A6rwreOxtxiyzlSez1Q3Lv3Q3Yw6ztaREJ7R/6W/GUI62ktnqiWXGNtQWrSUmghK9Qbmet2yzr+3cV5QYBDZbpo+u+96ZY0chF8UOO1ne+k5Mg2qKaBOVgMaBE/8eaEC06cr0x4/y92+a7DSalsDdn3+M/2T5Z6TyFw1ME21ZWDsIUvm8DKeM3pAnoHrpvlE7DYkena+81R/Zd2f2dxbWZ/5CcZNuPZut4Zod4uOz
215sV7pELOF8qlmx0HRPkTQiaK15Ul/ZHNWshYvQtGmq2j733rWktTkT/SnsV5qT1zUbPhKCd9cG+tvzA2Lmg1bSnhFWiI2X1v9sWTCnoUysulK7PlhrC+LlV/0MjM2fif/7Kgdn419xqo4ErU/z7bc0j76ysg0aSg3LWfkGVTb1poQ5xCEI2BfeX60N9w5N4xzMm0IM5m6B5ZCCP7fAvtx6sw9jUeXehCf5wbz6tsx/UrGf9jRm3lJgza+HUIGE2w/uwhGyLLGXIa7lRVByQLlzpfRs8ahGuhydCNH5AnlUL2SBez4nzVFGN95opHRTQ5vqVuFVcjCfibaIEDXV4r7fv7813I0kzZ/oH7wZ1OtERQhsAMtGF2UFABwD2FrSpQDlmArBvZPZk4BAffAz6asEZHWoDyxgjDrC0EJhUE1zakNOSIZBItyQnjGjr7wIzsKDG6Dk+VX6h46bxBHEFAKsBYUAVIwK1IR2o7as0JkQUAUQmEGCJ1ZMFEEAdEIhdHmbClXP1I3reHJF4Kf/YKFUtgzQZGgc6VYa7bUHm61YF+zpFBBoCFxU9AvdGbNmTxfAOWQ+GKSZvuhQf/QWdCEwG6+R0DNLH1BP62ZLHSG3aoCW3UiB/1anTeYQGtgVeDZ0Vfb8yOmZ+ic0chBAJR1KlXgF1QOLQXNgJ6hsyDViTZWnabSyTg7TTExQucu3dxXGMfHmvd897KGuoyKGYFuQYD3nliUh55k5oZKRsUcQfvQeUmegTFfWPG/opnFzKgY4+n4gPEG/vxrXDRHN4ICAVZmavH/Qiimzc0oMRaZsf6SmfosFGu8xBuk2YnG4p2xvi1WzFbiIq43k/MSntAPfuEqSi/bMYVya6zPMm83MEzfvTU3vAjFMmEXyYQ906V+0xRzKkNzVFelk6vYyAKJLlVnYG59vRpKR12Z/lh5T5gtlGtj/ROdLnyT/iB/mO6hkhTimnGi/YwILZHH4KF8v9M4nFHz11z9TUpDtuQJVGf0+E2nrh7cyZwRof1sO4mDWM0qzecSQJ/ZdhK1oM/sUJa25CkSGwb0nffG0pYVJXphaUmOLg2/1o88Ysatx2OAoaZ+RLkPIjn9jsCaaJv6gOqEx6deoWxNL+d+4Ecz60dTY2VDHA/1ioYC1Qn1UzTWAJSjreEzUFGOxpJ/OQLGeGEDqv3bpzyz3UHkvfmEMv662KHew2VO35H6XSz0PYIXP3LgoEvroEkwGsdDu6KxQHmWiiQYeolSTYHc0Nigmtx2soKBSpnCpAIxTsYWzGxfTVsHylHWtAIpcPiYHCfQTgZVMVxb135NoYDq21Fn/f5gx/UyKwoNuPN013PTGoe54gcwo5BB9T26OWbQewkVXdkvb95E89DBPUUUf46uMRNu3xGmuTqGNmc3jotZx/B0aWFcoToB6SbGh6sE3E6xuDjvwy7aos3UF4cw5he8oH7WO/7f5ZTao7XiEu7J31gYXB+bb/0Lh6ck3Oib4908WIJ4DEkYTTMHB0ebLk5yrjNhO1Lpoz/08v5oJmH9sfjGClKZn+d6KWq+viU1gOem6/H6MplQCrBPdubc5WMawjdpZyx/1nzvtV4WL2ATdPx3eXyO15TVpkwuFBNDQO+o/CqqoWEhFFq4DUEQJkEJxQb710RlpMxOl1FmO10e9HJLavjBJKapCUELpQ7sp84QNV/Z8Z9Y3wPzP6m8VwPkWfldAAAAAElFTkSuQmCC",SB="/videos/demo.mp4";function NB(){document.getElementById("hero")?.scrollIntoView({behavior:"smooth",block:"start"}),window.setTimeout(()=>{document.getElementById("hero-email")?.focus()},600)}function CB({onToggle:e}){const[t,s]=w.useState(!1),[r,o]=w.useState(!1);w.useEffect(()=>{const d=()=>s(window.scrollY>8);return d(),window.addEventListener("scroll",d,{passive:!0}),()=>window.removeEventListener("scroll",d)},[]),w.useEffect(()=>{if(!r)return;const d=h=>{h.key==="Escape"&&o(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r]);const c=[{href:"/demo-report",label:"Demo Report",testId:"link-mobile-insights"},{href:"/pricing",label:"Pricing",testId:"link-mobile-pricing"},{href:"/resources",label:"Resources",testId:"link-mobile-resources"},{href:"/property-data",label:"Property data",testId:"link-mobile-property-data"},{href:"/investors",label:"Investors",testId:"link-mobile-investors"},{href:"/contact",label:"Contact",testId:"link-mobile-contact"},{href:"/dashboard?mode=signin",label:"Sign in",testId:"link-mobile-signin"}];return n.jsxs("header",{className:`fixed top-0 z-40 w-full transition-colors duration-200 ${t||r?"border-b border-slate-200/60 backdrop-blur-md dark:border-white/[0.07]":""}`,children:[n.jsxs("div",{className:"relative mx-auto flex h-16 w-full max-w-7xl items-center justify-between px-6 sm:h-20",children:[n.jsxs("a",{href:"#hero",className:"flex items-center gap-3","data-testid":"link-logo",children:[n.jsx("img",{src:zo,alt:"Scapely",className:"block h-7 w-auto sm:hidden [filter:brightness(0)] dark:[filter:brightness(1)]"}),n.jsx("img",{src:fp,alt:"Scapely",className:"hidden h-[15px] w-auto sm:block sm:h-[16px] dark:hidden"}),n.jsx("img",{src:_n,alt:"",className:"hidden h-[15px] w-auto sm:dark:block sm:h-[16px]"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("a",{href:"/demo-report","data-testid":"link-nav-insight",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-700 transition hover:text-slate-900 dark:text-slate-200 dark:hover:text-white sm:inline-flex",children:"Demo Report"}),n.jsx("a",{href:"/pricing","data-testid":"link-nav-pricing",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-700 transition hover:text-slate-900 dark:text-slate-200 dark:hover:text-white sm:inline-flex",children:"Pricing"}),n.jsx("a",{href:"/resources","data-testid":"link-nav-resources",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-700 transition hover:text-slate-900 dark:text-slate-200 dark:hover:text-white sm:inline-flex",children:"Resources"}),n.jsx("a",{href:"/dashboard?mode=signin","data-testid":"link-nav-signin",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-700 transition hover:text-slate-900 dark:text-slate-200 dark:hover:text-white sm:inline-flex",children:"Sign in"}),n.jsxs("button",{type:"button",onClick:e,"aria-label":"Toggle dark mode",className:"hidden h-9 w-9 items-center justify-center rounded-lg text-slate-500 transition hover:bg-slate-100 dar
215k:text-slate-400 dark:hover:bg-white/10 sm:inline-flex",children:[n.jsx(Rc,{className:"h-4 w-4 dark:hidden"}),n.jsx(Ac,{className:"hidden h-4 w-4 dark:block"})]}),n.jsx("a",{href:"/pricing","data-testid":"button-nav-cta",className:"inline-flex h-9 items-center rounded-full border border-slate-900 bg-transparent px-4 text-[13px] font-semibold text-slate-900 transition hover:bg-slate-900 hover:text-white active:scale-[0.98] dark:border-white dark:text-white dark:hover:bg-white dark:hover:text-[#06081c]",children:"Create account"}),n.jsx("button",{type:"button","aria-label":r?"Close menu":"Open menu","aria-expanded":r,"data-testid":"button-mobile-menu",onClick:()=>o(d=>!d),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-slate-700 transition hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-white/10 sm:hidden",children:r?n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})]})]}),r&&n.jsx("div",{"data-testid":"mobile-menu",className:"border-t border-slate-200 bg-white/95 backdrop-blur-md dark:border-white/10 dark:bg-[#06081c]/95 sm:hidden",children:n.jsxs("nav",{className:"mx-auto flex max-w-7xl flex-col px-4 py-3",children:[n.jsxs("button",{type:"button",onClick:()=>{e(),o(!1)},className:"flex items-center gap-3 rounded-lg px-3 py-3 text-[15px] font-medium text-slate-800 transition hover:bg-slate-100 dark:text-slate-100 dark:hover:bg-white/10",children:[n.jsx(Rc,{className:"h-4 w-4 dark:hidden"}),n.jsx(Ac,{className:"hidden h-4 w-4 dark:block"}),n.jsx("span",{className:"dark:hidden",children:"Switch to dark mode"}),n.jsx("span",{className:"hidden dark:block",children:"Switch to light mode"})]}),c.map(d=>n.jsx("a",{href:d.href,"data-testid":d.testId,onClick:()=>o(!1),className:"rounded-lg px-3 py-3 text-[15px] font-medium text-slate-800 transition hover:bg-slate-100 dark:text-slate-100 dark:hover:bg-white/10",children:d.label},d.testId))]})})]})}function EB(){const e=["EPC · 24.1M certificates indexed","PLANNING · 412k applications parsed","BUILD COST · April 2026 benchmarks live","ARTICLE 4 · 1,820 zones tracked","GDV MODEL · v3.2 — Land Registry sync 09:14","OBJECTIONS · 2.3M minutes vector-indexed"],t=[...e,...e];return n.jsxs("div",{className:"relative overflow-hidden border-y border-slate-200 bg-slate-100 dark:border-white/10 dark:bg-[#06081c]",children:[n.jsx("div",{className:"flex animate-ticker whitespace-nowrap py-3",children:t.map((s,r)=>n.jsxs("span",{className:"mx-6 inline-flex items-center gap-2 font-mono text-[11px] uppercase tracking-wider text-slate-500 dark:text-slate-400",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-cyan-600 dark:bg-cyan-400"}),s]},r))}),n.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-16 bg-gradient-to-r from-slate-100 to-transparent dark:from-[#06081c]"}),n.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-16 bg-gradient-to-l from-slate-100 to-transparent dark:from-[#06081c]"})]})}const H5=["UK address or postcode","14 Ladbroke Grove, London W11","32 Park Road, Manchester M14","7 Victoria Street, Bristol BS1","45 The High Street, Brighton BN1","12 Church Lane, Leeds LS1","3 Clifton Road, Birmingham B12"];function TB(e){const[t,s]=w.useState("");return w.useEffect(()=>{if(!e)return;let r=0,o=0,c=!1,d;function h(){const p=H5[r];c?(o--,s(p.slice(0,o)),o===0?(c=!1,r=(r+1)%H5.length,d=setTimeout(h,400)):d=setTimeout(h,30)):(o++,s(p.slice(0,o)),o===p.length?(c=!0,d=setTimeout(h,1800)):d=setTimeout(h,55))}return d=setTimeout(h,700),()=>clearTimeout(d)},[e]),t}function AB(){const[e,t]=w.useState(""),s=TB(e==="");function r(o){o.preventDefault();const c=e.trim();c&&(window.location.href=`/dashboard?q=${encodeURIComponent(c)}`)}return n.jsxs("section",{id:"hero",className:"relative isolate w-full overflow-hidden bg-slate-50 pt-8 pb-12 dark:bg-[#06081c] sm:pt-16 sm:pb-20",children:[n.jsx("div",{className:"absolute inset-0 hidden dark:block","aria-hidden":!0,
215children:n.jsx(vB,{})}),n.jsxs("div",{className:"relative mx-auto flex w-full max-w-7xl flex-col items-center px-6 text-center",children:[n.jsx(Se.p,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.5,delay:.05},className:"mt-10 font-mono text-[11px] font-semibold uppercase tracking-widest text-slate-900 dark:text-cyan-400 sm:hidden",children:"Scapely"}),n.jsxs(Se.h1,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.55,delay:.1},className:"mt-2 text-4xl font-semibold leading-tight tracking-tight text-slate-900 dark:text-white sm:hidden","aria-label":"UK Property Intelligence for Investors, Developers and Buyers",children:["UK Property",n.jsx("br",{}),"Intelligence for",n.jsx("br",{}),n.jsx("span",{"aria-hidden":"true",className:"scapely-rotator inline-block h-[1em] overflow-hidden align-bottom leading-[1]",children:n.jsxs("span",{className:"scapely-rotator-track block h-[4em]",children:[n.jsx("span",{className:"block h-[1em] leading-[1] bg-gradient-to-r from-cyan-500 via-sky-400 to-fuchsia-500 bg-clip-text text-transparent [-webkit-text-fill-color:transparent]",children:"Investors"}),n.jsx("span",{className:"block h-[1em] leading-[1] bg-gradient-to-r from-cyan-500 via-sky-400 to-fuchsia-500 bg-clip-text text-transparent [-webkit-text-fill-color:transparent]",children:"Developers"}),n.jsx("span",{className:"block h-[1em] leading-[1] bg-gradient-to-r from-cyan-500 via-sky-400 to-fuchsia-500 bg-clip-text text-transparent [-webkit-text-fill-color:transparent]",children:"Buyers"}),n.jsx("span",{className:"block h-[1em] leading-[1] bg-gradient-to-r from-cyan-500 via-sky-400 to-fuchsia-500 bg-clip-text text-transparent [-webkit-text-fill-color:transparent]",children:"Investors"})]})})]}),n.jsxs(Se.h1,{initial:{opacity:0,y:14},animate:{opacity:1,y:0},transition:{duration:.6,delay:.05},className:"mx-auto hidden max-w-3xl text-balance text-[21px] font-semibold leading-[1.1] tracking-tight text-slate-900 dark:text-white sm:block sm:text-[29px] md:text-[31px] lg:text-[46px]","aria-label":"Property buyer, developer and investor due diligence",children:[n.jsx("span",{"aria-hidden":"true",children:"Property-"}),n.jsx("span",{"aria-hidden":"true",className:"scapely-rotator inline-block h-[1.1em] overflow-hidden align-bottom leading-[1.1]",children:n.jsxs("span",{className:"scapely-rotator-track block h-[4.4em]",children:[n.jsx("span",{className:"block h-[1.1em] leading-[1.1] text-left bg-gradient-to-r from-cyan-500 via-sky-400 to-fuchsia-500 bg-clip-text text-transparent [-webkit-text-fill-color:transparent]",children:"buyer"}),n.jsx("span",{className:"block h-[1.1em] leading-[1.1] text-left bg-gradient-to-r from-cyan-500 via-sky-400 to-fuchsia-500 bg-clip-text text-transparent [-webkit-text-fill-color:transparent]",children:"developer"}),n.jsx("span",{className:"block h-[1.1em] leading-[1.1] text-left bg-gradient-to-r from-cyan-500 via-sky-400 to-fuchsia-500 bg-clip-text text-transparent [-webkit-text-fill-color:transparent]",children:"investor"}),n.jsx("span",{className:"block h-[1.1em] leading-[1.1] text-left bg-gradient-to-r from-cyan-500 via-sky-400 to-fuchsia-500 bg-clip-text text-transparent [-webkit-text-fill-color:transparent]",children:"buyer"})]})}),n.jsx("br",{}),"due diligence"]}),n.jsx("style",{children:`
216          @keyframes scapely-rotate {
217            0%, 28%   { transform: translateY(0); }
218            33%, 61%  { transform: translateY(-25%); }
219            66%, 94%  { transform: translateY(-50%); }
220            100%      { transform: translateY(-75%); }
221          }
222          .scapely-rotator-track {
223            animation: scapely-rotate 7.5s cubic-bezier(0.7, 0, 0.3, 1) infinite;
224          }
225          @keyframes gradient-flow {
226            from { background-position: 0px center; }
227            to   { background-position: -600px center; }
228          }
229          .btn-gradient-animated {
230            color: white !important;
231            background-image: linear-gradient(90deg,
232              #06b6d4, #818cf8, #c084fc, #f472b6, #06b6d4);
233            background-size: 600px 100%;
234            background-repeat: repeat-x;
235            animation: gradient-flow 8s linear infinite;
236          }
237          @media (prefers-reduced-motion: reduce) {
238            .scapely-rotator-track { animation: none; }
239            .btn-gradient-animated { animation: none; }
240          }
241        `}),n.jsx(Se.form,{onSubmit:r,initial:{opacity:0,y:12}
241,animate:{opacity:1,y:0},transition:{duration:.6,delay:.2},className:"mt-10 w-full max-w-xl sm:mt-8","data-testid":"hero-search-form",children:n.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-slate-900 bg-transparent pl-4 pr-1.5 py-1.5 shadow-sm transition-all focus-within:ring-2 focus-within:ring-cyan-500/30 dark:border-white/60",children:[n.jsx(Ra,{className:"h-4 w-4 flex-none text-slate-400","aria-hidden":!0}),n.jsx("input",{type:"text",value:e,onChange:o=>t(o.target.value),placeholder:s,"aria-label":"Property address or postcode",className:"flex-1 bg-transparent text-[14px] text-slate-900 placeholder:text-slate-400 focus:outline-none dark:text-white dark:placeholder:text-slate-500","data-testid":"hero-search-input"}),n.jsx("button",{type:"submit",className:"btn-gradient-animated inline-flex h-9 items-center gap-1.5 rounded-full px-4 text-[13px] font-semibold transition hover:opacity-90",style:{color:"#ffffff"},"data-testid":"hero-search-button",children:"View Report"})]})}),n.jsx(Se.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.7,delay:.3},className:"mt-6 hidden w-full sm:mt-8 sm:block",children:n.jsx(wB,{})}),n.jsx(Se.p,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.55,delay:.35},className:"mx-auto mt-8 max-w-3xl text-balance text-[17px] leading-relaxed text-slate-600 dark:text-slate-300 sm:mt-6 sm:text-lg",children:"Instantly uncover true build costs, local council objection risks, and hidden EPC uplift potential — for all UK-based residential and commercial properties."}),n.jsxs(Se.a,{href:"#magic-trick",onClick:o=>{o.preventDefault(),NB()},"aria-label":"Scroll for more",initial:{opacity:0}
241,animate:{opacity:1},transition:{duration:.6,delay:.5},className:"group mx-auto mt-6 flex flex-col items-center gap-2 text-slate-500 transition hover:text-cyan-700 dark:text-slate-400 dark:hover:text-cyan-300 sm:mt-8","data-testid":"hero-scroll-indicator",children:[n.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em] text-slate-500 transition group-hover:text-cyan-700/80 dark:text-slate-400 dark:group-hover:text-cyan-300/80",children:"Scroll"}),n.jsx("span",{className:"flex h-10 w-6 items-start justify-center rounded-full border border-slate-300 p-1.5 transition group-hover:border-cyan-500/40 dark:border-white/30",children:n.jsx(Se.span,{"aria-hidden":!0,className:"block h-1.5 w-1.5 rounded-full bg-current",animate:{y:[0,14,0],opacity:[1,.2,1]},transition:{duration:1.8,repeat:1/0,ease:"easeInOut"}})})]})]})]})}function RB({dark:e}){return n.jsxs("section",{id:"magic-trick",className:"relative overflow-hidden bg-white pt-24 pb-12 dark:bg-[#06081c] sm:pt-32 sm:pb-16",children:[n.jsx("div",{className:"absolute inset-0 opacity-20","aria-hidden":!0,style:{backgroundImage:"radial-gradient(ellipse at 80% 0%, rgba(34,211,238,0.18), transparent 50%), radial-gradient(ellipse at 0% 100%, rgba(217,70,239,0.12), transparent 55%)"}}),n.jsx("div",{className:"absolute inset-0","aria-hidden":!0,style:{backgroundImage:e?"linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px)":"linear-gradient(to right, rgba(30,41,59,0.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(30,41,59,0.04) 1px, transparent 1px)",backgroundSize:"56px 56px",maskImage:"radial-gradient(ellipse at center, black 30%, transparent 80%)",WebkitMaskImage:"radial-gradient(ellipse at center, black 30%, transparent 80%)"}}),n.jsxs("div",{className:"relative mx-auto max-w-6xl px-6",children:[n.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[n.jsx("p",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.22em] text-slate-900 sm:text-cyan-700 dark:text-cyan-400",children:"Property intelligence"}),n.jsx("h2",{className:"mt-3 text-balance text-4xl font-semibold tracking-tight text-slate-900 dark:text-white sm:text-5xl",children:"The Buyer's Edge."}),n.jsx("p",{className:"mt-5 text-[17px] leading-relaxed text-slate-600 dark:text-slate-300",children:"Don't spend hours doing due diligence on a potentially dead-end property or site. Scapely accesses government and council data in milliseconds, giving you an institutional-grade site appraisal before you even book a viewing."})]}),n.jsx("div",{className:"relative mx-auto mt-16 max-w-5xl rounded-lg ring-1 ring-slate-200/80 shadow-[0_8px_32px_rgba(0,0,0,0.10)] dark:ring-white/[0.08] dark:shadow-[0_8px_32px_rgba(0,0,0,0.35)]",children:n.jsx("div",{className:"overflow-hidden rounded-lg bg-white dark:bg-[#06081c]",children:n.jsxs("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"metadata","aria-label":"Scapely dashboard demo",className:"block w-full",style:{clipPath:"inset(0 1px 0 0)"},children:[n.jsx("source",{src:"/videos/demo.webm",type:"video/webm"}),n.jsx("source",{src:SB,type:"video/mp4"})]})})}),n.jsx("div",{className:"mx-auto mt-10 max-w-5xl sm:mt-14",children:n.jsx(_B,{})})]}),n.jsx(LB,{dark:e})]})}function OB(){const e=[{label:"GDV",pct:100,cls:"bg-cyan-400/80 dark:bg-cyan-400/60",val:"£485k"},{label:"Build cost",pct:64,cls:"bg-slate-300 dark:bg-white/20",val:"£285k"},{label:"Profit",pct:27,cls:"bg-emerald-400",val:"£98k",glow:!0}];return n.jsx("div",{className:"mt-6 space-y-2.5",children:e.map((t,s)=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"w-16 shrink-0 font-mono text-[10px] uppercase tracking-wider text-slate-400 dark:text-slate-500",children:t.label}),n.jsx("div",{className:"relative flex-1 h-[5px] overflow-hidden rounded-full bg-slate-100 dark:bg-white/[0.07]",children:n.jsx(Se.div,{initial:{width:0},whileInView:{width:`${t.pct}%`},viewport:{once:!0},transition:{duration:1,ease:"easeOut",delay:.2+s*.14},className:`h-full rounded-full ${t.cls}`,style:t.glow?{boxShadow:"0 0 8px rgba(52,211,153,0.6)"}:void 0})}),n.jsx("span",{className:"w-10 shrink-0 text-right font-mono text-[11px] tabular-nums text-slate-400 dark:text-slate-500",children:t.val})]},t.label))})}function PB(){return n.jsxs("div",{className:"mt-6",children:[n.jsxs("div",{className:"flex items-baseline gap-2.5",children:[n.jsx("span",{className:"text-[30px] font-semibold tabular-nums leading-none text-slate-900 dark:text-white",children:"2.1%"}),n.jsx(Se.span,{animate:{boxShadow:["0 0 0 0 rgba(52,211,153,0)","0 0 0 4px rgba(52,211,153,0.18)","0 0 0 0 rgba(52,211,153,0)"]},transition:{duration:2.2,repeat:1/0},className:"rounded bg-emerald-100 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider text-emerald-700 dark:bg-emerald-400/15 dark:text-emerald-300",children:"Low Risk"})]}),n.jsx("p",{className:"mt-1 font-mono text-[10px] text-slate-400 dark:text-slate-500",children:"Southwark · 412 decisions analysed"}),n.jsxs("div",{className:"relative mt-3 h-2 w-full overflow-hidden rounded-full bg-gradient-to-r from-emerald-400/60 via-amber-400/60 to-rose-500/60 dark:from-emerald-400/40 dark:via-amber-400/40 dark:to-rose-500/40",children:[n.jsx(Se.div,{animate:{x:["-50%","120%"]},transition:{duration:3,repeat:1/0,ease:"linear"},className:"absolute inset-y-0 w-1/2 bg-gradient-to-r from-transparent via-white/20 to-transparent"}
241),n.jsx(Se.div,{animate:{opacity:[.5,1,.5]},transition:{duration:1.8,repeat:1/0},className:"absolute inset-y-0 left-[2%] w-0.5 rounded-full bg-white shadow-[0_0_5px_white]"})]}),n.jsxs("div",{className:"mt-1.5 flex justify-between font-mono text-[9px] text-slate-400 dark:text-slate-500",children:[n.jsx("span",{children:"Low"}),n.jsx("span",{children:"Medium"}),n.jsx("span",{children:"High"})]})]})}const MB=[{Icon:jx,title:"EPC & MEES 2027 compliance flag.",body:"Current EPC rating and SAP score, plus an automatic red flag if the property falls below the incoming Minimum Energy Efficiency Standard. Know the upgrade cost before you offer."},{Icon:u7,title:"Permitted development matrix.",body:"Loft, rear extension, outbuilding, HMO, commercial-to-resi — the full PD matrix checked against the property type in a single view."},{Icon:y8,title:"Article 4 & September 2026 rules.",body:"Instantly see if PD rights have been removed by the local authority, and flag properties caught by the new Second Staircase requirement — before you offer."},{Icon:Zo,title:"Companies House owner intel.",body:"Corporate owners, directors, registered addresses and mortgaged charges — surface motivated sellers before agents and other buyers have even spotted the opportunity."},{Icon:an,title:"Sale comparables.",body:"HM Land Registry sold prices for similar properties nearby — the evidence base your broker, solicitor and JV partner will expect in any deal pack."},{Icon:Z8,title:"One-click PDF report.",body:"Every figure, every flag, every source — packaged into a shareable PDF. Send it to your broker, solicitor or JV partner in seconds, generated client-side for full data privacy."}];function LB({dark:e}){return n.jsx("section",{className:"relative pt-10 pb-0 sm:pt-16",children:n.jsxs("div",{className:"relative mx-auto max-w-6xl px-6",children:[n.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[n.jsx("p",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.22em] text-slate-900 sm:text-cyan-700 dark:text-cyan-400",children:"What's included"}),n.jsx("h2",{className:"mt-3 text-balance text-3xl font-semibold tracking-tight text-slate-900 dark:text-white sm:text-4xl",children:"Every angle. One run."}),n.jsx("p",{className:"mt-4 text-[15px] leading-relaxed text-slate-600 dark:text-slate-300",children:"Developers, investors and buyers get the full institutional-grade pack — no add-ons, no data unlocks, no waiting. Every figure traces back to a named UK government dataset."})]}),n.jsxs("div",{className:"mt-10 grid grid-cols-1 gap-4 sm:grid-cols-2",children:[n.jsxs(Se.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{duration:.4},className:"relative overflow-hidden rounded-2xl border border-slate-200/80 bg-white p-6 dark:border-white/[0.07] dark:bg-[#06081c]",children:[n.jsx(kn,{className:"h-5 w-5 text-slate-400 dark:text-slate-500"}),n.jsx("h3",{className:"mt-3 text-[17px] font-semibold leading-snug tracking-tight text-slate-900 dark:text-white",children:"Full development appraisal in seconds."}),n.jsx("p",{className:"mt-2 text-[13.5px] leading-relaxed text-slate-500 dark:text-slate-400",children:"Three project types. Real regional build costs. Instant profit margin. No spreadsheet required."}),n.jsx(OB,{})]}),n.jsxs(Se.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{duration:.4,delay:.08},className:"relative overflow-hidden rounded-2xl border border-slate-200/80 bg-white p-6 dark:border-white/[0.07] dark:bg-[#06081c]",children:[n.jsx(_k,{className:"h-5 w-5 text-slate-400 dark:text-slate-500"}),n.jsx("h3",{className:"mt-3 text-[17px] font-semibold leading-snug tracking-tight text-slate-900 dark:text-white",children:"Planning Risk Score."}),n.jsx("p",{className:"mt-2 text-[13.5px] leading-relaxed text-slate-500 dark:text-slate-400",children:"Scapely's AI reads thousands of local planning decisions to score your council's appetite for new builds — before you commit a penny to planning fees."}),n.jsx(PB,{})]})]}),n.jsx("div",{className:"mt-2 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:MB.map(({Icon:t,title:s,body:r},o)=>n.jsxs(Se.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{duration:.35,delay:o*.05},className:["px-6 py-7","",""].join(" "),children:[n.jsx(t,{className:"h-5 w-5 text-cyan-500 dark:text-cyan-400"}),n.jsx("h3",{className:"mt-3 text-[15px] font-semibold leading-snug tracking-tight text-slate-900 dark:text-white",children:s}),n.jsx("p",{className:"mt-1.5 text-[13px] leading-relaxed text-slate-500 dark:text-slate-400",children:r})]},s))}),n.jsxs("div",{className:"mt-10 px-6 py-10 text-center sm:py-12","data-testid":"early-access",children:[n.jsx("h3",{className:"text-balance text-3xl font-semibold tracking-tight text-slate-900 dark:text-white sm:text-4xl",children:"Sign up to Scapely today."}),n.jsx("p",{className:"mt-3 text-[15px] text-slate-500 dark:text-slate-400",children:"7 day free trial. No credit card required."}),n.jsx("div",{className:"mt-7 flex justify-center",children:n.jsx($D,{ctaLabel:"Create account",surface:e?"dark":"light"})})]})]})})}function DB(){return n.jsx("footer",{className:"border-t border-slate-200 bg-white py-10 dar
241k:border-white/5 dark:bg-[#070a20]",children:n.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center gap-5 px-6",children:[n.jsx("a",{href:"/pricing","data-testid":"link-footer-dashboard",className:"text-[13px] font-medium text-slate-600 underline underline-offset-4 transition hover:text-slate-900 dark:text-slate-300 dark:hover:text-white",children:"Get the Scapely Dashboard"}),n.jsxs("div",{className:"flex w-full flex-col items-center justify-between gap-3 sm:flex-row",children:[n.jsx("div",{className:"text-sm text-slate-500 dark:text-slate-400",children:n.jsx("span",{children:"© 2026 Scapely Ltd. All rights reserved."})}),n.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-4 gap-y-2 font-mono text-[11px] uppercase tracking-wider text-slate-500 dark:text-slate-500",children:[n.jsx("a",{href:"/resources","data-testid":"link-footer-resources",className:"transition hover:text-slate-700 dark:hover:text-slate-300",children:"Resources"}),n.jsx("a",{href:"/investors","data-testid":"link-footer-investors",className:"transition hover:text-slate-700 dark:hover:text-slate-300",children:"Investors"}),n.jsx("a",{href:"/property-data","data-testid":"link-footer-property-data",className:"transition hover:text-slate-700 dark:hover:text-slate-300",children:"Property data"}),n.jsx("a",{href:"/privacy","data-testid":"link-footer-privacy",className:"transition hover:text-slate-700 dark:hover:text-slate-300",children:"Privacy"}),n.jsx("a",{href:"/terms","data-testid":"link-footer-terms",className:"transition hover:text-slate-700 dark:hover:text-slate-300",children:"Terms"}),n.jsx("a",{href:"/contact","data-testid":"link-footer-contact",className:"transition hover:text-slate-700 dark:hover:text-slate-300",children:"Contact"})]})]})]})})}function BB(){const{theme:e,toggleTheme:t}=Da(),s=e==="dark";return n.jsxs("div",{className:`min-h-screen bg-slate-50 text-slate-900 dark:bg-[#06081c] dark:text-white transition-colors duration-300 ${s?"dark":""}`,children:[n.jsx(ps,{meta:gy()}),n.jsx(CB,{onToggle:t}),n.jsxs("main",{children:[n.jsx(AB,{}),n.jsx("div",{className:"hidden sm:block",children:n.jsx(EB,{})}),n.jsx(RB,{dark:s})]}),n.jsx(DB,{})]})}const IB="/assets/ScapelyToolbar_1778803574974-CAsbYa9Z.png",q5="/assets/EPCUplift_1778803574974-Dwejo5vz.png",V5="/assets/Sales_1778803574974-C2byzrAN.png",z5="/assets/Owner_1778803574974-BvutZidt.png",F5="/assets/ScapelyDasboard_1778803574974-_iSpX4wV.png",G5="/assets/Watchlist_1778803574974-B1ByNMV0.png",$B="/assets/Thismonth_1778803574974-CaYSLBjE.png";function UB(){const[e,t]=w.useState(!1),[s,r]=w.useState(!1);w.useEffect(()=>{const c=()=>t(window.scrollY>8);return c(),window.addEventListener("scroll",c,{passive:!0}),()=>window.removeEventListener("scroll",c)},[]),w.useEffect(()=>{if(!s)return;const c=d=>{d.key==="Escape"&&r(!1)};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[s]);const o=[{href:"/",label:"Home",testId:"link-mobile-home"},{href:"/demo-report",label:"Demo Report",testId:"link-mobile-insights"},{href:"/pricing",label:"Pricing",testId:"link-mobile-pricing"},{href:"/resources",label:"Resources",testId:"link-mobile-resources"},{href:"/property-data",label:"Property data",testId:"link-mobile-property-data"},{href:"/investors",label:"Investors",testId:"link-mobile-investors"},{href:"/contact",label:"Contact",testId:"link-mobile-contact"},{href:"/dashboard?mode=signin",label:"Sign in",testId:"link-mobile-signin"}];return n.jsxs("header",{className:`fixed top-0 z-40 w-full transition-colors duration-200 ${e||s?"border-b border-white/10 backdrop-blur-md":""}`,children:[n.jsxs("div",{className:"relative mx-auto flex h-16 w-full max-w-7xl items-center justify-between px-6 sm:h-20",children:[n.jsxs("a",{href:"/",className:"flex items-center gap-3","data-testid":"link-logo",children:[n.jsx("img",{src:zo,alt:"Scapely",className:"block h-7 w-auto sm:hidden"}),n.jsx("img",{src:_n,alt:"Scapely",className:"hidden h-[15px] w-auto sm:block sm:h-[16px]"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("a",{href:"/","data-testid":"link-nav-home",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-200 transition hover:text-white sm:inline-flex",children:"Home"}),n.jsx("a",{href:"/demo-report","data-testid":"link-nav-insight",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-200 transition hover:text-white sm:inline-flex",children:"Demo Report"}),n.jsx("a",{href:"/pricing","data-testid":"link-nav-pricing",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-200 transition hover:text-white sm:inline-flex",children:"Pricing"}),n.jsx("a",{href:"/resources","data-testid":"link-nav-resources",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-200 transition hover:text-white sm:inline-flex",children:"Resources"}),n.jsx("a",{href:"/dashboard?mode=signin","data-testid":"link-nav-signin",className:"hidden h-9 items-center px-3 text-[13px] font-medium text-slate-200 transition hover:text-white sm:inline-flex",children:"Sign in"}),n.jsx("a",{href:"/pricing","data-testid":"button-nav-cta",className:"inline-flex h-9 items-center rounded-full border border-white bg-transparent px-4 text-[13px] font-semibold text-white transition hover:bg-white hover:text-[#06081c] active:scale-[0.98]",children:"Create account"}),n.jsx("button",{type:"button","aria-label":s?"Close menu":"Open menu","aria-expanded":s,"data-testid":"button-mobile-menu",onClick:()=>r(c=>!c),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-slate-200 transition hover:bg-white/10 sm:hidden",children:s?n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,
241children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})]})]}),s&&n.jsx("div",{"data-testid":"mobile-menu",className:"border-t border-white/10 bg-[#06081c]/95 backdrop-blur-md sm:hidden",children:n.jsx("nav",{className:"mx-auto flex max-w-7xl flex-col px-4 py-3",children:o.map(c=>n.jsx("a",{href:c.href,"data-testid":c.testId,onClick:()=>r(!1),className:"rounded-lg px-3 py-3 text-[15px] font-medium text-slate-100 transition hover:bg-white/10",children:c.label},c.testId))})})]})}function HB(){return n.jsx("section",{className:"relative pt-4 pb-24 sm:pt-6 sm:pb-32",children:n.jsx("div",{className:"relative mx-auto max-w-6xl px-6",children:n.jsx("div",{className:"relative mx-auto max-w-7xl",children:n.jsx(qB,{})})})})}function qB(){const e="From a D-rated boiler swap to a B-rated retrofit — Scapely models the EPC uplift, the works it'll take and the rental premium it unlocks, before you commit a penny.",t="See exactly who owns the freehold and what every neighbouring property has actually changed hands for — Companies House and Land Registry evidence, surfaced in seconds.",s="Track every site you're considering in one place. Watchlist flags the rising-risk postcodes, monthly counters keep your pipeline visible, and a single search rerun gives you fresh appraisals on demand.";return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"relative mx-auto hidden h-[1140px] w-full max-w-7xl lg:block",children:[n.jsx("img",{src:IB,alt:"","aria-hidden":!0,className:"absolute left-1/2 top-0 block w-[58px] -translate-x-1/2"}),n.jsx("p",{className:"absolute left-0 top-[110px] max-w-[460px] text-pretty text-[14px] leading-relaxed text-[#8488AA]",children:e}),n.jsx("img",{src:q5,alt:"EPC uplift potential indicator showing a D rating climbing toward B",className:"absolute left-0 top-[230px] w-[720px] rounded-[12px] transition-transform duration-200 ease-out hover:-translate-y-1 active:-translate-y-0.5 [filter:drop-shadow(0_0_14px_rgba(0,0,0,0.18))] hover:[filter:drop-shadow(0_10px_24px_rgba(0,0,0,0.45))]"}),n.jsx("img",{src:z5,alt:"","aria-hidden":!0,className:"absolute right-[-20px] top-[70px] w-[480px] rounded-t-[12px] transition-transform duration-200 ease-out hover:-translate-y-1 active:-translate-y-0.5 hover:[filter:drop-shadow(0_10px_24px_rgba(0,0,0,0.45))]"}),n.jsx("img",{src:V5,alt:"Sale history chart showing comparable sales for the postcode",className:"absolute right-[-50px] top-[150px] w-[520px] rounded-[12px] transition-transform duration-200 ease-out hover:-translate-y-1 active:-translate-y-0.5 [filter:drop-shadow(0_0_14px_rgba(0,0,0,0.18))] hover:[filter:drop-shadow(0_10px_24px_rgba(0,0,0,0.45))]"}),n.jsx("p",{className:"absolute right-0 top-[500px] max-w-[520px] text-right text-pretty text-[14px] leading-relaxed text-[#8488AA]",children:t}),n.jsx("img",{src:F5,alt:"Scapely dashboard header showing 45 Sundridge Avenue, Bromley",className:"absolute left-1/2 top-[660px] w-[80%] -translate-x-1/2 rounded-[12px] transition-transform duration-200 ease-out hover:-translate-y-1 active:-translate-y-0.5 hover:[filter:drop-shadow(0_10px_24px_rgba(0,0,0,0.45))]"}),n.jsx("img",{src:G5,alt:"Watchlist of six tracked properties, four flagged high-risk",className:"absolute left-[5%] top-[870px] w-[420px] rounded-[12px] transition-transform duration-200 ease-out hover:-translate-y-1 active:-translate-y-0.5 [filter:drop-shadow(0_0_14px_rgba(0,0,0,0.18))] hover:[filter:drop-shadow(0_10px_24px_rgba(0,0,0,0.45))]"}),n.jsx("img",{src:$B,alt:"This month: one appraisal completed",className:"absolute right-[5%] top-[870px] w-[420px] rounded-[12px] transition-transform duration-200 ease-out hover:-translate-y-1 active:-translate-y-0.5 [filter:drop-shadow(0_0_14px_rgba(0,0,0,0.18))] hover:[filter:drop-shadow(0_10px_24px_rgba(0,0,0,0.45))]"})]}),n.jsx("p",{className:"mx-auto -mt-16 hidden max-w-[680px] text-center text-pretty text-[14px] leading-relaxed text-[#8488AA] lg:block",children:s}),n.jsxs("div",{className:"space-y-14 lg:hidden",children:[n.jsxs("div",{className:"space-y-5",children:[n.jsx("img",{src:q5,alt:"EPC uplift potential indicator showing a D rating climbing toward B",className:"w-full rounded-[12px]"}),n.jsx("p",{className:"text-pretty text-center text-[14px] leading-relaxed text-white",children:e})]}),n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"relative",children:[n.jsx("img",{src:z5,alt:"","aria-hidden":!0,
241className:"block w-full rounded-t-[12px]"}),n.jsx("img",{src:V5,alt:"Sale history chart showing comparable sales for the postcode",className:"relative -mt-[55%] block w-full rounded-[12px] [filter:drop-shadow(0_0_14px_rgba(0,0,0,0.35))]"})]}),n.jsx("p",{className:"text-pretty text-center text-[14px] leading-relaxed text-white",children:t})]}),n.jsxs("div",{className:"space-y-5",children:[n.jsx("img",{src:F5,alt:"Scapely dashboard header showing 45 Sundridge Avenue, Bromley",className:"w-full rounded-[12px]"}),n.jsx("img",{src:G5,alt:"Watchlist of six tracked properties, four flagged high-risk",className:"w-full rounded-[12px]"}),n.jsx("p",{className:"text-pretty text-center text-[14px] leading-relaxed text-white",children:s})]})]})]})}function VB(){const e=["Search the EPC register manually — one address at a time","Email the council for planning history and wait days for a response","Cross-reference Article 4 zones, flood maps and heritage designations in separate tabs","Build a cost estimate from last year's BCIS PDF or a stale spreadsheet","Pull Companies House and Land Registry records separately, then reconcile"],t=["EPC current rating, SAP score, MEES 2027 compliance flag and uplift potential — scored","AI objection-risk score drawn from thousands of real planning minutes, instantly","Flood zone, heritage status, Article 4 and HMO density overlaid automatically","April 2026 regional build benchmarks with full GDV, fees and contingency model","Companies House owner intel — directors, PSCs, charges — plus Land Registry history in one panel"];return n.jsx("section",{className:"relative pb-20 sm:pb-24","data-testid":"section-comparison-cards",children:n.jsx("div",{className:"relative mx-auto max-w-5xl px-6",children:n.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[n.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-white/[0.07] bg-[#06081c] p-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"rounded-full border border-rose-300/20 bg-rose-400/10 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-rose-200",children:"The traditional way"}),n.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"~30 min / property"})]}),n.jsx("h3",{className:"mt-4 text-[17px] font-semibold leading-snug tracking-tight text-white",children:"5 tabs, a phone call, and a PDF."}),n.jsx("ul",{className:"mt-4 space-y-3 text-[13.5px] text-slate-400",children:e.map(s=>n.jsxs("li",{className:"flex items-start gap-2.5",children:[n.jsx(Ar,{className:"mt-0.5 h-4 w-4 flex-none text-rose-300/70"}),n.jsx("span",{children:s})]},s))})]}),n.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-cyan-300/20 bg-[#06081c] p-6",children:[n.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 h-48 w-48 rounded-full bg-cyan-400/10 blur-3xl","aria-hidden":!0}),n.jsxs("div",{className:"relative flex items-center gap-2",children:[n.jsx("span",{className:"rounded-full border border-cyan-300/30 bg-cyan-300/10 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-cyan-200",children:"The Scapely way"}),n.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"~30 sec / property"})]}),n.jsx("h3",{className:"relative mt-4 text-[17px] font-semibold leading-snug tracking-tight text-white",children:"One search. Every data point."}),n.jsx("ul",{className:"relative mt-4 space-y-3 text-[13.5px] text-slate-300",children:t.map(s=>n.jsxs("li",{className:"flex items-start gap-2.5",children:[n.jsx(mx,{className:"mt-0.5 h-4 w-4 flex-none text-cyan-300"}),n.jsx("span",{children:s})]},s))})]})]})})})}function zB(){return n.jsx("section",{className:"relative pt-0 pb-8 sm:pt-0 sm:pb-10","data-testid":"section-comparison",children:n.jsx("div",{className:"relative mx-auto max-w-5xl px-6",children:n.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[n.jsx("p",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.22em] text-cyan-300",children:"The maths"}),n.jsxs("h2",{className:"mt-3 text-4xl font-semibold tracking-tight text-white sm:text-5xl",children:["From countless open tabs"," ",n.jsx("span",{className:"text-slate-500",children:"→"})," ",n.jsx("br",{className:"hidden sm:block"}),"to 1 Intelligent"," ",n.jsx("span",{className:"bg-gradient-to-r from-cyan-300 via-sky-300 to-fuchsia-400 bg-clip-text text-transparent",style:{WebkitTextFillColor:"transparent"},children:"Dashboard"}),"."]}),n.jsxs("p",{className:"mt-5 text-[15px] leading-relaxed text-slate-300",children:["Stop spending an afternoon on properties that were never going to be viable."," ",n.jsx("br",{className:"hidden sm:block"}
241),"Scapely fills the intelligence-gap instantly."]})]})})})}function FB(){return n.jsx("footer",{className:"border-t border-white/5 bg-[#070a20] py-10",children:n.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-3 px-6 sm:flex-row",children:[n.jsx("div",{className:"text-sm text-slate-400",children:n.jsx("span",{children:"© 2026 Scapely Ltd. All rights reserved."})}),n.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-4 gap-y-2 font-mono text-[11px] uppercase tracking-wider text-slate-500",children:[n.jsx("a",{href:"/resources","data-testid":"link-footer-resources",className:"transition hover:text-slate-300",children:"Resources"}),n.jsx("a",{href:"/investors","data-testid":"link-footer-investors",className:"transition hover:text-slate-300",children:"Investors"}),n.jsx("a",{href:"/property-data","data-testid":"link-footer-property-data",className:"transition hover:text-slate-300",children:"Property data"}),n.jsx("a",{href:"/privacy","data-testid":"link-footer-privacy",className:"transition hover:text-slate-300",children:"Privacy"}),n.jsx("a",{href:"/terms","data-testid":"link-footer-terms",className:"transition hover:text-slate-300",children:"Terms"}),n.jsx("a",{href:"/contact","data-testid":"link-footer-contact",className:"transition hover:text-slate-300",children:"Contact"})]})]})})}function GB(){return n.jsxs("div",{className:"min-h-screen bg-[#06081c] text-foreground",children:[n.jsx(ps,{meta:gy()}),n.jsx(UB,{}),n.jsxs("main",{className:"relative isolate overflow-hidden bg-[#06081c] pt-24 sm:pt-32",children:[n.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-30","aria-hidden":!0,style:{backgroundImage:"radial-gradient(ellipse at 80% 0%, rgba(103,232,249,0.18), transparent 50%), radial-gradient(ellipse at 0% 100%, rgba(217,70,239,0.15), transparent 55%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]","aria-hidden":!0,style:{backgroundImage:"linear-gradient(to right, white 1px, transparent 1px), linear-gradient(to bottom, white 1px, transparent 1px)",backgroundSize:"56px 56px",maskImage:"radial-gradient(ellipse at center, transparent 0%, transparent 40%, black 85%)",WebkitMaskImage:"radial-gradient(ellipse at center, transparent 0%, transparent 40%, black 85%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0","aria-hidden":!0,style:{backgroundImage:"radial-gradient(ellipse 60% 55% at center, rgba(2,4,18,0.85) 0%, rgba(2,4,18,0.45) 45%, transparent 75%)"}}),n.jsx(zB,{}),n.jsx(HB,{}),n.jsx(VB,{})]}),n.jsx(FB,{})]})}const gi={cyan:{label:"text-cyan-700 dark:text-cyan-300",titleSoft:"text-cyan-700/90 dark:text-cyan-300/80",valueText:"text-slate-900 dark:text-white",valuePhoto:"text-white",glowRgba:"rgba(34,211,238,0.10)",lineColor:"#22d3ee"},white:{label:"text-slate-500 dark:text-white/80",titleSoft:"text-slate-500 dark:text-white/70",valueText:"text-slate-900 dark:text-white",valuePhoto:"text-white",glowRgba:"rgba(255,255,255,0.07)",lineColor:"",lineClass:"bg-black dark:bg-white"},emerald:{label:"text-emerald-700 dark:text-emerald-300",titleSoft:"text-emerald-700/90 dark:text-emerald-300/80",valueText:"text-slate-900 dark:text-white",valuePhoto:"text-white",glowRgba:"rgba(52,211,153,0.10)",lineColor:"#10b981"},fuchsia:{label:"text-fuchsia-700 dark:text-fuchsia-300",titleSoft:"text-fuchsia-700/90 dark:text-fuchsia-300/80",valueText:"text-slate-900 dark:text-white",valuePhoto:"text-white",glowRgba:"rgba(217,70,239,0.10)",lineColor:"#d946ef"},amber:{label:"text-amber-700 dark:text-amber-300",titleSoft:"text-amber-700/90 dark:text-amber-300/80",valueText:"text-slate-900 dark:text-white",valuePhoto:"text-white",glowRgba:"rgba(245,158,11,0.10)",lineColor:"#f59e0b"},sky:{label:"text-sky-700 dark:text-sky-300",titleSoft:"text-sky-700/90 dark:text-sky-300/80",valueText:"text-slate-900 dark:text-white",valuePhoto:"text-white",glowRgba:"rgba(56,189,248,0.10)",lineColor:"#38bdf8"},violet:{label:"text-violet-700 dark:text-violet-300",titleSoft:"text-violet-700/90 dark:text-violet-300/80",valueText:"text-slate-900 dark:text-white",valuePhoto:"text-white",glowRgba:"rgba(167,139,250,0.10)",lineColor:"#8b5cf6"},rose:{label:"text-rose-700 dark:text-rose-400",titleSoft:"text-rose-700/90 dark:text-rose-400/80",valueText:"text-slate-900 dark:text-white",valuePhoto:"text-white",glowRgba:"rgba(251,113,133,0.10)",lineColor:"#fb7185"}},Eh={1:"text-slate-400 dark:text-slate-500",2:"text-cyan-500 dark:text-cyan-300",3:"text-sky-700 dark:text-sky-300",4:"text-amber-700 dark:text-amber-300",5:"text-rose-700 dark:text-rose-300",6:"text-emerald-700 dark:text-emerald-300",7:"text-violet-700 dark:text-violet-300"},Th={1:"text-slate-900 dark:text-white",2:"text-slate-900 dark:text-white",3:"text-slate-900 dark:text-white",4:"text-slate-900 dark:text-white",5:"text-slate-900 dark:text-white",6:"text-slate-900 dark:text-white",7:"text-slate-900 dark:text-white"},ws="relative overflow-hidden rounded-[12px] border border-slate-300 dark:border-white/[0.16]",KB="relative overflow-hidden rounded-[12px] border border-slate-300 dark:border-white/[0.16]";function js(){return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-[1] h-px dark:hidden",style:{background:"linear-gradient(90deg, transparent, rgba(15,23,42,0.10), transparent)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-[1] hidden h-px dark:block",style:{background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent)"}})]})}function WB(e,t,s){const r=Number.isFinite(t)&&t!==e,[o,c]=w.useState(r?e:t),d=w.useRef(!1);return w.useEffect(()=>{if(d.current){c(t);return}if(!Number.isFinite(t)||t===e){c(t);return}
241d.current=!0,c(e);const h=jS(e,t,{duration:s,ease:"easeOut",onUpdate:p=>c(p)});return()=>h.stop()},[e,t,s]),o}function c0({from:e=0,to:t,unit:s,decimals:r=0,duration:o=1.2}){const c=WB(e,t,o);return n.jsxs(n.Fragment,{children:[c.toFixed(r),n.jsx("span",{className:"ml-0.5 text-[12px] text-slate-600 dark:text-slate-400",children:s})]})}function Xs({accent:e,icon:t,title:s,delay:r=0,className:o="",muted:c=!1,collapsible:d=!1,defaultCollapsed:h=!1,children:p}){const f=gi[e],[m,x]=w.useState(!h),y=n.jsxs("div",{className:`relative flex items-center gap-2 font-mono text-[11px] font-bold uppercase tracking-wider ${f.label}`,children:[t!=null&&n.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center",children:t}),n.jsx("span",{className:"flex-1",children:s}),d&&n.jsx(Zc,{className:`h-3.5 w-3.5 flex-none opacity-50 transition-transform duration-300 ${m?"rotate-180":""}`})]});return n.jsxs(Se.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{delay:r,duration:.5},className:`${c?KB:ws} p-5 ${o}`,children:[n.jsx(js,{}),n.jsxs("div",{children:[d?n.jsx("button",{type:"button",onClick:()=>x(v=>!v),className:"flex w-full items-center text-left",children:y}):y,n.jsx(rL,{initial:!1,children:(!d||m)&&n.jsx(Se.div,{initial:d?{height:0,opacity:0}:!1,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:[.25,1,.5,1]},className:"overflow-hidden",children:n.jsx("div",{className:"relative mt-3",children:p})},"body")})]})]})}function yr({accent:e,icon:t,title:s,value:r,blurb:o,shortBlurb:c,delay:d=0,backgroundImage:h,illustration:p}){const f=gi[e],m=!!h,x=!m&&!!p;return n.jsxs(Se.div,{initial:{opacity:0,y:8},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{delay:d,duration:.4},className:`${ws} ${m?"@container flex min-h-[130px] flex-col overflow-hidden p-0 sm:min-h-[320px]":"p-4"}`,children:[n.jsx(js,{}),m?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"sm:hidden relative flex flex-col p-4",children:[n.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:`radial-gradient(220px 100px at 100% 0%, ${f.glowRgba}, transparent 60%)`}}),n.jsxs("div",{className:"relative",children:[n.jsxs("div",{className:`flex items-center gap-1.5 font-mono text-[10px] font-bold uppercase tracking-wider text-cyan-700/90 ${f.titleSoft.split(" ")[1]??""}`,children:[n.jsx("span",{className:"inline-flex h-3 w-3 items-center justify-center [&>svg]:h-3 [&>svg]:w-3",children:t}),s]}),n.jsx("div",{className:`mt-2 inline-block text-3xl font-semibold tracking-tight ${f.valueText}`,children:r})]})]}),n.jsx("img",{src:h,alt:"","aria-hidden":"true",className:"hidden sm:block absolute inset-0 h-full w-full object-cover opacity-70",style:{objectPosition:"50% 50%"},loading:"lazy"}),n.jsx("div",{className:"pointer-events-none absolute inset-0 hidden sm:block dark:hidden",style:{background:"linear-gradient(to top, rgba(71,85,105,0.98) 0%, rgba(71,85,105,0.96) 38%, rgba(71,85,105,0.78) 58%, rgba(71,85,105,0.35) 80%, rgba(71,85,105,0.10) 100%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0 hidden sm:dark:block",style:{background:"linear-gradient(to top, rgba(8,11,32,0.98) 0%, rgba(8,11,32,0.96) 38%, rgba(8,11,32,0.78) 58%, rgba(8,11,32,0.35) 80%, rgba(8,11,32,0.10) 100%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0 hidden sm:block",style:{background:`radial-gradient(260px 140px at 100% 0%, ${f.glowRgba}, transparent 65%)`}}),n.jsxs("div",{className:"hidden sm:flex relative items-center gap-1.5 px-4 pt-4 font-mono text-[12px] font-bold uppercase tracking-wider text-white [filter:drop-shadow(0_1px_2px_rgba(2,6,23,0.85))_drop-shadow(0_2px_6px_rgba(2,6,23,0.55))] sm:px-5 sm:pt-5",children:[n.jsx("span",{className:"inline-flex h-[15px] w-[15px] items-center justify-center [&>svg]:h-[15px] [&>svg]:w-[15px]",children:t}),s]}),n.jsx("div",{className:`hidden sm:block sm:absolute left-4 right-4 bottom-[100px] sm:left-5 sm:right-5 sm:bottom-[114px] whitespace-nowrap text-3xl font-semibold leading-none tracking-tight sm:text-4xl ${f.valuePhoto}`,children:r}),c&&n.jsx("p",{className:"hidden sm:block sm:absolute left-4 right-4 bottom-4 text-[12px] leading-relaxed text-white dark:text-slate-300 line-clamp-3 @min-[210px]:hidden",title:c,children:c}),n.jsx("p",{className:"hidden sm:absolute left-4 right-4 bottom-4 text-[12px] leading-relaxed text-white dark:text-slate-300 @min-[210px]:left-5 @min-[210px]:right-5 @min-[210px]:bottom-5 @min-[210px]:line-clamp-3",title:o,children:o})]}):x?n.jsx(n.Fragment,{children:n.jsxs("div",{className:"relative flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[10px] font-bold uppercase tracking-wider text-slate-900 dark:text-white",children:[n.jsx("span",{className:`inline-flex h-3 w-3 items-center justify-center ${f.titleSoft}`,children:t}),s]}),n.jsx("div",{className:`mt-2 mb-3 h-px w-full rounded-full flex-shrink-0 ${f.lineClass??""}`,style:f.lineClass?void 0:{backgroundColor:f.lineColor}}),n.jsx("div",{className:"text-4xl font-bold leading-none tracking-tight text-slate-900 dark:text-white",children:r}),c&&n.jsx("p",{className:"mt-2 text-[12px] leading-relaxed text-slate-600 dar
241k:text-slate-300 line-clamp-3 sm:hidden",children:c}),n.jsx("p",{className:"mt-2 hidden text-[12px] leading-relaxed text-slate-600 dark:text-slate-300 line-clamp-3 sm:block",children:o})]})}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:`radial-gradient(220px 100px at 100% 0%, ${f.glowRgba}, transparent 60%)`}}),n.jsxs("div",{className:"relative",children:[n.jsxs("div",{className:`flex items-center gap-1.5 font-mono text-[10px] font-bold uppercase tracking-wider ${f.titleSoft}`,children:[n.jsx("span",{className:"inline-flex h-3 w-3 items-center justify-center",children:t}),s]}),n.jsx("div",{className:`mt-2 inline-block text-3xl font-semibold tracking-tight ${f.valueText}`,children:r}),c&&n.jsx("p",{className:"mt-2 text-[12px] leading-relaxed text-slate-600 dark:text-slate-400 sm:hidden",children:c}),n.jsx("p",{className:"mt-2 hidden text-[12px] leading-relaxed text-slate-600 dark:text-slate-400 sm:block",children:o})]})]})]})}function IS(){const e=["M624.92 691.079H29.0684C25.3972 691.079 22.4004 694.076 22.4004 697.747V752.739C22.4004 756.41 25.3972 759.407 29.0684 759.407H624.92C627.317 759.407 629.49 758.134 630.689 756.111L646.946 728.615C648.22 726.517 648.22 723.894 646.946 721.797L630.689 694.3C629.49 692.278 627.317 691.004 624.92 691.004V691.079Z","M499.875 588.444H29.0684C25.3972 588.444 22.4004 591.441 22.4004 595.112V650.105C22.4004 653.776 25.3972 656.773 29.0684 656.773H499.875C502.273 656.773 504.446 655.499 505.644 653.476L521.902 625.98C523.176 623.882 523.176 621.26 521.902 619.162L505.644 591.666C504.446 589.643 502.273 588.369 499.875 588.369V588.444Z","M354.977 488.717H29.0684C25.3972 488.717 22.4004 491.714 22.4004 495.385V550.378C22.4004 554.049 25.3972 557.046 29.0684 557.046H354.977C357.375 557.046 359.547 555.772 360.746 553.749L377.004 526.253C378.278 524.155 378.278 521.533 377.004 519.435L360.746 491.939C359.547 489.916 357.375 488.643 354.977 488.643V488.717Z","M223.939 388.921H29.0684C25.3972 388.921 22.4004 391.918 22.4004 395.589V450.581C22.4004 454.252 25.3972 457.249 29.0684 457.249H223.939C226.337 457.249 228.51 455.975 229.708 453.953L245.966 426.456C247.24 424.359 247.24 421.736 245.966 419.638L229.708 392.142C228.51 390.119 226.337 388.846 223.939 388.846V388.921Z"];return n.jsx("svg",{viewBox:"10 231 1153 546",preserveAspectRatio:"xMinYMin meet",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-[65%] block","aria-hidden":"true",children:e.map((t,s)=>n.jsx(Se.path,{d:t,fill:"#f59e0b",style:{transformBox:"fill-box",transformOrigin:"left center"},initial:{scaleX:0},whileInView:{scaleX:1},viewport:{once:!0},transition:{duration:.55,ease:[.25,1,.5,1],delay:s*.09}},s))})}function $S(){const e=[["M897.859 584.09C911.597 584.09 922.733 572.953 922.733 559.216C922.733 545.478 911.597 534.342 897.859 534.342C884.122 534.342 872.985 545.478 872.985 559.216C872.985 572.953 884.122 584.09 897.859 584.09Z","white","M897.858 589.48C881.151 589.48 867.59 575.919 867.59 559.212C867.59 542.504 881.151 528.943 897.858 528.943C914.566 528.943 928.127 542.504 928.127 559.212C928.127 575.919 914.566 589.48 897.858 589.48ZM897.858 539.732C887.07 539.732 878.379 548.498 878.379 559.212C878.379 569.925 887.145 578.691 897.858 578.691C908.572 578.691 917.338 569.925 917.338 559.212C917.338 548.498 908.572 539.732 897.858 539.732Z"],["M754.909 581.779C768.647 581.779 779.783 570.643 779.783 556.905C779.783 543.168 768.647 532.031 754.909 532.031C741.172 532.031 730.035 543.168 730.035 556.905C730.035 570.643 741.172 581.779 754.909 581.779Z","white","M754.911 587.167C738.203 587.167 724.643 573.607 724.643 556.899C724.643 540.192 738.203 526.631 754.911 526.631C771.618 526.631 785.179 540.192 785.179 556.899C785.179 573.607 771.618 587.167 754.911 587.167ZM754.911 537.42C744.122 537.42 735.431 546.185 735.431 556.899C735.431 567.613 744.197 576.379 754.911 576.379C765.625 576.379 774.39 567.613 774.39 556.899C774.39 546.185 765.625 537.42 754.911 537.42Z"],["M751.912 669.504C765.649 669.504 776.786 658.367 776.786 644.63C776.786 630.892 765.649 619.756 751.912 619.756C738.174 619.756 727.038 630.892 727.038 644.63C727.038 658.367 738.174 669.504 751.912 669.504Z","#22d3ee","M751.911 674.894C735.203 674.894 721.643 661.333 721.643 644.626C721.643 627.918 735.203 614.357 751.911 614.357C768.618 614.357 782.179 627.918 782.179 644.626C782.179 661.333 768.618 674.894 751.911 674.894ZM751.911 625.146C741.122 625.146 732.43
2411 633.912 732.431 644.626C732.431 655.339 741.197 664.105 751.911 664.105C762.625 664.105 771.391 655.339 771.391 644.626C771.391 633.912 762.625 625.146 751.911 625.146Z"],["M52.2959 797.324C66.0334 797.324 77.1699 786.188 77.1699 772.45C77.1699 758.713 66.0334 747.576 52.2959 747.576C38.5584 747.576 27.4219 758.713 27.4219 772.45C27.4219 786.188 38.5584 797.324 52.2959 797.324Z","#22d3ee","M52.2947 802.714C35.5872 802.714 22.0264 789.154 22.0264 772.446C22.0264 755.739 35.5872 742.178 52.2947 742.178C69.0022 742.178 82.5631 755.739 82.5631 772.446C82.5631 789.154 69.0022 802.714 52.2947 802.714ZM52.2947 752.966C41.506 752.966 32.8151 761.732 32.8151 772.446C32.8151 783.16 41.581 791.926 52.2947 791.926C63.0085 791.926 71.7744 783.16 71.7744 772.446C71.7744 761.732 63.0085 752.966 52.2947 752.966Z"],["M1105.17 584.017C1118.91 584.017 1130.04 572.881 1130.04 559.144C1130.04 545.406 1118.91 534.27 1105.17 534.27C1091.43 534.27 1080.29 545.406 1080.29 559.144C1080.29 572.881 1091.43 584.017 1105.17 584.017Z","#22d3ee","M1105.17 589.406C1088.46 589.406 1074.9 575.845 1074.9 559.138C1074.9 542.43 1088.46 528.869 1105.17 528.869C1121.88 528.869 1135.44 542.43 1135.44 559.138C1135.44 575.845 1121.88 589.406 1105.17 589.406ZM1105.17 539.658C1094.38 539.658 1085.69 548.424 1085.69 559.138C1085.69 569.851 1094.46 578.617 1105.17 578.617C1115.88 578.617 1124.65 569.851 1124.65 559.138C1124.65 548.424 1115.88 539.658 1105.17 539.658Z"],["M358.124 628.443C371.862 628.443 382.998 617.307 382.998 603.569C382.998 589.832 371.862 578.695 358.124 578.695C344.387 578.695 333.25 589.832 333.25 603.569C333.25 617.307 344.387 628.443 358.124 628.443Z","#22d3ee","M358.123 633.834C341.415 633.834 327.854 620.273 327.854 603.565C327.854 586.858 341.415 573.297 358.123 573.297C374.83 573.297 388.391 586.858 388.391 603.565C388.391 620.273 374.83 633.834 358.123 633.834ZM358.123 584.086C347.334 584.086 338.643 592.851 338.643 603.565C338.643 614.279 347.409 623.045 358.123 623.045C368.837 623.045 377.603 614.279 377.603 603.565C377.603 592.851 368.837 584.086 358.123 584.086Z"],["M220.96 602.459C221.032 588.722 209.954 577.527 196.217 577.455C182.48 577.383 171.285 588.461 171.213 602.199C171.141 615.936 182.219 627.131 195.957 627.203C209.694 627.274 220.889 616.196 220.96 602.459Z","white","M195.846 632.486C179.138 632.486 165.577 618.925 165.577 602.218C165.577 585.51 179.138 571.949 195.846 571.949C212.553 571.949 226.114 585.51 226.114 602.218C226.114 618.925 212.553 632.486 195.846 632.486ZM195.846 582.738C185.057 582.738 176.366 591.504 176.366 602.218C176.366 612.931 185.132 621.697 195.846 621.697C206.559 621.697 215.325 612.931 215.325 602.218C215.325 591.504 206.559 582.738 195.846 582.738Z"],["M399.858 426.681C413.596 426.681 424.732 415.545 424.732 401.808C424.732 388.07 413.596 376.934 399.858 376.934C386.121 376.934 374.984 388.07 374.984 401.808C374.984 415.545 386.121 426.681 399.858 426.681Z","white","M399.857 432.072C383.15 432.072 369.589 418.511 369.589 401.804C369.589 385.096 383.15 371.535 399.857 371.535C416.565 371.535 430.126 385.096 430.126 401.804C430.126 418.511 416.565 432.072 399.857 432.072ZM399.857 382.324C389.068 382.324 380.378 391.09 380.378 401.804C380.378 412.517 389.143 421.283 399.857 421.283C410.571 421.283 419.337 412.517 419.337 401.804C419.337 391.09 410.571 382.324 399.857 382.324Z"],["M48.0254 602.286C48.0254 614.049 57.6154 623.639 69.3781 623.639C81.1408 623.639 90.7308 614.049 90.7308 602.286C90.7308 590.524 81.1408 580.934 69.3781 580.934C57.6154 580.934 48.0254 590.524 48.0254 602.286Z","white","M69.3777 628.29C55.0677 628.29 43.3799 616.603 43.3799 602.293C43.3799 587.983 55.0677 576.295 69.3777 576.295C83.6877 576.295 95.3755 587.983 95.3755 602.293C95.3755 616.603 83.6877 628.29 69.3777 628.29ZM69.3777 585.585C60.1623 585.585 52.6703 593.077 52.6703 602.293C52.6703 611.508 60.1623 619 69.3777 619C78.593 619 86.0853 611.508 86.0853 602.293C86.0853 593.077 78.593 585.585 69.3777 585.585Z"],["M44.5039 404.061C44.5039 417.772 55.6673 428.935 69.3779 428.935C83.0886 428.935 94.2519 417.772 94.2519 404.061C94.2519 390.351 83.0886 379.188 69.3779 379.188C55.6673 379.188 44.5039 390.351 44.5039 404.061Z","#22d3ee","M69.3758 434.398C52.6683 434.398 39.1074 420.837 39.1074 404.13C39.1074 387.422 52.6683 373.861 69.3758 373.861C86.0833 373.861 99.6442 387.422 99.6442 404.13C99.6442 420.837 86.0833 434.398 69.3758 434.398ZM69.3758 384.575C58.5871 384.575 49.8961 393.341 49.8961 404.055C49.8961 414.768 58.662 423.534 69.3758 423.534C80.0896 423.534 88.8554 414.768 88.8554 404.055C88.8554 393.341 80.0896 384.575 69.3758 384.575Z"],["M70.4277 291.004C84.1652 291.004 95.3015 279.867 95.3015 266.13C95.3015 252.392 84.1652 241.256 70.4277 241.256C56.6902 241.256 45.5537 252.392 45.5537 266.13C45.5537 279.867 56.6902 291.004 70.4277 291.004Z","white","M70.4256 296.392C53.7181 296.392 40.1572 282.831 40.1572 266.124C40.1572 249.416 53.7181 235.855 70.4256 235.855C87.1331 235.855 100.694 249.416 100.
241694 266.124C100.694 282.831 87.1331 296.392 70.4256 296.392ZM70.4256 246.569C59.6369 246.569 50.9459 255.335 50.9459 266.049C50.9459 276.763 59.7118 285.528 70.4256 285.528C81.1394 285.528 89.905 276.763 89.905 266.049C89.905 255.335 81.1394 246.569 70.4256 246.569Z"]];return n.jsxs("svg",{viewBox:"10 137 1441 683",preserveAspectRatio:"xMinYMin meet",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-[65%] block text-black dark:text-white","aria-hidden":"true",children:[n.jsx(Se.path,{d:"M574.872 544.613C566.705 544.538 558.913 541.317 552.994 535.698L275.56 271.15C265.52 261.56 252.334 256.24 238.399 256.24H58.5869V277.818H238.399C246.715 277.818 254.657 280.964 260.725 286.733L538.16 551.281C548.049 560.721 561.011 565.966 574.647 566.191L1108.54 572.934L1108.84 551.356L574.946 544.613H574.872Z",fill:"currentColor",initial:{clipPath:"inset(0 100% 0 0)"},whileInView:{clipPath:"inset(0 0% 0 0)"},viewport:{once:!0},transition:{duration:.9,ease:"easeOut",delay:.5}}),n.jsx(Se.path,{d:"M153.365 785.552H38.3604V763.974H153.365C171.196 763.974 185.656 749.515 185.656 731.683V440.988C185.656 414.091 207.533 392.139 234.505 392.139H708.833C738.502 392.139 762.702 416.263 762.702 446.007V644.624H741.125V446.007C741.125 428.176 726.664 413.716 708.833 413.716H234.505C219.446 413.716 207.233 425.928 207.233 440.988V731.683C207.233 761.352 183.109 785.552 153.365 785.552Z",fill:"currentColor",initial:{clipPath:"inset(0 100% 0 0)"},whileInView:{clipPath:"inset(0 0% 0 0)"},viewport:{once:!0},transition:{duration:.9,ease:"easeOut",delay:.65}}),n.jsx(Se.path,{d:"M352.729 591.441H69.376V613.019H352.729V591.441Z",fill:"currentColor",initial:{clipPath:"inset(0 100% 0 0)"},whileInView:{clipPath:"inset(0 0% 0 0)"},viewport:{once:!0},transition:{duration:.45,ease:"easeOut",delay:.5}}),n.jsx(Se.path,{d:"M80.1644 266.117H58.5869V404.123H80.1644V266.117Z",fill:"currentColor",initial:{clipPath:"inset(100% 0 0 0)"},whileInView:{clipPath:"inset(0% 0 0 0)"},viewport:{once:!0},transition:{duration:.45,ease:"easeOut",delay:.52}}),e.map(([t,s,r],o)=>n.jsxs(Se.g,{style:{transformBox:"fill-box",transformOrigin:"center"},initial:{scale:0,opacity:0},whileInView:{scale:1,opacity:1},viewport:{once:!0},transition:{type:"spring",stiffness:420,damping:22,delay:o*.045},children:[n.jsx("path",{d:t,fill:"currentColor"}),n.jsx("path",{d:r,fill:"currentColor"})]},o))]})}function US(){return n.jsxs("svg",{viewBox:"10 163 1281 607",preserveAspectRatio:"xMinYMin meet",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-[65%] block","aria-hidden":"true",children:[n.jsx(Se.path,{d:"M189.179 356.252H46.9028C36.1141 356.252 27.2734 355.053 27.2734 365.917V752.138C27.2734 754.835 29.5213 757.082 32.2185 757.082H184.234C186.931 757.082 189.179 754.835 189.179 752.138V356.252ZM83.1651 391.615C83.1651 389.367 84.963 387.569 87.2107 387.569H137.184C139.431 387.569 141.229 389.367 141.229 391.615V444.585C141.229 446.832 139.431 448.63 137.184 448.63H87.2107C84.963 448.63 83.1651 446.832 83.1651 444.585V391.615ZM83.1651 499.502C83.1651 497.329 84.963 495.456 87.2107 495.456H137.184C139.431 495.456 141.229 497.254 141.229 499.502V552.472C141.229 554.719 139.431 556.517 137.184 556.517H87.2107C84.963 556.517 83.1651 554.719 83.1651 552.472V499.502Z",fill:"#8b5cf6",initial:{y:28,opacity:0}
241,whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{duration:.5,ease:[.34,1.56,.64,1],delay:0}}),n.jsx("g",{transform:"translate(-21, 0)",children:n.jsx(Se.path,{d:"M310.254 641.702C310.254 635.633 315.199 630.689 321.267 630.689H397.687C403.756 630.689 408.701 635.633 408.701 641.702V752.136C408.701 754.834 410.948 757.081 413.645 757.081H503.327C506.024 757.081 508.271 754.834 508.271 752.136V328.08C508.271 319.989 501.753 313.471 493.662 313.471H224.918C216.901 313.471 210.309 320.064 210.309 328.08V752.062C210.309 754.759 212.556 757.006 215.253 757.006H305.234C307.931 757.006 310.179 754.759 310.179 752.062V641.627L310.254 641.702ZM270.246 552.545V499.576C270.246 496.204 273.018 493.357 276.389 493.357H326.362C329.808 493.357 332.58 496.129 332.58 499.576V552.545C332.58 555.992 329.808 558.764 326.362 558.764H276.389C273.018 558.764 270.246 555.992 270.246 552.545ZM272.418 391.614C272.418 389.366 274.216 387.568 276.389 387.568H326.362C328.61 387.568 330.408 389.366 330.408 391.614V444.583C330.408 446.831 328.61 448.629 326.362 448.629H276.389C274.216 448.629 272.418 446.831 272.418 444.583V391.614ZM388.022 552.545V499.576C388.022 496.204 390.794 493.357 394.166 493.357H444.138C447.585 493.357 450.357 496.129 450.357 499.576V552.545C450.357 555.992 447.585 558.764 444.138 558.764H394.166C390.794 558.764 388.022 555.992 388.022 552.545ZM390.195 391.614C390.195 389.366 391.993 387.568 394.166 387.568H444.138C446.386 387.568 448.185 389.366 448.185 391.614V444.583C448.185 446.831 446.386 448.629 444.138 448.629H394.166C391.993 448.629 390.195 446.831 390.195 444.583V391.614Z",fill:"#8b5cf6",initial:{y:28,opacity:0}
241,whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{duration:.5,ease:[.34,1.56,.64,1],delay:.1}})}),n.jsx("g",{transform:"translate(-42, 0)",children:n.jsx(Se.path,{d:"M615.407 465.181C615.407 457.015 608.814 450.422 600.648 450.422H543.857C535.766 450.422 529.173 457.015 529.173 465.181V752.131C529.173 754.828 531.42 757.076 534.117 757.076H610.463C613.16 757.076 615.407 754.828 615.407 752.131V465.181Z",fill:"#8b5cf6",initial:{y:28,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{duration:.5,ease:[.34,1.56,.64,1],delay:.2}})})]})}function HS(){const e=MD(),t=w.useRef(null),s=BD(t,{once:!0});return w.useEffect(()=>{s&&e.start({opacity:1,y:0,transition:{duration:.65,delay:.35,ease:"easeOut"}}).then(()=>{e.start({y:[0,-7,0],transition:{duration:3,repeat:1/0,ease:"easeInOut"}})})},[s,e]),n.jsxs("svg",{viewBox:"18 120 1356 642",preserveAspectRatio:"xMinYMin meet",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-[65%] block","aria-hidden":"true",children:[n.jsx(Se.path,{d:"M602.446 630.695L497.105 445.339C487.216 428.781 463.166 428.781 453.276 445.339L353.63 630.695C343.441 647.702 355.654 669.355 375.583 669.355H580.568C600.422 669.355 612.71 647.702 602.521 630.695H602.446ZM475.079 636.164C466.987 636.164 460.619 629.721 460.619 621.555C460.619 613.388 467.062 607.02 475.378 607.095C483.395 607.095 489.763 613.613 489.688 621.779C489.688 629.871 483.245 636.164 475.004 636.164H475.079ZM492.385 511.045C491.336 519.212 490.812 527.453 490.063 535.695C488.864 548.956 487.666 562.217 486.467 575.478C486.167 578.999 485.868 582.521 485.493 585.967C485.044 591.137 480.622 595.182 475.378 595.257C469.984 595.257 465.414 591.436 464.965 586.117C463.541 570.608 462.117 555.099 460.694 539.59C459.795 529.701 458.895 519.811 457.847 509.921C456.798 499.882 464.89 490.966 475.229 490.966C486.018 490.966 493.734 500.257 492.385 511.045Z",fill:"#38bdf8",style:{transformBox:"fill-box",transformOrigin:"center"},initial:{scale:0,opacity:0},whileInView:{scale:1,opacity:1},viewport:{once:!0},transition:{type:"spring",stiffness:260,damping:18}}),n.jsx(Se.g,{ref:t,animate:e,initial:{opacity:0,y:10},children:n.jsx("path",{d:"M249.19 718.956C235.329 718.956 224.465 715.435 206.784 697.004C206.784 696.929 206.634 696.854 206.559 696.779C206.484 696.704 206.41 696.63 206.335 696.555C187.979 678.723 168.873 662.69 137.331 662.69C109.985 662.69 89.4569 672.58 66.456 696.63C58.5892 704.272 52.3707 709.516 46.7516 712.962C45.7027 713.562 45.1035 714.761 45.1035 715.959V752.072C45.1035 754.394 47.351 756.117 49.5986 755.443C67.8795 749.749 81.3653 737.986 94.4766 725.25C94.5515 725.175 94.6267 725.025 94.7765 724.95C94.8515 724.875 95.0016 724.8 95.0765 724.65C112.608 706.22 123.471 702.698 137.406 702.698C151.342 702.698 160.557 707.718 178.463 725.175C201.689 749.15 222.218 758.964 249.34 758.964C280.957 758.964 300.061 743.006 318.492 725.25C318.567 725.175 318.717 725.025 318.792 724.95C318.867 724.875 319.016 724.725 319.091 724.65C321.339 722.328 319.766 718.507 316.619 718.507H255.858C253.76 718.806 251.587 718.956 249.34 718.956H249.19ZM290.322 593.238C272.34 610.545 263.125 615.564 249.19 615.564C235.254 615.564 224.465 612.043 206.784 593.612C206.784 593.537 206.634 593.463 206.559 593.388C206.484 593.313 206.41 593.238 206.335 593.163C187.979 575.332 168.873 559.298 137.331 559.298C109.985 559.298 89.4569 569.188 66.456 593.238C58.5892 600.88 52.3707 606.124 46.7516 609.571C45.7027 610.17 45.1035 611.369 45.1035 612.568V648.68C45.1035 651.002 47.351 652.726 49.5986 652.051C67.8795 646.357 81.3653 634.594 94.4766 621.858C94.5515 621.783 94.6267 621.633 94.7765 621.558C94.8515 621.483 95.0016 621.408 95.0765 621.258C112.608 602.828 123.471 599.306 137.406 599.306C151.342 599.306 160.557 604.326 178.463 621.783C201.689 645.758 222.218 655.573 249.34 655.573C259.829 655.573 268.894 653.849 277.06 650.852C277.81 650.553 278.484 650.028 278.858 649.354L323.287 575.331C325.16 572.185 321.639 568.514 318.417 570.387C309.127 575.781 299.987 583.348 290.547 593.313L290.322 593.238ZM290.322 483.628C272.34 500.934 263.125 505.954 249.19 505.954C235.254 505.954 224.465 502.433 206.784 484.002C206.784 483.927 206.634 483.852 206.559 483.777C206.484 483.702 206.41 483.628 206.335 483.553C187.979 465.721 168.873 449.688 137.331 449.688C109.985 449.688 89.4569 459.578 66.456 483.628C58.5892 491.27 52.3707 496.514 46.7516 499.96C45.7027 500.56 45.1035 501.759 45.1035 502.957V539.069C45.1035 541.392 47.351 543.115 49.5986 542.441C67.8795 536.747 81.3653 524.984 94.4766 512.248C94.5515 512.173 94.6267 512.023 94.7765 511.948C94.8515 511.873 95.
2410016 511.798 95.0765 511.648C112.608 493.217 123.471 489.696 137.406 489.696C151.342 489.696 160.557 494.716 178.463 512.173C201.689 536.148 222.218 545.962 249.34 545.962C280.957 545.962 300.061 530.004 318.492 512.248C318.567 512.173 318.717 512.023 318.792 511.948C318.867 511.873 319.016 511.723 319.091 511.648C336.623 493.217 347.412 489.696 361.272 489.696C364.793 489.696 367.94 489.996 371.012 490.745C372.511 491.12 374.084 490.445 374.908 489.097L392.215 460.177C393.339 458.304 392.515 455.832 390.492 455.007C381.951 451.636 372.361 449.688 361.272 449.688C334.076 449.688 313.473 459.578 290.472 483.628H290.322ZM49.4486 439.049C67.7295 433.355 81.2153 421.592 94.3266 408.856C94.4015 408.781 94.4767 408.631 94.6266 408.556C94.7015 408.481 94.8516 408.406 94.9265 408.257C112.458 389.826 123.321 386.304 137.256 386.304C151.192 386.304 160.408 391.324 178.314 408.781C201.54 432.756 222.068 442.57 249.19 442.57C280.807 442.57 299.912 426.612 318.342 408.856C318.417 408.781 318.567 408.631 318.642 408.556C318.717 408.481 318.866 408.331 318.941 408.257C336.473 389.826 347.262 386.304 361.122 386.304C374.983 386.304 384.048 391.174 402.329 408.781C405.7 412.302 408.998 415.449 412.219 418.371C413.867 419.869 416.49 419.42 417.688 417.547L434.996 388.702C435.82 387.278 435.594 385.48 434.471 384.282C433.347 383.083 432.073 381.959 430.875 380.61C430.8 380.536 430.649 380.461 430.575 380.311C430.5 380.236 430.35 380.086 430.275 380.011C411.77 362.18 392.589 346.146 361.122 346.146C333.926 346.146 313.323 356.036 290.322 380.086C272.34 397.393 263.125 402.413 249.19 402.413C235.254 402.413 224.465 398.891 206.784 380.461C206.784 380.386 206.634 380.311 206.559 380.236C206.484 380.161 206.41 380.086 206.335 380.011C187.979 362.18 168.873 346.146 137.331 346.146C109.985 346.146 89.4569 356.036 66.456 380.086C58.5892 387.728 52.3707 392.973 46.7516 396.419C45.7027 397.018 45.1035 398.217 45.1035 399.416V435.528C45.1035 437.851 47.351 439.574 49.5986 438.899L49.4486 439.049ZM694.374 718.507H633.612C630.39 718.507 628.892 722.328 631.14 724.65C631.215 724.725 631.365 724.875 631.44 724.95C631.515 725.025 631.664 725.175 631.739 725.25C650.169 743.006 669.275 758.964 700.892 758.964C728.014 758.964 748.542 749.15 771.768 725.175C789.674 707.718 798.889 702.698 812.824 702.698C826.76 702.698 837.699 706.22 855.155 724.65C855.23 724.725 855.38 724.8 855.455 724.95C855.53 725.025 855.605 725.175 855.754 725.25C868.866 737.986 882.351 749.824 900.632 755.443C902.88 756.117 905.128 754.394 905.128 752.072V715.959C905.128 714.761 904.528 713.637 903.479 712.962C897.785 709.516 891.642 704.272 883.775 696.63C860.774 672.505 840.171 662.69 812.899 662.69C781.283 662.69 762.178 678.723 743.897 696.555C743.822 696.63 743.747 696.704 743.672 696.779C743.672 696.779 743.522 696.929 743.447 697.004C725.691 715.435 714.827 718.956 701.041 718.956C698.794 718.956 696.621 718.806 694.523 718.507H694.374ZM631.814 570.312C628.592 568.439 625.072 572.11 626.945 575.257L671.373 649.279C671.822 649.953 672.421 650.553 673.171 650.778C681.337 653.774 690.403 655.498 700.892 655.498C728.014 655.498 748.542 645.683 771.768 621.708C789.674 604.251 798.889 599.231 812.824 599.231C826.76 599.231 837.699 602.753 855.155 621.184C855.23 621.258 855.38 621.333 855.455 621.483C855.53 621.558 855.605 621.708 855.754 621.783C868.866 634.52 882.351 646.357 900.632 651.976C902.88 652.651 905.128 650.927 905.128 648.605V612.493C905.128 611.294 904.528 610.17 903.479 609.496C897.785 606.049 891.642 600.805 883.775 593.163C860.774 569.038 840.171 559.223 812.899 559.223C781.283 559.223 762.178 575.257 743.897 593.088C743.822 593.163 743.747 593.238 743.672 593.313C743.672 593.313 743.522 593.463 743.447 593.537C725.691 611.968 714.827 615.489 701.041 615.489C687.256 615.489 677.816 610.47 659.909 593.163C650.394 583.198 641.329 575.706 632.039 570.237L631.814 570.312ZM588.959 449.688C577.87 449.688 568.28 451.711 559.739 455.007C557.716 455.832 556.892 458.304 558.016 460.177L575.324 489.097C576.148 490.445 577.721 491.12 579.22 490.745C582.291 489.996 585.512 489.696 588.959 489.696C602.819 489.696 613.683 493.217 631.14 511.648C631.215 511.723 631.365 511.873 631.44 511.948C631.515 512.023 631.664 512.173 631.739 512.248C650.169 530.004 669.275 545.962 700.892 545.962C728.014 545.962 748.542 536.148 771.768 512.173C789.674 494.716 798.889 489.696 812.824 489.696C826.76 489.696 837.699 493.217 855.155 511.648C855.23 511.723 855.38 511.798 855.455 511.948C855.53 512.023 855.605 512.173 855.754 512.248C868.866 524.984 882.351 536.822 900.632 542.441C902.88 543.115 905.128 541.392 905.128 539.069V502.957C905.128 501.759 904.528 500.635 903.479 499.96C897.785 496.514 891.642 491.27 883.775 483.628C860.774 459.503 840.171 449.688 812.899 449.688C781.283 449.688 762.178 465.721 743.897 483.553C743.822 483.628 743.747 483.702 743.672 483.777C743.672 483.777 743.522 483.927 743.447 484.002C725.691 502.433 714.827 505.954 701.041 505.954C687.256 505.954 677.816 500.934 659.909 483.628C636.908 459.503 616.38 449.688 589.109 449.688H588.959ZM905.128 435.678V399.566C905.128 398.367 904.528 397.243 903.479 396.569C897.785 393.122 891.642 387.878 883.775 380.236C860.774 356.111 840.171 346.296 812.899 346.296C781.283 346.296 762.178 362.33 743.897 380.161C743.822 380.236 743.747 380.311 743.672 380.386C743.672 380.386 743.522 380.536 743.447 380.61C725.691 399.041 714.827 402.562 701.041 402.562C687.256 402.562 677.816 397.543 659.909 380.236C636.908 356.111 616.38 346.296 589.109 346.296C557.642 346.296 538.462 362.33 519.956 380.161C519.881 380.236 519.731 380.386 519.656 380.461C519.581 380.535 519.431 380.61 519.356 380.76C518.158 382.034 516.959 383.233 515.76 384.431C514.562 385.63 514.337 387.428 515.236 388.852L532.543 417.697C533.667 419.645 536.29 420.019 538.013 418.521C541.309 415.599 544.605 412.452 547.902 408.931C566.183 391.249 575.098 386.454 589.109 386.454C603.119 386.454 613.833 389.976 631.29 408.406C631.365 408.481 631.515 408.631 631.59 408.706C631.665 408.781 631.814 408.931 631.889 409.006C650.319 426.762 669.424 442.72 701.041 442.72C728.163 442.72 748.692 432.906 771.918 408.931C789.824 391.474 799.039 386.454 812.974 386.454C826.91 386.454 837.849 389.976 855.305 408.406C855.38 408.481 855.529 408.556 855.604 408.706C855.679 408.781 855.755 408.931 855.904 409.006C869.016 421.742 882.501 433.58 900.782 439.199C903.03 439.873 905.277 438.15 905.277 435.828L905.128 435.678ZM402.329 725.25C425.33 749.224 445.934 759.039 473.205 759.039C504.672 759.039 523.777 743.081 542.208 725.324C542.358 725.25 542.433 725.1 542.508 724.95C542.583 724.875 542.732 724.725 542.807 724.65C543.406 723.976 544.006 723.377 544.606 722.777H399.782C400.606 723.526 401.43 724.35 402.329 725.175V725.25Z",fill:"#38bdf8"})})]})}function nt({accent:e,icon:t,title:s,value:r,note:o,explainer:c,tone:d="default",badge:h,delay:p=0,testId:f,children:m}){const x=gi[e],y=d==="muted"?"text-slate-500 dark:text-slate-400":"text-slate-900 dark:text-white";return n.jsxs(Se.div,{initial:{opacity:0,y:8},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{delay:p,duration:.4},className:`${ws} p-4`,"data-testid":f,children:[n.jsx(js,{}),n.jsxs("div",{className:"relative flex h-full flex-col",children:[n.jsxs("div",{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 font-mono text-[10px] font-bold uppercase tracking-wider ${x.titleSoft}`,children:[t!=null&&n.jsx("span",{className:"inline-flex h-3 w-3 items-center justify-center",children:t}),s,h]}),r!=null&&n.jsx("div",{className:`mt-2 text-[17px] font-semibold leading-snug ${y}`,children:r}),o&&n.jsx("p",{className:"mt-1 text-[12px] leading-relaxed text-slate-600 dar
241k:text-slate-400",children:o}),m,c&&n.jsx("div",{className:"mt-auto pt-3",children:n.jsx("div",{className:"border-t border-slate-200/70 pt-2.5 dark:border-white/10",children:n.jsx("p",{className:"text-[11px] leading-relaxed text-slate-500 dark:text-slate-400",children:c})})})]})]})}const Au=[[72,22],[78,35],[68,48],[82,18],[88,42],[75,58],[92,28],[85,62],[70,72],[94,55],[66,30],[80,78],[90,15],[76,45],[62,62],[55,25],[58,42],[52,55],[60,68],[64,18],[50,35],[56,78],[48,22],[54,60],[46,45],[96,38],[97,65],[86,82],[93,72],[88,12],[38,28],[42,55],[35,42],[40,68],[44,18],[32,62],[36,80],[28,38],[34,15],[30,55],[62,85],[70,88],[80,88],[90,82],[50,88],[48,10],[60,12],[72,10],[84,8],[56,8]];function xy({accent:e="cyan",className:t="",searching:s=!1,dotExcludeZone:r,children:o}){const c=e==="fuchsia"?"rgba(217,70,239,0.7)":e==="sky"?"rgba(56,189,248,0.7)":"rgba(34,211,238,0.7)",d=e==="fuchsia"?"rgba(217,70,239,0.45)":e==="sky"?"rgba(56,189,248,0.45)":"rgba(34,211,238,0.45)",h=e==="fuchsia"?"bg-fuchsia-200":e==="sky"?"bg-sky-200":"bg-cyan-200",p=e==="fuchsia"?"bg-fuchsia-400/35 dark:bg-fuchsia-300/25":e==="sky"?"bg-sky-400/35 dark:bg-sky-300/25":"bg-cyan-400/35 dark:bg-cyan-300/25",f=r?Au.reduce((k,[S,N],C)=>(S>=r.minLeft&&N<=r.maxTop||k.push(C),k),[]):Au.map((k,S)=>S),m=()=>f[Math.floor(Math.random()*f.length)],[x,y]=w.useState(m);w.useEffect(()=>{if(!s){y(m());return}const k=setInterval(()=>{y(S=>{let N;do N=m();while(N===S);return N})},480);return()=>clearInterval(k)},[s]);const[v,j]=Au[x];return n.jsxs("div",{className:`relative bg-transparent ${t}`,children:[n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-[1] h-px dark:hidden",style:{background:"linear-gradient(90deg, transparent, rgba(15,23,42,0.10), transparent)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-[1] hidden h-px dark:block",style:{background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.10] dark:hidden","aria-hidden":!0,style:{backgroundImage:"linear-gradient(to right, rgb(15 23 42) 1px, transparent 1px), linear-gradient(to bottom, rgb(15 23 42) 1px, transparent 1px)",backgroundSize:"56px 56px",maskImage:"radial-gradient(ellipse at 75% 50%, black 30%, transparent 90%)",WebkitMaskImage:"radial-gradient(ellipse at 75% 50%, black 30%, transparent 90%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0 hidden opacity-[0.07] dark:block","aria-hidden":!0,style:{backgroundImage:"linear-gradient(to right, white 1px, transparent 1px), linear-gradient(to bottom, white 1px, transparent 1px)",backgroundSize:"56px 56px",maskImage:"radial-gradient(ellipse at 75% 50%, black 30%, transparent 90%)",WebkitMaskImage:"radial-gradient(ellipse at 75% 50%, black 30%, transparent 90%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":!0,children:Au.map(([k,S],N)=>{const C=N===x;return n.jsx("div",{className:"absolute",style:{left:`${k}%`,top:`${S}%`,transform:"translate(-50%, -50%)"},children:C?n.jsxs("div",{className:`relative h-2.5 w-2.5 rounded-full ${h}`,children:[n.jsx(Se.span,{className:"absolute -inset-1.5 rounded-full",style:{border:`1px solid ${c}`},initial:{scale:.6,opacity:.9},animate:{scale:2.8,opacity:0},transition:{duration:s?1.2:2.6,repeat:1/0,ease:[.215,.61,.355,1]}},`${x}-a`),n.jsx(Se.span,{className:"absolute -inset-1.5 rounded-full",style:{border:`1px solid ${d}`},initial:{scale:.6,opacity:.9},animate:{scale:2.8,opacity:0},transition:{duration:s?1.2:2.6,repeat:1/0,ease:[.215,.61,.355,1],delay:s?.6:1.3}},`${x}-b`)]}):n.jsx(Se.div,{className:`h-1.5 w-1.5 rounded-full ${p}`,animate:{opacity:[.25,.55,.25]},transition:{duration:3+N%5*.7,repeat:1/0,ease:"easeInOut",delay:N*.17%3}})},N)})}),o]})}const qS="scapely-dashboard-theme",VS=w.createContext(null);function YB(e){if(typeof window>"u")return e;try{const t=new URLSearchParams(window.location.search).get("theme");if(t==="light"||t==="dark")return t}catch{}try{const t=window.localStorage.getItem(qS);if(t==="light"||t==="dark")return t}catch{}return e}function zS({children:e,defaultTheme:t="light"}){const[s,r]=w.useState(()=>YB(t)),o=h=>{r(h);try{window.localStorage.setItem(qS,h)}catch{}},c=()=>o(s==="dark"?"light":"dark");w.useEffect(()=>{const h=document.documentElement;return s==="light"?h.classList.add("dashboard-light"):h.classList.remove("dashboard-light"),()=>{h.classList.remove("dashboard-light")}},[s]);const d=s==="dark";return n.jsx(VS.Provider,{value:{theme:s,setTheme:o,toggleTheme:c}
241,children:n.jsx("div",{className:d?"dark min-h-screen bg-[#06081c] [color-scheme:dark]":"min-h-screen bg-slate-50 [color-scheme:light]",children:e})})}function rl(){const e=w.useContext(VS);if(!e)throw new Error("useDashboardTheme must be used within a DashboardThemeProvider");return e}function QB({className:e=""}){const{theme:t,toggleTheme:s}=rl(),r=t==="dark",o=r?"Switch to light theme":"Switch to dark theme";return n.jsx("button",{type:"button",onClick:s,"data-testid":"button-theme-toggle","aria-label":o,title:o,className:`inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-200 text-slate-600 transition hover:bg-slate-100 hover:text-slate-900 dark:border-white/10 dark:bg-transparent dark:text-slate-300 dark:hover:bg-white/5 dark:hover:text-white sm:h-8 sm:w-8 ${e}`,children:r?n.jsx(Rc,{className:"h-4 w-4"}):n.jsx(Ac,{className:"h-4 w-4"})})}const Qn=e=>new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",maximumFractionDigits:0}).format(e),K5=e=>e.slice(0,4),ko=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})},d0=e=>e.toLowerCase().replace(/\b\w/g,t=>t.toUpperCase()),Og=e=>{const t=[];e.saon&&t.push(`Flat ${d0(e.saon)},`);const s=e.paon?d0(e.paon):"",r=e.street?d0(e.street):"",o=[s,r].filter(Boolean).join(" ");return o&&t.push(o),t.join(" ").trim()};function FS({records:e,matched_subject:t,attribution:s,comparable_records:r}){const[o,c]=w.useState(null),{theme:d}=rl(),h=d==="dark",p=h?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)",f=h?"rgba(255,255,255,0.65)":"rgba(71,85,105,0.95)",m=h?"#ffffff":"#0891b2",x=h?"rgba(255,255,255,0.85)":"rgba(51,65,85,0.95)",y=h?"#ffffff":"#0f172a",v=w.useRef(null),[j,k]=w.useState(1e3);w.useEffect(()=>{const pe=v.current;if(!pe)return;const Qe=()=>{const Yt=pe.clientWidth||pe.getBoundingClientRect().width;Yt>0&&k(Yt)};Qe();const rs=new ResizeObserver(Qe);return rs.observe(pe),()=>rs.disconnect()},[]);const S=w.useMemo(()=>[...e].sort((pe,Qe)=>new Date(pe.date).getTime()-new Date(Qe.date).getTime()),[e]);if(S.length===0)return n.jsx(W5,{matched:!1,attribution:s,children:n.jsxs("div",{className:"flex flex-col items-center justify-center px-4 py-10 text-center",children:[n.jsx(vk,{className:"h-6 w-6 text-cyan-700 dark:text-cyan-300/60"}),n.jsx("p",{className:"mt-3 text-[14px] text-slate-700 dark:text-slate-300",children:"No Land Registry sales recorded for this address."}),n.jsx("p",{className:"mt-1 max-w-md font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"Likely a new build, an off-register transfer, or sold before 1995."})]})});const N=1e3,C=280,E=48,O=48,P=28,M=56,B=N-E-O,A=C-P-M,L=r??[],U=[...S,...L],K=Math.min(...U.map(pe=>new Date(pe.date).getTime())),G=Math.max(...U.map(pe=>new Date(pe.date).getTime())),W=Math.max(G-K,1),ee=U.map(pe=>pe.price_gbp),te=Math.min(...ee),I=Math.max(...ee),V=Math.max(I-te,I*.1,1),H=Math.max(0,te-V*.15),se=I+V*.2,R=Math.max(se-H,1),Q=pe=>U.length===1?E+B/2:E+(new Date(pe).getTime()-K)/W*B,oe=pe=>P+A-(pe-H)/R*A,ne=S.map(pe=>({record:pe,x:Q(pe.date),y:oe(pe.price_gbp)})),le=L.map(pe=>({record:pe,x:Q(pe.date),y:oe(pe.price_gbp)})),fe=ne.length>1?ne.map((pe,Qe)=>`${Qe===0?"M":"L"} ${pe.x.toFixed(2)} ${pe.y.toFixed(2)}`).join(" "):`M ${ne[0].x.toFixed(2)} ${ne[0].y.toFixed(2)} L ${ne[0].x.toFixed(2)} ${ne[0].y.toFixed(2)}`,he=ne.length>1?`${fe} L ${ne[ne.length-1].x.toFixed(2)} ${(P+A).toFixed(2)} L ${ne[0].x.toFixed(2)} ${(P+A).toFixed(2)} Z`:"",Ne=(()=>{if(U.length===1){const gt=U[0];return[{x:Q(gt.date),label:K5(gt.date)}]}const pe=new Date(K).getFullYear(),Qe=new Date(G).getFullYear(),rs=Qe-pe,Yt=Math.max(1,Math.ceil(rs/6)),We=[];for(let gt=pe;gt<=Qe;gt+=Yt){const lt=new Date(`${gt}-01-01`).getTime(),Et=E+(Math.max(lt,K)-K)/W*B;We.push({x:Et,label:String(gt)})}return We[We.length-1]?.label!==String(Qe)&&We.push({x:E+B,label:String(Qe)}),We})(),J=S[0],ue=S[S.length-1],ye=S.length>1?(ue.price_gbp-J.price_gbp)/J.price_gbp*100:null,Le=(new Date(ue.date).getTime()-new Date(J.date).getTime())/(1e3*60*60*24*365.25),ot=S.length>1&&Le>.5?(Math.pow(ue.price_gbp/J.price_gbp,1/Le)-1)*100:null,Je=(ye??0)>=0,jt=pe=>pe*1e3/Math.max(j,1),Ia=jt(8),Is=jt(11),Wt=jt(8),oa=t&&S.length>=2,la=(Date.now()-new Date(ue.date).getTime())/(1e3*60*60*24*365.25),Ss=ue.price_gbp-J.price_gbp;return n.jsxs(W5,{matched:t,attribution:s,children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3 border-b border-slate-200 dark:border-white/[0.06] px-5 py-4 sm:grid-cols-4 sm:px-6",children:[n.jsx(ei,{label:"Sales recorded",value:String(S.length)}),n.jsx(ei,{label:"Last sale",value:Qn(ue.price_gbp),sub:ko(ue.date)}),n.jsx(ei,{label:"First on record",value:Qn(J.price_gbp),sub:ko(J.date)}),ye!==null?n.jsx(ei,{label:"Change",value:n.jsxs("span",{className:`inline-flex items-center justify-center gap-1 ${Je?"text-emerald-600 dark:text-emerald-400":"text-purple-500"}`,children:[Je?n.jsx(an,{className:"h-4 w-4"}):n.jsx(W7,{className:"h-4 w-4"}),ye>=0?"+":"",ye.toFixed(0),"%"]}),sub:ot!==null?`${ot>=0?"+":""}${ot.toFixed(1)}% / yr`:void 0}):n.jsx(ei,{label:"Change",value:"—",sub:"Single sale"})]}),oa&&n.jsxs("div",{className:"grid grid-cols-2 gap-3 border-b border-slate-200 dark:border-white/[0.06] px-5 py-3 sm:px-6",children:[n.jsx(ei,{label:"Current holding period",value:`${la.toFixed(1)} yrs`,sub:`Since ${ko(ue.date)}`}),n.jsx(ei,{label:"Paper gain since first sale",value:n.jsxs("span",{className:Ss>=0?"text-emerald-600 dark:text-emerald-400":"text-purple-500",children:[Ss>=0?"+":"",Qn(Ss)]}),sub:`From ${Qn(J.price_gbp)} (${K5(J.date)})`})]}),n.jsx("div",{className:"px-3 py-4 sm:px-5 sm:py-5",children:n.jsxs("svg",{ref:v,viewBox:`0 0 ${N} ${C}`,className:"h-auto w-full",preserveAspectRatio:"none",role:"img","aria-label":"Sale price history chart",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"sale-area-grad",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"0%",stopColor:"rgba(34,211,238,0.18)"}),n.jsx("stop",{offset:"100%",stopColor:"rgba(34,211,238,0)"})]}),n.jsxs("linearGradient",{id:"sale-line-grad",x1:"0",y1:"0",x2:"1",y2:"0",children:[n.jsx("stop",{offset:"0%",stopColor:m}),n.jsx("stop",{offset:"100%",stopColor:m})]})]}),n.jsx("line",{x1:E,x2:N-O,y1:P+A,y2:P+A,stroke:p,strokeWidth:1}),Ne.map((pe,Qe)=>n.jsx("text",{x:pe.x,y:P+A+18,textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",fontSize:Wt,fontWeight:400,fill:f,children:pe.label},`xt-${Qe}`)),he&&n.jsx(Se.path,{d:he,fill:"url(#sale-area-grad)",initial:{opacity:0}
241,whileInView:{opacity:1},viewport:{once:!0,margin:"-60px"},transition:{duration:.9,delay:.3,ease:"easeOut"}}),n.jsx(Se.path,{d:fe,fill:"none",stroke:"url(#sale-line-grad)",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round",initial:{pathLength:0,opacity:0},whileInView:{pathLength:1,opacity:1},viewport:{once:!0,margin:"-60px"},transition:{duration:1.6,ease:"easeInOut"}}),le.map((pe,Qe)=>{const rs=o===-(Qe+1);return n.jsxs("g",{onMouseEnter:()=>c(-(Qe+1)),onMouseLeave:()=>c(null),style:{cursor:"pointer"},children:[n.jsx("circle",{cx:pe.x,cy:pe.y,r:rs?5:3,fill:"rgba(125, 211, 252, 0.3)",stroke:"rgba(125, 211, 252, 0.85)",strokeWidth:1,style:{transition:"r 0.18s ease"}}),rs&&(()=>{const Yt=Og(pe.record),We=Yt?60:42,gt=200,lt=12,Et=pe.y+lt,ct=pe.y-lt-We,fs=Et+We<=P+A+18||ct<4?Math.min(Et,P+A+18-We):ct,$s=Math.min(Math.max(pe.x-gt/2,E),N-O-gt);return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:$s,y:fs,width:gt,height:We,rx:6,ry:6,fill:"rgba(10, 14, 42, 0.95)",stroke:"rgba(167, 139, 250, 0.4)",strokeWidth:1}),n.jsx("text",{x:$s+10,y:fs+18,fontFamily:"Inter, system-ui, sans-serif",fontSize:Is,fontWeight:600,fill:"#ddd6fe",children:Qn(pe.record.price_gbp)}),n.jsx("text",{x:$s+10,y:fs+34,fontFamily:"Inter, system-ui, sans-serif",fontSize:Is,fill:"rgba(255,255,255,0.7)",children:ko(pe.record.date)}),Yt&&n.jsx("text",{x:$s+10,y:fs+50,fontFamily:"Inter, system-ui, sans-serif",fontSize:Is,fill:"rgba(255,255,255,0.55)",children:Yt.length>30?Yt.slice(0,28)+"…":Yt})]})})()]},`cmp-${Qe}`)}),ne.map((pe,Qe)=>{const rs=Qn(pe.record.price_gbp),Yt=Math.max(16,rs.length*3.1),We=[-12,20,-26,32,-40,46];let gt=pe.y-12;for(const Ns of We){const dt=pe.y+Ns;if(dt<P+4||dt>P+A+18)continue;if(!ne.slice(0,Qe).some(ut=>{const ys=Qn(ut.record.price_gbp),Cs=Math.max(16,ys.length*3.1);if(Math.abs(pe.x-ut.x)>Yt+Cs+4)return!1;const Es=ut._labelY??ut.y-16;return Math.abs(dt-Es)<18})){gt=dt;break}}pe._labelY=gt;const lt=o===Qe,Et=Qe>0?ne[Qe-1].record.price_gbp:null,ct=Et==null?"flat":pe.record.price_gbp>Et?"up":pe.record.price_gbp<Et?"down":"flat",fs=Qe===0,$s=fs?y:ct==="up"?"#c4b5fd":ct==="down"?"#a855f7":pe.record.is_subject_property?"#22d3ee":"#a78bfa",$a=fs?y:ct==="up"?"#c4b5fd":ct==="down"?"#a855f7":"#06081c";return n.jsxs(Se.g,{initial:{opacity:0,scale:0},whileInView:{opacity:1,scale:1},viewport:{once:!0,margin:"-60px"},transition:{duration:.4,delay:.3+Qe/Math.max(ne.length-1,1)*.9,ease:"easeOut"},onMouseEnter:()=>c(Qe),onMouseLeave:()=>c(null),style:{cursor:"pointer"},children:[pe.record.is_subject_property&&n.jsxs(n.Fragment,{children:[n.jsx(Se.circle,{cx:pe.x,cy:pe.y,fill:"none",stroke:"#22d3ee",strokeWidth:1.5,initial:{r:5,opacity:.6},animate:{r:16,opacity:0},transition:{duration:1.8,repeat:1/0,ease:"easeOut"}}),n.jsx(Se.circle,{cx:pe.x,cy:pe.y,fill:"none",stroke:"#22d3ee",strokeWidth:1.5,initial:{r:5,opacity:.6},animate:{r:16,opacity:0},transition:{duration:1.8,repeat:1/0,ease:"easeOut",delay:.9}})]}),n.jsx("circle",{cx:pe.x,cy:pe.y,r:lt?8:5,fill:$a,stroke:$s,strokeWidth:2,style:{transition:"r 0.18s ease"}}),n.jsx("text",{x:pe.x,y:gt,textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",fontSize:Ia,fontWeight:500,fill:lt?"#67e8f9":x,children:Qn(pe.record.price_gbp)}),lt&&(()=>{const Ns=Og(pe.record),dt=!t&&Ns,Qt=dt?68:50,ut=200,ys=14,Cs=pe.y+ys,ln=pe.y-ys-Qt,Es=Cs+Qt<=P+A+18||ln<4?Math.min(Cs,P+A+18-Qt):ln,Ts=Math.min(Math.max(pe.x-ut/2,E),N-O-ut);return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:Ts,y:Es,width:200,height:Qt,rx:8,fill:"rgba(10,14,42,0.96)",stroke:"rgba(34,211,238,0.4)",strokeWidth:1}),n.jsx("text",{x:Ts+100,y:Es+20,textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",fontSize:jt(13),fontWeight:600,fill:"#fff",children:Qn(pe.record.price_gbp)}),n.jsxs("text",{x:Ts+100,y:Es+38,textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",fontSize:Is,fill:"rgba(148,163,184,0.95)",children:[ko(pe.record.date),pe.record.estate_type?` · ${pe.record.estate_type}`:"",pe.record.new_build?" · new build":""]}),dt&&n.jsx("text",{x:Ts+100,y:Es+56,textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",fontSize:Is,fontWeight:500,fill:"rgba(103,232,249,0.95)",children:Ns})]})})()]},`pt-${Qe}`)})]})}),r&&r.length>0&&n.jsx(ZB,{records:r})]})}function ZB({records:e}){const s=[...e].sort((r,o)=>new Date(o.date).getTime()-new Date(r.date).getTime()).slice(0,6);return n.jsxs("div",{className:"border-t border-slate-200 dark:border-white/[0.06] px-5 py-4 sm:px-6",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-2 text-cyan-500 dark:text-cyan-300",children:[n.jsx(vk,{className:"h-3.5 w-3.5"}),n.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-wider",children:"Comparable sales nearby"}),n.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:["(",e.length," at this postcode)"]})]}),n.jsx("ul",{className:"divide-y divide-slate-200 dark:divide-white/[0.04]",children:s.map((r,o)=>n.jsxs("li",{className:"flex items-center justify-between gap-3 py-1.5 text-[13px] text-slate-800 dark:text-slate-200",children:[n.jsx("span",{className:"truncate text-slate-700 dark:text-slate-300",children:Og(r)||"Same postcode"}),n.jsxs("span",{className:"flex items-center gap-2 font-mono text-[11px] text-slate-500",children:[n.jsx("span",{children:ko(r.date)}),n.jsx("span",{className:"font-semibold text-slate-900 dark:text-white",children:Qn(r.price_gbp)})]})]},`${r.date}-${r.paon??""}-${r.saon??""}-${o}`))}),e.length>s.length&&n.jsxs("p",{className:"mt-2 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:["Showing ",s.length," most recent of ",e.length]})]})}function W5({matched:e,attribution:t,children:s}){return n.jsxs(Se.section,{initial:{opacity:0,y:14},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{duration:.5,ease:"easeOut"},className:"relative overflow-hidden rounded-[12px] border border-slate-300 dark:border-white/[0.16]","data-testid":"card-sale-history",children:[n.jsx("span",{"aria-hidden":!0,
241className:"pointer-events-none absolute left-0 right-0 top-0 h-px bg-gradient-to-r from-transparent via-slate-300/60 dark:via-white/15 to-transparent"}),n.jsx("header",{className:"flex items-start justify-between gap-3 px-5 pb-3 pt-4 sm:px-6",children:n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center gap-2 text-cyan-500 dark:text-cyan-300",children:n.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-wider",children:"Transactions"})}),n.jsx("p",{className:"mt-1 text-[13px] text-slate-600 dark:text-slate-400",children:e?"Confirmed Land Registry sales for this address.":"Recent sales at this postcode (no exact match for this address — shown as comparable evidence)."})]})}),s]})}function ei({label:e,value:t,sub:s}){return n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:e}),n.jsx("div",{className:"mt-1 text-[15px] font-semibold text-slate-900 dark:text-white",children:t}),s&&n.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-slate-500",children:s})]})}function GS({primaryLink:e}){const{theme:t,toggleTheme:s}=Da(),r=t==="light",[o,c]=w.useState(!1),[d,h]=w.useState(!1);w.useEffect(()=>{const S=()=>c(window.scrollY>8);return S(),window.addEventListener("scroll",S,{passive:!0}),()=>window.removeEventListener("scroll",S)},[]),w.useEffect(()=>{if(!d)return;const S=N=>{N.key==="Escape"&&h(!1)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[d]);const p=o||d?r?"border-b border-slate-200 bg-white/85 backdrop-blur-md":"border-b border-white/10 backdrop-blur-md":"",f=r?"text-slate-700 hover:text-slate-900":"text-slate-200 hover:text-white",m=r?"border border-slate-900 bg-transparent text-slate-900 hover:bg-slate-900 hover:text-white":"border border-white bg-transparent text-white hover:bg-white hover:text-[#06081c]",x=r?"text-slate-700 hover:bg-slate-100":"text-slate-200 hover:bg-white/10",y=r?"bg-white/95 border-slate-200":"bg-[#06081c]/95 border-white/10",v=r?"text-slate-800 hover:bg-slate-100":"text-slate-100 hover:bg-white/10",j=r?"text-slate-500 hover:bg-slate-100":"text-slate-400 hover:bg-white/10",k=[{href:"/demo-report",label:"Demo report",testId:"link-mobile-demo-report"},{href:e.href,label:e.label,testId:`link-mobile-${e.testId}`},{href:"/resources",label:"Resources",testId:"link-mobile-resources"},{href:"/property-data",label:"Property data",testId:"link-mobile-property-data"},{href:"/investors",label:"Investors",testId:"link-mobile-investors"},{href:"/contact",label:"Contact",testId:"link-mobile-contact"},{href:"/dashboard",label:"Sign in",testId:"link-mobile-signin"}];return n.jsxs("header",{className:`fixed top-0 z-40 w-full transition-colors duration-200 ${p}`,children:[n.jsxs("div",{className:"relative mx-auto flex h-16 w-full max-w-7xl items-center justify-between px-6 sm:h-20",children:[n.jsxs("a",{href:"/",className:"flex items-center gap-3","data-testid":"link-logo",children:[n.jsx("img",{src:zo,alt:"Scapely",className:"block h-7 w-auto sm:hidden"}),n.jsx("img",{src:r?fp:_n,alt:"Scapely",className:"hidden h-[15px] w-auto sm:block sm:h-[16px]"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("a",{href:"/demo-report","data-testid":"link-nav-demo-report",className:`hidden h-9 items-center px-3 text-[13px] font-medium transition sm:inline-flex ${f}`,children:"Demo report"}),n.jsx("a",{href:e.href,"data-testid":e.testId,className:`hidden h-9 items-center px-3 text-[13px] font-medium transition sm:inline-flex ${f}`,children:e.label}),n.jsx("a",{href:"/resources","data-testid":"link-nav-resources",className:`hidden h-9 items-center px-3 text-[13px] font-medium transition sm:inline-flex ${f}`,children:"Resources"}),n.jsx("a",{href:"/dashboard","data-testid":"link-nav-signin",className:`hidden h-9 items-center px-3 text-[13px] font-medium transition sm:inline-flex ${f}`,children:"Sign in"}),n.jsx("button",{type:"button",onClick:s,"aria-label":r?"Switch to dark theme":"Switch to light theme",className:`hidden h-9 w-9 items-center justify-center rounded-lg transition sm:inline-flex ${j}`,children:r?n.jsx(Ac,{className:"h-4 w-4"}):n.jsx(Rc,{className:"h-4 w-4"})}),n.jsx("a",{href:"/dashboard?mode=signup","data-testid":"button-nav-cta",className:`inline-flex h-9 items-center rounded-full border px-4 text-[13px] font-semibold backdrop-blur transition active:scale-[0.98] ${m}`,children:"Create account"}),n.jsx("button",{type:"button","aria-label":d?"Close menu":"Open menu","aria-expanded":d,"data-testid":"button-mobile-menu",onClick:()=>h(S=>!S),className:`inline-flex h-9 w-9 items-center justify-center rounded-lg transition sm:hidden ${x}`,children:d?n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,
241children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})]})]}),d&&n.jsx("div",{id:"mobile-menu","data-testid":"mobile-menu",className:`border-t backdrop-blur-md sm:hidden ${y}`,children:n.jsxs("nav",{className:"mx-auto flex max-w-7xl flex-col px-4 py-3",children:[n.jsxs("button",{type:"button",onClick:()=>{s(),h(!1)},className:`flex items-center gap-3 rounded-lg px-3 py-3 text-[15px] font-medium transition ${v}`,children:[r?n.jsx(Ac,{className:"h-4 w-4"}):n.jsx(Rc,{className:"h-4 w-4"}),n.jsx("span",{children:r?"Switch to dark mode":"Switch to light mode"})]}),k.map(S=>n.jsx("a",{href:S.href,"data-testid":S.testId,onClick:()=>h(!1),className:`rounded-lg px-3 py-3 text-[15px] font-medium transition ${v}`,children:S.label},S.testId))]})})]})}function XB({isLight:e}){const t=e?"hover:text-slate-700":"hover:text-slate-300",s=e?"text-slate-600 hover:text-slate-900":"text-slate-300 hover:text-white";return n.jsx("footer",{className:`border-t py-10 ${e?"border-slate-200 bg-slate-50":"border-white/5 bg-[#070a20]"}`,children:n.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center gap-5 px-6",children:[n.jsx("a",{href:"/pricing","data-testid":"link-footer-dashboard",className:`text-[13px] font-medium underline underline-offset-4 transition ${s}`,children:"Get the Scapely Dashboard"}),n.jsxs("div",{className:"flex w-full flex-col items-center justify-between gap-3 sm:flex-row",children:[n.jsx("div",{className:`text-sm ${e?"text-slate-500":"text-slate-400"}`,children:n.jsx("span",{children:"© 2026 Scapely Ltd. All rights reserved."})}),n.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-4 gap-y-2 font-mono text-[11px] uppercase tracking-wider text-slate-500",children:[n.jsx("a",{href:"/resources","data-testid":"link-footer-resources",className:`transition ${t}`,children:"Resources"}),n.jsx("a",{href:"/investors","data-testid":"link-footer-investors",className:`transition ${t}`,children:"Investors"}),n.jsx("a",{href:"/property-data","data-testid":"link-footer-property-data",className:`transition ${t}`,children:"Property data"}),n.jsx("a",{href:"/privacy","data-testid":"link-footer-privacy",className:`transition ${t}`,children:"Privacy"}),n.jsx("a",{href:"/terms","data-testid":"link-footer-terms",className:`transition ${t}`,children:"Terms"}),n.jsx("a",{href:"/contact","data-testid":"link-footer-contact",className:`transition ${t}`,children:"Contact"})]})]})]})})}function as({children:e,surface:t,primaryNavLink:s={href:"/pricing",label:"Pricing",testId:"link-nav-pricing"}}){const{theme:r}=Da(),o=r==="light";return n.jsxs("div",{className:`min-h-screen transition-colors duration-300 ${o?"bg-slate-50 text-slate-900":"dark bg-[#06081c] text-foreground"}`,children:[n.jsx(GS,{primaryLink:s}),n.jsx("main",{className:"pt-24 sm:pt-28",children:e}),n.jsx(XB,{isLight:o})]})}function Y5(e){return e*Math.PI/180}function Q5(e,t,s,r){return{x:e+s*Math.cos(Y5(r)),y:t+s*Math.sin(Y5(r))}}function Z5(e,t,s,r,o){const c=Q5(e,t,s,r),d=Q5(e,t,s,o),p=(o-r+360)%360>180?1:0;return`M ${c.x.toFixed(2)} ${c.y.toFixed(2)} A ${s} ${s} 0 ${p} 1 ${d.x.toFixed(2)} ${d.y.toFixed(2)}`}const JB={efficiency:.15,location:.3,investment:.25,safety:.15,value:.15};function eI(e){if(!e.length)return 0;let t=0,s=0;for(const r of e){const o=JB[r.key]??1/e.length;t+=r.value*o,s+=o}return Math.round(t/s)}function Ah(e){return e>=80?"#22d3ee":e>=65?"#a3e635":e>=50?"#f59e0b":"#f87171"}function tI(e){return e>=80?"Excellent":e>=65?"Good":e>=50?"Fair":"Poor"}const X5=50,J5=40,e3=34,Ru=150,t3=240;function sI({score:e,isDark:t}){const s=Ah(e),r=t?"rgba(255,255,255,0.07)":"rgba(15,23,42,0.10)",o=Z5(X5,J5,e3,Ru,Ru+t3),c=e/100*t3,d=Ru+c,h=e>0?Z5(X5,J5,e3,Ru,d):null;return n.jsxs("svg",{viewBox:"0 0 100 80",className:"w-full","aria-hidden":!0,
241children:[n.jsx("path",{d:o,fill:"none",stroke:r,strokeWidth:"6",strokeLinecap:"round"}),h&&n.jsx("path",{d:h,fill:"none",stroke:s,strokeWidth:"6",strokeLinecap:"round"})]})}const nI=[{range:"80 – 100",label:"Excellent",color:"#22d3ee",desc:"Strong across most dimensions."},{range:"65 – 79",label:"Good",color:"#a3e635",desc:"Clear strengths with minor gaps."},{range:"50 – 64",label:"Fair",color:"#f59e0b",desc:"Multiple factors need attention."},{range:"0 – 49",label:"Poor",color:"#f87171",desc:"Significant challenges identified."}];function aI({dimensions:e,overall:t,onClose:s}){const r=w.useRef(null),{theme:o}=rl(),c=o==="dark";function d(j){j.target===r.current&&s()}w.useEffect(()=>{const j=k=>{k.key==="Escape"&&s()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[s]);const h=Ah(t),p=c?"bg-[#06081c] border-white/[0.08]":"bg-white border-slate-200",f=c?"border-white/[0.06]":"border-slate-100",m=c?"text-white":"text-slate-900",x=c?"text-white":"text-slate-900",y=c?"text-white":"text-slate-900",v=c?"border-white/20 text-white hover:border-white hover:bg-white hover:text-[#06081c]":"border-slate-300 text-slate-900 hover:border-slate-900 hover:bg-slate-900 hover:text-white";return Qo.createPortal(n.jsx("div",{ref:r,onClick:d,className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:n.jsxs("div",{className:`relative w-full max-w-4xl overflow-hidden rounded-2xl border shadow-2xl ${p}`,children:[n.jsxs("div",{className:`flex items-center justify-between border-b px-6 py-5 ${f}`,children:[n.jsx("h2",{className:`text-[18px] font-semibold tracking-tight ${m}`,children:"Scapely Property Score®"}),n.jsx("button",{onClick:s,"aria-label":"Close",className:`rounded-lg p-1.5 transition ${c?"text-white hover:bg-white/[0.06]":"text-slate-900 hover:bg-slate-100"}`,children:n.jsx(Ar,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"max-h-[80vh] overflow-y-auto px-6 py-5",children:[n.jsx("div",{className:"grid grid-cols-2 gap-x-5 gap-y-5 sm:grid-cols-5",children:e.map(j=>(Ah(j.value),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("div",{className:`inline-flex items-baseline gap-1 self-start rounded-full px-2.5 py-0.5 font-mono text-[11px] font-bold ${c?"bg-white/[0.08] text-white":"bg-slate-100 text-slate-900"}`,children:[n.jsx("span",{className:"text-[13px] tabular-nums",children:j.value}),n.jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-80",children:j.label})]}),n.jsx("p",{className:`text-[12px] leading-relaxed ${x}`,children:j.modalDescription})]},j.key)))}),n.jsx("div",{className:`my-6 border-t ${f}`}),n.jsx("h3",{className:`mb-5 text-[16px] font-semibold ${m}`,children:"How we calculate the Score"}),n.jsxs("div",{className:"relative mb-6",children:[n.jsx("div",{className:"h-3 w-full rounded-full",style:{background:"linear-gradient(to right, #f87171 0%, #f59e0b 33%, #a3e635 66%, #22d3ee 100%)"}}),n.jsxs("div",{className:"pointer-events-none absolute top-0 flex -translate-x-1/2 flex-col items-center",style:{left:`${t}%`},children:[n.jsx("div",{className:"mb-px h-3 w-0.5 rounded-full bg-white/90"}),n.jsx("span",{className:"mt-1 font-mono text-[12px] font-bold tabular-nums leading-none",style:{color:h},children:t})]})]}),n.jsx("div",{className:"mt-8 grid grid-cols-2 gap-4 sm:grid-cols-4",children:nI.map(j=>n.jsxs("div",{children:[n.jsx("p",{className:`mb-1 text-[14px] font-semibold leading-none ${m}`,children:j.label}),n.jsx("p",{className:`text-[12px] leading-relaxed ${x}`,children:j.desc})]},j.label))}),n.jsx("div",{className:`my-5 border-t ${f}`}),n.jsxs("p",{className:`mb-2 text-[13px] leading-relaxed ${x}`,children:["Five weighted dimensions —"," ",n.jsx("strong",{className:m,children:"Location (30%), Investment (25%), Efficiency (15%), Safety (15%), Value (15%)"})," ","— combined into a single 0–100 index using EPC Register, TfL PTAL, Environment Agency, Land Registry, and Scapely AI data."]}),n.jsx("p",{className:`text-[12px] leading-relaxed ${y}`,children:"Indicative only — not financial advice. Use alongside the full report and independent professional advice."})]}),n.jsx("div",{className:`flex items-center justify-end border-t px-6 py-4 ${f}`,children:n.jsx("button",{onClick:s,className:`inline-flex h-9 items-center rounded-full border px-5 text-[13px] font-semibold transition active:scale-[0.98] ${v}`,children:"Close"})})]})}),document.body)}function KS({dimensions:e,className:t}){const[s,r]=w.useState(!1),{theme:o}=rl(),c=o==="dark",d=eI(e),h=Ah(d),p=tI(d),[f,m]=w.useState(0);return w.useEffect(()=>{let x=0;const y=1e3,v=performance.now(),j=k=>{const S=Math.min(1,(k-v)/y),N=1-Math.pow(1-S,3);m(Math.round(d*N)),S<1&&(x=requestAnimationFrame(j))};return x=requestAnimationFrame(j),()=>cancelAnimationFrame(x)},[d]),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:["relative flex w-[220px] flex-col items-center","pb-4 pt-3.5",t??""].join(" "),children:[n.jsxs("div",{className:"relative w-[128px] translate-y-3 scale-[1.21] transform-gpu",children:[n.jsx(sI,{score:f,isDark:c}),n.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:n.jsx("span",{className:"font-mono text-[34px] font-bold tabular-nums leading-none tracking-tight",style:{color:h},children:f})})]}),n.jsx("p",{className:"mt-1.5 font-mono text-[14px] font-semibold uppercase tracking-[0.14em] text-slate-900 dark:text-white",children:p}),n.jsx("p",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-[0.14em] text-slate-900 dark:text-white",children:"Scapely Property Score®"}),n.jsx("button",{type:"button",onClick:()=>r(!0),className:["mt-3 inline-flex h-[27px] items-center rounded-full border px-3","text-[10px] font-semibold backdrop-blur transition active:scale-[0.98]","border-slate-900 bg-transparent text-slate-900 hover:bg-slate-900 hover:text-white","dark:border-white dark:bg-transparent dark:text-white dark:hover:bg-white dark:hover:text-[#06081c]"].join(" "),children:"Score breakdown"})]}),s&&n.jsx(aI,{dimensions:e,overall:d,onClose:()=>r(!1)})]})}const rI=[{key:"efficiency",label:"Efficiency",icon:n.jsx(kn,{className:"h-3.5 w-3.5"}),value:40,barColor:"#f59e0b",modalDescription:"EPC E (SAP 38). Pre-1900 solid-wall terrace with above-average heating costs. Uplift to band C viable via insulation and heat-pump retrofit.",sources:["EPC Register","MHCLG"]},{key:"location",label:"Location",icon:n.jsx(Xo,{className:"h-3.5 w-3.5"}),value:92,barColor:"#22d3ee",modalDescription:"PTAL 6a — highest TfL accessibility tier. Exceptional walkability, multiple tube and bus routes in SW10.",sources:["TfL PTAL","Walkscore"]},{key:"investment",label:"Investment",icon:n.jsx(an,{className:"h-3.5 w-3.5"}),value:81,barColor:"#10b981",modalDescription:"HMO density 14% — below saturation. BTL yield ~5.2% gross. Redevelopment potential identified; flip margins tight at £1.85m.",sources:["Scapely AI","Land Registry","Rightmove"]},{key:"safety",label:"Safety",icon:n.jsx(jx,{className:"h-3.5 w-3.5"}),value:88,barColor:"#818cf8",modalDescription:"Flood Zone 1 (<0.1% annual probability). RBKC crime below London average. No subsidence flags.",sources:["Environment Agency","Police.uk","BGS"]},{key:"value",label:"Value",icon:n.jsx(Jo,{className:"h-3.5 w-3.5"}),value:65,barColor:"#c084fc",modalDescription:"£1.85m in line with SW10 comparables. Mature prime market; limited near-term growth. EPC upgrade adds equity headroom.",sources:["Land Registry","Zoopla","Scapely AI"]}],iI={"6b":98,"6a":92,5:82,4:70,3:57,2:43,"1b":32,"1a":22,0:12},oI={A:94,B:82,C:69,D:55,E:40,F:25,G:12};function lI({epcBand:e,sapScore:t,ptalScore:s,hmoSaturationPct:r,floodZone:o}){const c=t!=null?Math.min(99,Math.max(5,Math.round(t))):e?oI[e.toUpperCase()]??50:50,d=s!=null?String(s).toLowerCase().trim():null,h=d?iI[d]??50:55,p=r??10,f=p<5?48:p<10?62:p<20?78:p<30?85:p<40?68:52,m={1:90,2:60,3:28},x=o!=null?m[o]??75:80,y=Math.min(95,Math.round(h*.45+c*.25+x*.2+5));return[{key:"efficiency",label:"Efficiency",icon:n.jsx(kn,{className:"h-3.5 w-3.5"}),value:c,barColor:"#f59e0b",modalDescription:"Based on EPC band or SAP score. Reflects current energy performance, running costs, and upgrade headroom.",sources:["EPC Register","MHCLG"]},{key:"location",label:"Location",icon:n.jsx(Xo,{className:"h-3.5 w-3.5"}),value:h,barColor:"#22d3ee",modalDescription:"Based on TfL PTAL score. 6a/6b is the highest tier — excellent public transport access.",sources:["TfL PTAL"]},{key:"investment",label:"Investment",icon:n.jsx(an,{className:"h-3.5 w-3.5"}),value:f,barColor:"#10b981",modalDescription:"From HMO density, rental yield projections, and Scapely AI appraisal. Moderate saturation typically signals the strongest opportunity.",sources:["Scapely AI","Land Registry"]},{key:"safety",label:"Safety",icon:n.jsx(jx,{className:"h-3.5 w-3.5"}),value:x,barColor:"#818cf8",modalDescription:"Driven by EA flood risk zone. Zone 1 (<0.1% annual probability) scores highest.",sources:["Environment Agency","Police.uk"]},{key:"value",label:"Value",icon:n.jsx(Jo,{className:"h-3.5 w-3.5"}),value:y,barColor:"#c084fc",modalDescription:"Composite of location and energy-efficiency potential. Reflects long-term capital value prospects.",sources:["Land Registry","Zoopla"]}]}const s3=["#ef4444","#f97316","#f59e0b","#eab308","#d4e034","#a3e635","#4ade80","#22c55e","#10b981","#008054"];function WS({decile:e}){if(e===null)return null;const s=Math.min(10,Math.max(1,e))*10;return n.jsxs("div",{className:"mt-3.5 space-y-1.5","data-testid":"imd-decile-gauge",children:[n.jsxs("div",{className:"relative flex gap-[5px]",children:[s3.map((r,o)=>n.jsx("div",{className:"h-[14px] flex-1 rounded-full bg-slate-200 dark:bg-white/[0.05]"},o)),n.jsx(Se.div,{className:"pointer-events-none absolute inset-0 flex gap-[5px]",initial:{clipPath:"inset(0 100% 0 0 round 999px)"},whileInView:{clipPath:`inset(0 ${100-s}% 0 0 round 999px)`},viewport:{once:!0,margin:"-40px"},transition:{duration:1.5,ease:[.25,1,.5,1],delay:.2},children:s3.map((r,o)=>n.jsx("div",{className:"h-[14px] flex-1 rounded-full",style:{backgroundColor:r}},o))})]}),n.jsxs("div",{className:"flex justify-between font-mono text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500",children:[n.jsx("span",{children:"Most"}),n.jsx("span",{children:"Least"})]})]})}function cI({title:e,icon:t=void 0,accent:s,muted:r=!1,children:o}){return n.jsx(Xs,{accent:s,icon:t,title:e,muted:r,children:n.jsx("div",{className:"space-y-3.5",children:o})})}function mp(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(s[r[o]]=e[r[o]]);return s}function dI(e,t,s,r){function o(c){return c instanceof s?c:new s(function(d){d(c)})}
241return new(s||(s=Promise))(function(c,d){function h(m){try{f(r.next(m))}catch(x){d(x)}}function p(m){try{f(r.throw(m))}catch(x){d(x)}}function f(m){m.done?c(m.value):o(m.value).then(h,p)}f((r=r.apply(e,t||[])).next())})}const uI=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class yy extends Error{constructor(t,s="FunctionsError",r){super(t),this.name=s,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class hI extends yy{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class n3 extends yy{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class a3 extends yy{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Pg;(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"})(Pg||(Pg={}));class pI{constructor(t,{headers:s={},customFetch:r,region:o=Pg.Any}={}){this.url=t,this.headers=s,this.region=o,this.fetch=uI(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return dI(this,arguments,void 0,function*(s,r={}){var o;let c,d;try{const{headers:h,method:p,body:f,signal:m,timeout:x}=r;let y={},{region:v}=r;v||(v=this.region);const j=new URL(`${this.url}/${s}`);v&&v!=="any"&&(y["x-region"]=v,j.searchParams.set("forceFunctionRegion",v));let k;f&&(h&&!Object.prototype.hasOwnProperty.call(h,"Content-Type")||!h)?typeof Blob<"u"&&f instanceof Blob||f instanceof ArrayBuffer?(y["Content-Type"]="application/octet-stream",k=f):typeof f=="string"?(y["Content-Type"]="text/plain",k=f):typeof FormData<"u"&&f instanceof FormData?k=f:(y["Content-Type"]="application/json",k=JSON.stringify(f)):f&&typeof f!="string"&&!(typeof Blob<"u"&&f instanceof Blob)&&!(f instanceof ArrayBuffer)&&!(typeof FormData<"u"&&f instanceof FormData)?k=JSON.stringify(f):k=f;let S=m;x&&(d=new AbortController,c=setTimeout(()=>d.abort(),x),m?(S=d.signal,m.addEventListener("abort",()=>d.abort())):S=d.signal);const N=yield this.fetch(j.toString(),{method:p||"POST",headers:Object.assign(Object.assign(Object.assign({},y),this.headers),h),body:k,signal:S}).catch(P=>{throw new hI(P)}),C=N.headers.get("x-relay-error");if(C&&C==="true")throw new n3(N);if(!N.ok)throw new a3(N);let E=((o=N.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),O;return E==="application/json"?O=yield N.json():E==="application/octet-stream"||E==="application/pdf"?O=yield N.blob():E==="text/event-stream"?O=N:E==="multipart/form-data"?O=yield N.formData():O=yield N.text(),{data:O,error:null,response:N}}catch(h){return{data:null,error:h,response:h instanceof a3||h instanceof n3?h.context:void 0}}finally{c&&clearTimeout(c)}})}}const YS=3,r3=e=>Math.min(1e3*2**e,3e4),fI=[520,503],QS=["GET","HEAD","OPTIONS"];var mI=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
241de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function i3(e,t){return new Promise(s=>{if(t?.aborted){s();return}const r=setTimeout(()=>{t?.removeEventListener("abort",o),s()},e);function o(){clearTimeout(r),s()}t?.addEventListener("abort",o)})}function gI(e,t,s,r){return!(!r||s>=YS||!QS.includes(e)||!fI.includes(t))}var xI=class{constructor(e){var t,s,r,o,c;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=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(s=e.isMaybeSingle)!==null&&s!==void 0?s:!1,this.shouldStripNulls=(r=e.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(o=e.urlLengthLimit)!==null&&o!==void 0?o:8e3,this.retryEnabled=(c=e.retry)!==null&&c!==void 0?c:!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 new 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 s=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){const d=this.headers.get("Accept");d==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!d||d==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let c=(async()=>{let d=0;for(;;){const f=new Headers(s.headers);d>0&&f.set("X-Retry-Count",String(d));let m;try{m=await r(s.url.toString(),{method:s.method,headers:f,body:JSON.stringify(s.body,(x,y)=>typeof y=="bigint"?y.toString():y),signal:s.signal})}catch(x){if(x?.name==="AbortError"||x?.code==="ABORT_ERR"||!QS.includes(s.method))throw x;if(s.retryEnabled&&d<YS){const y=r3(d);d++,await i3(y,s.signal);continue}throw x}if(gI(s.method,m.status,d,s.retryEnabled)){var h,p;const x=(h=(p=m.headers)===null||p===void 0?void 0:p.get("Retry-After"))!==null&&h!==void 0?h:null,y=x!==null?Math.max(0,parseInt(x,10)||0)*1e3:r3(d);await m.text(),d++,await i3(y,s.signal);continue}return await s.processResponse(m)}})();return this.shouldThrowOnError||(c=c.catch(d=>{var h;let p="",f="",m="";const x=d?.cause;if(x){var y,v,j,k;const C=(y=x?.message)!==null&&y!==void 0?y:"",E=(v=x?.code)!==null&&v!==void 0?v:"";p=`${(j=d?.name)!==null&&j!==void 0?j:"FetchError"}: ${d?.message}`,p+=`
242
243Caused by: ${(k=x?.name)!==null&&k!==void 0?k:"Error"}: ${C}`,E&&(p+=` (${E})`),x?.stack&&(p+=`
244${x.stack}`)}else{var S;p=(S=d?.stack)!==null&&S!==void 0?S:""}const N=this.url.toString().length;return d?.name==="AbortError"||d?.code==="ABORT_ERR"?(m="",f="Request was aborted (timeout or manual cancellation)",N>this.urlLengthLimit&&(f+=`. Note: Your request URL is ${N} 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.`)):(x?.name==="HeadersOverflowError"||x?.code==="UND_ERR_HEADERS_OVERFLOW")&&(m="",f="HTTP headers exceeded server limits (typically 16KB)",N>this.urlLengthLimit&&(f+=`. Your request URL is ${N} 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:`${(h=d?.name)!==null&&h!==void 0?h:"FetchError"}: ${d?.message}`,details:p,hint:f,code:m},data:null,count:null,status:0,statusText:""}})),c.then(e,t)}async processResponse(e){var t=this;let s=null,r=null,o=null,c=e.status,d=e.statusText;if(e.ok){var h,p;if(t.method!=="HEAD"){var f;const y=await e.text();y===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((f=t.headers.get("Accept"))===null||f===void 0)&&f.includes("application/vnd.pgrst.plan+text"))?r=y:r=JSON.parse(y))}const m=(h=t.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),x=(p=e.headers.get("content-range"))===null||p===void 0?void 0:p.split("/");m&&x&&x.length>1&&(o=parseInt(x[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(s={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,o=null,c=406,d="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const m=await e.text();try{s=JSON.parse(m),Array.isArray(s)&&e.status===404&&(r=[],s=null,c=200,d="OK")}catch{e.status===404&&m===""?(c=204,d="No Content"):s={message:m}}
244if(s&&t.shouldThrowOnError)throw new mI(s)}return{success:s===null,error:s,data:r,count:o,status:c,statusText:d}}returns(){return this}overrideTypes(){return this}},yI=class extends xI{select(e){let t=!1;const s=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",s),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:s,foreignTable:r,referencedTable:o=r}={}){const c=o?`${o}.order`:"order",d=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${d?`${d},`:""}${e}.${t?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:s=t}={}){const r=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:s,referencedTable:r=s}={}){const o=typeof r>"u"?"offset":`${r}.offset`,c=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(c,`${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:s=!1,buffers:r=!1,wal:o=!1,format:c="text"}={}){var d;const h=[e?"analyze":null,t?"verbose":null,s?"settings":null,r?"buffers":null,o?"wal":null].filter(Boolean).join("|"),p=(d=this.headers.get("Accept"))!==null&&d!==void 0?d:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${c}; for="${p}"; options=${h};`),c==="json"?this: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}};const o3=new RegExp("[,()]");var _o=class extends yI{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){const s=Array.from(new Set(t)).map(r=>typeof r=="string"&&o3.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${s})`),this}notIn(e,t){const s=Array.from(new Set(t)).map(r=>typeof r=="string"&&o3.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${s})`),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:s,type:r}={}){let o="";r==="plain"?o="pl":r==="phrase"?o="ph":r==="websearch"&&(o="w");const c=s===void 0?"":`(${s})`;return this.url.searchParams.append(e,`${o}fts${c}.${t}`),this}match(e){return Object.entries(e).filter(([t,s])=>
244s!==void 0).forEach(([t,s])=>{this.url.searchParams.append(t,`eq.${s}`)}),this}not(e,t,s){return this.url.searchParams.append(e,`not.${t}.${s}`),this}or(e,{foreignTable:t,referencedTable:s=t}={}){const r=s?`${s}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,s){return this.url.searchParams.append(e,`${t}.${s}`),this}},bI=class{constructor(e,{headers:t={},schema:s,fetch:r,urlLengthLimit:o=8e3,retry:c}){this.url=e,this.headers=new Headers(t),this.schema=s,this.fetch=r,this.urlLengthLimit=o,this.retry=c}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:s=!1,count:r}=t??{},o=s?"HEAD":"GET";let c=!1;const d=(e??"*").split("").map(f=>/\s/.test(f)&&!c?"":(f==='"'&&(c=!c),f)).join(""),{url:h,headers:p}=this.cloneRequestState();return h.searchParams.set("select",d),r&&p.append("Prefer",`count=${r}`),new _o({method:o,url:h,headers:p,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:s=!0}={}){var r;const o="POST",{url:c,headers:d}=this.cloneRequestState();if(t&&d.append("Prefer",`count=${t}`),s||d.append("Prefer","missing=default"),Array.isArray(e)){const h=e.reduce((p,f)=>p.concat(Object.keys(f)),[]);if(h.length>0){const p=[...new Set(h)].map(f=>`"${f}"`);c.searchParams.set("columns",p.join(","))}}return new _o({method:o,url:c,headers:d,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:s=!1,count:r,defaultToNull:o=!0}={}){var c;const d="POST",{url:h,headers:p}=this.cloneRequestState();if(p.append("Prefer",`resolution=${s?"ignore":"merge"}-duplicates`),t!==void 0&&h.searchParams.set("on_conflict",t),r&&p.append("Prefer",`count=${r}`),o||p.append("Prefer","missing=default"),Array.isArray(e)){const f=e.reduce((m,x)=>m.concat(Object.keys(x)),[]);if(f.length>0){const m=[...new Set(f)].map(x=>`"${x}"`);h.searchParams.set("columns",m.join(","))}}return new _o({method:d,url:h,headers:p,schema:this.schema,body:e,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var s;const r="PATCH",{url:o,headers:c}=this.cloneRequestState();return t&&c.append("Prefer",`count=${t}`),new _o({method:r,url:o,headers:c,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const s="DELETE",{url:r,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new _o({method:s,url:r,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}function vI(e,t){if($c(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t);if($c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wI(e){var t=vI(e,"string");return $c(t)=="symbol"?t:t+""}function jI(e,t,s){return(t=wI(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function l3(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),s.push.apply(s,r)}return s}function Ou(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?l3(Object(s),!0).forEach(function(r){jI(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):l3(Object(s)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})}return e}var kI=class ZS{constructor(t,{headers:s={},schema:r,fetch:o,timeout:c,urlLengthLimit:d=8e3,retry:h}={}){this.url=t,this.headers=new Headers(s),this.schemaName=r,this.urlLengthLimit=d;const p=o??globalThis.fetch;c!==void 0&&c>0?this.fetch=(f,m)=>{const x=new AbortController,y=setTimeout(()=>x.abort(),c),v=m?.signal;if(v){if(v.aborted)return clearTimeout(y),p(f,m);const j=()=>{clearTimeout(y),x.abort()};return v.addEventListener("abort",j,{once:!0}),p(f,Ou(Ou({},m),{},{signal:x.signal})).finally(()=>{clearTimeout(y),v.removeEventListener("abort",j)})}return p(f,Ou(Ou({},m),{},{signal:x.signal})).finally(()=>clearTimeout(y))}:this.fetch=p,this.retry=h}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new bI(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new ZS(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,s={},{head:r=!1,get:o=!1,count:c}={}){var d;let h;const p=new URL(`${this.url}/rpc/${t}`);let f;const m=v=>v!==null&&typeof v=="object"&&(!Array.isArray(v)||v.some(m)),x=r&&Object.values(s).some(m);x?(h="POST",f=s):r||o?(h=r?"HEAD":"GET",Object.entries(s).filter(([v,j])=>j!==void 0).map(([v,j])=>[v,Array.isArray(j)?`{${j.join(",")}}`:`${j}
244`]).forEach(([v,j])=>{p.searchParams.append(v,j)})):(h="POST",f=s);const y=new Headers(this.headers);return x?y.set("Prefer",c?`count=${c},return=minimal`:"return=minimal"):c&&y.set("Prefer",`count=${c}`),new _o({method:h,url:p,headers:y,schema:this.schemaName,body:f,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class _I{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")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"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.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."};const s=globalThis.process;if(s){const r=s.versions;if(r&&r.node){const o=r.node,c=parseInt(o.replace(/^v/,"").split(".")[0]);return c>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${c} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${c} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
245import ws from "ws"
246new 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(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let s=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(s+=`
247
248Suggested solution: ${t.workaround}`),new Error(s)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const SI="2.103.3",NI=`realtime-js/${SI}`,CI="1.0.0",XS="2.0.0",EI=XS,TI=1e4,AI=100,fr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},JS={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Mg={connecting:"connecting",closing:"closing",closed:"closed"};class RI{constructor(t){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=t??[]}encode(t,s){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return s(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return s(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var s;return this._isArrayBuffer((s=t.payload)===null||s===void 0?void 0:s.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var s,r;const o=(r=(s=t.payload)===null||s===void 0?void 0:s.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(t){var s,r;const o=(r=(s=t.payload)===null||s===void 0?void 0:s.payload)!==null&&r!==void 0?r:{},d=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,d)}_encodeUserBroadcastPush(t,s,r){var o,c;const d=t.topic,h=(o=t.ref)!==null&&o!==void 0?o:"",p=(c=t.join_ref)!==null&&c!==void 0?c:"",f=t.payload.event,m=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},x=Object.keys(m).length===0?"":JSON.stringify(m);if(p.length>255)throw new Error(`joinRef length ${p.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`ref length ${h.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`topic length ${d.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`userEvent length ${f.length} exceeds maximum of 255`);if(x.length>255)throw new Error(`metadata length ${x.length} exceeds maximum of 255`);const y=this.USER_BROADCAST_PUSH_META_LENGTH+p.length+h.length+d.length+f.length+x.length,v=new ArrayBuffer(this.HEADER_LENGTH+y);let j=new DataView(v),k=0;j.setUint8(k++,this.KINDS.userBroadcastPush),j.setUint8(k++,p.length),j.setUint8(k++,h.length),j.setUint8(k++,d.length),j.setUint8(k++,f.length),j.setUint8(k++,x.length),j.setUint8(k++,s),Array.from(p,N=>
248j.setUint8(k++,N.charCodeAt(0))),Array.from(h,N=>j.setUint8(k++,N.charCodeAt(0))),Array.from(d,N=>j.setUint8(k++,N.charCodeAt(0))),Array.from(f,N=>j.setUint8(k++,N.charCodeAt(0))),Array.from(x,N=>j.setUint8(k++,N.charCodeAt(0)));var S=new Uint8Array(v.byteLength+r.byteLength);return S.set(new Uint8Array(v),0),S.set(new Uint8Array(r),v.byteLength),S.buffer}decode(t,s){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return s(r)}if(typeof t=="string"){const r=JSON.parse(t),[o,c,d,h,p]=r;return s({join_ref:o,ref:c,topic:d,event:h,payload:p})}return s({})}_binaryDecode(t){const s=new DataView(t),r=s.getUint8(0),o=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(t,s,o)}_decodeUserBroadcast(t,s,r){const o=s.getUint8(1),c=s.getUint8(2),d=s.getUint8(3),h=s.getUint8(4);let p=this.HEADER_LENGTH+4;const f=r.decode(t.slice(p,p+o));p=p+o;const m=r.decode(t.slice(p,p+c));p=p+c;const x=r.decode(t.slice(p,p+d));p=p+d;const y=t.slice(p,t.byteLength),v=h===this.JSON_ENCODING?JSON.parse(r.decode(y)):y,j={type:this.BROADCAST_EVENT,event:m,payload:v};return d>0&&(j.meta=JSON.parse(x)),{join_ref:null,ref:null,topic:f,event:this.BROADCAST_EVENT,payload:j}}_isArrayBuffer(t){var s;return t instanceof ArrayBuffer||((s=t?.constructor)===null||s===void 0?void 0:s.name)==="ArrayBuffer"}_pick(t,s){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>s.includes(r)))}}var yt;(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"})(yt||(yt={}));const c3=(e,t,s={})=>{var r;const o=(r=s.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((c,d)=>(c[d]=OI(d,e,t,o),c),{}):{}},OI=(e,t,s,r)=>{const o=t.find(h=>h.name===e),c=o?.type,d=s[e];return c&&!r.includes(c)?eN(c,d):Lg(d)},eN=(e,t)=>{if(e.charAt(0)==="_"){const s=e.slice(1,e.length);return DI(t,s)}switch(e){case yt.bool:return PI(t);case yt.float4:case yt.float8:case yt.int2:case yt.int4:case yt.int8:case yt.numeric:case yt.oid:return MI(t);case yt.json:case yt.jsonb:return LI(t);case yt.timestamp:return BI(t);case yt.abstime:case yt.date:case yt.daterange:case yt.int4range:case yt.int8range:case yt.money:case yt.reltime:case yt.text:case yt.time:case yt.timestamptz:case yt.timetz:case yt.tsrange:case yt.tstzrange:return Lg(t);default:return Lg(t)}},Lg=e=>e,PI=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},MI=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},LI=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},DI=(e,t)=>{if(typeof e!="string")return e;const s=e.length-1,r=e[s];if(e[0]==="{"&&r==="}"){let c;const d=e.slice(1,s);try{c=JSON.parse("["+d+"]")}catch{c=d?d.split(","):[]}return c.map(h=>eN(t,h))}return e},BI=e=>typeof e=="string"?e.replace(" ","T"):e,tN=e=>{const 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=t.pathname+"/api/broadcast",t.href};var Nc=e=>typeof e=="function"?e:function(){return e},II=typeof self<"u"?self:null,So=typeof window<"u"?window:null,Xn=II||So||globalThis,$I="2.0.0",UI=1e4,HI=1e3,Jn={connecting:0,open:1,closing:2,closed:3},Ms={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Sa={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Dg={longpoll:"longpoll",websocket:"websocket"},qI={complete:4},Bg="base64url.bearer.phx.",Pu=class{constructor(e,t,s,r){this.channel=e,this.event=t,this.payload=s||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHo
vendor: 8,700 bytes, line 248
248oks=[],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:s}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.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})}},sN=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=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},VI=class{constructor(e,t,s){this.state=Ms.closed,this.topic=e,this.params=Nc(t||{}),this.socket=s,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Pu(this,Sa.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new sN(()=>{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=Ms.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=Ms.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Ms.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=Ms.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 Pu(this,Sa.leave,Nc({}),this.timeout).send(),this.state=Ms.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Sa.reply,(r,o)=>{this.trigger(this.replyEventName(o),r)})}join(e=this.timeout){if(this.joinedOnce)throw new 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=Ms.closed,this.bindings=[]}onClose(e){this.on(Sa.close,e)}onError(e){return this.on(Sa.error,t=>e(t))}on(e,t){let s=this.bindingRef++;return this.bindings.push({event:e,ref:s,callback:t}),s}off(e,t){this.bindings=this.bindings.filter(s=>!(s.event===e&&(typeof t>"u"||t===s.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,s=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Pu(this,e,function(){return t},s);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Ms.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Sa.close,"leave")},s=new Pu(this,Sa.leave,Nc({}),e);return s.receive("ok",()=>t()).receive("timeout",()=>t()),s.send(),this.canPush()||s.trigger("ok",{}),s}onMessage(e,t,s){return t}filterBindings(e,t,s){return!0}isMember(e,t,s,r){return this.topic!==e?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:s,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Ms.joining,this.joinPush.resend(e))}trigger(e,t,s,r){let o=this.onMessage(e,t,s,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let c=this.bindings.filter(d=>d.event===e&&this.filterBindings(d,t,s));for(let d=0;d<c.length;d++)c[d].callback(o,s,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Ms.closed}isErrored(){return this.state===Ms.errored}isJoined(){return this.state===Ms.joined}isJoining(){return this.state===Ms.joining}isLeaving(){return this.state===Ms.leaving}},Rh=class{static request(e,t,s,r,o,c,d){if(Xn.XDomainRequest){let h=new Xn.XDomainRequest;return this.xdomainRequest(h,e,t,r,o,c,d)}else if(Xn.XMLHttpRequest){let h=new Xn.XMLHttpRequest;return this.xhrRequest(h,e,t,s,r,o,c,d)}else{if(Xn.fetch&&Xn.AbortController)return this.fetchRequest(e,t,s,r,o,c,d);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,s,r,o,c,d){let h={method:e,headers:s,body:r},p=null;return o&&(p=new AbortController,setTimeout(()=>p.abort(),o),h.signal=p.signal),Xn.fetch(t,h).then(f=>f.text()).then(f=>this.parseJSON(f)).then(f=>d&&d(f)).catch(f=>{f.name==="AbortError"&&c?c():d&&d(null)}),p}static xdomainRequest(e,t,s,r,o,c,d){return e.timeout=o,e.open(t,s),e.onload=()=>{let h=this.parseJSON(e.responseText);d&&d(h)},c&&(e.ontimeout=c),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,s,r,o,c,d,h){e.open(t,s,!0),e.timeout=c;for(let[p,f]of Object.entries(r))e.setRequestHeader(p,f);return e.onerror=()=>h&&h(null),e.onreadystatechange=()=>{if(e.readyState===qI.complete&&h){let p=this.parseJSON(e.responseText);h(p)}},d&&(e.ontimeout=d),e.send(o),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 s=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=t?`${t}[${r}]`:r,c=e[r];typeof c=="object"?s.push(this.serialize(c,o)):s.push(encodeURIComponent(o)+"="+encodeURIComponent(c))}return s.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let s=e.match(/\?/)?"&":"?";return`${e}${s}${this.serialize(t)}`}},zI=e=>{let t="",s=new Uint8Array(e),r=s.byteLength;for(let o=0;o<r;o++)t+=String.fromCharCode(s[o]);return btoa(t)},ho=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Bg)&&(this.authToken=atob(t[1].slice(Bg.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=Jn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Dg.websocket),"$1/"+Dg.longpoll)}endpointURL(){return Rh.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,s){this.close(e,t,s),this.readyState=Jn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Jn.open||this.readyState===Jn.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:s,token:r,messages:o}=t;if(s===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else s=0;switch(s){case 200:o.forEach(c=>{setTimeout(()=>this.onmessage({data:c}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Jn.open,this.onopen({}),this.poll();break;
248case 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 new Error(`unhandled poll status ${s}`)}})}send(e){typeof e!="string"&&(e=zI(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(`
249`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,s){for(let o of this.reqs)o.abort();this.readyState=Jn.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:s});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,s,r,o){let c,d=()=>{this.reqs.delete(c),r()};c=Rh.request(e,this.endpointURL(),t,s,this.timeout,d,h=>{this.reqs.delete(c),this.isActive()&&o(h)}),this.reqs.add(c)}},FI=class xc{constructor(t,s={}){let r=s.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,o=>{let{onJoin:c,onLeave:d,onSync:h}=this.caller;this.joinRef=this.channel.joinRef(),this.state=xc.syncState(this.state,o,c,d),this.pendingDiffs.forEach(p=>{this.state=xc.syncDiff(this.state,p,c,d)}),this.pendingDiffs=[],h()}),this.channel.on(r.diff,o=>{let{onJoin:c,onLeave:d,onSync:h}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=xc.syncDiff(this.state,o,c,d),h())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return xc.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,s,r,o){let c=this.clone(t),d={},h={};return this.map(c,(p,f)=>{s[p]||(h[p]=f)}),this.map(s,(p,f)=>{let m=c[p];if(m){let x=f.metas.map(k=>k.phx_ref),y=m.metas.map(k=>k.phx_ref),v=f.metas.filter(k=>y.indexOf(k.phx_ref)<0),j=m.metas.filter(k=>x.indexOf(k.phx_ref)<0);v.length>0&&(d[p]=f,d[p].metas=v),j.length>0&&(h[p]=this.clone(m),h[p].metas=j)}else d[p]=f}),this.syncDiff(c,{joins:d,leaves:h},r,o)}static syncDiff(t,s,r,o){let{joins:c,leaves:d}=this.clone(s);return r||(r=function(){}),o||(o=function(){}),this.map(c,(h,p)=>{let f=t[h];if(t[h]=this.clone(p),f){let m=t[h].metas.map(y=>y.phx_ref),x=f.metas.filter(y=>m.indexOf(y.phx_ref)<0);t[h].metas.unshift(...x)}r(h,f,p)}),this.map(d,(h,p)=>{let f=t[h];if(!f)return;let m=p.metas.map(x=>x.phx_ref);f.metas=f.metas.filter(x=>m.indexOf(x.phx_ref)<0),o(h,f,p),f.metas.length===0&&delete t[h]}),t}static list(t,s){return s||(s=function(r,o){return o}),this.map(t,(r,o)=>s(r,o))}static map(t,s){return Object.getOwnPropertyNames(t).map(r=>s(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},Mu={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 s=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(s))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[s,r,o,c,d]=JSON.parse(e);return t({join_ref:s,ref:r,topic:o,event:c,payload:d})}},binaryEncode(e){let{join_ref:t,ref:s,event:r,topic:o,payload:c}=e,d=this.META_LENGTH+t.length+s.length+o.length+r.length,h=new ArrayBuffer(this.HEADER_LENGTH+d),p=new DataView(h),f=0;p.setUint8(f++,this.KINDS.push),p.setUint8(f++,t.length),p.setUint8(f++,s.length),p.setUint8(f++,o.length),p.setUint8(f++,r.length),Array.from(t,x=>p.setUint8(f++,x.charCodeAt(0))),Array.from(s,x=>p.setUint8(f++,x.charCodeAt(0))),Array.from(o,x=>p.setUint8(f++,x.charCodeAt(0))),Array.from(r,x=>p.setUint8(f++,x.charCodeAt(0)));var m=new Uint8Array(h.byteLength+c.byteLength);return m.set(new Uint8Array(h),0),m.set(new Uint8Array(c),h.byteLength),m.buffer},binaryDecode(e){let t=new DataView(e),s=t.getUint8(0),r=new TextDecoder;switch(s){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)}},decodePush(e,t,s){let r=t.getUint8(1),o=t.getUint8(2),c=t.getUint8(3),d=this.HEADER_LENGTH+this.META_LENGTH-1,h=s.decode(e.slice(d,d+r));d=d+r;let p=s.decode(e.slice(d,d+o));d=d+o;let f=s.decode(e.slice(d,d+c));d=d+c;let m=e.slice(d,e.byteLength);return{join_ref:h,ref:null,topic:p,event:f,payload:m}},decodeReply(e,t,s){let r=t.getUint8(1),o=t.getUint8(2),c=t.getUint8(3),d=t.getUint8(4),h=this.HEADER_LENGTH+this.META_LENGTH,p=s.decode(e.slice(h,h+r));h=h+r;let f=s.decode(e.slice(h,h+o));h=h+o;let m=s.decode(e.slice(h,h+c));h=h+c;let x=s.decode(e.slice(h,h+d));h=h+d;let y=e.slice(h,e.byteLength),v={status:x,response:y};return{join_ref:p,ref:f,topic:m,event:Sa.reply,payload:v}}
249,decodeBroadcast(e,t,s){let r=t.getUint8(1),o=t.getUint8(2),c=this.HEADER_LENGTH+2,d=s.decode(e.slice(c,c+r));c=c+r;let h=s.decode(e.slice(c,c+o));c=c+o;let p=e.slice(c,e.byteLength);return{join_ref:null,ref:null,topic:d,event:h,payload:p}}},GI=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||UI,this.transport=t.transport||Xn.WebSocket||ho,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||Xn&&Xn.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Mu.encode.bind(Mu),this.defaultDecoder=Mu.decode.bind(Mu),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!==ho?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let s=null;So&&So.addEventListener&&(So.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),s=this.connectClock)}),So.addEventListener("pageshow",r=>{s===this.connectClock&&(s=null,this.connect())}),So.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=r=>t.rejoinAfterMs?t.rejoinAfterMs(r):[1e3,2e3,5e3][r-1]||1e4,this.reconnectAfterMs=r=>t.reconnectAfterMs?t.reconnectAfterMs(r):[10,50,100,150,200,250,500,1e3,2e3][r-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(r,o,c)=>{console.log(`${r}: ${o}`,c)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Nc(t.params||{}),this.endPoint=`${e}/${Dg.websocket}`,this.vsn=t.vsn||$I,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new sN(()=>{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 ho}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Rh.appendParams(Rh.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,s){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,s)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Nc(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==ho?this.connectWithF
vendor: 4,313 bytes, line 249
249allback(ho,this.longPollFallbackMs):this.transportConnect())}log(e,t,s){this.logger&&this.logger(e,t,s)}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(),s=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(o=>{o.ref===t&&(this.off([r]),e(Date.now()-s))});return!0}transportName(e){return e===ho?"LongPoll":e.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Bg}${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=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}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 s=!1,r=!0,o,c,d=this.transportName(e),h=p=>{this.log("transport",`falling back to ${d}...`,p),this.off([o,c]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${d}`))return h("memorized");this.fallbackTimer=setTimeout(h,t),c=this.onError(p=>{this.log("transport","error",p),r&&!s&&(clearTimeout(this.fallbackTimer),h(p))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(s=!0,!r){let p=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${p}`,"true"),this.log("transport",`established ${p} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(h,t),this.ping(p=>{this.log("transport","connected to primary after",p),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(),HI,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,s){if(!this.conn)return e&&e();const r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,s||""):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,s=1){if(s===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,s+1)},150*s)}waitForSocketClosed(e,t,s=1){if(s===5||e.readyState===Jn.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,s+1)},150*s)}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,s=this.establishedConnections;this.triggerStateCallbacks("error",e,t,s),(t===this.transport||s>0)&&this.triggerChanError()}
249triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Sa.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Jn.connecting:return"connecting";case Jn.open:return"open";case Jn.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(([s])=>e.indexOf(s)===-1)}channel(e,t={}){let s=new VI(e,t,this);return this.channels.push(s),s}push(e){if(this.hasLogger()){let{topic:t,event:s,payload:r,ref:o,join_ref:c}=e;this.log("push",`${t} ${s} (${c}, ${o})`,r)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}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,t=>{let{topic:s,event:r,payload:o,ref:c,join_ref:d}=t;if(c&&c===this.pendingHeartbeatRef){const h=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(o.status==="ok"?"ok":"error",h)}catch(p){this.log("error","error in heartbeat callback",p)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${o.status||""} ${s} ${r} ${c&&"("+c+")"||""}`.trim(),o);for(let h=0;h<this.channels.length;h++){const p=this.channels[h];p.isMember(s,r,o,d)&&p.trigger(r,o,c,d)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([s,r])=>{try{r(...t)}catch(o){this.log("error",`error in ${e} callback`,o)}})}catch(s){this.log("error",`error triggering ${e} callbacks`,s)}}leaveOpenTopic(e){let t=this.channels.find(s=>s.topic===e&&(s.isJoined()||s.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class Cc{constructor(t,s){const r=WI(s);this.presence=new FI(t.getChannel(),r),this.presence.onJoin((o,c,d)=>{const h=Cc.onJoinPayload(o,c,d);t.getChannel().trigger("presence",h)}),this.presence.onLeave((o,c,d)=>{const h=Cc.onLeavePayload(o,c,d);t.getChannel().trigger("presence",h)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return Cc.transformState(this.presence.state)}static transformState(t){return t=KI(t),Object.getOwnPropertyNames(t).reduce((s,r)=>{const o=t[r];return s[r]=dh(o),s},{})}static onJoinPayload(t,s,r){const o=d3(s),c=dh(r);return{event:"join",key:t,currentPresences:o,newPresences:c}}static onLeavePayload(t,s,r){const o=d3(s),c=dh(r);return{event:"leave",key:t,currentPresences:o,leftPresences:c}}}function dh(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function KI(e){return JSON.parse(JSON.stringify(e))}function WI(e){return e?.events&&{events:e.events}}function d3(e){return e?.metas?dh(e):[]}var u3;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(u3||(u3={}));class YI{get state(){return this.presenceAdapter.state}constructor(t,s){this.channel=t,this.presenceAdapter=new Cc(this.channel.channelAdapter,s)}}class QI{constructor(t,s,r){const o=ZI(r);this.channel=t.getSocket().channel(s,o),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,s){return this.channel.on(t,s)}off(t,s){this.channel.off(t,s)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,s,r){let o;try{o=this.channel.push(t,s,r)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>AI){const c=this.channel.pushBuffer.shift();c.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${c.event}`,c.payload())}return o}updateJoinPayload(t){const s=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},s),t)}canPush(){return this.socket.isConnected()&&this.state===fr.joined}isJoined(){return this.state===fr.joined}isJoining(){return this.state===fr.joining}isClosed(){return this.state===fr.closed}isLeaving(){return this.state===fr.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function ZI(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var h3;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(h3||(h3={}));var Mo;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Mo||(Mo={}));var Na;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Na||(Na={}));class Ec{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}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(t,s={config:{}},r){var o,c;if(this.topic=t,this.params=s,this.socket=r,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},s.config),this.channelAdapter=new QI(this.socket.socketAdapter,t,this.params),this.presence=new YI(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=tN(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((c=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,s=this.timeout){var r,o,c;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:d,presence:h,private:p}}=this.params,f=(o=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(v=>v.filter))!==null&&o!==void 0?o:[],m=!!this.bindings[Mo.PRESENCE]&&this.bindings[Mo.PRESENCE].length>0||((c=this.params.config.presence)===null||c===void 0?void 0:c.enabled)===!0,x={},y={broadcast:d,presence:Object.assign(Object.assign({},h),{enabled:m}),postgres_changes:f,private:p};this.socket.accessTokenValue&&(x.access_token=this.socket.accessTokenValue),this._onError(v=>{t?.(Na.CHANNEL_ERROR,v)}),this._onClose(()=>t?.(Na.CLOSED)),this.updateJoinPayload(Object.assign({config:y},x)),this._updateFilterMessage(),this.channelAdapter.subscribe(s).receive("ok",async({postgres_changes:v})=>
249{if(this.socket._isManualToken()||this.socket.setAuth(),v===void 0){t?.(Na.SUBSCRIBED);return}this._updatePostgresBindings(v,t)}).receive("error",v=>{this.state=fr.errored,t?.(Na.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(v).join(", ")||"error")))}).receive("timeout",()=>{t?.(Na.TIMED_OUT)})}return this}_updatePostgresBindings(t,s){var r;const o=this.bindings.postgres_changes,c=(r=o?.length)!==null&&r!==void 0?r:0,d=[];for(let h=0;h<c;h++){const p=o[h],{filter:{event:f,schema:m,table:x,filter:y}}=p,v=t&&t[h];if(v&&v.event===f&&Ec.isFilterValueEqual(v.schema,m)&&Ec.isFilterValueEqual(v.table,x)&&Ec.isFilterValueEqual(v.filter,y))d.push(Object.assign(Object.assign({},p),{id:v.id}));else{this.unsubscribe(),this.state=fr.errored,s?.(Na.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=d,this.state!=fr.errored&&s&&s(Na.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,s={}){return await this.send({type:"presence",event:"track",payload:t},s.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,s,r){const o=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),c=t===Mo.PRESENCE||t===Mo.POSTGRES_CHANGES;if(o&&c)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,s,r)}async httpSend(t,s,r={}){var o;if(s==null)return Promise.reject(new Error("Payload is required for httpSend()"));const c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);const d={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:s,private:this.private}]})},h=await this._fetchWithTimeout(this.broadcastEndpointURL,d,(o=r.timeout)!==null&&o!==void 0?o:this.timeout);if(h.status===202)return{success:!0};let p=h.statusText;try{const f=await h.json();p=f.error||f.message||p}catch{}return Promise.reject(new Error(p))}async send(t,s={}){var r,o;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
249in the future. Please use httpSend() explicitly for REST delivery.");const{event:c,payload:d}=t,h={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(h.Authorization=`Bearer ${this.socket.accessTokenValue}`);const p={method:"POST",headers:h,body:JSON.stringify({messages:[{topic:this.subTopic,event:c,payload:d,private:this.private}]})};try{const f=await this._fetchWithTimeout(this.broadcastEndpointURL,p,(r=s.timeout)!==null&&r!==void 0?r:this.timeout);return await((o=f.body)===null||o===void 0?void 0:o.cancel()),f.ok?"ok":"error"}catch(f){return f.name==="AbortError"?"timed out":"error"}}else return new Promise(c=>{var d,h,p;const f=this.channelAdapter.push(t.type,t,s.timeout||this.timeout);t.type==="broadcast"&&!(!((p=(h=(d=this.params)===null||d===void 0?void 0:d.config)===null||h===void 0?void 0:h.broadcast)===null||p===void 0)&&p.ack)&&c("ok"),f.receive("ok",()=>c("ok")),f.receive("error",()=>c("error")),f.receive("timeout",()=>c("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(s=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>s("ok")).receive("timeout",()=>s("timed out")).receive("error",()=>s("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,s,r){const o=new AbortController,c=setTimeout(()=>o.abort(),r),d=await this.socket.fetch(t,Object.assign(Object.assign({},s),{signal:o.signal}));return clearTimeout(c),d}_on(t,s,r){const o=t.toLocaleLowerCase(),c=this.channelAdapter.on(t,r),d={type:o,filter:s,callback:r,ref:c};return this.bindings[o]?this.bindings[o].push(d):this.bindings[o]=[d],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,s,r)=>{var o,c,d,h,p,f,m;const x=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(x,r))return!1;const y=(o=this.bindings[x])===null||o===void 0?void 0:o.find(v=>v.ref===t.ref);if(!y)return!0;if(["broadcast","presence","postgres_changes"].includes(x))if("id"in y){const v=y.id,j=(c=y.filter)===null||c===void 0?void 0:c.event;return v&&((d=s.ids)===null||d===void 0?void 0:d.includes(v))&&(j==="*"||j?.toLocaleLowerCase()===((h=s.data)===null||h===void 0?void 0:h.type.toLocaleLowerCase()))}else{const v=(f=(p=y?.filter)===null||p===void 0?void 0:p.event)===null||f===void 0?void 0:f.toLocaleLowerCase();return v==="*"||v===((m=s?.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return y.type.toLocaleLowerCase()===x})}_notThisChannelEvent(t,s){const{close:r,error:o,leave:c,join:d}=JS;return s&&[r,o,c,d].includes(t)&&s!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,s,r)=>{if(typeof s=="object"&&"ids"in s){const o=s.data,{schema:c,table:d,commit_timestamp:h,type:p,errors:f}=o;return Object.assign(Object.assign({},{schema:c,table:d,commit_timestamp:h,eventType:p,new:{},old:{},errors:f}),this._getPayloadRecords(o))}return s})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const s in t.bindings)for(const r of t.bindings[s])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(t,s){return(t??void 0)===(s??void 0)}_getPayloadRecords(t){const s={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(s.new=c3(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(s.old=c3(t.columns,t.old_record)),s}}class XI{constructor(t,s){this.socket=new GI(t,s)}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(t){this.socket.heartbeatCallback=t}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(t,s,r,o=1e4){return new Promise(c=>{setTimeout(()=>c("timeout"),o),this.socket.disconnect(()=>{t(),c("ok")},s,r)})}push(t){this.socket.push(t)}log(t,s,r){this.socket.log(t,s,r)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Mg.connecting}isDisconnecting(){return this.socket.connectionState()==Mg.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const JI={HEARTBEAT_INTERVAL:25e3},e$=[1e3,2e3,5e3,1e4],t$=1e4,s$=`
250  addEventListener("message", (e) => {
251    if (e.data.event === "start") {
252      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
253    }
254  });`;class n${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(t,s){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
254,this.ref=0,this.serializer=new RI,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=c=>c?(...d)=>c(...d):(...d)=>fetch(...d),!(!((r=s?.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=s.params.apikey;const o=this._initializeOptions(s);this.socketAdapter=new XI(t,o),this.httpEndpoint=tN(t),this.fetch=this._resolveFetch(s?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const s=t.message;throw s.includes("Node.js")?new Error(`${s}
255
256To use Realtime in Node.js, you need to provide a WebSocket implementation:
257
258Option 1: Use Node.js 22+ which has native WebSocket support
259Option 2: Install and provide the "ws" package:
260
261  npm install ws
262
263  import ws from "ws"
264  const client = new RealtimeClient(url, {
265    ...options,
266    transport: ws
267  })`):new Error(`WebSocket not available: ${s}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,s){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,s)}getChannels(){return this.channels}async removeChannel(t){const s=await t.unsubscribe();return s==="ok"&&t.teardown(),this.channels.length===0&&this.disconnect(),s}async removeAllChannels(){const t=this.channels.map(async r=>{const o=await r.unsubscribe();return r.teardown(),o}),s=await Promise.all(t);return this.disconnect(),s}log(t,s,r){this.socketAdapter.log(t,s,r)}connectionState(){return this.socketAdapter.connectionState()||Mg.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,s={config:{}}){const r=`realtime:${t}`,o=this.getChannels().find(c=>c.topic===r);if(o)return o;{const c=new Ec(`realtime:${t}`,s,this);return this.channels.push(c),c}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(s=>s.topic!==t.topic)}async _performAuth(t=null){let s,r=!1;if(t)s=t,r=!0;else if(this.accessToken)try{s=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),s=this.accessTokenValue}else s=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=s&&(this.accessTokenValue=s,this.channels.forEach(o=>{const c={access_token:s,version:NI};s&&o.updateJoinPayload(c),o.joinedOnce&&o.channelAdapter.isJoined()&&o.channelAdapter.push(JS.access_token,{access_token:s})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(s=>{this.log("error",`Error setting auth in ${t}`,s)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(s=>{this.log("error","error waiting for auth on connect",s)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(s,r)=>{s=="sent"&&this._setAuthSafely(),t&&t(s,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=s=>{this.log("worker","worker error",s.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=s=>{s.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let s;if(t)s=t;else{const r=new Blob([s$],{type:"application/javascript"});s=URL.createObjectURL(r)}return s}_initializeOptions(t){var s,r,o,c,d,h,p,f,m;this.worker=(s=t?.worker)!==null&&s!==void 0?s:!1,this.accessToken=(r=t?.accessToken)!==null&&r!==void 0?r:null;const x={};x.timeout=(o=t?.timeout)!==null&&o!==void 0?o:TI,x.heartbeatIntervalMs=(c=t?.heartbeatIntervalMs)!==null&&c!==void 0?c:JI.HEARTBEAT_INTERVAL,x.transport=(d=t?.transport)!==null&&d!==void 0?d:_I.getWebSocketConstructor(),x.params=t?.params,x.logger=t?.logger,x.heartbeatCallback=this._wrapHeartbeatCallback(t?.heartbeatCallback),x.reconnectAfterMs=(h=t?.reconnectAfterMs)!==null&&h!==void 0?h:(k=>e$[k-1]||t$);let y,v;const j=(p=t?.vsn)!==null&&p!==void 0?p:EI;switch(j){case CI:y=(k,S)=>S(JSON.stringify(k)),v=(k,S)=>S(JSON.parse(k));break;case XS:y=this.serializer.encode.bind(this.serializer),v=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${x.vsn}`)}if(x.vsn=j,x.encode=(f=t?.encode)!==null&&f!==void 0?f:y,x.decode=(m=t?.decode)!==null&&m!==void 0?m:v,x.beforeReconnect=this._reconnectAuth.bind(this),(t?.logLevel||t?.log_level)&&(this.logLevel=t.logLevel||t.log_level,x.params=Object.assign(Object.assign({},x.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t?.workerUrl,x.autoSendHeartbeat=!this.worker}return x}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
267var Uc=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 a$(e,t,s){const r=new URL(t,e);if(s)for(const[o,c]of Object.entries(s))c!==void 0&&r.searchParams.set(o,c);return r.toString()}async function r$(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 i$(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:s,path:r,query:o,body:c,headers:d}){const h=a$(e.baseUrl,r,o),p=await r$(e.auth),f=await t(h,{method:s,headers:{...c?{"Content-Type":"application/json"}:{},...p,...d},body:c?JSON.stringify(c):void 0}),m=await f.text(),x=(f.headers.get("content-type")||"").includes("application/json"),y=x&&m?JSON.parse(m):m;if(!f.ok){const v=x?y:void 0,j=v?.error;throw new Uc(j?.message??`Request failed with status ${f.status}`,{status:f.status,icebergType:j?.type,icebergCode:j?.code,details:v})}return{status:f.status,headers:f.headers,data:y}}}}function Lu(e){return e.join("�")}var o$=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Lu(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const s={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:s})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Lu(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Lu(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Lu(e.namespace)}`}),!0}catch(t){if(t instanceof Uc&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(s){if(s instanceof Uc&&s.status===409)return;throw s}}};function po(e){return e.join("�")}var l$=class{constructor(e,t="",s){this.client=e,this.prefix=t,this.accessDelegation=s}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${po(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const s={};return this.accessDelegation&&(s["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${po(e.namespace)}/tables`,body:t,headers:s})).data.metadata}async updateTable(e,t){const s=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${po(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":s.data["metadata-location"],metadata:s.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${po(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${po(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${po(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(s){if(s instanceof Uc&&s.status===404)return!1;throw s}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(s){if(s instanceof Uc&&s.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw s}}},c$=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const s=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=i$({baseUrl:s,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new o$(this.client,t),this.tableOps=new l$(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)}
267async 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 Hc(e){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hc(e)}function d$(e,t){if(Hc(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t);if(Hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function u$(e){var t=d$(e,"string");return Hc(t)=="symbol"?t:t+""}function h$(e,t,s){return(t=u$(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function p3(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),s.push.apply(s,r)}return s}function Ae(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?p3(Object(s),!0).forEach(function(r){h$(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):p3(Object(s)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})}return e}var gp=class extends Error{constructor(e,t="storage",s,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=s,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function xp(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Ig=class extends gp{constructor(e,t,s,r="storage"){super(e,r,t,s),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=s}toJSON(){return Ae({},super.toJSON())}},nN=class extends gp{constructor(e,t,s="storage"){super(e,s),this.name=s==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const p$=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),f$=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},$g=e=>{if(Array.isArray(e))return e.map(s=>$g(s));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([s,r])=>{const o=s.replace(/([-_][a-z])/gi,c=>c.toUpperCase().replace(/[-_]/g,""));t[o]=$g(r)}),t},m$=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),f3=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},g$=async(e,t,s,r)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const o=e;let c=parseInt(o.status,10);Number.isFinite(c)||(c=500),o.json().then(d=>{const h=d?.statusCode||d?.code||c+"";t(new Ig(f3(d),c,h,r))}).catch(()=>{const d=c+"";t(new Ig(o.statusText||`HTTP ${c} error`,c,d,r))})}else t(new nN(f3(e),e,r))},x$=(e,t,s,r)=>{const o={method:e,headers:t?.headers||{}};if(e==="GET"||e==="HEAD"||!r)return Ae(Ae({},o),s);if(f$(r)){var c;const d=t?.headers||{};let h;for(const[p,f]of Object.entries(d))p.toLowerCase()==="content-type"&&(h=f);o.headers=y$(d,"Content-Type",(c=h)!==null&&c!==void 0?c:"application/json"),o.body=JSON.stringify(r)}else o.body=r;return t?.duplex&&(o.duplex=t.duplex),Ae(Ae({},o),s)};function y$(e,t,s){const r=Ae({},e);for(const o of Object.keys(r))o.toLowerCase()===t.toLowerCase()&&delete r[o];return r[t]=s,r}async function dc(e,t,s,r,o,c,d){return new Promise((h,p)=>{e(s,x$(t,r,o,c)).then(f=>{if(!f.ok)throw f;if(r?.noResolveJson)return f;if(d==="vectors"){const m=f.headers.get("content-type");if(f.headers.get("content-length")==="0"||f.status===204)return{};if(!m||!m.includes("application/json"))return{}}return f.json()}).then(f=>h(f)).catch(f=>g$(f,p,r,d))})}function aN(e="storage"){return{get:async(t,s,r,o)=>dc(t,"GET",s,r,o,void 0,e),post:async(t,s,r,o,c)=>
267dc(t,"POST",s,o,c,r,e),put:async(t,s,r,o,c)=>dc(t,"PUT",s,o,c,r,e),head:async(t,s,r,o)=>dc(t,"HEAD",s,Ae(Ae({},r),{},{noResolveJson:!0}),o,void 0,e),remove:async(t,s,r,o,c)=>dc(t,"DELETE",s,o,c,r,e)}}const b$=aN("storage"),{get:qc,post:Mn,put:Ug,head:v$,remove:by}=b$,Zs=aN("vectors");var il=class{constructor(e,t={},s,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=Object.fromEntries(Object.entries(t).map(([o,c])=>[o.toLowerCase(),c])),this.fetch=p$(s),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Ae(Ae({},this.headers),{},{[e.toLowerCase()]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(xp(s))return{data:null,error:s};throw s}}},w$=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(xp(t))return{data:null,error:t};throw t}}};let rN;rN=Symbol.toStringTag;var j$=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[rN]="BlobDownloadBuilder",this.promise=null}asStream(){return new w$(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.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(xp(t))return{data:null,error:t};throw t}}};const k$={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},m3={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var _$=class extends il{constructor(e,t={},s,r){super(e,t,r,"storage"),this.bucketId=s}async uploadOrUpdate(e,t,s,r){var o=this;return o.handleOperation(async()=>{let c;const d=Ae(Ae({},m3),r);let h=Ae(Ae({},o.headers),e==="POST"&&{"x-upsert":String(d.upsert)});const p=d.metadata;typeof Blob<"u"&&s instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),p&&c.append("metadata",o.encodeMetadata(p)),c.append("",s)):typeof FormData<"u"&&s instanceof FormData?(c=s,c.has("cacheControl")||c.append("cacheControl",d.cacheControl),p&&!c.has("metadata")&&c.append("metadata",o.encodeMetadata(p))):(c=s,h["cache-control"]=`max-age=${d.cacheControl}`,h["content-type"]=d.contentType,p&&(h["x-metadata"]=o.toBase64(o.encodeMetadata(p))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!d.duplex&&(d.duplex="half")),r?.headers&&(h=Ae(Ae({},h),r.headers));const f=o._removeEmptyFolders(t),m=o._getFinalPath(f),x=await(e=="PUT"?Ug:Mn)(o.fetch,`${o.url}/object/${m}`,c,Ae({headers:h},d?.duplex?{duplex:d.duplex}:{}));return{path:f,id:x.Id,fullPath:x.Key}})}async upload(e,t,s){return this.uploadOrUpdate("POST",e,t,s)}async uploadToSignedUrl(e,t,s,r){var o=this;const c=o._removeEmptyFolders(e),d=o._getFinalPath(c),h=new URL(o.url+`/object/upload/sign/${d}`);return h.searchParams.set("token",t),o.handleOperation(async()=>{let p;const f=Ae(Ae({},m3),r),m=Ae(Ae({},o.headers),{"x-upsert":String(f.upsert)});return typeof Blob<"u"&&s instanceof Blob?(p=new FormData,p.append("cacheControl",f.cacheControl),p.append("",s)):typeof FormData<"u"&&s instanceof FormData?(p=s,p.append("cacheControl",f.cacheControl)):(p=s,m["cache-control"]=`max-age=${f.cacheControl}`,m["content-type"]=f.contentType),{path:c,fullPath:(await Ug(o.fetch,h.toString(),p,{headers:m})).Key}})}async createSignedUploadUrl(e,t){var s=this;return s.handleOperation(async()=>{let r=s._getFinalPath(e);const o=Ae({},s.headers);t?.upsert&&(o["x-upsert"]="true");const c=await Mn(s.fetch,`${s.url}/object/upload/sign/${r}`,{},{headers:o}),d=new URL(s.url+c.url),h=d.searchParams.get("token");if(!h)throw new gp("No token returned by API");return{signedUrl:d.toString(),path:e,token:h}})}async update(e,t,s){return this.uploadOrUpdate("PUT",e,t,s)}async move(e,t,s){var r=this;return r.handleOperation(async()=>await Mn(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
267stinationBucket:s?.destinationBucket},{headers:r.headers}))}async copy(e,t,s){var r=this;return r.handleOperation(async()=>({path:(await Mn(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,s){var r=this;return r.handleOperation(async()=>{let o=r._getFinalPath(e);const c=typeof s?.transform=="object"&&s.transform!==null&&Object.keys(s.transform).length>0;let d=await Mn(r.fetch,`${r.url}/object/sign/${o}`,Ae({expiresIn:t},c?{transform:s.transform}:{}),{headers:r.headers});const h=new URLSearchParams;s?.download&&h.set("download",s.download===!0?"":s.download),s?.cacheNonce!=null&&h.set("cacheNonce",String(s.cacheNonce));const p=h.toString();return{signedUrl:encodeURI(`${r.url}${d.signedURL}${p?`&${p}`:""}`)}})}async createSignedUrls(e,t,s){var r=this;return r.handleOperation(async()=>{const o=await Mn(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),c=new URLSearchParams;s?.download&&c.set("download",s.download===!0?"":s.download),s?.cacheNonce!=null&&c.set("cacheNonce",String(s.cacheNonce));const d=c.toString();return o.map(h=>Ae(Ae({},h),{},{signedUrl:h.signedURL?encodeURI(`${r.url}${h.signedURL}${d?`&${d}`:""}`):null}))})}download(e,t,s){const r=typeof t?.transform=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",o=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(o,t.transform),t?.cacheNonce!=null&&o.set("cacheNonce",String(t.cacheNonce));const c=o.toString(),d=this._getFinalPath(e),h=()=>qc(this.fetch,`${this.url}/${r}/${d}${c?`?${c}`:""}`,{headers:this.headers,noResolveJson:!0},s);return new j$(h,this.shouldThrowOnError)}async info(e){var t=this;const s=t._getFinalPath(e);return t.handleOperation(async()=>$g(await qc(t.fetch,`${t.url}/object/info/${s}`,{headers:t.headers})))}async exists(e){var t=this;const s=t._getFinalPath(e);try{return await v$(t.fetch,`${t.url}/object/${s}`,{headers:t.headers}),{data:!0,error:null}}catch(o){if(t.shouldThrowOnError)throw o;
267if(xp(o)){var r;const c=o instanceof Ig?o.status:o instanceof nN?(r=o.originalError)===null||r===void 0?void 0:r.status:void 0;if(c!==void 0&&[400,404].includes(c))return{data:!1,error:o}}throw o}}getPublicUrl(e,t){const s=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));const o=r.toString(),c=typeof t?.transform=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${c}/public/${s}`)+(o?`?${o}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await by(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,s){var r=this;return r.handleOperation(async()=>{const o=Ae(Ae(Ae({},k$),t),{},{prefix:e||""});return await Mn(r.fetch,`${r.url}/object/list/${r.bucketId}`,o,{headers:r.headers},s)})}async listV2(e,t){var s=this;return s.handleOperation(async()=>{const r=Ae({},e);return await Mn(s.fetch,`${s.url}/object/list-v2/${s.bucketId}`,r,{headers:s.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}};const S$="2.103.3",ad={"X-Client-Info":`storage-js/${S$}`};var N$=class extends il{constructor(e,t={},s,r){const o=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const c=o.href.replace(/\/$/,""),d=Ae(Ae({},ad),t);super(c,d,s,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const s=t.listBucketOptionsToQueryString(e);return await qc(t.fetch,`${t.url}/bucket${s}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await qc(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var s=this;return s.handleOperation(async()=>await Mn(s.fetch,`${s.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:s.headers}))}async updateBucket(e,t){var s=this;return s.handleOperation(async()=>await Ug(s.fetch,`${s.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:s.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Mn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await by(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const 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>0?"?"+new URLSearchParams(t).toString():""}},C$=class extends il{constructor(e,t={},s){const r=e.replace(/\/$/,""),o=Ae(Ae({},ad),t);super(r,o,s,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Mn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const s=new URLSearchParams;e?.limit!==void 0&&s.set("limit",e.limit.toString()),e?.offset!==void 0&&s.set("offset",e.offset.toString()),e?.sortColumn&&s.set("sortColumn",e.sortColumn),e?.sortOrder&&s.set("sortOrder",e.sortOrder),e?.search&&s.set("search",e.search);const r=s.toString(),o=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await qc(t.fetch,o,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await by(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!m$(e))throw new gp("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const s=new c$({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}
267),r=this.shouldThrowOnError;return new Proxy(s,{get(o,c){const d=o[c];return typeof d!="function"?d:async(...h)=>{try{return{data:await d.apply(o,h),error:null}}catch(p){if(r)throw p;return{data:null,error:p}}}}})}},E$=class extends il{constructor(e,t={},s){const r=e.replace(/\/$/,""),o=Ae(Ae({},ad),{},{"Content-Type":"application/json"},t);super(r,o,s,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var s=this;return s.handleOperation(async()=>await Zs.post(s.fetch,`${s.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:s.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var s=this;return s.handleOperation(async()=>await Zs.post(s.fetch,`${s.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:s.headers})||{})}},T$=class extends il{constructor(e,t={},s){const r=e.replace(/\/$/,""),o=Ae(Ae({},ad),{},{"Content-Type":"application/json"},t);super(r,o,s,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Zs.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 new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Zs.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 new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},A$=class extends il{constructor(e,t={},s){const r=e.replace(/\/$/,""),o=Ae(Ae({},ad),{},{"Content-Type":"application/json"},t);super(r,o,s,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Zs.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},R$=class extends A${constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new O$(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,s=this;return t().call(s,e)}async getBucket(e){var t=()=>super.getBucket,s=this;return t().call(s,e)}async listBuckets(e={}){var t=()=>super.listBuckets,s=this;return t().call(s,e)}async deleteBucket(e){var t=()=>super.deleteBucket,s=this;return t().call(s,e)}},O$=class extends E${constructor(e,t,s,r){super(e,t,r),this.vectorBucketName=s}async createIndex(e){var t=()=>super.createIndex,s=this;return t().call(s,Ae(Ae({},e),{},{vectorBucketName:s.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,s=this;return t().call(s,Ae(Ae({},e),{},{vectorBucketName:s.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,s=this;return t().call(s,s.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,s=this;return t().call(s,s.vectorBucketName,e)}index(e){return new P$(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},P$=class extends T${constructor(e,t,s,r,o){super(e,t,o),this.vectorBucketName=s,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,s=this;return t().call(s,Ae(Ae({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async getVectors(e){var t=()=>super.getVectors,s=this;return t().call(s,Ae(Ae({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,s=this;return t().call(s,Ae(Ae({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,s=this;return t().call(s,Ae(Ae({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,s=this;return t().call(s,Ae(Ae({},e),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}},M$=class extends N${constructor(e,t={},s,r){super(e,t,s,r)}from(e){return new _$(this.url,this.headers,e,this.fetch)}get vectors(){return new R$(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new C$(this.url+"/iceberg",this.headers,this.fetch)}};const iN="2.103.3",No=30*1e3,Hg=3,u0=Hg*No,L$="http://localhost:9999",D$="supabase.auth.token",B$={"X-Client-Info":`gotrue-js/${iN}`},qg="X-Supabase-Api-Version",oN={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},I$=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,$$=600*1e3;
267class Vc extends Error{constructor(t,s,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=s,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function je(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class U$ extends Vc{constructor(t,s,r){super(t,s,r),this.name="AuthApiError",this.status=s,this.code=r}}function H$(e){return je(e)&&e.name==="AuthApiError"}class di extends Vc{constructor(t,s){super(t),this.name="AuthUnknownError",this.originalError=s}}class Ba extends Vc{constructor(t,s,r,o){super(t,r,o),this.name=s,this.status=r}}class Ws extends Ba{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Du(e){return je(e)&&e.name==="AuthSessionMissingError"}class fo extends Ba{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Bu extends Ba{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Iu extends Ba{constructor(t,s=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function q$(e){return je(e)&&e.name==="AuthImplicitGrantRedirectError"}class g3 extends Ba{constructor(t,s=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class V$ extends Ba{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")}}class Vg extends Ba{constructor(t,s){super(t,"AuthRetryableFetchError",s,void 0)}}function h0(e){return je(e)&&e.name==="AuthRetryableFetchError"}class x3 extends Ba{constructor(t,s,r){super(t,"AuthWeakPasswordError",s,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class zg extends Ba{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Oh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),y3=` 	
268\r=`.split(""),z$=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<y3.length;t+=1)e[y3[t].charCodeAt(0)]=-2;for(let t=0;t<Oh.length;t+=1)e[Oh[t].charCodeAt(0)]=t;return e})();function b3(e,t,s){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;s(Oh[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;s(Oh[r]),t.queuedBits-=6}}function lN(e,t,s){const r=z$[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)s(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function v3(e){const t=[],s=d=>{t.push(String.fromCodePoint(d))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},c=d=>{K$(d,r,s)};for(let d=0;d<e.length;d+=1)lN(e.charCodeAt(d),o,c);return t.join("")}function F$(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 new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function G$(e,t){for(let s=0;s<e.length;s+=1){let r=e.charCodeAt(s);if(r>55295&&r<=56319){const o=(r-55296)*1024&65535;r=(e.charCodeAt(s+1)-56320&65535|o)+65536,s+=1}F$(r,t)}}function K$(e,t,s){if(t.utf8seq===0){if(e<=127){s(e);return}for(let r=1;r<6;r+=1)if((e>>7-r&1)===0){t.utf8seq=r;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 new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&s(t.codepoint)}}function Io(e){const t=[],s={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)lN(e.charCodeAt(o),s,r);return new Uint8Array(t)}function W$(e){const t=[];return G$(e,s=>t.push(s)),new Uint8Array(t)}function fi(e){const t=[],s={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>b3(o,s,r)),b3(null,s,r),t.join("")}function Y$(e){return Math.round(Date.now()/1e3)+e}function Q$(){return Symbol("auth-callback")}const us=()=>typeof window<"u"&&typeof document<"u",ti={tested:!1,writable:!1},cN=()=>
268{if(!us())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ti.tested)return ti.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),ti.tested=!0,ti.writable=!0}catch{ti.tested=!0,ti.writable=!1}return ti.writable};function Z$(e){const t={},s=new URL(e);if(s.hash&&s.hash[0]==="#")try{new URLSearchParams(s.hash.substring(1)).forEach((o,c)=>{t[c]=o})}catch{}return s.searchParams.forEach((r,o)=>{t[o]=r}),t}const dN=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),X$=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Co=async(e,t,s)=>{await e.setItem(t,JSON.stringify(s))},si=async(e,t)=>{const s=await e.getItem(t);if(!s)return null;try{return JSON.parse(s)}catch{return s}},ds=async(e,t)=>{await e.removeItem(t)};class yp{constructor(){this.promise=new yp.promiseConstructor((t,s)=>{this.resolve=t,this.reject=s})}}yp.promiseConstructor=Promise;function $u(e){const t=e.split(".");if(t.length!==3)throw new zg("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!I$.test(t[r]))throw new zg("JWT not in base64url format");return{header:JSON.parse(v3(t[0])),payload:JSON.parse(v3(t[1])),signature:Io(t[2]),raw:{header:t[0],payload:t[1]}}}async function J$(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function eU(e,t){return new Promise((r,o)=>{(async()=>{for(let c=0;c<1/0;c++)try{const d=await e(c);if(!t(c,null,d)){r(d);return}}catch(d){if(!t(c,d)){o(d);return}}})()})}function tU(e){return("0"+e.toString(16)).substr(-2)}function sU(){const t=new Uint32Array(56);if(typeof crypto>"u"){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=s.length;let o="";for(let c=0;c<56;c++)o+=s.charAt(Math.floor(Math.random()*r));return o}return crypto.getRandomValues(t),Array.from(t,tU).join("")}async function nU(e){const s=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",s),o=new Uint8Array(r);return Array.from(o).map(c=>String.fromCharCode(c)).join("")}async function aU(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const s=await nU(e);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function mo(e,t,s=!1){const r=sU();let o=r;s&&(o+="/PASSWORD_RECOVERY"),await Co(e,`${t}-code-verifier`,o);const c=await aU(r);return[c,r===c?"plain":"s256"]}const rU=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function iU(e){const t=e.headers.get(qg);if(!t||!t.match(rU))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function oU(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function lU(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 new Error("Invalid alg claim")}}const cU=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function go(e){if(!cU.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function p0(){const e={};return new Proxy(e,{get:(t,s)=>{if(s==="__isUserNotAvailableProxy")return!0;if(typeof s=="symbol"){const r=s.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${s}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,s)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${s}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,s)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${s}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function dU(e,t){return new Proxy(e,{get:(s,r,o)=>{if(r==="__isInsecureUserWarningProxy")return!0;
268if(typeof r=="symbol"){const c=r.toString();if(c==="Symbol(Symbol.toPrimitive)"||c==="Symbol(Symbol.toStringTag)"||c==="Symbol(util.inspect.custom)"||c==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(s,r,o)}return!t.value&&typeof r=="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(s,r,o)}})}function w3(e){return JSON.parse(JSON.stringify(e))}const ci=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),uU=[502,503,504,520,521,522,523,524,530];async function j3(e){var t;if(!X$(e))throw new Vg(ci(e),0);if(uU.includes(e.status))throw new Vg(ci(e),e.status);let s;try{s=await e.json()}catch(c){throw new di(ci(c),c)}let r;const o=iU(e);if(o&&o.getTime()>=oN["2024-01-01"].timestamp&&typeof s=="object"&&s&&typeof s.code=="string"?r=s.code:typeof s=="object"&&s&&typeof s.error_code=="string"&&(r=s.error_code),r){if(r==="weak_password")throw new x3(ci(s),e.status,((t=s.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Ws}else if(typeof s=="object"&&s&&typeof s.weak_password=="object"&&s.weak_password&&Array.isArray(s.weak_password.reasons)&&s.weak_password.reasons.length&&s.weak_password.reasons.reduce((c,d)=>c&&typeof d=="string",!0))throw new x3(ci(s),e.status,s.weak_password.reasons);throw new U$(ci(s),e.status||500,r)}const hU=(e,t,s,r)=>{const o={method:e,headers:t?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),o.body=JSON.stringify(r),Object.assign(Object.assign({},o),s))};async function Te(e,t,s,r){var o;const c=Object.assign({},r?.headers);c[qg]||(c[qg]=oN["2024-01-01"].name),r?.jwt&&(c.Authorization=`Bearer ${r.jwt}`);const d=(o=r?.query)!==null&&o!==void 0?o:{};r?.redirectTo&&(d.redirect_to=r.redirectTo);const h=Object.keys(d).length?"?"+new URLSearchParams(d).toString():"",p=await pU(e,t,s+h,{headers:c,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(p):{data:Object.assign({},p),error:null}}async function pU(e,t,s,r,o,c){const d=hU(t,r,o,c);let h;try{h=await e(s,Object.assign({},d))}catch(p){throw console.error(p),new Vg(ci(p),0)}if(h.ok||await j3(h),r?.noResolveJson)return h;try{return await h.json()}catch(p){await j3(p)}}function On(e){var t;let s=null;gU(e)&&(s=Object.assign({},e),e.expires_at||(s.expires_at=Y$(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:s,user:r},error:null}}function k3(e){const t=On(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((s,r)=>s&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function mr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function fU(e){return{data:e,error:null}}function mU(e){const{action_link:t,email_otp:s,hashed_token:r,redirect_to:o,verification_type:c}=e,d=mp(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),h={action_link:t,email_otp:s,hashed_token:r,redirect_to:o,verification_type:c},p=Object.assign({},d);return{data:{properties:h,user:p},error:null}}function _3(e){return e}function gU(e){return e.access_token&&e.refresh_token&&e.expires_in}const f0=["global","local","others"];class xU{constructor({url:t="",headers:s={},fetch:r}){this.url=t,this.headers=s,this.fetch=dN(r),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)}}
268async signOut(t,s=f0[0]){if(f0.indexOf(s)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${f0.join(", ")}`);try{return await Te(this.fetch,"POST",`${this.url}/logout?scope=${s}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(je(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,s={}){try{return await Te(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:s.data},headers:this.headers,redirectTo:s.redirectTo,xform:mr})}catch(r){if(je(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:s}=t,r=mp(t,["options"]),o=Object.assign(Object.assign({},r),s);return"newEmail"in r&&(o.new_email=r?.newEmail,delete o.newEmail),await Te(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:mU,redirectTo:s?.redirectTo})}catch(s){if(je(s))return{data:{properties:null,user:null},error:s};throw s}}async createUser(t){try{return await Te(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:mr})}catch(s){if(je(s))return{data:{user:null},error:s};throw s}}async listUsers(t){var s,r,o,c,d,h,p;try{const f={nextPage:null,lastPage:0,total:0},m=await Te(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(s=t?.page)===null||s===void 0?void 0:s.toString())!==null&&r!==void 0?r:"",per_page:(c=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:_3});if(m.error)throw m.error;const x=await m.json(),y=(d=m.headers.get("x-total-count"))!==null&&d!==void 0?d:0,v=(p=(h=m.headers.get("link"))===null||h===void 0?void 0:h.split(","))!==null&&p!==void 0?p:[];return v.length>0&&(v.forEach(j=>{const k=parseInt(j.split(";")[0].split("=")[1].substring(0,1)),S=JSON.parse(j.split(";")[1].split("=")[1]);f[`${S}Page`]=k}),f.total=parseInt(y)),{data:Object.assign(Object.assign({},x),f),error:null}}catch(f){if(je(f))return{data:{users:[]},error:f};throw f}}async getUserById(t){go(t);try{return await Te(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:mr})}catch(s){if(je(s))return{data:{user:null},error:s};throw s}}async updateUserById(t,s){go(t);try{return await Te(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:s,headers:this.headers,xform:mr})}catch(r){if(je(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,s=!1){go(t);try{return await Te(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:s},xform:mr})}catch(r){if(je(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){go(t.userId);try{const{data:s,error:r}=await Te(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:s,error:r}}catch(s){if(je(s))return{data:null,error:s};throw s}}async _deleteFactor(t){go(t.userId),go(t.id);try{return{data:await Te(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(s){if(je(s))return{data:null,error:s};throw s}}async _listOAuthClients(t){var s,r,o,c,d,h,p;try{const f={nextPage:null,lastPage:0,total:0},m=await Te(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(s=t?.page)===null||s===void 0?void 0:s.toString())!==null&&r!==void 0?r:"",per_page:(c=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:_3});if(m.error)throw m.error;const x=await m.json(),y=(d=m.headers.get("x-total-count"))!==null&&d!==void 0?d:0,v=(p=(h=m.headers.get("link"))===null||h===void 0?void 0:h.split(","))!==null&&p!==void 0?p:[];return v.length>0&&(v.forEach(j=>{const k=parseInt(j.split(";")[0].split("=")[1].substring(0,1)),S=JSON.parse(j.split(";")[1].split("=")[1]);f[`${S}Page`]=k}),f.total=parseInt(y)),{data:Object.assign(Object.assign({},x),f),error:null}}catch(f){if(je(f))return{data:{clients:[]},error:f};throw f}}async _createOAuthClient(t){try{return await Te(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(je(s))return{data:null,error:s};throw s}}async _getOAuthClient(t){try{return await Te(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(je(s))return{data:null,error:s};throw s}}async _updateOAuthClient(t,s){try{return await Te(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:s,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(je(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Te(this.fetch,"DELET
268E",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(je(s))return{data:null,error:s};throw s}}async _regenerateOAuthClientSecret(t){try{return await Te(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(je(s))return{data:null,error:s};throw s}}async _listCustomProviders(t){try{const s={};return t?.type&&(s.type=t.type),await Te(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:s,xform:r=>{var o;return{data:{providers:(o=r?.providers)!==null&&o!==void 0?o:[]},error:null}}})}catch(s){if(je(s))return{data:{providers:[]},error:s};throw s}}async _createCustomProvider(t){try{return await Te(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(je(s))return{data:null,error:s};throw s}}async _getCustomProvider(t){try{return await Te(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(je(s))return{data:null,error:s};throw s}}async _updateCustomProvider(t,s){try{return await Te(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:s,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(je(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{return await Te(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(je(s))return{data:null,error:s};throw s}}}function S3(e={}){return{getItem:t=>e[t]||null,setItem:(t,s)=>{e[t]=s},removeItem:t=>{delete e[t]}}}const Wn={debug:!!(globalThis&&cN()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class uN extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class N3 extends uN{}async function yU(e,t,s){Wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;let o;t>0&&(o=setTimeout(()=>{r.abort(),Wn.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 c=>{if(c){clearTimeout(o),Wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,c.name);try{return await s()}finally{Wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,c.name)}}else{if(t===0)throw Wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new N3(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Wn.debug)try{const d=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(d,null,"  "))}catch(d){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",d)}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(o),await s()}})}catch(c){if(t>0&&clearTimeout(o),c?.name==="AbortError"&&t>0){if(r.signal.aborted)return Wn.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 d=>{if(d){Wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,d.name);try{return await s()}finally{Wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,d.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await s()}));throw Wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new N3(`Lock "${e}" was released because another request stole it`)}throw c}}function bU(){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 hN(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}
268" is invalid.`);return e.toLowerCase()}function vU(e){return parseInt(e,16)}function wU(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function jU(e){var t;const{chainId:s,domain:r,expirationTime:o,issuedAt:c=new Date,nonce:d,notBefore:h,requestId:p,resources:f,scheme:m,uri:x,version:y}=e;{if(!Number.isInteger(s))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${s}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(d&&d.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${d}`);if(!x)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(y!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${y}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
269`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const v=hN(e.address),j=m?`${m}://${r}`:r,k=e.statement?`${e.statement}
270`:"",S=`${j} wants you to sign in with your Ethereum account:
271${v}
272
273${k}`;let N=`URI: ${x}
274Version: ${y}
275Chain ID: ${s}${d?`
276Nonce: ${d}`:""}
277Issued At: ${c.toISOString()}`;if(o&&(N+=`
278Expiration Time: ${o.toISOString()}`),h&&(N+=`
279Not Before: ${h.toISOString()}`),p&&(N+=`
280Request ID: ${p}`),f){let C=`
281Resources:`;for(const E of f){if(!E||typeof E!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${E}`);C+=`
282- ${E}`}N+=C}return`${S}
283${N}`}class Ut extends Error{constructor({message:t,code:s,cause:r,name:o}){var c;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(c=o??(r instanceof Error?r.name:void 0))!==null&&c!==void 0?c:"Unknown Error",this.code=s}}class Ph extends Ut{constructor(t,s){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s,message:t}),this.name="WebAuthnUnknownError",this.originalError=s}}function kU({error:e,options:t}){var s,r,o;const{publicKey:c}=t;if(!c)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ut({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((s=c.authenticatorSelection)===null||s===void 0?void 0:s.requireResidentKey)===!0)return new Ut({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=c.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Ut({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=c.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new Ut({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 Ut({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ut({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return c.pubKeyCredParams.filter(h=>h.type==="public-key").length===0?new Ut({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ut({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const d=window.location.hostname;if(pN(d)){if(c.rp.id!==d)return new Ut({message:`The RP ID "${c.rp.id}
283" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ut({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(c.user.id.byteLength<1||c.user.id.byteLength>64)return new Ut({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 Ut({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 Ut({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function _U({error:e,options:t}){const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ut({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ut({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(pN(r)){if(s.rpId!==r)return new Ut({message:`The RP ID "${s.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ut({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ut({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 Ut({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class SU{createNewAbortSignal(){if(this.controller){const s=new Error("Cancelling existing WebAuthn API call for new one");s.name="AbortError",this.controller.abort(s)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const NU=new SU;function CU(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:s,excludeCredentials:r}=e,o=mp(e,["challenge","user","excludeCredentials"]),c=Io(t).buffer,d=Object.assign(Object.assign({},s),{id:Io(s.id).buffer}),h=Object.assign(Object.assign({},o),{challenge:c,user:d});if(r&&r.length>0){h.excludeCredentials=new Array(r.length);for(let p=0;p<r.length;p++){const f=r[p];h.excludeCredentials[p]=Object.assign(Object.assign({},f),{id:Io(f.id).buffer,type:f.type||"public-key",transports:f.transports})}}return h}function EU(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:s}=e,r=mp(e,["challenge","allowCredentials"]),o=Io(t).buffer,c=Object.assign(Object.assign({},r),{challenge:o});if(s&&s.length>0){c.allowCredentials=new Array(s.length);for(let d=0;d<s.length;d++){const h=s[d];c.allowCredentials[d]=Object.assign(Object.assign({},h),{id:Io(h.id).buffer,type:h.type||"public-key",transports:h.transports})}}return c}function TU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const s=e;return{id:e.id,rawId:e.id,response:{attestationObject:fi(new Uint8Array(e.response.attestationObject)),clientDataJSON:fi(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=s.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function AU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const s=e,r=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:fi(new Uint8Array(o.authenticatorData)),clientDataJSON:fi(new Uint8Array(o.clientDataJSON)),signature:fi(new Uint8Array(o.signature)),userHandle:o.userHandle?fi(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=s.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function pN(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function C3(){var e,t;return!!(us()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.get)=="function")}async function RU(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ph("Browser returned unexpected credential type",t)}:{data:null,error:new Ph("Empty credential response",t)}}
283catch(t){return{data:null,error:kU({error:t,options:e})}}}async function OU(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ph("Browser returned unexpected credential type",t)}:{data:null,error:new Ph("Empty credential response",t)}}catch(t){return{data:null,error:_U({error:t,options:e})}}}const PU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},MU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Mh(...e){const t=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),s=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),r={};for(const o of e)if(o)for(const c in o){const d=o[c];if(d!==void 0)if(Array.isArray(d))r[c]=d;else if(s(d))r[c]=d;else if(t(d)){const h=r[c];t(h)?r[c]=Mh(h,d):r[c]=Mh(d)}else r[c]=d}return r}function LU(e,t){return Mh(PU,e,t||{})}function DU(e,t){return Mh(MU,e,t||{})}class BU{constructor(t){this.client=t,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(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:s,friendlyName:r,signal:o},c){var d;try{const{data:h,error:p}=await this.client.mfa.challenge({factorId:t,webauthn:s});if(!h)return{data:null,error:p};const f=o??NU.createNewAbortSignal();if(h.webauthn.type==="create"){const{user:m}=h.webauthn.credential_options.publicKey;if(!m.name){const x=r;if(x)m.name=`${m.id}:${x}`;else{const v=(await this.client.getUser()).data.user,j=((d=v?.user_metadata)===null||d===void 0?void 0:d.name)||v?.email||v?.id||"User";m.name=`${m.id}:${j}`}}m.displayName||(m.displayName=m.name)}switch(h.webauthn.type){case"create":{const m=LU(h.webauthn.credential_options.publicKey,c?.create),{data:x,error:y}=await RU({publicKey:m,signal:f});return x?{data:{factorId:t,challengeId:h.id,webauthn:{type:h.webauthn.type,credential_response:x}},error:null}:{data:null,error:y}}case"request":{const m=DU(h.webauthn.credential_options.publicKey,c?.request),{data:x,error:y}=await OU(Object.assign(Object.assign({},h.webauthn.credential_options),{publicKey:m,signal:f}));return x?{data:{factorId:t,challengeId:h.id,webauthn:{type:h.webauthn.type,credential_response:x}},error:null}:{data:null,error:y}}}}catch(h){return je(h)?{data:null,error:h}:{data:null,error:new di("Unexpected error in challenge",h)}}}async _verify({challengeId:t,factorId:s,webauthn:r}){return this.client.mfa.verify({factorId:s,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!s)return{data:null,error:new Vc("rpId is required for WebAuthn authentication")};try{if(!C3())return{data:null,error:new di("Browser does not support WebAuthn",null)};const{data:d,error:h}=await this.challenge({factorId:t,webauthn:{rpId:s,rpOrigins:r},signal:o},{request:c});if(!d)return{data:null,error:h};const{webauthn:p}=d;return this._verify({factorId:t,challengeId:d.challengeId,webauthn:{type:p.type,rpId:s,rpOrigins:r,credential_response:p.credential_response}})}catch(d){return je(d)?{data:null,error:d}:{data:null,error:new di("Unexpected error in authenticate",d)}}}async _register({friendlyName:t,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!s)return{data:null,error:new Vc("rpId is required for WebAuthn registration")};try{if(!C3())return{data:null,error:new di("Browser does not support WebAuthn",null)};const{data:d,error:h}=await this._enroll({friendlyName:t});if(!d)return await this.client.mfa.listFactors().then(m=>{var x;return(x=m.data)===null||x===void 0?void 0:x.all.find(y=>y.factor_type==="webauthn"&&y.friendly_name===t&&y.status!=="unverified")}).then(m=>m?this.client.mfa.unenroll({factorId:m?.id}):void 0),{data:null,error:h};const{data:p,error:f}=await this._challenge({factorId:d.id,friendlyName:d.friendly_name,webauthn:{rpId:s,rpOrigins:r},signal:o},{create:c});return p?this._verify({factorId:d.id,challengeId:p.challengeId,webauthn:{rpId:s,rpOrigins:r,type:p.webauthn.type,credential_response:p.webauthn.credential_response}}):{data:null,error:f}}catch(d){return je(d)?{data:null,error:d}:{data:null,error:new di("Unexpected error in register",d)}}}}bU();const IU={url:L$,storageKey:D$,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:B$,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function E3(e,t,s){return await s()}const xo={};class zc{get jwks(){var t,s;return(s=(t=xo[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&s!==void 0?s:{keys:[]}}set jwks(t){xo[this.storageKey]=Object.assign(Object.assign({},xo[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,s;return(s=(t=xo[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&s!==void 0?s:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){xo[this.storageKey]=Object.assign(Object.assign({},xo[this.storageKey]),{cachedAt:t})}constructor(t){var s,r,o;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;const c=Object.assign(Object.assign({},IU),t);
283if(this.storageKey=c.storageKey,this.instanceID=(s=zc.nextInstanceID[this.storageKey])!==null&&s!==void 0?s:0,zc.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!c.debug,typeof c.debug=="function"&&(this.logger=c.debug),this.instanceID>0&&us()){const d=`${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(d),this.logDebugMessages&&console.trace(d)}if(this.persistSession=c.persistSession,this.autoRefreshToken=c.autoRefreshToken,this.admin=new xU({url:c.url,headers:c.headers,fetch:c.fetch}),this.url=c.url,this.headers=c.headers,this.fetch=dN(c.fetch),this.lock=c.lock||E3,this.detectSessionInUrl=c.detectSessionInUrl,this.flowType=c.flowType,this.hasCustomAuthorizationHeader=c.hasCustomAuthorizationHeader,this.throwOnError=c.throwOnError,this.lockAcquireTimeout=c.lockAcquireTimeout,c.lock?this.lock=c.lock:this.persistSession&&us()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=yU:this.lock=E3,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),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 BU(this)},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?(c.storage?this.storage=c.storage:cN()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=S3(this.memoryStorage)),c.userStorage&&(this.userStorage=c.userStorage)):(this.memoryStorage={},this.storage=S3(this.memoryStorage)),us()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(d){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",d)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async d=>{this._debug("received broadcast notification from other tab or client",d);try{await this._notifyAllSubscribers(d.data.event,d.data.session,!1)}catch(h){this._debug("#broadcastChannel","error",h)}})}c.skipAutoInitialize||this.initialize().catch(d=>{this._debug("#initialize()","error",d)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${iN}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let s={},r="none";if(us()&&(s=Z$(window.location.href),this._isImplicitGrantCallback(s)?r="implicit":await this._isPKCECallback(s)&&(r="pkce")),us()&&this.detectSessionInUrl&&r!=="none"){const{data:o,error:c}=await this._getSessionFromURL(s,r);if(c){if(this._debug("#_initialize()","error detecting session from URL",c),q$(c)){const p=(t=c.details)===null||t===void 0?void 0:t.code;if(p==="identity_already_exists"||p==="identity_not_found"||p==="single_identity_not_deletable")return{error:c}}return{error:c}}const{session:d,redirectType:h}=o;return this._debug("#_initialize()","detected session in URL",d,"redirect type",h),await this._saveSession(d),setTimeout(async()=>{h==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",d):await this._notifyAllSubscribers("SIGNED_IN",d)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(s){return je(s)?this._returnResult({error:s}):this._returnResult({error:new di("Unexpected error during initialization",s)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var s,r,o;try{const c=await Te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(s=t?.options)===null||s===void 0?void 0:s.data)!==null&&r!==void 0?r:{}
283,gotrue_meta_security:{captcha_token:(o=t?.options)===null||o===void 0?void 0:o.captchaToken}},xform:On}),{data:d,error:h}=c;if(h||!d)return this._returnResult({data:{user:null,session:null},error:h});const p=d.session,f=d.user;return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:f,session:p},error:null})}catch(c){if(je(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signUp(t){var s,r,o;try{let c;if("email"in t){const{email:m,password:x,options:y}=t;let v=null,j=null;this.flowType==="pkce"&&([v,j]=await mo(this.storage,this.storageKey)),c=await Te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:y?.emailRedirectTo,body:{email:m,password:x,data:(s=y?.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:y?.captchaToken},code_challenge:v,code_challenge_method:j},xform:On})}else if("phone"in t){const{phone:m,password:x,options:y}=t;c=await Te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:m,password:x,data:(r=y?.data)!==null&&r!==void 0?r:{},channel:(o=y?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:y?.captchaToken}},xform:On})}else throw new Bu("You must provide either an email or phone number and a password");const{data:d,error:h}=c;if(h||!d)return await ds(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:h});const p=d.session,f=d.user;return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:f,session:p},error:null})}catch(c){if(await ds(this.storage,`${this.storageKey}-code-verifier`),je(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signInWithPassword(t){try{let s;if("email"in t){const{email:c,password:d,options:h}=t;s=await Te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:c,password:d,gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:k3})}else if("phone"in t){const{phone:c,password:d,options:h}=t;s=await Te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:c,password:d,gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:k3})}else throw new Bu("You must provide either an email or phone number and a password");const{data:r,error:o}=s;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!r||!r.session||!r.user){const c=new fo;return this._returnResult({data:{user:null,session:null},error:c})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:o})}catch(s){if(je(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOAuth(t){var s,r,o,c;return await this._handleProviderSignIn(t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(c=t.options)===null||c===void 0?void 0:c.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:s}=t;switch(s){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${s}"`)}}async signInWithEthereum(t){var s,r,o,c,d,h,p,f,m,x,y;let v,j;if("message"in t)v=t.message,j=t.signature;else{const{chain:k,wallet:S,statement:N,options:C}=t;let E;if(us())if(typeof S=="object")E=S;else{const L=window;if("ethereum"in L&&typeof L.ethereum=="object"&&"request"in L.ethereum&&typeof L.ethereum.request=="function")E=L.ethereum;else throw new 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.")}else{if(typeof S!="object"||!C?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");E=S}
283const O=new URL((s=C?.url)!==null&&s!==void 0?s:window.location.href),P=await E.request({method:"eth_requestAccounts"}).then(L=>L).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!P||P.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const M=hN(P[0]);let B=(r=C?.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!B){const L=await E.request({method:"eth_chainId"});B=vU(L)}const A={domain:O.host,address:M,statement:N,uri:O.href,version:"1",chainId:B,nonce:(o=C?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(d=(c=C?.signInWithEthereum)===null||c===void 0?void 0:c.issuedAt)!==null&&d!==void 0?d:new Date,expirationTime:(h=C?.signInWithEthereum)===null||h===void 0?void 0:h.expirationTime,notBefore:(p=C?.signInWithEthereum)===null||p===void 0?void 0:p.notBefore,requestId:(f=C?.signInWithEthereum)===null||f===void 0?void 0:f.requestId,resources:(m=C?.signInWithEthereum)===null||m===void 0?void 0:m.resources};v=jU(A),j=await E.request({method:"personal_sign",params:[wU(v),M]})}try{const{data:k,error:S}=await Te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:v,signature:j},!((x=t.options)===null||x===void 0)&&x.captchaToken?{gotrue_meta_security:{captcha_token:(y=t.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:On});if(S)throw S;if(!k||!k.session||!k.user){const N=new fo;return this._returnResult({data:{user:null,session:null},error:N})}return k.session&&(await this._saveSession(k.session),await this._notifyAllSubscribers("SIGNED_IN",k.session)),this._returnResult({data:Object.assign({},k),error:S})}catch(k){if(je(k))return this._returnResult({data:{user:null,session:null},error:k});throw k}}async signInWithSolana(t){var s,r,o,c,d,h,p,f,m,x,y,v;let j,k;if("message"in t)j=t.message,k=t.signature;else{const{chain:S,wallet:N,statement:C,options:E}=t;let O;if(us())if(typeof N=="object")O=N;else{const M=window;if("solana"in M&&typeof M.solana=="object"&&("signIn"in M.solana&&typeof M.solana.signIn=="function"||"signMessage"in M.solana&&typeof M.solana.signMessage=="function"))O=M.solana;else throw new 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.")}else{if(typeof N!="object"||!E?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");O=N}const P=new URL((s=E?.url)!==null&&s!==void 0?s:window.location.href);if("signIn"in O&&O.signIn){const M=await O.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},E?.signInWithSolana),{version:"1",domain:P.host,uri:P.href}),C?{statement:C}:null));let B;if(Array.isArray(M)&&M[0]&&typeof M[0]=="object")B=M[0];else if(M&&typeof M=="object"&&"signedMessage"in M&&"signature"in M)B=M;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in B&&"signature"in B&&(typeof B.signedMessage=="string"||B.signedMessage instanceof Uint8Array)&&B.signature instanceof Uint8Array)j=typeof B.signedMessage=="string"?B.signedMessage:new TextDecoder().decode(B.signedMessage),k=B.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in O)||typeof O.signMessage!="function"||!("publicKey"in O)||typeof O!="object"||!O.publicKey||!("toBase58"in O.publicKey)||typeof O.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");j=[`${P.host} wants you to sign in with your Solana account:`,O.publicKey.toBase58(),...C?["",C,""]:[""],"Version: 1",`URI: ${P.href}`,`Issued At: ${(o=(r=E?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((c=E?.signInWithSolana)===null||c===void 0)&&c.notBefore?[`Not Before: ${E.signInWithSolana.notBefore}`]:[],...!((d=E?.signInWithSolana)===null||d===void 0)&&d.expirationTime?[`Expiration Time: ${E.signInWithSolana.expirationTime}
283`]:[],...!((h=E?.signInWithSolana)===null||h===void 0)&&h.chainId?[`Chain ID: ${E.signInWithSolana.chainId}`]:[],...!((p=E?.signInWithSolana)===null||p===void 0)&&p.nonce?[`Nonce: ${E.signInWithSolana.nonce}`]:[],...!((f=E?.signInWithSolana)===null||f===void 0)&&f.requestId?[`Request ID: ${E.signInWithSolana.requestId}`]:[],...!((x=(m=E?.signInWithSolana)===null||m===void 0?void 0:m.resources)===null||x===void 0)&&x.length?["Resources",...E.signInWithSolana.resources.map(B=>`- ${B}`)]:[]].join(`
284`);const M=await O.signMessage(new TextEncoder().encode(j),"utf8");if(!M||!(M instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");k=M}}try{const{data:S,error:N}=await Te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:j,signature:fi(k)},!((y=t.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(v=t.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:On});if(N)throw N;if(!S||!S.session||!S.user){const C=new fo;return this._returnResult({data:{user:null,session:null},error:C})}return S.session&&(await this._saveSession(S.session),await this._notifyAllSubscribers("SIGNED_IN",S.session)),this._returnResult({data:Object.assign({},S),error:N})}catch(S){if(je(S))return this._returnResult({data:{user:null,session:null},error:S});throw S}}async _exchangeCodeForSession(t){const s=await si(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(s??"").split("/");try{if(!r&&this.flowType==="pkce")throw new V$;const{data:c,error:d}=await Te(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:On});if(await ds(this.storage,`${this.storageKey}-code-verifier`),d)throw d;if(!c||!c.session||!c.user){const h=new fo;return this._returnResult({data:{user:null,session:null,redirectType:null},error:h})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:Object.assign(Object.assign({},c),{redirectType:o??null}),error:d})}catch(c){if(await ds(this.storage,`${this.storageKey}-code-verifier`),je(c))return this._returnResult({data:{user:null,session:null,redirectType:null},error:c});throw c}}async signInWithIdToken(t){try{const{options:s,provider:r,token:o,access_token:c,nonce:d}=t,h=await Te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:o,access_token:c,nonce:d,gotrue_meta_security:{captcha_token:s?.captchaToken}},xform:On}),{data:p,error:f}=h;if(f)return this._returnResult({data:{user:null,session:null},error:f});if(!p||!p.session||!p.user){const m=new fo;return this._returnResult({data:{user:null,session:null},error:m})}return p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),this._returnResult({data:p,error:f})}catch(s){if(je(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOtp(t){var s,r,o,c,d;try{if("email"in t){const{email:h,options:p}=t;let f=null,m=null;this.flowType==="pkce"&&([f,m]=await mo(this.storage,this.storageKey));const{error:x}=await Te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:h,data:(s=p?.data)!==null&&s!==void 0?s:{},create_user:(r=p?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:p?.captchaToken},code_challenge:f,code_challenge_method:m},redirectTo:p?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:x})}if("phone"in t){const{phone:h,options:p}=t,{data:f,error:m}=await Te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:h,data:(o=p?.data)!==null&&o!==void 0?o:{},create_user:(c=p?.shouldCreateUser)!==null&&c!==void 0?c:!0,gotrue_meta_security:{captcha_token:p?.captchaToken},channel:(d=p?.channel)!==null&&d!==void 0?d:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:f?.message_id},error:m})}throw new Bu("You must provide either an email or phone number.")}catch(h){if(await ds(this.storage,`${this.storageKey}-code-verifier`),je(h))return this._returnResult({data:{user:null,session:null},error:h});throw h}}async verifyOtp(t){var s,r;try{let o,c;"options"in t&&(o=(s=t.options)===null||s===void 0?void 0:s.redirectTo,c=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:d,error:h}=await Te(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:c}}),redirectTo:o,xform:On});if(h)throw h;if(!d)throw new Error("An error occurred on token verification.");const p=d.session,f=d.user;return p?.access_token&&(await this._saveSession(p),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",p)),this._returnResult({data:{user:f,session:p},error:null})}catch(o){if(je(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(t){var s,r,o,c,d;try{let h=null,p=null;this.flowType==="pkce"&&([h,p]=await mo(this.storage,this.storageKey));const f=await Te(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(s=t.options)===null||s===void 0?void 0:s.redirectTo)!==null&&r!==void 0?r:void 0}
284),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:h,code_challenge_method:p}),headers:this.headers,xform:fU});return!((c=f.data)===null||c===void 0)&&c.url&&us()&&!(!((d=t.options)===null||d===void 0)&&d.skipBrowserRedirect)&&window.location.assign(f.data.url),this._returnResult(f)}catch(h){if(await ds(this.storage,`${this.storageKey}-code-verifier`),je(h))return this._returnResult({data:null,error:h});throw h}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:s},error:r}=t;if(r)throw r;if(!s)throw new Ws;const{error:o}=await Te(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:s.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(t){if(je(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const s=`${this.url}/resend`;if("email"in t){const{email:r,type:o,options:c}=t,{error:d}=await Te(this.fetch,"POST",s,{headers:this.headers,body:{email:r,type:o,gotrue_meta_security:{captcha_token:c?.captchaToken}},redirectTo:c?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}else if("phone"in t){const{phone:r,type:o,options:c}=t,{data:d,error:h}=await Te(this.fetch,"POST",s,{headers:this.headers,body:{phone:r,type:o,gotrue_meta_security:{captcha_token:c?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:d?.message_id},error:h})}throw new Bu("You must provide either an email or phone number and a type")}catch(s){if(je(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async s=>s))}async _acquireLock(t,s){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await r,await s()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=s();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const s=await this.__loadSession();return await t(s)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const s=await si(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",s),s!==null&&(this._isValidSession(s)?t=s:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<u0:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const d=await si(this.userStorage,this.storageKey+"-user");d?.user?t.user=d.user:t.user=p0()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const d={value:this.suppressGetSessionWarning};t.user=dU(t.user,d),d.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:o,error:c}=await this._callRefreshToken(t.refresh_token);return c?this._returnResult({data:{session:null},error:c}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const s=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return s.data.user&&(this.suppressGetSessionWarning=!0),s}async _getUser(t){try{return t?await Te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:mr}):await this._useSession(async s=>{var r,o,c;const{data:d,error:h}=s;if(h)throw h;return!(!((r=d.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ws}:await Te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(c=(o=d.session)===null||o===void 0?void 0:o.access_token)!==null&&c!==void 0?c:void 0,xform:mr})})}catch(s){if(je(s))return Du(s)&&(await this._removeSession(),await ds(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:s});throw s}}async updateUser(t,s={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,s))}async _updateUser(t,s={}){try{return await this._useSession(async r=>{const{data:o,error:c}=r;if(c)throw c;if(!o.session)throw new Ws;const d=o.session;let h=null,p=null;this.flowType==="pkce"&&t.email!=null&&([h,p]=await mo(this.storage,this.storageKey));const{data:f,error:m}=await Te(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:s?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:h,code_challenge_method:p}),jwt:d.access_token,xform:mr});if(m)throw m;return d.user=f.user,await this._saveSession(d),await this._notifyAllSubscribers("USER_UPDATED",d),this._returnResult({data:{user:d.user},error:null})})}catch(r){if(await ds(this.storage,`${this.storageKey}-code-verifier`),je(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ws;const s=Date.now()/1e3;let r=s,o=!0,c=null;const{payload:d}=$u(t.access_token);if(d.exp&&(r=d.exp,o=r<=s),o){const{data:h,error:p}=await this._callRefreshToken(t.refresh_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!h)return{data:{user:null,session:null},error:null};c=h}else{const{data:h,error:p}=await this._getUser(t.access_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});c={access_token:t.access_token,refresh_token:t.refresh_token,user:h.user,token_type:"bearer",expires_in:r-s,expires_at:r},await this._saveSession(c),await this._notifyAllSubscribers("SIGNED_IN",c)}return this._returnResult({data:{user:c.user,session:c},error:null})}catch(s){if(je(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async s=>{var r;if(!t){const{data:d,error:h}=s;if(h)throw h;t=(r=d.session)!==null&&r!==void 0?r:void 0}if(!t?.refresh_token)throw new Ws;const{data:o,error:c}=await this._callRefreshToken(t.refresh_token);return c?this._returnResult({data:{user:null,session:null},error:c}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(s){if(je(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async _getSessionFromURL(t,s){try{if(!us())throw new Iu("No browser detected.");
284if(t.error||t.error_description||t.error_code)throw new Iu(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(s){case"implicit":if(this.flowType==="pkce")throw new g3("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Iu("Not a valid implicit grant flow url.");break;default:}if(s==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new g3("No code detected.");const{data:C,error:E}=await this._exchangeCodeForSession(t.code);if(E)throw E;const O=new URL(window.location.href);return O.searchParams.delete("code"),window.history.replaceState(window.history.state,"",O.toString()),{data:{session:C.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:o,access_token:c,refresh_token:d,expires_in:h,expires_at:p,token_type:f}=t;if(!c||!h||!d||!f)throw new Iu("No session defined in URL");const m=Math.round(Date.now()/1e3),x=parseInt(h);let y=m+x;p&&(y=parseInt(p));const v=y-m;v*1e3<=No&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${v}s, should have been closer to ${x}s`);const j=y-x;m-j>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",j,y,m):m-j<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",j,y,m);const{data:k,error:S}=await this._getUser(c);if(S)throw S;const N={provider_token:r,provider_refresh_token:o,access_token:c,expires_in:x,expires_at:y,refresh_token:d,token_type:f,user:k.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:N,redirectType:t.type},error:null})}catch(r){if(je(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const s=await si(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&s)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async s=>{var r;const{data:o,error:c}=s;if(c&&!Du(c))return this._returnResult({error:c});const d=(r=o.session)===null||r===void 0?void 0:r.access_token;if(d){const{error:h}=await this.admin.signOut(d,t);if(h&&!(H$(h)&&(h.status===404||h.status===401||h.status===403)||Du(h)))return this._returnResult({error:h})}return t!=="others"&&(await this._removeSession(),await ds(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const s=Q$(),r={id:s,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",s),this.stateChangeEmitters.delete(s)}};return this._debug("#onAuthStateChange()","registered callback with id",s),this.stateChangeEmitters.set(s,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(s)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async s=>{var r,o;try{const{data:{session:c},error:d}=s;if(d)throw d;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",c)),this._debug("INITIAL_SESSION","callback id",t,"session",c)}catch(c){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",c),Du(c)?console.warn(c):console.error(c)}})}async resetPasswordForEmail(t,s={}){let r=null,o=null;this.flowType==="pkce"&&([r,o]=await mo(this.storage,this.storageKey,!0));try{return await Te(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:o,gotrue_meta_security:{captcha_token:s.captchaToken}},headers:this.headers,redirectTo:s.redirectTo})}catch(c){if(await ds(this.storage,`${this.storageKey}-code-verifier`),je(c))return this._returnResult({data:null,error:c});throw c}}async getUserIdentities(){var t;try{const{data:s,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=s.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(s){if(je(s))return this._returnResult({data:null,error:s});throw s}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var s;try{const{data:r,error:o}=await this._useSession(async c=>{var d,h,p,f,m;
284const{data:x,error:y}=c;if(y)throw y;const v=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(d=t.options)===null||d===void 0?void 0:d.redirectTo,scopes:(h=t.options)===null||h===void 0?void 0:h.scopes,queryParams:(p=t.options)===null||p===void 0?void 0:p.queryParams,skipBrowserRedirect:!0});return await Te(this.fetch,"GET",v,{headers:this.headers,jwt:(m=(f=x.session)===null||f===void 0?void 0:f.access_token)!==null&&m!==void 0?m:void 0})});if(o)throw o;return us()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(r?.url),this._returnResult({data:{provider:t.provider,url:r?.url},error:null})}catch(r){if(je(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async s=>{var r;try{const{error:o,data:{session:c}}=s;if(o)throw o;const{options:d,provider:h,token:p,access_token:f,nonce:m}=t,x=await Te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=c?.access_token)!==null&&r!==void 0?r:void 0,body:{provider:h,id_token:p,access_token:f,nonce:m,link_identity:!0,gotrue_meta_security:{captcha_token:d?.captchaToken}},xform:On}),{data:y,error:v}=x;return v?this._returnResult({data:{user:null,session:null},error:v}):!y||!y.session||!y.user?this._returnResult({data:{user:null,session:null},error:new fo}):(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("USER_UPDATED",y.session)),this._returnResult({data:y,error:v}))}catch(o){if(await ds(this.storage,`${this.storageKey}-code-verifier`),je(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(t){try{return await this._useSession(async s=>{var r,o;const{data:c,error:d}=s;if(d)throw d;return await Te(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(r=c.session)===null||r===void 0?void 0:r.access_token)!==null&&o!==void 0?o:void 0})})}catch(s){if(je(s))return this._returnResult({data:null,error:s});throw s}}async _refreshAccessToken(t){const s=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{const r=Date.now();return await eU(async o=>(o>0&&await J$(200*Math.pow(2,o-1)),this._debug(s,"refreshing attempt",o),await Te(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:On})),(o,c)=>{const d=200*Math.pow(2,o);return c&&h0(c)&&Date.now()+d-r<No})}catch(r){if(this._debug(s,"error",r),je(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(s,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,s){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:s.redirectTo,scopes:s.scopes,queryParams:s.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",s,"url",r),us()&&!s.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,s;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const o=await si(this.storage,this.storageKey);if(o&&this.userStorage){let d=await si(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!d&&(d={user:o.user},await Co(this.userStorage,this.storageKey+"-user",d)),o.user=(t=d?.user)!==null&&t!==void 0?t:p0()}else if(o&&!o.user&&!o.user){const d=await si(this.storage,this.storageKey+"-user");d&&d?.user?(o.user=d.user,await ds(this.storage,this.storageKey+"-user"),await Co(this.storage,this.storageKey,o)):o.user=p0()}if(this._debug(r,"session from storage",o),!this._isValidSession(o)){this._debug(r,"session is not valid"),o!==null&&await this._removeSession();return}const c=((s=o.expires_at)!==null&&s!==void 0?s:1/0)*1e3-Date.now()<u0;if(this._debug(r,`session has${c?"":" not"} expired with margin of ${u0}s`),c){if(this.autoRefreshToken&&o.refresh_token){const{error:d}=await this._callRefreshToken(o.refresh_token);d&&(console.error(d),h0(d)||(this._debug(r,"refresh failed with a non-retryable error, remov
284ing the session",d),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:d,error:h}=await this._getUser(o.access_token);!h&&d?.user?(o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(d){console.error("Error getting user data:",d),this._debug(r,"error getting user data, skipping SIGNED_IN notification",d)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(r,"error",o),console.error(o);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var s,r;if(!t)throw new Ws;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new yp;const{data:c,error:d}=await this._refreshAccessToken(t);if(d)throw d;if(!c.session)throw new Ws;await this._saveSession(c.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",c.session);const h={data:c.session,error:null};return this.refreshingDeferred.resolve(h),h}catch(c){if(this._debug(o,"error",c),je(c)){const d={data:null,error:c};return h0(c)||await this._removeSession(),(s=this.refreshingDeferred)===null||s===void 0||s.resolve(d),d}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(c),c}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,s,r=!0){const o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",s,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:s});const c=[],d=Array.from(this.stateChangeEmitters.values()).map(async h=>{try{await h.callback(t,s)}catch(p){c.push(p)}});if(await Promise.all(d),c.length>0){for(let h=0;h<c.length;h+=1)console.error(c[h]);throw c[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await ds(this.storage,`${this.storageKey}-code-verifier`);const s=Object.assign({},t),r=s.user&&s.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&s.user&&await Co(this.userStorage,this.storageKey+"-user",{user:s.user});const o=Object.assign({},s);delete o.user;const c=w3(o);await Co(this.storage,this.storageKey,c)}else{const o=w3(s);await Co(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ds(this.storage,this.storageKey),await ds(this.storage,this.storageKey+"-code-verifier"),await ds(this.storage,this.storageKey+"-user"),this.userStorage&&await ds(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&us()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(s){console.error("removing visibilitychange callback failed",s)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),No);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const s=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=s,s&&typeof s=="object"&&typeof s.unref=="function"?s.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(s)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const s=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,s&&clearTimeout(s)}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{const t=Date.now();try{return await this._useSession(async s=>{const{data:{session:r}}=s;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((r.expires_at*1e3-t)/No);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${No}ms, refresh threshold is ${Hg} ticks`),o<=Hg&&await this._callRefreshToken(r.refresh_token)})}catch(s){console.error("Auto refresh tick failed with error. This is likely a transient error.",s
284)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof uN)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!us()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const s=`#_onVisibilityChanged(${t})`;this._debug(s,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(s,"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(t,s,r){const o=[`provider=${encodeURIComponent(s)}`];if(r?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r?.scopes&&o.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[c,d]=await mo(this.storage,this.storageKey),h=new URLSearchParams({code_challenge:`${encodeURIComponent(c)}`,code_challenge_method:`${encodeURIComponent(d)}`});o.push(h.toString())}if(r?.queryParams){const c=new URLSearchParams(r.queryParams);o.push(c.toString())}return r?.skipBrowserRedirect&&o.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async s=>{var r;const{data:o,error:c}=s;return c?this._returnResult({data:null,error:c}):await Te(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(s){if(je(s))return this._returnResult({data:null,error:s});throw s}}async _enroll(t){try{return await this._useSession(async s=>{var r,o;const{data:c,error:d}=s;if(d)return this._returnResult({data:null,error:d});const h=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:p,error:f}=await Te(this.fetch,"POST",`${this.url}/factors`,{body:h,headers:this.headers,jwt:(r=c?.session)===null||r===void 0?void 0:r.access_token});return f?this._returnResult({data:null,error:f}):(t.factorType==="totp"&&p.type==="totp"&&(!((o=p?.totp)===null||o===void 0)&&o.qr_code)&&(p.totp.qr_code=`data:image/svg+xml;utf-8,${p.totp.qr_code}`),this._returnResult({data:p,error:null}))})}catch(s){if(je(s))return this._returnResult({data:null,error:s});throw s}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async s=>{var r;const{data:o,error:c}=s;if(c)return this._returnResult({data:null,error:c});const d=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?TU(t.webauthn.credential_response):AU(t.webauthn.credential_response)})}:{code:t.code}),{data:h,error:p}=await Te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:d,headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token});return p?this._returnResult({data:null,error:p}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+h.expires_in},h)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",h),this._returnResult({data:h,error:p}))})}catch(s){if(je(s))return this._returnResult({data:null,error:s});throw s}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async s=>{var r;const{data:o,error:c}=s;if(c)return this._returnResult({data:null,error:c});const d=await Te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token});if(d.error)return d;const{data:h}=d;if(h.type!=="webauthn")return{data:h,error:null};switch(h.webauthn.type){case"create":return{data:Object.assign(Object.assign({},h),{webauthn:Object.assign(Object.assign({},h.webauthn),{credential_options:Object.assign(Object.assign({},h.webauthn.credential_options),{publicKey:CU(h.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},h),{webauthn:Object.assign(Object.assign({},h.webauthn),{credential_options:Object.assign(Object.assign({},h.webauthn.credential_options),{publicKey:EU(h.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(s){if(je(s))return this._returnResult({data:null,error:s});throw s}})}async _challengeAndVerify(t){const{data:s,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:s.id,code:t.code})}async _listFactors(){var t;const{data:{user:s},error:r}=await this.getUser();if(r)return{data:null,error:r};const o={all:[],phone:[],totp:[],webauthn:[]};for(const c of(t=s?.factors)!==null&&t!==void 0?t:[])o.all.push(c),c.status==="verified"&&o[c.factor_type].push(c);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(t){var s,r,o,c;if(t)try{const{payload:v}=$u(t);let j=null;v.aal&&(j=v.aal);let k=j;const{data:{user:S},error:N}=await this.getUser(t);if(N)return this._returnResult({data:null,error:N});((r=(s=S?.factors)===null||s===void 0?void 0:s.filter(O=>O.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(k="aal2");const E=v.amr||[];return{data:{currentLevel:j,nextLevel:k,currentAuthenticationMethods:E},error:null}}catch(v){if(je(v))return this._returnResult({data:null,error:v});throw v}const{data:{session:d},error:h}
284=await this.getSession();if(h)return this._returnResult({data:null,error:h});if(!d)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:p}=$u(d.access_token);let f=null;p.aal&&(f=p.aal);let m=f;((c=(o=d.user.factors)===null||o===void 0?void 0:o.filter(v=>v.status==="verified"))!==null&&c!==void 0?c:[]).length>0&&(m="aal2");const y=p.amr||[];return{data:{currentLevel:f,nextLevel:m,currentAuthenticationMethods:y},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async s=>{const{data:{session:r},error:o}=s;return o?this._returnResult({data:null,error:o}):r?await Te(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:c=>({data:c,error:null})}):this._returnResult({data:null,error:new Ws})})}catch(s){if(je(s))return this._returnResult({data:null,error:s});throw s}}async _approveAuthorization(t,s){try{return await this._useSession(async r=>{const{data:{session:o},error:c}=r;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new Ws});const d=await Te(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:h=>({data:h,error:null})});return d.data&&d.data.redirect_url&&us()&&!s?.skipBrowserRedirect&&window.location.assign(d.data.redirect_url),d})}catch(r){if(je(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,s){try{return await this._useSession(async r=>{const{data:{session:o},error:c}=r;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new Ws});const d=await Te(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:h=>({data:h,error:null})});return d.data&&d.data.redirect_url&&us()&&!s?.skipBrowserRedirect&&window.location.assign(d.data.redirect_url),d})}catch(r){if(je(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:s},error:r}=t;return r?this._returnResult({data:null,error:r}):s?await Te(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new Ws})})}catch(t){if(je(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async s=>{const{data:{session:r},error:o}=s;return o?this._returnResult({data:null,error:o}):r?(await Te(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ws})})}catch(s){if(je(s))return this._returnResult({data:null,error:s});throw s}}async fetchJwk(t,s={keys:[]}){let r=s.keys.find(h=>h.kid===t);if(r)return r;const o=Date.now();if(r=this.jwks.keys.find(h=>h.kid===t),r&&this.jwks_cached_at+$$>o)return r;const{data:c,error:d}=await Te(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(d)throw d;return!c.keys||c.keys.length===0||(this.jwks=c,this.jwks_cached_at=o,r=c.keys.find(h=>h.kid===t),!r)?null:r}async getClaims(t,s={}){try{let r=t;if(!r){const{data:v,error:j}
284=await this.getSession();if(j||!v.session)return this._returnResult({data:null,error:j});r=v.session.access_token}const{header:o,payload:c,signature:d,raw:{header:h,payload:p}}=$u(r);s?.allowExpired||oU(c.exp);const f=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,s?.keys?{keys:s.keys}:s?.jwks);if(!f){const{error:v}=await this.getUser(r);if(v)throw v;return{data:{claims:c,header:o,signature:d},error:null}}const m=lU(o.alg),x=await crypto.subtle.importKey("jwk",f,m,!0,["verify"]);if(!await crypto.subtle.verify(m,x,d,W$(`${h}.${p}`)))throw new zg("Invalid JWT signature");return{data:{claims:c,header:o,signature:d},error:null}}catch(r){if(je(r))return this._returnResult({data:null,error:r});throw r}}}zc.nextInstanceID={};const $U=zc,UU="2.103.3";let yc="";typeof Deno<"u"?yc="deno":typeof document<"u"?yc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?yc="react-native":yc="node";const HU={"X-Client-Info":`supabase-js-${yc}/${UU}`},qU={headers:HU},VU={schema:"public"},zU={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},FU={};function Fc(e){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fc(e)}function GU(e,t){if(Fc(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t);if(Fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KU(e){var t=GU(e,"string");return Fc(t)=="symbol"?t:t+""}function WU(e,t,s){return(t=KU(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function T3(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),s.push.apply(s,r)}return s}function Rt(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?T3(Object(s),!0).forEach(function(r){WU(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):T3(Object(s)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})}return e}const YU=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),QU=()=>Headers,ZU=(e,t,s)=>{const r=YU(s),o=QU();return async(c,d)=>{var h;const p=(h=await t())!==null&&h!==void 0?h:e;let f=new o(d?.headers);return f.has("apikey")||f.set("apikey",e),f.has("Authorization")||f.set("Authorization",`Bearer ${p}`),r(c,Rt(Rt({},d),{},{headers:f}))}};function XU(e){return e.endsWith("/")?e:e+"/"}function JU(e,t){var s,r;const{db:o,auth:c,realtime:d,global:h}=e,{db:p,auth:f,realtime:m,global:x}=t,y={db:Rt(Rt({},p),o),auth:Rt(Rt({},f),c),realtime:Rt(Rt({},m),d),storage:{},global:Rt(Rt(Rt({},x),h),{},{headers:Rt(Rt({},(s=x?.headers)!==null&&s!==void 0?s:{}),(r=h?.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}function eH(e){const t=e?.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(XU(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var tH=class extends $U{constructor(e){super(e)}},sH=class{constructor(e,t,s){var r,o;this.supabaseUrl=e,this.supabaseKey=t;const c=eH(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",c),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",c),this.storageUrl=new URL("storage/v1",c),this.functionsUrl=new URL("functions/v1",c);const d=`sb-${c.hostname.split(".")[0]}-auth-token`,h={db:VU,realtime:FU,auth:Rt(Rt({},zU),{},{storageKey:d}),global:qU},p=JU(s??{},h);if(this.storageKey=(r=p.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(o=p.global.headers)!==null&&o!==void 0?o:{},p.accessToken)this.accessToken=p.accessToken,this.auth=new Proxy({},{get:(m,x)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(x)} is not possible`)}});else{var f;this.auth=this._initSupabaseAuthClient((f=p.auth)!==null&&f!==void 0?f:{},this.headers,p.global.fetch)}this.fetch=ZU(t,this._getAccessToken.bind(this),p.global.fetch),this.realtime=this._initRealtimeClient(Rt({headers:this.headers,accessToken:this._getAccessToken.bind(this)},p.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(m=>this.realtime.setAuth(m)).catch(m=>console.warn("Failed to set initial Realtime auth token:",m)),this.rest=new kI(new URL("rest/v1",c).href,{headers:this.headers,schema:p.db.schema,fetch:this.fetch,timeout:p.db.timeout,urlLengthLimit:p.db.urlLengthLimit}),this.storage=new M$(this.storageUrl.href,this.headers,this.fetch,s?.storage),p.accessToken||this._listenForAuthEvents()}get functions(){return new pI(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={},s={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,s)}
284channel(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,t,s;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(s=r.session)===null||s===void 0?void 0:s.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,userStorage:o,storageKey:c,flowType:d,lock:h,debug:p,throwOnError:f},m,x){const y={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new tH({url:this.authUrl.href,headers:Rt(Rt({},y),m),storageKey:c,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,userStorage:o,flowType:d,lock:h,debug:p,throwOnError:f,fetch:x,hasCustomAuthorizationHeader:Object.keys(this.headers).some(v=>v.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new n$(this.realtimeUrl.href,Rt(Rt({},e),{},{params:Rt(Rt({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t?.access_token)})}_handleTokenChanged(e,t,s){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==s?(this.changedAccessToken=s,this.realtime.setAuth(s)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const nH=(e,t,s)=>new sH(e,t,s);function aH(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const s=t.match(/^v(\d+)\./);return s?parseInt(s[1],10)<=18:!1}aH()&&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");const rH="https://rxnvprdvlnlycamuwybx.supabase.co/",iH="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InJ4bnZwcmR2bG5seWNhbXV3eWJ4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzY1MjkxNzYsImV4cCI6MjA5MjEwNTE3Nn0.lElMI58nm0x73iiLeRqcLcj9J8095Xp97qpZMW7y6GM",wt=nH(rH,iH,{auth:{persistSession:!0,autoRefreshToken:!0,storageKey:"scapely-web-auth"}});async function bp(){const{data:e}=await wt.auth.getSession(),t=e.session?.access_token;if(t)try{const r=JSON.parse(atob(t.split(".")[1]));if(typeof r.exp=="number"&&r.exp*1e3>Date.now()+6e4)return t}catch{return t}const{data:s}=await wt.auth.refreshSession().catch(()=>({data:null}));return s?.session?.access_token??null}const Lh="/api";async function oH(){try{const e=await bp();await fetch(`${Lh}/analytics/sample-report-view`,{method:"POST",headers:e?{Authorization:`Bearer ${e}`}:void 0,keepalive:!0})}catch{}}async function lH(e){const t=await fetch(`${Lh}/contact`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const s=await t.json().catch(()=>({error:"Request failed"}));throw new Error(s.error??`HTTP ${t.status}`)}}class Gc extends Error{constructor(t,s,r,o){super(t),this.status=s,this.code=r,this.body=o}}function A3(e,t){return{"Content-Type":"application/json",Authorization:`Bearer ${e}`,...t??{}}}async function bt(e,t={}){const s=await bp();if(!s)throw new Gc("Not signed in",401);let r=await fetch(`${Lh}${e}`,{...t,headers:A3(s,t.headers)});if(r.status===401){const{data:c}=await wt.auth.refreshSession().catch(()=>({data:null})),d=c?.session?.access_token;d&&(r=await fetch(`${Lh}${e}`,{...t,headers:A3(d,t.headers)}))}const o=await r.json().catch(()=>({}));if(!r.ok)throw new Gc(o.error??`HTTP ${r.status}`,r.status,o.code,o);return o}const cH=new Set;typeof window<"u"&&(window.gm_authFailure=()=>{for(const e of cH)e()});function Fg(e,t){return(e+180)/360*(1<<t)}function Gg(e,t){const s=e*Math.PI/180;return(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*(1<<t)}function dH({centerLat:e,centerLng:t,zoom:s,cols:r,rows:o,urlTemplate:c,testId:d="os-tilegrid"}){const h=Fg(t,s),p=Gg(e,s),f=Math.floor(h)-Math.floor(r/2),m=Math.floor(p)-Math.floor(o/2),x=r*256,y=o*256,v=(h-f)*256,j=(p-m)*256,k=[];for(let S=0;S<o;S++)for(let N=0;N<r;N++){const C=f+N,E=m+S,O=c.replace("{layer}","Light_3857").replace("{z}",String(s)).replace("{x}",String(C)).replace("{y}",String(E));k.push({x:C,y:E,url:O})}return n.jsx("div",{className:"grid",style:{position:"absolute",left:`calc(50% - ${v}
284px)`,top:`calc(50% - ${j}px)`,width:`${x}px`,height:`${y}px`,gridTemplateColumns:`repeat(${r}, 256px)`,gridTemplateRows:`repeat(${o}, 256px)`},"data-testid":d,children:k.map(S=>n.jsx("img",{src:S.url,alt:"",loading:"lazy",width:256,height:256,className:"block"},`${S.x},${S.y}`))})}function uH({centerLat:e,centerLng:t,targetPolygon:s,adjacentPolygons:r,urlTemplate:o}){const m={x:Fg(t,19)*256,y:Gg(e,19)*256},x=([v,j])=>[Fg(v,19)*256-m.x,Gg(j,19)*256-m.y],y=v=>v.length===0?"":v.map((j,k)=>{const[S,N]=x(j);return`${k===0?"M":"L"}${S.toFixed(2)},${N.toFixed(2)}`}).join(" ")+" Z";return n.jsxs("div",{className:"relative aspect-[4/3] overflow-hidden rounded-[12px] border border-slate-200 dark:border-white/10 bg-slate-900","data-testid":"plot-intel-minimap-fallback",children:[n.jsx(dH,{centerLat:e,centerLng:t,zoom:19,cols:3,rows:3,urlTemplate:o,testId:"os-tilegrid-plot"}),n.jsxs("svg",{className:"pointer-events-none absolute inset-0 h-full w-full",viewBox:`${-768/2} ${-768/2} 768 768`,preserveAspectRatio:"xMidYMid slice",children:[r.map((v,j)=>n.jsx("path",{d:y(v),fill:"rgba(148,163,184,0.18)",stroke:"rgba(148,163,184,0.7)",strokeWidth:1.2},`adj-${j}`)),s&&s.length>0&&n.jsx("path",{d:y(s),fill:"rgba(52,211,153,0.28)",stroke:"#34d399",strokeWidth:2.5}),n.jsx("circle",{cx:0,cy:0,r:5,fill:"#22d3ee",stroke:"#06081c",strokeWidth:2})]}),n.jsx("div",{className:"pointer-events-none absolute bottom-1.5 right-2 font-mono text-[9px] uppercase tracking-wider text-slate-300/80",children:"OS · Crown copyright"})]})}function hH(e){return n.jsx(uH,{...e})}function pH(){return n.jsxs("section",{className:"space-y-4","data-testid":"plot-intel-locked",children:[n.jsxs("h2",{className:"flex items-center gap-2 font-mono text-[13px] uppercase tracking-wider text-emerald-700 dark:text-emerald-300",children:[n.jsx(Yh,{className:"h-3.5 w-3.5"})," Plot intelligence",n.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 rounded-full border border-slate-900/20 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider text-slate-900 dark:border-white/20 dark:text-white",children:[n.jsx(Aa,{className:"h-2.5 w-2.5"})," Pro"]})]}),n.jsxs("div",{className:"space-y-3 rounded-[12px] border border-slate-300 bg-slate-100 p-5 backdrop-blur dark:border-white/[0.16] dark:bg-white/[0.03]",children:[n.jsx("p",{className:"text-[14px] text-slate-700 dark:text-slate-300",children:"Get the building footprint, plot adjacency and roof height for any UK address — drawn directly from the Ordnance Survey National Geographic Database."}),n.jsxs("ul",{className:"space-y-1 text-[13px] text-slate-600 dark:text-slate-400",children:[n.jsx("li",{children:"• Exact ground-floor footprint in m²"}),n.jsx("li",{children:"• Roof height (where surveyed)"}),n.jsx("li",{children:"• Adjacent building count + total adjacent footprint"}),n.jsx("li",{children:"• OS Light basemap mini-view with the plot highlighted"})]}),n.jsxs(Be,{href:"/pricing",className:"inline-flex items-center gap-1.5 rounded-[12px] border border-emerald-300/40 bg-emerald-300/10 px-3 py-1.5 font-mono text-[12px] uppercase tracking-wider text-emerald-700 transition hover:border-emerald-300/60 hover:bg-emerald-300/[0.18] hover:text-slate-900 dark:text-emerald-100 dark:hover:text-white","data-testid":"link-plot-intel-upgrade",children:[n.jsx(na,{className:"h-3 w-3"})," Upgrade to Pro"]})]})]})}async function fH(){const e=await fetch("/api/plot-intel/demo",{headers:{Accept:"application/json"}}),t=await e.json().catch(()=>({}));if(!e.ok)throw new Error("error"in t&&t.error?t.error:`Plot Intelligence request failed (${e.status})`);return t}function fN({lat:e,lng:t,tier:s,publicDemo:r=!1}){const o=s==="pro"||s==="enterprise"||s==="single_report",c=typeof e=="number"&&typeof t=="number"&&Number.isFinite(e)&&Number.isFinite(t),d=vr({queryKey:["plot-intel",r?"public-demo":"dashboard",c?e.toFixed(6):"",c?t.toFixed(6):""],queryFn:()=>r?fH():bt(`/plot-intel?lat=${e}&lng=${t}`),enabled:o&&c,staleTime:300*1e3,refetchOnWindowFocus:!1,retry:1});if(!o)return n.jsx(pH,{});if(!c)return null;const h=d.data,p=h?.target??null,f=h?.adjacent??null,m=(h?.source??"Ordnance Survey O
284S NGD").replace(/\s*\(Crown Copyright\)/gi,"");return n.jsxs(cI,{title:n.jsxs("span",{className:"flex flex-col leading-tight",children:[n.jsx("span",{children:"Footprint"}),n.jsx("span",{className:"mt-0.5 text-[10px] font-medium normal-case tracking-normal text-slate-500 dark:text-slate-400",children:"Adjacency and density"})]}),accent:"emerald",children:[d.isLoading&&n.jsxs("p",{className:"text-[13px] text-slate-600 dark:text-slate-400","data-testid":"plot-intel-loading",children:[n.jsx(Me,{className:"mr-1.5 inline h-3 w-3 animate-spin"}),"Looking up Ordnance Survey…"]}),d.isError&&n.jsx("p",{className:"text-[13px] text-amber-700 dark:text-amber-300","data-testid":"plot-intel-error",children:"Couldn’t reach Ordnance Survey — try again shortly."}),!d.isLoading&&!d.isError&&h&&!p&&f&&f.count===0&&n.jsx("p",{className:"text-[13px] text-slate-700 dark:text-slate-300","data-testid":"plot-intel-empty",children:"Ordnance Survey has no building footprint at this point — the address may be a rural plot, a park, or a newly-built development not yet captured in the NGD."}),h&&(p||f&&f.count>0)&&n.jsxs("div",{className:"grid grid-cols-1 items-start gap-4 lg:grid-cols-2","data-testid":"plot-intel-data",children:[n.jsx(hH,{centerLat:e,centerLng:t,targetPolygon:p?p.polygon:null,adjacentPolygons:f?f.polygons:[],urlTemplate:h.tile_session.url_template}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[p?n.jsxs("div",{className:"rounded-[12px] border border-slate-200 dark:border-white/10 p-3","data-testid":"plot-intel-footprint",children:[n.jsx("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-emerald-700/90 dark:text-emerald-300/80",children:"Building footprint"}),n.jsx("div",{className:"mt-0.5 text-xl font-semibold text-slate-900 dark:text-white",children:n.jsx(c0,{to:p.area_m2,unit:" m²",decimals:p.area_m2>=100?0:1})}),p.match==="nearest"&&n.jsxs("div",{className:"mt-1 text-[11px] text-slate-600 dark:text-slate-400",children:["Nearest building, ~",Math.round(p.distance_m)," m from the geocoded point"]})]}):n.jsxs("div",{className:"rounded-[12px] border border-slate-200 dark:border-white/10 p-3",children:[n.jsx("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-emerald-700/90 dark:text-emerald-300/80",children:"Building footprint"}),n.jsx("div",{className:"mt-0.5 text-[13px] text-slate-600 dark:text-slate-400",children:"No matching footprint at this point"})]}),n.jsxs("div",{className:"rounded-[12px] border border-slate-200 dark:border-white/10 p-3","data-testid":"plot-intel-height",children:[n.jsx("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-emerald-700/90 dark:text-emerald-300/80",children:"Roof height"}),n.jsx("div",{className:"mt-0.5 text-xl font-semibold text-slate-900 dark:text-white",children:p&&p.height_m!=null?n.jsx(c0,{to:p.height_m,unit:" m",decimals:1}):"—"}),!(p&&p.height_m!=null)&&n.jsx("div",{className:"mt-1 text-[11px] text-slate-500",children:"Not captured for this building"})]}),n.jsxs("div",{className:"rounded-[12px] border border-slate-200 dark:border-white/10 p-3","data-testid":"plot-intel-adjacent-count",children:[n.jsx("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-emerald-700/90 dark:text-emerald-300/80",children:"Adjacent buildings"}),n.jsx("div",{className:"mt-0.5 text-xl font-semibold text-slate-900 dark:text-white",children:f?f.count:0}),n.jsx("div",{className:"mt-1 text-[11px] text-slate-500",children:"Within ~50 m"})]}),n.jsxs("div",{className:"rounded-[12px] border border-slate-200 dark:border-white/10 p-3","data-testid":"plot-intel-adjacent-area",children:[n.jsx("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-emerald-700/90 dark:text-emerald-300/80",children:"Total adjacent footprint"}),n.jsx("div",{className:"mt-0.5 text-xl font-semibold text-slate-900 dark:text-white",children:f&&f.total_area_m2>0?n.jsx(c0,{to:f.total_area_m2,unit:" m²",decimals:f.total_area_m2>=100?0:1}):"—"})]}),p&&f&&f.total_area_m2+p.area_m2>0&&n.jsxs("div",{className:"rounded-[12px] border border-slate-200 dark:border-white/10 p-3","data-testid":"plot-intel-density",children:[n.jsx("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-emerald-700/90 dark:text-emerald-300/80",children:"Plot density"}),n.jsxs("div",{className:"mt-0.5 text-xl font-semibold text-slate-900 dark:text-white",children:[Math.round(p.area_m2/(p.area_m2+f.total_area_m2)*100),"%"]}),n.jsx("div",{className:"mt-1 text-[11px] text-slate-500",children:"Subject footprint share within ~50 m"})]}),n.jsxs("p",{className:"col-span-2 border-t border-slate-200 pt-2 font-mono text-[10px] uppercase tracking-wider text-slate-600 dar
284k:border-white/5",children:["Source: ",m]})]})]})]})}const mH="modulepreload",gH=function(e){return"/"+e},R3={},O3=function(t,s,r){let o=Promise.resolve();if(s&&s.length>0){let p=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=d?.nonce||d?.getAttribute("nonce");o=p(s.map(f=>{if(f=gH(f),f in R3)return;R3[f]=!0;const m=f.endsWith(".css"),x=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${x}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":mH,m||(y.as="script"),y.crossOrigin="",y.href=f,h&&y.setAttribute("nonce",h),document.head.appendChild(y),m)return new Promise((v,j)=>{y.addEventListener("load",v),y.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return o.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return t().catch(c)})},xH="/assets/scapelylogo_1776627137395-C8fyOQAX.png",yo="#0f172a",ni="#64748b",Fo="#e2e8f0",Uu="#0f172a",ai=e=>e==null||!Number.isFinite(e)?"—":new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",maximumFractionDigits:0}).format(e),P3=(e,t=1)=>e==null||!Number.isFinite(e)?"—":`${e.toFixed(t)}%`,bo=e=>e==null||!Number.isFinite(e)?"—":new Intl.NumberFormat("en-GB").format(e),Hu=e=>e===!0?"Yes":e===!1?"No":"—",Lt=e=>{const t=(e??"").toString().trim();return t.length===0?"—":t},yH=e=>{if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})},m0=e=>{if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString("en-GB",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})},M3=e=>Array.isArray(e)?e.map(t=>typeof t=="string"?t:t?.name??"").filter(t=>t.trim().length>0):[],mN=[{label:"Refurbishment",rate_per_sqm:1200,basis:"existing",blurb:"Light-touch upgrade of existing fabric — kitchens, bathrooms, services, finishes. Applied to the full existing floor area."},{label:"Single-storey extension",rate_per_sqm:2400,basis:"added",added_sqm:25,blurb:"Typical rear or side extension — applied to a representative 25 sqm footprint."},{label:"New build (replacement)",rate_per_sqm:2800,basis:"existing",blurb:"Full demolition and rebuild on the existing footprint — substructure, frame, envelope, services, finishes."},{label:"Class E conversion",rate_per_sqm:1500,basis:"existing",blurb:"Permitted Class E commercial-to-residential change of use — strip-out, layout reconfiguration, MEP upgrade."}];function bH(e){if(!e)return{region:"Midlands (default)",multiplier:1};const s=(e.trim().toUpperCase().split(/\s+/)[0]??"").match(/^[A-Z]+/)?.[0]??"",r=new Set(["E","EC","N","NW","SE","SW","W","WC","BR","CR","DA","EN","HA","IG","KT","RM","SM","TW","UB","WD","GU","ME","CT","TN","RH","BN","PO","SO","BH","SP","RG","OX","HP","SL","MK","LU","AL","SG","CM","CB","CO","SS","IP"]),o=new Set(["BD","BL","CA","CH","CW","DH","DL","DN","FY","HD","HG","HU","HX","LA","LL","LS","M","NE","OL","PR","S","SK","SR","ST","TS","WA","WF","WN","YO"]);return r.has(s)?{region:"London & South-East",multiplier:1.25}:o.has(s)?{region:"North & Wales",multiplier:.95}:{region:"Midlands",multiplier:1}}function vH(e,t){const{region:s,multiplier:r}=bH(t),o=Number.isFinite(e)?e:0;return{rows:mN.map(d=>{const h=d.basis==="added"?d.added_sqm??25:o,p=Math.round(h*d.rate_per_sqm*r),f=Math.round(p*.12),m=Math.round(p*.1);return{label:d.label,basisFloor:h,base:p,fees:f,contingency:m,total:p+f+m}}),multiplier:r,region:s}}let g0=null;async function wH(){if(g0)return g0;try{const e=await fetch(xH);if(!e.ok)return null;const t=await e.blob(),s=await new Promise((h,p)=>{const f=URL.createObjectURL(t),m=new Image;m.onload=()=>{URL.revokeObjectURL(f),h(m)},m.onerror=()=>{URL.revokeObjectURL(f),p(new Error("logo decode failed"))},m.src=f}),r=document.createElement("canvas");
284r.width=s.naturalWidth,r.height=s.naturalHeight;const o=r.getContext("2d");if(!o)return null;o.drawImage(s,0,0);const c=o.getImageData(0,0,r.width,r.height);for(let h=0;h<c.data.length;h+=4)c.data[h+3]>0&&(c.data[h]=90,c.data[h+1]=106,c.data[h+2]=122);o.putImageData(c,0,0);const d=r.toDataURL("image/png");return g0=d,d}catch{return null}}function An(e,t){const s=[{text:e,style:"h2",margin:[0,18,0,4]},{canvas:[{type:"line",x1:0,y1:0,x2:515,y2:0,lineWidth:.6,lineColor:Fo}],margin:[0,0,0,8]}];return t&&s.push({text:t,style:"intro",margin:[0,0,0,8]}),s}function Yn(e){const t=[[{text:"Data point",style:"th"},{text:"Value",style:"th"},{text:"Source",style:"th"}],...e.map(s=>[{text:s.field,style:"td"},{text:s.value,style:"tdValue"},{text:s.source,style:"tdSource"}])];return{table:{headerRows:1,widths:[170,"*",150],body:t},layout:{hLineColor:()=>Fo,vLineColor:()=>Fo,hLineWidth:s=>s===0||s===1?.6:.4,vLineWidth:()=>0,paddingTop:()=>6,paddingBottom:()=>6,paddingLeft:()=>0,paddingRight:()=>8},margin:[0,0,0,4]}}function jH(e){const t=e.last_appraisal??null,s=new Date,r=[];r.push({text:"Intelligence report",style:"h1",margin:[0,0,0,4]},{text:e.address_line,style:"subtitle",margin:[0,0,0,2]},{text:`${e.postcode}${e.local_authority?` · ${e.local_authority}`:""}`,style:"muted",margin:[0,0,0,14]});const o=t?.property?.epc?.current,c=t?.pro_data?.ptal_score,d=t?.appraisal?.planning_risk_assessment?.overall_risk_level,h=[];o&&h.push(`an EPC rating of ${o}`),c!=null&&c!==""&&h.push(`a PTAL score of ${c}`),d&&h.push(`an overall planning risk of ${d.toLowerCase()}`);const p=h.length>0?`This report consolidates what Scapely has captured for this property. It currently shows ${h.join(", ")}. The right-hand "Source" column on every table makes the provenance of each row explicit. Read it carefully: rows sourced from official registers (Companies House, EPC Open Data Communities, Environment Agency, planning.data.gov.uk) are reproduced as recorded; rows labelled "Scapely heuristic" or "Scapely estimate" are derived locally because no official per-property API exists; rows labelled "Scapely AI appraisal" are produced by an LLM and should be treated as one indicative input alongside the deterministic data, not as advice.`:'This report consolidates the public-record data Scapely has captured for this property. No AI appraisal has been run yet, so several sections below show "Not checked yet" — re-run the analysis from the dashboard to populate them. The right-hand "Source" column on every table makes the provenance of each row explicit: official register, Scapely heuristic, or Scapely AI appraisal.';r.push({text:p,style:"body",margin:[0,0,0,6]});const f=Number.isFinite(e.latitude)&&Number.isFinite(e.longitude)?`${e.latitude.toFixed(5)}, ${e.longitude.toFixed(5)}`:"—";r.push(...An("1. Property record","The address as it was captured in the watchlist and the official identifiers used to look up every other section of this report.")),r.push(Yn([{field:"Address",value:Lt(e.address_line),source:"User input on save"},{field:"Postcode",value:Lt(e.postcode),source:"User input on save"},{field:"Local authority",value:Lt(e.local_authority),source:"Reverse-geocoded via UK postcode lookup"},{field:"Coordinates (lat, lon)",value:f,source:"Geocoded from address"},{field:"Capture source",value:Lt(e.source),source:"Scapely watchlist record"},{field:"Source URL",value:Lt(e.source_url),source:"Scapely watchlist record"},{field:"Saved on",value:m0(e.created_at),source:"Scapely watchlist record"},{field:"Last refreshed",value:m0(e.last_refreshed_at),source:"Scapely watchlist record"}]));const m="Not checked yet",x=t?.property?.epc,y=t?.pro_data?.epc_uplift,v=!!t?.property,j=!!t?.pro_data,k="EPC Open Data Communities — domestic EPC register (MHCLG / Department for Energy Security & Net Zero)";r.push(...An("2. Energy performance (EPC)","The property's most recent Energy Performance Certificate, plus an indicative retrofit-cost estimate. From April 2025 (commercial) and 2028 (domestic, proposed), let properties must reach EPC C or above under MEES.")),r.push(Yn([{field:"Current EPC rating",value:v?Lt(x?.current??null):m,source:k},{field:"Potential EPC rating",value:v?Lt(x?.potential??null):m,source:k},{field:"Current SAP score",value:v?bo(x?.current_sap_score):m,source:k},{field:"Potential SAP score",value:v?bo(x?.potential_sap_score):m,source:k},{field:"Total floor area",value:v&&x?.floor_area_sqm!=null?`${bo(x.floor_area_sqm)} sqm`:v?"—":m,source:k},{field:"Indicative retrofit cost (current → C)",value:j?ai(y?.estimated_retrofit_cost_gbp??null):m,source:"Scapely retrofit benchmark — heuristic (£/SAP-point uplift × floor area)"},{field:"Indicative value uplift on retrofit",value:j?P3(y?.estimated_value_uplift_pct??null):m,source:"Scapely estimate — informed by published greener-homes premium studies (e.g. Knight Frank)"}]));const S=t?.pro_data?.ptal_score,N=t?.pro_data?.ptal_label,C=!!t?.pro_data,E="Scapely PTAL approximation — derived from rail and bus stop density within ~500m via the TfL StopPoint API. Not the official TfL PTAL dataset.";r.push(...An("3. Public transport accessibility","PTAL (Public Transport Acce
284ssibility Level) is a 0–6b scale used by London boroughs. The figure below is Scapely's approximation from nearby stop density — useful as a guide, not a planning submission.")),r.push(Yn([{field:"PTAL score (approx.)",value:C?Lt(S!=null?String(S):null):m,source:E},{field:"Interpretation",value:C?Lt(N):m,source:E}]));const O=t?.property?.planning_gateway,P=t?.property?.free_metrics,M=!!t?.property?.planning_gateway,B=!!t?.property?.free_metrics,A=O?.conservation_areas??[],L=M3(O?.listed_buildings),U=M3(O?.active_article_4_directions),K="planning.data.gov.uk — UK Government planning datasets (live spatial query against the property coordinates)";r.push(...An("4. Heritage & planning constraints","Statutory designations that restrict permitted-development rights and increase the likelihood of a planning application being needed (and contested). All three are spatial queries against the same UK Government dataset.")),r.push(Yn([{field:"Conservation areas",value:M?A.length>0?A.join("; "):"None found at this location":m,source:K},{field:"Listed buildings (on or near site)",value:M?L.length>0?L.join("; "):"None found at this location":m,source:`${K} (Historic England National Heritage List, mirrored)`},{field:"Active Article 4 directions",value:M?U.length>0?U.join("; "):"None found at this location":m,source:K},{field:"Heritage status (summary)",value:B?Lt(P?.heritage_status??null):m,source:`Scapely interpretation of ${K.toLowerCase()}`},{field:"Property is statutorily listed",value:B?Hu(P?.is_listed??null):m,source:`${K} (Historic England National Heritage List, mirrored)`}]));const G="Environment Agency Flood Map for Planning (Zone 2 / Zone 3 polygons), accessed via planning.data.gov.uk";r.push(...An("5. Flood risk","Flood Zones are published by the Environment Agency. Zone 1 is the lowest risk; Zones 2 and 3 typically require a flood risk assessment with any planning application.")),r.push(Yn([{field:"Flood zone",value:B?P?.flood_risk_zone!=null?`Zone ${P.flood_risk_zone}`:"Outside Zone 2 / 3 polygons (treated as Zone 1)":m,source:G},{field:"Interpretation",value:B?Lt(P?.flood_risk_label??null):m,source:G}]));const W=t?.pro_data??null,ee=!!W,te="Article 4 detection from planning.data.gov.uk — checks whether an active Article 4 direction mentioning HMO/C4 covers the site. 100% indicates the site is inside such a direction (i.e. permitted-development to HMO is removed); it is a binary proxy, not a true saturation count.";r.push(...An("6. HMO Article 4 status","A binary check for whether the site sits inside an active Article 4 direction that removes permitted-development rights to convert to HMO/C4 use. This is a proxy for HMO saturation, not a count of nearby licensed HMOs.")),r.push(Yn([{field:"Inside HMO Article 4 direction",value:ee?W?.hmo_saturation_pct===100?"Yes":W?.hmo_saturation_pct===0?"No":P3(W?.hmo_saturation_pct??null,0):m,source:te},{field:"Interpretation",value:ee?Lt(W?.hmo_saturation_label??null):m,source:te}]));const I=t?.property?.epc?.floor_area_sqm??null,V=I!=null&&Number.isFinite(I)&&I>0,H=vH(I,e.postcode);r.push(...An("7. Indicative cost benchmarks",`Deterministic per-square-metre rates from the Scapely cost-benchmark engine. ${V?`Applied to the EPC-recorded floor area of ${bo(I)} sqm with a regional multiplier of ${H.multiplier.toFixed(2)} for the ${H.region} band.`:`The EPC floor area for this property is not yet available, so per-property build/fees/contingency totals cannot be calculated. Re-run the analysis from the dashboard to populate them. The benchmark rates and regional multiplier of ${H.multiplier.toFixed(2)} for the ${H.region} band are still shown for reference.`} These are budget-stage benchmarks, not a quote.`)),V?r.push({table:{headerRows:1,widths:[130,40,"*","*","*","*",100],body:[[{text:"Scenario",style:"th"},{text:"Floor (sqm)",style:"th",alignment:"right"},{text:"Build cost",style:"th",alignment:"right"},{text:"Fees (12%)",style:"th",alignment:"right"},{text:"Contingency (10%)",style:"th",alignment:"right"},{text:"Total",style:"th",alignment:"right"},{text:"Source",style:"th"}],...H.rows.map(ye=>[{text:ye.label,style:"td"},{text:bo(ye.basisFloor),style:"tdValue",alignment:"right"},{text:ai(ye.base),style:"tdValue",alignment:"right"},{text:ai(ye.fees),style:"tdValue",alignment:"right"},{text:ai(ye.contingency),style:"tdValue",alignment:"right"},{text:ai(ye.total),style:"tdValueBold",alignment:"right"},{text:`Scapely benchmark calculator (April 2026 rates) × ${H.multiplier.toFixed(2)} ${H.region} multiplier; fees 12%, contingency 10%`,style:"tdSource"}])]},layout:{hLineColor:()=>Fo,vLineColor:()=>
284Fo,hLineWidth:ye=>ye===0||ye===1?.6:.4,vLineWidth:()=>0,paddingTop:()=>6,paddingBottom:()=>6,paddingLeft:()=>0,paddingRight:()=>8},margin:[0,0,0,6]}):r.push(Yn(mN.map(ye=>({field:ye.label,value:m,source:"Awaiting EPC floor area before per-property totals can be calculated"})))),r.push({text:"Reference rates: refurbishment £1,200/sqm; single-storey extension £2,400/sqm on a 25 sqm footprint; new-build replacement £2,800/sqm; Class E conversion £1,500/sqm. Regional bands: London & South-East 1.25×, Midlands 1.00×, North & Wales 0.95×. These are Scapely-published budget benchmarks and not contractor quotes.",style:"footnote",margin:[0,0,0,4]});const se=t?.appraisal?.planning_risk_assessment,R=!!se,Q=ye=>R?ye:m,oe="Scapely AI appraisal — LLM interpretation of the heritage / Article 4 / policy signals collected above";r.push(...An("8. Planning risk assessment","An AI-derived view of the likely planning outcome, drawing on the heritage, conservation, Article 4 and policy signals collected for this property. This is an LLM interpretation of the data above, not a planning consultant's opinion.")),r.push(Yn([{field:"Overall risk level",value:Q(Lt(se?.overall_risk_level??null)),source:oe},{field:"Gateway status",value:Q(Lt(se?.gateway_status??null)),source:oe},{field:"Key objection themes",value:R?se?.key_objection_themes&&se.key_objection_themes.length>0?se.key_objection_themes.join("; "):"None identified by the AI appraisal":m,source:oe},{field:"Fire-safety warning",value:Q(Lt(se?.fire_safety_warning??null)),source:oe}])),se?.executive_summary&&(r.push({text:"Executive summary",style:"h3",margin:[0,6,0,4]}),r.push({text:se.executive_summary,style:"body",margin:[0,0,0,4]}),r.push({text:"Source: Scapely AI appraisal.",style:"footnote",margin:[0,0,0,4]}));const ne=t?.enterprise_data,le=!!ne,fe=ye=>le?ye:m;r.push(...An("9. Commercial intelligence","Cross-cutting policy checks. Several of these are heuristic estimates because no official per-postcode API exists — each row's source explains exactly how the value was derived. Always verify with the relevant authority before committing.")),r.push(Yn([{field:"Class MA eligible",value:fe(Hu(ne?.class_ma_eligible??null)),source:"Scapely heuristic — combines listed-building checks and Class-MA-specific Article 4 directions from planning.data.gov.uk against GPDO Class MA criteria. Not a determination."},{field:"Class MA note",value:fe(Lt(ne?.class_ma_note??null)),source:"Scapely interpretation of the same data"},{field:"CIL zone (band hint)",value:fe(Lt(ne?.cil_zone??null)),source:"Scapely heuristic — no per-postcode CIL API exists; band A–D is a stable hint generated from the postcode. Verify against your LPA's CIL charging schedule."},{field:"CIL charge per sqm (estimate)",value:fe(ai(ne?.cil_charge_per_sqm_gbp??null)),source:"Scapely estimate — ballpark figure for the band hint above. Not an LPA quote."},{field:"MEES 2027 warning",value:fe(Hu(ne?.mees_2027_warning??null)),source:"Derived directly from the current EPC band (D / E / F / G triggers warning) — EPC Open Data Communities"},{field:"MEES 2027 note",value:fe(Lt(ne?.mees_2027_note??null)),source:"Scapely interpretation against MEES Regulations 2018 (proposed C minimum from 2028)"},{field:"Biodiversity Net Gain risk",value:fe(Lt(ne?.bng_risk_level??null)),source:"Scapely heuristic — based on Tree Preservation Zones / Conservation Area presence at the site (planning.data.gov.uk). Not a BNG metric calculation."},{field:"BNG note",value:fe(Lt(ne?.bng_note??null)),source:"Scapely interpretation against Environment Act 2021 BNG provisions"},{field:"Indicative business rates (per year)",value:fe(ai(ne?.business_rate_estimate_gbp_yr??null)),source:"Scapely estimate — EPC floor area × regional £/sqm band. Not a VOA rateable-value lookup."}]));const he=t?.appraisal?.recommendation,Ne=!!he,J=ye=>Ne?ye:m,ue="Scapely AI appraisal — LLM recommendation, not professional advice";return r.push(...An("10. Recommendation","Scapely's headline take on the most appropriate scheme given everything above. This is an LLM-generated suggestion intended as a starting point for discussion 
284with a qualified surveyor or planning consultant — not a substitute for one.")),r.push(Yn([{field:"Recommended project type",value:J(Lt(he?.recommended_project_type??null)),source:ue},{field:"Maximum units",value:J(bo(he?.max_units??null)),source:ue},{field:"EPC upgrade required",value:J(Hu(he?.epc_upgrade_required??null)),source:ue}])),r.push(...An("Notes & disclaimers","All figures are indicative. Scapely is not a substitute for advice from a qualified surveyor, planning consultant or solicitor. Public-record fields are reproduced verbatim from their stated sources and may lag the source register; please verify any figure that is material to your decision.")),r.push({text:`Report generated ${m0(s.toISOString())} from Scapely watchlist record ${e.id}.`,style:"footnote",margin:[0,0,0,4]}),r}async function Kg(e){const{default:t}=await O3(async()=>{const{default:j}=await import("./pdfmake-jJU2yA97.js").then(k=>k.p);return{default:j}},[]),s=await O3(()=>import("./vfs_fonts-AT1S0rDj.js").then(j=>j.v),[]),r=await wH(),o=s,c=j=>!j||typeof j!="object"?!1:Object.keys(j).some(k=>k.endsWith(".ttf")),d=o.default,h=d&&typeof d=="object"?d:null,p=o.pdfMake?.vfs??o.vfs??h?.pdfMake?.vfs??h?.vfs??(c(d)?d:null)??(c(o)?o:null),f=t;p&&(typeof f.addVirtualFileSystem=="function"?f.addVirtualFileSystem(p):f.vfs=p);const m=new Date,x={pageSize:"A4",pageOrientation:"portrait",pageMargins:[40,60,40,70],info:{title:`Scapely property report — ${e.address_line}`,author:"Scapely",subject:"Property due-diligence report",creator:"Scapely"},defaultStyle:{font:"Roboto",fontSize:10,color:yo,lineHeight:1.35},header:()=>({margin:[40,24,40,0],stack:[{columns:[{text:"Property report",style:"headerText",alignment:"left"},{text:`Generated ${yH(m.toISOString())}  |  scapely.io`,style:"headerText",alignment:"right"}]},{canvas:[{type:"line",x1:0,y1:6,x2:515,y2:6,lineWidth:.6,lineColor:Fo}]}]}),footer:(j,k)=>({margin:[40,16,40,0],columns:[r?{image:r,width:83,alignment:"left",margin:[0,4,0,0]}:{text:"SCAPELY",style:"footerLogo",alignment:"left"},{text:`Page ${j} of ${k}`,style:"footerText",alignment:"right",margin:[0,4,0,0]}]}),content:jH(e),styles:{h1:{fontSize:20,bold:!0,color:Uu},h2:{fontSize:13,bold:!0,color:Uu},h3:{fontSize:11,bold:!0,color:Uu},subtitle:{fontSize:12,color:yo},muted:{fontSize:9.5,color:ni},intro:{fontSize:9.5,color:ni,italics:!1},body:{fontSize:10,color:yo},th:{fontSize:8.5,bold:!0,color:ni,characterSpacing:.4},td:{fontSize:9.5,color:yo},tdValue:{fontSize:9.5,color:yo,bold:!1},tdValueBold:{fontSize:10,color:yo,bold:!0},tdSource:{fontSize:8.5,color:ni,italics:!0},footnote:{fontSize:8.5,color:ni,italics:!0},headerText:{fontSize:8.5,color:ni,characterSpacing:.3},footerLogo:{fontSize:10,bold:!0,color:Uu,characterSpacing:1.5},footerText:{fontSize:8.5,color:ni}}},v=`scapely-report-${e.address_line.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||e.id}.pdf`;t.createPdf(x).download(v)}const kH={A:{bg:"#19b459",fg:"text-white"},B:{bg:"#8dce46",fg:"text-white"},C:{bg:"#c9d200",fg:"text-slate-900"},D:{bg:"#ffd500",fg:"text-slate-900"},E:{bg:"#fcaa65",fg:"text-slate-900"},F:{bg:"#ef8023",fg:"text-white"},G:{bg:"#e9153b",fg:"text-white"}};function _H(e){return!!e&&/^[A-G]$/.test(e)}function L3({rating:e,pulse:t=!1,testId:s}){const r=_H(e)?kH[e]:null;return n.jsx(Se.div,{animate:t?{boxShadow:["0 0 0px 0px rgba(34, 211, 238, 0)","0 0 15px 2px rgba(34, 211, 238, 0.3)","0 0 0px 0px rgba(34, 211, 238, 0)"]}:void 0,transition:t?{duration:3,repeat:1/0,ease:"easeInOut"}:void 0,className:`flex h-12 w-12 items-center justify-center rounded-md text-2xl font-bold ${r?r.fg:"text-slate-600 dark:text-slate-400"}`,style:{background:r?r.bg:"rgba(255,255,255,0.05)",border:r?"none":"1px solid rgba(255,255,255,0.1)"},"data-testid":s,children:e??"—"})}function ri({id:e,number:t,title:s,description:r,children:o}){return n.jsxs("div",{id:`property-section-${e}`,"data-section-id":e,className:"scroll-mt-5 flex flex-col gap-6 py-8 sm:py-12 lg:flex-row lg:gap-14",children:[n.jsx("div",{className:"flex-none lg:w-[220px] xl:w-[260px]",children:n.jsxs("div",{className:"lg:sticky lg:top-[68px]",children:[t!=null&&n.jsx("span",{className:`mb-2 block font-mono text-[10px] font-bold uppercase tracking-[0.14em] ${Eh[t??1]??Eh[1]}`,children:String(t).padStart(2,"0")}),n.jsx("h2",{className:`text-[20px] font-medium leading-snug ${Th[t??1]??Th[1]}`,children:s}),n.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-slate-500 dark:text-slate-400",children:r})]})}),n.jsx("div",{className:"min-w-0 flex-1 space-y-4",children:o})]})}function D3({children:e}){return n.jsx("section",{className:"space-y-4",children:e})}function x0({label:e,value:t,valueClass:s="text-slate-900 dark:text-white font-mono"}){return n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-slate-600 dar
284k:text-slate-400",children:e}),n.jsx("span",{className:s,children:t})]})}function SH({title:e,accent:t,muted:s=!1,children:r}){return n.jsx(Xs,{accent:t,title:e,muted:s,children:n.jsx("div",{className:"space-y-3.5",children:r})})}const y0=[{id:"overview",label:"Overview & quick stats",icon:fx},{id:"sales",label:"Sale history & comparables",icon:Jo},{id:"fundamentals",label:"Heritage & tenure",icon:wk},{id:"epc-uplift",label:"EPC uplift",icon:kn},{id:"developer",label:"Build cost & planning risk",icon:Zo},{id:"site",label:"Plot intelligence",icon:Xo},{id:"commercial",label:"Business / commercial",icon:Wh}],NH={overview:"Overview",sales:"Sales",fundamentals:"Heritage","epc-uplift":"EPC uplift",developer:"Build & planning",site:"Plot",commercial:"Ownership"},Js={postcode:"SW10 9BW",latitude:51.488158,longitude:-.190763},CH=[{date:"2019-04-12",price_gbp:185e4,paon:"24",saon:null,street:"Coleherne Road",postcode:Js.postcode,property_type:"T",new_build:!1,estate_type:"F",category:"A",is_subject_property:!0},{date:"2011-07-06",price_gbp:142e4,paon:"24",saon:null,street:"Coleherne Road",postcode:Js.postcode,property_type:"T",new_build:!1,estate_type:"F",category:"A",is_subject_property:!0}],EH=[{date:"2024-02-08",price_gbp:1975e3,paon:"18",saon:null,street:"Coleherne Road",postcode:Js.postcode,property_type:"T",new_build:!1,estate_type:"F",category:"A",is_subject_property:!1},{date:"2022-09-14",price_gbp:169e4,paon:"31",saon:null,street:"Coleherne Road",postcode:Js.postcode,property_type:"T",new_build:!1,estate_type:"F",category:"A",is_subject_property:!1},{date:"2021-11-03",price_gbp:1545e3,paon:"9",saon:null,street:"Coleherne Road",postcode:Js.postcode,property_type:"T",new_build:!1,estate_type:"F",category:"A",is_subject_property:!1}],TH=[{class_id:"c3-to-c4-hmo",name:"C3 to C4 HMO Conversion",gpdo_reference:"Part 3, Class L",status:"restricted",headline:"Article 4 direction in force — prior approval required rather than automatic PD right.",reasons:["RBKC Article 4 Direction (Earl's Court & World's End) removes Class L PD rights in this ward.","Prior approval application required — determination within 56 days."],notes:[]},{class_id:"part1-class-a",name:"Rear Extension",gpdo_reference:"Part 1, Class A",status:"restricted",headline:"Extensions up to 3m (terraced) permitted in principle, subject to Conservation Area materials criteria.",reasons:["Conservation Area: materials must match original Victorian stock — brick and lime render.","Any extension taller than the eaves or covering more than 50% of curtilage requires full planning consent."],notes:["
284Submit pre-application advice to RBKC planning before proceeding."]},{class_id:"part1-class-aa",name:"Additional Storey",gpdo_reference:"Part 1, Class AA",status:"prohibited",headline:"Additional storey via PD is not available within a Conservation Area.",reasons:["Class AA rights do not apply to properties within designated Conservation Areas.","Full planning consent required — RBKC policy is strongly restrictive on upward extensions within Chelsea Conservation Areas."],notes:[]}],AH={permitted:{dot:"bg-emerald-400",label:"Available",border:"border-emerald-300/25",bg:"bg-emerald-300/5",text:"text-emerald-700 dark:text-emerald-200"},restricted:{dot:"bg-amber-400",label:"Restricted",border:"border-amber-300/25",bg:"bg-amber-300/5",text:"text-amber-700 dark:text-amber-100"},prohibited:{dot:"bg-rose-400",label:"Not available",border:"border-rose-300/25",bg:"bg-rose-300/5",text:"text-rose-700 dark:text-rose-100"}},RH={id:"demo-24-coleherne-road",address_line:"24 Coleherne Road",postcode:Js.postcode,local_authority:"Royal Borough of Kensington and Chelsea",latitude:Js.latitude,longitude:Js.longitude,source:"demo",source_url:null,last_total_cost:182400,last_risk_level:"Medium",last_refreshed_at:new Date().toISOString(),created_at:new Date().toISOString(),last_appraisal:{property:{postcode:Js.postcode,address_line:"24 Coleherne Road",local_authority:"Royal Borough of Kensington and Chelsea",epc:{current:"E",potential:"C",current_sap_score:48,potential_sap_score:79,floor_area_sqm:152},planning_gateway:{conservation_areas:["Chelsea Conservation Area"],listed_buildings:[],active_article_4_directions:["RBKC Article 4 Direction — Earl's Court & World's End (HMO)"]},free_metrics:{flood_risk_zone:1,flood_risk_label:"Zone 1 — Low",heritage_status:"Conservation Area",is_listed:!1}},pro_data:{hmo_saturation_pct:14,hmo_saturation_label:"Moderate",ptal_score:"6a",ptal_label:"Excellent",epc_uplift:{estimated_retrofit_cost_gbp:22400,estimated_value_uplift_pct:6.5}},enterprise_data:{class_ma_eligible:!1,class_ma_note:"Residential use (C3) — Class MA applies to commercial Class E only.",cil_zone:"3",cil_charge_per_sqm_gbp:125,mees_2027_warning:!0,mees_2027_note:"EPC E is below the proposed 2027 MEES minimum (EPC C). Upgrading required to continue letting post-2027.",bng_risk_level:"Low",bng_note:"Existing residential — negligible BNG obligation unless adding new footprint.",business_rate_estimate_gbp_yr:null},appraisal:{financial_appraisal:{total_estimated_cost:182400,base_construction_cost:145200,professional_fees:17424,contingency_buffer:19776,confidence_score:72},planning_risk_assessment:{overall_risk_level:"Medium",gateway_status:"Gateway 1 — Low BSA risk",key_objection_themes:["Conservation Area character","Article 4 — HMO restrictions","Neighbour amenity impact","Heritage materials policy"],executive_summary:"Conservation Area and Article 4 restrictions materially limit the permitted development options for this property. Extensions and alterations require full planning consent; the council's SPD on residential extensions applies strict height and materials criteria.",fire_safety_warning:void 0},recommendation:{recommended_project_type:"Full refurbishment — 4-bed HMO (prior approval route)",max_units:1,epc_upgrade_required:!0}}}},OH={price_basis:{source_note:"Based on last HM Land Registry sale — £1,850,000 (Apr 2019). Current market estimate circa £1.95m–£2.05m based on comparables."},headline:"A high-value Chelsea terrace with strong long-hold and HMO income potential. Conservation Area constraints limit extension and PD options, but PTAL 6a and EPC upgrade headroom make refurbishment and regulated HMO conversion the most compelling near-term play.",overall_verdict:"Buy",overall_score_0_100:67,recommendation:{best_strategy_key:"hmo",rationale:"Prior-approval HMO conversion (C3→C4, 4 beds) offers the strongest risk-adjusted yield in this postcode. PTAL 6a supports premium room rents; EPC E→C upgrade adds compliance insurance post-2027. Article 4 requires prior approval rather than automatic PD, adding 56-day determination time but not blocking the route. Walk away if acquisition exceeds £2.05m.",walk_away_threshold_gbp:205e4,stretch_thoughts:"A full planning application for a rear single-storey extension (up to 3m under CA criteria) could add a utility/bedroom, lifting rental yield further. Subject to RBKC SPD approval — budget 12 months for c
284onsent."},data_caveats:["Purchase price based on Apr 2019 Land Registry transaction. Current asking price not confirmed — verify before proceeding.","HMO yield assumes 4 rooms at £1,050pcm average (SW10 comparable). Room rents are subject to licensing, HHSRS, and Article 4 prior approval.","EPC retrofit cost (£22,400) is an indicative mid-range estimate — obtain specialist quotes before committing.","CIL liability applies if new floorspace is created. RBKC Zone 3 — £125/sqm heuristic; verify current charging schedule."],strategies:[{key:"flip",label:"Flip",verdict:"Marginal",headline:"Refurbish to high spec and sell. Thin margin at entry price given Chelsea land values and stamp duty costs.",economics:{acquisition_cost_gbp:1942500,works_cost_gbp:182400,finance_cost_gbp:58200,total_capital_in_gbp:2183100,exit_or_annual_gbp:23e5,profit_or_net_yield:"£116,900 (5.4% on capital)",timeline_months:14},pros:["Proven Chelsea market — comparable sales at £1.92m–£1.98m in 2024.","EPC C upgrade adds ~6.5% to sale value (Knight Frank greener-homes premium).","Clean exit — no ongoing management burden."],cons:["SDLT at entry (£1.85m) = £138,750 — significantly erodes margin.","No permitted development for extension — Conservation Area limits upside.","14-month tie-up with bridging finance costs."],key_risks:["Chelsea prime market softening — any correction >5% wipes the margin.","Refurbishment cost overrun in Victorian solid-wall construction.","Holding cost escalation if sale takes >4 months post-completion."],assumptions:["Acquisition at last sale price (£1.85m) + SDLT + legal = £1.9425m all-in.","Works: full refurbishment at £1,200/sqm × 152 sqm × 1.25 (London) = £228k base; modelled at £182,400 for light-touch (kitchens, bathrooms, décor).","Bridging finance at 0.75%/month on 70% LTV for 14 months.","Exit at £2.3m — in line with 2024 comparables for fully refurbished 4-bed Chelsea terrace."]},{key:"btl",label:"Buy-to-Let",verdict:"Viable",headline:"Single-let as a 4-bed family home. Solid yield in a high-demand rental postcode; works well with EPC upgrade.",economics:{acquisition_cost_gbp:1942500,works_cost_gbp:52e3,finance_cost_gbp:0,total_capital_in_gbp:1994500,exit_or_annual_gbp:72e3,profit_or_net_yield:"3.6% gross yield",timeline_months:12},pros:["PTAL 6a — premium family rental demand, very low void risk.","EPC E→C upgrade satisfies 2027 MEES, protecting asset for long-term letting.","Simple single-let structure — lower licensing burden than HMO."],cons:["3.6% gross yield is below SW10 average for comparable capital outlay.","EPC upgrade (£22,400) required before 2027 to remain lettable.","High land value means yield compression vs. alternative strategies."],key_risks:["Rental regulation changes — renters reform bill may restrict rent increases.","Section 21 abolition increases void risk on tenant turnover."],assumptions:["Rental income: £6,000pcm (£72,000/yr) — conservative for SW10 4-bed.","Light refurbishment only: £52,000 (bathrooms, kitchen, EPC works).","No bridging finance — assumes cash or standard BTL mortgage."]},{key:"hmo",label:"HMO",verdict:"Strong",headline:"4-bed HMO via C3→C4 prior approval. Best yield and fastest payback — Article 4 adds process, not a blocker.",economics:{acquisition_cost_gbp:1942500,works_cost_gbp:95e3,finance_cost_gbp:0,total_capital_in_gbp:2037500,exit_or_annual_gbp:50400,profit_or_net_yield:"5.4% gross yield (4 rooms @ £1,050pcm)",timeline_months:9},pros:["5.4% gross yield — strongest of all five strategies at this price point.","PTAL 6a drives premium room rents; SW10 professional demand is robust.","Article 4 direction requires prior approval (not full planning) — 56-day determination, no design constraints.","EPC upgrade to C protects 2027 MEES compliance for all rooms."],cons:["HMO licensing required (RBKC mandatory licensing, £1,380/5yr).","Higher management overhead vs. single-let.","C3→C4 prior approval adds 56 days before works can commence."],key_risks:["Prior approval refusal — low risk for a 4-bed (below mandatory HMO threshold of 5+), but RBKC may impose conditions.","Room rent softening if professional demand dips post-2026."],assumptions:["4 rooms at £1,050pcm average (SW10 professional sharers market, Q1 2026 data).","Works: refurbishment + room fit-out + EPC works + licensing compliance = £95,000.","Prior approval via RBKC — 56-day determination, budgeted at £206 fee."]},{key:"redevelop",label:"Redevelop",verdict:"Marginal",headline:"Full redevelopment blocked by Conservation Area — only extensions feasible, and those need full planning consent.",economics:{acquisition_cost_gbp:1942500,works_cost_gbp:426e3,finance_cost_gbp:92400,total_capital_in_gbp:2460900,exit_or_annual_gbp:265e4,profit_or_net_yield:"£189,100 (7.7% on capital)",timeline_months:28},pros:["Rear single-storey extension (up to 3m, subject to CA approval) could add ~25 sqm.","Post-extension GDV materially stronger — comparable 177 sqm properties achieving £2.6m+."],cons:["Full planning consent required — RBKC track record very restrictive on extensions in Chelsea CAs.","28-month programme including 12-month planning and 16-month build.","Class AA (additional storey) entirely blocked in Conservation Area."],key_risks:["Planning refusal — no PD fallback in CA; high cost of abortive fees (£40k–£60k).","RBKC heritage materials requirement adds significant cost premium.","28-month capital tie-up with bridging."],assumptions:["Single-storey rear extension only — no additional storeys.","Full planning process including pre-app advice and heritage assessment.","Build cost: refurbishment + extension at blended £2,100/sqm × 177 sqm effective."]},{key:"hold",label:"Hold",verdict:"Viable",headline:"Long-hold in prime Chelsea — strong capital appreciation track record. Rational strategy if acquisition is below market.",economics:{acquisition_cost_gbp:1942500,works_cost_gbp:22400,finance_cost_gbp:0,total_capital_in_gbp:1964900,exit_or_annual_gbp:245e4,profit_or_net_yield:"£485,100 over 5 years (24.7%)",timeline_months:60},pros:["SW10 prime land scarcity — Chelsea terraces have compounded at 4–6%/yr over 10 years.","EPC upgrade (£22,400) is the only near-term capital commitment.","No planning, no licensing, no management complexity."],cons:["5-year illiquidity — capital tied up while alternatives compound.","No income during hold (assumes vacant/lightly tenanted).","Market-risk exposure across a full cycle."],key_risks:["Prime London underperformance relative to national market.","Interest rate environment if leveraged."],assumptions:["5% pa capital appreciation — conservative vs. historical Chelsea average.","EPC upgrade costs incurred in year 1 to protect lettability and value.","No income during hold period — 
284clean hold scenario."]}]},PH={flip:"amber",btl:"cyan",redevelop:"violet",hold:"sky",hmo:"emerald"},B3={Strong:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-200 border-emerald-400/30",Viable:"bg-cyan-500/15 text-cyan-700 dark:text-cyan-200 border-cyan-400/30",Marginal:"bg-amber-500/15 text-amber-700 dark:text-amber-200 border-amber-400/30",Avoid:"bg-rose-500/15 text-rose-700 dark:text-rose-200 border-rose-400/30"},MH={"Strong Buy":"bg-emerald-500/15 text-emerald-700 dark:text-emerald-200 border-emerald-400/30",Buy:"bg-cyan-500/15 text-cyan-700 dark:text-cyan-200 border-cyan-400/30",Marginal:"bg-amber-500/15 text-amber-700 dark:text-amber-200 border-amber-400/30",Avoid:"bg-rose-500/15 text-rose-700 dark:text-rose-200 border-rose-400/30"};function Eo(e){return e==null||!Number.isFinite(e)?"—":`£${Math.round(e).toLocaleString("en-GB")}`}function vo({label:e,value:t,accent:s}){return n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-slate-500",children:e}),n.jsx("div",{className:`mt-0.5 text-[13px] font-medium ${s??"text-slate-900 dark:text-white"}`,children:t})]})}function b0({icon:e,title:t,items:s}){return!s||s.length===0?null:n.jsxs("div",{className:"mt-3",children:[n.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:[e,t]}),n.jsx("ul",{className:"space-y-1 text-[13px] text-slate-700 dark:text-slate-300",children:s.map((r,o)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-1.5 inline-block h-1 w-1 flex-none rounded-full bg-slate-500"}),n.jsx("span",{children:r})]},o))})]})}function LH({s:e}){const t=PH[e.key]??"cyan",s=B3[e.verdict]??B3.Marginal,r={amber:"text-amber-700 dark:text-amber-400",cyan:"text-cyan-700 dark:text-cyan-400",violet:"text-violet-700 dark:text-violet-400",sky:"text-sky-700 dark:text-sky-400",emerald:"text-emerald-700 dark:text-emerald-400"},o={amber:"text-amber-700 dark:text-amber-200",cyan:"text-cyan-700 dark:text-cyan-200",violet:"text-violet-700 dark:text-violet-200",sky:"text-sky-700 dark:text-sky-200",emerald:"text-emerald-700 dark:text-emerald-200"},c=e.economics;return n.jsxs("div",{className:`${ws} p-5`,children:[n.jsx(js,{}),n.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("div",{className:`font-mono text-[10px] font-bold uppercase tracking-wider ${r[t]??""}`,children:e.label}),n.jsx("p",{className:"mt-1 text-[14px] leading-snug text-slate-800 dark:text-slate-200",children:e.headline})]}),n.jsx("span",{className:`inline-flex flex-none items-center rounded-md border px-2 py-1 text-[11px] font-semibold ${s}`,children:e.verdict})]}),n.jsxs("div",{className:"mb-4 grid grid-cols-2 gap-x-4 gap-y-2 rounded-md border border-slate-200 bg-slate-100 p-3 text-[12px] dark:border-white/10 dark:bg-white/[0.02]",children:[n.jsx(vo,{label:"Acquisition",value:Eo(c.acquisition_cost_gbp)}),n.jsx(vo,{label:"Works",value:Eo(c.works_cost_gbp)}),n.jsx(vo,{label:"Finance",value:Eo(c.finance_cost_gbp)}),n.jsx(vo,{label:"Total capital in",value:Eo(c.total_capital_in_gbp),accent:o[t]}),n.jsx(vo,{label:"Exit / annual",value:Eo(c.exit_or_annual_gbp)}),n.jsx(vo,{label:"Timeline",value:`${c.timeline_months} mo`}),n.jsxs("div",{className:"col-span-2 mt-1 border-t border-slate-200 pt-2 dark:border-white/10",children:[n.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-slate-500",children:"Profit / yield"}),n.jsx("div",{className:`mt-0.5 text-[13px] font-semibold ${o[t]??""}`,children:c.profit_or_net_yield})]})]}),n.jsx(b0,{icon:n.jsx(Tr,{className:"h-3 w-3 text-emerald-700 dark:text-emerald-300"}),title:"Pros",items:e.pros}),n.jsx(b0,{icon:n.jsx(gx,{className:"h-3 w-3 text-rose-700 dark:text-rose-300"}),title:"Cons",items:e.cons}),n.jsx(b0,{icon:n.jsx(el,{className:"h-3 w-3 text-amber-700 dark:text-amber-300"}),title:"Key risks",items:e.key_risks}),e.assumptions.length>0&&n.jsxs("details",{className:"mt-3 text-[12px] text-slate-500",children:[n.jsxs("summary",{className:"cursor-pointer font-mono text-[10px] uppercase tracking-wider text-slate-500 hover:text-slate-700 dark:hover:text-slate-300",children:["Assumptions (",e.assumptions.length,")"]}),n.jsx("ul",{className:"mt-2 space-y-1",children:e.assumptions.map((d,h)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-1 inline-block h-1 w-1 flex-none rounded-full bg-slate-600"}),n.jsx("span",{children:d})]},h))})]})]})}function DH(){const e=OH;return n.jsxs("div",{className:"mx-auto w-full max-w-5xl px-4 py-6 sm:px-8 lg:max-w-6xl xl:max-w-[1400px] 2xl:max-w-[1600px]",children:[n.jsxs("header",{className:"mb-5",children:[n.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[n.jsx($o,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),n.jsx("h2",{className:"text-[15px] font-semibold text-emerald-600 dark:text-emerald-400",children:"Investment view"})]}
284),n.jsx("p",{className:"text-[13px] text-slate-600 dark:text-slate-400",children:"Strategy stress-test across five exit options — flip, buy-to-let, HMO, redevelop, and hold — based on last sale price."})]}),n.jsxs("div",{className:`${ws} mb-6 p-6`,children:[n.jsx(js,{}),n.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[n.jsxs("div",{className:"max-w-prose",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-1.5 font-mono text-[10px] font-bold uppercase tracking-wider text-cyan-700 dark:text-cyan-300",children:[n.jsx(na,{className:"h-3 w-3"}),"Verdict"]}),n.jsx("p",{className:"text-[15px] leading-relaxed text-slate-800 dark:text-slate-200",children:e.headline}),n.jsx("p",{className:"mt-3 text-[12px] text-slate-500",children:e.price_basis.source_note})]}),n.jsxs("div",{className:"flex flex-col items-start gap-2 sm:items-end",children:[n.jsx("span",{className:`inline-flex items-center rounded-md border px-3 py-1.5 text-[13px] font-semibold ${MH[e.overall_verdict]}`,children:e.overall_verdict}),n.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:["Score ",e.overall_score_0_100,"/100"]})]})]})]}),n.jsx(Xs,{accent:"rose",icon:n.jsx(an,{className:"h-3 w-3"}),title:"Recommendation",children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Best strategy"}),n.jsx("div",{className:"mt-1 text-[14px] font-semibold text-slate-900 dark:text-white",children:e.strategies.find(t=>t.key===e.recommendation.best_strategy_key)?.label??e.recommendation.best_strategy_key})]}),n.jsx("p",{className:"text-[14px] leading-relaxed text-slate-700 dark:text-slate-300",children:e.recommendation.rationale}),n.jsxs("div",{className:"grid gap-3 border-t border-slate-200 pt-3 dark:border-white/10 sm:grid-cols-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Walk-away threshold"}),n.jsx("div",{className:"mt-1 text-[14px] text-slate-900 dark:text-white",children:Eo(e.recommendation.walk_away_threshold_gbp)})]}),n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Stretch thoughts"}),n.jsx("div",{className:"mt-1 text-[13px] text-slate-700 dark:text-slate-300",children:e.recommendation.stretch_thoughts})]})]})]})}),n.jsx("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:e.strategies.map(t=>n.jsx(LH,{s:t},t.key))}),n.jsxs("div",{className:`${ws} mt-6 p-5`,children:[n.jsx(js,{}),n.jsxs("div",{className:"mb-2 flex items-center gap-2 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:[n.jsx(bx,{className:"h-3 w-3"})," Data caveats"]}),n.jsx("ul",{className:"space-y-1.5 text-[13px] text-slate-600 dark:text-slate-400",children:e.data_caveats.map((t,s)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-1 inline-block h-1 w-1 flex-none rounded-full bg-slate-500"}),n.jsx("span",{children:t})]},s))})]})]})}function BH(){const{theme:e}=Da(),{setTheme:t}=rl();return w.useEffect(()=>{t(e)},[e,t]),null}function IH(){const[e,t]=w.useState("overview"),[s,r]=w.useState("detail"),[o,c]=w.useState(!1),[d,h]=w.useState(null),[p,f]=w.useState(!1),m=w.useRef(null),x=w.useRef(!1);w.useEffect(()=>{x.current||(x.current=!0,oH())},[]),w.useEffect(()=>{const v=m.current;if(!v)return;const j=["overview","sales","fundamentals","epc-uplift","developer","site","commercial"],k=j.map(C=>document.getElementById(`property-section-${C}`)).filter(C=>C!==null);if(k.length===0)return;const S=new Set,N=new IntersectionObserver(C=>{for(const O of C){const P=O.target.getAttribute("data-section-id");P&&(O.isIntersecting?S.add(P):S.delete(P))}const E=j.find(O=>S.has(O));E&&t(E)},{root:v,rootMargin:"0px 0px -80% 0px",threshold:0});return k.forEach(C=>N.observe(C)),()=>N.disconnect()},[]),w.useEffect(()=>{const v="#property-section-";if(!window.location.hash.startsWith(v))return;const j=window.location.hash.slice(v.length);if(!y0.some(S=>S.id===j))return;const k=requestAnimationFrame(()=>{document.getElementById(`property-section-${j}`)?.scrollIntoView({block:"start"}),t(j)});return()=>cancelAnimationFrame(k)},[]);function y(v){document.getElementById(`property-section-${v}`)?.scrollIntoView({behavior:"smooth",block:"start"}),t(v)}return n.jsx(_S,{children:n.jsxs(zS,{defaultTheme:"light",children:[n.jsx(BH,{}),n.jsx(ps,{meta:iB()}),n.jsx("div",{className:"report-copy-contrast",children:n.jsx(GS,{primaryLink:{href:"/pricing",label:"Pricing",testId:"link-nav-pricing"}})}),n.jsxs("div",{className:"report-copy-contrast mt-16 flex h-[calc(100vh-4rem)] w-full flex-col overflow-hidden bg-slate-50 font-sans text-slate-800 selection:bg-cyan-300/30 selection:text-slate-900 dark:bg-[#06081c] dark:text-slate-200 dark:selection:text-white sm:mt-20 sm:h-[calc(100vh-5rem)]",children:[n.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[n.jsxs("nav",{"aria-label":"Property sections",className:"hidden w-16 flex-none flex-col items-center gap-1 border-r border-slate-200 bg-white/70 px-2 pb-4 pt-[2.25rem] dark:border-white/[0.06] dark:bg-[#070a20]/60 sm:pt-[2.875rem] md:flex",children:[n.jsx("a",{href:"/",title:"Scapely home","aria-label":"Scapely home",className:"mb-2 flex h-9 w-9 items-center justify-center rounded-xl transition hover:bg-slate-100 dar
284k:hover:bg-white/5",children:n.jsx("img",{src:zo,alt:"","aria-hidden":"true",className:"h-9 w-9 [filter:brightness(0)] dark:[filter:none]"})}),n.jsx("button",{type:"button",onClick:()=>{p||(f(!0),window.setTimeout(()=>f(!1),1400))},disabled:p,title:"Re-analyse sample property","aria-label":"Re-analyse sample property",className:"mb-2 flex h-10 w-10 items-center justify-center rounded-xl bg-cyan-400 text-slate-950 shadow-[0_0_16px_rgba(34,211,238,0.2)] transition hover:bg-cyan-300 disabled:cursor-not-allowed disabled:opacity-60","data-testid":"rail-reanalyze",children:p?n.jsx(Me,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}):n.jsx(sn,{className:"h-4 w-4","aria-hidden":"true"})}),n.jsx("a",{href:"/",title:"Back to home","aria-label":"Back to home",className:"mb-2 flex h-10 w-10 items-center justify-center rounded-xl text-slate-600 transition hover:bg-slate-100 hover:text-cyan-800 dark:text-slate-400 dark:hover:bg-white/5 dark:hover:text-cyan-200",children:n.jsx(_r,{className:"h-4 w-4","aria-hidden":"true"})}),n.jsx("div",{className:"my-1 h-px w-8 bg-slate-200 dark:bg-white/10","aria-hidden":"true"}),y0.map(({id:v,label:j,icon:k})=>{const S=e===v&&s==="detail";return n.jsx("button",{type:"button",onClick:()=>{r("detail"),y(v)},title:j,"aria-label":j,"aria-pressed":S,className:`relative flex h-10 w-10 items-center justify-center rounded-xl transition ${S?"bg-cyan-400/10 text-cyan-700 shadow-[inset_0_0_18px_rgba(34,211,238,0.15)] dark:text-cyan-200":"text-slate-500 hover:bg-slate-100 hover:text-slate-800 dark:hover:bg-white/5 dark:hover:text-slate-200"}`,children:n.jsx(k,{className:"h-4 w-4","aria-hidden":"true"})},v)}),n.jsx("button",{type:"button",onClick:()=>r(v=>v==="investment"?"detail":"investment"),title:"Investment view","aria-label":"Investment view","aria-pressed":s==="investment",className:`relative mt-1 flex h-10 w-10 items-center justify-center rounded-xl transition ${s==="investment"?"bg-cyan-400/10 text-cyan-700 shadow-[inset_0_0_18px_rgba(34,211,238,0.15)] dark:text-cyan-200":"text-slate-500 hover:bg-slate-100 hover:text-cyan-800 dark:hover:bg-white/5 dark:hover:text-cyan-200"}`,children:n.jsx($o,{className:"h-4 w-4","aria-hidden":"true"})}),n.jsx("div",{className:"my-1 h-px w-8 bg-slate-200 dark:bg-white/10","aria-hidden":"true"}),n.jsx("div",{className:"my-1 h-px w-8 bg-slate-200 dark:bg-white/10","aria-hidden":"true"}),n.jsx("button",{type:"button",onClick:async()=>{if(!o){c(!0),h(null);try{await Kg(RH)}catch(v){h(v instanceof Error?v.message:"Could not generate report")}finally{c(!1)}}},disabled:o,title:o?"Building report…":"Download property report (PDF)","aria-label":"Download property report",className:"flex h-10 w-10 items-center justify-center rounded-xl text-slate-600 transition hover:bg-slate-100 hover:text-cyan-800 dark:text-slate-400 dark:hover:bg-white/5 dark:hover:text-cyan-200 disabled:cursor-not-allowed disabled:opacity-60",children:o?n.jsx(Me,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}):n.jsx(Kh,{className:"h-4 w-4","aria-hidden":"true"})}),d&&n.jsx("span",{className:"max-w-[3.25rem] text-center font-mono text-[9px] uppercase leading-tight tracking-wider text-rose-700 dark:text-rose-300",title:d,children:"Failed"})]}),n.jsxs("main",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-slate-50 dark:bg-[#06081c]",children:[n.jsx("div",{className:"sticky top-0 z-20 flex items-center gap-1.5 overflow-x-auto border-b border-slate-200 bg-slate-50/90 px-3 py-2 backdrop-blur-md dark:border-white/10 dark:bg-[#06081c]/90 md:hidden",children:y0.map(({id:v,icon:j})=>{const k=e===v;return n.jsxs("button",{type:"button",onClick:()=>y(v),className:`flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1.5 text-[12px] font-medium transition ${k?"border-cyan-300/40 bg-cyan-400/10 text-cyan-700 dark:text-cyan-200":"border-slate-200 bg-white text-slate-600 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-300"}`,children:[n.jsx(j,{className:"h-3 w-3","aria-hidden":"true"}),NH[v]]},v)})}),n.jsxs("div",{ref:m,className:"min-h-0 flex-1 overflow-y-auto",children:[s==="investment"&&n.jsx(DH,{}),n.jsxs("div",{className:s==="investment"?"hidden":"",children:[n.jsx("div",{className:"w-full",children:n.jsx(xy,{accent:"cyan",className:"min-h-[200px] w-full sm:min-h-[260px]",searching:p,dotExcludeZone:{minLeft:72,maxTop:85},children:n.jsx("div",{className:"relative mx-auto flex min-h-[200px] w-full max-w-5xl flex-col px-4 py-5 sm:min-h-[260px] sm:px-8 sm:py-6 lg:max-w-6xl xl:max-w-[1400px] 2xl:max-w-[1600px]",children:n.jsxs("div",{className:"flex items-start justify-end gap-2",children:[n.jsx(KS,{dimensions:rI}),n.jsxs("button",{type:"button",onClick:()=>{p||(f(!0),window.setTimeout(()=>f(!1),1400))},disabled:p,className:"inline-flex items-center gap-1.5 rounded-full border border-cyan-300/30 bg-cyan-300/[0.08] px-3 py-1.5 font-mono text-[12px] text-cyan-700 backdrop-blur transition hover:border-cyan-300/60 hover:bg-cyan-300/[0.14] hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-60 dark:text-cyan-100 dark:hover:text-white md:hidden","aria-label":"Re-analyse sample property",title:"Re-analyse sample property",children:[p?n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(sn,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:p?"Analysing…":"Re-analyse"})]})]})})})}),n.jsx("div",{className:"sticky top-0 z-20 w-full border-b border-slate-200/60 bg-slate-50/80 backdrop-blur-md dark:border-white/[0.06] dark:bg-[#06081c]/70",children:n.jsxs("div",{className:"mx-auto w-full max-w-5xl px-4 py-3 sm:px-8 lg:max-w-6xl xl:max-w-[1400px] 2xl:max-w-[1600px]",children:[n.jsx("h1",{className:"text-[14px] font-semibold tracking-tight text-slate-900 dark:text-white sm:text-[17px]",children:"24 Coleherne Road"}),n.jsx("div",{className:"mt-1.5 flex flex-wrap items-center gap-2",children:[Js.postcode,"Royal Borough of Kensington and Chelsea","Mid-Terrace House","6 rooms","152 sqm","Pre-1900"].map(v=>n.jsx("span",{className:"rounded-md border border-slate-900/20 px-2 py-0.5 font-mono text-[12px] text-slate-900 dark:border-white/20 dark:text-white",children:v},v))})]})}),n.jsxs("div",{className:"mx-auto w-full max-w-5xl divide-y divide-slate-300 px-4 py-4 dark:divide-white/[0.16] sm:px-8 lg:max-w-6xl xl:max-w-[1400px] 2xl:max-w-[1600px]",children:[n.jsx(ri,{id:"overview",number:1,title:"Quick stats",description:"Key indicators at a glance — EPC rating, transport access, HMO density and flood risk.",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(yr,{accent:"amber",icon:n.jsx(kn,{className:"h-3 w-3"}),title:"EPC Rating",illustration:n.jsx(IS,{}
284),value:n.jsx(Se.span,{animate:{opacity:[.7,1,.7]},transition:{duration:2.4,repeat:1/0,ease:"easeInOut"},className:"text-slate-900 dark:text-white",children:"E"}),blurb:"EPC band E (SAP 48) — below average energy efficiency. Significant improvement headroom to EPC C.",shortBlurb:"Below average — improvement headroom to C."}),n.jsx(yr,{accent:"white",icon:n.jsx(kx,{className:"h-3 w-3"}),title:"PTAL Score",illustration:n.jsx($S,{}),value:"6a",delay:.05,blurb:"PTAL 6a — highest connectivity band in TfL's Public Transport Accessibility Levels framework. Excellent public transport links.",shortBlurb:"Excellent — highest TfL connectivity band."}),n.jsx(yr,{accent:"violet",icon:n.jsx(bi,{className:"h-3 w-3"}),title:"HMO Density",illustration:n.jsx(US,{}),value:n.jsxs(n.Fragment,{children:["14",n.jsx("span",{className:"text-[14px] text-slate-500 dark:text-slate-300",children:"%"})]}),delay:.1,blurb:"14% HMO density — moderate. Article 4 direction in force restricting further HMO conversions in this ward.",shortBlurb:"Moderate density — Article 4 HMO restriction."}),n.jsx(yr,{accent:"sky",icon:n.jsx(yx,{className:"h-3 w-3"}),title:"Flood Risk",illustration:n.jsx(HS,{}),value:"Zone 1",delay:.15,blurb:"Environment Agency Flood Zone 1 — low probability of flooding (less than 1-in-1000-year annual probability).",shortBlurb:"Low probability — Zone 1."})]})}),n.jsx(ri,{id:"sales",number:2,title:"Sale history",description:"Registered transactions from HM Land Registry and nearby comparables to benchmark the asking price.",children:n.jsx(FS,{records:CH,matched_subject:!0,attribution:"HM Land Registry Price Paid Data — © Crown copyright and database rights 2024. Licence: OGL v3.0.",comparable_records:EH})}),n.jsx(ri,{id:"fundamentals",number:3,title:"Property fundamentals",description:"Heritage designations, tenure type, and neighbourhood deprivation — factors that shape planning consent and buyer appetite.",children:n.jsxs(D3,{children:[n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[n.jsx(nt,{accent:"cyan",title:"Deprivation",value:"Decile 7",tone:"default",note:"Above average — top 30% least deprived",explainer:"England's Index of Multiple Deprivation ranks every LSOA from 1 (most deprived) to 32,844. Decile 7 is in the top 30% least deprived neighbourhoods.",children:n.jsx(WS,{decile:7})}),n.jsxs(Se.div,{initial:{opacity:0,y:8},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{delay:.05,duration:.4},className:`${ws} p-4 sm:col-span-2`,children:[n.jsx(js,{}),n.jsxs("div",{className:"relative flex h-full flex-col",children:[n.jsx("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 font-mono text-[10px] font-bold uppercase tracking-wider text-cyan-700/90 dark:text-cyan-300/80",children:"Area Information"}),n.jsx("p",{className:"mt-3 text-[13px] leading-relaxed text-slate-700 dark:text-slate-300",children:"Kensington and Chelsea 012B — urban major conurbation, central London. IMD rank 24,388 of 32,844 (top 26% least deprived). The area is characterised by high-value Victorian terraced housing, strong rental demand, and conservation-led planning policy."}),n.jsx("div",{className:"mt-auto flex flex-wrap gap-2 pt-3",children:["Urban major conurbation","Kensington and Chelsea 012B","IMD rank 24,388 of 32,844"].map(v=>n.jsx("span",{className:"rounded-full border border-slate-900/20 px-2.5 py-0.5 font-mono text-[10px] text-slate-900 dark:border-white/20 dark:text-white",children:v},v))})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[n.jsx(nt,{accent:"cyan",title:"Heritage status",value:"Conservation Area",note:"Not listed — but alterations in RBKC Conservation Areas require full planning consent.",explainer:"Whether the property is listed or in a conservation area — designations that restrict alterations and can require extra planning consent."}),n.jsx(nt,{accent:"cyan",title:"Boundary issues",value:"None detected",tone:"good",note:"No registered boundary anomalies.",delay:.05,explainer:"Mismatches between the registered title boundary and the building's actual footprint."}),n.jsx(nt,{accent:"cyan",title:"Tenure",value:"Freehold",tone:"good",note:"Full ownership — no lease or ground rent liabilities.",delay:.1,explainer:"Whether the property is freehold (full ownership) or leasehold (ownership for a fixed term)."})]})]})}),n.jsx(ri,{id:"epc-uplift",number:4,title:"Energy performance",description:"Current EPC rating and the estimated cost and uplift potential of upgrading before selling or letting.",children:n.jsxs(Xs,{accent:"amber",title:"EPC uplift potential",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx("div",{className:"mb-1 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Current"}),n.jsx(L3,{rating:"E",testId:"badge-epc-current"})]}),n.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[n.jsxs("div",{className:"mb-1 flex flex-col items-center leading-none",children:[n.jsx("div",{className:"mb-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Headroom"}),n.jsx("div",{className:"text-base font-semibold text-emerald-700 dark:text-emerald-200",children:"+2 bands"})]}),n.jsx("div",{className:"relative h-2 w-full overflow-hidden rounded-full bg-slate-200 dark:bg-slate-800",children:n.jsx(Se.div,{initial:{width:0},whileInView:{width:"60%"},viewport:{once:!0,margin:"-60px"},transition:{duration:1.5,ease:[.25,1,.5,1],delay:.2},className:"absolute inset-y-0 left-0 bg-gradient-to-r from-[#ffd500] via-[#8dce46] to-[#19b459]"})})]}),n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx("div",{className:"mb-1 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Potential"}),n.jsx(L3,{rating:"C",pulse:!0,testId:"badge-epc-potential"})]})]}),n.jsxs("div",{className:"mt-3 text-[13px] leading-relaxed text-slate-600 dar
284k:text-slate-400",children:["Currently rated EPC"," ",n.jsx("strong",{className:"text-amber-600 dark:text-amber-400",children:"E"})," ","— below the proposed 2027 MEES minimum (EPC C) for let homes. The modelled works bring the property to EPC"," ",n.jsx("strong",{className:"text-emerald-700 dark:text-emerald-400",children:"C"}),","," ",n.jsx("strong",{children:"unlocking MEES compliance"})," and enabling continued letting post-2027, alongside the financial upside shown below."]}),n.jsx("div",{className:"relative mt-5 border-t border-slate-200 pt-5 dark:border-white/5",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-5",children:[n.jsx(nt,{accent:"amber",title:"Retrofit cost",value:"£22,400",note:"£18,200 – £28,600 range",explainer:"Indicative spend on the upgrades modelled to reach EPC C."}),n.jsx(nt,{accent:"amber",title:"Capital uplift",tone:"good",value:"+6.5%",explainer:"Knight Frank greener-homes premium, applied per band achieved."}),n.jsx(nt,{accent:"amber",title:"Rental uplift",tone:"good",value:"+4.2%",explainer:"Estimated rent premium per EPC band achieved."}),n.jsx(nt,{accent:"amber",title:"Annual bill saving",tone:"good",value:"£1,840/yr",note:"£3,120 → £1,280",explainer:"Total energy bill saving (heating + hot water + lighting) after EPC improvements."}),n.jsx(nt,{accent:"amber",title:"CO₂ saving",tone:"good",value:"−3.9t/yr",note:"7.8t → 3.9t CO₂",explainer:"Annual CO₂ emission reduction (tonnes) after improvements per the EPC model."})]})}),n.jsxs("div",{className:"mt-5 border-t border-slate-200 pt-4 dark:border-white/10",children:[n.jsx("div",{className:"mb-2 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Assessor-recommended improvements"}),n.jsx("ul",{className:"space-y-2",children:[{label:"Air source heat pump",cost:"£8,000–£14,000",saving:"£720/yr"},{label:"Solid wall insulation (external)",cost:"£9,000–£15,000",saving:"£540/yr"},{label:"Secondary glazing",cost:"£1,200–£3,500",saving:"£180/yr"}].map(v=>n.jsxs("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-0.5 rounded-md bg-slate-50 px-3 py-2 dark:bg-white/5",children:[n.jsx("span",{className:"text-[13px] font-medium text-slate-800 dark:text-slate-100",children:v.label}),n.jsxs("span",{className:"flex items-center gap-3 font-mono text-[12px] text-slate-500 dark:text-slate-400",children:[n.jsx("span",{children:v.cost}),n.jsxs("span",{className:"text-emerald-700 dark:text-emerald-300",children:["saves ",v.saving]})]})]},v.label))})]})]})}),n.jsx(ri,{id:"developer",number:5,title:"Development potential",description:"AI-powered planning risk, build-cost estimate, and a first-pass screen of permitted development rights.",children:n.jsxs(D3,{children:[n.jsx("section",{className:"space-y-4",children:n.jsx(Xs,{accent:"rose",icon:n.jsx(an,{className:"h-3 w-3"}),title:"Recommendation",delay:.1,children:n.jsxs("div",{className:"space-y-2.5 text-[14px]",children:[n.jsx(x0,{label:"Target strategy",value:"Full refurbishment — 4-bed HMO (prior approval route)",valueClass:"text-slate-900 dark:text-white font-medium"}),n.jsx(x0,{label:"Max units",value:"1",valueClass:"text-slate-900 dark:text-white font-medium"}),n.jsx(x0,{label:"EPC upgrade required",value:"Yes",valueClass:"text-amber-700 dark:text-amber-300 font-medium"})]})})}),n.jsxs("section",{className:"space-y-4",children:[n.jsxs(Xs,{accent:"rose",muted:!0,title:"Planning risks · Gateway 1",children:[n.jsxs("div",{className:"mb-4 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[n.jsx("div",{className:"max-w-prose",children:n.jsx("p",{className:"text-[14px] leading-relaxed text-slate-700 dark:text-slate-300",children:"Conservation Area and Article 4 restrictions materially limit the permitted development options for this property. The local planning authority (RBKC) operates one of the most restrictive planning regimes in London. Extensions and alterations require full planning consent; the council's SPD on residential extensions applies strict height and materials criteria. HMO conversion via PD (C3→C4) is blocked by an Article 4 direction covering this ward."})}),n.jsxs("div",{className:"sm:text-right",children:[n.jsx("div",{className:"mb-1.5 font-mono text-[12px] uppercase tracking-wider text-slate-400",children:"Gateway"}),n.jsx("div",{className:"text-[14px] font-medium text-slate-900 dark:text-white",children:"Gateway 1 — Low BSA risk"})]})]}),n.jsxs("div",{className:"mt-4 border-t border-slate-200 pt-4 dark:border-white/10",children:[n.jsx("div",{className:"mb-2 font-mono text-[12px] uppercase tracking-wider text-slate-400",children:"Key objection themes"}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:["Conservation Area character","Article 4 — HMO restrictions","Neighbour amenity impact","Heritage materials policy"].map(v=>n.jsx("span",{className:"inline-flex items-center rounded-md border border-slate-900/20 px-2 py-1 text-[14px] leading-relaxed text-slate-900 dark:border-white/20 dark:text-white",children:v},v))})]}),n.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 border-t border-slate-200 pt-4 dark:border-white/10 sm:grid-cols-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[12px] uppercase tracking-wider text-slate-400",children:"Last committee activity"}),n.jsx("div",{className:"mt-0.5 text-[14px] text-slate-900 dark:text-white",children:"4 Nov 2025"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[12px] uppercase tracking-wider text-slate-400",children:"Planning sentiment"}),n.jsxs("div",{className:"mt-0.5 text-[14px] text-slate-900 dark:text-white",children:["Mixed"," ",n.jsx("span",{className:"text-slate-400",children:"(0.18)"})]})]})]})]}),n.jsxs(Xs,{accent:"rose",title:"Development rights",delay:.1,collapsible:!0,defaultCollapsed:!0,children:[n.jsx("p",{className:"mb-4 text-[13px] leading-relaxed text-slate-600 dar
284k:text-slate-400",children:"First-pass screening of the main GPDO classes against the live planning constraints for this plot. Reasoning is shown for any class that is restricted or removed."}),n.jsx("div",{className:"space-y-3",children:TH.map(v=>{const j=AH[v.status];return n.jsxs("div",{className:`rounded-[12px] border ${j.border} ${j.bg} p-3.5`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[14px] font-medium text-slate-900 dark:text-white",children:v.name}),n.jsx("div",{className:"mt-0.5 font-mono text-[11px] uppercase tracking-wider text-slate-500",children:v.gpdo_reference})]}),n.jsxs("div",{className:"inline-flex flex-none items-center gap-1.5 rounded-md border border-slate-900/20 px-2 py-1 text-[12px] text-slate-900 dark:border-white/20 dark:text-white",children:[n.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${j.dot}`}),j.label]})]}),n.jsx("div",{className:`mt-2 text-[13px] leading-relaxed ${j.text}`,children:v.headline}),v.reasons.length>0&&n.jsx("ul",{className:"mt-2 space-y-1 text-[13px] leading-relaxed text-slate-700 dark:text-slate-300",children:v.reasons.map((k,S)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-2 h-1 w-1 flex-none rounded-full bg-slate-500"}),n.jsx("span",{children:k})]},S))}),v.notes.length>0&&n.jsx("div",{className:"mt-2 text-[12px] leading-relaxed text-slate-500",children:v.notes.join(" ")})]},v.class_id)})}),n.jsx("div",{className:"mt-4 border-t border-slate-200 pt-3 text-[11px] leading-relaxed text-slate-500 dark:border-white/10",children:"Source: Planning.data.gov.uk + RBKC Article 4 Directions register. This is a first-pass screen only — always verify with the LPA before proceeding."})]})]})]})}),n.jsx(ri,{id:"site",number:6,title:"Plot intelligence",description:"Site shape, OS mapping data, and boundary information for this plot.",children:n.jsx(fN,{lat:Js.latitude,lng:Js.longitude,tier:"single_report",publicDemo:!0})}),n.jsxs(ri,{id:"commercial",number:7,title:"Business / commercial",description:"Company ownership, Community Infrastructure Levy, biodiversity net gain obligations, and commercial conversion rights.",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(nt,{accent:"violet",title:"Class MA",value:"Not eligible",note:"Residential use (C3) — Class MA applies to commercial Class E only.",explainer:"Permitted development right to convert commercial (Class E) premises into homes — not applicable to existing residential."}),n.jsx(nt,{accent:"violet",title:"CIL Zone 3",value:"£125/sqm",note:"Verify current rate with RBKC charging schedule.",delay:.05,explainer:"Community Infrastructure Levy — a per-square-metre charge applied to qualifying new floorspace.",children:n.jsxs("a",{href:"https://www.google.com/search?q=RBKC+CIL+charging+schedule",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-flex items-center gap-1 font-mono text-[11px] uppercase tracking-wider text-cyan-700 hover:text-cyan-800 dark:text-cyan-300 dark:hover:text-cyan-200",children:["Find RBKC CIL schedule",n.jsx(In,{className:"h-3 w-3"})]})}),n.jsx(nt,{accent:"violet",title:"MEES 2027",value:"At risk",tone:"warn",note:"EPC E is below the proposed 2027 MEES minimum (EPC C). Upgrading required to continue letting post-2027.",delay:.1,explainer:"Minimum Energy Efficiency Standards — let properties must meet EPC C from 2027."}),n.jsx(nt,{accent:"violet",title:"BNG",value:"Low",note:"Existing residential — negligible BNG obligation unless adding new footprint.",delay:.15,explainer:"Biodiversity Net Gain — most new developments must deliver a measurable 10% improvement in habitat."})]}),n.jsxs(SH,{title:"Registered businesses",accent:"violet",muted:!0,children:[n.jsxs("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2 lg:gap-6",children:[n.jsxs("div",{children:[n.jsx("div",{className:"mb-3 font-mono text-[11px] font-semibold uppercase tracking-[0.1em] text-slate-500 dark:text-slate-400",children:"At this address"}),n.jsxs("div",{className:"rounded-[12px] border border-violet-300/20 bg-violet-300/[0.04] p-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[14px] font-semibold text-slate-900 dark:text-white",children:"Coleherne Properties Ltd"}),n.jsx("div",{className:"mt-0.5 font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"No. 09842175"})]}),n.jsx("span",{className:"inline-flex items-center gap-1 rounded-full border border-emerald-300/30 bg-emerald-300/10 px-2.5 py-0.5 text-[12px] text-emerald-700 dark:text-emerald-300",children:"Active"})]}),n.jsxs("div",{className:"mt-3 space-y-2 text-[13px]",children:[n.jsxs("div",{className:"flex justify-between gap-3",children:[n.jsx("span",{className:"text-slate-500",children:"SIC code"}),n.jsx("span",{className:"text-right text-slate-800 dark:text-slate-200",children:"68100 — Buying & selling own real estate"})]}),n.jsxs("div",{className:"flex justify-between gap-3",children:[n.jsx("span",{className:"text-slate-500",children:"Incorporated"}),n.jsx("span",{className:"text-slate-800 dark:text-slate-200",children:"3 Nov 2015"})]}),n.jsxs("div",{className:"flex justify-between gap-3",children:[n.jsx("span",{className:"text-slate-500",children:"Directors"}),n.jsx("span",{className:"text-right text-slate-800 dark:text-slate-200",children:"James A. Whitfield, Sarah R. Whitfield"})]}),n.jsxs("div",{className:"flex justify-between gap-3",children:[n.jsx("span",{className:"text-slate-500",children:"Reg. address"}),n.jsxs("span",{className:"text-right text-slate-800 dark:text-slate-200",children:["24 Coleherne Road, London,"," ",Js.postcode]})]})]}),n.jsxs("a",{href:"https://find-and-update.company-information.service.gov.uk/company/09842175",target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1 font-mono text-[11px] uppercase tracking-wider text-violet-700 hover:underline dark:text-violet-300",children:["View on Companies House",n.jsx(In,{className:"h-3 w-3"})]})]})]}),n.jsxs("div",{className:"lg:border-l lg:border-slate-200 lg:pl-6 lg:dark:border-white/10",children:[n.jsx("div",{className:"mb-3 font-mono text-[11px] font-semibold uppercase tracking-[0.1em] text-slate-500 dark:text-slate-400",children:"Registered nearby (same postcode)"}),n.jsx("p",{className:"rounded-[10px] border border-slate-200 bg-white p-3 text-[13px] leading-relaxed text-slate-600 dar
284k:border-white/10 dark:bg-white/[0.04] dark:text-slate-400",children:"No other companies share this postcode."})]})]}),n.jsx("p",{className:"border-t border-slate-200 pt-2 font-mono text-[10px] uppercase tracking-wider text-slate-600 dark:border-white/5",children:"Source: Companies House Public Data API"})]})]}),n.jsx("div",{className:"flex items-center justify-between gap-4 border-t border-slate-200 pt-4 font-mono text-[12px] uppercase tracking-wider text-slate-500 dark:border-white/5",children:n.jsx("span",{className:"text-[10px] normal-case tracking-normal text-slate-500",children:"HM Land Registry Price Paid Data — © Crown copyright and database rights 2024. Licence: OGL v3.0. EPC data © Crown copyright — Department for Energy Security & Net Zero. Planning data © Crown copyright — Planning.data.gov.uk. OS NGD © Crown copyright and database rights 2025. Companies House data © Crown copyright."})})]})]})]})]})]}),n.jsxs("div",{className:"z-10 flex flex-none items-center justify-between gap-4 border-t border-slate-200 bg-white/90 px-5 py-3 backdrop-blur-md dark:border-white/10 dark:bg-[#06081c]/90",children:[n.jsxs("div",{className:"hidden flex-col sm:flex",children:[n.jsx("span",{className:"text-[13px] font-semibold text-slate-900 dark:text-white",children:"This is a sample report"}),n.jsx("span",{className:"text-[12px] text-slate-500",children:"Run a full report on any UK property for £9.99"})]}),n.jsx("span",{className:"text-[13px] text-slate-500 sm:hidden",children:"Run a report on any UK property — £9.99"}),n.jsxs("a",{href:"/dashboard",className:"flex shrink-0 items-center gap-2 rounded-full bg-cyan-500 px-5 py-2.5 text-[13px] font-semibold text-white shadow-lg shadow-cyan-500/20 transition hover:bg-cyan-400",children:["Get your report",n.jsx(px,{className:"h-4 w-4"})]})]})]})]})})}const $H=["Full AI development appraisal for one address","Live build-cost model — base, fees, contingency","Council objection-risk score + key planning themes","EPC rating, flood risk, heritage & conservation status","Companies House owner intel — directors, PSCs, charges","HMO density, PTAL transit score & boundary anomalies","Class MA conversion eligibility (Class E → C3)","CIL zone, BNG risk, MEES warnings & Gateway 2 checks","Saved to your dashboard — revisit any time"],UH=["Live build cost model — base, fees, contingency","Council objection-risk score + key themes","Fire-safety / Gateway 2 warnings","HMO density, PTAL transit score & boundary anomalies","Companies House owner intel — directors, PSCs, charges","Class MA conversion eligibility (Class E → C3)","CIL zone & charge-per-sqm estimates","MEES 2027 compliance warnings (commercial)","Biodiversity Net Gain (BNG) risk scoring","Business rates annual estimate","7-day appraisal history per property"],HH=["200 development appraisals per month","Everything in Pro","Priority support & onboarding"];function qH(){const{theme:e}=Da(),t=e==="dark",[s,r]=w.useState("loading"),[o,c]=w.useState(null),[d,h]=w.useState("£29.99"),[p,f]=w.useState(null),[m,x]=w.useState("£59.99"),[y,v]=w.useState(null),[j,k]=w.useState(null);w.useEffect(()=>{let L=!1;return fetch("/api/stripe/plans").then(U=>U.json()).then(U=>{if(L)return;const K=U.plans.find(te=>te.tier==="pro")??U.plans.find(te=>te.name?.toLowerCase().includes("pro")),G=K?.prices.find(te=>te.interval==="month")??K?.prices[0];if(G&&(c(G.id),G.currency.toLowerCase()==="gbp")){const te=G.unit_amount/100;h(`£${Number.isInteger(te)?te:te.toFixed(2)}`)}const W=U.plans.find(te=>te.tier==="enterprise")??U.plans.find(te=>te.name?.toLowerCase().includes("enterprise")),ee=W?.prices.find(te=>te.interval==="month")??W?.prices[0];if(ee&&(f(ee.id),ee.currency.toLowerCase()==="gbp")){const te=ee.unit_amount/100;x(`£${Number.isInteger(te)?te:te.toFixed(2)}`)}r(G?"ready":"error")}).catch(()=>{L||r("error")}),()=>{L=!0}},[]);async function S(L,U){if(k(null),!U){k(`${L==="pro"?"Pro":"Enterprise"} plan isn't configured yet — please try again shortly.`);return}v(L);try{const{data:{session:K}}=await wt.auth.getSession();if(!K){try{sessionStorage.setItem("scapely:pendingPriceId",U)}catch{}window.location.href="/dashboard?mode=signup";return}const{url:G}=await bt("/stripe/checkout",{method:"POST",body:JSON.stringify({priceId:U})});if(G)window.location.href=G;else throw new Error("No checkout URL returned")}catch(K){const G=K instanceof Gc?K.message:"Couldn't start checkout";k(G),v(null)}}async function N(){k(null);const{data:{session:L}}=await wt.auth.getSession();if(!L){try{sessionStorage.removeItem("scapely:pendingPriceId")}catch{}window.location.href="/dashboard?mode=signup";return}return S("pro",o)}const C=()=>S("enterprise",p),E=s==="error"?"Temporarily unavailable":y==="pro"?"Redirecting…":"Subscribe to Pro",O=s==="error"||y!==null,P=s==="loading"||y==="pro",M=s==="error"?"Temporarily unavailable":y==="enterprise"?"Redirecting…":"Start Enterprise",B=s==="error"||y!==null,A=s==="loading"||y==="enterprise";return n.jsx(as,{primaryNavLink:{href:"/",label:"Home",testId:"link-nav-home"},children:n.jsxs("div",{className:"-mt-24 sm:-mt-28 relative overflow-hidden pt-24 sm:pt-28",children:[n.jsx("div",{className:`pointer-events-none absolute inset-0 ${t?"opacity-40":"opacity-30"}`,"aria-hidden":!0,style:{backgroundImage:t?"radial-gradient(ellipse at 80% 0%, rgba(34,211,238,0.18), transparent 50%), radial-gradient(ellipse at 0% 100%, rgba(217,70,239,0.12), transparent 55%)":"radial-gradient(ellipse at 80% 0%, rgba(34,211,238,0.12), transparent 50%), radial-gradient(ellipse at 0% 100%, rgba(167,139,250,0.10), transparent 55%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0","aria-hidden":!0,style:{backgroundImage:t?"linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px)":"linear-gradient(to right, rgba(15,23,42,0.06) 1px, transparent 1px), linear-gradient(to bottom, rgba(15,23,42,0.06) 1px, transparent 1px)",backgroundSize:"56px 56px",maskImage:"radial-gradient(ellipse at center, black 30%, transparent 80%)",WebkitMaskImage:"radial-gradient(ellipse at center, black 30%, transparent 80%)"}}),n.jsxs("section",{className:"relative mx-auto w-full max-w-7xl px-6 pt-8 pb-16",children:[n.jsxs("div",{className:"text-center",children:[n.jsxs("span",{className:"inline-flex items-center gap-2 font-mono text-[11px] uppercase tracking-[0.2em] text-cyan-600 dark:text-cyan-400",children:[n.jsx(na,{className:"h-3.5 w-3.5"})," Pay as you go / Subscription"]}),n.jsxs("h1",{className:"mt-4 text-[25px] font-semibold tracking-tight text-slate-900 dark:text-white sm:text-[34px]",children:["One report."," ",n.jsx("span",{className:"bg-gradient-to-r from-cyan-500 to-fuchsia-500 bg-clip-text text-transparent",children:"Full analysis."})]}),n.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-base text-slate-600 dar
284k:text-slate-400",children:"Pay-as-you-go per report or subscribe to Pro or Enterprise for unlimited monthly searches."})]}),n.jsxs("div",{className:"mt-14 grid gap-6 lg:grid-cols-3",children:[n.jsx(v0,{tier:"single_report",name:"Single Report",price:"£9.99",cadence:"/ report",tagline:"Every feature. Pay only for what you search.",cta:"Get started",ctaHref:"/dashboard?mode=signup&plan=single_report",features:$H}),n.jsx(v0,{tier:"pro",name:"Pro",price:d,cadence:"/ month",tagline:"All features. 50 development appraisals per month.",cta:E,onCta:N,ctaDisabled:O,ctaLoading:P,features:UH,highlighted:!0}),n.jsx(v0,{tier:"enterprise",name:"Enterprise",price:m,cadence:"/ month",tagline:"All features. 200 development appraisals per month.",cta:M,onCta:C,ctaDisabled:B,ctaLoading:A,features:HH})]}),j&&n.jsx("p",{"data-testid":"text-checkout-error",className:"mt-8 text-center text-sm text-rose-600 dark:text-rose-400",children:j}),n.jsx("p",{className:"mt-12 text-center text-[13px] text-slate-500",children:"All payments processed by Stripe for Scapely Ltd."}),n.jsx("p",{className:"mt-2 text-center font-mono text-[11px] uppercase tracking-wider text-slate-400 dark:text-slate-500",children:"Pricing in GBP. VAT additional where applicable. Cancel anytime."})]})]})})}function v0({tier:e,name:t,price:s,cadence:r,tagline:o,cta:c,ctaHref:d,ctaExternal:h,onCta:p,ctaDisabled:f,ctaLoading:m,features:x,highlighted:y}){const v=y?"rounded-2xl border border-cyan-300/50 bg-gradient-to-br from-cyan-50 via-white to-white p-8 shadow-md lg:scale-[1.02] lg:shadow-[0_30px_80px_-30px_rgba(34,211,238,0.25)] dark:border-cyan-400/30 dark:from-cyan-950/40 dark:via-[#07091f] dark:to-[#06081c] dark:shadow-[0_30px_80px_-30px_rgba(34,211,238,0.2)]":e==="enterprise"?"rounded-2xl border border-amber-200 bg-gradient-to-br from-amber-50 via-white to-white p-8 shadow-sm dark:border-amber-400/25 dark:from-amber-950/30 dark:via-[#07091f] dark:to-[#06081c]":"rounded-2xl border border-slate-200 bg-white p-8 shadow-sm dark:border-white/10 dark:bg-white/5",j=e==="pro"?"rounded-full bg-cyan-100 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-cyan-700 dark:bg-cyan-900/40 dark:text-cyan-400":e==="enterprise"?"rounded-full bg-amber-100 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-amber-700 dark:bg-amber-900/40 dark:text-amber-400":"rounded-full bg-slate-100 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-600 dark:bg-white/10 dark:text-slate-400",k=y?"mt-7 inline-flex h-11 w-full items-center justify-center gap-2 rounded-xl bg-cyan-400 text-sm font-semibold text-[#06081c] shadow-[0_8px_24px_-8px_rgba(34,211,238,0.5)] transition hover:bg-cyan-300":e==="enterprise"?"mt-7 inline-flex h-11 w-full items-center justify-center gap-2 rounded-xl border border-amber-300 bg-amber-50 text-sm font-semibold text-amber-800 transition hover:bg-amber-100 dark:border-amber-400/40 dark:bg-amber-900/20 dark:text-amber-300 dark:hover:bg-amber-900/35":"mt-7 inline-flex h-11 w-full items-center justify-center gap-2 rounded-xl border border-slate-300 bg-slate-100 text-sm font-semibold text-slate-800 transition hover:bg-slate-200 dark:border-white/15 dark:bg-white/10 dark:text-slate-200 dark:hover:bg-white/15",S=f?`${k} opacity-60 cursor-not-allowed`:k,N=e==="enterprise"?"mt-0.5 flex h-5 w-5 flex-none items-center justify-center rounded-full bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-400":"mt-0.5 flex h-5 w-5 flex-none items-center justify-center rounded-full bg-cyan-100 text-cyan-700 dark:bg-cyan-900/40 dark:text-cyan-400";return n.jsxs("div",{"data-testid":`plan-${e}`,className:v,children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-slate-900 dark:text-white",children:t}),(e==="pro"||e==="enterprise")&&n.jsx("span",{className:j,children:"Cancel anytime"})]}),n.jsx("p",{className:"mt-2 text-[13px] text-slate-500 dark:text-slate-400",children:o}),n.jsxs("div",{className:"mt-5 flex items-baseline gap-1",children:[n.jsx("span",{className:"text-5xl font-semibold tracking-tight text-slate-900 dark:text-white",children:s}),n.jsx("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:r})]}),p?n.jsxs("button",{type:"button",onClick:f?void 0:p,disabled:f,"data-testid":`button-${e}-cta`,className:S,children:[m&&n.jsx(Me,{className:"h-4 w-4 animate-spin"}),c]}):n.jsx("a",{href:d??"#","data-testid":`button-${e}-cta`,className:S,...h?{target:"_blank",rel:"noopener noreferrer"}:{},children:c}),n.jsx("ul",{className:"mt-7 space-y-3",children:x.map(C=>n.jsxs("li",{className:"flex items-start gap-3 text-[14px] text-slate-700 dark:text-slate-300",children:[n.jsx("span",{className:N,children:n.jsx(mx,{className:"h-3 w-3",strokeWidth:3})}),n.jsx("span",{children:C})]},C))})]})}function vp({surface:e}){const{theme:t}=Da(),s=t==="light";return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`pointer-events-none absolute inset-0 ${s?"opacity-40":"opacity-30"}`,"aria-hidden":!0,style:{backgroundImage:s?"radial-gradient(ellipse at 80% 0%, rgba(103,232,249,0.14), transparent 50%), radial-gradient(ellipse at 0% 100%, rgba(167,139,250,0.10), transparent 55%)":"radial-gradient(ellipse at 80% 0%, rgba(103,232,249,0.18), transparent 50%), radial-gradient(ellipse at 0% 100%, rgba(217,70,239,0.15), transparent 55%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0","aria-hidden":!0,style:{backgroundImage:s?"linear-gradient(to right, rgba(15,23,42,0.07) 1px, transparent 1px), linear-gradient(to bottom, rgba(15,23,42,0.07) 1px, transparent 1px)":"linear-gradient(to right, white 1px, transparent 1px), linear-gradient(to bottom, white 1px, transparent 1px)",backgroundSize:"56px 56px",opacity:s?1:.06,maskImage:"radial-gradient(ellipse at center, black 30%, transparent 80%)",WebkitMaskImage:"radial-gradient(ellipse at center, black 30%, transparent 80%)"}})]})}const VH="20 April 2026",I3="[email protected]";function zH(){return n.jsx(as,{children:n.jsxs("div",{className:"relative -mt-24 overflow-hidden pt-24 sm:-mt-28 sm:pt-28",children:[n.jsx(vp,{}),n.jsxs("article",{className:"relative mx-auto w-full max-w-3xl px-6 py-12 sm:py-16",children:[n.jsxs("header",{className:"mb-10 border-b border-slate-200 pb-6 dark:border-white/10",children:[n.jsx("p",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-900 sm:text-cyan-700 dark:text-cyan-400",children:"Legal"}),n.jsx("h1",{className:"mt-2 text-[21px] font-semibold text-slate-900 dark:text-white sm:text-[25px]",children:"Privacy Policy"}),n.jsxs("p",{className:"mt-2 text-sm text-slate-500 dark:text-slate-400",children:["Last updated: ",VH]})]}),n.jsxs("div",{className:"prose-policy space-y-8 text-[15px] leading-relaxed text-slate-600 dar
284k:text-slate-400",children:[n.jsx(Rn,{title:"1. Who we are",children:n.jsxs("p",{children:['Scapely ("we", "us", "our") provides AI-powered property development intelligence to UK property professionals through the scapely.io website and the Scapely browser extension. We are the data controller of any personal data described in this policy. You can reach us at'," ",n.jsx(w0,{}),"."]})}),n.jsx(Rn,{title:"2. What we collect",children:n.jsxs("ul",{className:"list-disc space-y-2 pl-5",children:[n.jsxs("li",{children:[n.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"Account data"})," — your email address and an encrypted password (or third-party identity token) used to create and authenticate your account."]}),n.jsxs("li",{children:[n.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"Subscription data"})," — billing status and Stripe customer/subscription identifiers. Card details are handled directly by Stripe and never reach our servers."]}),n.jsxs("li",{children:[n.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"Usage data"})," — the addresses, postcodes and listing URLs you ask Scapely to analyse, plus the resulting appraisals we generate for you."]}),n.jsxs("li",{children:[n.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"Technical data"})," — limited request logs (timestamp, endpoint, status, IP) used for security, abuse prevention and debugging."]})]})}),n.jsxs(Rn,{title:"3. How we use it",children:[n.jsx("p",{children:"We use the data above to:"}),n.jsxs("ul",{className:"list-disc space-y-2 pl-5",children:[n.jsx("li",{children:"provide the appraisal, watchlist and extension features;"}),n.jsx("li",{children:"authenticate you, enforce your plan limits and process payments via Stripe;"}),n.jsx("li",{children:"debug, monitor and improve the service, including training internal heuristics on aggregated, non-identifying usage patterns;"}),n.jsx("li",{children:"send essential service emails (billing receipts, security notices). We do not send marketing email without your explicit opt-in."})]})]}),n.jsx(Rn,{title:"4. Lawful bases (UK GDPR)",children:n.jsxs("p",{children:["We rely on ",n.jsx("em",{children:"contract"})," (to deliver the service you sign up for), ",n.jsx("em",{children:"legitimate interests"})," (to keep the service secure and improve it) and ",n.jsx("em",{children:"legal obligation"})," (e.g. to retain billing records). Where a basis isn't available, we ask for your consent."]})}),n.jsx(Rn,{title:"5. Data sources we query on your behalf",children:n.jsx("p",{children:"When you run an appraisal we query public UK property data (HM Land Registry EPC register, planning portals, council boundary data) and third-party APIs (Anthropic for language analysis, Google Maps for geocoding). We send the minimum data necessary — typically a postcode, address line or UPRN — and never share your account identity with these providers."})}),n.jsx(Rn,{title:"6. Subprocessors",children:n.jsxs("ul",{className:"list-disc space-y-2 pl-5",children:[n.jsx("li",{children:"Supabase (authentication & primary database) — EU region."}),n.jsx("li",{children:"Stripe (payments)."}),n.jsx("li",{children:"Anthropic (AI analysis)."}),n.jsx("li",{children:"Google Maps Platform (geocoding)."}),n.jsx("li",{children:"Cloud hosting (UK / EU region)."})]})}),n.jsx(Rn,{title:"7. Retention",children:n.jsx("p",{children:"We keep your account and appraisal history for as long as your account is active. Billing records are retained for seven years to meet UK accounting requirements. Deleting your account removes your appraisal data within 30 days, except where we are legally required to retain it."})}),n.jsx(Rn,{title:"8. Your rights",children:n.jsxs("p",{children:["Under UK GDPR you can request access to, correction of, or deletion of your personal data, restrict or object to processing, and request portability. Email"," ",n.jsx(w0,{})," and we'll respond within 30 days. You can also complain to the UK Information Commissioner's Office (ico.org.uk)."]})}),n.jsx(Rn,{title:"9. Cookies and local storage",children:n.jsxs("p",{children:["The website uses a small number of strictly-necessary cookies for authentication and session security. The browser extension stores your Supabase session and your selected tier in"," ",n.jsx("code",{className:"rounded bg-slate-100 px-1.5 py-0.5 text-cyan-700 dark:bg-white/10 dark:text-cyan-400",children:"chrome.storage.local"})," ","so you don't have to sign in on every page."]})}),n.jsx(Rn,{title:"10. Changes",children:n.jsx("p",{children:"We may update this policy from time to time. Material changes will be announced on the website and, where appropriate, by email."})}),n.jsx(Rn,{title:"11. Contact",children:n.jsxs("p",{children:["Questions about this policy? Email ",n.jsx(w0,{}),"."]})})]})]})]})})}function Rn({title:e,children:t}){return n.jsxs("section",{children:[n.jsx("h2",{className:"mb-3 text-lg font-semibold text-slate-900 dark:text-white",children:e}),n.jsx("div",{className:"space-y-3",children:t})]})}function w0(){return n.jsx("a",{href:`mailto:${I3}`,className:"text-cyan-700 underline-offset-2 hover:underline dark:text-cyan-400","data-testid":"link-contact-email",children:I3})}const FH="20 April 2026",$3="[email protected]";function GH(){return n.jsx(as,{children:n.jsxs("div",{className:"relative -mt-24 overflow-hidden pt-24 sm:-mt-28 sm:pt-28",children:[n.jsx(vp,{}),n.jsxs("article",{className:"relative mx-auto w-full max-w-3xl px-6 py-12 sm:py-16",children:[n.jsxs("header",{className:"mb-10 border-b border-slate-200 pb-6 dark:border-white/10",children:[n.jsx("p",{className:"font-mono text-[11px] uppercase tracking-wider text-cyan-700 dark:text-cyan-400",children:"Legal"}),n.jsx("h1",{className:"mt-2 text-[21px] font-semibold text-slate-900 dark:text-white sm:text-[25px]",children:"Terms & Conditions"}),n.jsxs("p",{className:"mt-2 text-sm text-slate-500 dark:text-slate-400",children:["Last updated: ",FH]})]}),n.jsxs("div",{className:"space-y-8 text-[15px] leading-relaxed text-slate-600 dar
284k:text-slate-400",children:[n.jsx(Ls,{title:"1. About these terms",children:n.jsx("p",{children:`These terms govern your use of Scapely ("the Service"), operated from the United Kingdom. By creating an account, otherwise using the Service, you agree to be bound by these terms. If you don't agree, please don't use the Service.`})}),n.jsx(Ls,{title:"2. The Service",children:n.jsx("p",{children:"Scapely provides AI-assisted property development intelligence — including build-cost estimates, planning-risk scoring, EPC and tenure data through a web dashboard and a companion Chrome extension. The Service is offered on a tiered basis (Free, Pro and Enterprise)."})}),n.jsx(Ls,{title:"3. Accounts",children:n.jsxs("p",{children:["You must be 18 or over and provide accurate registration details. You are responsible for keeping your credentials secure and for all activity carried out through your account. Notify us immediately at ",n.jsx(j0,{})," if you suspect unauthorised access."]})}),n.jsx(Ls,{title:"4. Plans, billing and refunds",children:n.jsxs("ul",{className:"list-disc space-y-2 pl-5",children:[n.jsx("li",{children:"The Free tier permits 3 development appraisals per calendar month."}),n.jsx("li",{children:"Pro is billed at £29.99/month (GBP), Enterprise at £59.99/month, both via Stripe and renewing automatically until cancelled."}),n.jsx("li",{children:"Enterprise pricing is agreed in writing and invoiced separately."}),n.jsx("li",{children:"You can cancel at any time from the billing portal; access continues until the end of the paid period. We do not offer pro-rata refunds for partial months unless required by law."}),n.jsx("li",{children:"We may change pricing on 30 days' notice. Existing paid periods are honoured at the original price."})]})}),n.jsxs(Ls,{title:"5. Acceptable use",children:[n.jsx("p",{children:"You agree not to:"}),n.jsxs("ul",{className:"list-disc space-y-2 pl-5",children:[n.jsx("li",{children:"resell, sublicense or scrape the Service for bulk data extraction;"}),n.jsx("li",{children:"circumvent plan limits, authentication or rate limits;"}),n.jsx("li",{children:"upload unlawful, defamatory or infringing content;"}),n.jsx("li",{children:"use the Service to harass, deceive or harm any person;"}),n.jsx("li",{children:"interfere with the operation or security of the Service."})]}),n.jsx("p",{children:"We may suspend or terminate accounts that breach this section."})]}),n.jsx(Ls,{title:"6. Property data and AI output — important",children:n.jsxs("p",{children:["Appraisals are ",n.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"indicative estimates"})," generated by combining public datasets and large language models. They are intended to support your own professional judgement and"," ",n.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"do not constitute legal, financial, planning, surveying or investment advice"}),". Always commission qualified professionals before committing capital. We do not warrant that the data is complete, up-to-date or fit for any particular purpose."]})}),n.jsx(Ls,{title:"7. Intellectual property",children:n.jsx("p",{children:"Scapely, the Scapely logo, the website code, the extension code and the appraisal outputs (other than the underlying public data) are owned by us. You retain ownership of the addresses, notes and watchlist entries you submit. You grant us a worldwide, non-exclusive licence to host and process that content solely to operate the Service for you."})}),n.jsx(Ls,{title:"8. Third-party services",children:n.jsx("p",{children:"The Service relies on third-party providers (Stripe, Supabase, Anthropic, Google Maps, public planning APIs). We are not responsible for outages or data quality issues originating from those providers, but we will use reasonable efforts to mitigate them."})}),n.jsx(Ls,{title:"9. Availability",children:n.jsx("p",{children:"We aim for high availability but do not guarantee that the Service will be uninterrupted or error-free. Scheduled maintenance will be announced where practical."})}),n.jsx(Ls,{title:"10. Liability",children:n.jsx("p",{children:"Nothing in these terms excludes liability for death or personal injury caused by negligence, fraud or any other liability that cannot be excluded under English law. Subject to that, our total aggregate liability arising out of or in connection with the Service is limited to the greater of (a) the fees you paid us in the 12 months preceding the claim, or (b) £100. We are not liable for indirect, consequential, or loss-of-profit damages."})}),n.jsx(Ls,{title:"11. Termination",children:n.jsxs("p",{children:["You may close your account at any time by emailing"," ",n.jsx(j0,{}),". We may suspend or terminate your access if you breach these terms or if we reasonably believe doing so is necessary to protect the Service or other users."]})}),n.jsx(Ls,{title:"12. Changes to these terms",children:n.jsx("p",{children:"We may update these terms from time to time. Material changes will be announced on the website and take effect 14 days after posting. Continued use of the Service after that date constitutes acceptance."})}),n.jsx(Ls,{title:"13. Governing law",children:n.jsx("p",{children:"These terms are governed by the laws of England and Wales. The courts of England and Wales have exclusive jurisdiction over any dispute, except that consumers may bring proceedings in the courts of their country of residence where required by law."})}),n.jsx(Ls,{title:"14. Contact",children:n.jsxs("p",{children:["Questions about these terms? Email ",n.jsx(j0,{}),"."]})})]})]})]})})}function Ls({title:e,children:t}){return n.jsxs("section",{children:[n.jsx("h2",{className:"mb-3 text-lg font-semibold text-slate-900 dark:text-white",children:e}),n.jsx("div",{className:"space-y-3",children:t})]})}function j0(){return n.jsx("a",{href:`mailto:${$3}`,className:"text-cyan-700 underline-offset-2 hover:underline dark:text-cyan-400","data-testid":"link-contact-email",children:$3})}const ol="/assets/scapelyicon_1776670280835-Cvi6_49-.png",KH=[{id:"appraisal",label:"Appraisal runs",short:"Appr."},{id:"owner_intel",label:"Owner Intel views",short:"Owner"},{id:"plot_intel",label:"Plot Intel views",short:"Plot"},{id:"investment_view",label:"Investment View",short:"Inv."},{id:"watchlist",label:"Watchlist actions",short:"Watch"},{id:"billing",label:"Billing / Stripe",short:"Bill"},{id:"title_register",label:"Title Register lookups",short:"Title"},{id:"other",label:"Other API calls",short:"Other"}];function gN(e,t){const s=e.toUpperCase();return t.startsWith("/api/appraisal")&&s==="POST"?"Run appraisal":t.startsWith("/api/appraisal")?"Read cached appraisal":t.startsWith("/api/owner-intel")?"Owner Intel lookup":t.startsWith("/api/plot-intel")?"Plot Intel lookup":t.startsWith("/api/investment-view")?"Investment View":t.startsWith("/api/watchlist")&&s==="POST"?"Add to wat
284chlist":t.startsWith("/api/watchlist")&&s==="DELETE"?"Remove from watchlist":t.startsWith("/api/watchlist")?"Load watchlist":t.startsWith("/api/stripe/checkout")?"Start checkout":t.startsWith("/api/stripe/portal")?"Open billing portal":t.startsWith("/api/stripe/plans")?"Load plans":t.startsWith("/api/stripe")?"Stripe (other)":t.startsWith("/api/title-register")?"Title Register":t.startsWith("/api/photo")?"Property photos":t.startsWith("/api/os-tiles")?"Map tiles":t.startsWith("/api/me")?"Session check":t==="__unmatched__"?"Unmatched / 404":t}function Go(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t)||t<0)return"Just now";const s=Math.floor(t/1e3);if(s<60)return"Just now";const r=Math.floor(s/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);if(o<24)return`${o}h ago`;const c=Math.floor(o/24);if(c<30)return`${c}d ago`;const d=Math.floor(c/30);return d<12?`${d}mo ago`:`${Math.floor(d/12)}y ago`}const xN={extension:"Chrome extension",web:"Web dashboard",unknown:"Other / server"},U3={extension:"border-violet-300/30 bg-violet-300/10 text-violet-100",web:"border-emerald-300/30 bg-emerald-300/10 text-emerald-100",unknown:"border-slate-500/30 bg-slate-500/10 text-slate-300"};function wr(e){return e?e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):"0"}function Dh(e){if(!e)return null;const t=new Date(e).getTime()-Date.now();return Math.ceil(t/(1440*60*1e3))}function Wg(e){if(e.trial_status==="active"){const t=Dh(e.trial_ends_at);if(t!==null&&t<=0)return"expired"}return e.trial_status}function WH({profile:e}){const t=Dh(e.trial_ends_at),s=Wg(e);if(s==="active"&&t!==null&&t>0){const r=t<=1?"border-red-400/30 bg-red-400/10 text-red-200":t<=3?"border-amber-300/30 bg-amber-300/10 text-amber-100":"border-emerald-300/30 bg-emerald-300/10 text-emerald-100";return n.jsxs("span",{className:`inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${r}`,title:e.trial_ends_at?`Ends ${new Date(e.trial_ends_at).toLocaleString()}`:void 0,children:[n.jsx(xx,{className:"h-3 w-3"})," Trial · ",t,"d"]})}return s==="expired"?n.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-slate-500/30 bg-slate-500/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-slate-300",title:e.trial_ends_at?`Expired ${new Date(e.trial_ends_at).toLocaleString()}`:void 0,children:"Trial · expired"}):s==="converted"?n.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-violet-300/30 bg-violet-300/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-violet-100",children:"Converted"}):n.jsx("span",{className:"text-xs text-slate-500",children:"—"})}function uc(e,t){try{return new Intl.NumberFormat("en-GB",{style:"currency",currency:t.toUpperCase()}).format(e/100)}catch{return`${(e/100).toFixed(2)} ${t.toUpperCase()}`}}async function Ct(e,t={}){const s=await bp();if(!s)throw new Error("Not signed in");const r=await fetch(`/api${e}`,{...t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`,...t.headers??{}}}),o=await r.json().catch(()=>({}));if(!r.ok)throw new Error(o.error??`HTTP ${r.status}`);return o}function YH(){_i();const[e,t]=w.useState(null),[s,r]=w.useState(!0),[o,c]=w.useState("checking");return w.useEffect(()=>{let d=!1;wt.auth.getSession().then(({data:p})=>{d||(t(p.session?.user.email??null),r(!1))});const{data:h}=wt.auth.onAuthStateChange((p,f)=>{const m=f?.user.email??null;t(x=>x===m?x:(c("checking"),m))});return()=>{d=!0,h.subscription.unsubscribe()}},[]),w.useEffect(()=>{if(!e)return;let d=!1;return(async()=>{try{await Ct("/admin/profiles"),d||c("authorized")}catch{d||c("forbidden")}})(),()=>{d=!0}},[e]),s?n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-950 text-white",children:n.jsx(Me,{className:"h-6 w-6 animate-spin"})}):e?o==="checking"?n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-950 text-white",children:n.jsx(Me,{className:"h-6 w-6 animate-spin"})}):o==="forbidden"?n.jsx(ZH,{email:e}
284):n.jsx(lq,{adminEmail:e}):n.jsx(QH,{})}function QH(){const[e,t]=w.useState(""),[s,r]=w.useState(""),[o,c]=w.useState(!1),[d,h]=w.useState(null);async function p(f){f.preventDefault(),c(!0),h(null);const{error:m}=await wt.auth.signInWithPassword({email:e,password:s});c(!1),m&&h(m.message)}return n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-950 px-4 text-white",children:n.jsxs("form",{onSubmit:p,className:"w-full max-w-sm rounded-2xl border border-white/10 bg-slate-900/80 p-7 shadow-2xl backdrop-blur",children:[n.jsxs("div",{className:"mb-5 flex items-center gap-3",children:[n.jsx("img",{src:ol,alt:"",className:"h-8 w-8 rounded-lg"}),n.jsx("img",{src:_n,alt:"Scapely",className:"h-[15px] w-auto sm:h-[16px]"}),n.jsx("span",{className:"ml-1 rounded-full border border-emerald-300/30 bg-emerald-300/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-emerald-200",children:"Admin"})]}),n.jsx("p",{className:"mb-5 text-sm text-slate-400",children:"Sign in with an authorised admin account to manage user tiers."}),n.jsxs("label",{className:"mb-3 block text-xs uppercase tracking-wider text-slate-400",children:["Email",n.jsx("input",{type:"email",required:!0,value:e,onChange:f=>t(f.target.value),className:"mt-1 w-full rounded-lg border border-white/10 bg-slate-950/80 px-3 py-2 text-sm text-white outline-none focus:border-emerald-300/50"})]}),n.jsxs("label",{className:"mb-5 block text-xs uppercase tracking-wider text-slate-400",children:["Password",n.jsx("input",{type:"password",required:!0,value:s,onChange:f=>r(f.target.value),className:"mt-1 w-full rounded-lg border border-white/10 bg-slate-950/80 px-3 py-2 text-sm text-white outline-none focus:border-emerald-300/50"})]}),d&&n.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-xs text-red-200",children:[n.jsx(en,{className:"mt-0.5 h-3.5 w-3.5 flex-none"}),d]}),n.jsxs("button",{type:"submit",disabled:o,className:"flex w-full items-center justify-center gap-2 rounded-lg bg-emerald-400 px-3 py-2 text-sm font-semibold text-slate-950 transition hover:bg-emerald-300 disabled:opacity-60",children:[o&&n.jsx(Me,{className:"h-4 w-4 animate-spin"}),"Sign in"]}),n.jsx("p",{className:"mt-5 text-center text-xs text-slate-500",children:n.jsx(Be,{href:"/",className:"hover:text-slate-300",children:"← Back to scapely.io"})})]})})}function ZH({email:e}){return n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-950 px-4 text-white",children:n.jsxs("div",{className:"max-w-md rounded-2xl border border-white/10 bg-slate-900/80 p-7 text-center",children:[n.jsx(en,{className:"mx-auto mb-3 h-8 w-8 text-red-300"}),n.jsx("h1",{className:"mb-2 text-[13px] font-semibold",children:"Not authorised"}),n.jsxs("p",{className:"mb-5 text-sm text-slate-400",children:["The account ",n.jsx("span",{className:"text-white",children:e})," is not on the admin allowlist."]}),n.jsx("button",{onClick:()=>wt.auth.signOut(),className:"rounded-lg border border-white/10 px-3 py-2 text-sm hover:bg-white/5",children:"Sign out"})]})})}function XH({usage:e}){const t=KH.map(o=>({...o,count:e?.[o.id]??0})),s=t.reduce((o,c)=>o+c.count,0),r=t.reduce((o,c)=>Math.max(o,c.count),0);return n.jsxs("div",{children:[n.jsxs("div",{className:"mb-2 flex items-baseline justify-between",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-400",children:"Features used"}),n.jsxs("div",{className:"font-mono text-[10px] text-slate-500",children:[s.toLocaleString()," total"]})]}),s===0?n.jsx("div",{className:"rounded-lg border border-white/10 bg-white/5 px-3 py-4 text-center text-xs text-slate-500",children:"No feature activity in this window."}):n.jsx("div",{className:"space-y-1.5",children:t.filter(o=>o.count>0).sort((o,c)=>c.count-o.count).map(o=>{const c=r===0?0:Math.round(o.count/r*100);return n.jsxs("div",{className:"grid grid-cols-[110px_1fr_auto] items-center gap-2 text-xs",children:[n.jsx("div",{className:"truncate text-slate-300",title:o.label,children:o.label}),n.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-white/5",children:n.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-cyan-400/70 to-violet-400/70",style:{width:`${Math.max(4,c)}%`}})}),n.jsx("div",{className:"font-mono tabular-nums text-slate-100",children:o.count})]},o.id)})})]})}function JH({activity:e,loading:t,error:s}){return n.jsxs("div",{children:[n.jsx("div",{className:"mb-3 text-[10px] font-semibold uppercase tracking-wider text-slate-400",children:"Recent activity"}),t&&n.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading activity…"]}),s&&n.jsx("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:s}),e&&!t&&n.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[n.jsx(qu,{title:"Searches",count:e.searches.length,empty:"No searches recorded yet.",rows:e.searches.map(r=>({key:r.id,primary:r.query,secondary:eq[r.source]??r.source,tag:r.resolved===!1?{label:"not found",tone:"red"}:null,at:r.created_at}))}
284),n.jsx(qu,{title:"Appraisals",count:e.appraisals.length,empty:"No appraisals yet.",rows:e.appraisals.map(r=>({key:r.id,primary:`UPRN ${r.target_uprn}`,secondary:r.total_estimated_cost?`£${Math.round(r.total_estimated_cost).toLocaleString()} est.`:null,tag:r.overall_risk_level?{label:r.overall_risk_level,tone:H3(r.overall_risk_level)}:null,at:r.created_at}))}),n.jsx(qu,{title:"Watchlist",count:e.watchlist.length,empty:"Nothing on the watchlist.",rows:e.watchlist.map(r=>({key:r.id,primary:r.address_line,secondary:[r.postcode,r.source].filter(Boolean).join(" · "),tag:r.last_risk_level?{label:r.last_risk_level,tone:H3(r.last_risk_level)}:null,at:r.created_at}))}),n.jsx(qu,{title:"Title Register orders",count:e.titleOrders.length,empty:"No Land Registry orders.",rows:e.titleOrders.map(r=>({key:r.id,primary:r.address_line,secondary:[r.postcode,`£${(r.amount_gbp_pence/100).toFixed(2)}`,r.tenure_type??null].filter(Boolean).join(" · "),tag:{label:r.status,tone:sq(r.status)},at:r.created_at}))})]})]})}const eq={appraisal_generate:"Appraisal (signed in)",appraisal_preview:"Landing-page preview",watchlist_add:"Watchlist add",title_register_order:"Title Register"},tq={slate:"border-slate-500/30 bg-slate-500/10 text-slate-300",emerald:"border-emerald-300/30 bg-emerald-300/10 text-emerald-200",amber:"border-amber-300/30 bg-amber-300/10 text-amber-200",red:"border-red-400/30 bg-red-400/10 text-red-200",violet:"border-violet-300/30 bg-violet-300/10 text-violet-100"};function H3(e){const t=e.toLowerCase();return t.includes("low")?"emerald":t.includes("medium")||t.includes("mod")?"amber":t.includes("high")||t.includes("severe")?"red":"slate"}function sq(e){switch(e){case"fulfilled":return"emerald";case"paid":return"violet";case"pending":return"amber";case"failed":return"red";default:return"slate"}}function qu({title:e,count:t,empty:s,rows:r}){return n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.02] p-4",children:[n.jsxs("div",{className:"mb-3 flex items-baseline justify-between",children:[n.jsx("div",{className:"text-xs font-semibold text-slate-200",children:e}),n.jsx("div",{className:"font-mono text-[10px] text-slate-500",children:t.toLocaleString()})]}),r.length===0?n.jsx("div",{className:"rounded-lg border border-white/5 bg-white/[0.02] px-3 py-4 text-center text-[11px] text-slate-500",children:s}):n.jsx("ul",{className:"space-y-1.5",children:r.map(o=>n.jsxs("li",{className:"flex items-start gap-2 rounded-lg border border-white/5 bg-white/[0.02] px-2.5 py-2",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-xs text-slate-100",title:o.primary,children:o.primary}),o.secondary&&n.jsx("div",{className:"mt-0.5 truncate text-[10px] text-slate-500",children:o.secondary})]}),n.jsxs("div",{className:"flex flex-none items-center gap-1.5",children:[o.tag&&n.jsx("span",{className:`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider ${tq[o.tag.tone]}`,children:o.tag.label}),n.jsx("span",{className:"whitespace-nowrap text-[10px] text-slate-500",title:o.at?new Date(o.at).toLocaleString():void 0,children:Go(o.at)})]})]},o.key))})]})}function nq({profile:e,usage:t,usageLoading:s,usageError:r,activity:o,activityLoading:c,activityError:d,busy:h,isSelf:p,onBack:f,onExtendTrial:m,onChangeTier:x,onSendReset:y,onDelete:v}){if(!e)return n.jsxs("div",{children:[n.jsxs("button",{onClick:f,className:"mb-4 inline-flex items-center gap-1 rounded-md border border-white/10 bg-white/5 px-2.5 py-1.5 text-xs font-medium text-slate-300 hover:bg-white/10",children:[n.jsx(_r,{className:"h-3.5 w-3.5"})," Back to users"]}),n.jsx("div",{className:"rounded-xl border border-white/10 bg-white/[0.02] px-5 py-12 text-center text-sm text-slate-400",children:"User not found in the current list. They may have been deleted — go back and refresh."})]});const j=e.tier_source==="stripe"?"Stripe":e.tier_source==="admin_comp"?"Comp":"Signup",k=e.tier_source==="stripe"?"border-violet-300/30 bg-violet-300/10 text-violet-100":e.tier_source==="admin_comp"?"border-amber-300/30 bg-amber-300/10 text-amber-100":"border-slate-500/30 bg-slate-500/10 text-slate-300";return n.jsxs("div",{children:[n.jsxs("button",{onClick:f,className:"mb-4 inline-flex items-center gap-1 rounded-md border border-white/10 bg-white/5 px-2.5 py-1.5 text-xs font-medium text-slate-300 hover:bg-white/10",children:[n.jsx(_r,{className:"h-3.5 w-3.5"})," Back to users"]}),n.jsxs("div",{className:"rounded-2xl border border-white/10 bg-gradient-to-br from-white/[0.04] to-white/[0.01] p-6",children:[n.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-400",children:"User profile"}),n.jsx("div",{className:"mt-1 break-all font-mono text-lg text-slate-100",children:e.email??e.id}),n.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-[11px]",children:[n.jsx(yN,{tier:e.tier}),n.jsx("span",{className:`inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 font-semibold uppercase tracking-wider ${k}`,title:e.tier_source==="admin_comp"?`Granted by ${e.tier_granted_by??"?"}`:void 0,children:j}),n.jsx(WH,{profile:e})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("select",{disabled:h,value:e.tier,onCh
284ange:S=>x(S.target.value),className:"rounded-md border border-white/10 bg-slate-900 px-2 py-1.5 text-xs text-white outline-none focus:border-emerald-300/50",title:"Change subscription tier",children:[n.jsx("option",{value:"free",children:"Free"}),n.jsx("option",{value:"pro",children:"Pro"}),n.jsx("option",{value:"enterprise",children:"Enterprise"})]}),n.jsxs("button",{onClick:()=>m(e.email),disabled:h||e.trial_status==="converted",title:e.trial_status==="converted"?"Account is on a paid plan — manage via Stripe":"Extend Pro trial by 7 days",className:"inline-flex items-center gap-1 rounded-md border border-emerald-300/30 bg-emerald-300/10 px-2.5 py-1.5 text-xs font-medium text-emerald-100 hover:bg-emerald-300/20 disabled:cursor-not-allowed disabled:opacity-40",children:[n.jsx(yk,{className:"h-3.5 w-3.5"})," Extend trial 7d"]}),n.jsxs("button",{onClick:()=>y(e.email),disabled:h||!e.email,title:e.email?`Email a password reset link to ${e.email}`:"No email on file",className:"inline-flex items-center gap-1 rounded-md border border-cyan-300/30 bg-cyan-300/10 px-2.5 py-1.5 text-xs font-medium text-cyan-100 hover:bg-cyan-300/20 disabled:cursor-not-allowed disabled:opacity-40",children:[n.jsx(Wh,{className:"h-3.5 w-3.5"})," Password reset"]}),n.jsxs("button",{onClick:()=>v(e.email),disabled:h||p,title:p?"You can't delete your own admin account":"Permanently delete this account",className:"inline-flex items-center gap-1 rounded-md border border-red-400/30 bg-red-400/10 px-2.5 py-1.5 text-xs font-medium text-red-200 hover:bg-red-400/20 disabled:cursor-not-allowed disabled:opacity-40",children:[n.jsx(Xh,{className:"h-3.5 w-3.5"})," Delete"]})]})]}),n.jsxs("div",{className:"mt-6 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.03] px-3 py-2.5",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-500",children:"Joined"}),n.jsx("div",{className:"mt-0.5 text-sm text-slate-100",children:e.created_at?new Date(e.created_at).toLocaleDateString():"—"})]}),n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.03] px-3 py-2.5",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-500",children:"Last active"}),n.jsx("div",{className:"mt-0.5 text-sm text-slate-100",title:e.last_active_at?new Date(e.last_active_at).toLocaleString():void 0,children:Go(e.last_active_at)})]}),n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.03] px-3 py-2.5",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-500",children:"Monthly scans"}),n.jsx("div",{className:"mt-0.5 font-mono text-sm text-slate-100",children:e.monthly_scan_count.toLocaleString()})]}),n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.03] px-3 py-2.5",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-500",children:"API requests · 30
284d"}),n.jsxs("div",{className:"mt-0.5 font-mono text-sm text-slate-100",children:[wr(e.api_requests_30d),e.api_errors_30d?n.jsxs("span",{className:"ml-1 text-[10px] text-red-300",children:["· ",e.api_errors_30d," err"]}):null]})]})]})]}),n.jsx("div",{className:"mt-5 rounded-2xl border border-white/10 bg-white/[0.02] p-6",children:n.jsx(JH,{activity:o,loading:c,error:d})}),n.jsx("div",{className:"mt-5 rounded-2xl border border-white/10 bg-white/[0.02] p-6",children:n.jsx(XH,{usage:e.feature_usage_30d})}),n.jsxs("div",{className:"mt-5 rounded-2xl border border-white/10 bg-white/[0.02] p-6",children:[n.jsx("div",{className:"mb-3 flex items-baseline justify-between",children:n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-400",children:"API requests · last 30 days"})}),s&&n.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading usage…"]}),r&&n.jsx("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:r}),t&&!s&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-5 grid grid-cols-3 gap-3 text-center",children:[n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2.5",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-400",children:"Total requests"}),n.jsx("div",{className:"mt-0.5 font-mono text-xl text-slate-100",children:t.totalRequests.toLocaleString()})]}),n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2.5",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-400",children:"5xx errors"}),n.jsx("div",{className:`mt-0.5 font-mono text-xl ${t.totalErrors>0?"text-red-300":"text-slate-100"}`,children:t.totalErrors.toLocaleString()})]}),n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2.5",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-400",children:"Active days"}),n.jsx("div",{className:"mt-0.5 font-mono text-xl text-slate-100",children:t.byDay.length})]})]}),t.byRoute.length===0?n.jsx("div",{className:"py-8 text-center text-sm text-slate-500",children:"No authenticated API traffic in this window."}):n.jsx("div",{className:"overflow-hidden rounded-lg border border-white/10",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{className:"bg-white/5 text-left text-[10px] uppercase tracking-wider text-slate-500",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-3 py-2",children:"Method"}),n.jsx("th",{className:"px-3 py-2",children:"Route"}),n.jsx("th",{className:"px-3 py-2 text-right",children:"Requests"}),n.jsx("th",{className:"px-3 py-2 text-right",children:"Errors"}),n.jsx("th",{className:"px-3 py-2 text-right",children:"Avg ms"})]})}),n.jsx("tbody",{children:t.byRoute.map(S=>{const N=S.request_count>0?Math.round(S.total_duration_ms/S.request_count):0;return n.jsxs("tr",{className:"border-t border-white/5",children:[n.jsx("td",{className:"px-3 py-2 font-mono text-[10px] text-slate-500",children:S.method}),n.jsxs("td",{className:"px-3 py-2 text-slate-200",title:`${S.method} ${S.route}`,children:[gN(S.method,S.route),n.jsx("div",{className:"font-mono text-[10px] text-slate-500",children:S.route})]}),n.jsx("td",{className:"px-3 py-2 text-right tabular-nums text-slate-100",children:S.request_count.toLocaleString()}),n.jsx("td",{className:`px-3 py-2 text-right tabular-nums ${S.error_count>0?"text-red-300":"text-slate-500"}`,children:S.error_count}),n.jsx("td",{className:"px-3 py-2 text-right tabular-nums text-slate-400",children:N})]},`${S.method} ${S.route}`)})})]})})]})]})]})}function aq({overview:e,error:t}){if(t)return n.jsxs("section",{className:"mb-6 rounded-xl border border-red-400/30 bg-red-400/10 p-4 text-sm text-red-200",children:["Couldn't load activity overview: ",t]});if(!e)return n.jsx("section",{className:"mb-6 rounded-xl border border-white/10 bg-white/[0.03] p-5 text-sm text-slate-400",children:"Loading overview…"});const s=e.tiers.free??0,r=e.tiers.pro??0,o=e.tiers.enterprise??0,c=e.trials.active??0,d=e.trials.expired??0,h=e.trials.converted??0;return n.jsxs("section",{className:"mb-6 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-slate-400",children:"Signups"}),n.jsx("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:e.signups.total.toLocaleStr
284ing()}),n.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[n.jsxs("span",{className:"tabular-nums text-slate-200",children:["+",e.signups.last_7d]})," ","last 7d ·"," ",n.jsxs("span",{className:"tabular-nums text-slate-200",children:["+",e.signups.last_30d]})," ","last 30d"]})]}),n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-slate-400",children:"Tier mix"}),n.jsxs("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:[r+o,n.jsx("span",{className:"ml-1 text-sm font-normal text-slate-400",children:"paid"})]}),n.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-xs text-slate-400",children:[n.jsxs("span",{children:["Free ",n.jsx("span",{className:"tabular-nums text-slate-200",children:s})]}),n.jsxs("span",{children:["Pro ",n.jsx("span",{className:"tabular-nums text-slate-200",children:r})]}),n.jsxs("span",{children:["Ent ",n.jsx("span",{className:"tabular-nums text-slate-200",children:o})]})]})]}),n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-slate-400",children:"Trials"}),n.jsxs("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:[c,n.jsx("span",{className:"ml-1 text-sm font-normal text-slate-400",children:"active"})]}),n.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[e.trialConversionPct===null?n.jsx("span",{children:"No completed trials yet"}):n.jsxs("span",{children:[n.jsxs("span",{className:"tabular-nums text-slate-200",children:[e.trialConversionPct,"%"]})," ","conversion"]})," ","·"," ",n.jsx("span",{className:"tabular-nums text-slate-200",children:h})," ","converted ·"," ",n.jsx("span",{className:"tabular-nums text-slate-200",children:d})," ","expired"]})]}),n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-slate-400",children:"Active users"}),n.jsxs("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:[e.active.dau,n.jsx("span",{className:"ml-1 text-sm font-normal text-slate-400",children:"DAU"})]}),n.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[n.jsx("span",{className:"tabular-nums text-slate-200",children:e.active.wau})," ","WAU ·"," ",n.jsx("span",{className:"tabular-nums text-slate-200",children:e.active.mau})," ","MAU"]})]})]})}function rq({data:e,loading:t,error:s,days:r,onDaysChange:o,onRefresh:c}){const d=e?.byDay??[],h=Math.max(1,...d.map(p=>p.authenticated+p.anonymous));return n.jsxs("section",{className:"mb-6 rounded-xl border border-white/10 bg-white/[0.03] p-5",children:[n.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"flex items-center gap-2 text-xl font-semibold",children:[n.jsx(an,{className:"h-5 w-5 text-cyan-300"}),"Sample Report access"]}),n.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Page loads for the public Sample Report, split by signed-in and anonymous visitors. Anonymous figures are access counts, not guaranteed unique people."})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"inline-flex rounded-lg border border-white/10 bg-white/5 p-0.5 text-xs",children:[7,30].map(p=>n.jsxs("button",{type:"button",onClick:()=>o(p),className:`rounded-md px-2.5 py-1 font-medium ${r===p?"bg-white/10 text-white":"text-slate-300 hover:text-white"}`,children:[p,"d"]},p))}),n.jsxs("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 rounded-md border border-white/10 bg-white/5 px-2.5 py-1 text-xs font-medium text-slate-200 hover:bg-white/10",title:"Reload Sample Report access data",children:[n.jsx(sn,{className:"h-3.5 w-3.5"}),"Refresh"]})]})]}),s?n.jsxs("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:["Couldn't load Sample Report access: ",s]}):t&&!e?n.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading…"]}):e?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[n.jsxs("div",{className:"rounded-lg border border-cyan-300/20 bg-cyan-300/5 p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-cyan-200/80",children:"Authenticated page loads"}),n.jsx("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:wr(e.totals.authenticated)}),n.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["Last ",e.windowDays," days"]})]}),n.jsxs("div",{className:"rounded-lg border border-violet-300/20 bg-violet-300/5 p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-violet-200/80",children:"Anonymous page loads"}),n.jsx("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:wr(e.totals.anonymous)}),n.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["Last ",e.windowDays," days"]})]}),n.jsxs("div",{className:"rounded-lg border border-emerald-300/20 bg-emerald-300/5 p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-emerald-200/80",children:"Distinct signed-in accounts"}),n.jsx("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:wr(e.distinctAuthenticatedUsers)}),n.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["Viewed in the last ",e.windowDays," days"]})]})]}),n.jsxs("div",{className:"mt-5 rounded-lg border border-white/10 bg-white/[0.02] p-4",children:[n.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-semibold",children:"Daily access"}),n.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"UTC calendar days; quiet days are omitted."})]}),t&&n.jsx(Me,{className:"h-4 w-4 animate-spin text-slate-500"})]}),d.length===0?n.jsxs("div",{className:"rounded-md border border-white/10 px-3 py-5 text-center text-sm text-slate-500",children:["No Sample Report accesses recorded in the last ",e.windowDays," days."]}):n.jsx("div",{className:"space-y-2",children:d.map(p=>{const f=p.authenticated+p.anonymous,m=Math.max(3,Math.round(f/h*100)),x=f>0?p.authenticated/f*100:0;return n.jsxs("div",{className:"grid grid-cols-[4.5rem_1fr_auto] items-center gap-3 text-xs",children:[n.jsx("span",{className:"font-mono text-slate-400",children:p.day}),n.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-white/5",children:n.jsx("div",{className:"flex h-full min-w-[3px] rounded-full bg-violet-400/70",style:{width:`${m}%`},title:`${f} total page loads`,children:n.jsx("div",{className:"h-full bg-cyan-300/80",style:{width:`${x}%`}})})}),n.jsxs("span",{className:"tabular-nums text-slate-300",children:[f,n.jsxs("span",{className:"ml-2 text-slate-500",children:["(",p.authenticated," signed in · ",p.anonymous," anonymous)"]})]})]},p.day)})})]})]}):null]})}const q3={authentication_failure:"Authentication failures",admin_access_de
284nied:"Blocked admin access",rate_limit_exceeded:"Rate-limit blocks",reconnaissance_probe:"Reconnaissance probes",reconnaissance_blocked:"Reconnaissance requests blocked"};function iq({data:e,loading:t,error:s,days:r,onDaysChange:o,onRefresh:c}){return n.jsxs("section",{className:"mb-6 rounded-xl border border-amber-300/20 bg-amber-300/[0.03] p-5",children:[n.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"flex items-center gap-2 text-xl font-semibold",children:[n.jsx(mh,{className:"h-5 w-5 text-amber-300"}),"Security monitor"]}),n.jsx("p",{className:"mt-1 max-w-3xl text-xs text-slate-400",children:"Suspicious API activity including failed authentication, blocked admin access, rate-limit abuse and common reconnaissance probes. Suspicious sources show coarse location and masked addresses. Raw IP addresses, request bodies and credentials are not stored."})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"inline-flex rounded-lg border border-white/10 bg-white/5 p-0.5 text-xs",children:[7,30].map(d=>n.jsxs("button",{type:"button",onClick:()=>o(d),className:`rounded-md px-2.5 py-1 font-medium ${r===d?"bg-white/10 text-white":"text-slate-300 hover:text-white"}`,children:[d,"d"]},d))}),n.jsxs("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 rounded-md border border-white/10 bg-white/5 px-2.5 py-1 text-xs font-medium text-slate-200 hover:bg-white/10",children:[n.jsx(sn,{className:"h-3.5 w-3.5"}),"Refresh"]})]})]}),s?n.jsxs("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:["Couldn't load security monitoring: ",s]}):t&&!e?n.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading…"]}):e?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[n.jsxs("div",{className:"rounded-lg border border-amber-300/20 bg-amber-300/5 p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-amber-200/80",children:"Suspicious events"}),n.jsx("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:wr(e.totals.events)}),n.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["Last ",e.windowDays," days"]})]}),n.jsxs("div",{className:"rounded-lg border border-red-300/20 bg-red-300/5 p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-red-200/80",children:"High severity"}),n.jsx("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:wr(e.totals.highSeverity)}),n.jsx("div",{className:"mt-1 text-xs text-slate-400",children:"Admin denials and reconnaissance"})]}),n.jsxs("div",{className:"rounded-lg border border-sky-300/20 bg-sky-300/5 p-4",children:[n.jsx("div",{className:"text-xs uppercase tracking-wider text-sky-200/80",children:"Correlated sources"}),n.jsx("div",{className:"mt-1 text-2xl font-semibold tabular-nums",children:wr(e.totals.uniqueSources)}),n.jsx("div",{className:"mt-1 text-xs text-slate-400",children:"One-way source hashes, not raw IPs"})]})]}),n.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:e.byType.length===0?n.jsx("span",{className:"text-sm text-slate-500",children:"No suspicious activity recorded in this period."}):e.byType.map(d=>n.jsxs("span",{className:"rounded-full border border-white/10 bg-white/5 px-3 py-1 text-xs text-slate-300",children:[q3[d.eventType]??d.eventType,":"," ",n.jsx("strong",{className:"text-white",children:d.count})]},d.eventType))}),e.recent.length>0&&n.jsxs("div",{className:"mt-5 overflow-hidden rounded-lg border border-white/10",children:[n.jsx("div",{className:"border-b border-white/10 bg-white/[0.03] px-4 py-3",children:n.jsx("h3",{className:"text-sm font-semibold",children:"Recent events"})}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full min-w-[760px] text-left text-xs",children:[n.jsx("thead",{className:"bg-white/[0.02] text-slate-500",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-4 py-2 font-medium",children:"Time"}),n.jsx("th",{className:"px-4 py-2 font-medium",children:"Event"}),n.jsx("th",{className:"px-4 py-2 font-medium",children:"Request"}),n.jsx("th",{className:"px-4 py-2 font-medium",children:"Source"}),n.jsx("th",{className:"px-4 py-2 font-medium",children:"Severity"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:e.recent.map(d=>n.jsxs("tr",{children:[n.jsx("td",{className:"whitespace-nowrap px-4 py-2.5 text-slate-400",children:new Date(d.createdAt).toLocaleStr
284ing()}),n.jsx("td",{className:"px-4 py-2.5 text-slate-200",children:q3[d.eventType]??d.eventType}),n.jsxs("td",{className:"px-4 py-2.5 font-mono text-slate-400",children:[d.method," ",d.route," · ",d.statusCode]}),n.jsxs("td",{className:"px-4 py-2.5 text-slate-400",children:[n.jsx("div",{children:[d.region,d.countryName].filter(Boolean).join(", ")||"Location unavailable"}),n.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-slate-500",children:[d.maskedIp??"Address unavailable",d.countryCode?` · ${d.countryCode}`:""]})]}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:`rounded-full border px-2 py-0.5 font-medium ${d.severity==="high"?"border-red-300/30 bg-red-300/10 text-red-200":"border-amber-300/30 bg-amber-300/10 text-amber-200"}`,children:d.severity})})]},d.id))})]})})]})]}):null]})}function oq(){const[e,t]=w.useState(null),[s,r]=w.useState(!0),[o,c]=w.useState(null),[d,h]=w.useState(7),[p,f]=w.useState(null),[m,x]=w.useState(0);w.useEffect(()=>{let v=!1;return r(!0),c(null),Ct(`/admin/errors?days=${d}&limit=100`).then(j=>{v||(t(j),r(!1))}).catch(j=>{v||(c(j instanceof Error?j.message:"Failed to load"),r(!1))}),()=>{v=!0}},[d,m]);const y=e?.errors??[];return n.jsxs("section",{className:"mb-6 rounded-xl border border-white/10 bg-white/[0.03] p-5",children:[n.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"flex items-center gap-2 text-xl font-semibold",children:[n.jsx(el,{className:"h-5 w-5 text-amber-300"}),"Recent server errors"]}),n.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Per-request 5xx responses from the API, newest first. Click a row to see the message and stack trace."})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"inline-flex rounded-lg border border-white/10 bg-white/5 p-0.5 text-xs",children:[7,30].map(v=>n.jsxs("button",{onClick:()=>h(v),className:`rounded-md px-2.5 py-1 font-medium ${d===v?"bg-white/10 text-white":"text-slate-300 hover:text-white"}`,children:[v,"d"]},v))}),n.jsxs("button",{onClick:()=>x(v=>v+1),className:"inline-flex items-center gap-1 rounded-md border border-white/10 bg-white/5 px-2.5 py-1 text-xs font-medium text-slate-200 hover:bg-white/10",title:"Reload",children:[n.jsx(sn,{className:"h-3.5 w-3.5"}),"Refresh"]})]})]}),o?n.jsxs("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:["Couldn't load errors: ",o]}):s?n.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading…"]}):y.length===0?n.jsxs("div",{className:"rounded-lg border border-emerald-300/20 bg-emerald-300/5 px-3 py-6 text-center text-sm text-emerald-100",children:["No server errors recorded in the last ",d," days."]}):n.jsx("div",{className:"overflow-hidden rounded-lg border border-white/10",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{className:"bg-white/5 text-left text-[10px] uppercase tracking-wider text-slate-500",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-3 py-2",children:"When"}),n.jsx("th",{className:"px-3 py-2",children:"Status"}),n.jsx("th",{className:"px-3 py-2",children:"Route"}),n.jsx("th",{className:"px-3 py-2",children:"User"}),n.jsx("th",{className:"px-3 py-2",children:"Message"}),n.jsx("th",{className:"px-3 py-2"})]})}),n.jsx("tbody",{children:y.map(v=>{const j=p===v.id;return n.jsxs(w.Fragment,{children:[n.jsxs("tr",{className:"cursor-pointer border-t border-white/5 hover:bg-white/[0.03]",onClick:()=>f(j?null:v.id),children:[n.jsx("td",{className:"px-3 py-2 whitespace-nowrap text-slate-300",title:new Date(v.occurred_at).toLocaleString(),children:Go(v.occurred_at)}),n.jsx("td",{className:"px-3 py-2",children:n.jsx("span",{className:"inline-flex items-center rounded-md border border-red-400/30 bg-red-400/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-red-200",children:v.status_code})}),n.jsxs("td",{className:"px-3 py-2 text-slate-200",children:[n.jsx("div",{children:gN(v.method,v.route)}),n.jsxs("div",{className:"font-mono text-[10px] text-slate-500",children:[v.method," ",v.route]})]}),n.jsx("td",{className:"px-3 py-2 text-slate-300",children:v.user_email??n.jsx("span",{className:"text-slate-500",children:"—"})}),n.jsx("td",{className:"max-w-[24rem] truncate px-3 py-2 text-slate-300",children:v.message??n.jsx("span",{className:"text-slate-500",children:"No message captured"})}),n.jsx("td",{className:"px-3 py-2 text-right text-slate-500",children:j?n.jsx(Zc,{className:"ml-auto h-4 w-4"}):n.jsx(Gh,{className:"ml-auto h-4 w-4"})})]}),j&&n.jsx("tr",{className:"bg-black/30",children:n.jsxs("td",{colSpan:6,className:"px-4 py-3",children:[n.jsxs("div",{className:"grid grid-cols-1 gap-3 text-[11px] md:grid-cols-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-slate-500",children:"Occurred"}),n.jsx("div",{className:"font-mono text-slate-200",children:new Date(v.occurred_at).toLocaleStr
284ing()})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-slate-500",children:"Client"}),n.jsxs("div",{className:"text-slate-200",children:[xN[v.client]??v.client," ·"," ",v.duration_ms,"ms"]})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-slate-500",children:"User"}),n.jsx("div",{className:"text-slate-200",children:v.user_email??"(unauthenticated)"}),v.user_id&&n.jsx("div",{className:"font-mono text-[10px] text-slate-500",children:v.user_id})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-slate-500",children:"Request ID"}),n.jsx("div",{className:"font-mono text-[10px] text-slate-400",children:v.request_id??"—"})]})]}),v.message&&n.jsxs("div",{className:"mt-3",children:[n.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-slate-500",children:"Message"}),n.jsx("pre",{className:"max-h-40 overflow-auto rounded border border-white/10 bg-black/40 p-2 font-mono text-[11px] text-red-200 whitespace-pre-wrap break-words",children:v.message})]}),v.stack&&n.jsxs("div",{className:"mt-3",children:[n.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-slate-500",children:"Stack"}),n.jsx("pre",{className:"max-h-72 overflow-auto rounded border border-white/10 bg-black/40 p-2 font-mono text-[10px] text-slate-300 whitespace-pre",children:v.stack})]}),!v.message&&!v.stack&&n.jsxs("div",{className:"mt-3 text-[11px] text-slate-500",children:["No exception was thrown for this request — the handler returned a 5xx response directly. Check the server logs around"," ",new Date(v.occurred_at).toLocaleString()," for more context."]})]})})]},v.id)})})]})})]})}function lq({adminEmail:e}){const[t,s]=w.useState([]),[r,o]=w.useState(!0),[c,d]=w.useState(null),[h,p]=w.useState(null),[f,m]=w.useState(!1),[x,y]=w.useState(!1),[v,j]=w.useState(null),[k,S]=w.useState(null),[N,C]=w.useState("all"),[E,O]=w.useState(null),[P,M]=w.useState(!1),[B,A]=w.useState(null),[L,U]=w.useState(null),[K,G]=w.useState(!1),[W,ee]=w.useState(null),[te,I]=w.useState(null),[V,H]=w.useState(7),[se,R]=w.useState(null),[Q,oe]=w.useState(null),[ne,le]=w.useState(null),[fe,he]=w.useState(null),[Ne,J]=w.useState(7),[ue,ye]=w.useState(!1),[Le,ot]=w.useState(null),[Je,jt]=w.useState(0),[Ia,Is]=w.useState(null),[Wt,oa]=w.useState(7),[la,Ss]=w.useState(!1),[pe,Qe]=w.useState(null),[rs,Yt]=w.useState(0),[We,gt]=w.useState(null),[lt,Et]=w.useState(null),[ct,fs]=w.useState(!1),$s=["overview","users","invoices","support","costs","free-searches","sitemap","db-health"];function $a(){if(typeof window>"u")return{view:"overview",userDetailId:null};const Z=window.location.hash.replace(/^#/,""),[ce,Ie]=Z.split("/");if(ce==="users"&&Ie){let He;try{He=decodeURIComponent(Ie)}catch{return{view:"users",userDetailId:null}}return{view:"users",userDetailId:He}}return $s.includes(ce)?{view:ce,userDetailId:null}:{view:"overview",userDetailId:null}}const Ns=$a(),[dt,Qt]=w.useState(Ns.view),[ut,ys]=w.useState(Ns.userDetailId);w.useEffect(()=>{function Z(){const ce=$a();Qt(ce.view),ys(ce.userDetailId)}return window.addEventListener("hashchange",Z),()=>window.removeEventListener("hashchange",Z)},[]);function Cs(Z,ce){if(Qt(Z),ys(ce??null),typeof window<"u"){const Ie=ce&&Z==="users"?`#users/${encodeURIComponent(ce)}`:`#${Z}`;window.location.hash!==Ie&&window.history.replaceState(null,"",Ie)}}const[ln,Es]=w.useState(null);w.useEffect(()=>{let Z=!1;return Ct("/admin/support-messages?status=open").then(ce=>{Z||Es(ce.messages.length)}).catch(()=>{Z||Es(null)}),()=>{Z=!0}},[dt]),w.useEffect(()=>{let Z=!1;return le(null),Ct("/admin/activity/overview").then(ce=>{Z||oe(ce)}).catch(ce=>{Z||le(ce instanceof Error?ce.message:"Failed to load")}),()=>{Z=!0}},[]),w.useEffect(()=>{let Z=!1;return ot(null),ye(!0),Ct(`/admin/activity/sample-report?days=${Ne}`).then(ce=>{Z||(he(ce),ye(!1))}).catch(ce=>{Z||(ot(ce instanceof Error?ce.message:"Failed to load"),ye(!1))}),()=>{Z=!0}},[Ne,Je]),w.useEffect(()=>{let Z=!1;return Qe(null),Ss(!0),Ct(`/admin/security/events?days=${Wt}`).then(ce=>{Z||(Is(ce),Ss(!1))}).catch(ce=>{Z||(Qe(ce instanceof Error?ce.message:"Failed to load"),Ss(!1))}),()=>{Z=!0}},[Wt,rs]),w.useEffect(()=>{let Z=!1;return R(null),Ct(`/admin/usage/by-client?days=${V}`).then(ce=>{Z||I(ce)}).catch(ce=>{Z||R(ce instanceof Error?ce.message:"Failed to load")}),()=>{Z=!0}},[V]),w.useEffect(()=>{if(dt!=="costs")return;let Z=!1;return Et(null),fs(!0),Ct("/admin/costs").then(ce=>{Z||(gt(ce),fs(!1))}).catch(ce=>{Z||(Et(ce instanceof Error?ce.message:"Failed to load"),fs(!1))}),()=>{Z=!0}},[dt]);const Ts=w.useMemo(()=>{let Z=0,ce=0,Ie=0;for(const He of t){const St=Wg(He);if(St==="active"){Z+=1;const Us=Dh(He.trial_ends_at);Us!==null&&Us<=3&&Us>0&&(ce+=1)}else St==="expired"&&(Ie+=1)}return{active:Z,ending:ce,expired:Ie}},[t]),de=w.useMemo(()=>N==="all"?t:t.filter(Z=>{const ce=Wg(Z);if(N==="active")return ce==="active";if(N==="expired")return ce==="expired";if(ce!=="active")return!1;const Ie=Dh(Z.trial_ends_at);return Ie!==null&&Ie>0&&Ie<=3}),[t,N]);w.useEffect(()=>{let Z=!1;return wt.auth.getUser().then(({data:ce})=>{Z||S(ce.user?.id??null)}),()=>{Z=!0}},[]);const Xe=w.useCallback(async()=>{o(!0),d(null);try{const Z=await Ct("/admin/profiles");s(Z.profiles)}catch(Z){d(Z instanceof Error?Z.message:"Failed to load profiles")}finally{o(!1)}},[]);w.useEffect(()=>{Xe()},[Xe]);async function is(){y(!0),j(null);try{const Z=await Ct("/admin/sync-orphans",{method:"POST"});j(Z.inserted===0?"All Supabase users already have profiles.":`Imported ${Z.inserted} orphan${Z.inserted===1?"":"s"}: ${Z.orphans.join(", ")}`),await Xe()}catch(Z){j(Z instanceof Error?Z.message:"Sync failed")}finally{y(!1)}}w.useEffect(()=>{if(!ut){O(null),A(null),M(!1),U(null),ee(null),G(!1);return}let Z=!1;return O(null),A(null),M(!0),U(null),ee(null),G(!0),Ct(`/admin/profiles/${ut}/api-usage?days=30`).then(ce=>{Z||O(ce)}).catch(ce=>{Z||A(ce instanceof Error?ce.message:"Failed to load usage")}).finally(()=>{Z||M(!1)}),Ct(`/admin/profiles/${ut}/activity`).then(ce=>{Z||U(ce)}).catch(ce=>{Z||ee(ce instanceof Error?ce.message:"Failed to load activity")}).finally(()=>{Z||G(!1)}),()=>{Z=!0}},[ut]);async function Dt(Z,ce){if(window.confirm(`Extend the Pro trial for ${ce??"this account"} by 7 days?
285
286If the trial is still active, 7 days will be added to the existing end date.
287If it has already expired, a fresh 7-day window starts today.`)){p(Z);try{await Ct(`/admin/profiles/${Z}/extend-trial`,{method:"POST"}),await Xe()}catch(He){alert(He instanceof Error?He.message:"Failed to extend trial")}finally{p(null)}}}async function Ua(Z,ce){p(Z);try{await Ct(`/admin/profiles/${Z}/tier`,{method:"PATCH",body:JSON.stringify({tier:ce})}),await Xe()}catch(Ie){alert(Ie instanceof Error?Ie.message:"Failed")}finally{p(null)}}async function Si(Z,ce){if(!ce){alert("This profile has no email on file.");return}if(window.confirm(`Send a password reset link to ${ce}?
288
289They'll receive a branded Scapely email with a secure link valid for 60 minutes.`)){p(Z);try{await Ct(`/admin/profiles/${Z}/password-reset`,{method:"POST"}),alert(`Password reset link sent to ${ce}.`)}catch(He){alert(He instanceof Error?He.message:"Failed to send reset email")}finally{p(null)}}}async function ul(Z,ce){const Ie=ce??Z;if(!window.confirm(`Delete ${Ie}?
290
291This permanently removes their account, profile, watchlist and appraisal history. This cannot be undone.`))return!1;p(Z);try{return await Ct(`/admin/profiles/${Z}`,{method:"DELETE"}),await Xe(),!0}catch(St){return alert(St instanceof Error?St.message:"Delete failed"),!1}finally{p(null)}}return n.jsxs("div",{className:"min-h-screen bg-slate-950 text-white [scrollbar-gutter:stable]",children:[n.jsx("header",{className:"border-b border-white/10 py-4",children:n.jsxs("div",{className:"mx-auto flex max-w-7xl items-center gap-3 px-4 sm:px-6",children:[n.jsx("img",{src:ol,alt:"Scapely",className:"h-7 w-7 rounded-lg"}),n.jsx("span",{className:"rounded-full border border-emerald-300/30 bg-emerald-300/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-emerald-200",children:"Admin"}),n.jsx(Be,{href:"/admin/features",className:"ml-3 inline-flex items-center gap-1 rounded-md border border-white/10 px-2 py-1 text-xs text-slate-300 hover:bg-white/5",children:"Features reference"}),n.jsx("span",{className:"ml-auto text-xs text-slate-400",children:e}),n.jsxs("button",{onClick:()=>wt.auth.signOut(),className:"flex items-center gap-1 rounded-md border border-white/10 px-2 py-1 text-xs text-slate-300 hover:bg-white/5","aria-label":"Sign out",children:[n.jsx(Qh,{className:"h-3.5 w-3.5"})," Sign out"]})]})}),n.jsxs("div",{className:"mx-auto flex max-w-7xl gap-6 px-4 py-6 sm:px-6",children:[n.jsx("aside",{className:"w-52 shrink-0","data-testid":"nav-admin",children:n.jsx("nav",{className:"sticky top-6 space-y-1 text-sm",children:[{key:"overview",label:"Overview",icon:l7},{key:"users",label:"Users",icon:bi,badge:t.length||null},{key:"invoices",label:"Invoices",icon:Zh},{key:"support",label:"Support",icon:m7,badge:ln??null,badgeTone:ln&&ln>0?"alert":void 0},{key:"costs",label:"AI Costs",icon:Um},{key:"free-searches",label:"Free searches",icon:Ra},{key:"sitemap",label:"Site map",icon:vx},{key:"db-health",label:"DB health",icon:X0}].map(Z=>{const ce=Z.icon,Ie=dt===Z.key,He="badge"in Z?Z.badge??null:null,St="badgeTone"in Z?Z.badgeTone:void 0;return n.jsxs("button",{type:"button",onClick:()=>Cs(Z.key),className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left font-medium transition ${Ie?"bg-white/10 text-white":"text-slate-300 hover:bg-white/5 hover:text-white"}`,"data-testid":`nav-admin-${Z.key}`,"aria-current":Ie?"page":void 0,children:[n.jsx(ce,{className:"h-4 w-4 shrink-0"}),n.jsx("span",{className:"flex-1",children:Z.label}),He!==null&&n.jsx("span",{className:`inline-flex min-w-[1.25rem] items-center justify-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold ${St==="alert"?"bg-amber-400/20 text-amber-200":"bg-white/10 text-slate-300"}`,children:He})]},Z.key)})})}),n.jsxs("main",{className:"min-w-0 flex-1","data-testid":"admin-view-content",children:[dt==="overview"&&n.jsxs(n.Fragment,{children:[n.jsx(aq,{overview:Q,error:ne}),n.jsx(rq,{data:fe,loading:ue,error:Le,days:Ne,onDaysChange:J,onRefresh:()=>jt(Z=>Z+1)}),n.jsx(iq,{data:Ia,loading:la,error:pe,days:Wt,onDaysChange:oa,onRefresh:()=>Yt(Z=>Z+1)}),n.jsx(oq,{}),n.jsxs("section",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-5",children:[n.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-xl font-semibold",children:"Activity by client"}),n.jsx("p",{className:"mt-1 text-xs text-slate-400",children:'Split of API traffic between the Chrome extension and the web dashboard. "Other / server" covers callers without a recognised origin (Stripe webhooks, scripts, unknown).'})]}),n.jsx("div",{className:"inline-flex rounded-lg border border-white/10 bg-white/5 p-0.5 text-xs",children:[7,30].map(Z=>n.jsxs("button",{onClick:()=>H(Z),className:`rounded-md px-2.5 py-1 font-medium ${V===Z?"bg-white/10 text-white":"text-slate-300 hover:text-white"}`,children:[Z,"d"]},Z))})]}),se?n.jsx("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:se}):te?(()=>{const Z=["extension","web","unknown"],ce=new Map(te.totals.map(He=>[He.client,He])),Ie=Z.map(He=>{const St=ce.get(He)??{request_count:0,error_count:0,active_users:0},Us=te.totals.reduce((hl,Ci)=>hl+Ci.request_count,0),Ni=Us>0?Math.round(St.request_count/Us*100):0;return n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.02] p-4",children:[n.jsx("div",{className:`mb-2 inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${U3[He]??U3.unknown}`,children:xN[He]??He}),n.jsxs("div",{className:"flex items-baseline gap-2",children:[n.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:wr(St.request_count)}
291),n.jsxs("div",{className:"text-xs text-slate-400",children:[Ni,"% of traffic"]})]}),n.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-slate-400",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-slate-500",children:"Users: "}),n.jsx("span",{className:"text-slate-200 tabular-nums",children:St.active_users})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-slate-500",children:"Errors: "}),n.jsx("span",{className:`tabular-nums ${St.error_count>0?"text-red-300":"text-slate-200"}`,children:St.error_count})]})]})]},He)});return n.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:Ie})})():n.jsx("div",{className:"text-sm text-slate-400",children:"Loading…"})]})]}),dt==="users"&&ut&&n.jsx(nq,{profile:t.find(Z=>Z.id===ut)??null,usage:E,usageLoading:P,usageError:B,activity:L,activityLoading:K,activityError:W,busy:h===ut,isSelf:ut===k,onBack:()=>Cs("users"),onExtendTrial:Z=>Dt(ut,Z),onChangeTier:Z=>Ua(ut,Z),onSendReset:Z=>Si(ut,Z),onDelete:async Z=>{await ul(ut,Z)&&Cs("users")}}),dt==="users"&&!ut&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[n.jsx("div",{children:n.jsx("h2",{className:"text-xl font-semibold",children:"User profiles"})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:is,disabled:x,title:"Import any Supabase Auth users that don't yet have a profile row",className:"flex items-center gap-2 rounded-lg border border-white/15 bg-white/5 px-3 py-2 text-sm font-medium text-slate-200 hover:bg-white/10 disabled:opacity-60",children:[x?n.jsx(Me,{className:"h-4 w-4 animate-spin"}):n.jsx(sn,{className:"h-4 w-4"}),"Sync orphans"]}),n.jsxs("button",{onClick:()=>m(Z=>!Z),className:"flex items-center gap-2 rounded-lg bg-emerald-400 px-3 py-2 text-sm font-semibold text-slate-950 hover:bg-emerald-300",children:[n.jsx(S7,{className:"h-4 w-4"}),"New user"]})]})]}),v&&n.jsx("div",{className:"mb-4 rounded-lg border border-emerald-300/30 bg-emerald-300/10 px-3 py-2 text-xs text-emerald-100",children:v}),f&&n.jsx(bq,{onCreated:()=>{m(!1),Xe()},onCancel:()=>m(!1)}),c&&n.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:[n.jsx(en,{className:"mt-0.5 h-4 w-4 flex-none"}),c]}),r?n.jsxs("div",{className:"flex items-center gap-2 py-8 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading…"]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2 text-xs",children:[n.jsx("span",{className:"text-slate-400",children:"Filter:"}),[{key:"all",label:`All (${t.length})`},{key:"active",label:`Active trials (${Ts.active})`},{key:"ending",label:`Ending soon (${Ts.ending})`},{key:"expired",label:`Expired trials (${Ts.expired})`}].map(Z=>n.jsx("button",{onClick:()=>C(Z.key),className:`rounded-md border px-2 py-1 font-medium transition ${N===Z.key?"border-purple-300/50 bg-purple-300/15 text-purple-100":"border-white/10 bg-white/5 text-slate-300 hover:bg-white/10"}`,children:Z.label},Z.key))]}),n.jsx("div",{className:"overflow-hidden rounded-xl border border-white/10",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{className:"bg-white/5 text-left text-xs uppercase tracking-wider text-slate-400",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-4 py-3",children:"Email"}),n.jsx("th",{className:"px-4 py-3",children:"Current tier"}),n.jsx("th",{className:"px-4 py-3",children:"Last active"}),n.jsx("th",{className:"px-4 py-3",children:"Joined"}),n.jsx("th",{className:"px-4 py-3 text-right",children:"Set tier"}),n.jsx("th",{className:"px-4 py-3 text-right",children:"Actions"})]})}),n.jsxs("tbody",{children:[de.length===0&&n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-slate-500",children:N==="all"?"No profiles yet — once a user signs up via the extension they'll appear here.":"No accounts match this filter."})}),de.map(Z=>n.jsxs("tr",{onClick:()=>Cs("users",Z.id),onKeyDown:ce=>{(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),Cs("users",Z.id))},role:"button",tabIndex:0,title:"Open full user profile",className:"cursor-pointer border-t border-white/10 outline-none hover:bg-white/[0.04] focus-visible:bg-white/[0.06] focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-emerald-300/40",children:[n.jsx("td",{className:"max-w-[260px] truncate px-4 py-3 font-mono text-xs",title:Z.email??void 0,children:Z.email??n.jsx("span",{className:"text-slate-500",children:"—"})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(yN,{tier:Z.tier})}),n.jsx("td",{className:"px-4 py-3 text-xs text-slate-400",title:Z.last_active_at?new Date(Z.last_active_at).toLocaleStr
291ing():"No API activity in the last 30 days",children:Go(Z.last_active_at)}),n.jsx("td",{className:"px-4 py-3 text-xs text-slate-400",children:Z.created_at?new Date(Z.created_at).toLocaleDateString():"—"}),n.jsx("td",{className:"px-4 py-3 text-right",onClick:ce=>ce.stopPropagation(),children:n.jsxs("select",{disabled:h===Z.id,value:Z.tier,onChange:ce=>Ua(Z.id,ce.target.value),className:"rounded-md border border-white/10 bg-slate-900 px-2 py-1 text-xs text-white outline-none focus:border-emerald-300/50",children:[n.jsx("option",{value:"free",children:"Free"}),n.jsx("option",{value:"pro",children:"Pro"}),n.jsx("option",{value:"enterprise",children:"Enterprise"})]})}),n.jsx("td",{className:"px-4 py-3 text-right",onClick:ce=>ce.stopPropagation(),children:n.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[n.jsxs("button",{onClick:()=>Dt(Z.id,Z.email),disabled:h===Z.id||Z.trial_status==="converted",title:Z.trial_status==="converted"?"Account is on a paid plan — manage via Stripe":"Extend Pro trial by 7 days",className:"inline-flex items-center gap-1 rounded-md border border-emerald-300/30 bg-emerald-300/10 px-2 py-1 text-xs font-medium text-emerald-100 hover:bg-emerald-300/20 disabled:cursor-not-allowed disabled:opacity-40",children:[n.jsx(yk,{className:"h-3.5 w-3.5"}),"+7d"]}),n.jsxs("button",{onClick:()=>Si(Z.id,Z.email),disabled:h===Z.id||!Z.email,title:Z.email?`Email a password reset link to ${Z.email}`:"No email on file",className:"inline-flex items-center gap-1 rounded-md border border-cyan-300/30 bg-cyan-300/10 px-2 py-1 text-xs font-medium text-cyan-100 hover:bg-cyan-300/20 disabled:cursor-not-allowed disabled:opacity-40",children:[n.jsx(Wh,{className:"h-3.5 w-3.5"}),"Reset"]}),n.jsxs("button",{onClick:()=>ul(Z.id,Z.email),disabled:h===Z.id||Z.id===k,title:Z.id===k?"You can't delete your own admin account":"Permanently delete this account",className:"inline-flex items-center gap-1 rounded-md border border-red-400/30 bg-red-400/10 px-2 py-1 text-xs font-medium text-red-200 hover:bg-red-400/20 disabled:cursor-not-allowed disabled:opacity-40",children:[n.jsx(Xh,{className:"h-3.5 w-3.5"}),"Delete"]})]})})]},Z.id))]})]})})]}),n.jsxs("p",{className:"mt-6 text-xs text-slate-500",children:["Tip: any tier other than ",n.jsx("span",{className:"text-slate-300",children:"Free"})," ","is recorded as a comp grant tagged with your admin email — when Stripe billing ships, paid upgrades will show as"," ",n.jsx("span",{className:"text-slate-300",children:"Stripe"})," instead."]})]}),dt==="invoices"&&n.jsx(xq,{}),dt==="support"&&n.jsx(gq,{}),dt==="costs"&&(()=>{const St=We?We.total_tracked_input*3e-6+We.total_tracked_output*15e-6:0,Us=We?We.total_untracked*(4e3*3e-6+1500*15e-6):0,Ni=St+Us,hl=We?We.total_appraisals-We.total_untracked:0,Ci=st=>st.tracked_input*3e-6+st.tracked_output*15e-6+st.untracked_count*(4e3*3e-6+1500*15e-6),Pr=st=>st==="enterprise"?"text-violet-300 bg-violet-400/10 border-violet-400/30":st==="pro"?"text-emerald-300 bg-emerald-400/10 border-emerald-400/30":"text-slate-400 bg-white/5 border-white/10";return n.jsxs("section",{"data-testid":"section-costs",children:[n.jsxs("div",{className:"mb-5 flex items-center gap-2",children:[n.jsx(Um,{className:"h-5 w-5 text-amber-300"}),n.jsx("h2",{className:"text-xl font-semibold",children:"AI Cost Dashboard"})]}),n.jsxs("p",{className:"mb-5 text-xs text-slate-400",children:["Estimated Anthropic spend per user based on token usage. Rates: ",n.jsx("span",{className:"font-mono text-slate-300",children:"$3/MTok input · $15/MTok output"})," (Claude Sonnet 4). Historical appraisals without token data are estimated at 4 000 in + 1 500 out each."]}),ct&&n.jsxs("div",{className:"flex items-center gap-2 py-12 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading cost data…"]}),lt&&n.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-red-400/30 bg-red-400/10 p-4 text-sm text-red-200",children:[n.jsx(en,{className:"h-4 w-4 shrink-0"})," ",lt]}),We&&!ct&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"mb-6 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[{label:"Total estimated spend",value:`$${Ni.toFixed(4)}`,sub:"tracked + estimated",accent:"text-amber-300",icon:an},{label:"Tracked spend",value:`$${St.toFixed(4)}
291`,sub:`${hl.toLocaleString()} appraisals with token data`,accent:"text-emerald-300",icon:Um},{label:"Untracked (estimated)",value:`$${Us.toFixed(4)}`,sub:`${We.total_untracked.toLocaleString()} historical appraisals`,accent:"text-slate-300",icon:en},{label:"Total appraisals",value:We.total_appraisals.toLocaleString(),sub:`across ${We.rows.length} users`,accent:"text-cyan-300",icon:bi}].map(st=>{const Sn=st.icon;return n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-4",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-400",children:[n.jsx(Sn,{className:"h-3.5 w-3.5"}),st.label]}),n.jsx("div",{className:`mt-1.5 font-mono text-2xl font-semibold tabular-nums ${st.accent}`,children:st.value}),n.jsx("div",{className:"mt-0.5 text-[11px] text-slate-500",children:st.sub})]},st.label)})}),We.rows.length===0?n.jsx("p",{className:"py-8 text-center text-sm text-slate-500",children:"No appraisal data yet. Costs will appear here once users run their first scans."}):n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-5",children:[n.jsx("h3",{className:"mb-3 text-sm font-semibold text-slate-200",children:"Per-user breakdown"}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-white/10 text-left text-[11px] uppercase tracking-wider text-slate-500",children:[n.jsx("th",{className:"pb-2 pr-4 font-medium",children:"User"}),n.jsx("th",{className:"pb-2 pr-4 font-medium",children:"Tier"}),n.jsx("th",{className:"pb-2 pr-4 text-right font-medium",children:"Appraisals"}),n.jsx("th",{className:"pb-2 pr-4 text-right font-medium",children:"Input tokens"}),n.jsx("th",{className:"pb-2 pr-4 text-right font-medium",children:"Output tokens"}),n.jsx("th",{className:"pb-2 pr-4 text-right font-medium",children:"Untracked"}),n.jsx("th",{className:"pb-2 text-right font-medium",children:"Est. cost (USD)"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:We.rows.map(st=>{const Sn=Ci(st);return n.jsxs("tr",{className:"hover:bg-white/[0.02]",children:[n.jsx("td",{className:"py-2.5 pr-4 font-mono text-slate-300 max-w-[200px] truncate",children:st.email}),n.jsx("td",{className:"py-2.5 pr-4",children:n.jsx("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${Pr(st.tier)}`,children:st.tier})}),n.jsx("td",{className:"py-2.5 pr-4 text-right tabular-nums text-slate-200",children:st.appraisal_count.toLocaleString()}),n.jsx("td",{className:"py-2.5 pr-4 text-right tabular-nums text-slate-400",children:st.tracked_input>0?st.tracked_input.toLocaleString():"—"}),n.jsx("td",{className:"py-2.5 pr-4 text-right tabular-nums text-slate-400",children:st.tracked_output>0?st.tracked_output.toLocaleString():"—"}),n.jsx("td",{className:"py-2.5 pr-4 text-right tabular-nums text-slate-500",children:st.untracked_count>0?n.jsx("span",{className:"text-amber-400/70",children:st.untracked_count}):"0"}),n.jsxs("td",{className:`py-2.5 text-right font-mono tabular-nums font-semibold ${Sn>.01?"text-amber-300":"text-slate-400"}`,children:["$",Sn.toFixed(4)]})]},st.user_id)})}),n.jsx("tfoot",{children:n.jsxs("tr",{className:"border-t border-white/10 font-semibold text-slate-200",children:[n.jsx("td",{className:"pt-2.5 pr-4",children:"Total"}),n.jsx("td",{className:"pt-2.5 pr-4"}),n.jsx("td",{className:"pt-2.5 pr-4 text-right tabular-nums",children:We.total_appraisals.toLocaleString()}),n.jsx("td",{className:"pt-2.5 pr-4 text-right tabular-nums text-slate-300",children:We.total_tracked_input.toLocaleString()}),n.jsx("td",{className:"pt-2.5 pr-4 text-right tabular-nums text-slate-300",children:We.total_tracked_output.toLocaleString()}),n.jsx("td",{className:"pt-2.5 pr-4 text-right tabular-nums text-amber-400/70",children:We.total_untracked.toLocaleString()}),n.jsxs("td",{className:"pt-2.5 text-right font-mono tabular-nums text-amber-300",children:["$",Ni.toFixed(4)]})]})})]})})]})]})]})})(),dt==="free-searches"&&n.jsx(hq,{}),dt==="sitemap"&&n.jsx(fq,{}),dt==="db-health"&&n.jsx(pq,{})]})]})]})}const Yg=[{id:"marketing",label:"Marketing & public",defaultOpen:!0,entries:[{path:"/",title:"Home",hint:"Landing page + hero + waitlist"},{path:"/pricing",title:"Pricing",hint:"Free / Pro / Enterprise tiers"},{path:"/extension-preview",title:"Extension preview",hint:"Interactive demo of the Chrome extension sidebar"},{path:"/faq",title:"FAQ",hint:"Common questions about Scapely"},{path:"/glossary",title:"Glossary",hint:"UK property-development terms (A–Z)"},{path:"/alternatives",title:"Alternatives",hint:"Comparison vs other PropTech tools"},{path:"/privacy",title:"Privacy policy"},{path:"/terms",title:"Terms of service"}]},{id:"account",label:"Account & app",defaultOpen:!0,entries:[{path:"/dashboard",title:"Dashboard",hint:"Signed-in user dashboard — watchlist, AI appraisals, scenarios"},{path:"/billing/success",title:"Billing success",hint:"Post-Stripe-checkout confirmation page"},{path:"/reset-password",title:"Reset password",hint:"Set a new password from the email reset link"}]},{id:"admin",label:"Admin",defaultOpen:!0,entries:[{path:"/admin",title:"Admin (this page)",hint:"Profiles, invoices, site map"}]}];function cq(e){const t=e.lastIndexOf("|");return t===-1?e.trim():e.slice(0,t).trim()}function dq(e){return{path:e.path,title:cq(e.meta.title)}}function uq(){const e=mB(),t=[],s=[],r=[],o=[],c=[],d=[],h=new Set(Yg.flatMap(f=>f.entries.map(m=>m.path)));for(const f of e){const m=dq(f);if(h.has(m.path))continue;
291const x=m.path.split("/").filter(Boolean);x.length===1?t.push(m):x[0]==="councils"&&x.length===2?s.push(m):x[0]==="councils"&&x.length===4?c.push(m):x[0]==="strategies"&&x.length===2?r.push(m):x[0]==="postcodes"&&x.length===2?o.push(m):d.push(m)}const p=(f,m)=>f.title.localeCompare(m.title);return s.sort(p),r.sort(p),o.sort(p),c.sort(p),d.sort(p),[{id:"seo-indexes",label:"SEO landing-page indexes",defaultOpen:!0,entries:t},{id:"councils",label:"Council guides",defaultOpen:!1,entries:s},{id:"strategies",label:"Strategy guides",defaultOpen:!1,entries:r},{id:"postcodes",label:"Postcode hot-spots",defaultOpen:!1,entries:o},{id:"council-strategy",label:"Council × Strategy combo pages",defaultOpen:!1,entries:c},...d.length>0?[{id:"longform",label:"Other long-form content",defaultOpen:!1,entries:d}]:[]]}function hq(){const[e,t]=w.useState(30),[s,r]=w.useState(null),[o,c]=w.useState(!0),[d,h]=w.useState(null);return w.useEffect(()=>{let p=!1;return c(!0),h(null),Ct(`/admin/anonymous-searches?days=${e}`).then(f=>{p||(r(f),c(!1))}).catch(f=>{p||(h(f instanceof Error?f.message:"Failed to load"),c(!1))}),()=>{p=!0}},[e]),n.jsxs("section",{"data-testid":"section-free-searches",children:[n.jsxs("div",{className:"mb-5 flex flex-wrap items-end justify-between gap-3",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ra,{className:"h-5 w-5 text-cyan-300"}),n.jsx("h2",{className:"text-xl font-semibold",children:"Free searches"}),s&&n.jsxs("span",{className:"rounded-full border border-white/10 bg-white/5 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-300",children:[s.total.toLocaleString()," in window"]})]}),n.jsx("p",{className:"mt-1 max-w-2xl text-xs text-slate-400",children:"All anonymous property lookups via the public preview endpoint — no login required. Logs include the searched address, resolved location, date/time, and approximate origin of the request."})]}),n.jsxs("select",{value:e,onChange:p=>t(Number(p.target.value)),className:"rounded-lg border border-white/10 bg-white/[0.04] px-3 py-1.5 text-xs text-white focus:outline-none",children:[n.jsx("option",{value:7,children:"Last 7 days"}),n.jsx("option",{value:30,children:"Last 30 days"}),n.jsx("option",{value:90,children:"Last 90 days"})]})]}),o&&n.jsxs("div",{className:"flex items-center gap-2 py-8 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading…"]}),d&&n.jsx("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:d}),s&&!o&&n.jsx("div",{className:"overflow-x-auto rounded-xl border border-white/10",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-white/10 text-left text-[10px] uppercase tracking-wider text-slate-400",children:[n.jsx("th",{className:"px-4 py-3 font-medium",children:"Date / Time"}),n.jsx("th",{className:"px-4 py-3 font-medium",children:"Searched address"}),n.jsx("th",{className:"px-4 py-3 font-medium",children:"Resolved as"}),n.jsx("th",{className:"px-4 py-3 font-medium",children:"Postcode"}),n.jsx("th",{className:"px-4 py-3 font-medium",children:"Searcher location"}),n.jsx("th",{className:"px-4 py-3 font-medium",children:"IP"})]})}),n.jsx("tbody",{className:"divide-y divide-white/5",children:s.rows.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"px-4 py-10 text-center text-slate-500",children:"No free searches in this period."})}):s.rows.map(p=>{const f=[p.city,p.region,p.country].filter(Boolean).join(", ");return n.jsxs("tr",{className:"hover:bg-white/[0.025]",children:[n.jsx("td",{className:"whitespace-nowrap px-4 py-2.5 tabular-nums text-slate-300",children:new Date(p.created_at).toLocaleString("en-GB",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}),n.jsx("td",{className:"max-w-[180px] truncate px-4 py-2.5 text-white",title:p.searched_address,children:p.searched_address}),n.jsx("td",{className:"max-w-[180px] truncate px-4 py-2.5 text-slate-300",title:p.resolved_address??"—",children:p.resolved_address??n.jsx("span",{className:"text-slate-600",children:"—"})}),n.jsx("td",{className:"whitespace-nowrap px-4 py-2.5 font-mono text-slate-300",children:p.postcode??n.jsx("span",{className:"text-slate-600",children:"—"})}),n.jsx("td",{className:"whitespace-nowrap px-4 py-2.5 text-slate-300",children:f||n.jsx("span",{className:"text-slate-600",children:"—"})}),n.jsx("td",{className:"whitespace-nowrap px-4 py-2.5 font-mono text-slate-500",children:p.ip_address})]}
291,p.id)})})]})})]})}function pq(){const[e,t]=w.useState([]),[s,r]=w.useState(!0),[o,c]=w.useState(null),[d,h]=w.useState(0);w.useEffect(()=>{let x=!1;return r(!0),c(null),Ct("/admin/warmup-logs?limit=50").then(y=>{x||(t(y.rows),r(!1))}).catch(y=>{x||(c(y instanceof Error?y.message:"Failed to load"),r(!1))}),()=>{x=!0}},[d]);const p=e.filter(x=>x.success).length,f=e.filter(x=>!x.success).length,m=e.length>0?Math.round(e.reduce((x,y)=>x+y.duration_ms,0)/e.length):null;return n.jsxs("section",{"data-testid":"section-db-health",children:[n.jsxs("div",{className:"mb-5 flex flex-wrap items-end justify-between gap-3",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(X0,{className:"h-5 w-5 text-cyan-300"}),n.jsx("h2",{className:"text-xl font-semibold",children:"DB health warm-ups"}),e.length>0&&n.jsxs("span",{className:"rounded-full border border-white/10 bg-white/5 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-300",children:[e.length," runs logged"]})]}),n.jsx("p",{className:"mt-1 max-w-2xl text-xs text-slate-400",children:"Automated keep-alive queries run 3× per day (every 8 hours) to prevent Supabase from pausing the project. Each run checks profiles, watchlist, appraisals, and recent searches."})]}),n.jsxs("button",{onClick:()=>h(x=>x+1),className:"inline-flex items-center gap-1 rounded-md border border-white/10 bg-white/5 px-2.5 py-1 text-xs font-medium text-slate-200 hover:bg-white/10",children:[n.jsx(sn,{className:"h-3.5 w-3.5"}),"Refresh"]})]}),e.length>0&&n.jsx("div",{className:"mb-5 grid grid-cols-3 gap-3",children:[{label:"Successful runs",value:p,tone:"green"},{label:"Failed runs",value:f,tone:f>0?"red":"neutral"},{label:"Avg duration",value:m!==null?`${m} ms`:"—",tone:"neutral"}].map(x=>n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.03] p-4",children:[n.jsx("p",{className:"text-xs text-slate-400",children:x.label}),n.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${x.tone==="green"?"text-emerald-300":x.tone==="red"?"text-red-300":"text-white"}`,children:x.value})]},x.label))}),o?n.jsxs("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:["Couldn't load warm-up logs: ",o]}):s?n.jsxs("div",{className:"flex items-center gap-2 py-8 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading…"]}):e.length===0?n.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.03] px-4 py-10 text-center",children:[n.jsx(X0,{className:"mx-auto mb-2 h-7 w-7 text-slate-600"}),n.jsx("p",{className:"text-sm text-slate-400",children:"No warm-up runs recorded yet."}),n.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"The first run fires 45 seconds after the server boots."})]}):n.jsx("div",{className:"overflow-hidden rounded-lg border border-white/10",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{className:"bg-white/5 text-left text-[10px] uppercase tracking-wider text-slate-500",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-3 py-2",children:"Status"}),n.jsx("th",{className:"px-3 py-2",children:"Time (UTC)"}),n.jsx("th",{className:"px-3 py-2",children:"Checks"}),n.jsx("th",{className:"px-3 py-2",children:"Duration"}),n.jsx("th",{className:"px-3 py-2",children:"Error"})]})}),n.jsx("tbody",{children:e.map(x=>n.jsxs("tr",{className:"border-t border-white/5 hover:bg-white/[0.02]",children:[n.jsx("td",{className:"px-3 py-2",children:x.success?n.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-emerald-300",children:[n.jsx(Tr,{className:"h-3.5 w-3.5"})," OK"]}):n.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-red-300",children:[n.jsx(gx,{className:"h-3.5 w-3.5"})," Failed"]})}),n.jsx("td",{className:"px-3 py-2 whitespace-nowrap text-slate-300",children:new Date(x.ran_at).toLocaleString("en-GB",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:"UTC",timeZoneName:"short"})}),n.jsxs("td",{className:"px-3 py-2 tabular-nums text-slate-300",children:[x.checks_run-x.checks_failed,"/",x.checks_run," passed"]}),n.jsxs("td",{className:"px-3 py-2 tabular-nums text-slate-300",children:[x.duration_ms," ms"]}),n.jsx("td",{className:"px-3 py-2 max-w-xs truncate text-slate-400",children:x.error_text??n.jsx("span",{className:"text-slate-600",children:"—"})})]},x.id))})]})})]})}function fq(){const[e,t]=w.useState(""),s=w.useMemo(()=>[...Yg,...uq()],[]),r=w.useMemo(()=>s.reduce((h,p)=>
291h+p.entries.length,0),[s]),o=e.trim().toLowerCase(),c=w.useMemo(()=>o?s.map(h=>({...h,defaultOpen:!0,entries:h.entries.filter(p=>p.path.toLowerCase().includes(o)||p.title.toLowerCase().includes(o)||(p.hint?.toLowerCase().includes(o)??!1))})).filter(h=>h.entries.length>0):s,[s,o]),d=w.useMemo(()=>c.reduce((h,p)=>h+p.entries.length,0),[c]);return n.jsxs("section",{"data-testid":"section-sitemap",children:[n.jsxs("div",{className:"mb-5 flex flex-wrap items-end justify-between gap-3",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(vx,{className:"h-5 w-5 text-cyan-300"}),n.jsx("h2",{className:"text-xl font-semibold",children:"Site map"}),n.jsxs("span",{className:"rounded-full border border-white/10 bg-white/5 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-300",children:[r.toLocaleString()," pages"]})]}),n.jsxs("p",{className:"mt-1 max-w-2xl text-xs text-slate-400",children:["Every public route on scapely.io — marketing, account, admin and the ",r-Yg.flatMap(h=>h.entries).length," ","prerendered SEO landing pages. Click any path to open it in a new tab."]})]}),n.jsxs("div",{className:"relative w-full sm:w-72",children:[n.jsx("span",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-500",children:n.jsx(Ra,{className:"h-3.5 w-3.5"})}),n.jsx("input",{type:"text",value:e,onChange:h=>t(h.target.value),placeholder:"Filter by path or title…",className:"block h-9 w-full rounded-lg border border-white/10 bg-white/[0.04] pl-8 pr-12 text-xs text-white placeholder:text-slate-500 focus:border-cyan-300/50 focus:outline-none focus:ring-1 focus:ring-cyan-300/30","data-testid":"input-sitemap-filter","aria-label":"Filter site map"}),e.length>0&&n.jsx("button",{type:"button",onClick:()=>t(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded px-2 py-1 font-mono text-[9px] uppercase tracking-wider text-slate-400 hover:bg-white/5 hover:text-white","data-testid":"btn-clear-sitemap-filter","aria-label":"Clear filter",children:"Clear"})]})]}),o&&n.jsxs("p",{className:"mb-3 text-xs text-slate-400","data-testid":"text-sitemap-match-count",children:[d.toLocaleString()," match",d===1?"":"es",d===0&&" — try a different query"]}),n.jsx("div",{className:"space-y-3",children:c.map(h=>n.jsx(mq,{group:h},`${h.id}:${o}`))})]})}function mq({group:e}){return n.jsxs("details",{open:e.defaultOpen,className:"group overflow-hidden rounded-xl border border-white/10 bg-white/[0.02]","data-testid":`sitemap-group-${e.id}`,children:[n.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-medium text-white hover:bg-white/[0.04]",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{children:e.label}),n.jsx("span",{className:"rounded-full border border-white/10 bg-white/5 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-400",children:e.entries.length.toLocaleString()})]}),n.jsx(Zc,{className:"h-4 w-4 text-slate-400 transition-transform group-open:rotate-180"})]}),n.jsx("ul",{className:"divide-y divide-white/5 border-t border-white/5",children:e.entries.map(t=>n.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs hover:bg-white/[0.02]",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-slate-200",children:t.title}),t.hint&&n.jsx("div",{className:"truncate text-[11px] text-slate-500",children:t.hint})]}),n.jsxs("a",{href:t.path,target:"_blank",rel:"noopener noreferrer",className:"inline-flex flex-none items-center gap-1 rounded-md border border-white/10 bg-white/[0.03] px-2 py-1 font-mono text-[11px] text-cyan-200 hover:border-cyan-300/40 hover:bg-cyan-300/[0.08] hover:text-cyan-100","data-testid":`sitemap-link-${t.path}`,title:`Open ${t.path} in a new tab`,children:[t.path,n.jsx(In,{className:"h-3 w-3 opacity-70"})]})]},t.path))})]})}function gq(){const[e,t]=w.useState([]),[s,r]=w.useState(!0),[o,c]=w.useState(null),[d,h]=w.useState("open"),[p,f]=w.useState(null),[m,x]=w.useState({}),[y,v]=w.useState({}),[j,k]=w.useState({}),[S,N]=w.useState({}),[C,E]=w.useState({});async function O(A){const L=(y[A.id]??"").trim();if(!L){E(U=>({...U,[A.id]:"Reply cannot be empty"}));return}N(U=>({...U,[A.id]:!0})),E(U=>{const K={...U};return delete K[A.id],K});try{const U=await Ct(`/admin/support-messages/${A.id}/reply`,{method:"POST",body:JSON.stringify({body:L,markResolved:j[A.id]??!1})});v(K=>{const G={...K};return delete G[A.id],G}),k(K=>{const G={...K};return delete G[A.id],G}),x(K=>({...K,[A.id]:!1})),U.emailStatus==="failed"&&E(K=>({...K,[A.id]:`Reply saved but email send failed${U.emailError?`: ${U.emailError}`:""}.`})),await P()}catch(U){E(K=>({...K,[A.id]:U instanceof Error?U.message:"Failed to send"}))}finally{N(U=>{const K={...U};return delete K[A.id],K})}}const P=w.useCallback(async()=>{r(!0),c(null);try{const A=await Ct(`/admin/support-messages?status=${d}`);t(A.messages)}catch(A){c(A instanceof Error?A.message:"Failed to load")}finally{r(!1)}},[d]);w.useEffect(()=>{P()},[P]);async function M(A){f(A.id);try{const L=A.status==="open"?"resolved":"open";await Ct(`/admin/support-messages/${A.id}`,{method:"PATCH",body:JSON.stringify({status:L})}),await P()}catch(L){c(L instanceof Error?L.message:"Failed to update")}finally{f(null)}}const B=e.filter(A=>A.status==="open").length;return n.jsxs("section",{"data-testid":"section-support-inbox",children:[n.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-white",children:"Support inbox"}),n.jsxs("p",{className:"text-xs text-slate-400",children:["Messages sent from the user dashboard Account panel.",d==="open"&&B>0&&n.jsxs("span",{className:"ml-2 inline-flex items-center rounded-full bg-amber-400/15 px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-amber-200",children:[B," open"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"inline-flex rounded-md border border-white/10 bg-white/[0.03] p-0.5 text-xs",children:["open","resolved","all"].map(A=>n.jsx("button",{type:"button",onClick:()=>h(A),className:`rounded px-2.5 py-1 capitalize ${d===A?"bg-white/10 text-white":"text-slate-400 hover:text-white"}`,"data-testid":`button-support-filter-${A}`,children:A},A))}),n.jsx("button",{type:"button",onClick:()=>P(),className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-white/10 text-slate-400 hover:bg-white/5 hover:text-white",title:"Refresh","aria-label":"Refresh support inbox","data-testid":"button-support-refresh",children:n.jsx(sn,{className:"h-3.5 w-3.5"})})]})]}),o&&n.jsx("div",{className:"mb-3 rounded-md border border-red-400/30 bg-red-400/10 px-3 py-2 text-xs text-red-200",children:o}),n.jsx("div",{className:"rounded-xl border border-white/10 bg-white/[0.03]",children:s?n.jsxs("div",{className:"flex items-center gap-2 p-4 text-xs text-slate-400",children:[n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"})," Loading…"]}):e.length===0?n.jsxs("div",{className:"p-4 text-xs text-slate-500",children:["No ",d==="all"?"":d+" ","messages."]}):n.jsx("ul",{className:"divide-y divide-white/5",children:e.map(A=>
291n.jsx("li",{className:"p-4","data-testid":`row-support-${A.id}`,children:n.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("p",{className:"text-sm font-semibold text-white",children:A.subject}),n.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-wider ${A.status==="open"?"bg-amber-400/15 text-amber-200":"bg-emerald-400/15 text-emerald-200"}`,children:A.status}),A.tier_snapshot&&n.jsx("span",{className:"inline-flex items-center rounded-full border border-violet-300/30 bg-violet-300/10 px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-violet-200",children:A.tier_snapshot})]}),n.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:["From"," ",n.jsx("span",{className:"text-slate-200",children:A.name_snapshot??"(no name)"}),A.email_snapshot&&n.jsxs(n.Fragment,{children:[" ","<",n.jsx("a",{href:`mailto:${A.email_snapshot}?subject=Re:%20${encodeURIComponent(A.subject)}`,className:"text-cyan-300 hover:text-cyan-200",children:A.email_snapshot}),">"]})," ","· ",Go(A.created_at)]}),n.jsx("p",{className:"mt-2 whitespace-pre-wrap text-sm text-slate-200",children:A.body}),A.replies.length>0&&n.jsx("ul",{className:"mt-3 space-y-2 border-l-2 border-cyan-400/30 pl-3",children:A.replies.map(L=>n.jsxs("li",{className:"rounded-md border border-white/5 bg-white/[0.02] p-3",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-slate-400",children:[n.jsx("span",{className:"font-semibold text-cyan-200",children:L.admin_email??"admin"}),n.jsxs("span",{children:["· ",Go(L.created_at)]}),n.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 font-mono font-semibold uppercase tracking-wider ${L.email_status==="sent"?"bg-emerald-400/15 text-emerald-200":L.email_status==="failed"?"bg-red-400/15 text-red-200":"bg-slate-400/15 text-slate-300"}`,title:L.email_error??void 0,children:L.email_status==="sent"?`emailed${L.sent_to_email?` · ${L.sent_to_email}`:""}`:L.email_status==="failed"?"email failed":"no email on file"})]}),n.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-sm text-slate-200",children:L.body})]},L.id))}),m[A.id]?n.jsxs("div",{className:"mt-3 rounded-md border border-cyan-400/20 bg-cyan-400/[0.04] p-3",children:[!A.email_snapshot&&n.jsx("div",{className:"mb-2 rounded border border-amber-300/30 bg-amber-400/10 px-2 py-1 text-[11px] text-amber-200",children:"No email on file for this user — the reply will be saved as an internal note only."}),n.jsx("textarea",{value:y[A.id]??"",onChange:L=>v(U=>({...U,[A.id]:L.target.value})),placeholder:A.email_snapshot?`Reply to ${A.email_snapshot}…`:"Internal note…",rows:5,className:"w-full resize-y rounded-md border border-white/10 bg-slate-950/60 px-3 py-2 text-sm text-white outline-none focus:border-cyan-300/50 focus:ring-1 focus:ring-cyan-300/30","data-testid":`textarea-reply-${A.id}`}),C[A.id]&&n.jsx("div",{className:"mt-2 rounded border border-red-400/30 bg-red-400/10 px-2 py-1 text-[11px] text-red-200",children:C[A.id]}),n.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2",children:[n.jsxs("label",{className:"inline-flex items-center gap-1.5 text-[11px] text-slate-300",children:[n.jsx("input",{type:"checkbox",checked:j[A.id]??!1,onChange:L=>k(U=>({...U,[A.id]:L.target.checked})),className:"h-3.5 w-3.5 rounded border-white/20 bg-slate-900","data-testid":`checkbox-reply-resolve-${A.id}`}),"Mark resolved after sending"]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:()=>x(L=>({...L,[A.id]:!1})),className:"rounded-md border border-white/10 px-2.5 py-1 text-xs text-slate-300 hover:bg-white/5",children:"Cancel"}),n.jsx("button",{type:"button",disabled:!!S[A.id],onClick:()=>O(A),className:"rounded-md border border-cyan-300/40 bg-cyan-300/10 px-3 py-1 text-xs font-semibold text-cyan-100 hover:bg-cyan-300/20 disabled:opacity-60","data-testid":`button-reply-send-${A.id}`,children:S[A.id]?"Sending…":A.email_snapshot?"Send reply":"Save note"})]})]})]}):n.jsx("button",{type:"button",onClick:()=>x(L=>({...L,[A.id]:!0})),className:"mt-2 inline-flex items-center gap-1 rounded-md border border-cyan-300/30 bg-cyan-300/5 px-2.5 py-1 text-[11px] font-semibold text-cyan-200 hover:bg-cyan-300/10","data-testid":`button-reply-open-${A.id}`,children:"Reply"})]}),n.jsx("button",{type:"button",disabled:p===A.id,onClick:()=>M(A),className:`shrink-0 rounded-md border px-3 py-1.5 text-xs font-semibold transition disabled:opacity-60 ${A.status==="open"?"border-emerald-400/30 bg-emerald-400/10 text-emerald-200 hover:bg-emerald-400/20":"border-white/10 text-slate-300 hover:bg-white/5"}
291`,"data-testid":`button-toggle-support-${A.id}`,children:p===A.id?"Saving…":A.status==="open"?"Mark resolved":"Reopen"})]})},A.id))})})]})}function xq(){const[e,t]=w.useState([]),[s,r]=w.useState(!0),[o,c]=w.useState(!1),[d,h]=w.useState(null),[p,f]=w.useState(!1),[m,x]=w.useState(null),[y,v]=w.useState("all"),j=w.useCallback(async C=>{const E=new URLSearchParams;y!=="all"&&E.set("status",y),C&&E.set("starting_after",C);const O=E.toString()?`?${E.toString()}`:"";return Ct(`/admin/invoices${O}`)},[y]),k=w.useCallback(async()=>{r(!0),h(null);try{const C=await j(null);t(C.invoices),f(!!C.has_more),x(C.next_cursor??null)}catch(C){h(C instanceof Error?C.message:"Failed to load invoices")}finally{r(!1)}},[j]),S=w.useCallback(async()=>{if(!(!m||o)){c(!0),h(null);try{const C=await j(m);t(E=>[...E,...C.invoices]),f(!!C.has_more),x(C.next_cursor??null)}catch(C){h(C instanceof Error?C.message:"Failed to load more invoices")}finally{c(!1)}}},[j,m,o]);w.useEffect(()=>{k()},[k]);const N=w.useMemo(()=>{const C=new Map;for(const E of e){const O=E.currency.toUpperCase(),P=C.get(O)??{paid:0,outstanding:0,count:0};P.paid+=E.amount_paid,P.outstanding+=E.amount_remaining,P.count+=1,C.set(O,P)}return Array.from(C.entries()).map(([E,O])=>({currency:E,...O}))},[e]);return n.jsxs("section",{children:[n.jsxs("div",{className:"mb-5 flex flex-wrap items-end justify-between gap-3",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Zh,{className:"h-5 w-5 text-cyan-300"}),n.jsx("h2",{className:"text-xl font-semibold",children:"Sales & invoices"})]}),n.jsx("p",{className:"mt-1 max-w-2xl text-xs text-slate-400",children:"Live invoices from Stripe — these PDFs are the canonical accounting documents (sequential numbering, business name & VAT details from your Stripe settings) and can go straight into your bookkeeping."})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("select",{value:y,onChange:C=>v(C.target.value),className:"rounded-lg border border-white/10 bg-slate-900 px-3 py-2 text-xs text-white outline-none focus:border-cyan-300/50",children:[n.jsx("option",{value:"all",children:"All statuses"}),n.jsx("option",{value:"paid",children:"Paid"}),n.jsx("option",{value:"open",children:"Open"}),n.jsx("option",{value:"uncollectible",children:"Uncollectible"}),n.jsx("option",{value:"void",children:"Void"}),n.jsx("option",{value:"draft",children:"Draft"})]}),n.jsxs("button",{onClick:k,disabled:s,className:"flex items-center gap-2 rounded-lg border border-white/15 bg-white/5 px-3 py-2 text-xs font-medium text-slate-200 hover:bg-white/10 disabled:opacity-60",children:[s?n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(sn,{className:"h-3.5 w-3.5"}),"Refresh"]})]})]}),N.length>0&&n.jsx("div",{className:"mb-5 grid grid-cols-1 gap-3 sm:grid-cols-3",children:N.map(C=>n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.02] p-4",children:[n.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-400",children:["Collected (",C.currency,")"]}),n.jsx("p",{className:"mt-1 font-mono text-2xl tabular-nums text-emerald-200",children:uc(C.paid,C.currency)}),n.jsxs("p",{className:"mt-1 text-[11px] text-slate-500",children:[C.count," invoice",C.count===1?"":"s",C.outstanding>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",n.jsxs("span",{className:"text-amber-300",children:[uc(C.outstanding,C.currency)," outstanding"]})]})]})]},C.currency))}),d&&n.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:[n.jsx(en,{className:"mt-0.5 h-4 w-4 flex-none"}),d]}),s?n.jsxs("div",{className:"flex items-center gap-2 py-8 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Loading invoices…"]}):e.length===0?n.jsx("div",{className:"rounded-xl border border-dashed border-white/10 bg-white/[0.01] px-4 py-10 text-center text-sm text-slate-500",children:"No invoices yet — the first paid Stripe subscription will appear here automatically."}):n.jsxs("div",{className:"overflow-hidden rounded-xl border border-white/10",children:[n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{className:"bg-white/5 text-left text-xs uppercase tracking-wider text-slate-400",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-4 py-3",children:"Number"}),n.jsx("th",{className:"px-4 py-3",children:"Date"}),n.jsx("th",{className:"px-4 py-3",children:"Customer"}),n.jsx("th",{className:"px-4 py-3",children:"Description"}),n.jsx("th",{className:"px-4 py-3 text-right",children:"Subtotal"}),n.jsx("th",{className:"px-4 py-3 text-right",children:"Tax"}),n.jsx("th",{className:"px-4 py-3 text-right",children:"Total"}),n.jsx("th",{className:"px-4 py-3",children:"Status"}),n.jsx("th",{className:"px-4 py-3 text-right",children:"Document"})]})}),n.jsx("tbody",{children:e.map(C=>n.jsxs("tr",{className:"border-t border-white/10 hover:bg-white/[0.02]",children:[n.jsx("td",{className:"px-4 py-3 font-mono text-xs text-slate-300",children:C.number??n.jsx("span",{className:"text-slate-500",children:"draft"})}),n.jsx("td",{className:"px-4 py-3 text-xs text-slate-400",children:new Date(C.created*1e3).toLocaleDateString()}),n.jsxs("td",{className:"px-4 py-3 text-xs",children:[n.jsx("div",{className:"text-slate-200",children:C.customer_name??C.customer_email??"—"}),C.customer_name&&C.customer_email&&n.jsx("div",{className:"text-[11px] text-slate-500",children:C.customer_email})]}),n.jsx("td",{className:"px-4 py-3 text-xs text-slate-400",children:C.description??"—"}),n.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs tabular-nums text-slate-300",children:uc(C.subtotal,C.currency)}),n.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs tabular-nums text-slate-400",children:C.tax?uc(C.tax,C.currency):"—"}),n.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs tabular-nums font-semibold text-white",children:uc(C.total,C.currency)}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(yq,{status:C.status})}),n.jsx("td",{className:"px-4 py-3 text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[C.invoice_pdf&&n.jsxs("a",{href:C.invoice_pdf,target:"_blank",rel:"noopener noreferrer",title:"Download PDF invoice",className:"inline-flex items-center gap-1 rounded-md border border-cyan-300/30 bg-cyan-300/10 px-2 py-1 text-xs font-medium text-cyan-100 hover:bg-cyan-300/20",children:[n.jsx(Kh,{className:"h-3.5 w-3.5"}),"PDF"]}),C.hosted_invoice_url&&n.jsxs("a",{href:C.hosted_invoice_url,target:"_blank",rel:"noopener noreferrer",title:"Open hosted Stripe invoice",className:"inline-flex items-center gap-1 rounded-md border border-white/10 px-2 py-1 text-xs font-medium text-slate-200 hover:bg-white/5",children:[n.jsx(In,{className:"h-3.5 w-3.5"}),"View"]}
291)]})})]},C.id))})]}),p&&n.jsxs("div",{className:"flex items-center justify-between border-t border-white/10 bg-white/[0.02] px-4 py-3",children:[n.jsxs("p",{className:"text-[11px] text-slate-500",children:["Showing ",e.length," invoice",e.length===1?"":"s"," · more available from Stripe"]}),n.jsxs("button",{onClick:S,disabled:o,className:"flex items-center gap-2 rounded-lg border border-cyan-300/30 bg-cyan-300/10 px-3 py-1.5 text-xs font-medium text-cyan-100 hover:bg-cyan-300/20 disabled:opacity-60",children:[o&&n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}),"Load more"]})]})]})]})}function yq({status:e}){const s={paid:"border-emerald-300/30 bg-emerald-300/10 text-emerald-200",open:"border-amber-300/30 bg-amber-300/10 text-amber-200",void:"border-white/10 bg-white/5 text-slate-400",draft:"border-white/10 bg-white/5 text-slate-300",uncollectible:"border-red-400/30 bg-red-400/10 text-red-200"}[e??""]??"border-white/10 bg-white/5 text-slate-300";return n.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-semibold uppercase tracking-wider ${s}`,children:e??"—"})}function yN({tier:e}){const t={free:"border-white/10 bg-white/5 text-slate-300",pro:"border-emerald-300/30 bg-emerald-300/10 text-emerald-200",enterprise:"border-violet-300/30 bg-violet-300/10 text-violet-200"};return n.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-semibold uppercase tracking-wider ${t[e]}`,children:e})}function bq({onCreated:e,onCancel:t}){const[s,r]=w.useState(""),[o,c]=w.useState(""),[d,h]=w.useState("free"),[p,f]=w.useState(!1),[m,x]=w.useState(null);async function y(v){v.preventDefault(),f(!0),x(null);try{await Ct("/admin/users",{method:"POST",body:JSON.stringify({email:s,password:o,tier:d})}),r(""),c(""),h("free"),e()}catch(j){x(j instanceof Error?j.message:"Failed")}finally{f(!1)}}return n.jsxs("form",{onSubmit:y,className:"mb-6 grid gap-3 rounded-xl border border-white/10 bg-white/[0.02] p-4 sm:grid-cols-[1fr_1fr_140px_auto_auto]",children:[n.jsx("input",{type:"email",required:!0,placeholder:"[email protected]",value:s,onChange:v=>r(v.target.value),className:"rounded-lg border border-white/10 bg-slate-950/80 px-3 py-2 text-sm text-white outline-none focus:border-emerald-300/50"}),n.jsx("input",{type:"password",required:!0,minLength:8,placeholder:"Initial password (≥8 chars)",value:o,onChange:v=>c(v.target.value),className:"rounded-lg border border-white/10 bg-slate-950/80 px-3 py-2 text-sm text-white outline-none focus:border-emerald-300/50"}),n.jsxs("select",{value:d,onChange:v=>h(v.target.value),className:"rounded-lg border border-white/10 bg-slate-950/80 px-3 py-2 text-sm text-white outline-none focus:border-emerald-300/50",children:[n.jsx("option",{value:"free",children:"Free"}),n.jsx("option",{value:"pro",children:"Pro (comp)"}),n.jsx("option",{value:"enterprise",children:"Enterprise (comp)"})]}),n.jsxs("button",{type:"submit",disabled:p,className:"flex items-center justify-center gap-2 rounded-lg bg-emerald-400 px-4 py-2 text-sm font-semibold text-slate-950 hover:bg-emerald-300 disabled:opacity-60",children:[p&&n.jsx(Me,{className:"h-4 w-4 animate-spin"}),"Create"]}),n.jsx("button",{type:"button",onClick:t,className:"rounded-lg border border-white/10 px-3 py-2 text-sm text-slate-300 hover:bg-white/5",children:"Cancel"}),m&&n.jsxs("div",{className:"col-span-full flex items-start gap-2 rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-xs text-red-200",children:[n.jsx(en,{className:"mt-0.5 h-3.5 w-3.5 flex-none"}),m]})]})}const V3=[{title:"Property identity & search",blurb:"Resolve any UK address to a unique property record, then keep it on your radar.",features:[{name:"Address search & UPRN resolution",what:"Type-ahead search resolves any postal address to its UPRN, postcode, ward, and local authority so every downstream lookup uses the right record.",source:"Ordnance Survey Places",audiences:{Buyer:"Lands on the right unit in a block rather than a building-level guess.",Developer:"Avoids appraising the wrong title before any work has been done.",Investor:"Removes ambiguity when adding leads from agents or auctions."}},{name:"Watchlist",what:"Save properties to a personal carousel that follows you across every section of the dashboard.",audiences:{Buyer:"Hold a shortlist of homes worth a second viewing.",Developer:"Track every site under offer or in DD without juggling spreadsheets.",Investor:"Compare yields and risk flags across the pipeline at a glance."}},{name:"Chrome extension overlay",what:"Inline Scapely panel on Rightmove, Zoopla, OnTheMarket, Realla, Allsop and Savills auctions — appraisal, EPC, planning flags without leaving the page.",audiences:{Buyer:"Vets a portal listing in seconds while still browsing.",Developer:"Filters portal noise down to the few sites worth a full appraisal.",Investor:"Sourcing scale: triage hundreds of listings per week."}}]}
291,{title:"Property fundamentals",blurb:"The non-negotiable facts about the building, the plot, and who owns it.",features:[{name:"Plot Intelligence (footprint, area, height)",what:"Ordnance Survey NGD building footprints with adjacency, area and height — rendered over satellite imagery with an OS tile fallback.",source:"Ordnance Survey NGD",audiences:{Buyer:"Confirms the actual plot size before booking a viewing.",Developer:"Tests massing and curtilage before paying for a survey.",Investor:"Spots oversized plots, gardens or yards with hidden value."}},{name:"Tenure & Title Register lookup",what:"Freehold or leasehold flag plus on-demand HMLR Title Register purchase (£5) attached to the property.",source:"HM Land Registry",audiences:{Buyer:"Surfaces restrictive covenants and rentcharges before exchange.",Developer:"Confirms ownership and title boundaries before committing fees.",Investor:"Spot leasehold ground rent traps and freeholder identity."}},{name:"Owner Intel (Companies House)",what:"If the owner is a company: profile, registered office, officers, PSCs, charges, and other companies registered at the same address.",source:"Companies House",audiences:{Buyer:"Reveals who really owns the property and how to reach them.",Developer:"Maps the owner's wider portfolio for off-market approaches.",Investor:"Finds related entities, charges, and counter-party risk."}},{name:"Sale history & comparables",what:"Full HM Land Registry Price Paid record for the property plus matched comparables on the same street and postcode.",source:"HM Land Registry Price Paid",audiences:{Buyer:"Negotiate from real transacted prices, not asking prices.",Developer:"Anchors a GDV from like-for-like sales nearby.",Investor:"Tracks holding-period performance for similar stock."}}]},{title:"Energy & compliance",blurb:"What the property must do to stay lettable and saleable through 2027 and beyond.",features:[{name:"EPC rating & uplift recommendations",what:"Current EPC band, expiry date, and the cheapest credible route to band C, with cost ranges per measure.",source:"EPC Register",audiences:{Buyer:"Forecasts running costs and any pre-purchase remediation.",Developer:"Scopes the spec needed to hit the lettable standard.",Investor:"Quantifies the capex to stay above the MEES threshold."}},{name:"MEES 2027 compliance check",what:"Flags lets that would fall foul of the proposed band C minimum from 2027, with a 'cannot legally be let' warning where relevant.",audiences:{Buyer:"Avoids buying a property that quietly becomes unrentable.",Developer:"Prioritises retrofit scope on at-risk stock.",Investor:"Stress-tests portfolio income against the regulation calendar."}},{name:"Flood risk",what:"Environment Agency river, sea, and surface-water flood zones with plain-English risk band.",source:"Environment Agency",audie
291nces:{Buyer:"Catches uninsurable or premium-loading properties early.",Developer:"Confirms whether a site triggers a flood risk assessment.",Investor:"Avoids stock with structural insurance cost drag."}},{name:"Biodiversity Net Gain (BNG) indicator",what:"Flags whether a development site is subject to the mandatory 10% BNG uplift.",audiences:{Developer:"Builds BNG cost and offsite units into the appraisal up front.",Investor:"Models BNG drag on land value before bidding."}}]},{title:"Planning & heritage constraints",blurb:"Everything that quietly stops a project before it starts.",features:[{name:"Article 4 directions",what:"Identifies whether the property sits inside an Article 4 area that withdraws permitted development rights — at the right level of granularity (HMO-only, full PD, conservation-driven, etc.).",audiences:{Buyer:"Knows in advance which 'simple' changes will need full planning.",Developer:"Stops a viability collapse from assuming PD rights that no longer exist.",Investor:"Filters HMO targets that have lost their Class L route."}},{name:"Permitted Development rights checker",what:"Per-class verdicts for the routes that matter: Class MA (commercial → resi), Class Q (agricultural → resi), Class L (C3 → C4 HMO), Part 1 Class A extensions, Class AA upward additions on houses, and Part 20 Class AA upward additions on flats and commercial.",audiences:{Buyer:"Sees what can be added without a planning application.",Developer:"Goes straight to the viable PD route rather than full planning.",Investor:"Spots conversion plays the wider market has missed."}},{name:"Conservation areas & listed buildings",what:"Flags conservation area, statutory listing grade, and curtilage listings, with a link through to the Historic England entry where relevant.",source:"Historic England",audiences:{Buyer:"Sets expectations on windows, doors, and external changes.",Developer:"Adjusts spec and timeline for heritage consent.",Investor:"Price
291s in slower, costlier works on listed stock."}},{name:"Designated landscapes & ecology",what:"AONB, National Park, Broads, World Heritage Site, SSSI, SPA, SAC, Ramsar, and Scheduled Monument overlays.",source:"Natural England, Historic England",audiences:{Developer:"Catches the consultee constraints that kill marginal sites.",Investor:"Prices ecological mitigation into rural and edge-of-village stock."}},{name:"HMO saturation & licensing",what:"Share of homes within ~100m already licensed as HMOs, plus the council's HMO licensing scheme type.",audiences:{Developer:"Sense-check whether another HMO licence is realistic.",Investor:"Filters out streets that will fail the saturation test."}},{name:"Business rates estimate",what:"Rateable value and indicative annual business rates bill for commercial floorspace on site, drawn from the VOA rating list.",source:"Valuation Office Agency",audiences:{Buyer:"Real running cost on a mixed-use or commercial purchase.",Developer:"Tests whether commercial floorspace at ground level still pencils.",Investor:"Net-income clarity on commercial and mixed-use stock."}},{name:"CIL zone & charge",what:"Local Community Infrastructure Levy zone and £/m² charging rate applied to the floorspace uplift.",audiences:{Developer:"Real CIL number in the appraisal, not a placeholder.",Investor:"Prevents CIL surprises wiping out residual land value."}}]},{title:"Location & demand",blurb:"How well connected and how lettable the property actually is.",features:[{name:"PTAL — public transport accessibility",what:"TfL PTAL score from 0 (poor) to 6b (excellent) for London properties.",source:"Transport for London",audiences:{Buyer:"Confirms commute viability in objective terms.",Developer:"Backs density and parking arguments in planning.",Investor:"Predicts rental demand and void risk."}},{name:"Mini-map & Street View",what:"Client-side Google Maps mini-map with an Ordnance Survey signed-tile fallback when the OS session is unavailable, plus Street View imagery on the property hero.",source:"Google Maps Platform",audiences:{Buyer:"Gut-check the kerb appeal and street context before viewing.",Developer:"Spots access, parking and neighbouring uses without a site visit.",Investor:"Quick visual triage across many leads."}}]},{title:"Appraisal, risk & reporting",blurb:"The Scapely-original analysis that turns raw data into a decision.",features:[{name:"Development appraisal (per strategy)",what:"End-to-end appraisal for refurbishment, new build, extension, HMO conversion and similar strategies — GDV, build cost, fees, finance, profit on cost.",audiences:{Buyer:"Frames any 'add value' purchase with a real number, not a hunch.",Developer:"Skips a day of spreadsheet work on each shortlisted site.",Investor:"Comparable profit-on-cost across very different opportunities."}},{name:"Cost estimator",what:"Build-cost ranges per m² benchmarked against current UK build data, tuned per strategy.",audiences:{Developer:"Sanity checks contractor pricing before going firm.",Investor:"Stress-tests downside scenarios on capex."}},{name:"Investment view (ROI & yield)",what:"Gross/net yield, cash-on-cash, and ROI projections under buy-to-let, HMO, refurbish-and-flip, and refurbish-and-refinance assumptions.",audiences:{Investor:"One screen comparison of every exit strategy.",Developer:"Decides whether to flip or hold post-completion."}},{name:"Objection risk analyser",what:"Surfaces the planning, heritage, and policy reasons a scheme is most likely to be refused, ranked by severity.",audiences:{Developer:"Pre-empts the planner's objection list before submission.",Investor:"Quantifies the probability of consent for marginal sites."}},{name:"Recommendation engine",what:"Highest-confidence strategy for the specific property, with the second- and third-best routes ranked underneath.",audiences:{Buyer:"Tells you which renovation route is worth the effort.",Developer:"Skips dead-end strategies that look obvious but don't pencil.",Investor:"Aligns the strategy to the asset rather than the other way round."}},{name:"Client-side PDF report",what:"Generates the full Scapely report (cover, appraisal, intel, planning, EPC, comparables) entirely in the browser using pdfmake — no data leaves the device.",audiences:{Buyer:"Shareable report for solicitor, broker, or family.",Developer:"Investor-ready pack from a single click.",Investor:"Audit trail of why each acquisition decision was made."}}]},{title:"Caching, fairness & access",blurb:"How Scapely keeps results fast, fair, and private.",features:[{name:"7-day appraisal cache (per user / UPRN / strategy)",what:"Re-opening a property within 7 days returns the cached appraisal instantly and does not consume a monthly scan, even when the user is over quota.",audiences:{Buyer:"Free to revisit a saved property as often as needed.",Developer:"Doesn't penalise iterating on the same shortlist.",Investor:"Predictable cost of working a long list over a month."}}
291,{name:"Per-user monthly scan quota by tier",what:"Free / Pro / Enterprise tiers each have a monthly scan budget enforced server-side with a transparent counter.",audiences:{Buyer:"Free tier is enough to vet a handful of homes a month.",Developer:"Pro tier sized to a working pipeline.",Investor:"Enterprise tier for sourcing teams at scale."}},{name:"No listing-price scraping",what:"Scapely deliberately does not scrape asking prices from portals — every price figure is sourced from HM Land Registry or user input.",audiences:{Buyer:"Numbers reflect what properties actually sell for.",Developer:"Defensible figures in front of lenders.",Investor:"No ToS exposure from portal scraping."}}]}];function vq(){_i();const[e,t]=w.useState(null),[s,r]=w.useState(!0),[o,c]=w.useState("checking");return w.useEffect(()=>{let d=!1;wt.auth.getSession().then(({data:p})=>{d||(t(p.session?.user.email??null),r(!1))});const{data:h}=wt.auth.onAuthStateChange((p,f)=>{t(f?.user.email??null),c("checking")});return()=>{d=!0,h.subscription.unsubscribe()}},[]),w.useEffect(()=>{if(!e)return;let d=!1;return(async()=>{try{const h=await bp();if(!h)throw new Error("no token");const p=await fetch("/api/admin/profiles",{headers:{Authorization:`Bearer ${h}`}});if(!p.ok)throw new Error(String(p.status));d||c("authorized")}catch{d||c("forbidden")}})(),()=>{d=!0}},[e]),s||e&&o==="checking"?n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-950 text-white",children:n.jsx(Me,{className:"h-6 w-6 animate-spin"})}):e?o==="forbidden"?n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-950 px-4 text-white",children:n.jsxs("div",{className:"max-w-md rounded-2xl border border-white/10 bg-slate-900/80 p-7 text-center",children:[n.jsx(en,{className:"mx-auto mb-3 h-8 w-8 text-red-300"}),n.jsx("h1",{className:"mb-2 text-[13px] font-semibold",children:"Not authorised"}),n.jsxs("p",{className:"text-xs text-slate-400",children:[e," is signed in but is not an admin."]})]})}):n.jsxs("div",{className:"min-h-screen bg-slate-950 text-white",children:[n.jsx("header",{className:"border-b border-white/10 px-6 py-4",children:n.jsxs("div",{className:"mx-auto flex max-w-6xl items-center gap-3",children:[n.jsx("img",{src:ol,alt:"",className:"h-7 w-7 rounded-lg"}),n.jsx("img",{src:_n,alt:"Scapely",className:"h-[15px] w-auto sm:h-[16px]"}),n.jsx("span",{className:"rounded-full border border-emerald-300/30 bg-emerald-300/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-emerald-200",children:"Admin"}),n.jsxs(Be,{href:"/admin",className:"ml-3 inline-flex items-center gap-1 rounded-md border border-white/10 px-2 py-1 text-xs text-slate-300 hover:bg-white/5",children:[n.jsx(Xw,{className:"h-3.5 w-3.5"})," Back to admin"]}),n.jsx("span",{className:"ml-auto text-xs text-slate-400",children:e}),n.jsxs("button",{onClick:()=>wt.auth.signOut(),className:"flex items-center gap-1 rounded-md border border-white/10 px-2 py-1 text-xs text-slate-300 hover:bg-white/5","aria-label":"Sign out",children:[n.jsx(Qh,{className:"h-3.5 w-3.5"})," Sign out"]})]})}),n.jsxs("main",{className:"mx-auto max-w-6xl px-6 py-10",children:[n.jsxs("div",{className:"mb-8",children:[n.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-emerald-300/80",children:"Internal reference"}),n.jsx("h1",{className:"mt-2 text-3xl font-semibold tracking-tight",children:"Scapely Dashboard — active features"}),n.jsx("p",{className:"mt-3 max-w-3xl text-sm text-slate-400",children:"Every feature and insight the dashboard currently ships, grouped by theme, with a one-line description and the value each audience — buyer, developer, investor — actually gets from it. Use this when briefing a customer, writing copy, or scoping a demo."}),n.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-[11px] font-semibold uppercase tracking-wider",children:[n.jsx("span",{className:"rounded-full border border-sky-300/30 bg-sky-300/10 px-2 py-0.5 text-sky-200",children:"Buyer"}),n.jsx("span",{className:"rounded-full border border-emerald-300/30 bg-emerald-300/10 px-2 py-0.5 text-emerald-200",children:"Developer"}),n.jsx("span",{className:"rounded-full border border-violet-300/30 bg-violet-300/10 px-2 py-0.5 text-violet-200",children:"Investor"})]})]}),n.jsxs("nav",{className:"mb-10 rounded-xl border border-white/10 bg-white/[0.03] p-4",children:[n.jsx("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider text-slate-500",children:"Jump to"}),n.jsx("ul",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-slate-300",children:V3.map(d=>n.jsx("li",{children:n.jsx("a",{href:`#${z3(d.title)}`,className:"hover:text-emerald-200",children:d.title})},d.title))})]}),n.jsx("div",{className:"space-y-12",children:V3.map(d=>n.jsxs("section",{id:z3(d.title),className:"scroll-mt-24",children:[n.jsx("h2",{className:"text-xl font-semibold",children:d.title}),n.jsx("p",{className:"mt-1 max-w-2xl text-xs text-slate-400",children:d.blurb}),n.jsx("div",{className:"mt-5 space-y-4",children:d.features.map(h=>n.jsxs("article",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-5",children:[n.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-3",children:[n.jsx("h3",{className:"text-sm font-semibold text-white",children:h.name}),h.source&&n.jsx("span",{className:"rounded-md border border-white/10 bg-white/5 px-2 py-0.5 text-[10px] uppercase tracking-wider text-slate-400",children:h.source})]}),n.jsx("p",{className:"mt-2 text-sm leading-relaxed text-slate-300",children:h.what}),n.jsx("dl",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:["Buyer","Developer","Investor"].map(p=>{const f=h.audiences[p];return f?n.jsxs("div",{className:`rounded-lg border p-3 ${wq(p)}`,children:[n.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-wider opacity-80",children:p}),n.jsx("dd",{className:"mt-1 text-xs leading-relaxed text-slate-100/90",children:f})]},p):null})})]},h.name))})]},d.title))}),n.jsxs("p",{className:"mt-12 border-t border-white/5 pt-4 text-[11px] text-slate-500",children:["Keep this page in sync with"," ",n.jsx(Be,{href:"/dashboard-features",className:"underline hover:text-slate-300",children:"/dashboard-features"})," ","(public) and the live Dashboard. When a new panel ships, add it here."]})]})]}):n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-950 px-4 text-white",children:n.jsxs("div",{className:"max-w-md rounded-2xl border border-white/10 bg-slate-900/80 p-7 text-center",children:[n.jsx(en,{className:"mx-auto mb-3 h-8 w-8 text-amber-300"}),n.jsx("h1",{className:"mb-2 text-[13px] font-semibold",children:"Sign in required"}),n.jsx("p",{className:"mb-4 text-xs text-slate-400",children:"This page is part of the admin area."}),n.jsxs(Be,{href:"/admin",className:"inline-flex items-center gap-1 rounded-lg border border-white/10 px-3 py-1.5 text-xs text-slate-200 hover:bg-white/5",children:[n.jsx(Xw,{className:"h-3.5 w-3.5"})," Go to admin sign-in"]})]})})}function z3(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function wq(e){return e==="Buyer"?"border-sky-300/20 bg-sky-300/[0.06]":e==="Developer"?"border-emerald-300/20 bg-emerald-300/[0.06]":"border-violet-300/20 bg-violet-300/[0.06]"}function jq(){_i();const[e,t]=w.useState("checking"),[s,r]=w.useState(""),[o,c]=w.useState(""),[d,h]=w.useState(null),[p,f]=w.useState(null);w.useEffect(()=>{let x=!1;const y=typeof window<"u"?window.location.hash:"",j=new URLSearchParams(y.replace(/^#/,"")).get("type")==="recovery",k=typeof window<"u"&&new URLSearchParams(window.location.search).get("type")==="recovery",S=j||k,N=O=>{x||(f(O),t("ready"))},{data:C}=wt.auth.onAuthStateChange((O,P)=>{O==="PASSWORD_RECOVERY"&&N(P?.user.email??null)}),E=setTimeout(async()=>
291{if(x||e!=="checking")return;if(!S){t("expired");return}const{data:O}=await wt.auth.getSession();x||(O.session?N(O.session.user.email??null):t("expired"))},600);return()=>{x=!0,clearTimeout(E),C.subscription.unsubscribe()}},[]);async function m(x){if(x.preventDefault(),h(null),s.length<8){h("Password must be at least 8 characters.");return}if(s!==o){h("Passwords don't match.");return}t("saving");const{error:y}=await wt.auth.updateUser({password:s});if(y){h(y.message),t("ready");return}await wt.auth.signOut(),t("done")}return n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-950 px-4 text-white",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/10 bg-slate-900/80 p-7 shadow-2xl backdrop-blur",children:[n.jsxs("div",{className:"mb-5 flex items-center gap-3",children:[n.jsx("img",{src:ol,alt:"",className:"h-8 w-8 rounded-lg"}),n.jsx("img",{src:_n,alt:"Scapely",className:"h-[15px] w-auto sm:h-[16px]"})]}),e==="checking"&&n.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-slate-400",children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"})," Verifying reset link…"]}),e==="expired"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-sm text-red-200",children:[n.jsx(en,{className:"mt-0.5 h-4 w-4 flex-none"}),"This password reset link is invalid or has expired."]}),n.jsxs("p",{className:"text-sm text-slate-400",children:["Ask your Scapely admin to send you a fresh link, or contact us at"," ",n.jsx("a",{href:"mailto:[email protected]",className:"text-cyan-300 hover:underline",children:"[email protected]"}),"."]}),n.jsx("p",{className:"mt-5 text-center text-xs text-slate-500",children:n.jsx(Be,{href:"/",className:"hover:text-slate-300",children:"← Back to scapely.io"})})]}),e==="done"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-emerald-300/30 bg-emerald-300/10 px-3 py-2 text-sm text-emerald-100",children:[n.jsx(Tr,{className:"mt-0.5 h-4 w-4 flex-none"}),"Password updated. You can now sign in with your new password."]}),n.jsx("p",{className:"mt-5 text-center text-xs text-slate-500",children:n.jsx(Be,{href:"/dashboard",className:"hover:text-slate-300",children:"Go to dashboard →"})})]}),(e==="ready"||e==="saving")&&n.jsxs("form",{onSubmit:m,children:[n.jsxs("p",{className:"mb-5 text-sm text-slate-400",children:["Choose a new password for"," ",n.jsx("span",{className:"text-white",children:p??"your account"}),"."]}),n.jsxs("label",{className:"mb-3 block text-xs uppercase tracking-wider text-slate-400",children:["New password",n.jsx("input",{type:"password",required:!0,minLength:8,autoComplete:"new-password",value:s,onChange:x=>r(x.target.value),className:"mt-1 w-full rounded-lg border border-white/10 bg-slate-950/80 px-3 py-2 text-sm text-white outline-none focus:border-cyan-300/50"})]}),n.jsxs("label",{className:"mb-5 block text-xs uppercase tracking-wider text-slate-400",children:["Confirm password",n.jsx("input",{type:"password",required:!0,minLength:8,autoComplete:"new-password",value:o,onChange:x=>c(x.target.value),className:"mt-1 w-full rounded-lg border border-white/10 bg-slate-950/80 px-3 py-2 text-sm text-white outline-none focus:border-cyan-300/50"})]}),d&&n.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-400/30 bg-red-400/10 px-3 py-2 text-xs text-red-200",children:[n.jsx(en,{className:"mt-0.5 h-3.5 w-3.5 flex-none"}),d]}),n.jsxs("button",{type:"submit",disabled:e==="saving",className:"flex w-full items-center justify-center gap-2 rounded-lg bg-cyan-300 px-3 py-2 text-sm font-semibold text-slate-950 transition hover:bg-cyan-200 disabled:opacity-60",children:[e==="saving"&&n.jsx(Me,{className:"h-4 w-4 animate-spin"}),"Set new password"]})]})]})})}function bN(e){return t=>typeof t===e}var kq=bN("function"),_q=e=>e===null,F3=e=>Object.prototype.toString.call(e).slice(8,-1)==="RegExp",G3=e=>!Sq(e)&&!_q(e)&&(kq(e)||typeof e=="object"),Sq=bN("undefined");function Nq(e,t,s){return Pq(s,e,t)?!0:(Mq(s,e,t),e.constructor!==t.constructor?!1:Array.isArray(e)&&Array.isArray(t)?Cq(e,t,s):e instanceof Map&&t instanceof Map?Aq(e,t,s):e instanceof Set&&t instanceof Set?Oq(e,t):e instanceof WeakMap||e instanceof WeakSet?!1:ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)?Eq(e,t):F3(e)&&F3(t)?e.source===t.source&&e.flags===t.flags:e instanceof Error&&t instanceof Error?Tq(e,t,s):e.valueOf!==Object.prototype.valueOf?e.valueOf()===t.valueOf():e.toString!==Object.prototype.toString?e.toString()===t.toString():Rq(e,t,s))}function rd(e,t,s){return e===t||Number.isNaN(e)&&Number.isNaN(t)?!0:!e||!G3(e)||!t||!G3(t)?!1:Nq(e,t,s)}function Cq(e,t,s){const{length:r}=e;if(r!==t.length)return!1;for(let o=r;o--!==0;)if(!rd(e[o],t[o],s))return!1;return!0}function Eq(e,t){if(e.byteLength!==t.byteLength)return!1;const s=new DataView(e.buffer),r=new DataView(t.buffer);let o=e.byteLength;for(;o--;)if(s.getUint8(o)!==r.getUint8(o))return!1;return!0}function Tq(e,t,s){return e.message===t.message&&e.name===t.name&&rd(e.cause,t.cause,s)}function Aq(e,t,s){if(e.size!==t.size)return!1;
291for(const r of e.entries())if(!t.has(r[0]))return!1;for(const r of e.entries())if(!rd(r[1],t.get(r[0]),s))return!1;return!0}function Rq(e,t,s){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let o=r.length;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[o]))return!1;for(let o=r.length;o--!==0;){const c=r[o];if(!(c==="_owner"&&e.$$typeof)&&!rd(e[c],t[c],s))return!1}return!0}function Oq(e,t){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;return!0}function Pq(e,t,s){return e.get(t)?.has(s)??!1}function Mq(e,t,s){let r=e.get(t);r||(r=new WeakSet,e.set(t,r)),r.add(s)}function vy(e,t){return rd(e,t,new WeakMap)}function k0(){return!!(typeof window<"u"&&window?.document?.createElement)}function Lq(e,...t){e&&e.removeEventListener&&e.removeEventListener(...t)}function Dq(e,...t){e&&e.addEventListener&&e.addEventListener(...t)}function Bq(){const e=w.useRef(!0);return e.current?(e.current=!1,!0):e.current}function Iq(e,t){const s=Bq();w.useEffect(()=>{if(!s)return e()},t)}function vN(e){const t=w.useRef(void 0);return w.useEffect(()=>{t.current=e}),t.current}function $q(e,t){const s=w.useRef(t);return vy(t,s.current)||(s.current=t),w.useMemo(e,s.current)}function Uq(e){w.useEffect(()=>{e()},[])}function Hq(e=0){const[t,s]=w.useState({height:k0()?window.innerHeight:0,width:k0()?window.innerWidth:0}),r=w.useRef(0),o=w.useRef(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{s({width:window.innerWidth,height:window.innerHeight})},e)});return w.useEffect(()=>{if(!k0())return()=>{};const c=o.current;return s({height:window.innerHeight,width:window.innerWidth}),Dq(window,"resize",c),()=>{Lq(window,"resize",c)}},[]),t}var qq=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","URL","WeakMap","WeakSet"],Vq=["bigint","boolean","null","number","string","symbol","undefined"];function id(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(zq(t))return t}function qn(e){return t=>id(t)===e}function zq(e){return qq.includes(e)}function ll(e){return t=>typeof t===e}function Fq(e){return Vq.includes(e)}var Gq=["innerHTML","ownerDocument","style","attributes","nodeValue"],od=e=>Array.isArray(e),Kq=e=>id(e)==="AsyncGeneratorFunction",Wq=qn("AsyncFunction"),Yq=ll("bigint"),Qq=e=>e===!0||e===!1,Zq=qn("Date"),Xq=qn("Error"),Er=ll("function"),Jq=qn("GeneratorFunction"),eV=e=>typeof e=="number"&&Number.isInteger(e),Qg=qn("Map"),wN=e=>Number.isNaN(e),wy=e=>e===null,jN=qn("Function"),tV=qn("Promise"),sV=qn("RegExp"),Zg=qn("Set"),ld=ll("string"),nV=ll("symbol"),jy=ll("undefined"),aV=qn("WeakMap"),rV=qn("WeakSet"),ky=e=>wy(e)||jy(e),kN=e=>!jy(e),iV=e=>ll("number")(e)&&!wN(e),oV=e=>ld(e)&&e.trim().length>0,lV=e=>{if(!ld(e)||e.length===0)return!1;const t=e.trim();return t.length>0&&Number.isFinite(Number(t))},wp=e=>!ky(e)&&(Er(e)||typeof e=="object"),_N=e=>{if(id(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})},cV=e=>wy(e)||Fq(typeof e),dV=e=>id(e)==="URL",SN=e=>!ky(e)&&Er(e[Symbol.iterator]),uV=e=>SN(e)&&Er(e.next)&&Er(e.throw),hV=e=>Er(e)&&/^class\s/.test(e.toString()),pV=(e,t)=>!od(e)||!Er(t)?!1:e.every(s=>t(s)),fV=e=>wp(e)&&!_N(e)&&e.nodeType===1&&ld(e.nodeName)&&Gq.every(t=>t in e),mV=e=>ld(e)&&e.length===0||od(e)&&e.length===0||wp(e)&&!Qg(e)&&!Zg(e)&&Object.keys(e).length===0||Zg(e)&&e.size===0||Qg(e)&&e.size===0,gV=(e,t)=>!e||!t?!1:Object.getPrototypeOf(e)===t.prototype,xV=(e,t)=>od(e)?e.indexOf(t)>-1:!1,yV=(e,t,s)=>{if(!wp(e)||!t)return!1;const r=e[t];return Er(s)?s(r):kN(r)};function Ue(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(od(e))return"Array";if(jN(e))return"Function";const t=id(e);return t||"Object"}Ue.array=od;Ue.arrayOf=pV;Ue.asyncGeneratorFunction=Kq;Ue.asyncFunction=Wq;Ue.bigint=Yq;Ue.boolean=Qq;Ue.class=hV;Ue.date=Zq;Ue.defined=kN;Ue.domElement=fV;Ue.empty=mV;Ue.error=Xq;Ue.function=Er;Ue.generator=uV;Ue.generatorFunction=Jq;Ue.instanceOf=gV;Ue.integer=eV;Ue.iterable=SN;Ue.map=Qg;Ue.nan=wN;Ue.null=wy;Ue.nullOrUndefined=ky;Ue.nonEmptyString=oV;Ue.number=iV;Ue.numericString=lV;Ue.object=wp;Ue.oneOf=xV;Ue.plainFunction=jN;Ue.plainObject=_N;Ue.primitive=cV;Ue.promise=tV;Ue.propertyOf=yV;Ue.regexp=sV;Ue.set=Zg;Ue.string=ld;Ue.symbol=nV;Ue.undefined=jy;Ue.url=dV;Ue.weakMap=aV;Ue.weakSet=rV;var xs=Ue;var _0,K3;function bV(){if(K3)return _0;K3=1;var e=function(r){return Object.prototype.hasOwnProperty.call(r,"props")},t=function(r,o){return r+s(o)},s=function(r){return r===null||typeof r=="boolean"||typeof r>"u"?"":typeof r=="number"?r.toString():typeof r=="string"?r:Array.isArray(r)?r.reduce(t,""):e(r)&&Object.prototype.hasOwnProperty.call(r.props,"children")?s(r.props.children):""};return s.default=s,_0=s,_0}var vV=bV();const S0=Ko(vV);var N0={exports:{}},W3;function wV(){return W3||(W3=1,(function(e){const t=Object.getPrototypeOf({});function s(){return function(c){return typeof c=="object"&&c!==null&&!(c instanceof RegExp)&&!(c instanceof Date)}}function r(o){function c(P){return P!=="constructor"&&P!=="prototype"&&P!=="__proto__"}function d(P){let M=0;const B=P.length,A=new Array(B);for(M;M<B;++M)A[M]=N(P[M]);return A}function h(P){const M={};if(y&&Object.getPrototypeOf(P)!==t)return y(P);const B=x(P);let A,L,U;for(A=0,L=B.length;A<L;++A)c(U=B[A])&&(M[U]=N(P[U]));return M}function p(P,M){const B=P.length,A=M.length;let L=0;const U=new Array(B+A);for(L;L<B;++L)U[L]=N(P[L]);for(L=0;L<A;++L)U[L+B]=N(M[L]);return U}const f=Object.prototype.propertyIsEnumerable;function m(P){const M=Object.keys(P),B=Object.getOwnPropertySymbols(P);for(let A=0,L=B.length;A<L;++A)f.call(P,B[A])&&M.push(B[A]);return M}const x=o?.symbols?m:Object.keys,y=typeof o?.cloneProtoObject=="function"?o.cloneProtoObject:void 0,v=typeof o?.isMergeableObject=="function"?o.isMergeableObject:s(),j=o?.onlyDefinedProperties===!0;function k(P){return typeof P!="object"||P===null}const S=o&&typeof o.mergeArray=="function"?o.mergeArray({clone:N,deepmerge:E,getKeys:x,isMergeableObject:v}):p;function N(P){return v(P)?Array.isArray(P)?d(P):h(P):P}function C(P,M){const B={},A=x(P),L=x(M);let U,K,G;for(U=0,K=A.length;U<K;++U)c(G=A[U])&&L.indexOf(G)===-1&&(B[G]=N(P[G]));for(U=0,K=L.length;U<K;++U)if(c(G=L[U]))if(G in P)A.indexOf(G)!==-1&&(y&&v(M[G])&&Object.getPrototypeOf(M[G])!==t?B[G]=y(M[G]):B[G]=E(P[G],M[G]));else{if(j&&typeof M[G]>"u")continue;B[G]=N(M[G])}return B}function E(P,M){if(j&&typeof M>"u")return N(P);const B=Array.isArray(M),A=Array.isArray(P);return k(M)?M:v(P)?B&&A?S(P,M):B!==A?N(M):C(P,M):N(M)}function O(){switch(arguments.length){case 0:return{};case 1:return N(arguments[0]);case 2:return E(arguments[0],arguments[1])}let P;for(let M=0,B=arguments.length;M<B;++M)P=E(P,arguments[M]);return P}return o?.all?O:E}e.exports=r,e.exports.default=r,e.exports.deepmerge=r,Object.defineProperty(e.exports,"isMergeableObject",{get:s})})(N0)),N0.exports}var jV=wV();const kV=Ko(jV);var C0,Y3;function _V(){if(Y3)return C0;Y3=1;var e=new Error("Element already at target scroll position"),t=new Error("Scroll cancelled"),s=Math.min,r=Date.now;C0={left:o("scrollLeft"),top:o("scrollTop")};function o(h){return function(f,m,x,y){x=x||{},typeof x=="function"&&(y=x,x={}),typeof y!="function"&&(y=d);var v=r(),j=f[h],k=x.ease||c,S=isNaN(x.duration)?350:+x.duration,N=!1;return j===m?y(e,f[h]):requestAnimationFrame(E),C;function C(){N=!0}function E(O){if(N)return y(t,f[h]);var P=r(),M=s(1,(P-v)/S),B=k(M);f[h]=B*(m-j)+j,M<1?requestAnimationFrame(E):requestAnimationFrame(function(){y(null,f[h])})}}}function c(h){return .5*(1-Math.cos(Math.PI*h))}function d(){}return C0}var SV=_V();const NV=Ko(SV);var uh={exports:{}},CV=uh.exports,Q3;function EV(){return Q3||(Q3=1,(function(e){(function(t,s){e.exports?e.exports=s():t.Scrollparent=s()})(CV,function(){function t(r){var o=getComputedStyle(r,null).getPropertyValue("overflow");return o.indexOf("scroll")>-1||o.indexOf("auto")>-1}function s(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var o=r.parentNode;o.parentNode;){if(t(o))return o;o=o.parentNode}return document.scrollingElement||document.documentElement}}return s})})(uh)),uh.exports}var TV=EV();const NN=Ko(TV),AV={arrowBase:32,arrowColor:"#ffffff",arrowSize:16,arrowSpacing:12,backgroundColor:"#ffffff",beaconSize:36,beaconTrigger:"click",beforeTimeout:5e3,blockTargetInteraction:!1,buttons:["back","close","primary"],closeButtonAction:"close",disableFocusTrap:!1,dismissKeyAction:"close",hideOverlay:!1,loaderDelay:300,offset:10,overlayClickAction:"close",overlayColor:"#00000080",primaryColor:"#000000",scrollDuration:300,scrollOffset:20,showProgress:!1,skipBeacon:!1,skipScroll:!1,spotlightPadding:10,spotlightRadius:4,targetWaitTimeout:1e3,textColor:"#000000",width:380,zIndex:100},RV={beaconOptions:{offset:-18}},CN={back:"Back",close:"Close",last:"Last",next:"Next",nextWithProgress:"Next ({current} of {total}
291)",open:"Open the dialog",skip:"Skip"},OV={isFixed:!1,locale:CN,placement:"bottom"},PV={continuous:!1,debug:!1,run:!1,scrollToFirstStep:!1,steps:[]},qe={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",REPLAY:"replay",UPDATE:"update",COMPLETE:"complete"},ts={TOUR_START:"tour:start",STEP_BEFORE_HOOK:"step:before_hook",STEP_BEFORE:"step:before",SCROLL_START:"scroll:start",SCROLL_END:"scroll:end",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",STEP_AFTER_HOOK:"step:after_hook",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found",ERROR:"error"},ge={INIT:"init",READY:"ready",BEACON_BEFORE:"beacon_before",BEACON:"beacon",TOOLTIP_BEFORE:"tooltip_before",TOOLTIP:"tooltip",COMPLETE:"complete"},Ys={BUTTON_BACK:"button_back",BUTTON_CLOSE:"button_close",BUTTON_PRIMARY:"button_primary",BUTTON_SKIP:"button_skip",KEYBOARD:"keyboard",OVERLAY:"overlay"},De={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"},MV="react-joyride-portal";function LV(e){const t={};for(const s in e)e[s]!==void 0&&(t[s]=e[s]);return t}function Lo(...e){return kV({all:!0,isMergeableObject:t=>!(!xs.plainObject(t)||w.isValidElement(t))})(...e)}function EN(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function Ca(e,t={}){const{defaultValue:s,step:r,steps:o}=t;let c=S0(e);if(c)(c.includes("{current}")||c.includes("{total}"))&&r&&o&&(c=c.replace("{current}",r.toString()).replace("{total}",o.toString()));else if(w.isValidElement(e)&&!Object.values(e.props).length&&EN(e.type)==="function")try{c=Ca(e.type({}),t)}catch{c=S0(s)}else c=S0(s);return c}function ss(e,t,s,...r){if(!e)return;const o=new Date,c=`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}.${String(o.getMilliseconds()).padStart(3,"0")}`;console.log(`${t} %c${s}%c ${c}`,"font-weight: bold","color: gray; font-weight: normal",...r)}function DV(e,t){const s=LV(t);return{...e,...s}}function Kc(){}function BV(e){return Object.keys(e)}function Bh(e,...t){if(!xs.plainObject(e))throw new TypeError("Expected an object");const s={};for(const r in e)({}).hasOwnProperty.call(e,r)&&!t.includes(r)&&(s[r]=e[r]);return s}function Z3(e,...t){if(!xs.plainObject(e))throw new TypeError("Expected an object");if(!t.length)return e;const s={};for(const r in e)({}).hasOwnProperty.call(e,r)&&t.includes(r)&&(s[r]=e[r]);return s}function Xg(e,t,s){const r=c=>c.replace("{current}",String(t)).replace("{total}",String(s));if(EN(e)==="string")return r(e);if(!w.isValidElement(e))return e;const{children:o}=e.props;if(xs.string(o)&&o.includes("{current}"))return w.cloneElement(e,{children:r(o)});if(Array.isArray(o))return w.cloneElement(e,{children:o.map(c=>typeof c=="string"?r(c):Xg(c,t,s))});if(xs.function(e.type)&&!Object.values(e.props).length)try{return Xg(e.type({}),t,s)}catch{return e}return e}function X3(e){return BV(e).sort().reduce((t,s)=>(t[s]=e[s],t),{})}function _y(){return!!(typeof window<"u"&&window.document?.createElement)}function J3(e){let t=0,s=0,r=e;for(;r;)t+=r.offsetTop,s+=r.offsetLeft,r=r.offsetParent;return{left:s,top:t}}function Sy(e){return e?e.getBoundingClientRect():null}function IV(e=!1){const{body:t,documentElement:s}=document;if(!t||!s)return 0;if(e){const r=[t.scrollHeight,t.offsetHeight,s.clientHeight,s.scrollHeight,s.offsetHeight].sort((c,d)=>c-d),o=Math.floor(r.length/2);return r.length%2===0?(r[o-1]+r[o])/2:r[o]}return Math.max(t.scrollHeight,t.offsetHeight,s.clientHeight,s.scrollHeight,s.offsetHeight)}function bn(e){if(!e)return null;if(typeof e=="function")try{return e()}catch{return null}if(typeof e=="object"&&"current"in e)return e.current;if(typeof e=="string")try{return document.querySelector(e)}catch{return null}return e}function $V(e,t,s){const r=Sy(e),o=cl(e),c=o?!o.isSameNode(Ds()):!1,d=s??dl(e);let h=0,p=r?.top??0;return c&&d?p=r?.top??0:o instanceof HTMLElement&&(h=o.scrollTop,!c&&!d&&(p+=h),o.isSameNode(Ds())||(p+=Ds().scrollTop)),Math.floor(p-t)}function cl(e,t){if(!e)return Ds();const s=NN(e);if(s){if(s.isSameNode(Ds()))return t?document:Ds();if(!(s.scrollHeight>s.offsetHeight))return Ds()}return s}function UV(e){const t=e.getBoundingClientRect(),s=Ds(),r=t.top+t.height/2,o=window.innerHeight/2;return Math.max(0,s.scrollTop+r-o)}function HV(e,t){if(!e)return 0;const s=NN(e)??Ds(),r=parseFloat(getComputedStyle(e).scrollMarginTop)||0,o=Sy(s),c=s.scrollTop??0,{offsetTop:d=0,scrollTop:h=0}=s;let p=e.getBoundingClientRect().top+h;if(d&&(TN(e)||qV(e))){const m=e.getBoundingClientRect(),x=m.top-(o?.top??0),y=x+m.he
291ight,v=s.clientHeight,j=v*.2;x>=j&&y<=v-j?p=c:p=x+c}const f=Math.floor(p-t-r);return f<0?0:f}function qV(e){return e.offsetParent!==document.body}function TN(e){if(!e)return!1;const t=cl(e);return t?!t.isSameNode(Ds()):!1}function dl(e,t="fixed"){if(!e||!(e instanceof Element))return!1;const{nodeName:s}=e;return s==="BODY"||s==="HTML"?!1:getComputedStyle(e).position===t?!0:e.parentNode?dl(e.parentNode,t):!1}function Vu(e){if(!e)return!1;let t=e;for(;t&&t!==document.body;){if(t instanceof HTMLElement){const{display:s,visibility:r}=getComputedStyle(t);if(s==="none"||r==="hidden")return!1}t=t.parentElement??null}return!0}function ej(e){const{isFirstStep:t,scrollToFirstStep:s,step:r,target:o,targetLifecycle:c}=e;if(r.skipScroll||t&&!s&&c!==ge.TOOLTIP||r.placement==="center")return!1;const d=o?.isConnected?cl(o):Ds(),h=d?!d.isSameNode(Ds()):!1;return(r.isFixed||dl(o))&&!h?!1:d.scrollHeight>d.clientHeight}function Ds(){return document.scrollingElement??document.documentElement}function tj(e,t){const{duration:s,element:r}=t;let o=()=>{};const c=new Promise(d=>{const{scrollTop:h}=r,p=e>h?e-h:h-e;o=NV.top(r,e,{duration:p<100?50:s},()=>{d()})});return{cancel:o,promise:c}}function VV(e){const t=e.replace(/^#?([\da-f])([\da-f])([\da-f])$/i,(r,o,c,d)=>o+o+c+c+d+d),s=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})/i.exec(t);return s?[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]:[]}const AN={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555555",cursor:"pointer",fontSize:16,lineHeight:1,padding:0,WebkitAppearance:"none"},zu={...AN,borderRadius:4,padding:8};function zV(e,t){const{styles:s}=e,r=Lo(s??{},t.styles??{});let{width:o}=t;_y()&&(o=typeof o=="number"&&window.innerWidth<o?window.innerWidth-30:o);const c={bottom:0,left:0,overflow:"hidden",position:"absolute",right:0,top:0,zIndex:t.zIndex};return Lo({arrow:{alignItems:"center",color:t.arrowColor,display:"inline-flex",justifyContent:"center",position:"absolute"},beaconWrapper:{...AN,display:"inline-flex",borderRadius:"50%",position:"relative"},beacon:{height:t.beaconSize,width:t.beaconSize},beaconInner:{animation:"joyride-beacon-inner 1.2s infinite ease-in-out",backgroundColor:t.primaryColor,borderRadius:"50%",display:"block",height:"50%",left:"50%",opacity:.7,position:"absolute",top:"50%",transform:"translate(-50%, -50%)",width:"50%"},beaconOuter:{animation:"joyride-beacon-outer 1.2s infinite ease-in-out",backgroundColor:`rgba(${VV(t.primaryColor).join(",")}, 0.2)`,border:`2px solid ${t.primaryColor}`,borderRadius:"50%",boxSizing:"border-box",display:"block",height:"100%",left:0,opacity:.9,position:"absolute",top:0,transformOrigin:"center",width:"100%"},buttonBack:{...zu,color:t.primaryColor,marginLeft:"auto",marginRight:5},buttonClose:{...zu,color:t.textColor,height:12,padding:8,position:"absolute",right:0,top:0,width:12},buttonPrimary:{...zu,backgroundColor:t.primaryColor,color:t.backgroundColor},buttonSkip:{...zu,color:t.textColor,fontSize:14},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:"100%",transition:"opacity 0.3s"},loader:{alignItems:"center",display:"flex",height:48,inset:0,justifyContent:"center",pointerEvents:"none",position:"fixed",width:48,zIndex:t.zIndex+1},overlay:{...c,backgroundColor:t.overlayColor},spotlight:{},tooltip:{backgroundColor:t.backgroundColor,borderRadius:5,boxSizing:"border-box",color:t.textColor,fontSize:16,maxWidth:"100%",padding:12,position:"relative",width:o},tooltipContainer:{lineHeight:1.4,textAlign:"center"},tooltipTitle:{fontSize:18,margin:0},tooltipContent:{paddingBottom:12,paddingTop:12},tooltipFooter:{alignItems:"center",display:"flex",justifyContent:"flex-end"},tooltipFooterSpacer:{flex:1}},r)}const FV=["after","arrowBase","arrowColor","arrowSize","arrowSpacing","backgroundColor","beaconSize","beaconTrigger","before","beforeTimeout","buttons","closeButtonAction","skipBeacon","dismissKeyAction","disableFocusTrap","hideOverlay","skipScroll","blockTargetInteraction","loaderDelay","offset","overlayClickAction","overlayColor","primaryColor","scrollDuration","scrollOffset","showProgress","spotlightPadding","spotlightRadius","targetWaitTimeout","textColor","width","zIndex"];function Ny(e,t){if(!t)return null;const s=Lo(OV,Z3(e,"arrowComponent","beaconComponent","floatingOptions","loaderComponent","locale","styles","tooltipComponent"),t),r=Lo(AV,e.options??{},Z3(t,...FV)),o=zV(e,{...s,...r}),c=Lo(RV,e.floatingOptions??{},s.floatingOptions??{});return{...s,...r,locale:Lo(CN,e.locale??{},s.locale||{}
291),floatingOptions:c,spotlightPadding:GV(r.spotlightPadding),styles:o}}function GV(e){return typeof e=="number"?{top:e,right:e,bottom:e,left:e}:{top:e?.top??0,right:e?.right??0,bottom:e?.bottom??0,left:e?.left??0}}function KV(e,t,s){const{action:r}=t,o=s&&[qe.PREV,qe.NEXT].includes(r);return e.skipBeacon||e.placement==="center"||o}function RN(e,t=!1){return xs.plainObject(e)?e.target?!0:(ss(t,"tour","target is missing from the step"),!1):(ss(t,"tour","step must be an object"),!1)}function ON(e,t=!1){return xs.array(e)?e.every(s=>RN(s,t)):(ss(t,"tour","steps must be an array"),!1)}var WV=class{beaconPosition=null;debug;eventListeners=new Map;listeners=new Set;props;snapshot;state;steps;tooltipPosition=null;constructor(e){const{initialStepIndex:t,stepIndex:s,steps:r=[]}=e??{},o=xs.number(s);let c=0;this.debug=e?.debug??!1,o?(c=s,xs.number(t)&&ss(this.debug,"tour","initialStepIndex is ignored in controlled mode")):xs.number(t)&&(t>=0&&t<r.length?c=t:r.length>0&&ss(this.debug,"tour","initialStepIndex is out of bounds")),this.props=e??{steps:[]},this.steps=r,this.state={action:qe.INIT,controlled:o,index:c,lifecycle:ge.INIT,origin:null,positioned:!1,scrolling:!1,size:r.length,status:r.length?De.READY:De.IDLE,waiting:!1},this.snapshot=Object.freeze({...this.state})}applyTransitions(e){return e.status===De.WAITING&&e.size>0?{...e,status:De.RUNNING}:e}getStep(e){return Ny(this.props,this.steps[e??this.state.index])}cleanupPositionData=()=>{this.beaconPosition=null,this.tooltipPosition=null};getPositionData=e=>e==="beacon"?this.beaconPosition:this.tooltipPosition;getServerSnapshot=()=>this.snapshot;getSnapshot=()=>this.snapshot;getEventState=()=>Bh(this.snapshot,"positioned");getState=()=>Bh(this.snapshot,"positioned");setPositionData=(e,t)=>{(e==="beacon"?this.beaconPosition:this.tooltipPosition)?.placement!==t.placement&&ss(this.debug,`step:${this.state.index}`,"positioned",`${e} ${t.placement}`),e==="beacon"?this.beaconPosition=t:this.tooltipPosition=t,(this.state.lifecycle===ge.BEACON_BEFORE||this.state.lifecycle===ge.TOOLTIP_BEFORE)&&!this.state.positioned&&this.updateState({positioned:!0});const s=this.getStep()?.floatingOptions?.onPosition;s&&s(t)};setSteps=e=>{this.steps=e,this.updateState({size:e.length})};dispatch=(e,t)=>{const s=this.eventListeners.get(e.type);if(s)for(const r of s)try{r(e,t)}catch{}};on=(e,t)=>{let s=this.eventListeners.get(e);return s||(s=new Set,this.eventListeners.set(e,s)),s.add(t),()=>{s.delete(t)}};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});updateState=(e,t=!1)=>{const{controlled:s,index:r}=this.state,o=this.snapshot,c=s&&!t&&e.index!==void 0?r:e.index??r,d={action:e.action??this.state.action,controlled:s,index:c,lifecycle:e.lifecycle??this.state.lifecycle,origin:e.origin??null,positioned:e.positioned??this.state.positioned,scrolling:e.scrolling??this.state.scrolling,size:e.size??this.state.size,status:e.status??this.state.status,waiting:e.waiting??this.state.waiting},h=this.applyTransitions(d);if(this.state=h,!vy(o,h)){this.snapshot=Object.freeze({...h});for(const p of this.listeners)p(this.snapshot)}}};function YV(e){return new WV(e)}function sj(e,t){return Math.min(Math.max(e,0),t)}function QV(e,t,s){const r=w.useRef(t),o=w.useRef(s);return r.current=t,o.current=s,w.useMemo(()=>{const c=()=>e.current.getSnapshot();return{close:(N=null)=>{const{index:C,status:E}=c();E===De.RUNNING&&e.current.updateState({action:qe.CLOSE,index:C+1,origin:N,lifecycle:ge.COMPLETE,positioned:!1,scrolling:!1,waiting:!1})},go:N=>{const{controlled:C,size:E,status:O}=c();if(C){ss(r.current,"tour","go() is not supported in controlled mode");return}O===De.RUNNING&&e.current.updateState({action:qe.GO,index:N,lifecycle:ge.COMPLETE,positioned:!1,scrolling:!1,status:N<E?O:De.FINISHED,waiting:!1})},info:()=>Bh(e.current.getSnapshot(),"positioned"),next:N=>{const{index:C,size:E,status:O}=c();O===De.RUNNING&&e.current.updateState({action:qe.NEXT,index:sj(C+1,E),lifecycle:ge.COMPLETE,origin:N,positioned:!1,scrolling:!1,waiting:!1})},open:()=>{const{status:N}=c();N===De.RUNNING&&e.current.updateState({action:qe.UPDATE,lifecycle:ge.TOOLTIP_BEFORE,positioned:!1,scrolling:!1,waiting:!1})},prev:N=>{const{index:C,size:E,status:O}=c();O===De.RUNNING&&e.current.updateState({action:qe.PREV,index:sj(C-1,E),lifecycle:ge.COMPLETE,origin:N,positioned:!1,scrolling:!1,waiting:!1})},replay:N=>{const{lifecycle:C,status:E}=c();E!==De.RUNNING||C!==ge.TOOLTIP||e.current.updateState({action:qe.REPLAY,lifecycle:ge.COMPLETE,origin:N,positioned:!1,scrolling:!1,waiting:!1})},reset:(N=!1)=>{const{controlled:C}=c();if(C){ss(r.current,"tour","reset() is not supported in controlled mode");return}o.current(),e.current.updateState({action:qe.RESET,index:0,lifecycle:ge.INIT,positioned:!1,scrolling:!1,status:N?De.RUNNING:De.READY,waiting:!1})},skip:N=>{const{status:C}=c();C===De.RUNNING&&e.current.updateState({action:qe.SKIP,lifecycle:ge.COMPLETE,origin:N,positioned:!1,scrolling:!1,status:De.SKIPPED,waiting:!1})},start:N=>{const{index:C,size:E}=c();o.current(),e.current.updateState({action:qe.START,index:xs.number(N)?N:C,lifecycle:ge.INIT,positioned:!1,scrolling:!1,status:E?De.RUNNING:De.WAITING,waiting:!1},!0)},stop:(N=!1)=>{const{index:C,status:E}=c();[De.FINISHED,De.SKIPPED].includes(E)||e.current.updateState({action:qe.STOP,index:C+(N?1:0),lifecycle:ge.COMPLETE,positioned:!1,scrolling:!1,status:De.PAUSED,waiting:!1})}}},[e])}const ZV=new Set(["origin","positioned"]);function XV(e,t){const s=w.useRef(null);
291w.useEffect(()=>{if(!t)return;const r=e.current.getSnapshot();return ss(!0,"tour","init",r),s.current=r,e.current.subscribe(o=>{const c=s.current;if(s.current=o,!c)return;const d={};let h=!1;for(const p of Object.keys(o))o[p]!==c[p]&&!ZV.has(p)&&(d[p]={from:c[p],to:o[p]},(p==="status"||p==="size")&&(h=!0));Object.keys(d).length&&(!h&&o.index>=o.size||ss(!0,h?"tour":`step:${o.index}`,"state",d))})},[t,e])}function JV(e,t,s){const r=w.useRef(e),o=w.useRef(t);return r.current=e,o.current=t,w.useCallback((c,d,h)=>{const p={...s.current.getEventState(),error:null,scroll:null,step:d,type:c,...h};r.current?.(p,o.current),s.current.dispatch(p,o.current)},[s])}function pr(e,t){return{hasChanged(s){return e[s]!==t[s]},hasChangedTo(s,r){const o=e[s],c=t[s];return Array.isArray(r)?r.includes(o)&&!r.includes(c):o===r&&c!==r},previous:t}}function ez(e){const{addFailure:t,controls:s,emitEvent:r,previousState:o,props:c,state:d,step:h,store:p}=e,{action:f,index:m,lifecycle:x,positioned:y,scrolling:v,size:j,status:k}=d,S=vN(h)??null,N=w.useRef(null),C=w.useRef(c),E=w.useRef(d),O=w.useRef(o),P=w.useRef(h),M=w.useRef(S),B=w.useRef(s),A=w.useRef(null),L=w.useRef(null),U=w.useRef(null);C.current=c,E.current=d,O.current=o,P.current=h,M.current=S,B.current=s;const K=()=>{A.current&&(clearInterval(A.current),A.current=null),L.current=null,U.current&&(U.current.cancel(),U.current=null)};w.useEffect(()=>{if(!O.current)return;const{hasChangedTo:G}=pr(E.current,O.current),W=G("action",[qe.NEXT,qe.PREV,qe.SKIP,qe.CLOSE,qe.REPLAY]),ee=f===qe.START&&(N.current===qe.CLOSE||N.current===qe.REPLAY);(W||ee)&&(N.current=f)},[f]),w.useEffect(()=>{if(!O.current)return()=>{K()};const{hasChanged:G}=pr(E.current,O.current),W=P.current;if(G("index")&&K(),k!==De.RUNNING||!W||x!==ge.INIT)return()=>{K()};const{hasChangedTo:ee}=pr(E.current,O.current);ee("status",De.RUNNING)&&[De.IDLE,De.READY,De.PAUSED].includes(O.current.status)&&r(ts.TOUR_START,W),p.current.cleanupPositionData();const{debug:te}=C.current;if(W.before&&!U.current){ss(te,`step:${m}`,"before()",W),U.current={cancel:()=>{}},p.current.updateState({waiting:!0}),r(ts.STEP_BEFORE_HOOK,W,{action:N.current??E.current.action});const I=()=>{U.current=null,p.current.updateState({action:N.current??E.current.action,waiting:!1,lifecycle:ge.READY})},V=new AbortController,H=W.beforeTimeout;U.current={cancel:()=>V.abort()};const se=H?setTimeout(()=>{V.signal.aborted||(ss(te,`step:${m}`,"before()","timed out",`${H}ms`),V.abort(),t(W,"before_hook"),r(ts.ERROR,W,{error:new Error("Step before hook timed out")}),I())},H):null;W.before({...p.current.getState(),action:N.current??p.current.getState().action,step:W}).then(()=>{V.signal.aborted||(se&&clearTimeout(se),I())}).catch(R=>{V.signal.aborted||(se&&clearTimeout(se),t(W,"before_hook"),r(ts.ERROR,W,{error:R instanceof Error?R:new Error(String(R))}),I())})}else if(!U.current){A.current&&L.current!==W.target&&K();const I=bn(W.target);if(I&&Vu(I))K(),p.current.updateState({action:N.current??qe.UPDATE,lifecycle:ge.READY,waiting:!1});else if(W.targetWaitTimeout===0)p.current.updateState({action:N.current??qe.UPDATE,lifecycle:ge.READY,waiting:!1});else if(!A.current){const{targetWaitTimeout:V}=W,H=Date.now();L.current=W.target,ss(te,`step:${m}`,"polling","started",`${V}ms`),p.current.updateState({waiting:!0}),A.current=setInterval(()=>{const se=bn(W.target),R=Date.now()-H,Q=R>=V;(se&&Vu(se)||Q)&&(ss(te,`step:${m}`,"polling",se&&Vu(se)?"found":"timed out",`${R}ms`),K(),p.current.updateState({action:N.current??qe.UPDATE,lifecycle:ge.READY,waiting:!1}))},100)}}return()=>{K()}},[t,r,m,x,k,p]),w.useEffect(()=>{if(!O.current)return;const{hasChanged:G,hasChangedTo:W,previous:ee}=pr(E.current,O.current),te=P.current;if(!te)return;const I=bn(te.target),V=!!I;if(V&&Vu(I)){if(W("lifecycle",ge.READY)&&ee.lifecycle===ge.INIT&&r(ts.STEP_BEFORE,te,{action:N.current??E.current.action}),W("lifecycle",ge.READY)){const H=E.current,se=KV(te,H,C.current.continuous)?ge.TOOLTIP:ge.BEACON,R=bn(te.scrollTarget??te.spotlightTarget??te.target),Q=ej({isFirstStep:H.index===0,scrollToFirstStep:C.current.scrollToFirstStep,step:te,target:R,targetLifecycle:se}),oe=se===ge.TOOLTIP?ge.TOOLTIP_BEFORE:ge.BEACON_BEFORE;ss(C.current.debug,`step:${m}`,"scroll",Q?"needed":"skipped"),p.current.updateState({action:qe.UPDATE,lifecycle:oe,scrolling:Q})}}else if(E.current.status===De.RUNNING&&x!==ge.INIT&&x!==ge.COMPLETE&&G("lifecycle")){ss(C.current.debug,`step:${m}`,V?"Target not visible":"Target not mounted",te),t(te,"target_not_found"),r(ts.TARGET_NOT_FOUND,te);const H=E.current;H.controlled||p.current.updateState({action:qe.UPDATE,index:H.index+(H.action===qe.PREV?-1:1),lifecycle:ge.INIT})}},[t,r,m,x,p]),w.useEffect(()=>{if(!O.current)return;const{hasChangedTo:G,previous:W}=pr(E.current,O.current),ee=P.current,te=M.current;if(ee&&G("lifecycle",ge.TOOLTIP_BEFORE)&&W.lifecycle===ge.BEACON){const H=bn(ee.scrollTarget??ee.spotlightTarget??ee.target);if(ej({isFirstStep:E.current.index===0,scrollToFirstStep:C.current.scrollToFirstStep,step:ee,target:H,targetLifecycle:ge.TOOLTIP})){p.current.updateState({scrolling:!0,positioned:!1});return}}const I=x===ge.BEACON_BEFORE||x===ge.TOOLTIP_BEFORE;if(ee&&I&&!v){const H=x===ge.TOOLTIP_BEFORE?ge.TOOLTIP:ge.BEACON;p.current.updateState({action:qe.UPDATE,lifecycle:H})}ee&&G("lifecycle",ge.BEACON)&&r(ts.BEACON,ee),ee&&G("lifecycle",ge.TOOLTIP)&&r(ts.TOOLTIP,ee);const V=E.current;if((V.status===De.RUNNING||V.controlled&&V.status===De.PAUSED&&ee)&&te&&G("lifecycle",ge.COMPLETE)&&W.lifecycle===ge.TOOLTIP&&(r(ts.STEP_AFTER,te,{action:N.current??qe.UPDATE,index:W.index??V.index,lifecycle:V.lifecycle}),te.after)){r(ts.STEP_AFTER_HOOK,te,{action:N.current??qe.UPDATE,index:W.index??V.index,lifecycle:V.lifecycle});try{te.after({...p.current.getState(),action:N.current??qe.UPDATE,index:W.index??V.index,lifecycle:V.lifecycle,step:te})}catch{}}},[r,x,y,v,p]),w.useEffect(()=>{if(!O.current)return;const{hasChangedTo:G,previous:W}=pr(E.current,O.current),ee=P.current,te=M.current;if(G("action",qe.REPLAY)&&G("lifecycle",ge.COMPLETE)){p.current.updateState({lifecycle:ge.INIT});return}j&&!ee&&x===ge.INIT&&p.current.updateState({action:qe.UPDATE,lifecycle:ge.COMPLETE,status:De.FINISHED}),!E.current.controlled&&k===De.RUNNING&&G("lifecycle",ge.COMPLETE)&&m<j&&p.current.updateState({action:qe.UPDATE,lifecycle:ge.INIT}),G("lifecycle",ge.COMPLETE)&&m>=j&&p.current.updateState({action:qe.UPDATE,lifecycle:ge.COMPLETE,status:De.FINISHED});const I=ee??te??Ny(C.current,C.current.steps[m-1]);if(I&&G("status",[De.FINISHED,De.SKIPPED])){let V;ee?V=m:te?V=W.index??m:V=m-1,r(ts.TOUR_END,I,{index:V}),E.current.controlled||B.current.reset(),N.current=null}ee&&G("action",qe.STOP)&&(N.current=null,r(ts.TOUR_STATUS,ee)),ee&&G("action",qe.RESET)&&(r(ts.TOUR_STATUS,ee),N.current=null)},[f,r,m,x,j,k,p])}function tz({controls:e,emitEvent:t,props:s,state:r,store:o}){const{debug:c,initialStepIndex:d,run:h,stepIndex:p,steps:f}=s,m=w.useRef(void 0),x=w.useRef(r),y=w.useRef(e);x.current=r,y.current=e,w.useEffect(()=>{const v=m.current;if(m.current=s,!v||s===v)return;const{hasChanged:j}=pr(s,v);if(vy(v.steps,f)||(ON(f,c)?o.current.setSteps(f):(ss(c,"tour","Steps are not valid",f),t(ts.ERROR,f[0]??{target:"",content:""},{error:new Error("Steps are not valid")}))),j("run"))h?o.current.getState().size&&y.current.start(p??d):y.current.stop();else if(xs.number(p)&&j("stepIndex")){const k=xs.number(v.stepIndex)&&v.stepIndex<p?qe.NEXT:qe.PREV;[De.FINISHED,De.SKIPPED].includes(x.current.status)||o.current.updateState({action:k,index:p,lifecycle:ge.INIT,positioned:!1},!0)}},[c,t,d,s,h,p,f,o])}function sz(e,t){const{beaconPosition:s,lifecycle:r,scrollOffset:o,step:c}=t;if(c.scrollTarget||c.spotlightTarget)return Math.max(0,e);let d=e-c.spotlightPadding.top;if(r===ge.BEACON_BEFORE&&s?.placement){const h=nz(s);
291["bottom"].includes(s.placement)||(d+=Math.floor(h-o))}else if(r===ge.TOOLTIP_BEFORE){const{placement:h}=c;if(h==="top"){const p=document.querySelector(".react-joyride__floater")?.getBoundingClientRect().height??0,f=c.floatingOptions?.hideArrow?0:c.arrowSize,m=c.offset+c.spotlightPadding.top+f;d-=p+m}else if(h==="left"||h==="right"){const p=document.querySelector(".react-joyride__floater")?.getBoundingClientRect().height??0,f=bn(c.target)?.getBoundingClientRect().height??0,m=o+c.spotlightPadding.top+f/2-p/2;m<o&&(d-=o-m)}}return Math.max(0,d)}function nz(e){const t=e.middlewareData?.offset;return t?["left","right"].some(s=>e.placement.startsWith(s))?t.x:t.y:0}function az({emitEvent:e,previousState:t,props:s,state:r,step:o,store:c}){const{index:d,lifecycle:h,positioned:p,scrolling:f,status:m}=r,x=w.useRef(null),y=w.useRef(r),v=w.useRef(t),j=w.useRef(s),k=w.useRef(o);y.current=r,v.current=t,j.current=s,k.current=o,w.useEffect(()=>()=>{x.current?.()},[]),w.useEffect(()=>{if(!v.current||!k.current)return;const{hasChangedTo:S}=pr(y.current,v.current),N=k.current,{debug:C}=j.current,{scrollDuration:E}=N,O=h===ge.BEACON_BEFORE||h===ge.TOOLTIP_BEFORE;if(m===De.RUNNING&&O&&f&&S("positioned",!0)){const P=bn(N.scrollTarget??N.spotlightTarget??N.target),M=c.current.getPositionData("beacon"),B=cl(P),A=B?!B.isSameNode(Ds()):!1;x.current?.(),(async()=>{if(A&&!dl(B)){const I=Ds(),V=UV(B),H={initial:I.scrollTop,target:V,element:I,duration:E};e(ts.SCROLL_START,N,{scroll:H});const{cancel:se,promise:R}=tj(V,{element:I,duration:E});x.current=se,await R,e(ts.SCROLL_END,N,{scroll:H})}const U=Math.floor(HV(P,N.scrollOffset))||0,K=A?U:sz(U,{beaconPosition:M,lifecycle:h,scrollOffset:N.scrollOffset,step:N});ss(C,`step:${d}`,"scroll",A?"custom":"document",`${U} → ${K}`);const G=B,W={initial:G.scrollTop,target:K,element:G,duration:E};e(ts.SCROLL_START,N,{scroll:W});const{cancel:ee,promise:te}=tj(K,{element:G,duration:E});x.current=ee,await te,e(ts.SCROLL_END,N,{scroll:W}),c.current.updateState({scrolling:!1})})().catch(()=>{c.current.updateState({scrolling:!1})})}},[e,d,h,p,f,m,c])}function rz(e){const t=$q(()=>DV(PV,e),[e]),{debug:s,initialStepIndex:r,onEvent:o,run:c,stepIndex:d,steps:h}=t,p=w.useRef(YV(t)),f=_j.useSyncExternalStore(p.current.subscribe,p.current.getSnapshot,p.current.getServerSnapshot),[m,x]=w.useState([]),y=w.useCallback((P,M)=>{x(B=>[...B,{reason:M,step:P}])},[]),v=w.useCallback(()=>{x([])},[]);XV(p,s);const j=QV(p,s,v),k=JV(o,j,p),{index:S,size:N,status:C}=f,E=vN(f),O=w.useMemo(()=>Ny(t,h[S]),[S,t,h]);return Uq(()=>{c&&N&&ON(h,s)&&j.start(d??r)}),Iq(()=>{c&&N&&C===De.IDLE&&p.current.updateState({status:De.READY})},[c,N,C]),tz({controls:j,emitEvent:k,props:t,state:f,store:p}),ez({addFailure:y,controls:j,emitEvent:k,previousState:E,props:t,state:f,step:O,store:p}),az({emitEvent:k,previousState:E,props:t,state:f,step:O,store:p}),{controls:j,failures:m,mergedProps:t,state:f,step:O,store:p}}function iz(e){const[t,s]=w.useState(null);return w.useEffect(()=>{let r=null,o=!1;if(e)if(xs.domElement(e))r=e,o=!0;else{const c=document.querySelector(e);c&&(r=c)}else{const c=document.createElement("div");c.id=MV,document.body.appendChild(c),r=c}return s(r),()=>{!r||o||r.parentNode===document.body&&document.body.removeChild(r)}},[e]),t}const oz={animation:"joyride-loader-spin 1s linear infinite",border:"5px solid rgba(0, 0, 0, 0.1)",borderRadius:"50%",borderTopColor:"#555"};function lz({nonce:e,step:t}){const{loaderComponent:s}=t,r=!!s;if(w.useEffect(()=>{if(r||document.getElementById("joyride-loader-animation"))return Kc;const p=document.createElement("style");return p.id="joyride-loader-animation",e&&p.setAttribute("nonce",e),p.appendChild(document.createTextNode(`
292        @keyframes joyride-loader-spin {
293          to { transform: rotate(360deg); }
294        }
295      `)),document.head.appendChild(p),()=>{const f=document.getElementById("joyride-loader-animation");f?.parentNode&&f.parentNode.removeChild(f)}},[r,e]),s===null)return null;const{height:o,width:c,...d}=t.styles.loader;let h;if(s){const p=s;h=Ce.createElement(p,{step:t})}else h=Ce.createElement("div",{style:{...oz,height:o,width:c,borderTopColor:t.primaryColor}});return Ce.createElement("div",{className:"react-joyride__loader","data-testid":"loader",style:d},h)}const cz={height:0,isFixed:!1,left:0,top:0,width:0};function hc(e,t){const s=bn(e);if(!s)return cz;const r=Sy(s),o=dl(s),c=$V(s,t.top,o);
295return{height:Math.round((r?.height??0)+t.top+t.bottom),isFixed:o,left:Math.round((r?.left??0)-t.left),top:c,width:Math.round((r?.width??0)+t.left+t.right)}}function dz(e,t,s){const[r,o]=w.useState(()=>hc(e,t)),c=w.useRef(void 0),d=w.useRef(null),h=w.useRef(s),p=w.useRef(null),f=w.useCallback(()=>{clearTimeout(c.current),c.current=window.setTimeout(()=>{o(x=>{const y=hc(e,t);return x.top===y.top&&x.left===y.left&&x.width===y.width&&x.height===y.height&&x.isFixed===y.isFixed?x:y})},100)},[e,t]);w.useEffect(()=>{let x=null;const y=j=>{d.current=cl(j,!0),d.current&&d.current.addEventListener("scroll",f,{passive:!0}),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f),typeof ResizeObserver<"u"&&(p.current=new ResizeObserver(f),p.current.observe(j)),o(hc(e,t))},v=bn(e);return v?y(v):(x=new MutationObserver(()=>{const j=bn(e);j&&(x?.disconnect(),x=null,y(j))}),x.observe(document.body,{childList:!0,subtree:!0})),()=>{x?.disconnect(),d.current&&d.current.removeEventListener("scroll",f),window.removeEventListener("scroll",f),window.removeEventListener("resize",f),p.current?.disconnect(),clearTimeout(c.current)}},[e,t,f]),w.useEffect(()=>{h.current&&!s&&o(hc(e,t)),h.current=s},[s,e,t]);let m=r;return h.current&&!s&&(m=hc(e,t)),m}function uz(e,t,s){let r=`M0 0H${e}V${t}H0Z`;return s&&(r+=` ${s}`),r}function nj(e,t,s,r,o){if(s<=0||r<=0)return"";const c=Math.max(0,Math.min(o,s/2,r/2));let d=`M${e+c} ${t}`;return d+=`H${e+s-c}`,d+=`A${c} ${c} 0 0 1 ${e+s} ${t+c}`,d+=`V${t+r-c}`,d+=`A${c} ${c} 0 0 1 ${e+s-c} ${t+r}`,d+=`H${e+c}`,d+=`A${c} ${c} 0 0 1 ${e} ${t+r-c}`,d+=`V${t+c}`,d+=`A${c} ${c} 0 0 1 ${e+c} ${t}Z`,d}const hz=[ge.BEACON_BEFORE,ge.BEACON];function pz(e){const{blockTargetInteraction:t,continuous:s,hideOverlay:r,lifecycle:o,onClickOverlay:c,overlayClickAction:d,placement:h,portalElement:p,scrolling:f,spotlightPadding:m,spotlightRadius:x,spotlightTarget:y,styles:v,target:j,waiting:k}=e,S=Hq(),N=dz(y??j,m,f||k),C=w.useRef(null),E=(o===ge.TOOLTIP||o===ge.TOOLTIP_BEFORE)&&h!=="center",[O,P]=w.useState(!1),M=p?C.current?.offsetParent:null,B=M?.clientWidth??S.width,A=M?.clientHeight??IV()??S.height,L=v.overlay?.backgroundColor??"rgba(0, 0, 0, 0.5)",U=w.useMemo(()=>{const{backgroundColor:I,mixBlendMode:V,...H}=v.overlay;return{height:A,pointerEvents:"none",...H}},[A,v.overlay]),K=E&&!f&&!k;w.useEffect(()=>{K?requestAnimationFrame(()=>P(!0)):P(!1)},[K]);const G=s&&hz.includes(o),W=!s&&o!==ge.TOOLTIP;if(r||!k&&(G||W))return null;let ee="";if(K)if(p&&M){const I=bn(y??j);if(I){const V=J3(I),H=J3(M);ee=nj(V.left-H.left-m.left,V.top-H.top-m.top,I.offsetWidth+m.left+m.right,I.offsetHeight+m.top+m.bottom,x)}}else ee=nj(N.left,N.top,N.width,N.height,x);const te=uz(B,A,ee);return Ce.createElement("div",{ref:C,"aria-hidden":"true",className:"react-joyride__overlay","data-testid":"overlay",style:U},Ce.createElement("svg",{className:"react-joyride__spotlight","data-testid":"spotlight",style:{height:A,left:0,position:N.isFixed?"fixed":"absolute",top:0,width:B}},Ce.createElement("path",{d:te,fill:L,fillRule:"evenodd",onClick:c,style:{cursor:d?"pointer":"default",pointerEvents:"auto"}}),ee&&Ce.createElement("path",{d:ee,fill:L,style:{opacity:O?0:1,pointerEvents:t?"auto":"none",transition:"opacity 0.2s"}}),ee&&Object.keys(v.spotlight).length>0&&Ce.createElement("path",{d:ee,fill:"none",style:{pointerEvents:"none"},...v.spotlight})))}function PN(e){const{children:t,element:s}=e;return s?Qo.createPortal(t,s):null}const fz='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), area[href], [tabindex]:not([tabindex="-1"]), [contenteditable]';function mz(e,t){const s=w.useRef(null);w.useEffect(()=>{if(!e)return Kc;s.current=document.activeElement;const r=c=>{if(c.key!=="Tab")return;const d=[...e.querySelectorAll(fz)],{shiftKey:h}=c;if(!d.length)return;c.preventDefault();let p=document.activeElement?d.indexOf(document.activeElement):0;p===-1||!h&&p+1===d.length?p=0:h&&p===0?p=d.length-1:p+=h?-1:1,d[p].focus()};e.addEventListener("keydown",r,!1);let o;{const c=e.querySelector(t);c&&(o=setTimeout(()=>{c.focus({preventScroll:!0})},100))}return()=>{e.removeEventListener("keydown",r),o!==void 0&&clearTimeout(o),s.current?.focus({preventScroll:!0})}},[e,t])}function Ea(e,t,s){const[r]=e.split("-");switch(r){case"top":case"bottom":return{width:t,height:s};case"left":case"right":return{width:s,height:t};default:return null}}function gz(e,t,s){const[r]=e.split("-");switch(r){case"top":return{points:`0,0 ${t/2},${s} ${t},0`,...Ea(e,t,s)};case"bottom":return{points:`${t},${s} ${t/2},0 0,${s}`,...Ea(e,t,s)};case"left":return{points:`0,0 ${s},${t/2} 0,${t}`,...Ea(e,t,s)};case"right":return{points:`${s},${t} ${s},0 0,${t/2}`,...Ea(e,t,s)};default:return null}}function xz(e,t,s,r){if(!t)return{};const[o]=e.split("-");switch(o){case"top":return{bottom:-s,left:t.x??0,...Ea(e,r,s)};case"bottom":return{top:-s,left:t.x??0,...Ea(e,r,s)};case"left":return{right:-s,top:t.y??0,...Ea(e,r,s)};case"right":return{left:-s,top:t.y??0,...Ea(e,r,s)};default:return{}}}
295function yz({arrowComponent:e,arrowRef:t,base:s,placement:r,position:o,size:c,styles:d}){const h=e;let p=null;if(h){if(!Ea(r,s,c))return null;p=Ce.createElement("span",{style:{flexShrink:0}},Ce.createElement(h,{base:s,placement:r,size:c}))}else{const f=gz(r,s,c);if(!f)return null;p=Ce.createElement("svg",{height:f.height,width:f.width,xmlns:"http://www.w3.org/2000/svg"},Ce.createElement("polygon",{fill:"currentColor",points:f.points}))}return Ce.createElement("span",{ref:t,className:"react-joyride__arrow","data-testid":"arrow",style:{...d,...xz(r,o,c,s),...o?{}:{visibility:"hidden"}}},p)}function bz(e){const{beaconComponent:t,continuous:s,index:r,isLastStep:o,locale:c,nonce:d,onInteract:h,shouldFocus:p,size:f,step:m,styles:x}=e,y=w.useRef(null),v=!!t;w.useEffect(()=>{if(v||document.getElementById("joyride-beacon-animation"))return Kc;const S=document.createElement("style");S.id="joyride-beacon-animation",d&&S.setAttribute("nonce",d),S.appendChild(document.createTextNode(`
296        @keyframes joyride-beacon-inner {
297          20% {
298            opacity: 0.9;
299          }
300
301          90% {
302            opacity: 0.7;
303          }
304        }
305
306        @keyframes joyride-beacon-outer {
307          0% {
308            transform: scale(1);
309          }
310
311          45% {
312            opacity: 0.7;
313            transform: scale(0.75);
314          }
315
316          100% {
317            opacity: 0.9;
318            transform: scale(1);
319          }
320        }
321      `)),document.head.appendChild(S);const N=setTimeout(()=>{xs.domElement(y.current)&&p&&y.current.focus()},0);return()=>{clearTimeout(N);const C=document.getElementById("joyride-beacon-animation");C?.parentNode&&C.parentNode.removeChild(C)}},[v,d,p]);const j=Ca(c.open);let k;if(t){const S=t;k=Ce.createElement(S,{continuous:s,index:r,isLastStep:o,size:f,step:m})}else k=Ce.createElement("span",{style:x.beacon},Ce.createElement("span",{style:x.beaconOuter}),Ce.createElement("span",{style:x.beaconInner}));return Ce.createElement("button",{ref:y,"aria-label":j,className:"react-joyride__beacon","data-testid":"button-beacon",onClick:h,onMouseEnter:h,style:x.beaconWrapper,title:j,type:"button"},k)}function vz({styles:e,...t}){const{color:s,height:r,width:o,...c}=e;return Ce.createElement("button",{style:c,type:"button",...t},Ce.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof o=="number"?`${o}px`:o,xmlns:"http://www.w3.org/2000/svg"},Ce.createElement("g",null,Ce.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:s}))))}function wz(e){const{backProps:t,closeProps:s,index:r,isLastStep:o,primaryProps:c,skipProps:d,step:h,tooltipProps:p}=e,{buttons:f,content:m,styles:x,title:y}=h,v={};f.includes("primary")&&(v.primary=Ce.createElement("button",{"data-testid":"button-primary",style:x.buttonPrimary,type:"button",...c})),f.includes("skip")&&!o&&(v.skip=Ce.createElement("button",{"aria-live":"off","data-testid":"button-skip",style:x.buttonSkip,type:"button",...d})),f.includes("back")&&r>0&&(v.back=Ce.createElement("button",{"data-testid":"button-back",style:x.buttonBack,type:"button",...t})),v.close=f.includes("close")&&Ce.createElement(vz,{"data-testid":"button-close",styles:x.buttonClose,...s});const j=y?{"aria-labelledby":"joyride-tooltip-title","aria-describedby":"joyride-tooltip-content"}:{"aria-label":Ca(m),"aria-describedby":"joyride-tooltip-content"};return Ce.createElement("div",{key:"JoyrideTooltip",className:"react-joyride__tooltip","data-joyride-step":r,...h.id&&{"data-joyride-id":h.id},style:x.tooltip,...p,...j},Ce.createElement("div",{style:x.tooltipContainer},y&&Ce.createElement("h4",{id:"joyride-tooltip-title",style:x.tooltipTitle},y),Ce.createElement("div",{id:"joyride-tooltip-content",style:x.tooltipContent},m)),f.some(k=>k==="back"||k==="primary"||k==="skip")&&Ce.createElement("div",{style:x.tooltipFooter},Ce.createElement("div",{style:x.tooltipFooterSpacer},v.skip),v.back,v.primary),v.close)}function jz(e){const{continuous:t,controls:s,index:r,isLastStep:o,size:c,step:d}=e,h=N=>{N.preventDefault(),s.prev(Ys.BUTTON_BACK)},p=N=>{N.preventDefault(),d.closeButtonAction==="skip"?s.skip(Ys.BUTTON_CLOSE):d.closeButtonAction==="replay"?s.replay(Ys.BUTTON_CLOSE):s.close(Ys.BUTTON_CLOSE)},f=N=>{if(N.preventDefault(),!t){s.close(Ys.BUTTON_PRIMARY);return}s.next(Ys.BUTTON_PRIMARY)},m=N=>{N.preventDefault(),s.skip(Ys.BUTTON_SKIP)},x=()=>
321{const{back:N,close:C,last:E,next:O,nextWithProgress:P,skip:M}=d.locale,B=Ca(N),A=Ca(C),L=Ca(E),U=Ca(O),K=Ca(M);let G=C,W=A;if(t){if(G=O,W=U,d.showProgress&&!o){const ee=Ca(P,{step:r+1,steps:c});G=Xg(P,r+1,c),W=ee}o&&(G=E,W=L)}return{backProps:{"aria-label":B,children:N,"data-action":"back",onClick:h,role:"button",title:B},closeProps:{"aria-label":A,children:C,"data-action":"close",onClick:p,role:"button",title:A},primaryProps:{"aria-label":W,children:G,"data-action":"primary",onClick:f,role:"button",title:W},skipProps:{"aria-label":K,children:M,"data-action":"skip",onClick:m,role:"button",title:K},tooltipProps:{"aria-modal":!0,role:"alertdialog"}}},{arrowComponent:y,beaconComponent:v,tooltipComponent:j,...k}=d;let S;if(j){const N=j;S=Ce.createElement(N,{...x(),continuous:t,controls:s,index:r,isLastStep:o,size:c,step:k})}else S=Ce.createElement(wz,{...x(),continuous:t,controls:s,index:r,isLastStep:o,size:c,step:k});return S}function kz(e){if(e.startsWith("left"))return["top","bottom"];if(e.startsWith("right"))return["bottom","top"]}function _z(e,t,s){return e?[K9()]:t.floatingOptions?.flipOptions===!1?[]:[r4({crossAxis:!1,fallbackPlacements:kz(s),padding:20,...t.floatingOptions?.flipOptions})]}function Sz(e){const{continuous:t,controls:s,index:r,lifecycle:o,nonce:c,open:d,portalElement:h,setPositionData:p,setTooltipRef:f,shouldScroll:m,size:x,step:y,target:v,updateState:j}=e,k=w.useRef(null),S=w.useRef({}),N=w.useRef({}),C=y.placement==="center",E=y.placement==="auto",O=w.useMemo(()=>({getBoundingClientRect:()=>({x:window.innerWidth/2,y:window.innerHeight/2,top:window.innerHeight/2,left:window.innerWidth/2,bottom:window.innerHeight/2,right:window.innerWidth/2,width:0,height:0})}),[]),P=w.useMemo(()=>TN(v)?cl(v):void 0,[v]),M=w.useMemo(()=>dl(v),[v]),B=w.useMemo(()=>P?{boundary:P,rootBoundary:"viewport"}:{},[P]),A=C||E?"bottom":y.placement,L=C?"fixed":y.floatingOptions?.strategy??(y.isFixed||M?"fixed":"absolute"),U=w.useMemo(()=>C?[{name:"center",fn:({rects:se})=>({x:(window.innerWidth-se.floating.width)/2,y:(window.innerHeight-se.floating.height)/2})}]:[ag(({placement:se})=>{let R="right";se.startsWith("top")?R="top":se.startsWith("bottom")?R="bottom":se.startsWith("left")&&(R="left");const Q=y.spotlightTarget?0:y.spotlightPadding[R];return y.offset+Q+(y.floatingOptions?.hideArrow?0:y.arrowSize)},[y.offset,y.spotlightPadding,y.spotlightTarget,y.arrowSize,y.floatingOptions?.hideArrow]),..._z(E,y,A),a4({padding:10,...B,...y.floatingOptions?.shiftOptions}),...y.floatingOptions?.hideArrow?[]:[i4({element:k,padding:y.arrowSpacing},[y.arrowSpacing,y.arrowBase])],...y.floatingOptions?.middleware??[]],[C,y,E,A,B]),K=ng({...C?{elements:{reference:O}}:{},placement:A,strategy:L,middleware:U}),G=ng({strategy:L,placement:y.beaconPlacement??(E||C?"bottom":y.placement),middleware:w.useMemo(()=>[ag(y.floatingOptions?.beaconOptions?.offset??-18)],[y.floatingOptions?.beaconOptions?.offset]),whileElementsMounted:sg});N.current=K.middlewareData,S.current=G.middlewareData,w.useEffect(()=>{const{floating:se,reference:R}=K.elements;if(!(!R||!se||o!==ge.TOOLTIP))return sg(R,se,K.update,y.floatingOptions?.autoUpdate)},[o,K.update,y.floatingOptions?.autoUpdate,y.target,K.elements]),w.useEffect(()=>{!C&&v&&K.refs.setReference(v),v&&G.refs.setReference(v)},[G.refs,C,v,K.refs]),w.useEffect(()=>{K.isPositioned&&p("tooltip",{placement:K.placement,x:K.x??0,y:K.y??0,middlewareData:N.current})},[p,K.isPositioned,K.placement,K.x,K.y]),w.useEffect(()=>{G.isPositioned&&p("beacon",{placement:G.placement,x:G.x??0,y:G.y??0,middlewareData:S.current})},[p,G.isPositioned,G.placement,G.x,G.y]);const W=y.zIndex+1,ee=w.useCallback(se=>{se.type==="mouseenter"&&y.beaconTrigger!=="hover"||j({lifecycle:ge.TOOLTIP_BEFORE,positioned:!1})},[y.beaconTrigger,j]),te=w.useCallback(se=>{se&&(K.refs.setFloating(se),f(se))},[K.refs,f]),{arrow:I,floater:V}=y.styles;let H=null;if(o===ge.TOOLTIP||o===ge.TOOLTIP_BEFORE){const se=X3({...V,...K.floatingStyles,zIndex:W,opacity:d&&K.isPositioned?1:0,...!d&&{transition:"none"}});H=Ce.createElement("div",{ref:te,className:"react-joyride__floater","data-testid":"floater",id:`react-joyride-step-${r}`,style:se},Ce.createElement(jz,{continuous:t,controls:s,index:r,isLastStep:r+1===x,size:x,step:y}),!C&&!y.floatingOptions?.hideArrow&&Ce.createElement(yz,{arrowComponent:y.arrowComponent,arrowRef:k,base:y.arrowBase,placement:K.placement,position:K.middlewareData.arrow,size:y.arrowSize,styles:I}))}else(o===ge.BEACON||o===ge.BEACON_BEFORE)&&(H=Ce.createElement("div",{ref:G.refs.setFloating,className:"react-joyride__floater","data-testid":"floater-beacon",i
321d:`react-joyride-step-${r}-beacon`,style:X3({...G.floatingStyles,zIndex:W})},Ce.createElement(bz,{beaconComponent:y.beaconComponent,continuous:t,index:r,isLastStep:r+1===x,locale:y.locale,nonce:c,onInteract:ee,shouldFocus:m,size:x,step:y,styles:y.styles})));return Ce.createElement(PN,{element:h},H)}function Nz(e){const{continuous:t,controls:s,index:r,lifecycle:o,nonce:c,portalElement:d,setPositionData:h,shouldScroll:p,size:f,step:m,updateState:x}=e,[y,v]=w.useState(null);mz(m.disableFocusTrap?null:y,"[data-action=primary]");const j=bn(m.target),k=o===ge.TOOLTIP;return!RN(m)||!xs.domElement(j)?null:Ce.createElement(Sz,{key:`JoyrideStep-${r}`,continuous:t,controls:s,index:r,lifecycle:o,nonce:c,open:k,portalElement:d,setPositionData:h,setTooltipRef:v,shouldScroll:p,size:f,step:m,target:j,updateState:x})}function Cz({controls:e,mergedProps:t,state:s,step:r,store:o}){const{continuous:c,debug:d,nonce:h,portalElement:p,scrollToFirstStep:f}=t,m=iz(p),{index:x,lifecycle:y,status:v}=s,j=v===De.RUNNING,[k,S]=w.useState(!1),N=w.useRef(null),C=r?.loaderDelay??0;w.useEffect(()=>(s.waiting?C===0?S(!0):N.current=setTimeout(()=>{S(!0)},C):S(!1),()=>{N.current&&(clearTimeout(N.current),N.current=null)}),[C,s.waiting]),w.useEffect(()=>{if(!j)return;const P=M=>{!r||y!==ge.TOOLTIP||M.key==="Escape"&&r.dismissKeyAction&&(r.dismissKeyAction==="next"?e.next(Ys.KEYBOARD):r.dismissKeyAction==="replay"?e.replay(Ys.KEYBOARD):e.close(Ys.KEYBOARD))};return document.body.addEventListener("keydown",P,{passive:!0}),()=>{document.body.removeEventListener("keydown",P)}},[e,j,y,r]);const E=w.useCallback(()=>{switch(r?.overlayClickAction){case"close":e.close(Ys.OVERLAY);break;case"next":e.next(Ys.OVERLAY);break;case"replay":e.replay(Ys.OVERLAY);break}},[e,r?.overlayClickAction]);if(!r||!j)return null;const O=s.action===qe.START&&!r.skipBeacon&&r.placement!=="center";return Ce.createElement(Ce.Fragment,null,y!==ge.INIT&&Ce.createElement(Nz,{...s,continuous:c,controls:e,debug:d,nonce:h,portalElement:m,setPositionData:o.current.setPositionData,shouldScroll:!r.skipScroll&&(x!==0||f),step:r,updateState:o.current.updateState}),Ce.createElement(PN,{element:m},Ce.createElement(Ce.Fragment,null,k&&Ce.createElement(lz,{nonce:h,step:r}),!O&&Ce.createElement(pz,{...r,continuous:c,lifecycle:y,onClickOverlay:E,portalElement:p?m:null,scrolling:s.scrolling,waiting:s.waiting}))))}function Ez(e){const{controls:t,failures:s,mergedProps:r,state:o,step:c,store:d}=rz(e);return{controls:t,failures:s,on:w.useCallback((h,p)=>d.current.on(h,p),[d]),state:w.useMemo(()=>Bh(o,"positioned"),[o]),step:c,Tour:_y()?Ce.createElement(Cz,{controls:t,mergedProps:r,state:o,step:c,store:d}):null}}function Tz(e){const{Tour:t}=Ez(e);return t}function MN(e){return _y()?Ce.createElement(Tz,e):null}const Cy="scapely.dashboardTourCompletedAt";function LN(){if(typeof window>"u")return!0;try{return!!window.localStorage.getItem(Cy)}catch{return!0}}function Az(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Cy)}catch{}}function Rz({replayKey:e,isTrial:t,isAccountOpen:s,onOpenAccount:r,onCloseAccount:o}){const[c,d]=w.useState(!1),h=w.useRef(!1);w.useEffect(()=>{const y=window.setTimeout(()=>{LN()||d(!0)},600);return()=>window.clearTimeout(y)},[]),w.useEffect(()=>{e>0&&(Az(),d(!0))},[e]);const p=w.useMemo(()=>{const y=[{target:'[data-tour="header-pill"]',title:"Welcome to Scapely",content:t?"You're on a 7-day Pro trial — full access to every appraisal feature, no card needed. Here's a quick tour of what's where.":"Welcome back. Here's a quick tour of the dashboard so you know where everything lives.",placement:"bottom",skipBeacon:!0},{target:'[data-tour="search"]',title:"Appraise any UK property",content:"Type an address or postcode and we'll pull EPC, planning, flood, plot data and a full cost appraisal in seconds.",placement:"bottom"},{target:'[data-tour="watchlist"]',title:"Your watchlist",content:"Saved appraisals live here. Re-open them any time, re-run a property under different scenarios, or export a PDF report.",placement:"right"},{target:'[data-tour="chrome-banner"]',title:"Scan as you browse",content:"Speed up deal screening with the Scapely Chrome extension — it overlays your appraisal results directly on Rightmove, Zoopla and OnTheMarket listings, no copy-
321paste needed.",placement:"bottom"}];return t&&y.push({target:'[data-tour="trial-badge"]',title:"Your trial countdown",content:"This pill counts down the days left of your Pro trial. We'll send a reminder email partway through and again as it ends. Click it any time to upgrade.",placement:"bottom"}),y.push({target:'[data-tour="header-pill"]',title:"Your account & settings",content:"Click your name pill (or the gear icon) to open Account & settings. We'll open it for you now so you can see what's inside.",placement:"bottom"},{target:'[data-tour="account-plan"]',title:"Plan & billing",content:"See which plan you're on, view your subscription, manage billing in Stripe, or cancel any time. Everything related to payment lives here.",placement:"left",requiresAccountPanel:!0},{target:'[data-tour="account-conversations"]',title:"Your support conversations",content:"When the Scapely team replies to a message you've sent us, the full thread appears here — and a red badge shows on the account button until you've read it.",placement:"left",requiresAccountPanel:!0},{target:'[data-tour="account-support"]',title:"Talk to us any time",content:"Stuck on something or have a feature idea? Send us a note. Replies come back in your inbox and in the conversations section above.",placement:"left",requiresAccountPanel:!0}),y},[t]),[f,m]=w.useState(0);w.useEffect(()=>{if(!c)return;const y=p[f];y&&(y.requiresAccountPanel&&!s?(h.current=!0,r()):!y.requiresAccountPanel&&s&&h.current&&(o(),h.current=!1))},[c,f,p,s,r,o]);const x=y=>{const{status:v,index:j,type:k}=y;if(k==="step:before"&&typeof j=="number"&&m(j),k==="error:target_not_found"&&m(N=>Math.min(p.length-1,N+1)),[De.FINISHED,De.SKIPPED].includes(v)){try{window.localStorage.setItem(Cy,new Date().toISOString())}catch{}d(!1),m(0),h.current&&(o(),h.current=!1)}};return n.jsx(MN,{run:c,steps:p,continuous:!0,onEvent:x,options:{buttons:["back","skip","close","primary"],showProgress:!0,overlayClickAction:!1,dismissKeyAction:"close",arrowColor:"#0f1638",backgroundColor:"#0f1638",primaryColor:"#22d3ee",textColor:"#e2e8f0",overlayColor:"rgba(2, 6, 23, 0.72)",zIndex:1e4,width:440,spotlightRadius:14},styles:{tooltip:{borderRadius:16,padding:24,border:"1px solid rgba(34, 211, 238, 0.25)",boxShadow:"0 30px 60px -20px rgba(34, 211, 238, 0.25), 0 18px 40px -16px rgba(0,0,0,0.6)"},tooltipTitle:{fontSize:16,fontWeight:600,color:"#ffffff",marginBottom:10,lineHeight:1.35},tooltipContent:{fontSize:14,lineHeight:1.65,color:"#cbd5e1",padding:0,marginBottom:4},tooltipFooter:{marginTop:18,gap:8},buttonPrimary:{backgroundColor:"#22d3ee",color:"#06081c",fontSize:12.5,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",borderRadius:10,padding:"9px 16px"},buttonBack:{color:"#94a3b8",fontSize:12.5,marginRight:4,padding:"8px 10px"},buttonSkip:{color:"#64748b",fontSize:12.5,padding:"8px 10px"},buttonClose:{top:12,right:12,width:12,height:12,color:"#64748b"}}})}const Ey="scapely.propertyTourCompletedAt";function Oz(){if(typeof window>"u")return!0;try{return!!window.localStorage.getItem(Ey)}catch{return!0}}function Pz(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Ey)}catch{}}function E0(e){const t=e?'[data-tour-property="rail-mobile"]':'[data-tour-property="rail"]',s=e?'[data-tour-property="back-mobile"]':'[data-tour-property="back"]',r=e?'[data-tour-property="report-mobile"]':'[data-tour-property="report"]',o=e?"bottom":"right";return[{target:'[data-tour-property="overview"]',title:"Your property at a glance",content:"EPC band, plot size, planning risk and an indicative value — the four numbers that matter, refreshed every time the appraisal runs.",placement:"bottom",skipBeacon:!0},{target:t,title:"Jump between sections",content:"Use this rail to focus on one area at a time — sale history, EPC and tenure, build cost and planning risk, plot intelligence, and (on Enterprise) ownership. Tap the active one again to see everything.",placement:o},{target:r,title:"Download a full PDF report",content:"Generates a client-ready property report with every metric, comparable and risk flag from this appraisal. Built entirely in your browser, so your data never leaves the page.",placement:o},{target:s,title:"Back to your watchlist",content:"Done with this property? Head back to the dashboard home — your watchlist, recent searches and a new search are all one click away.",placement:o}]}function T0(){return typeof window>"u"?!1:window.matchMedia("(max-width: 767px)").matches}function Mz({replayKey:e,selectedId:t}){const[s,r]=w.useState(!1),[o,c]=w.useState(()=>
321E0(T0())),d=w.useRef(null);w.useEffect(()=>{const p=d.current;if(d.current=t,!t){r(!1);return}if(p!==null||Oz()||!LN())return;c(E0(T0()));const f=window.setTimeout(()=>r(!0),800);return()=>window.clearTimeout(f)},[t]),w.useEffect(()=>{e>0&&t&&(Pz(),c(E0(T0())),r(!0))},[e,t]);const h=p=>{const{status:f,type:m}=p;if(m==="error:target_not_found")return;if([De.FINISHED,De.SKIPPED].includes(f)){try{window.localStorage.setItem(Ey,new Date().toISOString())}catch{}r(!1)}};return t?n.jsx(MN,{run:s,steps:o,continuous:!0,onEvent:h,options:{buttons:["back","skip","close","primary"],showProgress:!0,overlayClickAction:!1,dismissKeyAction:"close",arrowColor:"#0f1638",backgroundColor:"#0f1638",primaryColor:"#22d3ee",textColor:"#e2e8f0",overlayColor:"rgba(2, 6, 23, 0.72)",zIndex:1e4,width:440,spotlightRadius:14},styles:{tooltip:{borderRadius:16,padding:24,border:"1px solid rgba(34, 211, 238, 0.25)",boxShadow:"0 30px 60px -20px rgba(34, 211, 238, 0.25), 0 18px 40px -16px rgba(0,0,0,0.6)"},tooltipTitle:{fontSize:16,fontWeight:600,color:"#ffffff",marginBottom:10,lineHeight:1.35},tooltipContent:{fontSize:14,lineHeight:1.65,color:"#cbd5e1",padding:0,marginBottom:4},tooltipFooter:{marginTop:18,gap:8},buttonPrimary:{backgroundColor:"#22d3ee",color:"#06081c",fontSize:12.5,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",borderRadius:10,padding:"9px 16px"},buttonBack:{color:"#94a3b8",fontSize:12.5,marginRight:4,padding:"8px 10px"},buttonSkip:{color:"#64748b",fontSize:12.5,padding:"8px 10px"},buttonClose:{top:12,right:12,width:12,height:12,color:"#64748b"}}}):null}const Lz={flip:"amber",btl:"cyan",redevelop:"violet",hold:"sky",hmo:"emerald"},aj={Strong:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-200 border-emerald-400/30",Viable:"bg-cyan-500/15 text-cyan-700 dark:text-cyan-200 border-cyan-400/30",Marginal:"bg-amber-500/15 text-amber-700 dark:text-amber-200 border-amber-400/30",Avoid:"bg-rose-500/15 text-rose-700 dark:text-rose-200 border-rose-400/30"},rj={"Strong Buy":"bg-emerald-500/15 text-emerald-700 dark:text-emerald-200 border-emerald-400/30",Buy:"bg-cyan-500/15 text-cyan-700 dark:text-cyan-200 border-cyan-400/30",Marginal:"bg-amber-500/15 text-amber-700 dark:text-amber-200 border-amber-400/30",Avoid:"bg-rose-500/15 text-rose-700 dark:text-rose-200 border-rose-400/30"};function gr(e){return e==null||!Number.isFinite(e)?"—":`£${Math.round(e).toLocaleString("en-GB")}`}function Dz({item:e,tier:t,onUpgradeHref:s="/pricing"}){const r=t==="enterprise",o=w.useMemo(()=>(e?.last_appraisal?.property?.sale_history?.records?.filter(O=>O.is_subject_property)??[]).sort((O,P)=>P.date.localeCompare(O.date))[0]??null,[e]),[c,d]=w.useState("single"),[h,p]=w.useState(""),[f,m]=w.useState(""),[x,y]=w.useState(""),[v,j]=w.useState(null),[k,S]=w.useState(null);w.useEffect(()=>{d("single"),p(""),m(""),y(""),j(null),S(null)},[e?.id]);const N=vc({mutationFn:async()=>{if(!e)throw new Error("No property selected");const C={watchlist_item_id:e.id,price_mode:c};if(c==="single"){const E=Number(h.replace(/[, ]/g,""));if(!E||E<=0)throw new Error("Enter a positive purchase price");C.price_gbp=E}else if(c==="range"){const E=Number(f.replace(/[, ]/g,"")),O=Number(x.replace(/[, ]/g,""));if(!E||!O||E<=0||O<=0)throw new Error("Enter a positive low and high price");if(O<=E)throw new Error("High price must be greater than low");C.price_low_gbp=E,C.price_high_gbp=O}else if(c==="last_sale"&&!o)throw new Error("No HM Land Registry sale history for this property — choose another mode.");return bt("/appraisal/investment-view",{method:"POST",body:JSON.stringify(C)})},onSuccess:C=>{j(C),S(null)},onError:C=>{j(null),S(C instanceof Gc||C instanceof Error?C.message:"Unexpected error")}});return e?n.jsxs("div",{children:[n.jsxs("header",{className:"mb-5",children:[n.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[n.jsx($o,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),n.jsx("h2",{className:"text-[15px] font-semibold text-emerald-600 dark:text-emerald-400",children:"Investment view"})]}
321),n.jsx("p",{className:"text-[13px] text-slate-600 dark:text-slate-400",children:"Stress-test a purchase price across five exit strategies — flip, buy-to-let, redevelop, hold, and HMO — using your saved appraisal data."})]}),!r&&t!==void 0&&n.jsxs("div",{className:`${ws} mb-6 p-6`,children:[n.jsx(js,{}),n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(Aa,{className:"mt-0.5 h-5 w-5 text-amber-700 dark:text-amber-300"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[16px] font-semibold text-slate-900 dark:text-white",children:"Investment view is an Enterprise feature"}),n.jsx("p",{className:"mt-1 text-[13px] text-slate-600 dark:text-slate-400",children:"Upgrade to run AI-driven price stress-tests across all five exit strategies for any property on your watchlist."}),n.jsx("a",{href:s,className:"mt-3 inline-flex items-center gap-2 rounded-md bg-cyan-500/15 px-3 py-1.5 text-[13px] font-medium text-cyan-700 dark:text-cyan-200 ring-1 ring-cyan-400/30 transition hover:bg-cyan-500/25",children:"See plans"})]})]})]}),r&&!e.last_appraisal&&n.jsxs("div",{className:`${ws} p-6`,children:[n.jsx(js,{}),n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(el,{className:"mt-0.5 h-5 w-5 text-amber-700 dark:text-amber-300"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[15px] font-semibold text-slate-900 dark:text-white",children:"Run a property appraisal first"}),n.jsx("p",{className:"mt-1 text-[13px] text-slate-600 dark:text-slate-400",children:"The investment view uses your appraisal data (EPC, sale history, planning, plot intel) to model each strategy. Switch back to the property detail and run a scan, then try again."})]})]})]}),r&&!!e.last_appraisal&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`${ws} mb-6 p-6`,children:[n.jsx(js,{}),n.jsx("div",{className:"mb-4 flex items-center gap-2",children:n.jsx("h2",{className:"text-[15px] font-semibold text-slate-900 dark:text-white",children:"Purchase price"})}),n.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3",children:[n.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.03] p-1",children:[{id:"single",label:"Single price"},{id:"range",label:"Price range"},{id:"last_sale",label:o?`Last sale (${gr(o.price_gbp)})`:"Last sale (none on record)"}].map(C=>{const E=c===C.id,O=C.id==="last_sale"&&!o;return n.jsx("button",{type:"button",disabled:O,onClick:()=>{d(C.id),S(null)},className:`rounded-md px-3 py-1.5 text-[12px] font-medium transition ${E?"bg-cyan-500/20 text-cyan-700 dark:text-cyan-100":O?"text-slate-600":"text-slate-600 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200"}`,children:C.label},C.id)})}),c==="single"&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500 whitespace-nowrap",children:"Asking / estimated price (£)"}),n.jsx("input",{type:"text",inputMode:"numeric",value:h,onChange:C=>p(C.target.value),placeholder:"e.g. 425000",className:"w-40 rounded-md border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.04] px-3 py-1.5 text-[13px] text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:border-cyan-400/40 focus:outline-none"})]}),c==="range"&&n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500 whitespace-nowrap",children:"Low (£)"}),n.jsx("input",{type:"text",inputMode:"numeric",value:f,onChange:C=>m(C.target.value),placeholder:"e.g. 400000",className:"w-32 rounded-md border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.04] px-3 py-1.5 text-[13px] text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:border-cyan-400/40 focus:outline-none"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("label",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500 
321whitespace-nowrap",children:"High (£)"}),n.jsx("input",{type:"text",inputMode:"numeric",value:x,onChange:C=>y(C.target.value),placeholder:"e.g. 460000",className:"w-32 rounded-md border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.04] px-3 py-1.5 text-[13px] text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:border-cyan-400/40 focus:outline-none"})]})]})]}),c==="last_sale"&&o&&n.jsxs("div",{className:"text-[13px] text-slate-700 dark:text-slate-300",children:["Using the most recent HM Land Registry sale for this property:"," ",n.jsx("span",{className:"font-semibold text-slate-900 dark:text-white",children:gr(o.price_gbp)})," ","on"," ",new Date(o.date).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}),"."]}),n.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[n.jsxs("button",{type:"button",onClick:()=>N.mutate(),disabled:N.isPending,className:"inline-flex items-center gap-2 rounded-md bg-cyan-500/20 px-4 py-2 text-[13px] font-semibold text-cyan-700 dark:text-cyan-100 ring-1 ring-cyan-400/40 transition hover:bg-cyan-500/30 disabled:opacity-50","data-testid":"button-run-investment-view",children:[N.isPending?n.jsx(Me,{className:"h-4 w-4 animate-spin"}):n.jsx($o,{className:"h-4 w-4"}),N.isPending?"Analysing…":v?"Re-run investment view":"Run investment view"]}),k&&n.jsx("span",{className:"text-[12px] text-rose-700 dark:text-rose-300",children:k})]})]}),v&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:`${ws} p-6`,children:[n.jsx(js,{}),n.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[n.jsxs("div",{className:"max-w-prose",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-1.5 font-mono text-[10px] font-bold uppercase tracking-wider text-cyan-700 dark:text-cyan-300",children:[n.jsx(na,{className:"h-3 w-3"}),"VERDICT"]}),n.jsx("p",{className:"text-[15px] leading-relaxed text-slate-800 dark:text-slate-200",children:v.headline}),n.jsx("p",{className:"mt-3 text-[12px] text-slate-500",children:v.price_basis.source_note})]}),n.jsxs("div",{className:"flex flex-col items-start gap-2 sm:items-end",children:[n.jsx("span",{className:`inline-flex items-center rounded-md border px-3 py-1.5 text-[13px] font-semibold ${rj[v.overall_verdict]??rj.Marginal}`,children:v.overall_verdict}),n.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:["Score ",v.overall_score_0_100,"/100"]})]})]})]}),n.jsx(Xs,{accent:"emerald",icon:n.jsx(an,{className:"h-3 w-3"}),title:"Recommendation",children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Best strategy"}),n.jsx("div",{className:"mt-1 text-[14px] font-semibold text-slate-900 dark:text-white",children:v.strategies.find(C=>C.key===v.recommendation.best_strategy_key)?.label??v.recommendation.best_strategy_key})]}),n.jsx("p",{className:"text-[14px] leading-relaxed text-slate-700 dark:text-slate-300",children:v.recommendation.rationale}),n.jsxs("div",{className:"grid gap-3 border-t border-slate-200 dark:border-white/10 pt-3 sm:grid-cols-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Walk-away threshold"}),n.jsx("div",{className:"mt-1 text-[14px] text-slate-900 dark:text-white",children:gr(v.recommendation.walk_away_threshold_gbp)})]}),n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Stretch thoughts"}),n.jsx("div",{className:"mt-1 text-[13px] text-slate-700 dark:text-slate-300",children:v.recommendation.stretch_thoughts})]})]})]})}),n.jsx("div",{className:"grid gap-4 lg:grid-cols-2",children:v.strategies.map(C=>n.jsx(Bz,{s:C},C.key))}),v.data_caveats&&v.data_caveats.length>0&&n.jsxs("div",{className:`${ws} p-5`,children:[n.jsx(js,{}),n.jsxs("div",{className:"mb-2 flex items-center gap-2 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:[n.jsx(bx,{className:"h-3 w-3"})," Data caveats"]}),n.jsx("ul",{className:"space-y-1.5 text-[13px] text-slate-600 dar
321k:text-slate-400",children:v.data_caveats.map((C,E)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-1 inline-block h-1 w-1 flex-none rounded-full bg-slate-500"}),n.jsx("span",{children:C})]},E))})]})]})]})]}):n.jsxs("div",{className:`${ws} p-6 text-[14px] text-slate-700 dark:text-slate-300`,children:[n.jsx(js,{}),"Select a property from your watchlist to run an investment view."]})}function Bz({s:e}){const t=Lz[e.key]??"cyan",s=aj[e.verdict]??aj.Marginal,r=e.economics??{acquisition_cost_gbp:0,works_cost_gbp:0,finance_cost_gbp:0,total_capital_in_gbp:0,exit_or_annual_gbp:0,profit_or_net_yield:"—",timeline_months:0};return n.jsxs("div",{className:`${ws} p-5`,children:[n.jsx(js,{}),n.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("div",{className:`font-mono text-[10px] font-bold uppercase tracking-wider ${gi[t].label}`,children:e.label}),n.jsx("p",{className:"mt-1 text-[14px] leading-snug text-slate-800 dark:text-slate-200",children:e.headline})]}),n.jsx("span",{className:`inline-flex flex-none items-center rounded-md border px-2 py-1 text-[11px] font-semibold ${s}`,children:e.verdict})]}),n.jsxs("div",{className:"mb-4 grid grid-cols-2 gap-x-4 gap-y-2 rounded-md border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.02] p-3 text-[12px]",children:[n.jsx(wo,{label:"Acquisition",value:gr(r.acquisition_cost_gbp)}),n.jsx(wo,{label:"Works",value:gr(r.works_cost_gbp)}),n.jsx(wo,{label:"Finance",value:gr(r.finance_cost_gbp)}),n.jsx(wo,{label:"Total capital in",value:gr(r.total_capital_in_gbp),accent:gi[t].valueText}),n.jsx(wo,{label:"Exit / annual",value:gr(r.exit_or_annual_gbp)}),n.jsx(wo,{label:"Timeline",value:`${r.timeline_months} mo`}),n.jsxs("div",{className:"col-span-2 mt-1 border-t border-slate-200 dark:border-white/10 pt-2",children:[n.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-slate-500",children:"Profit / yield"}),n.jsx("div",{className:`mt-0.5 text-[13px] font-semibold ${gi[t].valueText}`,children:r.profit_or_net_yield})]})]}),n.jsx(A0,{icon:n.jsx(Tr,{className:"h-3 w-3 text-emerald-700 dark:text-emerald-300"}),title:"Pros",items:e.pros??[]}),n.jsx(A0,{icon:n.jsx(gx,{className:"h-3 w-3 text-rose-700 dark:text-rose-300"}),title:"Cons",items:e.cons??[]}),n.jsx(A0,{icon:n.jsx(el,{className:"h-3 w-3 text-amber-700 dark:text-amber-300"}),title:"Key risks",items:e.key_risks??[]}),e.assumptions&&e.assumptions.length>0&&n.jsxs("details",{className:"mt-3 text-[12px] text-slate-500",children:[n.jsxs("summary",{className:"cursor-pointer font-mono text-[10px] uppercase tracking-wider text-slate-500 hover:text-slate-700 dark:hover:text-slate-300",children:["Assumptions (",e.assumptions.length,")"]}),n.jsx("ul",{className:"mt-2 space-y-1",children:e.assumptions.map((o,c)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-1 inline-block h-1 w-1 flex-none rounded-full bg-slate-600"}),n.jsx("span",{children:o})]},c))})]})]})}function wo({label:e,value:t,accent:s}){return n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-slate-500",children:e}),n.jsx("div",{className:`mt-0.5 text-[13px] font-medium ${s??"text-slate-900 dark:text-white"}`,children:t})]})}function A0({icon:e,title:t,items:s}){return!s||s.length===0?null:n.jsxs("div",{className:"mt-3",children:[n.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:[e,t]}),n.jsx("ul",{className:"space-y-1 text-[13px] text-slate-700 dark:text-slate-300",children:s.map((r,o)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-1.5 inline-block h-1 w-1 flex-none rounded-full bg-slate-500"}),n.jsx("span",{children:r})]},o))})]})}const hr=e=>e==null?"—":new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",maximumFractionDigits:0}).format(e),Iz={A:"Pre-1900",B:"1900–1929",C:"1930–1949",D:"1950–1966",E:"1967–1975",F:"1976–1982",G:"1983–1990",H:"1991–1995",I:"1996–2002",J:"2003–2006",K:"2007–2011",L:"2012+"};function $z(e){return!!e&&/^[A-G]$/.test(e)}const Uz={A:{bg:"#19b459",fg:"text-white"},B:{bg:"#8dce46",fg:"text-white"}
321,C:{bg:"#c9d200",fg:"text-slate-900"},D:{bg:"#ffd500",fg:"text-slate-900"},E:{bg:"#fcaa65",fg:"text-slate-900"},F:{bg:"#ef8023",fg:"text-white"},G:{bg:"#e9153b",fg:"text-white"}};function ij({rating:e,pulse:t=!1,testId:s}){const r=$z(e)?Uz[e]:null;return n.jsx(Se.div,{animate:t?{boxShadow:["0 0 0px 0px rgba(34, 211, 238, 0)","0 0 15px 2px rgba(34, 211, 238, 0.3)","0 0 0px 0px rgba(34, 211, 238, 0)"]}:void 0,transition:t?{duration:3,repeat:1/0,ease:"easeInOut"}:void 0,className:`flex h-12 w-12 items-center justify-center rounded-md text-2xl font-bold ${r?r.fg:"text-slate-600 dark:text-slate-400"} ${e==="D"?"shadow-[0_0_24px_rgba(255,213,0,0.25)]":e==="B"?"shadow-[0_0_24px_rgba(141,206,70,0.25)]":""}`,style:{background:r?r.bg:"rgba(255,255,255,0.05)",border:r?"none":"1px solid rgba(255,255,255,0.1)"},"data-testid":s,children:e??"—"})}function Hz({currentRating:e,potentialRating:t,uplift:s,certificateDate:r,epcDetail:o}){const c=!!s&&s.band_jumps>0,d=s?Math.min(95,Math.max(15,s.band_jumps*25+10)):0,h=o&&o.heating_cost_current_gbp!=null&&o.heating_cost_potential_gbp!=null,p=h?(o.heating_cost_current_gbp??0)+(o.hot_water_cost_current_gbp??0)+(o.lighting_cost_current_gbp??0):null,f=h?(o.heating_cost_potential_gbp??0)+(o.hot_water_cost_potential_gbp??0)+(o.lighting_cost_potential_gbp??0):null,m=p!==null&&f!==null?Math.round(p-f):null,x=o?.co2_emissions_current??null,y=o?.co2_emissions_potential??null,v=x!==null&&y!==null?Math.round((x-y)*10)/10:null,j=o?.suggested_improvements?.filter(k=>k.improvement_label||k.improvement_type)??null;return n.jsxs(Xs,{accent:"amber",title:"EPC uplift potential",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx("div",{className:"mb-1 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Current"}),n.jsx(ij,{rating:e,testId:"badge-epc-current"})]}),n.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[s&&n.jsxs("div",{className:"mb-1 flex flex-col items-center leading-none",children:[n.jsx("div",{className:"mb-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Headroom"}),n.jsx("div",{className:"text-base font-semibold text-emerald-700 dark:text-emerald-200",children:c?`+${s.band_jumps} band${s.band_jumps>1?"s":""}`:"Capped"})]}),n.jsx("div",{className:"relative h-2 w-full overflow-hidden rounded-full bg-slate-200 dark:bg-slate-800",children:n.jsx(Se.div,{initial:{width:0},whileInView:{width:`${d}%`},viewport:{once:!0,margin:"-60px"},transition:{duration:1.5,ease:[.25,1,.5,1],delay:.2},className:"absolute inset-y-0 left-0 bg-gradient-to-r from-[#ffd500] via-[#8dce46] to-[#19b459]"})})]}),n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx("div",{className:"mb-1 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Potential"}),n.jsx(ij,{rating:t,pulse:c,testId:"badge-epc-potential"})]})]}),s&&(s.meets_2027_mees_at_current?c:!0)&&n.jsx("div",{className:"mt-3 text-[13px] leading-relaxed text-slate-600 dark:text-slate-400",children:s.meets_2027_mees_at_current?n.jsxs(n.Fragment,{children:["EPC ",n.jsx("strong",{className:"text-emerald-700 dark:text-emerald-400",children:e})," already satisfies the proposed 2027 MEES minimum (EPC C) for let homes. Improving to"," ",n.jsx("strong",{className:"text-emerald-700 dark:text-emerald-400",children:t})," would strengthen the asset's capital value and reduce running costs further."]}):s.meets_2027_mees_at_potential?n.jsxs(n.Fragment,{children:["Currently rated EPC"," ",n.jsx("strong",{className:"text-amber-600 dark:text-amber-400",children:e})," — below the proposed 2027 MEES minimum (EPC C) for let homes. The modelled works bring the property to EPC"," ",n.jsx("strong",{className:"text-emerald-700 dark:text-emerald-400",children:t}),","," ",n.jsx("strong",{children:"unlocking MEES compliance"})," and enabling continued letting post-2027, alongside the financial upside shown below."]}):n.jsxs(n.Fragment,{children:["Currently rated EPC"," ",n.jsx("strong",{className:"text-amber-600 dar
321k:text-amber-400",children:e})," — below the proposed 2027 MEES minimum (EPC C) for let homes. The modelled works improve efficiency to EPC"," ",n.jsx("strong",{children:t})," but do not fully reach the compliance threshold. Further intervention may be required to meet the 2027 letting requirement."]})}),n.jsx("div",{className:"relative mt-5 border-t border-slate-200 dark:border-white/5 pt-5",children:s&&c?n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[n.jsx(nt,{accent:"amber",title:"Retrofit cost",value:s.estimated_retrofit_cost_gbp!==null?hr(s.estimated_retrofit_cost_gbp):"—",note:s.estimated_retrofit_cost_low_gbp!==null&&s.estimated_retrofit_cost_high_gbp!==null?`${hr(s.estimated_retrofit_cost_low_gbp)} – ${hr(s.estimated_retrofit_cost_high_gbp)} range`:void 0,explainer:"Indicative spend on the upgrades modelled to reach the potential band."}),n.jsx(nt,{accent:"amber",title:"Capital value uplift",tone:"good",value:`+${s.estimated_value_uplift_pct.toFixed(1)}%`,explainer:"Knight Frank greener-homes premium, applied per band achieved."}),n.jsx(nt,{accent:"amber",title:"Rental uplift",tone:"good",value:`+${s.estimated_rent_uplift_pct.toFixed(1)}%`,explainer:"Estimated rent premium per EPC band achieved."}),m!==null&&m>0&&n.jsx(nt,{accent:"amber",title:"Annual bill saving",tone:"good",value:`${hr(m)}/yr`,note:p!==null&&f!==null?`${hr(p)} → ${hr(f)}`:void 0,explainer:"Total energy bill saving (heating + hot water + lighting) after EPC improvements."}),v!==null&&v>0&&n.jsx(nt,{accent:"amber",title:"CO₂ saving",tone:"good",value:`−${v}t/yr`,note:x!==null&&y!==null?`${x}t → ${y}t CO₂`:void 0,explainer:"Annual CO₂ emission reduction (tonnes) after improvements per the EPC model."})]}):s?n.jsxs("p",{className:"text-[14px] text-slate-700 dark:text-slate-300",children:["Property is already at its EPC potential per the latest certificate.",s.meets_2027_mees_at_current?" Current rating meets the 2027 MEES minimum — no compliance risk.":" The current rating does not meet the 2027 MEES minimum (EPC C); as no further improvement is modelled, additional works would need to be scoped separately."]}):n.jsx("p",{className:"text-[14px] text-slate-600 dark:text-slate-400",children:"EPC certificate data unavailable for this property — uplift cannot be modelled."})}),s&&s.notes.length>0&&n.jsx("ul",{className:"mt-5 space-y-1.5 border-t border-slate-200 dark:border-white/10 pt-4 text-[13px] text-slate-700 dark:text-slate-300",children:s.notes.map(k=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-1 h-1 w-1 flex-none rounded-full bg-cyan-300/70"}),n.jsx("span",{children:k})]},k))}),j&&j.length>0&&n.jsxs("div",{className:"mt-5 border-t border-slate-200 dark:border-white/10 pt-4",children:[n.jsx("div",{className:"mb-2 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Assessor-recommended improvements"}),n.jsx("ul",{className:"space-y-2",children:j.map(k=>n.jsxs("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-0.5 rounded-md bg-slate-50 dark:bg-white/5 px-3 py-2",children:[n.jsx("span",{className:"text-[13px] font-medium text-slate-800 dark:text-slate-100",children:k.improvement_label??k.improvement_type}),n.jsxs("span",{className:"flex items-center gap-3 font-mono text-[12px] text-slate-500 dark:text-slate-400",children:[k.indicative_cost&&n.jsx("span",{title:"Indicative install cost",children:k.indicative_cost}),k.typical_saving_gbp!=null&&n.jsxs("span",{className:"text-emerald-700 dark:text-emerald-300",title:"Typical annual saving",children:["saves ",hr(k.typical_saving_gbp),"/yr"]}),k.energy_performance_rating!=null&&n.jsxs("span",{title:"New SAP score after improvement",children:["→ SAP ",k.energy_performance_rating]})]})]},k.sequence))})]}),r&&n.jsx(qz,{certificateDate:r})]})}function qz({certificateDate:e}){const t=new Date(e);if(Number.isNaN(t.getTime()))return null;const s=new Date(t.getTime());s.setFullYear(s.getFullYear()+10);const r=Date.now(),o=(r-t.getTime())/(1e3*60*60*24*365.25),c=(s.getTime()-r)/(1e3*60*60*24*365.25),d=c<=0,h=!d&&c<=1,p=t.toLocaleDateString("en-GB",{month:"short",year:"numeric"}),f=s.toLocaleDateString("en-GB",{month:"short",year:"numeric"});return n.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 border-t border-slate-200 dark:border-white/10 pt-4 font-mono text-[11px] uppercase tracking-wider text-slate-600 dar
321k:text-slate-400",children:[n.jsxs("span",{children:["Certificate issued ",p," · ",o.toFixed(1)," yrs old"]}),n.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-slate-900/20 dark:border-white/20 px-2 py-0.5 text-slate-900 dark:text-white",children:d?`Expired ${f} — re-assess required`:`Valid until ${f}${h?" — renew soon":""}`})]})}function Wc(e){if(!e)return null;const t=e.toLowerCase();return t.startsWith("low")?"Low":t.startsWith("med")?"Medium":t.startsWith("high")?"High":t.startsWith("crit")?"Critical":null}function oj(e){return typeof e=="number"&&Number.isFinite(e)?Math.round(e):void 0}function Ty(e){if(!e)return"Not yet appraised";const t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const r=Math.floor(s/60);if(r<24)return`${r}h ago`;const o=Math.floor(r/24);return o<7?`${o}d ago`:`${Math.floor(o/7)}w ago`}function Vz(){_i();const[e,t]=w.useState(null),[s,r]=w.useState(null),[o,c]=w.useState(!0),[d,h]=w.useState(!1),p=f=>{if(!f)return null;const m=f.user_metadata??{},x=[m.full_name,m.name,m.display_name,m.first_name];for(const y of f.identities??[]){const v=y.identity_data??{};x.push(v.full_name,v.name,v.first_name)}for(const y of x)if(typeof y=="string"&&y.trim())return y.trim();return null};return w.useEffect(()=>{let f=!1;wt.auth.getSession().then(({data:x})=>{f||(t(x.session?.user.email??null),r(p(x.session?.user??null)),c(!1))});const{data:m}=wt.auth.onAuthStateChange((x,y)=>{if(t(y?.user.email??null),r(p(y?.user??null)),x==="SIGNED_IN"){const v=new URL(window.location.href);v.searchParams.has("mode")&&(v.searchParams.delete("mode"),window.history.replaceState({},"",v.pathname+(v.search||"")))}});return()=>{f=!0,m.subscription.unsubscribe()}},[]),w.useEffect(()=>{if(!e)return;let f=!1;try{f=sessionStorage.getItem("scapely:justSignedUp")==="1"}catch{f=!1}if(f){try{sessionStorage.removeItem("scapely:justSignedUp")}catch{}bt("/welcome/send",{method:"POST"}).catch(()=>{})}let m=null;try{m=sessionStorage.getItem("scapely:pendingPriceId")}catch{m=null}m&&(h(!0),(async()=>{try{const{url:x}=await bt("/stripe/checkout",{method:"POST",body:JSON.stringify({priceId:m})});if(sessionStorage.removeItem("scapely:pendingPriceId"),x){window.location.href=x;return}}catch{}sessionStorage.removeItem("scapely:pendingPriceId"),h(!1)})())},[e]),o?n.jsx(Jg,{}):d?n.jsx(Jg,{}):e?n.jsx(Kz,{sessionEmail:e,sessionName:s}):n.jsx(zz,{})}function Jg(){return n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-slate-50 dark:bg-[#06081c] text-cyan-700 dark:text-cyan-200",children:n.jsx(Me,{className:"h-6 w-6 animate-spin"})})}function zz(){const{theme:e}=Da(),t=e==="dark",s=typeof window>"u"?"signup":new URLSearchParams(window.location.search).get("mode")==="signin"?"signin":"signup",[r,o]=w.useState(s),[c,d]=w.useState(""),[h,p]=w.useState(""),[f,m]=w.useState(!1),[x,y]=w.useState(null),[v,j]=w.useState(null),k=typeof window<"u"&&!!sessionStorage.getItem("scapely:pendingPriceId"),S=typeof window<"u"&&new URLSearchParams(window.location.search).get("plan")==="single_report",N=async O=>{if(O.preventDefault(),m(!0),y(null),j(null),r==="signup"){const{data:M,error:B}=await wt.auth.signUp({email:c,password:h,options:{emailRedirectTo:`${window.location.origin}/dashboard`}});if(m(!1),B){y(B.message);return}try{sessionStorage.setItem("scapely:justSignedUp","1")}catch{}M.session||(j("Check your email to confirm your account. Once verified, sign in to complete your purchase."),o("signin"));return}const{error:P}=await wt.auth.signInWithPassword({email:c,password:h});m(!1),P&&y(P.message)},C=r==="signup"?"Create your Scapely account":"Sign in to dashboard",E=k?r==="signup"?"We'll create your account, then take you straight to secure checkout.":"Sign in and we'll resume your checkout.":S?r==="signup"?"Pay £9.99 per report. No subscription needed.":"Sign in to your pay-as-you-go account.":r==="signup"?"Start your Pro plan in under a minute.":"Pro & Enterprise account holders only.";return n.jsx(as,{primaryNavLink:{href:"/",label:"Home",testId:"link-nav-home"},children:n.jsxs("div",{className:`${t?"dark bg-[#06081c] text-slate-200":"bg-slate-50 text-slate-800"} flex min-h-screen items-center justify-center px-6 transition-colors duration-300`,children:[n.jsx("div",{className:"pointer-events-none fixed inset-0 opacity-[0.05]",style:{backgroundImage:t?"linear-gradient(to right, white 1px, transparent 1px), linear-gradient(to bottom, white 1px, transparent 1px)":"linear-gradient(to right, #0f172a 1p
321x, transparent 1px), linear-gradient(to bottom, #0f172a 1px, transparent 1px)",backgroundSize:"48px 48px"}}),n.jsxs("div",{className:`relative w-full max-w-sm rounded-[12px] border p-7 backdrop-blur transition-colors duration-300 ${t?"border-white/10 bg-white/[0.03]":"border-slate-200 bg-white/80"}`,children:[n.jsx(Be,{href:"/",className:"mb-6 inline-flex items-center","data-testid":"link-home",children:n.jsx("img",{src:t?_n:fp,alt:"Scapely",className:"h-[14px] w-auto"})}),n.jsx("h1",{className:`text-[14px] font-semibold ${t?"text-white":"text-slate-900"}`,children:C}),n.jsx("p",{className:`mt-1 text-[14px] ${t?"text-slate-400":"text-slate-900"}`,children:E}),n.jsxs("form",{onSubmit:N,className:"mt-6 space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:`mb-1 block font-mono text-[12px] uppercase tracking-wider ${t?"text-slate-400":"text-slate-900"}`,children:"Email"}),n.jsx("input",{type:"email",required:!0,autoComplete:"email",value:c,onChange:O=>d(O.target.value),className:`w-full rounded-[12px] border px-3 py-2 text-[14px] placeholder:text-slate-500 focus:border-cyan-500/60 focus:outline-none focus:ring-1 focus:ring-cyan-300/30 ${t?"border-white/10 bg-white/[0.03] text-white":"border-slate-300 bg-white text-slate-900"}`,"data-testid":"input-email"})]}),n.jsxs("div",{children:[n.jsx("label",{className:`mb-1 block font-mono text-[12px] uppercase tracking-wider ${t?"text-slate-400":"text-slate-900"}`,children:"Password"}),n.jsx("input",{type:"password",required:!0,minLength:r==="signup"?8:void 0,autoComplete:r==="signup"?"new-password":"current-password",value:h,onChange:O=>p(O.target.value),className:`w-full rounded-[12px] border px-3 py-2 text-[14px] placeholder:text-slate-500 focus:border-cyan-500/60 focus:outline-none focus:ring-1 focus:ring-cyan-300/30 ${t?"border-white/10 bg-white/[0.03] text-white":"border-slate-300 bg-white text-slate-900"}`,"data-testid":"input-password"}),r==="signup"&&n.jsx("p",{className:`mt-1 text-[12px] ${t?"text-slate-400":"text-slate-900"}`,children:"Minimum 8 characters."})]}),x&&n.jsx("div",{className:"rounded-[12px] border border-fuchsia-400/30 bg-fuchsia-400/10 px-3 py-2 text-[14px] text-fuchsia-700 dark:text-fuchsia-200",children:x}),v&&n.jsx("div",{className:"rounded-[12px] border border-cyan-300/30 bg-cyan-300/10 px-3 py-2 text-[14px] text-cyan-700 dark:text-cyan-100",children:v}),n.jsx("button",{type:"submit",disabled:f,className:"flex w-full items-center justify-center gap-2 rounded-[12px] bg-gradient-to-r from-cyan-300 to-fuchsia-400 px-4 py-2.5 text-sm font-semibold text-[#06081c] transition hover:opacity-90 disabled:opacity-50","data-testid":r==="signup"?"button-signup":"button-signin",children:f?n.jsx(Me,{className:"h-4 w-4 animate-spin"}):r==="signup"?k?"Create account & continue":"Create account":k?"Sign in & continue":"Sign in"})]}),n.jsx("div",{className:`mt-5 border-t pt-4 text-center text-[14px] ${t?"border-white/10 text-slate-400":"border-slate-200 text-slate-900"}`,children:r==="signup"?n.jsxs(n.Fragment,{children:["Already have an account?"," ",n.jsx("button",{type:"button",onClick:()=>{o("signin"),y(null),j(null)},className:"text-cyan-700 dark:text-cyan-300 hover:text-cyan-800 dark:hover:text-cyan-200","data-testid":"link-toggle-signin",children:"Sign in →"})]}):n.jsxs(n.Fragment,{children:["New to Scapely?"," ",n.jsx("button",{type:"button",onClick:()=>{o("signup"),y(null),j(null)},className:"text-cyan-700 dark:text-cyan-300 hover:text-cyan-800 dark:hover:text-cyan-200","data-testid":"link-toggle-signup",children:"Create an account →"})]})})]})]})})}const DN=[{id:"overview",label:"Overview & quick stats",icon:fx},{id:"sales",label:"Sale history & comparables",icon:Jo},{id:"fundamentals",label:"Heritage & tenure",icon:wk},{id:"epc-uplift",label:"EPC uplift",icon:kn},{id:"developer",label:"Build cost & planning risk",icon:Zo},{id:"site",label:"Plot intelligence",icon:Xo},{id:"commercial",label:"Business / commercial",icon:Wh}],Fz={overview:"Overview",sales:"Sales",fundamentals:"Heritage & tenure","epc-uplift":"EPC uplift",developer:"Build & planning",site:"Plot",commercial:"Ownership"};function Gz({tier:e,activeSection:t,propertyView:s,hasSelected:r,generatingReport:o,reportError:c,onBack:d,onSection:h,onToggleInvestment:p,onGenerateReport:f}){return n.jsxs("div",{className:"w-full min-w-0 max-w-full flex-none overflow-hidden border-b border-slate-200 dark:border-white/[0.06] bg-white/80 dark:bg-[#070a20]/80 backdrop-blur md:hidden","data-testid":"mobile-section-menu",children:[n.jsxs("div",{className:"flex w-full items-center gap-1 overflow-x-auto px-3 py-2 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden","data-tour-property":"rail-mobile",children:[n.jsxs("button",{type:"button",onClick:d,"aria-label":"Back to dashboard home",className:"inline-flex h-9 flex-none items-center gap-1.5 rounded-full border border-slate-200 dark:border-white/10 px-3 text-[12px] font-medium text-slate-700 dark:text-slate-300 transition hover:bg-slate-100 dar
321k:hover:bg-white/[0.06] hover:text-slate-900 dark:hover:text-white","data-testid":"mobile-rail-home","data-tour-property":"back-mobile",children:[n.jsx(_r,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Back"]}),DN.filter(m=>m.id==="commercial"?!0:m.id==="epc-uplift"?e==="pro"||e==="enterprise"||e==="single_report":!0).map(({id:m,label:x,icon:y})=>{const v=t===m&&s!=="investment";return n.jsxs("button",{type:"button",onClick:()=>h(m),"aria-label":x,"aria-pressed":v,className:`inline-flex h-9 flex-none items-center gap-1.5 rounded-full border px-3 text-[12px] font-medium transition ${v?"border-cyan-400/40 bg-cyan-400/10 text-cyan-700 dark:text-cyan-200":"border-slate-200 dark:border-white/10 text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/[0.06] hover:text-slate-900 dark:hover:text-white"}`,"data-testid":`mobile-rail-${m}`,children:[n.jsx(y,{className:"h-3.5 w-3.5","aria-hidden":"true"}),n.jsx("span",{className:"whitespace-nowrap",children:Fz[m]})]},m)}),n.jsxs("button",{type:"button",onClick:p,"aria-label":"Investment view","aria-pressed":s==="investment",className:`inline-flex h-9 flex-none items-center gap-1.5 rounded-full border px-3 text-[12px] font-medium transition ${s==="investment"?"border-cyan-400/40 bg-cyan-400/10 text-cyan-700 dark:text-cyan-200":"border-slate-200 dark:border-white/10 text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/[0.06] hover:text-slate-900 dark:hover:text-white"}`,"data-testid":"mobile-rail-investment-view",children:[n.jsx($o,{className:"h-3.5 w-3.5","aria-hidden":"true"}),n.jsx("span",{className:"whitespace-nowrap",children:"Investment"})]}),r&&n.jsxs("button",{type:"button",onClick:f,disabled:o,"aria-label":"Download property report",className:"inline-flex h-9 flex-none items-center gap-1.5 rounded-full border border-slate-200 dark:border-white/10 px-3 text-[12px] font-medium text-slate-700 dark:text-slate-300 transition hover:bg-slate-100 dark:hover:bg-white/[0.06] hover:text-slate-900 dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-60","data-testid":"mobile-rail-generate-report","data-tour-property":"report-mobile",children:[o?n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}):n.jsx(Kh,{className:"h-3.5 w-3.5","aria-hidden":"true"}),n.jsx("span",{className:"whitespace-nowrap",children:"Report"})]})]}),c&&n.jsx("p",{className:"px-3 pb-2 text-[11px] text-rose-700 dark:text-rose-300",children:c})]})}function Kz({sessionEmail:e,sessionName:t}){const s=t?.trim()||e.split("@")[0]||e,r=Yc(),o=vr({queryKey:["me"],queryFn:()=>bt("/me")}),c=vr({queryKey:["watchlist"],queryFn:()=>bt("/watchlist"),enabled:o.data?.tier==="pro"||o.data?.tier==="enterprise"||o.data?.tier==="single_report"}),[d,h]=w.useState(null),[p,f]=w.useState("overview"),[m,x]=w.useState("detail");w.useEffect(()=>{x("detail")},[d]);const[y,v]=w.useState(!1),[j,k]=w.useState(null),S=J=>{if(J==="all")return;f(J);let ue=0;const ye=()=>{const Le=document.getElementById(`property-section-${J}`);Le?Le.scrollIntoView({behavior:"smooth",block:"start"}):ue++<12&&requestAnimationFrame(ye)};requestAnimationFrame(ye)},[N,C]=w.useState(""),[E,O]=w.useState(0),[P,M]=w.useState(0),[B,A]=w.useState(null),[L,U]=w.useState(null),[K,G]=w.useState(!1);w.useRef(!1);const W=w.useRef(null),[ee,te]=w.useState(!1),I=c.data?.items??[],[V,H]=w.useState(()=>{if(typeof window>"u")return[];try{const J=window.localStorage.getItem("scapely:recent-searches");if(!J)return[];const ue=JSON.parse(J);return Array.isArray(ue)?ue.filter(ye=>typeof ye=="string").slice(0,3):[]}catch{return[]}}),se=J=>{const ue=J.trim();ue&&H(ye=>{const Le=[ue,...ye.filter(ot=>ot!==ue)].slice(0,3);try{window.localStorage.setItem("scapely:recent-searches",JSON.stringify(Le))}catch{}return Le})},R=w.useMemo(()=>I.find(J=>J.id===d)??null,[I,d]),[Q,oe]=w.useState(null),ne=vc({mutationFn:async({item:J,scenario:ue})=>{const ye=await bt("/appraisal/generate",{method:"POST",body:JSON.stringify({postcode:J.postcode,address_line:J.address_line,local_authority:J.local_authority??void 0,run_ai:!0,...ue?{project_type:ue}:{}})});await bt("/watchlist",{method:"POST",body:JSON.stringify({address_line:ye.property?.address_line??J.address_line,postcode:ye.property?.postcode??J.postcode,local_authority:ye.property?.local_authority??J.local_authority??void 0,source:J.source??"dashboard",source_url:J.source_url??void 0,last_total_cost:oj(ye.appraisal?.financial_appraisal?.total_estimated_cost),last_risk_level:ye.appraisal?.planning_risk_assessment?.overall_risk_level??void 0,last_appraisal:ye})})},onSuccess:()=>{oe(null),r.invalidateQueries({queryKey:["watchlist"]})},onError:J=>{oe(J.message||"Couldn't re-run the appraisal — try again shortly.")}}),le=vc({mutationFn:async({query:J})=>{const ue=J.trim(),ye=ue.match(/[A-Z]{1,2}\d{1,2}[A-Z]?\s?\d?[A-Z]{0,2}/i),Le=ye?ye[0]:ue,ot=ye&&ue.replace(ye[0],"").replace(/,\s*$/,"").trim()||ue,Je=await bt("/appraisal/generate",{method:"POST",body:JSON.stringify({postcode:Le,address_line:ot,run_ai:!0})});return await bt("/watchlist",{method:"POST",body:JSON.stringify({address_line:Je.property?.address_line??ot,postcode:Je.property?.postcode??Le,local_authority:Je.property?.local_authority??void 0,source:"dashboard",last_total_cost:oj(Je.appraisal?.financial_appraisal?.total_estimated_cost),last_risk_level:Je.appraisal?.planning_risk_assessment?.overall_risk_level??void 0,last_appraisal:Je})})},onSuccess:(J,ue)=>{r.invalidateQueries({queryKey:["watchlist"]}),h(J.item.id),f("all"),se(ue.query),C(""),A(null)},onError:J=>{if(J instanceof Gc&&J.status===402&&J.body?.payment_required){U({uprn:String(J.body.uprn??""),address_line:J.body.address_line!=null?String(J.body.address_line):null,postcode:String(J.body.postcode??"")});return}A(J.message)}});w.useEffect(()=>{const J=new URLSearchParams(window.location.search),ue=J.get("session_id"),ye=J.get("uprn"),Le=J.get("postcode");if(!ue||!ye||!Le)return;const ot=new URL(window.location.href);["session_id","uprn","postcode","address_line"].forEach(jt=>ot.searchParams.delete(jt)),window.history.replaceState({},"",ot.toString());const Je=J.get("address_line")??"";bt("/stripe/verify-single-report",{method:"POST",body:JSON.stringify({sessionId:ue})}).then(()=>{const jt=Je?`${Je}, ${Le}`:Le;le.mutate({query:jt})}).catch(()=>{const jt=Je?`${Je}, ${Le}`:Le;le.mutate({query:jt})})},[]),w.useEffect(()=>{const ue=new URLSearchParams(window.location.search).get("q");
321if(!ue)return;const ye=new URL(window.location.href);ye.searchParams.delete("q"),window.history.replaceState({},"",ye.toString()),le.mutate({query:ue}),C(ue)},[]);const fe=vc({mutationFn:async J=>{await bt(`/watchlist/${J}`,{method:"DELETE"})},onSuccess:(J,ue)=>{r.setQueryData(["watchlist"],ye=>ye?{items:ye.items.filter(Le=>Le.id!==ue)}:{items:[]}),d===ue&&h(null)}}),he=async()=>{await wt.auth.signOut()};if(o.isLoading)return n.jsx(Jg,{});if(o.isError)return n.jsx(dF,{title:"Couldn't load your profile",body:o.error.message});const Ne=o.data;return n.jsxs("div",{className:"report-copy-contrast flex h-screen w-full flex-col overflow-hidden bg-slate-50 dark:bg-[#06081c] font-sans text-slate-800 dark:text-slate-200 selection:bg-cyan-300/30 selection:text-slate-900 dark:selection:text-white",children:[n.jsxs("header",{className:"z-10 flex h-16 flex-none items-center gap-3 border-b border-slate-200 dark:border-white/10 bg-white/80 dark:bg-[#06081c]/80 px-5 backdrop-blur-md",children:[n.jsxs(Be,{href:"/",className:"flex items-center gap-3","data-testid":"link-home",children:[n.jsx("img",{src:zo,alt:"Scapely",className:"h-10 w-10 shrink-0 sm:hidden [filter:brightness(0)] dark:[filter:none]"}),n.jsx("img",{src:fp,alt:"Scapely",className:"hidden h-[14px] w-auto shrink-0 sm:block dark:hidden"}),n.jsx("img",{src:_n,alt:"",className:"hidden h-[14px] w-auto shrink-0 sm:dark:block"})]}),n.jsx("div",{className:"flex flex-1 justify-center",children:d&&n.jsxs("form",{onSubmit:J=>{J.preventDefault(),N.trim()&&(A(null),le.mutate({query:N}))},className:"relative hidden w-full max-w-md md:flex lg:max-w-lg","data-tour":"search",children:[n.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:n.jsx(Ra,{className:"h-4 w-4 text-slate-500"})}),n.jsx("input",{type:"text",placeholder:"Search a UK address or postcode…",value:N,onChange:J=>C(J.target.value),disabled:le.isPending,className:"w-full rounded-full border border-slate-200 dark:border-white/10 bg-white/80 dark:bg-[#070a20]/80 py-2 pl-10 pr-[88px] text-[13px] text-slate-900 dark:text-white shadow-inner placeholder:text-slate-500 focus:border-cyan-500/50 focus:outline-none focus:ring-1 focus:ring-cyan-500/50 disabled:opacity-60","data-testid":"input-search"}),n.jsx("div",{className:"absolute inset-y-0 right-1 flex items-center",children:n.jsx("button",{type:"submit",disabled:le.isPending||!N.trim(),className:"inline-flex h-[28px] items-center gap-1.5 rounded-full bg-cyan-500 px-3 text-[12px] font-semibold text-white transition-all hover:bg-cyan-400 disabled:cursor-not-allowed disabled:bg-cyan-500/70","data-testid":"button-search",children:le.isPending?n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}):"Run Check"})})]})}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(QB,{}),n.jsx("span",{"data-tour":"trial-badge",children:n.jsx(Zz,{me:o.data})}),n.jsxs("button",{type:"button",onClick:()=>te(!0),className:"flex items-center gap-2.5 rounded-full px-1.5 py-1 transition hover:bg-slate-100 dark:hover:bg-white/5","data-tour":"header-pill","data-testid":"button-open-account",title:"Account & subscription","aria-label":"Open account settings",children:[n.jsx("span",{className:"hidden text-[14px] font-medium text-slate-900 dark:text-slate-100 sm:block","data-testid":"text-user-name",children:s}),(Ne.unread_support_count??0)>0&&n.jsx("span",{className:"ml-0.5 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-rose-500 px-1 text-[10px] font-bold text-white",title:`${Ne.unread_support_count} new support repl${Ne.unread_support_count===1?"y":"ies"}`,"data-testid":"badge-unread-support","aria-label":`${Ne.unread_support_count} new support replies`,children:Ne.unread_support_count>9?"9+":Ne.unread_support_count})]}),n.jsx("button",{type:"button",onClick:()=>te(!0),className:"flex h-10 w-10 items-center justify-center rounded-full text-slate-700 dark:text-slate-300 transition hover:bg-slate-100 dark:hover:bg-white/5 hover:text-slate-900 dark:hover:text-white sm:h-8 sm:w-8","aria-label":"Account settings",title:"Account settings","data-testid":"button-account-settings",children:n.jsx(L7,{className:"h-5 w-5 sm:h-4 sm:w-4"})}),n.jsx("button",{type:"button",onClick:()=>{d?M(J=>J+1):O(J=>J+1)},className:"hidden h-10 w-10 items-center justify-center rounded-full text-slate-600 dar
321k:text-slate-400 transition hover:bg-slate-100 dark:hover:bg-white/5 hover:text-slate-900 dark:hover:text-white sm:flex sm:h-8 sm:w-8","aria-label":"Replay tour",title:"Replay tour","data-testid":"button-replay-tour",children:n.jsx(bk,{className:"h-5 w-5 sm:h-4 sm:w-4"})}),n.jsx("button",{type:"button",onClick:he,className:"flex h-10 w-10 items-center justify-center rounded-full text-slate-600 dark:text-slate-400 transition hover:bg-slate-100 dark:hover:bg-white/5 hover:text-slate-900 dark:hover:text-white sm:h-8 sm:w-8","aria-label":"Sign out","data-testid":"button-signout",children:n.jsx(Qh,{className:"h-5 w-5 sm:h-4 sm:w-4"})})]})]}),n.jsx("div",{"data-tour":"chrome-banner",children:n.jsx(Qz,{})}),n.jsx(Rz,{replayKey:E,isTrial:!!(Ne.is_trial&&Ne.trial_ends_at),isAccountOpen:ee,onOpenAccount:()=>te(!0),onCloseAccount:()=>te(!1)}),n.jsx(Mz,{replayKey:P,selectedId:d}),n.jsxs("form",{onSubmit:J=>{J.preventDefault(),N.trim()&&(A(null),le.mutate({query:N}))},className:"relative z-10 flex flex-none items-center gap-2 border-b border-slate-200 dark:border-white/[0.06] bg-white/70 dark:bg-[#070a20]/60 px-3 py-2 md:hidden",children:[n.jsx(Ra,{className:"ml-1 h-4 w-4 flex-none text-slate-500"}),n.jsx("input",{type:"text",placeholder:"Search a UK address or postcode…",value:N,onChange:J=>C(J.target.value),disabled:le.isPending,className:"min-w-0 flex-1 rounded-full border border-slate-200 dark:border-white/10 bg-white/80 dark:bg-[#070a20]/80 px-3 py-2 text-[13px] text-slate-900 dark:text-white placeholder:text-slate-500 focus:border-cyan-500/50 focus:outline-none focus:ring-1 focus:ring-cyan-500/50 disabled:opacity-60","data-testid":"input-search-mobile"}),n.jsx("button",{type:"submit",disabled:le.isPending||!N.trim(),className:"inline-flex h-9 flex-none items-center gap-1.5 rounded-full bg-cyan-500 px-3 text-[12px] font-semibold text-white transition-all hover:bg-cyan-400 disabled:cursor-not-allowed disabled:bg-cyan-500/70","data-testid":"button-search-mobile","aria-label":"Run check",children:le.isPending?n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}):"Run"})]}),B&&n.jsx("div",{className:"z-10 flex flex-none items-center justify-center border-b border-fuchsia-400/20 bg-fuchsia-500/10 px-5 py-2 text-[13px] text-fuchsia-700 dark:text-fuchsia-200",children:B}),n.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d&&n.jsxs("nav",{"aria-label":"Property sections",className:"hidden w-16 flex-none flex-col items-center gap-1 border-r border-slate-200 dark:border-white/[0.06] bg-white/70 dark:bg-[#070a20]/60 px-2 pb-4 pt-[2.25rem] sm:pt-[2.875rem] md:flex","data-tour":"watchlist","data-tour-property":"rail",children:[n.jsx(Be,{href:"/",title:"Scapely home","aria-label":"Scapely home",className:"mb-2 flex h-9 w-9 items-center justify-center rounded-xl transition hover:bg-slate-100 dark:hover:bg-white/5","data-testid":"rail-brand",children:n.jsx("img",{src:zo,alt:"","aria-hidden":"true",className:"h-9 w-9 [filter:brightness(0)] dark:[filter:none]"})}),R&&n.jsx("button",{type:"button",onClick:()=>ne.mutate({item:R}),disabled:ne.isPending,title:"Re-run the development appraisal for this property","aria-label":"Re-analyse property",className:"mb-2 flex h-10 w-10 items-center justify-center rounded-xl bg-cyan-400 text-slate-950 shadow-[0_0_16px_rgba(34,211,238,0.2)] transition hover:bg-cyan-300 disabled:cursor-not-allowed disabled:opacity-60","data-testid":"rail-reanalyze",children:ne.isPending?n.jsx(Me,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}):n.jsx(sn,{className:"h-4 w-4","aria-hidden":"true"})}),n.jsx("button",{type:"button",onClick:()=>{h(null),f("overview")},title:"Back to dashboard home","aria-label":"Back to dashboard home",className:"mb-2 flex h-10 w-10 items-center justify-center rounded-xl text-slate-600 dark:text-slate-400 transition hover:bg-slate-100 dark:hover:bg-white/5 hover:text-cyan-800 dark:hover:text-cyan-200","data-testid":"rail-home","data-tour-property":"back",children:n.jsx(_r,{className:"h-4 w-4","aria-hidden":"true"})}),n.jsx("div",{className:"my-1 h-px w-8 bg-slate-200 dark:bg-white/10","aria-hidden":"true"}),DN.filter(J=>J.id==="commercial"?!0:J.id==="epc-uplift"?Ne.tier==="pro"||Ne.tier==="enterprise"||Ne.tier==="single_report":!0).map(({id:J,label:ue,icon:ye})=>{const Le=p===J&&m!=="investment";return n.jsx("button",{type:"button",onClick:()=>{x("detail"),S(J)},title:ue,"aria-label":ue,"aria-pressed":Le,className:`relative flex h-10 w-10 items-center justify-center rounded-xl transition ${Le?"bg-cyan-400/10 text-cyan-700 dark:text-cyan-200 shadow-[inset_0_0_18px_rgba(34,211,238,0.15)]":"text-slate-500 hover:bg-slate-100 dar
321k:hover:bg-white/5 hover:text-slate-800 dark:hover:text-slate-200"}`,"data-testid":`rail-${J}`,children:n.jsx(ye,{className:"h-4 w-4","aria-hidden":"true"})},J)}),d&&(Ne.tier==="pro"||Ne.tier==="enterprise"||Ne.tier==="single_report")&&n.jsx("button",{type:"button",onClick:()=>x(J=>J==="investment"?"detail":"investment"),title:"Investment view","aria-label":"Investment view","aria-pressed":m==="investment",className:`relative mt-1 flex h-10 w-10 items-center justify-center rounded-xl transition ${m==="investment"?"bg-cyan-400/10 text-cyan-700 dark:text-cyan-200 shadow-[inset_0_0_18px_rgba(34,211,238,0.15)]":"text-slate-500 hover:bg-slate-100 dark:hover:bg-white/5 hover:text-cyan-800 dark:hover:text-cyan-200"}`,"data-testid":"rail-investment-view",children:n.jsx($o,{className:"h-4 w-4","aria-hidden":"true"})}),R&&n.jsxs(n.Fragment,{children:[Q&&n.jsx("span",{className:"max-w-[3.25rem] text-center font-mono text-[9px] uppercase leading-tight tracking-wider text-rose-700 dark:text-rose-300",title:Q,children:"Failed"}),n.jsx("div",{className:"my-1 h-px w-8 bg-slate-200 dark:bg-white/10","aria-hidden":"true"}),n.jsx("button",{type:"button",onClick:async()=>{if(!(y||!R)){v(!0),k(null);try{await Kg(R)}catch(J){k(J instanceof Error?J.message:"Could not generate report")}finally{v(!1)}}},disabled:y,title:y?"Building report…":"Download property report (PDF)","aria-label":"Download property report",className:"flex h-10 w-10 items-center justify-center rounded-xl text-slate-600 dark:text-slate-400 transition hover:bg-slate-100 dark:hover:bg-white/5 hover:text-cyan-800 dark:hover:text-cyan-200 disabled:cursor-not-allowed disabled:opacity-60","data-testid":"rail-generate-report","data-tour-property":"report",children:y?n.jsx(Me,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}):n.jsx(Kh,{className:"h-4 w-4","aria-hidden":"true"})}),j&&n.jsx("span",{className:"max-w-[3.25rem] text-center font-mono text-[9px] uppercase leading-tight tracking-wider text-rose-700 dark:text-rose-300",title:j,children:"Failed"})]})]}),n.jsxs("main",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-slate-50 dark:bg-[#06081c]",children:[d&&n.jsx(Gz,{tier:Ne.tier,activeSection:p,propertyView:m,hasSelected:!!R,generatingReport:y,reportError:j,onBack:()=>{h(null),f("overview")},onSection:J=>{x("detail"),S(J)},onToggleInvestment:()=>x(J=>J==="investment"?"detail":"investment"),onGenerateReport:async()=>{if(!(y||!R)){v(!0),k(null);try{await Kg(R)}catch(J){k(J instanceof Error?J.message:"Could not generate report")}finally{v(!1)}}}}),n.jsx("div",{ref:W,className:"min-h-0 flex-1 overflow-y-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:n.jsx("div",{className:R&&I.length>1?"pb-[240px]":void 0,children:R?n.jsx(tF,{item:R,tier:Ne.tier,ownerIntelUnlocked:Ne.owner_intel_unlocked===!0,scrollRootRef:W,onSectionInView:f,reanalyzing:ne.isPending,reanalyzeError:Q,onReanalyze:()=>ne.mutate({item:R}),onBack:()=>{h(null),f("overview")},bodyOverride:m==="investment"?n.jsx(Dz,{item:R,tier:Ne.tier}):void 0}):le.isPending?n.jsx(cF,{query:N}):n.jsx(lF,{items:I,isLoading:c.isLoading,recentSearches:V,searchInput:N,onSearchInputChange:C,onSubmitSearch:J=>{A(null),le.mutate({query:J})},isSearching:le.isPending,searchError:B,onSelectItem:J=>{h(J),f("overview")},onRemoveItem:J=>fe.mutate(J),userEmail:e,userName:t,tier:Ne.tier})})}),R&&I.length>1&&n.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-30",children:n.jsx("div",{className:"pointer-events-auto border-t border-slate-200 dark:border-white/[0.08] bg-white/70 dark:bg-[#06081c]/55 shadow-[0_-12px_40px_-12px_rgba(0,0,0,0.6)] [backdrop-filter:blur(18px)_saturate(140%)] supports-[backdrop-filter]:bg-white/55 dark:supports-[backdrop-filter]:bg-[#06081c]/35",children:n.jsx(sF,{items:I,currentId:R.id,onSelect:J=>{h(J),f("overview")},onRemove:J=>fe.mutate(J)})})})]})]}),ee&&n.jsx(Wz,{email:e,displayName:t??"",me:Ne,onClose:()=>te(!1)}),L&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-label":"Payment required",children:n.jsxs("div",{className:"mx-4 w-full max-w-sm rounded-2xl border border-slate-200 dark:border-white/10 bg-white dark:bg-[#0d1027] p-6 shadow-2xl",children:[n.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Pay to unlock this report"}
321),n.jsxs("p",{className:"mt-2 text-sm text-slate-600 dark:text-slate-400",children:["Get the full AI development appraisal for"," ",n.jsx("span",{className:"font-medium text-slate-900 dark:text-white",children:L.address_line?`${L.address_line}, ${L.postcode}`:L.postcode})," ","— every feature unlocked, saved to your dashboard."]}),n.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[n.jsx("span",{className:"text-3xl font-bold text-slate-900 dark:text-white",children:"£9.99"}),n.jsx("span",{className:"text-sm text-slate-500",children:"one-time"})]}),K&&n.jsx("p",{className:"mt-3 text-xs text-slate-500 dark:text-slate-400",children:"Opening Stripe checkout…"}),n.jsx("button",{type:"button",disabled:K,onClick:async()=>{G(!0);try{const{url:J}=await bt("/stripe/single-report-checkout",{method:"POST",body:JSON.stringify({uprn:L.uprn,address_line:L.address_line??"",postcode:L.postcode})});J&&(window.location.href=J)}catch{G(!1)}},className:"mt-4 inline-flex h-11 w-full items-center justify-center gap-2 rounded-xl bg-cyan-400 text-sm font-semibold text-[#06081c] shadow-[0_8px_24px_-8px_rgba(34,211,238,0.5)] transition hover:bg-cyan-300 disabled:opacity-60","data-testid":"button-pay-single-report",children:"Pay with Stripe"}),n.jsx("button",{type:"button",onClick:()=>U(null),className:"mt-2 w-full rounded-xl px-4 py-2 text-sm text-slate-500 dark:text-slate-400 transition hover:text-slate-700 dark:hover:text-slate-200",children:"Cancel"})]})})]})}function R0(e){return e?new Date(e*1e3).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"—"}function lj(e,t,s){if(e==null)return"—";const r=t.toLowerCase()==="gbp"?"£":t.toUpperCase()+" ",o=(e/100).toLocaleString("en-GB",{minimumFractionDigits:e%100===0?0:2,maximumFractionDigits:2});return s?`${r}${o} / ${s}`:`${r}${o}`}function Wz({email:e,displayName:t,me:s,onClose:r}){const o=Yc(),c=vr({queryKey:["me","subscription"],queryFn:()=>bt("/me/subscription")}),d=c.data?.subscription??null,[h,p]=w.useState(!1),[f,m]=w.useState(t),[x,y]=w.useState(!1),[v,j]=w.useState(null),[k,S]=w.useState(!1),[N,C]=w.useState(e),[E,O]=w.useState(!1),[P,M]=w.useState(null),[B,A]=w.useState(null),[L,U]=w.useState(!1),[K,G]=w.useState(""),[W,ee]=w.useState(!1),[te,I]=w.useState(null),[V,H]=w.useState(null),[se,R]=w.useState(!1),[Q,oe]=w.useState(!1),[ne,le]=w.useState(null),[fe,he]=w.useState(!1),[Ne,J]=w.useState(!1),[ue,ye]=w.useState(null),Le=vr({queryKey:["stripe","plans"],queryFn:()=>bt("/stripe/plans"),enabled:s.tier==="single_report"||!d,staleTime:300*1e3});function ot(de){const Xe=Le.data?.plans.find(Dt=>Dt.tier===de)??Le.data?.plans.find(Dt=>Dt.name?.toLowerCase().includes(de));return Xe?Xe.prices.find(Dt=>Dt.interval==="month")??Xe.prices[0]??null:null}const[Je,jt]=w.useState(null),[Ia,Is]=w.useState(null);async function Wt(de){const Xe=ot(de);if(!Xe){Is("Plans are still loading — try again in a moment");return}Is(null),jt(de);try{const{url:is}=await bt("/stripe/checkout",{method:"POST",body:JSON.stringify({priceId:Xe.id})});window.location.href=is}catch(is){Is(is instanceof Error?is.message:"Could not start checkout"),jt(null)}}const[oa,la]=w.useState(""),[Ss,pe]=w.useState(""),[Qe,rs]=w.useState(!1),[Yt,We]=w.useState(!1),[gt,lt]=w.useState(null);async function Et(){rs(!0),lt(null);try{await bt("/me/support",{method:"POST",body:JSON.stringify({subject:oa.trim(),body:Ss.trim()})}),We(!0),la(""),pe(""),ct.refetch()}catch(de){lt(de instanceof Error?de.message:"Could not send your message")}finally{rs(!1)}}const ct=vr({queryKey:["me","support-messages"],queryFn:()=>bt("/me/support-messages")}),fs=ct.data?.messages??[],[$s,$a]=w.useState(null);async function Ns(de){const Xe=$s===de.id?null:de.id;if($a(Xe),Xe&&de.has_unread)try{await bt(`/me/support-messages/${de.id}/read`,{method:"POST"}),await Promise.all([ct.refetch(),o.invalidateQueries({queryKey:["me"]})])}catch{}}function dt(){if(!s.is_trial||!s.trial_ends_at)return null;const de=7,is=new Date(s.trial_ends_at).getTime()-Date.now(),Dt=Math.max(1,Math.ceil(is/864e5)),Ua=Math.min(de,de-Dt+1);return{dayN:Math.max(1,Ua),totalDays:de}}dt(),w.useEffect(()=>{const de=Xe=>{Xe.key==="Escape"&&r()};return window.addEventListener("keydown",de),()=>window.removeEventListener("keydown",de)},[r]);async function Qt(){y(!0),j(null);const{error:de}=await wt.auth.updateUser({data:{full_name:f.trim()}});if(y(!1),de){j(de.message);return}p(!1)}async function ut(){O(!0),A(null),M(null);const de=N.trim();if(!de||!de.includes("@")){A("Enter a valid email address"),O(!1);return}const{error:Xe}=await wt.auth.updateUser({email:de});if(O(!1),Xe){A(Xe.message);return}M("Check both inboxes — Supabase has sent confirmation links to the old and new addresses. The change takes effect once both are clicked."),S(!1)}async function ys(){if(ee(!0),H(null),I(null),K.length<8){H("Use at least 8 characters"),ee(!1);return}const{error:de}=await wt.auth.updateUser({password:K});if(ee(!1),de){H(de.message);return}I("Password updated."),G(""),U(!1)}async function Cs(){oe(!0),le(null);try{await bt("/me/subscription/cancel",{method:"POST"}),await o.invalidateQueries({queryKey:["me","subscription"]}),R(!1)}catch(de){le(de instanceof Error?de.message:"Cancel failed")}finally{oe(!1)}}async function ln(){he(!0),le(null);try{await bt("/me/subscription/resume",{method:"POST"}),await o.invalidateQueries({queryKey:["me","subscription"]})}catch(de){le(de instanceof Error?de.message:"Resume failed")}finally{he(!1)}}async function Es(){J(!0),ye(null);try{const{url:de}=await bt("/stripe/portal",{method:"POST"});window.location.href=de}catch(de){ye(de instanceof Error?de.message:"Could not open portal"),J(!1)}}const Ts=s.tier==="enterprise"?"Enterprise":s.tier==="pro"?"Pro":"Single Report";return n.jsxs("div",{className:"fixed inset-0 z-50 flex",role:"dialog","aria-modal":"true","aria-label":"Account settings",children:[n.jsx("button",{type:"button","aria-label":"Close account panel",onClick:r,className:"flex-1 bg-black/60 backdrop-blur-sm"}),n.jsxs("aside",{className:"flex h-full w-full max-w-md flex-col overflow-y-auto border-l border-slate-200 dark:border-white/10 bg-slate-50 dark:bg-[#06081c] text-slate-800 dark:text-slate-200 shadow-2xl","data-testid":"panel-account",children:[n.jsxs("header",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-slate-200 dark:border-white/10 bg-white/90 dark:bg-[#06081c]/90 px-5 py-4 backdrop-blur",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx(J7,{className:"h-4 w-4 text-cyan-700 dark:text-cyan-300"}),n.jsx("h2",{className:"text-base font-semibold text-slate-900 dark:text-white",children:"Account"})]}),n.jsx("button",{type:"button",onClick:r,className:"rounded-full p-1.5 text-slate-600 dar
321k:text-slate-400 hover:bg-slate-100 dark:hover:bg-white/5 hover:text-slate-900 dark:hover:text-white","aria-label":"Close","data-testid":"button-close-account",children:n.jsx(Ar,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"space-y-6 p-5",children:[n.jsxs("section",{children:[n.jsx("h3",{className:"mb-2 font-mono text-[11px] font-bold uppercase tracking-wider text-slate-600 dark:text-slate-400",children:"Profile"}),n.jsxs("div",{className:"space-y-3 rounded-lg border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.03] p-4",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{className:"text-xs text-slate-600 dark:text-slate-400",children:"Display name"}),!h&&n.jsxs("button",{type:"button",onClick:()=>{m(t),j(null),p(!0)},className:"inline-flex items-center gap-1 text-xs text-cyan-700 dark:text-cyan-300 hover:text-cyan-800 dark:hover:text-cyan-200","data-testid":"button-edit-name",children:[n.jsx(Hm,{className:"h-3 w-3"})," Edit"]})]}),h?n.jsxs("div",{className:"mt-1 space-y-2",children:[n.jsx("input",{type:"text",value:f,onChange:de=>m(de.target.value),className:"w-full rounded-md border border-slate-200 dark:border-white/10 bg-white dark:bg-[#070a20] px-2.5 py-1.5 text-sm text-slate-900 dark:text-white outline-none focus:border-cyan-500/50","data-testid":"input-name"}),v&&n.jsx("p",{className:"text-xs text-rose-700 dark:text-rose-300",children:v}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",disabled:x,onClick:Qt,className:"rounded-md bg-cyan-500 px-3 py-1 text-xs font-semibold text-white hover:bg-cyan-400 disabled:opacity-60","data-testid":"button-save-name",children:x?"Saving…":"Save"}),n.jsx("button",{type:"button",onClick:()=>p(!1),className:"rounded-md border border-slate-200 dark:border-white/10 px-3 py-1 text-xs text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5",children:"Cancel"})]})]}):n.jsx("p",{className:"mt-1 text-sm text-slate-900 dark:text-white",children:t||n.jsx("span",{className:"text-slate-500",children:"No name set"})})]}),n.jsxs("div",{className:"border-t border-slate-200 dark:border-white/5 pt-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{className:"text-xs text-slate-600 dark:text-slate-400",children:"Email"}),!k&&n.jsxs("button",{type:"button",onClick:()=>{C(e),A(null),M(null),S(!0)},className:"inline-flex items-center gap-1 text-xs text-cyan-700 dark:text-cyan-300 hover:text-cyan-800 dark:hover:text-cyan-200","data-testid":"button-edit-email",children:[n.jsx(Hm,{className:"h-3 w-3"})," Change"]})]}),k?n.jsxs("div",{className:"mt-1 space-y-2",children:[n.jsx("input",{type:"email",value:N,onChange:de=>C(de.target.value),className:"w-full rounded-md border border-slate-200 dark:border-white/10 bg-white dark:bg-[#070a20] px-2.5 py-1.5 text-sm text-slate-900 dark:text-white outline-none focus:border-cyan-500/50","data-testid":"input-email"}),n.jsx("p",{className:"text-[11px] text-slate-500",children:"You'll need to confirm via links sent to both the old and new addresses."}),B&&n.jsx("p",{className:"text-xs text-rose-700 dark:text-rose-300",children:B}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",disabled:E,onClick:ut,className:"rounded-md bg-cyan-500 px-3 py-1 text-xs font-semibold text-white hover:bg-cyan-400 disabled:opacity-60","data-testid":"button-save-email",children:E?"Sending…":"Send confirmation"}),n.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-md border border-slate-200 dark:border-white/10 px-3 py-1 text-xs text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5",children:"Cancel"})]})]}):n.jsxs("p",{className:"mt-1 inline-flex items-center gap-1.5 text-sm text-slate-900 dark:text-white",children:[n.jsx(kk,{className:"h-3.5 w-3.5 text-slate-500"}),e]}),P&&!k&&n.jsx("p",{className:"mt-2 rounded-md border border-cyan-400/20 bg-cyan-400/5 px-2 py-1.5 text-[11px] text-cyan-700 dark:text-cyan-200",children:P})]}),n.jsxs("div",{className:"border-t border-slate-200 dark:border-white/5 pt-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{className:"text-xs text-slate-600 dar
321k:text-slate-400",children:"Password"}),!L&&n.jsxs("button",{type:"button",onClick:()=>{G(""),H(null),I(null),U(!0)},className:"inline-flex items-center gap-1 text-xs text-cyan-700 dark:text-cyan-300 hover:text-cyan-800 dark:hover:text-cyan-200","data-testid":"button-edit-password",children:[n.jsx(Hm,{className:"h-3 w-3"})," Change"]})]}),L?n.jsxs("div",{className:"mt-1 space-y-2",children:[n.jsx("input",{type:"password",value:K,onChange:de=>G(de.target.value),placeholder:"New password (min 8 chars)",className:"w-full rounded-md border border-slate-200 dark:border-white/10 bg-white dark:bg-[#070a20] px-2.5 py-1.5 text-sm text-slate-900 dark:text-white outline-none focus:border-cyan-500/50","data-testid":"input-password"}),V&&n.jsx("p",{className:"text-xs text-rose-700 dark:text-rose-300",children:V}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",disabled:W,onClick:ys,className:"rounded-md bg-cyan-500 px-3 py-1 text-xs font-semibold text-white hover:bg-cyan-400 disabled:opacity-60","data-testid":"button-save-password",children:W?"Saving…":"Update password"}),n.jsx("button",{type:"button",onClick:()=>U(!1),className:"rounded-md border border-slate-200 dark:border-white/10 px-3 py-1 text-xs text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5",children:"Cancel"})]})]}):n.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"••••••••"}),te&&!L&&n.jsx("p",{className:"mt-2 text-[11px] text-emerald-700 dark:text-emerald-300",children:te})]})]})]}),n.jsxs("section",{"data-tour":"account-plan",children:[n.jsx("h3",{className:"mb-2 font-mono text-[11px] font-bold uppercase tracking-wider text-slate-600 dark:text-slate-400",children:"Plan & billing"}),n.jsxs("div",{className:"space-y-3 rounded-lg border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.03] p-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsx("div",{children:n.jsx("div",{className:"flex items-center gap-2",children:n.jsx("span",{className:"inline-flex items-center rounded-full border border-violet-300/30 bg-violet-300/10 px-2 py-0.5 font-mono text-[11px] font-semibold uppercase tracking-wider text-violet-700 dark:text-violet-200",children:Ts})})}),d?.price&&n.jsx("div",{className:"text-right text-sm font-semibold text-slate-900 dark:text-white",children:lj(d.price.unit_amount,d.price.currency,d.price.interval)})]}),c.isLoading&&n.jsx("p",{className:"text-xs text-slate-500",children:"Loading subscription…"}),c.isError&&n.jsxs("p",{className:"text-xs text-rose-700 dark:text-rose-300",children:["Couldn't load subscription: ",c.error.message]}),d&&n.jsxs("div",{className:"space-y-1 border-t border-slate-200 dark:border-white/5 pt-3 text-xs text-slate-600 dark:text-slate-400",children:[d.product_name&&n.jsxs("div",{children:[n.jsx("span",{className:"text-slate-500",children:"Product: "}),n.jsx("span",{className:"text-slate-800 dark:text-slate-200",children:d.product_name})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-slate-500",children:"Status: "}),n.jsx("span",{className:"text-slate-800 dark:text-slate-200",children:d.status})]}),d.cancel_at_period_end?n.jsxs("div",{className:"text-amber-700 dark:text-amber-300",children:["Cancels on ",R0(d.current_period_end),". You keep access until then."]}):d.current_period_end?n.jsxs("div",{children:[n.jsx("span",{className:"text-slate-500",children:"Renews: "}),n.jsx("span",{className:"text-slate-800 dark:text-slate-200",children:R0(d.current_period_end)})]}):null]}),!d&&!c.isLoading&&!c.isError&&s.tier==="single_report"&&n.jsx("p",{className:"text-xs text-slate-500",children:"You're on Single Report — pay £9.99 per property. Subscribe below for unlimited monthly searches."}),(s.tier==="single_report"||!d)&&n.jsxs("div",{className:"space-y-2 border-t border-slate-200 dark:border-white/5 pt-3",children:[n.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400",children:"Upgrade to unlimited searches"}),Le.isLoading&&n.jsx("p",{className:"text-xs text-slate-500",children:"Loading plans…"}),Le.isError&&n.jsxs("p",{className:"text-xs text-rose-700 dark:text-rose-300",children:["Couldn't load plans: ",Le.error.message]}),Le.data&&n.jsx("div",{className:"space-y-2",children:["pro","enterprise"].map(de=>{const Xe=ot(de);
321if(!Xe)return null;const is=de==="pro"?"Pro":"Enterprise",Dt=Je===de;return n.jsxs("button",{type:"button",disabled:Dt||Je!==null,onClick:()=>Wt(de),className:`flex w-full items-center justify-between gap-2 rounded-md border px-3 py-2 text-xs font-semibold transition disabled:opacity-60 ${de==="pro"?"border-cyan-400/30 bg-cyan-400/10 text-cyan-700 dark:text-cyan-100 hover:bg-cyan-400/20":"border-violet-400/30 bg-violet-400/10 text-violet-700 dark:text-violet-100 hover:bg-violet-400/20"}`,"data-testid":`button-subscribe-${de}`,children:[n.jsxs("span",{className:"inline-flex items-center gap-2",children:[n.jsx(Jw,{className:"h-3.5 w-3.5"}),Dt?"Opening checkout…":`Subscribe to ${is}`]}),n.jsx("span",{className:"font-mono text-[11px] text-slate-700 dark:text-white/90",children:lj(Xe.unit_amount,Xe.currency,Xe.interval)})]},de)})}),Ia&&n.jsx("p",{className:"text-xs text-rose-700 dark:text-rose-300",children:Ia})]}),n.jsxs("div",{className:"space-y-2 border-t border-slate-200 dark:border-white/5 pt-3",children:[d&&!d.cancel_at_period_end&&!se&&n.jsxs("button",{type:"button",onClick:()=>R(!0),className:"inline-flex items-center gap-1.5 rounded-md border border-rose-300/30 bg-rose-400/5 px-3 py-1.5 text-xs font-semibold text-rose-700 dark:text-rose-200 hover:bg-rose-400/10","data-testid":"button-cancel-subscription",children:[n.jsx(el,{className:"h-3.5 w-3.5"}),"Cancel subscription"]}),se&&n.jsxs("div",{className:"space-y-2 rounded-md border border-rose-300/30 bg-rose-400/5 p-3 text-xs",children:[n.jsx("p",{className:"font-semibold text-rose-700 dark:text-rose-100",children:"Cancel your subscription?"}),n.jsxs("p",{className:"text-rose-700 dark:text-rose-200/80",children:["You'll keep dashboard access until"," ",n.jsx("span",{className:"font-semibold text-rose-700 dark:text-rose-100",children:R0(d?.current_period_end)}),", then your account reverts to Single Report pay-as-you-go. You won't be billed again."]}),ne&&n.jsx("p",{className:"text-rose-700 dark:text-rose-300",children:ne}),n.jsxs("div",{className:"flex gap-2 pt-1",children:[n.jsx("button",{type:"button",disabled:Q,onClick:Cs,className:"rounded-md bg-rose-500 px-3 py-1 text-xs font-semibold text-white hover:bg-rose-400 disabled:opacity-60","data-testid":"button-confirm-cancel",children:Q?"Cancelling…":"Yes, cancel"}),n.jsx("button",{type:"button",disabled:Q,onClick:()=>{R(!1),le(null)},className:"rounded-md border border-slate-200 dark:border-white/10 px-3 py-1 text-xs text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5",children:"Keep subscription"})]})]}),d?.cancel_at_period_end&&n.jsxs("button",{type:"button",disabled:fe,onClick:ln,className:"inline-flex items-center gap-1.5 rounded-md border border-emerald-300/30 bg-emerald-400/5 px-3 py-1.5 text-xs font-semibold text-emerald-700 dark:text-emerald-200 hover:bg-emerald-400/10 disabled:opacity-60","data-testid":"button-resume-subscription",children:[n.jsx(sn,{className:"h-3.5 w-3.5"}),fe?"Resuming…":"Resume subscription"]}),d&&n.jsxs("button",{type:"button",disabled:Ne,onClick:Es,className:"inline-flex items-center gap-1.5 rounded-md border border-slate-200 dark:border-white/10 px-3 py-1.5 text-xs text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5 disabled:opacity-60","data-testid":"button-open-portal",children:[n.jsx(Jw,{className:"h-3.5 w-3.5"}),Ne?"Opening…":"Manage payment method (Stripe portal)"]}),ue&&n.jsx("p",{className:"text-xs text-rose-700 dark:text-rose-300",children:ue})]})]})]}),fs.length>0&&n.jsxs("section",{"data-tour":"account-conversations",children:[n.jsx("h3",{className:"mb-2 font-mono text-[11px] font-bold uppercase tracking-wider text-slate-600 dark:text-slate-400",children:"Your conversations"}),n.jsx("ul",{className:"space-y-2",children:fs.map(de=>{const Xe=$s===de.id,is=de.replies[de.replies.length-1]??null;return n.jsxs("li",{className:"rounded-lg border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.03]","data-testid":`user-thread-${de.id}`,children:[n.jsxs("button",{type:"button",onClick:()=>Ns(de),className:"flex w-full items-start gap-3 px-4 py-3 text-left","data-testid":`button-thread-toggle-${de.id}`,children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:de.subject}),de.has_unread&&n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-rose-500/20 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-rose-700 dark:text-rose-200","data-testid":`badge-thread-unread-${de.id}`,children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-400"}),"New reply"]}),n.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-wider ${de.status==="resolved"?"bg-emerald-400/15 text-emerald-700 dark:text-emerald-200":"bg-slate-100 dar
321k:bg-white/5 text-slate-700 dark:text-slate-300"}`,children:de.status})]}),n.jsx("p",{className:"mt-0.5 truncate text-[11px] text-slate-600 dark:text-slate-400",children:de.replies.length===0?"Awaiting a reply":`${de.replies.length} repl${de.replies.length===1?"y":"ies"}${is?` · last ${new Date(is.created_at).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"})}`:""}`})]}),n.jsx("span",{className:"mt-1 shrink-0 text-slate-600 dark:text-slate-400",children:n.jsx(Zc,{className:`h-4 w-4 transition-transform ${Xe?"rotate-180":""}`})})]}),Xe&&n.jsxs("div",{className:"space-y-3 border-t border-slate-200 dark:border-white/5 px-4 py-3",children:[n.jsxs("div",{children:[n.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:["You · ",new Date(de.created_at).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"})]}),n.jsx("p",{className:"mt-1 whitespace-pre-wrap text-sm text-slate-800 dark:text-slate-200",children:de.body})]}),de.replies.map(Dt=>n.jsxs("div",{className:"rounded-md border border-cyan-400/20 bg-cyan-400/[0.04] p-3",children:[n.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-wider text-cyan-700 dark:text-cyan-300",children:["Scapely Support · ",new Date(Dt.created_at).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"})]}),n.jsx("p",{className:"mt-1 whitespace-pre-wrap text-sm text-slate-900 dark:text-slate-100",children:Dt.body})]},Dt.id)),de.replies.length===0&&n.jsx("p",{className:"text-xs text-slate-500",children:"We haven't replied yet — you'll get an email and an in-app notification as soon as we do."})]})]},de.id)})})]}),n.jsxs("section",{"data-tour":"account-support",children:[n.jsx("h3",{className:"mb-2 font-mono text-[11px] font-bold uppercase tracking-wider text-slate-600 dark:text-slate-400",children:"Contact support"}),n.jsx("div",{className:"space-y-3 rounded-lg border border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.03] p-4",children:Yt?n.jsxs("div",{className:"space-y-2 text-xs",children:[n.jsxs("p",{className:"inline-flex items-center gap-2 font-semibold text-emerald-700 dark:text-emerald-200",children:[n.jsx(M8,{className:"h-3.5 w-3.5"}),"Message sent — we'll reply by email shortly."]}),n.jsx("button",{type:"button",onClick:()=>We(!1),className:"text-cyan-700 dark:text-cyan-300 hover:text-cyan-800 dark:hover:text-cyan-200","data-testid":"button-support-send-another",children:"Send another message"})]}):n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400",children:"Sends straight to the Scapely team — your account details come along so we know who to reply to."}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs text-slate-600 dark:text-slate-400",children:"Subject"}),n.jsx("input",{type:"text",value:oa,onChange:de=>la(de.target.value),placeholder:"What's the issue?",maxLength:200,className:"mt-1 w-full rounded-md border border-slate-200 dark:border-white/10 bg-white dark:bg-[#070a20] px-2.5 py-1.5 text-sm text-slate-900 dark:text-white outline-none focus:border-cyan-500/50","data-testid":"input-support-subject"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs text-slate-600 dark:text-slate-400",children:"Message"}),n.jsx("textarea",{value:Ss,onChange:de=>pe(de.target.value),rows:4,maxLength:5e3,placeholder:"Tell us what's going on…",className:"mt-1 w-full rounded-md border border-slate-200 dark:border-white/10 bg-white dark:bg-[#070a20] px-2.5 py-1.5 text-sm text-slate-900 dark:text-white outline-none focus:border-cyan-500/50","data-testid":"input-support-body"})]}),gt&&n.jsx("p",{className:"text-xs text-rose-700 dark:text-rose-300",children:gt}),n.jsxs("button",{type:"button",disabled:Qe||oa.trim().length<3||Ss.trim().length<10,onClick:Et,className:"inline-flex items-center gap-1.5 rounded-md bg-cyan-500 px-3 py-1.5 text-xs font-semibold text-white hover:bg-cyan-400 disabled:opacity-60","data-testid":"button-support-send",children:[n.jsx(Sk,{className:"h-3.5 w-3.5"}),Qe?"Sending…":"Send message"]})]})})]})]})]})]})}function Yz({postcode:e,address:t}){const s=Yc(),[r,o]=w.useState(null),c=w.useMemo(()=>["title-register-lookup",e,t],[e,t]),d=vr({queryKey:c,queryFn:()=>bt(`/title-register/lookup?postcode=${encodeURIComponent(e)}&address=${encodeURIComponent(t)}`),refetchOnWindowFocus:!0,staleTime:3e4,enabled:!!(e&&t)}),h=vc({mutationFn:()=>bt("/title-register/order",{method:"POST",body:JSON.stringify({postcode:e,address:t})}),onSuccess:({url:x})=>{o(null),window.open(x,"_blank","noopener,noreferrer"),s.setQueryData(c,y=>({verified_tenure:y?.verified_tenure??null,in_flight_order:y?.in_flight_order??{id:"optimistic",status:"pending",created_at:new Date().toISOString()}}))},onError:x=>{o(x.message||"Couldn't start checkout — try again shortly.")}}),p=d.data?.verified_tenure??null,f=d.data?.in_flight_order??null,m=h.isPending;if(p){const x=p.tenure_type==="leasehold"?"Leasehold":"Freehold",y=p.tenure_type==="leasehold"&&p.lease_years_remaining?`${p.lease_years_remaining} yrs remaining on lease`:p.tenure_type==="freehold"?"Owned outright — no ground rent or lease extension cost":"Term unspecified on the Title Register",v=(()=>{try{return new Date(p.fulfilled_at).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}catch{return null}})();return n.jsx(nt,{accent:"cyan",title:"Tenure",testId:"tenure-verified",value:x,tone:"good",delay:.1,badge:n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-emerald-300/40 bg-emerald-300/10 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider text-emerald-700 dark:text-emerald-200",children:[n.jsx(Tr,{className:"h-2.5 w-2.5"})," Verified"]}),note:n.jsxs(n.Fragment,{children:[y,v?` · Verified ${v}`:null]}),explainer:"Whether you own the property outright (freehold) or hold a lease (leasehold), plus any restrictions or charges on the title."})}return f?n.jsx(nt,{accent:"cyan",title:"Tenure",testId:"tenure-pending",value:"Ordered",tone:"warn",delay:.1,badge:n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-300/40 bg-amber-300/10 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider text-amber-700 dark:text-amber-200",children:[n.jsx(xx,{className:"h-2.5 w-2.5"})," Pending"]}),note:"Order received — usually verified within 24 hours.",explainer:"Whether you own the property outright (freehold) or hold a lease (leasehold), plus any restrictions or charges on the title.",children:n.jsxs("button",{type:"button",onClick:()=>s.invalidateQueries({queryKey:c}),className:"mt-2 inline-flex items-center gap-1 font-mono text-[11px] uppercase tracking-wider text-cyan-700 dark:text-cyan-200 hover:text-cyan-800 dark:hover:text-cyan-100","data-testid":"button-tenure-refresh",children:[n.jsx(sn,{className:"h-3 w-3"})," Refresh"]})}):d.isLoading?n.jsx(nt,{accent:"cyan",title:"Tenure",testId:"tenure-loading",value:"Checking…",tone
321:"muted",delay:.1,explainer:"Whether you own the property outright (freehold) or hold a lease (leasehold), plus any restrictions or charges on the title."}):n.jsxs(nt,{accent:"cyan",title:"Tenure",testId:"tenure-cta",value:"Unverified",tone:"muted",delay:.1,note:"Pull the official HM Land Registry Title Register — confirms freehold/leasehold, lease term and registered owner.",explainer:"Whether you own the property outright (freehold) or hold a lease (leasehold), plus any restrictions or charges on the title.",children:[n.jsx("button",{type:"button",onClick:()=>h.mutate(),disabled:m,className:"mt-3 inline-flex items-center gap-1.5 rounded-[12px] border border-cyan-300/40 bg-cyan-300/10 px-3 py-1.5 font-mono text-[12px] uppercase tracking-wider text-cyan-700 dark:text-cyan-100 transition hover:border-cyan-300/60 hover:bg-cyan-300/[0.18] hover:text-slate-900 dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-60","data-testid":"button-verify-tenure",children:m?n.jsxs(n.Fragment,{children:[n.jsx(Me,{className:"h-3 w-3 animate-spin"})," Opening checkout…"]}):n.jsxs(n.Fragment,{children:[n.jsx(Jo,{className:"h-3 w-3"})," Verify tenure (£5)"]})}),r&&n.jsx("p",{className:"mt-1.5 text-[11px] text-rose-700 dark:text-rose-300","data-testid":"text-tenure-error",children:r}),n.jsx("p",{className:"mt-1.5 text-[11px] text-slate-500",children:"One-off £5 payment — sits outside Free / Pro / Enterprise plans."})]})}function O0(e){if(!e)return null;try{return new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}catch{return null}}const cj="scapely.chromeExtBannerDismissed.v1";function Qz(){const[e,t]=w.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(cj)==="1");if(e)return null;const s=()=>{try{window.localStorage.setItem(cj,"1")}catch{}t(!0)};return n.jsxs("div",{"data-testid":"banner-chrome-extension",className:"relative hidden border-b border-cyan-300/15 bg-gradient-to-r from-cyan-500/10 via-cyan-400/5 to-transparent px-5 py-2.5 md:block",children:[n.jsxs("div",{className:"flex items-center justify-center gap-3 px-12 text-center text-[13px] text-slate-800 dark:text-slate-200",children:[n.jsx("span",{"aria-hidden":"true",className:"flex h-7 w-7 flex-none items-center justify-center rounded-full bg-slate-100 dark:bg-white/[0.04] ring-1 ring-slate-200 dark:ring-white/10",children:n.jsx(na,{className:"h-3.5 w-3.5 text-cyan-700 dark:text-cyan-300"})}),n.jsxs("span",{children:[n.jsx("a",{href:"https://chromewebstore.google.com/detail/scapely-%E2%80%94-property-develo/fnocmjiaocimmogcjeamceokldmagfgo",target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-slate-900 dark:text-white underline decoration-cyan-700 dark:decoration-cyan-300/70 underline-offset-4 transition hover:decoration-cyan-700 dark:hover:decoration-cyan-200","data-testid":"link-install-chrome-extension",children:"Install the Chrome extension"})," ",n.jsx("span",{className:"text-slate-600 dark:text-slate-400",children:"to appraise properties instantly on Rightmove, Zoopla, OnTheMarket, PrimeLocation, Savills and Knight Frank."})]})]}),n.jsx("button",{type:"button",onClick:s,"aria-label":"Dismiss","data-testid":"button-dismiss-chrome-banner",className:"absolute right-3 top-1/2 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full text-slate-500 transition hover:bg-slate-100 dark:hover:bg-white/5 hover:text-slate-900 dark:hover:text-white",children:n.jsx(Ar,{className:"h-4 w-4"})})]})}function Zz({me:e}){if(!e||e.tier!=="pro"||e.is_trial)return null;const t=e.monthly_scan_count??0,s=50;if(t<40)return null;const r=Math.max(0,s-t),c=r<=5?"border-rose-300/40 bg-rose-300/10 text-rose-700 dark:text-rose-100":"border-amber-300/40 bg-amber-300/10 text-amber-700 dark:text-amber-200";return n.jsxs(Be,{href:"/pricing","data-testid":"badge-scan-usage",className:`ml-2 inline-flex items-center gap-1.5 rounded-full border px-3 py-1 font-mono text-[11px] uppercase tracking-wider transition hover:bg-slate-200 dark:hover:bg-white/10 ${c}`,children:[n.jsx(kn,{className:"h-3 w-3"}),r===0?"No scans left":`${r} scan${r===1?"":"s"} left`,n.jsx("span",{className:"hidden font-semibold sm:inline",children:"· Go Enterprise"})]})}function Xz(){return n.jsxs("section",{className:"space-y-4","data-testid":"owner-intel-locked",children:[n.jsxs("h2",{className:"flex items-center gap-2 font-mono text-[13px] uppercase tracking-wider text-amber-700 dark:text-amber-300",children:[n.jsx(Zo,{className:"h-3.5 w-3.5"})," Registered businesses",n.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 rounded-full border border-slate-900/20 dark:border-white/20 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider text-slate-900 dark:text-white",children:[n.jsx(Aa,{className:"h-2.5 w-2.5"})," Pro & Enterprise"]})]}),n.jsxs("div",{className:"space-y-3 rounded-[12px] border border-slate-200 dark:border-white/10 bg-slate-100 dar
321k:bg-white/[0.03] p-5 backdrop-blur",children:[n.jsx("p",{className:"text-[14px] text-slate-700 dark:text-slate-300",children:"See who actually owns this property: the limited company registered at this address, its directors, persons with significant control, and any outstanding lender charges — pulled live from Companies House. Available on Pro & Enterprise."}),n.jsxs("ul",{className:"space-y-1 text-[13px] text-slate-600 dark:text-slate-400",children:[n.jsx("li",{children:"• Vendor entity, status and incorporation date"}),n.jsx("li",{children:"• Up to 5 active directors with appointment dates"}),n.jsx("li",{children:"• Beneficial owners (PSC register)"}),n.jsx("li",{children:"• Outstanding mortgages / charges against the company"})]}),n.jsxs(Be,{href:"/pricing",className:"inline-flex items-center gap-1.5 rounded-[12px] border border-cyan-300/40 bg-cyan-300/10 px-3 py-1.5 font-mono text-[12px] uppercase tracking-wider text-cyan-700 dark:text-cyan-100 transition hover:border-cyan-300/60 hover:bg-cyan-300/[0.18] hover:text-slate-900 dark:hover:text-white","data-testid":"link-owner-intel-upgrade",children:[n.jsx(na,{className:"h-3 w-3"})," Upgrade to Pro"]})]})]})}function hh(e,t,s){const r=x=>x.toLowerCase().replace(/[^a-z0-9]+/g," ").trim(),o=x=>x.toLowerCase().replace(/[^a-z0-9]+/g,""),c=r(e??"");if(!c)return!1;const d=o(s);if(d&&!o(e??"").includes(d))return!1;const h=c.split(" "),p=r(t).split(" ").filter(Boolean),f=p.filter(x=>/^\d/.test(x));if(!f.every(x=>h.includes(x)))return!1;const m=p.filter(x=>x.length>=3&&!/^\d/.test(x));return f.length===0&&m.length===0?!1:m.every(x=>c.includes(x))}function dj({children:e}){return n.jsx("div",{className:"mb-3 font-mono text-[11px] font-semibold uppercase tracking-wider text-slate-700 dark:text-slate-300",children:e})}function uj({company:e}){const t=e.company_status.toLowerCase()==="active";return n.jsxs("a",{href:e.ch_url,target:"_blank",rel:"noopener noreferrer",className:"group block rounded-[10px] border border-slate-200 dark:border-white/10 bg-white dark:bg-white/[0.04] p-2.5 transition-colors hover:border-violet-300 dark:hover:border-violet-300/30","data-testid":"owner-intel-nearby-row",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium leading-snug text-slate-900 dark:text-white group-hover:text-violet-700 dark:group-hover:text-violet-200",children:e.company_name}),n.jsx(In,{className:"mt-0.5 h-3 w-3 shrink-0 text-slate-400 group-hover:text-violet-600 dark:group-hover:text-violet-300"})]}),n.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-slate-400",children:[n.jsx("span",{className:t?"rounded border border-emerald-300/40 bg-emerald-300/10 px-1 py-0.5 text-emerald-700 dark:text-emerald-200":"rounded border border-amber-300/40 bg-amber-300/10 px-1 py-0.5 text-amber-700 dark:text-amber-200",children:e.company_status}),n.jsxs("span",{children:["· ",e.company_number]})]}),e.registered_address_one_line&&n.jsx("p",{className:"mt-1 text-[11px] leading-snug text-slate-400",children:e.registered_address_one_line})]})}function hj({primary:e,address:t,postcode:s}){const r=hh(e.registered_address_one_line,t,s);return n.jsxs("div",{className:"space-y-4","data-testid":"owner-intel-primary",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[n.jsx("h3",{className:"text-[15px] font-semibold text-slate-900 dark:text-white",children:e.company_name}),n.jsxs("a",{href:e.ch_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] uppercase tracking-wider text-violet-700 dark:text-violet-200 hover:text-violet-700 dark:hover:text-violet-100","data-testid":"link-companies-house",children:["Companies House ",n.jsx(In,{className:"h-3 w-3"})]})]}),n.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 font-mono text-[11px] uppercase tracking-wider text-slate-600 dark:text-slate-400",children:[n.jsx("span",{className:e.company_
321status.toLowerCase()==="active"?"rounded border border-emerald-300/40 bg-emerald-300/10 px-1.5 py-0.5 text-emerald-700 dark:text-emerald-200":"rounded border border-amber-300/40 bg-amber-300/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-200",children:e.company_status}),n.jsxs("span",{children:["· ",e.company_number]}),e.date_of_creation&&n.jsxs("span",{children:["· Inc. ",O0(e.date_of_creation)]}),e.has_insolvency_history&&n.jsx("span",{className:"rounded border border-rose-300/40 bg-rose-300/10 px-1.5 py-0.5 text-rose-700 dark:text-rose-200",children:"Insolvency history"})]}),e.registered_address_one_line&&n.jsxs("div",{className:"mt-2","data-testid":"owner-intel-registered-office",children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-400",children:"Registered office"}),n.jsx("p",{className:"mt-0.5 text-[13px] leading-snug text-slate-800 dark:text-slate-200",children:e.registered_address_one_line}),n.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-slate-400",children:r?"Matches the property you searched.":"Note: the company's registered office may differ from the property address you searched — directors often use an accountant's or solicitor's address."})]}),e.sic_codes.length>0&&n.jsxs("p",{className:"mt-2 text-[12px] text-slate-400",children:["SIC: ",e.sic_codes.join(", ")]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"inline-flex items-center gap-1.5 font-mono text-[12px] uppercase tracking-wider text-slate-400",children:[n.jsx(bi,{className:"h-3 w-3 text-violet-700 dark:text-violet-300/70"})," Active directors (",e.active_officer_count,")"]}),e.officers.length===0?n.jsx("p",{className:"mt-1 text-[13px] text-slate-600 dark:text-slate-400",children:"No active officers on file."}):n.jsx("ul",{className:"mt-1 space-y-1 text-[13px] text-slate-800 dark:text-slate-200",children:e.officers.map(o=>n.jsxs("li",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[n.jsx("span",{className:"font-medium",children:o.name}),n.jsxs("span",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-400",children:[o.role,o.appointed_on?` · since ${O0(o.appointed_on)}`:""]})]},`${o.name}-${o.appointed_on??""}`))})]}),e.psc.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"inline-flex items-center gap-1.5 font-mono text-[12px] uppercase tracking-wider text-slate-400",children:[n.jsx(mh,{className:"h-3 w-3 text-violet-700 dark:text-violet-300/70"})," Beneficial owners (",e.active_psc_count,")"]}),n.jsx("ul",{className:"mt-1 space-y-1 text-[13px] text-slate-800 dark:text-slate-200",children:e.psc.map(o=>n.jsxs("li",{children:[n.jsx("span",{className:"font-medium",children:o.name}),o.natures_of_control.length>0&&n.jsxs("span",{className:"ml-1 text-[12px] text-slate-600 dark:text-slate-400",children:["— ",o.natures_of_control.slice(0,2).join(", ")]})]},`${o.name}-${o.notified_on??""}`))})]}),e.charges.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"inline-flex items-center gap-1.5 font-mono text-[12px] uppercase tracking-wider text-slate-400",children:[n.jsx(Zh,{className:"h-3 w-3 text-violet-700 dark:text-violet-300/70"})," Outstanding charges (",e.outstanding_charge_count,")"]}),n.jsx("ul",{className:"mt-1 space-y-1 text-[13px] text-slate-800 dark:text-slate-200",children:e.charges.map((o,c)=>n.jsxs("li",{children:[n.jsx("span",{className:"font-medium",children:o.classification??"Charge"}),o.persons_entitled.length>0&&n.jsxs("span",{className:"text-slate-600 dark:text-slate-400",children:[" ","— held by ",o.persons_entitled.slice(0,2).join(", ")]}),o.delivered_on&&n.jsx("span",{className:"ml-1 font-mono text-[11px] uppercase tracking-wider text-slate-400",children:O0(o.delivered_on)})]},o.code??`charge-${c}`))})]})]})}function Jz({postcode:e,address:t,unlocked:s}){const r=vr({queryKey:["owner-intel",e,t],queryFn:()=>bt(`/owner-intel?postcode=${encodeURIComponent(e)}&address=${encodeURIComponent(t)}`),enabled:s&&!!(e&&t),staleTime:3e5,refetchOnWindowFocus:!1,retry:1});if(!s)return n.jsx(Xz,{});const o=r.data,c=o?.primary??null,d=o?.nearby??[],h=o?.other_companies_count??0,p=o?.source??"Companies House Public Data API",f=c?hh(c.registered_address_one_line,t,e):!1,m=d.filter(k=>hh(k.registered_address_one_line,t,e)),x=d.filter(k=>!hh(k.registered_address_one_line,t,e)),y=Math.max(0,h-d.length),v=f||m.length>0,j=!f||x.length>0||y>0;return n.jsxs(rF,{title:"Registered businesses",accent:"violet",muted:!0,children:[r.isLoading&&n.jsxs("p",{className:"text-[13px] text-slate-600 dar
321k:text-slate-400","data-testid":"owner-intel-loading",children:[n.jsx(Me,{className:"mr-1.5 inline h-3 w-3 animate-spin"}),"Looking up Companies House…"]}),r.isError&&n.jsx("p",{className:"text-[13px] text-amber-700 dark:text-amber-300","data-testid":"owner-intel-error",children:"Couldn’t reach Companies House — try again shortly."}),!r.isLoading&&!r.isError&&!c&&d.length===0&&h===0&&n.jsx("p",{className:"text-[13px] text-slate-700 dark:text-slate-300","data-testid":"owner-intel-empty",children:"No company is registered at this address. The property is most likely owned by an individual rather than a limited company."}),!r.isLoading&&!r.isError&&!c&&(d.length>0||h>0)&&n.jsx("p",{className:"mb-4 text-[13px] leading-relaxed text-slate-700 dark:text-slate-300","data-testid":"owner-intel-partial",children:"We couldn’t load full details for the registered owner, but these companies share this postcode."}),(c||d.length>0||h>0)&&n.jsxs("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2 lg:gap-6","data-testid":"owner-intel-columns",children:[n.jsxs("div",{children:[n.jsx(dj,{children:"At this address"}),v?n.jsxs("div",{className:"space-y-3",children:[c&&f&&n.jsx(hj,{primary:c,address:t,postcode:e}),m.map(k=>n.jsx(uj,{company:k},k.company_number))]}):n.jsx("p",{className:"text-[13px] leading-relaxed text-slate-600 dark:text-slate-400","data-testid":"owner-intel-none-at-address",children:"No company’s registered office matches the exact address you searched — the property is most likely owned by an individual, or its owning company is registered elsewhere."})]}),n.jsxs("div",{className:"lg:border-l lg:border-slate-200 lg:pl-6 lg:dark:border-white/10",children:[n.jsx(dj,{children:"Registered nearby (same postcode)"}),j?n.jsxs("div",{className:"space-y-3",children:[c&&!f&&n.jsx(hj,{primary:c,address:t,postcode:e}),x.map(k=>n.jsx(uj,{company:k},k.company_number)),y>0&&n.jsxs("a",{href:`https://find-and-update.company-information.service.gov.uk/search?q=${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",className:"block text-[12px] text-violet-700 dark:text-violet-200 hover:text-violet-700 dark:hover:text-violet-100 hover:underline","data-testid":"link-other-companies",children:["+ ",y," more"," ",y===1?"company":"companies"," in this postcode →"]})]}):n.jsx("p",{className:"rounded-[10px] border border-slate-200 dark:border-white/10 bg-white dark:bg-white/[0.04] p-3 text-[13px] leading-relaxed text-slate-600 dark:text-slate-400","data-testid":"owner-intel-none-nearby",children:"No other companies share this postcode."})]})]}),n.jsxs("p",{className:"border-t border-slate-200 dark:border-white/5 pt-2 font-mono text-[10px] uppercase tracking-wider text-slate-600",children:["Source: ",p]})]})}const eF=new Set;typeof window<"u"&&(window.gm_authFailure=()=>{for(const e of eF)e()});function tF({item:e,tier:t,ownerIntelUnlocked:s,scrollRootRef:r,onSectionInView:o,reanalyzing:c,reanalyzeError:d,onReanalyze:h,onBack:p,bodyOverride:f}){const{theme:m}=rl(),x=m==="dark",y=W=>W==="commercial"?!0:!(W==="epc-uplift"&&t!=="pro"&&t!=="enterprise"&&t!=="single_report");w.useEffect(()=>{if(f)return;const W=r.current;if(!W)return;const ee=["overview","sales","fundamentals","epc-uplift","developer","site","commercial"],te=ee.map(H=>document.getElementById(`property-section-${H}`)).filter(H=>H!==null);if(te.length===0)return;const I=new Set,V=new IntersectionObserver(H=>{for(const R of H){const Q=R.target.getAttribute("data-section-id");Q&&(R.isIntersecting?I.add(Q):I.delete(Q))}const se=ee.find(R=>I.has(R));se&&o(se)},{root:W,rootMargin:"0px 0px -80% 0px",threshold:0});return te.forEach(H=>V.observe(H)),()=>V.disconnect()},[f,e.id,t,o,r]);const v=e.last_appraisal??null;v?.appraisal?.financial_appraisal;const j=v?.appraisal?.planning_risk_assessment??null,k=c;Wc(j?.overall_risk_level)??Wc(e.last_risk_level);const S=v?.property?.epc?.current??null,N=v?.property?.epc?.potential??null,C=v?.pro_data?.epc_uplift??null;(v?.property?.planning_gateway?.conservation_areas??[]).filter(Boolean),(v?.property?.planning_gateway?.active_article_4_directions??[]).map(W=>typeof W=="string"?W:W.name??"").filter(W=>!!W),(v?.property?.planning_gateway?.listed_buildings??[]).map(W=>typeof W=="string"?W:W.name??"").filter(W=>!!W);const E=v?.property?.free_metrics??null,O=E?.flood_risk_zone??null,P=v?.pro_data??null,M=P?.ptal_score??null;P?.ptal_label;const B=P?.hmo_saturation_pct??null;P?.hmo_saturation_label;
321const A=P?.boundary_warnings??[],L=v?.enterprise_data??null;P!==null&&(M!==null||B!==null||A.length>0);const U=v?.property?.neighbourhood??null,K=U!==null;return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-full",children:n.jsx(xy,{accent:"cyan",className:"min-h-[200px] w-full sm:min-h-[260px]",searching:c,children:n.jsx("div",{className:"relative mx-auto flex min-h-[200px] w-full max-w-5xl flex-col px-4 py-5 sm:min-h-[260px] sm:px-8 sm:py-6 lg:max-w-6xl xl:max-w-[1400px] 2xl:max-w-[1600px]",children:n.jsxs("div",{className:"flex items-start justify-end gap-2",children:[n.jsx(KS,{dimensions:lI({epcBand:v?.property?.epc?.current,sapScore:v?.property?.epc?.current_sap_score,ptalScore:M,hmoSaturationPct:typeof B=="number"?B:null,floodZone:typeof O=="number"?O:null})}),n.jsxs("button",{type:"button",onClick:h,disabled:c,className:"inline-flex items-center gap-1.5 rounded-full border border-cyan-300/30 bg-cyan-300/[0.08] px-3 py-1.5 font-mono text-[12px] text-cyan-700 dark:text-cyan-100 backdrop-blur transition hover:border-cyan-300/60 hover:bg-cyan-300/[0.14] hover:text-slate-900 dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-60 md:hidden","data-testid":"button-reanalyze-mobile","aria-label":"Re-analyse property",title:"Re-run the development appraisal for this property",children:[c?n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(sn,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:c?"Analysing…":"Re-analyse"})]})]})})})}),n.jsx("div",{className:"sticky top-0 z-20 w-full",style:{backgroundColor:x?"#06081c":"rgba(248,250,252,0.9)",backdropFilter:x?"none":"blur(12px)"},children:n.jsxs("div",{className:"mx-auto w-full max-w-5xl px-4 py-3 sm:px-8 lg:max-w-6xl xl:max-w-[1400px] 2xl:max-w-[1600px]",children:[n.jsx("h1",{className:"text-[14px] font-semibold tracking-tight text-slate-900 dark:text-white sm:text-[17px]","data-testid":"text-property-address",children:e.address_line}),n.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-0.5 font-mono text-[12px] text-slate-900 dark:text-white",children:e.postcode}),e.local_authority&&n.jsx("span",{className:"rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-0.5 font-mono text-[12px] text-slate-900 dark:text-white","data-testid":"text-property-borough",children:e.local_authority}),(()=>{const W=v?.property?.epc;if(!W)return null;const ee=[W.built_form,W.property_type].filter(te=>typeof te=="string"&&te.trim().length>0).map(te=>te.toLowerCase().replace(/(^|[\s-])\w/g,I=>I.toUpperCase())).join(" ");return n.jsxs(n.Fragment,{children:[ee&&n.jsx("span",{className:"rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-0.5 font-mono text-[12px] text-slate-900 dark:text-white","data-testid":"text-property-type",title:"EPC property type",children:ee}),W.habitable_rooms&&W.habitable_rooms>0&&n.jsxs("span",{className:"rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-0.5 font-mono text-[12px] text-slate-900 dark:text-white","data-testid":"text-property-rooms",title:"EPC habitable rooms (proxy for bed/reception count)",children:[W.habitable_rooms," room",W.habitable_rooms===1?"":"s"]}),W.floor_area_sqm&&W.floor_area_sqm>0&&n.jsxs("span",{className:"rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-0.5 font-mono text-[12px] text-slate-900 dark:text-white","data-testid":"text-property-floor-area",title:"EPC floor area",children:[W.floor_area_sqm," sqm"]}),W.construction_age_band&&n.jsx("span",{className:"rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-0.5 font-mono text-[12px] text-slate-900 dark:text-white",title:"Construction age band (SAP/RdSAP)",children:Iz[W.construction_age_band]??`Band ${W.construction_age_band}`})]})})()]})]})}),n.jsx("div",{className:"mx-auto w-full max-w-5xl divide-y divide-slate-300 dark:divide-white/[0.16] px-4 py-4 sm:px-8 lg:max-w-6xl xl:max-w-[1400px] 2xl:max-w-[1600px]",children:f||n.jsxs(n.Fragment,{children:[y("overview")&&n.jsx(ii,{id:"overview",number:1,title:"Quick stats",description:"Key indicators at a glance — EPC rating, transport access, HMO density and flood risk.",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4","data-tour-property":"overview",children:[n.jsx(yr,{accent:"amber",icon:n.jsx(kn,{className:"h-3 w-3"}),title:"EPC Rating",illustration:n.jsx(IS,{}
321),value:n.jsx(Se.span,{animate:{opacity:[.7,1,.7]},transition:{duration:2.4,repeat:1/0,ease:"easeInOut"},className:"text-slate-900 dark:text-white","data-testid":"text-epc-current",children:S??"—"}),blurb:pj(S),shortBlurb:Fu(pj(S))}),n.jsx(yr,{accent:"white",icon:n.jsx(kx,{className:"h-3 w-3"}),title:"PTAL Score",illustration:n.jsx($S,{}),value:M!=null?String(M):"—",delay:.05,blurb:fj(M),shortBlurb:Fu(fj(M))}),n.jsx(yr,{accent:"violet",icon:n.jsx(bi,{className:"h-3 w-3"}),title:"HMO Density",illustration:n.jsx(US,{}),value:B!=null?n.jsxs(n.Fragment,{children:[B,n.jsx("span",{className:"text-[14px] text-slate-500 dark:text-slate-300",children:"%"})]}):"—",delay:.1,blurb:P?.hmo_directive_name?`${P0(B)} Active directive: ${P.hmo_directive_name}.`:P0(B),shortBlurb:Fu(P0(B))}),n.jsx(yr,{accent:"sky",icon:n.jsx(yx,{className:"h-3 w-3"}),title:"Flood Risk",illustration:n.jsx(HS,{}),value:O!=null?String(O):"—",delay:.15,blurb:mj(O),shortBlurb:Fu(mj(O))})]})}),y("sales")&&e.last_appraisal?.property?.sale_history&&n.jsx(ii,{id:"sales",number:2,title:"Sale history",description:"Registered transactions from HM Land Registry and nearby comparables to benchmark the asking price.",children:n.jsx(FS,{records:e.last_appraisal.property.sale_history.records,matched_subject:e.last_appraisal.property.sale_history.matched_subject,attribution:e.last_appraisal.property.sale_history.attribution,comparable_records:e.last_appraisal.property.sale_history.comparable_records??[]})}),y("fundamentals")&&!0&&n.jsx(ii,{id:"fundamentals",number:3,title:"Property fundamentals",description:"Heritage designations, tenure type, and neighbourhood deprivation — factors that shape planning consent and buyer appetite.",children:n.jsxs(gj,{children:[K&&n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[n.jsx(nt,{accent:"cyan",title:"Deprivation",value:U.imd_decile!==null?`Decile ${U.imd_decile}`:"—",tone:"default",note:U.imd_decile!==null?aF(U.imd_decile):void 0,explainer:"England's Index of Multiple Deprivation ranks every LSOA from 1 (most deprived) to 32,844. Decile 1 is the most deprived 10% of neighbourhoods; Decile 10 the least.",children:n.jsx(WS,{decile:U.imd_decile})}),n.jsxs(Se.div,{initial:{opacity:0,y:8},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{delay:.05,duration:.4},className:`${ws} p-4 sm:col-span-2`,children:[n.jsx(js,{}),n.jsxs("div",{className:"relative flex h-full flex-col",children:[n.jsx("div",{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 font-mono text-[10px] font-bold uppercase tracking-wider ${gi.cyan.titleSoft}`,children:"Area Information"}),n.jsx("p",{className:"mt-3 text-[13px] leading-relaxed text-slate-700 dark:text-slate-300",children:nF(U)}),n.jsxs("div",{className:"mt-auto flex flex-wrap gap-2 pt-3",children:[U.rural_urban&&n.jsx("span",{className:"rounded-full border border-slate-900/20 dark:border-white/20 px-2.5 py-0.5 font-mono text-[10px] text-slate-900 dark:text-white",children:U.rural_urban}),U.lsoa_name&&n.jsx("span",{className:"rounded-full border border-slate-900/20 dark:border-white/20 px-2.5 py-0.5 font-mono text-[10px] text-slate-900 dark:text-white",children:U.lsoa_name}),U.imd_rank!==null&&n.jsxs("span",{className:"rounded-full border border-slate-900/20 dark:border-white/20 px-2.5 py-0.5 font-mono text-[10px] text-slate-900 dark:text-white",children:["IMD rank ",U.imd_rank.toLocaleString()," of 32,844"]})]})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[n.jsx(nt,{accent:"cyan",title:"Heritage status",value:E?.is_listed?"Listed":E?.heritage_status??"Not designated",note:E?.is_listed?"Listed building — alterations need listed building consent.":void 0,explainer:"Whether the property is listed or in a conservation area — designations that restrict alterations and can require extra planning consent."}),n.jsx(nt,{accent:"cyan",title:"Boundary issues",value:A.length===0?"None detected":`${A.length} flagged`,tone:A.length===0?"good":"warn",note:A.length===0?"No registered boundary anomalies.":void 0,delay:.05,explainer:"Mismatches between the registered title boundary and the building's actual footprint, which can signal disputes or encroachments.",children:A.length>0&&n.jsx("ul",{className:"mt-1 space-y-0.5 text-[12px] text-slate-700 dark:text-slate-300",children:A.map(W=>n.jsxs("li",{children:["• ",W]},W))})}),n.jsx(Yz,{postcode:e.postcode,address:e.address_line})]})]})}),y("epc-uplift")&&n.jsx(ii,{id:"epc-uplift",number:4,title:"Energy performance",description:"Current EPC rating and the estimated cost and uplift potential of upgrading before selling or letting.",children:n.jsx(Hz,{currentRating:S,potentialRating:N??C?.potential_rating??null,uplift:C,certificateDate:e.last_appraisal?.property?.epc?.certificate_date??null,epcDetail:e.last_appraisal?.property?.epc??null})}),y("developer")&&n.jsx(ii,{id:"developer",number:5,title:"Development potential",description:"AI-powered planning risk, build-cost estimate, and a first-pass screen of permitted development rights.",children:n.jsx(gj,{children:v===null||!v.appraisal?n.jsxs("div",{className:"rounded-[12px] border border-slate-200 dark:border-white/10 bg-slate-100 dar
321k:bg-white/[0.03] p-8 text-center",children:[n.jsx(na,{className:"mx-auto h-7 w-7 text-cyan-700 dark:text-cyan-300/60"}),n.jsx("p",{className:"mt-3 text-[14px] text-slate-700 dark:text-slate-300",children:k?"Refreshing appraisal…":"No appraisal cached for this property yet."}),n.jsx("p",{className:"mt-1 font-mono text-[12px] uppercase tracking-wider text-slate-500",children:k?"Pulling latest from Scapely AI":"Re-run a search to refresh"})]}):n.jsxs(n.Fragment,{children:[n.jsx("section",{className:"space-y-4",children:v.appraisal?.recommendation&&n.jsx(Xs,{accent:"rose",icon:n.jsx(an,{className:"h-3 w-3"}),title:"Recommendation",delay:.1,children:n.jsxs("div",{className:"space-y-2.5 text-[14px]",children:[v.appraisal.recommendation.recommended_project_type&&n.jsx(M0,{label:"Target strategy",value:v.appraisal.recommendation.recommended_project_type,valueClass:"text-slate-900 dark:text-white font-medium"}),v.appraisal.recommendation.max_units!==void 0&&n.jsx(M0,{label:"Max units",value:String(v.appraisal.recommendation.max_units),valueClass:"text-slate-900 dark:text-white font-medium"}),v.appraisal.recommendation.epc_upgrade_required!==void 0&&n.jsx(M0,{label:"EPC upgrade required",value:v.appraisal.recommendation.epc_upgrade_required?"Yes":"No",valueClass:v.appraisal.recommendation.epc_upgrade_required?"text-amber-700 dark:text-amber-300 font-medium":"text-emerald-700 dark:text-emerald-300 font-medium"})]})})}),n.jsxs("section",{className:"space-y-4",children:[n.jsxs(Xs,{accent:"rose",muted:!0,title:j?.gateway_status?"Planning risks · Gateway":"Planning risks",children:[n.jsxs("div",{className:"mb-4 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[j?.executive_summary?n.jsx("div",{className:"max-w-prose",children:n.jsx("p",{className:"text-[14px] leading-relaxed text-slate-700 dark:text-slate-300",children:j.executive_summary})}):n.jsx("span",{className:"text-[14px] text-slate-400",children:"Nothing found"}),j?.gateway_status&&n.jsxs("div",{className:"sm:text-right",children:[n.jsx("div",{className:"mb-1.5 font-mono text-[12px] uppercase tracking-wider text-slate-400",children:"Gateway"}),n.jsx("div",{className:"text-[14px] font-medium text-slate-900 dark:text-white",children:j.gateway_status})]})]}),j?.key_objection_themes&&j.key_objection_themes.length>0&&n.jsxs("div",{className:"mt-4 border-t border-slate-200 dark:border-white/10 pt-4",children:[n.jsx("div",{className:"mb-2 font-mono text-[12px] uppercase tracking-wider text-slate-400",children:"Key objection themes"}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:j.key_objection_themes.map(W=>n.jsx("span",{className:"inline-flex items-center rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-1 text-[14px] leading-relaxed text-slate-900 dark:text-white",children:W},W))})]}),j?.fire_safety_warning&&n.jsxs("div",{className:"mt-4 flex items-start gap-2 rounded-[12px] border border-amber-300/25 bg-amber-300/5 p-3 text-[14px] text-amber-700 dark:text-amber-100",children:[n.jsx(bx,{className:"mt-0.5 h-3.5 w-3.5 flex-none"}),n.jsxs("span",{children:["Fire Safety: ",j.fire_safety_warning]})]}),(v.property?.planning_gateway?.last_meeting_date||v.property?.planning_gateway?.ai_sentiment_score!==null&&v.property?.planning_gateway?.ai_sentiment_score!==void 0)&&n.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 border-t border-slate-200 dark:border-white/10 pt-4 sm:grid-cols-2",children:[v.property?.planning_gateway?.last_meeting_date&&n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[12px] uppercase tracking-wider text-slate-400",children:"Last committee activity"}),n.jsx("div",{className:"mt-0.5 text-[14px] text-slate-900 dark:text-white",children:new Date(v.property.planning_gateway.last_meeting_date).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})})]}),v.property?.planning_gateway?.ai_sentiment_score!==null&&v.property?.planning_gateway?.ai_sentiment_score!==void 0&&n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[12px] uppercase tracking-wider text-slate-400",children:"Planning sentiment"}),n.jsxs("div",{className:"mt-0.5 text-[14px] text-slate-900 dark:text-white",children:[v.property.planning_gateway.ai_sentiment_score>=.5?"Supportive":v.property.planning_gateway.ai_sentiment_score<=-.5?"Hostile":"Mixed"," ",n.jsxs("span",{className:"text-slate-400",children:["(",v.property.planning_gateway.ai_sentiment_score.toFixed(2),")"]})]})]})]})]}),v.property?.permitted_development&&n.jsx(oF,{pd:v.property.permitted_development,propertyType:v.property.epc?.property_type,dwellingType:v.property.epc?.dwelling_type})]})]})})}),y("site")&&n.jsx(ii,{id:"site",number:6,title:"Plot intelligence",description:"Site shape, OS mapping data, and boundary information for this plot.",children:n.jsx(fN,{lat:e.latitude,lng:e.longitude,tier:t})}),y("commercial")&&n.jsxs(ii,{id:"commercial",number:7,title:"Business / commercial",description:"Company ownership, Community Infrastru
321cture Levy, biodiversity net gain obligations, and commercial conversion rights.",children:[L&&n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[L.class_ma_status&&n.jsxs(nt,{accent:"violet",title:"Class MA",value:L.class_ma_status,tone:/eligible/i.test(L.class_ma_status)?"good":"default",note:L.class_ma_note??void 0,explainer:"Permitted development right to convert commercial (Class E) premises into homes without a full planning application, subject to size and condition limits.",children:[(L.class_ma_blocking_factors?.length??0)>0&&n.jsx(xj,{label:"Blockers",tone:"warn",items:L.class_ma_blocking_factors}),(L.class_ma_caution_factors?.length??0)>0&&n.jsx(xj,{label:"Cautions",tone:"caution",items:L.class_ma_caution_factors})]}),L.cil_zone&&n.jsx(nt,{accent:"violet",title:`CIL Zone ${L.cil_zone}`,value:L.cil_charge_per_sqm_gbp!==null&&L.cil_charge_per_sqm_gbp!==void 0?`£${L.cil_charge_per_sqm_gbp}/sqm`:"—",note:"Community Infrastructure Levy — heuristic band hint; verify the live rate with the LPA's charging schedule.",delay:.05,explainer:"Community Infrastructure Levy — a per-square-metre charge councils apply to qualifying new floorspace to fund local infrastructure.",children:e.local_authority&&n.jsxs("a",{href:`https://www.google.com/search?q=${encodeURIComponent(`${e.local_authority} CIL charging schedule`)}`,target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-flex items-center gap-1 font-mono text-[11px] uppercase tracking-wider text-cyan-700 dark:text-cyan-300 hover:text-cyan-800 dark:hover:text-cyan-200",children:["Find ",e.local_authority," CIL schedule",n.jsx(In,{className:"h-3 w-3"})]})}),L.mees_2027_note&&n.jsx(nt,{accent:"violet",title:"MEES 2027",value:L.mees_2027_warning?"At risk":"Compliant",tone:L.mees_2027_warning?"warn":"good",note:L.mees_2027_note,delay:.1,explainer:"Minimum Energy Efficiency Standards — let properties must meet a minimum EPC rating, with the threshold tightening from 2027."}),L.bng_risk_level&&n.jsx(nt,{accent:"violet",title:"BNG",value:L.bng_risk_level,note:L.bng_note??void 0,delay:.15,explainer:"Biodiversity Net Gain — most new developments must deliver a measurable 10% improvement in habitat as a planning condition."}),L.business_rate_estimate_gbp_yr!==null&&L.business_rate_estimate_gbp_yr!==void 0&&n.jsx(nt,{accent:"violet",title:"Business rates",value:`${hr(L.business_rate_estimate_gbp_yr)}/yr`,note:L.business_rate_note??"Estimated annual charge — confirm with VOA rateable value.",delay:.2,explainer:"The tax on non-domestic property, based on the rateable value set by the Valuation Office Agency."})]}),n.jsx(Jz,{postcode:e.postcode,address:e.address_line,unlocked:s})]}),n.jsxs("div",{className:"flex items-center justify-between gap-4 border-t border-slate-200 dark:border-white/5 pt-4 font-mono text-[12px] uppercase tracking-wider text-slate-500",children:[n.jsx("span",{className:"text-[10px] normal-case tracking-normal text-slate-500",children:e.last_appraisal?.property?.sale_history?.attribution?n.jsxs(n.Fragment,{children:[e.last_appraisal.property.sale_history.attribution," ",n.jsx("a",{href:"https://www.gov.uk/government/organisations/land-registry",target:"_blank",rel:"noopener noreferrer",className:"text-slate-600 dark:text-slate-400 underline decoration-dotted underline-offset-2 transition-colors hover:text-cyan-700 dark:hover:text-cyan-300",children:"HM Land Registry"})]}):null}),n.jsxs("span",{className:"font-sans normal-case tracking-normal",children:["Last refreshed ",Ty(e.last_refreshed_at??e.created_at)]})]})]})})]})}function sF({items:e,currentId:t,onSelect:s,onRemove:r}){const o=w.useRef(null),[c,d]=w.useState(()=>{try{return localStorage.getItem("scapely-watchlist-rail-collapsed")==="true"}catch{return!1}}),h=()=>{d(m=>{const x=!m;try{localStorage.setItem("scapely-watchlist-rail-collapsed",String(x))}catch{}return x})},p=w.useMemo(()=>{const m=e.find(y=>y.id===t),x=e.filter(y=>y.id!==t);return m?[m,...x]:e},[e,t]);if(p.length<=1)return null;const f=m=>{const x=o.current;x&&x.scrollBy({left:m==="left"?-360:360,behavior:"smooth"})};return n.jsxs("div",{className:`mx-auto w-full max-w-5xl px-4 sm:px-8 lg:max-w-6xl xl:max-w-[1400px] 2xl:max-w-[1600px] transition-[padding] duration-300 ${c?"py-3":"pb-10 pt-6"}`,children:[n.jsxs("div",{className:`flex items-center justify-between px-1 transition-[margin] duration-300 ${c?"mb-0":"mb-3"}`,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:h,"aria-label":c?"Expand w
321atchlist":"Collapse watchlist",className:"flex h-6 w-6 items-center justify-center rounded text-slate-500 dark:text-slate-400 transition hover:bg-slate-100 dark:hover:bg-white/10 hover:text-slate-700 dark:hover:text-slate-200",children:n.jsx(Zc,{className:`h-3.5 w-3.5 transition-transform duration-300 ${c?"":"rotate-180"}`})}),n.jsx("h2",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-600 dark:text-slate-400",children:"Your watchlist"})]}),n.jsxs("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${c?"opacity-0 pointer-events-none":"opacity-100"}`,children:[n.jsx("button",{type:"button",onClick:()=>f("left"),"aria-label":"Scroll watchlist left",className:"flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 dark:bg-white/5 text-slate-700 dark:text-slate-300 transition hover:bg-slate-200 dark:hover:bg-white/10",children:n.jsx(_r,{className:"h-4 w-4"})}),n.jsx("button",{type:"button",onClick:()=>f("right"),"aria-label":"Scroll watchlist right",className:"flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 dark:bg-white/5 text-slate-700 dark:text-slate-300 transition hover:bg-slate-200 dark:hover:bg-white/10",children:n.jsx(Gh,{className:"h-4 w-4"})})]})]}),n.jsx("div",{className:`overflow-hidden transition-all duration-300 ${c?"max-h-0":"max-h-[400px]"}`,children:n.jsx("div",{ref:o,className:"flex snap-x snap-mandatory gap-4 overflow-x-auto pb-2 pr-6 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{maskImage:"linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%)",WebkitMaskImage:"linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%)"},children:p.map(m=>{const x=m.id===t,y=Wc(m.last_risk_level);return n.jsxs("div",{className:"group relative min-w-[280px] max-w-[280px] snap-start",children:[n.jsxs("button",{type:"button",onClick:()=>{x||s(m.id)},"aria-current":x?"true":void 0,disabled:x,className:`flex w-full cursor-pointer flex-col rounded-2xl border p-4 text-left backdrop-blur transition ${x?"border-cyan-300/40 bg-cyan-300/[0.06] shadow-[inset_0_0_18px_rgba(34,211,238,0.12)]":"border-slate-200 dark:border-white/10 bg-slate-100 dark:bg-white/[0.03] hover:border-cyan-300/30 hover:bg-slate-100 dark:hover:bg-white/[0.06]"}`,"data-testid":`detail-watchlist-${m.id}`,children:[n.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:`line-clamp-1 text-sm font-medium ${x?"text-cyan-700 dark:text-cyan-100":"text-slate-900 dark:text-white group-hover:text-cyan-700 dark:group-hover:text-cyan-200"}`,children:m.address_line}),n.jsxs("p",{className:"mt-0.5 flex items-center gap-1 font-mono text-[11px] text-slate-600 dark:text-slate-400",children:[n.jsx(Xo,{className:"h-3 w-3"}),m.local_authority??m.postcode]})]}),y&&n.jsx("div",{className:`shrink-0 rounded border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider ${y==="Low"?"border-emerald-500/20 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":y==="Medium"?"border-amber-500/20 bg-amber-500/10 text-amber-600 dark:text-amber-400":"border-fuchsia-500/20 bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400"}`,children:y})]}),n.jsx("div",{className:"mt-auto flex items-center justify-end border-t border-slate-200 dark:border-white/5 pt-3",children:n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:x?n.jsx("span",{className:"text-cyan-700 dark:text-cyan-300",children:"Viewing"}):Ty(m.last_refreshed_at??m.created_at)})})]}),n.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),r(m.id)},"aria-label":`Remove ${m.address_line} from watchlist`,className:"absolute bottom-3 left-3 hidden h-7 w-7 items-center justify-center rounded-md text-slate-600 dark:text-slate-400 transition hover:bg-fuchsia-400/10 hover:text-fuchsia-700 dark:hover:text-fuchsia-300 group-hover:flex","data-testid":`button-remove-watchlist-${m.id}`,children:n.jsx(Xh,{className:"h-3.5 w-3.5"})})]},m.id)})})})]})}function pj(e){if(!e)return"EPC unknown — required before letting or sale.";const t=e.toUpperCase().slice(0,1);return t==="A"||t==="B"?`Band ${t} comfortably clears the 2027 MEES C threshold — no mandatory upgrade spend, and energy efficie
321ncy is a marketing positive.`:t==="C"?"Band C just meets the 2027 MEES requirement — lettable today and in 2027 with no forced works.":t==="D"?"Band D fails the 2027 MEES C target — budget for insulation/heating works before re-letting after April 2027.":t==="E"?"Band E is the current legal minimum but fails 2027 MEES — significant upgrade works likely needed within 12 months.":`Band ${t} is below the current MEES E minimum — cannot legally be let to new tenants without upgrade works first.`}function fj(e){if(e==null)return"PTAL not available for this location.";const t=String(e);return t==="0"||t==="1a"||t==="1b"?`PTAL ${t} is very poor — councils will demand off-street parking, and car-free schemes are unlikely to win consent.`:t==="2"||t==="3"?`PTAL ${t} is moderate — expect parking ratios of around 1 space per unit and standard density limits.`:t==="4"?`PTAL ${t} is good — many London boroughs allow reduced parking and modestly higher density at this level.`:`PTAL ${t} is excellent — supports car-free or car-lite schemes and the highest density allowed by the local plan.`}function nF(e){const t=[];if(e.lsoa_name||e.msoa_name){const s=e.lsoa_name,r=e.msoa_name;s&&r?t.push(`This property sits within ${s} — a statistical neighbourhood (LSOA) of around 1,500 residents, part of the broader ${r} area.`):s&&t.push(`This property is within the ${s} statistical neighbourhood (LSOA), typically home to around 1,500 residents.`)}if(e.rural_urban){const s=e.rural_urban.toLowerCase(),r=s.includes("sparse setting");if(s.startsWith("urban major conurbation"))t.push("The ONS 2021 Rural/Urban Classification designates this a major urban conurbation — the highest urban tier, characteristic of city-regions such as London, Birmingham or Manchester.");else if(s.startsWith("urban minor conurbation"))t.push("ONS classifies this as a minor urban conurbation — a densely settled cluster of interconnected towns or cities.");else if(s.startsWith("urban city and town")){const o=r?" in a sparse setting — a city or town relatively isolated from other built-up areas":" — a well-connected city or town with typical urban population density";t.push(`The area is classed by ONS as an Urban City and Town${o}.`)}else if(s.startsWith("rural town and fringe")){const o=r?" in a sparse setting, indicating a market town or fringe area with very low surrounding population density":", typical of a market town or the built-up fringe of a rural area";t.push(`ONS places this in a Rural Town and Fringe category${o}.`)}else if(s.startsWith("rural village")){const o=r?" in a sparse setting — a small settlement in a very low-density area":", characteristic of a village or dispersed rural community";t.push(`The area is classified as Rural Village and Dispersed${o}.`)}else t.push(`The ONS 2021 Rural/Urban Classification for this area is: ${e.rural_urban}.`)}if(e.imd_rank!==null&&e.imd_decile!==null){const s=e.imd_decile,r=s<=1?"the most deprived 10% of neighbourhoods in England":s<=2?"the most deprived fifth of English neighbourhoods":s<=3?"the more deprived third of English neighbourhoods":s<=5?"around the national median for deprivation":s<=7?"the less deprived half of English neighbourhoods":s<=9?"the more affluent areas nationally":"the least deprived 10% of neighbourhoods in England";t.push(`On England's Index of Multiple Deprivation it ranks ${e.imd_rank.toLocaleString()} of 32,844 LSOAs (Decile ${s}), placing it within ${r}.`)}return t.length>0?t.join(" "):"No area classification data is available for this property."}function aF(e){return e<=1?"Most deprived 10%":e<=2?"Deprived":e<=3?"Quite deprived":e<=4?"Below average":e<=6?"Around average":e<=7?"Above average":e<=8?"Fairly affluent":e<=9?"Affluent":"Least deprived 10%"}function P0(e){return e==null?"HMO saturation data not available for this area.":e>=20?`${e}% saturation is at or above the typical Article 4 refusal threshold — a new HMO licence is likely to be rejected.`:e>=10?`${e}% saturation is moderate — a new HMO licence is plausible but expect close scrutiny on amenity and parking.`:`${e}% saturation is low — councils generally grant new HMO licences in areas with this level of density.`}function mj(e){return e==null?"Flood zone data not available for this property.":e===1?"Zone 1 is low risk (under 0.1% per year) — standard insurance and mortgage products available, no Flood Risk Assessment required.":e===2?"Zone 2 is medium risk (0.1–1% per year) — expect higher buildings insurance premiums and a Flood Risk Assessment with any planning application.":"Zone 3 is high risk (over 1% per year) — many lenders restrict, premiums are substantially higher, and the Sequential Test will apply at planning."}function Fu(e){let t=e.length;for(const s of[" ("," — "]){const r=e.indexOf(s);r!==-1&&r<t&&(t=r)}return e.slice(0,t).trim()}function gj({title:e,blurb:t,children:s}){return n.jsxs("section",{className:"space-y-4",children:[(e||t)&&n.jsxs("div",{children:[e&&n.jsx("h2",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.12em] text-slate-800 dark:text-slate-200",children:e}),t&&n.jsx("p",{className:"mt-1 text-[13px] leading-snug text-slate-500",children:t})]}),s]})}function ii({id:e,number:t,title:s,description:r,children:o}){return n.jsxs("div",{id:`property-section-${e}`,"data-section-id":e,className:"scroll-mt-5 flex flex-col gap-6 py-8 sm:py-12 lg:flex-row lg:gap-14",children:[n.jsx("div",{className:"flex-none lg:w-[220px] xl:w-[260px]",children:n.jsxs("div",{className:"lg:sticky lg:top-[68px]",children:[t!=null&&n.jsx("span",{className:`mb-2 block font-mono text-[10px] font-bold uppercase tracking-[0.14em] ${Eh[t??1]??Eh[1]}`,children:String(t).padStart(2,"0")}),n.jsx("h2",{className:`text-[20px] font-medium leading-snug ${Th[t??1]??Th[1]}`,children:s}),n.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-slate-500 dark:text-slate-400",children:r})]})}),n.jsx("div",{className:"min-w-0 flex-1 space-y-4",children:o})]})}function rF({title:e,icon:t=void 0,accent:s,muted:r=!1,children:o}){return n.jsx(Xs,{accent:s,icon:t,title:e,muted:r,children:n.jsx("div",{className:"space-y-3.5",children:o})})}function xj({label:e,items:t,tone:s}){const r=s==="warn"?"border-rose-300/30 bg-rose-300/10 text-rose-700 dark:text-rose-200":"border-amber-300/30 bg-amber-300/10 text-amber-700 dark:text-amber-200";return n.jsxs("div",{className:"mt-2",children:[n.jsx("div",{className:"mb-1.5 font-mono text-[11px] uppercase tracking-wider text-slate-500",children:e}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(o=>n.jsx("span",{className:`inline-flex items-center rounded-md border px-2 py-0.5 text-[12px] ${r}`,children:o},o))})]})}function M0({label:e,value:t,valueClass:s="text-slate-900 dark:text-white font-mono"}){return n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-slate-600 dar
321k:text-slate-400",children:e}),n.jsx("span",{className:s,children:t})]})}const yj={flat:["part20-class-aa"],house:["c3-to-c4-hmo","part1-class-a","part1-class-aa"],commercial:["class-ma","part20-class-aa"],agricultural:["class-q"],unknown:["class-ma","class-q","c3-to-c4-hmo","part1-class-a","part1-class-aa","part20-class-aa"]};function iF(e,t){const s=`${e??""} ${t??""}`.toLowerCase();return/flat|apartment|maisonette/.test(s)?"flat":/house|bungalow|cottage/.test(s)?"house":"unknown"}function oF({pd:e,propertyType:t,dwellingType:s}){const r=iF(t,s),o=new Set(yj[r]??yj.unknown),c=e.evaluations.filter(h=>o.has(h.class_id)),d={permitted:{dot:"bg-emerald-400",label:"Available",text:"text-emerald-700 dark:text-emerald-200",border:"border-emerald-300/25",bg:"bg-emerald-300/5"},restricted:{dot:"bg-amber-400",label:"Restricted",text:"text-amber-700 dark:text-amber-100",border:"border-amber-300/25",bg:"bg-amber-300/5"},prohibited:{dot:"bg-rose-400",label:"Not available",text:"text-rose-700 dark:text-rose-100",border:"border-rose-300/25",bg:"bg-rose-300/5"}};return n.jsxs(Xs,{accent:"rose",title:"Development rights",delay:.1,collapsible:!0,defaultCollapsed:!0,children:[n.jsx("p",{className:"mb-4 text-[13px] leading-relaxed text-slate-600 dark:text-slate-400",children:"First-pass screening of the main GPDO classes against the live planning constraints for this plot. Reasoning is shown for any class that is restricted or removed."}),n.jsx("div",{className:"space-y-3",children:c.map(h=>{const p=d[h.status];return n.jsxs("div",{className:`rounded-[12px] border ${p.border} ${p.bg} p-3.5`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[14px] font-medium text-slate-900 dark:text-white",children:h.name}),n.jsx("div",{className:"mt-0.5 font-mono text-[11px] uppercase tracking-wider text-slate-500",children:h.gpdo_reference})]}),n.jsxs("div",{className:"inline-flex flex-none items-center gap-1.5 rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-1 text-[12px] text-slate-900 dark:text-white",children:[n.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${p.dot}`}),p.label]})]}),n.jsx("div",{className:`mt-2 text-[13px] leading-relaxed ${p.text}`,children:h.headline}),h.reasons.length>0&&n.jsx("ul",{className:"mt-2 space-y-1 text-[13px] leading-relaxed text-slate-700 dark:text-slate-300",children:h.reasons.map((f,m)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{className:"mt-2 h-1 w-1 flex-none rounded-full bg-slate-500"}),n.jsx("span",{children:f})]},m))}),h.notes.length>0&&n.jsx("div",{className:"mt-2 text-[12px] leading-relaxed text-slate-500",children:h.notes.join(" ")})]},h.class_id)})}),n.jsxs("div",{className:"mt-4 border-t border-slate-200 dark:border-white/10 pt-3 text-[11px] leading-relaxed text-slate-500",children:["Source: ",e.source,". ",e.disclaimer]})]})}function lF({items:e,isLoading:t,recentSearches:s,searchInput:r,onSearchInputChange:o,onSubmitSearch:c,isSearching:d,searchError:h,onSelectItem:p,onRemoveItem:f,userEmail:m,userName:x,tier:y,anonymous:v,onSignIn:j}){const k=w.useRef(null),S=w.useMemo(()=>{const M=new Date;return e.filter(B=>{const A=new Date(B.last_refreshed_at??B.created_at);return A.getFullYear()===M.getFullYear()&&A.getMonth()===M.getMonth()}).length},[e]),N=w.useMemo(()=>{const M={Low:0,Medium:0,High:0,Critical:0};return e.forEach(B=>{const A=Wc(B.last_risk_level);A&&(M[A]+=1)}),M},[e]),C=M=>{M.preventDefault(),r.trim()&&c(r)},E=M=>{const B=k.current;B&&B.scrollBy({left:M==="left"?-360:360,behavior:"smooth"})},O=x?.trim()||m?.split("@")[0]||"there",P=typeof window<"u"&&!!sessionStorage.getItem("scapely:justSignedUp");return n.jsxs("div",{className:"report-copy-contrast scap-bento-root relative w-full overflow-x-hidden pb-12 font-sans text-slate-800 dark:text-slate-200 selection:bg-cyan-500/30 selection:text-cyan-700 dark:selection:text-cyan-50",children:[n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-[700px] dark:hidden","aria-hidden":!0,style:{backgroundImage:"linear-gradient(to right, rgba(15,23,42,0.07) 1px, transparent 1px), linear-gradient(to bottom, rgba(15,23,42,0.07) 1px, transparent 1px)",backgroundSize:"56px 56px",maskImage:"linear-gradient(to bottom, black 0%, black 15%, transparent 55%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, black 15%, transparent 55%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 hidden h-[700px] dark:block","aria-hidden":!0,style:{backgroundImage:"linear-gradient(to right, white 1px, transparent 1px), linear-gradient(to bottom, white 1px, transparent 1px)",backgroundSize:"56px 56px",opacity:.06,maskImage:"linear-gradient(to bottom, black 0%, black 15%, transparent 55%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, black 15%, transparent 55%)"}}),n.jsx("style",{children:`
322        .scap-bento-root {
323          /* Light (default) — matches the app's other light panels:
324             white surface, slate-200 hairline, soft elevation. */
325          --bento-card-bg: #ffffff;
326          --bento-card-border: #e2e8f0;
327          --bento-cyan-glow: rgba(34, 211, 238, 0.08);
328          --bento-card-shadow: none;
329          --bento-card-hairline: rgba(15, 23, 42, 0.10);
330          --bento-card-hover-shadow: none;
331        }
332        .dark .scap-bento-root {
333          /* Dark — original values, kept byte-identical. */
334          --bento-card-bg: #06081c;
335          --bento-card-border: rgba(255, 255, 255, 0.08);
336          --bento-cyan-glow: rgba(34, 211, 238, 0.15);
337          --bento-card-shadow: none;
338          --bento-card-hairline: rgba(255, 255, 255, 0.15);
339          --bento-card-hover-shadow: none;
340        }
341        .scap-bento-root .bento-card {
342          background: var(--bento-card-bg);
343          border: 1px solid var(--bento-card-border);
344          border-radius: 12px;
345          position: relative;
346          overflow: hidden;
347          backdrop-filter: blur(12px);
348          box-shadow: var(--bento-card-shadow);
349          transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
350        }
351        .scap-bento-root .bento-card::before {
352          content: '';
353          position: absolute;
354          top: 0; left: 0; right: 0;
355          height: 1px;
356          background: linear-gradient(90deg, transparent, var(--bento-card-hairline), transparent);
357          z-index: 1;
358        }
359        .scap-bento-root .bento-card:not(.no-hover):hover {
360          transform: translateY(-2px);
361          border-color: rgba(34, 211, 238, 0.3);
362          box-shadow: var(--bento-card-hover-shadow);
363        }
364        .scap-bento-root .bento-card.no-lift:hover {
365          transform: none;
366        }
367        .scap-bento-root .hide-scrollbar::-webkit-scrollbar { display: none; }
368        .scap-bento-root .hide-scrollbar {
369          -ms-overflow-style: none;
370          scrollbar-width: none;
371        }
372      `}),n.jsxs("main",{className:"relative z-10 mx-auto flex w-full max-w-[1400px] flex-col gap-4 px-3 py-4 sm:gap-6 sm:px-8 sm:py-8",children:[n.jsxs("div",{className:"flex flex-col items-stretch gap-4 sm:gap-6 lg:flex-row",children:[n.jsx("div",{className:"bento-card no-hover flex flex-[3] flex-col justify-center p-4 sm:p-8 lg:p-10",children:n.jsxs("div",{className:"max-w-2xl",children:[n.jsx("h1",{className:"mb-2 text-[18px] font-semibold tracking-tight text-slate-900 dark:text-white sm:mb-3 sm:text-[25px] lg:text-[34px]",children:v?"Search any UK property":P?"Welcome to your dashboard.":`Welcome back${`, ${O}.`}`}),n.jsx("p",{className:"mb-4 text-[14px] text-slate-600 dark:text-slate-400 sm:text-lg",children:v?"Enter any address or postcode to instantly see EPC rating, planning constraints and flood risk — free, no account needed.":"Ready to appraise your next site? Enter an address or postcode to generate a viability, planning and financial assessment."}),!v&&n.jsxs("p",{className:"mb-6 hidden text-[13px] text-slate-600 dark:text-slate-400 sm:mb-8 sm:block",children:["New here?"," ",n.jsxs(Be,{href:"/resources","data-testid":"link-dashboard-resources",className:"inline-flex items-center gap-1 font-medium text-cyan-700 dark:text-cyan-300 underline-offset-4 hover:text-cyan-800 dark:hover:text-cyan-200 hover:underline",children:["Browse the Resources library",n.jsx(Z0,{className:"h-3.5 w-3.5"})]})," ","— playbooks, council guides, postcode benchmarks and our development glossary."]}),n.jsxs("form",{onSubmit:C,className:"relative mb-4",children:[n.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-4",children:d?n.jsx(Me,{className:"h-5 w-5 animate-spin text-cyan-700 dark:text-cyan-300"}):n.jsx(Ra,{className:"h-5 w-5 text-slate-500"})}),n.jsx("input",{type:"text",value:r,onChange:M=>o(M.target.value),placeholder:"Search address or postcode…",disabled:d,className:"w-full rounded-[12px] border border-slate-200 dark:border-white/10 bg-white/80 dark:bg-[#070a20]/80 py-4 pl-12 pr-[68px] text-base text-slate-900 dark:text-white shadow-inner placeholder:text-slate-500 focus:border-cyan-500/50 focus:outline-none focus:ring-1 focus:ring-cyan-500/50 disabled:opacity-60 sm:py-6 sm:pr-[160px] sm:text-lg","data-testid":"input-home-search"}),n.jsx("div",{className:"absolute inset-y-0 right-2 flex items-center sm:right-5",children:n.jsx("button",{type:"submit",disabled:d||!r.trim(),"aria-label":"Run check",className:"inline-flex h-[42px] items-center gap-2 rounded-[3px] border-0 bg-cyan-500 px-3 font-semibold text-white outline-none transition-all hover:bg-cyan-400 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-cyan-500/70 sm:px-5","data-testid":"button-home-search",children:d?n.jsx(Zw,{className:"h-4 w-4 animate-spin"}):n.jsxs(n.Fragment,{children:[n.jsx(Ra,{className:"h-4 w-4 sm:hidden","aria-hidden":"true"}),n.jsx("span",{className:"hidden sm:inline",children:"Run Check"})]})})})]}),h&&n.jsx("p",{className:"mb-4 text-[13px] text-fuchsia-700 dark:text-fuchsia-300",children:h}),s.length>0&&n.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[n.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Recent:"}),n.jsx("div",{className:"flex flex-wrap gap-2",children:s.map(M=>n.jsx("button",{type:"button",onClick:()=>{o(M),c(M)},className:"rounded-full border border-slate-200 dark:border-white/5 bg-slate-100 dark:bg-white/5 px-3 py-1 font-mono text-xs text-slate-700 dark:text-slate-300 transition-colors hover:bg-slate-200 dark:hover:bg-white/10 hover:text-slate-900 dark:hover:text-white",children:M},M))})]})]})}),n.jsx("div",{className:"grid flex-[2] grid-cols-2 gap-3 sm:grid-cols-2 sm:gap-6 lg:flex lg:flex-col",children:v?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bento-card flex flex-1 flex-col gap-3 p-4 sm:p-6",children:[n.jsxs("div",{className:"flex items-center gap-2 text-cyan-600 dark:text-cyan-400",children:[n.jsx(Tr,{className:"h-4 w-4"}),n.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-wider",children:"Free includes"})]}),n.jsxs("ul",{className:"mt-1 space-y-1.5 text-[12px] text-slate-600 dar
372k:text-slate-400",children:[n.jsxs("li",{className:"flex items-center gap-1.5",children:[n.jsx(kn,{className:"h-3 w-3 text-emerald-400 shrink-0"})," EPC rating & potential"]}),n.jsxs("li",{className:"flex items-center gap-1.5",children:[n.jsx(yx,{className:"h-3 w-3 text-blue-400 shrink-0"})," Flood risk zone"]}),n.jsxs("li",{className:"flex items-center gap-1.5",children:[n.jsx(jk,{className:"h-3 w-3 text-amber-400 shrink-0"})," Conservation & heritage"]}),n.jsxs("li",{className:"flex items-center gap-1.5",children:[n.jsx(mh,{className:"h-3 w-3 text-orange-400 shrink-0"})," Article 4 directions"]})]})]}),n.jsxs("div",{className:"bento-card flex flex-1 flex-col justify-between p-4 sm:p-6",children:[n.jsxs("div",{className:"flex items-center gap-2 text-fuchsia-600 dark:text-fuchsia-400",children:[n.jsx(na,{className:"h-4 w-4"}),n.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-wider",children:"Pro unlocks"})]}),n.jsx("p",{className:"mt-3 text-[12px] text-slate-600 dark:text-slate-400",children:"AI appraisals, GDV, build costs, planning risk, owner intel & more."}),n.jsx(Be,{href:"/pricing",className:"mt-4 inline-flex w-full items-center justify-center gap-1.5 rounded-[10px] border border-slate-900 bg-transparent px-4 py-2.5 text-[12px] font-semibold text-slate-900 transition hover:bg-slate-900 hover:text-white dark:border-white dark:text-white dark:hover:bg-white dark:hover:text-[#06081c]",children:"Create account →"})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bento-card flex flex-1 flex-col justify-between p-4 sm:p-6",children:[n.jsxs("div",{className:"flex flex-col items-start gap-1 sm:flex-row sm:items-start sm:justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 text-cyan-600 dark:text-cyan-400",children:[n.jsx(Zw,{className:"h-4 w-4"}),n.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-wider",children:"Watchlist"})]}),n.jsxs("span",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:[e.length," ",n.jsx("span",{className:"text-sm font-normal text-slate-500",children:"tracked"})]})]}),n.jsxs("div",{className:"mt-6 flex h-12 items-end justify-between",children:[n.jsx("div",{className:"flex flex-col justify-end",children:n.jsx("span",{className:"text-xs text-slate-600 dark:text-slate-400",children:N.High+N.Critical>0?`${N.High+N.Critical} high-risk`:"Risk profile"})}),n.jsxs("svg",{width:"120",height:"40",viewBox:"0 0 120 40",className:"overflow-visible",children:[n.jsx("path",{d:"M0 30 Q 20 25, 40 35 T 80 15 T 120 10",fill:"none",stroke:"rgba(34, 211, 238, 0.4)",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("path",{d:"M0 30 Q 20 25, 40 35 T 80 15 T 120 10 L 120 40 L 0 40 Z",fill:"url(#scap-bento-grad)"}),n.jsx("circle",{cx:"120",cy:"10",r:"3",fill:"#22d3ee",className:"animate-pulse"}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:"scap-bento-grad",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"0%",stopColor:"rgba(34, 211, 238, 0.2)"}),n.jsx("stop",{offset:"100%",stopColor:"rgba(34, 211, 238, 0)"})]})})]})]})]}),n.jsxs("div",{className:"bento-card flex flex-1 flex-col justify-between p-4 sm:p-6",children:[n.jsxs("div",{className:"flex flex-col items-start gap-1 sm:flex-row sm:items-start sm:justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 text-fuchsia-600 dark:text-fuchsia-400",children:[n.jsx(fx,{className:"h-4 w-4"}),n.jsx("span",{className:"font-mono text-[11px] font-bold uppercase tracking-wider",children:"This Month"})]}),n.jsxs("span",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:[S," ",n.jsx("span",{className:"text-sm font-normal text-slate-500",children:"appraisals"})]})]}),n.jsx("div",{className:"mt-6 flex h-12 items-end gap-2",children:[30,45,25,60,75,40,85].map((M,B)=>n.jsx("div",{className:"relative flex-1 rounded-t-sm bg-slate-100 dark:bg-white/5 transition-colors hover:bg-slate-200 dark:hover:bg-white/20",style:{height:`${M}%`}},B))})]})]})})]}),!v&&n.jsxs("div",{children:[n.jsxs("div",{className:"mb-4 flex items-center justify-between px-2",children:[n.jsx("h2",{className:"text-lg font-medium text-slate-900 dark:text-white",children:"Saved properties"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:()=>E("left"),"aria-label":"Scroll watchlist left",className:"flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 dar
372k:bg-white/5 text-slate-700 dark:text-slate-300 transition hover:bg-slate-200 dark:hover:bg-white/10",children:n.jsx(_r,{className:"h-4 w-4"})}),n.jsx("button",{type:"button",onClick:()=>E("right"),"aria-label":"Scroll watchlist right",className:"flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 dark:bg-white/5 text-slate-700 dark:text-slate-300 transition hover:bg-slate-200 dark:hover:bg-white/10",children:n.jsx(Gh,{className:"h-4 w-4"})})]})]}),t?n.jsx("div",{className:"bento-card no-hover flex items-center justify-center py-16",children:n.jsx(Me,{className:"h-5 w-5 animate-spin text-cyan-700 dark:text-cyan-300"})}):e.length===0?n.jsxs("div",{className:"bento-card no-hover flex flex-col items-center justify-center px-6 py-12 text-center",children:[n.jsx(na,{className:"h-6 w-6 text-cyan-700 dark:text-cyan-300/60"}),n.jsx("p",{className:"mt-3 text-[14px] text-slate-700 dark:text-slate-300",children:"Your watchlist is empty."}),n.jsx("p",{className:"mt-1 font-mono text-[12px] uppercase tracking-wider text-slate-500",children:"Run an appraisal above or save listings via the Chrome extension"})]}):n.jsx("div",{ref:k,className:"hide-scrollbar flex snap-x snap-mandatory gap-6 overflow-x-auto pb-4 pr-6",style:{maskImage:"linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%)",WebkitMaskImage:"linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%)"},children:e.map(M=>{const B=Wc(M.last_risk_level);return n.jsxs("div",{className:"group relative min-w-[260px] max-w-[260px] snap-start sm:min-w-[320px] sm:max-w-[320px]",children:[n.jsxs("button",{type:"button",onClick:()=>p(M.id),className:"bento-card no-lift flex w-full cursor-pointer flex-col p-5 text-left","data-testid":`home-watchlist-${M.id}`,children:[n.jsxs("div",{className:"mb-4 flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"line-clamp-1 font-medium text-slate-900 dark:text-white transition-colors group-hover:text-cyan-600 dark:group-hover:text-cyan-400",children:M.address_line}),n.jsxs("p",{className:"mt-1 flex items-center gap-1 font-mono text-xs text-slate-600 dark:text-slate-400",children:[n.jsx(Xo,{className:"h-3 w-3"}),M.local_authority??M.postcode]})]}),B&&n.jsxs("div",{className:`shrink-0 rounded border px-2 py-0.5 font-mono text-[9px] uppercase tracking-wider ${B==="Low"?"border-emerald-500/20 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":B==="Medium"?"border-amber-500/20 bg-amber-500/10 text-amber-600 dark:text-amber-400":"border-fuchsia-500/20 bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400"}`,children:[B," Risk"]})]}),n.jsx("div",{className:"mt-auto flex items-center justify-end border-t border-slate-200 dark:border-white/5 pt-4",children:n.jsxs("div",{className:"text-right",children:[n.jsxs("div",{className:"mb-0.5 flex items-center justify-end gap-1 font-mono text-[10px] uppercase tracking-wider text-slate-500",children:[n.jsx(xx,{className:"h-3 w-3"}),Ty(M.last_refreshed_at??M.created_at)]}),n.jsxs("div",{className:"flex items-center justify-end gap-1 text-sm font-medium text-cyan-600 dark:text-cyan-400 opacity-0 transition-opacity group-hover:opacity-100",children:["View ",n.jsx(Z0,{className:"h-3 w-3"})]})]})})]}),n.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),f(M.id)},"aria-label":`Remove ${M.address_line} from watchlist`,className:"absolute bottom-4 left-4 hidden h-8 w-8 items-center justify-center rounded-md text-slate-600 dark:text-slate-400 transition hover:bg-fuchsia-400/10 hover:text-fuchsia-700 dark:hover:text-fuchsia-300 group-hover:flex","data-testid":`button-remove-home-watchlist-${M.id}`,children:n.jsx(Xh,{className:"h-4 w-4"})})]},M.id)})})]}),n.jsxs("div",{className:"bento-card no-hover mt-2 hidden flex-col items-center justify-between gap-4 p-4 sm:flex sm:flex-row",children:[n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-r-0 px-2 sm:border-r sm:border-slate-200 dark:sm:border-white/10",children:[n.jsx(an,{className:"h-4 w-4 text-slate-600 dark:text-slate-400"}),n.jsx("span",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-600 dar
372k:text-slate-400",children:"UK Market Pulse"})]}),n.jsxs("div",{className:"hide-scrollbar flex w-full items-center justify-between gap-8 overflow-x-auto px-4",children:[n.jsxs("div",{className:"flex items-center gap-3 whitespace-nowrap",children:[n.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full border border-cyan-500/20 bg-cyan-500/10 text-cyan-600 dark:text-cyan-400",children:n.jsx(Jo,{className:"h-4 w-4"})}),n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase text-slate-500",children:"Avg Build Cost"}),n.jsxs("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:["£2,450 / sqm"," ",n.jsx("span",{className:"ml-1 text-xs text-emerald-600 dark:text-emerald-400",children:"↓ 1.2%"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 whitespace-nowrap",children:[n.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full border border-emerald-500/20 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:n.jsx(mh,{className:"h-4 w-4"})}),n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase text-slate-500",children:"Planning Approval"}),n.jsxs("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:["68% avg"," ",n.jsx("span",{className:"ml-1 text-xs text-fuchsia-600 dark:text-fuchsia-400",children:"↓ 0.5%"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 whitespace-nowrap",children:[n.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full border border-amber-500/20 bg-amber-500/10 text-amber-600 dark:text-amber-400",children:n.jsx(kn,{className:"h-4 w-4"})}),n.jsxs("div",{children:[n.jsx("div",{className:"font-mono text-[10px] uppercase text-slate-500",children:"EPC C+ Rate"}),n.jsxs("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:["42% housing stock"," ",n.jsx("span",{className:"ml-1 text-xs text-emerald-600 dark:text-emerald-400",children:"↑ 2.1%"})]})]})]})]})]}),n.jsxs("p",{className:"mt-2 text-center font-mono text-[11px] uppercase tracking-wider text-slate-600",children:[v?"Free":y==="enterprise"?"Enterprise":y==="pro"?"Pro":"Pay-as-you-go",m?` · ${m}`:""]})]})]})}function cF({query:e}){const t=e.trim(),s=t.match(/[A-Z]{1,2}\d{1,2}[A-Z]?\s?\d?[A-Z]{0,2}/i),r=s?s[0].toUpperCase():null,o=s?t.replace(s[0],"").replace(/,\s*$/,"").trim()||t:t||"Analysing…";return n.jsx("div",{className:"mx-auto max-w-5xl px-4 pt-5 sm:px-8 sm:pt-7",children:n.jsx(xy,{accent:"cyan",className:"min-h-[260px] w-full sm:min-h-[320px]",children:n.jsxs("div",{className:"relative flex min-h-[260px] flex-col px-5 py-5 sm:min-h-[320px] sm:px-7 sm:py-6",children:[n.jsx("div",{className:"flex items-start justify-end gap-2",children:n.jsxs("div",{className:"hidden sm:inline-flex items-center gap-2 rounded-full border border-slate-900/20 dark:border-white/20 px-3 py-1.5 font-mono text-[12px] uppercase tracking-wider text-slate-900 dark:text-white",children:[n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}),n.jsx("span",{children:"Analysing…"})]})}),n.jsxs("div",{className:"mt-auto",children:[r&&n.jsx("div",{className:"mb-2 hidden items-center gap-2 sm:flex",children:n.jsx("span",{className:"rounded-md border border-slate-900/20 dark:border-white/20 px-2 py-0.5 font-mono text-[13px] text-slate-900 dark:text-white",children:r})}),n.jsx("h1",{className:"text-[14px] font-semibold tracking-tight text-slate-900 dark:text-white dark:drop-shadow-[0_2px_12px_rgba(0,0,0,0.6)] sm:text-[21px]","data-testid":"text-loading-address",children:o}),n.jsx("p",{className:"mt-2 hidden font-mono text-[12px] uppercase tracking-wider text-slate-500 sm:block",children:"Pulling EPC, planning gateway, tenure and development appraisal…"})]})]})})})}function dF({title:e,body:t}){return n.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-slate-50 dark:bg-[#06081c] px-6 text-center text-slate-800 dark:text-slate-200",children:[n.jsx(Ar,{className:"h-7 w-7 text-fuchsia-700 dark:text-fuchsia-300"}),n.jsx("h1",{className:"mt-4 text-[14px] font-semibold text-slate-900 dark:text-white",children:e}),n.jsx("p",{className:"mt-1 max-w-md text-[14px] text-slate-600 dar
372k:text-slate-400",children:t})]})}function uF(){return _i(),w.useEffect(()=>{const e=window.setTimeout(()=>{},500);return()=>window.clearTimeout(e)},[]),n.jsxs("div",{className:"min-h-screen bg-[#06081c] text-white",children:[n.jsx("header",{className:"border-b border-white/10",children:n.jsx("div",{className:"mx-auto flex h-16 w-full max-w-7xl items-center justify-between px-6",children:n.jsx(Be,{href:"/",className:"flex items-center gap-3",children:n.jsx("img",{src:_n,alt:"Scapely",className:"h-[15px] w-auto sm:h-[16px]"})})})}),n.jsxs("main",{className:"mx-auto flex min-h-[70vh] w-full max-w-2xl flex-col items-center justify-center px-6 text-center",children:[n.jsx("span",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-cyan-300/15 text-cyan-200",children:n.jsx(Tr,{className:"h-9 w-9"})}),n.jsxs("h1",{className:"mt-6 text-[21px] font-semibold tracking-tight sm:text-[25px]",children:["Welcome to Scapely ",n.jsx("span",{className:"bg-gradient-to-r from-cyan-300 to-fuchsia-400 bg-clip-text text-transparent",children:"Pro"})]}),n.jsx("p",{className:"mt-3 max-w-md text-[15px] text-slate-300",children:"Payment confirmed. Development appraisals, cost models, and risk scores are unlocking on your account now."}),n.jsxs(Be,{href:"/dashboard",className:"mt-8 inline-flex h-11 items-center gap-2 rounded-xl bg-cyan-300 px-6 text-sm font-semibold text-[#06081c] shadow-[0_8px_24px_-8px_rgba(34,211,238,0.6)] transition hover:bg-cyan-200","data-testid":"link-dashboard",children:["Open dashboard ",n.jsx(px,{className:"h-4 w-4"})]}),n.jsx("p",{className:"mt-6 font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"Manage billing anytime from the dashboard"})]})]})}const L0="28 Wellfield Road, SW16 2BE",bc=e=>new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",maximumFractionDigits:0}).format(e),hF=["Refurbishment","Single-storey extension","New build","Class E conversion"],Gu={Refurbishment:{build:275e3,fees:33e3,contingency:30800,total:338800},"Single-storey extension":{build:95e3,fees:11400,contingency:10640,total:117040},"New build":{build:54e4,fees:64800,contingency:60480,total:665280},"Class E conversion":{build:36e4,fees:43200,contingency:40320,total:443520}};function pF(){_i();const[e,t]=w.useState("pro"),[s,r]=w.useState("account"),[o,c]=w.useState("ready"),[d,h]=w.useState(!0),[p,f]=w.useState(!0),[m,x]=w.useState(!0),[y,v]=w.useState("");return n.jsxs("div",{className:"min-h-screen bg-slate-950 text-white",children:[n.jsx("div",{className:"sticky top-0 z-30 border-b border-white/10 bg-slate-950/95 backdrop-blur",children:n.jsxs("div",{className:"mx-auto flex max-w-[1400px] flex-wrap items-center gap-4 px-6 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("img",{src:_n,alt:"Scapely",className:"h-3.5 w-auto select-none"}),n.jsx("span",{className:"rounded-full border border-white/10 bg-white/5 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-300",children:"Extension preview"})]}),n.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-3 text-[11px]",children:[n.jsx(pc,{label:"Tier",children:["free","pro","enterprise"].map(j=>n.jsx(oi,{active:e===j,onClick:()=>t(j),"data-testid":`btn-tier-${j}`,children:j},j))}),n.jsx(pc,{label:"AI",children:["loading","ready"].map(j=>n.jsx(oi,{active:o===j,onClick:()=>c(j),"data-testid":`btn-ai-${j}`,children:j},j))}),n.jsxs(pc,{label:"Free scans",children:[n.jsx(oi,{active:d,onClick:()=>h(!0),"data-testid":"btn-scans-available",children:"2 left"}),n.jsx(oi,{active:!d,onClick:()=>h(!1),"data-testid":"btn-scans-exhausted",children:"0 left"})]}),n.jsx(pc,{label:"Popup",children:[["account","Account"],["auth-signin","Sign in"],["auth-signup","Sign up"]].map(([j,k])=>n.jsx(oi,{active:s===j,onClick:()=>r(j),"data-testid":`btn-popup-${j}`,children:k},j))}),n.jsxs(pc,{label:"Show",children:[n.jsx(oi,{active:p,onClick:()=>f(j=>!j),"data-testid":"btn-toggle-sidebar",children:"Sidebar"}),n.jsx(oi,{active:m,onClick:()=>x(j=>!j),"data-testid":"btn-toggle-popup",children:"Popup"})]})]})]})}),n.jsxs("div",{className:"mx-auto max-w-[1400px] px-6 py-8",children:[n.jsxs("div",{className:"overflow-hidden rounded-xl border border-white/10 bg-zinc-900 shadow-[0_30px_80px_-30px_rgba(0,0,0,0.7)]",children:[n.jsx(BN,{popupOpen:m,onTogglePopup:()=>x(j=>!j)}),n.jsxs("div",{className:"relative bg-[#f6f7f9] text-slate-900",children:[n.jsx(IN,{}),p&&n.jsx("div",{className:"absolute right-4 top-4 z-10",children:n.jsx(Ay,{tier:e,aiPhase:o,scansAvailable:d,manualAddress:y,onManualAddressChange:v,onClose:()=>f(!1)})}),m&&n.jsx("div",{className:"absolute right-[60px] top-2 z-20",children:n.jsx(fF,{view:s,tier:e,onSwitch:r})})]})]}),n.jsxs("p",{className:"mt-4 text-center text-[11px] text-slate-500",children:["Visual preview of the Chrome extension popup & injected sidebar. Source files:"," ",n.jsx("code",{className:"font-mono text-slate-400",children:"artifacts/chrome-extension/src/popup/Popup.tsx"})," ","and"," ",n.jsx("code",{className:"font-mono text-slate-400",children:"artifacts/chrome-extension/src/contentScript/Sidebar.tsx"}),"."]})]})]})}function pc({label:e,children:t}){return n.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-white/10 bg-white/[0.03] px-2 py-1",children:[n.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wider text-slate-500",children:e}),n.jsx("div",{className:"flex items-center gap-1",children:t})]})}function oi({active:e,onClick:t,children:s,...r}){return n.jsx("button",{type:"button",onClick:t,className:`rounded-md px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider transition ${e?"bg-cyan-300 text-slate-950":"text-slate-400 hover:text-white"}`,...r,children:s})}function BN({popupOpen:e,onTogglePopup:t}){return n.jsxs("div",{className:"select-none bg-zinc-800 text-zinc-300",children:[n.jsxs("div",{className:"flex items-end gap-2 px-3 pt-2",children:[n.jsx("div",{className:"flex h-8 w-3 items-end",children:n.jsx("div",{className:"h-full w-3 rounded-tl-md bg-zinc-700"})}),n.jsxs("div",{className:"flex h-8 min-w-0 max-w-[280px] flex-1 items-center gap-2 rounded-t-md bg-zinc-700 px-3",children:[n.jsx("div",{className:"h-3.5 w-3.5 rounded-sm bg-emerald-500/90"}),n.jsx("span",{className:"truncate text-[11px] text-zinc-200",children:"3-bed terraced house for sale - Rightmove"}),n.jsx(Ar,{className:"ml-auto h-3 w-3 opacity-60"})]}),n.jsx("div",{className:"h-8 w-3"})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-zinc-700 px-3 py-2",children:[n.jsx(_r,{className:"h-4 w-4 opacity-60"}),n.jsx(Gh,{className:"h-4 w-4 opacity-30"}),n.jsx(R7,{className:"h-3.5 w-3.5 opacity-60"}),n.jsxs("div",{className:"ml-2 flex h-7 flex-1 items-center gap-2 rounded-full bg-zinc-800 px-3 text-[11px] text-zinc-400",children:[n.jsx(wx,{className:"h-3 w-3 text-emerald-400"}),n.jsx("span",{className:"truncate",children:"rightmove.co.uk/properties/152384725#/?channel=RES_BUY"})]}),n.jsx("button",{type:"button",onClick:t,className:`ml-1 flex h-7 w-7 items-center justify-center rounded-md transition ${e?"bg-zinc-600":"hover:bg-zinc-600/60"}`,"aria-label":"Scapely","data-testid":"btn-toolbar-scapely",children:n.jsx("img",{src:ol,alt:"Scapely",className:"h-4 w-4 roun
372ded-full"})}),n.jsx("div",{className:"h-6 w-6 rounded-full bg-fuchsia-500/40"})]})]})}function IN(){return n.jsxs("div",{className:"min-h-[860px] px-10 py-8",children:[n.jsxs("div",{className:"mb-6 flex items-center justify-between border-b border-slate-200 pb-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"rounded-md bg-[#00deb6] px-3 py-1 font-bold tracking-tight text-slate-900",children:"Rightmove"}),n.jsx("span",{className:"text-[12px] text-slate-500",children:"Buy · Rent · House Prices · Find Agent"})]}),n.jsxs("div",{className:"flex items-center gap-3 text-[12px] text-slate-600",children:[n.jsx(t7,{className:"h-4 w-4"}),n.jsx(B7,{className:"h-4 w-4"}),n.jsx("span",{children:"Sign in"})]})]}),n.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-2",children:[n.jsx("div",{className:"col-span-2 flex h-[320px] items-center justify-center rounded-lg bg-gradient-to-br from-slate-300 via-slate-400 to-slate-500 text-white/70",children:n.jsx(S8,{className:"h-8 w-8"})}),n.jsxs("div",{className:"grid grid-rows-2 gap-2",children:[n.jsx("div",{className:"rounded-lg bg-gradient-to-br from-amber-200 to-amber-400"}),n.jsx("div",{className:"rounded-lg bg-gradient-to-br from-emerald-200 to-emerald-400"})]})]}),n.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[28px] font-bold text-slate-900",children:"£475,000"}),n.jsx("div",{className:"text-[14px] text-slate-600",children:"3 bedroom terraced house for sale"}),n.jsx("div",{className:"mt-1 text-[13px] text-slate-500",children:"Wellfield Road, Streatham, London SW16"})]}),n.jsx("button",{type:"button",className:"rounded-full bg-[#00deb6] px-6 py-2 text-[13px] font-semibold text-slate-900",children:"Contact agent"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 text-[12px] text-slate-700",children:[n.jsx(fc,{label:"PROPERTY TYPE",value:"Terraced house"}),n.jsx(fc,{label:"BEDROOMS",value:"× 3"}),n.jsx(fc,{label:"BATHROOMS",value:"× 1"}),n.jsx(fc,{label:"SIZE",value:"1,012 sq ft / 94 sq m"}),n.jsx(fc,{label:"COUNCIL TAX",value:"Band C"})]}),n.jsxs("div",{className:"mt-6 space-y-2",children:[n.jsx("h2",{className:"text-[15px] font-semibold text-slate-800",children:"Property description"}),["A beautifully presented three-bedroom Victorian terraced house, ideally located moments from Streatham Common station.","The property comprises a bright through reception, modern kitchen with bi-fold doors opening onto a low-maintenance garden, and three well-proportioned bedrooms.","Further benefits include a family bathroom, gas central heating and an excellent EPC rating with planning potential subject to consents."].map(e=>n.jsx("p",{className:"leading-relaxed text-slate-600",children:e},e))]})]})}function fc({label:e,value:t}){return n.jsxs("div",{className:"rounded-md border border-slate-200 bg-white p-3",children:[n.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-400",children:e}),n.jsx("div",{className:"mt-0.5 text-[14px] font-medium text-slate-800",children:t})]})}function fF({view:e,tier:t,onSwitch:s}){const r=e==="account";return n.jsx("div",{className:"w-[340px] overflow-hidden rounded-xl border border-white/10 bg-slate-950 text-white shadow-[0_30px_60px_-15px_rgba(0,0,0,0.55)]","data-testid":"scapely-popup",children:n.jsxs("div",{className:"p-5",children:[n.jsxs("div",{className:"mb-5 flex items-center gap-2",children:[n.jsx("img",{src:_n,alt:"Scapely",className:"h-[14px] w-auto select-none",draggable:!1}),n.jsx(mF,{status:r?"live":"offline"})]}),e==="account"?n.jsx(xF,{tier:t}):n.jsx(gF,{mode:e==="auth-signup"?"signup":"signin",onSwitch:s})]})})}function mF({status:e}){return e==="live"?n.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 rounded-full border border-emerald-400/40 bg-emerald-400/15 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-emerald-300","data-testid":"badge-status",children:[n.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[n.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-70"}),n.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-400"})]}),"Live"]}):n.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 rounded-full border border-white/10 bg-white/5 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-400","data-testid":"badge-status",children:[n.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-slate-500"}),"Offline"]})}function gF({mode:e,onSwitch:t}){return n.jsxs(n.Fragment,{children:[n.jsx("h2",{className:"text-base font-semibold tracking-tight",children:e==="signin"?"Sign in":"Create account"}),n.jsx("p",{className:"mt-1 text-[13px] text-slate-400",children:e==="signin"?"Sign in to enable property appraisals on listings.":"Free account — instant access to overlays on UK portals."}),n.jsxs("div",{className:"mt-4 space-y-3",children:[n.jsx(bj,{icon:n.jsx(kk,{className:"h-4 w-4"}),placeholder:"[email protected]"}),n.jsx(bj,{icon:n.jsx(Aa,{className:"h-4 w-4"}),placeholder:"Password"}),n.jsx("button",{type:"button",className:"inline-flex h-10 w-full items-center justify-center gap-2 rounded-lg bg-cyan-300 text-[13px] font-semibold text-slate-950 transition hover:bg-cyan-200",children:e==="signin"?"Sign in":"Create account"})]}),n.jsx("button",{type:"button",onClick:()=>t(e==="signin"?"auth-signup":"auth-signin"),className:"mt-4 w-full text-center text-[12px] text-slate-400 hover:text-slate-200",children:e==="signin"?"New to Scapely? Create an account →":"Have an account? Sign in →"})]})}function xF({tier:e}){return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.03] p-3.5",children:[n.jsx("div",{className:"text-[11px] uppercase tracking-wider text-slate-400",children:"Signed in as"}),n.jsx("div",{className:"mt-0.5 truncate text-sm font-medium text-white",children:"[email protected]"}),n.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] uppercase tracking-wider text-slate-400",children:"Plan"}),n.jsx(yF,{tier:e})]})]}),e==="free"&&n.jsxs("a",{className:"mt-3 inline-flex h-10 w-full items-center justify-center gap-1.5 rounded-lg bg-gradient-to-r from-cyan-400 to-fuchsia-500 text-[13px] font-semibold text-slate-950 transition hover:opacity-90",href:"#",children:["Unlock Pro for £29/mo",n.jsx(In,{className:"h-3.5 w-3.5"})]}),n.jsxs("a",{href:"#",className:"mt-2 inline-flex h-10 w-full items-center justify-center gap-1.5 rounded-lg border border-white/15 bg-white/5 text-[13px] font-medium text-slate-200 transition hover:bg-white/10",children:["Open dashboard",n.jsx(In,{className:"h-3.5 w-3.5"})]}),n.jsxs("button",{type:"button",className:"mt-2 inline-flex h-9 w-full items-center justify-center gap-1.5 rounded-lg text-[12px] text-slate-400 hover:text-white",children:[n.jsx(Qh,{className:"h-3.5 w-3.5"}),"Sign out"]}),n.jsx("p",{className:"mt-4 text-center text-[11px] text-slate-500",children:"Open any UK property listing to see the Scapely sidebar."})]})}function yF({tier:e}){return e==="enterprise"?n.jsx("span",{className:"rounded-full bg-amber-300 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-950",children:"Enterprise"}):e==="pro"?n.jsx("span",{className:"rounded-full bg-cyan-300 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-950",children:"Pro"}):n.jsx("span",{className:"rounded-full border border-white/15 bg-white/5 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-300",children:"Free"})}function bj({icon:e,placeholder:t}){return n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",children:e}),n.jsx("div",{className:"block h-10 w-full rounded-lg border border-white/10 bg-white/[0.03] pl-9 pr-3 text-[13px] text-slate-500 leading-[40px]",children:t})]})}function Ay({tier:e,aiPhase:t,scansAvailable:s,manualAddress:r,onManualAddressChange:o,onClose:c,costMultiplier:d=1}){const h=r.trim(),p=h.length>0,f=p?h:L0,m=e==="pro"||e==="enterprise",x=e==="enterprise",y=t==="loading",v=e==="free"&&t==="ready",j=m||v,k=x||v,S=e==="free"&&!s,[N,C]=w.useState("Refurbishment");return n.jsxs("div",{className:"flex max-h-[820px] w-[340px] flex-col overflow-hidden rounded-2xl border border-white/10 bg-slate-950/95 text-white shadow-[0_30px_60px_-2
3720px_rgba(0,0,0,0.7)] backdrop-blur-xl","data-testid":"scapely-sidebar",children:[n.jsxs("div",{className:"flex items-center gap-3 border-b border-white/5 px-4 py-3.5",children:[n.jsx("img",{src:ol,alt:"Scapely",className:"h-7 w-7 flex-none select-none rounded-full",draggable:!1}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"truncate text-[13px] font-medium text-white","data-testid":"sidebar-address",children:f}),p&&n.jsx("span",{className:"flex-none rounded border border-amber-400/30 bg-amber-400/10 px-1.5 py-px font-mono text-[9px] uppercase tracking-wider text-amber-300",children:"Manual"})]}),p&&n.jsxs("div",{className:"truncate text-[10px] text-slate-500",children:["Auto: ",L0]})]}),c&&n.jsx("button",{type:"button",onClick:c,className:"flex h-6 w-6 flex-none items-center justify-center rounded text-slate-500 transition hover:bg-white/5 hover:text-white","aria-label":"Collapse",children:n.jsx(Ar,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-500",children:n.jsx(Ra,{className:"h-3.5 w-3.5"})}),n.jsx("input",{type:"text",value:r,onChange:E=>o(E.target.value),placeholder:`Search a different address (e.g. ${L0})`,className:"block h-9 w-full rounded-lg border border-white/10 bg-white/[0.04] pl-8 pr-16 text-[12px] text-white placeholder:text-slate-500 focus:border-emerald-400/40 focus:outline-none focus:ring-1 focus:ring-emerald-400/30","data-testid":"input-manual-address","aria-label":"Override auto-detected address"}),p&&n.jsx("button",{type:"button",onClick:()=>o(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded px-2 py-1 font-mono text-[9px] uppercase tracking-wider text-slate-400 transition hover:bg-white/5 hover:text-white","data-testid":"btn-reset-address",children:"Reset"})]}),n.jsx("p",{className:"mt-1 px-0.5 text-[10px] text-slate-500",children:p?"Manual address in use — clear to fall back to the page address":"Auto-detected from the page. Type to search a different address."})]}),n.jsx(D0,{label:"Property essentials"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[n.jsx(Ku,{icon:n.jsx(Zo,{className:"h-3.5 w-3.5"}),label:n.jsxs(n.Fragment,{children:["EPC",n.jsx("br",{}),"rating"]}),value:"D",sub:"Potential B"}),n.jsx(Ku,{icon:n.jsx(wx,{className:"h-3.5 w-3.5"}),label:n.jsxs(n.Fragment,{children:["Planning",n.jsx("br",{}),"constraints"]}),value:"2",sub:"Conservation area · Article 4"}),n.jsx(Ku,{icon:n.jsx(K8,{className:"h-3.5 w-3.5"}),label:n.jsxs(n.Fragment,{children:["Flood",n.jsx("br",{}),"risk"]}),value:"Zone 1",sub:"Very low — surface water",source:"Environment Agency · planning.data.gov.uk"}),n.jsx(Ku,{icon:n.jsx(jk,{className:"h-3.5 w-3.5"}),label:n.jsxs(n.Fragment,{children:["Heritage",n.jsx("br",{}),"status"]}),value:"Conservation",sub:"Streatham Common CA"})]}),n.jsxs("div",{className:"mt-2.5 space-y-1.5 rounded-xl border border-white/5 bg-white/[0.03] px-3 py-2.5",children:[n.jsx(vj,{label:"Conservation area",value:"Streatham Common CA"}),n.jsx(vj,{label:"Article 4 direction",value:"HMO conversions restricted"})]}),m?n.jsx(bF,{}):t==="ready"?null:S?n.jsx(wF,{}):n.jsx(vF,{scansRemaining:2,loading:y}),n.jsx(D0,{label:"Investor intelligence",tier:"pro",locked:!j}),n.jsxs(Wu,{title:"Cost estimator",icon:n.jsx(an,{className:"h-3.5 w-3.5"}),locked:!j,loading:j&&y,children:[n.jsx(jF,{value:N,onChange:C,interactive:e==="pro"||e==="enterprise",locked:e==="free"}),n.jsx("div",{className:"mt-2.5",children:n.jsx(kF,{rows:[["Build cost",bc(Gu[N].build*d)],["Professional fees",bc(Gu[N].fees*d)],["Contingency",bc(Gu[N].contingency*d)],["Total estimate",bc(Gu[N].total*d)]],loading:j&&y})}),n.jsxs("p",{className:"mt-2 text-[10px] leading-snug text-slate-500",children:["Pricing the ",N.toLowerCase()," scenario. Build cost uses regional £/sqm benchmarks, +12% professional fees, +10% contingency."]})]}),n.jsx(Wu,{title:"Risk analyzer",icon:n.jsx(el,{className:"h-3.5 w-3.5"}),locked:!j,loading:j&&y,children:n.jsx(_F,{overall:"Medium",note:"Conservation area + Article 4 designation will require careful pre-app engagement. Recent comparable consents granted with conditions.",themes:["Massing & rear extension overlooking","Material palette for fenestration","Tree retention to neighbour boundary"],loading:j&&y})}),n.jsx(Wu,{title:"Locality signals",icon:n.jsx(bi,{className:"h-3.5 w-3.5"}),locked:!j,children:n.jsx(SF,{})}),n.jsx(D0,{label:"Commercial intelligence",tier:"enterprise",locked:!k}),n.jsx(Wu,{title:"Commercial & development",icon:n.jsx(Yh,{className:"h-3.5 w-3.5"}),locked:!k,lockTier:"enterprise",children:n.jsx(NF,{})})]}),n.jsxs("div",{className:"flex items-center justify-between border-t border-white/5 bg-white/[0.02] px-4 py-2.5",children:[n.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-slate-500",children:"Rev 0.1.2"}),n.jsxs("a",{href:"#",className:"inline-flex items-center gap-1 text-[10px] text-slate-400 hover:text-cyan-300",children:["scapely.io",n.jsx(In,{className:"h-2.5 w-2.5"})]})]})]})}function vj({label:e,value:t}){return n.jsxs("div",{className:"flex items-start gap-2 text-[11px]",children:[n.jsx("span",{className:"mt-1 inline-block h-1.5 w-1.5 flex-none rounded-full bg-cyan-400"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-500",children:e}),n.jsx("div",{className:"truncate text-slate-200",children:t})]})]})}function bF(){const[e,t]=w.useState(!1);return e?n.jsxs("div",{className:"mt-3.5 flex items-center justify-between gap-2 rounded-xl border border-emerald-300/30 bg-emerald-300/[0.06] px-3 py-2.5 text-[12px] text-emerald-100",children:[n.jsxs("span",{className:"inline-flex items-center gap-2 font-medium",children:[n.jsx(mx,{className:"h-3.5 w-3.5"})," Saved to watchlist"]}),n.jsxs("a",{href:"#",className:"inline-flex items-center gap-1 rounded-md border border-white/10 bg-white/5 px-2 py-1 font-mono text-[10px] uppercase tracking-wider text-emerald-100 transition hover:bg-white/10",children:["View ",n.jsx(In,{className:"h-3 w-3"})]})]}):n.jsx("div",{className:"mt-3.5",children:n.jsxs("button",{type:"button",onClick:()=>t(!0),className:"flex w-full items-center justify-center gap-2 rounded-xl border border-cyan-300/30 bg-cyan-400/10 px-3 py-2.5 text-[12px] font-semibold text-cyan-100 transition hover:bg-cyan-400/15",children:[n.jsx(V7,{className:"h-3.5 w-3.5"})," Add to Watchlist"]})})}function vF({scansRemaining:e,loading:t}){return n.jsx("div",{className:"mt-3.5",children:n.jsx("button",{type:"button",disabled:t,className:"flex w-full items-center justify-center gap-2 rounded-xl border border-cyan-300/30 bg-cyan-400/10 px-3 py-2.5 text-[12px] font-semibold text-cyan-100 transition hover:bg-cyan-400/15 disabled:opacity-60",children:t?n.jsxs(n.Fragment,{children:[n.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}),"Running deep dive…"]}):n.jsxs(n.Fragment,{children:[n.jsx(na,{className:"h-3.5 w-3.5"}),"Run AI Deep Dive",n.jsxs("span",{className:"font-mono text-[10px] opacity-70",children:["(",e," of 3 free)"]})]})})})}function wF(){return n.jsxs("div",{className:"mt-3.5 rounded-xl border border-fuchsia-400/30 bg-fuchsia-400/5 p-3 text-[12px] text-fuchsia-100",children:[n.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[n.jsx(Aa,{className:"h-3.5 w-3.5"})," Free scan limit reached"]}),n.jsx("p",{className:"mt-1 text-[11px] text-fuchsia-200/80",children:"You've used all 3 free development appraisals this month. Upgrade to run more."}),n.jsx("a",{href:"#",className:"mt-2.5 inline-flex h-8 items-center rounded-lg px-3 text-[11px] font-semibold text-white transition hover:opacity-90",style:{backgroundColor:"#4b4b4a"},children:"Unlock Pro for £29/mo"})]})}function D0({label:e,tier:t,locked:s}){const r=t==="enterprise"?"border-amber-400/30 bg-amber-400/10 text-amber-200":t==="pro"?"border-fuchsia-400/30 bg-fuchsia-400/10 text-fuchsia-200":"border-cyan-300/30 bg-cyan-300/10 text-cyan-200";return n.jsxs("div",{className:"mb-2 mt-4 flex items-center gap-2 first:mt-0",children:[n.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 font-mono text-[9px] uppercase tracking-wider ${r}`,children:[s&&n.jsx(Aa,{className:"h-2.5 w-2.5"}),e]}),n.jsx("span",{className:"h-px flex-1 bg-white/5"})]})}function Ku({icon:e,label:t,value:s,sub:r,source:o}){return n.jsxs("div",{className:"rounded-xl border border-white/5 bg-white/[0.03] p-3",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-slate-400",children:[n.jsx("span",{className:"text-cyan-300",children:e}),n.jsx("span",{children:t})]}),n.jsx("div",{className:"mt-1 text-[15px] font-semibold tracking-tight text-white",children:s}),r&&n.jsx("div",{className:"mt-0.5 text-[10px] text-slate-500",children:r}),o&&n.jsxs("div",{className:"mt-1 truncate text-[9px] text-slate-600",title:o,children:["↳ ",o]})]})}function wj({label:e,value:t,strong:s}){return n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-slate-400",children:e}),n.jsx("span",{className:s?"font-semibold text-white":"font-medium text-slate-200",children:t})]})}function Wu({title:e,icon:t,locked:s,lockTier:r,loading:o,children:c}){const d=r??"pro",h=d==="enterprise"?"Unlock Enterprise":"Unlock Pro for £29/mo",p=d==="enterprise"?"border-amber-400/30 bg-amber-400/10 text-amber-300":"border-fuchsia-400/30 bg-fuchsia-400/10 text-fuchsia-300";return n.jsxs("div",{className:"mt-3",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[n.jsx("span",{className:"text-cyan-300",children:t}),n.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-300",children:e}),o&&!s&&n.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 font-mono text-[9px] uppercase tracking-wider text-cyan-300/80",children:["Analyzing",n.jsx(Me,{className:"h-3 w-3 animate-spin"})]}),s&&n.jsxs("span",{className:`ml-auto inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider ${p}`,children:[n.jsx(Aa,{className:"h-2.5 w-2.5"}),d==="enterprise"?"Ent":"Pro"]})]}),n.jsxs("div",{className:"relative rounded-xl border border-white/5 bg-white/[0.02] p-3",children:[n.jsx("div",{className:s?"select-none blur-[6px]":"",children:c}),s&&n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 rounded-xl bg-slate-950/40 backdrop-blur-[2px]",children:[n.jsx(Aa,{className:d==="enterprise"?"h-4 w-4 text-amber-300":"h-4 w-4 text-fuchsia-300"}),n.jsx("a",{href:"#",className:"inline-flex h-8 items-center rounded-lg px-3 text-[11px] font-semibold text-white transition hover:opacity-90",style:{backgroundColor:"#4b4b4a"},children:h})]})]})]})}function $N({width:e="w-12"}){return n.jsx("span",{className:`inline-flex h-3 ${e} items-center overflow-hidden rounded bg-white/[0.06]`,children:n.jsx("span",{className:"block h-full w-full animate-pulse bg-gradient-to-r from-transparent via-cyan-400/30 to-transparent"})})}function Yu({width:e="w-full"}){return n.jsx("span",{className:`block h-2.5 ${e} overflow-hidden rounded bg-white/[0.06]`,children:n.jsx("span",{className:"block h-full w-full animate-pulse bg-gradient-to-r from-transparent via-cyan-400/30 to-transparent"})})}
372function jF({value:e,onChange:t,interactive:s,locked:r}){return n.jsxs("div",{children:[n.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[n.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500",children:"Project scenario"}),r&&n.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-[9px] uppercase tracking-wider text-fuchsia-300/80",children:[n.jsx(Aa,{className:"h-2.5 w-2.5"})," Pro switches"]})]}),n.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:hF.map(o=>{const c=o===e;return n.jsx("button",{type:"button",onClick:()=>{s&&!c&&t(o)},disabled:!s,"aria-pressed":c,className:`rounded-lg border px-2 py-1.5 text-left text-[10.5px] leading-tight transition ${c?"border-cyan-300/40 bg-cyan-300/10 text-cyan-100":"border-white/5 bg-white/[0.02] text-slate-400 hover:border-white/10 hover:text-slate-200"} ${s?"cursor-pointer":"cursor-default"}`,children:o},o)})})]})}function kF({rows:e,loading:t}){return n.jsx("div",{className:"space-y-2 text-[12px]",children:e.map(([s,r],o)=>{const c=o===e.length-1;return n.jsxs("div",{className:"flex items-baseline justify-between gap-3 border-b border-white/5 pb-1.5 last:border-0 last:pb-0",children:[n.jsx("span",{className:"text-slate-400",children:s}),t?n.jsx($N,{width:c?"w-16":"w-14"}):n.jsx("span",{className:c?"font-semibold text-white":"font-medium text-slate-200",children:r})]},s)})})}function _F({overall:e,note:t,themes:s,loading:r}){const o=r?3:s.length;return n.jsxs("div",{className:"space-y-2.5",children:[n.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[n.jsx("span",{className:"text-[12px] text-slate-400",children:"Overall risk"}),r?n.jsx($N,{width:"w-16"}):n.jsx("span",{className:"text-[12px] font-semibold text-white",children:e})]}),r?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(Yu,{}),n.jsx(Yu,{width:"w-11/12"}),n.jsx(Yu,{width:"w-9/12"})]}):n.jsx("p",{className:"text-[12px] leading-relaxed text-slate-300",children:t}),n.jsx("ul",{className:"space-y-1 text-[12px] text-slate-300",children:Array.from({length:o}).map((c,d)=>n.jsxs("li",{className:"flex items-baseline gap-1.5",children:[n.jsx("span",{className:"text-slate-500",children:"•"}),r?n.jsx(Yu,{width:"w-9/12"}):n.jsx("span",{children:s[d]})]},r?d:s[d]))})]})}function SF(){return n.jsxs("div",{className:"space-y-2 text-[12px]",children:[n.jsx(wj,{label:n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.jsx(bi,{className:"h-3 w-3 text-slate-500"})," HMO saturation"]}),value:"18% — Moderate density"}),n.jsx(wj,{label:n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.jsx(kx,{className:"h-3 w-3 text-slate-500"})," PTAL"]}),value:"4 — Good"}),n.jsxs("div",{className:"pt-1",children:[n.jsxs("div",{className:"mb-1 inline-flex items-center gap-1.5 text-[11px] text-slate-400",children:[n.jsx(J8,{className:"h-3 w-3 text-slate-500"})," Boundary"]}),n.jsx("ul",{className:"space-y-0.5 text-[12px] text-slate-300",children:n.jsx("li",{children:"• Possible shared driveway with No. 47"})})]})]})}function NF(){return n.jsxs("div",{className:"space-y-2.5 text-[12px]",children:[n.jsx(mc,{icon:n.jsx(Yh,{className:"h-3 w-3"}),label:"Class MA",value:"Eligible",note:"Commercial-to-residential PD permitted, subject to prior approval"}),n.jsx(mc,{icon:n.jsx($8,{className:"h-3 w-3"}),label:"CIL Zone B",value:"£180/sqm",note:"Community Infrastructure Levy charge"}),n.jsx(mc,{icon:n.jsx(kn,{className:"h-3 w-3"}),label:"MEES 2027",value:"At risk",note:"EPC D — requires upgrade to C before April 2027 to be lettable",warn:!0}),n.jsx(mc,{icon:n.jsx(p7,{className:"h-3 w-3"}),label:"BNG",value:"Medium",note:"10% biodiversity net gain achievable on plot"}),n.jsx(mc,{icon:n.jsx(Zh,{className:"h-3 w-3"}),label:"Business rates",value:`${bc(14500)}/yr`,note:"Estimated annual charge"})]})}function mc({icon:e,label:t,value:s,note:r,warn:o}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-slate-400",children:[n.jsx("span",{className:"text-slate-500",children:e}),t]}),n.jsx("span",{className:o?"font-semibold text-amber-300":"font-semibold text-white",children:s})]}),r&&n.jsx("p",{className:"mt-0.5 text-[10.5px] leading-snug text-slate-500",children:r})]})}function on({children:e,panelLabel:t="Scapely Panel preview",surface:s}){const{theme:r}=Da(),o=r==="light",[c,d]=w.useState(""),h=o?"mb-3 font-mono text-[11px] uppercase tracking-widest text-purple-700":"mb-3 font-mono text-[11px] uppercase tracking-widest text-purple-300";return n.jsxs("div",{className:"mx-auto grid w-full max-w-7xl grid-cols-1 gap-10 px-6 py-12 lg:grid-cols-[minmax(0,1fr)_380px]",children:[n.jsx("div",{className:"min-w-0",children:e}),n.jsx("aside",{className:"lg:relative",children:n.jsxs("div",{className:"lg:sticky lg:top-28",children:[n.jsx("p",{className:h,children:t}),n.jsx("div",{className:"flex justify-center lg:justify-start",children:n.jsx(Ay,{tier:"enterprise",aiPhase:"ready",scansAvailable:!0,manualAddress:c,onManualAddressChange:d,costMultiplier:.5})})]})})]})}function CF(){return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:ES()}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsxs("header",{className:"mb-10 border-b border-slate-200 pb-6",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:"Programmatic SEO · Council guides"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]",children:"UK council property development guides"}),n.jsxs("p",{className:"mt-4 max-w-3xl text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:["Live build-cost benchmarks, Article 4 status and Building Safety Gateway risk for ",nn.length," major UK councils. Pick a council to see how its planning regime affects HMO conversions, Class MA commercial-to-residential and permitted development."]})]}),n.jsx("ul",{className:"grid gap-4 sm:grid-cols-2",children:nn.map(e=>n.jsx("li",{children:n.jsxs(Be,{href:`/councils/${e.slug}`,className:"group block rounded-xl border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-5 shadow-sm transition hover:border-purple-500/50 hover:shadow-md","data-testid":`link-council-${e.slug}`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white group-hover:text-purple-700 dark:group-hover:text-purple-300",children:e.name}),n.jsx("span",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-500",children:e.region})]}),n.jsxs("p",{className:"mt-3 flex flex-wrap gap-2 font-mono text-[11px] uppercase tracking-wider",children:[n.jsx("span",{className:"rounded-md border border-slate-200 dark:border-white/10 bg-slate-50 dark:bg-white/[0.04] px-2 py-0.5 text-slate-700",children:e.gateway_status}),e.article_4_active&&n.jsx("span",{className:"rounded-md border border-fuchsia-300 bg-fuchsia-50 px-2 py-0.5 text-fuchsia-800",children:"Article 4"}),n.jsxs("span",{className:"rounded-md border border-slate-200 dark:border-white/10 bg-slate-50 dark:bg-white/[0.04] px-2 py-0.5 text-slate-700",children:["£",e.avg_build_cost_sqm,"/sqm"]})]})]})},e.slug))})]})})]})}const UN=w.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:rn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));
372UN.displayName="Card";const EF=w.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:rn("flex flex-col space-y-1.5 p-6",e),...t}));EF.displayName="CardHeader";const TF=w.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:rn("font-semibold leading-none tracking-tight",e),...t}));TF.displayName="CardTitle";const AF=w.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:rn("text-sm text-muted-foreground",e),...t}));AF.displayName="CardDescription";const HN=w.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:rn("p-6 pt-0",e),...t}));HN.displayName="CardContent";const RF=w.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:rn("flex items-center p-6 pt-0",e),...t}));RF.displayName="CardFooter";function cd(){return n.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:n.jsx(UN,{className:"w-full max-w-md mx-4",children:n.jsxs(HN,{className:"pt-6",children:[n.jsxs("div",{className:"flex mb-4 gap-2",children:[n.jsx(en,{className:"h-8 w-8 text-red-500"}),n.jsx("h1",{className:"text-[17px] font-bold text-gray-900",children:"404 Page Not Found"})]}),n.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function OF(){const[,e]=Hh("/councils/:slug"),t=e?.slug??"",s=up(t);if(!s)return n.jsx(cd,{});const r=s.article_4_active;return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:TS(s)}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsxs("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:["Council guide · ",s.region]}),n.jsxs("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-council-name",children:["Property Development in ",s.name]}),n.jsxs("p",{className:"mt-4 text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:[s.name," sits in the ",s.region," and operates a"," ",n.jsx("strong",{className:"text-slate-900 dark:text-white",children:s.gateway_status})," ","Building Safety regime — meaning fire-safety scrutiny scales with building height and use class."]}),n.jsxs("div",{className:"mt-8 grid gap-3 sm:grid-cols-3",children:[n.jsx(B0,{label:"Avg build cost",value:`£${s.avg_build_cost_sqm}/sqm`}),n.jsx(B0,{label:"Building Safety",value:s.gateway_status}),n.jsx(B0,{label:"Article 4",value:r?"Active":"Inactive",tone:r?"warn":"ok"})]}),n.jsx(I0,{title:"Build cost benchmark",children:n.jsxs("p",{children:["The Scapely cost model puts the typical build cost in"," ",s.name," at"," ",n.jsxs("strong",{className:"text-slate-900 dark:text-white",children:["£",s.avg_build_cost_sqm,"/sqm"]})," ","for a standard residential conversion or new-build, before professional fees and contingency. Use this as a rule-of-thumb when stress-testing a deal — Scapely Pro produces a per-property estimate from CIL, footprint and access constraints."]})}),n.jsx(I0,{title:"Article 4 directions",children:n.jsx("p",{children:r?n.jsxs(n.Fragment,{children:[n.jsxs("strong",{className:"text-slate-900 dark:text-white",children:["Article 4 directions are active in ",s.name,"."]})," ","Permitted development rights have been removed in defined zones, which means HMO conversions, office-to-resi schemes and other PD plays require a full planning application. Always check the council's Article 4 map before committing."]}):n.jsxs(n.Fragment,{children:[n.jsx("strong",{className:"text-slate-900 dark:text-white",children:s.name})," ","does not currently operate Article 4 directions on residential PD. HMO conversions and Class MA prior approval routes generally remain available, subject to the usual prior-approval criteria."]})})}),n.jsx(I0,{title:`Strategies for ${s.name}`,children:n.jsx("ul",{className:"grid gap-3 sm:grid-cols-2",children:Pa.map(o=>n.jsx("li",{children:n.jsxs(Be,{href:`/councils/${s.slug}/strategies/${o.slug}`,className:"group block rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-4 shadow-sm transition hover:border-purple-500/50 hover:shadow-md","data-testid":`link-strategy-${o.slug}`,children:[n.jsxs("span",{className:"block text-sm font-semibold text-slate-900 dark:text-white group-hover:text-purple-700 dark:group-hover:text-purple-300",children:[o.title," in ",s.name]}),n.jsx("span",{className:"mt-1 block text-xs text-slate-500",children:o.intent})]})},o.slug))})}),n.jsx(PF,{councilName:s.name})]})})]})}function B0({label:e,value:t,tone:s="neutral"}){const r=s==="warn"?"border-fuchsia-300 bg-fuchsia-50 text-fuchsia-900":s==="ok"?"border-emerald-300 bg-emerald-50 text-emerald-900":"border-slate-200 bg-white text-slate-900 shadow-sm";return n.jsxs("div",{className:`rounded-xl border p-4 ${r}`,children:[n.jsx("p",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-600",children:e}),n.jsx("p",{className:"mt-1 text-lg font-semibold",children:t})]})}function I0({title:e,children:t}){return n.jsxs("section",{className:"mt-10",children:[n.jsx("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:e}),n.jsx("div",{className:"mt-3 space-y-3 text-sm text-slate-700 dark:text-slate-300 sm:text-base",children:t})]})}function PF({councilName:e}){return n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsxs("h3",{className:"text-lg font-semibold text-slate-900",children:["Appraise any ",e," property in seconds"]}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:"Search any address on the Scapely dashboard — build cost, planning risk, EPC uplift and owner intel in one screen. Free 3 development appraisals per month, no card required."}),n.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[n.jsx(Be,{href:"/dashboard",className:"inline-flex h-9 items-center rounded-lg border border-slate-900 bg-slate-900 px-4 text-[13px] font-semibold text-white hover:bg-slate-800","data-testid":"link-cta-dashboard",children:"Open dashboard"}),n.jsx(Be,{href:"/pricing",className:"inline-flex h-9 items-center rounded-lg px-4 text-[13px] font-semibold text-slate-700 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white","data-testid":"link-cta-pricing",children:"See pricing →"})]})]})}function MF(){return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:AS()}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsxs("header",{className:"mb-10 border-b border-slate-200 pb-6",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:"Programmatic SEO · Strategy playbooks"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]",children:"UK property development strategies"}),n.jsx("p",{className:"mt-4 max-w-3xl text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:"Practical playbooks for the four highest-ROI development strategies in the UK market. Each guide covers the planning route, the typical numbers and the most common reasons schemes get refused."})]}),n.jsx("ul",{className:"grid gap-4 sm:grid-cols-2",children:Pa.map(e=>n.jsx("li",{children:n.jsxs(Be,{href:`/strategies/${e.slug}`,className:"group block rounded-xl border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-5 shadow-sm transition hover:border-purple-500/50 hover:shadow-md","data-testid":`link-strategy-${e.slug}`,children:[n.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white group-hover:text-purple-700 dark:group-hover:text-purple-300",children:e.title}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:e.intent}),n.jsxs("p",{className:"mt-3 font-mono text-[11px] uppercase tracking-wider text-purple-700 dark:text-purple-400",children:["Powered by ",e.feature_upsell]})]})},e.slug))})]})})]})}function LF(){const[,e]=Hh("/strategies/:slug"),t=e?.slug??"",s=hp(t);return s?n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:RS(s)}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:"Strategy playbook"}),n.jsxs("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-strategy-title",children:[s.title," in the UK"]}),n.jsxs("p",{className:"mt-4 text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:[s.intent,". This guide walks through the planning route, the most common refusal reasons, and how Scapely's"," ",n.jsx("strong",{className:"text-slate-900 dark:text-white",children:s.feature_upsell})," ","de-risks the deal at scan-time."]}),n.jsxs("section",{className:"mt-10",children:[n.jsxs("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:[s.title," by council"]}),n.jsxs("p",{className:"mt-3 text-sm text-slate-700 dark:text-slate-300 sm:text-base",children:["The viability of ",Ta(s.title)," swings sharply with local Article 4 designations, Gateway status and build cost. See council-specific guidance below:"]}),n.jsx("ul",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:nn.map(r=>n.jsx("li",{children:n.jsxs(Be,{href:`/councils/${r.slug}/strategies/${s.slug}`,className:"group block rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-4 shadow-sm transition hover:border-purple-500/50 hover:shadow-md","data-testid":`link-council-${r.slug}`,children:[n.jsxs("span",{className:"block text-sm font-semibold text-slate-900 dark:text-white group-hover:text-purple-700 dark:group-hover:text-purple-300",children:[s.title," in ",r.name]}),n.jsxs("span",{className:"mt-1 block font-mono text-[11px] uppercase tracking-wider text-slate-500",children:["£",r.avg_build_cost_sqm,"/sqm · ",r.gateway_status,r.article_4_active?" · Article 4":""]})]})},r.slug))})]}),n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsxs("h3",{className:"text-lg font-semibold text-slate-900",children:["Try ",s.title," viability live"]}),n.jsxs("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:["Run a property listing through the Scapely Panel to see if"," ",Ta(s.title)," stack up — free 3 scans/month."]}),n.jsx(Be,{href:"/pricing",className:"mt-4 inline-flex h-9 items-center rounded-lg border border-slate-900 bg-slate-900 px-4 text-[13px] font-semibold text-white hover:bg-slate-800","data-testid":"link-cta-pricing",children:"See pricing"})]})]})})]}):n.jsx(cd,{})}function DF(){const[,e]=Hh("/councils/:council/strategies/:strategy"),t=up(e?.council??""),s=hp(e?.strategy??"");return!t||!s?n.jsx(cd,{}):n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:OS(t,s)}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsxs("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:[s.title," · ",t.region]}),n.jsxs("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-council-strategy-heading",children:[s.title," in ",t.name]}),n.jsxs("p",{className:"mt-4 text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:[s.intent," — applied to ",t.name,". With"," ",n.jsx("strong",{className:"text-slate-900 dark:text-white",children:t.gateway_status})," ","Building Safety scrutiny and an average build cost of"," ",n.jsxs("strong",{className:"text-slate-900 dark:text-white",children:["£",t.avg_build_cost_sqm,"/sqm"]}),", the deal arithmetic for ",Ta(s.title)," here is distinct from neighbouring boroughs."]}),n.jsxs("section",{className:"mt-10 rounded-xl border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-6 shadow-sm",children:[n.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Local planning context"}),n.jsx("p",{className:"mt-3 text-sm text-slate-700 dark:text-slate-300 sm:text-base",children:t.article_4_active?n.jsxs(n.Fragment,{children:[n.jsx("strong",{className:"text-fuchsia-700",children:"Heads up:"})," ",t.name," operates Article 4 directions, so"," ",Ta(s.title)," that would normally be permitted development will likely require a full planning application here. Build that into your timeline and risk model."]}):n.jsxs(n.Fragment,{children:[t.name," does not currently operate Article 4 on residential PD, so ",Ta(s.title)," can proceed via the standard prior-approval route in most cases."]})})]}),n.jsxs("section",{className:"mt-8",children:[n.jsx("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:"How Scapely helps"}),n.jsxs("p",{className:"mt-3 text-sm text-slate-700 dark:text-slate-300 sm:text-base",children:["Run any ",t.region," listing through the Scapely Panel to get a property-specific build cost, council objection-risk score and the"," ",n.jsx("strong",{className:"text-slate-900 dark:text-white",children:s.feature_upsell})," ","overlay applied to ",t.name,"'s policy environment."]})]}),n.jsxs("div",{className:"mt-12 flex flex-wrap gap-3 border-t border-slate-200 pt-6 font-mono text-[12px] uppercase tracking-wider",children:[n.jsxs(Be,{href:`/strategies/${s.slug}`,className:"text-purple-700 hover:text-purple-900","data-testid":"link-back-strategy",children:["← More on ",s.title]}),n.jsxs(Be,{href:`/councils/${t.slug}`,className:"text-purple-700 hover:text-purple-900","data-testid":"link-back-council",children:["← More on ",t.name]})]}),n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Appraise any property in seconds"}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:"Search any UK address on the Scapely dashboard — free 3 development appraisals per month, no card required."}),n.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[n.jsx(Be,{href:"/dashboard",className:"inline-flex h-9 items-center rounded-lg border border-slate-900 bg-slate-900 px-4 text-[13px] font-semibold text-white hover:bg-slate-800","data-testid":"link-cta-dashboard",children:"Open dashboard"}),n.jsx(Be,{href:"/pricing",className:"inline-flex h-9 items-center rounded-lg px-4 text-[13px] font-semibold text-slate-700 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white","data-testid":"link-cta-pricing",children:"See pricing →"})]})]})]})})]})}function BF(){return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:DS()}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:"Postcode hot-spots"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-postcodes-title",children:"UK Property Development Postcode Hot-Spots"}),n.jsxs("p",{className:"mt-4 text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:["The ",Ma.length," postcode districts where the highest-volume UK property-development activity is happening right now — covering inner-London regeneration zones, regional city centres and the established HMO and student belts."]}),n.jsx("ul",{className:"mt-10 grid gap-3 sm:grid-cols-2",children:Ma.map(e=>n.jsx("li",{children:n.jsxs(Be,{href:`/postcodes/${e.code.toLowerCase()}`,className:"group block rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-4 shadow-sm transition hover:border-purple-500/50 hover:shadow-md","data-testid":`link-postcode-${e.code.toLowerCase()}`,children:[n.jsxs("span",{className:"block text-sm
372 font-semibold text-slate-900 dark:text-white group-hover:text-purple-700 dark:group-hover:text-purple-300",children:[e.code," — ",e.area]}),n.jsxs("span",{className:"mt-1 block text-[12px] text-slate-500",children:[e.city," · ",e.region]}),n.jsxs("span",{className:"mt-2 block font-mono text-[11px] uppercase tracking-wider text-slate-500",children:["£",(e.avg_property_value_gbp/1e3).toFixed(0),"k avg ·"," ",e.avg_yield_pct,"% yield"]})]})},e.code))})]})})]})}function IF(){const[,e]=Hh("/postcodes/:code"),t=e?.code??"",s=UD(t);if(!s)return n.jsx(cd,{});const r=up(s.council_slug),o=s.hot_strategies.map(c=>hp(c)).filter(c=>!!c);return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:BS(s)}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsxs("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:["Postcode hot-spot · ",s.region]}),n.jsxs("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-postcode-title",children:[s.code," ",s.area]}),n.jsxs("p",{className:"mt-4 text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:[s.code," covers ",s.area," in ",s.city,"."," ",s.character,"."]}),n.jsxs("section",{className:"mt-10 grid gap-4 sm:grid-cols-3",children:[n.jsxs("div",{className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-4 shadow-sm",children:[n.jsx("p",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"Avg property value"}),n.jsxs("p",{className:"mt-1 text-2xl font-semibold text-slate-900",children:["£",(s.avg_property_value_gbp/1e3).toFixed(0),"k"]})]}),n.jsxs("div",{className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-4 shadow-sm",children:[n.jsx("p",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"Indicative gross yield"}),n.jsxs("p",{className:"mt-1 text-2xl font-semibold text-slate-900",children:[s.avg_yield_pct,"%"]})]}),n.jsxs("div",{className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-4 shadow-sm",children:[n.jsx("p",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"BSA Gateway"}),n.jsx("p",{className:"mt-1 text-2xl font-semibold text-slate-900",children:r?r.gateway_status:"—"})]})]}),r&&n.jsxs("section",{className:"mt-10",children:[n.jsx("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:"Local authority"}),n.jsxs(Be,{href:`/councils/${r.slug}`,className:"mt-3 block rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-5 shadow-sm transition hover:border-purple-500/50 hover:shadow-md","data-testid":`link-council-${r.slug}`,children:[n.jsx("span",{className:"block text-base font-semibold text-slate-900",children:r.name}),n.jsxs("span",{className:"mt-1 block font-mono text-[11px] uppercase tracking-wider text-slate-500",children:[r.gateway_status,r.article_4_active?" · Article 4 active":""," · £",r.avg_build_cost_sqm,"/sqm avg build cost"]})]})]}),o.length>0&&n.jsxs("section",{className:"mt-10",children:[n.jsxs("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:["Hot strategies in ",s.code]}),n.jsx("ul",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:o.map(c=>n.jsx("li",{children:n.jsxs(Be,{href:r?`/councils/${r.slug}/strategies/${c.slug}`:`/strategies/${c.slug}`,className:"group block rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-4 shadow-sm transition hover:border-purple-500/50 hover:shadow-md","data-testid":`link-strategy-${c.slug}`,children:[n.jsx("span",{className:"block text-sm font-semibold text-slate-900 dark:text-white group-hover:text-purple-700 dark:group-hover:text-purple-300",children:c.title}),n.jsx("span",{className:"mt-1 block text-[12px] text-slate-500",children:c.intent})]})},c.slug))})]}),n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsxs("h3",{className:"text-lg font-semibold text-slate-900",children:["Appraise any ",s.code," property in seconds"]}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:"Search any address on the Scapely dashboard — build cost, planning risk, HMO viability and owner intel in one screen. Free 3 development appraisals per month, no card required."}),n.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[n.jsx(Be,{href:"/dashboard",className:"inline-flex h-9 items-center rounded-lg border border-slate-900 bg-slate-900 px-4 text-[13px] font-semibold text-white hover:bg-slate-800","data-testid":"link-cta-dashboard",children:"Open dashboard"}),n.jsx(Be,{href:"/pricing",className:"inline-flex h-9 items-center rounded-lg px-4 text-[13px] font-semibold text-slate-700 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white","data-testid":"link-cta-pricing",children:"See pricing →"})]})]}),n.jsx("p",{className:"mt-8 text-sm text-slate-600",children:n.jsx(Be,{href:"/postcodes",className:"text-purple-700 underline-offset-4 hover:underline",children:"← All postcode hot-spots"})})]})})]})}function $F(){return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:PS()}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:"Reference"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-glossary-title",children:"UK Property Development Glossary"}),n.jsxs("p",{className:"mt-4 text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:["Plain-English definitions of the ",ji.length," terms property developers, investors and BTL landlords meet most often when underwriting UK deals."]}),n.jsx("dl",{className:"mt-10 space-y-6",children:ji.map(e=>n.jsxs("div",{id:e.slug,className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-5 shadow-sm","data-testid":`glossary-term-${e.slug}`,children:[n.jsx("dt",{className:"text-lg font-semibold text-slate-900",children:e.term}),n.jsx("dd",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300 sm:text-base",children:e.definition})]},e.slug))}),n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"See these terms in action"}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:"Scapely surfaces Article 4, Class MA, BSA Gateway and CIL data directly on Rightmove and Zoopla listings — no spreadsheet cross-referencing required."}),n.jsx("a",{href:"/pricing",className:"mt-4 inline-flex h-9 items-center rounded-lg border border-slate-900 bg-slate-900 px-4 text-[13px] font-semibold text-white hover:bg-slate-800","data-testid":"link-cta-pricing",children:"See pricing"})]})]})})]})}function UF(){return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:MS()}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:"Frequently asked"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-faq-title",children:"Scapely FAQ"}),n.jsx("p",{className:"mt-4 text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:"Qu
372ick answers to the questions buyers, developers and investors ask most about the Scapely dashboard — appraisals, planning, EPC and MEES, permitted development, owner intel and pricing."}),n.jsx("div",{className:"mt-10 space-y-5",children:pp.map((e,t)=>n.jsxs("details",{className:"group rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-5 shadow-sm open:shadow-md","data-testid":`faq-item-${t}`,children:[n.jsxs("summary",{className:"cursor-pointer list-none text-base font-semibold text-slate-900 dark:text-white sm:text-lg",children:[n.jsx("span",{className:"mr-2 text-purple-700 dark:text-purple-400",children:"+"}),e.question]}),n.jsx("p",{className:"mt-3 text-sm text-slate-700 dark:text-slate-300 sm:text-base",children:e.answer})]},t))}),n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Still have a question?"}),n.jsxs("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:["Email"," ",n.jsx("a",{href:"mailto:[email protected]",className:"text-purple-700 underline-offset-4 hover:underline",children:"[email protected]"})," ","and we'll come back to you."]})]})]})})]})}function HF(){return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:LS()}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:"Comparison"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-alternatives-title",children:"Scapely vs the alternatives"}),n.jsx("p",{className:"mt-4 text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:"Scapely is two things in one: the dashboard for in-depth property underwriting, and the Scapely Panel — a Chrome extension that overlays the same intelligence directly on portal listings. Here's an honest take on how the combination compares to the tools UK buyers, developers and investors most often evaluate alongside it."}),n.jsx("div",{className:"mt-10 space-y-6",children:SS.map(e=>n.jsxs("section",{className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-6 shadow-sm","data-testid":`alternative-${e.name.toLowerCase().replace(/\s+/g,"-")}`,children:[n.jsxs("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:["Scapely vs ",e.name]}),n.jsxs("dl",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[n.jsxs("div",{children:[n.jsx("dt",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"Positioning"}),n.jsx("dd",{className:"mt-1 text-sm text-slate-700 dark:text-slate-300",children:e.positioning})]}),n.jsxs("div",{children:[n.jsx("dt",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"Pricing"}),n.jsx("dd",{className:"mt-1 text-sm text-slate-700 dark:text-slate-300",children:e.pricing})]}),n.jsxs("div",{children:[n.jsx("dt",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-500",children:"Best for"}),n.jsx("dd",{className:"mt-1 text-sm text-slate-700 dark:text-slate-300",children:e.best_for})]})]}),n.jsxs("p",{className:"mt-4 text-sm text-slate-700 dark:text-slate-300 sm:text-base",children:[n.jsx("strong",{className:"text-slate-900 dark:text-white",children:"How they compare:"})," ",e.vs_scapely]})]},e.name))}),n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Try Scapely free"}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:"3 development appraisals a month, no card required. Use the dashboard for in-depth underwriting and install the Scapely Panel to triage any portal listing in seconds."}),n.jsx(Be,{href:"/pricing",className:"mt-4 inline-flex h-9 items-center rounded-lg border border-slate-900 bg-slate-900 px-4 text-[13px] font-semibold text-white hover:bg-slate-800","data-testid":"link-cta-pricing",children:"See pricing"})]})]})})]})}const qF=[{title:"Yield context",body:"Local rental comps and gross yield benchmarks by postcode, so you can sanity-check the asking price in seconds."},{title:"EPC rating & MEES exposure",body:"Current EPC plus the indicative regulatory uplift cost to hit the proposed minimum-C standard for new tenancies."},{title:"Planning risk",body:"Article 4 status, conservation area, listed-building flags and the local HMO licensing regime — surfaced before you pay for a survey."},{title:"Ownership intel",body:"Companies House director links, charges and registered owner history for property-holding entities (Pro and Enterprise)."},{title:"Verified tenure",body:"On-demand HM Land Registry Title Register lookup so freehold vs leasehold isn't a guess at the offer stage."},{title:"Flood risk",body:"Environment Agency Zone 1/2/3 classification — the same dataset lenders and insurers use to price the property."}],VF=[{title:"Buy-to-let & HMO conversions",href:"/strategies",blurb
372:"Article 4, mandatory licensing thresholds and room-yield modelling."},{title:"Class MA commercial-to-residential",href:"/strategies",blurb:"Office-to-resi via Permitted Development with prior-approval risk scoring."},{title:"Build-to-rent & PBSA",href:"/strategies",blurb:"Density, PTAL and policy-fit scoring for institutional rental schemes."},{title:"Title splitting & refurb-to-revalue",href:"/strategies",blurb:"Tenure restructuring and value-add refurb pipelines for portfolio investors."}];function zF(){return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:NS()}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700",children:[n.jsxs("header",{className:"mb-10 border-b border-slate-200 pb-6",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700",children:"For UK property investors"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 sm:text-[34px]","data-testid":"text-investors-title",children:"UK property investment intelligence — in one click"}),n.jsx("p",{className:"mt-4 max-w-3xl text-base text-slate-700 sm:text-lg",children:"Scapely gives UK property investors live due diligence on every listing — yield context, EPC rating, planning risk, ownership and tenure — pulled directly from official UK data sources. Built for buy-to-let, HMO, BTR and serviced-accommodation investors."})]}),n.jsxs("section",{className:"mt-10",children:[n.jsx("h2",{className:"text-xl font-semibold text-slate-900 sm:text-2xl",children:"Built for the way investors screen deals"}),n.jsx("p",{className:"mt-3 text-sm text-slate-700 sm:text-base",children:"Whether you run a buy-to-let portfolio, an HMO operation, a serviced-accommodation business or a build-to-rent vehicle, deal-screening time is the bottleneck. Scapely cuts a 30-minute manual lookup cycle to under 10 seconds per property — across Rightmove, Zoopla, OnTheMarket and the major auction houses."})]}),n.jsxs("section",{className:"mt-10",children:[n.jsx("h2",{className:"text-xl font-semibold text-slate-900 sm:text-2xl",children:"What investors see at a glance"}),n.jsx("ul",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:qF.map(e=>n.jsxs("li",{className:"rounded-lg border border-slate-200 bg-white p-4 shadow-sm",children:[n.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:e.title}),n.jsx("p",{className:"mt-1 text-sm text-slate-700",children:e.body})]},e.title))})]}),n.jsxs("section",{className:"mt-10",children:[n.jsx("h2",{className:"text-xl font-semibold text-slate-900 sm:text-2xl",children:"Investor strategies covered"}),n.jsx("ul",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:VF.map(e=>n.jsx("li",{children:n.jsxs(Be,{href:e.href,className:"group block rounded-lg border border-slate-200 bg-white p-4 shadow-sm transition hover:border-purple-500/50 hover:shadow-md","data-testid":`link-investor-strategy-${e.title.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,children:[n.jsx("span",{className:"block text-sm font-semibold text-slate-900 group-hover:text-purple-700",children:e.title}),n.jsx("span",{className:"mt-1 block text-sm text-slate-700",children:e.blurb})]})},e.title))})]}),n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Try Scapely on your next investment listing"}),n.jsx("p",{className:"mt-2 text-sm text-slate-700",children:"Free for the first 3 development appraisals every month. Pro is £29.99/month for 50 appraisals, Enterprise £59.99/month for 200."}),n.jsx(Be,{href:"/dashboard?mode=signup",className:"mt-4 inline-flex h-9 items-center rounded-full border border-slate-900 bg-transparent px-4 text-[13px] font-semibold text-slate-900 transition hover:bg-slate-900 hover:text-white active:scale-[0.98]","data-testid":"link-cta-signup",children:"Create account"})]})]})})]})}const FF=[{title:"EPC data",source:"EPC Open Data Communities",body:"Current and potential energy ratings, plus MEES uplift cost modelling for the proposed minimum-C standard."},{title:"Planning data",source:"planning.data.gov.uk",body:"Live planning history, Article 4 directions, conservation areas, listed buildings and local-plan policy designations."},{title:"Flood & environmental risk",source:"Environment Agency",body:"Flood-zone classification (Zone 1/2/3), plus heritage and protected-tree overlays."},{title:"Land data & geospatial",source:"Ordnance Survey, OpenStreetMap, postcodes.io, TfL",body:"Premium OS tiles, OSM context, PTAL scoring and postcode lookups underpin every Scapely map and metric."}
372,{title:"Ownership & corporate intel",source:"Companies House",body:"Director, PSC and charges data for property-holding entities — the standard discovery layer for off-market deals."},{title:"Title Register",source:"HM Land Registry",body:"On-demand £5 verified tenure lookup so freehold vs leasehold isn't a guess at the offer stage."},{title:"Build-cost benchmarks",source:"Scapely cost model",body:"Council-level £/sqm benchmarks reconciled against CIL rates and Building Safety Act exposure tier."}];function GF(){return n.jsxs(as,{surface:"light",children:[n.jsx(ps,{meta:CS()}),n.jsx(on,{surface:"light",children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsxs("header",{className:"mb-10 border-b border-slate-200 pb-6",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-slate-900 sm:text-purple-700 dark:text-purple-400",children:"UK property data"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white dark:text-white sm:text-[34px]","data-testid":"text-property-data-title",children:"UK property data — EPC, planning, flood, ownership & land data"}),n.jsx("p",{className:"mt-4 max-w-3xl text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:"Scapely aggregates the open UK property and land data sources every developer, investor and buyer needs into a single one-click overlay — so you stop tab-juggling between EPC registers, planning portals, flood maps and Land Registry."})]}),n.jsxs("section",{children:[n.jsx("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:"The UK property data we surface"}),n.jsx("ul",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:FF.map(e=>n.jsxs("li",{className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 p-4 shadow-sm",children:[n.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:e.title}),n.jsxs("p",{className:"mt-1 font-mono text-[11px] uppercase tracking-wider text-purple-700 dark:text-purple-400",children:["Source · ",e.source]}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:e.body})]},e.title))})]}),n.jsxs("section",{className:"mt-12",children:[n.jsx("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white sm:text-2xl",children:"Who uses Scapely's property data"}),n.jsx("p",{className:"mt-3 text-sm text-slate-700 dark:text-slate-300 sm:text-base",children:"UK property buyers, property investors, property developers, buy-to-let landlords, planning consultants and small house-builders use Scapely to cut deal-screening from half an hour to under ten seconds per listing."}),n.jsxs("div",{className:"mt-6 flex flex-wrap gap-3 text-[13px]",children:[n.jsx(Be,{href:"/investors",className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 px-3 py-2 text-slate-900 shadow-sm hover:border-purple-500/50","data-testid":"link-investors",children:"For investors →"}),n.jsx(Be,{href:"/strategies",className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 px-3 py-2 text-slate-900 shadow-sm hover:border-purple-500/50","data-testid":"link-strategies",children:"Development strategies →"}),n.jsx(Be,{href:"/councils",className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 px-3 py-2 text-slate-900 shadow-sm hover:border-purple-500/50","data-testid":"link-councils",children:"Council guides →"}),n.jsx(Be,{href:"/postcodes",className:"rounded-lg border border-slate-200 dark:border-white/10 bg-white dark:bg-white/5 px-3 py-2 text-slate-900 shadow-sm hover:border-purple-500/50","data-testid":"link-postcodes",children:"Postcode hot-spots →"})]})]}),n.jsxs("div",{className:"mt-12 rounded-xl border border-slate-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6",children:[n.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Run the full data set on your next listing"}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:"Free for the first 3 development appraisals every month. Pro unlocks 50 appraisals per month with exportable PDF reports."}),n.jsx(Be,{href:"/pricing",className:"mt-4 inline-flex h-9 items-center rounded-lg border border-slate-900 bg-slate-900 px-4 text-[13px] font-semibold text-white hover:bg-slate-800","data-testid":"link-cta-pricing",children:"See pricing"})]})]})})]})}const KF="[email protected]";function WF(){return n.jsxs(as,{children:[n.jsx(ps,{meta:{title:"Contact Scapely — Get in touch",description:"Get in touch with the Scapely team. Send us a message about product, sales, partnerships, press, or data requests.",canonical:"https://scapely.io/contact",ogImage:"/opengraph.jpg",jsonLd:{"@context":"https://schema.org","@type":"ContactPage",name:"Contact Scapely",url:"https://scapely.io/contact",mainEntity:{"@type":"Organization",name:"Scapely Ltd.",email:KF,url:"https://scapely.io"}}}}),n.jsxs("div",{className:"relative -mt-24 overflow-hidden pt-24 sm:-mt-28 sm:pt-28",children:[n.jsx(vp,{}),n.jsxs("article",{className:"relative mx-auto w-full max-w-3xl px-6 py-12 sm:py-16",children:[n.jsxs("header",{className:"mb-10 border-b border-slate-200 pb-6 dark:border-white/10",children:[n.jsx("p",{className:"font-mono text-[11px] uppercase tracking-wider text-slate-900 sm:text-cyan-700 dark:text-cyan-400",children:"Get in touch"}),n.jsx("h1",{className:"mt-2 text-[21px] font-semibold text-slate-900 dark:text-white sm:text-[25px]",children:"Contact us"})]}),n.jsx(YF,{}),n.jsxs("div",{className:"mt-12 space-y-8 text-[15px] leading-relaxed text-slate-600 dar
372k:text-slate-400",children:[n.jsx($0,{title:"What to write to us about",children:n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx(Xu,{title:"Product feedback",body:"Bug reports, feature requests, or anything that didn't quite work the way you expected."}),n.jsx(Xu,{title:"Sales & enterprise",body:"Multi-seat plans, custom data integrations, or volume pricing for development firms."}),n.jsx(Xu,{title:"Partnerships",body:"Data providers, planning consultancies, surveyors, brokers, and portals."}),n.jsx(Xu,{title:"Press & media",body:"Interviews, market commentary, and citation requests."})]})}),n.jsxs($0,{title:"Privacy and data requests",children:[n.jsx("p",{children:`For data subject requests under UK GDPR — access, erasure, rectification, or objection — please use the form above with the subject "Data request" and we'll respond within one calendar month, as required by law.`}),n.jsxs("p",{children:["See our"," ",n.jsx("a",{href:"/privacy",className:"text-cyan-700 underline-offset-2 hover:underline dark:text-cyan-400",children:"Privacy Policy"})," ","for full details on what we collect and why."]})]}),n.jsx($0,{title:"Company details",children:n.jsx("p",{children:"Scapely Ltd. is a company registered in England & Wales."})})]})]})]})]})}function YF(){const[e,t]=w.useState(""),[s,r]=w.useState(""),[o,c]=w.useState(""),[d,h]=w.useState(""),[p,f]=w.useState(""),[m,x]=w.useState({kind:"idle"}),y=m.kind==="submitting";async function v(j){if(j.preventDefault(),!y){x({kind:"submitting"});try{await lH({name:e,email:s,subject:o,message:d,company:p}),x({kind:"success"}),t(""),r(""),c(""),h(""),f("")}catch(k){x({kind:"error",message:k instanceof Error?k.message:"Could not send your message — please try again or email us directly."})}}}return m.kind==="success"?n.jsx("div",{role:"status","data-testid":"contact-form-success",className:"rounded-2xl border border-emerald-200 bg-emerald-50 p-6 text-emerald-700 dark:border-emerald-500/20 dark:bg-emerald-900/15 dark:text-emerald-400",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(Tr,{className:"mt-0.5 h-6 w-6 flex-none text-emerald-600 dark:text-emerald-400"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Message sent"}),n.jsx("p",{className:"mt-1 text-[15px] leading-relaxed",children:"Thanks for getting in touch. We'll reply to you within two working days."}),n.jsx("button",{type:"button",onClick:()=>x({kind:"idle"}),className:"mt-4 inline-flex items-center text-sm font-medium text-emerald-700 underline-offset-2 hover:underline dark:text-emerald-400",children:"Send another message"})]})]})}):n.jsxs("form",{onSubmit:v,className:"space-y-5 rounded-2xl border border-slate-200 bg-white p-6 shadow-sm sm:p-8 dark:border-white/10 dark:bg-white/5","data-testid":"contact-form",noValidate:!0,children:[n.jsxs("div",{className:"grid gap-5 sm:grid-cols-2",children:[n.jsx(Zu,{label:"Your name",htmlFor:"contact-name",required:!0,children:n.jsx("input",{id:"contact-name",name:"name",type:"text",required:!0,autoComplete:"name",value:e,onChange:j=>t(j.target.value),disabled:y,"data-testid":"input-contact-name",className:Qu,placeholder:"Jane Smith"})}),n.jsx(Zu,{label:"Email address",htmlFor:"contact-email",required:!0,children:n.jsx("input",{id:"contact-email",name:"email",type:"email",required:!0,autoComplete:"email",value:s,onChange:j=>r(j.target.value),disabled:y,"data-testid":"input-contact-email",className:Qu,placeholder:"[email protected]"})})]}),n.jsx(Zu,{label:"Subject",htmlFor:"contact-subject",required:!0,children:n.jsx("input",{id:"contact-subject",name:"subject",type:"text",required:!0,maxLength:200,value:o,onChange:j=>c(j.target.value),disabled:y,"data-testid":"input-contact-subject",className:Qu,placeholder:"What's this about?"})}),n.jsx(Zu,{label:"Message",htmlFor:"contact-message",required:!0,children:n.jsx("textarea",{id:"contact-message",name:"message",required:!0,minLength:10,maxLength:5e3,rows:6,value:d,onChange:j=>h(j.target.value),disabled:y,"data-testid":"input-contact-message",className:`${Qu} resize-y`,placeholder:"Tell us a bit about what you're working on or what you need."})}
372),n.jsxs("div",{"aria-hidden":!0,className:"absolute -left-[10000px] h-px w-px overflow-hidden",children:[n.jsx("label",{htmlFor:"contact-company",children:"Company (leave blank)"}),n.jsx("input",{id:"contact-company",name:"company",type:"text",tabIndex:-1,autoComplete:"off",value:p,onChange:j=>f(j.target.value)})]}),m.kind==="error"&&n.jsxs("div",{role:"alert","data-testid":"contact-form-error",className:"flex items-start gap-3 rounded-xl border border-rose-200 bg-rose-50 px-4 py-3 text-[14px] text-rose-700 dark:border-rose-500/20 dark:bg-rose-900/15 dark:text-rose-400",children:[n.jsx(en,{className:"mt-0.5 h-5 w-5 flex-none text-rose-500 dark:text-rose-400"}),n.jsx("span",{children:m.message})]}),n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"We'll only use your details to reply to this message."}),n.jsx("button",{type:"submit",disabled:y,"data-testid":"button-contact-submit",className:"inline-flex h-12 items-center justify-center gap-2 rounded-xl bg-primary px-6 text-[15px] font-semibold text-primary-foreground shadow-[0_8px_20px_-8px_rgba(37,99,235,0.6)] transition hover:bg-primary/90 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60",children:y?n.jsxs(n.Fragment,{children:[n.jsx(Me,{className:"h-4 w-4 animate-spin"}),"Sending…"]}):n.jsxs(n.Fragment,{children:[n.jsx(Sk,{className:"h-4 w-4"}),"Send message"]})})]})]})}const Qu="block w-full rounded-xl border border-slate-300 bg-white px-4 py-3 text-[15px] text-slate-900 placeholder:text-slate-400 transition focus:border-cyan-500 focus:outline-none focus:ring-2 focus:ring-cyan-200/60 disabled:opacity-60 dark:border-white/15 dark:bg-white/5 dark:text-white dark:placeholder:text-slate-500 dark:focus:border-cyan-400 dark:focus:ring-cyan-800/30";function Zu({label:e,htmlFor:t,required:s,children:r}){return n.jsxs("label",{htmlFor:t,className:"block",children:[n.jsxs("span",{className:"mb-1.5 block text-[12px] font-medium uppercase tracking-wider text-slate-600 dark:text-slate-400",children:[e,s&&n.jsx("span",{className:"ml-1 text-rose-500",children:"*"})]}),r]})}function Xu({title:e,body:t}){return n.jsxs("div",{children:[n.jsx("p",{className:"text-[14px] font-semibold text-slate-900 dark:text-white",children:e}),n.jsx("p",{className:"mt-1.5 text-[13px] leading-relaxed text-slate-600 dark:text-slate-400",children:t})]})}function $0({title:e,children:t}){return n.jsxs("section",{children:[n.jsx("h2",{className:"mb-3 text-lg font-semibold text-slate-900 dark:text-white",children:e}),n.jsx("div",{className:"space-y-3",children:t})]})}function QF(){const{theme:e}=Da(),t=e==="light",s=[{href:"/strategies",eyebrow:"Playbooks",title:"Development strategy library",blurb:"Plain-English playbooks for the strategies UK developers actually run — HMO conversion, Class MA, title splitting, BRR and more. Each entry covers the planning route, typical numbers and the gotchas that kill deals.",meta:`${Pa.length} strategies`,icon:H8,testId:"card-resource-strategies"},{href:"/councils",eyebrow:"Council intelligence",title:"Council-by-council guides",blurb:"Article 4 coverage, BSA Gateway status and typical build costs for every council in the index. Useful for sense-checking a region before you commit time to a viability model.",meta:`${nn.length} councils`,icon:Zo,testId:"card-resource-councils"},{href:"/postcodes",eyebrow:"Market data",title:"Postcode market benchmarks",blurb:"Yield, average values and dominant strategies for the UK's most active development postcode districts. A quick read before you set your offer ceiling.",meta:`${Ma.length} postcodes`,icon:vx,testId:"card-resource-postcodes"},{href:"/glossary",eyebrow:"Reference",title:"Property development glossary",blurb:"Plain-English definitions for the acronyms underwriters and planners take for granted — Article 4, Class MA, BSA Gateway, CIL, S106, HMO, title splitting and the rest.",meta:`${ji.length} terms`,icon:v8,testId:"card-resource-glossary"},{href:"/faq",eyebrow:"FAQ",title:"Frequently asked questions",blurb:"What Scapely covers, where the data comes from, how the development appraisal works, and how we differ from a generic property portal. Worth a skim before a sales call.",meta:`${pp.length} answers`,icon:bk,testId:"card-resource-faq"}
372,{href:"/property-data",eyebrow:"Data sources",title:"What data powers Scapely",blurb:"The full list of open and licensed data feeds behind every appraisal — planning.data.gov.uk, EPC Register, Environment Agency, Ordnance Survey, TfL, Land Registry and more.",meta:"Data inventory",icon:Yh,testId:"card-resource-property-data"}];return n.jsxs(as,{primaryNavLink:{href:"/",label:"Home",testId:"link-nav-home"},children:[n.jsx(ps,{meta:{title:"Resources — Scapely",description:"Thought-leadership guides for UK property developers: strategy playbooks, council intelligence, postcode benchmarks, a development glossary and the data behind Scapely's appraisals.",canonical:`${ch}/resources`,ogImage:`${ch}/og-default.png`,jsonLd:{"@context":"https://schema.org","@type":"CollectionPage",name:"Scapely Resources",url:`${ch}/resources`,description:"Curated thought-leadership for UK property developers — strategy playbooks, council intelligence, postcode benchmarks and reference material."}}}),n.jsxs("div",{className:"relative -mt-24 overflow-hidden pt-24 sm:-mt-28 sm:pt-28",children:[n.jsx(vp,{}),n.jsx("div",{className:"relative",children:n.jsx(on,{children:n.jsxs("article",{className:"text-slate-700 dark:text-slate-300",children:[n.jsx("p",{className:"font-mono text-[12px] uppercase tracking-widest text-purple-700 dark:text-purple-300",children:"Resources"}),n.jsx("h1",{className:"mt-3 text-[21px] font-semibold tracking-tight text-slate-900 dark:text-white sm:text-[34px]","data-testid":"text-resources-title",children:"Thought-leadership for UK property developers"}),n.jsx("p",{className:"mt-4 max-w-2xl text-base text-slate-700 dark:text-slate-300 sm:text-lg",children:"A curated library of playbooks, market benchmarks and reference material — written by the same team that builds Scapely's appraisal engine. Free for everyone on every tier, no signup required."}),n.jsx("div",{className:"mt-10 grid gap-4 sm:grid-cols-2",children:s.map(r=>{const o=r.icon;return n.jsxs("a",{href:r.href,"data-testid":r.testId,className:`group flex h-full flex-col rounded-xl border p-6 backdrop-blur-md transition hover:-translate-y-0.5 ${t?"border-slate-200 bg-white/80 shadow-[0_10px_30px_-10px_rgba(15,23,42,0.18)] hover:border-cyan-500/40 hover:bg-white":"border-white/10 bg-[rgba(15,22,56,0.6)] shadow-[0_10px_30px_-10px_rgba(0,0,0,0.5)] hover:border-cyan-300/40 hover:bg-[rgba(15,22,56,0.75)]"}`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-purple-700 dark:text-purple-300",children:[n.jsx(o,{className:"h-4 w-4"}),n.jsx("span",{className:"font-mono text-[11px] uppercase tracking-widest",children:r.eyebrow})]}),n.jsx(Z0,{className:"h-4 w-4 text-slate-500 transition group-hover:text-cyan-700 dark:group-hover:text-cyan-200"})]}),n.jsx("h2",{className:"mt-3 text-lg font-semibold text-slate-900 dark:text-white",children:r.title}),n.jsx("p",{className:"mt-2 flex-1 text-sm text-slate-700 dark:text-slate-300",children:r.blurb}),n.jsx("p",{className:"mt-4 font-mono text-[11px] uppercase tracking-wider text-slate-600 dark:text-slate-500",children:r.meta}
372)]},r.href)})}),n.jsxs("div",{className:"mt-12 rounded-xl border border-purple-200 bg-gradient-to-br from-purple-50 to-fuchsia-50 p-6 backdrop-blur-md dark:border-white/10 dark:from-purple-500/10 dark:to-fuchsia-500/10",children:[n.jsx("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Put these ideas to work on a real site"}),n.jsx("p",{className:"mt-2 text-sm text-slate-700 dark:text-slate-300",children:"Run any UK address through Scapely and get a full viability, planning and financial appraisal in under a minute — Article 4, Class MA, flood, EPC and PTAL all surfaced in one view."}),n.jsx("a",{href:"/pricing",className:"mt-4 inline-flex h-9 items-center rounded-lg border border-cyan-600/40 bg-cyan-500/10 px-4 text-[13px] font-semibold text-cyan-800 transition hover:border-cyan-700/60 hover:bg-cyan-500/20 hover:text-cyan-950 dark:border-cyan-300/40 dark:bg-cyan-400/10 dark:text-cyan-100 dark:hover:border-cyan-200/60 dark:hover:bg-cyan-400/20 dark:hover:text-white","data-testid":"link-resources-cta-dashboard",children:"Get the Scapely Dashboard"})]})]})})})]})]})}function ZF(){_i();const[e,t]=w.useState("");return w.useEffect(()=>{const s=document.title;return document.title="The Scapely Panel",()=>{document.title=s}},[]),n.jsxs("div",{className:"min-h-screen bg-slate-950 text-white",children:[n.jsx("div",{className:"border-b border-white/10 bg-slate-950/95 backdrop-blur",children:n.jsxs("div",{className:"mx-auto flex max-w-[1400px] items-center gap-3 px-6 py-4",children:[n.jsx("img",{src:_n,alt:"Scapely",className:"h-3.5 w-auto select-none"}),n.jsx("span",{className:"rounded-full border border-white/10 bg-white/5 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider text-slate-300",children:"The Scapely Panel"})]})}),n.jsxs("div",{className:"mx-auto max-w-[1400px] px-6 py-8",children:[n.jsxs("div",{className:"overflow-hidden rounded-xl border border-white/10 bg-zinc-900 shadow-[0_30px_80px_-30px_rgba(0,0,0,0.7)]",children:[n.jsx(BN,{popupOpen:!1,onTogglePopup:()=>{}}),n.jsxs("div",{className:"relative bg-[#f6f7f9] text-slate-900",children:[n.jsx(IN,{}),n.jsx("div",{className:"absolute right-4 top-4 z-10",children:n.jsx(Ay,{tier:"enterprise",aiPhase:"ready",scansAvailable:!0,manualAddress:e,onManualAddressChange:t,costMultiplier:.5})})]})]}),n.jsx("p",{className:"mt-4 text-center text-[11px] text-slate-500",children:"Live demo of the Scapely sidebar on a Rightmove listing — fixed to Enterprise privileges so every panel is unlocked."})]})]})}const XF=new YE;function JF(){const[,e]=Uh();return w.useEffect(()=>{e("/dashboard")},[e]),null}function eG(){return n.jsxs(SE,{children:[n.jsx(it,{path:"/",component:BB}),n.jsx(it,{path:"/dashboard-features",component:GB}),n.jsx(it,{path:"/demo-report",component:IH}),n.jsx(it,{path:"/pricing",component:qH}),n.jsx(it,{path:"/privacy",component:zH}),n.jsx(it,{path:"/terms",component:GH}),n.jsx(it,{path:"/dashboard",children:n.jsx(zS,{defaultTheme:"dark",children:n.jsx(Vz,{})})}),n.jsx(it,{path:"/dashboard/property/:id/investment",component:JF}),n.jsx(it,{path:"/billing/success",component:uF}),n.jsx(it,{path:"/admin",component:YH}),n.jsx(it,{path:"/admin/features",component:vq}),n.jsx(it,{path:"/reset-password",component:jq}),n.jsx(it,{path:"/extension-preview",component:pF}),n.jsx(it,{path:"/SPanelDemo",component:ZF}),n.jsx(it,{path:"/councils/:council/strategies/:strategy",component:DF}),n.jsx(it,{path:"/councils/:slug",component:OF}),n.jsx(it,{path:"/councils",component:CF}),n.jsx(it,{path:"/strategies/:slug",component:LF}),n.jsx(it,{path:"/strategies",component:MF}),n.jsx(it,{path:"/postcodes/:code",component:IF}),n.jsx(it,{path:"/postcodes",component:BF}),n.jsx(it,{path:"/glossary",component:$F}),n.jsx(it,{path:"/faq",component:UF}),n.jsx(it,{path:"/alternatives",component:HF}),n.jsx(it,{path:"/investors",component:zF}),n.jsx(it,{path:"/property-data",component:GF}),n.jsx(it,{path:"/contact",component:WF}),n.jsx(it,{path:"/resources",component:QF}),n.jsx(it,{component:cd})]})}function tG(){const[e]=Uh();return w.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[e]),null}function sG(){const[e]=Uh(),t=w.useRef(!0);return w.useEffect(()=>{if(t.current){t.current=!1;return}const s=window.fbq;typeof s=="function"&&s("track","PageView")},[e]),null}function nG(){return n.jsx(QE,{client:XF,children:n.jsx(_R,{children:n.jsxs(_S,{defaultTheme:"dark",children:[n.jsxs(Oj,{base:"/".replace(/\/$/,""),children:[n.jsx(tG,{}),n.jsx(sG,{}),n.jsx(eG,{})]}),n.jsx(WA,{})]})})})}rE.createRoot(document.getElementById("root")).render(n.jsx(nG,{}));export{aG as c,Ko as g};

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.