PageSourceSearch

https://castlestone.netlify.app/assets/index-D6UAari1.js

js castlestone.netlify.app collected 2026-10-03 10:33:20 UTC 786,586 bytes, 418 lines download raw bytes

vendor: 3,500 bytes, lines 1-9
1var Ym=Object.defineProperty;var $m=(t,r,e)=>r in t?Ym(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var Ut=(t,r,e)=>$m(t,typeof r!="symbol"?r+"":r,e);function ep(t,r){for(var e=0;e<r.length;e++){const i=r[e];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in t)){const a=Object.getOwnPropertyDescriptor(i,n);a&&Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function e(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(n){if(n.ep)return;n.ep=!0;const a=e(n);fetch(n.href,a)}})();var mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function tp(t){if(t.__esModule)return t;var r=t.default;if(typeof r=="function"){var e=function i(){return this instanceof i?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};e.prototype=r.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),e}var Ld={exports:{}},pa={},Id={exports:{}},ue={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Gn=Symbol.for("react.element"),rp=Symbol.for("react.portal"),ip=Symbol.for("react.fragment"),np=Symbol.for("react.strict_mode"),sp=Symbol.for("react.profiler"),ap=Symbol.for("react.provider"),op=Symbol.for("react.context"),lp=Symbol.for("react.forward_ref"),cp=Symbol.for("react.suspense"),up=Symbol.for("react.memo"),dp=Symbol.for("react.lazy"),Wc=Symbol.iterator;function hp(t){return t===null||typeof t!="object"?null:(t=Wc&&t[Wc]||t["@@iterator"],typeof t=="function"?t:null)}var zd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fd=Object.assign,Md={};function Ui(t,r,e){this.props=t,this.context=r,this.refs=Md,this.updater=e||zd}Ui.prototype.isReactComponent={};Ui.prototype.setState=function(t,r){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,r,"setState")};Ui.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Bd(){}Bd.prototype=Ui.prototype;function zl(t,r,e){this.props=t,this.context=r,this.refs=Md,this.updater=e||zd}var Fl=zl.prototype=new Bd;Fl.constructor=zl;Fd(Fl,Ui.prototype);Fl.isPureReactComponent=!0;
vendor: 11,942 bytes, lines 9-33
9var qc=Array.isArray,Hd=Object.prototype.hasOwnProperty,Ml={current:null},Ud={key:!0,ref:!0,__self:!0,__source:!0};function Wd(t,r,e){var i,n={},a=null,c=null;if(r!=null)for(i in r.ref!==void 0&&(c=r.ref),r.key!==void 0&&(a=""+r.key),r)Hd.call(r,i)&&!Ud.hasOwnProperty(i)&&(n[i]=r[i]);var o=arguments.length-2;if(o===1)n.children=e;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];n.children=l}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)n[i]===void 0&&(n[i]=o[i]);return{$$typeof:Gn,type:t,key:a,ref:c,props:n,_owner:Ml.current}}function fp(t,r){return{$$typeof:Gn,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}function Bl(t){return typeof t=="object"&&t!==null&&t.$$typeof===Gn}function mp(t){var r={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(e){return r[e]})}var Vc=/\/+/g;function Va(t,r){return typeof t=="object"&&t!==null&&t.key!=null?mp(""+t.key):r.toString(36)}function Ts(t,r,e,i,n){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var c=!1;if(t===null)c=!0;else switch(a){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case Gn:case rp:c=!0}}if(c)return c=t,n=n(c),t=i===""?"."+Va(c,0):i,qc(n)?(e="",t!=null&&(e=t.replace(Vc,"$&/")+"/"),Ts(n,r,e,"",function(u){return u})):n!=null&&(Bl(n)&&(n=fp(n,e+(!n.key||c&&c.key===n.key?"":(""+n.key).replace(Vc,"$&/")+"/")+t)),r.push(n)),1;if(c=0,i=i===""?".":i+":",qc(t))for(var o=0;o<t.length;o++){a=t[o];var l=i+Va(a,o);c+=Ts(a,r,e,l,n)}else if(l=hp(t),typeof l=="function")for(t=l.call(t),o=0;!(a=t.next()).done;)a=a.value,l=i+Va(a,o++),c+=Ts(a,r,e,l,n);else if(a==="object")throw r=String(t),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return c}function is(t,r,e){if(t==null)return t;var i=[],n=0;return Ts(t,i,"","",function(a){return r.call(e,a,n++)}),i}function pp(t){if(t._status===-1){var r=t._result;r=r(),r.then(function(e){(t._status===0||t._status===-1)&&(t._status=1,t._result=e)},function(e){(t._status===0||t._status===-1)&&(t._status=2,t._result=e)}),t._status===-1&&(t._status=0,t._result=r)}if(t._status===1)return t._result.default;throw t._result}var $e={current:null},Es={transition:null},gp={ReactCurrentDispatcher:$e,ReactCurrentBatchConfig:Es,ReactCurrentOwner:Ml};function qd(){throw Error("act(...) is not supported in production builds of React.")}ue.Children={map:is,forEach:function(t,r,e){is(t,function(){r.apply(this,arguments)},e)},count:function(t){var r=0;return is(t,function(){r++}),r},toArray:function(t){return is(t,function(r){return r})||[]},only:function(t){if(!Bl(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ue.Component=Ui;ue.Fragment=ip;ue.Profiler=sp;ue.PureComponent=zl;ue.StrictMode=np;ue.Suspense=cp;ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gp;ue.act=qd;ue.cloneElement=function(t,r,e){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var i=Fd({},t.props),n=t.key,a=t.ref,c=t._owner;if(r!=null){if(r.ref!==void 0&&(a=r.ref,c=Ml.current),r.key!==void 0&&(n=""+r.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in r)Hd.call(r,l)&&!Ud.hasOwnProperty(l)&&(i[l]=r[l]===void 0&&o!==void 0?o[l]:r[l])}var l=arguments.length-2;if(l===1)i.children=e;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];i.children=o}return{$$typeof:Gn,type:t.type,key:n,ref:a,props:i,_owner:c}};ue.createContext=function(t){return t={$$typeof:op,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:ap,_context:t},t.Consumer=t};ue.createElement=Wd;ue.createFactory=function(t){var r=Wd.bind(null,t);return r.type=t,r};ue.createRef=function(){return{current:null}};ue.forwardRef=function(t){return{$$typeof:lp,render:t}};ue.isValidElement=Bl;ue.lazy=function(t){return{$$typeof:dp,_payload:{_status:-1,_result:t},_init:pp}};ue.memo=function(t,r){return{$$typeof:up,type:t,compare:r===void 0?null:r}};ue.startTransition=function(t){var r=Es.transition;Es.transition={};try{t()}finally{Es.transition=r}};ue.unstable_act=qd;ue.useCallback=function(t,r){return $e.current.useCallback(t,r)};ue.useContext=function(t){return $e.current.useContext(t)};ue.useDebugValue=function(){};ue.useDeferredValue=function(t){return $e.current.useDeferredValue(t)};ue.useEffect=function(t,r){return $e.current.useEffect(t,r)};ue.useId=function(){return $e.current.useId()};ue.useImperativeHandle=function(t,r,e){return $e.current.useImperativeHandle(t,r,e)};ue.useInsertionEffect=function(t,r){return $e.current.useInsertionEffect(t,r)};ue.useLayoutEffect=function(t,r){return $e.current.useLayoutEffect(t,r)};ue.useMemo=function(t,r){return $e.current.useMemo(t,r)};ue.useReducer=function(t,r,e){return $e.current.useReducer(t,r,e)};ue.useRef=function(t){return $e.current.useRef(t)};ue.useState=function(t){return $e.current.useState(t)};ue.useSyncExternalStore=function(t,r,e){return $e.current.useSyncExternalStore(t,r,e)};ue.useTransition=function(){return $e.current.useTransition()};ue.version="18.3.1";Id.exports=ue;var T=Id.exports;const Gt=Hi(T),vp=ep({__proto__:null,default:Gt},[T]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var xp=T,yp=Symbol.for("react.element"),wp=Symbol.for("react.fragment"),bp=Object.prototype.hasOwnProperty,jp=xp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Sp={key:!0,ref:!0,__self:!0,__source:!0};function Vd(t,r,e){var i,n={},a=null,c=null;e!==void 0&&(a=""+e),r.key!==void 0&&(a=""+r.key),r.ref!==void 0&&(c=r.ref);for(i in r)bp.call(r,i)&&!Sp.hasOwnProperty(i)&&(n[i]=r[i]);if(t&&t.defaultProps)for(i in r=t.defaultProps,r)n[i]===void 0&&(n[i]=r[i]);return{$$typeof:yp,type:t,key:a,ref:c,props:n,_owner:jp.current}}pa.Fragment=wp;pa.jsx=Vd;pa.jsxs=Vd;Ld.exports=pa;var s=Ld.exports,Gd={exports:{}},gt={},Zd={exports:{}},Kd={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(t){function r(D,M){var B=D.length;D.push(M);e:for(;0<B;){var K=B-1>>>1,se=D[K];if(0<n(se,M))D[K]=M,D[B]=se,B=K;else break e}}function e(D){return D.length===0?null:D[0]}function i(D){if(D.length===0)return null;var M=D[0],B=D.pop();if(B!==M){D[0]=B;e:for(var K=0,se=D.length,J=se>>>1;K<J;){var ce=2*(K+1)-1,Fe=D[ce],Pe=ce+1,Ne=D[Pe];if(0>n(Fe,B))Pe<se&&0>n(Ne,Fe)?(D[K]=Ne,D[Pe]=B,K=Pe):(D[K]=Fe,D[ce]=B,K=ce);else if(Pe<se&&0>n(Ne,B))D[K]=Ne,D[Pe]=B,K=Pe;else break e}}return M}function n(D,M){var B=D.sortIndex-M.sortIndex;return B!==0?B:D.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var c=Date,o=c.now();t.unstable_now=function(){return c.now()-o}}var l=[],u=[],d=1,h=null,f=3,p=!1,g=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(D){for(var M=e(u);M!==null;){if(M.callback===null)i(u);else if(M.startTime<=D)i(u),M.sortIndex=M.expirationTime,r(l,M);else break;M=e(u)}}function E(D){if(w=!1,S(D),!g)if(e(l)!==null)g=!0,O(R);else{var M=e(u);M!==null&&z(E,M.startTime-D)}}function R(D,M){g=!1,w&&(w=!1,x(H),H=-1),p=!0;var B=f;try{for(S(M),h=e(l);h!==null&&(!(h.expirationTime>M)||D&&!$());){var K=h.callback;if(typeof K=="function"){h.callback=null,f=h.priorityLevel;var se=K(h.expirationTime<=M);M=t.unstable_now(),typeof se=="function"?h.callback=se:h===e(l)&&i(l),S(M)}else i(l);h=e(l)}if(h!==null)var J=!0;else{var ce=e(u);ce!==null&&z(E,ce.startTime-M),J=!1}return J}finally{h=null,f=B,p=!1}}var A=!1,I=null,H=-1,W=5,Z=-1;function $(){return!(t.unstable_now()-Z<W)}function X(){if(I!==null){var D=t.unstable_now();Z=D;var M=!0;try{M=I(!0,D)}finally{M?ee():(A=!1,I=null)}}else A=!1}var ee;if(typeof j=="function")ee=function(){j(X)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,k=P.port2;P.port1.onmessage=X,ee=function(){k.postMessage(null)}}else ee=function(){b(X,0)};function O(D){I=D,A||(A=!0,ee())}function z(D,M){H=b(function(){D(t.unstable_now())},M)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(D){D.callback=null},t.unstable_continueExecution=function(){g||p||(g=!0,O(R))},t.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<D?Math.floor(1e3/D):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return e(l)},t.unstable_next=function(D){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var B=f;f=M;try{return D()}finally{f=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(D,M){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var B=f;f=D;try{return M()}finally{f=B}},t.unstable_scheduleCallback=function(D,M,B){var K=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?K+B:K):B=K,D){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=B+se,D={id:d++,callback:M,priorityLevel:D,startTime:B,expirationTime:se,sortIndex:-1},B>K?(D.sortIndex=B,r(u,D),e(l)===null&&D===e(u)&&(w?(x(H),H=-1):w=!0,z(E,B-K))):(D.sortIndex=se,r(l,D),g||p||(g=!0,O(R))),D},t.unstable_shouldYield=$,t.unstable_wrapCallback=function(D){var M=f;return function(){var B=f;f=M;try{return D.apply(this,arguments)}finally{f=B}}}})(Kd);Zd.exports=Kd;var _p=Zd.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var Cp=T,pt=_p;function q(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,e=1;e<arguments.length;e++)r+="&args[]="+encodeURIComponent(arguments[e]);return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Xd=new Set,Cn={};function Kr(t,r){Pi(t,r),Pi(t+"Capture",r)}function Pi(t,r){for(Cn[t]=r,t=0;t<r.length;t++)Xd.add(r[t])}var Qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ko=Object.prototype.hasOwnProperty,Np=/^[: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]*$/,Gc={},Zc={};function Tp(t){return ko.call(Zc,t)?!0:ko.call(Gc,t)?!1:Np.test(t)?Zc[t]=!0:(Gc[t]=!0,!1)}function Ep(t,r,e,i){if(e!==null&&e.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return i?!1:e!==null?!e.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function kp(t,r,e,i){if(r===null||typeof r>"u"||Ep(t,r,e,i))return!0;
vendor: 5,200 bytes, lines 33-34
33if(i)return!1;if(e!==null)switch(e.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function et(t,r,e,i,n,a,c){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=e,this.propertyName=t,this.type=r,this.sanitizeURL=a,this.removeEmptyString=c}var Ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ve[t]=new et(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];Ve[r]=new et(r,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ve[t]=new et(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ve[t]=new et(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ve[t]=new et(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ve[t]=new et(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ve[t]=new et(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ve[t]=new et(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ve[t]=new et(t,5,!1,t.toLowerCase(),null,!1,!1)});var Hl=/[\-:]([a-z])/g;function Ul(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var r=t.replace(Hl,Ul);Ve[r]=new et(r,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(Hl,Ul);Ve[r]=new et(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(Hl,Ul);Ve[r]=new et(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ve[t]=new et(t,1,!1,t.toLowerCase(),null,!1,!1)});Ve.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ve[t]=new et(t,1,!1,t.toLowerCase(),null,!0,!0)});function Wl(t,r,e,i){var n=Ve.hasOwnProperty(r)?Ve[r]:null;(n!==null?n.type!==0:i||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(kp(r,e,n,i)&&(e=null),i||n===null?Tp(r)&&(e===null?t.removeAttribute(r):t.setAttribute(r,""+e)):n.mustUseProperty?t[n.propertyName]=e===null?n.type===3?!1:"":e:(r=n.attributeName,i=n.attributeNamespace,e===null?t.removeAttribute(r):(n=n.type,e=n===3||n===4&&e===!0?"":""+e,i?t.setAttributeNS(i,r,e):t.setAttribute(r,e))))}var er=Cp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ns=Symbol.for("react.element"),ci=Symbol.for("react.portal"),ui=Symbol.for("react.fragment"),ql=Symbol.for("react.strict_mode"),Po=Symbol.for("react.profiler"),Qd=Symbol.for("react.provider"),Jd=Symbol.for("react.context"),Vl=Symbol.for("react.forward_ref"),Ro=Symbol.for("react.suspense"),Ao=Symbol.for("react.suspense_list"),Gl=Symbol.for("react.memo"),nr=Symbol.for("react.lazy"),Yd=Symbol.for("react.offscreen"),Kc=Symbol.iterator;function Qi(t){return t===null||typeof t!="object"?null:(t=Kc&&t[Kc]||t["@@iterator"],typeof t=="function"?t:null)}var ke=Object.assign,Ga;function cn(t){if(Ga===void 0)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);Ga=r&&r[1]||""}return`
34`+Ga+t}var Za=!1;function Ka(t,r){if(!t||Za)return"";Za=!0;var e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(u){var i=u}Reflect.construct(t,[],r)}else{try{r.call()}catch(u){i=u}t.call(r.prototype)}else{try{throw Error()}catch(u){i=u}t()}}
vendor: 5,382 bytes, lines 34-37
34catch(u){if(u&&i&&typeof u.stack=="string"){for(var n=u.stack.split(`
35`),a=i.stack.split(`
36`),c=n.length-1,o=a.length-1;1<=c&&0<=o&&n[c]!==a[o];)o--;for(;1<=c&&0<=o;c--,o--)if(n[c]!==a[o]){if(c!==1||o!==1)do if(c--,o--,0>o||n[c]!==a[o]){var l=`
37`+n[c].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=c&&0<=o);break}}}finally{Za=!1,Error.prepareStackTrace=e}return(t=t?t.displayName||t.name:"")?cn(t):""}function Pp(t){switch(t.tag){case 5:return cn(t.type);case 16:return cn("Lazy");case 13:return cn("Suspense");case 19:return cn("SuspenseList");case 0:case 2:case 15:return t=Ka(t.type,!1),t;case 11:return t=Ka(t.type.render,!1),t;case 1:return t=Ka(t.type,!0),t;default:return""}}function Oo(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ui:return"Fragment";case ci:return"Portal";case Po:return"Profiler";case ql:return"StrictMode";case Ro:return"Suspense";case Ao:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Jd:return(t.displayName||"Context")+".Consumer";case Qd:return(t._context.displayName||"Context")+".Provider";case Vl:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Gl:return r=t.displayName||null,r!==null?r:Oo(t.type)||"Memo";case nr:r=t._payload,t=t._init;try{return Oo(t(r))}catch{}}return null}function Rp(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Oo(r);case 8:return r===ql?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function jr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function $d(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ap(t){var r=$d(t)?"checked":"value",e=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),i=""+t[r];if(!t.hasOwnProperty(r)&&typeof e<"u"&&typeof e.get=="function"&&typeof e.set=="function"){var n=e.get,a=e.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return n.call(this)},set:function(c){i=""+c,a.call(this,c)}}),Object.defineProperty(t,r,{enumerable:e.enumerable}),{getValue:function(){return i},setValue:function(c){i=""+c},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function ss(t){t._valueTracker||(t._valueTracker=Ap(t))}function eh(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var e=r.getValue(),i="";return t&&(i=$d(t)?t.checked?"true":"false":t.value),t=i,t!==e?(r.setValue(t),!0):!1}function Us(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Do(t,r){var e=r.checked;return ke({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:e??t._wrapperState.initialChecked})}function Xc(t,r){var e=r.defaultValue==null?"":r.defaultValue,i=r.checked!=null?r.checked:r.defaultChecked;e=jr(r.value!=null?r.value:e),t._wrapperState={initialChecked:i,initialValue:e,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function th(t,r){r=r.checked,r!=null&&Wl(t,"checked",r,!1)}function Lo(t,r){th(t,r);var e=jr(r.value),i=r.type;if(e!=null)i==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+e):t.value!==""+e&&(t.value=""+e);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?Io(t,r.type,e):r.hasOwnProperty("defaultValue")&&Io(t,r.type,jr(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function Qc(t,r,e){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var i=r.type;if(!(i!=="submit"&&i!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,e||r===t.value||(t.value=r),t.defaultValue=r}e=t.name,e!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,e!==""&&(t.name=e)}function Io(t,r,e){(r!=="number"||Us(t.ownerDocument)!==t)&&(e==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+e&&(t.defaultValue=""+e))}var un=Array.isArray;function bi(t,r,e,i){if(t=t.options,r){r={};for(var n=0;n<e.length;n++)r["$"+e[n]]=!0;for(e=0;e<t.length;e++)n=r.hasOwnProperty("$"+t[e].value),t[e].selected!==n&&(t[e].selected=n),n&&i&&(t[e].defaultSelected=!0)}else{for(e=""+jr(e),r=null,n=0;n<t.length;n++){if(t[n].value===e){t[n].selected=!0,i&&(t[n].defaultSelected=!0);return}r!==null||t[n].disabled||(r=t[n])}r!==null&&(r.selected=!0)}}function zo(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(q(91));return ke({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}
vendor: 9,072 bytes, line 37
37function Jc(t,r){var e=r.value;if(e==null){if(e=r.children,r=r.defaultValue,e!=null){if(r!=null)throw Error(q(92));if(un(e)){if(1<e.length)throw Error(q(93));e=e[0]}r=e}r==null&&(r=""),e=r}t._wrapperState={initialValue:jr(e)}}function rh(t,r){var e=jr(r.value),i=jr(r.defaultValue);e!=null&&(e=""+e,e!==t.value&&(t.value=e),r.defaultValue==null&&t.defaultValue!==e&&(t.defaultValue=e)),i!=null&&(t.defaultValue=""+i)}function Yc(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function ih(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Fo(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?ih(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var as,nh=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,e,i,n){MSApp.execUnsafeLocalFunction(function(){return t(r,e,i,n)})}:t}(function(t,r){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=r;else{for(as=as||document.createElement("div"),as.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=as.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function Nn(t,r){if(r){var e=t.firstChild;if(e&&e===t.lastChild&&e.nodeType===3){e.nodeValue=r;return}}t.textContent=r}var mn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Op=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(t){Op.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),mn[r]=mn[t]})});function sh(t,r,e){return r==null||typeof r=="boolean"||r===""?"":e||typeof r!="number"||r===0||mn.hasOwnProperty(t)&&mn[t]?(""+r).trim():r+"px"}function ah(t,r){t=t.style;for(var e in r)if(r.hasOwnProperty(e)){var i=e.indexOf("--")===0,n=sh(e,r[e],i);e==="float"&&(e="cssFloat"),i?t.setProperty(e,n):t[e]=n}}var Dp=ke({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mo(t,r){if(r){if(Dp[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(q(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(q(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(q(61))}if(r.style!=null&&typeof r.style!="object")throw Error(q(62))}}function Bo(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ho=null;function Zl(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Uo=null,ji=null,Si=null;function $c(t){if(t=Xn(t)){if(typeof Uo!="function")throw Error(q(280));var r=t.stateNode;r&&(r=wa(r),Uo(t.stateNode,t.type,r))}}function oh(t){ji?Si?Si.push(t):Si=[t]:ji=t}function lh(){if(ji){var t=ji,r=Si;if(Si=ji=null,$c(t),r)for(t=0;t<r.length;t++)$c(r[t])}}function ch(t,r){return t(r)}function uh(){}var Xa=!1;function dh(t,r,e){if(Xa)return t(r,e);Xa=!0;try{return ch(t,r,e)}finally{Xa=!1,(ji!==null||Si!==null)&&(uh(),lh())}}function Tn(t,r){var e=t.stateNode;if(e===null)return null;var i=wa(e);if(i===null)return null;e=i[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(e&&typeof e!="function")throw Error(q(231,r,typeof e));return e}var Wo=!1;if(Qt)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){Wo=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{Wo=!1}function Lp(t,r,e,i,n,a,c,o,l){var u=Array.prototype.slice.call(arguments,3);try{r.apply(e,u)}catch(d){this.onError(d)}}var pn=!1,Ws=null,qs=!1,qo=null,Ip={onError:function(t){pn=!0,Ws=t}};function zp(t,r,e,i,n,a,c,o,l){pn=!1,Ws=null,Lp.apply(Ip,arguments)}function Fp(t,r,e,i,n,a,c,o,l){if(zp.apply(this,arguments),pn){if(pn){var u=Ws;pn=!1,Ws=null}else throw Error(q(198));qs||(qs=!0,qo=u)}}function Xr(t){var r=t,e=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(e=r.return),t=r.return;while(t)}return r.tag===3?e:null}function hh(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function eu(t){if(Xr(t)!==t)throw Error(q(188))}function Mp(t){var r=t.alternate;if(!r){if(r=Xr(t),r===null)throw Error(q(188));return r!==t?null:t}for(var e=t,i=r;;){var n=e.return;if(n===null)break;var a=n.alternate;if(a===null){if(i=n.return,i!==null){e=i;continue}break}if(n.child===a.child){for(a=n.child;a;){if(a===e)return eu(n),t;if(a===i)return eu(n),r;a=a.sibling}throw Error(q(188))}if(e.return!==i.return)e=n,i=a;else{for(var c=!1,o=n.child;o;){if(o===e){c=!0,e=n,i=a;break}if(o===i){c=!0,i=n,e=a;break}o=o.sibling}if(!c){for(o=a.child;o;){if(o===e){c=!0,e=a,i=n;break}if(o===i){c=!0,i=a,e=n;break}o=o.sibling}if(!c)throw Error(q(189))}}if(e.alternate!==i)throw Error(q(190))}if(e.tag!==3)throw Error(q(188));return e.stateNode.current===e?t:r}function fh(t){return t=Mp(t),t!==null?mh(t):null}function mh(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=mh(t);if(r!==null)return r;t=t.sibling}return null}var ph=pt.unstable_scheduleCallback,tu=pt.unstable_cancelCallback,Bp=pt.unstable_shouldYield,Hp=pt.unstable_requestPaint,Oe=pt.unstable_now,Up=pt.unstable_getCurrentPriorityLevel,Kl=pt.unstable_ImmediatePriority,gh=pt.unstable_UserBlockingPriority,Vs=pt.unstable_NormalPriority,Wp=pt.unstable_LowPriority,vh=pt.unstable_IdlePriority,ga=null,Mt=null;function qp(t){if(Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(ga,t,void 0,(t.current.flags&128)===128)}catch{}}var Rt=Math.clz32?Math.clz32:Zp,Vp=Math.log,Gp=Math.LN2;function Zp(t){return t>>>=0,t===0?32:31-(Vp(t)/Gp|0)|0}var os=64,ls=4194304;function dn(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Gs(t,r){var e=t.pendingLanes;if(e===0)return 0;var i=0,n=t.suspendedLanes,a=t.pingedLanes,c=e&268435455;if(c!==0){var o=c&~n;o!==0?i=dn(o):(a&=c,a!==0&&(i=dn(a)))}else c=e&~n,c!==0?i=dn(c):a!==0&&(i=dn(a));if(i===0)return 0;if(r!==0&&r!==i&&!(r&n)&&(n=i&-i,a=r&-r,n>=a||n===16&&(a&4194240)!==0))return r;if(i&4&&(i|=e&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=i;0<r;)e=31-Rt(r),n=1<<e,i|=t[e],r&=~n;return i}function Kp(t,r){switch(t){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xp(t,r){for(var e=t.suspendedLanes,i=t.pingedLanes,n=t.expirationTimes,a=t.pendingLanes;0<a;){var c=31-Rt(a),o=1<<c,l=n[c];l===-1?(!(o&e)||o&i)&&(n[c]=Kp(o,r)):l<=r&&(t.expiredLanes|=o),a&=~o}}function Vo(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function xh(){var t=os;return os<<=1,!(os&4194240)&&(os=64),t}function Qa(t){for(var r=[],e=0;31>e;e++)r.push(t);return r}function Zn(t,r,e){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-Rt(r),t[r]=e}function Qp(t,r){var e=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<e;){var n=31-Rt(e),a=1<<n;
vendor: 5,266 bytes, line 37
37r[n]=0,i[n]=-1,t[n]=-1,e&=~a}}function Xl(t,r){var e=t.entangledLanes|=r;for(t=t.entanglements;e;){var i=31-Rt(e),n=1<<i;n&r|t[i]&r&&(t[i]|=r),e&=~n}}var ge=0;function yh(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var wh,Ql,bh,jh,Sh,Go=!1,cs=[],fr=null,mr=null,pr=null,En=new Map,kn=new Map,or=[],Jp="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 submit".split(" ");function ru(t,r){switch(t){case"focusin":case"focusout":fr=null;break;case"dragenter":case"dragleave":mr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":En.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":kn.delete(r.pointerId)}}function Yi(t,r,e,i,n,a){return t===null||t.nativeEvent!==a?(t={blockedOn:r,domEventName:e,eventSystemFlags:i,nativeEvent:a,targetContainers:[n]},r!==null&&(r=Xn(r),r!==null&&Ql(r)),t):(t.eventSystemFlags|=i,r=t.targetContainers,n!==null&&r.indexOf(n)===-1&&r.push(n),t)}function Yp(t,r,e,i,n){switch(r){case"focusin":return fr=Yi(fr,t,r,e,i,n),!0;case"dragenter":return mr=Yi(mr,t,r,e,i,n),!0;case"mouseover":return pr=Yi(pr,t,r,e,i,n),!0;case"pointerover":var a=n.pointerId;return En.set(a,Yi(En.get(a)||null,t,r,e,i,n)),!0;case"gotpointercapture":return a=n.pointerId,kn.set(a,Yi(kn.get(a)||null,t,r,e,i,n)),!0}return!1}function _h(t){var r=Lr(t.target);if(r!==null){var e=Xr(r);if(e!==null){if(r=e.tag,r===13){if(r=hh(e),r!==null){t.blockedOn=r,Sh(t.priority,function(){bh(e)});return}}else if(r===3&&e.stateNode.current.memoizedState.isDehydrated){t.blockedOn=e.tag===3?e.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ks(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var e=Zo(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(e===null){e=t.nativeEvent;var i=new e.constructor(e.type,e);Ho=i,e.target.dispatchEvent(i),Ho=null}else return r=Xn(e),r!==null&&Ql(r),t.blockedOn=e,!1;r.shift()}return!0}function iu(t,r,e){ks(t)&&e.delete(r)}function $p(){Go=!1,fr!==null&&ks(fr)&&(fr=null),mr!==null&&ks(mr)&&(mr=null),pr!==null&&ks(pr)&&(pr=null),En.forEach(iu),kn.forEach(iu)}function $i(t,r){t.blockedOn===r&&(t.blockedOn=null,Go||(Go=!0,pt.unstable_scheduleCallback(pt.unstable_NormalPriority,$p)))}function Pn(t){function r(n){return $i(n,t)}if(0<cs.length){$i(cs[0],t);for(var e=1;e<cs.length;e++){var i=cs[e];i.blockedOn===t&&(i.blockedOn=null)}}for(fr!==null&&$i(fr,t),mr!==null&&$i(mr,t),pr!==null&&$i(pr,t),En.forEach(r),kn.forEach(r),e=0;e<or.length;e++)i=or[e],i.blockedOn===t&&(i.blockedOn=null);for(;0<or.length&&(e=or[0],e.blockedOn===null);)_h(e),e.blockedOn===null&&or.shift()}var _i=er.ReactCurrentBatchConfig,Zs=!0;function eg(t,r,e,i){var n=ge,a=_i.transition;_i.transition=null;try{ge=1,Jl(t,r,e,i)}finally{ge=n,_i.transition=a}}function tg(t,r,e,i){var n=ge,a=_i.transition;_i.transition=null;try{ge=4,Jl(t,r,e,i)}finally{ge=n,_i.transition=a}}function Jl(t,r,e,i){if(Zs){var n=Zo(t,r,e,i);if(n===null)ao(t,r,i,Ks,e),ru(t,i);else if(Yp(n,t,r,e,i))i.stopPropagation();else if(ru(t,i),r&4&&-1<Jp.indexOf(t)){for(;n!==null;){var a=Xn(n);if(a!==null&&wh(a),a=Zo(t,r,e,i),a===null&&ao(t,r,i,Ks,e),a===n)break;n=a}n!==null&&i.stopPropagation()}else ao(t,r,i,null,e)}}var Ks=null;function Zo(t,r,e,i){if(Ks=null,t=Zl(i),t=Lr(t),t!==null)if(r=Xr(t),r===null)t=null;else if(e=r.tag,e===13){if(t=hh(r),t!==null)return t;t=null}else if(e===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null);return Ks=t,null}function Ch(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Up()){case Kl:return 1;case gh:return 4;case Vs:case Wp:return 16;case vh:return 536870912;default:return 16}default:return 16}}var ur=null,Yl=null,Ps=null;function Nh(){if(Ps)return Ps;var t,r=Yl,e=r.length,i,n="value"in ur?ur.value:ur.textContent,a=n.length;for(t=0;t<e&&r[t]===n[t];t++);var c=e-t;for(i=1;i<=c&&r[e-i]===n[a-i];i++);return Ps=n.slice(t,1<i?1-i:void 0)}function Rs(t){var r=t.keyCode;
vendor: 8,858 bytes, line 37
37return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function us(){return!0}function nu(){return!1}function vt(t){function r(e,i,n,a,c){this._reactName=e,this._targetInst=n,this.type=i,this.nativeEvent=a,this.target=c,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(e=t[o],this[o]=e?e(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?us:nu,this.isPropagationStopped=nu,this}return ke(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!="unknown"&&(e.returnValue=!1),this.isDefaultPrevented=us)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!="unknown"&&(e.cancelBubble=!0),this.isPropagationStopped=us)},persist:function(){},isPersistent:us}),r}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=vt(Wi),Kn=ke({},Wi,{view:0,detail:0}),rg=vt(Kn),Ja,Ya,en,va=ke({},Kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ec,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==en&&(en&&t.type==="mousemove"?(Ja=t.screenX-en.screenX,Ya=t.screenY-en.screenY):Ya=Ja=0,en=t),Ja)},movementY:function(t){return"movementY"in t?t.movementY:Ya}}),su=vt(va),ig=ke({},va,{dataTransfer:0}),ng=vt(ig),sg=ke({},Kn,{relatedTarget:0}),$a=vt(sg),ag=ke({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),og=vt(ag),lg=ke({},Wi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),cg=vt(lg),ug=ke({},Wi,{data:0}),au=vt(ug),dg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hg={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"},fg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mg(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=fg[t])?!!r[t]:!1}function ec(){return mg}var pg=ke({},Kn,{key:function(t){if(t.key){var r=dg[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Rs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?hg[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ec,charCode:function(t){return t.type==="keypress"?Rs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Rs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),gg=vt(pg),vg=ke({},va,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ou=vt(vg),xg=ke({},Kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ec}),yg=vt(xg),wg=ke({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),bg=vt(wg),jg=ke({},va,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Sg=vt(jg),_g=[9,13,27,32],tc=Qt&&"CompositionEvent"in window,gn=null;Qt&&"documentMode"in document&&(gn=document.documentMode);var Cg=Qt&&"TextEvent"in window&&!gn,Th=Qt&&(!tc||gn&&8<gn&&11>=gn),lu=" ",cu=!1;function Eh(t,r){switch(t){case"keyup":return _g.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var di=!1;function Ng(t,r){switch(t){case"compositionend":return kh(r);case"keypress":return r.which!==32?null:(cu=!0,lu);case"textInput":return t=r.data,t===lu&&cu?null:t;default:return null}}function Tg(t,r){if(di)return t==="compositionend"||!tc&&Eh(t,r)?(t=Nh(),Ps=Yl=ur=null,di=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Th&&r.locale!=="ko"?null:r.data;default:return null}}var Eg={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 uu(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!Eg[t.type]:r==="textarea"}function Ph(t,r,e,i){oh(i),r=Xs(r,"onChange"),0<r.length&&(e=new $l("onChange","change",null,e,i),t.push({event:e,listeners:r}))}var vn=null,Rn=null;function kg(t){Hh(t,0)}function xa(t){var r=mi(t);if(eh(r))return t}function Pg(t,r){if(t==="change")return r}var Rh=!1;if(Qt){var eo;if(Qt){var to="oninput"in document;if(!to){var du=document.createElement("div");du.setAttribute("oninput","return;"),to=typeof du.oninput=="function"}eo=to}else eo=!1;Rh=eo&&(!document.documentMode||9<document.documentMode)}function hu(){vn&&(vn.detachEvent("onpropertychange",Ah),Rn=vn=null)}function Ah(t){if(t.propertyName==="value"&&xa(Rn)){var r=[];Ph(r,Rn,t,Zl(t)),dh(kg,r)}}function Rg(t,r,e){t==="focusin"?(hu(),vn=r,Rn=e,vn.attachEvent("onpropertychange",Ah)):t==="focusout"&&hu()}function Ag(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return xa(Rn)}function Og(t,r){if(t==="click")return xa(r)}function Dg(t,r){if(t==="input"||t==="change")return xa(r)}function Lg(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Ot=typeof Object.is=="function"?Object.is:Lg;function An(t,r){if(Ot(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var e=Object.keys(t),i=Object.keys(r);if(e.length!==i.length)return!1;for(i=0;i<e.length;i++){var n=e[i];if(!ko.call(r,n)||!Ot(t[n],r[n]))return!1}return!0}function fu(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function mu(t,r){var e=fu(t);t=0;for(var i;e;){if(e.nodeType===3){if(i=t+e.textContent.length,t<=r&&i>=r)return{node:e,offset:r-t};t=i}e:{for(;e;){if(e.nextSibling){e=e.nextSibling;break e}e=e.parentNode}e=void 0}e=fu(e)}}function Oh(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Oh(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Dh(){for(var t=window,r=Us();r instanceof t.HTMLIFrameElement;){try{var e=typeof r.contentWindow.location.href=="string"}catch{e=!1}if(e)t=r.contentWindow;else break;r=Us(t.document)}return r}function rc(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function Ig(t){var r=Dh(),e=t.focusedElem,i=t.selectionRange;if(r!==e&&e&&e.ownerDocument&&Oh(e.ownerDocument.documentElement,e)){if(i!==null&&rc(e)){if(r=i.start,t=i.end,t===void 0&&(t=r),"selectionStart"in e)e.selectionStart=r,e.selectionEnd=Math.min(t,e.value.length);else if(t=(r=e.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var n=e.textContent.length,a=Math.min(i.start,n);i=i.end===void 0?a:Math.min(i.end,n),!t.extend&&a>i&&(n=i,i=a,a=n),n=mu(e,a);var c=mu(e,i);n&&c&&(t.rangeCount!==1||t.anchorNode!==n.node||t.anchorOffset!==n.offset||t.focusNode!==c.node||t.focusOffset!==c.offset)&&(r=r.createRange(),r.setStart(n.node,n.offset),t.removeAllRanges(),a>i?(t.addRange(r),t.extend(c.node,c.offset)):(r.setEnd(c.node,c.offset),t.addRange(r)))}}for(r=[],t=e;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof e.focus=="function"&&e.focus(),e=0;e<r.length;e++)t=r[e],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var zg=Qt&&"documentMode"in document&&11>=document.documentMode,hi=null,Ko=null,xn=null,Xo=!1;function pu(t,r,e){var i=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Xo||hi==null||hi!==Us(i)||(i=hi,"selectionStart"in i&&rc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focu
vendor: 4,383 bytes, line 37
37sNode:i.focusNode,focusOffset:i.focusOffset}),xn&&An(xn,i)||(xn=i,i=Xs(Ko,"onSelect"),0<i.length&&(r=new $l("onSelect","select",null,r,e),t.push({event:r,listeners:i}),r.target=hi)))}function ds(t,r){var e={};return e[t.toLowerCase()]=r.toLowerCase(),e["Webkit"+t]="webkit"+r,e["Moz"+t]="moz"+r,e}var fi={animationend:ds("Animation","AnimationEnd"),animationiteration:ds("Animation","AnimationIteration"),animationstart:ds("Animation","AnimationStart"),transitionend:ds("Transition","TransitionEnd")},ro={},Lh={};Qt&&(Lh=document.createElement("div").style,"AnimationEvent"in window||(delete fi.animationend.animation,delete fi.animationiteration.animation,delete fi.animationstart.animation),"TransitionEvent"in window||delete fi.transitionend.transition);function ya(t){if(ro[t])return ro[t];if(!fi[t])return t;var r=fi[t],e;for(e in r)if(r.hasOwnProperty(e)&&e in Lh)return ro[t]=r[e];return t}var Ih=ya("animationend"),zh=ya("animationiteration"),Fh=ya("animationstart"),Mh=ya("transitionend"),Bh=new Map,gu="abort auxClick 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(" ");function _r(t,r){Bh.set(t,r),Kr(r,[t])}for(var io=0;io<gu.length;io++){var no=gu[io],Fg=no.toLowerCase(),Mg=no[0].toUpperCase()+no.slice(1);_r(Fg,"on"+Mg)}_r(Ih,"onAnimationEnd");_r(zh,"onAnimationIteration");_r(Fh,"onAnimationStart");_r("dblclick","onDoubleClick");_r("focusin","onFocus");_r("focusout","onBlur");_r(Mh,"onTransitionEnd");Pi("onMouseEnter",["mouseout","mouseover"]);Pi("onMouseLeave",["mouseout","mouseover"]);Pi("onPointerEnter",["pointerout","pointerover"]);Pi("onPointerLeave",["pointerout","pointerover"]);Kr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Kr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Kr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Kr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Kr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Kr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hn="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(" "),Bg=new Set("cancel close invalid load scroll toggle".split(" ").concat(hn));function vu(t,r,e){var i=t.type||"unknown-event";t.currentTarget=e,Fp(i,r,void 0,t),t.currentTarget=null}function Hh(t,r){r=(r&4)!==0;for(var e=0;e<t.length;e++){var i=t[e],n=i.event;i=i.listeners;e:{var a=void 0;if(r)for(var c=i.length-1;0<=c;c--){var o=i[c],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==a&&n.isPropagationStopped())break e;vu(n,o,u),a=l}else for(c=0;c<i.length;c++){if(o=i[c],l=o.instance,u=o.currentTarget,o=o.listener,l!==a&&n.isPropagationStopped())break e;vu(n,o,u),a=l}}}if(qs)throw t=qo,qs=!1,qo=null,t}function je(t,r){var e=r[el];e===void 0&&(e=r[el]=new Set);var i=t+"__bubble";e.has(i)||(Uh(r,t,2,!1),e.add(i))}function so(t,r,e){var i=0;r&&(i|=4),Uh(e,t,i,r)}var hs="_reactListening"+Math.random().toString(36).slice(2);function On(t){if(!t[hs]){t[hs]=!0,Xd.forEach(function(e){e!=="selectionchange"&&(Bg.has(e)||so(e,!1,t),so(e,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[hs]||(r[hs]=!0,so("selectionchange",!1,r))}}function Uh(t,r,e,i){switch(Ch(r)){case 1:var n=eg;break;case 4:n=tg;break;default:n=Jl}e=n.bind(null,r,e,t),n=void 0,!Wo||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(n=!0),i?n!==void 0?t.addEventListener(r,e,{capture:!0,passive:n}):t.addEventListener(r,e,!0):n!==void 0?t.addEventListener(r,e,{passive:n}):t.addEventListener(r,e,!1)}function ao(t,r,e,i,n){var a=i;
vendor: 5,434 bytes, lines 37-38
37if(!(r&1)&&!(r&2)&&i!==null)e:for(;;){if(i===null)return;var c=i.tag;if(c===3||c===4){var o=i.stateNode.containerInfo;if(o===n||o.nodeType===8&&o.parentNode===n)break;if(c===4)for(c=i.return;c!==null;){var l=c.tag;if((l===3||l===4)&&(l=c.stateNode.containerInfo,l===n||l.nodeType===8&&l.parentNode===n))return;c=c.return}for(;o!==null;){if(c=Lr(o),c===null)return;if(l=c.tag,l===5||l===6){i=a=c;continue e}o=o.parentNode}}i=i.return}dh(function(){var u=a,d=Zl(e),h=[];e:{var f=Bh.get(t);if(f!==void 0){var p=$l,g=t;switch(t){case"keypress":if(Rs(e)===0)break e;case"keydown":case"keyup":p=gg;break;case"focusin":g="focus",p=$a;break;case"focusout":g="blur",p=$a;break;case"beforeblur":case"afterblur":p=$a;break;case"click":if(e.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=su;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=ng;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=yg;break;case Ih:case zh:case Fh:p=og;break;case Mh:p=bg;break;case"scroll":p=rg;break;case"wheel":p=Sg;break;case"copy":case"cut":case"paste":p=cg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=ou}var w=(r&4)!==0,b=!w&&t==="scroll",x=w?f!==null?f+"Capture":null:f;w=[];for(var j=u,S;j!==null;){S=j;var E=S.stateNode;if(S.tag===5&&E!==null&&(S=E,x!==null&&(E=Tn(j,x),E!=null&&w.push(Dn(j,E,S)))),b)break;j=j.return}0<w.length&&(f=new p(f,g,null,e,d),h.push({event:f,listeners:w}))}}if(!(r&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&e!==Ho&&(g=e.relatedTarget||e.fromElement)&&(Lr(g)||g[Jt]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(g=e.relatedTarget||e.toElement,p=u,g=g?Lr(g):null,g!==null&&(b=Xr(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(w=su,E="onMouseLeave",x="onMouseEnter",j="mouse",(t==="pointerout"||t==="pointerover")&&(w=ou,E="onPointerLeave",x="onPointerEnter",j="pointer"),b=p==null?f:mi(p),S=g==null?f:mi(g),f=new w(E,j+"leave",p,e,d),f.target=b,f.relatedTarget=S,E=null,Lr(d)===u&&(w=new w(x,j+"enter",g,e,d),w.target=S,w.relatedTarget=b,E=w),b=E,p&&g)t:{for(w=p,x=g,j=0,S=w;S;S=ii(S))j++;for(S=0,E=x;E;E=ii(E))S++;for(;0<j-S;)w=ii(w),j--;for(;0<S-j;)x=ii(x),S--;for(;j--;){if(w===x||x!==null&&w===x.alternate)break t;w=ii(w),x=ii(x)}w=null}else w=null;p!==null&&xu(h,f,p,w,!1),g!==null&&b!==null&&xu(h,b,g,w,!0)}}e:{if(f=u?mi(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var R=Pg;else if(uu(f))if(Rh)R=Dg;else{R=Ag;var A=Rg}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(R=Og);if(R&&(R=R(t,u))){Ph(h,R,e,d);break e}A&&A(t,f,u),t==="focusout"&&(A=f._wrapperState)&&A.controlled&&f.type==="number"&&Io(f,"number",f.value)}switch(A=u?mi(u):window,t){case"focusin":(uu(A)||A.contentEditable==="true")&&(hi=A,Ko=u,xn=null);break;case"focusout":xn=Ko=hi=null;break;case"mousedown":Xo=!0;break;case"contextmenu":case"mouseup":case"dragend":Xo=!1,pu(h,e,d);break;case"selectionchange":if(zg)break;case"keydown":case"keyup":pu(h,e,d)}var I;if(tc)e:{switch(t){case"compositionstart":var H="onCompositionStart";break e;case"compositionend":H="onCompositionEnd";break e;case"compositionupdate":H="onCompositionUpdate";break e}H=void 0}else di?Eh(t,e)&&(H="onCompositionEnd"):t==="keydown"&&e.keyCode===229&&(H="onCompositionStart");H&&(Th&&e.locale!=="ko"&&(di||H!=="onCompositionStart"?H==="onCompositionEnd"&&di&&(I=Nh()):(ur=d,Yl="value"in ur?ur.value:ur.textContent,di=!0)),A=Xs(u,H),0<A.length&&(H=new au(H,t,null,e,d),h.push({event:H,listeners:A}),I?H.data=I:(I=kh(e),I!==null&&(H.data=I)))),(I=Cg?Ng(t,e):Tg(t,e))&&(u=Xs(u,"onBeforeInput"),0<u.length&&(d=new au("onBeforeInput","beforeinput",null,e,d),h.push({event:d,listeners:u}),d.data=I))}Hh(h,r)})}function Dn(t,r,e){return{instance:t,listener:r,currentTarget:e}}function Xs(t,r){for(var e=r+"Capture",i=[];t!==null;){var n=t,a=n.stateNode;n.tag===5&&a!==null&&(n=a,a=Tn(t,e),a!=null&&i.unshift(Dn(t,a,n)),a=Tn(t,r),a!=null&&i.push(Dn(t,a,n))),t=t.return}return i}function ii(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function xu(t,r,e,i,n){for(var a=r._reactName,c=[];e!==null&&e!==i;){var o=e,l=o.alternate,u=o.stateNode;if(l!==null&&l===i)break;o.tag===5&&u!==null&&(o=u,n?(l=Tn(e,a),l!=null&&c.unshift(Dn(e,l,o))):n||(l=Tn(e,a),l!=null&&c.push(Dn(e,l,o)))),e=e.return}c.length!==0&&t.push({event:r,listeners:c})}var Hg=/\r\n?/g,Ug=/\u0000|\uFFFD/g;function yu(t){return(typeof t=="string"?t:""+t).replace(Hg,`
38`).replace(Ug,"")}function fs(t,r,e){if(r=yu(r),yu(t)!==r&&e)throw Error(q(425))}function Qs(){}var Qo=null,Jo=null;function Yo(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var $o=typeof setTimeout=="function"?setTimeout:void 0,Wg=typeof clearTimeout=="function"?clearTimeout:void 0,wu=typeof Promise=="function"?Promise:void 0,qg=typeof queueMicrotask=="function"?queueMicrotask:typeof wu<"u"?function(t){return wu.resolve(null).then(t).cat
vendor: 4,824 bytes, line 38
38ch(Vg)}:$o;function Vg(t){setTimeout(function(){throw t})}function oo(t,r){var e=r,i=0;do{var n=e.nextSibling;if(t.removeChild(e),n&&n.nodeType===8)if(e=n.data,e==="/$"){if(i===0){t.removeChild(n),Pn(r);return}i--}else e!=="$"&&e!=="$?"&&e!=="$!"||i++;e=n}while(e);Pn(r)}function gr(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return t}function bu(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var e=t.data;if(e==="$"||e==="$!"||e==="$?"){if(r===0)return t;r--}else e==="/$"&&r++}t=t.previousSibling}return null}var qi=Math.random().toString(36).slice(2),Ft="__reactFiber$"+qi,Ln="__reactProps$"+qi,Jt="__reactContainer$"+qi,el="__reactEvents$"+qi,Gg="__reactListeners$"+qi,Zg="__reactHandles$"+qi;function Lr(t){var r=t[Ft];if(r)return r;for(var e=t.parentNode;e;){if(r=e[Jt]||e[Ft]){if(e=r.alternate,r.child!==null||e!==null&&e.child!==null)for(t=bu(t);t!==null;){if(e=t[Ft])return e;t=bu(t)}return r}t=e,e=t.parentNode}return null}function Xn(t){return t=t[Ft]||t[Jt],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function mi(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(q(33))}function wa(t){return t[Ln]||null}var tl=[],pi=-1;function Cr(t){return{current:t}}function Se(t){0>pi||(t.current=tl[pi],tl[pi]=null,pi--)}function we(t,r){pi++,tl[pi]=t.current,t.current=r}var Sr={},Xe=Cr(Sr),st=Cr(!1),Ur=Sr;function Ri(t,r){var e=t.type.contextTypes;if(!e)return Sr;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===r)return i.__reactInternalMemoizedMaskedChildContext;var n={},a;for(a in e)n[a]=r[a];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=n),n}function at(t){return t=t.childContextTypes,t!=null}function Js(){Se(st),Se(Xe)}function ju(t,r,e){if(Xe.current!==Sr)throw Error(q(168));we(Xe,r),we(st,e)}function Wh(t,r,e){var i=t.stateNode;if(r=r.childContextTypes,typeof i.getChildContext!="function")return e;i=i.getChildContext();for(var n in i)if(!(n in r))throw Error(q(108,Rp(t)||"Unknown",n));return ke({},e,i)}function Ys(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Sr,Ur=Xe.current,we(Xe,t),we(st,st.current),!0}function Su(t,r,e){var i=t.stateNode;if(!i)throw Error(q(169));e?(t=Wh(t,r,Ur),i.__reactInternalMemoizedMergedChildContext=t,Se(st),Se(Xe),we(Xe,t)):Se(st),we(st,e)}var Vt=null,ba=!1,lo=!1;function qh(t){Vt===null?Vt=[t]:Vt.push(t)}function Kg(t){ba=!0,qh(t)}function Nr(){if(!lo&&Vt!==null){lo=!0;var t=0,r=ge;try{var e=Vt;for(ge=1;t<e.length;t++){var i=e[t];do i=i(!0);while(i!==null)}Vt=null,ba=!1}catch(n){throw Vt!==null&&(Vt=Vt.slice(t+1)),ph(Kl,Nr),n}finally{ge=r,lo=!1}}return null}var gi=[],vi=0,$s=null,ea=0,yt=[],wt=0,Wr=null,Zt=1,Kt="";function Rr(t,r){gi[vi++]=ea,gi[vi++]=$s,$s=t,ea=r}function Vh(t,r,e){yt[wt++]=Zt,yt[wt++]=Kt,yt[wt++]=Wr,Wr=t;var i=Zt;t=Kt;var n=32-Rt(i)-1;i&=~(1<<n),e+=1;var a=32-Rt(r)+n;if(30<a){var c=n-n%5;a=(i&(1<<c)-1).toString(32),i>>=c,n-=c,Zt=1<<32-Rt(r)+n|e<<n|i,Kt=a+t}else Zt=1<<a|e<<n|i,Kt=t}function ic(t){t.return!==null&&(Rr(t,1),Vh(t,1,0))}function nc(t){for(;t===$s;)$s=gi[--vi],gi[vi]=null,ea=gi[--vi],gi[vi]=null;for(;t===Wr;)Wr=yt[--wt],yt[wt]=null,Kt=yt[--wt],yt[wt]=null,Zt=yt[--wt],yt[wt]=null}var ft=null,ht=null,_e=!1,kt=null;function Gh(t,r){var e=bt(5,null,null,0);e.elementType="DELETED",e.stateNode=r,e.return=t,r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)}function _u(t,r){switch(t.tag){case 5:var e=t.type;return r=r.nodeType!==1||e.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(t.stateNode=r,ft=t,ht=gr(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,ft=t,ht=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(e=Wr!==null?{id:Zt,overflow:Kt}:null,t.memoizedState={dehydrated:r,treeContext:e,retryLane:1073741824},e=bt(18,null,null,0),e.stateNode=r,e.return=t,t.child=e,ft=t,ht=null,!0):!1;default:return!1}}function rl(t){return(t.mode&1)!==0&&(t.flags&128)===0}function il(t){if(_e){var r=ht;if(r){var e=r;if(!_u(t,r)){if(rl(t))throw Error(q(418));r=gr(e.nextSibling);var i=ft;r&&_u(t,r)?Gh(i,e):(t.flags=t.flags&-4097|2,_e=!1,ft=t)}}else{if(rl(t))throw Error(q(418));t.flags=t.flags&-4097|2,_e=!1,ft=t}}}function Cu(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;ft=t}function ms(t){if(t!==ft)return!1;if(!_e)return Cu(t),_e=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!Yo(t.type,t.memoizedProps)),r&&(r=ht)){if(rl(t))throw Zh(),Error(q(418));for(;r;)Gh(t,r),r=gr(r.nextSibling)}if(Cu(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(q(317));e:{for(t=t.nextSibling,r=0;t;
vendor: 10,408 bytes, line 38
38){if(t.nodeType===8){var e=t.data;if(e==="/$"){if(r===0){ht=gr(t.nextSibling);break e}r--}else e!=="$"&&e!=="$!"&&e!=="$?"||r++}t=t.nextSibling}ht=null}}else ht=ft?gr(t.stateNode.nextSibling):null;return!0}function Zh(){for(var t=ht;t;)t=gr(t.nextSibling)}function Ai(){ht=ft=null,_e=!1}function sc(t){kt===null?kt=[t]:kt.push(t)}var Xg=er.ReactCurrentBatchConfig;function tn(t,r,e){if(t=e.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(e._owner){if(e=e._owner,e){if(e.tag!==1)throw Error(q(309));var i=e.stateNode}if(!i)throw Error(q(147,t));var n=i,a=""+t;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===a?r.ref:(r=function(c){var o=n.refs;c===null?delete o[a]:o[a]=c},r._stringRef=a,r)}if(typeof t!="string")throw Error(q(284));if(!e._owner)throw Error(q(290,t))}return t}function ps(t,r){throw t=Object.prototype.toString.call(r),Error(q(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function Nu(t){var r=t._init;return r(t._payload)}function Kh(t){function r(x,j){if(t){var S=x.deletions;S===null?(x.deletions=[j],x.flags|=16):S.push(j)}}function e(x,j){if(!t)return null;for(;j!==null;)r(x,j),j=j.sibling;return null}function i(x,j){for(x=new Map;j!==null;)j.key!==null?x.set(j.key,j):x.set(j.index,j),j=j.sibling;return x}function n(x,j){return x=wr(x,j),x.index=0,x.sibling=null,x}function a(x,j,S){return x.index=S,t?(S=x.alternate,S!==null?(S=S.index,S<j?(x.flags|=2,j):S):(x.flags|=2,j)):(x.flags|=1048576,j)}function c(x){return t&&x.alternate===null&&(x.flags|=2),x}function o(x,j,S,E){return j===null||j.tag!==6?(j=go(S,x.mode,E),j.return=x,j):(j=n(j,S),j.return=x,j)}function l(x,j,S,E){var R=S.type;return R===ui?d(x,j,S.props.children,E,S.key):j!==null&&(j.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===nr&&Nu(R)===j.type)?(E=n(j,S.props),E.ref=tn(x,j,S),E.return=x,E):(E=Fs(S.type,S.key,S.props,null,x.mode,E),E.ref=tn(x,j,S),E.return=x,E)}function u(x,j,S,E){return j===null||j.tag!==4||j.stateNode.containerInfo!==S.containerInfo||j.stateNode.implementation!==S.implementation?(j=vo(S,x.mode,E),j.return=x,j):(j=n(j,S.children||[]),j.return=x,j)}function d(x,j,S,E,R){return j===null||j.tag!==7?(j=Br(S,x.mode,E,R),j.return=x,j):(j=n(j,S),j.return=x,j)}function h(x,j,S){if(typeof j=="string"&&j!==""||typeof j=="number")return j=go(""+j,x.mode,S),j.return=x,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case ns:return S=Fs(j.type,j.key,j.props,null,x.mode,S),S.ref=tn(x,null,j),S.return=x,S;case ci:return j=vo(j,x.mode,S),j.return=x,j;case nr:var E=j._init;return h(x,E(j._payload),S)}if(un(j)||Qi(j))return j=Br(j,x.mode,S,null),j.return=x,j;ps(x,j)}return null}function f(x,j,S,E){var R=j!==null?j.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return R!==null?null:o(x,j,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ns:return S.key===R?l(x,j,S,E):null;case ci:return S.key===R?u(x,j,S,E):null;case nr:return R=S._init,f(x,j,R(S._payload),E)}if(un(S)||Qi(S))return R!==null?null:d(x,j,S,E,null);ps(x,S)}return null}function p(x,j,S,E,R){if(typeof E=="string"&&E!==""||typeof E=="number")return x=x.get(S)||null,o(j,x,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case ns:return x=x.get(E.key===null?S:E.key)||null,l(j,x,E,R);case ci:return x=x.get(E.key===null?S:E.key)||null,u(j,x,E,R);case nr:var A=E._init;return p(x,j,S,A(E._payload),R)}if(un(E)||Qi(E))return x=x.get(S)||null,d(j,x,E,R,null);ps(j,E)}return null}function g(x,j,S,E){for(var R=null,A=null,I=j,H=j=0,W=null;I!==null&&H<S.length;H++){I.index>H?(W=I,I=null):W=I.sibling;var Z=f(x,I,S[H],E);if(Z===null){I===null&&(I=W);break}t&&I&&Z.alternate===null&&r(x,I),j=a(Z,j,H),A===null?R=Z:A.sibling=Z,A=Z,I=W}if(H===S.length)return e(x,I),_e&&Rr(x,H),R;if(I===null){for(;H<S.length;H++)I=h(x,S[H],E),I!==null&&(j=a(I,j,H),A===null?R=I:A.sibling=I,A=I);return _e&&Rr(x,H),R}for(I=i(x,I);H<S.length;H++)W=p(I,x,H,S[H],E),W!==null&&(t&&W.alternate!==null&&I.delete(W.key===null?H:W.key),j=a(W,j,H),A===null?R=W:A.sibling=W,A=W);return t&&I.forEach(function($){return r(x,$)}),_e&&Rr(x,H),R}function w(x,j,S,E){var R=Qi(S);if(typeof R!="function")throw Error(q(150));if(S=R.call(S),S==null)throw Error(q(151));for(var A=R=null,I=j,H=j=0,W=null,Z=S.next();I!==null&&!Z.done;H++,Z=S.next()){I.index>H?(W=I,I=null):W=I.sibling;var $=f(x,I,Z.value,E);if($===null){I===null&&(I=W);break}t&&I&&$.alternate===null&&r(x,I),j=a($,j,H),A===null?R=$:A.sibling=$,A=$,I=W}if(Z.done)return e(x,I),_e&&Rr(x,H),R;if(I===null){for(;!Z.done;H++,Z=S.next())Z=h(x,Z.value,E),Z!==null&&(j=a(Z,j,H),A===null?R=Z:A.sibling=Z,A=Z);return _e&&Rr(x,H),R}for(I=i(x,I);!Z.done;H++,Z=S.next())Z=p(I,x,H,Z.value,E),Z!==null&&(t&&Z.alternate!==null&&I.delete(Z.key===null?H:Z.key),j=a(Z,j,H),A===null?R=Z:A.sibling=Z,A=Z);return t&&I.forEach(function(X){return r(x,X)}),_e&&Rr(x,H),R}function b(x,j,S,E){if(typeof S=="object"&&S!==null&&S.type===ui&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case ns:e:{for(var R=S.key,A=j;A!==null;){if(A.key===R){if(R=S.type,R===ui){if(A.tag===7){e(x,A.sibling),j=n(A,S.props.children),j.return=x,x=j;break e}}else if(A.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===nr&&Nu(R)===A.type){e(x,A.sibling),j=n(A,S.props),j.ref=tn(x,A,S),j.return=x,x=j;break e}e(x,A);break}else r(x,A);A=A.sibling}S.type===ui?(j=Br(S.props.children,x.mode,E,S.key),j.return=x,x=j):(E=Fs(S.type,S.key,S.props,null,x.mode,E),E.ref=tn(x,j,S),E.return=x,x=E)}return c(x);case ci:e:{for(A=S.key;j!==null;){if(j.key===A)if(j.tag===4&&j.stateNode.containerInfo===S.containerInfo&&j.stateNode.implementation===S.implementation){e(x,j.sibling),j=n(j,S.children||[]),j.return=x,x=j;break e}else{e(x,j);break}else r(x,j);j=j.sibling}j=vo(S,x.mode,E),j.return=x,x=j}return c(x);case nr:return A=S._init,b(x,j,A(S._payload),E)}if(un(S))return g(x,j,S,E);if(Qi(S))return w(x,j,S,E);ps(x,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,j!==null&&j.tag===6?(e(x,j.sibling),j=n(j,S),j.return=x,x=j):(e(x,j),j=go(S,x.mode,E),j.return=x,x=j),c(x)):e(x,j)}return b}var Oi=Kh(!0),Xh=Kh(!1),ta=Cr(null),ra=null,xi=null,ac=null;function oc(){ac=xi=ra=null}function lc(t){var r=ta.current;Se(ta),t._currentValue=r}function nl(t,r,e){for(;t!==null;){var i=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,i!==null&&(i.childLanes|=r)):i!==null&&(i.childLanes&r)!==r&&(i.childLanes|=r),t===e)break;t=t.return}}function Ci(t,r){ra=t,ac=xi=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&r&&(nt=!0),t.firstContext=null)}function St(t){var r=t._currentValue;if(ac!==t)if(t={context:t,memoizedValue:r,next:null},xi===null){if(ra===null)throw Error(q(308));xi=t,ra.dependencies={lanes:0,firstContext:t}}else xi=xi.next=t;return r}var Ir=null;function cc(t){Ir===null?Ir=[t]:Ir.push(t)}function Qh(t,r,e,i){var n=r.interleaved;return n===null?(e.next=e,cc(r)):(e.next=n.next,n.next=e),r.interleaved=e,Yt(t,i)}function Yt(t,r){t.lanes|=r;var e=t.alternate;for(e!==null&&(e.lanes|=r),e=t,t=t.return;t!==null;)t.childLanes|=r,e=t.alternate,e!==null&&(e.childLanes|=r),e=t,t=t.return;return e.tag===3?e.stateNode:null}var sr=!1;function uc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Xt(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function vr(t,r,e){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,he&2){var n=i.pending;return n===null?r.next=r:(r.next=n.next,n.next=r),i.pending=r,Yt(t,e)}return n=i.interleaved,n===null?(r.next=r,cc(i)):(r.next=n.next,n.next=r),i.interleaved=r,Yt(t,e)}function As(t,r,e){if(r=r.updateQueue,r!==null&&(r=r.shared,(e&4194240)!==0)){var i=r.lanes;i&=t.pendingLanes,e|=i,r.lanes=e,Xl(t,e)}}function Tu(t,r){var e=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,e===i)){var n=null,a=null;if(e=e.firstBaseUpdate,e!==null){do{var c={eventTime:e.eventTime,lane:e.lane,tag:e.tag,payload:e.payload,callback:e.callback,next:null};a===null?n=a=c:a=a.next=c,e=e.next}while(e!==null);a===null?n=a=r:a=a.next=r}else n=a=r;e={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:a,shared:i.shared,effects:i.effects},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=r:t.next=r,e.lastBaseUpdate=r}function ia(t,r,e,i){var n=t.updateQueue;sr=!1;var a=n.firstBaseUpdate,c=n.lastBaseUpdate,o=n.shared.pending;if(o!==null){n.shared.pending=null;var l=o,u=l.next;l.next=null,c===null?a=u:c.next=u,c=l;var d=t.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==c&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(a!==null){var h=n.baseState;c=0,d=u=l=null,o=a;do{var f=o.lane,p=o.eventTime;if((i&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=t,w=o;switch(f=r,p=e,w.tag){case 1:if(g=w.payload,typeof g=="function"){h=g.call(p,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=w.payload,f=typeof g=="function"?g.call(p,h,f):g,f==null)break e;h=ke({},h,f);break e;case 2:sr=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=n.effects,f===null?n.effects=[o]:f.push(o))}else p={eventTime:p,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,l=h):d=d.next=p,c|=f;if(o=o.next,o===null){if(o=n.shared.pending,o===null)break;f=o,o=f.next,f.next=null,n.lastBaseUpdate=f,n.shared.pending=null}}while(!0);if(d===null&&(l=h),n.baseState=l,n.firstBaseUpdate=u,n.lastBaseUpdate=d,r=n.shared.interleaved,r!==null){n=r;do c|=n.lane,n=n.next;while(n!==r)}else a===null&&(n.shared.lanes=0);Vr|=c,t.lanes=c,t.memoizedState=h}}function Eu(t,r,e){if(t=r.effects,r.effects=null,t!==null)for(r=0;r<t.length;r++){var i=t[r],n=i.callback;if(n!==null){if(i.callback=null,i=e,typeof n!="function")throw Error(q(191,n));n.call(i)}}}var Qn={},Bt=Cr(Qn),In=Cr(Qn),zn=Cr(Qn);function zr(t){if(t===Qn)throw Error(q(174));return t}function dc(t,r){switch(we(zn,r),we(In,t),we(Bt,Qn),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:Fo(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=Fo(r,t)}
vendor: 1,165 bytes, line 38
38Se(Bt),we(Bt,r)}function Di(){Se(Bt),Se(In),Se(zn)}function Yh(t){zr(zn.current);var r=zr(Bt.current),e=Fo(r,t.type);r!==e&&(we(In,t),we(Bt,e))}function hc(t){In.current===t&&(Se(Bt),Se(In))}var Te=Cr(0);function na(t){for(var r=t;r!==null;){if(r.tag===13){var e=r.memoizedState;if(e!==null&&(e=e.dehydrated,e===null||e.data==="$?"||e.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var co=[];function fc(){for(var t=0;t<co.length;t++)co[t]._workInProgressVersionPrimary=null;co.length=0}var Os=er.ReactCurrentDispatcher,uo=er.ReactCurrentBatchConfig,qr=0,Ee=null,Ie=null,He=null,sa=!1,yn=!1,Fn=0,Qg=0;function Ge(){throw Error(q(321))}function mc(t,r){if(r===null)return!1;for(var e=0;e<r.length&&e<t.length;e++)if(!Ot(t[e],r[e]))return!1;return!0}function pc(t,r,e,i,n,a){if(qr=a,Ee=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Os.current=t===null||t.memoizedState===null?ev:tv,t=e(i,n),yn){a=0;
vendor: 5,451 bytes, line 38
38do{if(yn=!1,Fn=0,25<=a)throw Error(q(301));a+=1,He=Ie=null,r.updateQueue=null,Os.current=rv,t=e(i,n)}while(yn)}if(Os.current=aa,r=Ie!==null&&Ie.next!==null,qr=0,He=Ie=Ee=null,sa=!1,r)throw Error(q(300));return t}function gc(){var t=Fn!==0;return Fn=0,t}function zt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return He===null?Ee.memoizedState=He=t:He=He.next=t,He}function _t(){if(Ie===null){var t=Ee.alternate;t=t!==null?t.memoizedState:null}else t=Ie.next;var r=He===null?Ee.memoizedState:He.next;if(r!==null)He=r,Ie=t;else{if(t===null)throw Error(q(310));Ie=t,t={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},He===null?Ee.memoizedState=He=t:He=He.next=t}return He}function Mn(t,r){return typeof r=="function"?r(t):r}function ho(t){var r=_t(),e=r.queue;if(e===null)throw Error(q(311));e.lastRenderedReducer=t;var i=Ie,n=i.baseQueue,a=e.pending;if(a!==null){if(n!==null){var c=n.next;n.next=a.next,a.next=c}i.baseQueue=n=a,e.pending=null}if(n!==null){a=n.next,i=i.baseState;var o=c=null,l=null,u=a;do{var d=u.lane;if((qr&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:t(i,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=h,c=i):l=l.next=h,Ee.lanes|=d,Vr|=d}u=u.next}while(u!==null&&u!==a);l===null?c=i:l.next=o,Ot(i,r.memoizedState)||(nt=!0),r.memoizedState=i,r.baseState=c,r.baseQueue=l,e.lastRenderedState=i}if(t=e.interleaved,t!==null){n=t;do a=n.lane,Ee.lanes|=a,Vr|=a,n=n.next;while(n!==t)}else n===null&&(e.lanes=0);return[r.memoizedState,e.dispatch]}function fo(t){var r=_t(),e=r.queue;if(e===null)throw Error(q(311));e.lastRenderedReducer=t;var i=e.dispatch,n=e.pending,a=r.memoizedState;if(n!==null){e.pending=null;var c=n=n.next;do a=t(a,c.action),c=c.next;while(c!==n);Ot(a,r.memoizedState)||(nt=!0),r.memoizedState=a,r.baseQueue===null&&(r.baseState=a),e.lastRenderedState=a}return[a,i]}function $h(){}function ef(t,r){var e=Ee,i=_t(),n=r(),a=!Ot(i.memoizedState,n);if(a&&(i.memoizedState=n,nt=!0),i=i.queue,vc(nf.bind(null,e,i,t),[t]),i.getSnapshot!==r||a||He!==null&&He.memoizedState.tag&1){if(e.flags|=2048,Bn(9,rf.bind(null,e,i,n,r),void 0,null),Ue===null)throw Error(q(349));qr&30||tf(e,r,n)}return n}function tf(t,r,e){t.flags|=16384,t={getSnapshot:r,value:e},r=Ee.updateQueue,r===null?(r={lastEffect:null,stores:null},Ee.updateQueue=r,r.stores=[t]):(e=r.stores,e===null?r.stores=[t]:e.push(t))}function rf(t,r,e,i){r.value=e,r.getSnapshot=i,sf(r)&&af(t)}function nf(t,r,e){return e(function(){sf(r)&&af(t)})}function sf(t){var r=t.getSnapshot;t=t.value;try{var e=r();return!Ot(t,e)}catch{return!0}}function af(t){var r=Yt(t,1);r!==null&&At(r,t,1,-1)}function ku(t){var r=zt();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mn,lastRenderedState:t},r.queue=t,t=t.dispatch=$g.bind(null,Ee,t),[r.memoizedState,t]}function Bn(t,r,e,i){return t={tag:t,create:r,destroy:e,deps:i,next:null},r=Ee.updateQueue,r===null?(r={lastEffect:null,stores:null},Ee.updateQueue=r,r.lastEffect=t.next=t):(e=r.lastEffect,e===null?r.lastEffect=t.next=t:(i=e.next,e.next=t,t.next=i,r.lastEffect=t)),t}function of(){return _t().memoizedState}function Ds(t,r,e,i){var n=zt();Ee.flags|=t,n.memoizedState=Bn(1|r,e,void 0,i===void 0?null:i)}function ja(t,r,e,i){var n=_t();i=i===void 0?null:i;var a=void 0;if(Ie!==null){var c=Ie.memoizedState;if(a=c.destroy,i!==null&&mc(i,c.deps)){n.memoizedState=Bn(r,e,a,i);return}}Ee.flags|=t,n.memoizedState=Bn(1|r,e,a,i)}function Pu(t,r){return Ds(8390656,8,t,r)}function vc(t,r){return ja(2048,8,t,r)}function lf(t,r){return ja(4,2,t,r)}function cf(t,r){return ja(4,4,t,r)}function uf(t,r){if(typeof r=="function")return t=t(),r(t),function(){r(null)};if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function df(t,r,e){return e=e!=null?e.concat([t]):null,ja(4,4,uf.bind(null,r,t),e)}function xc(){}function hf(t,r){var e=_t();r=r===void 0?null:r;var i=e.memoizedState;return i!==null&&r!==null&&mc(r,i[1])?i[0]:(e.memoizedState=[t,r],t)}function ff(t,r){var e=_t();r=r===void 0?null:r;var i=e.memoizedState;return i!==null&&r!==null&&mc(r,i[1])?i[0]:(t=t(),e.memoizedState=[t,r],t)}function mf(t,r,e){return qr&21?(Ot(e,r)||(e=xh(),Ee.lanes|=e,Vr|=e,t.baseState=!0),r):(t.baseState&&(t.baseState=!1,nt=!0),t.memoizedState=e)}function Jg(t,r){var e=ge;ge=e!==0&&4>e?e:4,t(!0);var i=uo.transition;uo.transition={};try{t(!1),r()}finally{ge=e,uo.transition=i}}function pf(){return _t().memoizedState}function Yg(t,r,e){var i=yr(t);if(e={lane:i,action:e,hasEagerState:!1,eagerState:null,next:null},gf(t))vf(r,e);else if(e=Qh(t,r,e,i),e!==null){var n=Ye();At(e,t,i,n),xf(e,r,i)}}function $g(t,r,e){var i=yr(t),n={lane:i,action:e,hasEagerState:!1,eagerState:null,next:null};if(gf(t))vf(r,n);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=r.lastRenderedReducer,a!==null))try{var c=r.lastRenderedState,o=a(c,e);if(n.hasEagerState=!0,n.eagerState=o,Ot(o,c)){var l=r.interleaved;l===null?(n.next=n,cc(r)):(n.next=l.next,l.next=n),r.interleaved=n;return}}catch{}finally{}e=Qh(t,r,n,i),e!==null&&(n=Ye(),At(e,t,i,n),xf(e,r,i))}}function gf(t){var r=t.alternate;return t===Ee||r!==null&&r===Ee}function vf(t,r){yn=sa=!0;var e=t.pending;
vendor: 8,572 bytes, lines 38-40
38e===null?r.next=r:(r.next=e.next,e.next=r),t.pending=r}function xf(t,r,e){if(e&4194240){var i=r.lanes;i&=t.pendingLanes,e|=i,r.lanes=e,Xl(t,e)}}var aa={readContext:St,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},ev={readContext:St,useCallback:function(t,r){return zt().memoizedState=[t,r===void 0?null:r],t},useContext:St,useEffect:Pu,useImperativeHandle:function(t,r,e){return e=e!=null?e.concat([t]):null,Ds(4194308,4,uf.bind(null,r,t),e)},useLayoutEffect:function(t,r){return Ds(4194308,4,t,r)},useInsertionEffect:function(t,r){return Ds(4,2,t,r)},useMemo:function(t,r){var e=zt();return r=r===void 0?null:r,t=t(),e.memoizedState=[t,r],t},useReducer:function(t,r,e){var i=zt();return r=e!==void 0?e(r):r,i.memoizedState=i.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=Yg.bind(null,Ee,t),[i.memoizedState,t]},useRef:function(t){var r=zt();return t={current:t},r.memoizedState=t},useState:ku,useDebugValue:xc,useDeferredValue:function(t){return zt().memoizedState=t},useTransition:function(){var t=ku(!1),r=t[0];return t=Jg.bind(null,t[1]),zt().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,e){var i=Ee,n=zt();if(_e){if(e===void 0)throw Error(q(407));e=e()}else{if(e=r(),Ue===null)throw Error(q(349));qr&30||tf(i,r,e)}n.memoizedState=e;var a={value:e,getSnapshot:r};return n.queue=a,Pu(nf.bind(null,i,a,t),[t]),i.flags|=2048,Bn(9,rf.bind(null,i,a,e,r),void 0,null),e},useId:function(){var t=zt(),r=Ue.identifierPrefix;if(_e){var e=Kt,i=Zt;e=(i&~(1<<32-Rt(i)-1)).toString(32)+e,r=":"+r+"R"+e,e=Fn++,0<e&&(r+="H"+e.toString(32)),r+=":"}else e=Qg++,r=":"+r+"r"+e.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},tv={readContext:St,useCallback:hf,useContext:St,useEffect:vc,useImperativeHandle:df,useInsertionEffect:lf,useLayoutEffect:cf,useMemo:ff,useReducer:ho,useRef:of,useState:function(){return ho(Mn)},useDebugValue:xc,useDeferredValue:function(t){var r=_t();return mf(r,Ie.memoizedState,t)},useTransition:function(){var t=ho(Mn)[0],r=_t().memoizedState;return[t,r]},useMutableSource:$h,useSyncExternalStore:ef,useId:pf,unstable_isNewReconciler:!1},rv={readContext:St,useCallback:hf,useContext:St,useEffect:vc,useImperativeHandle:df,useInsertionEffect:lf,useLayoutEffect:cf,useMemo:ff,useReducer:fo,useRef:of,useState:function(){return fo(Mn)},useDebugValue:xc,useDeferredValue:function(t){var r=_t();return Ie===null?r.memoizedState=t:mf(r,Ie.memoizedState,t)},useTransition:function(){var t=fo(Mn)[0],r=_t().memoizedState;return[t,r]},useMutableSource:$h,useSyncExternalStore:ef,useId:pf,unstable_isNewReconciler:!1};function Nt(t,r){if(t&&t.defaultProps){r=ke({},r),t=t.defaultProps;for(var e in t)r[e]===void 0&&(r[e]=t[e]);return r}return r}function sl(t,r,e,i){r=t.memoizedState,e=e(i,r),e=e==null?r:ke({},r,e),t.memoizedState=e,t.lanes===0&&(t.updateQueue.baseState=e)}var Sa={isMounted:function(t){return(t=t._reactInternals)?Xr(t)===t:!1},enqueueSetState:function(t,r,e){t=t._reactInternals;var i=Ye(),n=yr(t),a=Xt(i,n);a.payload=r,e!=null&&(a.callback=e),r=vr(t,a,n),r!==null&&(At(r,t,n,i),As(r,t,n))},enqueueReplaceState:function(t,r,e){t=t._reactInternals;var i=Ye(),n=yr(t),a=Xt(i,n);a.tag=1,a.payload=r,e!=null&&(a.callback=e),r=vr(t,a,n),r!==null&&(At(r,t,n,i),As(r,t,n))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var e=Ye(),i=yr(t),n=Xt(e,i);n.tag=2,r!=null&&(n.callback=r),r=vr(t,n,i),r!==null&&(At(r,t,i,e),As(r,t,i))}};function Ru(t,r,e,i,n,a,c){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,a,c):r.prototype&&r.prototype.isPureReactComponent?!An(e,i)||!An(n,a):!0}function yf(t,r,e){var i=!1,n=Sr,a=r.contextType;return typeof a=="object"&&a!==null?a=St(a):(n=at(r)?Ur:Xe.current,i=r.contextTypes,a=(i=i!=null)?Ri(t,n):Sr),r=new r(e,a),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Sa,t.stateNode=r,r._reactInternals=t,i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=a),r}function Au(t,r,e,i){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(e,i),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(e,i),r.state!==t&&Sa.enqueueReplaceState(r,r.state,null)}function al(t,r,e,i){var n=t.stateNode;n.props=e,n.state=t.memoizedState,n.refs={},uc(t);var a=r.contextType;typeof a=="object"&&a!==null?n.context=St(a):(a=at(r)?Ur:Xe.current,n.context=Ri(t,a)),n.state=t.memoizedState,a=r.getDerivedStateFromProps,typeof a=="function"&&(sl(t,r,a,e),n.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(r=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),r!==n.state&&Sa.enqueueReplaceState(n,n.state,null),ia(t,e,n,i),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308)}function Li(t,r){try{var e="",i=r;do e+=Pp(i),i=i.return;while(i);var n=e}catch(a){n=`
39Error generating stack: `+a.message+`
40`+a.stack}return{value:t,source:r,stack:n,digest:null}}function mo(t,r,e){return{value:t,source:null,stack:e??null,digest:r??null}}function ol(t,r){try{console.error(r.value)}catch(e){setTimeout(function(){throw e})}}var iv=typeof WeakMap=="function"?WeakMap:Map;function wf(t,r,e){e=Xt(-1,e),e.tag=3,e.payload={element:null};var i=r.value;return e.callback=function(){la||(la=!0,vl=i),ol(t,r)},e}function bf(t,r,e){e=Xt(-1,e),e.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var n=r.value;e.payload=function(){return i(n)},e.callback=function(){ol(t,r)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){ol(t,r),typeof i!="function"&&(xr===null?xr=new Set([this]):xr.add(this));var c=r.stack;this.componentDidCatch(r.value,{componentStack:c!==null?c:""})}),e}function Ou(t,r,e){var i=t.pingCache;if(i===null){i=t.pingCache=new iv;var n=new Set;i.set(r,n)}else n=i.get(r),n===void 0&&(n=new Set,i.set(r,n));n.has(e)||(n.add(e),t=vv.bind(null,t,r,e),r.then(t,t))}function Du(t){do{var r;if((r=t.tag===13)&&(r=t.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return t;t=t.return}while(t!==null);return null}function Lu(t,r,e,i,n){return t.mode&1?(t.flags|=65536,t.lanes=n,t):(t===r?t.flags|=65536:(t.flags|=128,e.flags|=131072,e.flags&=-52805,e.tag===1&&(e.alternate===null?e.tag=17:(r=Xt(-1,1),r.tag=2,vr(e,r,1))),e.lanes|=1),t)}var nv=er.ReactCurrentOwner,nt=!1;function Je(t,r,e,i){r.child=t===null?Xh(r,null,e,i):Oi(r,t.child,e,i)}function Iu(t,r,e,i,n){e=e.render;var a=r.ref;return Ci(r,n),i=pc(t,r,e,i,a,n),e=gc(),t!==null&&!nt?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~n,$t(t,r,n)):(_e&&e&&ic(r),r.flags|=1,Je(t,r,i,n),r.child)}function zu(t,r,e,i,n){if(t===null){var a=e.type;return typeof a=="function"&&!Nc(a)&&a.defaultProps===void 0&&e.compare===null&&e.defaultProps===void 0?(r.tag=15,r.type=a,jf(t,r,a,i,n)):(t=Fs(e.type,null,i,r,r.mode,n),t.ref=r.ref,t.return=r,r.child=t)}if(a=t.child,!(t.lanes&n)){var c=a.memoizedProps;if(e=e.compare,e=e!==null?e:An,e(c,i)&&t.ref===r.ref)return $t(t,r,n)}return r.flags|=1,t=wr(a,i),t.ref=r.ref,t.return=r,r.child=t}function jf(t,r,e,i,n){if(t!==null){var a=t.memoizedProps;if(An(a,i)&&t.ref===r.ref)if(nt=!1,r.pendingProps=i=a,(t.lanes&n)!==0)t.flags&131072&&(nt=!0);else return r.lanes=t.lanes,$t(t,r,n)}return ll(t,r,e,i,n)}function Sf(t,r,e){var i=r.pendingProps,n=i.children,a=t!==null?t.memoizedState:null;if(i.mode==="hidden")if(!(r.mode&1))r.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(wi,dt),dt|=e;else{if(!(e&1073741824))return t=a!==null?a.baseLanes|e:e,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:t,cachePool:null,transitions:null},r.updateQueue=null,we(wi,dt),dt|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=a!==null?a.baseLanes:e,we(wi,dt),dt|=i}else a!==null?(i=a.baseLanes|e,r.memoizedState=null):i=e,we(wi,dt),dt|=i;return Je(t,r,n,e),r.child}function _f(t,r){var e=r.ref;(t===null&&e!==null||t!==null&&t.ref!==e)&&(r.flags|=512,r.flags|=2097152)}
vendor: 8,806 bytes, line 40
40function ll(t,r,e,i,n){var a=at(e)?Ur:Xe.current;return a=Ri(r,a),Ci(r,n),e=pc(t,r,e,i,a,n),i=gc(),t!==null&&!nt?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~n,$t(t,r,n)):(_e&&i&&ic(r),r.flags|=1,Je(t,r,e,n),r.child)}function Fu(t,r,e,i,n){if(at(e)){var a=!0;Ys(r)}else a=!1;if(Ci(r,n),r.stateNode===null)Ls(t,r),yf(r,e,i),al(r,e,i,n),i=!0;else if(t===null){var c=r.stateNode,o=r.memoizedProps;c.props=o;var l=c.context,u=e.contextType;typeof u=="object"&&u!==null?u=St(u):(u=at(e)?Ur:Xe.current,u=Ri(r,u));var d=e.getDerivedStateFromProps,h=typeof d=="function"||typeof c.getSnapshotBeforeUpdate=="function";h||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(o!==i||l!==u)&&Au(r,c,i,u),sr=!1;var f=r.memoizedState;c.state=f,ia(r,i,c,n),l=r.memoizedState,o!==i||f!==l||st.current||sr?(typeof d=="function"&&(sl(r,e,d,i),l=r.memoizedState),(o=sr||Ru(r,e,o,i,f,l,u))?(h||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(r.flags|=4194308)):(typeof c.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=i,r.memoizedState=l),c.props=i,c.state=l,c.context=u,i=o):(typeof c.componentDidMount=="function"&&(r.flags|=4194308),i=!1)}else{c=r.stateNode,Jh(t,r),o=r.memoizedProps,u=r.type===r.elementType?o:Nt(r.type,o),c.props=u,h=r.pendingProps,f=c.context,l=e.contextType,typeof l=="object"&&l!==null?l=St(l):(l=at(e)?Ur:Xe.current,l=Ri(r,l));var p=e.getDerivedStateFromProps;(d=typeof p=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(o!==h||f!==l)&&Au(r,c,i,l),sr=!1,f=r.memoizedState,c.state=f,ia(r,i,c,n);var g=r.memoizedState;o!==h||f!==g||st.current||sr?(typeof p=="function"&&(sl(r,e,p,i),g=r.memoizedState),(u=sr||Ru(r,e,u,i,f,g,l)||!1)?(d||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,g,l),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,g,l)),typeof c.componentDidUpdate=="function"&&(r.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof c.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(r.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(r.flags|=1024),r.memoizedProps=i,r.memoizedState=g),c.props=i,c.state=g,c.context=l,i=u):(typeof c.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(r.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(r.flags|=1024),i=!1)}return cl(t,r,e,i,a,n)}function cl(t,r,e,i,n,a){_f(t,r);var c=(r.flags&128)!==0;if(!i&&!c)return n&&Su(r,e,!1),$t(t,r,a);i=r.stateNode,nv.current=r;var o=c&&typeof e.getDerivedStateFromError!="function"?null:i.render();return r.flags|=1,t!==null&&c?(r.child=Oi(r,t.child,null,a),r.child=Oi(r,null,o,a)):Je(t,r,o,a),r.memoizedState=i.state,n&&Su(r,e,!0),r.child}function Cf(t){var r=t.stateNode;r.pendingContext?ju(t,r.pendingContext,r.pendingContext!==r.context):r.context&&ju(t,r.context,!1),dc(t,r.containerInfo)}function Mu(t,r,e,i,n){return Ai(),sc(n),r.flags|=256,Je(t,r,e,i),r.child}var ul={dehydrated:null,treeContext:null,retryLane:0};function dl(t){return{baseLanes:t,cachePool:null,transitions:null}}function Nf(t,r,e){var i=r.pendingProps,n=Te.current,a=!1,c=(r.flags&128)!==0,o;if((o=c)||(o=t!==null&&t.memoizedState===null?!1:(n&2)!==0),o?(a=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(n|=1),we(Te,n&1),t===null)return il(r),t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(r.mode&1?t.data==="$!"?r.lanes=8:r.lanes=1073741824:r.lanes=1,null):(c=i.children,t=i.fallback,a?(i=r.mode,a=r.child,c={mode:"hidden",children:c},!(i&1)&&a!==null?(a.childLanes=0,a.pendingProps=c):a=Na(c,i,0,null),t=Br(t,i,e,null),a.return=r,t.return=r,a.sibling=t,r.child=a,r.child.memoizedState=dl(e),r.memoizedState=ul,t):yc(r,c));if(n=t.memoizedState,n!==null&&(o=n.dehydrated,o!==null))return sv(t,r,c,i,o,n,e);if(a){a=i.fallback,c=r.mode,n=t.child,o=n.sibling;var l={mode:"hidden",children:i.children};return!(c&1)&&r.child!==n?(i=r.child,i.childLanes=0,i.pendingProps=l,r.deletions=null):(i=wr(n,l),i.subtreeFlags=n.subtreeFlags&14680064),o!==null?a=wr(o,a):(a=Br(a,c,e,null),a.flags|=2),a.return=r,i.return=r,i.sibling=a,r.child=i,i=a,a=r.child,c=t.child.memoizedState,c=c===null?dl(e):{baseLanes:c.baseLanes|e,cachePool:null,transitions:c.transitions},a.memoizedState=c,a.childLanes=t.childLanes&~e,r.memoizedState=ul,i}return a=t.child,t=a.sibling,i=wr(a,{mode:"visible",children:i.children}),!(r.mode&1)&&(i.lanes=e),i.return=r,i.sibling=null,t!==null&&(e=r.deletions,e===null?(r.deletions=[t],r.flags|=16):e.push(t)),r.child=i,r.memoizedState=null,i}function yc(t,r){return r=Na({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function gs(t,r,e,i){return i!==null&&sc(i),Oi(r,t.child,null,e),t=yc(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function sv(t,r,e,i,n,a,c){if(e)return r.flags&256?(r.flags&=-257,i=mo(Error(q(422))),gs(t,r,c,i)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(a=i.fallback,n=r.mode,i=Na({mode:"visible",children:i.children},n,0,null),a=Br(a,n,c,null),a.flags|=2,i.return=r,a.return=r,i.sibling=a,r.child=i,r.mode&1&&Oi(r,t.child,null,c),r.child.memoizedState=dl(c),r.memoizedState=ul,a);if(!(r.mode&1))return gs(t,r,c,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var o=i.dgst;return i=o,a=Error(q(419)),i=mo(a,i,void 0),gs(t,r,c,i)}if(o=(c&t.childLanes)!==0,nt||o){if(i=Ue,i!==null){switch(c&-c){case 4:n=2;break;case 16:n=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(i.suspendedLanes|c)?0:n,n!==0&&n!==a.retryLane&&(a.retryLane=n,Yt(t,n),At(i,t,n,-1))}return Cc(),i=mo(Error(q(421))),gs(t,r,c,i)}return n.data==="$?"?(r.flags|=128,r.child=t.child,r=xv.bind(null,t),n._reactRetry=r,null):(t=a.treeContext,ht=gr(n.nextSibling),ft=r,_e=!0,kt=null,t!==null&&(yt[wt++]=Zt,yt[wt++]=Kt,yt[wt++]=Wr,Zt=t.id,Kt=t.overflow,Wr=r),r=yc(r,i.children),r.flags|=4096,r)}function Bu(t,r,e){t.lanes|=r;var i=t.alternate;i!==null&&(i.lanes|=r),nl(t.return,r,e)}function po(t,r,e,i,n){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:i,tail:e,tailMode:n}:(a.isBackwards=r,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=e,a.tailMode=n)}function Tf(t,r,e){var i=r.pendingProps,n=i.revealOrder,a=i.tail;if(Je(t,r,i.children,e),i=Te.current,i&2)i=i&1|2,r.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Bu(t,e,r);else if(t.tag===19)Bu(t,e,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(we(Te,i),!(r.mode&1))r.memoizedState=null;else switch(n){case"forwards":for(e=r.child,n=null;e!==null;)t=e.alternate,t!==null&&na(t)===null&&(n=e),e=e.sibling;e=n,e===null?(n=r.child,r.child=null):(n=e.sibling,e.sibling=null),po(r,!1,n,e,a);break;case"backwards":for(e=null,n=r.child,r.child=null;n!==null;){if(t=n.alternate,t!==null&&na(t)===null){r.child=n;break}t=n.sibling,n.sibling=e,e=n,n=t}po(r,!0,e,null,a);break;case"together":po(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ls(t,r){!(r.mode&1)&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function $t(t,r,e){if(t!==null&&(r.dependencies=t.dependencies),Vr|=r.lanes,!(e&r.childLanes))return null;if(t!==null&&r.child!==t.child)throw Error(q(153));if(r.child!==null){for(t=r.child,e=wr(t,t.pendingProps),r.child=e,e.return=r;t.sibling!==null;)t=t.sibling,e=e.sibling=wr(t,t.pendingProps),e.return=r;e.sibling=null}return r.child}function av(t,r,e){switch(r.tag){case 3:Cf(r),Ai();break;case 5:Yh(r);break;case 1:at(r.type)&&Ys(r);break;case 4:dc(r,r.stateNode.containerInfo);break;case 10:var i=r.type._context,n=r.memoizedProps.value;we(ta,i._currentValue),i._currentValue=n;break;case 13:if(i=r.memoizedState,i!==null)return i.dehydrated!==null?(we(Te,Te.current&1),r.flags|=128,null):e&r.child.childLanes?Nf(t,r,e):(we(Te,Te.current&1),t=$t(t,r,e),t!==null?t.sibling:null);
vendor: 4,118 bytes, line 40
40we(Te,Te.current&1);break;case 19:if(i=(e&r.childLanes)!==0,t.flags&128){if(i)return Tf(t,r,e);r.flags|=128}if(n=r.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),we(Te,Te.current),i)break;return null;case 22:case 23:return r.lanes=0,Sf(t,r,e)}return $t(t,r,e)}var Ef,hl,kf,Pf;Ef=function(t,r){for(var e=r.child;e!==null;){if(e.tag===5||e.tag===6)t.appendChild(e.stateNode);else if(e.tag!==4&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break;for(;e.sibling===null;){if(e.return===null||e.return===r)return;e=e.return}e.sibling.return=e.return,e=e.sibling}};hl=function(){};kf=function(t,r,e,i){var n=t.memoizedProps;if(n!==i){t=r.stateNode,zr(Bt.current);var a=null;switch(e){case"input":n=Do(t,n),i=Do(t,i),a=[];break;case"select":n=ke({},n,{value:void 0}),i=ke({},i,{value:void 0}),a=[];break;case"textarea":n=zo(t,n),i=zo(t,i),a=[];break;default:typeof n.onClick!="function"&&typeof i.onClick=="function"&&(t.onclick=Qs)}Mo(e,i);var c;e=null;for(u in n)if(!i.hasOwnProperty(u)&&n.hasOwnProperty(u)&&n[u]!=null)if(u==="style"){var o=n[u];for(c in o)o.hasOwnProperty(c)&&(e||(e={}),e[c]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Cn.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in i){var l=i[u];if(o=n!=null?n[u]:void 0,i.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(c in o)!o.hasOwnProperty(c)||l&&l.hasOwnProperty(c)||(e||(e={}),e[c]="");for(c in l)l.hasOwnProperty(c)&&o[c]!==l[c]&&(e||(e={}),e[c]=l[c])}else e||(a||(a=[]),a.push(u,e)),e=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Cn.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&je("scroll",t),a||o===l||(a=[])):(a=a||[]).push(u,l))}e&&(a=a||[]).push("style",e);var u=a;(r.updateQueue=u)&&(r.flags|=4)}};Pf=function(t,r,e,i){e!==i&&(r.flags|=4)};function rn(t,r){if(!_e)switch(t.tailMode){case"hidden":r=t.tail;for(var e=null;r!==null;)r.alternate!==null&&(e=r),r=r.sibling;e===null?t.tail=null:e.sibling=null;break;case"collapsed":e=t.tail;for(var i=null;e!==null;)e.alternate!==null&&(i=e),e=e.sibling;i===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Ze(t){var r=t.alternate!==null&&t.alternate.child===t.child,e=0,i=0;if(r)for(var n=t.child;n!==null;)e|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=t,n=n.sibling;else for(n=t.child;n!==null;)e|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=t,n=n.sibling;return t.subtreeFlags|=i,t.childLanes=e,r}function ov(t,r,e){var i=r.pendingProps;switch(nc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(r),null;case 1:return at(r.type)&&Js(),Ze(r),null;case 3:return i=r.stateNode,Di(),Se(st),Se(Xe),fc(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(ms(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,kt!==null&&(wl(kt),kt=null))),hl(t,r),Ze(r),null;case 5:hc(r);var n=zr(zn.current);if(e=r.type,t!==null&&r.stateNode!=null)kf(t,r,e,i,n),t.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!i){if(r.stateNode===null)throw Error(q(166));return Ze(r),null}if(t=zr(Bt.current),ms(r)){i=r.stateNode,e=r.type;var a=r.memoizedProps;switch(i[Ft]=r,i[Ln]=a,t=(r.mode&1)!==0,e){case"dialog":je("cancel",i),je("close",i);break;case"iframe":case"object":case"embed":je("load",i);break;case"video":case"audio":for(n=0;n<hn.length;n++)je(hn[n],i);break;case"source":je("error",i);break;case"img":case"image":case"link":je("error",i),je("load",i);break;case"details":je("toggle",i);break;case"input":Xc(i,a),je("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!a.multiple},je("invalid",i);break;case"textarea":Jc(i,a),je("invalid",i)}Mo(e,a),n=null;for(var c in a)if(a.hasOwnProperty(c)){var o=a[c];
vendor: 32,230 bytes, line 40
40c==="children"?typeof o=="string"?i.textContent!==o&&(a.suppressHydrationWarning!==!0&&fs(i.textContent,o,t),n=["children",o]):typeof o=="number"&&i.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&fs(i.textContent,o,t),n=["children",""+o]):Cn.hasOwnProperty(c)&&o!=null&&c==="onScroll"&&je("scroll",i)}switch(e){case"input":ss(i),Qc(i,a,!0);break;case"textarea":ss(i),Yc(i);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(i.onclick=Qs)}i=n,r.updateQueue=i,i!==null&&(r.flags|=4)}else{c=n.nodeType===9?n:n.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=ih(e)),t==="http://www.w3.org/1999/xhtml"?e==="script"?(t=c.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=c.createElement(e,{is:i.is}):(t=c.createElement(e),e==="select"&&(c=t,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):t=c.createElementNS(t,e),t[Ft]=r,t[Ln]=i,Ef(t,r,!1,!1),r.stateNode=t;e:{switch(c=Bo(e,i),e){case"dialog":je("cancel",t),je("close",t),n=i;break;case"iframe":case"object":case"embed":je("load",t),n=i;break;case"video":case"audio":for(n=0;n<hn.length;n++)je(hn[n],t);n=i;break;case"source":je("error",t),n=i;break;case"img":case"image":case"link":je("error",t),je("load",t),n=i;break;case"details":je("toggle",t),n=i;break;case"input":Xc(t,i),n=Do(t,i),je("invalid",t);break;case"option":n=i;break;case"select":t._wrapperState={wasMultiple:!!i.multiple},n=ke({},i,{value:void 0}),je("invalid",t);break;case"textarea":Jc(t,i),n=zo(t,i),je("invalid",t);break;default:n=i}Mo(e,n),o=n;for(a in o)if(o.hasOwnProperty(a)){var l=o[a];a==="style"?ah(t,l):a==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&nh(t,l)):a==="children"?typeof l=="string"?(e!=="textarea"||l!=="")&&Nn(t,l):typeof l=="number"&&Nn(t,""+l):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Cn.hasOwnProperty(a)?l!=null&&a==="onScroll"&&je("scroll",t):l!=null&&Wl(t,a,l,c))}switch(e){case"input":ss(t),Qc(t,i,!1);break;case"textarea":ss(t),Yc(t);break;case"option":i.value!=null&&t.setAttribute("value",""+jr(i.value));break;case"select":t.multiple=!!i.multiple,a=i.value,a!=null?bi(t,!!i.multiple,a,!1):i.defaultValue!=null&&bi(t,!!i.multiple,i.defaultValue,!0);break;default:typeof n.onClick=="function"&&(t.onclick=Qs)}switch(e){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Ze(r),null;case 6:if(t&&r.stateNode!=null)Pf(t,r,t.memoizedProps,i);else{if(typeof i!="string"&&r.stateNode===null)throw Error(q(166));if(e=zr(zn.current),zr(Bt.current),ms(r)){if(i=r.stateNode,e=r.memoizedProps,i[Ft]=r,(a=i.nodeValue!==e)&&(t=ft,t!==null))switch(t.tag){case 3:fs(i.nodeValue,e,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&fs(i.nodeValue,e,(t.mode&1)!==0)}a&&(r.flags|=4)}else i=(e.nodeType===9?e:e.ownerDocument).createTextNode(i),i[Ft]=r,r.stateNode=i}return Ze(r),null;case 13:if(Se(Te),i=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_e&&ht!==null&&r.mode&1&&!(r.flags&128))Zh(),Ai(),r.flags|=98560,a=!1;else if(a=ms(r),i!==null&&i.dehydrated!==null){if(t===null){if(!a)throw Error(q(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(q(317));a[Ft]=r}else Ai(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ze(r),a=!1}else kt!==null&&(wl(kt),kt=null),a=!0;if(!a)return r.flags&65536?r:null}return r.flags&128?(r.lanes=e,r):(i=i!==null,i!==(t!==null&&t.memoizedState!==null)&&i&&(r.child.flags|=8192,r.mode&1&&(t===null||Te.current&1?ze===0&&(ze=3):Cc())),r.updateQueue!==null&&(r.flags|=4),Ze(r),null);case 4:return Di(),hl(t,r),t===null&&On(r.stateNode.containerInfo),Ze(r),null;case 10:return lc(r.type._context),Ze(r),null;case 17:return at(r.type)&&Js(),Ze(r),null;case 19:if(Se(Te),a=r.memoizedState,a===null)return Ze(r),null;if(i=(r.flags&128)!==0,c=a.rendering,c===null)if(i)rn(a,!1);else{if(ze!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(c=na(t),c!==null){for(r.flags|=128,rn(a,!1),i=c.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),r.subtreeFlags=0,i=e,e=r.child;e!==null;)a=e,t=i,a.flags&=14680066,c=a.alternate,c===null?(a.childLanes=0,a.lanes=t,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,t=c.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e=e.sibling;return we(Te,Te.current&1|2),r.child}t=t.sibling}a.tail!==null&&Oe()>Ii&&(r.flags|=128,i=!0,rn(a,!1),r.lanes=4194304)}else{if(!i)if(t=na(c),t!==null){if(r.flags|=128,i=!0,e=t.updateQueue,e!==null&&(r.updateQueue=e,r.flags|=4),rn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!_e)return Ze(r),null}else 2*Oe()-a.renderingStartTime>Ii&&e!==1073741824&&(r.flags|=128,i=!0,rn(a,!1),r.lanes=4194304);a.isBackwards?(c.sibling=r.child,r.child=c):(e=a.last,e!==null?e.sibling=c:r.child=c,a.last=c)}return a.tail!==null?(r=a.tail,a.rendering=r,a.tail=r.sibling,a.renderingStartTime=Oe(),r.sibling=null,e=Te.current,we(Te,i?e&1|2:e&1),r):(Ze(r),null);case 22:case 23:return _c(),i=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(r.flags|=8192),i&&r.mode&1?dt&1073741824&&(Ze(r),r.subtreeFlags&6&&(r.flags|=8192)):Ze(r),null;case 24:return null;case 25:return null}throw Error(q(156,r.tag))}function lv(t,r){switch(nc(r),r.tag){case 1:return at(r.type)&&Js(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Di(),Se(st),Se(Xe),fc(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 5:return hc(r),null;case 13:if(Se(Te),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(q(340));Ai()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Se(Te),null;case 4:return Di(),null;case 10:return lc(r.type._context),null;case 22:case 23:return _c(),null;case 24:return null;default:return null}}var vs=!1,Ke=!1,cv=typeof WeakSet=="function"?WeakSet:Set,Y=null;function yi(t,r){var e=t.ref;if(e!==null)if(typeof e=="function")try{e(null)}catch(i){Re(t,r,i)}else e.current=null}function fl(t,r,e){try{e()}catch(i){Re(t,r,i)}}var Hu=!1;function uv(t,r){if(Qo=Zs,t=Dh(),rc(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else e:{e=(e=t.ownerDocument)&&e.defaultView||window;var i=e.getSelection&&e.getSelection();if(i&&i.rangeCount!==0){e=i.anchorNode;var n=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{e.nodeType,a.nodeType}catch{e=null;break e}var c=0,o=-1,l=-1,u=0,d=0,h=t,f=null;t:for(;;){for(var p;h!==e||n!==0&&h.nodeType!==3||(o=c+n),h!==a||i!==0&&h.nodeType!==3||(l=c+i),h.nodeType===3&&(c+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===e&&++u===n&&(o=c),f===a&&++d===i&&(l=c),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}e=o===-1||l===-1?null:{start:o,end:l}}else e=null}e=e||{start:0,end:0}}else e=null;for(Jo={focusedElem:t,selectionRange:e},Zs=!1,Y=r;Y!==null;)if(r=Y,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Y=t;else for(;Y!==null;){r=Y;try{var g=r.alternate;if(r.flags&1024)switch(r.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,b=g.memoizedState,x=r.stateNode,j=x.getSnapshotBeforeUpdate(r.elementType===r.type?w:Nt(r.type,w),b);x.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var S=r.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(E){Re(r,r.return,E)}if(t=r.sibling,t!==null){t.return=r.return,Y=t;break}Y=r.return}return g=Hu,Hu=!1,g}function wn(t,r,e){var i=r.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&t)===t){var a=n.destroy;n.destroy=void 0,a!==void 0&&fl(r,e,a)}n=n.next}while(n!==i)}}function _a(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var e=r=r.next;do{if((e.tag&t)===t){var i=e.create;e.destroy=i()}e=e.next}while(e!==r)}}function ml(t){var r=t.ref;if(r!==null){var e=t.stateNode;switch(t.tag){case 5:t=e;break;default:t=e}typeof r=="function"?r(t):r.current=t}}function Rf(t){var r=t.alternate;r!==null&&(t.alternate=null,Rf(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[Ft],delete r[Ln],delete r[el],delete r[Gg],delete r[Zg])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Af(t){return t.tag===5||t.tag===3||t.tag===4}function Uu(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Af(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function pl(t,r,e){var i=t.tag;if(i===5||i===6)t=t.stateNode,r?e.nodeType===8?e.parentNode.insertBefore(t,r):e.insertBefore(t,r):(e.nodeType===8?(r=e.parentNode,r.insertBefore(t,e)):(r=e,r.appendChild(t)),e=e._reactRootContainer,e!=null||r.onclick!==null||(r.onclick=Qs));else if(i!==4&&(t=t.child,t!==null))for(pl(t,r,e),t=t.sibling;t!==null;)pl(t,r,e),t=t.sibling}function gl(t,r,e){var i=t.tag;if(i===5||i===6)t=t.stateNode,r?e.insertBefore(t,r):e.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(gl(t,r,e),t=t.sibling;t!==null;)gl(t,r,e),t=t.sibling}var We=null,Tt=!1;function tr(t,r,e){for(e=e.child;e!==null;)Of(t,r,e),e=e.sibling}function Of(t,r,e){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(ga,e)}catch{}switch(e.tag){case 5:Ke||yi(e,r);case 6:var i=We,n=Tt;We=null,tr(t,r,e),We=i,Tt=n,We!==null&&(Tt?(t=We,e=e.stateNode,t.nodeType===8?t.parentNode.removeChild(e):t.removeChild(e)):We.removeChild(e.stateNode));break;case 18:We!==null&&(Tt?(t=We,e=e.stateNode,t.nodeType===8?oo(t.parentNode,e):t.nodeType===1&&oo(t,e),Pn(t)):oo(We,e.stateNode));break;case 4:i=We,n=Tt,We=e.stateNode.containerInfo,Tt=!0,tr(t,r,e),We=i,Tt=n;break;case 0:case 11:case 14:case 15:if(!Ke&&(i=e.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var a=n,c=a.destroy;a=a.tag,c!==void 0&&(a&2||a&4)&&fl(e,r,c),n=n.next}while(n!==i)}tr(t,r,e);break;case 1:if(!Ke&&(yi(e,r),i=e.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=e.memoizedProps,i.state=e.memoizedState,i.componentWillUnmount()}catch(o){Re(e,r,o)}tr(t,r,e);break;case 21:tr(t,r,e);break;case 22:e.mode&1?(Ke=(i=Ke)||e.memoizedState!==null,tr(t,r,e),Ke=i):tr(t,r,e);break;default:tr(t,r,e)}}function Wu(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var e=t.stateNode;e===null&&(e=t.stateNode=new cv),r.forEach(function(i){var n=yv.bind(null,t,i);e.has(i)||(e.add(i),i.then(n,n))})}}function Ct(t,r){var e=r.deletions;if(e!==null)for(var i=0;i<e.length;i++){var n=e[i];try{var a=t,c=r,o=c;e:for(;o!==null;){switch(o.tag){case 5:We=o.stateNode,Tt=!1;break e;case 3:We=o.stateNode.containerInfo,Tt=!0;break e;case 4:We=o.stateNode.containerInfo,Tt=!0;break e}o=o.return}if(We===null)throw Error(q(160));Of(a,c,n),We=null,Tt=!1;var l=n.alternate;l!==null&&(l.return=null),n.return=null}catch(u){Re(n,r,u)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Df(r,t),r=r.sibling}function Df(t,r){var e=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Ct(r,t),Lt(t),i&4){try{wn(3,t,t.return),_a(3,t)}catch(w){Re(t,t.return,w)}try{wn(5,t,t.return)}catch(w){Re(t,t.return,w)}}break;case 1:Ct(r,t),Lt(t),i&512&&e!==null&&yi(e,e.return);break;case 5:if(Ct(r,t),Lt(t),i&512&&e!==null&&yi(e,e.return),t.flags&32){var n=t.stateNode;try{Nn(n,"")}catch(w){Re(t,t.return,w)}}if(i&4&&(n=t.stateNode,n!=null)){var a=t.memoizedProps,c=e!==null?e.memoizedProps:a,o=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&th(n,a),Bo(o,c);var u=Bo(o,a);for(c=0;c<l.length;c+=2){var d=l[c],h=l[c+1];d==="style"?ah(n,h):d==="dangerouslySetInnerHTML"?nh(n,h):d==="children"?Nn(n,h):Wl(n,d,h,u)}switch(o){case"input":Lo(n,a);break;case"textarea":rh(n,a);break;case"select":var f=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?bi(n,!!a.multiple,p,!1):f!==!!a.multiple&&(a.defaultValue!=null?bi(n,!!a.multiple,a.defaultValue,!0):bi(n,!!a.multiple,a.multiple?[]:"",!1))}n[Ln]=a}catch(w){Re(t,t.return,w)}}break;case 6:if(Ct(r,t),Lt(t),i&4){if(t.stateNode===null)throw Error(q(162));n=t.stateNode,a=t.memoizedProps;try{n.nodeValue=a}catch(w){Re(t,t.return,w)}}break;case 3:if(Ct(r,t),Lt(t),i&4&&e!==null&&e.memoizedState.isDehydrated)try{Pn(r.containerInfo)}catch(w){Re(t,t.return,w)}break;case 4:Ct(r,t),Lt(t);break;case 13:Ct(r,t),Lt(t),n=t.child,n.flags&8192&&(a=n.memoizedState!==null,n.stateNode.isHidden=a,!a||n.alternate!==null&&n.alternate.memoizedState!==null||(jc=Oe())),i&4&&Wu(t);break;case 22:if(d=e!==null&&e.memoizedState!==null,t.mode&1?(Ke=(u=Ke)||d,Ct(r,t),Ke=u):Ct(r,t),Lt(t),i&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(Y=t,d=t.child;d!==null;){for(h=Y=d;Y!==null;){switch(f=Y,p=f.child,f.tag){case 0:case 11:case 14:case 15:wn(4,f,f.return);break;case 1:yi(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){i=f,e=f.return;try{r=i,g.props=r.memoizedProps,g.state=r.memoizedState,g.componentWillUnmount()}catch(w){Re(i,e,w)}}break;case 5:yi(f,f.return);break;case 22:if(f.memoizedState!==null){Vu(h);continue}}p!==null?(p.return=f,Y=p):Vu(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{n=h.stateNode,u?(a=n.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(o=h.stateNode,l=h.memoizedProps.style,c=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=sh("display",c))}catch(w){Re(t,t.return,w)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(w){Re(t,t.return,w)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Ct(r,t),Lt(t),i&4&&Wu(t);break;case 21:break;default:Ct(r,t),Lt(t)}}function Lt(t){var r=t.flags;if(r&2){try{e:{for(var e=t.return;e!==null;){if(Af(e)){var i=e;break e}e=e.return}throw Error(q(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(Nn(n,""),i.flags&=-33);var a=Uu(t);gl(t,a,n);break;case 3:case 4:var c=i.stateNode.containerInfo,o=Uu(t);pl(t,o,c);break;default:throw Error(q(161))}}catch(l){Re(t,t.return,l)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function dv(t,r,e){Y=t,Lf(t)}function Lf(t,r,e){for(var i=(t.mode&1)!==0;Y!==null;){var n=Y,a=n.child;if(n.tag===22&&i){var c=n.memoizedState!==null||vs;if(!c){var o=n.alternate,l=o!==null&&o.memoizedState!==null||Ke;o=vs;var u=Ke;if(vs=c,(Ke=l)&&!u)for(Y=n;Y!==null;)c=Y,l=c.child,c.tag===22&&c.memoizedState!==null?Gu(n):l!==null?(l.return=c,Y=l):Gu(n);for(;a!==null;)Y=a,Lf(a),a=a.sibling;Y=n,vs=o,Ke=u}qu(t)}else n.subtreeFlags&8772&&a!==null?(a.return=n,Y=a):qu(t)}}function qu(t){for(;Y!==null;){var r=Y;if(r.flags&8772){var e=r.alternate;try{if(r.flags&8772)switch(r.tag){case 0:case 11:case 15:Ke||_a(5,r);break;case 1:var i=r.stateNode;if(r.flags&4&&!Ke)if(e===null)i.componentDidMount();else{var n=r.elementType===r.type?e.memoizedProps:Nt(r.type,e.memoizedProps);i.componentDidUpdate(n,e.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=r.updateQueue;a!==null&&Eu(r,a,i);break;case 3:var c=r.updateQueue;if(c!==null){if(e=null,r.child!==null)switch(r.child.tag){case 5:e=r.child.stateNode;break;case 1:e=r.child.stateNode}Eu(r,c,e)}break;case 5:var o=r.stateNode;if(e===null&&r.flags&4){e=o;var l=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&e.focus();break;case"img":l.src&&(e.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var u=r.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&Pn(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}Ke||r.flags&512&&ml(r)}catch(f){Re(r,r.return,f)}}if(r===t){Y=null;break}if(e=r.sibling,e!==null){e.return=r.return,Y=e;break}Y=r.return}}function Vu(t){for(;Y!==null;){var r=Y;if(r===t){Y=null;break}var e=r.sibling;if(e!==null){e.return=r.return,Y=e;break}Y=r.return}}function Gu(t){for(;Y!==null;){var r=Y;try{switch(r.tag){case 0:case 11:case 15:var e=r.return;try{_a(4,r)}catch(l){Re(r,e,l)}break;case 1:var i=r.stateNode;if(typeof i.componentDidMount=="function"){var n=r.return;try{i.componentDidMount()}catch(l){Re(r,n,l)}}var a=r.return;try{ml(r)}catch(l){Re(r,a,l)}break;case 5:var c=r.return;try{ml(r)}catch(l){Re(r,c,l)}}}catch(l){Re(r,r.return,l)}if(r===t){Y=null;break}var o=r.sibling;if(o!==null){o.return=r.return,Y=o;break}Y=r.return}}var hv=Math.ceil,oa=er.ReactCurrentDispatcher,wc=er.ReactCurrentOwner,jt=er.ReactCurrentBatchConfig,he=0,Ue=null,De=null,qe=0,dt=0,wi=Cr(0),ze=0,Hn=null,Vr=0,Ca=0,bc=0,bn=null,rt=null,jc=0,Ii=1/0,Wt=null,la=!1,vl=null,xr=null,xs=!1,dr=null,ca=0,jn=0,xl=null,Is=-1,zs=0;function Ye(){return he&6?Oe():Is!==-1?Is:Is=Oe()}function yr(t){return t.mode&1?he&2&&qe!==0?qe&-qe:Xg.transition!==null?(zs===0&&(zs=xh()),zs):(t=ge,t!==0||(t=window.event,t=t===void 0?16:Ch(t.type)),t):1}function At(t,r,e,i){if(50<jn)throw jn=0,xl=null,Error(q(185));Zn(t,e,i),(!(he&2)||t!==Ue)&&(t===Ue&&(!(he&2)&&(Ca|=e),ze===4&&lr(t,qe)),ot(t,i),e===1&&he===0&&!(r.mode&1)&&(Ii=Oe()+500,ba&&Nr()))}function ot(t,r){var e=t.callbackNode;Xp(t,r);var i=Gs(t,t===Ue?qe:0);if(i===0)e!==null&&tu(e),t.callbackNode=null,t.callbackPriority=0;else if(r=i&-i,t.callbackPriority!==r){if(e!=null&&tu(e),r===1)t.tag===0?Kg(Zu.bind(null,t)):qh(Zu.bind(null,t)),qg(function(){!(he&6)&&Nr()}),e=null;else{switch(yh(i)){case 1:e=Kl;break;case 4:e=gh;break;case 16:e=Vs;break;case 536870912:e=vh;break;default:e=Vs}e=Wf(e,If.bind(null,t))}t.callbackPriority=r,t.callbackNode=e}}function If(t,r){if(Is=-1,zs=0,he&6)throw Error(q(327));var e=t.callbackNode;if(Ni()&&t.callbackNode!==e)return null;var i=Gs(t,t===Ue?qe:0);if(i===0)return null;if(i&30||i&t.expiredLanes||r)r=ua(t,i);else{r=i;var n=he;he|=2;var a=Ff();(Ue!==t||qe!==r)&&(Wt=null,Ii=Oe()+500,Mr(t,r));do try{pv();break}catch(o){zf(t,o)}while(!0);oc(),oa.current=a,he=n,De!==null?r=0:(Ue=null,qe=0,r=ze)}if(r!==0){if(r===2&&(n=Vo(t),n!==0&&(i=n,r=yl(t,n))),r===1)throw e=Hn,Mr(t,0),lr(t,i),ot(t,Oe()),e;if(r===6)lr(t,i);else{if(n=t.current.alternate,!(i&30)&&!fv(n)&&(r=ua(t,i),r===2&&(a=Vo(t),a!==0&&(i=a,r=yl(t,a))),r===1))throw e=Hn,Mr(t,0),lr(t,i),ot(t,Oe()),e;switch(t.finishedWork=n,t.finishedLanes=i,r){case 0:case 1:throw Error(q(345));case 2:Ar(t,rt,Wt);break;case 3:if(lr(t,i),(i&130023424)===i&&(r=jc+500-Oe(),10<r)){if(Gs(t,0)!==0)break;if(n=t.suspendedLanes,(n&i)!==i){Ye(),t.pingedLanes|=t.suspendedLanes&n;break}t.timeoutHandle=$o(Ar.bind(null,t,rt,Wt),r);break}Ar(t,rt,Wt);break;case 4:if(lr(t,i),(i&4194240)===i)break;for(r=t.eventTimes,n=-1;0<i;){var c=31-Rt(i);a=1<<c,c=r[c],c>n&&(n=c),i&=~a}if(i=n,i=Oe()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*hv(i/1960))-i,10<i){t.timeoutHandle=$o(Ar.bind(null,t,rt,Wt),i);break}Ar(t,rt,Wt);break;case 5:Ar(t,rt,Wt);break;default:throw Error(q(329))}}}return ot(t,Oe()),t.callbackNode===e?If.bind(null,t):null}function yl(t,r){var e=bn;return t.current.memoizedState.isDehydrated&&(Mr(t,r).flags|=256),t=ua(t,r),t!==2&&(r=rt,rt=e,r!==null&&wl(r)),t}function wl(t){rt===null?rt=t:rt.push.apply(rt,t)}function fv(t){for(var r=t;;){if(r.flags&16384){var e=r.updateQueue;if(e!==null&&(e=e.stores,e!==null))for(var i=0;i<e.length;i++){var n=e[i],a=n.getSnapshot;n=n.value;try{if(!Ot(a(),n))return!1}catch{return!1}}}if(e=r.child,r.subtreeFlags&16384&&e!==null)e.return=r,r=e;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function lr(t,r){for(r&=~bc,r&=~Ca,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var e=31-Rt(r),i=1<<e;t[e]=-1,r&=~i}}function Zu(t){if(he&6)throw Error(q(327));Ni();var r=Gs(t,0);if(!(r&1))return ot(t,Oe()),null;var e=ua(t,r);if(t.tag!==0&&e===2){var i=Vo(t);i!==0&&(r=i,e=yl(t,i))}if(e===1)throw e=Hn,Mr(t,0),lr(t,r),ot(t,Oe()),e;if(e===6)throw Error(q(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,Ar(t,rt,Wt),ot(t,Oe()),null}function Sc(t,r){var e=he;he|=1;try{return t(r)}finally{he=e,he===0&&(Ii=Oe()+500,ba&&Nr())}}function Gr(t){dr!==null&&dr.tag===0&&!(he&6)&&Ni();var r=he;he|=1;var e=jt.transition,i=ge;try{if(jt.transition=null,ge=1,t)return t()}finally{ge=i,jt.transition=e,he=r,!(he&6)&&Nr()}}function _c(){dt=wi.current,Se(wi)}function Mr(t,r){t.finishedWork=null,t.finishedLanes=0;var e=t.timeoutHandle;if(e!==-1&&(t.timeoutHandle=-1,Wg(e)),De!==null)for(e=De.return;e!==null;){var i=e;switch(nc(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Js();break;case 3:Di(),Se(st),Se(Xe),fc();break;case 5:hc(i);break;case 4:Di();break;case 13:Se(Te);break;case 19:Se(Te);break;case 10:lc(i.type._context);break;case 22:case 23:_c()}e=e.return}if(Ue=t,De=t=wr(t.current,null),qe=dt=r,ze=0,Hn=null,bc=Ca=Vr=0,rt=bn=null,Ir!==null){for(r=0;r<Ir.length;r++)if(e=Ir[r],i=e.interleaved,i!==null){e.interleaved=null;var n=i.next,a=e.pending;if(a!==null){var c=a.next;a.next=n,i.next=c}e.pending=i}Ir=null}return t}function zf(t,r){do{var e=De;try{if(oc(),Os.current=aa,sa){for(var i=Ee.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}sa=!1}if(qr=0,He=Ie=Ee=null,yn=!1,Fn=0,wc.current=null,e===null||e.return===null){ze=1,Hn=r,De=null;break}e:{var a=t,c=e.return,o=e,l=r;if(r=qe,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=o,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Du(c);if(p!==null){p.flags&=-257,Lu(p,c,o,a,r),p.mode&1&&Ou(a,u,r),r=p,l=u;var g=r.updateQueue;if(g===null){var w=new Set;w.add(l),r.updateQueue=w}else g.add(l);break e}else{if(!(r&1)){Ou(a,u,r),Cc();break e}l=Error(q(426))}}else if(_e&&o.mode&1){var b=Du(c);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Lu(b,c,o,a,r),sc(Li(l,o));break e}}a=l=Li(l,o),ze!==4&&(ze=2),bn===null?bn=[a]:bn.push(a),a=c;do{switch(a.tag){case 3:a.flags|=65536,r&=-r,a.lanes|=r;var x=wf(a,l,r);Tu(a,x);break e;case 1:o=l;var j=a.type,S=a.stateNode;if(!(a.flags&128)&&(typeof j.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(xr===null||!xr.has(S)))){a.flags|=65536,r&=-r,a.lanes|=r;var E=bf(a,o,r);Tu(a,E);break e}}a=a.return}while(a!==null)}Bf(e)}catch(R){r=R,De===e&&e!==null&&(De=e=e.return);continue}break}while(!0)}function Ff(){var t=oa.current;return oa.current=aa,t===null?aa:t}function Cc(){(ze===0||ze===3||ze===2)&&(ze=4),Ue===null||!(Vr&268435455)&&!(Ca&268435455)||lr(Ue,qe)}function ua(t,r){var e=he;he|=2;var i=Ff();(Ue!==t||qe!==r)&&(Wt=null,Mr(t,r));do try{mv();break}catch(n){zf(t,n)}while(!0);if(oc(),he=e,oa.current=i,De!==null)throw Error(q(261));return Ue=null,qe=0,ze}function mv(){for(;De!==null;)Mf(De)}function pv(){for(;De!==null&&!Bp();)Mf(De)}function Mf(t){var r=Uf(t.alternate,t,dt);t.memoizedProps=t.pendingProps,r===null?Bf(t):De=r,wc.current=null}function Bf(t){var r=t;do{var e=r.alternate;if(t=r.return,r.flags&32768){if(e=lv(e,r),e!==null){e.flags&=32767,De=e;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{ze=6,De=null;return}}else if(e=ov(e,r,dt),e!==null){De=e;return}if(r=r.sibling,r!==null){De=r;return}De=r=t}while(r!==null);ze===0&&(ze=5)}function Ar(t,r,e){var i=ge,n=jt.transition;try{jt.transition=null,ge=1,gv(t,r,e,i)}finally{jt.transition=n,ge=i}return null}function gv(t,r,e,i){do Ni();while(dr!==null);if(he&6)throw Error(q(327));e=t.finishedWork;var n=t.finishedLanes;if(e===null)return null;if(t.finishedWork=null,t.finishedLanes=0,e===t.current)throw Error(q(177));t.callbackNode=null,t.callbackPriority=0;var a=e.lanes|e.childLanes;if(Qp(t,a),t===Ue&&(De=Ue=null,qe=0),!(e.subtreeFlags&2064)&&!(e.flags&2064)||xs||(xs=!0,Wf(Vs,function(){return Ni(),null})),a=(e.flags&15990)!==0,e.subtreeFlags&15990||a){a=jt.transition,jt.transition=null;var c=ge;ge=1;var o=he;he|=4,wc.current=null,uv(t,e),Df(e,t),Ig(Jo),Zs=!!Qo,Jo=Qo=null,t.current=e,dv(e),Hp(),he=o,ge=c,jt.transition=a}else t.current=e;if(xs&&(xs=!1,dr=t,ca=n),a=t.pendingLanes,a===0&&(xr=null),qp(e.stateNode),ot(t,Oe()),r!==null)for(i=t.onRecoverableError,e=0;e<r.length;e++)n=r[e],i(n.value,{componentStack:n.stack,digest:n.digest});if(la)throw la=!1,t=vl,vl=null,t;return ca&1&&t.tag!==0&&Ni(),a=t.pendingLanes,a&1?t===xl?jn++:(jn=0,xl=t):jn=0,Nr(),null}function Ni(){if(dr!==null){var t=yh(ca),r=jt.transition,e=ge;try{if(jt.transition=null,ge=16>t?16:t,dr===null)var i=!1;else{if(t=dr,dr=null,ca=0,he&6)throw Error(q(331));var n=he;for(he|=4,Y=t.current;Y!==null;){var a=Y,c=a.child;if(Y.flags&16){var o=a.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(Y=u;Y!==null;){var d=Y;switch(d.tag){case 0:case 11:case 15:wn(8,d,a)}var h=d.child;if(h!==null)h.return=d,Y=h;else for(;Y!==null;){d=Y;var f=d.sibling,p=d.return;if(Rf(d),d===u){Y=null;break}if(f!==null){f.return=p,Y=f;break}Y=p}}}var g=a.alternate;if(g!==null){var w=g.child;if(w!==null){g.child=null;do{var b=w.sibling;w.sibling=null,w=b}while(w!==null)}}Y=a}}if(a.subtreeFlags&2064&&c!==null)c.return=a,Y=c;else e:for(;Y!==null;){if(a=Y,a.flags&2048)switch(a.tag){case 0:case 11:case 15:wn(9,a,a.return)}var x=a.sibling;if(x!==null){x.return=a.return,Y=x;break e}Y=a.return}}var j=t.current;for(Y=j;Y!==null;){c=Y;var S=c.child;if(c.subtreeFlags&2064&&S!==null)S.return=c,Y=S;else e:for(c=j;Y!==null;){if(o=Y,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:_a(9,o)}}catch(R){Re(o,o.return,R)}if(o===c){Y=null;break e}var E=o.sibling;if(E!==null){E.return=o.return,Y=E;break e}Y=o.return}}if(he=n,Nr(),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(ga,t)}catch{}i=!0}return i}finally{ge=e,jt.transition=r}}return!1}function Ku(t,r,e){r=Li(e,r),r=wf(t,r,1),t=vr(t,r,1),r=Ye(),t!==null&&(Zn(t,1,r),ot(t,r))}function Re(t,r,e){if(t.tag===3)Ku(t,t,e);else for(;r!==null;){if(r.tag===3){Ku(r,t,e);break}else if(r.tag===1){var i=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(xr===null||!xr.has(i))){t=Li(e,t),t=bf(r,t,1),r=vr(r,t,1),t=Ye(),r!==null&&(Zn(r,1,t),ot(r,t));break}}r=r.return}}function vv(t,r,e){var i=t.pingCache;i!==null&&i.delete(r),r=Ye(),t.pingedLanes|=t.suspendedLanes&e,Ue===t&&(qe&e)===e&&(ze===4||ze===3&&(qe&130023424)===qe&&500>Oe()-jc?Mr(t,0):bc|=e),ot(t,r)}function Hf(t,r){r===0&&(t.mode&1?(r=ls,ls<<=1,!(ls&130023424)&&(ls=4194304)):r=1);var e=Ye();t=Yt(t,r),t!==null&&(Zn(t,r,e),ot(t,e))}function xv(t){var r=t.memoizedState,e=0;r!==null&&(e=r.retryLane),Hf(t,e)}function yv(t,r){var e=0;switch(t.tag){case 13:var i=t.stateNode,n=t.memoizedState;n!==null&&(e=n.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(q(314))}i!==null&&i.delete(r),Hf(t,e)}var Uf;Uf=function(t,r,e){if(t!==null)if(t.memoizedProps!==r.pendingProps||st.current)nt=!0;else{if(!(t.lanes&e)&&!(r.flags&128))return nt=!1,av(t,r,e);nt=!!(t.flags&131072)}else nt=!1,_e&&r.flags&1048576&&Vh(r,ea,r.index);switch(r.lanes=0,r.tag){case 2:var i=r.type;Ls(t,r),t=r.pendingProps;var n=Ri(r,Xe.current);Ci(r,e),n=pc(null,r,i,t,n,e);var a=gc();return r.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,at(i)?(a=!0,Ys(r)):a=!1,r.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,uc(r),n.updater=Sa,r.stateNode=n,n._reactInternals=r,al(r,i,t,e),r=cl(null,r,i,!0,a,e)):(r.tag=0,_e&&a&&ic(r),Je(null,r,n,e),r=r.child),r;case 16:i=r.elementType;e:{switch(Ls(t,r),t=r.pendingProps,n=i._init,i=n(i._payload),r.type=i,n=r.tag=bv(i),t=Nt(i,t),n){case 0:r=ll(null,r,i,t,e);break e;case 1:r=Fu(null,r,i,t,e);break e;case 11:r=Iu(null,r,i,t,e);break e;case 14:r=zu(null,r,i,Nt(i.type,t),e);break e}throw Error(q(306,i,""))}return r;case 0:return i=r.type,n=r.pendingProps,n=r.elementType===i?n:Nt(i,n),ll(t,r,i,n,e);case 1:return i=r.type,n=r.pendingProps,n=r.elementType===i?n:Nt(i,n),Fu(t,r,i,n,e);case 3:e:{if(Cf(r),t===null)throw Error(q(387));i=r.pendingProps,a=r.memoizedState,n=a.element,Jh(t,r),ia(r,i,null,e);var c=r.memoizedState;if(i=c.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},r.updateQueue.baseState=a,r.memoizedState=a,r.flags&256){n=Li(Error(q(423)),r),r=Mu(t,r,i,e,n);break e}else if(i!==n){n=Li(Error(q(424)),r),r=Mu(t,r,i,e,n);break e}else for(ht=gr(r.stateNode.containerInfo.firstChild),ft=r,_e=!0,kt=null,e=Xh(r,null,i,e),r.child=e;e;)e.flags=e.flags&-3|4096,e=e.sibling;else{if(Ai(),i===n){r=$t(t,r,e);break e}Je(t,r,i,e)}r=r.child}return r;case 5:return Yh(r),t===null&&il(r),i=r.type,n=r.pendingProps,a=t!==null?t.memoizedProps:null,c=n.children,Yo(i,n)?c=null:a!==null&&Yo(i,a)&&(r.flags|=32),_f(t,r),Je(t,r,c,e),r.child;case 6:return t===null&&il(r),null;case 13:return Nf(t,r,e);case 4:return dc(r,r.stateNode.containerInfo),i=r.pendingProps,t===null?r.child=Oi(r,null,i,e):Je(t,r,i,e),r.child;case 11:return i=r.type,n=r.pendingProps,n=r.elementType===i?n:Nt(i,n),Iu(t,r,i,n,e);case 7:return Je(t,r,r.pendingProps,e),r.child;case 8:return Je(t,r,r.pendingProps.children,e),r.child;case 12:return Je(t,r,r.pendingProps.children,e),r.child;case 10:e:{if(i=r.type._context,n=r.pendingProps,a=r.memoizedProps,c=n.value,we(ta,i._currentValue),i._currentValue=c,a!==null)if(Ot(a.value,c)){if(a.children===n.children&&!st.current){r=$t(t,r,e);break e}}else for(a=r.child,a!==null&&(a.return=r);a!==null;){var o=a.dependencies;if(o!==null){c=a.child;for(var l=o.firstContext;l!==null;){if(l.context===i){if(a.tag===1){l=Xt(-1,e&-e),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}a.lanes|=e,l=a.alternate,l!==null&&(l.lanes|=e),nl(a.return,e,r),o.lanes|=e;break}l=l.next}}else if(a.tag===10)c=a.type===r.type?null:a.child;else if(a.tag===18){if(c=a.return,c===null)throw Error(q(341));c.lanes|=e,o=c.alternate,o!==null&&(o.lanes|=e),nl(c,e,r),c=a.sibling}else c=a.child;if(c!==null)c.return=a;else for(c=a;c!==null;){if(c===r){c=null;break}if(a=c.sibling,a!==null){a.return=c.return,c=a;break}c=c.return}a=c}Je(t,r,n.children,e),r=r.child}return r;case 9:return n=r.type,i=r.pendingProps.children,Ci(r,e),n=St(n),i=i(n),r.flags|=1,Je(t,r,i,e),r.child;case 14:return i=r.type,n=Nt(i,r.pendingProps),n=Nt(i.type,n),zu(t,r,i,n,e);case 15:return jf(t,r,r.type,r.pendingProps,e);case 17:return i=r.type,n=r.pendingProps,n=r.elementType===i?n:Nt(i,n),Ls(t,r),r.tag=1,at(i)?(t=!0,Ys(r)):t=!1,Ci(r,e),yf(r,i,n),al(r,i,n,e),cl(null,r,i,!0,t,e);case 19:return Tf(t,r,e);case 22:return Sf(t,r,e)}throw Error(q(156,r.tag))};function Wf(t,r){return ph(t,r)}function wv(t,r,e,i){this.tag=t,this.key=e,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(t,r,e,i){return new wv(t,r,e,i)}function Nc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function bv(t){if(typeof t=="function")return Nc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Vl)return 11;if(t===Gl)return 14}return 2}function wr(t,r){var e=t.alternate;
vendor: 9,591 bytes, line 40
40return e===null?(e=bt(t.tag,r,t.key,t.mode),e.elementType=t.elementType,e.type=t.type,e.stateNode=t.stateNode,e.alternate=t,t.alternate=e):(e.pendingProps=r,e.type=t.type,e.flags=0,e.subtreeFlags=0,e.deletions=null),e.flags=t.flags&14680064,e.childLanes=t.childLanes,e.lanes=t.lanes,e.child=t.child,e.memoizedProps=t.memoizedProps,e.memoizedState=t.memoizedState,e.updateQueue=t.updateQueue,r=t.dependencies,e.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},e.sibling=t.sibling,e.index=t.index,e.ref=t.ref,e}function Fs(t,r,e,i,n,a){var c=2;if(i=t,typeof t=="function")Nc(t)&&(c=1);else if(typeof t=="string")c=5;else e:switch(t){case ui:return Br(e.children,n,a,r);case ql:c=8,n|=8;break;case Po:return t=bt(12,e,r,n|2),t.elementType=Po,t.lanes=a,t;case Ro:return t=bt(13,e,r,n),t.elementType=Ro,t.lanes=a,t;case Ao:return t=bt(19,e,r,n),t.elementType=Ao,t.lanes=a,t;case Yd:return Na(e,n,a,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Qd:c=10;break e;case Jd:c=9;break e;case Vl:c=11;break e;case Gl:c=14;break e;case nr:c=16,i=null;break e}throw Error(q(130,t==null?t:typeof t,""))}return r=bt(c,e,r,n),r.elementType=t,r.type=i,r.lanes=a,r}function Br(t,r,e,i){return t=bt(7,t,i,r),t.lanes=e,t}function Na(t,r,e,i){return t=bt(22,t,i,r),t.elementType=Yd,t.lanes=e,t.stateNode={isHidden:!1},t}function go(t,r,e){return t=bt(6,t,null,r),t.lanes=e,t}function vo(t,r,e){return r=bt(4,t.children!==null?t.children:[],t.key,r),r.lanes=e,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function jv(t,r,e,i,n){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qa(0),this.expirationTimes=Qa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qa(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function Tc(t,r,e,i,n,a,c,o,l){return t=new jv(t,r,e,o,l),r===1?(r=1,a===!0&&(r|=8)):r=0,a=bt(3,null,null,r),t.current=a,a.stateNode=t,a.memoizedState={element:i,isDehydrated:e,cache:null,transitions:null,pendingSuspenseBoundaries:null},uc(a),t}function Sv(t,r,e){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ci,key:i==null?null:""+i,children:t,containerInfo:r,implementation:e}}function qf(t){if(!t)return Sr;t=t._reactInternals;e:{if(Xr(t)!==t||t.tag!==1)throw Error(q(170));var r=t;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(at(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(q(171))}if(t.tag===1){var e=t.type;if(at(e))return Wh(t,e,r)}return r}function Vf(t,r,e,i,n,a,c,o,l){return t=Tc(e,i,!0,t,n,a,c,o,l),t.context=qf(null),e=t.current,i=Ye(),n=yr(e),a=Xt(i,n),a.callback=r??null,vr(e,a,n),t.current.lanes=n,Zn(t,n,i),ot(t,i),t}function Ta(t,r,e,i){var n=r.current,a=Ye(),c=yr(n);return e=qf(e),r.context===null?r.context=e:r.pendingContext=e,r=Xt(a,c),r.payload={element:t},i=i===void 0?null:i,i!==null&&(r.callback=i),t=vr(n,r,c),t!==null&&(At(t,n,c,a),As(t,n,c)),c}function da(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Xu(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var e=t.retryLane;t.retryLane=e!==0&&e<r?e:r}}function Ec(t,r){Xu(t,r),(t=t.alternate)&&Xu(t,r)}function _v(){return null}var Gf=typeof reportError=="function"?reportError:function(t){console.error(t)};function kc(t){this._internalRoot=t}Ea.prototype.render=kc.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(q(409));Ta(t,r,null,null)};Ea.prototype.unmount=kc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Gr(function(){Ta(null,t,null,null)}),r[Jt]=null}};function Ea(t){this._internalRoot=t}Ea.prototype.unstable_scheduleHydration=function(t){if(t){var r=jh();t={blockedOn:null,target:t,priority:r};for(var e=0;e<or.length&&r!==0&&r<or[e].priority;e++);or.splice(e,0,t),e===0&&_h(t)}};function Pc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function ka(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Qu(){}function Cv(t,r,e,i,n){if(n){if(typeof i=="function"){var a=i;i=function(){var u=da(c);a.call(u)}}var c=Vf(r,i,t,0,null,!1,!1,"",Qu);return t._reactRootContainer=c,t[Jt]=c.current,On(t.nodeType===8?t.parentNode:t),Gr(),c}for(;n=t.lastChild;)t.removeChild(n);if(typeof i=="function"){var o=i;i=function(){var u=da(l);o.call(u)}}var l=Tc(t,0,!1,null,null,!1,!1,"",Qu);return t._reactRootContainer=l,t[Jt]=l.current,On(t.nodeType===8?t.parentNode:t),Gr(function(){Ta(r,l,e,i)}),l}function Pa(t,r,e,i,n){var a=e._reactRootContainer;if(a){var c=a;if(typeof n=="function"){var o=n;n=function(){var l=da(c);o.call(l)}}Ta(r,c,t,n)}else c=Cv(e,r,t,n,i);return da(c)}wh=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var e=dn(r.pendingLanes);e!==0&&(Xl(r,e|1),ot(r,Oe()),!(he&6)&&(Ii=Oe()+500,Nr()))}break;case 13:Gr(function(){var i=Yt(t,1);if(i!==null){var n=Ye();At(i,t,1,n)}}),Ec(t,1)}};Ql=function(t){if(t.tag===13){var r=Yt(t,134217728);if(r!==null){var e=Ye();At(r,t,134217728,e)}Ec(t,134217728)}};bh=function(t){if(t.tag===13){var r=yr(t),e=Yt(t,r);if(e!==null){var i=Ye();At(e,t,r,i)}Ec(t,r)}};jh=function(){return ge};Sh=function(t,r){var e=ge;try{return ge=t,r()}finally{ge=e}};Uo=function(t,r,e){switch(r){case"input":if(Lo(t,e),r=e.name,e.type==="radio"&&r!=null){for(e=t;e.parentNode;)e=e.parentNode;for(e=e.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<e.length;r++){var i=e[r];if(i!==t&&i.form===t.form){var n=wa(i);if(!n)throw Error(q(90));eh(i),Lo(i,n)}}}break;case"textarea":rh(t,e);break;case"select":r=e.value,r!=null&&bi(t,!!e.multiple,r,!1)}};ch=Sc;uh=Gr;var Nv={usingClientEntryPoint:!1,Events:[Xn,mi,wa,oh,lh,Sc]},nn={findFiberByHostInstance:Lr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Tv={bundleType:nn.bundleType,version:nn.version,rendererPackageName:nn.rendererPackageName,rendererConfig:nn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:er.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=fh(t),t===null?null:t.stateNode},findFiberByHostInstance:nn.findFiberByHostInstance||_v,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ys=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ys.isDisabled&&ys.supportsFiber)try{ga=ys.inject(Tv),Mt=ys}catch{}}gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nv;gt.createPortal=function(t,r){var e=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pc(r))throw Error(q(200));return Sv(t,r,null,e)};gt.createRoot=function(t,r){if(!Pc(t))throw Error(q(299));var e=!1,i="",n=Gf;return r!=null&&(r.unstable_strictMode===!0&&(e=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(n=r.onRecoverableError)),r=Tc(t,1,!1,null,null,e,!1,i,n),t[Jt]=r.current,On(t.nodeType===8?t.parentNode:t),new kc(r)};gt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(q(188)):(t=Object.keys(t).join(","),Error(q(268,t)));return t=fh(r),t=t===null?null:t.stateNode,t};gt.flushSync=function(t){return Gr(t)};gt.hydrate=function(t,r,e){if(!ka(r))throw Error(q(200));return Pa(null,t,r,!0,e)};gt.hydrateRoot=function(t,r,e){if(!Pc(t))throw Error(q(405));var i=e!=null&&e.hydratedSources||null,n=!1,a="",c=Gf;if(e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(a=e.identifierPrefix),e.onRecoverableError!==void 0&&(c=e.onRecoverableError)),r=Vf(r,null,t,1,e??null,n,!1,a,c),t[Jt]=r.current,On(t),i)for(t=0;t<i.length;t++)e=i[t],n=e._getVersion,n=n(e._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[e,n]:r.mutableSourceEagerHydrationData.push(e,n);return new Ea(r)};gt.render=function(t,r,e){if(!ka(r))throw Error(q(200));return Pa(null,t,r,!1,e)};gt.unmountComponentAtNode=function(t){if(!ka(t))throw Error(q(40));return t._reactRootContainer?(Gr(function(){Pa(null,null,t,!1,function(){t._reactRootContainer=null,t[Jt]=null})}),!0):!1};gt.unstable_batchedUpdates=Sc;gt.unstable_renderSubtreeIntoContainer=function(t,r,e,i){if(!ka(e))throw Error(q(200));if(t==null||t._reactInternals===void 0)throw Error(q(38));return Pa(t,r,e,!1,i)};gt.version="18.3.1-next-f1338f8080-20240426";function Zf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zf)}catch(t){console.error(t)}}Zf(),Gd.exports=gt;var Ev=Gd.exports,Kf,Ju=Ev;Kf=Ju.createRoot,Ju.hydrateRoot;var kv=typeof Element<"u",Pv=typeof Map=="function",Rv=typeof Set=="function",Av=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ms(t,r){if(t===r)return!0;
40if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var e,i,n;if(Array.isArray(t)){if(e=t.length,e!=r.length)return!1;for(i=e;i--!==0;)if(!Ms(t[i],r[i]))return!1;return!0}var a;if(Pv&&t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(a=t.entries();!(i=a.next()).done;)if(!r.has(i.value[0]))return!1;for(a=t.entries();!(i=a.next()).done;)if(!Ms(i.value[1],r.get(i.value[0])))return!1;return!0}if(Rv&&t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(a=t.entries();!(i=a.next()).done;)if(!r.has(i.value[0]))return!1;return!0}if(Av&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(e=t.length,e!=r.length)return!1;for(i=e;i--!==0;)if(t[i]!==r[i])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof r.valueOf=="function")return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof r.toString=="function")return t.toString()===r.toString();if(n=Object.keys(t),e=n.length,e!==Object.keys(r).length)return!1;for(i=e;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,n[i]))return!1;if(kv&&t instanceof Element)return!1;for(i=e;i--!==0;)if(!((n[i]==="_owner"||n[i]==="__v"||n[i]==="__o")&&t.$$typeof)&&!Ms(t[n[i]],r[n[i]]))return!1;return!0}return t!==t&&r!==r}var Ov=function(r,e){try{return Ms(r,e)}catch(i){if((i.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw i}};const Dv=Hi(Ov);var Lv=function(t,r,e,i,n,a,c,o){if(!t){var l;if(r===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[e,i,n,a,c,o],d=0;l=new Error(r.replace(/%s/g,function(){return u[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},Iv=Lv;const Yu=Hi(Iv);
40var zv=function(r,e,i,n){var a=i?i.call(n,r,e):void 0;if(a!==void 0)return!!a;if(r===e)return!0;if(typeof r!="object"||!r||typeof e!="object"||!e)return!1;var c=Object.keys(r),o=Object.keys(e);if(c.length!==o.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(e),u=0;u<c.length;u++){var d=c[u];if(!l(d))return!1;var h=r[d],f=e[d];if(a=i?i.call(n,h,f,d):void 0,a===!1||a===void 0&&h!==f)return!1}return!0};const Fv=Hi(zv);var Xf=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(Xf||{}),xo={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},$u=Object.values(Xf),Rc={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Mv=Object.entries(Rc).reduce((t,[r,e])=>(t[e]=r,t),{}),Pt="data-rh",Ti={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Ei=(t,r)=>{for(let e=t.length-1;e>=0;e-=1){const i=t[e];if(Object.prototype.hasOwnProperty.call(i,r))return i[r]}return null},Bv=t=>{let r=Ei(t,"title");const e=Ei(t,Ti.TITLE_TEMPLATE);if(Array.isArray(r)&&(r=r.join("")),e&&r)return e.replace(/%s/g,()=>r);const i=Ei(t,Ti.DEFAULT_TITLE);return r||i||void 0},Hv=t=>Ei(t,Ti.ON_CHANGE_CLIENT_STATE)||(()=>{}),yo=(t,r)=>r.filter(e=>typeof e[t]<"u").map(e=>e[t]).reduce((e,i)=>({...e,...i}),{}),Uv=(t,r)=>r.filter(e=>typeof e.base<"u").map(e=>e.base).reverse().reduce((e,i)=>{if(!e.length){const n=Object.keys(i);for(let a=0;a<n.length;a+=1){const o=n[a].toLowerCase();if(t.indexOf(o)!==-1&&i[o])return e.concat(i)}}return e},[]),Wv=t=>console&&typeof console.warn=="function"&&console.warn(t),sn=(t,r,e)=>{const i={};return e.filter(n=>Array.isArray(n[t])?!0:(typeof n[t]<"u"&&Wv(`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`),!1)).map(n=>n[t]).reverse().reduce((n,a)=>{const c={};a.filter(l=>{let u;const d=Object.keys(l);for(let f=0;f<d.length;f+=1){const p=d[f],g=p.toLowerCase();r.indexOf(g)!==-1&&!(u==="rel"&&l[u].toLowerCase()==="canonical")&&!(g==="rel"&&l[g].toLowerCase()==="stylesheet")&&(u=g),r.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(u=p)}if(!u||!l[u])return!1;const h=l[u].toLowerCase();return i[u]||(i[u]={}),c[u]||(c[u]={}),i[u][h]?!1:(c[u][h]=!0,!0)}).reverse().forEach(l=>n.push(l));const o=Object.keys(c);for(let l=0;l<o.length;l+=1){const u=o[l],d={...i[u],...c[u]};i[u]=d}return n},[]).reverse()},qv=(t,r)=>{if(Array.isArray(t)&&t.length){for(let e=0;e<t.length;e+=1)if(t[e][r])return!0}return!1},Vv=t=>({baseTag:Uv(["href"],t),bodyAttributes:yo("bodyAttributes",t),defer:Ei(t,Ti.DEFER),encode:Ei(t,Ti.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:yo("htmlAttributes",t),linkTags:sn("link",["rel","href"],t),metaTags:sn("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:sn("noscript",["innerHTML"],t),onChangeClientState:Hv(t),scriptTags:sn("script",["src","innerHTML"],t),styleTags:sn("style",["cssText"],t),title:Bv(t),titleAttributes:yo("titleAttributes",t),prioritizeSeoTags:qv(t,Ti.PRIORITIZE_SEO_TAGS)}),Qf=t=>Array.isArray(t)?t.join(""):t,Gv=(t,r)=>{const e=Object.keys(t);for(let i=0;i<e.length;i+=1)if(r[e[i]]&&r[e[i]].includes(t[e[i]]))return!0;return!1},wo=(t,r)=>Array.isArray(t)?t.reduce((e,i)=>(Gv(i,r)?e.priority.push(i):e.default.push(i),e),{priority:[],default:[]}):{default:t,priority:[]},ed=(t,r)=>({...t,[r]:void 0}),Zv=["noscript","script","style"],bl=(t,r=!0)=>r===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),Jf=t=>Object.keys(t).reduce((r,e)=>{const i=typeof t[e]<"u"?`${e}="${t[e]}"`:`${e}`;return r?`${r} ${i}`:i},""),Kv=(t,r,e,i)=>{const n=Jf(e),a=Qf(r);return n?`<${t} ${Pt}="true" ${n}>${bl(a,i)}</${t}>`:`<${t} ${Pt}="true">${bl(a,i)}</${t}>`},Xv=(t,r,e=!0)=>r.reduce((i,n)=>{const a=n,c=Object.keys(a).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const h=typeof a[d]>"u"?d:`${d}="${bl(a[d],e)}"`;return u?`${u} ${h}`:h},""),o=a.innerHTML||a.cssText||"",l=Zv.indexOf(t)===-1;return`${i}<${t} ${Pt}="true" ${c}${l?"/>":`>${o}</${t}>`}`},""),Yf=(t,r={})=>Object.keys(t).reduce((e,i)=>{const n=Rc[i];return e[n||i]=t[i],e},r),Qv=(t,r,e)=>{const i={key:r,[Pt]:!0},n=Yf(e,i);return[Gt.createElement("title",n,r)]},Bs=(t,r)=>r.map((e,i)=>{const n={key:i,[Pt]:!0};return Object.keys(e).forEach(a=>{const o=Rc[a]||a;if(o==="innerHTML"||o==="cssText"){const l=e.innerHTML||e.cssText;n.dangerouslySetInnerHTML={__html:l}}else n[o]=e[a]}),Gt.createElement(t,n)}),xt=(t,r,e=!0)=>{switch(t){case"title":return{toComponent:()=>Qv(t,r.title,r.titleAttributes),toString:()=>Kv(t,r.title,r.titleAttributes,e)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Yf(r),toString:()=>Jf(r)};default:return{toComponent:()=>Bs(t,r),toString:()=>Xv(t,r,e)}}},Jv=({metaTags:t,linkTags:r,scriptTags:e,encode:i})=>{const n=wo(t,xo.meta),a=wo(r,xo.link),c=wo(e,xo.script);return{priorityMethods:{toComponent:()=>[...Bs("meta",n.priority),...Bs("link",a.priority),...Bs("script",c.priority)],toString:()=>`${xt("meta",n.priority,i)} ${xt("link",a.priority,i)} ${xt("script",c.priority,i)}`},metaTags:n.default,linkTags:a.default,scriptTags:c.default}},Yv=t=>{const{baseTag:r,bodyAttributes:e,encode:i=!0,htmlAttributes:n,noscriptTags:a,styleTags:c,title:o="",titleAttributes:l,prioritizeSeoTags:u}=t;let{linkTags:d,metaTags:h,scriptTags:f}=t,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:d,metaTags:h,scriptTags:f}
40=Jv(t)),{priority:p,base:xt("base",r,i),bodyAttributes:xt("bodyAttributes",e,i),htmlAttributes:xt("htmlAttributes",n,i),link:xt("link",d,i),meta:xt("meta",h,i),noscript:xt("noscript",a,i),script:xt("script",f,i),style:xt("style",c,i),title:xt("title",{title:o,titleAttributes:l},i)}},jl=Yv,ws=[],$f=!!(typeof window<"u"&&window.document&&window.document.createElement),Sl=class{constructor(t,r){Ut(this,"instances",[]);Ut(this,"canUseDOM",$f);Ut(this,"context");Ut(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?ws:this.instances,add:t=>{(this.canUseDOM?ws:this.instances).push(t)},remove:t=>{const r=(this.canUseDOM?ws:this.instances).indexOf(t);(this.canUseDOM?ws:this.instances).splice(r,1)}}});this.context=t,this.canUseDOM=r||!1,r||(t.helmet=jl({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},$v={},em=Gt.createContext($v),Fr,tm=(Fr=class extends T.Component{constructor(e){super(e);Ut(this,"helmetData");this.helmetData=new Sl(this.props.context||{},Fr.canUseDOM)}render(){return Gt.createElement(em.Provider,{value:this.helmetData.value},this.props.children)}},Ut(Fr,"canUseDOM",$f),Fr),ni=(t,r)=>{const e=document.head||document.querySelector("head"),i=e.querySelectorAll(`${t}[${Pt}]`),n=[].slice.call(i),a=[];let c;return r&&r.length&&r.forEach(o=>{const l=document.createElement(t);for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u))if(u==="innerHTML")l.innerHTML=o.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=o.cssText:l.appendChild(document.createTextNode(o.cssText));else{const d=u,h=typeof o[d]>"u"?"":o[d];l.setAttribute(u,h)}l.setAttribute(Pt,"true"),n.some((u,d)=>(c=d,l.isEqualNode(u)))?n.splice(c,1):a.push(l)}),n.forEach(o=>{var l;return(l=o.parentNode)==null?void 0:l.removeChild(o)}),a.forEach(o=>e.appendChild(o)),{oldTags:n,newTags:a}},_l=(t,r)=>{const e=document.getElementsByTagName(t)[0];if(!e)return;const i=e.getAttribute(Pt),n=i?i.split(","):[],a=[...n],c=Object.keys(r);for(const o of c){const l=r[o]||"";e.getAttribute(o)!==l&&e.setAttribute(o,l),n.indexOf(o)===-1&&n.push(o);const u=a.indexOf(o);u!==-1&&a.splice(u,1)}for(let o=a.length-1;o>=0;o-=1)e.removeAttribute(a[o]);n.length===a.length?e.removeAttribute(Pt):e.getAttribute(Pt)!==c.join(",")&&e.setAttribute(Pt,c.join(","))},ex=(t,r)=>{typeof t<"u"&&document.title!==t&&(document.title=Qf(t)),_l("title",r)},td=(t,r)=>{const{baseTag:e,bodyAttributes:i,htmlAttributes:n,linkTags:a,metaTags:c,noscriptTags:o,onChangeClientState:l,scriptTags:u,styleTags:d,title:h,titleAttributes:f}=t;_l("body",i),_l("html",n),ex(h,f);const p={baseTag:ni("base",e),linkTags:ni("link",a),metaTags:ni("meta",c),noscriptTags:ni("noscript",o),scriptTags:ni("script",u),styleTags:ni("style",d)},g={},w={};Object.keys(p).forEach(b=>{const{newTags:x,oldTags:j}=p[b];x.length&&(g[b]=x),j.length&&(w[b]=p[b].oldTags)}),r&&r(),l(t,g,w)},an=null,tx=t=>{an&&cancelAnimationFrame(an),t.defer?an=requestAnimationFrame(()=>{td(t,()=>{an=null})}):(td(t),an=null)},rx=tx,rd=class extends T.Component{constructor(){super(...arguments);Ut(this,"rendered",!1)}shouldComponentUpdate(r){return!Fv(r,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:r}=this.props.context;r.remove(this),this.emitChange()}emitChange(){const{helmetInstances:r,setHelmet:e}=this.props.context;let i=null;const n=Vv(r.get().map(a=>{const c={...a.props};return delete c.context,c}));tm.canUseDOM?rx(n):jl&&(i=jl(n)),e(i)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:r}=this.props.context;r.add(this),this.emitChange()}render(){return this.init(),null}},Eo,Tr=(Eo=class extends T.Component{shouldComponentUpdate(t){return!Dv(ed(this.props,"helmetData"),ed(t,"helmetData"))}mapNestedChildrenToProps(t,r){if(!r)return null;switch(t.type){case"script":case"noscript":return{innerHTML:r};case"style":return{cssText:r};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,r,e,i){return{...r,[t.type]:[...r[t.type]||[],{...e,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,r,e,i){switch(t.type){case"title":return{...r,[t.type]:i,titleAttributes:{...e}};case"body":return{...r,bodyAttributes:{...e}};case"html":return{...r,htmlAttributes:{...e}};default:return{...r,[t.type]:{...e}}}}mapArrayTypeChildrenToProps(t,r){let e={...r};return Object.keys(t).forEach(i=>
40{e={...e,[i]:t[i]}}),e}warnOnInvalidChildren(t,r){return Yu($u.some(e=>t.type===e),typeof t.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${$u.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),Yu(!r||typeof r=="string"||Array.isArray(r)&&!r.some(e=>typeof e!="string"),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,r){let e={};return Gt.Children.forEach(t,i=>{if(!i||!i.props)return;const{children:n,...a}=i.props,c=Object.keys(a).reduce((l,u)=>(l[Mv[u]||u]=a[u],l),{});let{type:o}=i;switch(typeof o=="symbol"?o=o.toString():this.warnOnInvalidChildren(i,n),o){case"Symbol(react.fragment)":r=this.mapChildrenToProps(n,r);break;case"link":case"meta":case"noscript":case"script":case"style":e=this.flattenArrayTypeChildren(i,e,c,n);break;default:r=this.mapObjectTypeChildren(i,r,c,n);break}}),this.mapArrayTypeChildrenToProps(e,r)}render(){const{children:t,...r}=this.props;let e={...r},{helmetData:i}=r;if(t&&(e=this.mapChildrenToProps(t,e)),i&&!(i instanceof Sl)){const n=i;i=new Sl(n.context,!0),delete e.helmetData}return i?Gt.createElement(rd,{...e,context:i.value}):Gt.createElement(em.Consumer,null,n=>Gt.createElement(rd,{...e,context:n}))}},Ut(Eo,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Eo);/**
41 * @remix-run/router v1.21.1
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */function Un(){return Un=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Un.apply(this,arguments)}var hr;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(hr||(hr={}));const id="popstate";function ix(t){t===void 0&&(t={});function r(i,n){let{pathname:a,search:c,hash:o}=i.location;return Cl("",{pathname:a,search:c,hash:o},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function e(i,n){return typeof n=="string"?n:ha(n)}return sx(r,e,null,t)}function Le(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function rm(t,r){if(!t){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function nx(){return Math.random().toString(36).substr(2,8)}function nd(t,r){return{usr:t.state,key:t.key,idx:r}}function Cl(t,r,e,i){return e===void 0&&(e=null),Un({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof r=="string"?Vi(r):r,{state:e,key:r&&r.key||i||nx()})}function ha(t){let{pathname:r="/",search:e="",hash:i=""}=t;return e&&e!=="?"&&(r+=e.charAt(0)==="?"?e:"?"+e),i&&i!=="#"&&(r+=i.charAt(0)==="#"?i:"#"+i),r}function Vi(t){let r={};if(t){let e=t.indexOf("#");e>=0&&(r.hash=t.substr(e),t=t.substr(0,e));let i=t.indexOf("?");i>=0&&(r.search=t.substr(i),t=t.substr(0,i)),t&&(r.pathname=t)}return r}function sx(t,r,e,i){i===void 0&&(i={});let{window:n=document.defaultView,v5Compat:a=!1}=i,c=n.history,o=hr.Pop,l=null,u=d();u==null&&(u=0,c.replaceState(Un({},c.state,{idx:u}),""));function d(){return(c.state||{idx:null}).idx}function h(){o=hr.Pop;let b=d(),x=b==null?null:b-u;u=b,l&&l({action:o,location:w.location,delta:x})}function f(b,x){o=hr.Push;let j=Cl(w.location,b,x);u=d()+1;let S=nd(j,u),E=w.createHref(j);try{c.pushState(S,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;n.location.assign(E)}a&&l&&l({action:o,location:w.location,delta:1})}function p(b,x){o=hr.Replace;let j=Cl(w.location,b,x);u=d();let S=nd(j,u),E=w.createHref(j);c.replaceState(S,"",E),a&&l&&l({action:o,location:w.location,delta:0})}function g(b){let x=n.location.origin!=="null"?n.location.origin:n.location.href,j=typeof b=="string"?b:ha(b);return j=j.replace(/ $/,"%20"),Le(x,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,x)}let w={get action(){return o},get location(){return t(n,c)},listen(b){if(l)throw new Error("A history only accepts one active listener");return n.addEventListener(id,h),l=b,()=>{n.removeEventListener(id,h),l=null}},createHref(b){return r(n,b)},createURL:g,encodeLocation(b){let x=g(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:p,go(b){return c.go(b)}};return w}var sd;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(sd||(sd={}));function ax(t,r,e){return e===void 0&&(e="/"),ox(t,r,e,!1)}function ox(t,r,e,i){let n=typeof r=="string"?Vi(r):r,a=Ac(n.pathname||"/",e);if(a==null)return null;
vendor: 9,044 bytes, lines 49-58
49let c=im(t);lx(c);let o=null;for(let l=0;o==null&&l<c.length;++l){let u=yx(a);o=vx(c[l],u,i)}return o}function im(t,r,e,i){r===void 0&&(r=[]),e===void 0&&(e=[]),i===void 0&&(i="");let n=(a,c,o)=>{let l={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:c,route:a};l.relativePath.startsWith("/")&&(Le(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let u=br([i,l.relativePath]),d=e.concat(l);a.children&&a.children.length>0&&(Le(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),im(a.children,r,d,u)),!(a.path==null&&!a.index)&&r.push({path:u,score:px(u,a.index),routesMeta:d})};return t.forEach((a,c)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))n(a,c);else for(let l of nm(a.path))n(a,c,l)}),r}function nm(t){let r=t.split("/");if(r.length===0)return[];let[e,...i]=r,n=e.endsWith("?"),a=e.replace(/\?$/,"");if(i.length===0)return n?[a,""]:[a];let c=nm(i.join("/")),o=[];return o.push(...c.map(l=>l===""?a:[a,l].join("/"))),n&&o.push(...c),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function lx(t){t.sort((r,e)=>r.score!==e.score?e.score-r.score:gx(r.routesMeta.map(i=>i.childrenIndex),e.routesMeta.map(i=>i.childrenIndex)))}const cx=/^:[\w-]+$/,ux=3,dx=2,hx=1,fx=10,mx=-2,ad=t=>t==="*";function px(t,r){let e=t.split("/"),i=e.length;return e.some(ad)&&(i+=mx),r&&(i+=dx),e.filter(n=>!ad(n)).reduce((n,a)=>n+(cx.test(a)?ux:a===""?hx:fx),i)}function gx(t,r){return t.length===r.length&&t.slice(0,-1).every((i,n)=>i===r[n])?t[t.length-1]-r[r.length-1]:0}function vx(t,r,e){let{routesMeta:i}=t,n={},a="/",c=[];for(let o=0;o<i.length;++o){let l=i[o],u=o===i.length-1,d=a==="/"?r:r.slice(a.length)||"/",h=od({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),f=l.route;if(!h&&u&&e&&!i[i.length-1].route.index&&(h=od({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(n,h.params),c.push({params:n,pathname:br([a,h.pathname]),pathnameBase:Sx(br([a,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(a=br([a,h.pathnameBase]))}return c}function od(t,r){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[e,i]=xx(t.path,t.caseSensitive,t.end),n=r.match(e);if(!n)return null;let a=n[0],c=a.replace(/(.)\/+$/,"$1"),o=n.slice(1);return{params:i.reduce((u,d,h)=>{let{paramName:f,isOptional:p}=d;if(f==="*"){let w=o[h]||"";c=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const g=o[h];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:c,pattern:t}}function xx(t,r,e){r===void 0&&(r=!1),e===void 0&&(e=!0),rm(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let i=[],n="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,o,l)=>(i.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(i.push({paramName:"*"}),n+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):e?n+="\\/*$":t!==""&&t!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,r?void 0:"i"),i]}function yx(t){try{return t.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return rm(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+r+").")),t}}function Ac(t,r){if(r==="/")return t;if(!t.toLowerCase().startsWith(r.toLowerCase()))return null;let e=r.endsWith("/")?r.length-1:r.length,i=t.charAt(e);return i&&i!=="/"?null:t.slice(e)||"/"}function wx(t,r){r===void 0&&(r="/");let{pathname:e,search:i="",hash:n=""}=typeof t=="string"?Vi(t):t;return{pathname:e?e.startsWith("/")?e:bx(e,r):r,search:_x(i),hash:Cx(n)}}function bx(t,r){let e=r.replace(/\/+$/,"").split("/");return t.split("/").forEach(n=>{n===".."?e.length>1&&e.pop():n!=="."&&e.push(n)}),e.length>1?e.join("/"):"/"}function bo(t,r,e,i){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(i)+"].  Please separate it out to the ")+("`to."+e+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function jx(t){return t.filter((r,e)=>e===0||r.route.path&&r.route.path.length>0)}function sm(t,r){let e=jx(t);return r?e.map((i,n)=>n===e.length-1?i.pathname:i.pathnameBase):e.map(i=>i.pathnameBase)}function am(t,r,e,i){i===void 0&&(i=!1);let n;typeof t=="string"?n=Vi(t):(n=Un({},t),Le(!n.pathname||!n.pathname.includes("?"),bo("?","pathname","search",n)),Le(!n.pathname||!n.pathname.includes("#"),bo("#","pathname","hash",n)),Le(!n.search||!n.search.includes("#"),bo("#","search","hash",n)));let a=t===""||n.pathname==="",c=a?"/":n.pathname,o;if(c==null)o=e;else{let h=r.length-1;if(!i&&c.startsWith("..")){let f=c.split("/");for(;f[0]==="..";)f.shift(),h-=1;n.pathname=f.join("/")}o=h>=0?r[h]:"/"}let l=wx(n,o),u=c&&c!=="/"&&c.endsWith("/"),d=(a||c===".")&&e.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const br=t=>t.join("/").replace(/\/\/+/g,"/"),Sx=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),_x=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Cx=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Nx(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const om=["post","put","patch","delete"];new Set(om);const Tx=["get",...om];new Set(Tx);/**
50 * React Router v6.28.2
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function Wn(){return Wn=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Wn.apply(this,arguments)}const Oc=T.createContext(null),Ex=T.createContext(null),Qr=T.createContext(null),Ra=T.createContext(null),Er=T.createContext({outlet:null,matches:[],isDataRoute:!1}),lm=T.createContext(null);function kx(t,r){let{relative:e}=r===void 0?{}:r;Jn()||Le(!1);let{basename:i,navigator:n}=T.useContext(Qr),{hash:a,pathname:c,search:o}=dm(t,{relative:e}),l=c;return i!=="/"&&(l=c==="/"?i:br([i,c])),n.createHref({pathname:l,search:o,hash:a})}function Jn(){return T.useContext(Ra)!=null}function Yn(){return Jn()||Le(!1),T.useContext(Ra).location}function cm(t){T.useContext(Qr).static||T.useLayoutEffect(t)}function Px(){let{isDataRoute:t}=T.useContext(Er);return t?Wx():Rx()}function Rx(){Jn()||Le(!1);let t=T.useContext(Oc),{basename:r,future:e,navigator:i}=T.useContext(Qr),{matches:n}=T.useContext(Er),{pathname:a}=Yn(),c=JSON.stringify(sm(n,e.v7_relativeSplatPath)),o=T.useRef(!1);return cm(()=>{o.current=!0}),T.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){i.go(u);return}let h=am(u,JSON.parse(c),a,d.relative==="path");t==null&&r!=="/"&&(h.pathname=h.pathname==="/"?r:br([r,h.pathname])),(d.replace?i.replace:i.push)(h,d.state,d)},[r,i,c,a,t])}function um(){let{matches:t}=T.useContext(Er),r=t[t.length-1];return r?r.params:{}}function dm(t,r){let{relative:e}=r===void 0?{}:r,{future:i}=T.useContext(Qr),{matches:n}=T.useContext(Er),{pathname:a}=Yn(),c=JSON.stringify(sm(n,i.v7_relativeSplatPath));return T.useMemo(()=>am(t,JSON.parse(c),a,e==="path"),[t,c,a,e])}function Ax(t,r){return Ox(t,r)}function Ox(t,r,e,i){Jn()||Le(!1);let{navigator:n}=T.useContext(Qr),{matches:a}=T.useContext(Er),c=a[a.length-1],o=c?c.params:{};c&&c.pathname;let l=c?c.pathnameBase:"/";c&&c.route;let u=Yn(),d;if(r){var h;let b=typeof r=="string"?Vi(r):r;l==="/"||(h=b.pathname)!=null&&h.startsWith(l)||Le(!1),d=b}else d=u;let f=d.pathname||"/",p=f;if(l!=="/"){let b=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(b.length).join("/")}let g=ax(t,{pathname:p}),w=Fx(g&&g.map(b=>Object.assign({},b,{params:Object.assign({},o,b.params),pathname:br([l,n.encodeLocation?n.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:br([l,n.encodeLocation?n.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),a,e,i);return r&&w?T.createElement(Ra.Provider,{value:{location:Wn({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:hr.Pop}},w):w}function Dx(){let t=Ux(),r=Nx(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),e=t instanceof Error?t.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application 
58Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},r),e?T.createElement("pre",{style:n},e):null,null)}const Lx=T.createElement(Dx,null);class Ix extends T.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,e){return e.location!==r.location||e.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:e.error,location:e.location,revalidation:r.revalidation||e.revalidation}}componentDidCatch(r,e){console.error("React Router caught the following error during render",r,e)}render(){return this.state.error!==void 0?T.createElement(Er.Provider,{value:this.props.routeContext},T.createElement(lm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function zx(t){let{routeContext:r,match:e,children:i}=t,n=T.useContext(Oc);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),T.createElement(Er.Provider,{value:r},i)}function Fx(t,r,e,i){var n;if(r===void 0&&(r=[]),e===void 0&&(e=null),i===void 0&&(i=null),t==null){var a;if(!e)return null;if(e.errors)t=e.matches;else if((a=i)!=null&&a.v7_partialHydration&&r.length===0&&!e.initialized&&e.matches.length>0)t=e.matches;else return null}let c=t,o=(n=e)==null?void 0:n.errors;if(o!=null){let d=c.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||Le(!1),c=c.slice(0,Math.min(c.length,d+1))}let l=!1,u=-1;if(e&&i&&i.v7_partialHydration)for(let d=0;d<c.length;d++){let h=c[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:p}=e,g=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||g){l=!0,u>=0?c=c.slice(0,u+1):c=[c[0]];break}}}return c.reduceRight((d,h,f)=>{let p,g=!1,w=null,b=null;e&&(p=o&&h.route.id?o[h.route.id]:void 0,w=h.route.errorElement||Lx,l&&(u<0&&f===0?(g=!0,b=null):u===f&&(g=!0,b=h.route.hydrateFallbackElement||null)));let x=r.concat(c.slice(0,f+1)),j=()=>{let S;return p?S=w:g?S=b:h.route.Component?S=T.createElement(h.route.Component,null):h.route.element?S=h.route.element:S=d,T.createElement(zx,{match:h,routeContext:{outlet:d,matches:x,isDataRoute:e!=null},children:S})};return e&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?T.createElement(Ix,{location:e.location,revalidation:e.revalidation,component:w,error:p,children:j(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):j()},null)}var hm=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(hm||{}),fa=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(fa||{});function Mx(t){let r=T.useContext(Oc);return r||Le(!1),r}function Bx(t){let r=T.useContext(Ex);return r||Le(!1),r}function Hx(t){let r=T.useContext(Er);return r||Le(!1),r}function fm(t){let r=Hx(),e=r.matches[r.matches.length-1];return e.route.id||Le(!1),e.route.id}function Ux(){var t;let r=T.useContext(lm),e=Bx(fa.UseRouteError),i=fm(fa.UseRouteError);return r!==void 0?r:(t=e.errors)==null?void 0:t[i]}function Wx(){let{router:t}=Mx(hm.UseNavigateStable),r=fm(fa.UseNavigateStable),e=T.useRef(!1);return cm(()=>{e.current=!0}),T.useCallback(function(n,a){a===void 0&&(a={}),e.current&&(typeof n=="number"?t.navigate(n):t.navigate(n,Wn({fromRouteId:r},a)))},[t,r])}const ld={};function qx(t,r){ld[r]||(ld[r]=!0,console.warn(r))}const cd=(t,r,e)=>qx(t,"⚠️ React Router Future Flag Warning: "+r+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+e+"."));function Vx(t,r){(t==null?void 0:t.v7_startTransition)===void 0&&cd("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(t==null?void 0:t.v7_relativeSplatPath)===void 0&&!r&&cd("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function Qe(t){Le(!1)}function Gx(t){let{basename:r="/",children:e=null,location:i,navigationType:n=hr.Pop,navigator:a,static:c=!1,future:o}=t;Jn()&&Le(!1);let l=r.replace(/^\/*/,"/"),u=T.useMemo(()=>({basename:l,navigator:a,static:c,future:Wn({v7_relativeSplatPath:!1},o)}),[l,o,a,c]);typeof i=="string"&&(i=Vi(i));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:g="default"}=i,w=T.useMemo(()=>{let b=Ac(d,l);return b==null?null:{location:{pathname:b,search:h,hash:f,state:p,key:g},navigationType:n}},[l,d,h,f,p,g,n]);return w==null?null:T.createElement(Qr.Provider,{value:u},T.createElement(Ra.Provider,{children:e,value:w}))}function Zx(t){let{children:r,location:e}=t;return Ax(Nl(r),e)}new Promise(()=>{});function Nl(t,r){r===void 0&&(r=[]);let e=[];
58return T.Children.forEach(t,(i,n)=>{if(!T.isValidElement(i))return;let a=[...r,n];if(i.type===T.Fragment){e.push.apply(e,Nl(i.props.children,a));return}i.type!==Qe&&Le(!1),!i.props.index||!i.props.children||Le(!1);let c={id:i.props.id||a.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(c.children=Nl(i.props.children,a)),e.push(c)}),e}/**
59 * React Router DOM v6.28.2
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */function Tl(){return Tl=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Tl.apply(this,arguments)}function Kx(t,r){if(t==null)return{};var e={},i=Object.keys(t),n,a;for(a=0;a<i.length;a++)n=i[a],!(r.indexOf(n)>=0)&&(e[n]=t[n]);return e}function Xx(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Qx(t,r){return t.button===0&&(!r||r==="_self")&&!Xx(t)}const Jx=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yx="6";try{window.__reactRouterVersion=Yx}catch{}const $x="startTransition",ud=vp[$x];function ey(t){let{basename:r,children:e,future:i,window:n}=t,a=T.useRef();a.current==null&&(a.current=ix({window:n,v5Compat:!0}));let c=a.current,[o,l]=T.useState({action:c.action,location:c.location}),{v7_startTransition:u}=i||{},d=T.useCallback(h=>{u&&ud?ud(()=>l(h)):l(h)},[l,u]);return T.useLayoutEffect(()=>c.listen(d),[c,d]),T.useEffect(()=>Vx(i),[i]),T.createElement(Gx,{basename:r,children:e,location:o.location,navigationType:o.action,navigator:c,future:i})}const ty=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,le=T.forwardRef(function(r,e){let{onClick:i,relative:n,reloadDocument:a,replace:c,state:o,target:l,to:u,preventScrollReset:d,viewTransition:h}=r,f=Kx(r,Jx),{basename:p}=T.useContext(Qr),g,w=!1;if(typeof u=="string"&&ry.test(u)&&(g=u,ty))try{let S=new URL(window.location.href),E=u.startsWith("//")?new URL(S.protocol+u):new URL(u),R=Ac(E.pathname,p);E.origin===S.origin&&R!=null?u=R+E.search+E.hash:w=!0}catch{}let b=kx(u,{relative:n}),x=iy(u,{replace:c,state:o,target:l,preventScrollReset:d,relative:n,viewTransition:h});function j(S){i&&i(S),S.defaultPrevented||x(S)}return T.createElement("a",Tl({},f,{href:g||b,onClick:w||a?i:j,ref:e,target:l}))});var dd;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(dd||(dd={}));var hd;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(hd||(hd={}));function iy(t,r){let{target:e,replace:i,state:n,preventScrollReset:a,relative:c,viewTransition:o}=r===void 0?{}:r,l=Px(),u=Yn(),d=dm(t,{relative:c}
67);return T.useCallback(h=>{if(Qx(h,e)){h.preventDefault();let f=i!==void 0?i:ha(u)===ha(d);l(t,{replace:f,state:n,preventScrollReset:a,relative:c,viewTransition:o})}},[u,l,d,i,n,e,t,a,c,o])}const ny="modulepreload",sy=function(t){return"/"+t},fd={},zi=function(r,e,i){let n=Promise.resolve();if(e&&e.length>0){document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),o=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=Promise.allSettled(e.map(l=>{if(l=sy(l),l in fd)return;fd[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":ny,u||(h.as="script"),h.crossOrigin="",h.href=l,o&&h.setAttribute("nonce",o),document.head.appendChild(h),u)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(c){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=c,window.dispatchEvent(o),!o.defaultPrevented)throw c}return n.then(c=>{for(const o of c||[])o.status==="rejected"&&a(o.reason);return r().catch(a)})},ay=t=>{let r;return t?r=t:typeof fetch>"u"?r=(...e)=>zi(async()=>{const{default:i}=await Promise.resolve().then(()=>Gi);return{default:i}},void 0).then(({default:i})=>i(...e)):r=fetch,(...e)=>r(...e)};class Dc extends Error{constructor(r,e="FunctionsError",i){super(r),this.name=e,this.context=i}}class oy extends Dc{constructor(r){super("Failed to send a request to the Edge Function","FunctionsFetchError",r)}}class ly extends Dc{constructor(r){super("Relay Error invoking the Edge Function","FunctionsRelayError",r)}}class cy extends Dc{constructor(r){super("Edge Function returned a non-2xx status code","FunctionsHttpError",r)}}var El;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(El||(El={}));var uy=function(t,r,e,i){function n(a){return a instanceof e?a:new e(function(c){c(a)})}return new(e||(e=Promise))(function(a,c){function o(d){try{u(i.next(d))}catch(h){c(h)}}function l(d){try{u(i.throw(d))}catch(h){c(h)}}function u(d){d.done?a(d.value):n(d.value).then(o,l)}u((i=i.apply(t,r||[])).next())})};class dy{constructor(r,{headers:e={},customFetch:i,region:n=El.Any}={}){this.url=r,this.headers=e,this.region=n,this.fetch=ay(i)}setAuth(r){this.headers.Authorization=`Bearer ${r}`}invoke(r,e={}){var i;return uy(this,void 0,void 0,function*(){try{const{headers:n,method:a,body:c}=e;let o={},{region:l}=e;l||(l=this.region),l&&l!=="any"&&(o["x-region"]=l);let u;c&&(n&&!Object.prototype.hasOwnProperty.call(n,"Content-Type")||!n)&&(typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(o["Content-Type"]="application/octet-stream",u=c):typeof c=="string"?(o["Content-Type"]="text/plain",u=c):typeof FormData<"u"&&c instanceof FormData?u=c:(o["Content-Type"]="application/json",u=JSON.stringify(c)));const d=yield this.fetch(`${this.url}/${r}`,{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},o),this.headers),n),body:u}).catch(g=>{throw new oy(g)}),h=d.headers.get("x-relay-error");if(h&&h==="true")throw new ly(d);if(!d.ok)throw new cy(d);let f=((i=d.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),p;return f==="application/json"?p=yield d.json():f==="application/octet-stream"?p=yield d.blob():f==="text/event-stream"?p=d:f==="multipart/form-data"?p=yield d.formData():p=yield d.text(),{data:p,error:null}}catch(n){return{data:null,error:n}}})}}var it={},Lc={},Aa={},$n={},Oa={},Da={},hy=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Fi=hy();const fy=Fi.fetch,mm=Fi.fetch.bind(Fi),pm=Fi.Headers,my=Fi.Request,py=Fi.Response,Gi=Object.freeze(Object.defineProperty({__proto__:null,Headers:pm,Request:my,Response:py,default:mm,fetch:fy},Symbol.toStringTag,{value:"Module"})),gy=tp(Gi);var La={};Object.defineProperty(La,"__esModule",{value:!0});
67let vy=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};La.default=vy;var gm=mt&&mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Da,"__esModule",{value:!0});const xy=gm(gy),yy=gm(La);let wy=class{constructor(r){this.shouldThrowOnError=!1,this.method=r.method,this.url=r.url,this.headers=r.headers,this.schema=r.schema,this.body=r.body,this.shouldThrowOnError=r.shouldThrowOnError,this.signal=r.signal,this.isMaybeSingle=r.isMaybeSingle,r.fetch?this.fetch=r.fetch:typeof fetch>"u"?this.fetch=xy.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(r,e){return this.headers=Object.assign({},this.headers),this.headers[r]=e,this}then(r,e){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const i=this.fetch;let n=i(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{var c,o,l;let u=null,d=null,h=null,f=a.status,p=a.statusText;if(a.ok){if(this.method!=="HEAD"){const x=await a.text();x===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=x:d=JSON.parse(x))}const w=(c=this.headers.Prefer)===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),b=(o=a.headers.get("content-range"))===null||o===void 0?void 0:o.split("/");w&&b&&b.length>1&&(h=parseInt(b[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(u={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,h=null,f=406,p="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{const w=await a.text();try{u=JSON.parse(w),Array.isArray(u)&&a.status===404&&(d=[],u=null,f=200,p="OK")}catch{a.status===404&&w===""?(f=204,p="No Content"):u={message:w}}if(u&&this.isMaybeSingle&&(!((l=u==null?void 0:u.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,f=200,p="OK"),u&&this.shouldThrowOnError)throw new yy.default(u)}return{error:u,data:d,count:h,status:f,statusText:p}});return this.shouldThrowOnError||(n=n.catch(a=>{var c,o,l;return{error:{message:`${(c=a==null?void 0:a.name)!==null&&c!==void 0?c:"FetchError"}: ${a==null?void 0:a.message}`,details:`${(o=a==null?void 0:a.stack)!==null&&o!==void 0?o:""}`,hint:"",code:`${(l=a==null?void 0:a.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),n.then(r,e)}};Da.default=wy;var by=mt&&mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oa,"__esModule",{value:!0});const jy=by(Da);let Sy=class extends jy.default{select(r){let e=!1;const i=(r??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",i),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(r,{ascending:e=!0,nullsFirst:i,foreignTable:n,referencedTable:a=n}={}){const c=a?`${a}.order`:"order",o=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${o?`${o},`:""}${r}.${e?"asc":"desc"}${i===void 0?"":i?".nullsfirst":".nullslast"}`),this}limit(r,{foreignTable:e,referencedTable:i=e}={}){const n=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(n,`${r}`),this}range(r,e,{foreignTable:i,referencedTable:n=i}={}){const a=typeof n>"u"?"offset":`${n}.offset`,c=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(a,`${r}`),this.url.searchParams.set(c,`${e-r+1}`),this}abortSignal(r){return this.signal=r,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
67explain({analyze:r=!1,verbose:e=!1,settings:i=!1,buffers:n=!1,wal:a=!1,format:c="text"}={}){var o;const l=[r?"analyze":null,e?"verbose":null,i?"settings":null,n?"buffers":null,a?"wal":null].filter(Boolean).join("|"),u=(o=this.headers.Accept)!==null&&o!==void 0?o:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${c}; for="${u}"; options=${l};`,c==="json"?this:this}rollback(){var r;return((r=this.headers.Prefer)!==null&&r!==void 0?r:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Oa.default=Sy;var _y=mt&&mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($n,"__esModule",{value:!0});const Cy=_y(Oa);let Ny=class extends Cy.default{eq(r,e){return this.url.searchParams.append(r,`eq.${e}`),this}neq(r,e){return this.url.searchParams.append(r,`neq.${e}`),this}gt(r,e){return this.url.searchParams.append(r,`gt.${e}`),this}gte(r,e){return this.url.searchParams.append(r,`gte.${e}`),this}lt(r,e){return this.url.searchParams.append(r,`lt.${e}`),this}lte(r,e){return this.url.searchParams.append(r,`lte.${e}`),this}like(r,e){return this.url.searchParams.append(r,`like.${e}`),this}likeAllOf(r,e){return this.url.searchParams.append(r,`like(all).{${e.join(",")}}`),this}likeAnyOf(r,e){return this.url.searchParams.append(r,`like(any).{${e.join(",")}}`),this}ilike(r,e){return this.url.searchParams.append(r,`ilike.${e}`),this}ilikeAllOf(r,e){return this.url.searchParams.append(r,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(r,e){return this.url.searchParams.append(r,`ilike(any).{${e.join(",")}}`),this}is(r,e){return this.url.searchParams.append(r,`is.${e}`),this}in(r,e){const i=Array.from(new Set(e)).map(n=>typeof n=="string"&&new RegExp("[,()]").test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(r,`in.(${i})`),this}contains(r,e){return typeof e=="string"?this.url.searchParams.append(r,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(r,`cs.{${e.join(",")}}`):this.url.searchParams.append(r,`cs.${JSON.stringify(e)}`),this}containedBy(r,e){return typeof e=="string"?this.url.searchParams.append(r,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(r,`cd.{${e.join(",")}}`):this.url.searchParams.append(r,`cd.${JSON.stringify(e)}`),this}rangeGt(r,e){return this.url.searchParams.append(r,`sr.${e}`),this}rangeGte(r,e){return this.url.searchParams.append(r,`nxl.${e}`),this}rangeLt(r,e){return this.url.searchParams.append(r,`sl.${e}`),this}rangeLte(r,e){return this.url.searchParams.append(r,`nxr.${e}`),this}rangeAdjacent(r,e){return this.url.searchParams.append(r,`adj.${e}`),this}overlaps(r,e){return typeof e=="string"?this.url.searchParams.append(r,`ov.${e}`):this.url.searchParams.append(r,`ov.{${e.join(",")}}`),this}textSearch(r,e,{config:i,type:n}={}){let a="";n==="plain"?a="pl":n==="phrase"?a="ph":n==="websearch"&&(a="w");const c=i===void 0?"":`(${i})`;return this.url.searchParams.append(r,`${a}fts${c}.${e}`),this}match(r){return Object.entries(r).forEach(([e,i])=>{this.url.searchParams.append(e,`eq.${i}`)}),this}not(r,e,i){return this.url.searchParams.append(r,`not.${e}.${i}`),this}or(r,{foreignTable:e,referencedTable:i=e}={}){const n=i?`${i}.or`:"or";return this.url.searchParams.append(n,`(${r})`),this}filter(r,e,i){return this.url.searchParams.append(r,`${e}.${i}`),this}};$n.default=Ny;var Ty=mt&&mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Aa,"__esModule",{value:!0});const on=Ty($n);let Ey=class{constructor(r,{headers:e={},schema:i,fetch:n}){this.url=r,this.headers=e,this.schema=i,this.fetch=n}select(r,{head:e=!1,count:i}={}){const n=e?"HEAD":"GET";let a=!1;const c=(r??"*").split("").map(o=>/\s/.test(o)&&!a?"":(o==='"'&&(a=!a),o)).join("");return this.url.searchParams.set("select",c),i&&(this.headers.Prefer=`count=${i}`),new on.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(r,{count:e,defaultToNull:i=!0}={}){const n="POST",a=[];if(this.headers.Prefer&&a.push(this.headers.Prefer),e&&a.push(`count=${e}`),i||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(r)){const c=r.reduce((o,l)=>o.concat(Object.keys(l)),[]);if(c.length>
670){const o=[...new Set(c)].map(l=>`"${l}"`);this.url.searchParams.set("columns",o.join(","))}}return new on.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}upsert(r,{onConflict:e,ignoreDuplicates:i=!1,count:n,defaultToNull:a=!0}={}){const c="POST",o=[`resolution=${i?"ignore":"merge"}-duplicates`];if(e!==void 0&&this.url.searchParams.set("on_conflict",e),this.headers.Prefer&&o.push(this.headers.Prefer),n&&o.push(`count=${n}`),a||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(r)){const l=r.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){const u=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new on.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}update(r,{count:e}={}){const i="PATCH",n=[];return this.headers.Prefer&&n.push(this.headers.Prefer),e&&n.push(`count=${e}`),this.headers.Prefer=n.join(","),new on.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}delete({count:r}={}){const e="DELETE",i=[];return r&&i.push(`count=${r}`),this.headers.Prefer&&i.unshift(this.headers.Prefer),this.headers.Prefer=i.join(","),new on.default({method:e,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Aa.default=Ey;var Ia={},za={};Object.defineProperty(za,"__esModule",{value:!0});za.version=void 0;za.version="0.0.0-automated";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.DEFAULT_HEADERS=void 0;const ky=za;Ia.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${ky.version}`};var vm=mt&&mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lc,"__esModule",{value:!0});const Py=vm(Aa),Ry=vm($n),Ay=Ia;let Oy=class xm{constructor(r,{headers:e={},schema:i,fetch:n}={}){this.url=r,this.headers=Object.assign(Object.assign({},Ay.DEFAULT_HEADERS),e),this.schemaName=i,this.fetch=n}from(r){const e=new URL(`${this.url}/${r}`);return new Py.default(e,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(r){return new xm(this.url,{headers:this.headers,schema:r,fetch:this.fetch})}rpc(r,e={},{head:i=!1,get:n=!1,count:a}={}){let c;const o=new URL(`${this.url}/rpc/${r}`);let l;i||n?(c=i?"HEAD":"GET",Object.entries(e).filter(([d,h])=>h!==void 0).map(([d,h])=>[d,Array.isArray(h)?`{${h.join(",")}}`:`${h}`]).forEach(([d,h])=>{o.searchParams.append(d,h)})):(c="POST",l=e);const u=Object.assign({},this.headers);return a&&(u.Prefer=`count=${a}`),new Ry.default({method:c,url:o,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Lc.default=Oy;var Zi=mt&&mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(it,"__esModule",{value:!0});it.PostgrestError=it.PostgrestBuilder=it.PostgrestTransformBuilder=it.PostgrestFilterBuilder=it.PostgrestQueryBuilder=it.PostgrestClient=void 0;const ym=Zi(Lc);it.PostgrestClient=ym.default;const wm=Zi(Aa);it.PostgrestQueryBuilder=wm.default;const bm=Zi($n);it.PostgrestFilterBuilder=bm.default;const jm=Zi(Oa);it.PostgrestTransformBuilder=jm.default;const Sm=Zi(Da);it.PostgrestBuilder=Sm.default;const _m=Zi(La);it.PostgrestError=_m.default;var Dy=it.default={PostgrestClient:ym.default,PostgrestQueryBuilder:wm.default,PostgrestFilterBuilder:bm.default,PostgrestTransformBuilder:jm.default,PostgrestBuilder:Sm.default,PostgrestError:_m.default};const{PostgrestClient:Ly,PostgrestQueryBuilder:Lb,PostgrestFilterBuilder:Ib,PostgrestTransformBuilder:zb,PostgrestBuilder:Fb,PostgrestError:Mb}=Dy,Iy="2.11.2",zy={"X-Client-Info":`realtime-js/${Iy}`},Fy="1.0.0",Cm=1e4,My=1e3;var ki;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(ki||(ki={}));var ut;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(ut||(ut={}));var Et;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Et||(Et={}));var kl;(function(t){t.websocket="websocket"})(kl||(kl={}));var Dr;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(Dr||(Dr={}));class By{constructor(){this.HEADER_LENGTH=1}decode(r,e){return r.constructor===ArrayBuffer?e(this._binaryDecode(r)):e(typeof r=="string"?JSON.parse(r):{})}_binaryDecode(r){const e=new DataView(r),i=new TextDecoder;return this._decodeBroadcast(r,e,i)}_decodeBroadcast(r,e,i){const n=e.getUint8(1),a=e.getUint8(2);let c=this.HEADER_LENGTH+2;const o=i.decode(r.slice(c,c+n));c=c+n;const l=i.decode(r.slice(c,c+a));c=c+a;const u=JSON.parse(i.decode(r.slice(c,r.byteLength)));return{ref:null,topic:o,event:l,payload:u}}}class Nm{constructor(r,e){this.callback=r,this.timerCalc=e,this.timer=void 0,this.tries=0,this.callback=r,this.timerCalc=e}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))}}var ye;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.t
vendor: 4,686 bytes, line 67
67srange="tsrange",t.tstzrange="tstzrange"})(ye||(ye={}));const md=(t,r,e={})=>{var i;const n=(i=e.skipTypes)!==null&&i!==void 0?i:[];return Object.keys(r).reduce((a,c)=>(a[c]=Hy(c,t,r,n),a),{})},Hy=(t,r,e,i)=>{const n=r.find(o=>o.name===t),a=n==null?void 0:n.type,c=e[t];return a&&!i.includes(a)?Tm(a,c):Pl(c)},Tm=(t,r)=>{if(t.charAt(0)==="_"){const e=t.slice(1,t.length);return Vy(r,e)}switch(t){case ye.bool:return Uy(r);case ye.float4:case ye.float8:case ye.int2:case ye.int4:case ye.int8:case ye.numeric:case ye.oid:return Wy(r);case ye.json:case ye.jsonb:return qy(r);case ye.timestamp:return Gy(r);case ye.abstime:case ye.date:case ye.daterange:case ye.int4range:case ye.int8range:case ye.money:case ye.reltime:case ye.text:case ye.time:case ye.timestamptz:case ye.timetz:case ye.tsrange:case ye.tstzrange:return Pl(r);default:return Pl(r)}},Pl=t=>t,Uy=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},Wy=t=>{if(typeof t=="string"){const r=parseFloat(t);if(!Number.isNaN(r))return r}return t},qy=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(r){return console.log(`JSON parse error: ${r}`),t}return t},Vy=(t,r)=>{if(typeof t!="string")return t;const e=t.length-1,i=t[e];if(t[0]==="{"&&i==="}"){let a;const c=t.slice(1,e);try{a=JSON.parse("["+c+"]")}catch{a=c?c.split(","):[]}return a.map(o=>Tm(r,o))}return t},Gy=t=>typeof t=="string"?t.replace(" ","T"):t,Em=t=>{let r=t;return r=r.replace(/^ws/i,"http"),r=r.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),r.replace(/\/+$/,"")};class jo{constructor(r,e,i={},n=Cm){this.channel=r,this.event=e,this.payload=i,this.timeout=n,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(r){this.timeout=r,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(r){this.payload=Object.assign(Object.assign({},this.payload),r)}receive(r,e){var i;return this._hasReceived(r)&&e((i=this.receivedResp)===null||i===void 0?void 0:i.response),this.recHooks.push({status:r,callback:e}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const r=e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)};this.channel._on(this.refEvent,{},r),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(r,e){this.refEvent&&this.channel._trigger(this.refEvent,{status:r,response:e})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:r,response:e}){this.recHooks.filter(i=>i.status===r).forEach(i=>i.callback(e))}_hasReceived(r){return this.receivedResp&&this.receivedResp.status===r}}var pd;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(pd||(pd={}));class Sn{constructor(r,e){this.channel=r,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const i=(e==null?void 0:e.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(i.state,{},n=>{const{onJoin:a,onLeave:c,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Sn.syncState(this.state,n,a,c),this.pendingDiffs.forEach(l=>{this.state=Sn.syncDiff(this.state,l,a,c)}),this.pendingDiffs=[],o()}),this.channel._on(i.diff,{},n=>{const{onJoin:a,onLeave:c,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(n):(this.state=Sn.syncDiff(this.state,n,a,c),o())}),this.onJoin((n,a,c)=>{this.channel._trigger("presence",{event:"join",key:n,currentPresences:a,newPresences:c})}),this.onLeave((n,a,c)=>{this.channel._trigger("presence",{event:"leave",key:n,currentPresences:a,leftPresences:c})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(r,e,i,n){const a=this.cloneDeep(r),c=this.transformState(e),o={},l={};return this.map(a,(u,d)=>{c[u]||(l[u]=d)}),this.map(c,(u,d)=>{const h=a[u];if(h){const f=d.map(b=>b.presence_ref),p=h.map(b=>b.presence_ref),g=d.filter(b=>p.indexOf(b.presence_ref)<0),w=h.filter(b=>f.indexOf(b.presence_ref)<0);g.length>0&&(o[u]=g),w.length>0&&(l[u]=w)}else o[u]=d}),this.syncDiff(a,{joins:o,leaves:l},i,n)}static syncDiff(r,e,i,n){const{joins:a,leaves:c}={joins:this.transformState(e.joins),leaves:this.transformState(e.leaves)};
67return i||(i=()=>{}),n||(n=()=>{}),this.map(a,(o,l)=>{var u;const d=(u=r[o])!==null&&u!==void 0?u:[];if(r[o]=this.cloneDeep(l),d.length>0){const h=r[o].map(p=>p.presence_ref),f=d.filter(p=>h.indexOf(p.presence_ref)<0);r[o].unshift(...f)}i(o,d,l)}),this.map(c,(o,l)=>{let u=r[o];if(!u)return;const d=l.map(h=>h.presence_ref);u=u.filter(h=>d.indexOf(h.presence_ref)<0),r[o]=u,n(o,u,l),u.length===0&&delete r[o]}),r}static map(r,e){return Object.getOwnPropertyNames(r).map(i=>e(i,r[i]))}static transformState(r){return r=this.cloneDeep(r),Object.getOwnPropertyNames(r).reduce((e,i)=>{const n=r[i];return"metas"in n?e[i]=n.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):e[i]=n,e},{})}static cloneDeep(r){return JSON.parse(JSON.stringify(r))}onJoin(r){this.caller.onJoin=r}onLeave(r){this.caller.onLeave=r}onSync(r){this.caller.onSync=r}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var gd;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(gd||(gd={}));var vd;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(vd||(vd={}));var qt;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(qt||(qt={}));class Ic{constructor(r,e={config:{}},i){this.topic=r,this.params=e,this.socket=i,this.bindings={},this.state=ut.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=r.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},e.config),this.timeout=this.socket.timeout,this.joinPush=new jo(this,Et.join,this.params,this.timeout),this.rejoinTimer=new Nm(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ut.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=ut.closed,this.socket._remove(this)}),this._onError(n=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,n),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Et.reply,{},(n,a)=>{this._trigger(this._replyEventName(a),n)}),this.presence=new Sn(this),this.broadcastEndpointURL=Em(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(r,e=this.timeout){var i,n;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:a,presence:c,private:o}}=this.params;this._onError(d=>r==null?void 0:r(qt.CHANNEL_ERROR,d)),this._onClose(()=>r==null?void 0:r(qt.CLOSED));const l={},u={broadcast:a,presence:c,postgres_changes:(n=(i=this.bindings.postgres_changes)===null||i===void 0?void 0:i.map(d=>d.filter))!==null&&n!==void 0?n:[],private:o};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},l)),this.joinedOnce=!0,this._rejoin(e),this.joinPush.receive("ok",async({postgres_changes:d})=>{var h;if(this.socket.setAuth(),d===void 0){r==null||r(qt.SUBSCRIBED);return}else{const f=this.bindings.postgres_changes,p=(h=f==null?void 0:f.length)!==null&&h!==void 0?h:0,g=[];for(let w=0;w<p;w++){const b=f[w],{filter:{event:x,schema:j,table:S,filter:E}}=b,R=d&&d[w];if(R&&R.event===x&&R.schema===j&&R.table===S&&R.filter===E)g.push(Object.assign(Object.assign({},b),{id:R.id}));else{this.unsubscribe(),r==null||r(qt.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=g,r&&r(qt.SUBSCRIBED);return}}).receive("error",d=>{r==null||r(qt.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{r==null||r(qt.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(r,e={}){return await this.send({type:"presence",event:"track",payload:r},e.timeout||this.timeout)}async untrack(r={}){return await this.send({type:"presence",event:"untrack"},r)}on(r,e,i){return this._on(r,e,i)}async send(r,e={}){var i,n;if(!this._canPush()&&r.type==="broadcast"){const{event:a,payload:c}=r,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:c,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(i=e.timeout)!==null&&i!==void 0?i:this.timeout);return await((n=u.body)===null||n===void 0?void 0:n.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var c,o,l;const u=this._push(r.type,r,e.timeout||this.timeout);r.type==="broadcast"&&!(!((l=(o=(c=this.params)===null||c===void 0?void 0:c.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>
vendor: 4,402 bytes, lines 67-72
67a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(r){this.joinPush.updatePayload(r)}unsubscribe(r=this.timeout){this.state=ut.leaving;const e=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Et.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(i=>{const n=new jo(this,Et.leave,{},r);n.receive("ok",()=>{e(),i("ok")}).receive("timeout",()=>{e(),i("timed out")}).receive("error",()=>{i("error")}),n.send(),this._canPush()||n.trigger("ok",{})})}async _fetchWithTimeout(r,e,i){const n=new AbortController,a=setTimeout(()=>n.abort(),i),c=await this.socket.fetch(r,Object.assign(Object.assign({},e),{signal:n.signal}));return clearTimeout(a),c}_push(r,e,i=this.timeout){if(!this.joinedOnce)throw`tried to push '${r}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let n=new jo(this,r,e,i);return this._canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}_onMessage(r,e,i){return e}_isMember(r){return this.topic===r}_joinRef(){return this.joinPush.ref}_trigger(r,e,i){var n,a;const c=r.toLocaleLowerCase(),{close:o,error:l,leave:u,join:d}=Et;if(i&&[o,l,u,d].indexOf(c)>=0&&i!==this._joinRef())return;let f=this._onMessage(c,e,i);if(e&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(c)?(n=this.bindings.postgres_changes)===null||n===void 0||n.filter(p=>{var g,w,b;return((g=p.filter)===null||g===void 0?void 0:g.event)==="*"||((b=(w=p.filter)===null||w===void 0?void 0:w.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===c}).map(p=>p.callback(f,i)):(a=this.bindings[c])===null||a===void 0||a.filter(p=>{var g,w,b,x,j,S;if(["broadcast","presence","postgres_changes"].includes(c))if("id"in p){const E=p.id,R=(g=p.filter)===null||g===void 0?void 0:g.event;return E&&((w=e.ids)===null||w===void 0?void 0:w.includes(E))&&(R==="*"||(R==null?void 0:R.toLocaleLowerCase())===((b=e.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const E=(j=(x=p==null?void 0:p.filter)===null||x===void 0?void 0:x.event)===null||j===void 0?void 0:j.toLocaleLowerCase();return E==="*"||E===((S=e==null?void 0:e.event)===null||S===void 0?void 0:S.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===c}).map(p=>{if(typeof f=="object"&&"ids"in f){const g=f.data,{schema:w,table:b,commit_timestamp:x,type:j,errors:S}=g;f=Object.assign(Object.assign({},{schema:w,table:b,commit_timestamp:x,eventType:j,new:{},old:{},errors:S}),this._getPayloadRecords(g))}p.callback(f,i)})}_isClosed(){return this.state===ut.closed}_isJoined(){return this.state===ut.joined}_isJoining(){return this.state===ut.joining}_isLeaving(){return this.state===ut.leaving}_replyEventName(r){return`chan_reply_${r}`}_on(r,e,i){const n=r.toLocaleLowerCase(),a={type:n,filter:e,callback:i};return this.bindings[n]?this.bindings[n].push(a):this.bindings[n]=[a],this}_off(r,e){const i=r.toLocaleLowerCase();return this.bindings[i]=this.bindings[i].filter(n=>{var a;return!(((a=n.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===i&&Ic.isEqual(n.filter,e))}),this}static isEqual(r,e){if(Object.keys(r).length!==Object.keys(e).length)return!1;for(const i in r)if(r[i]!==e[i])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(r){this._on(Et.close,{},r)}_onError(r){this._on(Et.error,{},e=>r(e))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(r=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ut.joining,this.joinPush.resend(r))}_getPayloadRecords(r){const e={new:{},old:{}};return(r.type==="INSERT"||r.type==="UPDATE")&&(e.new=md(r.columns,r.record)),(r.type==="UPDATE"||r.type==="DELETE")&&(e.old=md(r.columns,r.old_record)),e}}const Zy=()=>{},Ky=typeof WebSocket<"u",Xy=`
68  addEventListener("message", (e) => {
69    if (e.data.event === "start") {
70      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
71    }
72  });`;class Qy{constructor(r,e){var i;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=zy,this.params={},this.timeout=Cm,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=Zy,this.conn=null,this.sendBuffer=[],this.serializer
72=new By,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=a=>{let c;return a?c=a:typeof fetch>"u"?c=(...o)=>zi(async()=>{const{default:l}=await Promise.resolve().then(()=>Gi);return{default:l}},void 0).then(({default:l})=>l(...o)):c=fetch,(...o)=>c(...o)},this.endPoint=`${r}/${kl.websocket}`,this.httpEndpoint=Em(r),e!=null&&e.transport?this.transport=e.transport:this.transport=null,e!=null&&e.params&&(this.params=e.params),e!=null&&e.headers&&(this.headers=Object.assign(Object.assign({},this.headers),e.headers)),e!=null&&e.timeout&&(this.timeout=e.timeout),e!=null&&e.logger&&(this.logger=e.logger),e!=null&&e.heartbeatIntervalMs&&(this.heartbeatIntervalMs=e.heartbeatIntervalMs);const n=(i=e==null?void 0:e.params)===null||i===void 0?void 0:i.apikey;if(n&&(this.accessTokenValue=n,this.apiKey=n),this.reconnectAfterMs=e!=null&&e.reconnectAfterMs?e.reconnectAfterMs:a=>[1e3,2e3,5e3,1e4][a-1]||1e4,this.encode=e!=null&&e.encode?e.encode:(a,c)=>c(JSON.stringify(a)),this.decode=e!=null&&e.decode?e.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new Nm(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(e==null?void 0:e.fetch),e!=null&&e.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(e==null?void 0:e.worker)||!1,this.workerUrl=e==null?void 0:e.workerUrl}this.accessToken=(e==null?void 0:e.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(Ky){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new Jy(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),zi(async()=>{const{default:r}=await import("./browser-DnAEMLow.js").then(e=>e.b);return{default:r}},[]).then(({default:r})=>{this.conn=new r(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Fy}))}disconnect(r,e){this.conn&&(this.conn.onclose=function(){},r?this.conn.close(r,e??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(r){const e=await r.unsubscribe();return this.channels.length===0&&this.disconnect(),e}async removeAllChannels(){const r=await Promise.all(this.channels.map(e=>e.unsubscribe()));return this.disconnect(),r}log(r,e,i){this.logger(r,e,i)}connectionState(){switch(this.conn&&this.conn.readyState){case ki.connecting:return Dr.Connecting;case ki.open:return Dr.Open;case ki.closing:return Dr.Closing;default:return Dr.Closed}}isConnected(){return this.connectionState()===Dr.Open}channel(r,e={config:{}}){const i=new Ic(`realtime:${r}`,e,this);return this.channels.push(i),i}push(r){const{topic:e,event:i,payload:n,ref:a}=r,c=()=>{this.encode(r,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${e} ${i} (${a})`,n),this.isConnected()?c():this.sendBuffer.push(c)}async setAuth(r=null){let e=r||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(e){let i=null;try{i=JSON.parse(atob(e.split(".")[1]))}catch{}if(i&&i.exp&&!(Math.floor(Date.now()/1e3)-i.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${i.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${i.exp}`);this.accessTokenValue=e,this.channels.forEach(n=>{e&&n.updateJoinPayload({access_token:e}),n.joinedOnce&&n._isJoined()&&n._push(Et.access_token,{access_token:e})})}}async sendHeartbeat(){var r;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(r=this.conn)===null||r===void 0||r.close(My,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(r=>r()),this.sendBuffer=[])}_makeRef(){let r=this.ref+1;return r===this.ref?this.ref=0:this.ref=r,this.ref.toString()}_leaveOpenTopic(r){let e=this.channels.find(i=>i.topic===r&&(i._isJoined()||i._isJoining()));e&&(this.log("transport",`leaving duplicate topic "${r}"`),e.unsubscribe())}_remove(r){this.channels=this.channels.filter(e=>e._joinRef()!==r._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=r=>this._onConnError(r),this.conn.onmessage=r=>
72this._onConnMessage(r),this.conn.onclose=r=>this._onConnClose(r))}_onConnMessage(r){this.decode(r.data,e=>{let{topic:i,event:n,payload:a,ref:c}=e;c&&c===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${a.status||""} ${i} ${n} ${c&&"("+c+")"||""}`,a),this.channels.filter(o=>o._isMember(i)).forEach(o=>o._trigger(n,a,c)),this.stateChangeCallbacks.message.forEach(o=>o(e))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const r=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(r),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this.workerRef.terminate()},this.workerRef.onmessage=e=>{e.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(r=>r())}_onConnClose(r){this.log("transport","close",r),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(e=>e(r))}_onConnError(r){this.log("transport",r.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(e=>e(r))}_triggerChanError(){this.channels.forEach(r=>r._trigger(Et.error))}_appendParams(r,e){if(Object.keys(e).length===0)return r;const i=r.match(/\?/)?"&":"?",n=new URLSearchParams(e);return`${r}${i}${n}`}_workerObjectUrl(r){let e;if(r)e=r;else{const i=new Blob([Xy],{type:"application/javascript"});e=URL.createObjectURL(i)}return e}}class Jy{constructor(r,e,i){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=ki.connecting,this.send=()=>{},this.url=null,this.url=r,this.close=i.close}}class zc extends Error{constructor(r){super(r),this.__isStorageError=!0,this.name="StorageError"}}function Be(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class Yy extends zc{constructor(r,e){super(r),this.name="StorageApiError",this.status=e}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class Rl extends zc{constructor(r,e){super(r),this.name="StorageUnknownError",this.originalError=e}}var $y=function(t,r,e,i){function n(a){return a instanceof e?a:new e(function(c){c(a)})}return new(e||(e=Promise))(function(a,c){function o(d){try{u(i.next(d))}catch(h){c(h)}}function l(d){try{u(i.throw(d))}catch(h){c(h)}}function u(d){d.done?a(d.value):n(d.value).then(o,l)}u((i=i.apply(t,r||[])).next())})};const km=t=>{let r;return t?r=t:typeof fetch>"u"?r=(...e)=>zi(async()=>{const{default:i}=await Promise.resolve().then(()=>Gi);return{default:i}},void 0).then(({default:i})=>i(...e)):r=fetch,(...e)=>r(...e)},e0=()=>$y(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield zi(()=>Promise.resolve().then(()=>Gi),void 0)).Response:Response}),Al=t=>{if(Array.isArray(t))return t.map(e=>Al(e));if(typeof t=="function"||t!==Object(t))return t;const r={};return Object.entries(t).forEach(([e,i])=>{const n=e.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));r[n]=Al(i)}),r};var Jr=function(t,r,e,i){function n(a){return a instanceof e?a:new e(function(c){c(a)})}return new(e||(e=Promise))(function(a,c){function o(d){try{u(i.next(d))}catch(h){c(h)}}function l(d){try{u(i.throw(d))}catch(h){c(h)}}function u(d){d.done?a(d.value):n(d.value).then(o,l)}u((i=i.apply(t,r||[])).next())})};const So=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),t0=(t,r,e)=>Jr(void 0,void 0,void 0,function*(){const i=yield e0();t instanceof i&&!(e!=null&&e.noResolveJson)?t.json().then(n=>{r(new Yy(So(n),t.status||500))}).catch(n=>{r(new Rl(So(n),n))}):r(new Rl(So(t),t))}),r0=(t,r,e,i)=>{const n={method:t,headers:(r==null?void 0:r.headers)||{}};return t==="GET"?n:(n.headers=Object.assign({"Content-Type":"application/json"},r==null?void 0:r.headers),i&&(n.body=JSON.stringify(i)),Object.assign(Object.assign({},n),e))};function es(t,r,e,i,n,a){return Jr(this,void 0,void 0,function*(){return new Promise((c,o)=>{t(e,r0(r,i,n,a)).then(l=>{if(!l.ok)throw l;return i!=null&&i.noResolveJson?l:l.json()}).then(l=>c(l)).catch(l=>t0(l,o,i))})})}function ma(t,r,e,i){return Jr(this,void 0,void 0,function*(){return es(t,"GET",r,e,i)})}function ar(t,r,e,i,n){return Jr(this,void 0,void 0,function*(){return es(t,"POST",r,i,n,e)})}function i0(t,r,e,i,n){return Jr(this,void 0,void 0,function*(){return es(t,"PUT",r,i,n,e)})}function n0(t,r,e,i){return Jr(this,void 0,void 0,function*(){return es(t,"HEAD",r,Object.assign(Object.assign({},e),{noResolveJson:!0}),i)})}function Pm(t,r,e,i,n){return Jr(this,void 0,void 0,function*(){return es(t,"DELETE",r,i,n,e)})}var tt=function(t,r,e,i){function n(a){return a instanceof e?a:new e(function(c){c(a)})}return new(e||(e=Promise))(function(a,c){function o(d){try{u(i.next(d))}catch(h){c(h)}}function l(d){try{u(i.throw(d))}catch(h){c(h)}}function u(d){d.done?a(d.value):n(d.value).then(o,l)}u((i=i.apply(t,r||[])).next())})};const s0={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},xd={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class a0{constructor(r,e={},i,n){this.url=r,this.headers=e,this.bucketId=i,this.fetch=km(n)}uploadOrUpdate(r,e,i,n){return tt(this,void 0,void 0,function*(){try{let a;const c=Object.assign(Object.assign({},xd),n);let o=Object.assign(Object.assign({},this.headers),r==="POST"&&{"x-upsert":String(c.upsert)});const l=c.metadata;typeof Blob<"u"&&i instanceof Blob?(a=new FormData,a.append("cacheControl",c.cacheControl),l&&a.append("metadata",this.encodeMetadata(l)),a.append("",i)):typeof FormData<"u"&&i instanceof FormData?(a=i,a.append("cacheControl",c.cacheControl),l&&a.append("metadata",this.encodeMetadata(l))):(a=i,o["cache-control"]=`max-age=${c.cacheControl}`,o["content-type"]=c.contentType,l&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),n!=null&&n.headers&&(o=Object.assign(Object.assign({},o),n.headers));const u=this._removeEmptyFolders(e),d=this._getFinalPath(u),h=yield this.fetch(`${this.url}/object/${d}`,Object.assign({method:r,body:a,headers:o},c!=null&&c.duplex?{duplex:c.duplex}:{})),f=yield h.json();return h.ok?{data:{path:u,id:f.Id,fullPath:f.Key},error:null}:{data:null,error:f}}catch(a){if(Be(a))return{data:null,error:a};throw a}})}upload(r,e,i){return tt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",r,e,i)})}uploadToSignedUrl(r,e,i,n){return tt(this,void 0,void 0,function*(){const a=this._removeEmptyFolders(r),c=this._getFinalPath(a),o=new URL(this.url+`/object/upload/sign/${c}`);o.searchParams.set("token",e);try{let l;const u=Object.assign({upsert:xd.upsert},n),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&i instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",i)):typeof FormData<"u"&&i instanceof FormData?(l=i,l.append("cacheControl",u.cacheControl)):(l=i,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);const h=yield this.fetch(o.toString(),{method:"PUT",body:l,headers:d}),f=yield h.json();return h.ok?{data:{path:a,fullPath:f.Key},error:null}:{data:null,error:f}}catch(l){if(Be(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(r,e){return tt(this,void 0,void 0,function*(){try{let i=this._getFinalPath(r);const n=Object.assign({},this.headers);e!=null&&e.upsert&&(n["x-upsert"]="true");const a=yield ar(this.fetch,`${this.url}/object/upload/sign/${i}`,{},{headers:n}),c=new URL(this.url+a.url),o=c.searchParams.get("token");if(!o)throw new zc("No token returned by API");return{data:{signedUrl:c.toString(),path:r,token:o},error:null}}catch(i){if(Be(i))return{data:null,error:i};throw i}})}update(r,e,i){return tt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",r,e,i)})}move(r,e,i){return tt(this,void 0,void 0,function*(){try{return{data:yield ar(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:r,destinationKey:e,destinationBucket:i==null?void 0:i.destinationBucket},{headers:this.headers}),error:null}}catch(n){if(Be(n))return{data:null,error:n};throw n}})}copy(r,e,i){return tt(this,void 0,void 0,function*(){try{return{data:{path:(yield ar(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:r,destinationKey:e,destinationBucket:i==null?void 0:i.destinationBucket},{headers:this.headers})).Key},error:null}}catch(n){if(Be(n))return{data:null,error:n};throw n}})}createSignedUrl(r,e,i){return tt(this,void 0,void 0,function*(){try{let n=this._getFinalPath(r),a=yield ar(this.fetch,`${this.url}/object/sign/${n}
72`,Object.assign({expiresIn:e},i!=null&&i.transform?{transform:i.transform}:{}),{headers:this.headers});const c=i!=null&&i.download?`&download=${i.download===!0?"":i.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${c}`)},{data:a,error:null}}catch(n){if(Be(n))return{data:null,error:n};throw n}})}createSignedUrls(r,e,i){return tt(this,void 0,void 0,function*(){try{const n=yield ar(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:e,paths:r},{headers:this.headers}),a=i!=null&&i.download?`&download=${i.download===!0?"":i.download}`:"";return{data:n.map(c=>Object.assign(Object.assign({},c),{signedUrl:c.signedURL?encodeURI(`${this.url}${c.signedURL}${a}`):null})),error:null}}catch(n){if(Be(n))return{data:null,error:n};throw n}})}download(r,e){return tt(this,void 0,void 0,function*(){const n=typeof(e==null?void 0:e.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((e==null?void 0:e.transform)||{}),c=a?`?${a}`:"";try{const o=this._getFinalPath(r);return{data:yield(yield ma(this.fetch,`${this.url}/${n}/${o}${c}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(o){if(Be(o))return{data:null,error:o};throw o}})}info(r){return tt(this,void 0,void 0,function*(){const e=this._getFinalPath(r);try{const i=yield ma(this.fetch,`${this.url}/object/info/${e}`,{headers:this.headers});return{data:Al(i),error:null}}catch(i){if(Be(i))return{data:null,error:i};throw i}})}exists(r){return tt(this,void 0,void 0,function*(){const e=this._getFinalPath(r);try{return yield n0(this.fetch,`${this.url}/object/${e}`,{headers:this.headers}),{data:!0,error:null}}catch(i){if(Be(i)&&i instanceof Rl){const n=i.originalError;if([400,404].includes(n==null?void 0:n.status))return{data:!1,error:i}}throw i}})}getPublicUrl(r,e){const i=this._getFinalPath(r),n=[],a=e!=null&&e.download?`download=${e.download===!0?"":e.download}`:"";a!==""&&n.push(a);const o=typeof(e==null?void 0:e.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((e==null?void 0:e.transform)||{});l!==""&&n.push(l);let u=n.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${i}${u}`)}}}remove(r){return tt(this,void 0,void 0,function*(){try{return{data:yield Pm(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:r},{headers:this.headers}),error:null}}catch(e){if(Be(e))return{data:null,error:e};throw e}})}list(r,e,i){return tt(this,void 0,void 0,function*(){try{const n=Object.assign(Object.assign(Object.assign({},s0),e),{prefix:r||""});return{data:yield ar(this.fetch,`${this.url}/object/list/${this.bucketId}`,n,{headers:this.headers},i),error:null}}catch(n){if(Be(n))return{data:null,error:n};throw n}})}encodeMetadata(r){return JSON.stringify(r)}toBase64(r){return typeof Buffer<"u"?Buffer.from(r).toString("base64"):btoa(r)}_getFinalPath(r){return`${this.bucketId}/${r}`}_removeEmptyFolders(r){return r.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(r){const e=[];return r.width&&e.push(`width=${r.width}`),r.height&&e.push(`height=${r.height}`),r.resize&&e.push(`resize=${r.resize}`),r.format&&e.push(`format=${r.format}`),r.quality&&e.push(`quality=${r.quality}`),e.join("&")}}const o0="2.7.1",l0={"X-Client-Info":`storage-js/${o0}`};var si=function(t,r,e,i){function n(a){return a instanceof e?a:new e(function(c){c(a)})}return new(e||(e=Promise))(function(a,c){function o(d){try{u(i.next(d))}catch(h){c(h)}}function l(d){try{u(i.throw(d))}catch(h){c(h)}}function u(d){d.done?a(d.value):n(d.value).then(o,l)}u((i=i.apply(t,r||[])).next())})};class c0{constructor(r,e={},i){this.url=r,this.headers=Object.assign(Object.assign({},l0),e),this.fetch=km(i)}listBuckets(){return si(this,void 0,void 0,function*(){try{return{data:yield ma(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(r){if(Be(r))return{data:null,error:r};throw r}})}getBucket(r){return si(this,void 0,void 0,function*(){try{return{data:yield ma(this.fetch,`${this.url}/bucket/${r}`,{headers:this.headers}),error:null}}catch(e){if(Be(e))return{data:null,error:e};throw e}})}createBucket(r,e={public:!1}){return si(this,void 0,void 0,function*(){try{return{data:yield ar(this.fetch,`${this.url}/bucket`,{id:r,name:r,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:this.headers}),error:null}}catch(i){if(Be(i))return{data:null,error:i};throw i}})}updateBucket(r,e){return si(this,void 0,void 0,function*(){try{return{data:yield i0(this.fetch,`${this.url}/bucket/${r}`,{id:r,name:r,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:this.headers}),error:null}}catch(i){if(Be(i))return{data:null,error:i};throw i}})}emptyBucket(r){return si(this,void 0,void 0,function*(){try{return{data:yield ar(this.fetch,`${this.url}/bucket/${r}/empty`,{},{headers:this.headers}),error:null}}catch(e){if(Be(e))return{data:null,error:e};throw e}})}deleteBucket(r){return si(this,void 0,void 0,function*(){try{return{data:yield Pm(this.fetch,`${this.url}/bucket/${r}`,{},{headers:this.headers}),error:null}}catch(e){if(Be(e))return{data:null,error:e};throw e}})}}class u0 extends c0{constructor(r,e={},i){super(r,e,i)}from(r){return new a0(this.url,this.headers,r,this.fetch)}}const d0="2.48.1";let fn="";typeof Deno<"u"?fn="deno":typeof document<"u"?fn="web":typeof navigator<"u"&&navigator.product==="ReactNative"?fn="react-native":fn="node";const h0={"X-Client-Info":`supabase-js-${fn}/${d0}`},f0={headers:h0},m0={schema:"public"},p0={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},g0={};var v0=function(t,r,e,i){function n(a){return a instanceof e?a:new e(function(c){c(a)})}return new(e||(e=Promise))(function(a,c){function o(d){try{u(i.next(d))}catch(h){c(h)}}function l(d){try{u(i.throw(d))}catch(h){c(h)}}function u(d){d.done?a(d.value):n(d.value).then(o,l)}u((i=i.apply(t,r||[])).next())})};const x0=t=>{let r;return t?r=t:typeof fetch>"u"?r=mm:r=fetch,(...e)=>r(...e)},y0=()=>typeof Headers>"u"?pm:Headers,w0=(t,r,e)=>{const i=x0(e),n=y0();return(a,c)=>v0(void 0,void 0,void 0,function*(){var o;const l=(o=yield r())!==null&&o!==void 0?o:t;let u=new n(c==null?void 0:c.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),i(a,Object.assign(Object.assign({},c),{headers:u}))})};var b0=function(t,r,e,i){function n(a){return a instanceof e?a:new e(function(c){c(a)})}return new(e||(e=Promise))(function(a,c){function o(d){try{u(i.next(d))}catch(h){c(h)}}function l(d){try{u(i.throw(d))}catch(h){c(h)}}function u(d){d.done?a(d.value):n(d.value).then(o,l)}u((i=i.apply(t,r||[])).next())})};function j0(t){return t.replace(/\/$/,"")}function S0(t,r){const{db:e,auth:i,realtime:n,global:a}=t,{db:c,auth:o,realtime:l,global:u}=r,d={db:Object.assign(Object.assign({},c),e),auth:Object.assign(Object.assign({},o),i),realtime:Object.assign(Object.assign({},l),n),global:Object.assign(Object.assign({},u),a),accessToken:()=>b0(this,void 0,void 0,function*(){return""})};return t.accessToken?d.accessToken=t.accessToken:delete d.accessToken,d}const Rm="2.67.3",_0="http://localhost:9999",C0="supabase.auth.token",N0={"X-Client-Info":`gotrue-js/${Rm}`},yd=10,Ol="X-Supabase-Api-Version",Am={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function T0(t){return Math.round(Date.now()/1e3)+t}function E0(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const r=Math.random()*16|0;return(t=="x"?r:r&3|8).toString(16)})}const It=()=>typeof window<"u"&&typeof document<"u",Pr={tested:!1,writable:!1},_n=()=>
72{if(!It())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Pr.tested)return Pr.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Pr.tested=!0,Pr.writable=!0}catch{Pr.tested=!0,Pr.writable=!1}return Pr.writable};function k0(t){const r={},e=new URL(t);if(e.hash&&e.hash[0]==="#")try{new URLSearchParams(e.hash.substring(1)).forEach((n,a)=>{r[a]=n})}catch{}return e.searchParams.forEach((i,n)=>{r[n]=i}),r}const Om=t=>{let r;return t?r=t:typeof fetch>"u"?r=(...e)=>zi(async()=>{const{default:i}=await Promise.resolve().then(()=>Gi);return{default:i}},void 0).then(({default:i})=>i(...e)):r=fetch,(...e)=>r(...e)},P0=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Dm=async(t,r,e)=>{await t.setItem(r,JSON.stringify(e))},bs=async(t,r)=>{const e=await t.getItem(r);if(!e)return null;try{return JSON.parse(e)}catch{return e}},js=async(t,r)=>{await t.removeItem(r)};function R0(t){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let e="",i,n,a,c,o,l,u,d=0;for(t=t.replace("-","+").replace("_","/");d<t.length;)c=r.indexOf(t.charAt(d++)),o=r.indexOf(t.charAt(d++)),l=r.indexOf(t.charAt(d++)),u=r.indexOf(t.charAt(d++)),i=c<<2|o>>4,n=(o&15)<<4|l>>2,a=(l&3)<<6|u,e=e+String.fromCharCode(i),l!=64&&n!=0&&(e=e+String.fromCharCode(n)),u!=64&&a!=0&&(e=e+String.fromCharCode(a));return e}class Fa{constructor(){this.promise=new Fa.promiseConstructor((r,e)=>{this.resolve=r,this.reject=e})}}Fa.promiseConstructor=Promise;function wd(t){const r=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,e=t.split(".");if(e.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!r.test(e[1]))throw new Error("JWT is not valid: payload is not in base64url format");const i=e[1];return JSON.parse(R0(i))}async function A0(t){return await new Promise(r=>{setTimeout(()=>r(null),t)})}function O0(t,r){return new Promise((i,n)=>{(async()=>{for(let a=0;a<1/0;a++)try{const c=await t(a);if(!r(a,null,c)){i(c);return}}catch(c){if(!r(a,c)){n(c);return}}})()})}function D0(t){return("0"+t.toString(16)).substr(-2)}function L0(){const r=new Uint32Array(56);if(typeof crypto>"u"){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",i=e.length;let n="";for(let a=0;a<56;a++)n+=e.charAt(Math.floor(Math.random()*i));return n}return crypto.getRandomValues(r),Array.from(r,D0).join("")}async function I0(t){const e=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(i);return Array.from(n).map(a=>String.fromCharCode(a)).join("")}function z0(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function F0(t){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."),t;const e=await I0(t);return z0(e)}async function ai(t,r,e=!1){const i=L0();let n=i;e&&(n+="/PASSWORD_RECOVERY"),await Dm(t,`${r}-code-verifier`,n);const a=await F0(i);return[a,i===a?"plain":"s256"]}const M0=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function B0(t){const r=t.headers.get(Ol);if(!r||!r.match(M0))return null;try{return new Date(`${r}T00:00:00.0Z`)}catch{return null}}
72class Fc extends Error{constructor(r,e,i){super(r),this.__isAuthError=!0,this.name="AuthError",this.status=e,this.code=i}}function oe(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class H0 extends Fc{constructor(r,e,i){super(r,e,i),this.name="AuthApiError",this.status=e,this.code=i}}function U0(t){return oe(t)&&t.name==="AuthApiError"}class Lm extends Fc{constructor(r,e){super(r),this.name="AuthUnknownError",this.originalError=e}}class Yr extends Fc{constructor(r,e,i,n){super(r,i,n),this.name=e,this.status=i}}class rr extends Yr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function W0(t){return oe(t)&&t.name==="AuthSessionMissingError"}class _o extends Yr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Ss extends Yr{constructor(r){super(r,"AuthInvalidCredentialsError",400,void 0)}}class _s extends Yr{constructor(r,e=null){super(r,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=e}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function q0(t){return oe(t)&&t.name==="AuthImplicitGrantRedirectError"}class bd extends Yr{constructor(r,e=null){super(r,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=e}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Dl extends Yr{constructor(r,e){super(r,"AuthRetryableFetchError",e,void 0)}}function Co(t){return oe(t)&&t.name==="AuthRetryableFetchError"}class jd extends Yr{constructor(r,e,i){super(r,"AuthWeakPasswordError",e,"weak_password"),this.reasons=i}}var V0=function(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]]);return e};const Or=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),G0=[502,503,504];async function Sd(t){var r;if(!P0(t))throw new Dl(Or(t),0);if(G0.includes(t.status))throw new Dl(Or(t),t.status);let e;try{e=await t.json()}catch(a){throw new Lm(Or(a),a)}let i;const n=B0(t);if(n&&n.getTime()>=Am["2024-01-01"].timestamp&&typeof e=="object"&&e&&typeof e.code=="string"?i=e.code:typeof e=="object"&&e&&typeof e.error_code=="string"&&(i=e.error_code),i){if(i==="weak_password")throw new jd(Or(e),t.status,((r=e.weak_password)===null||r===void 0?void 0:r.reasons)||[]);if(i==="session_not_found")throw new rr}else if(typeof e=="object"&&e&&typeof e.weak_password=="object"&&e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.reasons.reduce((a,c)=>a&&typeof c=="string",!0))throw new jd(Or(e),t.status,e.weak_password.reasons);throw new H0(Or(e),t.status||500,i)}const Z0=(t,r,e,i)=>{const n={method:t,headers:(r==null?void 0:r.headers)||{}};return t==="GET"?n:(n.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},r==null?void 0:r.headers),n.body=JSON.stringify(i),Object.assign(Object.assign({},n),e))};async function de(t,r,e,i){var n;const a=Object.assign({},i==null?void 0:i.headers);a[Ol]||(a[Ol]=Am["2024-01-01"].name),i!=null&&i.jwt&&(a.Authorization=`Bearer ${i.jwt}`);const c=(n=i==null?void 0:i.query)!==null&&n!==void 0?n:{};i!=null&&i.redirectTo&&(c.redirect_to=i.redirectTo);const o=Object.keys(c).length?"?"+new URLSearchParams(c).toString():"",l=await K0(t,r,e+o,{headers:a,noResolveJson:i==null?void 0:i.noResolveJson},{},i==null?void 0:i.body);return i!=null&&i.xform?i==null?void 0:i.xform(l):{data:Object.assign({},l),error:null}}async function K0(t,r,e,i,n,a){const c=Z0(r,i,n,a);let o;try{o=await t(e,Object.assign({},c))}catch(l){throw console.error(l),new Dl(Or(l),0)}if(o.ok||await Sd(o),i!=null&&i.noResolveJson)return o;try{return await o.json()}catch(l){await Sd(l)}}function ir(t){var r;let e=null;Y0(t)&&(e=Object.assign({},t),t.expires_at||(e.expires_at=T0(t.expires_in)));const i=(r=t.user)!==null&&r!==void 0?r:t;return{data:{session:e,user:i},error:null}}function _d(t){const r=ir(t);return!r.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((e,i)=>e&&typeof i=="string",!0)&&(r.data.weak_password=t.weak_password),r}function cr(t){var r;return{data:{user:(r=t.user)!==null&&r!==void 0?r:t},error:null}}function X0(t){return{data:t,error:null}}function Q0(t){const{action_link:r,email_otp:e,hashed_token:i,redirect_to:n,verification_type:a}=t,c=V0(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:r,email_otp:e,hashed_token:i,redirect_to:n,verification_type:a},l=Object.assign({},c);return{data:{properties:o,user:l},error:null}}function J0(t){return t}function Y0(t){return t.access_token&&t.refresh_token&&t.expires_in}var $0=function(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]]);return e};class ew{constructor({url:r="",headers:e={},fetch:i}){this.url=r,this.headers=e,this.fetch=Om(i),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(r,e="global"){try{return await de(this.fetch,"POST",`${this.url}/logout?scope=${e}`,{headers:this.headers,jwt:r,noResolveJson:!0}),{data:null,error:null}}catch(i){if(oe(i))return{data:null,error:i};throw i}}async inviteUserByEmail(r,e={}){try{return await de(this.fetch,"POST",`${this.url}/invite`,{body:{email:r,data:e.data},headers:this.headers,redirectTo:e.redirectTo,xform:cr})}catch(i){if(oe(i))return{data:{user:null},error:i};throw i}}async generateLink(r){try{const{options:e}=r,i=$0(r,["options"]),n=Object.assign(Object.assign({},i),e);return"newEmail"in i&&(n.new_email=i==null?void 0:i.newEmail,delete n.newEmail),await de(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:Q0,redirectTo:e==null?void 0:e.redirectTo})}catch(e){if(oe(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(r){try{return await de(this.fetch,"POST",`${this.url}/admin/users`,{body:r,headers:this.headers,xform:cr})}catch(e){if(oe(e))return{data:{user:null},error:e};throw e}}async listUsers(r){var e,i,n,a,c,o,l;try{const u={nextPage:null,lastPage:0,total:0},d=await de(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(i=(e=r==null?void 0:r.page)===null||e===void 0?void 0:e.toString())!==null&&i!==void 0?i:"",per_page:(a=(n=r==null?void 0:r.perPage)===null||n===void 0?void 0:n.toString())!==null&&a!==void 0?a:""},xform:J0});if(d.error)throw d.error;const h=await d.json(),f=(c=d.headers.get("x-total-count"))!==null&&c!==void 0?c:0,p=(l=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return p.length>
vendor: 21,990 bytes, line 72
720&&(p.forEach(g=>{const w=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(g.split(";")[1].split("=")[1]);u[`${b}Page`]=w}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(oe(u))return{data:{users:[]},error:u};throw u}}async getUserById(r){try{return await de(this.fetch,"GET",`${this.url}/admin/users/${r}`,{headers:this.headers,xform:cr})}catch(e){if(oe(e))return{data:{user:null},error:e};throw e}}async updateUserById(r,e){try{return await de(this.fetch,"PUT",`${this.url}/admin/users/${r}`,{body:e,headers:this.headers,xform:cr})}catch(i){if(oe(i))return{data:{user:null},error:i};throw i}}async deleteUser(r,e=!1){try{return await de(this.fetch,"DELETE",`${this.url}/admin/users/${r}`,{headers:this.headers,body:{should_soft_delete:e},xform:cr})}catch(i){if(oe(i))return{data:{user:null},error:i};throw i}}async _listFactors(r){try{const{data:e,error:i}=await de(this.fetch,"GET",`${this.url}/admin/users/${r.userId}/factors`,{headers:this.headers,xform:n=>({data:{factors:n},error:null})});return{data:e,error:i}}catch(e){if(oe(e))return{data:null,error:e};throw e}}async _deleteFactor(r){try{return{data:await de(this.fetch,"DELETE",`${this.url}/admin/users/${r.userId}/factors/${r.id}`,{headers:this.headers}),error:null}}catch(e){if(oe(e))return{data:null,error:e};throw e}}}const tw={getItem:t=>_n()?globalThis.localStorage.getItem(t):null,setItem:(t,r)=>{_n()&&globalThis.localStorage.setItem(t,r)},removeItem:t=>{_n()&&globalThis.localStorage.removeItem(t)}};function Cd(t={}){return{getItem:r=>t[r]||null,setItem:(r,e)=>{t[r]=e},removeItem:r=>{delete t[r]}}}function rw(){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)}}const oi={debug:!!(globalThis&&_n()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Im extends Error{constructor(r){super(r),this.isAcquireTimeout=!0}}class iw extends Im{}async function nw(t,r,e){oi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,r);const i=new globalThis.AbortController;return r>0&&setTimeout(()=>{i.abort(),oi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},r),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,r===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:i.signal},async n=>{if(n){oi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,n.name);try{return await e()}finally{oi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,n.name)}}else{if(r===0)throw oi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new iw(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(oi.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null,"  "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}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"),await e()}}))}rw();const sw={url:_0,storageKey:C0,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:N0,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},ln=30*1e3,Nd=3;async function Td(t,r,e){return await e()}class qn{constructor(r){var e,i;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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,this.instanceID=qn.nextInstanceID,qn.nextInstanceID+=1,this.instanceID>0&&It()&&console.warn("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.");const n=Object.assign(Object.assign({},sw),r);if(this.logDebugMessages=!!n.debug,typeof n.debug=="function"&&(this.logger=n.debug),this.persistSession=n.persistSession,this.storageKey=n.storageKey,this.autoRefreshToken=n.autoRefreshToken,this.admin=new ew({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=Om(n.fetch),this.lock=n.lock||Td,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,n.lock?this.lock=n.lock:It()&&(!((e=globalThis==null?void 0:globalThis.navigator)===null||e===void 0)&&e.locks)?this.lock=nw:this.lock=Td,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)},this.persistSession?n.storage?this.storage=n.storage:_n()?this.storage=tw:(this.memoryStorage={},this.storage=Cd(this.memoryStorage)):(this.memoryStorage={},this.storage=Cd(this.memoryStorage)),It()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}_debug(...r){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${Rm}) ${new Date().toISOString()}`,...r),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var r;try{const e=k0(window.location.href);let i="none";if(this._isImplicitGrantCallback(e)?i="implicit":await this._isPKCECallback(e)&&(i="pkce"),It()&&this.detectSessionInUrl&&i!=="none"){const{data:n,error:a}=await this._getSessionFromURL(e,i);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),q0(a)){const l=(r=a.details)===null||r===void 0?void 0:r.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:a}}return await this._removeSession(),{error:a}}const{session:c,redirectType:o}=n;return this._debug("#_initialize()","detected session in URL",c,"redirect type",o),await this._saveSession(c),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",c):await this._notifyAllSubscribers("SIGNED_IN",c)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return oe(e)?{error:e}:{error:new Lm("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(r){var e,i,n;try{const a=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(i=(e=r==null?void 0:r.options)===null||e===void 0?void 0:e.data)!==null&&i!==void 0?i:{},gotrue_meta_security:{captcha_token:(n=r==null?void 0:r.options)===null||n===void 0?void 0:n.captchaToken}},xform:ir}),{data:c,error:o}=a;if(o||!c)return{data:{user:null,session:null},error:o};const l=c.session,u=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(a){if(oe(a))return{data:{user:null,session:null},error:a};throw a}}async signUp(r){var e,i,n;try{let a;if("email"in r){const{email:d,password:h,options:f}=r;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await ai(this.storage,this.storageKey)),a=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(e=f==null?void 0:f.data)!==null&&e!==void 0?e:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:g},xform:ir})}else if("phone"in r){const{phone:d,password:h,options:f}=r;a=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(i=f==null?void 0:f.data)!==null&&i!==void 0?i:{},channel:(n=f==null?void 0:f.channel)!==null&&n!==void 0?n:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:ir})}else throw new Ss("You must provide either an email or phone number and a password");const{data:c,error:o}=a;if(o||!c)return{data:{user:null,session:null},error:o};const l=c.session,u=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(a){if(oe(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithPassword(r){try{let e;if("email"in r){const{email:a,password:c,options:o}=r;e=await de(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:c,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:_d})}else if("phone"in r){const{phone:a,password:c,options:o}=r;e=await de(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:c,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:_d})}else throw new Ss("You must provide either an email or phone number and a password");const{data:i,error:n}=e;return n?{data:{user:null,session:null},error:n}:!i||!i.session||!i.user?{data:{user:null,session:null},error:new _o}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign({user:i.user,session:i.session},i.weak_password?{weakPassword:i.weak_password}:null),error:n})}catch(e){if(oe(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOAuth(r){var e,i,n,a;return await this._handleProviderSignIn(r.provider,{redirectTo:(e=r.options)===null||e===void 0?void 0:e.redirectTo,scopes:(i=r.options)===null||i===void 0?void 0:i.scopes,queryParams:(n=r.options)===null||n===void 0?void 0:n.queryParams,skipBrowserRedirect:(a=r.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(r){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(r))}async _exchangeCodeForSession(r){const e=await bs(this.storage,`${this.storageKey}-code-verifier`),[i,n]=(e??"").split("/");try{const{data:a,error:c}=await de(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:r,code_verifier:i},xform:ir});if(await js(this.storage,`${this.storageKey}-code-verifier`),c)throw c;return!a||!a.session||!a.user?{data:{user:null,session:null,redirectType:null},error:new _o}:(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:Object.assign(Object.assign({},a),{redirectType:n??null}),error:c})}catch(a){if(oe(a))return{data:{user:null,session:null,redirectType:null},error:a};throw a}}async signInWithIdToken(r){try{const{options:e,provider:i,token:n,access_token:a,nonce:c}=r,o=await de(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:i,id_token:n,access_token:a,nonce:c,gotrue_meta_security:{captcha_token:e==null?void 0:e.captchaToken}},xform:ir}),{data:l,error:u}=o;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new _o}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(e){if(oe(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOtp(r){var e,i,n,a,c;try{if("email"in r){const{email:o,options:l}=r;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await ai(this.storage,this.storageKey));const{error:h}=await de(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(e=l==null?void 0:l.data)!==null&&e!==void 0?e:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:h}}if("phone"in r){const{phone:o,options:l}=r,{data:u,error:d}=await de(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(a=l==null?void 0:l.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(c=l==null?void 0:l.channel)!==null&&c!==void 0?c:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d}}throw new Ss("You must provide either an email or phone number.")}catch(o){if(oe(o))return{data:{user:null,session:null},error:o};throw o}}async verifyOtp(r){var e,i;try{let n,a;"options"in r&&(n=(e=r.options)===null||e===void 0?void 0:e.redirectTo,a=(i=r.options)===null||i===void 0?void 0:i.captchaToken);const{data:c,error:o}=await de(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},r),{gotrue_meta_security:{captcha_token:a}}),redirectTo:n,xform:ir});if(o)throw o;if(!c)throw new Error("An error occurred on token verification.");const l=c.session,u=c.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(r.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(n){if(oe(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithSSO(r){var e,i,n;try{let a=null,c=null;return this.flowType==="pkce"&&([a,c]=await ai(this.storage,this.storageKey)),await de(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in r?{provider_id:r.providerId}:null),"domain"in r?{domain:r.domain}:null),{redirect_to:(i=(e=r.options)===null||e===void 0?void 0:e.redirectTo)!==null&&i!==void 0?i:void 0}),!((n=r==null?void 0:r.options)===null||n===void 0)&&n.captchaToken?{gotrue_meta_security:{captcha_token:r.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:c}),headers:this.headers,xform:X0})}catch(a){if(oe(a))return{data:null,error:a};throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async r=>{const{data:{session:e},error:i}=r;if(i)throw i;if(!e)throw new rr;const{error:n}=await de(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:e.access_token});return{data:{user:null,session:null},error:n}})}catch(r){if(oe(r))return{data:{user:null,session:null},error:r};throw r}}async resend(r){try{const e=`${this.url}/resend`;if("email"in r){const{email:i,type:n,options:a}=r,{error:c}=await de(this.fetch,"POST",e,{headers:this.headers,body:{email:i,type:n,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return{data:{user:null,session:null},error:c}}else if("phone"in r){const{phone:i,type:n,options:a}=r,{data:c,error:o}=await de(this.fetch,"POST",e,{headers:this.headers,body:{phone:i,type:n,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return{data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:o}}throw new Ss("You must provide either an email or phone number and a type")}catch(e){if(oe(e))return{data:{user:null,session:null},error:e};throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async e=>e))}async _acquireLock(r,e){this._debug("#_acquireLock","begin",r);try{if(this.lockAcquired){const i=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await i,await e()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,r,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const i=e();for(this.pendingInLock.push((async()=>{try{await i}catch{}})()),await i;this.pendingInLock.length;){const n=[...this.pendingInLock];await Promise.all(n),this.pendingInLock.splice(0,n.length)}return await i}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(r){this._debug("#_useSession","begin");try{const e=await this.__loadSession();return await r(e)}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 r=null;const e=await bs(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",e),e!==null&&(this._isValidSession(e)?r=e:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!r)return{data:{session:null},error:null};const i=r.expires_at?r.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${i?"":" not"} expired`,"expires_at",r.expires_at),!i){if(this.storage.isServer){let c=this.suppressGetSessionWarning;r=new Proxy(r,{get:(l,u,d)=>(!c&&u==="user"&&(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."),c=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,d))})}return{data:{session:r},error:null}}const{session:n,error:a}=await this._callRefreshToken(r.refresh_token);return a?{data:{session:null},error:a}:{data:{session:n},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(r){return r?await this._getUser(r):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(r){try{return r?await de(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:r,xform:cr}):await this._useSession(async e=>{var i,n,a;const{data:c,error:o}=e;if(o)throw o;return!(!((i=c.session)===null||i===void 0)&&i.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new rr}:await de(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(n=c.session)===null||n===void 0?void 0:n.access_token)!==null&&a!==void 0?a:void 0,xform:cr})})}catch(e){if(oe(e))return W0(e)&&(await this._removeSession(),await js(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:e};throw e}}async updateUser(r,e={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(r,e))}async _updateUser(r,e={}){try{return await this._useSession(async i=>{const{data:n,error:a}=i;if(a)throw a;if(!n.session)throw new rr;const c=n.session;let o=null,l=null;this.flowType==="pkce"&&r.email!=null&&([o,l]=await ai(this.storage,this.storageKey));const{data:u,error:d}=await de(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:e==null?void 0:e.emailRedirectTo,body:Object.assign(Object.assign({},r),{code_challenge:o,code_challenge_method:l}),jwt:c.access_token,xform:cr});if(d)throw d;return c.user=u.user,await this._saveSession(c),await this._notifyAllSubscribers("USER_UPDATED",c),{data:{user:c.user},error:null}})}catch(i){if(oe(i))return{data:{user:null},error:i};throw i}}_decodeJWT(r){return wd(r)}async setSession(r){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(r))}async _setSession(r){try{if(!r.access_token||!r.refresh_token)throw new rr;const e=Date.now()/1e3;let i=e,n=!0,a=null;const c=wd(r.access_token);if(c.exp&&(i=c.exp,n=i<=e),n){const{session:o,error:l}=await this._callRefreshToken(r.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!o)return{data:{user:null,session:null},error:null};a=o}else{const{data:o,error:l}=await this._getUser(r.access_token);if(l)throw l;a={access_token:r.access_token,refresh_token:r.refresh_token,user:o.user,token_type:"bearer",expires_in:i-e,expires_at:i},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return{data:{user:a.user,session:a},error:null}}catch(e){if(oe(e))return{data:{session:null,user:null},error:e};throw e}}async refreshSession(r){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(r))}async _refreshSession(r){try{return await this._useSession(async e=>{var i;if(!r){const{data:c,error:o}=e;if(o)throw o;r=(i=c.session)!==null&&i!==void 0?i:void 0}if(!(r!=null&&r.refresh_token))throw new rr;const{session:n,error:a}=await this._callRefreshToken(r.refresh_token);return a?{data:{user:null,session:null},error:a}:n?{data:{user:n.user,session:n},error:null}:{data:{user:null,session:null},error:null}})}catch(e){if(oe(e))return{data:{user:null,session:null},error:e};throw e}}async _getSessionFromURL(r,e){try{if(!It())throw new _s("No browser detected.");
72if(r.error||r.error_description||r.error_code)throw new _s(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});switch(e){case"implicit":if(this.flowType==="pkce")throw new bd("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new _s("Not a valid implicit grant flow url.");break;default:}if(e==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!r.code)throw new bd("No code detected.");const{data:j,error:S}=await this._exchangeCodeForSession(r.code);if(S)throw S;const E=new URL(window.location.href);return E.searchParams.delete("code"),window.history.replaceState(window.history.state,"",E.toString()),{data:{session:j.session,redirectType:null},error:null}}const{provider_token:i,provider_refresh_token:n,access_token:a,refresh_token:c,expires_in:o,expires_at:l,token_type:u}=r;if(!a||!o||!c||!u)throw new _s("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(o);let f=d+h;l&&(f=parseInt(l));const p=f-d;p*1e3<=ln&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);const g=f-h;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,f,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,f,d);const{data:w,error:b}=await this._getUser(a);if(b)throw b;const x={provider_token:i,provider_refresh_token:n,access_token:a,expires_in:h,expires_at:f,refresh_token:c,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:x,redirectType:r.type},error:null}}catch(i){if(oe(i))return{data:{session:null,redirectType:null},error:i};throw i}}_isImplicitGrantCallback(r){return!!(r.access_token||r.error_description)}async _isPKCECallback(r){const e=await bs(this.storage,`${this.storageKey}-code-verifier`);return!!(r.code&&e)}async signOut(r={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(r))}async _signOut({scope:r}={scope:"global"}){return await this._useSession(async e=>{var i;const{data:n,error:a}=e;if(a)return{error:a};const c=(i=n.session)===null||i===void 0?void 0:i.access_token;if(c){const{error:o}=await this.admin.signOut(c,r);if(o&&!(U0(o)&&(o.status===404||o.status===401||o.status===403)))return{error:o}}return r!=="others"&&(await this._removeSession(),await js(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(r){const e=E0(),i={id:e,callback:r,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",e),this.stateChangeEmitters.delete(e)}};return this._debug("#onAuthStateChange()","registered callback with id",e),this.stateChangeEmitters.set(e,i),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(e)})))(),{data:{subscription:i}}}async _emitInitialSession(r){return await this._useSession(async e=>{var i,n;try{const{data:{session:a},error:c}=e;if(c)throw c;await((i=this.stateChangeEmitters.get(r))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",r,"session",a)}catch(a){await((n=this.stateChangeEmitters.get(r))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",r,"error",a),console.error(a)}})}async resetPasswordForEmail(r,e={}){let i=null,n=null;this.flowType==="pkce"&&([i,n]=await ai(this.storage,this.storageKey,!0));try{return await de(this.fetch,"POST",`${this.url}/recover`,{body:{email:r,code_challenge:i,code_challenge_method:n,gotrue_meta_security:{captcha_token:e.captchaToken}},headers:this.headers,redirectTo:e.redirectTo})}catch(a){if(oe(a))return{data:null,error:a};throw a}}async getUserIdentities(){var r;try{const{data:e,error:i}=await this.getUser();if(i)throw i;return{data:{identities:(r=e.user.identities)!==null&&r!==void 0?r:[]},error:null}}catch(e){if(oe(e))return{data:null,error:e};throw e}}async linkIdentity(r){var e;try{const{data:i,error:n}=await this._useSession(async a=>{var c,o,l,u,d;const{data:h,error:f}=a;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,r.provider,{redirectTo:(c=r.options)===null||c===void 0?void 0:c.redirectTo,scopes:(o=r.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=r.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await de(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(n)throw n;return It()&&!(!((e=r.options)===null||e===void 0)&&e.skipBrowserRedirect)&&window.location.assign(i==null?void 0:i.url),{data:{provider:r.provider,url:i==null?void 0:i.url},error:null}}catch(i){if(oe(i))return{data:{provider:r.provider,url:null},error:i};throw i}}async unlinkIdentity(r){try{return await this._useSession(async e=>{var i,n;const{data:a,error:c}=e;if(c)throw c;
72return await de(this.fetch,"DELETE",`${this.url}/user/identities/${r.identity_id}`,{headers:this.headers,jwt:(n=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&n!==void 0?n:void 0})})}catch(e){if(oe(e))return{data:null,error:e};throw e}}async _refreshAccessToken(r){const e=`#_refreshAccessToken(${r.substring(0,5)}...)`;this._debug(e,"begin");try{const i=Date.now();return await O0(async n=>(n>0&&await A0(200*Math.pow(2,n-1)),this._debug(e,"refreshing attempt",n),await de(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:r},headers:this.headers,xform:ir})),(n,a)=>{const c=200*Math.pow(2,n);return a&&Co(a)&&Date.now()+c-i<ln})}catch(i){if(this._debug(e,"error",i),oe(i))return{data:{session:null,user:null},error:i};throw i}finally{this._debug(e,"end")}}_isValidSession(r){return typeof r=="object"&&r!==null&&"access_token"in r&&"refresh_token"in r&&"expires_at"in r}async _handleProviderSignIn(r,e){const i=await this._getUrlForProvider(`${this.url}/authorize`,r,{redirectTo:e.redirectTo,scopes:e.scopes,queryParams:e.queryParams});return this._debug("#_handleProviderSignIn()","provider",r,"options",e,"url",i),It()&&!e.skipBrowserRedirect&&window.location.assign(i),{data:{provider:r,url:i},error:null}}async _recoverAndRefresh(){var r;const e="#_recoverAndRefresh()";this._debug(e,"begin");try{const i=await bs(this.storage,this.storageKey);if(this._debug(e,"session from storage",i),!this._isValidSession(i)){this._debug(e,"session is not valid"),i!==null&&await this._removeSession();return}const n=Math.round(Date.now()/1e3),a=((r=i.expires_at)!==null&&r!==void 0?r:1/0)<n+yd;if(this._debug(e,`session has${a?"":" not"} expired with margin of ${yd}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:c}=await this._callRefreshToken(i.refresh_token);c&&(console.error(c),Co(c)||(this._debug(e,"refresh failed with a non-retryable error, removing the session",c),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(e,"error",i),console.error(i);return}finally{this._debug(e,"end")}}async _callRefreshToken(r){var e,i;if(!r)throw new rr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const n=`#_callRefreshToken(${r.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new Fa;const{data:a,error:c}=await this._refreshAccessToken(r);if(c)throw c;if(!a.session)throw new rr;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const o={session:a.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(a){if(this._debug(n,"error",a),oe(a)){const c={session:null,error:a};return Co(a)||await this._removeSession(),(e=this.refreshingDeferred)===null||e===void 0||e.resolve(c),c}throw(i=this.refreshingDeferred)===null||i===void 0||i.reject(a),a}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(r,e,i=!0){const n=`#_notifyAllSubscribers(${r})`;this._debug(n,"begin",e,`broadcast = ${i}`);try{this.broadcastChannel&&i&&this.broadcastChannel.postMessage({event:r,session:e});const a=[],c=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(r,e)}catch(l){a.push(l)}});if(await Promise.all(c),a.length>0){for(let o=0;o<a.length;o+=1)console.error(a[o]);throw a[0]}}finally{this._debug(n,"end")}}async _saveSession(r){this._debug("#_saveSession()",r),this.suppressGetSessionWarning=!0,await Dm(this.storage,this.storageKey,r)}async _removeSession(){this._debug("#_removeSession()"),await js(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const r=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{r&&It()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",r)}catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const r=setInterval(()=>this._autoRefreshTokenTick(),ln);this.autoRefreshTicker=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const r=this.autoRefreshTicker;this.autoRefreshTicker=null,r&&clearInterval(r)}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 r=Date.now();try{return await this._useSession(async e=>{const{data:{session:i}}=e;if(!i||!i.refresh_token||!i.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const n=Math.floor((i.expires_at*1e3-r)/ln);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${ln}ms, refresh threshold is ${Nd} ticks`),n<=Nd&&await this._callRefreshToken(i.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(r){if(r.isAcquireTimeout||r instanceof Im)this._debug("auto refresh token tick lock not available");else throw r}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!It()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(r){console.error("_handleVisibilityChange",r)}}async _onVisibilityChanged(r){const e=`#_onVisibilityChanged(${r})`;this._debug(e,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),r||(await this.initializePromise,await this._acquireLock(-1,async()=>
72{if(document.visibilityState!=="visible"){this._debug(e,"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(r,e,i){const n=[`provider=${encodeURIComponent(e)}`];if(i!=null&&i.redirectTo&&n.push(`redirect_to=${encodeURIComponent(i.redirectTo)}`),i!=null&&i.scopes&&n.push(`scopes=${encodeURIComponent(i.scopes)}`),this.flowType==="pkce"){const[a,c]=await ai(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(c)}`});n.push(o.toString())}if(i!=null&&i.queryParams){const a=new URLSearchParams(i.queryParams);n.push(a.toString())}return i!=null&&i.skipBrowserRedirect&&n.push(`skip_http_redirect=${i.skipBrowserRedirect}`),`${r}?${n.join("&")}`}async _unenroll(r){try{return await this._useSession(async e=>{var i;const{data:n,error:a}=e;return a?{data:null,error:a}:await de(this.fetch,"DELETE",`${this.url}/factors/${r.factorId}`,{headers:this.headers,jwt:(i=n==null?void 0:n.session)===null||i===void 0?void 0:i.access_token})})}catch(e){if(oe(e))return{data:null,error:e};throw e}}async _enroll(r){try{return await this._useSession(async e=>{var i,n;const{data:a,error:c}=e;if(c)return{data:null,error:c};const o=Object.assign({friendly_name:r.friendlyName,factor_type:r.factorType},r.factorType==="phone"?{phone:r.phone}:{issuer:r.issuer}),{data:l,error:u}=await de(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(i=a==null?void 0:a.session)===null||i===void 0?void 0:i.access_token});return u?{data:null,error:u}:(r.factorType==="totp"&&(!((n=l==null?void 0:l.totp)===null||n===void 0)&&n.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(e){if(oe(e))return{data:null,error:e};throw e}}async _verify(r){return this._acquireLock(-1,async()=>{try{return await this._useSession(async e=>{var i;const{data:n,error:a}=e;if(a)return{data:null,error:a};const{data:c,error:o}=await de(this.fetch,"POST",`${this.url}/factors/${r.factorId}/verify`,{body:{code:r.code,challenge_id:r.challengeId},headers:this.headers,jwt:(i=n==null?void 0:n.session)===null||i===void 0?void 0:i.access_token});return o?{data:null,error:o}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),{data:c,error:o})})}catch(e){if(oe(e))return{data:null,error:e};throw e}})}async _challenge(r){return this._acquireLock(-1,async()=>{try{return await this._useSession(async e=>{var i;const{data:n,error:a}=e;return a?{data:null,error:a}:await de(this.fetch,"POST",`${this.url}/factors/${r.factorId}/challenge`,{body:{channel:r.channel},headers:this.headers,jwt:(i=n==null?void 0:n.session)===null||i===void 0?void 0:i.access_token})})}catch(e){if(oe(e))return{data:null,error:e};throw e}})}async _challengeAndVerify(r){const{data:e,error:i}=await this._challenge({factorId:r.factorId});return i?{data:null,error:i}:await this._verify({factorId:r.factorId,challengeId:e.id,code:r.code})}async _listFactors(){const{data:{user:r},error:e}=await this.getUser();if(e)return{data:null,error:e};const i=(r==null?void 0:r.factors)||[],n=i.filter(c=>c.factor_type==="totp"&&c.status==="verified"),a=i.filter(c=>c.factor_type==="phone"&&c.status==="verified");return{data:{all:i,totp:n,phone:a},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async r=>{var e,i;const{data:{session:n},error:a}=r;if(a)return{data:null,error:a};if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const c=this._decodeJWT(n.access_token);let o=null;c.aal&&(o=c.aal);let l=o;((i=(e=n.user.factors)===null||e===void 0?void 0:e.filter(h=>h.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(l="aal2");const d=c.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:d},error:null}}))}}qn.nextInstanceID=0;const aw=qn;class ow extends aw{constructor(r){super(r)}}var lw=function(t,r,e,i){function n(a){return a instanceof e?a:new e(function(c){c(a)})}return new(e||(e=Promise))(function(a,c){function o(d){try{u(i.next(d))}catch(h){c(h)}}function l(d){try{u(i.throw(d))}catch(h){c(h)}}function u(d){d.done?a(d.value):n(d.value).then(o,l)}u((i=i.apply(t,r||[])).next())})};class cw{constructor(r,e,i){var n,a,c;if(this.supabaseUrl=r,this.supabaseKey=e,!r)throw new Error("supabaseUrl is required.");
72if(!e)throw new Error("supabaseKey is required.");const o=j0(r);this.realtimeUrl=`${o}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${o}/auth/v1`,this.storageUrl=`${o}/storage/v1`,this.functionsUrl=`${o}/functions/v1`;const l=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,u={db:m0,realtime:g0,auth:Object.assign(Object.assign({},p0),{storageKey:l}),global:f0},d=S0(i??{},u);this.storageKey=(n=d.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(a=d.global.headers)!==null&&a!==void 0?a:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(h,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((c=d.auth)!==null&&c!==void 0?c:{},this.headers,d.global.fetch),this.fetch=w0(e,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.rest=new Ly(`${o}/rest/v1`,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),d.accessToken||this._listenForAuthEvents()}get functions(){return new dy(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new u0(this.storageUrl,this.headers,this.fetch)}from(r){return this.rest.from(r)}schema(r){return this.rest.schema(r)}rpc(r,e={},i={}){return this.rest.rpc(r,e,i)}channel(r,e={config:{}}){return this.realtime.channel(r,e)}getChannels(){return this.realtime.getChannels()}removeChannel(r){return this.realtime.removeChannel(r)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var r,e;return lw(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:i}=yield this.auth.getSession();return(e=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:null})}_initSupabaseAuthClient({autoRefreshToken:r,persistSession:e,detectSessionInUrl:i,storage:n,storageKey:a,flowType:c,lock:o,debug:l},u,d){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new ow({url:this.authUrl,headers:Object.assign(Object.assign({},h),u),storageKey:a,autoRefreshToken:r,persistSession:e,detectSessionInUrl:i,storage:n,flowType:c,lock:o,debug:l,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(r){return new Qy(this.realtimeUrl,Object.assign(Object.assign({},r),{params:Object.assign({apikey:this.supabaseKey},r==null?void 0:r.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,i)=>{this._handleTokenChanged(e,"CLIENT",i==null?void 0:i.access_token)})}_handleTokenChanged(r,e,i){(r==="TOKEN_REFRESHED"||r==="SIGNED_IN")&&this.changedAccessToken!==i?this.changedAccessToken=i:r==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const uw=(t,r,e)=>new cw(t,r,e),dw="https://wkljadlmnqsapyvyydfy.supabase.co",hw="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6IndrbGphZGxtbnFzYXB5dnl5ZGZ5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzgyMTczMDUsImV4cCI6MjA1Mzc5MzMwNX0.xuiycIstwv5M1-LhN_yo9JzAOrkD55SCvjvSUpgLIu4",fe=uw(dw,hw,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0}}),fw=t=>(console.error("Supabase error:",t),t instanceof Error?t.message.includes("Failed to fetch")?"Connection error. Please check your internet connection.":t.message.includes("storage")?"Error uploading image. Please try again.":t.message:"An unexpected error occurred"),mw=async()=>{try{const{data:t,error:r}=await fe.from("properties").select("id").limit(1);if(r)throw r;return!0}catch(t){return console.error("Supabase connection check failed:",t),!1}},zm=T.createContext(void 0),pw=()=>{const t=T.useContext(zm);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},gw=({children:t})=>{const[r,e]=T.useState(null),[i,n]=T.useState(null),[a,c]=T.useState(!0);T.useEffect(()=>{fe.auth.getSession().then(({data:{session:f}})=>
72{n(f),e((f==null?void 0:f.user)??null),c(!1)});const{data:{subscription:h}}=fe.auth.onAuthStateChange((f,p)=>{n(p),e((p==null?void 0:p.user)??null),c(!1)});return()=>h.unsubscribe()},[]);const d={user:r,session:i,loading:a,signIn:async(h,f)=>{const{error:p}=await fe.auth.signInWithPassword({email:h,password:f});return{error:p}},signUp:async(h,f)=>{const{error:p}=await fe.auth.signUp({email:h,password:f});return{error:p}},signOut:async()=>{await fe.auth.signOut()}};return s.jsx(zm.Provider,{value:d,children:t})};var Fm={},Mm={},Bm={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(){for(var n=arguments.length,a=new Array(n),c=0;c<n;c++)a[c]=arguments[c];if(typeof window<"u"){var o;typeof window.gtag>"u"&&(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)}),(o=window).gtag.apply(o,a)}},e=r;t.default=e})(Bm);var Hm={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var r=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;function e(o){return o.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,function(l,u,d){return u>0&&u+l.length!==d.length&&l.search(r)>-1&&d.charAt(u-2)!==":"&&(d.charAt(u+l.length)!=="-"||d.charAt(u-1)==="-")&&d.charAt(u-1).search(/[^\s-]/)<0?l.toLowerCase():l.substr(1).search(/[A-Z]|\../)>-1?l:l.charAt(0).toUpperCase()+l.substr(1)})}function i(o){return typeof o=="string"&&o.indexOf("@")!==-1}var n="REDACTED (Potential Email Address)";function a(o){return i(o)?(console.warn("This arg looks like an email address, redacting."),n):o}function c(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,d=o||"";return l&&(d=e(o)),u&&(d=a(d)),d}})(Hm);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.GA4=void 0;var r=c(Bm),e=c(Hm),i=["eventCategory","eventAction","eventLabel","eventValue","hitType"],n=["title","location"],a=["page","hitType"];function c(P){return P&&P.__esModule?P:{default:P}}function o(P,k){if(P==null)return{};var O=l(P,k),z,D;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(P);for(D=0;D<M.length;D++)z=M[D],!(k.indexOf(z)>=0)&&Object.prototype.propertyIsEnumerable.call(P,z)&&(O[z]=P[z])}return O}function l(P,k){if(P==null)return{};var O={},z=Object.keys(P),D,M;for(M=0;M<z.length;M++)D=z[M],!(k.indexOf(D)>=0)&&(O[D]=P[D]);return O}function u(P){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},u(P)}function d(P){return p(P)||f(P)||j(P)||h()}function h(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
73In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(P){if(typeof Symbol<"u"&&P[Symbol.iterator]!=null||P["@@iterator"]!=null)return Array.from(P)}function p(P){if(Array.isArray(P))return S(P)}function g(P,k){var O=Object.keys(P);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(P);k&&(z=z.filter(function(D){return Object.getOwnPropertyDescriptor(P,D).enumerable})),O.push.apply(O,z)}return O}function w(P){for(var k=1;k<arguments.length;k++){var O=arguments[k]!=null?arguments[k]:{};k%2?g(Object(O),!0).forEach(function(z){W(P,z,O[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(O)):g(Object(O)).forEach(function(z){Object.defineProperty(P,z,Object.getOwnPropertyDescriptor(O,z))})}return P}function b(P,k){return R(P)||E(P,k)||j(P,k)||x()}function x(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
74In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j(P,k){if(P){if(typeof P=="string")return S(P,k);var O=Object.prototype.toString.call(P).slice(8,-1);if(O==="Object"&&P.constructor&&(O=P.constructor.name),O==="Map"||O==="Set")return Array.from(P);if(O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O))return S(P,k)}}function S(P,k){(k==null||k>P.length)&&(k=P.length);for(var O=0,z=new Array(k);O<k;O++)z[O]=P[O];return z}function E(P,k){var O=P==null?null:typeof Symbol<"u"&&P[Symbol.iterator]||P["@@iterator"];if(O!=null){var z,D,M,B,K=[],se=!0,J=!1;try{if(M=(O=O.call(P)).next,k!==0)for(;!(se=(z=M.call(O)).done)&&(K.push(z.value),K.length!==k);se=!0);}catch(ce){J=!0,D=ce}
74finally{try{if(!se&&O.return!=null&&(B=O.return(),Object(B)!==B))return}finally{if(J)throw D}}return K}}function R(P){if(Array.isArray(P))return P}function A(P,k){if(!(P instanceof k))throw new TypeError("Cannot call a class as a function")}function I(P,k){for(var O=0;O<k.length;O++){var z=k[O];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(P,Z(z.key),z)}}function H(P,k,O){return k&&I(P.prototype,k),Object.defineProperty(P,"prototype",{writable:!1}),P}function W(P,k,O){return k=Z(k),k in P?Object.defineProperty(P,k,{value:O,enumerable:!0,configurable:!0,writable:!0}):P[k]=O,P}function Z(P){var k=$(P,"string");return u(k)==="symbol"?k:String(k)}function $(P,k){if(u(P)!=="object"||P===null)return P;var O=P[Symbol.toPrimitive];if(O!==void 0){var z=O.call(P,k||"default");if(u(z)!=="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(P)}var X=function(){function P(){var k=this;A(this,P),W(this,"reset",function(){k.isInitialized=!1,k._testMode=!1,k._currentMeasurementId,k._hasLoadedGA=!1,k._isQueuing=!1,k._queueGtag=[]}),W(this,"_gtag",function(){for(var O=arguments.length,z=new Array(O),D=0;D<O;D++)z[D]=arguments[D];k._testMode||k._isQueuing?k._queueGtag.push(z):r.default.apply(void 0,z)}),W(this,"_loadGA",function(O,z){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"https://www.googletagmanager.com/gtag/js";if(!(typeof window>"u"||typeof document>"u")&&!k._hasLoadedGA){var M=document.createElement("script");M.async=!0,M.src="".concat(D,"?id=").concat(O),z&&M.setAttribute("nonce",z),document.body.appendChild(M),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},k._hasLoadedGA=!0}}),W(this,"_toGtagOptions",function(O){if(O){var z={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"},D=Object.entries(O).reduce(function(M,B){var K=b(B,2),se=K[0],J=K[1];return z[se]?M[z[se]]=J:M[se]=J,M},{});return D}}),W(this,"initialize",function(O){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!O)throw new Error("Require GA_MEASUREMENT_ID");var D=typeof O=="string"?[{trackingId:O}]:O;k._currentMeasurementId=D[0].trackingId;var M=z.gaOptions,B=z.gtagOptions,K=z.nonce,se=z.testMode,J=se===void 0?!1:se,ce=z.gtagUrl;if(k._testMode=J,J||k._loadGA(k._currentMeasurementId,K,ce),k.isInitialized||(k._gtag("js",new Date),D.forEach(function(Ne){var lt=w(w(w({},k._toGtagOptions(w(w({},M),Ne.gaOptions))),B),Ne.gtagOptions);Object.keys(lt).length?k._gtag("config",Ne.trackingId,lt):k._gtag("config",Ne.trackingId)})),k.isInitialized=!0,!J){var Fe=d(k._queueGtag);for(k._queueGtag=[],k._isQueuing=!1;Fe.length;){var Pe=Fe.shift();k._gtag.apply(k,d(Pe)),Pe[0]==="get"&&(k._isQueuing=!0)}}}),W(this,"set",function(O){if(!O){console.warn("`fieldsObject` is required in .set()");return}if(u(O)!=="object"){console.warn("Expected `fieldsObject` arg to be an Object");return}Object.keys(O).length===0&&console.warn("empty `fieldsObject` given to .set()"),k._gaCommand("set",O)}),W(this,"_gaCommandSendEvent",function(O,z,D,M,B){k._gtag("event",z,w(w({event_category:O,event_label:D,value:M},B&&{non_interaction:B.nonInteraction}),k._toGtagOptions(B)))}),W(this,"_gaCommandSendEventParameters",function(){for(var O=arguments.length,z=new Array(O),D=0;D<O;D++)z[D]=arguments[D];if(typeof z[0]=="string")k._gaCommandSendEvent.apply(k,d(z.slice(1)));else{var M=z[0],B=M.eventCategory,K=M.eventAction,se=M.eventLabel,J=M.eventValue;M.hitType;var ce=o(M,i);k._gaCommandSendEvent(B,K,se,J,ce)}}),W(this,"_gaCommandSendTiming",function(O,z,D,M){k._gtag("event","timing_complete",{name:z,value:D,event_category:O,event_label:M})}
74),W(this,"_gaCommandSendPageview",function(O,z){if(z&&Object.keys(z).length){var D=k._toGtagOptions(z),M=D.title,B=D.location,K=o(D,n);k._gtag("event","page_view",w(w(w(w({},O&&{page_path:O}),M&&{page_title:M}),B&&{page_location:B}),K))}else O?k._gtag("event","page_view",{page_path:O}):k._gtag("event","page_view")}),W(this,"_gaCommandSendPageviewParameters",function(){for(var O=arguments.length,z=new Array(O),D=0;D<O;D++)z[D]=arguments[D];if(typeof z[0]=="string")k._gaCommandSendPageview.apply(k,d(z.slice(1)));else{var M=z[0],B=M.page;M.hitType;var K=o(M,a);k._gaCommandSendPageview(B,K)}}),W(this,"_gaCommandSend",function(){for(var O=arguments.length,z=new Array(O),D=0;D<O;D++)z[D]=arguments[D];var M=typeof z[0]=="string"?z[0]:z[0].hitType;switch(M){case"event":k._gaCommandSendEventParameters.apply(k,z);break;case"pageview":k._gaCommandSendPageviewParameters.apply(k,z);break;case"timing":k._gaCommandSendTiming.apply(k,d(z.slice(1)));break;case"screenview":case"transaction":case"item":case"social":case"exception":console.warn("Unsupported send command: ".concat(M));break;default:console.warn("Send command doesn't exist: ".concat(M))}}),W(this,"_gaCommandSet",function(){for(var O=arguments.length,z=new Array(O),D=0;D<O;D++)z[D]=arguments[D];typeof z[0]=="string"&&(z[0]=W({},z[0],z[1])),k._gtag("set",k._toGtagOptions(z[0]))}),W(this,"_gaCommand",function(O){for(var z=arguments.length,D=new Array(z>1?z-1:0),M=1;M<z;M++)D[M-1]=arguments[M];switch(O){case"send":k._gaCommandSend.apply(k,D);break;case"set":k._gaCommandSet.apply(k,D);break;default:console.warn("Command doesn't exist: ".concat(O))}}),W(this,"ga",function(){for(var O=arguments.length,z=new Array(O),D=0;D<O;D++)z[D]=arguments[D];if(typeof z[0]=="string")k._gaCommand.apply(k,z);else{var M=z[0];k._gtag("get",k._currentMeasurementId,"client_id",function(B){k._isQueuing=!1;var K=k._queueGtag;for(M({get:function(ce){return ce==="clientId"?B:ce==="trackingId"?k._currentMeasurementId:ce==="apiVersion"?"1":void 0}});K.length;){var se=K.shift();k._gtag.apply(k,d(se))}}),k._isQueuing=!0}return k.ga}),W(this,"event",function(O,z){if(typeof O=="string")k._gtag("event",O,k._toGtagOptions(z));else{var D=O.action,M=O.category,B=O.label,K=O.value,se=O.nonInteraction,J=O.transport;if(!M||!D){console.warn("args.category AND args.action are required in event()");return}var ce={hitType:"event",eventCategory:(0,e.default)(M),eventAction:(0,e.default)(D)};B&&(ce.eventLabel=(0,e.default)(B)),typeof K<"u"&&(typeof K!="number"?console.warn("Expected `args.value` arg to be a Number."):ce.eventValue=K),typeof se<"u"&&(typeof se!="boolean"?console.warn("`args.nonInteraction` must be a boolean."):ce.nonInteraction=se),typeof J<"u"&&(typeof J!="string"?console.warn("`args.transport` must be a string."):(["beacon","xhr","image"].indexOf(J)===-1&&console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),ce.transport=J)),k._gaCommand("send",ce)}}),W(this,"send",function(O){k._gaCommand("send",O)}),this.reset()}return H(P,[{key:"gtag",value:function(){this._gtag.apply(this,arguments)}}]),P}();t.GA4=X;var ee=new X;t.default=ee})(Mm);(function(t){function r(o){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r(o)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ReactGAImplementation=void 0;var e=n(Mm);function i(o){if(typeof WeakMap!="function")return null;var l=new WeakMap,u=new WeakMap;return(i=function(h){return h?u:l})(o)}function n(o,l){if(o&&o.__esModule)return o;if(o===null||r(o)!=="object"&&typeof o!="function")return{default:o};var u=i(l);if(u&&u.has(o))return u.get(o);var d={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in o)if(f!=="default"&&Object.prototype.hasOwnProperty.call(o,f)){var p=h?Object.getOwnPropertyDescriptor(o,f):null;p&&(p.get||p.set)?Object.defineProperty(d,f,p):d[f]=o[f]}return d.default=o,u&&u.set(o,d),d}var a=e.GA4;t.ReactGAImplementation=a;var c=e.default;t.default=c})(Fm);
74const Mc=Hi(Fm),vw=()=>{Mc.initialize("G-8KC9T6LMJL")},xw=t=>{Mc.send({hitType:"pageview",page:t})},No=t=>{Mc.event({category:"Form",action:"Submit",label:t})};/**
75 * @license lucide-react v0.344.0 - ISC
76 *
77 * This source code is licensed under the ISC license.
78 * See the LICENSE file in the root directory of this source tree.
79 */var yw={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"};/**
80 * @license lucide-react v0.344.0 - ISC
81 *
82 * This source code is licensed under the ISC license.
83 * See the LICENSE file in the root directory of this source tree.
84 */const ww=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ne=(t,r)=>{const e=T.forwardRef(({color:i="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:o="",children:l,...u},d)=>T.createElement("svg",{ref:d,...yw,width:n,height:n,stroke:i,strokeWidth:c?Number(a)*24/Number(n):a,className:["lucide",`lucide-${ww(t)}`,o].join(" "),...u},[...r.map(([h,f])=>T.createElement(h,f)),...Array.isArray(l)?l:[l]]));return e.displayName=`${t}`,e};/**
85 * @license lucide-react v0.344.0 - ISC
86 *
87 * This source code is licensed under the ISC license.
88 * See the LICENSE file in the root directory of this source tree.
89 */const Dt=ne("AlertCircle",[["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"}]]);/**
90 * @license lucide-react v0.344.0 - ISC
91 *
92 * This source code is licensed under the ISC license.
93 * See the LICENSE file in the root directory of this source tree.
94 */const Ll=ne("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
95 * @license lucide-react v0.344.0 - ISC
96 *
97 * This source code is licensed under the ISC license.
98 * See the LICENSE file in the root directory of this source tree.
99 */const xe=ne("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
100 * @license lucide-react v0.344.0 - ISC
101 *
102 * This source code is licensed under the ISC license.
103 * See the LICENSE file in the root directory of this source tree.
104 */const Cs=ne("Bean",[["path",{d:"M10.165 6.598C9.954 7.478 9.64 8.36 9 9c-.64.64-1.521.954-2.402 1.165A6 6 0 0 0 8 22c7.732 0 14-6.268 14-14a6 6 0 0 0-11.835-1.402Z",key:"1tvzk7"}],["path",{d:"M5.341 10.62a4 4 0 1 0 5.279-5.28",key:"2cyri2"}]]);/**
105 * @license lucide-react v0.344.0 - ISC
106 *
107 * This source code is licensed under the ISC license.
108 * See the LICENSE file in the root directory of this source tree.
109 */const bw=ne("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
110 * @license lucide-react v0.344.0 - ISC
111 *
112 * This source code is licensed under the ISC license.
113 * See the LICENSE file in the root directory of this source tree.
114 */const Il=ne("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
115 * @license lucide-react v0.344.0 - ISC
116 *
117 * This source code is licensed under the ISC license.
118 * See the LICENSE file in the root directory of this source tree.
119 */const Hs=ne("Calculator",[["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"}]]);/**
120 * @license lucide-react v0.344.0 - ISC
121 *
122 * This source code is licensed under the ISC license.
123 * See the LICENSE file in the root directory of this source tree.
124 */const jw=ne("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
125 * @license lucide-react v0.344.0 - ISC
126 *
127 * This source code is licensed under the ISC license.
128 * See the LICENSE file in the root directory of this source tree.
129 */const Sw=ne("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
130 * @license lucide-react v0.344.0 - ISC
131 *
132 * This source code is licensed under the ISC license.
133 * See the LICENSE file in the root directory of this source tree.
134 */const _w=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
135 * @license lucide-react v0.344.0 - ISC
136 *
137 * This source code is licensed under the ISC license.
138 * See the LICENSE file in the root directory of this source tree.
139 */const Ed=ne("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
140 * @license lucide-react v0.344.0 - ISC
141 *
142 * This source code is licensed under the ISC license.
143 * See the LICENSE file in the root directory of this source tree.
144 */const Ce=ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
145 * @license lucide-react v0.344.0 - ISC
146 *
147 * This source code is licensed under the ISC license.
148 * See the LICENSE file in the root directory of this source tree.
149 */const Zr=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
150 * @license lucide-react v0.344.0 - ISC
151 *
152 * This source code is licensed under the ISC license.
153 * See the LICENSE file in the root directory of this source tree.
154 */const Cw=ne("Compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76",key:"m9r19z"}]]);/**
155 * @license lucide-react v0.344.0 - ISC
156 *
157 * This source code is licensed under the ISC license.
158 * See the LICENSE file in the root directory of this source tree.
159 */const Nw=ne("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
159],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
160 * @license lucide-react v0.344.0 - ISC
161 *
162 * This source code is licensed under the ISC license.
163 * See the LICENSE file in the root directory of this source tree.
164 */const Tw=ne("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
165 * @license lucide-react v0.344.0 - ISC
166 *
167 * This source code is licensed under the ISC license.
168 * See the LICENSE file in the root directory of this source tree.
169 */const Ew=ne("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]);/**
170 * @license lucide-react v0.344.0 - ISC
171 *
172 * This source code is licensed under the ISC license.
173 * See the LICENSE file in the root directory of this source tree.
174 */const Ma=ne("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
175 * @license lucide-react v0.344.0 - ISC
176 *
177 * This source code is licensed under the ISC license.
178 * See the LICENSE file in the root directory of this source tree.
179 */const Um=ne("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
180 * @license lucide-react v0.344.0 - ISC
181 *
182 * This source code is licensed under the ISC license.
183 * See the LICENSE file in the root directory of this source tree.
184 */const kw=ne("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
185 * @license lucide-react v0.344.0 - ISC
186 *
187 * This source code is licensed under the ISC license.
188 * See the LICENSE file in the root directory of this source tree.
189 */const Pw=ne("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
190 * @license lucide-react v0.344.0 - ISC
191 *
192 * This source code is licensed under the ISC license.
193 * See the LICENSE file in the root directory of this source tree.
194 */const Hr=ne("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
195 * @license lucide-react v0.344.0 - ISC
196 *
197 * This source code is licensed under the ISC license.
198 * See the LICENSE file in the root directory of this source tree.
199 */const Rw=ne("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
200 * @license lucide-react v0.344.0 - ISC
201 *
202 * This source code is licensed under the ISC license.
203 * See the LICENSE file in the root directory of this source tree.
204 */const Ba=ne("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
205 * @license lucide-react v0.344.0 - ISC
206 *
207 * This source code is licensed under the ISC license.
208 * See the LICENSE file in the root directory of this source tree.
209 */const Ha=ne("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
210 * @license lucide-react v0.344.0 - ISC
211 *
212 * This source code is licensed under the ISC license.
213 * See the LICENSE file in the root directory of this source tree.
214 */const Aw=ne("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
215 * @license lucide-react v0.344.0 - ISC
216 *
217 * This source code is licensed under the ISC license.
218 * See the LICENSE file in the root directory of this source tree.
219 */const Vn=ne("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
220 * @license lucide-react v0.344.0 - ISC
221 *
222 * This source code is licensed under the ISC license.
223 * See the LICENSE file in the root directory of this source tree.
224 */const Ht=ne("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
225 * @license lucide-react v0.344.0 - ISC
226 *
227 * This source code is licensed under the ISC license.
228 * See the LICENSE file in the root directory of this source tree.
229 */const kd=ne("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
230 * @license lucide-react v0.344.0 - ISC
231 *
232 * This source code is licensed under the ISC license.
233 * See the LICENSE file in the root directory of this source tree.
234 */const ts=ne("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
235 * @license lucide-react v0.344.0 - ISC
236 *
237 * This source code is licensed under the ISC license.
238 * See the LICENSE file in the root directory of this source tree.
239 */const Ow=ne("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/**
240 * @license lucide-react v0.344.0 - ISC
241 *
242 * This source code is licensed under the ISC license.
243 * See the LICENSE file in the root directory of this source tree.
244 */const Dw=ne("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
245 * @license lucide-react v0.344.0 - ISC
246 *
247 * This source code is licensed under the ISC license.
248 * See the LICENSE file in the root directory of this source tree.
249 */const Lw=ne("PencilRuler",[["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}
249],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m2 22 5.5-1.5L21.17 6.83a2.82 2.82 0 0 0-4-4L3.5 16.5Z",key:"hes763"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}]]);/**
250 * @license lucide-react v0.344.0 - ISC
251 *
252 * This source code is licensed under the ISC license.
253 * See the LICENSE file in the root directory of this source tree.
254 */const Ua=ne("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
255 * @license lucide-react v0.344.0 - ISC
256 *
257 * This source code is licensed under the ISC license.
258 * See the LICENSE file in the root directory of this source tree.
259 */const Wm=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
260 * @license lucide-react v0.344.0 - ISC
261 *
262 * This source code is licensed under the ISC license.
263 * See the LICENSE file in the root directory of this source tree.
264 */const qm=ne("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
265 * @license lucide-react v0.344.0 - ISC
266 *
267 * This source code is licensed under the ISC license.
268 * See the LICENSE file in the root directory of this source tree.
269 */const Vm=ne("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/**
270 * @license lucide-react v0.344.0 - ISC
271 *
272 * This source code is licensed under the ISC license.
273 * See the LICENSE file in the root directory of this source tree.
274 */const Gm=ne("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
275 * @license lucide-react v0.344.0 - ISC
276 *
277 * This source code is licensed under the ISC license.
278 * See the LICENSE file in the root directory of this source tree.
279 */const Mi=ne("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
280 * @license lucide-react v0.344.0 - ISC
281 *
282 * This source code is licensed under the ISC license.
283 * See the LICENSE file in the root directory of this source tree.
284 */const Zm=ne("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
285 * @license lucide-react v0.344.0 - ISC
286 *
287 * This source code is licensed under the ISC license.
288 * See the LICENSE file in the root directory of this source tree.
289 */const Km=ne("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
290 * @license lucide-react v0.344.0 - ISC
291 *
292 * This source code is licensed under the ISC license.
293 * See the LICENSE file in the root directory of this source tree.
294 */const Iw=ne("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
295 * @license lucide-react v0.344.0 - ISC
296 *
297 * This source code is licensed under the ISC license.
298 * See the LICENSE file in the root directory of this source tree.
299 */const Wa=ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
300 * @license lucide-react v0.344.0 - ISC
301 *
302 * This source code is licensed under the ISC license.
303 * See the LICENSE file in the root directory of this source tree.
304 */const Xm=ne("Trees",[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16v0H5v0h0a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"yh07w9"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]]);/**
305 * @license lucide-react v0.344.0 - ISC
306 *
307 * This source code is licensed under the ISC license.
308 * See the LICENSE file in the root directory of this source tree.
309 */const zw=ne("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
310 * @license lucide-react v0.344.0 - ISC
311 *
312 * This source code is licensed under the ISC license.
313 * See the LICENSE file in the root directory of this source tree.
314 */const Fw=ne("Video",[["path",{d:"m22 8-6 4 6 4V8Z",key:"50v9me"}],["rect",{width:"14",height:"12",x:"2",y:"6",rx:"2",ry:"2",key:"1rqjg6"}]]);/**
315 * @license lucide-react v0.344.0 - ISC
316 *
317 * This source code is licensed under the ISC license.
318 * See the LICENSE file in the root directory of this source tree.
319 */const Mw=ne("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);/**
320 * @license lucide-react v0.344.0 - ISC
321 *
322 * This source code is licensed under the ISC license.
323 * See the LICENSE file in the root directory of this source tree.
324 */const Bw=ne("VolumeX",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
325 * @license lucide-react v0.344.0 - ISC
326 *
327 * This source code is licensed under the ISC license.
328 * See the LICENSE file in the root directory of this source tree.
329 */const Bi=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
329],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
330 * @license lucide-react v0.344.0 - ISC
331 *
332 * This source code is licensed under the ISC license.
333 * See the LICENSE file in the root directory of this source tree.
334 */const Hw=ne("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Uw="/assets/logo-Do81t9au.svg",Ww=()=>{const[t,r]=T.useState(!1),e=()=>{r(!t),document.body.style.overflow=t?"unset":"hidden"};return s.jsxs(s.Fragment,{children:[s.jsx("nav",{className:"fixed w-full bg-white/90 backdrop-blur-sm z-50 border-b border-gray-100",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between items-center h-20",children:[s.jsx("div",{className:"flex-shrink-0 flex items-center",children:s.jsxs(le,{to:"/",className:"flex items-center",children:[s.jsx("img",{src:Uw,alt:"Castlestone Logo",className:"h-12 w-12 mr-3 hidden md:block"}),s.jsx("span",{className:"text-2xl font-playfair text-gray-900",children:"Castlestone Custom Homes"})]})}),s.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[s.jsx(le,{to:"/",className:"text-gray-900 hover:text-[#C0A458] transition-colors",children:"Home"}),s.jsx(le,{to:"/projects",className:"text-gray-900 hover:text-[#C0A458] transition-colors",children:"Projects"}),s.jsx(le,{to:"/blog",className:"text-gray-900 hover:text-[#C0A458] transition-colors",children:"Blog"}),s.jsx(le,{to:"/contact",className:"text-gray-900 hover:text-[#C0A458] transition-colors",children:"Contact"})]}),s.jsx("button",{onClick:e,className:"md:hidden p-2 rounded-md text-gray-900 hover:text-[#C0A458] transition-colors","aria-label":t?"Close menu":"Open menu",children:t?s.jsx(Bi,{size:24}):s.jsx(ts,{size:24})})]})})}),s.jsx("div",{className:`fixed inset-0 bg-white z-40 transform transition-transform duration-500 ease-in-out ${t?"translate-x-0":"translate-x-full"}`,children:s.jsx("div",{className:"flex flex-col items-center justify-center h-full space-y-8",children:s.jsxs("div",{className:"md:hidden space-y-8",children:[s.jsx(le,{to:"/",className:"block text-3xl font-playfair text-gray-900 hover:text-[#C0A458] transition-colors",onClick:e,children:"Home"}),s.jsx(le,{to:"/projects",className:"block text-3xl font-playfair text-gray-900 hover:text-[#C0A458] transition-colors",onClick:e,children:"Projects"}),s.jsx(le,{to:"/blog",className:"block text-3xl font-playfair text-gray-900 hover:text-[#C0A458] transition-colors",onClick:e,children:"Blog"}),s.jsx(le,{to:"/contact",className:"block text-3xl font-playfair text-gray-900 hover:text-[#C0A458] transition-colors",onClick:e,children:"Contact"})]})})})]})},qw=()=>{pw();const t=()=>{const r=encodeURIComponent("Castle Stone Homes Inquiry");window.location.href=`mailto:[email protected]?subject=${r}`};return s.jsx("footer",{className:"bg-black text-white",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-12",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-playfair",children:"Castle Stone"}),s.jsx("p",{className:"text-gray-400 text-sm mt-2",children:"Custom Homebuilding & Renovations"}),s.jsxs("div",{className:"flex space-x-4 mt-4",children:[s.jsx("a",{href:"https://www.facebook.com/jessie.s.sahota/reels/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-white transition-colors",children:s.jsx(Ma,{size:18})}),s.jsx("a",{href:"https://www.instagram.com/castlestone.customhomes/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-white transition-colors",children:s.jsx(Ba,{size:18})}),s.jsx("a",{href:"https://linkedin.com/company/castlestonecustomhomes",className:"text-gray-500 hover:text-white transition-colors",children:s.jsx(Ha,{size:18})})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider",children:"Links"}),s.jsxs("ul",{className:"mt-4 space-y-2",children:[s.jsx("li",{children:s.jsx(le,{to:"/",className:"text-gray-400 hover:text-white text-sm transition-colors",children:"Home"})}),s.jsx("li",{children:s.jsx(le,{to:"/projects",className:"text-gray-400 hover:text-white text-sm transition-colors",children:"Projects"})}),s.jsx("li",{children:s.jsx(le,{to:"/contact",className:"text-gray-400 hover:text-white text-sm transition-colors",children:"Contact"})})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider",children:"Contact"}),s.jsxs("ul",{className:"mt-4 space-y-2",children:[s.jsxs("li",{className:"flex items-center text-gray-400 text-sm",children:[s.jsx(Ua,{size:14,className:"mr-2"}),s.jsx("a",{href:"tel:+17802426941",className:"hover:text-white transition-colors",children:"(780) 242-6941"})]}),s.jsxs("li",{className:"flex items-center text-gray-400 text-sm",children:[s.jsx(Vn,{size:14,className:"mr-2"}),s.jsx("button",{onClick:t,className:"hover:text-white transition-colors text-left",children:"Email Us"})]}),s.jsxs("li",{className:"flex items-start text-gray-400 text-sm",children:[s.jsx(Ht,{size:14,className:"mr-2 mt
334-1"}),s.jsxs("span",{children:["Edmonton",s.jsx("br",{}),"Leduc",s.jsx("br",{}),"St. Albert",s.jsx("br",{}),s.jsx("span",{className:"text-xs text-gray-500 mt-1 block",children:"& surrounding areas"})]})]})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider",children:"Hours"}),s.jsxs("ul",{className:"mt-4 space-y-2 text-gray-400 text-sm",children:[s.jsx("li",{children:"Monday - Sunday"}),s.jsx("li",{children:"By Appointment Only"})]})]})]}),s.jsxs("div",{className:"mt-16 pt-8 border-t border-gray-800 text-center",children:[s.jsxs("p",{className:"text-gray-400 text-xs",children:["© ",new Date().getFullYear()," Castle Stone Custom Homes. All rights reserved."]}),s.jsxs("p",{className:"mt-2 text-xs",children:["Managed by"," ",s.jsx("a",{href:"https://mybuilder.ca",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors",children:"mybuilder.ca"})]})]})]})})},Pd=[{name:"Keswick",multiplier:1.15,taxRate:.0065},{name:"Ridgeview",multiplier:1.12,taxRate:.0062},{name:"Secord",multiplier:1,taxRate:.0058},{name:"Windermere",multiplier:1.18,taxRate:.0068},{name:"Glenora",multiplier:1.25,taxRate:.0072},{name:"Westmount",multiplier:1.22,taxRate:.007},{name:"Crestwood",multiplier:1.2,taxRate:.0069},{name:"Laurier Heights",multiplier:1.16,taxRate:.0066},{name:"Riverdale",multiplier:1.14,taxRate:.0064},{name:"Garneau",multiplier:1.1,taxRate:.0061}],Rd=[{name:"Standard",multiplier:1,basePrice:180},{name:"Premium",multiplier:1.3,basePrice:220},{name:"Luxury",multiplier:1.6,basePrice:280},{name:"Ultra-Luxury",multiplier:2,basePrice:350}],Ad=[{name:"Single Story",multiplier:1},{name:"Two Story",multiplier:.95},{name:"Walkout Basement",multiplier:1.15},{name:"Full Basement",multiplier:1.25}],Vw=t=>{const r=t.replace(/\D/g,"");return r.length<=3?r:r.length<=6?`${r.slice(0,3)}-${r.slice(3)}`:`${r.slice(0,3)}-${r.slice(3,6)}-${r.slice(6,10)}`},Gw=({onClose:t})=>{const[r,e]=T.useState({neighborhood:"",luxuryLevel:"",buildType:"",size:2500,bedrooms:4,bathrooms:3}),[i,n]=T.useState(null),[a,c]=T.useState(!1),[o,l]=T.useState(!1),[u,d]=T.useState({name:"",email:"",phone:"",preferred_contact_method:"email"}),[h,f]=T.useState(!1),[p,g]=T.useState(!1),[w,b]=T.useState(null),x=async()=>{if(!r.neighborhood||!r.luxuryLevel||!r.buildType)return;c(!0),await new Promise(O=>setTimeout(O,2500));const A=Pd.find(O=>O.name===r.neighborhood),I=Rd.find(O=>O.name===r.luxuryLevel),H=Ad.find(O=>O.name===r.buildType),Z=I.basePrice*A.multiplier*I.multiplier*H.multiplier,$=r.size>3e3?.95:r.size<2e3?1.05:1,X=Z*$,ee=X*r.size,k=ee*1.2*A.taxRate;n({buildCost:Math.round(ee),propertyTax:Math.round(k),pricePerSqft:Math.round(X)}),c(!1)},j=A=>{const I=Vw(A.target.value);(I===""||/^\d{3}-\d{3}-\d{4}$/.test(I)||I.length<12)&&d(H=>({...H,phone:I}))},S=()=>{if(!u.name.trim())throw new Error("Please enter your name");if(u.preferred_contact_method==="email"){if(!u.email.trim())throw new Error("Please enter your email address");if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u.email))throw new Error("Please enter a valid email address")}else{if(!u.phone.trim())throw new Error("Please enter your phone number");if(!/^\d{3}-\d{3}-\d{4}$/.test(u.phone))throw new Error("Please enter a valid phone number (123-456-7890)")}},E=async A=>{A.preventDefault(),f(!0),b(null);try{if(S(),!i)throw new Error("Please calculate costs first");const I={name:u.name.trim(),preferred_contact_method:u.preferred_contact_method,calculator_results:{...r,...i}};u.preferred_contact_method==="email"?I.email=u.email.trim():I.phone=u.phone.trim();const{error:H}=await fe.from("quote_requests").insert([I]);if(H)throw H;g(!0)}catch(I){console.error("Error submitting quote request:",I),b(I instanceof Error?I.message:"Failed to submit quote request")}finally{f(!1)}},R=A=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:0,maximumFractionDigits:0}).format(A);return p?s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg max-w-md w-full p-8 text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6",children:s.jsx(Sw,{className:"w-8 h-8 text-green-600"})}),s.jsx("h2",{className:"text-2xl font-playfair mb-4",children:"Quote Request Submitted!"}
334),s.jsx("p",{className:"text-gray-600 mb-6",children:"Thank you for your interest! Our team will contact you within 24 hours via your preferred method to discuss your custom home project."}),s.jsx("button",{onClick:t,className:"w-full bg-[#C0A458] text-white py-3 px-6 rounded-md hover:bg-[#9A834A] transition-colors",children:"Close"})]})}):o?s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg max-w-md w-full max-h-[90vh] overflow-y-auto",children:[s.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 p-6 flex justify-between items-center",children:[s.jsx("h2",{className:"text-xl font-playfair",children:"Get Detailed Quote"}),s.jsx("button",{onClick:()=>l(!1),className:"text-gray-400 hover:text-gray-600 transition-colors",children:s.jsx(Bi,{size:24})})]}),s.jsxs("form",{onSubmit:E,className:"p-6 space-y-6",children:[w&&s.jsxs("div",{className:"p-4 bg-red-50 text-red-600 rounded-md flex items-center",children:[s.jsx(Dt,{className:"w-5 h-5 mr-2 flex-shrink-0"}),w]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Full Name *"}),s.jsx("input",{type:"text",value:u.name,onChange:A=>d(I=>({...I,name:A.target.value})),className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",placeholder:"Enter your full name"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:"Preferred Contact Method *"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("label",{className:"flex items-center p-3 border border-gray-300 rounded-md cursor-pointer hover:bg-gray-50",children:[s.jsx("input",{type:"radio",name:"contact_method",value:"email",checked:u.preferred_contact_method==="email",onChange:A=>d(I=>({...I,preferred_contact_method:"email"})),className:"mr-3"}),s.jsx(Vn,{className:"w-5 h-5 text-[#C0A458] mr-2"}),s.jsx("span",{children:"Email"})]}),s.jsxs("label",{className:"flex items-center p-3 border border-gray-300 rounded-md cursor-pointer hover:bg-gray-50",children:[s.jsx("input",{type:"radio",name:"contact_method",value:"phone",checked:u.preferred_contact_method==="phone",onChange:A=>d(I=>({...I,preferred_contact_method:"phone"})),className:"mr-3"}),s.jsx(Ua,{className:"w-5 h-5 text-[#C0A458] mr-2"}),s.jsx("span",{children:"Phone"})]})]})]}),u.preferred_contact_method==="email"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Address *"}),s.jsx("input",{type:"email",value:u.email,onChange:A=>d(I=>({...I,email:A.target.value})),className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",placeholder:"[email protected]"})]}),u.preferred_contact_method==="phone"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone Number *"}),s.jsx("input",{type:"tel",value:u.phone,onChange:j,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",placeholder:"123-456-7890"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Format: 123-456-7890"})]}),s.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[s.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:"Your Estimate Summary"}),s.jsxs("div",{className:"space-y-1 text-sm text-gray-600",children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Location:"})," ",r.neighborhood]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Style:"})," ",r.luxuryLevel]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Size:"})," ",r.size.toLocaleString()," sq ft"]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Estimated Cost:"})," ",i?R(i.buildCost):"N/A"]})]})]}),s.jsx("button",{type:"submit",disabled:h,className:"w-full bg-[#C0A458] text-white py-3 px-6 rounded-md hover:bg-[#9A834A] transition-colors disabled:opacity-50 flex items-center justify-center",children:h?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white mr-2"}),"Submitting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Mi,{className:"w-5 h-5 mr-2"}),"Request Detailed Quote"]})})]})]})}):s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[s.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 p-6 flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(Hs,{className:"text-[#C0A458] mr-3",size:28}),s.jsx("h2",{className:"text-2xl font-playfair",children:"Edmonton Build Cost Calculator"})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors",children:s.jsx(Bi,{size:24})})]}),s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Project Details"}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[s.jsx(Ht,{size:16,className:"inline mr-1"}),"Neighborhood"]}),s.jsxs("select",{value:r.neighborhood,onChange:A=>e({...r,neighborhood:A.target.value}),className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",children:[s.jsx("option",{value:"",children:"Select Neighborhood"}),Pd.map(A=>s.jsx("option",{value:A.name,children:A.name},A.name))]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[s.jsx(zw,{size:16,className:"inline mr-1"}),"Luxury Level"]}),s.jsxs("select",{value:r.luxuryLevel,onChange:A=>e({...r,luxuryLevel:A.target.value}),className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",children:[s.jsx("option",{value:"",children:"Select Luxury Level"}),Rd.map(A=>s.jsxs("option",{value:A.name,children:[A.name," ($",A.basePrice,"/sqft base)"]},A.name))]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[s.jsx(Hr,{size:16,className:"inline mr-1"}),"Build Type"]}
334),s.jsxs("select",{value:r.buildType,onChange:A=>e({...r,buildType:A.target.value}),className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",children:[s.jsx("option",{value:"",children:"Select Build Type"}),Ad.map(A=>s.jsx("option",{value:A.name,children:A.name},A.name))]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Square Footage"}),s.jsx("input",{type:"number",value:r.size,onChange:A=>e({...r,size:parseInt(A.target.value)||0}),min:"1000",max:"10000",step:"100",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Bedrooms"}),s.jsx("input",{type:"number",value:r.bedrooms,onChange:A=>e({...r,bedrooms:parseInt(A.target.value)||0}),min:"1",max:"8",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Bathrooms"}),s.jsx("input",{type:"number",value:r.bathrooms,onChange:A=>e({...r,bathrooms:parseFloat(A.target.value)||0}),min:"1",max:"8",step:"0.5",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]})]}),s.jsx("button",{onClick:x,disabled:!r.neighborhood||!r.luxuryLevel||!r.buildType||a,className:"w-full bg-[#C0A458] text-white py-3 px-6 rounded-md hover:bg-[#9A834A] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",children:a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white mr-2"}),"Calculating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Hs,{size:18,className:"mr-2"}),"Calculate Costs"]})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Estimated Costs"}),i?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-[#F5F5DC] p-6 rounded-lg",children:[s.jsxs("div",{className:"flex items-center mb-2",children:[s.jsx(Tw,{className:"text-[#C0A458] mr-2",size:20}),s.jsx("h4",{className:"font-medium",children:"Total Build Cost"})]}),s.jsx("p",{className:"text-3xl font-bold text-[#C0A458]",children:R(i.buildCost)}),s.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:[R(i.pricePerSqft)," per sq ft"]})]}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsxs("div",{className:"flex items-center mb-2",children:[s.jsx(Hr,{className:"text-gray-600 mr-2",size:20}),s.jsx("h4",{className:"font-medium",children:"Annual Property Tax"})]}),s.jsx("p",{className:"text-2xl font-bold text-gray-700",children:R(i.propertyTax)}),s.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:[R(Math.round(i.propertyTax/12))," per month"]})]}),s.jsx("div",{className:"bg-blue-50 p-4 rounded-lg",children:s.jsxs("p",{className:"text-sm text-blue-800",children:[s.jsx("strong",{children:"Note:"})," These are estimates based on current market conditions. Final costs may vary based on specific design choices, site conditions, and material selections."]})}),s.jsx("button",{onClick:()=>l(!0),className:"w-full bg-gray-900 text-white py-3 px-6 rounded-md hover:bg-gray-800 transition-colors",children:"Get Detailed Quote"})]}):s.jsxs("div",{className:"text-center text-gray-500 py-12",children:[s.jsx(Hs,{size:48,className:"mx-auto mb-4 opacity-50"}),s.jsx("p",{children:"Fill in the details to see your estimated costs"})]})]})]})})]})})},Zw=()=>{const[t,r]=T.useState(!0),[e,i]=T.useState(!1),[n,a]=T.useState(!1),[c,o]=T.useState(!1),l=T.useRef(null);T.useEffect(()=>{const f=()=>{a(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]),T.useEffect(()=>{if(l.current)if(n){const f=new IntersectionObserver(p=>{p.forEach(g=>{var w;g.isIntersecting&&((w=l.current)==null||w.play().catch(()=>{}),f.disconnect())})},{threshold:.1});return f.observe(l.current),()=>f.disconnect()}else l.current.play().catch(()=>{})},[n]);const u=n?"https://castlehomesherovideo.s3.us-east-2.amazonaws.com/mobile.mp4":"https://castlehomesherovideo.s3.us-east-2.amazonaws.com/output.mp4",d="https://wkljadlmnqsapyvyydfy.supabase.co/storage/v1/object/public/property-images//1739085223560-a5apd6h47rk.jpg",h="https://wkljadlmnqsapyvyydfy.supabase.co/storage/v1/object/public/property-images//1739085223560-a5apd6h47rk.jpg";return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative h-screen",children:[s.jsx("div",{className:"absolute top-20 left-0 right-0 z-10 bg-black/40 backdrop-blur-[2px] border-b border-white/10",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 py-1.5",children:s.jsx("p",{className:"text-white/80 text-[11px] tracking-[0.2em] text-center font-light uppercase",children:"Custom Home Builders in Edmonton Area"})})}),s.jsxs("div",{className:"absolute inset-0 bg-black",children:[n&&s.jsx("img",{src:d,alt:"Luxury home exterior",className:"absolute inset-0 w-full h-full object-cover",loading:"eager",fetchpriority:"high"}),!n&&s.jsxs(s.Fragment,{children:[s.jsx("img",{src:n?h:h.replace("w=800","w=2850"),alt:"Luxury home exterior",className:"absolute inset-0 w-full h-full object-cover",loading:"eager",fetchpriority:"high"}),s.jsx("video",{ref:l,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-1000 ${e?"opacity-100":"opacity-0"}
334`,autoPlay:!0,loop:!0,muted:t,playsInline:!0,preload:n?"metadata":"auto",onCanPlay:()=>i(!0),children:s.jsx("source",{src:u,type:"video/mp4"})})]}),s.jsx("div",{className:"absolute inset-0 bg-black/50"})]}),!n&&s.jsx("button",{onClick:()=>r(!t),className:"absolute top-24 right-4 z-10 p-3 bg-black/30 hover:bg-black/50 rounded-full text-white transition-colors","aria-label":t?"Unmute video":"Mute video",children:t?s.jsx(Bw,{size:20}):s.jsx(Mw,{size:20})}),s.jsx("div",{className:"relative h-full flex items-center justify-center text-center",children:s.jsxs("div",{className:"max-w-4xl px-4 sm:px-6 lg:px-8",children:[s.jsxs("h1",{className:"text-4xl md:text-6xl font-playfair text-white mb-6",children:["BUILDING WITH VISION",s.jsx("span",{className:"block mt-2 text-[#C0A458]",children:"QUALITY & PRIDE"})]}),s.jsx("p",{className:"text-xl md:text-2xl text-gray-200 mb-12 font-light tracking-wide",children:"Custom Home Building & Renovation · Est. 2018"}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center space-y-4 sm:space-y-0 sm:space-x-4",children:[s.jsxs(le,{to:"/projects",className:"inline-flex items-center px-8 py-3 border border-[#C0A458] text-[#C0A458] hover:bg-[#C0A458] hover:text-white transition-all duration-300 text-lg group",children:["Explore Our Work",s.jsx(Ce,{className:"ml-2 group-hover:translate-x-1 transition-transform duration-300",size:20})]}),s.jsxs("button",{onClick:()=>o(!0),className:"inline-flex items-center px-8 py-3 bg-[#C0A458] text-white hover:bg-[#9A834A] transition-all duration-300 text-lg group",children:[s.jsx(Hs,{className:"mr-2 group-hover:scale-110 transition-transform duration-300",size:20}),"Build Cost Calculator"]})]})]})})]}),c&&s.jsx(Gw,{onClose:()=>o(!1)})]})},Kw=()=>s.jsxs("div",{className:"text-center space-y-6 bg-[#F5F5DC] p-8 rounded-lg",children:[s.jsx("h3",{className:"text-2xl font-playfair text-gray-900",children:"Follow Our Journey"}),s.jsx("p",{className:"text-gray-600",children:"Stay connected with us on social media for daily inspiration, behind-the-scenes content, and project updates."}),s.jsxs("div",{className:"flex justify-center space-x-6",children:[s.jsx("a",{href:"https://www.instagram.com/castlestone.customhomes/",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ba,{size:28})}),s.jsx("a",{href:"https://www.facebook.com/jessie.s.sahota/reels/",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ma,{size:28})}),s.jsx("a",{href:"https://linkedin.com/company/castlestonecustomhomes",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ha,{size:28})})]}),s.jsxs("div",{className:"mt-6 space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Tag us in your posts: #CastlestoneHomes #LuxuryLiving #CustomHomes"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Follow us on Instagram for exclusive content and design inspiration!"})]})]}),Xw=t=>{const r=t.replace(/\D/g,"");return r.length<=3?r:r.length<=6?`${r.slice(0,3)}-${r.slice(3)}`:`${r.slice(0,3)}-${r.slice(3,6)}-${r.slice(6,10)}`},Qw=()=>{const[t,r]=T.useState(!1),[e,i]=T.useState(!1),[n,a]=T.useState(!1),[c,o]=T.useState({type:null,message:""}),l=T.useRef(null),u=h=>{const f=Xw(h.target.value);(f===""||/^\d{3}-\d{3}-\d{4}$/.test(f)||f.length<12)&&(h.target.value=f)},d=async h=>{var f;h.preventDefault(),i(!0),o({type:null,message:""});try{const p=new FormData(h.currentTarget),g=p.get("phone");if(!/^\d{3}-\d{3}-\d{4}$/.test(g))throw new Error("Please enter a valid phone number in the format 123-456-7890");const w={name:p.get("name"),email:p.get("email"),phone:g,project_type:p.get("project_type"),budget_range:"1m-2m",timeline:p.get("timeline"),location:"",requirements:p.get("vision"),preferred_contact_method:"email"},{error:b}=await fe.from("project_inquiries").insert([w]);if(b)throw b;
334o({type:"success",message:"Thank you for sharing your dream with us. We'll be in touch soon!"}),(f=l.current)==null||f.reset(),a(!0)}catch(p){console.error("Error submitting inquiry:",p),o({type:"error",message:p instanceof Error?p.message:"There was an error submitting your inquiry. Please try again."})}finally{i(!1)}};return s.jsx("div",{className:"py-24 bg-white",children:s.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[s.jsx("div",{className:"mb-12 flex justify-center",children:s.jsx("div",{className:"w-32 h-[1px] bg-gradient-to-r from-transparent via-[#C0A458] to-transparent opacity-70"})}),s.jsx("p",{className:"text-2xl md:text-3xl text-gray-700 leading-relaxed font-playfair mb-8",children:"Visit Castlestone"}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center space-y-4 sm:space-y-0 sm:space-x-4",children:[s.jsxs("button",{onClick:()=>r(!0),className:"inline-flex items-center px-8 py-3 border border-[#C0A458] text-[#C0A458] hover:bg-[#C0A458] hover:text-white transition-all duration-300 text-lg group",children:["Dream With Us",s.jsx(Ce,{className:"ml-2 group-hover:translate-x-1 transition-transform duration-300",size:20})]}),s.jsxs(le,{to:"/real-estate-in-spruce-grove-edmonton",className:"inline-flex items-center px-8 py-3 bg-[#C0A458] text-white hover:bg-[#9A834A] transition-all duration-300 text-lg group",children:["Read Our Latest Blog",s.jsx(Ce,{className:"ml-2 group-hover:translate-x-1 transition-transform duration-300",size:20})]})]}),s.jsx("div",{className:"mt-12 flex justify-center",children:s.jsx("div",{className:"w-32 h-[1px] bg-gradient-to-r from-transparent via-[#C0A458] to-transparent opacity-70"})}),t&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-2xl w-full max-h-[90vh] overflow-y-auto relative",children:[s.jsx("button",{onClick:()=>r(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors",children:"×"}),n?s.jsx(Kw,{}):s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"text-2xl font-playfair mb-6",children:"Tell Us About Your Dream Home"}),c.type&&s.jsx("div",{className:`mb-6 p-4 rounded-md ${c.type==="success"?"bg-green-50 text-green-800":"bg-red-50 text-red-800"}`,children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Dt,{className:"mr-2",size:20}),c.message]})}),s.jsxs("form",{ref:l,onSubmit:d,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"What type of project are you interested in?"}),s.jsxs("select",{name:"project_type",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50",children:[s.jsx("option",{value:"",children:"Select Type"}),s.jsx("option",{value:"custom_home",children:"Custom Home Build"}),s.jsx("option",{value:"renovation",children:"Major Renovation"}),s.jsx("option",{value:"addition",children:"Addition"}),s.jsx("option",{value:"other",children:"Other"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"What's your desired timeline?"}),s.jsxs("select",{name:"timeline",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50",children:[s.jsx("option",{value:"",children:"Select Timeline"}),s.jsx("option",{value:"immediate",children:"Within 6 months"}),s.jsx("option",{value:"6-12months",children:"6-12 months"}),s.jsx("option",{value:"1-2years",children:"1-2 years"}),s.jsx("option",{value:"exploring",children:"Just exploring options"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"Tell us about your vision"}),s.jsx("textarea",{name:"vision",rows:4,required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50",placeholder:"Describe your dream project..."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"Name"}),s.jsx("input",{type:"text",name:"name",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"Phone"}),s.jsx("input",{type:"tel",name:"phone",required:!0,pattern:"\\d{3}-\\d{3}-\\d{4}",placeholder:"123-456-7890",onChange:u,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Format: 123-456-7890"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"Email"}),s.jsx("input",{type:"email",name:"email",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50"})]}),s.jsxs("div",{className:"flex justify-end space-x-4",children:[s.jsx("button",{type:"button",onClick:()=>r(!1),className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancel"}),s.jsx("button",{type:"submit",disabled:e,className:"px-6 py-2 bg-[#C0A458] text-white rounded-md hover:bg-[#9A834A] transition-colors flex items-center disabled:opacity-50",children:e?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Submitting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Mi,{size:18,className:"mr-2"}),"Submit"]})})]})]})]})]})})]})})},Jw=()=>s.jsx("div",{className:"bg-[#C0A458] py-4 overflow-hidden",children:s.jsxs("div",{className:"animate-scrolling-text whitespace-nowrap",children:[s.jsx("span",{className:"inline-block text-white font-playfair text-xl px-4",children:"We can build on your own property, contact us for details"}),s.jsx("span",{className:"inline-block text-white font-playfair text-xl px-4",children:"•"}),s.jsx("span",{className:"inline-block text-white font-playfair text-xl px-4",children:"We can build on your own property, contact us for details"}),s.jsx("span",{className:"inline-block text-white font-playfair text-xl px-4",children:"•"}),s.jsx("span",{className:"inline-block text-white font-playfair text-xl px-4",children:"We can build on your own property, contact us for details"}),s.jsx("span",{className:"inline-block text-white font-playfair text-xl px-4",children:"•"})]})}),Yw=()=>{const[t,r]=T.useState([]),[e,i]=T.useState(!0),[n,a]=T.useState(null),[c,o]=T.useState(!0);T.useEffect(()=>{(async()=>{const d=await mw();o(d),d?l():(a("Unable to connect to the database. Please try again later."),i(!1))})()},[]);const l=async()=>{try{i(!0),a(null);const{data:u,error:d}=await fe.from("properties").select(`
335          *,
336          property_images!property_images_property_id_fkey (
337            id,
338            url,
339            alt,
340            order
341          )
342        `).eq("featured",!0).order("created_at",{ascending:!1}).limit(3);
342if(d)throw d;const h=(u==null?void 0:u.map(f=>{var p;return{...f,property_images:(p=f.property_images)==null?void 0:p.sort((g,w)=>g.order-w.order)}}))||[];r(h)}catch(u){console.error("Error fetching projects:",u),a(fw(u))}finally{i(!1)}};return c?e?s.jsx("div",{className:"py-24 bg-gray-50",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair text-center mb-4",children:"Featured Projects"}),s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#C0A458]"})})]})}):n?s.jsx("div",{className:"py-24 bg-gray-50",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:s.jsxs("div",{className:"inline-flex items-center justify-center p-4 bg-red-50 text-red-600 rounded-lg",children:[s.jsx(Dt,{className:"mr-2"}),n]})})}):s.jsx("div",{className:"py-24 bg-gray-50",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair text-center mb-4",children:"Featured Projects"}),s.jsx("p",{className:"text-gray-600 text-center mb-16 max-w-2xl mx-auto",children:"Discover our collection of meticulously crafted luxury homes, each telling its own unique story of elegance and innovation."}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12",children:t.map(u=>{var h;const d=(h=u.property_images)==null?void 0:h[0];return s.jsxs(le,{to:`/projects/${u.id}`,className:"group",children:[s.jsxs("div",{className:"relative overflow-hidden rounded-lg shadow-lg",children:[s.jsx("img",{src:(d==null?void 0:d.url)||"/placeholder-home.jpg",alt:(d==null?void 0:d.alt)||u.title,className:"w-full h-[400px] object-cover transform group-hover:scale-105 transition-transform duration-700",onError:f=>{const p=f.target;p.src="https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80"}}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"})]}),s.jsxs("div",{className:"mt-6",children:[s.jsx("h3",{className:"text-xl font-playfair",children:u.title}),s.jsx("p",{className:"text-gray-600 mt-1 font-light",children:u.location}),s.jsxs("div",{className:"mt-4 inline-flex items-center text-[#C0A458] group-hover:translate-x-2 transition-transform duration-300",children:["View Details",s.jsx(xe,{className:"ml-2",size:18})]})]})]},u.id)})})]})}):s.jsx("div",{className:"py-24 bg-gray-50",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:s.jsxs("div",{className:"inline-flex items-center justify-center p-4 bg-red-50 text-red-600 rounded-lg",children:[s.jsx(Dt,{className:"mr-2"}),"Database connection error. Please try again later."]})})})},$w=()=>s.jsx("div",{className:"py-24 bg-white",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair text-center mb-4",children:"Our Process"}),s.jsx("p",{className:"text-gray-600 text-center mb-16 max-w-2xl mx-auto",children:"From initial design to final delivery, we ensure a collaborative journey every step of the way."}),s.jsxs("div",{className:"relative",children:[s.jsxs("svg",{className:"w-full h-auto max-w-4xl mx-auto hidden md:block",viewBox:"0 0 800 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",stopColor:"#C0A458",stopOpacity:"0",children:s.jsx("animate",{attributeName:"offset",values:"-1; 2",dur:"3s",repeatCount:"indefinite"})}),s.jsx("stop",{offset:"50%",stopColor:"#C0A458",stopOpacity:"0.8",children:s.jsx("animate",{attributeName:"offset",values:"-0.5; 2.5",dur:"3s",repeatCount:"indefinite"})}),s.jsx("stop",{offset:"100%",stopColor:"#C0A458",stopOpacity:"0",children:s.jsx("animate",{attributeName:"offset",values:"0;
342 3",dur:"3s",repeatCount:"indefinite"})})]})}),s.jsx("path",{d:"M50 100 C 200 100, 250 50, 400 50 C 550 50, 600 150, 750 150",stroke:"#F5F5DC",strokeWidth:"4",strokeLinecap:"round"}),s.jsx("path",{d:"M50 100 C 200 100, 250 50, 400 50 C 550 50, 600 150, 750 150",stroke:"url(#gradient)",strokeWidth:"4",strokeLinecap:"round",className:"path-animation"}),s.jsx("circle",{cx:"50",cy:"100",r:"20",fill:"#F5F5DC",stroke:"#C0A458",strokeWidth:"2"}),s.jsx("text",{x:"50",y:"105",fill:"#C0A458",fontSize:"14",fontWeight:"bold",textAnchor:"middle",children:"1"}),s.jsx("circle",{cx:"400",cy:"50",r:"20",fill:"#F5F5DC",stroke:"#C0A458",strokeWidth:"2"}),s.jsx("text",{x:"400",y:"55",fill:"#C0A458",fontSize:"14",fontWeight:"bold",textAnchor:"middle",children:"2"}),s.jsx("circle",{cx:"750",cy:"150",r:"20",fill:"#F5F5DC",stroke:"#C0A458",strokeWidth:"2"}),s.jsx("text",{x:"750",y:"155",fill:"#C0A458",fontSize:"14",fontWeight:"bold",textAnchor:"middle",children:"3"})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8 max-w-4xl mx-auto relative",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"md:hidden w-10 h-10 rounded-full bg-[#F5F5DC] border-2 border-[#C0A458] flex items-center justify-center text-[#C0A458] font-bold mx-auto mb-4",children:"1"}),s.jsx("h3",{className:"text-xl font-playfair mb-3",children:"Design Process"}),s.jsx("p",{className:"text-gray-600 font-light",children:"We start by working closely with you to nail down every aspect of the design, ensuring it matches exactly what you envision for your dream home."})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"md:hidden w-10 h-10 rounded-full bg-[#F5F5DC] border-2 border-[#C0A458] flex items-center justify-center text-[#C0A458] font-bold mx-auto mb-4",children:"2"}),s.jsx("h3",{className:"text-xl font-playfair mb-3",children:"Construction & Selection"}),s.jsx("p",{className:"text-gray-600 font-light",children:"During construction, we keep you engaged through regular site visits and design selections with our trusted suppliers."})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"md:hidden w-10 h-10 rounded-full bg-[#F5F5DC] border-2 border-[#C0A458] flex items-center justify-center text-[#C0A458] font-bold mx-auto mb-4",children:"3"}),s.jsx("h3",{className:"text-xl font-playfair mb-3",children:"Final Walkthrough & Delivery"}),s.jsx("p",{className:"text-gray-600 font-light",children:"We conduct a thorough prepossession walkthrough with you before delivering your beautifully finished custom home."})]})]})]})]})}),eb=()=>{const t=T.useRef(null);T.useEffect(()=>{const e=()=>{const n=document.createElement("script");n.src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD18IgtJ0sgvVH4i6x0ALUROEL300io3vY&callback=initMap",n.async=!0,n.defer=!0,document.body.appendChild(n)};window.initMap=()=>{const n=new google.maps.Map(t.current,{center:{lat:53.5461,lng:-113.4938},zoom:10,mapTypeControl:!1,fullscreenControl:!1,streetViewControl:!1,styles:[{featureType:"all",elementType:"labels.text.fill",stylers:[{color:"#333333"}]}]});[{lat:53.5461,lng:-113.4938,title:"Edmonton"},{lat:53.2671,lng:-113.5437,title:"Leduc"},{lat:53.6331,lng:-113.6436,title:"St. Albert"}].forEach(c=>{new google.maps.Marker({position:{lat:c.lat,lng:c.lng},map:n,title:`Castle Stone serves ${c.title}`})})};const i=new IntersectionObserver(n=>{n[0].isIntersecting&&(e(),i.disconnect())},{threshold:.1});return t.current&&i.observe(t.current),()=>i.disconnect()},[]);const r=()=>{const e=encodeURIComponent("Schedule a Consultation"),i=encodeURIComponent(`Hi, I would like to schedule a consultation to discuss my custom home project.
343
344Please let me know what times are available.
345
346Best regards`);window.location.href=`mailto:[email protected]?subject=${e}&body=${i}`};return s.jsx("div",{className:"py-24 bg-[#F5F5DC]",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair mb-4",children:"Visit Castle"}),s.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Experience luxury firsthand. Meet our team and explore our curated selection of premium finishes."})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12",children:[s.jsx("div",{ref:t,className:"relative h-[400px] rounded-lg overflow-hidden shadow-lg bg-gray-100",children:s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("div",{className:"animate-pulse",children:"Loading map..."})})}),s.jsx("div",{className:"bg-white rounded-lg shadow-lg p-8 md:p-12",children:s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx(Ht,{size:24,className:"text-[#C0A458] flex-shrink-0 mt-1"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-playfair text-xl mb-2",children:"Service Areas"}),s.jsxs("p",{className:"text-gray-600",children:["Edmonton",s.jsx("br",{}),"Leduc",s.jsx("br",{}),"St. Albert",s.jsx("br",{}),s.jsx("span",{className:"text-sm text-gray-500 mt-2 block",children:"& surrounding areas"})]})]})]}),s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx(Zr,{size:24,className:"text-[#C0A458] flex-shrink-0 mt-1"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-playfair text-xl mb-2",children:"Hours"}),s.jsxs("p",{className:"text-gray-600",children:["Monday - Sunday",s.jsx("br",{}),"By Appointment Only"]})]})]}),s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx(Ua,{size:24,className:"text-[#C0A458] flex-shrink-0 mt-1"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-playfair text-xl mb-2",children:"Phone"}),s.jsx("p",{className:"text-gray-600",children:s.jsx("a",{href:"tel:+17802426941",className:"hover:text-[#C0A458] transition-colors",children:"(780) 242-6941"})})]})]}),s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx(Vn,{size:24,className:"text-[#C0A458] flex-shrink-0 mt-1"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-playfair text-xl mb-2",children:"Email"}),s.jsx("p",{className:"text-gray-600",children:s.jsx("a",{href:"mailto:[email protected]",className:"hover:text-[#C0A458] transition-colors",children:"[email protected]"})})]})]}),s.jsxs("button",{onClick:r,className:"w-full mt-8 px-8 py-3 bg-[#C0A458] text-white rounded hover:bg-[#9A834A] transition-colors flex items-center justify-center",children:[s.jsx(Vn,{size:18,className:"mr-2"}),"Schedule a Consultation"]})]})})]})]})})},tb=[{icon:kw,title:"Built to Last",description:"We construct homes that stand the test of time, using premium materials and proven techniques."},{icon:Lw,title:"Tailored Design",description:"Every project is uniquely crafted to reflect your vision and lifestyle needs."},{icon:Pw,title:"Client-Focused",description:"Your satisfaction drives our process, ensuring a collaborative and transparent journey."}],rb=()=>s.jsx("div",{className:"py-24 bg-white",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-16",children:tb.map((t,r)=>s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-8 group-hover:scale-110 transition-transform duration-300",children:s.jsx(t.icon,{size:36})}),s.jsx("h3",{className:"text-2xl font-playfair mb-4",children:t.title}),s.jsx("p",{className:"text-gray-600 leading-relaxed font-light",children:t.description})]},r))})})});var Qm={exports:{}};(function(t){//! openseadragon 4.1.1
347//! Built on 2024-04-01
vendor: 58,124 bytes, lines 348-351
348//! Git commit: v4.1.1-0-f90d9814
349//! http://openseadragon.github.io
350//! License: http://openseadragon.github.io/license/
351function r(e){return new r.Viewer(e)}(function(e){e.version={versionStr:"4.1.1",major:parseInt("4",10),minor:parseInt("1",10),revision:parseInt("1",10)};var i={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object AsyncFunction]":"function","[object Promise]":"promise","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},n=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.isFunction=function(c){return e.type(c)==="function"},e.isArray=Array.isArray||function(c){return e.type(c)==="array"},e.isWindow=function(c){return c&&typeof c=="object"&&"setInterval"in c},e.type=function(c){return c==null?String(c):i[n.call(c)]||"object"},e.isPlainObject=function(c){if(!c||r.type(c)!=="object"||c.nodeType||e.isWindow(c)||c.constructor&&!a.call(c,"constructor")&&!a.call(c.constructor.prototype,"isPrototypeOf"))return!1;var o;for(var l in c)o=l;return o===void 0||a.call(c,o)},e.isEmptyObject=function(c){for(var o in c)return!1;return!0},e.freezeObject=function(c){return Object.freeze?e.freezeObject=Object.freeze:e.freezeObject=function(o){return o},e.freezeObject(c)},e.supportsCanvas=function(){var c=document.createElement("canvas");return!!(e.isFunction(c.getContext)&&c.getContext("2d"))}(),e.isCanvasTainted=function(c){var o=!1;try{c.getContext("2d").getImageData(0,0,1,1)}catch{o=!0}return o},e.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),e.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),e.supportsEventListenerOptions=function(){var c=0;if(e.supportsAddEventListener)try{var o={get capture(){return c++,!1},get once(){return c++,!1},get passive(){return c++,!1}};window.addEventListener("test",null,o),window.removeEventListener("test",null,o)}catch{c=0}return c>=3}(),e.getCurrentPixelDensityRatio=function(){if(e.supportsCanvas){var c=document.createElement("canvas").getContext("2d"),o=window.devicePixelRatio||1,l=c.webkitBackingStorePixelRatio||c.mozBackingStorePixelRatio||c.msBackingStorePixelRatio||c.oBackingStorePixelRatio||c.backingStorePixelRatio||1;return Math.max(o,1)/l}else return 1},e.pixelDensityRatio=e.getCurrentPixelDensityRatio()})(r),function(e){e.extend=function(){var l,u,d,h,f,p,g=arguments[0]||{},w=arguments.length,b=!1,x=1;for(typeof g=="boolean"&&(b=g,g=arguments[1]||{},x=2),typeof g!="object"&&!r.isFunction(g)&&(g={}),w===x&&(g=this,--x);x<w;x++)if(l=arguments[x],l!==null||l!==void 0)for(u in l){var j=Object.getOwnPropertyDescriptor(l,u);if(j!==void 0){if(j.get||j.set){Object.defineProperty(g,u,j);continue}h=j.value}else{e.console.warn('Could not copy inherited property "'+u+'".');continue}g!==h&&(b&&h&&(r.isPlainObject(h)||(f=r.isArray(h)))?(d=g[u],f?(f=!1,p=d&&r.isArray(d)?d:[]):p=d&&r.isPlainObject(d)?d:{},g[u]=r.extend(b,p,h)):h!==void 0&&(g[u]=h))}return g};var i=function(){if(typeof navigator!="object")return!1;var l=navigator.userAgent;return typeof l!="string"?!1:l.indexOf("iPhone")!==-1||l.indexOf("iPad")!==-1||l.indexOf("iPod")!==-1};e.extend(e,{DEFAULT_SETTINGS:{xmlPath:null,tileSources:null,tileHost:null,initialPage:0,crossOriginPolicy:!1,ajaxWithCredentials:!1,loadTilesWithAjax:!1,ajaxHeaders:{},splitHashDataForPost:!1,panHorizontal:!0,panVertical:!0,constrainDuringPan:!1,wrapHorizontal:!1,wrapVertical:!1,visibilityRatio:.5,minPixelRatio:.5,defaultZoomLevel:0,minZoomLevel:null,maxZoomLevel:null,homeFillsViewer:!1,clickTimeThreshold:300,clickDistThreshold:5,dblClickTimeThreshold:300,dblClickDistThreshold:20,springStiffness:6.5,animationTime:1.2,gestureSettingsMouse:{dragToPan:!0,scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!1,dblClickDragToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsTouch:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,dblClickDragToZoom:!0,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsPen:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!0,dblClickToZoom:!1,dblClickDragToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsUnknown:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,dblClickDragToZoom:!1,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},zoomPerClick:2,zoomPerScroll:1.2,zoomPerDblClickDrag:1.2,zoomPerSecond:1,blendTime:0,alwaysBlend:!1,autoHideControls:!0,immediateRender:!1,minZoomImageRatio:.9,maxZoomPixelRatio:1.1,smoothTileEdgesMinZoom:1.1,iOSDevice:i(),pixelsPerWheelLine:40,pixelsPerArrowPress:40,autoResize:!0,preserveImageSizeOnResize:!1,minScrollDeltaTime:50,rotationIncrement:90,showSequenceControl:!0,sequenceControlAnchor:null,preserveViewport:!1,preserveOverlays:!1,navPrevNextWrap:!1,showNavigationControl:!0,navigationControlAnchor:null,showZoomControl:!0,showHomeControl:!0,showFullPageControl:!0,showRotationControl:!1,showFlipControl:!1,controlsFadeDelay:2e3,controlsFadeLength:1500,mouseNavEnabled:!0,showNavigator:!1,navigatorElement:null,navigatorId:null,navigatorPosition:null,navigatorSizeRatio:.2,navigatorMaintainSizeRatio:!1,navigatorTop:null,navigatorLeft:null,navigatorHeight:null,navigatorWidth:null,navigatorAutoResize:!0,navigatorAutoFade:!0,navigatorRotate:!0,navigatorBackground:"#000",navigatorOpacity:.8,navigatorBorderColor:"#555",navigatorDisplayRegionColor:"#900",degrees:0,flipped:!1,opacity:1,preload:!1,compositeOperation:null,imageSmoothingEnabled:!0,placeholderFillStyle:null,subPixelRoundingForTransparency:null,showReferenceStrip:!1,referenceStripScroll:"horizontal",referenceStripElement:null,referenceStripHeight:null,referenceStripWidth:null,referenceStripPosition:"BOTTOM_LEFT",referenceStripSizeRatio:.2,collectionRows:3,collectionColumns:0,collectionLayout:"horizontal",collectionMode:!1,collectionTileSize:800,collectionTileMargin:80,imageLoaderLimit:0,maxImageCacheCount:200,timeout:3e4,useCanvas:!0,tileRetryMax:0,tileRetryDelay:2500,prefixUrl:"/images/",navImages:{zoomIn:{REST:"zoomin_rest.png",GROUP:"zoomin_grouphover.png",HOVER:"zoomin_hover.png",DOWN:"zoomin_pressed.png"},zoomOut:{REST:"zoomout_rest.png",GROUP:"zoomout_grouphover.png",HOVER:"zoomout_hover.png",DOWN:"zoomout_pressed.png"},home:{REST:"home_rest.png",GROUP:"home_grouphover.png",HOVER:"home_hover.png",DOWN:"home_pressed.png"},fullpage:{REST:"fullpage_rest.png",GROUP:"fullpage_grouphover.png",HOVER:"fullpage_hover.png",DOWN:"fullpage_pressed.png"},rotateleft:{REST:"rotateleft_rest.png",GROUP:"rotateleft_grouphover.png",HOVER:"rotateleft_hover.png",DOWN:"rotateleft_pressed.png"},rotateright:{REST:"rotateright_rest.png",GROUP:"rotateright_grouphover.png",HOVER:"rotateright_hover.png",DOWN:"rotateright_pressed.png"},flip:{REST:"flip_rest.png",GROUP:"flip_grouphover.png",HOVER:"flip_hover.png",DOWN:"flip_pressed.png"},previous:{REST:"previous_rest.png",GROUP:"previous_grouphover.png",HOVER:"previous_hover.png",DOWN:"previous_pressed.png"},next:{REST:"next_rest.png",GROUP:"next_grouphover.png",HOVER:"next_hover.png",DOWN:"next_pressed.png"}},debugMode:!1,debugGridColor:["#437AB2","#1B9E77","#D95F02","#7570B3","#E7298A","#66A61E","#E6AB02","#A6761D","#666666"],silenceMultiImageWarnings:!1},SIGNAL:"----seadragon----",delegate:function(l,u){return function(){var d=arguments;return d===void 0&&(d=[]),u.apply(l,d)}},BROWSERS:{UNKNOWN:0,IE:1,FIREFOX:2,SAFARI:3,CHROME:4,OPERA:5,EDGE:6,CHROMEEDGE:7},SUBPIXEL_ROUNDING_OCCURRENCES:{NEVER:0,ONLY_AT_REST:1,ALWAYS:2},_viewers:new Map,getViewer:function(l){return e._viewers.get(this.getElement(l))},getElement:function(l){return typeof l=="string"&&(l=document.getElementById(l)),l},getElementPosition:function(l){var u=new e.Point,d,h;for(l=e.getElement(l),d=e.getElementStyle(l).position==="fixed",h=o(l,d);h;)u.x+=l.offsetLeft,u.y+=l.offsetTop,d&&(u=u.plus(e.getPageScroll())),l=h,d=e.getElementStyle(l).position==="fixed",h=o(l,d);return u},getElementOffset:function(l){l=e.getElement(l);var u=l&&l.ownerDocument,d,h,f={top:0,left:0};return u?(d=u.documentElement,typeof l.getBoundingClientRect<"u"&&(f=l.getBoundingClientRect()),h=u===u.window?u:u.nodeType===9?u.defaultView||u.parentWindow:!1,new e.Point(f.left+(h.pageXOffset||d.scrollLeft)-(d.clientLeft||0),f.top+(h.pageYOffset||d.scrollTop)-(d.clientTop||0))):new e.Point},getElementSize:function(l){return l=e.getElement(l),new e.Point(l.clientWidth,l.clientHeight)},getElementStyle:document.documentElement.currentStyle?function(l){return l=e.getElement(l),l.currentStyle}:function(l){return l=e.getElement(l),window.getComputedStyle(l,"")},getCssPropertyWithVendorPrefix:function(l){var u={};return e.getCssPropertyWithVendorPrefix=function(d){if(u[d]!==void 0)return u[d];var h=document.createElement("div").style,f=null;if(h[d]!==void 0)f=d;else for(var p=["Webkit","Moz","MS","O","webkit","moz","ms","o"],g=e.capitalizeFirstLetter(d),w=0;w<p.length;w++){var b=p[w]+g;if(h[b]!==void 0){f=b;break}}return u[d]=f,f},e.getCssPropertyWithVendorPrefix(l)},capitalizeFirstLetter:function(l){return l.charAt(0).toUpperCase()+l.slice(1)},positiveModulo:function(l,u){var d=l%u;return d<0&&(d+=u),d},pointInElement:function(l,u){l=e.getElement(l);var d=e.getElementOffset(l),h=e.getElementSize(l);return u.x>=d.x&&u.x<d.x+h.x&&u.y<d.y+h.y&&u.y>=d.y},getMousePosition:function(l){if(typeof l.pageX=="number")e.getMousePosition=function(u){var d=new e.Point;return d.x=u.pageX,d.y=u.pageY,d};else if(typeof l.clientX=="number")e.getMousePosition=function(u){var d=new e.Point;return d.x=u.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,d.y=u.clientY+document.body.scrollTop+document.documentElement.scrollTop,d};else throw new Error("Unknown event mouse position, no known technique.");return e.getMousePosition(l)},getPageScroll:function(){var l=document.documentElement||{},u=document.body||{};if(typeof window.pageXOffset=="number")e.getPageScroll=function(){return new e.Point(window.pageXOffset,window.pageYOffset)};else if(u.scrollLeft||u.scrollTop)e.getPageScroll=function(){return new e.Point(document.body.scrollLeft,document.body.scrollTop)};else if(l.scrollLeft||l.scrollTop)e.getPageScroll=function(){return new e.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new e.Point(0,0);return e.getPageScroll()},setPageScroll:function(l){if(typeof window.scrollTo<"u")e.setPageScroll=function(h){window.scrollTo(h.x,h.y)};else{var u=e.getPageScroll();if(u.x===l.x&&u.y===l.y)return;document.body.scrollLeft=l.x,document.body.scrollTop=l.y;var d=e.getPageScroll();if(d.x!==u.x&&d.y!==u.y){e.setPageScroll=function(h){document.body.scrollLeft=h.x,document.body.scrollTop=h.y};return}if(document.documentElement.scrollLeft=l.x,document.documentElement.scrollTop=l.y,d=e.getPageScroll(),d.x!==u.x&&d.y!==u.y){e.setPageScroll=function(h){document.documentElement.scrollLeft=h.x,document.documentElement.scrollTop=h.y};return}e.setPageScroll=function(h){}}e.setPageScroll(l)},getWindowSize:function(){var l=document.documentElement||{},u=document.body||{};if(typeof window.innerWidth=="number")e.getWindowSize=function(){return new e.Point(window.innerWidth,window.innerHeight)};else if(l.clientWidth||l.clientHeight)e.getWindowSize=function(){return new e.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(u.clientWidth||u.clientHeight)e.getWindowSize=function(){return new e.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return e.getWindowSize()},makeCenteredNode:function(l){l=e.getElement(l);var u=[e.makeNeutralElement("div"),e.makeNeutralElement("div"),e.makeNeutralElement("div")];return e.extend(u[0].style,{display:"table",height:"100%",width:"100%"}),e.extend(u[1].style,{display:"table-row"}),e.extend(u[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),u[0].appendChild(u[1]),u[1].appendChild(u[2]),u[2].appendChild(l),u[0]},makeNeutralElement:function(l){var u=document.createElement(l),d=u.style;return d.background="transparent none",d.border="none",d.margin="0px",d.padding="0px",d.position="static",u},now:function(){return Date.now?e.now=Date.now:e.now=function(){return new Date().getTime()},e.now()},makeTransparentImage:function(l){var u=e.makeNeutralElement("img");return u.src=l,u},setElementOpacity:function(l,u,d){var h,f;l=e.getElement(l),d&&!e.Browser.alpha&&(u=Math.round(u)),e.Browser.opacity?l.style.opacity=u<1?u:"":u<1?(h=Math.round(100*u),f="alpha(opacity="+h+")",l.style.filter=f):l.style.filter=""},setElementTouchActionNone:function(l){l=e.getElement(l),typeof l.style.touchAction<"u"?l.style.touchAction="none":typeof l.style.msTouchAction<"u"&&(l.style.msTouchAction="none")},setElementPointerEvents:function(l,u){l=e.getElement(l),typeof l.style<"u"&&typeof l.style.pointerEvents<"u"&&(l.style.pointerEvents=u)},setElementPointerEventsNone:function(l){e.setElementPointerEvents(l,"none")},addClass:function(l,u){l=e.getElement(l),l.className?(" "+l.className+" ").indexOf(" "+u+" ")===-1&&(l.className+=" "+u):l.className=u},indexOf:function(l,u,d){return Array.prototype.indexOf?this.indexOf=function(h,f,p){return h.indexOf(f,p)}:this.indexOf=function(h,f,p){var g,w=p||0,b;if(!h)throw new TypeError;if(b=h.length,b===0||w>=b)return-1;for(w<0&&(w=b-Math.abs(w)),g=w;g<b;g++)if(h[g]===f)return g;return-1},this.indexOf(l,u,d)},removeClass:function(l,u){var d,h=[],f;for(l=e.getElement(l),d=l.className.split(/\s+/),f=0;f<d.length;f++)d[f]&&d[f]!==u&&h.push(d[f]);l.className=h.join(" ")},normalizeEventListenerOptions:function(l){var u;return typeof l<"u"?typeof l=="boolean"?u=e.supportsEventListenerOptions?{capture:l}:l:u=e.supportsEventListenerOptions?l:typeof l.capture<"u"?l.capture:!1:u=e.supportsEventListenerOptions?{capture:!1}:!1,u},addEvent:function(){if(e.supportsAddEventListener)return function(l,u,d,h){h=e.normalizeEventListenerOptions(h),l=e.getElement(l),l.addEventListener(u,d,h)};if(document.documentElement.attachEvent&&document.attachEvent)return function(l,u,d){l=e.getElement(l),l.attachEvent("on"+u,d)};throw new Error("No known event model.")}(),removeEvent:function(){if(e.supportsRemoveEventListener)return function(l,u,d,h){h=e.normalizeEventListenerOptions(h),l=e.getElement(l),l.removeEventListener(u,d,h)};if(document.documentElement.detachEvent&&document.detachEvent)return function(l,u,d){l=e.getElement(l),l.detachEvent("on"+u,d)};throw new Error("No known event model.")}(),cancelEvent:function(l){l.preventDefault()},eventIsCanceled:function(l){return l.defaultPrevented},stopEvent:function(l){l.stopPropagation()},createCallback:function(l,u){var d=[],h;for(h=2;h<arguments.length;h++)d.push(arguments[h]);return function(){var f=d.concat([]),p;for(p=0;p<arguments.length;p++)f.push(arguments[p]);return u.apply(l,f)}},getUrlParameter:function(l){var u=c[l];return u||null},getUrlProtocol:function(l){var u=l.match(/^([a-z]+:)\/\//i);return u===null?window.location.protocol:u[1].toLowerCase()},createAjaxRequest:function(l){var u;try{u=!!new ActiveXObject("Microsoft.XMLHTTP")}catch{u=!1}if(u)window.XMLHttpRequest?e.createAjaxRequest=function(d){return d?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest}:e.createAjaxRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")};else if(window.XMLHttpRequest)e.createAjaxRequest=function(){return new XMLHttpRequest};else throw new Error("Browser doesn't support XMLHttpRequest.");return e.createAjaxRequest(l)},makeAjaxRequest:function(l,u,d){var h,f,p,g;e.isPlainObject(l)&&(u=l.success,d=l.error,h=l.withCredentials,f=l.headers,p=l.responseType||null,g=l.postData||null,l=l.url);var w=e.getUrlProtocol(l),b=e.createAjaxRequest(w==="file:");if(!e.isFunction(u))throw new Error("makeAjaxRequest requires a success callback");b.onreadystatechange=function(){b.readyState===4&&(b.onreadystatechange=function(){},b.status>=200&&b.status<300||b.status===0&&w!=="http:"&&w!=="https:"?u(b):e.isFunction(d)?d(b):e.console.error("AJAX request returned %d: %s",b.status,l))};var x=g?"POST":"GET";try{if(b.open(x,l,!0),p&&(b.responseType=p),f)for(var j in f)Object.prototype.hasOwnProperty.call(f,j)&&f[j]&&b.setRequestHeader(j,f[j]);h&&(b.withCredentials=!0),b.send(g)}catch(S){e.console.error("%s while making AJAX request: %s",S.name,S.message),b.onreadystatechange=function(){},e.isFunction(d)&&d(b,S)}return b},jsonp:function(l){var u,d=l.url,h=document.head||document.getElementsByTagName("head")[0]||document.documentElement,f=l.callbackName||"openseadragon"+e.now(),p=window[f],g="$1"+f+"$2",w=l.param||"callback",b=l.callback;d=d.replace(/(=)\?(&|$)|\?\?/i,g),d+=(/\?/.test(d)?"&":"?")+w+"="+f,window[f]=function(x){if(p)window[f]=p;else try{delete window[f]}catch{}b&&e.isFunction(b)&&b(x)},u=document.createElement("script"),(l.async!==void 0||l.async!==!1)&&(u.async="async"),l.scriptCharset&&(u.charset=l.scriptCharset),u.src=d,u.onload=u.onreadystatechange=function(x,j){(j||!u.readyState||/loaded|complete/.test(u.readyState))&&(u.onload=u.onreadystatechange=null,h&&u.parentNode&&h.removeChild(u),u=void 0)},h.insertBefore(u,h.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(l){if(window.DOMParser)e.parseXml=function(u){var d=null,h;return h=new DOMParser,d=h.parseFromString(u,"text/xml"),d};else if(window.ActiveXObject)e.parseXml=function(u){var d=null;return d=new ActiveXObject("Microsoft.XMLDOM"),d.async=!1,d.loadXML(u),d};else throw new Error("Browser doesn't support XML DOM.");return e.parseXml(l)},parseJSON:function(l){return e.parseJSON=window.JSON.parse,e.parseJSON(l)},imageFormatSupported:function(l){return l=l||"",!!a[l.toLowerCase()]},setImageFormatsSupported:function(l){e.extend(a,l)}});var n=function(l){};e.console=window.console||{log:n,debug:n,info:n,warn:n,error:n,assert:n},e.Browser={vendor:e.BROWSERS.UNKNOWN,version:0,alpha:!0};var a={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},c={};(function(){var l=navigator.appVersion,u=navigator.userAgent,d;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(u.substring(u.indexOf("MSIE")+5,u.indexOf(";",u.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(u.indexOf("Edge")>=0?(e.Browser.vendor=e.BROWSERS.EDGE,e.Browser.version=parseFloat(u.substring(u.indexOf("Edge")+5))):u.indexOf("Edg")>=0?(e.Browser.vendor=e.BROWSERS.CHROMEEDGE,e.Browser.version=parseFloat(u.substring(u.indexOf("Edg")+4))):u.indexOf("Firefox")>=0?(e.Browser.vendor=e.BROWSERS.FIREFOX,e.Browser.version=parseFloat(u.substring(u.indexOf("Firefox")+8))):u.indexOf("Safari")>=0?(e.Browser.vendor=u.indexOf("Chrome")>=0?e.BROWSERS.CHROME:e.BROWSERS.SAFARI,e.Browser.version=parseFloat(u.substring(u.substring(0,u.indexOf("Safari")).lastIndexOf("/")+1,u.indexOf("Safari")))):(d=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),d.exec(u)!==null&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":e.Browser.vendor=e.BROWSERS.OPERA,e.Browser.version=parseFloat(l);break}var h=window.location.search.substring(1),f=h.split("&"),p,g,w;for(w=0;w<f.length;w++)if(p=f[w],g=p.indexOf("="),g>0){var b=p.substring(0,g),x=p.substring(g+1);try{c[b]=decodeURIComponent(x)}catch{e.console.error("Ignoring malformed URL parameter: %s=%s",b,x)}}e.Browser.alpha=!(e.Browser.vendor===e.BROWSERS.CHROME&&e.Browser.version<2),e.Browser.opacity=!0,e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version<11&&e.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(l){var u=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame,d=l.cancelAnimationFrame||l.mozCancelAnimationFrame||l.webkitCancelAnimationFrame||l.msCancelAnimationFrame;if(u&&d)e.requestAnimationFrame=function(){return u.apply(l,arguments)},e.cancelAnimationFrame=function(){return d.apply(l,arguments)};else{var h=[],f=[],p=0,g;e.requestAnimationFrame=function(w){return h.push([++p,w]),g||(g=setInterval(function(){if(h.length){var b=e.now(),x=f;for(f=h,h=x;f.length;)f.shift()[1](b)}else clearInterval(g),g=void 0},1e3/50)),p},e.cancelAnimationFrame=function(w){var b,x;for(b=0,x=h.length;b<x;b+=1)if(h[b][0]===w){h.splice(b,1);return}for(b=0,x=f.length;b<x;b+=1)if(f[b][0]===w){f.splice(b,1);return}}}}(window);function o(l,u){return u&&l!==document.body?document.body:l.offsetParent}}(r),function(e,i){t.exports?t.exports=i():e.OpenSeadragon=i()}(mt,function(){return r}),function(e){var i={supportsFullScreen:!1,isFullScreen:function(){return!1},getFullScreenElement:function(){return null},requestFullScreen:function(){},exitFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",fullScreenErrorEventName:""};document.exitFullscreen?(i.supportsFullScreen=!0,i.getFullScreenElement=function(){return document.fullscreenElement},i.requestFullScreen=function(n){return n.requestFullscreen()},i.exitFullScreen=function(){document.exitFullscreen()},i.fullScreenEventName="fullscreenchange",i.fullScreenErrorEventName="fullscreenerror"):document.msExitFullscreen?(i.supportsFullScreen=!0,i.getFullScreenElement=function(){return document.msFullscreenElement},i.requestFullScreen=function(n){return n.msRequestFullscreen()},i.exitFullScreen=function(){document.msExitFullscreen()},i.fullScreenEventName="MSFullscreenChange",i.fullScreenErrorEventName="MSFullscreenError"):document.webkitExitFullscreen?(i.supportsFullScreen=!0,i.getFullScreenElement=function(){return document.webkitFullscreenElement},i.requestFullScreen=function(n){return n.webkitRequestFullscreen()},i.exitFullScreen=function(){document.webkitExitFullscreen()},i.fullScreenEventName="webkitfullscreenchange",i.fullScreenErrorEventName="webkitfullscreenerror"):document.webkitCancelFullScreen?(i.supportsFullScreen=!0,i.getFullScreenElement=function(){return document.webkitCurrentFullScreenElement},i.requestFullScreen=function(n){return n.webkitRequestFullScreen()},i.exitFullScreen=function(){document.webkitCancelFullScreen()},i.fullScreenEventName="webkitfullscreenchange",i.fullScreenErrorEventName="webkitfullscreenerror"):document.mozCancelFullScreen&&(i.supportsFullScreen=!0,i.getFullScreenElement=function(){return document.mozFullScreenElement},i.requestFullScreen=function(n){return n.mozRequestFullScreen()},i.exitFullScreen=function(){document.mozCancelFullScreen()},i.fullScreenEventName="mozfullscreenchange",i.fullScreenErrorEventName="mozfullscreenerror"),i.isFullScreen=function(){return i.getFullScreenElement()!==null},i.cancelFullScreen=function(){e.console.error("cancelFullScreen is deprecated. Use exitFullScreen instead."),i.exitFullScreen()},e.extend(e,i)}(r),function(e){e.EventSource=function(){this.events={}},e.EventSource.prototype={addOnceHandler:function(i,n,a,c,o){var l=this;c=c||1;var u=0,d=function(h){return u++,u===c&&l.removeHandler(i,d),n(h)};this.addHandler(i,d,a,o)},addHandler:function(i,n,a,c){var o=this.events[i];if(o||(this.events[i]=o=[]),n&&e.isFunction(n)){var l=o.length,u={handler:n,userData:a||null,priority:c||0};for(o[l]=u;l>0&&o[l-1].priority<o[l].priority;)o[l]=o[l-1],o[l-1]=u,l--}},removeHandler:function(i,n){var a=this.events[i],c=[],o;if(a&&e.isArray(a)){for(o=0;o<a.length;o++)a[o].handler!==n&&c.push(a[o]);this.events[i]=c}},numberOfHandlers:function(i){var n=this.events[i];return n?n.length:0},removeAllHandlers:function(i){if(i)this.events[i]=[];else for(var n in this.events)this.events[n]=[]},getHandler:function(i){var n=this.events[i];return!n||!n.length?null:(n=n.length===1?[n[0]]:Array.apply(null,n),function(a,c){var o,l=n.length;for(o=0;o<l;o++)n[o]&&(c.eventSource=a,c.userData=n[o].userData,n[o].handler(c))})},raiseEvent:function(i,n){var a=this.getHandler(i);if(a)return a(this,n||{})}}}(r),function(e){var i={};e.MouseTracker=function(y){var v=arguments;e.isPlainObject(y)||(y={element:v[0],clickTimeThreshold:v[1],clickDistThreshold:v[2]}),this.hash=Math.random(),this.element=e.getElement(y.element),this.clickTimeThreshold=y.clickTimeThreshold||e.DEFAULT_SETTINGS.clickTimeThreshold,this.clickDistThreshold=y.clickDistThreshold||e.DEFAULT_SETTINGS.clickDistThreshold,this.dblClickTimeThreshold=y.dblClickTimeThreshold||e.DEFAULT_SETTINGS.dblClickTimeThreshold,this.dblClickDistThreshold=y.dblClickDistThreshold||e.DEFAULT_SETTINGS.dblClickDistThreshold,this.userData=y.userData||null,this.stopDelay=y.stopDelay||50,this.preProcessEventHandler=y.preProcessEventHandler||null,this.contextMenuHandler=y.contextMenuHandler||null,this.enterHandler=y.enterHandler||null,this.leaveHandler=y.leaveHandler||null,this.exitHandler=y.exitHandler||null,this.overHandler=y.overHandler||null,this.outHandler=y.outHandler||null,this.pressHandler=y.pressHandler||null,this.nonPrimaryPressHandler=y.nonPrimaryPressHandler||null,this.releaseHandler=y.releaseHandler||null,this.nonPrimaryReleaseHandler=y.nonPrimaryReleaseHandler||null,this.moveHandler=y.moveHandler||null,this.scrollHandler=y.scrollHandler||null,this.clickHandler=y.clickHandler||null,this.dblClickHandler=y.dblClickHandler||null,this.dragHandler=y.dragHandler||null,this.dragEndHandler=y.dragEndHandler||null,this.pinchHandler=y.pinchHandler||null,this.stopHandler=y.stopHandler||null,this.keyDownHandler=y.keyDownHandler||null,this.keyUpHandler=y.keyUpHandler||null,this.keyHandler=y.keyHandler||null,this.focusHandler=y.focusHandler||null,this.blurHandler=y.blurHandler||null;var _=this;i[this.hash]={click:function(N){S(_,N)},dblclick:function(N){E(_,N)},keydown:function(N){R(_,N)},keyup:function(N){A(_,N)},keypress:function(N){I(_,N)},focus:function(N){H(_,N)},blur:function(N){W(_,N)},contextmenu:function(N){Z(_,N)},wheel:function(N){$(_,N)},mousewheel:function(N){X(_,N)},DOMMouseScroll:function(N){X(_,N)},MozMousePixelScroll:function(N){X(_,N)},losecapture:function(N){P(_,N)},mouseenter:function(N){J(_,N)},mouseleave:function(N){ce(_,N)},mouseover:function(N){Fe(_,N)},mouseout:function(N){Pe(_,N)},mousedown:function(N){Ne(_,N)},mouseup:function(N){lt(_,N)},mousemove:function(N){kr(_,N)},touchstart:function(N){k(_,N)},touchend:function(N){O(_,N)},touchmove:function(N){z(_,N)},touchcancel:function(N){D(_,N)},gesturestart:function(N){M(_,N)},gesturechange:function(N){B(_,N)},gotpointercapture:function(N){K(_,N)},lostpointercapture:function(N){se(_,N)},pointerenter:function(N){J(_,N)},pointerleave:function(N){ce(_,N)},pointerover:function(N){Fe(_,N)},pointerout:function(N){Pe(_,N)},pointerdown:function(N){Ne(_,N)},pointerup:function(N){lt(_,N)},pointermove:function(N){kr(_,N)},pointercancel:function(N){qa(_,N)},pointerupcaptured:function(N){$r(_,N)},pointermovecaptured:function(N){Ki(_,N)},tracking:!1,activePointersLists:[],lastClickPos:null,dblClickTimeOut:null,pinchGPoints:[],lastPinchDist:0,currentPinchDist:0,lastPinchCenter:null,currentPinchCenter:null,sentDragEvent:!1},this.hasGestureHandlers=!!(this.pressHandler||this.nonPrimaryPressHandler||this.releaseHandler||this.nonPrimaryReleaseHandler||this.clickHandler||this.dblClickHandler||this.dragHandler||this.dragEndHandler||this.pinchHandler),this.hasScrollHandler=!!this.scrollHandler,e.MouseTracker.havePointerEvents&&e.setElementPointerEvents(this.element,"auto"),this.exitHandler&&e.console.error("MouseTracker.exitHandler is deprecated. Use MouseTracker.leaveHandler instead."),y.startDisabled||this.setTracking(!0)},e.MouseTracker.prototype={destroy:function(){l(this),this.element=null,i[this.hash]=null,delete i[this.hash]},isTracking:function(){return i[this.hash].tracking},setTracking:function(y){return y?o(this):l(this),this},getActivePointersListByType:function(y){var v=i[this.hash],_,N=v.activePointersLists.length,F;for(_=0;_<N;_++)if(v.activePointersLists[_].type===y)return v.activePointersLists[_];return F=new e.MouseTracker.GesturePointList(y),v.activePointersLists.push(F),F},getActivePointerCount:function(){var y=i[this.hash],v,_=y.activePointersLists.length,N=0;for(v=0;v<_;v++)N+=y.activePointersLists[v].getLength();return N},preProcessEventHandler:function(){},contextMenuHandler:function(){},enterHandler:function(){},leaveHandler:function(){},exitHandler:function(){},overHandler:function(){},outHandler:function(){},pressHandler:function(){},nonPrimaryPressHandler:function(){},releaseHandler:function(){},nonPrimaryReleaseHandler:function(){},moveHandler:function(){},scrollHandler:function(){},clickHandler:function(){},dblClickHandler:function(){},dragHandler:function(){},dragEndHandler:function(){},pinchHandler:function(){},stopHandler:function(){},keyDownHandler:function(){},keyUpHandler:function(){},keyHandler:function(){},focusHandler:function(){},blurHandler:function(){}};var n=function(){try{return window.self!==window.top}catch{return!0}}();function a(y){try{return y.addEventListener&&y.removeEventListener}catch{return!1}}e.MouseTracker.gesturePointVelocityTracker=function(){var y=[],v=0,_=0,N=function(pe,ie){return pe.hash.toString()+ie.type+ie.id.toString()},F=function(){var pe,ie=y.length,ct,Me,ri=e.now(),Bc,Hc,Uc;for(Bc=ri-_,_=ri,pe=0;pe<ie;pe++)ct=y[pe],Me=ct.gPoint,Me.direction=Math.atan2(Me.currentPos.y-ct.lastPos.y,Me.currentPos.x-ct.lastPos.x),Hc=ct.lastPos.distanceTo(Me.currentPos),ct.lastPos=Me.currentPos,Uc=1e3*Hc/(Bc+1),Me.speed=.75*Uc+.25*Me.speed},V=function(pe,ie){var ct=N(pe,ie);y.push({guid:ct,gPoint:ie,lastPos:ie.currentPos}),y.length===1&&(_=e.now(),v=window.setInterval(F,50))},re=function(pe,ie){var ct=N(pe,ie),Me,ri=y.length;for(Me=0;Me<ri;Me++)if(y[Me].guid===ct){y.splice(Me,1),ri--,ri===0&&window.clearInterval(v);break}};return{addPoint:V,removePoint:re}}(),e.MouseTracker.captureElement=document,e.MouseTracker.wheelEventName=e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version>8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",e.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",e.MouseTracker.wheelEventName],e.MouseTracker.wheelEventName==="DOMMouseScroll"&&e.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(e.MouseTracker.havePointerEvents=!0,e.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),e.MouseTracker.havePointerCapture=function(){var y=document.createElement("div");return e.isFunction(y.setPointerCapture)&&e.isFunction(y.releasePointerCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(e.MouseTracker.havePointerEvents=!1,e.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),e.MouseTracker.mousePointerId="legacy-mouse",e.MouseTracker.havePointerCapture=function(){var y=document.createElement("div");return e.isFunction(y.setCapture)&&e.isFunction(y.releaseCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&e.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&e.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),e.MouseTracker.GesturePointList=function(y){this._gPoints=[],this.type=y,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},e.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(y){return this._gPoints.push(y)},removeById:function(y){var v,_=this._gPoints.length;for(v=0;v<_;v++)if(this._gPoints[v].id===y){this._gPoints.splice(v,1);break}return this._gPoints.length},getByIndex:function(y){return y<this._gPoints.length?this._gPoints[y]:null},getById:function(y){var v,_=this._gPoints.length;for(v=0;v<_;v++)if(this._gPoints[v].id===y)return this._gPoints[v];return null},getPrimary:function(y){var v,_=this._gPoints.length;for(v=0;v<_;v++)if(this._gPoints[v].isPrimary)return this._gPoints[v];return null},addContact:function(){++this.contacts,this.contacts>1&&(this.type==="mouse"||this.type==="pen")&&(e.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(this.contacts=0)}};function c(y){var v=i[y.hash],_,N,F,V,re,pe=v.activePointersLists.length;for(_=0;_<pe;_++)if(F=v.activePointersLists[_],F.getLength()>0){for(re=[],V=F.asArray(),N=0;N<V.length;N++)re.push(V[N]);for(N=0;N<re.length;N++)ti(y,F,re[N])}for(_=0;_<pe;_++)v.activePointersLists.pop();v.sentDragEvent=!1}function o(y){var v=i[y.hash],_,N;if(!v.tracking){for(N=0;N<e.MouseTracker.subscribeEvents.length;N++)_=e.MouseTracker.subscribeEvents[N],e.addEvent(y.element,_,v[_],_===e.MouseTracker.wheelEventName?{passive:!1,capture:!1}:!1);c(y),v.tracking=!0}}function l(y){var v=i[y.hash],_,N;if(v.tracking){for(N=0;N<e.MouseTracker.subscribeEvents.length;N++)_=e.MouseTracker.subscribeEvents[N],e.removeEvent(y.element,_,v[_],!1);c(y),v.tracking=!1}}function u(y,v){var _=i[y.hash];if(v==="pointerevent")return{upName:"pointerup",upHandler:_.pointerupcaptured,moveName:"pointermove",moveHandler:_.pointermovecaptured};if(v==="mouse")return{upName:"pointerup",upHandler:_.pointerupcaptured,moveName:"pointermove",moveHandler:_.pointermovecaptured};if(v==="touch")return{upName:"touchend",upHandler:_.touchendcaptured,moveName:"touchmove",moveHandler:_.touchmovecaptured};throw new Error("MouseTracker.getCaptureEventParams: Unknown pointer type.")}function d(y,v){var _;if(e.MouseTracker.havePointerCapture)if(e.MouseTracker.havePointerEvents)try{y.element.setPointerCapture(v.id)}catch{e.console.warn("setPointerCapture() called on invalid pointer ID");return}else y.element.setCapture(!0);else _=u(y,e.MouseTracker.havePointerEvents?"pointerevent":v.type),n&&a(window.top)&&e.addEvent(window.top,_.upName,_.upHandler,!0),e.addEvent(e.MouseTracker.captureElement,_.upName,_.upHandler,!0),e.addEvent(e.MouseTracker.captureElement,_.moveName,_.moveHandler,!0);L(y,v,!0)}function h(y,v){var _,N,F;if(e.MouseTracker.havePointerCapture)if(e.MouseTracker.havePointerEvents){if(N=y.getActivePointersListByType(v.type),F=N.getById(v.id),!F||!F.captured)return;try{y.element.releasePointerCapture(v.id)}catch{}}else y.element.releaseCapture();else _=u(y,e.MouseTracker.havePointerEvents?"pointerevent":v.type),n&&a(window.top)&&e.removeEvent(window.top,_.upName,_.upHandler,!0),e.removeEvent(e.MouseTracker.captureElement,_.moveName,_.moveHandler,!0),e.removeEvent(e.MouseTracker.captureElement,_.upName,_.upHandler,!0);L(y,v,!1)}function f(y){return e.MouseTracker.havePointerEvents?y.pointerId:e.MouseTracker.mousePointerId}function p(y){return e.MouseTracker.havePointerEvents?y.pointerType||(e.Browser.vendor===e.BROWSERS.IE?"mouse":""):"mouse"}function g(y){return e.MouseTracker.havePointerEvents?y.isPrimary:!0}function w(y){return e.getMousePosition(y)}function b(y,v){return x(w(y),v)}function x(y,v){var _=e.getElementOffset(v);return y.minus(_)}function j(y,v){return new e.Point((y.x+v.x)/2,(y.y+v.y)/2)}function S(y,v){var _={originalEvent:v,eventType:"click",pointerType:"mouse",isEmulated:!1};C(y,_),_.preventDefault&&!_.defaultPrevented&&e.cancelEvent(v),_.stopPropagation&&e.stopEvent(v)}function E(y,v){var _={originalEvent:v,eventType:"dblclick",pointerType:"mouse",isEmulated:!1};C(y,_),_.preventDefault&&!_.defaultPrevented&&e.cancelEvent(v),_.stopPropagation&&e.stopEvent(v)}function R(y,v){var _=null,N={originalEvent:v,eventType:"keydown",pointerType:"",isEmulated:!1};C(y,N),y.keyDownHandler&&!N.preventGesture&&!N.defaultPrevented&&(_={eventSource:y,keyCode:v.keyCode?v.keyCode:v.charCode,ctrl:v.ctrlKey,shift:v.shiftKey,alt:v.altKey,meta:v.metaKey,originalEvent:v,preventDefault:N.preventDefault||N.defaultPrevented,userData:y.userData},y.keyDownHandler(_)),(_&&_.preventDefault||N.preventDefault&&!N.defaultPrevented)&&e.cancelEvent(v),N.stopPropagation&&e.stopEvent(v)}function A(y,v){var _=null,N={originalEvent:v,eventType:"keyup",pointerType:"",isEmulated:!1};C(y,N),y.keyUpHandler&&!N.preventGesture&&!N.defaultPrevented&&(_={eventSource:y,keyCode:v.keyCode?v.keyCode:v.charCode,ctrl:v.ctrlKey,shift:v.shiftKey,alt:v.altKey,meta:v.metaKey,originalEvent:v,preventDefault:N.preventDefault||N.defaultPrevented,userData:y.userData},y.keyUpHandler(_)),(_&&_.preventDefault||N.preventDefault&&!N.defaultPrevented)&&e.cancelEvent(v),N.stopPropagation&&e.stopEvent(v)}function I(y,v){var _=null,N={originalEvent:v,eventType:"keypress",pointerType:"",isEmulated:!1};C(y,N),y.keyHandler&&!N.preventGesture&&!N.defaultPrevented&&(_={eventSource:y,keyCode:v.keyCode?v.keyCode:v.charCode,ctrl:v.ctrlKey,shift:v.shiftKey,alt:v.altKey,meta:v.metaKey,originalEvent:v,preventDefault:N.preventDefault||N.defaultPrevented,userData:y.userData},y.keyHandler(_)),(_&&_.preventDefault||N.preventDefault&&!N.defaultPrevented)&&e.cancelEvent(v),N.stopPropagation&&e.stopEvent(v)}function H(y,v){var _={originalEvent:v,eventType:"focus",pointerType:"",isEmulated:!1};C(y,_),y.focusHandler&&!_.preventGesture&&y.focusHandler({eventSource:y,originalEvent:v,userData:y.userData})}function W(y,v){var _={originalEvent:v,eventType:"blur",pointerType:"",isEmulated:!1};C(y,_),y.blurHandler&&!_.preventGesture&&y.blurHandler({eventSource:y,originalEvent:v,userData:y.userData})}function Z(y,v){var _=null,N={originalEvent:v,eventType:"contextmenu",pointerType:"mouse",isEmulated:!1};C(y,N),y.contextMenuHandler&&!N.preventGesture&&!N.defaultPrevented&&(_={eventSource:y,position:x(w(v),y.element),originalEvent:N.originalEvent,preventDefault:N.preventDefault||N.defaultPrevented,userData:y.userData},y.contextMenuHandler(_)),(_&&_.preventDefault||N.preventDefault&&!N.defaultPrevented)&&e.cancelEvent(v),N.stopPropagation&&e.stopEvent(v)}function $(y,v){ee(y,v,v)}function X(y,v){var _={target:v.target||v.srcElement,type:"wheel",shiftKey:v.shiftKey||!1,clientX:v.clientX,clientY:v.clientY,pageX:v.pageX?v.pageX:v.clientX,pageY:v.pageY?v.pageY:v.clientY,deltaMode:v.type==="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0};e.MouseTracker.wheelEventName==="mousewheel"?_.deltaY=-v.wheelDelta/e.DEFAULT_SETTINGS.pixelsPerWheelLine:_.deltaY=v.detail,ee(y,_,v)}function ee(y,v,_){var N=0,F,V=null;N=v.deltaY<0?1:-1,F={originalEvent:v,eventType:"wheel",pointerType:"mouse",isEmulated:v!==_},C(y,F),y.scrollHandler&&!F.preventGesture&&!F.defaultPrevented&&(V={eventSource:y,pointerType:"mouse",position:b(v,y.element),scroll:N,shift:v.shiftKey,isTouchEvent:!1,originalEvent:_,preventDefault:F.preventDefault||F.defaultPrevented,userData:y.userData},y.scrollHandler(V)),F.stopPropagation&&e.stopEvent(_),(V&&V.preventDefault||F.preventDefault&&!F.defaultPrevented)&&e.cancelEvent(_)}function P(y,v){var _={id:e.MouseTracker.mousePointerId,type:"mouse"},N={originalEvent:v,eventType:"lostpointercapture",pointerType:"mouse",isEmulated:!1};C(y,N),v.target===y.element&&L(y,_,!1),N.stopPropagation&&e.stopEvent(v)}function k(y,v){var _,N,F=v.changedTouches.length,V,re=y.getActivePointersListByType("touch");_=e.now(),re.getLength()>v.touches.length-F&&e.console.warn("Tracked touch contact count doesn't match event.touches.length");var pe={originalEvent:v,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(C(y,pe),N=0;N<F;N++)V={id:v.changedTouches[N].identifier,type:"touch",isPrimary:re.getLength()===0,currentPos:w(v.changedTouches[N]),currentTime:_},G(y,pe,V),me(y,pe,V,0),L(y,V,!0);pe.preventDefault&&!pe.defaultPrevented&&e.cancelEvent(v),pe.stopPropagation&&e.stopEvent(v)}function O(y,v){var _,N,F=v.changedTouches.length,V;_=e.now();var re={originalEvent:v,eventType:"pointerup",pointerType:"touch",isEmulated:!1};for(C(y,re),N=0;N<F;N++)V={id:v.changedTouches[N].identifier,type:"touch",currentPos:w(v.changedTouches[N]),currentTime:_},ve(y,re,V,0),L(y,V,!1),U(y,re,V);re.preventDefault&&!re.defaultPrevented&&e.cancelEvent(v),re.stopPropagation&&e.stopEvent(v)}function z(y,v){var _,N,F=v.changedTouches.length,V;_=e.now();var re={originalEvent:v,eventType:"pointermove",pointerType:"touch",isEmulated:!1};for(C(y,re),N=0;N<F;N++)V={id:v.changedTouches[N].identifier,type:"touch",currentPos:w(v.changedTouches[N]),currentTime:_},be(y,re,V);re.preventDefault&&!re.defaultPrevented&&e.cancelEvent(v),re.stopPropagation&&e.stopEvent(v)}function D(y,v){var _=v.changedTouches.length,N,F,V={originalEvent:v,eventType:"pointercancel",pointerType:"touch",isEmulated:!1};for(C(y,V),N=0;N<_;N++)F={id:v.changedTouches[N].identifier,type:"touch"},ae(y,V,F);V.stopPropagation&&e.stopEvent(v)}function M(y,v){return e.eventIsCanceled(v)||v.preventDefault(),!1}function B(y,v){return e.eventIsCanceled(v)||v.preventDefault(),!1}function K(y,v){var _={originalEvent:v,eventType:"gotpointercapture",pointerType:p(v),isEmulated:!1};C(y,_),v.target===y.element&&L(y,{id:v.pointerId,type:p(v)},!0),_.stopPropagation&&e.stopEvent(v)}function se(y,v){var _={originalEvent:v,eventType:"lostpointercapture",pointerType:p(v),isEmulated:!1};C(y,_),v.target===y.element&&L(y,{id:v.pointerId,type:p(v)},!1),_.stopPropagation&&e.stopEvent(v)}function J(y,v){var _={id:f(v),type:p(v),isPrimary:g(v),currentPos:w(v),currentTime:e.now()},N={originalEvent:v,eventType:"pointerenter",pointerType:_.type,isEmulated:!1};C(y,N),G(y,N,_)}function ce(y,v){var _={id:f(v),type:p(v),isPrimary:g(v),currentPos:w(v),currentTime:e.now()},N={originalEvent:v,eventType:"pointerleave",pointerType:_.type,isEmulated:!1};C(y,N),U(y,N,_)}function Fe(y,v){var _={id:f(v),type:p(v),isPrimary:g(v),currentPos:w(v),currentTime:e.now()},N={originalEvent:v,eventType:"pointerover",pointerType:_.type,isEmulated:!1};C(y,N),te(y,N,_),N.preventDefault&&!N.defaultPrevented&&e.cancelEvent(v),N.stopPropagation&&e.stopEvent(v)}function Pe(y,v){var _={id:f(v),type:p(v),isPrimary:g(v),currentPos:w(v),currentTime:e.now()},N={originalEvent:v,eventType:"pointerout",pointerType:_.type,isEmulated:!1};C(y,N),Q(y,N,_),N.preventDefault&&!N.defaultPrevented&&e.cancelEvent(v),N.stopPropagation&&e.stopEvent(v)}function Ne(y,v){var _={id:f(v),type:p(v),isPrimary:g(v),currentPos:w(v),currentTime:e.now()},N=e.MouseTracker.havePointerEvents&&_.type==="touch"&&e.Browser.vendor!==e.BROWSERS.IE,F={originalEvent:v,eventType:"pointerdown",pointerType:_.type,isEmulated:!1};C(y,F),me(y,F,_,v.button),F.preventDefault&&!F.defaultPrevented&&e.cancelEvent(v),F.stopPropagation&&e.stopEvent(v),F.shouldCapture&&(N?L(y,_,!0):d(y,_))}function lt(y,v){ei(y,v)}function $r(y,v){var _=y.getActivePointersListByType(p(v));_.getById(v.pointerId)&&ei(y,v),e.stopEvent(v)}function ei(y,v){var _;_={id:f(v),type:p(v),isPrimary:g(v),currentPos:w(v),currentTime:e.now()};var N={originalEvent:v,eventType:"pointerup",pointerType:_.type,isEmulated:!1};C(y,N),ve(y,N,_,v.button),N.preventDefault&&!N.defaultPrevented&&e.cancelEvent(v),N.stopPropagation&&e.stopEvent(v),N.shouldReleaseCapture&&(v.target===y.element?h(y,_):L(y,_,!1))}function kr(y,v){rs(y,v)}function Ki(y,v){var _=y.getActivePointersListByType(p(v));_.getById(v.pointerId)&&rs(y,v),e.stopEvent(v)}function rs(y,v){var _={id:f(v),type:p(v),isPrimary:g(v),currentPos:w(v),currentTime:e.now()},N={originalEvent:v,eventType:"pointermove",pointerType:_.type,isEmulated:!1};C(y,N),be(y,N,_),N.preventDefault&&!N.defaultPrevented&&e.cancelEvent(v),N.stopPropagation&&e.stopEvent(v)}function qa(y,v){var _={id:v.pointerId,type:p(v)},N={originalEvent:v,eventType:"pointercancel",pointerType:_.type,isEmulated:!1};C(y,N),ae(y,N,_),N.stopPropagation&&e.stopEvent(v)}function Xi(y,v){return v.speed=0,v.direction=0,v.contactPos=v.currentPos,v.contactTime=v.currentTime,v.lastPos=v.currentPos,v.lastTime=v.currentTime,y.add(v)}function ti(y,v,_){var N,F=v.getById(_.id);return F?(F.captured&&(e.console.warn("stopTrackingPointer() called on captured pointer"),h(y,F)),v.removeContact(),N=v.removeById(_.id)):N=v.getLength(),N}function m(y,v){switch(v.eventType){case"pointermove":v.isStoppable=!0,v.isCancelable=!0,v.preventDefault=!1,v.preventGesture=!y.hasGestureHandlers,v.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":v.isStoppable=!0,v.isCancelable=!0,v.preventDefault=!1,v.preventGesture=!1,v.stopPropagation=!1;break;case"pointerdown":v.isStoppable=!0,v.isCancelable=!0,v.preventDefault=!1,v.preventGesture=!y.hasGestureHandlers,v.stopPropagation=!1;break;case"pointerup":v.isStoppable=!0,v.isCancelable=!0,v.preventDefault=!1,v.preventGesture=!y.hasGestureHandlers,v.stopPropagation=!1;break;case"wheel":v.isStoppable=!0,v.isCancelable=!0,v.preventDefault=!1,v.preventGesture=!y.hasScrollHandler,v.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":v.isStoppable=!0,v.isCancelable=!1,v.preventDefault=!1,v.preventGesture=!1,v.stopPropagation=!1;break;case"click":v.isStoppable=!0,v.isCancelable=!0,v.preventDefault=!!y.clickHandler,v.preventGesture=!1,v.stopPropagation=!1;break;case"dblclick":v.isStoppable=!0,v.isCancelable=!0,v.preventDefault=!!y.dblClickHandler,v.preventGesture=!1,v.stopPropagation=!1;break;case"focus":case"blur":case"pointerenter":case"pointerleave":default:v.isStoppable=!1,v.isCancelable=!1,v.preventDefault=!1,v.preventGesture=!1,v.stopPropagation=!1;break}}function C(y,v){v.eventSource=y,v.eventPhase=v.originalEvent&&typeof v.originalEvent.eventPhase<"u"?v.originalEvent.eventPhase:0,v.defaultPrevented=e.eventIsCanceled(v.originalEvent),v.shouldCapture=!1,v.shouldReleaseCapture=!1,v.userData=y.userData,m(y,v),y.preProcessEventHandler&&y.preProcessEventHandler(v)}function L(y,v,_){var N=y.getActivePointersListByType(v.type),F=N.getById(v.id);F?_&&!F.captured?(F.captured=!0,N.captureCount++):!_&&F.captured&&(F.captured=!1,N.captureCount--,N.captureCount<0&&(N.captureCount=0,e.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):e.console.warn("updatePointerCaptured() called on untracked pointer")}function G(y,v,_){var N=y.getActivePointersListByType(_.type),F;F=N.getById(_.id),F?(F.insideElement=!0,F.lastPos=F.currentPos,F.lastTime=F.currentTime,F.currentPos=_.currentPos,F.currentTime=_.currentTime,_=F):(_.captured=!1,_.insideElementPressed=!1,_.insideElement=!0,Xi(N,_)),y.enterHandler&&y.enterHandler({eventSource:y,pointerType:_.type,position:x(_.currentPos,y.element),buttons:N.buttons,pointers:y.getActivePointerCount(),insideElementPressed:_.insideElementPressed,buttonDownAny:N.buttons!==0,isTouchEvent:_.type==="touch",originalEvent:v.originalEvent,userData:y.userData})}function U(y,v,_){var N=y.getActivePointersListByType(_.type),F,V;F=N.getById(_.id),F?(F.captured?(F.insideElement=!1,F.lastPos=F.currentPos,F.lastTime=F.currentTime,F.currentPos=_.currentPos,F.currentTime=_.currentTime):ti(y,N,F),_=F):(_.captured=!1,_.insideElementPressed=!1),(y.leaveHandler||y.exitHandler)&&(V={eventSource:y,pointerType:_.type,position:_.currentPos&&x(_.currentPos,y.element),buttons:N.buttons,pointers:y.getActivePointerCount(),insideElementPressed:_.insideElementPressed,buttonDownAny:N.buttons!==0,isTouchEvent:_.type==="touch",originalEvent:v.originalEvent,userData:y.userData},y.leaveHandler&&y.leaveHandler(V),y.exitHandler&&y.exitHandler(V))}function te(y,v,_){var N,F;N=y.getActivePointersListByType(_.type),F=N.getById(_.id),F?_=F:(_.captured=!1,_.insideElementPressed=!1),y.overHandler&&y.overHandler({eventSource:y,pointerType:_.type,position:x(_.currentPos,y.element),buttons:N.buttons,pointers:y.getActivePointerCount(),insideElementPressed:_.insideElementPressed,buttonDownAny:N.buttons!==0,isTouchEvent:_.type==="touch",originalEvent:v.originalEvent,userData:y.userData})}function Q(y,v,_){var N,F;N=y.getActivePointersListByType(_.type),F=N.getById(_.id),F?_=F:(_.captured=!1,_.insideElementPressed=!1),y.outHandler&&y.outHandler({eventSource:y,pointerType:_.type,position:_.currentPos&&x(_.currentPos,y.element),buttons:N.buttons,pointers:y.getActivePointerCount(),insideElementPressed:_.insideElementPressed,buttonDownAny:N.buttons!==0,isTouchEvent:_.type==="touch",originalEvent:v.originalEvent,userData:y.userData})}function me(y,v,_,N){var F=i[y.hash],V=y.getActivePointersListByType(_.type),re;if(typeof v.originalEvent.buttons<"u"?V.buttons=v.originalEvent.buttons:N===0?V.buttons|=1:N===1?V.buttons|=4:N===2?V.buttons|=2:N===3?V.buttons|=8:N===4?V.buttons|=16:N===5&&(V.buttons|=32),N!==0){v.shouldCapture=!1,v.shouldReleaseCapture=!1,y.nonPrimaryPressHandler&&!v.preventGesture&&!v.defaultPrevented&&(v.preventDefault=!0,y.nonPrimaryPressHandler({eventSource:y,pointerType:_.type,position:x(_.currentPos,y.element),button:N,buttons:V.buttons,isTouchEvent:_.type==="touch",originalEvent:v.originalEvent,userData:y.userData}));return}re=V.getById(_.id),re?(re.insideElementPressed=!0,re.insideElement=!0,re.originalTarget=v.originalEvent.target,re.contactPos=_.currentPos,re.contactTime=_.currentTime,re.lastPos=re.currentPos,re.lastTime=re.currentTime,re.currentPos=_.currentPos,re.currentTime=_.currentTime,_=re):(_.captured=!1,_.insideElementPressed=!0,_.insideElement=!0,_.originalTarget=v.originalEvent.target,Xi(V,_)),V.addContact(),!v.preventGesture&&!v.defaultPrevented?(v.shouldCapture=!0,v.shouldReleaseCapture=!1,v.preventDefault=!0,(y.dragHandler||y.dragEndHandler||y.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.addPoint(y,_),V.contacts===1?y.pressHandler&&!v.preventGesture&&y.pressHandler({eventSource:y,pointerType:_.type,position:x(_.contactPos,y.element),buttons:V.buttons,isTouchEvent:_.type==="touch",originalEvent:v.originalEvent,userData:y.userData}):V.contacts===2&&y.pinchHandler&&_.type==="touch"&&(F.pinchGPoints=V.asArray(),F.lastPinchDist=F.currentPinchDist=F.pinchGPoints[0].currentPos.distanceTo(F.pinchGPoints[1].currentPos),F.lastPinchCenter=F.currentPinchCenter=j(F.pinchGPoints[0].currentPos,F.pinchGPoints[1].currentPos))):(v.shouldCapture=!1,v.shouldReleaseCapture=!1)}function ve(y,v,_,N){var F=i[y.hash],V=y.getActivePointersListByType(_.type),re,pe,ie,ct=!1,Me;if(typeof v.originalEvent.buttons<"u"?V.buttons=v.originalEvent.buttons:N===0?V.buttons^=-2:N===1?V.buttons^=-5:N===2?V.buttons^=-3:N===3?V.buttons^=-9:N===4?V.buttons^=-17:N===5&&(V.buttons^=-33),v.shouldCapture=!1,N!==0){v.shouldReleaseCapture=!1,y.nonPrimaryReleaseHandler&&!v.preventGesture&&!v.defaultPrevented&&(v.preventDefault=!0,y.nonPrimaryReleaseHandler({eventSource:y,pointerType:_.type,position:x(_.currentPos,y.element),button:N,buttons:V.buttons,isTouchEvent:_.type==="touch",originalEvent:v.originalEvent,userData:y.userData}));return}ie=V.getById(_.id),ie?(V.removeContact(),ie.captured&&(ct=!0),ie.lastPos=ie.currentPos,ie.lastTime=ie.currentTime,ie.currentPos=_.currentPos,ie.currentTime=_.currentTime,ie.insideElement||ti(y,V,ie),re=ie.currentPos,pe=ie.currentTime):(_.captured=!1,_.insideElementPressed=!1,_.insideElement=!0,Xi(V,_),ie=_),!v.preventGesture&&!v.defaultPrevented&&(ct?(v.shouldReleaseCapture=!0,v.preventDefault=!0,(y.dragHandler||y.dragEndHandler||y.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.removePoint(y,ie),V.contacts===0?(y.releaseHandler&&re&&y.releaseHandler({eventSource:y,pointerType:ie.type,position:x(re,y.element),buttons:V.buttons,insideElementPressed:ie.insideElementPressed,insideElementReleased:ie.insideElement,isTouchEvent:ie.type==="touch",originalEvent:v.originalEvent,userData:y.userData}),y.dragEndHandler&&F.sentDragEvent&&y.dragEndHandler({eventSource:y,pointerType:ie.type,position:x(ie.currentPos,y.element),speed:ie.speed,direction:ie.direction,shift:v.originalEvent.shiftKey,isTouchEvent:ie.type==="touch",originalEvent:v.originalEvent,userData:y.userData}),F.sentDragEvent=!1,(y.clickHandler||y.dblClickHandler)&&ie.insideElement&&(Me=pe-ie.contactTime<=y.clickTimeThreshold&&ie.contactPos.distanceTo(re)<=y.clickDistThreshold,y.clickHandler&&y.clickHandler({eventSource:y,pointerType:ie.type,position:x(ie.currentPos,y.element),quick:Me,shift:v.originalEvent.shiftKey,isTouchEvent:ie.type==="touch",originalEvent:v.originalEvent,originalTarget:ie.originalTarget,userData:y.userData}),y.dblClickHandler&&Me&&(V.clicks++,V.clicks===1?(F.lastClickPos=re,F.dblClickTimeOut=setTimeout(function(){V.clicks=0},y.dblClickTimeThreshold)):V.clicks===2&&(clearTimeout(F.dblClickTimeOut),V.clicks=0,F.lastClickPos.distanceTo(re)<=y.dblClickDistThreshold&&y.dblClickHandler({eventSource:y,pointerType:ie.type,position:x(ie.currentPos,y.element),shift:v.originalEvent.shiftKey,isTouchEvent:ie.type==="touch",originalEvent:v.originalEvent,userData:y.userData}),F.lastClickPos=null)))):V.contacts===2&&y.pinchHandler&&ie.type==="touch"&&(F.pinchGPoints=V.asArray(),F.lastPinchDist=F.currentPinchDist=F.pinchGPoints[0].currentPos.distanceTo(F.pinchGPoints[1].currentPos),F.lastPinchCenter=F.currentPinchCenter=j(F.pinchGPoints[0].currentPos,F.pinchGPoints[1].currentPos))):(v.shouldReleaseCapture=!1,y.releaseHandler&&re&&(y.releaseHandler({eventSource:y,pointerType:ie.type,position:x(re,y.element),buttons:V.buttons,insideElementPressed:ie.insideElementPressed,insideElementReleased:ie.insideElement,isTouchEvent:ie.type==="touch",originalEvent:v.originalEvent,userData:y.userData}),v.preventDefault=!0)))}function be(y,v,_){var N=i[y.hash],F=y.getActivePointersListByType(_.type),V,re,pe;if(typeof v.originalEvent.buttons<"u"&&(F.buttons=v.originalEvent.buttons),V=F.getById(_.id),V)V.lastPos=V.currentPos,V.lastTime=V.currentTime,V.currentPos=_.currentPos,V.currentTime=_.currentTime;else return;v.shouldCapture=!1,v.shouldReleaseCapture=!1,y.stopHandler&&_.type==="mouse"&&(clearTimeout(y.stopTimeOut),y.stopTimeOut=setTimeout(function(){Ae(y,v.originalEvent,_.type)},y.stopDelay)),F.contacts===0?y.moveHandler&&y.moveHandler({eventSource:y,pointerType:_.type,position:x(_.currentPos,y.element),buttons:F.buttons,isTouchEvent:_.type==="touch",originalEvent:v.originalEvent,userData:y.userData}):F.contacts===1?(y.moveHandler&&(V=F.asArray()[0],y.moveHandler({eventSource:y,pointerType:V.type,position:x(V.currentPos,y.element),buttons:F.buttons,isTouchEvent:V.type==="touch",originalEvent:v.originalEvent,userData:y.userData})),y.dragHandler&&!v.preventGesture&&!v.defaultPrevented&&(V=F.asArray()[0],pe=V.currentPos.minus(V.lastPos),y.dragHandler({eventSource:y,pointerType:V.type,position:x(V.currentPos,y.element),buttons:F.buttons,delta:pe,speed:V.speed,direction:V.direction,shift:v.originalEvent.shiftKey,isTouchEvent:V.type==="touch",originalEvent:v.originalEvent,userData:y.userData}),v.preventDefault=!0,N.sentDragEvent=!0)):F.contacts===2&&(y.moveHandler&&(re=F.asArray(),y.moveHandler({eventSource:y,pointerType:re[0].type,position:x(j(re[0].currentPos,re[1].currentPos),y.element),buttons:F.buttons,isTouchEvent:re[0].type==="touch",originalEvent:v.originalEvent,userData:y.userData})),y.pinchHandler&&_.type==="touch"&&!v.preventGesture&&!v.defaultPrevented&&(pe=N.pinchGPoints[0].currentPos.distanceTo(N.pinchGPoints[1].currentPos),pe!==N.currentPinchDist&&(N.lastPinchDist=N.currentPinchDist,N.currentPinchDist=pe,N.lastPinchCenter=N.currentPinchCenter,N.currentPinchCenter=j(N.pinchGPoints[0].currentPos,N.pinchGPoints[1].currentPos),y.pinchHandler({eventSource:y,pointerType:"touch",gesturePoints:N.pinchGPoints,lastCenter:x(N.lastPinchCenter,y.element),center:x(N.currentPinchCenter,y.element),lastDistance:N.lastPinchDist,distance:N.currentPinchDist,shift:v.originalEvent.shiftKey,originalEvent:v.originalEvent,userData:y.userData}),v.preventDefault=!0)))}function ae(y,v,_){var N=y.getActivePointersListByType(_.type),F;F=N.getById(_.id),F&&ti(y,N,F)}function Ae(y,v,_){y.stopHandler&&y.stopHandler({eventSource:y,pointerType:_,position:b(v,y.element),buttons:y.getActivePointersListByType(_).buttons,isTouchEvent:_==="touch",originalEvent:v,userData:y.userData})}}(r),function(e){e.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},e.Control=function(i,n,a){var c=i.parentNode;typeof n=="number"&&(e.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead.  Support for this deprecated variant is scheduled for removal in December 2013"),n={anchor:n}),n.attachToViewer=typeof n.attachToViewer>"u"?!0:n.attachToViewer,this.autoFade=typeof n.autoFade>"u"?!0:n.autoFade,this.element=i,this.anchor=n.anchor,this.container=a,this.anchor===e.ControlAnchor.ABSOLUTE?(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof n.top=="number"?n.top+"px":n.top,this.wrapper.style.left=typeof n.left=="number"?n.left+"px":n.left,this.wrapper.style.height=typeof n.height=="number"?n.height+"px":n.height,this.wrapper.style.width=typeof n.width=="number"?n.width+"px":n.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===e.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),n.attachToViewer?this.anchor===e.ControlAnchor.TOP_RIGHT||this.anchor===e.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):c.appendChild(this.wrapper)},e.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==e.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(i){this.wrapper.style.display=i?this.anchor===e.ControlAnchor.ABSOLUTE?"block":"inl
351ine-block":"none"},setOpacity:function(i){this.element[e.SIGNAL]&&e.Browser.vendor===e.BROWSERS.IE?e.setElementOpacity(this.element,i,!0):e.setElementOpacity(this.wrapper,i,!0)}}}(r),function(e){e.ControlDock=function(n){var a=["topleft","topright","bottomright","bottomleft"],c,o;for(e.extend(!0,this,{id:"controldock-"+e.now()+"-"+Math.floor(Math.random()*1e6),container:e.makeNeutralElement("div"),controls:[]},n),this.container.onsubmit=function(){return!1},this.element&&(this.element=e.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),o=0;o<a.length;o++)c=a[o],this.controls[c]=e.makeNeutralElement("div"),this.controls[c].style.position="absolute",c.match("left")&&(this.controls[c].style.left="0px"),c.match("right")&&(this.controls[c].style.right="0px"),c.match("top")&&(this.controls[c].style.top="0px"),c.match("bottom")&&(this.controls[c].style.bottom="0px");this.container.appendChild(this.controls.topleft),this.container.appendChild(this.controls.topright),this.container.appendChild(this.controls.bottomright),this.container.appendChild(this.controls.bottomleft)},e.ControlDock.prototype={addControl:function(n,a){n=e.getElement(n);var c=null;if(!(i(this,n)>=0)){switch(a.anchor){case e.ControlAnchor.TOP_RIGHT:c=this.controls.topright,n.style.position="relative",n.style.paddingRight="0px",n.style.paddingTop="0px";break;case e.ControlAnchor.BOTTOM_RIGHT:c=this.controls.bottomright,n.style.position="relative",n.style.paddingRight="0px",n.style.paddingBottom="0px";break;case e.ControlAnchor.BOTTOM_LEFT:c=this.controls.bottomleft,n.style.position="relative",n.style.paddingLeft="0px",n.style.paddingBottom="0px";break;case e.ControlAnchor.TOP_LEFT:c=this.controls.topleft,n.style.position="relative",n.style.paddingLeft="0px",n.style.paddingTop="0px";break;case e.ControlAnchor.ABSOLUTE:c=this.container,n.style.margin="0px",n.style.padding="0px";break;default:case e.ControlAnchor.NONE:c=this.container,n.style.margin="0px",n.style.padding="0px";break}this.controls.push(new e.Control(n,a,c)),n.style.display="inline-block"}},removeControl:function(n){n=e.getElement(n);var a=i(this,n);return a>=0&&(this.controls[a].destroy(),this.controls.splice(a,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var n;for(n=this.controls.length-1;n>=0;n--)if(this.controls[n].isVisible())return!0;return!1},setControlsEnabled:function(n){var a;for(a=this.controls.length-1;a>=0;a--)this.controls[a].setVisible(n);return this}};function i(n,a){var c=n.controls,o;for(o=c.length-1;o>=0;o--)if(c[o].element===a)return o;return-1}}(r),function(e){e.Placement=e.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(r),function(e){var i={},n=1;e.Viewer=function(m){var C=arguments,L=this,G;if(e.isPlainObject(m)||(m={id:C[0],xmlPath:C.length>1?C[1]:void 0,prefixUrl:C.length>2?C[2]:void 0,controls:C.length>3?C[3]:void 0,overlays:C.length>4?C[4]:void 0}),m.config&&(e.extend(!0,m,m.config),delete m.config),e.extend(!0,this,{id:m.id,hash:m.hash||n++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttonGroup:null,profiler:null},e.DEFAULT_SETTINGS,m),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof i[this.hash]<"u"&&e.console.warn("Hash "+this.hash+" has already been used."),i[this.hash]={fsBoundsDelta:new e.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,needsResize:!1,forceResize:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null,lastClickTime:null,draggingToZoom:!1},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=e.now(),e.EventSource.call(this),this.addHandler("open-failed",function(U){var te=e.getString("Errors.OpenFailed",U.eventSource,U.message);L._showMessage(te)}),e.ControlDock.call(this,m),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=e.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(U){U.width="100%",U.height="100%",U.overflow="hidden",U.position="absolute",U.top="0px",U.left="0px"}(this.canvas.style),e.setElementTouchActionNone(this.canvas),m.tabIndex!==""&&(this.canvas.tabIndex=m.tabIndex===void 0?0:m.tabIndex),this.container.className="openseadragon-container",function(U){U.width="100%",U.height="100%",U.position="relative",U.overflow="hidden",U.left="0px",U.top="0px",U.textAlign="left"}(this.container.style),e.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new e.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:e.delegate(this,b),keyDownHandler:e.delegate(this,x),keyHandler:e.delegate(this,j),clickHandler:e.delegate(this,S),dblClickHandler:e.delegate(this,E),dragHandler:e.delegate(this,R),dragEndHandler:e.delegate(this,A),enterHandler:e.delegate(this,I),leaveHandler:e.delegate(this,H),pressHandler:e.delegate(this,W),releaseHandler:e.delegate(this,Z),nonPrimaryPressHandler:e.delegate(this,$),nonPrimaryReleaseHandler:e.delegate(this,X),scrollHandler:e.delegate(this,O),pinchHandler:e.delegate(this,ee),focusHandler:e.delegate(this,P),blurHandler:e.delegate(this,k)}),this.outerTracker=new e.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:e.delegate(this,z),leaveHandler:e.delegate(this,D)}
vendor: 16,697 bytes, line 351
351),this.toolbar&&(this.toolbar=new e.ControlDock({element:this.toolbar})),this.bindStandardControls(),i[this.hash].prevContainerSize=a(this.container),window.ResizeObserver?(this._autoResizePolling=!1,this._resizeObserver=new ResizeObserver(function(){i[L.hash].needsResize=!0}),this._resizeObserver.observe(this.container,{})):this._autoResizePolling=!0,this.world=new e.World({viewer:this}),this.world.addHandler("add-item",function(U){L.source=L.world.getItemAt(0).source,i[L.hash].forceRedraw=!0,L._updateRequestId||(L._updateRequestId=u(L,M))}),this.world.addHandler("remove-item",function(U){L.world.getItemCount()?L.source=L.world.getItemAt(0).source:L.source=null,i[L.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(U){L.viewport&&L.viewport._setContentBounds(L.world.getHomeBounds(),L.world.getContentFactor())}),this.world.addHandler("item-index-change",function(U){L.source=L.world.getItemAt(0).source}),this.viewport=new e.Viewport({containerSize:i[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins,silenceMultiImageWarnings:this.silenceMultiImageWarnings}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new e.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:m.timeout,tileRetryMax:this.tileRetryMax,tileRetryDelay:this.tileRetryDelay}),this.tileCache=new e.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new e.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=e.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(G=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(G,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(G=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(G,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new e.Navigator({element:this.navigatorElement,id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy,animationTime:this.animationTime})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),G=0;G<this.customControls.length;G++)this.addControl(this.customControls[G].id,{anchor:this.customControls[G].anchor});e.requestAnimationFrame(function(){h(L)}),this.imageSmoothingEnabled!==void 0&&!this.imageSmoothingEnabled&&this.drawer.setImageSmoothingEnabled(this.imageSmoothingEnabled),e._viewers.set(this.element,this)},e.extend(e.Viewer.prototype,e.EventSource.prototype,e.ControlDock.prototype,{isOpen:function(){return!!this.world.getItemCount()},openDzi:function(m){return e.console.error("[Viewer.openDzi] this function is deprecated; use Viewer.open() instead."),this.open(m)},openTileSource:function(m){return e.console.error("[Viewer.openTileSource] this function is deprecated; use Viewer.open() instead."),this.open(m)},get buttons(){return e.console.warn("Viewer.buttons is deprecated; Please use Viewer.buttonGroup"),this.buttonGroup},open:function(m,C){var L=this;if(this.close(),!m)return this;if(this.sequenceMode&&e.isArray(m))return this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null),typeof C<"u"&&!isNaN(C)&&(this.initialPage=C),this.tileSources=m,this._sequenceIndex=Math.max(0,Math.min(this.tileSources.length-1,this.initialPage)),this.tileSources.length&&(this.open(this.tileSources[this._sequenceIndex]),this.showReferenceStrip&&this.addReferenceStrip()),this._updateSequenceButtons(this._sequenceIndex),this;if(e.isArray(m)||(m=[m]),!m.length)return this;this._opening=!0;for(var G=m.length,U=0,te=0,Q,me=function(){if(U+te===G)if(U){(L._firstOpen||!L.preserveViewport)&&(L.viewport.goHome(!0),L.viewport.update()),L._firstOpen=!1;var ae=m[0];if(ae.tileSource&&(ae=ae.tileSource),L.overlays&&!L.preserveOverlays)for(var Ae=0;Ae<L.overlays.length;Ae++)L.currentOverlays[Ae]=o(L,L.overlays[Ae]);L._drawOverlays(),L._opening=!1,L.raiseEvent("open",{source:ae})}else L._opening=!1,L.raiseEvent("open-failed",Q)},ve=function(ae){(!e.isPlainObject(ae)||!ae.tileSource)&&(ae={tileSource:ae}),ae.index!==void 0&&(e.console.error("[Viewer.open] setting indexes here is not supported; use addTiledImage instead"),delete ae.index),ae.collectionImmediately===void 0&&(ae.collectionImmediately=!0);var Ae=ae.success;ae.success=function(v){if(U++,ae.tileSource.overlays)for(var _=0;_<ae.tileSource.overlays.length;_++)L.addOverlay(ae.tileSource.overlays[_]);Ae&&Ae(v),me()};var y=ae.error;ae.error=function(v){te++,Q||(Q=v),y&&y(v),me()},L.addTiledImage(ae)},be=0;be<m.length;be++)ve(m[be]);return this},close:function(){return i[this.hash]?(this._opening=!1,this.navigator&&this.navigator.close(),this.preserveOverlays||(this.clearOverlays(),this.overlaysContainer.innerHTML=""),i[this.hash].animating=!1,this.world.removeAll(),this.imageLoader.clear(),this.raiseEvent("close"),this):this},destroy:function(){if(i[this.hash]){if(this.raiseEvent("before-destroy"),this._removeUpdatePixelDensityRatioEvent(),this.close(),this.clearOverlays(),this.overlaysContainer.innerHTML="",this._resizeObserver&&this._resizeObserver.disconnect(),this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null),this._updateRequestId!==null&&(e.cancelAnimationFrame(this._updateRequestId),this._updateRequestId=null),this.drawer&&this.drawer.destroy(),this.navigator&&(this.navigator.destroy(),i[this.navigator.hash]=null,delete i[this.navigator.hash],this.navigator=null),this.buttonGroup)this.buttonGroup.destroy();else if(this.customButtons)for(;this.customButtons.length;)this.customButtons.pop().destroy();if(this.paging&&this.paging.destroy(),this.element)for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.container.onsubmit=null,this.clearControls(),this.innerTracker&&this.innerTracker.destroy(),this.outerTracker&&this.outerTracker.destroy(),i[this.hash]=null,delete i[this.hash],this.canvas=null,this.container=null,e._viewers.delete(this.element),this.element=null,this.raiseEvent("destroy"),this.removeAllHandlers()}},isMouseNavEnabled:function(){return this.innerTracker.isTracking()},setMouseNavEnabled:function(m){return this.innerTracker.setTracking(m),this.outerTracker.setTracking(m),this.raiseEvent("mouse-enabled",{enabled:m}),this},areControlsEnabled:function(){var m=this.controls.length,C;for(C=0;C<this.controls.length;C++)m=m&&this.controls[C].isVisible();return m},setControlsEnabled:function(m){return m?p(this):h(this),this.raiseEvent("controls-enabled",{enabled:m}),this},setDebugMode:function(m){for(var C=0;C<this.world.getItemCount();C++)this.world.getItemAt(C).debugMode=m;this.debugMode=m,this.forceRedraw()},setAjaxHeaders:function(m,C){if(m===null&&(m={}),!e.isPlainObject(m)){console.error("[Viewer.setAjaxHeaders] Ignoring invalid headers, must be a plain object");return}if(C===void 0&&(C=!0),this.ajaxHeaders=m,C){for(var L=0;L<this.world.getItemCount();L++)this.world.getItemAt(L)._updateAjaxHeaders(!0);if(this.navigator&&this.navigator.setAjaxHeaders(this.ajaxHeaders,!0),this.referenceStrip&&this.referenceStrip.miniViewers)for(var G in this.referenceStrip.miniViewers)this.referenceStrip.miniViewers[G].setAjaxHeaders(this.ajaxHeaders,!0)}},addButton:function(m){this.buttonGroup.addButton(m)},isFullPage:function(){return i[this.hash].fullPage},setFullPage:function(m){var C=document.body,L=C.style,G=document.documentElement.style,U=this,te,Q;if(m===this.isFullPage())return this;var me={fullPage:m,preventDefaultAction:!1};if(this.raiseEvent("pre-full-page",me),me.preventDefaultAction)return this;if(m){for(this.elementSize=e.getElementSize(this.element),this.pageScroll=e.getPageScroll(),this.elementMargin=this.element.style.margin,this.element.style.margin="0",this.elementPadding=this.element.style.padding,this.element.style.padding="0",this.bodyMargin=L.margin,this.docMargin=G.margin,L.margin="0",G.margin="0",this.bodyPadding=L.padding,this.docPadding=G.padding,L.padding="0",G.padding="0",this.bodyWidth=L.width,this.docWidth=G.width,L.width="100%",G.width="100%",this.bodyHeight=L.height,this.docHeight=G.height,L.height="100%",G.height="100%",this.bodyDisplay=L.display,L.display="block",this.previousBody=[],i[this.hash].prevElementParent=this.element.parentNode,i[this.hash].prevNextSibling=this.element.nextSibling,i[this.hash].prevElementWidth=this.element.style.width,i[this.hash].prevElementHeight=this.element.style.height,te=C.childNodes.length,Q=0;Q<te;Q++)this.previousBody.push(C.childNodes[0]),C.removeChild(C.childNodes[0]);this.toolbar&&this.toolbar.element&&(this.toolbar.parentNode=this.toolbar.element.parentNode,this.toolbar.nextSibling=this.toolbar.element.nextSibling,C.appendChild(this.toolbar.element),e.addClass(this.toolbar.element,"fullpage")),e.addClass(this.element,"fullpage"),C.appendChild(this.element),this.element.style.height="100vh",this.element.style.width="100vw",this.toolbar&&this.toolbar.element&&(this.element.style.height=e.getElementSize(this.element).y-e.getElementSize(this.toolbar.element).y+"px"),i[this.hash].fullPage=!0,e.delegate(this,z)({})}else{for(this.element.style.margin=this.elementMargin,this.element.style.padding=this.elementPadding,L.margin=this.bodyMargin,G.margin=this.docMargin,L.padding=this.bodyPadding,G.padding=this.docPadding,L.width=this.bodyWidth,G.width=this.docWidth,L.height=this.bodyHeight,G.height=this.docHeight,L.display=this.bodyDisplay,C.removeChild(this.element),te=this.previousBody.length,Q=0;Q<te;Q++)C.appendChild(this.previousBody.shift());e.removeClass(this.element,"fullpage"),i[this.hash].prevElementParent.insertBefore(this.element,i[this.hash].prevNextSibling),this.toolbar&&this.toolbar.element&&(C.removeChild(this.toolbar.element),e.removeClass(this.toolbar.element,"fullpage"),this.toolbar.parentNode.insertBefore(this.toolbar.element,this.toolbar.nextSibling),delete this.toolbar.parentNode,delete this.toolbar.nextSibling),this.element.style.width=i[this.hash].prevElementWidth,this.element.style.height=i[this.hash].prevElementHeight;var ve=0,be=function(){e.setPageScroll(U.pageScroll);var ae=e.getPageScroll();ve++,ve<10&&(ae.x!==U.pageScroll.x||ae.y!==U.pageScroll.y)&&e.requestAnimationFrame(be)};e.requestAnimationFrame(be),i[this.hash].fullPage=!1,e.delegate(this,D)({})}return this.navigator&&this.viewport&&this.navigator.update(this.viewport),this.raiseEvent("full-page",{fullPage:m}),this},setFullScreen:function(m){var C=this;if(!e.supportsFullScreen)return this.setFullPage(m);if(e.isFullScreen()===m)return this;var L={fullScreen:m,preventDefaultAction:!1};if(this.raiseEvent("pre-full-screen",L),L.preventDefaultAction)return this;if(m){if(this.setFullPage(!0),!this.isFullPage())return this;this.fullPageStyleWidth=this.element.style.width,this.fullPageStyleHeight=this.element.style.height,this.element.style.width="100%",this.element.style.height="100%";var G=function(){var U=e.isFullScreen();U||(e.removeEvent(document,e.fullScreenEventName,G),e.removeEvent(document,e.fullScreenErrorEventName,G),C.setFullPage(!1),C.isFullPage()&&(C.element.style.width=C.fullPageStyleWidth,C.element.style.height=C.fullPageStyleHeight)),C.navigator&&C.viewport&&setTimeout(function(){C.navigator.update(C.viewport)}),C.raiseEvent("full-screen",{fullScreen:U})};e.addEvent(document,e.fullScreenEventName,G),e.addEvent(document,e.fullScreenErrorEventName,G),e.requestFullScreen(document.body)}else e.exitFullScreen();return this},isVisible:function(){return this.container.style.visibility!=="hidden"},isFullScreen:function(){return e.isFullScreen()&&this.isFullPage()},setVisible:function(m){return this.container.style.visibility=m?"":"hidden",this.raiseEvent("visible",{visible:m}),this},addTiledImage:function(m){e.console.assert(m,"[Viewer.addTiledImage] options is required"),e.console.assert(m.tileSource,"[Viewer.addTiledImage] options.tileSource is required"),e.console.assert(!m.replace||m.index>-1&&m.index<this.world.getItemCount(),"[Viewer.addTiledImage] if options.replace is used, options.index must be a valid index in Viewer.world");var C=this;m.replace&&(m.replaceItem=C.world.getItemAt(m.index)),this._hideMessage(),m.placeholderFillStyle===void 0&&(m.placeholderFillStyle=this.placeholderFillStyle),m.opacity===void 0&&(m.opacity=this.opacity),m.preload===void 0&&(m.preload=this.preload),m.compositeOperation===void 0&&(m.compositeOperation=this.compositeOperation),m.crossOriginPolicy===void 0&&(m.crossOriginPolicy=m.tileSource.crossOriginPolicy!==void 0?m.tileSource.crossOriginPolicy:this.crossOriginPolicy),m.ajaxWithCredentials===void 0&&(m.ajaxWithCredentials=this.ajaxWithCredentials),m.loadTilesWithAjax===void 0&&(m.loadTilesWithAjax=this.loadTilesWithAjax),e.isPlainObject(m.ajaxHeaders)||(m.ajaxHeaders={});var L={options:m};function G(Q){for(var me=0;me<C._loadQueue.length;me++)if(C._loadQueue[me]===L){C._loadQueue.splice(me,1);break}C._loadQueue.length===0&&U(L),C.raiseEvent("add-item-failed",Q),m.error&&m.error(Q)}function U(Q){C.collectionMode&&(C.world.arrange({immediately:Q.options.collectionImmediately,rows:C.collectionRows,columns:C.collectionColumns,layout:C.collectionLayout,tileSize:C.collectionTileSize,tileMargin:C.collectionTileMargin}),C.world.setAutoRefigureSizes(!0))}if(e.isArray(m.tileSource)){setTimeout(function(){G({message:"[Viewer.addTiledImage] Sequences can not be added; add them one at a time instead.",source:m.tileSource,options:m})});return}this._loadQueue.push(L);function te(){for(var Q,me,ve;C._loadQueue.length&&(Q=C._loadQueue[0],!!Q.tileSource);){if(C._loadQueue.splice(0,1),Q.options.replace){var be=C.world.getIndexOfItem(Q.options.replaceItem);be!==-1&&(Q.options.index=be),C.world.removeItem(Q.options.replaceItem)}me=new e.TiledImage({viewer:C,source:Q.tileSource,viewport:C.viewport,drawer:C.drawer,tileCache:C.tileCache,imageLoader:C.imageLoader,x:Q.options.x,y:Q.options.y,width:Q.options.width,height:Q.options.height,fitBounds:Q.options.fitBounds,fitBoundsPlacement:Q.options.fitBoundsPlacement,clip:Q.options.clip,placeholderFillStyle:Q.options.placeholderFillStyle,opacity:Q.options.opacity,preload:Q.options.preload,degrees:Q.options.degrees,flipped:Q.options.flipped,compositeOperation:Q.options.compositeOperation,springStiffness:C.springStiffness,animationTime:C.animationTime,minZoomImageRatio:C.minZoomImageRatio,wrapHorizontal:C.wrapHorizontal,wrapVertical:C.wrapVertical,immediateRender:C.immediateRender,blendTime:C.blendTime,alwaysBlend:C.alwaysBlend,minPixelRatio:C.minPixelRatio,smoothTileEdgesMinZoom:C.smoothTileEdgesMinZoom,iOSDevice:C.iOSDevice,crossOriginPolicy:Q.options.crossOriginPolicy,ajaxWithCredentials:Q.options.ajaxWithCredentials,loadTilesWithAjax:Q.options.loadTilesWithAjax,ajaxHeaders:Q.options.ajaxHeaders,debugMode:C.debugMode,subPixelRoundingForTransparency:C.subPixelRoundingForTransparency}),C.collectionMode&&C.world.setAutoRefigureSizes(!1),C.navigator&&(ve=e.extend({},Q.options,{replace:!1,originalTiledImage:me,tileSource:Q.tileSource}),C.navigator.addTiledImage(ve)),C.world.addItem(me,{index:Q.options.index}),C._loadQueue.length===0&&U(Q),C.world.getItemCount()===1&&!C.preserveViewport&&C.viewport.goHome(!0),Q.options.success&&Q.options.success({item:me})}}c(this,m.tileSource,m,function(Q){L.tileSource=Q,te()},function(Q){Q.options=m,G(Q),te()})},addSimpleImage:function(m){e.console.assert(m,"[Viewer.addSimpleImage] options is required"),e.console.assert(m.url,"[Viewer.addSimpleImage] options.url is required");var C=e.extend({},m,{tileSource:{type:"image",url:m.url}});delete C.url,this.addTiledImage(C)}
vendor: 4,846 bytes, line 351
351,addLayer:function(m){var C=this;e.console.error("[Viewer.addLayer] this function is deprecated; use Viewer.addTiledImage() instead.");var L=e.extend({},m,{success:function(G){C.raiseEvent("add-layer",{options:m,drawer:G.item})},error:function(G){C.raiseEvent("add-layer-failed",G)}});return this.addTiledImage(L),this},getLayerAtLevel:function(m){return e.console.error("[Viewer.getLayerAtLevel] this function is deprecated; use World.getItemAt() instead."),this.world.getItemAt(m)},getLevelOfLayer:function(m){return e.console.error("[Viewer.getLevelOfLayer] this function is deprecated; use World.getIndexOfItem() instead."),this.world.getIndexOfItem(m)},getLayersCount:function(){return e.console.error("[Viewer.getLayersCount] this function is deprecated; use World.getItemCount() instead."),this.world.getItemCount()},setLayerLevel:function(m,C){return e.console.error("[Viewer.setLayerLevel] this function is deprecated; use World.setItemIndex() instead."),this.world.setItemIndex(m,C)},removeLayer:function(m){return e.console.error("[Viewer.removeLayer] this function is deprecated; use World.removeItem() instead."),this.world.removeItem(m)},forceRedraw:function(){return i[this.hash].forceRedraw=!0,this},forceResize:function(){i[this.hash].needsResize=!0,i[this.hash].forceResize=!0},bindSequenceControls:function(){var m=e.delegate(this,g),C=e.delegate(this,w),L=e.delegate(this,this.goToNextPage),G=e.delegate(this,this.goToPreviousPage),U=this.navImages,te=!0;return this.showSequenceControl&&((this.previousButton||this.nextButton)&&(te=!1),this.previousButton=new e.Button({element:this.previousButton?e.getElement(this.previousButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.PreviousPage"),srcRest:J(this.prefixUrl,U.previous.REST),srcGroup:J(this.prefixUrl,U.previous.GROUP),srcHover:J(this.prefixUrl,U.previous.HOVER),srcDown:J(this.prefixUrl,U.previous.DOWN),onRelease:G,onFocus:m,onBlur:C}),this.nextButton=new e.Button({element:this.nextButton?e.getElement(this.nextButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.NextPage"),srcRest:J(this.prefixUrl,U.next.REST),srcGroup:J(this.prefixUrl,U.next.GROUP),srcHover:J(this.prefixUrl,U.next.HOVER),srcDown:J(this.prefixUrl,U.next.DOWN),onRelease:L,onFocus:m,onBlur:C}),this.navPrevNextWrap||this.previousButton.disable(),(!this.tileSources||!this.tileSources.length)&&this.nextButton.disable(),te&&(this.paging=new e.ButtonGroup({buttons:[this.previousButton,this.nextButton],clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.pagingControl=this.paging.element,this.toolbar?this.toolbar.addControl(this.pagingControl,{anchor:e.ControlAnchor.BOTTOM_RIGHT}):this.addControl(this.pagingControl,{anchor:this.sequenceControlAnchor||e.ControlAnchor.TOP_LEFT}))),this},bindStandardControls:function(){var m=e.delegate(this,ce),C=e.delegate(this,Pe),L=e.delegate(this,$r),G=e.delegate(this,Fe),U=e.delegate(this,ei),te=e.delegate(this,Ki),Q=e.delegate(this,rs),me=e.delegate(this,qa),ve=e.delegate(this,Xi),be=e.delegate(this,ti),ae=e.delegate(this,g),Ae=e.delegate(this,w),y=this.navImages,v=[],_=!0;return this.showNavigationControl&&((this.zoomInButton||this.zoomOutButton||this.homeButton||this.fullPageButton||this.rotateLeftButton||this.rotateRightButton||this.flipButton)&&(_=!1),this.showZoomControl&&(v.push(this.zoomInButton=new e.Button({element:this.zoomInButton?e.getElement(this.zoomInButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.ZoomIn"),srcRest:J(this.prefixUrl,y.zoomIn.REST),srcGroup:J(this.prefixUrl,y.zoomIn.GROUP),srcHover:J(this.prefixUrl,y.zoomIn.HOVER),srcDown:J(this.prefixUrl,y.zoomIn.DOWN),onPress:m,onRelease:C,onClick:L,onEnter:m,onExit:C,onFocus:ae,onBlur:Ae})),v.push(this.zoomOutButton=new e.Button({element:this.zoomOutButton?e.getElement(this.zoomOutButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.ZoomOut"),srcRest:J(this.prefixUrl,y.zoomOut.REST),srcGroup:J(this.prefixUrl,y.zoomOut.GROUP),srcHover:J(this.prefixUrl,y.zoomOut.HOVER),srcDown:J(this.prefixUrl,y.zoomOut.DOWN),onPress:G,onRelease:C,onClick:U,onEnter:G,onExit:C,onFocus:ae,onBlur:Ae}))),this.showHomeControl&&v.push(this.homeButton=new e.Button({element:this.homeButton?e.getElement(this.homeButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.Home"),srcRest:J(this.prefixUrl,y.home.REST),srcGroup:J(this.prefixUrl,y.home.GROUP),srcHover:J(this.prefixUrl,y.home.HOVER),srcDown:J(this.prefixUrl,y.home.DOWN),onRelease:te,onFocus:ae,onBlur:Ae}
vendor: 98,100 bytes, line 351
351)),this.showFullPageControl&&v.push(this.fullPageButton=new e.Button({element:this.fullPageButton?e.getElement(this.fullPageButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.FullPage"),srcRest:J(this.prefixUrl,y.fullpage.REST),srcGroup:J(this.prefixUrl,y.fullpage.GROUP),srcHover:J(this.prefixUrl,y.fullpage.HOVER),srcDown:J(this.prefixUrl,y.fullpage.DOWN),onRelease:Q,onFocus:ae,onBlur:Ae})),this.showRotationControl&&(v.push(this.rotateLeftButton=new e.Button({element:this.rotateLeftButton?e.getElement(this.rotateLeftButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.RotateLeft"),srcRest:J(this.prefixUrl,y.rotateleft.REST),srcGroup:J(this.prefixUrl,y.rotateleft.GROUP),srcHover:J(this.prefixUrl,y.rotateleft.HOVER),srcDown:J(this.prefixUrl,y.rotateleft.DOWN),onRelease:me,onFocus:ae,onBlur:Ae})),v.push(this.rotateRightButton=new e.Button({element:this.rotateRightButton?e.getElement(this.rotateRightButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.RotateRight"),srcRest:J(this.prefixUrl,y.rotateright.REST),srcGroup:J(this.prefixUrl,y.rotateright.GROUP),srcHover:J(this.prefixUrl,y.rotateright.HOVER),srcDown:J(this.prefixUrl,y.rotateright.DOWN),onRelease:ve,onFocus:ae,onBlur:Ae}))),this.showFlipControl&&v.push(this.flipButton=new e.Button({element:this.flipButton?e.getElement(this.flipButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.Flip"),srcRest:J(this.prefixUrl,y.flip.REST),srcGroup:J(this.prefixUrl,y.flip.GROUP),srcHover:J(this.prefixUrl,y.flip.HOVER),srcDown:J(this.prefixUrl,y.flip.DOWN),onRelease:be,onFocus:ae,onBlur:Ae})),_?(this.buttonGroup=new e.ButtonGroup({buttons:v,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.navControl=this.buttonGroup.element,this.addHandler("open",e.delegate(this,kr)),this.toolbar?this.toolbar.addControl(this.navControl,{anchor:this.navigationControlAnchor||e.ControlAnchor.TOP_LEFT}):this.addControl(this.navControl,{anchor:this.navigationControlAnchor||e.ControlAnchor.TOP_LEFT})):this.customButtons=v),this},currentPage:function(){return this._sequenceIndex},goToPage:function(m){return this.tileSources&&m>=0&&m<this.tileSources.length&&(this._sequenceIndex=m,this._updateSequenceButtons(m),this.open(this.tileSources[m]),this.referenceStrip&&this.referenceStrip.setFocus(m),this.raiseEvent("page",{page:m})),this},addOverlay:function(m,C,L,G){var U;if(e.isPlainObject(m)?U=m:U={element:m,location:C,placement:L,onDraw:G},m=e.getElement(U.element),l(this.currentOverlays,m)>=0)return this;var te=o(this,U);return this.currentOverlays.push(te),te.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:m,location:U.location,placement:U.placement}),this},updateOverlay:function(m,C,L){var G;return m=e.getElement(m),G=l(this.currentOverlays,m),G>=0&&(this.currentOverlays[G].update(C,L),i[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:m,location:C,placement:L})),this},removeOverlay:function(m){var C;return m=e.getElement(m),C=l(this.currentOverlays,m),C>=0&&(this.currentOverlays[C].destroy(),this.currentOverlays.splice(C,1),i[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:m})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return i[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(m){var C;return m=e.getElement(m),C=l(this.currentOverlays,m),C>=0?this.currentOverlays[C]:null},_updateSequenceButtons:function(m){this.nextButton&&(!this.tileSources||this.tileSources.length-1===m?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(m>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(m){this._hideMessage();var C=e.makeNeutralElement("div");C.appendChild(document.createTextNode(m)),this.messageDiv=e.makeCenteredNode(C),e.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var m=this.messageDiv;m&&(m.parentNode.removeChild(m),delete this.messageDiv)},gestureSettingsByDeviceType:function(m){switch(m){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var m,C=this.currentOverlays.length;for(m=0;m<C;m++)this.currentOverlays[m].drawHTML(this.overlaysContainer,this.viewport)},_cancelPendingImages:function(){this._loadQueue=[]},removeReferenceStrip:function(){this.showReferenceStrip=!1,this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null)},addReferenceStrip:function(){if(this.showReferenceStrip=!0,this.sequenceMode){if(this.referenceStrip)return;this.tileSources.length&&this.tileSources.length>1&&(this.referenceStrip=new e.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else e.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),e.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){e.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var m=e.pixelDensityRatio,C=e.getCurrentPixelDensityRatio();m!==C&&(e.pixelDensityRatio=C,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var m=this._sequenceIndex-1;this.navPrevNextWrap&&m<0&&(m+=this.tileSources.length),this.goToPage(m)},goToNextPage:function(){var m=this._sequenceIndex+1;this.navPrevNextWrap&&m>=this.tileSources.length&&(m=0),this.goToPage(m)},isAnimating:function(){return i[this.hash].animating}});function a(m){return m=e.getElement(m),new e.Point(m.clientWidth===0?1:m.clientWidth,m.clientHeight===0?1:m.clientHeight)}function c(m,C,L,G,U){var te=m;if(e.type(C)==="string"){if(C.match(/^\s*<.*>\s*$/))C=e.parseXml(C);else if(C.match(/^\s*[{[].*[}\]]\s*$/))try{var Q=e.parseJSON(C);C=Q}catch{}}function me(ve,be){ve.ready?G(ve):(ve.addHandler("ready",function(){G(ve)}),ve.addHandler("open-failed",function(ae){U({message:ae.message,source:be})}))}setTimeout(function(){if(e.type(C)==="string")C=new e.TileSource({url:C,crossOriginPolicy:L.crossOriginPolicy!==void 0?L.crossOriginPolicy:m.crossOriginPolicy,ajaxWithCredentials:m.ajaxWithCredentials,ajaxHeaders:L.ajaxHeaders?L.ajaxHeaders:m.ajaxHeaders,splitHashDataForPost:m.splitHashDataForPost,useCanvas:m.useCanvas,success:function(Ae){G(Ae.tileSource)}}),C.addHandler("open-failed",function(Ae){U(Ae)});else if(e.isPlainObject(C)||C.nodeType)if(C.crossOriginPolicy===void 0&&(L.crossOriginPolicy!==void 0||m.crossOriginPolicy!==void 0)&&(C.crossOriginPolicy=L.crossOriginPolicy!==void 0?L.crossOriginPolicy:m.crossOriginPolicy),C.ajaxWithCredentials===void 0&&(C.ajaxWithCredentials=m.ajaxWithCredentials),C.useCanvas===void 0&&(C.useCanvas=m.useCanvas),e.isFunction(C.getTileUrl)){var ve=new e.TileSource(C);ve.getTileUrl=C.getTileUrl,G(ve)}else{var be=e.TileSource.determineType(te,C);if(!be){U({message:"Unable to load TileSource",source:C});return}var ae=be.prototype.configure.apply(te,[C]);me(new be(ae),C)}else me(C,C)})}function o(m,C){if(C instanceof e.Overlay)return C;var L=null;if(C.element)L=e.getElement(C.element);else{var G=C.id?C.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);L=e.getElement(C.id),L||(L=document.createElement("a"),L.href="#/overlay/"+G),L.id=G,e.addClass(L,C.className?C.className:"openseadragon-overlay")}var U=C.location,te=C.width,Q=C.height;if(!U){var me=C.x,ve=C.y;if(C.px!==void 0){var be=m.viewport.imageToViewportRectangle(new e.Rect(C.px,C.py,te||0,Q||0));me=be.x,ve=be.y,te=te!==void 0?be.width:void 0,Q=Q!==void 0?be.height:void 0}U=new e.Point(me,ve)}var ae=C.placement;return ae&&e.type(ae)==="string"&&(ae=e.Placement[C.placement.toUpperCase()]),new e.Overlay({element:L,location:U,placement:ae,onDraw:C.onDraw,checkResize:C.checkResize,width:te,height:Q,rotationMode:C.rotationMode})}function l(m,C){var L;for(L=m.length-1;L>=0;L--)if(m[L].element===C)return L;return-1}function u(m,C){return e.requestAnimationFrame(function(){C(m)})}function d(m){e.requestAnimationFrame(function(){f(m)})}function h(m){m.autoHideControls&&(m.controlsShouldFade=!0,m.controlsFadeBeginTime=e.now()+m.controlsFadeDelay,window.setTimeout(function(){d(m)},m.controlsFadeDelay))}function f(m){var C,L,G,U;if(m.controlsShouldFade){for(C=e.now(),L=C-m.controlsFadeBeginTime,G=1-L/m.controlsFadeLength,G=Math.min(1,G),G=Math.max(0,G),U=m.controls.length-1;U>=0;U--)m.controls[U].autoFade&&m.controls[U].setOpacity(G);G>0&&d(m)}}function p(m){var C;for(m.controlsShouldFade=!1,C=m.controls.length-1;C>=0;C--)m.controls[C].setOpacity(1)}function g(){p(this)}function w(){h(this)}function b(m){var C={tracker:m.eventSource,position:m.position,originalEvent:m.originalEvent,preventDefault:m.preventDefault};this.raiseEvent("canvas-contextmenu",C),m.preventDefault=C.preventDefault}function x(m){var C={originalEvent:m.originalEvent,preventDefaultAction:!1,preventVerticalPan:m.preventVerticalPan||!this.panVertical,preventHorizontalPan:m.preventHorizontalPan||!this.panHorizontal};if(this.raiseEvent("canvas-key",C),!C.preventDefaultAction&&!m.ctrl&&!m.alt&&!m.meta)switch(m.keyCode){case 38:C.preventVerticalPan||(m.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),m.preventDefault=!0;break;case 40:C.preventVerticalPan||(m.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),m.preventDefault=!0;break;case 37:C.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),m.preventDefault=!0;break;case 39:C.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),m.preventDefault=!0;break;case 187:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),m.preventDefault=!0;break;case 189:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),m.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),m.preventDefault=!0;break;case 87:C.preventVerticalPan||(m.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-40))),this.viewport.applyConstraints()),m.preventDefault=!0;break;case 83:C.preventVerticalPan||(m.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,40))),this.viewport.applyConstraints()),m.preventDefault=!0;break;case 65:C.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-40,0))),this.viewport.applyConstraints()),m.preventDefault=!0;break;case 68:C.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(40,0))),this.viewport.applyConstraints()),m.preventDefault=!0;break;case 82:m.shift?this.viewport.flipped?this.viewport.setRotation(this.viewport.getRotation()+this.rotationIncrement):this.viewport.setRotation(this.viewport.getRotation()-this.rotationIncrement):this.viewport.flipped?this.viewport.setRotation(this.viewport.getRotation()-this.rotationIncrement):this.viewport.setRotation(this.viewport.getRotation()+this.rotationIncrement),this.viewport.applyConstraints(),m.preventDefault=!0;break;case 70:this.viewport.toggleFlip(),m.preventDefault=!0;break;case 74:this.goToPreviousPage();break;case 75:this.goToNextPage();break;default:m.preventDefault=!1;break}else m.preventDefault=!1}function j(m){var C={originalEvent:m.originalEvent};this.raiseEvent("canvas-key-press",C)}function S(m){var C,L=document.activeElement===this.canvas;L||this.canvas.focus(),this.viewport.flipped&&(m.position.x=this.viewport.getContainerSize().x-m.position.x);var G={tracker:m.eventSource,position:m.position,quick:m.quick,shift:m.shift,originalEvent:m.originalEvent,originalTarget:m.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",G),!G.preventDefaultAction&&this.viewport&&m.quick&&(C=this.gestureSettingsByDeviceType(m.pointerType),C.clickToZoom===!0&&(this.viewport.zoomBy(m.shift?1/this.zoomPerClick:this.zoomPerClick,C.zoomToRefPoint?this.viewport.pointFromPixel(m.position,!0):null),this.viewport.applyConstraints()),C.dblClickDragToZoom&&(i[this.hash].draggingToZoom===!0?(i[this.hash].lastClickTime=null,i[this.hash].draggingToZoom=!1):i[this.hash].lastClickTime=e.now()))}function E(m){var C,L={tracker:m.eventSource,position:m.position,shift:m.shift,originalEvent:m.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",L),!L.preventDefaultAction&&this.viewport&&(C=this.gestureSettingsByDeviceType(m.pointerType),C.dblClickToZoom&&(this.viewport.zoomBy(m.shift?1/this.zoomPerClick:this.zoomPerClick,C.zoomToRefPoint?this.viewport.pointFromPixel(m.position,!0):null),this.viewport.applyConstraints()))}function R(m){var C,L={tracker:m.eventSource,pointerType:m.pointerType,position:m.position,delta:m.delta,speed:m.speed,direction:m.direction,shift:m.shift,originalEvent:m.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",L),C=this.gestureSettingsByDeviceType(m.pointerType),!L.preventDefaultAction&&this.viewport){if(C.dblClickDragToZoom&&i[this.hash].draggingToZoom){var G=Math.pow(this.zoomPerDblClickDrag,m.delta.y/50);this.viewport.zoomBy(G)}else if(C.dragToPan&&!i[this.hash].draggingToZoom){if(this.panHorizontal||(m.delta.x=0),this.panVertical||(m.delta.y=0),this.viewport.flipped&&(m.delta.x=-m.delta.x),this.constrainDuringPan){var U=this.viewport.deltaPointsFromPixels(m.delta.negate());this.viewport.centerSpringX.target.value+=U.x,this.viewport.centerSpringY.target.value+=U.y;var te=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=U.x,this.viewport.centerSpringY.target.value-=U.y,te.xConstrained&&(m.delta.x=0),te.yConstrained&&(m.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(m.delta.negate()),C.flickEnabled&&!this.constrainDuringPan)}}}function A(m){var C,L={tracker:m.eventSource,pointerType:m.pointerType,position:m.position,speed:m.speed,direction:m.direction,shift:m.shift,originalEvent:m.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",L),C=this.gestureSettingsByDeviceType(m.pointerType),!L.preventDefaultAction&&this.viewport){if(!i[this.hash].draggingToZoom&&C.flickEnabled&&m.speed>=C.flickMinSpeed){var G=0;this.panHorizontal&&(G=C.flickMomentum*m.speed*Math.cos(m.direction));var U=0;this.panVertical&&(U=C.flickMomentum*m.speed*Math.sin(m.direction));var te=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),Q=this.viewport.pointFromPixel(new e.Point(te.x-G,te.y-U));this.viewport.panTo(Q,!1)}this.viewport.applyConstraints()}C.dblClickDragToZoom&&i[this.hash].draggingToZoom===!0&&(i[this.hash].draggingToZoom=!1)}function I(m){this.raiseEvent("canvas-enter",{tracker:m.eventSource,pointerType:m.pointerType,position:m.position,buttons:m.buttons,pointers:m.pointers,insideElementPressed:m.insideElementPressed,buttonDownAny:m.buttonDownAny,originalEvent:m.originalEvent})}function H(m){this.raiseEvent("canvas-exit",{tracker:m.eventSource,pointerType:m.pointerType,position:m.position,buttons:m.buttons,pointers:m.pointers,insideElementPressed:m.insideElementPressed,buttonDownAny:m.buttonDownAny,originalEvent:m.originalEvent})}function W(m){var C;if(this.raiseEvent("canvas-press",{tracker:m.eventSource,pointerType:m.pointerType,position:m.position,insideElementPressed:m.insideElementPressed,insideElementReleased:m.insideElementReleased,originalEvent:m.originalEvent}),C=this.gestureSettingsByDeviceType(m.pointerType),C.dblClickDragToZoom){var L=i[this.hash].lastClickTime,G=e.now();if(L===null)return;G-L<this.dblClickTimeThreshold&&(i[this.hash].draggingToZoom=!0),i[this.hash].lastClickTime=null}}function Z(m){this.raiseEvent("canvas-release",{tracker:m.eventSource,pointerType:m.pointerType,position:m.position,insideElementPressed:m.insideElementPressed,insideElementReleased:m.insideElementReleased,originalEvent:m.originalEvent})}function $(m){this.raiseEvent("canvas-nonprimary-press",{tracker:m.eventSource,position:m.position,pointerType:m.pointerType,button:m.button,buttons:m.buttons,originalEvent:m.originalEvent})}function X(m){this.raiseEvent("canvas-nonprimary-release",{tracker:m.eventSource,position:m.position,pointerType:m.pointerType,button:m.button,buttons:m.buttons,originalEvent:m.originalEvent})}function ee(m){var C,L,G,U,te={tracker:m.eventSource,pointerType:m.pointerType,gesturePoints:m.gesturePoints,lastCenter:m.lastCenter,center:m.center,lastDistance:m.lastDistance,distance:m.distance,shift:m.shift,originalEvent:m.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",te),this.viewport&&(C=this.gestureSettingsByDeviceType(m.pointerType),C.pinchToZoom&&(!te.preventDefaultPanAction||!te.preventDefaultZoomAction)&&(L=this.viewport.pointFromPixel(m.center,!0),C.zoomToRefPoint&&!te.preventDefaultPanAction&&(G=this.viewport.pointFromPixel(m.lastCenter,!0),U=G.minus(L),this.panHorizontal||(U.x=0),this.panVertical||(U.y=0),this.viewport.panBy(U,!0)),te.preventDefaultZoomAction||this.viewport.zoomBy(m.distance/m.lastDistance,L,!0),this.viewport.applyConstraints()),C.pinchRotate&&!te.preventDefaultRotateAction)){var Q=Math.atan2(m.gesturePoints[0].currentPos.y-m.gesturePoints[1].currentPos.y,m.gesturePoints[0].currentPos.x-m.gesturePoints[1].currentPos.x),me=Math.atan2(m.gesturePoints[0].lastPos.y-m.gesturePoints[1].lastPos.y,m.gesturePoints[0].lastPos.x-m.gesturePoints[1].lastPos.x);L=this.viewport.pointFromPixel(m.center,!0),this.viewport.rotateTo(this.viewport.getRotation(!0)+(Q-me)*(180/Math.PI),L,!0)}}function P(m){this.raiseEvent("canvas-focus",{tracker:m.eventSource,originalEvent:m.originalEvent})}function k(m){this.raiseEvent("canvas-blur",{tracker:m.eventSource,originalEvent:m.originalEvent})}function O(m){var C,L,G,U,te;U=e.now(),te=U-this._lastScrollTime,te>this.minScrollDeltaTime?(this._lastScrollTime=U,C={tracker:m.eventSource,position:m.position,scroll:m.scroll,shift:m.shift,originalEvent:m.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",C),!C.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(m.position.x=this.viewport.getContainerSize().x-m.position.x),L=this.gestureSettingsByDeviceType(m.pointerType),L.scrollToZoom&&(G=Math.pow(this.zoomPerScroll,m.scroll),this.viewport.zoomBy(G,L.zoomToRefPoint?this.viewport.pointFromPixel(m.position,!0):null),this.viewport.applyConstraints())),m.preventDefault=C.preventDefault):m.preventDefault=!0}function z(m){i[this.hash].mouseInside=!0,p(this),this.raiseEvent("container-enter",{tracker:m.eventSource,pointerType:m.pointerType,position:m.position,buttons:m.buttons,pointers:m.pointers,insideElementPressed:m.insideElementPressed,buttonDownAny:m.buttonDownAny,originalEvent:m.originalEvent})}function D(m){m.pointers<1&&(i[this.hash].mouseInside=!1,i[this.hash].animating||h(this)),this.raiseEvent("container-exit",{tracker:m.eventSource,pointerType:m.pointerType,position:m.position,buttons:m.buttons,pointers:m.pointers,insideElementPressed:m.insideElementPressed,buttonDownAny:m.buttonDownAny,originalEvent:m.originalEvent})}function M(m){K(m),m.isOpen()?m._updateRequestId=u(m,M):m._updateRequestId=!1}function B(m,C){var L=m.viewport,G=L.getZoom(),U=L.getCenter();L.resize(C,m.preserveImageSizeOnResize),L.panTo(U,!0);var te;if(m.preserveImageSizeOnResize)te=i[m.hash].prevContainerSize.x/C.x;else{var Q=new e.Point(0,0),me=new e.Point(i[m.hash].prevContainerSize.x,i[m.hash].prevContainerSize.y).distanceTo(Q),ve=new e.Point(C.x,C.y).distanceTo(Q);te=ve/me*i[m.hash].prevContainerSize.x/C.x}L.zoomTo(G*te,null,!0),i[m.hash].prevContainerSize=C,i[m.hash].forceRedraw=!0,i[m.hash].needsResize=!1,i[m.hash].forceResize=!1}function K(m){if(!(m._opening||!i[m.hash])){if(m.autoResize||i[m.hash].forceResize){var C;if(m._autoResizePolling){C=a(m.container);var L=i[m.hash].prevContainerSize;C.equals(L)||(i[m.hash].needsResize=!0)}i[m.hash].needsResize&&B(m,C||a(m.container))}var G=m.viewport.update(),U=m.world.update()||G;G&&m.raiseEvent("viewport-change"),m.referenceStrip&&(U=m.referenceStrip.update(m.viewport)||U);var te=i[m.hash].animating;!te&&U&&(m.raiseEvent("animation-start"),p(m));var Q=te&&!U;Q&&(i[m.hash].animating=!1),(U||Q||i[m.hash].forceRedraw||m.world.needsDraw())&&(se(m),m._drawOverlays(),m.navigator&&m.navigator.update(m.viewport),i[m.hash].forceRedraw=!1,U&&m.raiseEvent("animation")),Q&&(m.raiseEvent("animation-finish"),i[m.hash].mouseInside||h(m)),i[m.hash].animating=U}}function se(m){m.imageLoader.clear(),m.drawer.clear(),m.world.draw(),m.raiseEvent("update-viewport",{})}function J(m,C){return m?m+C:C}function ce(){i[this.hash].lastZoomTime=e.now(),i[this.hash].zoomFactor=this.zoomPerSecond,i[this.hash].zooming=!0,Ne(this)}function Fe(){i[this.hash].lastZoomTime=e.now(),i[this.hash].zoomFactor=1/this.zoomPerSecond,i[this.hash].zooming=!0,Ne(this)}function Pe(){i[this.hash].zooming=!1}function Ne(m){e.requestAnimationFrame(e.delegate(m,lt))}function lt(){var m,C,L;i[this.hash].zooming&&this.viewport&&(m=e.now(),C=m-i[this.hash].lastZoomTime,L=Math.pow(i[this.hash].zoomFactor,C/1e3),this.viewport.zoomBy(L),this.viewport.applyConstraints(),i[this.hash].lastZoomTime=m,Ne(this))}function $r(){this.viewport&&(i[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function ei(){this.viewport&&(i[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function kr(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function Ki(){this.viewport&&this.viewport.goHome()}function rs(){this.isFullPage()&&!e.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function qa(){if(this.viewport){var m=this.viewport.getRotation();this.viewport.flipped?m+=this.rotationIncrement:m-=this.rotationIncrement,this.viewport.setRotation(m)}}function Xi(){if(this.viewport){var m=this.viewport.getRotation();this.viewport.flipped?m-=this.rotationIncrement:m+=this.rotationIncrement,this.viewport.setRotation(m)}}function ti(){this.viewport.toggleFlip()}}(r),function(e){e.Navigator=function(u){var d=u.viewer,h=this,f,p;u.element||u.id?(u.element?(u.id&&e.console.warn("Given option.id for Navigator was ignored since option.element was provided and is being used instead."),u.element.id?u.id=u.element.id:u.id="navigator-"+e.now(),this.element=u.element):this.element=document.getElementById(u.id),u.controlOptions={anchor:e.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(u.id="navigator-"+e.now(),this.element=e.makeNeutralElement("div"),u.controlOptions={anchor:e.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:u.autoFade},u.position&&(u.position==="BOTTOM_RIGHT"?u.controlOptions.anchor=e.ControlAnchor.BOTTOM_RIGHT:u.position==="BOTTOM_LEFT"?u.controlOptions.anchor=e.ControlAnchor.BOTTOM_LEFT:u.position==="TOP_RIGHT"?u.controlOptions.anchor=e.ControlAnchor.TOP_RIGHT:u.position==="TOP_LEFT"?u.controlOptions.anchor=e.ControlAnchor.TOP_LEFT:u.position==="ABSOLUTE"&&(u.controlOptions.anchor=e.ControlAnchor.ABSOLUTE,u.controlOptions.top=u.top,u.controlOptions.left=u.left,u.controlOptions.height=u.height,u.controlOptions.width=u.width))),this.element.id=u.id,this.element.className+=" navigator",u=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.navigatorSizeRatio},u,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:u.animationTime,autoResize:!1,minZoomImageRatio:1,background:u.background,opacity:u.opacity,borderColor:u.borderColor,displayRegionColor:u.displayRegionColor}),u.minPixelRatio=this.minPixelRatio=d.minPixelRatio,e.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new e.Point(1,1),this.totalBorderWidths=new e.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),u.controlOptions.anchor!==e.ControlAnchor.NONE&&function(b,x){b.margin="0px",b.border=x+"px solid "+u.borderColor,b.padding="0px",b.background=u.background,b.opacity=u.opacity,b.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=e.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(b,x){b.position="relative",b.top="0px",b.left="0px",b.fontSize="0px",b.overflow="hidden",b.border=x+"px solid "+u.displayRegionColor,b.margin="0px",b.padding="0px",b.background="transparent",b.float="left",b.cssFloat="left",b.styleFloat="left",b.zIndex=999999999,b.cursor="default",b.boxSizing="content-box"}(this.displayRegion.style,this.borderWidth),e.setElementPointerEventsNone(this.displayRegion),e.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=e.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",e.setElementPointerEventsNone(this.displayRegionContainer),e.setElementTouchActionNone(this.displayRegionContainer),d.addControl(this.element,u.controlOptions),this._resizeWithViewer=u.controlOptions.anchor!==e.ControlAnchor.ABSOLUTE&&u.controlOptions.anchor!==e.ControlAnchor.NONE,u.width&&u.height?(this.setWidth(u.width),this.setHeight(u.height)):this._resizeWithViewer&&(f=e.getElementSize(d.element),this.element.style.height=Math.round(f.y*u.sizeRatio)+"px",this.element.style.width=Math.round(f.x*u.sizeRatio)+"px",this.oldViewerSize=f,p=e.getElementSize(this.element),this.elementArea=p.x*p.y),this.oldContainerSize=new e.Point(0,0),e.Viewer.apply(this,[u]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function g(b,x){o(h.displayRegionContainer,b),o(h.displayRegion,-b),h.viewport.setRotation(b,x)}if(u.navigatorRotate){var w=u.viewer.viewport?u.viewer.viewport.getRotation():u.viewer.degrees||0;g(w,!0),u.viewer.addHandler("rotate",function(b){g(b.degrees,b.immediately)})}this.innerTracker.destroy(),this.innerTracker=new e.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:e.delegate(this,n),clickHandler:e.delegate(this,i),releaseHandler:e.delegate(this,a),scrollHandler:e.delegate(this,c),preProcessEventHandler:function(b){b.eventType==="wheel"&&(b.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",e.setElementPointerEventsNone(this.canvas),e.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){h.viewport&&h.viewport.goHome(!0)}),d.world.addHandler("item-index-change",function(b){window.setTimeout(function(){var x=h.world.getItemAt(b.previousIndex);h.world.setItemIndex(x,b.newIndex)},1)}),d.world.addHandler("remove-item",function(b){var x=b.item,j=h._getMatchingItem(x);j&&h.world.removeItem(j)}),this.update(d.viewport)},e.extend(e.Navigator.prototype,e.EventSource.prototype,e.Viewer.prototype,{updateSize:function(){if(this.viewport){var u=new e.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);u.equals(this.oldContainerSize)||(this.viewport.resize(u,!0),this.viewport.goHome(!0),this.oldContainerSize=u,this.drawer.clear(),this.world.draw())}},setWidth:function(u){this.width=u,this.element.style.width=typeof u=="number"?u+"px":u,this._resizeWithViewer=!1,this.updateSize()},setHeight:function(u){this.height=u,this.element.style.height=typeof u=="number"?u+"px":u,this._resizeWithViewer=!1,this.updateSize()},setFlip:function(u){return this.viewport.setFlip(u),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(u){l(this.displayRegion,u),l(this.canvas,u),l(this.element,u)},update:function(u){var d,h,f,p,g,w;if(d=e.getElementSize(this.viewer.element),this._resizeWithViewer&&d.x&&d.y&&!d.equals(this.oldViewerSize)&&(this.oldViewerSize=d,this.maintainSizeRatio||!this.elementArea?(h=d.x*this.sizeRatio,f=d.y*this.sizeRatio):(h=Math.sqrt(this.elementArea*(d.x/d.y)),f=this.elementArea/h),this.element.style.width=Math.round(h)+"px",this.element.style.height=Math.round(f)+"px",this.elementArea||(this.elementArea=h*f),this.updateSize()),u&&this.viewport){if(p=u.getBoundsNoRotate(!0),g=this.viewport.pixelFromPointNoRotate(p.getTopLeft(),!1),w=this.viewport.pixelFromPointNoRotate(p.getBottomRight(),!1).minus(this.totalBorderWidths),!this.navigatorRotate){var b=u.getRotation(!0);o(this.displayRegion,-b)}var x=this.displayRegion.style;x.display=this.world.getItemCount()?"block":"none",x.top=g.y.toFixed(2)+"px",x.left=g.x.toFixed(2)+"px";var j=w.x-g.x,S=w.y-g.y;x.width=Math.round(Math.max(j,0))+"px",x.height=Math.round(Math.max(S,0))+"px"}},addTiledImage:function(u){var d=this,h=u.originalTiledImage;delete u.original;var f=e.extend({},u,{success:function(p){var g=p.item;g._originalForNavigator=h,d._matchBounds(g,h,!0),d._matchOpacity(g,h),d._matchCompositeOperation(g,h);function w(){d._matchBounds(g,h)}function b(){d._matchOpacity(g,h)}function x(){d._matchCompositeOperation(g,h)}h.addHandler("bounds-change",w),h.addHandler("clip-change",w),h.addHandler("opacity-change",b),h.addHandler("composite-operation-change",x)}});return e.Viewer.prototype.addTiledImage.apply(this,[f])},destroy:function(){return e.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(u){for(var d=this.world.getItemCount(),h,f=0;f<d;f++)if(h=this.world.getItemAt(f),h._originalForNavigator===u)return h;return null},_matchBounds:function(u,d,h){var f=d.getBoundsNoRotate();u.setPosition(f.getTopLeft(),h),u.setWidth(f.width,h),u.setRotation(d.getRotation(),h),u.setClip(d.getClip()),u.setFlip(d.getFlip())},_matchOpacity:function(u,d){u.setOpacity(d.opacity)},_matchCompositeOperation:function(u,d){u.setCompositeOperation(d.compositeOperation)}});function i(u){var d={tracker:u.eventSource,position:u.position,quick:u.quick,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};if(this.viewer.raiseEvent("navigator-click",d),!d.preventDefaultAction&&u.quick&&this.viewer.viewport&&(this.panVertical||this.panHorizontal)){this.viewer.viewport.flipped&&(u.position.x=this.viewport.getContainerSize().x-u.position.x);var h=this.viewport.pointFromPixel(u.position);this.panVertical?this.panHorizontal||(h.x=this.viewer.viewport.getCenter(!0).x):h.y=this.viewer.viewport.getCenter(!0).y,this.viewer.viewport.panTo(h),this.viewer.viewport.applyConstraints()}}function n(u){var d={tracker:u.eventSource,position:u.position,delta:u.delta,speed:u.speed,direction:u.direction,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};this.viewer.raiseEvent("navigator-drag",d),!d.preventDefaultAction&&this.viewer.viewport&&(this.panHorizontal||(u.delta.x=0),this.panVertical||(u.delta.y=0),this.viewer.viewport.flipped&&(u.delta.x=-u.delta.x),this.viewer.viewport.panBy(this.viewport.deltaPointsFromPixels(u.delta)),this.viewer.constrainDuringPan&&this.viewer.viewport.applyConstraints())}function a(u){u.insideElementPressed&&this.viewer.viewport&&this.viewer.viewport.applyConstraints()}function c(u){var d={tracker:u.eventSource,position:u.position,scroll:u.scroll,shift:u.shift,originalEvent:u.originalEvent,preventDefault:u.preventDefault};this.viewer.raiseEvent("navigator-scroll",d),u.preventDefault=d.preventDefault}function o(u,d){l(u,"rotate("+d+"deg)")}function l(u,d){u.style.webkitTransform=d,u.style.mozTransform=d,u.style.msTransform=d,u.style.oTransform=d,u.style.transform=d}}(r),function(e){var i={Errors:{Dzc:"Sorry, we don't support Deep Zoom Collections!",Dzi:"Hmm, this doesn't appear to be a valid Deep Zoom Image.",Xml:"Hmm, this doesn't appear to be a valid Deep Zoom Image.",ImageFormat:"Sorry, we don't support {0}-based Deep Zoom Images.",Security:"It looks like a security restriction stopped us from loading this Deep Zoom Image.",Status:"This space unintentionally left blank ({0} {1}).",OpenFailed:"Unable to open {0}: {1}"},Tooltips:{FullPage:"Toggle full page",Home:"Go home",ZoomIn:"Zoom in",ZoomOut:"Zoom out",NextPage:"Next page",PreviousPage:"Previous page",RotateLeft:"Rotate left",RotateRight:"Rotate right",Flip:"Flip Horizontally"}};e.extend(e,{getString:function(n){var a=n.split("."),c=null,o=arguments,l=i,u;for(u=0;u<a.length-1;u++)l=l[a[u]]||{};return c=l[a[u]],typeof c!="string"&&(e.console.error("Untranslated source string:",n),c=""),c.replace(/\{\d+\}/g,function(d){var h=parseInt(d.match(/\d+/),10)+1;return h<o.length?o[h]:""})},setString:function(n,a){var c=n.split("."),o=i,l;for(l=0;l<c.length-1;l++)o[c[l]]||(o[c[l]]={}),o=o[c[l]];o[c[l]]=a}})}(r),function(e){e.Point=function(i,n){this.x=typeof i=="number"?i:0,this.y=typeof n=="number"?n:0},e.Point.prototype={clone:function(){return new e.Point(this.x,this.y)},plus:function(i){return new e.Point(this.x+i.x,this.y+i.y)},minus:function(i){return new e.Point(this.x-i.x,this.y-i.y)},times:function(i){return new e.Point(this.x*i,this.y*i)},divide:function(i){return new e.Point(this.x/i,this.y/i)},negate:function(){return new e.Point(-this.x,-this.y)},distanceTo:function(i){return Math.sqrt(Math.pow(this.x-i.x,2)+Math.pow(this.y-i.y,2))},squaredDistanceTo:function(i){return Math.pow(this.x-i.x,2)+Math.pow(this.y-i.y,2)},apply:function(i){return new e.Point(i(this.x),i(this.y))},equals:function(i){return i instanceof e.Point&&this.x===i.x&&this.y===i.y},rotate:function(i,n){n=n||new e.Point(0,0);var a,c;if(i%90===0){var o=e.positiveModulo(i,360);switch(o){case 0:a=1,c=0;break;case 90:a=0,c=1;break;case 180:a=-1,c=0;break;case 270:a=0,c=-1;break}}else{var l=i*Math.PI/180;a=Math.cos(l),c=Math.sin(l)}var u=a*(this.x-n.x)-c*(this.y-n.y)+n.x,d=c*(this.x-n.x)+a*(this.y-n.y)+n.y;return new e.Point(u,d)},toString:function(){return"("+Math.round(this.x*100)/100+","+Math.round(this.y*100)/100+")"}}}(r),function(e){e.TileSource=function(n,a,c,o,l,u){var d=this,h=arguments,f,p;if(e.isPlainObject(n)?f=n:f={width:h[0],height:h[1],tileSize:h[2],tileOverlap:h[3],minLevel:h[4],maxLevel:h[5]},e.EventSource.call(this),e.extend(!0,this,f),!this.success){for(p=0;p<arguments.length;p++)if(e.isFunction(arguments[p])){this.success=arguments[p];break}}this.success&&this.addHandler("ready",function(g){d.success(g)}),e.type(arguments[0])==="string"&&(this.url=arguments[0]),this.url?(this.aspectRatio=1,this.dimensions=new e.Point(10,10),this._tileWidth=0,this._tileHeight=0,this.tileOverlap=0,this.minLevel=0,this.maxLevel=0,this.ready=!1,this.getImageInfo(this.url)):(this.ready=!0,this.aspectRatio=f.width&&f.height?f.width/f.height:1,this.dimensions=new e.Point(f.width,f.height),this.tileSize?(this._tileWidth=this._tileHeight=this.tileSize,delete this.tileSize):(this.tileWidth?(this._tileWidth=this.tileWidth,delete this.tileWidth):this._tileWidth=0,this.tileHeight?(this._tileHeight=this.tileHeight,delete this.tileHeight):this._tileHeight=0),this.tileOverlap=f.tileOverlap?f.tileOverlap:0,this.minLevel=f.minLevel?f.minLevel:0,this.maxLevel=f.maxLevel!==void 0&&f.maxLevel!==null?f.maxLevel:f.width&&f.height?Math.ceil(Math.log(Math.max(f.width,f.height))/Math.log(2)):0,this.success&&e.isFunction(this.success)&&this.success(this))},e.TileSource.prototype={getTileSize:function(n){return e.console.error("[TileSource.getTileSize] is deprecated. Use TileSource.getTileWidth() and TileSource.getTileHeight() instead"),this._tileWidth},getTileWidth:function(n){return this._tileWidth?this._tileWidth:this.getTileSize(n)},getTileHeight:function(n){return this._tileHeight?this._tileHeight:this.getTileSize(n)},setMaxLevel:function(n){this.maxLevel=n,this._memoizeLevelScale()},getLevelScale:function(n){return this._memoizeLevelScale(),this.getLevelScale(n)},_memoizeLevelScale:function(){var n={},a;for(a=0;a<=this.maxLevel;a++)n[a]=1/Math.pow(2,this.maxLevel-a);this.getLevelScale=function(c){return n[c]}},getNumTiles:function(n){var a=this.getLevelScale(n),c=Math.ceil(a*this.dimensions.x/this.getTileWidth(n)),o=Math.ceil(a*this.dimensions.y/this.getTileHeight(n));return new e.Point(c,o)},getPixelRatio:function(n){var a=this.dimensions.times(this.getLevelScale(n)),c=1/a.x*e.pixelDensityRatio,o=1/a.y*e.pixelDensityRatio;return new e.Point(c,o)},getClosestLevel:function(){var n,a;for(n=this.minLevel+1;n<=this.maxLevel&&(a=this.getNumTiles(n),!(a.x>1||a.y>1));n++);return n-1},getTileAtPoint:function(n,a){var c=a.x>=0&&a.x<=1&&a.y>=0&&a.y<=1/this.aspectRatio;e.console.assert(c,"[TileSource.getTileAtPoint] must be called with a valid point.");var o=this.dimensions.x*this.getLevelScale(n),l=a.x*o,u=a.y*o,d=Math.floor(l/this.getTileWidth(n)),h=Math.floor(u/this.getTileHeight(n));a.x>=1&&(d=this.getNumTiles(n).x-1);var f=1e-15;return a.y>=1/this.aspectRatio-f&&(h=this.getNumTiles(n).y-1),new e.Point(d,h)},getTileBounds:function(n,a,c,o){var l=this.dimensions.times(this.getLevelScale(n)),u=this.getTileWidth(n),d=this.getTileHeight(n),h=a===0?0:u*a-this.tileOverlap,f=c===0?0:d*c-this.tileOverlap,p=u+(a===0?1:2)*this.tileOverlap,g=d+(c===0?1:2)*this.tileOverlap,w=1/l.x;return p=Math.min(p,l.x-h),g=Math.min(g,l.y-f),o?new e.Rect(0,0,p,g):new e.Rect(h*w,f*w,p*w,g*w)},getImageInfo:function(n){var a=this,c,o,l,u,d,h,f;n&&(d=n.split("/"),h=d[d.length-1],f=h.lastIndexOf("."),f>-1&&(d[d.length-1]=h.slice(0,f)));var p=null;if(this.splitHashDataForPost){var g=n.indexOf("#");g!==-1&&(p=n.substring(g+1),n=n.substr(0,g))}o=function(w){typeof w=="string"&&(w=e.parseXml(w));var b=e.TileSource.determineType(a,w,n);if(!b){a.raiseEvent("open-failed",{message:"Unable to load TileSource",source:n});return}u=b.prototype.configure.apply(a,[w,n,p]),u.ajaxWithCredentials===void 0&&(u.ajaxWithCredentials=a.ajaxWithCredentials),l=new b(u),a.ready=!0,a.raiseEvent("ready",{tileSource:l})},n.match(/\.js$/)?(c=n.split("/").pop().replace(".js",""),e.jsonp({url:n,async:!1,callbackName:c,callback:o})):e.makeAjaxRequest({url:n,postData:p,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(w){var b=i(w);o(b)},error:function(w,b){var x;try{x="HTTP "+w.status+" attempting to load TileSource: "+n}catch{var j;typeof b>"u"||!b.toString?j="Unknown error":j=b.toString(),x=j+" attempting to load TileSource: "+n}e.console.error(x),a.raiseEvent("open-failed",{message:x,source:n,postData:p})}})},supports:function(n,a){return!1},configure:function(n,a,c){throw new Error("Method not implemented.")},getTileUrl:function(n,a,c){throw new Error("Method not implemented.")},getTilePostData:function(n,a,c){return null},getTileAjaxHeaders:function(n,a,c){return{}},getTileHashKey:function(n,a,c,o,l,u){function d(h){return l?h+"+"+JSON.stringify(l):h}return d(typeof o!="string"?n+"/"+a+"_"+c:o)},tileExists:function(n,a,c){var o=this.getNumTiles(n);return n>=this.minLevel&&n<=this.maxLevel&&a>=0&&c>=0&&a<o.x&&c<o.y},hasTransparency:function(n,a,c,o){return!!n||a.match(".png")},downloadTileStart:function(n){var a=n.userData,c=new Image;a.image=c,a.request=null;var o=function(l){if(!c){n.finish(null,a.request,"Image load failed: undefined Image instance.");return}c.onload=c.onerror=c.onabort=null,n.finish(l?null:c,a.request,l)};c.onload=function(){o()},c.onabort=c.onerror=function(){o("Image load aborted.")},n.loadWithAjax?a.request=e.makeAjaxRequest({url:n.src,withCredentials:n.ajaxWithCredentials,headers:n.ajaxHeaders,responseType:"arraybuffer",postData:n.postData,success:function(l){var u;try{u=new window.Blob([l.response])}catch(f){var d=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(f.name==="TypeError"&&d){var h=new d;h.append(l.response),u=h.getBlob()}}u.size===0?o("Empty image response."):c.src=(window.URL||window.webkitURL).createObjectURL(u)},error:function(l){o("Image load aborted - XHR error")}}):(n.crossOriginPolicy!==!1&&(c.crossOrigin=n.crossOriginPolicy),c.src=n.src)},downloadTileAbort:function(n){n.userData.request&&n.userData.request.abort();var a=n.userData.image;n.userData.image&&(a.onload=a.onerror=a.onabort=null)},createTileCache:function(n,a,c){n._data=a},destroyTileCache:function(n){n._data=null,n._renderedContext=null},getTileCacheData:function(n){return n._data},getTileCacheDataAsImage:function(n){return n._data},getTileCacheDataAsContext2D:function(n){if(!n._renderedContext){var a=document.createElement("canvas");a.width=n._data.width,a.height=n._data.height,n._renderedContext=a.getContext("2d"),n._renderedContext.drawImage(n._data,0,0),n._data=null}return n._renderedContext}},e.extend(!0,e.TileSource.prototype,e.EventSource.prototype);function i(n){var a=n.responseText,c=n.status,o,l;if(n){if(n.status!==200&&n.status!==0)throw c=n.status,o=c===404?"Not Found":n.statusText,new Error(e.getString("Errors.Status",c,o))}else throw new Error(e.getString("Errors.Security"));if(a.match(/^\s*<.*/))try{l=n.responseXML&&n.responseXML.documentElement?n.responseXML:e.parseXml(a)}catch{l=n.responseText}else if(a.match(/\s*[{[].*/))try{l=e.parseJSON(a)}catch{l=a}else l=a;return l}e.TileSource.determineType=function(n,a,c){var o;for(o in r)if(o.match(/.+TileSource$/)&&e.isFunction(r[o])&&e.isFunction(r[o].prototype.supports)&&r[o].prototype.supports.call(n,a,c))return r[o];return e.console.error("No TileSource was able to open %s %s",c,a),null}}(r),function(e){e.DziTileSource=function(a,c,o,l,u,d,h,f,p){var g,w,b,x;if(e.isPlainObject(a)?x=a:x={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4],fileFormat:arguments[5],displayRects:arguments[6],minLevel:arguments[7],maxLevel:arguments[8]},this._levelRects={},this.tilesUrl=x.tilesUrl,this.fileFormat=x.fileFormat,this.displayRects=x.displayRects,this.displayRects)for(g=this.displayRects.length-1;g>=0;g--)for(w=this.displayRects[g],b=w.minLevel;b<=w.maxLevel;b++)this._levelRects[b]||(this._levelRects[b]=[]),this._levelRects[b].push(w);e.TileSource.apply(this,[x])},e.extend(e.DziTileSource.prototype,e.TileSource.prototype,{supports:function(a,c){var o;return a.Image?o=a.Image.xmlns:a.documentElement&&(a.documentElement.localName==="Image"||a.documentElement.tagName==="Image")&&(o=a.documentElement.namespaceURI),o=(o||"").toLowerCase(),o.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||o.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(a,c,o){var l;return e.isPlainObject(a)?l=n(this,a):l=i(this,a),c&&!l.tilesUrl&&(l.tilesUrl=c.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),c.search(/\.(dzi|xml|js)\?/)!==-1?l.queryParams=c.match(/\?.*/):l.queryParams=""),l},getTileUrl:function(a,c,o){return[this.tilesUrl,a,"/",c,"_",o,".",this.fileFormat,this.queryParams].join("")},tileExists:function(a,c,o){var l=this._levelRects[a],u,d,h,f,p,g,w;if(this.minLevel&&a<this.minLevel||this.maxLevel&&a>this.maxLevel)return!1;if(!l||!l.length)return!0;for(w=l.length-1;w>=0;w--)if(u=l[w],!(a<u.minLevel||a>u.maxLevel)&&(d=this.getLevelScale(a),h=u.x*d,f=u.y*d,p=h+u.width*d,g=f+u.height*d,h=Math.floor(h/this._tileWidth),f=Math.floor(f/this._tileWidth),p=Math.ceil(p/this._tileWidth),g=Math.ceil(g/this._tileWidth),h<=c&&c<p&&f<=o&&o<g))return!0;return!1}});function i(a,c){if(!c||!c.documentElement)throw new Error(e.getString("Errors.Xml"));var o=c.documentElement,l=o.localName||o.tagName,u=c.documentElement.namespaceURI,d=null,h=[],f,p,g,w,b;if(l==="Image")try{if(w=o.getElementsByTagName("Size")[0],w===void 0&&(w=o.getElementsByTagNameNS(u,"Size")[0]),d={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:o.getAttribute("Url"),Format:o.getAttribute("Format"),DisplayRect:null,Overlap:parseInt(o.getAttribute("Overlap"),10),TileSize:parseInt(o.getAttribute("TileSize"),10),Size:{Height:parseInt(w.getAttribute("Height"),10),Width:parseInt(w.getAttribute("Width"),10)}}},!e.imageFormatSupported(d.Image.Format))throw new Error(e.getString("Errors.ImageFormat",d.Image.Format.toUpperCase()));for(f=o.getElementsByTagName("DisplayRect"),f===void 0&&(f=o.getElementsByTagNameNS(u,"DisplayRect")[0]),b=0;b<f.length;b++)p=f[b],g=p.getElementsByTagName("Rect")[0],g===void 0&&(g=p.getElementsByTagNameNS(u,"Rect")[0]),h.push({Rect:{X:parseInt(g.getAttribute("X"),10),Y:parseInt(g.getAttribute("Y"),10),Width:parseInt(g.getAttribute("Width"),10),Height:parseInt(g.getAttribute("Height"),10),MinLevel:parseInt(p.getAttribute("MinLevel"),10),MaxLevel:parseInt(p.getAttribute("MaxLevel"),10)}});return h.length&&(d.Image.DisplayRect=h),n(a,d)}catch(S){throw S instanceof Error?S:new Error(e.getString("Errors.Dzi"))}else{if(l==="Collection")throw new Error(e.getString("Errors.Dzc"));if(l==="Error"){var x=o.getElementsByTagName("Message")[0],j=x.firstChild.nodeValue;throw new Error(j)}}throw new Error(e.getString("Errors.Dzi"))}function n(a,c){var o=c.Image,l=o.Url,u=o.Format,d=o.Size,h=o.DisplayRect||[],f=parseInt(d.Width,10),p=parseInt(d.Height,10),g=parseInt(o.TileSize,10),w=parseInt(o.Overlap,10),b=[],x,j;for(j=0;j<h.length;j++)x=h[j].Rect,b.push(new e.DisplayRect(parseInt(x.X,10),parseInt(x.Y,10),parseInt(x.Width,10),parseInt(x.Height,10),parseInt(x.MinLevel,10),parseInt(x.MaxLevel,10)));return e.extend(!0,{width:f,height:p,tileSize:g,tileOverlap:w,minLevel:null,maxLevel:null,tilesUrl:l,fileFormat:u,displayRects:b},c)}}(r),function(e){e.IIIFTileSource=function(o){if(e.extend(!0,this,o),this._id=this["@id"]||this.id||this.identifier||null,!(this.height&&this.width&&this._id))throw new Error("IIIF required parameters (width, height, or id) not provided.");if(o.tileSizePerScaleFactor={},this.tileFormat=this.tileFormat||"jpg",this.version=o.version,this.tile_width&&this.tile_height)o.tileWidth=this.tile_width,o.tileHeight=this.tile_height;else if(this.tile_width)o.tileSize=this.tile_width;else if(this.tile_height)o.tileSize=this.tile_height;else if(this.tiles)if(this.tiles.length===1)o.tileWidth=this.tiles[0].width,o.tileHeight=this.tiles[0].height||this.tiles[0].width,this.scale_factors=this.tiles[0].scaleFactors;else{this.scale_factors=[];for(var l=0;l<this.tiles.length;l++)for(var u=0;u<this.tiles[l].scaleFactors.length;u++){var d=this.tiles[l].scaleFactors[u];this.scale_factors.push(d),o.tileSizePerScaleFactor[d]={width:this.tiles[l].width,height:this.tiles[l].height||this.tiles[l].width}}}else if(i(o)){for(var h=Math.min(this.height,this.width),f=[256,512,1024],p=[],g=0;g<f.length;g++)f[g]<=h&&p.push(f[g]);p.length>0?o.tileSize=Math.max.apply(null,p):o.tileSize=h}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,o.levels=n(this),e.extend(!0,o,{width:o.levels[o.levels.length-1].width,height:o.levels[o.levels.length-1].height,tileSize:Math.max(o.height,o.width),tileOverlap:0,minLevel:0,maxLevel:o.levels.length-1}),this.levels=o.levels):e.console.error("Nothing in the info.json to construct image pyramids from");if(!o.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)o.maxLevel=Number(Math.round(Math.log(Math.max(this.width,this.height),2)));else{var w=Math.max.apply(null,this.scale_factors);o.maxLevel=Math.round(Math.log(w)*Math.LOG2E)}if(this.sizes){var b=this.sizes.length;(b===o.maxLevel||b===o.maxLevel+1)&&(this.levelSizes=this.sizes.slice().sort(function(x,j){return x.width-j.width}),b===o.maxLevel&&this.levelSizes.push({width:this.width,height:this.height}))}e.TileSource.apply(this,[o])},e.extend(e.IIIFTileSource.prototype,e.TileSource.prototype,{supports:function(o,l){return o.protocol&&o.protocol==="http://iiif.io/api/image"||o["@context"]&&(o["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||o["@context"]==="http://iiif.io/api/image/1/context.json")||o.profile&&o.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||o.identifier&&o.width&&o.height?!0:!!(o.documentElement&&o.documentElement.tagName==="info"&&o.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(o,l,u){if(e.isPlainObject(o)){if(!o["@context"])o["@context"]="http://iiif.io/api/image/1.0/context.json",o["@id"]=l.replace("/info.json",""),o.version=1;else{var h=o["@context"];if(Array.isArray(h)){for(var f=0;f<h.length;f++)if(typeof h[f]=="string"&&(/^http:\/\/iiif\.io\/api\/image\/[1-3]\/context\.json$/.test(h[f])||h[f]==="http://library.stanford.edu/iiif/image-api/1.1/context.json")){h=h[f];break}}switch(h){case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":o.version=1;break;case"http://iiif.io/api/image/2/context.json":o.version=2;break;case"http://iiif.io/api/image/3/context.json":o.version=3;break;default:e.console.error("Data has a @context property which contains no known IIIF context URI.")}}if(o.preferredFormats){for(var p=0;p<o.preferredFormats.length;p++)if(r.imageFormatSupported(o.preferredFormats[p])){o.tileFormat=o.preferredFormats[p];break}}return o}else{var d=a(o);return d["@context"]="http://iiif.io/api/image/1.0/context.json",d["@id"]=l.replace("/info.xml",""),d.version=1,d}},getTileWidth:function(o){if(this.emulateLegacyImagePyramid)return e.TileSource.prototype.getTileWidth.call(this,o);var l=Math.pow(2,this.maxLevel-o);return this.tileSizePerScaleFactor&&this.tileSizePerScaleFactor[l]?this.tileSizePerScaleFactor[l].width:this._tileWidth},getTileHeight:function(o){if(this.emulateLegacyImagePyramid)return e.TileSource.prototype.getTileHeight.call(this,o);var l=Math.pow(2,this.maxLevel-o);return this.tileSizePerScaleFactor&&this.tileSizePerScaleFactor[l]?this.tileSizePerScaleFactor[l].height:this._tileHeight},getLevelScale:function(o){if(this.emulateLegacyImagePyramid){var l=NaN;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(l=this.levels[o].width/this.levels[this.maxLevel].width),l}return e.TileSource.prototype.getLevelScale.call(this,o)},getNumTiles:function(o){if(this.emulateLegacyImagePyramid){var l=this.getLevelScale(o);return l?new e.Point(1,1):new e.Point(0,0)}if(this.levelSizes){var u=this.levelSizes[o],d=Math.ceil(u.width/this.getTileWidth(o)),h=Math.ceil(u.height/this.getTileHeight(o));return new e.Point(d,h)}else return e.TileSource.prototype.getNumTiles.call(this,o)},getTileAtPoint:function(o,l){if(this.emulateLegacyImagePyramid)return new e.Point(0,0);if(this.levelSizes){var u=l.x>=0&&l.x<=1&&l.y>=0&&l.y<=1/this.aspectRatio;e.console.assert(u,"[TileSource.getTileAtPoint] must be called with a valid point.");var d=this.levelSizes[o].width,h=l.x*d,f=l.y*d,p=Math.floor(h/this.getTileWidth(o)),g=Math.floor(f/this.getTileHeight(o));l.x>=1&&(p=this.getNumTiles(o).x-1);var w=1e-15;return l.y>=1/this.aspectRatio-w&&(g=this.getNumTiles(o).y-1),new e.Point(p,g)}return e.TileSource.prototype.getTileAtPoint.call(this,o,l)},getTileUrl:function(o,l,u){if(this.emulateLegacyImagePyramid){var d=null;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(d=this.levels[o].url),d}var h="0",f=Math.pow(.5,this.maxLevel-o),p,g,w,b,x,j,S,E,R,A,I,H,W,Z,$,X;return this.levelSizes?(p=this.levelSizes[o].width,g=this.levelSizes[o].height):(p=Math.ceil(this.width*f),g=Math.ceil(this.height*f)),w=this.getTileWidth(o),b=this.getTileHeight(o),x=Math.round(w/f),j=Math.round(b/f),this.version===1?$="native."+this.tileFormat:$="default."+this.tileFormat,p<w&&g<b?(this.version===2&&p===this.width?H="full":this.version===3&&p===this.width&&g===this.height?H="max":this.version===3?H=p+","+g:H=p+",",S="full"):(E=l*x,R=u*j,A=Math.min(x,this.width-E),I=Math.min(j,this.height-R),l===0&&u===0&&A===this.width&&I===this.height?S="full":S=[E,R,A,I].join(","),W=Math.min(w,p-l*w),Z=Math.min(b,g-u*b),this.version===2&&W===this.width?H="full":this.version===3&&W===this.width&&Z===this.height?H="max":this.version===3?H=W+","+Z:H=W+","),X=[this._id,S,H,h,$].join("/"),X},__testonly__:{canBeTiled:i,constructLevels:n}});function i(o){var l=["http://library.stanford.edu/iiif/image-api/compliance.html#level0","http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0","http://iiif.io/api/image/2/level0.json","level0","https://iiif.io/api/image/3/level0.json"],u=Array.isArray(o.profile)?o.profile[0]:o.profile,d=l.indexOf(u)!==-1,h=!1;return o.version===2&&o.profile.length>1&&o.profile[1].supports&&(h=o.profile[1].supports.indexOf("sizeByW")!==-1),o.version===3&&o.extraFeatures&&(h=o.extraFeatures.indexOf("sizeByWh")!==-1),!d||h}function n(o){for(var l=[],u=0;u<o.sizes.length;u++)l.push({url:o._id+"/full/"+o.sizes[u].width+","+(o.version===3?o.sizes[u].height:"")+"/0/default."+o.tileFormat,width:o.sizes[u].width,height:o.sizes[u].height});return l.sort(function(d,h){return d.width-h.width})}function a(o){if(!o||!o.documentElement)throw new Error(e.getString("Errors.Xml"));var l=o.documentElement,u=l.tagName,d=null;if(u==="info")try{return d={},c(l,d),d}catch(h){throw h instanceof Error?h:new Error(e.getString("Errors.IIIF"))}throw new Error(e.getString("Errors.IIIF"))}function c(o,l,u){var d,h;if(o.nodeType===3&&u)h=o.nodeValue.trim(),h.match(/^\d*$/)&&(h=Number(h)),l[u]?(e.isArray(l[u])||(l[u]=[l[u]]),l[u].push(h)):l[u]=h;else if(o.nodeType===1)for(d=0;d<o.childNodes.length;d++)c(o.childNodes[d],l,o.nodeName)}}(r),function(e){e.OsmTileSource=function(i,n,a,c,o){var l;e.isPlainObject(i)?l=i:l={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]},(!l.width||!l.height)&&(l.width=65572864,l.height=65572864),l.tileSize||(l.tileSize=256,l.tileOverlap=0),l.tilesUrl||(l.tilesUrl="http://tile.openstreetmap.org/"),l.minLevel=8,e.TileSource.apply(this,[l])},e.extend(e.OsmTileSource.prototype,e.TileSource.prototype,{supports:function(i,n){return i.type&&i.type==="openstreetmaps"},configure:function(i,n,a){return i},getTileUrl:function(i,n,a){return this.tilesUrl+(i-8)+"/"+n+"/"+a+".png"}})}(r),function(e){e.TmsTileSource=function(i,n,a,c,o){var l;e.isPlainObject(i)?l=i:l={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]};var u=Math.ceil(l.width/256)*256,d=Math.ceil(l.height/256)*256,h;u>d?h=u/256:h=d/256,l.maxLevel=Math.ceil(Math.log(h)/Math.log(2))-1,l.tileSize=256,l.width=u,l.height=d,e.TileSource.apply(this,[l])},e.extend(e.TmsTileSource.prototype,e.TileSource.prototype,{supports:function(i,n){return i.type&&i.type==="tiledmapservice"},configure:function(i,n,a){return i},getTileUrl:function(i,n,a){var c=this.getNumTiles(i).y-1;return this.tilesUrl+i+"/"+n+"/"+(c-a)+".png"}})}(r),function(e){e.ZoomifyTileSource=function(i){typeof i.tileSize>"u"&&(i.tileSize=256),typeof i.fileFormat>"u"&&(i.fileFormat="jpg",this.fileFormat=i.fileFormat);var n={x:i.width,y:i.height};for(i.imageSizes=[{x:i.width,y:i.height}],i.gridSize=[this._getGridSize(i.width,i.height,i.tileSize)];parseInt(n.x,10)>i.tileSize||parseInt(n.y,10)>i.tileSize;)n.x=Math.floor(n.x/2),n.y=Math.floor(n.y/2),i.imageSizes.push({x:n.x,y:n.y}),i.gridSize.push(this._getGridSize(n.x,n.y,i.tileSize));i.imageSizes.reverse(),i.gridSize.reverse(),i.minLevel=0,i.maxLevel=i.gridSize.length-1,r.TileSource.apply(this,[i])},e.extend(e.ZoomifyTileSource.prototype,e.TileSource.prototype,{_getGridSize:function(i,n,a){return{x:Math.ceil(i/a),y:Math.ceil(n/a)}},_calculateAbsoluteTileNumber:function(i,n,a){for(var c=0,o={},l=0;l<i;l++)o=this.gridSize[l],c+=o.x*o.y;return o=this.gridSize[i],c+=o.x*a+n,c},supports:function(i,n){return i.type&&i.type==="zoomifytileservice"},configure:function(i,n,a){return i},getTileUrl:function(i,n,a){var c=0,o=this._calculateAbsoluteTileNumber(i,n,a);return c=Math.floor(o/256),this.tilesUrl+"TileGroup"+c+"/"+i+"-"+n+"-"+a+"."+this.fileFormat}})}(r),function(e){e.LegacyTileSource=function(c){var o,l,u;e.isArray(c)&&(o={type:"legacy-image-pyramid",levels:c}),o.levels=i(o.levels),o.levels.length>0?(l=o.levels[o.levels.length-1].width,u=o.levels[o.levels.length-1].height):(l=0,u=0,e.console.error("No supported image formats found")),e.extend(!0,o,{width:l,height:u,tileSize:Math.max(u,l),tileOverlap:0,minLevel:0,maxLevel:o.levels.length>0?o.levels.length-1:0}),e.TileSource.apply(this,[o]),this.levels=o.levels},e.extend(e.LegacyTileSource.prototype,e.TileSource.prototype,{supports:function(c,o){return c.type&&c.type==="legacy-image-pyramid"||c.documentElement&&c.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(c,o,l){var u;return e.isPlainObject(c)?u=a(this,c):u=n(this,c),u},getLevelScale:function(c){var o=NaN;return this.levels.length>0&&c>=this.minLevel&&c<=this.maxLevel&&(o=this.levels[c].width/this.levels[this.maxLevel].width),o},getNumTiles:function(c){var o=this.getLevelScale(c);return o?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(c,o,l){var u=null;return this.levels.length>0&&c>=this.minLevel&&c<=this.maxLevel&&(u=this.levels[c].url),u}});function i(c){var o=[],l,u;for(u=0;u<c.length;u++)l=c[u],l.height&&l.width&&l.url?o.push({url:l.url,width:Number(l.width),height:Number(l.height)}):e.console.error("Unsupported image format: %s",l.url?l.url:"<no URL>");return o.sort(function(d,h){return d.height-h.height})}function n(c,o){if(!o||!o.documentElement)throw new Error(e.getString("Errors.Xml"));var l=o.documentElement,u=l.tagName,d=null,h=[],f,p;if(u==="image")try{for(d={type:l.getAttribute("type"),levels:[]},h=l.getElementsByTagName("level"),p=0;p<h.length;p++)f=h[p],d.levels.push({url:f.getAttribute("url"),width:parseInt(f.getAttribute("width"),10),height:parseInt(f.getAttribute("height"),10)});return a(c,d)}catch(g){throw g instanceof Error?g:new Error("Unknown error parsing Legacy Image Pyramid XML.")}else{if(u==="collection")throw new Error("Legacy Image Pyramid Collections not yet supported.");if(u==="error")throw new Error("Error: "+o)}throw new Error("Unknown element "+u)}function a(c,o){return o.levels}}(r),function(e){e.ImageTileSource=function(i){i=e.extend({buildPyramid:!0,crossOriginPolicy:!1,ajaxWithCredentials:!1,useCanvas:!0},i),e.TileSource.apply(this,[i])},e.extend(e.ImageTileSource.prototype,e.TileSource.prototype,{supports:function(i,n){return i.type&&i.type==="image"},configure:function(i,n,a){return i},getImageInfo:function(i){var n=this._image=new Image,a=this;this.crossOriginPolicy&&(n.crossOrigin=this.crossOriginPolicy),this.ajaxWithCredentials&&(n.useCredentials=this.ajaxWithCredentials),e.addEvent(n,"load",function(){a.width=n.naturalWidth,a.height=n.naturalHeight,a.aspectRatio=a.width/a.height,a.dimensions=new e.Point(a.width,a.height),a._tileWidth=a.width,a._tileHeight=a.height,a.tileOverlap=0,a.minLevel=0,a.levels=a._buildLevels(),a.maxLevel=a.levels.length-1,a.ready=!0,a.raiseEvent("ready",{tileSource:a})}),e.addEvent(n,"error",function(){a.raiseEvent("open-failed",{message:"Error loading image at "+i,source:i})}),n.src=i},getLevelScale:function(i){var n=NaN;return i>=this.minLevel&&i<=this.maxLevel&&(n=this.levels[i].width/this.levels[this.maxLevel].width),n},getNumTiles:function(i){var n=this.getLevelScale(i);return n?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(i,n,a){var c=null;return i>=this.minLevel&&i<=this.maxLevel&&(c=this.levels[i].url),c},getContext2D:function(i,n,a){var c=null;return i>=this.minLevel&&i<=this.maxLevel&&(c=this.levels[i].context2D),c},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var i=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!e.supportsCanvas||!this.useCanvas)return delete this._image,i;var n=this._image.naturalWidth,a=this._image.naturalHeight,c=document.createElement("canvas"),o=c.getContext("2d");if(c.width=n,c.height=a,o.drawImage(this._image,0,0,n,a),i[0].context2D=o,delete this._image,e.isCanvasTainted(c))return i;for(;n>=2&&a>=2;){n=Math.floor(n/2),a=Math.floor(a/2);var l=document.createElement("canvas"),u=l.getContext("2d");l.width=n,l.height=a,u.drawImage(c,0,0,n,a),i.splice(0,0,{context2D:u,width:n,height:a}),c=l,o=u}return i},_freeupCanvasMemory:function(){for(var i=0;i<this.levels.length;i++)this.levels[i].context2D&&(this.levels[i].context2D.canvas.height=0,this.levels[i].context2D.canvas.width=0)}})}(r),function(e){e.TileSourceCollection=function(i,n,a,c){e.console.error("TileSourceCollection is deprecated; use World instead")}}(r),function(e){e.ButtonState={REST:0,GROUP:1,HOVER:2,DOWN:3},e.Button=function(u){var d=this;e.EventSource.call(this),e.extend(!0,this,{tooltip:null,srcRest:null,srcGroup:null,srcHover:null,srcDown:null,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,fadeDelay:0,fadeLength:2e3,onPress:null,onRelease:null,onClick:null,onEnter:null,onExit:null,onFocus:null,onBlur:null,userData:null},u),this.element=u.element||e.makeNeutralElement("div"),u.element||(this.imgRest=e.makeTransparentImage(this.srcRest),this.imgGroup=e.makeTransparentImage(this.srcGroup),this.imgHover=e.makeTransparentImage(this.srcHover),this.imgDown=e.makeTransparentImage(this.srcDown),this.imgRest.alt=this.imgGroup.alt=this.imgHover.alt=this.imgDown.alt=this.tooltip,e.setElementPointerEventsNone(this.imgRest),e.setElementPointerEventsNone(this.imgGroup),e.setElementPointerEventsNone(this.imgHover),e.setElementPointerEventsNone(this.imgDown),this.element.style.position="relative",e.setElementTouchActionNone(this.element),this.imgGroup.style.position=this.imgHover.style.position=this.imgDown.style.position="absolute",this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top="0px",this.imgGroup.style.left=this.imgHover.style.left=this.imgDown.style.left="0px",this.imgHover.style.visibility=this.imgDown.style.visibility="hidden",e.Browser.vendor===e.BROWSERS.FIREFOX&&e.Browser.version<3&&(this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top=""),this.element.appendChild(this.imgRest),this.element.appendChild(this.imgGroup),this.element.appendChild(this.imgHover),this.element.appendChild(this.imgDown)),this.addHandler("press",this.onPress),this.addHandler("release",this.onRelease),this.addHandler("click",this.onClick),this.addHandler("enter",this.onEnter),this.addHandler("exit",this.onExit),this.addHandler("focus",this.onFocus),this.addHandler("blur",this.onBlur),this.currentState=e.ButtonState.GROUP,this.fadeBeginTime=null,this.shouldFade=!1,this.element.style.display="inline-block",this.element.style.position="relative",this.element.title=this.tooltip,this.tracker=new e.MouseTracker({userData:"Button.tracker",element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(h){h.insideElementPressed?(o(d,e.ButtonState.DOWN),d.raiseEvent("enter",{originalEvent:h.originalEvent})):h.buttonDownAny||o(d,e.ButtonState.HOVER)},focusHandler:function(h){d.tracker.enterHandler(h),d.raiseEvent("focus",{originalEvent:h.originalEvent})},leaveHandler:function(h){l(d,e.ButtonState.GROUP),h.insideElementPressed&&d.raiseEvent("exit",{originalEvent:h.originalEvent})},blurHandler:function(h){d.tracker.leaveHandler(h),d.raiseEvent("blur",{originalEvent:h.originalEvent})},pressHandler:function(h){o(d,e.ButtonState.DOWN),d.raiseEvent("press",{originalEvent:h.originalEvent})},releaseHandler:function(h){h.insideElementPressed&&h.insideElementReleased?(l(d,e.ButtonState.HOVER),d.raiseEvent("release",{originalEvent:h.originalEvent})):h.insideElementPressed?l(d,e.ButtonState.GROUP):o(d,e.ButtonState.HOVER)},clickHandler:function(h){h.quick&&d.raiseEvent("click",{originalEvent:h.originalEvent})},keyHandler:function(h){h.keyCode===13?(d.raiseEvent("click",{originalEvent:h.originalEvent}),d.raiseEvent("release",{originalEvent:h.originalEvent}),h.preventDefault=!0):h.preventDefault=!1}}),l(this,e.ButtonState.REST)},e.extend(e.Button.prototype,e.EventSource.prototype,{notifyGroupEnter:function(){o(this,e.ButtonState.GROUP)},notifyGroupExit:function(){l(this,e.ButtonState.REST)},disable:function(){this.notifyGroupExit(),this.element.disabled=!0,this.tracker.setTracking(!1),e.setElementOpacity(this.element,.2,!0)},enable:function(){this.element.disabled=!1,this.tracker.setTracking(!0),e.setElementOpacity(this.element,1,!0),this.notifyGroupEnter()},destroy:function(){this.imgRest&&(this.element.removeChild(this.imgRest),this.imgRest=null),this.imgGroup&&(this.element.removeChild(this.imgGroup),this.imgGroup=null),this.imgHover&&(this.element.removeChild(this.imgHover),this.imgHover=null),this.imgDown&&(this.element.removeChild(this.imgDown),this.imgDown=null),this.removeAllHandlers(),this.tracker.destroy(),this.element=null}});function i(u){e.requestAnimationFrame(function(){n(u)})}function n(u){var d,h,f;u.shouldFade&&(d=e.now(),h=d-u.fadeBeginTime,f=1-h/u.fadeLength,f=Math.min(1,f),f=Math.max(0,f),u.imgGroup&&e.setElementOpacity(u.imgGroup,f,!0),f>0&&i(u))}function a(u){u.shouldFade=!0,u.fadeBeginTime=e.now()+u.fadeDelay,window.setTimeout(function(){i(u)},u.fadeDelay)}function c(u){u.shouldFade=!1,u.imgGroup&&e.setElementOpacity(u.imgGroup,1,!0)}function o(u,d){u.element.disabled||(d>=e.ButtonState.GROUP&&u.currentState===e.ButtonState.REST&&(c(u),u.currentState=e.ButtonState.GROUP),d>=e.ButtonState.HOVER&&u.currentState===e.ButtonState.GROUP&&(u.imgHover&&(u.imgHover.style.visibility=""),u.currentState=e.ButtonState.HOVER),d>=e.ButtonState.DOWN&&u.currentState===e.ButtonState.HOVER&&(u.imgDown&&(u.imgDown.style.visibility=""),u.currentState=e.ButtonState.DOWN))}function l(u,d){u.element.disabled||(d<=e.ButtonState.HOVER&&u.currentState===e.ButtonState.DOWN&&(u.imgDown&&(u.imgDown.style.visibility="hidden"),u.currentState=e.ButtonState.HOVER),d<=e.ButtonState.GROUP&&u.currentState===e.ButtonState.HOVER&&(u.imgHover&&(u.imgHover.style.visibility="hidden"),u.currentState=e.ButtonState.GROUP),d<=e.ButtonState.REST&&u.currentState===e.ButtonState.GROUP&&(a(u),u.currentState=e.ButtonState.REST))}}(r),function(e){e.ButtonGroup=function(i){e.extend(!0,this,{buttons:[],clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},i);var n=this.buttons.concat([]),a=this,c;if(this.element=i.element||e.makeNeutralElement("div"),!i.group)for(this.element.style.display="inline-block",c=0;c<n.length;c++)this.element.appendChild(n[c].element);e.setElementTouchActionNone(this.element),this.tracker=new e.MouseTracker({userData:"ButtonGroup.tracker",element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(o){var l;for(l=0;l<a.buttons.length;l++)a.buttons[l].notifyGroupEnter()},leaveHandler:function(o){var l;if(!o.insideElementPressed)for(l=0;l<a.buttons.length;l++)a.buttons[l].notifyGroupExit()}})},e.ButtonGroup.prototype={addButton:function(i){this.buttons.push(i),this.element.appendChild(i.element)},emulateEnter:function(){this.tracker.enterHandler({eventSource:this.tracker})},emulateLeave:function(){this.tracker.leaveHandler({eventSource:this.tracker})},destroy:function(){for(;this.buttons.length;){var i=this.buttons.pop();this.element.removeChild(i.element),i.destroy()}this.tracker.destroy(),this.element=null}}}(r),function(e){e.Rect=function(i,n,a,c,o){this.x=typeof i=="number"?i:0,this.y=typeof n=="number"?n:0,this.width=typeof a=="number"?a:0,this.height=typeof c=="number"?c:0,this.degrees=typeof o=="number"?o:0,this.degrees=e.positiveModulo(this.degrees,360);var l,u;this.degrees>=270?(l=this.getTopRight(),this.x=l.x,this.y=l.y,u=this.height,this.height=this.width,this.width=u,this.degrees-=270):this.degrees>=180?(l=this.getBottomRight(),this.x=l.x,this.y=l.y,this.degrees-=180):this.degrees>=90&&(l=this.getBottomLeft(),this.x=l.x,this.y=l.y,u=this.height,this.height=this.width,this.width=u,this.degrees-=90)},e.Rect.fromSummits=function(i,n,a){var c=i.distanceTo(n),o=i.distanceTo(a),l=n.minus(i),u=Math.atan(l.y/l.x);return l.x<0?u+=Math.PI:l.y<0&&(u+=2*Math.PI),new e.Rect(i.x,i.y,c,o,u/Math.PI*180)},e.Rect.prototype={clone:function(){return new e.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new e.Point(this.x,this.y)},getBottomRight:function(){return new e.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new e.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new e.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new e.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new e.Point(this.width,this.height)},equals:function(i){return i instanceof e.Rect&&this.x===i.x&&this.y===i.y&&this.width===i.width&&this.height===i.height&&this.degrees===i.degrees},times:function(i){return new e.Rect(this.x*i,this.y*i,this.width*i,this.height*i,this.degrees)},translate:function(i){return new e.Rect(this.x+i.x,this.y+i.y,this.width,this.height,this.degrees)},union:function(i){var n=this.getBoundingBox(),a=i.getBoundingBox(),c=Math.min(n.x,a.x),o=Math.min(n.y,a.y),l=Math.max(n.x+n.width,a.x+a.width),u=Math.max(n.y+n.height,a.y+a.height);return new e.Rect(c,o,l-c,u-o)},intersection:function(i){var n=1e-10,a=[],c=this.getTopLeft();i.containsPoint(c,n)&&a.push(c);var o=this.getTopRight();i.containsPoint(o,n)&&a.push(o);var l=this.getBottomLeft();i.containsPoint(l,n)&&a.push(l);var u=this.getBottomRight();i.containsPoint(u,n)&&a.push(u);var d=i.getTopLeft();this.containsPoint(d,n)&&a.push(d);var h=i.getTopRight();this.containsPoint(h,n)&&a.push(h);var f=i.getBottomLeft();this.containsPoint(f,n)&&a.push(f);var p=i.getBottomRight();this.containsPoint(p,n)&&a.push(p);for(var g=this._getSegments(),w=i._getSegments(),b=0;b<g.length;b++)for(var x=g[b],j=0;j<w.length;j++){var S=w[j],E=R(x[0],x[1],S[0],S[1]);E&&a.push(E)}function R(X,ee,P,k){var O=ee.minus(X),z=k.minus(P),D=-z.x*O.y+O.x*z.y;if(D===0)return null;var M=(O.x*(X.y-P.y)-O.y*(X.x-P.x))/D,B=(z.x*(X.y-P.y)-z.y*(X.x-P.x))/D;return-n<=M&&M<=1-n&&-n<=B&&B<=1-n?new e.Point(X.x+B*O.x,X.y+B*O.y):null}if(a.length===0)return null;for(var A=a[0].x,I=a[0].x,H=a[0].y,W=a[0].y,Z=1;Z<a.length;Z++){var $=a[Z];$.x<A&&(A=$.x),$.x>I&&(I=$.x),$.y<H&&(H=$.y),$.y>W&&(W=$.y)}return new e.Rect(A,H,I-A,W-H)},_getSegments:function(){var i=this.getTopLeft(),n=this.getTopRight(),a=this.getBottomLeft(),c=this.getBottomRight();return[[i,n],[n,c],[c,a],[a,i]]},rotate:function(i,n){if(i=e.positiveModulo(i,360),i===0)return this.clone();n=n||this.getCenter();var a=this.getTopLeft().rotate(i,n),c=this.getTopRight().rotate(i,n),o=c.minus(a);o=o.apply(function(u){var d=1e-15;return Math.abs(u)<d?0:u});var l=Math.atan(o.y/o.x);return o.x<0?l+=Math.PI:o.y<0&&(l+=2*Math.PI),new e.Rect(a.x,a.y,this.width,this.height,l/Math.PI*180)},getBoundingBox:function(){if(this.degrees===0)return this.clone();var i=this.getTopLeft(),n=this.getTopRight(),a=this.getBottomLeft(),c=this.getBottomRight(),o=Math.min(i.x,n.x,a.x,c.x),l=Math.max(i.x,n.x,a.x,c.x),u=Math.min(i.y,n.y,a.y,c.y),d=Math.max(i.y,n.y,a.y,c.y);return new e.Rect(o,u,l-o,d-u)},getIntegerBoundingBox:function(){var i=this.getBoundingBox(),n=Math.floor(i.x),a=Math.floor(i.y),c=Math.ceil(i.width+i.x-n),o=Math.ceil(i.height+i.y-a);return new e.Rect(n,a,c,o)},containsPoint:function(i,n){n=n||0;var a=this.getTopLeft(),c=this.getTopRight(),o=this.getBottomLeft(),l=c.minus(a),u=o.minus(a);return(i.x-a.x)*l.x+(i.y-a.y)*l.y>=-n&&(i.x-c.x)*l.x+(i.y-c.y)*l.y<=n&&(i.x-a.x)*u.x+(i.y-a.y)*u.y>=-n&&(i.x-o.x)*u.x+(i.y-o.y)*u.y<=n},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(r),function(e){var i={};e.ReferenceStrip=function(f){var p=this,g=f.viewer,w=e.getElementSize(g.element),b,x,j;for(f.id||(f.id="referencestrip-"+e.now(),this.element=e.makeNeutralElement("div"),this.element.id=f.id,this.element.className="referencestrip"),f=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.referenceStripSizeRatio,position:e.DEFAULT_SETTINGS.referenceStripPosition,scroll:e.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold},f,{element:this.element}),e.extend(this,f),i[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,x=this.element.style,x.marginTop="0px",x.marginRight="0px",x.marginBottom="0px",x.marginLeft="0px",x.left="0px",x.bottom="0px",x.border="0px",x.background="#000",x.position="relative",e.setElementTouchActionNone(this.element),e.setElementOpacity(this.element,.8),this.viewer=g,this.tracker=new e.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:e.delegate(this,n),dragHandler:e.delegate(this,a),scrollHandler:e.delegate(this,c),enterHandler:e.delegate(this,l),leaveHandler:e.delegate(this,u),keyDownHandler:e.delegate(this,d),keyHandler:e.delegate(this,h),preProcessEventHandler:function(S){S.eventType==="wheel"&&(S.preventDefault=!0)}}),f.width&&f.height?(this.element.style.width=f.width+"px",this.element.style.height=f.height+"px",g.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):f.scroll==="horizontal"?(this.element.style.width=w.x*f.sizeRatio*g.tileSources.length+12*g.tileSources.length+"px",this.element.style.height=w.y*f.sizeRatio+"px",g.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=w.y*f.sizeRatio*g.tileSources.length+12*g.tileSources.length+"px",this.element.style.width=w.x*f.sizeRatio+"px",g.addControl(this.element,{anchor:e.ControlAnchor.TOP_LEFT})),this.panelWidth=w.x*this.sizeRatio+8,this.panelHeight=w.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},j=0;j<g.tileSources.length;j++)b=e.makeNeutralElement("div"),b.id=this.element.id+"-"+j,b.style.width=p.panelWidth+"px",b.style.height=p.panelHeight+"px",b.style.display="inline",b.style.float="left",b.style.cssFloat="left",b.style.styleFloat="left",b.style.padding="2px",e.setElementTouchActionNone(b),e.setElementPointerEventsNone(b),this.element.appendChild(b),b.activePanel=!1,this.panels.push(b);o(this,this.scroll==="vertical"?w.y:w.x,0),this.setFocus(0)},e.ReferenceStrip.prototype={setFocus:function(f){var p=this.element.querySelector("#"+this.element.id+"-"+f),g=e.getElementSize(this.viewer.canvas),w=Number(this.element.style.width.replace("px","")),b=Number(this.element.style.height.replace("px","")),x=-Number(this.element.style.marginLeft.replace("px","")),j=-Number(this.element.style.marginTop.replace("px","")),S;this.currentSelected!==p&&(this.currentSelected&&(this.currentSelected.style.background="#000"),this.currentSelected=p,this.currentSelected.style.background="#999",this.scroll==="horizontal"?(S=Number(f)*(this.panelWidth+3),S>x+g.x-this.panelWidth?(S=Math.min(S,w-g.x),this.element.style.marginLeft=-S+"px",o(this,g.x,-S)):S<x&&(S=Math.max(0,S-g.x/2),this.element.style.marginLeft=-S+"px",o(this,g.x,-S))):(S=Number(f)*(this.panelHeight+3),S>j+g.y-this.panelHeight?(S=Math.min(S,b-g.y),this.element.style.marginTop=-S+"px",o(this,g.y,-S)):S<j&&(S=Math.max(0,S-g.y/2),this.element.style.marginTop=-S+"px",o(this,g.y,-S))),this.currentPage=f,l.call(this,{eventSource:this.tracker}))},update:function(){return!!i[this.id].animating},destroy:function(){if(this.miniViewers)for(var f in this.miniViewers)this.miniViewers[f].destroy();this.tracker.destroy(),this.element&&this.viewer.removeControl(this.element)}};function n(f){if(f.quick){var p;this.scroll==="horizontal"?p=Math.floor(f.position.x/(this.panelWidth+4)):p=Math.floor(f.position.y/this.panelHeight),this.viewer.goToPage(p)}this.element.focus()}function a(f){if(this.dragging=!0,this.element){var p=Number(this.element.style.marginLeft.replace("px","")),g=Number(this.element.style.marginTop.replace("px","")),w=Number(this.element.style.width.replace("px","")),b=Number(this.element.style.height.replace("px","")),x=e.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?-f.delta.x>0?p>-(w-x.x)&&(this.element.style.marginLeft=p+f.delta.x*2+"px",o(this,x.x,p+f.delta.x*2)):-f.delta.x<0&&p<0&&(this.element.style.marginLeft=p+f.delta.x*2+"px",o(this,x.x,p+f.delta.x*2)):-f.delta.y>0?g>-(b-x.y)&&(this.element.style.marginTop=g+f.delta.y*2+"px",o(this,x.y,g+f.delta.y*2)):-f.delta.y<0&&g<0&&(this.element.style.marginTop=g+f.delta.y*2+"px",o(this,x.y,g+f.delta.y*2))}}function c(f){if(this.element){var p=Number(this.element.style.marginLeft.replace("px","")),g=Number(this.element.style.marginTop.replace("px","")),w=Number(this.element.style.width.replace("px","")),b=Number(this.element.style.height.replace("px","")),x=e.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?f.scroll>0?p>-(w-x.x)&&(this.element.style.marginLeft=p-f.scroll*60+"px",o(this,x.x,p-f.scroll*60)):f.scroll<0&&p<0&&(this.element.style.marginLeft=p-f.scroll*60+"px",o(this,x.x,p-f.scroll*60)):f.scroll<0?g>x.y-b&&(this.element.style.marginTop=g+f.scroll*60+"px",o(this,x.y,g+f.scroll*60)):f.scroll>0&&g<0&&(this.element.style.marginTop=g+f.scroll*60+"px",o(this,x.y,g+f.scroll*60)),f.preventDefault=!0}}function o(f,p,g){var w,b,x,j,S,E;for(f.scroll==="horizontal"?w=f.panelWidth:w=f.panelHeight,b=Math.ceil(p/w)+5,x=Math.ceil((Math.abs(g)+p)/w)+1,b=x-b,b=b<0?0:b,S=b;S<x&&S<f.panels.length;S++)if(E=f.panels[S],!E.activePanel){var R,A=f.viewer.tileSources[S];A.referenceStripThumbnailUrl?R={type:"image",url:A.referenceStripThumbnailUrl}:R=A,j=new e.Viewer({id:E.id,tileSources:[R],element:E,navigatorSizeRatio:f.sizeRatio,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,loadTilesWithAjax:f.viewer.loadTilesWithAjax,ajaxHeaders:f.viewer.ajaxHeaders,useCanvas:f.useCanvas}),e.setElementPointerEventsNone(j.canvas),e.setElementPointerEventsNone(j.container),j.innerTracker.setTracking(!1),j.outerTracker.setTracking(!1),f.miniViewers[E.id]=j,E.activePanel=!0}}function l(f){var p=f.eventSource.element;this.scroll==="horizontal"?p.style.marginBottom="0px":p.style.marginLeft="0px"}function u(f){var p=f.eventSource.element;this.scroll==="horizontal"?p.style.marginBottom="-"+e.getElementSize(p).y/2+"px":p.style.marginLeft="-"+e.getElementSize(p).x/2+"px"}function d(f){if(!f.ctrl&&!f.alt&&!f.meta)switch(f.keyCode){case 38:c.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;case 40:c.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 37:c.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 39:c.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;default:f.preventDefault=!1;break}else f.preventDefault=!1}function h(f){if(!f.ctrl&&!f.alt&&!f.meta)switch(f.keyCode){case 61:c.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;case 45:c.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 48:case 119:case 87:c.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;case 115:case 83:c.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 97:c.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 100:c.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;default:f.preventDefault=!1;break}else f.preventDefault=!1}}(r),function(e){e.DisplayRect=function(i,n,a,c,o,l){e.Rect.apply(this,[i,n,a,c]),this.minLevel=o,this.maxLevel=l},e.extend(e.DisplayRect.prototype,e.Rect.prototype)}(r),function(e){e.Spring=function(n){var a=arguments;typeof n!="object"&&(n={initial:a.length&&typeof a[0]=="number"?a[0]:void 0,springStiffness:a.length>1?a[1].springStiffness:5,animationTime:a.length>1?a[1].animationTime:1.5}),e.console.assert(typeof n.springStiffness=="number"&&n.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),e.console.assert(typeof n.animationTime=="number"&&n.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),n.exponential&&(this._exponential=!0,delete n.exponential),e.extend(!0,this,n),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:e.now()},e.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},e.Spring.prototype={resetTo:function(n){e.console.assert(!this._exponential||n!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=n,this.start.time=this.target.time=this.current.time=e.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(n){e.console.assert(!this._exponential||n!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=n,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(n){this.start.value+=n,this.target.value+=n,this._exponential&&(e.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(n){this._exponential=n,this._exponential&&(e.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=e.now();var n,a;this._exponential?(n=this.start._logValue,a=this.target._logValue):(n=this.start.value,a=this.target.value);var c=this.current.time>=this.target.time?a:n+(a-n)*i(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),o=this.current.value;return this._exponential?this.current.value=Math.exp(c):this.current.value=c,o!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function i(n,a){return(1-Math.exp(n*-a))/(1-Math.exp(-n))}}(r),function(e){e.ImageJob=function(n){e.extend(!0,this,{timeout:e.DEFAULT_SETTINGS.timeout,jobId:null,tries:0},n),this.data=null,this.userData={},this.errorMsg=null},e.ImageJob.prototype={start:function(){this.tries++;var n=this,a=this.abort;this.jobId=window.setTimeout(function(){n.finish(null,null,"Image load exceeded timeout ("+n.timeout+" ms)")},this.timeout),this.abort=function(){n.source.downloadTileAbort(n),typeof a=="function"&&a()},this.source.downloadTileStart(this)},finish:function(n,a,c){this.data=n,this.request=a,this.errorMsg=c,this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},e.ImageLoader=function(n){e.extend(!0,this,{jobLimit:e.DEFAULT_SETTINGS.imageLoaderLimit,timeout:e.DEFAULT_SETTINGS.timeout,jobQueue:[],failedTiles:[],jobsInProgress:0},n)},e.ImageLoader.prototype={addJob:function(n){if(!n.source){e.console.error("ImageLoader.prototype.addJob() requires [options.source]. TileSource since new API defines how images are fetched. Creating a dummy TileSource.");var a=e.TileSource.prototype;n.source={downloadTileStart:a.downloadTileStart,downloadTileAbort:a.downloadTileAbort}}var c=this,o=function(d){i(c,d,n.callback)},l={src:n.src,tile:n.tile||{},source:n.source,loadWithAjax:n.loadWithAjax,ajaxHeaders:n.loadWithAjax?n.ajaxHeaders:null,crossOriginPolicy:n.crossOriginPolicy,ajaxWithCredentials:n.ajaxWithCredentials,postData:n.postData,callback:o,abort:n.abort,timeout:this.timeout},u=new e.ImageJob(l);!this.jobLimit||this.jobsInProgress<this.jobLimit?(u.start(),this.jobsInProgress++):this.jobQueue.push(u)},clear:function(){for(var n=0;n<this.jobQueue.length;n++){var a=this.jobQueue[n];typeof a.abort=="function"&&a.abort()}this.jobQueue=[]}};function i(n,a,c){a.errorMsg!==""&&(a.data===null||a.data===void 0)&&a.tries<1+n.tileRetryMax&&n.failedTiles.push(a);var o;n.jobsInProgress--,(!n.jobLimit||n.jobsInProgress<n.jobLimit)&&n.jobQueue.length>0&&(o=n.jobQueue.shift(),o.start(),n.jobsInProgress++),n.tileRetryMax>0&&n.jobQueue.length===0&&(!n.jobLimit||n.jobsInProgress<n.jobLimit)&&n.failedTiles.length>0&&(o=n.failedTiles.shift(),setTimeout(function(){o.start()},n.tileRetryDelay),n.jobsInProgress++),c(a.data,a.errorMsg,a.request)}}(r),function(e){e.Tile=function(i,n,a,c,o,l,u,d,h,f,p,g){this.level=i,this.x=n,this.y=a,this.bounds=c,this.sourceBounds=f,this.exists=o,this._url=l,this.postData=p,this.context2D=u,this.loadWithAjax=d,this.ajaxHeaders=h,g===void 0&&(e.console.warn("Tile constructor needs 'cacheKey' variable: creation tile cache in Tile class is deprecated. TileSource.prototype.getTileHashKey will be used."),g=e.TileSource.prototype.getTileHashKey(i,n,a,l,h,p)),this.cacheKey=g,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.hasTransparency=!1,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},e.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return console.warn("Tile.prototype._hasTransparencyChannel() has been deprecated and will be removed in the future. Use TileSource.prototype.hasTransparency() instead."),!!this.context2D||this.getUrl().match(".png")},drawHTML:function(i){if(!this.cacheImageRecord){e.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}if(!this.element){var n=this.getImage();if(!n)return;this.element=e.makeNeutralElement("div"),this.imgElement=n.cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"}this.element.parentNode!==i&&i.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),e.setElementOpacity(this.element,this.opacity)},get image(){return e.console.error("[Tile.image] property has been deprecated. Use [Tile.prototype.getImage] instead."),this.getImage()},get url(){return e.console.error("[Tile.url] property has been deprecated. Use [Tile.prototype.getUrl] instead."),this.getUrl()},getImage:function(){return this.cacheImageRecord.getImage()},getUrl:function(){return typeof this._url=="function"?this._url():this._url},getCanvasContext:function(){return this.context2D||this.cacheImageRecord.getRenderedContext()},drawCanvas:function(i,n,a,c,o,l){var u=this.position.times(e.pixelDensityRatio),d=this.size.times(e.pixelDensityRatio),h;if(!this.context2D&&!this.cacheImageRecord){e.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(h=this.getCanvasContext(),!this.loaded||!h){e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}i.save(),i.globalAlpha=this.opacity,typeof a=="number"&&a!==1&&(u=u.times(a),d=d.times(a)),c instanceof e.Point&&(u=u.plus(c)),i.globalAlpha===1&&this.hasTransparency&&(o&&(u.x=Math.round(u.x),u.y=Math.round(u.y),d.x=Math.round(d.x),d.y=Math.round(d.y)),i.clearRect(u.x,u.y,d.x,d.y)),n({context:i,tile:this,rendered:h});var f,p;this.sourceBounds?(f=Math.min(this.sourceBounds.width,h.canvas.width),p=Math.min(this.sourceBounds.height,h.canvas.height)):(f=h.canvas.width,p=h.canvas.height),i.translate(u.x+d.x/2,0),this.flipped&&i.scale(-1,1),i.drawImage(h.canvas,0,0,f,p,-d.x/2,u.y,d.x,d.y),i.restore()},getScaleForEdgeSmoothing:function(){var i;if(this.cacheImageRecord)i=this.cacheImageRecord.getRenderedContext();else if(this.context2D)i=this.context2D;else return e.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return i.canvas.width/(this.size.x*e.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(i,n,a){var c=Math.max(1,Math.ceil((a.x-n.x)/2)),o=Math.max(1,Math.ceil((a.y-n.y)/2));return new e.Point(c,o).minus(this.position.times(e.pixelDensityRatio).times(i||1).apply(function(l){return l%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(r),function(e){e.OverlayPlacement=e.Placement,e.OverlayRotationMode=e.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),e.Overlay=function(i,n,a){var c;e.isPlainObject(i)?c=i:c={element:i,location:n,placement:a},this.element=c.element,this.style=c.element.style,this._init(c)},e.Overlay.prototype={_init:function(i){this.location=i.location,this.placement=i.placement===void 0?e.Placement.TOP_LEFT:i.placement,this.onDraw=i.onDraw,this.checkResize=i.checkResize===void 0?!0:i.checkResize,this.width=i.width===void 0?null:i.width,this.height=i.height===void 0?null:i.height,this.rotationMode=i.rotationMode||e.OverlayRotationMode.EXACT,this.location instanceof e.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=e.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new e.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(i,n){var a=e.Placement.properties[this.placement];a&&(a.isHorizontallyCentered?i.x-=n.x/2:a.isRight&&(i.x-=n.x),a.isVerticallyCentered?i.y-=n.y/2:a.isBottom&&(i.y-=n.y))},destroy:function(){var i=this.element,n=this.style;i.parentNode&&(i.parentNode.removeChild(i),i.prevElementParent&&(n.display="none",document.body.appendChild(i))),this.onDraw=null,n.top="",n.left="",n.position="",this.width!==null&&(n.width=""),this.height!==null&&(n.height="");var a=e.getCssPropertyWithVendorPrefix("transformOrigin"),c=e.getCssPropertyWithVendorPrefix("transform");a&&c&&(n[a]="",n[c]="")},drawHTML:function(i,n){var a=this.element;a.parentNode!==i&&(a.prevElementParent=a.parentNode,a.prevNextSibling=a.nextSibling,i.appendChild(a),this.style.position="absolute",this.size=e.getElementSize(a));var c=this._getOverlayPositionAndSize(n),o=c.position,l=this.size=c.size,u=c.rotate;if(this.onDraw)this.onDraw(o,l,this.element);else{var d=this.style;d.left=o.x+"px",d.top=o.y+"px",this.width!==null&&(d.width=l.x+"px"),this.height!==null&&(d.height=l.y+"px");var h=e.getCssPropertyWithVendorPrefix("transformOrigin"),f=e.getCssPropertyWithVendorPrefix("transform");h&&f&&(u?(d[h]=this._getTransformOrigin(),d[f]="rotate("+u+"deg)"):(d[h]="",d[f]="")),d.display="block"}},_getOverlayPositionAndSize:function(i){var n=i.pixelFromPoint(this.location,!0),a=this._getSizeInPixels(i);this.adjust(n,a);var c=0;if(i.getRotation(!0)&&this.rotationMode!==e.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var o=new e.Rect(n.x,n.y,a.x,a.y),l=this._getBoundingBox(o,i.getRotation(!0));n=l.getTopLeft(),a=l.getSize()}else c=i.getRotation(!0);return{position:n,size:a,rotate:c}},_getSizeInPixels:function(i){var n=this.size.x,a=this.size.y;if(this.width!==null||this.height!==null){var c=i.deltaPixelsFromPointsNoRotate(new e.Point(this.width||0,this.height||0),!0);this.width!==null&&(n=c.x),this.height!==null&&(a=c.y)}if(this.checkResize&&(this.width===null||this.height===null)){var o=this.size=e.getElementSize(this.element);this.width===null&&(n=o.x),this.height===null&&(a=o.y)}return new e.Point(n,a)},_getBoundingBox:function(i,n){var a=this._getPlacementPoint(i);return i.rotate(n,a).getBoundingBox()},_getPlacementPoint:function(i){var n=new e.Point(i.x,i.y),a=e.Placement.properties[this.placement];return a&&(a.isHorizontallyCentered?n.x+=i.width/2:a.isRight&&(n.x+=i.width),a.isVerticallyCentered?n.y+=i.height/2:a.isBottom&&(n.y+=i.height)),n},_getTransformOrigin:function(){var i="",n=e.Placement.properties[this.placement];return n&&(n.isLeft?i="left":n.isRight&&(i="right"),n.isTop?i+=" top":n.isBottom&&(i+=" bottom")),i},update:function(i,n){var a=e.isPlainObject(i)?i:{location:i,placement:n};this._init({location:a.location||this.location,placement:a.placement!==void 0?a.placement:this.placement,onDraw:a.onDraw||this.onDraw,checkResize:a.checkResize||this.checkResize,width:a.width!==void 0?a.width:this.width,height:a.height!==void 0?a.height:this.height,rotationMode:a.rotationMode||this.rotationMode})},getBounds:function(i){e.console.assert(i,"A viewport must now be passed to Overlay.getBounds.");var n=this.width,a=this.height;if(n===null||a===null){var c=i.deltaPointsFromPixelsNoRotate(this.size,!0);n===null&&(n=c.x),a===null&&(a=c.y)}var o=this.location.clone();return this.adjust(o,new e.Point(n,a)),this._adjustBoundsForRotation(i,new e.Rect(o.x,o.y,n,a))},_adjustBoundsForRotation:function(i,n){if(!i||i.getRotation(!0)===0||this.rotationMode===e.OverlayRotationMode.EXACT)return n;if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return n;var a=this._getOverlayPositionAndSize(i);return i.viewerElementToViewportRectangle(new e.Rect(a.position.x,a.position.y,a.size.x,a.size.y))}return n.rotate(-i.getRotation(!0),this._getPlacementPoint(n))}}}(r),function(e){e.Drawer=function(i){e.console.assert(i.viewer,"[Drawer] options.viewer is required");var n=arguments;if(e.isPlainObject(i)||(i={source:n[0],viewport:n[1],element:n[2]}),e.console.assert(i.viewport,"[Drawer] options.viewport is required"),e.console.assert(i.element,"[Drawer] options.element is required"),i.source&&e.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=i.viewer,this.viewport=i.viewport,this.debugGridColor=typeof i.debugGridColor=="string"?[i.debugGridColor]:i.debugGridColor||e.DEFAULT_SETTINGS.debugGridColor,i.opacity&&e.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=e.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=e.getElement(i.element),this.canvas=e.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var a=this._calculateCanvasSize();this.canvas.width=a.x,this.canvas.height=a.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",e.setElementOpacity(this.canvas,this.opacity,!0),e.setElementPointerEventsNone(this.canvas),e.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},e.Drawer.prototype={addOverlay:function(i,n,a,c){return e.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(i,n,a,c),this},updateOverlay:function(i,n,a){return e.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(i,n,a),this},removeOverlay:function(i){return e.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(i),this},clearOverlays:function(){return e.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(i){var n=this.viewport.pixelFromPointNoRotate(i,!0);return new e.Point(n.x*e.pixelDensityRatio,n.y*e.pixelDensityRatio)},clipWithPolygons:function(i,n){if(this.useCanvas){var a=this._getContext(n);
351a.beginPath(),i.forEach(function(c){c.forEach(function(o,l){a[l===0?"moveTo":"lineTo"](o.x,o.y)})}),a.clip()}},setOpacity:function(i){e.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var n=this.viewer.world,a=0;a<n.getItemCount();a++)n.getItemAt(a).setOpacity(i);return this},getOpacity:function(){e.console.error("drawer.getOpacity is deprecated. Use tiledImage.getOpacity instead.");for(var i=this.viewer.world,n=0,a=0;a<i.getItemCount();a++){var c=i.getItemAt(a).getOpacity();c>n&&(n=c)}return n},needsUpdate:function(){return e.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return e.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return e.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return e.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var i=this._calculateCanvasSize();if((this.canvas.width!==i.x||this.canvas.height!==i.y)&&(this.canvas.width=i.x,this.canvas.height=i.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var n=this._calculateSketchCanvasSize();this.sketchCanvas.width=n.x,this.sketchCanvas.height=n.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(i,n){if(this.useCanvas){var a=this._getContext(i);if(n)a.clearRect(n.x,n.y,n.width,n.height);else{var c=a.canvas;a.clearRect(0,0,c.width,c.height)}}},viewportToDrawerRectangle:function(i){var n=this.viewport.pixelFromPointNoRotate(i.getTopLeft(),!0),a=this.viewport.deltaPixelsFromPointsNoRotate(i.getSize(),!0);return new e.Rect(n.x*e.pixelDensityRatio,n.y*e.pixelDensityRatio,a.x*e.pixelDensityRatio,a.y*e.pixelDensityRatio)},drawTile:function(i,n,a,c,o,l,u){if(e.console.assert(i,"[Drawer.drawTile] tile is required"),e.console.assert(n,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var d=this._getContext(a);c=c||1,i.drawCanvas(d,n,c,o,l,u)}else i.drawHTML(this.canvas)},_getContext:function(i){var n=this.context;if(i){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var a=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=a.x,this.sketchCanvas.height=a.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var c=this;this.viewer.addHandler("rotate",function o(){if(c.viewport.getRotation()!==0){c.viewer.removeHandler("rotate",o);var l=c._calculateSketchCanvasSize();c.sketchCanvas.width=l.x,c.sketchCanvas.height=l.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}n=this.sketchContext}return n},saveContext:function(i){this.useCanvas&&this._getContext(i).save()},restoreContext:function(i){this.useCanvas&&this._getContext(i).restore()},setClip:function(i,n){if(this.useCanvas){var a=this._getContext(n);a.beginPath(),a.rect(i.x,i.y,i.width,i.height),a.clip()}},drawRectangle:function(i,n,a){if(this.useCanvas){var c=this._getContext(a);c.save(),c.fillStyle=n,c.fillRect(i.x,i.y,i.width,i.height),c.restore()}},blendSketch:function(i,n,a,c){var o=i;if(e.isPlainObject(o)||(o={opacity:i,scale:n,translate:a,compositeOperation:c}),!(!this.useCanvas||!this.sketchCanvas)){i=o.opacity,c=o.compositeOperation;var l=o.bounds;if(this.context.save(),this.context.globalAlpha=i,c&&(this.context.globalCompositeOperation=c),l)l.x<0&&(l.width+=l.x,l.x=0),l.x+l.width>this.canvas.width&&(l.width=this.canvas.width-l.x),l.y<0&&(l.height+=l.y,l.y=0),l.y+l.height>this.canvas.height&&(l.height=this.canvas.height-l.y),this.context.drawImage(this.sketchCanvas,l.x,l.y,l.width,l.height,l.x,l.y,l.width,l.height);else{n=o.scale||1,a=o.translate;var u=a instanceof e.Point?a:new e.Point(0,0),d=0,h=0;if(a){var f=this.sketchCanvas.width-this.canvas.width,p=this.sketchCanvas.height-this.canvas.height;d=Math.round(f/2),h=Math.round(p/2)}this.context.drawImage(this.sketchCanvas,u.x-d*n,u.y-h*n,(this.canvas.width+2*d)*n,(this.canvas.height+2*h)*n,-d,-h,this.canvas.width+2*d,this.canvas.height+2*h)}
351this.context.restore()}},drawDebugInfo:function(i,n,a,c){if(this.useCanvas){var o=this.viewer.world.getIndexOfItem(c)%this.debugGridColor.length,l=this.context;l.save(),l.lineWidth=2*e.pixelDensityRatio,l.font="small-caps bold "+13*e.pixelDensityRatio+"px arial",l.strokeStyle=this.debugGridColor[o],l.fillStyle=this.debugGridColor[o],this.viewport.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:this.viewport.getRotation(!0)}),c.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:c.getRotation(!0),point:c.viewport.pixelFromPointNoRotate(c._getRotationPoint(!0),!0)}),c.viewport.getRotation(!0)%360===0&&c.getRotation(!0)%360===0&&c._drawer.viewer.viewport.getFlip()&&c._drawer._flip(),l.strokeRect(i.position.x*e.pixelDensityRatio,i.position.y*e.pixelDensityRatio,i.size.x*e.pixelDensityRatio,i.size.y*e.pixelDensityRatio);var u=(i.position.x+i.size.x/2)*e.pixelDensityRatio,d=(i.position.y+i.size.y/2)*e.pixelDensityRatio;l.translate(u,d),l.rotate(Math.PI/180*-this.viewport.getRotation(!0)),l.translate(-u,-d),i.x===0&&i.y===0&&(l.fillText("Zoom: "+this.viewport.getZoom(),i.position.x*e.pixelDensityRatio,(i.position.y-30)*e.pixelDensityRatio),l.fillText("Pan: "+this.viewport.getBounds().toString(),i.position.x*e.pixelDensityRatio,(i.position.y-20)*e.pixelDensityRatio)),l.fillText("Level: "+i.level,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+20)*e.pixelDensityRatio),l.fillText("Column: "+i.x,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+30)*e.pixelDensityRatio),l.fillText("Row: "+i.y,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+40)*e.pixelDensityRatio),l.fillText("Order: "+a+" of "+n,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+50)*e.pixelDensityRatio),l.fillText("Size: "+i.size.toString(),(i.position.x+10)*e.pixelDensityRatio,(i.position.y+60)*e.pixelDensityRatio),l.fillText("Position: "+i.position.toString(),(i.position.x+10)*e.pixelDensityRatio,(i.position.y+70)*e.pixelDensityRatio),this.viewport.getRotation(!0)%360!==0&&this._restoreRotationChanges(),c.getRotation(!0)%360!==0&&this._restoreRotationChanges(),c.viewport.getRotation(!0)%360===0&&c.getRotation(!0)%360===0&&c._drawer.viewer.viewport.getFlip()&&c._drawer._flip(),l.restore()}},debugRect:function(i){if(this.useCanvas){var n=this.context;n.save(),n.lineWidth=2*e.pixelDensityRatio,n.strokeStyle=this.debugGridColor[0],n.fillStyle=this.debugGridColor[0],n.strokeRect(i.x*e.pixelDensityRatio,i.y*e.pixelDensityRatio,i.width*e.pixelDensityRatio,i.height*e.pixelDensityRatio),n.restore()}},setImageSmoothingEnabled:function(i){this.useCanvas&&(this._imageSmoothingEnabled=i,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(i){i.msImageSmoothingEnabled=this._imageSmoothingEnabled,i.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(i){var n=this._getContext(i).canvas;return new e.Point(n.width,n.height)},getCanvasCenter:function(){return new e.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(i){var n=i.point?i.point.times(e.pixelDensityRatio):this.getCanvasCenter(),a=this._getContext(i.useSketch);a.save(),a.translate(n.x,n.y),this.viewer.viewport.flipped?(a.rotate(Math.PI/180*-i.degrees),a.scale(-1,1)):a.rotate(Math.PI/180*i.degrees),a.translate(-n.x,-n.y)},_flip:function(i){i=i||{};var n=i.point?i.point.times(e.pixelDensityRatio):this.getCanvasCenter(),a=this._getContext(i.useSketch);a.translate(n.x,0),a.scale(-1,1),a.translate(-n.x,0)},_restoreRotationChanges:function(i){var n=this._getContext(i);n.restore()},_calculateCanvasSize:function(){var i=e.pixelDensityRatio,n=this.viewport.getContainerSize();return{x:Math.round(n.x*i),y:Math.round(n.y*i)}},_calculateSketchCanvasSize:function(){var i=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return i;var n=Math.ceil(Math.sqrt(i.x*i.x+i.y*i.y));return{x:n,y:n}}}}(r),function(e){e.Viewport=function(i){var n=arguments;n.length&&n[0]instanceof e.Point&&(i={containerSize:n[0],contentSize:n[1],config:n[2]}),i.config&&(e.extend(!0,i,i.config),delete i.config),this._margins=e.extend({left:0,top:0,right:0,bottom:0},i.margins||{}),delete i.margins,i.initialDegrees=i.degrees,delete i.degrees,e.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,rotationPivot:null,viewer:null,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZ
vendor: 33,300 bytes, line 351
351oomImageRatio,maxZoomPixelRatio:e.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:e.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:e.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:e.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:e.DEFAULT_SETTINGS.maxZoomLevel,initialDegrees:e.DEFAULT_SETTINGS.degrees,flipped:e.DEFAULT_SETTINGS.flipped,homeFillsViewer:e.DEFAULT_SETTINGS.homeFillsViewer,silenceMultiImageWarnings:e.DEFAULT_SETTINGS.silenceMultiImageWarnings},i),this._updateContainerInnerSize(),this.centerSpringX=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new e.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.degreesSpring=new e.Spring({initial:i.initialDegrees,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._oldDegrees=this.degreesSpring.current.value,this._setContentBounds(new e.Rect(0,0,1,1),1),this.goHome(!0),this.update()},e.Viewport.prototype={get degrees(){return e.console.warn("Accessing [Viewport.degrees] is deprecated. Use viewport.getRotation instead."),this.getRotation()},set degrees(i){e.console.warn("Setting [Viewport.degrees] is deprecated. Use viewport.rotateTo, viewport.rotateBy, or viewport.setRotation instead."),this.rotateTo(i)},resetContentSize:function(i){return e.console.assert(i,"[Viewport.resetContentSize] contentSize is required"),e.console.assert(i instanceof e.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),e.console.assert(i.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),e.console.assert(i.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new e.Rect(0,0,1,i.y/i.x),i.x),this},setHomeBounds:function(i,n){e.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(i,n)},_setContentBounds:function(i,n){e.console.assert(i,"[Viewport._setContentBounds] bounds is required"),e.console.assert(i instanceof e.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),e.console.assert(i.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),e.console.assert(i.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=i.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(n),this._contentBounds=i.rotate(this.getRotation()).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(n),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:n,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var i=this._contentAspectRatio/this.getAspectRatio(),n;return this.homeFillsViewer?n=i>=1?i:1:n=i>=1?1:i,n/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var i=this._contentBounds.getCenter(),n=1/this.getHomeZoom(),a=n/this.getAspectRatio();return new e.Rect(i.x-n/2,i.y-a/2,n,a)},goHome:function(i){return this.viewer&&this.viewer.raiseEvent("home",{immediately:i}),this.fitBounds(this.getHomeBounds(),i)},getMinZoom:function(){var i=this.getHomeZoom(),n=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*i;return n},getMaxZoom:function(){var i=this.maxZoomLevel;return i||(i=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,i/=this._contentBounds.width),Math.max(i,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new e.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return e.extend({},this._margins)},setMargins:function(i){e.console.assert(e.type(i)==="object","[Viewport.setMargins] margins must be an object"),this._margins=e.extend({left:0,top:0,right:0,bottom:0},i),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(i){return this.getBoundsNoRotate(i).rotate(-this.getRotation(i))},getBoundsNoRotate:function(i){var n=this.getCenter(i),a=1/this.getZoom(i),c=a/this.getAspectRatio();return new e.Rect(n.x-a/2,n.y-c/2,a,c)},getBoundsWithMargins:function(i){return this.getBoundsNoRotateWithMargins(i).rotate(-this.getRotation(i),this.getCenter(i))},getBoundsNoRotateWithMargins:function(i){var n=this.getBoundsNoRotate(i),a=this._containerInnerSize.x*this.getZoom(i);return n.x-=this._margins.left/a,n.y-=this._margins.top/a,n.width+=(this._margins.left+this._margins.right)/a,n.height+=(this._margins.top+this._margins.bottom)/a,n},getCenter:function(i){var n=new e.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),a=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),c,o,l,u,d,h,f,p;return i?n:this.zoomPoint?(c=this.pixelFromPoint(this.zoomPoint,!0),o=this.getZoom(),l=1/o,u=l/this.getAspectRatio(),d=new e.Rect(n.x-l/2,n.y-u/2,l,u),h=this._pixelFromPoint(this.zoomPoint,d),f=h.minus(c).rotate(-this.getRotation(!0)),p=f.divide(this._containerInnerSize.x*o),a.plus(p)):a},getZoom:function(i){return i?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(i){return Math.max(Math.min(i,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(i){var n=this.viewportToViewerElementRectangle(i).getBoundingBox(),a=this.viewportToViewerElementRectangle(this._contentBoundsNoRotate).getBoundingBox(),c=!1,o=!1;if(!this.wrapHorizontal){var l=n.x+n.width,u=a.x+a.width,d,h,f;n.width>a.width?d=this.visibilityRatio*a.width:d=this.visibilityRatio*n.width,h=a.x-l+d,f=u-n.x-d,d>a.width?(n.x+=(h+f)/2,c=!0):f<0?(n.x+=f,c=!0):h>0&&(n.x+=h,c=!0)}if(!this.wrapVertical){var p=n.y+n.height,g=a.y+a.height,w,b,x;n.height>a.height?w=this.visibilityRatio*a.height:w=this.visibilityRatio*n.height,b=a.y-p+w,x=g-n.y-w,w>a.height?(n.y+=(b+x)/2,o=!0):x<0?(n.y+=x,o=!0):b>0&&(n.y+=b,o=!0)}var j=c||o,S=j?this.viewerElementToViewportRectangle(n):i.clone();return S.xConstrained=c,S.yConstrained=o,S.constraintApplied=j,S},_raiseConstraintsEvent:function(i){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:i})},applyConstraints:function(i){var n=this.getZoom(),a=this._applyZoomConstraints(n);n!==a&&this.zoomTo(a,this.zoomPoint,i);var c=this.getConstrainedBounds(!1);return c.constraintApplied&&(this.fitBounds(c,i),this._raiseConstraintsEvent(i)),this},ensureVisible:function(i){return this.applyConstraints(i)},_fitBounds:function(i,n){n=n||{};var a=n.immediately||!1,c=n.constraints||!1,o=this.getAspectRatio(),l=i.getCenter(),u=new e.Rect(i.x,i.y,i.width,i.height,i.degrees+this.getRotation()).getBoundingBox();u.getAspectRatio()>=o?u.height=u.width/o:u.width=u.height*o,u.x=l.x-u.width/2,u.y=l.y-u.height/2;var d=1/u.width;if(a)return this.panTo(l,!0),this.zoomTo(d,null,!0),c&&this.applyConstraints(!0),this;var h=this.getCenter(!0),f=this.getZoom(!0);this.panTo(h,!0),this.zoomTo(f,null,!0);var p=this.getBounds(),g=this.getZoom();if(g===0||Math.abs(d/g-1)<1e-8)return this.zoomTo(d,null,!0),this.panTo(l,a),c&&this.applyConstraints(!1),this;if(c){this.panTo(l,!1),d=this._applyZoomConstraints(d),this.zoomTo(d,null,!1);var w=this.getConstrainedBounds();this.panTo(h,!0),this.zoomTo(f,null,!0),this.fitBounds(w)}else{var b=u.rotate(-this.getRotation()),x=b.getTopLeft().times(d).minus(p.getTopLeft().times(g)).divide(d-g);this.zoomTo(d,x,a)}return this},fitBounds:function(i,n){return this._fitBounds(i,{immediately:n,constraints:!1})},fitBoundsWithConstraints:function(i,n){return this._fitBounds(i,{immediately:n,constraints:!0})},fitVertically:function(i){var n=new e.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(n,i)},fitHorizontally:function(i){var n=new e.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(n,i)},getConstrainedBounds:function(i){var n,a;return n=this.getBounds(i),a=this._applyBoundaryConstraints(n),a},panBy:function(i,n){var a=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(a.plus(i),n)},panTo:function(i,n){return n?(this.centerSpringX.resetTo(i.x),this.centerSpringY.resetTo(i.y)):(this.centerSpringX.springTo(i.x),this.centerSpringY.springTo(i.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:i,immediately:n}),this},zoomBy:function(i,n,a){return this.zoomTo(this.zoomSpring.target.value*i,n,a)},zoomTo:function(i,n,a){var c=this;return this.zoomPoint=n instanceof e.Point&&!isNaN(n.x)&&!isNaN(n.y)?n:null,a?this._adjustCenterSpringsForZoomPoint(function(){c.zoomSpring.resetTo(i)}):this.zoomSpring.springTo(i),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:i,refPoint:n,immediately:a}),this},setRotation:function(i,n){return this.rotateTo(i,null,n)},getRotation:function(i){return i?this.degreesSpring.current.value:this.degreesSpring.target.value},setRotationWithPivot:function(i,n,a){return this.rotateTo(i,n,a)},rotateTo:function(i,n,a){if(!this.viewer||!this.viewer.drawer.canRotate())return this;if(this.degreesSpring.target.value===i&&this.degreesSpring.isAtTargetValue())return this;if(this.rotationPivot=n instanceof e.Point&&!isNaN(n.x)&&!isNaN(n.y)?n:null,a)if(this.rotationPivot){var c=i-this._oldDegrees;if(!c)return this.rotationPivot=null,this;this._rotateAboutPivot(i)}else this.degreesSpring.resetTo(i);else{var o=e.positiveModulo(this.degreesSpring.current.value,360),l=e.positiveModulo(i,360),u=l-o;u>180?l-=360:u<-180&&(l+=360);var d=o-l;this.degreesSpring.resetTo(i+d),this.degreesSpring.springTo(i)}return this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:i,immediately:!!a,pivot:this.rotationPivot||this.getCenter()}),this},rotateBy:function(i,n,a){return this.rotateTo(this.degreesSpring.target.value+i,n,a)},resize:function(i,n){var a=this.getBoundsNoRotate(),c=a,o;this.containerSize.x=i.x,this.containerSize.y=i.y,this._updateContainerInnerSize(),n&&(o=i.x/this.containerSize.x,c.width=a.width*o,c.height=c.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:i,maintain:n});var l=this.fitBounds(c,!0);return this.viewer&&this.viewer.raiseEvent("after-resize",{newContainerSize:i,maintain:n}),l},_updateContainerInnerSize:function(){this._containerInnerSize=new e.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var i=this;this._adjustCenterSpringsForZoomPoint(function(){i.zoomSpring.update()}),this.degreesSpring.isAtTargetValue()&&(this.rotationPivot=null),this.centerSpringX.update(),this.centerSpringY.update(),this.rotationPivot?this._rotateAboutPivot(!0):this.degreesSpring.update();var n=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom||this.degreesSpring.current.value!==this._oldDegrees;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._oldDegrees=this.degreesSpring.current.value,n},_rotateAboutPivot:function(i){var n=i===!0,a=this.rotationPivot.minus(this.getCenter());this.centerSpringX.shiftBy(a.x),this.centerSpringY.shiftBy(a.y),n?this.degreesSpring.update():this.degreesSpring.resetTo(i);var c=this.degreesSpring.current.value-this._oldDegrees,o=a.rotate(c*-1).times(-1);this.centerSpringX.shiftBy(o.x),this.centerSpringY.shiftBy(o.y)},_adjustCenterSpringsForZoomPoint:function(i){if(this.zoomPoint){var n=this.pixelFromPoint(this.zoomPoint,!0);i();var a=this.pixelFromPoint(this.zoomPoint,!0),c=a.minus(n),o=this.deltaPointsFromPixels(c,!0);this.centerSpringX.shiftBy(o.x),this.centerSpringY.shiftBy(o.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else i()},deltaPixelsFromPointsNoRotate:function(i,n){return i.times(this._containerInnerSize.x*this.getZoom(n))},deltaPixelsFromPoints:function(i,n){return this.deltaPixelsFromPointsNoRotate(i.rotate(this.getRotation(n)),n)},deltaPointsFromPixelsNoRotate:function(i,n){return i.divide(this._containerInnerSize.x*this.getZoom(n))},deltaPointsFromPixels:function(i,n){return this.deltaPointsFromPixelsNoRotate(i,n).rotate(-this.getRotation(n))},pixelFromPointNoRotate:function(i,n){return this._pixelFromPointNoRotate(i,this.getBoundsNoRotate(n))},pixelFromPoint:function(i,n){return this._pixelFromPoint(i,this.getBoundsNoRotate(n))},_pixelFromPointNoRotate:function(i,n){return i.minus(n.getTopLeft()).times(this._containerInnerSize.x/n.width).plus(new e.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(i,n){return this._pixelFromPointNoRotate(i.rotate(this.getRotation(!0),this.getCenter(!0)),n)},pointFromPixelNoRotate:function(i,n){var a=this.getBoundsNoRotate(n);return i.minus(new e.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/a.width).plus(a.getTopLeft())},pointFromPixel:function(i,n){return this.pointFromPixelNoRotate(i,n).rotate(-this.getRotation(n),this.getCenter(n))},_viewportToImageDelta:function(i,n){var a=this._contentBoundsNoRotate.width;return new e.Point(i*this._contentSizeNoRotate.x/a,n*this._contentSizeNoRotate.x/a)},viewportToImageCoordinates:function(i,n){if(i instanceof e.Point)return this.viewportToImageCoordinates(i.x,i.y);if(this.viewer){var a=this.viewer.world.getItemCount();if(a>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(a===1){var c=this.viewer.world.getItemAt(0);return c.viewportToImageCoordinates(i,n,!0)}}return this._viewportToImageDelta(i-this._contentBoundsNoRotate.x,n-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(i,n){var a=this._contentBoundsNoRotate.width;return new e.Point(i/this._contentSizeNoRotate.x*a,n/this._contentSizeNoRotate.x*a)},imageToViewportCoordinates:function(i,n){if(i instanceof e.Point)return this.imageToViewportCoordinates(i.x,i.y);if(this.viewer){var a=this.viewer.world.getItemCount();if(a>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(a===1){var c=this.viewer.world.getItemAt(0);return c.imageToViewportCoordinates(i,n,!0)}}var o=this._imageToViewportDelta(i,n);return o.x+=this._contentBoundsNoRotate.x,o.y+=this._contentBoundsNoRotate.y,o},imageToViewportRectangle:function(i,n,a,c){var o=i;if(o instanceof e.Rect||(o=new e.Rect(i,n,a,c)),this.viewer){var l=this.viewer.world.getItemCount();if(l>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(l===1){var u=this.viewer.world.getItemAt(0);return u.imageToViewportRectangle(i,n,a,c,!0)}}var d=this.imageToViewportCoordinates(o.x,o.y),h=this._imageToViewportDelta(o.width,o.height);return new e.Rect(d.x,d.y,h.x,h.y,o.degrees)},viewportToImageRectangle:function(i,n,a,c){var o=i;if(o instanceof e.Rect||(o=new e.Rect(i,n,a,c)),this.viewer){var l=this.viewer.world.getItemCount();if(l>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(l===1){var u=this.viewer.world.getItemAt(0);return u.viewportToImageRectangle(i,n,a,c,!0)}}var d=this.viewportToImageCoordinates(o.x,o.y),h=this._viewportToImageDelta(o.width,o.height);return new e.Rect(d.x,d.y,h.x,h.y,o.degrees)},viewerElementToImageCoordinates:function(i){var n=this.pointFromPixel(i,!0);return this.viewportToImageCoordinates(n)},imageToViewerElementCoordinates:function(i){var n=this.imageToViewportCoordinates(i);return this.pixelFromPoint(n,!0)},windowToImageCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var n=i.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(n)},imageToWindowCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var n=this.imageToViewerElementCoordinates(i);return n.plus(e.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(i){return this.pointFromPixel(i,!0)},viewportToViewerElementCoordinates:function(i){return this.pixelFromPoint(i,!0)},viewerElementToViewportRectangle:function(i){return e.Rect.fromSummits(this.pointFromPixel(i.getTopLeft(),!0),this.pointFromPixel(i.getTopRight(),!0),this.pointFromPixel(i.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(i){return e.Rect.fromSummits(this.pixelFromPoint(i.getTopLeft(),!0),this.pixelFromPoint(i.getTopRight(),!0),this.pixelFromPoint(i.getBottomLeft(),!0))},windowToViewportCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var n=i.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(n)},viewportToWindowCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var n=this.viewportToViewerElementCoordinates(i);return n.plus(e.getElementPosition(this.viewer.element))},viewportToImageZoom:function(i){if(this.viewer){var n=this.viewer.world.getItemCount();if(n>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(n===1){var a=this.viewer.world.getItemAt(0);return a.viewportToImageZoom(i)}}var c=this._contentSizeNoRotate.x,o=this._containerInnerSize.x,l=this._contentBoundsNoRotate.width,u=o/c*l;return i*u},imageToViewportZoom:function(i){if(this.viewer){var n=this.viewer.world.getItemCount();if(n>1)this.silenceMultiImageWarnings||e.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(n===1){var a=this.viewer.world.getItemAt(0);return a.imageToViewportZoom(i)}}var c=this._contentSizeNoRotate.x,o=this._containerInnerSize.x,l=this._contentBoundsNoRotate.width,u=c/o/l;return i*u},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(i){return this.flipped===i?this:(this.flipped=i,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:i}),this)}}}(r),function(e){e.TiledImage=function(o){var l=this;e.console.assert(o.tileCache,"[TiledImage] options.tileCache is required"),e.console.assert(o.drawer,"[TiledImage] options.drawer is required"),e.console.assert(o.viewer,"[TiledImage] options.viewer is required"),e.console.assert(o.imageLoader,"[TiledImage] options.imageLoader is required"),e.console.assert(o.source,"[TiledImage] options.source is required"),e.console.assert(!o.clip||o.clip instanceof e.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),e.EventSource.call(this),this._tileCache=o.tileCache,delete o.tileCache,this._drawer=o.drawer,delete o.drawer,this._imageLoader=o.imageLoader,delete o.imageLoader,o.clip instanceof e.Rect&&(this._clip=o.clip.clone()),delete o.clip;var u=o.x||0;delete o.x;var d=o.y||0;delete o.y,this.normHeight=o.source.dimensions.y/o.source.dimensions.x,this.contentAspectX=o.source.dimensions.x/o.source.dimensions.y;var h=1;o.width?(h=o.width,delete o.width,o.height&&(e.console.error("specifying both width and height to a tiledImage is not supported"),delete o.height)):o.height&&(h=o.height/this.normHeight,delete o.height);var f=o.fitBounds;delete o.fitBounds;var p=o.fitBoundsPlacement||r.Placement.CENTER;delete o.fitBoundsPlacement;var g=o.degrees||0;delete o.degrees;var w=o.ajaxHeaders;delete o.ajaxHeaders,e.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,immediateRender:e.DEFAULT_SETTINGS.immediateRender,blendTime:e.DEFAULT_SETTINGS.blendTime,alwaysBlend:e.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:e.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:e.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:e.DEFAULT_SETTINGS.iOSDevice,debugMode:e.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:e.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:e.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:e.DEFAULT_SETTINGS.placeholderFillStyle,opacity:e.DEFAULT_SETTINGS.opacity,preload:e.DEFAULT_SETTINGS.preload,compositeOperation:e.DEFAULT_SETTINGS.compositeOperation,subPixelRoundingForTransparency:e.DEFAULT_SETTINGS.subPixelRoundingForTransparency},o),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new e.Spring({initial:u,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new e.Spring({initial:d,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new e.Spring({initial:h,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new e.Spring({initial:g,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),f&&this.fitBounds(f,p,!0),this._drawingHandler=function(b){l.viewer.raiseEvent("tile-drawing",e.extend({tiledImage:l},b))},this._ownAjaxHeaders={},this.setAjaxHeaders(w,!1)},e.extend(e.TiledImage.prototype,e.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(o){o!==this._fullyLoaded&&(this._fullyLoaded=o,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=e.now(),this._needsDraw=!0},update:function(){var o=this._xSpring.update(),l=this._ySpring.update(),u=this._scaleSpring.update(),d=this._degreesSpring.update();return o||l||u||d?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(o){return this.getBoundsNoRotate(o).rotate(this.getRotation(o),this._getRotationPoint(o))},getBoundsNoRotate:function(o){return o?new e.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new e.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return e.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(o){var l=this.getBoundsNoRotate(o);if(this._clip){var u=o?this._worldWidthCurrent:this._worldWidthTarget,d=u/this.source.dimensions.x,h=this._clip.times(d);l=new e.Rect(l.x+h.x,l.y+h.y,h.width,h.height)}return l.rotate(this.getRotation(o),this._getRotationPoint(o))},getTileBounds:function(o,l,u){var d=this.source.getNumTiles(o),h=(d.x+l%d.x)%d.x,f=(d.y+u%d.y)%d.y,p=this.source.getTileBounds(o,h,f);return this.getFlip()&&(p.x=1-p.x-p.width),p.x+=(l-h)/d.x,p.y+=this._worldHeightCurrent/this._worldWidthCurrent*((u-f)/d.y),p},getContentSize:function(){return new e.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var o=this.imageToWindowCoordinates(new e.Point(0,0)),l=this.imageToWindowCoordinates(this.getContentSize());return new e.Point(l.x-o.x,l.y-o.y)},_viewportToImageDelta:function(o,l,u){var d=u?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(o*(this.source.dimensions.x/d),l*(this.source.dimensions.y*this.contentAspectX/d))},viewportToImageCoordinates:function(o,l,u){var d;return o instanceof e.Point?(u=l,d=o):d=new e.Point(o,l),d=d.rotate(-this.getRotation(u),this._getRotationPoint(u)),u?this._viewportToImageDelta(d.x-this._xSpring.current.value,d.y-this._ySpring.current.value):this._viewportToImageDelta(d.x-this._xSpring.target.value,d.y-this._ySpring.target.value)},_imageToViewportDelta:function(o,l,u){var d=u?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(o/this.source.dimensions.x*d,l/this.source.dimensions.y/this.contentAspectX*d)},imageToViewportCoordinates:function(o,l,u){o instanceof e.Point&&(u=l,l=o.y,o=o.x);var d=this._imageToViewportDelta(o,l);return u?(d.x+=this._xSpring.current.value,d.y+=this._ySpring.current.value):(d.x+=this._xSpring.target.value,d.y+=this._ySpring.target.value),d.rotate(this.getRotation(u),this._getRotationPoint(u))},imageToViewportRectangle:function(o,l,u,d,h){var f=o;f instanceof e.Rect?h=l:f=new e.Rect(o,l,u,d);var p=this.imageToViewportCoordinates(f.getTopLeft(),h),g=this._imageToViewportDelta(f.width,f.height,h);return new e.Rect(p.x,p.y,g.x,g.y,f.degrees+this.getRotation(h))},viewportToImageRectangle:function(o,l,u,d,h){var f=o;o instanceof e.Rect?h=l:f=new e.Rect(o,l,u,d);var p=this.viewportToImageCoordinates(f.getTopLeft(),h),g=this._viewportToImageDelta(f.width,f.height,h);return new e.Rect(p.x,p.y,g.x,g.y,f.degrees-this.getRotation(h))},viewerElementToImageCoordinates:function(o){var l=this.viewport.pointFromPixel(o,!0);return this.viewportToImageCoordinates(l)},imageToViewerElementCoordinates:function(o){var l=this.imageToViewportCoordinates(o);return this.viewport.pixelFromPoint(l,!0)},windowToImageCoordinates:function(o){var l=o.minus(r.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(l)},imageToWindowCoordinates:function(o){var l=this.imageToViewerElementCoordinates(o);return l.plus(r.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(o){var l=this._scaleSpring.current.value;return o=o.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new e.Rect((o.x-this._xSpring.current.value)/l,(o.y-this._ySpring.current.value)/l,o.width/l,o.height/l,o.degrees)},viewportToImageZoom:function(o){var l=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return l*o},imageToViewportZoom:function(o){var l=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return o/l},setPosition:function(o,l){var u=this._xSpring.target.value===o.x&&this._ySpring.target.value===o.y;if(l){if(u&&this._xSpring.current.value===o.x&&this._ySpring.current.value===o.y)return;this._xSpring.resetTo(o.x),this._ySpring.resetTo(o.y),this._needsDraw=!0}else{if(u)return;this._xSpring.springTo(o.x),this._ySpring.springTo(o.y),this._needsDraw=!0}u||this._raiseBoundsChange()},setWidth:function(o,l){this._setScale(o,l)},setHeight:function(o,l){this._setScale(o/this.normHeight,l)},setCroppingPolygons:function(o){var l=function(d){return d instanceof e.Point||typeof d.x=="number"&&typeof d.y=="number"},u=function(d){return d.map(function(h){try{if(l(h))return{x:h.x,y:h.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!e.isArray(o))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=o.map(function(d){return u(d)})}catch(d){e.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),e.console.error(d),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(o,l,u){l=l||e.Placement.CENTER;var d=e.Placement.properties[l],h=this.contentAspectX,f=0,p=0,g=1,w=1;if(this._clip&&(h=this._clip.getAspectRatio(),g=this._clip.width/this.source.dimensions.x,w=this._clip.height/this.source.dimensions.y,o.getAspectRatio()>h?(f=this._clip.x/this._clip.height*o.height,p=this._clip.y/this._clip.height*o.height):(f=this._clip.x/this._clip.width*o.width,p=this._clip.y/this._clip.width*o.width)),o.getAspectRatio()>h){var b=o.height/w,x=0;d.isHorizontallyCentered?x=(o.width-o.height*h)/2:d.isRight&&(x=o.width-o.height*h),this.setPosition(new e.Point(o.x-f+x,o.y-p),u),this.setHeight(b,u)}else{var j=o.width/g,S=0;d.isVerticallyCentered?S=(o.height-o.width/h)/2:d.isBottom&&(S=o.height-o.width/h),this.setPosition(new e.Point(o.x-f,o.y-p+S),u),this.setWidth(j,u)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(o){e.console.assert(!o||o instanceof e.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),o instanceof e.Rect?this._clip=o.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(o){this.flipped=!!o,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(o){o!==this.opacity&&(this.opacity=o,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(o){this._preload=!!o,this._needsDraw=!0},getRotation:function(o){return o?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(o,l){this._degreesSpring.target.value===o&&this._degreesSpring.isAtTargetValue()||(l?this._degreesSpring.resetTo(o):this._degreesSpring.springTo(o),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(o){return this.getBoundsNoRotate(o).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(o){o!==this.compositeOperation&&(this.compositeOperation=o,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},setAjaxHeaders:function(o,l){if(o===null&&(o={}),!e.isPlainObject(o)){console.error("[TiledImage.setAjaxHeaders] Ignoring invalid headers, must be a plain object");return}this._ownAjaxHeaders=o,this._updateAjaxHeaders(l)},_updateAjaxHeaders:function(o){if(o===void 0&&(o=!0),e.isPlainObject(this.viewer.ajaxHeaders)?this.ajaxHeaders=e.extend({},this.viewer.ajaxHeaders,this._ownAjaxHeaders):this.ajaxHeaders=this._ownAjaxHeaders,o){var l,u,d,h;for(var f in this.tilesMatrix){l=this.source.getNumTiles(f);for(var p in this.tilesMatrix[f]){u=(l.x+p%l.x)%l.x;for(var g in this.tilesMatrix[f][p])if(d=(l.y+g%l.y)%l.y,h=this.tilesMatrix[f][p][g],h.loadWithAjax=this.loadTilesWithAjax,h.loadWithAjax){var w=this.source.getTileAjaxHeaders(f,u,d);h.ajaxHeaders=e.extend({},this.ajaxHeaders,w)}else h.ajaxHeaders=null}}for(var b=0;b<this._imageLoader.jobQueue.length;b++){var x=this._imageLoader.jobQueue[b];x.loadWithAjax=x.tile.loadWithAjax,x.ajaxHeaders=x.tile.loadWithAjax?x.tile.ajaxHeaders:null}}},_setScale:function(o,l){var u=this._scaleSpring.target.value===o;if(l){if(u&&this._scaleSpring.current.value===o)return;this._scaleSpring.resetTo(o),this._updateForScale(),this._needsDraw=!0}else{if(u)return;this._scaleSpring.springTo(o),this._updateForScale(),this._needsDraw=!0}u||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var o=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),l=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,u=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(l/this.minPixelRatio)/Math.log(2))));return u=Math.max(u,this.source.minLevel||0),o=Math.min(o,u),{lowestLevel:o,highestLevel:u}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var o=this.lastDrawn.pop();o.beingDrawn=!1}var l=this.viewport,u=this._viewportToTiledImageRectangle(l.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var d=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(u=u.intersection(d),u===null)return}
351for(var h=this._getLevelsInterval(),f=h.lowestLevel,p=h.highestLevel,g=null,w=!1,b=e.now(),x=p;x>=f;x--){var j=!1,S=l.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(x),!0).x*this._scaleSpring.current.value;if(x===f||!w&&S>=this.minPixelRatio)j=!0,w=!0;else if(!w)continue;var E=l.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(x),!1).x*this._scaleSpring.current.value,R=l.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,A=this.immediateRender?1:R,I=Math.min(1,(S-.5)/.5),H=A/Math.abs(A-E);if(g=this._updateLevel(w,j,x,I,H,u,b,g),this._providesCoverage(this.coverage,x))break}this._drawTiles(this.lastDrawn),g&&!g.context2D?(this._loadTile(g,b),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(o,l,u){var d,h;this.wrapHorizontal?(d=e.positiveModulo(l.x,1),h=e.positiveModulo(u.x,1)):(d=Math.max(0,l.x),h=Math.min(1,u.x));var f,p,g=1/this.source.aspectRatio;this.wrapVertical?(f=e.positiveModulo(l.y,g),p=e.positiveModulo(u.y,g)):(f=Math.max(0,l.y),p=Math.min(g,u.y));var w=this.source.getTileAtPoint(o,new e.Point(d,f)),b=this.source.getTileAtPoint(o,new e.Point(h,p)),x=this.source.getNumTiles(o);return this.wrapHorizontal&&(w.x+=x.x*Math.floor(l.x),b.x+=x.x*Math.floor(u.x)),this.wrapVertical&&(w.y+=x.y*Math.floor(l.y/g),b.y+=x.y*Math.floor(u.y/g)),{topLeft:w,bottomRight:b}},_updateLevel:function(o,l,u,d,h,f,p,g){var w=f.getBoundingBox().getTopLeft(),b=f.getBoundingBox().getBottomRight();this.viewer&&this.viewer.raiseEvent("update-level",{tiledImage:this,havedrawn:o,level:u,opacity:d,visibility:h,drawArea:f,topleft:w,bottomright:b,currenttime:p,best:g}),this._resetCoverage(this.coverage,u),this._resetCoverage(this.loadingCoverage,u);var x=this._getCornerTiles(u,w,b),j=x.topLeft,S=x.bottomRight,E=this.source.getNumTiles(u),R=this.viewport.pixelFromPoint(this.viewport.getCenter());this.getFlip()&&(S.x+=1,this.wrapHorizontal||(S.x=Math.min(S.x,E.x-1)));for(var A=j.x;A<=S.x;A++)for(var I=j.y;I<=S.y;I++){var H;if(this.getFlip()){var W=(E.x+A%E.x)%E.x;H=A+E.x-W-W-1}else H=A;f.intersection(this.getTileBounds(u,H,I))!==null&&(g=this._updateTile(l,o,H,I,u,d,h,R,E,p,g))}return g},_updateTile:function(o,l,u,d,h,f,p,g,w,b,x){var j=this._getTile(u,d,h,b,w,this._worldWidthCurrent,this._worldHeightCurrent),S=l;this.viewer&&this.viewer.raiseEvent("update-tile",{tiledImage:this,tile:j}),this._setCoverage(this.coverage,h,u,d,!1);var E=j.loaded||j.loading||this._isCovered(this.loadingCoverage,h,u,d);if(this._setCoverage(this.loadingCoverage,h,u,d,E),!j.exists||(o&&!S&&(this._isCovered(this.coverage,h,u,d)?this._setCoverage(this.coverage,h,u,d,!0):S=!0),!S))return x;if(this._positionTile(j,this.source.tileOverlap,this.viewport,g,p),!j.loaded)if(j.context2D)this._setTileLoaded(j);else{var R=this._tileCache.getImageRecord(j.cacheKey);R&&this._setTileLoaded(j,R.getData())}if(j.loaded){var A=this._blendTile(j,u,d,h,f,b);A&&(this._needsDraw=!0)}else j.loading?this._tilesLoading++:E||(x=this._compareTiles(x,j));return x},_getTile:function(o,l,u,d,h,f,p){var g,w,b,x,j,S,E,R,A,I,H=this.tilesMatrix,W=this.source;return H[u]||(H[u]={}),H[u][o]||(H[u][o]={}),(!H[u][o][l]||!H[u][o][l].flipped!=!this.flipped)&&(g=(h.x+o%h.x)%h.x,w=(h.y+l%h.y)%h.y,b=this.getTileBounds(u,o,l),x=W.getTileBounds(u,g,w,!0),j=W.tileExists(u,g,w),S=W.getTileUrl(u,g,w),E=W.getTilePostData(u,g,w),this.loadTilesWithAjax?(R=W.getTileAjaxHeaders(u,g,w),e.isPlainObject(this.ajaxHeaders)&&(R=e.extend({},this.ajaxHeaders,R))):R=null,A=W.getContext2D?W.getContext2D(u,g,w):void 0,I=new e.Tile(u,o,l,b,j,S,A,this.loadTilesWithAjax,R,x,E,W.getTileHashKey(u,g,w,S,R,E)),this.getFlip()?g===0&&(I.isRightMost=!0):g===h.x-1&&(I.isRightMost=!0),w===h.y-1&&(I.isBottomMost=!0),I.flipped=this.flipped,H[u][o][l]=I),I=H[u][o][l],I.lastTouchTime=d,I},_loadTile:function(o,l){var u=this;o.loading=!0,this._imageLoader.addJob({src:o.getUrl(),tile:o,source:this.source,postData:o.postData,loadWithAjax:o.loadWithAjax,ajaxHeaders:o.ajaxHeaders,crossOriginPolicy:this.crossOriginPolicy,ajaxWithCredentials:this.ajaxWithCredentials,callback:function(d,h,f){u._onTileLoad(o,l,d,h,f)},abort:function(){o.loading=!1}})},_onTileLoad:function(o,l,u,d,h){if(u)o.exists=!0;else{e.console.error("Tile %s failed to load: %s - error: %s",o,o.getUrl(),d),this.viewer.raiseEvent("tile-load-failed",{tile:o,tiledImage:this,time:l,message:d,tileRequest:h}),o.loading=!1,o.exists=!1;return}if(l<this.lastResetTime){e.console.warn("Ignoring tile %s loaded before reset: %s",o,o.getUrl()),o.loading=!1;return}var f=this,p=function(){var g=f.source,w=g.getClosestLevel();f._setTileLoaded(o,u,w,h)};this._midDraw?window.setTimeout(p,1):p()},_setTileLoaded:function(o,l,u,d){var h=0,f=!1,p=this;function g(){return f&&e.console.error("Event 'tile-loaded' argument getCompletionCallback must be called synchronously. Its return value should be called asynchronously."),h++,w}function w(){h--,h===0&&(o.loading=!1,o.loaded=!0,o.hasTransparency=p.source.hasTransparency(o.context2D,o.getUrl(),o.ajaxHeaders,o.postData),o.context2D||p._tileCache.cac
351heTile({data:l,tile:o,cutoff:u,tiledImage:p}),p._needsDraw=!0)}var b=g();this.viewer.raiseEvent("tile-loaded",{tile:o,tiledImage:this,tileRequest:d,get image(){return e.console.error("[tile-loaded] event 'image' has been deprecated. Use 'data' property instead."),l},data:l,getCompletionCallback:g}),f=!0,b()},_positionTile:function(o,l,u,d,h){var f=o.bounds.getTopLeft();f.x*=this._scaleSpring.current.value,f.y*=this._scaleSpring.current.value,f.x+=this._xSpring.current.value,f.y+=this._ySpring.current.value;var p=o.bounds.getSize();p.x*=this._scaleSpring.current.value,p.y*=this._scaleSpring.current.value;var g=u.pixelFromPointNoRotate(f,!0),w=u.pixelFromPointNoRotate(f,!1),b=u.deltaPixelsFromPointsNoRotate(p,!0),x=u.deltaPixelsFromPointsNoRotate(p,!1),j=w.plus(x.divide(2)),S=d.squaredDistanceTo(j);l||(b=b.plus(new e.Point(1,1))),o.isRightMost&&this.wrapHorizontal&&(b.x+=.75),o.isBottomMost&&this.wrapVertical&&(b.y+=.75),o.position=g,o.size=b,o.squaredDistance=S,o.visibility=h},_blendTile:function(o,l,u,d,h,f){var p=1e3*this.blendTime,g,w;if(o.blendStart||(o.blendStart=f),g=f-o.blendStart,w=p?Math.min(1,g/p):1,this.alwaysBlend&&(w*=h),o.opacity=w,this.lastDrawn.push(o),w===1)this._setCoverage(this.coverage,d,l,u,!0),this._hasOpaqueTile=!0;else if(g<p)return!0;return!1},_compareTiles:function(o,l){return!o||l.visibility>o.visibility||l.visibility===o.visibility&&l.squaredDistance<o.squaredDistance?l:o},_drawTiles:function(o){if(!(this.opacity===0||o.length===0&&!this.placeholderFillStyle)){var l=o[0],u;l&&(u=this.opacity<1||this.compositeOperation&&this.compositeOperation!=="source-over"||!this._isBottomItem()&&this.source.hasTransparency(l.context2D,l.getUrl(),l.ajaxHeaders,l.postData));var d,h,f=this.viewport.getZoom(!0),p=this.viewportToImageZoom(f);o.length>1&&p>this.smoothTileEdgesMinZoom&&!this.iOSDevice&&this.getRotation(!0)%360===0&&e.supportsCanvas&&this.viewer.useCanvas&&(u=!0,d=l.getScaleForEdgeSmoothing(),h=l.getTranslationForEdgeSmoothing(d,this._drawer.getCanvasSize(!1),this._drawer.getCanvasSize(!0)));var g;u&&(d||(g=this.viewport.viewportToViewerElementRectangle(this.getClippedBounds(!0)).getIntegerBoundingBox(),this._drawer.viewer.viewport.getFlip()&&(this.viewport.getRotation(!0)%360!==0||this.getRotation(!0)%360!==0)&&(g.x=this._drawer.viewer.container.clientWidth-(g.x+g.width)),g=g.times(e.pixelDensityRatio)),this._drawer._clear(!0,g)),d||(this.viewport.getRotation(!0)%360!==0&&this._drawer._offsetForRotation({degrees:this.viewport.getRotation(!0),useSketch:u}),this.getRotation(!0)%360!==0&&this._drawer._offsetForRotation({degrees:this.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(this._getRotationPoint(!0),!0),useSketch:u}),this.viewport.getRotation(!0)%360===0&&this.getRotation(!0)%360===0&&this._drawer.viewer.viewport.getFlip()&&this._drawer._flip());var w=!1;if(this._clip){this._drawer.saveContext(u);var b=this.imageToViewportRectangle(this._clip,!0);b=b.rotate(-this.getRotation(!0),this._getRotationPoint(!0));var x=this._drawer.viewportToDrawerRectangle(b);d&&(x=x.times(d)),h&&(x=x.translate(h)),this._drawer.setClip(x,u),w=!0}if(this._croppingPolygons){var j=this;this._drawer.saveContext(u);try{var S=this._croppingPolygons.map(function(Z){return Z.map(function($){var X=j.imageToViewportCoordinates($.x,$.y,!0).rotate(-j.getRotation(!0),j._getRotationPoint(!0)),ee=j._drawer.viewportCoordToDrawerCoord(X);return d&&(ee=ee.times(d)),h&&(ee=ee.plus(h)),ee})});this._drawer.clipWithPolygons(S,u)}catch(Z){e.console.error(Z)}w=!0}if(this.placeholderFillStyle&&this._hasOpaqueTile===!1){var E=this._drawer.viewportToDrawerRectangle(this.getBounds(!0));d&&(E=E.times(d)),h&&(E=E.translate(h));var R=null;typeof this.placeholderFillStyle=="function"?R=this.placeholderFillStyle(this,this._drawer.context):R=this.placeholderFillStyle,this._drawer.drawRectangle(E,R,u)}var A=c(this.subPixelRoundingForTransparency),I=!1;if(A===e.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS)I=!0;else if(A===e.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST){var H=this.viewer&&this.viewer.isAnimating();I=!H}for(var W=o.length-1;W>=0;W--)l=o[W],this._drawer.drawTile(l,this._drawingHandler,u,d,h,I,this.source),l.beingDrawn=!0,this.viewer&&this.viewer.raiseEvent("tile-drawn",{tiledImage:this,tile:l});w&&this._drawer.restoreContext(u),d||(this.getRotation(!0)%360!==0&&this._drawer._restoreRotationChanges(u),this.viewport.getRotation(!0)%360!==0&&this._drawer._restoreRotationChanges(u)),u&&(d&&
351(this.viewport.getRotation(!0)%360!==0&&this._drawer._offsetForRotation({degrees:this.viewport.getRotation(!0),useSketch:!1}),this.getRotation(!0)%360!==0&&this._drawer._offsetForRotation({degrees:this.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(this._getRotationPoint(!0),!0),useSketch:!1})),this._drawer.blendSketch({opacity:this.opacity,scale:d,translate:h,compositeOperation:this.compositeOperation,bounds:g}),d&&(this.getRotation(!0)%360!==0&&this._drawer._restoreRotationChanges(!1),this.viewport.getRotation(!0)%360!==0&&this._drawer._restoreRotationChanges(!1))),d||this.viewport.getRotation(!0)%360===0&&this.getRotation(!0)%360===0&&this._drawer.viewer.viewport.getFlip()&&this._drawer._flip(),this._drawDebugInfo(o)}},_drawDebugInfo:function(o){if(this.debugMode)for(var l=o.length-1;l>=0;l--){var u=o[l];try{this._drawer.drawDebugInfo(u,o.length,l,this)}catch(d){e.console.error(d)}}},_providesCoverage:function(o,l,u,d){var h,f,p,g;if(!o[l])return!1;if(u===void 0||d===void 0){h=o[l];for(p in h)if(Object.prototype.hasOwnProperty.call(h,p)){f=h[p];for(g in f)if(Object.prototype.hasOwnProperty.call(f,g)&&!f[g])return!1}return!0}return o[l][u]===void 0||o[l][u][d]===void 0||o[l][u][d]===!0},_isCovered:function(o,l,u,d){return u===void 0||d===void 0?this._providesCoverage(o,l+1):this._providesCoverage(o,l+1,2*u,2*d)&&this._providesCoverage(o,l+1,2*u,2*d+1)&&this._providesCoverage(o,l+1,2*u+1,2*d)&&this._providesCoverage(o,l+1,2*u+1,2*d+1)},_setCoverage:function(o,l,u,d,h){if(!o[l]){e.console.warn("Setting coverage for a tile before its level's coverage has been reset: %s",l);return}o[l][u]||(o[l][u]={}),o[l][u][d]=h},_resetCoverage:function(o,l){o[l]={}}});var i=e.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER;function n(o){return o!==e.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS&&o!==e.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST&&o!==e.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER}function a(o){return n(o)?i:o}function c(o){if(typeof o=="number")return a(o);if(!o||!e.Browser)return i;var l=o[e.Browser.vendor];return n(l)&&(l=o["*"]),a(l)}}(r),function(e){var i=function(a){e.console.assert(a,"[TileCache.cacheTile] options is required"),e.console.assert(a.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(a.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=a.tile,this.tiledImage=a.tiledImage},n=function(a){e.console.assert(a,"[ImageRecord] options is required"),e.console.assert(a.data,"[ImageRecord] options.data is required"),this._tiles=[],a.create.apply(null,[this,a.data,a.ownerTile]),this._destroyImplementation=a.destroy.bind(null,this),this.getImage=a.getImage.bind(null,this),this.getData=a.getData.bind(null,this),this.getRenderedContext=a.getRenderedContext.bind(null,this)};n.prototype={destroy:function(){this._destroyImplementation(),this._tiles=null},addTile:function(a){e.console.assert(a,"[ImageRecord.addTile] tile is required"),this._tiles.push(a)},removeTile:function(a){for(var c=0;c<this._tiles.length;c++)if(this._tiles[c]===a){this._tiles.splice(c,1);return}e.console.warn("[ImageRecord.removeTile] trying to remove unknown tile",a)},getTileCount:function(){return this._tiles.length}},e.TileCache=function(a){a=a||{},this._maxImageCacheCount=a.maxImageCacheCount||e.DEFAULT_SETTINGS.maxImageCacheCount,this._tilesLoaded=[],this._imagesLoaded=[],this._imagesLoadedCount=0},e.TileCache.prototype={numTilesLoaded:function(){return this._tilesLoaded.length},cacheTile:function(a){e.console.assert(a,"[TileCache.cacheTile] options is required"),e.console.assert(a.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(a.tile.cacheKey,"[TileCache.cacheTile] options.tile.cacheKey is required"),e.console.assert(a.tiledImage,"[TileCache.cacheTile] options.tiledImage is required");var c=a.cutoff||0,o=this._tilesLoaded.length,l=this._imagesLoaded[a.tile.cacheKey];if(l||(a.data||(e.console.error("[TileCache.cacheTile] options.image was renamed to options.data. '.image' attribute has been deprecated and will be removed in the future."),a.data=a.image),e.console.assert(a.data,"[TileCache.cac
351heTile] options.data is required to create an ImageRecord"),l=this._imagesLoaded[a.tile.cacheKey]=new n({data:a.data,ownerTile:a.tile,create:a.tiledImage.source.createTileCache,destroy:a.tiledImage.source.destroyTileCache,getImage:a.tiledImage.source.getTileCacheDataAsImage,getData:a.tiledImage.source.getTileCacheData,getRenderedContext:a.tiledImage.source.getTileCacheDataAsContext2D}),this._imagesLoadedCount++),l.addTile(a.tile),a.tile.cacheImageRecord=l,this._imagesLoadedCount>this._maxImageCacheCount){for(var u=null,d=-1,h=null,f,p,g,w,b,x,j=this._tilesLoaded.length-1;j>=0;j--)if(x=this._tilesLoaded[j],f=x.tile,!(f.level<=c||f.beingDrawn)){if(!u){u=f,d=j,h=x;continue}w=f.lastTouchTime,p=u.lastTouchTime,b=f.level,g=u.level,(w<p||w===p&&b>g)&&(u=f,d=j,h=x)}u&&d>=0&&(this._unloadTile(h),o=d)}this._tilesLoaded[o]=new i({tile:a.tile,tiledImage:a.tiledImage})},clearTilesFor:function(a){e.console.assert(a,"[TileCache.clearTilesFor] tiledImage is required");for(var c,o=0;o<this._tilesLoaded.length;++o)c=this._tilesLoaded[o],c.tiledImage===a&&(this._unloadTile(c),this._tilesLoaded.splice(o,1),o--)},getImageRecord:function(a){return e.console.assert(a,"[TileCache.getImageRecord] cacheKey is required"),this._imagesLoaded[a]},_unloadTile:function(a){e.console.assert(a,"[TileCache._unloadTile] tileRecord is required");var c=a.tile,o=a.tiledImage;c.unload(),c.cacheImageRecord=null;var l=this._imagesLoaded[c.cacheKey];l.removeTile(c),l.getTileCount()||(l.destroy(),delete this._imagesLoaded[c.cacheKey],this._imagesLoadedCount--),o.viewer.raiseEvent("tile-unloaded",{tile:c,tiledImage:o})}}}(r),function(e){e.World=function(i){var n=this;e.console.assert(i.viewer,"[World] options.viewer is required"),e.EventSource.call(this),this.viewer=i.viewer,this._items=[],this._needsDraw=!1,this._autoRefigureSizes=!0,this._needsSizesFigured=!1,this._delegatedFigureSizes=function(a){n._autoRefigureSizes?n._figureSizes():n._needsSizesFigured=!0},this._figureSizes()},e.extend(e.World.prototype,e.EventSource.prototype,{addItem:function(i,n){if(e.console.assert(i,"[World.addItem] item is required"),e.console.assert(i instanceof e.TiledImage,"[World.addItem] only TiledImages supported at this time"),n=n||{},n.index!==void 0){var a=Math.max(0,Math.min(this._items.length,n.index));this._items.splice(a,0,i)}else this._items.push(i);this._autoRefigureSizes?this._figureSizes():this._needsSizesFigured=!0,this._needsDraw=!0,i.addHandler("bounds-change",this._delegatedFigureSizes),i.addHandler("clip-change",this._delegatedFigureSizes),this.raiseEvent("add-item",{item:i})},getItemAt:function(i){return e.console.assert(i!==void 0,"[World.getItemAt] index is required"),this._items[i]},getIndexOfItem:function(i){return e.console.assert(i,"[World.getIndexOfItem] item is required"),e.indexOf(this._items,i)},getItemCount:function(){return this._items.length},setItemIndex:function(i,n){e.console.assert(i,"[World.setItemIndex] item is required"),e.console.assert(n!==void 0,"[World.setItemIndex] index is required");var a=this.getIndexOfItem(i);if(n>=this._items.length)throw new Error("Index bigger than number of layers.");n===a||a===-1||(this._items.splice(a,1),this._items.splice(n,0,i),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:i,previousIndex:a,newIndex:n}))},removeItem:function(i){e.console.assert(i,"[World.removeItem] item is required");var n=e.indexOf(this._items,i);n!==-1&&(i.removeHandler("bounds-change",this._delegatedFigureSizes),i.removeHandler("clip-change",this._delegatedFigureSizes),i.destroy(),this._items.splice(n,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(i))},removeAll:function(){this.viewer._cancelPendingImages();var i,n;for(n=0;n<this._items.length;n++)i=this._items[n],i.removeHandler("bounds-change",this._delegatedFigureSizes),i.removeHandler("clip-change",this._delegatedFigureSizes),i.destroy();var a=this._items;for(this._items=[],this._figureSizes(),this._needsDraw=!0,n=0;n<a.length;n++)i=a[n],this._raiseRemoveItem(i)},resetItems:function(){for(var i=0;i<this._items.length;i++)this._items[i].reset()},update:function(){for(var i=!1,n=0;n<this._items.length;n++)i=this._items[n].update()||i;return i},draw:function(){for(var i=0;i<this._items.length;i++)this._items[i].draw();this._needsDraw=!1},needsDraw:function(){for(var i=0;i<this._items.length;i++)if(this._items[i].needsDraw())return!0;return this._needsDraw},getHomeBounds:function(){return this._homeBounds.clone()},getContentFactor:function(){return this._contentFactor},setAutoRefigureSizes:function(i){this._autoRefigureSizes=i,i&this._needsSizesFigured&&(this._figureSizes(),this._needsSizesFigured=!1)},arrange:function(i){i=i||{};var n=i.immediately||!1,a=i.layout||e.DEFAULT_SETTINGS.collectionLayout,c=i.rows||e.DEFAULT_SETTINGS.collectionRows,o=i.columns||e.DEFAULT_SETTINGS.collectionColumns,l=i.tileSize||e.DEFAULT_SETTINGS.collectionTileSize,u=i.tileMargin||e.DEFAULT_SETTINGS.collectionTileMargin,d=l+u,h;!i.rows&&o?h=o:h=Math.ceil(this._items.length/c);var f=0,p=0,g,w,b,x,j;this.setAutoRefigureSizes(!1);for(var S=0;S<this._items.length;S++)S&&S%h===0&&(a==="horizontal"?(p+=d,f=0):(f+=d,p=0)),g=this._items[S],w=g.getBounds(),w.width>w.height?b=l:b=l*(w.width/w.height),x=b*(w.height/w.width),j=new e.Point(f+(l-b)/2,p+(l-x)/2),g.setPosition(j,n),g.setWidth(b,n),a==="horizontal"?f+=d:p+=d;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var i=this._homeBounds?this._homeBounds.clone():null,n=this._contentSize?this._contentSize.clone():null,a=this._contentFactor||0;if(!this._items.length)this._homeBounds=new e.Rect(0,0,1,1),this._contentSize=new e.Point(1,1),this._contentFactor=1;else{var c=this._items[0],o=c.getBounds();this._contentFactor=c.getContentSize().x/o.width;for(var l=c.getClippedBounds().getBoundingBox(),u=l.x,d=l.y,h=l.x+l.width,f=l.y+l.height,p=1;p<this._items.length;p++)c=this._items[p],o=c.getBounds(),this._contentFactor=Math.max(this._contentFactor,c.getContentSize().x/o.width),l=c.getClippedBounds().getBoundingBox(),u=Math.min(u,l.x),d=Math.min(d,l.y),h=Math.max(h,l.x+l.width),f=Math.max(f,l.y+l.height);this._homeBounds=new e.Rect(u,d,h-u,f-d),this._contentSize=new e.Point(this._homeBounds.width*this._contentFactor,this._homeBounds.height*this._contentFactor)}(this._contentFactor!==a||!this._homeBounds.equals(i)||!this._contentSize.equals(n))&&this.raiseEvent("metrics-change",{})},_raiseRemoveItem:function(i){this.raiseEvent("remove-item",{item:i})}})}(r)})(Qm);var ib=Qm.exports;const Od=Hi(ib),nb=({floorPlanUrl:t,onClose:r,title:e})=>{const i=T.useRef(null),n=T.useRef(null);return T.useEffect(()=>(i.current&&!n.current&&(n.current=Od({element:i.current,tileSources:{type:"image",url:t,buildPyramid:!1},showNavigationControl:!0,navigationControlAnchor:Od.ControlAnchor.TOP_RIGHT,showHomeControl:!0,showZoomControl:!0,showFullPageControl:!1,defaultZoomLevel:0,minZoomLevel:.5,maxZoomLevel:10,visibilityRatio:1,gestureSettingsMouse:{clickToZoom:!0,dblClickToZoom:!0,pinchToZoom:!0,scrollToZoom:!0}}
351)),()=>{n.current&&(n.current.destroy(),n.current=null)}),[t]),T.useEffect(()=>{const a=c=>{c.key==="Escape"&&r()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[r]),s.jsxs("div",{className:"fixed inset-0 z-50 bg-black/90 flex flex-col",children:[s.jsxs("div",{className:"p-4 flex justify-between items-center bg-white/10",children:[s.jsxs("h2",{className:"text-white text-xl font-playfair",children:[e," - Floor Plan"]}),s.jsx("button",{onClick:r,className:"text-white hover:text-gray-300 transition-colors","aria-label":"Close floor plan viewer",children:s.jsx(Bi,{size:24})})]}),s.jsx("div",{ref:i,className:"flex-grow"})]})},To=t=>t?{overview:"Welcome to this stunning custom-built home that seamlessly blends modern design with timeless elegance.",features:["Open-concept living space with soaring ceilings","Gourmet kitchen with premium appliances","Large windows providing abundant natural light","Custom millwork and high-end finishes throughout","Spacious primary suite with luxury ensuite","Professional landscaping with outdoor living space"],highlights:["Smart home technology integration","Energy-efficient systems","Premium construction materials","Designer lighting fixtures","Heated floors in bathrooms","Built-in storage solutions"],neighborhood:["Walking distance to parks and trails","Top-rated schools nearby","Easy access to shopping and dining","Close to major transportation routes","Family-friendly community","Active neighborhood association"]}:{overview:"",features:[],highlights:[],neighborhood:[]},Ns=({title:t,children:r,icon:e})=>{const[i,n]=T.useState(!1);return s.jsxs("div",{className:"border-b border-gray-200",children:[s.jsxs("button",{onClick:()=>n(!i),className:"w-full py-4 flex items-center justify-between text-left",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(e,{className:"w-5 h-5 text-[#C0A458] mr-3"}),s.jsx("span",{className:"text-lg font-playfair",children:t})]}),s.jsx(_w,{className:`w-5 h-5 text-gray-500 transition-transform ${i?"transform rotate-180":""}`})]}),s.jsx("div",{className:`overflow-hidden transition-all duration-300 ${i?"max-h-[1000px] pb-6":"max-h-0"}`,children:r})]})},sb=()=>{var ee,P,k,O,z,D,M;const{id:t}=um(),[r,e]=T.useState(null),[i,n]=T.useState(!0),[a,c]=T.useState(null),[o,l]=T.useState(0),[u,d]=T.useState(!1),[h,f]=T.useState(!1),[p,g]=T.useState({name:"",email:"",phone:"",message:""}),[w,b]=T.useState(!1),[x,j]=T.useState(null),S=T.useRef(null),E=T.useRef(null),R=B=>{window.open(B,"_blank")};T.useEffect(()=>{var B;(B=S.current)==null||B.scrollIntoView({behavior:"smooth"})},[]),T.useEffect(()=>{(async()=>{try{if(!t)throw new Error("No property ID provided");const{data:K,error:se}=await fe.from("properties").select(`
352            *,
353            property_images!property_images_property_id_fkey (
354              id,
355              url,
356              alt,
357              order
358            )
359          `).eq("id",t).single();if(se)throw se;K.property_images&&K.property_images.sort((J,ce)=>J.order-ce.order),e(K)}catch(K){console.error("Error fetching property:",K),c("Failed to load property details")}finally{n(!1)}})()},[t]);const A=async B=>{var K,se,J;B.preventDefault(),b(!0),j(null);try{const ce=B.currentTarget,Fe=new FormData(ce),Pe=Fe.get("name"),Ne=Fe.get("email"),lt=Fe.get("message");if(!(Pe!=null&&Pe.trim()))throw new Error("Please enter your name");if(!(Ne!=null&&Ne.trim()))throw new Error("Please enter your email");if(!(lt!=null&&lt.trim()))throw new Error("Please enter a message");const $r=await fetch("/.netlify/functions/send-inquiry",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Pe.trim(),email:Ne.trim(),phone:(K=Fe.get("phone"))==null?void 0:K.trim(),property:r,message:lt.trim()})});if(!$r.ok){const Ki=await $r.json();throw new Error(Ki.message||"Failed to send inquiry")}const ei={name:Pe.trim(),email:Ne.trim(),phone:((se=Fe.get("phone"))==null?void 0:se.trim())||null,message:`
360Property Inquiry: ${r==null?void 0:r.title}
361
362Property Details:
363Location: ${r==null?void 0:r.location}
364Beds: ${r==null?void 0:r.specs.beds}
365Baths: ${r==null?void 0:r.specs.baths}
366Sqft: ${r==null?void 0:r.specs.sqft}
367
368Message:
369${lt.trim()}
370
371Contact Details:
372Name: ${Pe.trim()}
373Email: ${Ne.trim()}
374Phone: ${((J=Fe.get("phone"))==null?void 0:J.trim())||"Not provided"}
375        `.trim()},{error:kr}=await fe.from("contact_submissions").insert([ei]);kr&&console.error("Database save error:",kr),ce.reset(),g({name:"",email:"",ph
375one:"",message:""}),alert("Thank you for your interest! Our team will contact you shortly.")}catch(ce){console.error("Error submitting form:",ce),j(ce instanceof Error?ce.message:"There was an error submitting your inquiry. Please try again.")}finally{b(!1)}},I=()=>{var B;(B=r==null?void 0:r.property_images)!=null&&B.length&&l(K=>(K+1)%r.property_images.length)},H=()=>{var B;(B=r==null?void 0:r.property_images)!=null&&B.length&&l(K=>(K-1+r.property_images.length)%r.property_images.length)},W=B=>{u&&(B.key==="ArrowRight"&&I(),B.key==="ArrowLeft"&&H(),B.key==="Escape"&&d(!1))};T.useEffect(()=>(window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)),[u,r]);const Z=()=>{if(r!=null&&r.location){const B=encodeURIComponent(r.location);window.open(`https://www.google.com/maps/search/?api=1&query=${B}`,"_blank")}};if(i)return s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.jsx("p",{className:"text-center",children:"Loading property details..."})})});if(a||!r)return s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-2xl font-playfair mb-4",children:"Error"}),s.jsx("p",{className:"text-gray-600 mb-8",children:a||"Property not found"}),s.jsx(le,{to:"/projects",className:"inline-block px-6 py-2 bg-[#C0A458] text-white rounded-md hover:bg-[#9A834A] transition-colors",children:"Back to Projects"})]})})});const $=(P=(ee=r.property_images)==null?void 0:ee[o])==null?void 0:P.url,X=((O=(k=r.property_images)==null?void 0:k[o])==null?void 0:O.alt)||r.title;return s.jsxs("div",{ref:S,className:"min-h-screen bg-white pt-20",children:[s.jsxs("div",{className:"relative h-[80vh] bg-gray-100",children:[s.jsx("img",{src:$||"https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80",alt:X,className:"w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/30 to-transparent"}),r.property_images&&r.property_images.length>1&&s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:H,className:"absolute left-4 top-1/2 -translate-y-1/2 bg-white/80 p-2 rounded-full hover:bg-white transition-colors",children:s.jsx(Ed,{size:24})}),s.jsx("button",{onClick:I,className:"absolute right-4 top-1/2 -translate-y-1/2 bg-white/80 p-2 rounded-full hover:bg-white transition-colors",children:s.jsx(Ce,{size:24})})]}),s.jsx("button",{onClick:()=>d(!0),className:"absolute bottom-4 right-4 bg-white/80 p-2 rounded-full hover:bg-white transition-colors",children:s.jsx(Ew,{size:24})}),s.jsxs("div",{className:"absolute bottom-4 left-4 bg-black/50 text-white px-3 py-1 rounded-full text-sm",children:[o+1," / ",((z=r.property_images)==null?void 0:z.length)||1]})]}),u&&s.jsxs("div",{className:"fixed inset-0 bg-black z-50 flex items-center justify-center",children:[s.jsx("button",{onClick:()=>d(!1),className:"absolute top-4 right-4 text-white hover:text-gray-300 z-10",children:s.jsx(Bi,{size:24})}),s.jsxs("div",{className:"relative w-full h-full",children:[s.jsx("img",{src:$||"https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80",alt:X,className:"absolute inset-0 w-full h-full object-contain"}),r.property_images&&r.property_images.length>1&&s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:H,className:"absolute left-4 top-1/2 -translate-y-1/2 bg-white/10 hover:bg-white/20 p-4 rounded-full text-white transition-colors",children:s.jsx(Ed,{size:32})}),s.jsx("button",{onClick:I,className:"absolute right-4 top-1/2 -translate-y-1/2 bg-white/10 hover:bg-white/20 p-4 rounded-full text-white transition-colors",children:s.jsx(Ce,{size:32})})]}),s.jsx("div",{className:"absolute bottom-0 inset-x-0 bg-black/50 p-4",children:s.jsx("div",{className:"flex space-x-2 overflow-x-auto",children:(D=r.property_images)==null?void 0:D.map((B,K)=>s.jsx("button",{onClick:()=>l(K),className:`flex-shrink-0 relative ${o===K?"ring-2 ring-white":""}`,children:s.jsx("img",{src:B.url,alt:B.alt||`Property image ${K+1}`,className:"h-20 w-32 object-cover rounded"})},B.id))})})]})]}),s.jsx("div",{className:"bg-[#F5F5DC] py-8",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-4xl font-playfair mb-2",children:r.title}),s.jsxs("button",{onClick:Z,className:"inline-flex items-center text-gray-600 hover:text-[#C0A458] transition-colors group",children:[s.jsx(Ht,{size:18,className:"mr-2"}),s.jsx("span",{className:"mr-2",children:r.location}),s.jsx(Dw,{size:16,className:"transform group-hover:translate-x-1 transition-transform"})]})]})})}),s.jsx("div",{className:"border-b border-gray-200 py-6",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 ga
375p-6 text-center",children:[s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(Hr,{size:24,className:"text-[#C0A458]"}),s.jsxs("span",{className:"mt-2 font-bold text-[#1A1A1A]",children:[r.specs.beds," Beds"]})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(Vm,{size:24,className:"text-[#C0A458]"}),s.jsxs("span",{className:"mt-2 font-bold text-[#1A1A1A]",children:[r.specs.baths," Baths"]})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(kd,{size:24,className:"text-[#C0A458]"}),s.jsxs("span",{className:"mt-2 font-bold text-[#1A1A1A]",children:[(M=r.specs.sqft)==null?void 0:M.toLocaleString()," Sq Ft"]})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(Xm,{size:24,className:"text-[#C0A458]"}),s.jsx("span",{className:"mt-2 font-bold text-[#1A1A1A]",children:r.specs.lotSize||"N/A"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(jw,{size:24,className:"text-[#C0A458]"}),s.jsxs("span",{className:"mt-2 font-bold text-[#1A1A1A]",children:["Built ",r.specs.yearBuilt]})]})]})})}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[s.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[s.jsx(Ns,{title:"Floor Plans",icon:Il,children:s.jsx("div",{className:"grid grid-cols-1 gap-4",children:r.main_floor_plan_url||r.second_floor_plan_url?s.jsxs(s.Fragment,{children:[r.main_floor_plan_url&&s.jsxs("button",{onClick:()=>R(r.main_floor_plan_url),className:"flex items-center space-x-3 p-4 bg-[#F5F5DC] hover:bg-[#C0A458] text-[#C0A458] hover:text-white rounded-lg transition-colors",children:[s.jsx(Hr,{className:"flex-shrink-0",size:24}),s.jsx("span",{className:"font-medium",children:"Main Floor Plan"})]}),r.second_floor_plan_url&&s.jsxs("button",{onClick:()=>R(r.second_floor_plan_url),className:"flex items-center space-x-3 p-4 bg-[#F5F5DC] hover:bg-[#C0A458] text-[#C0A458] hover:text-white rounded-lg transition-colors",children:[s.jsx(Il,{className:"flex-shrink-0",size:24}),s.jsx("span",{className:"font-medium",children:"Second Floor Plan"})]})]}):s.jsx("p",{className:"text-gray-500 text-center py-4",children:"Floor plans not available for this property"})})}),s.jsx(Ns,{title:"Key Features",icon:Hr,children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:To(r.description).features.map((B,K)=>s.jsxs("div",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsx("span",{className:"text-gray-600",children:B})]},K))})}),s.jsx(Ns,{title:"Property Details",icon:kd,children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:To(r.description).highlights.map((B,K)=>s.jsxs("div",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsx("span",{className:"text-gray-600",children:B})]},K))})}),s.jsxs(Ns,{title:"Neighborhood & Schools",icon:Ht,children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:To(r.description).neighborhood.map((B,K)=>s.jsxs("div",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsx("span",{className:"text-gray-600",children:B})]},K))}),s.jsx("div",{className:"mt-6",children:s.jsx("div",{className:"aspect-video w-full rounded-lg overflow-hidden shadow-lg",children:s.jsx("iframe",{title:"Property Location",width:"100%",height:"100%",frameBorder:"0",style:{border:0},src:`https://www.google.com/maps/embed/v1/place?key=AIzaSyD18IgtJ0sgvVH4i6x0ALUROEL300io3vY&q=${encodeURIComponent(r.location)}`,allowFullScreen:!0})})})]})]}),s.jsx("div",{className:"lg:col-span-1",children:s.jsxs("div",{className:"bg-gray-50 rounded-lg p-6 sticky top-24",children:[s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Interested in this property?"}),x&&s.jsx("div",{className:"mb-4 p-4 bg-red-50 text-red-600 rounded-md text-sm",children:x}),s.jsxs("form",{onSubmit:A,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Name *"}),s.jsx("input",{type:"text",name:"name",required:!0,className:"w-full p-2 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email *"}),s.jsx("input",{type:"email",name:"email",required:!0,className:"w-full p-2 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Phone"}),s.jsx("input",{type:"tel",name:"phone",className:"w-full p-2 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message *"}),s.jsx("textarea",{name:"message",rows:4,required:!0,className:"w-full p-2 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",placeholder:"I'm interested in learning more about this property..."})]}),s.jsx("button",{type:"submit",disabled:w,className:"w-full bg-[#C0A458] text-white py-2 px-4 roun
375ded-md hover:bg-[#9A834A] transition-colors flex items-center justify-center disabled:opacity-50",children:w?s.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}):s.jsxs(s.Fragment,{children:[s.jsx(Mi,{size:18,className:"mr-2"}),"Email Agent"]})})]})]})})]}),r.property_images&&r.property_images.length>1&&s.jsxs("div",{className:"mt-12",ref:E,children:[s.jsx("h2",{className:"text-2xl font-playfair mb-6",children:"Property Gallery"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:r.property_images.map((B,K)=>s.jsxs("button",{onClick:()=>{l(K),d(!0)},className:"group relative overflow-hidden aspect-[4/3] rounded-lg",children:[s.jsx("img",{src:B.url,alt:B.alt||`Property image ${K+1}`,className:"w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-500"}),s.jsx("div",{className:"absolute inset-0 bg-black/30 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center",children:s.jsx(Hw,{className:"text-white",size:24})})]},B.id))})]})]}),h&&r.floor_plan_url&&s.jsx(nb,{floorPlanUrl:r.floor_plan_url,onClose:()=>f(!1),title:r.title})]})},ab=()=>{const[t,r]=T.useState([]),[e,i]=T.useState(!0);return T.useEffect(()=>{(async()=>{try{const{data:a,error:c}=await fe.from("properties").select(`
376            *,
377            property_images!property_images_property_id_fkey (
378              id,
379              url,
380              alt,
381              order
382            )
383          `).order("created_at",{ascending:!1});if(c)throw c;const o=(a==null?void 0:a.map(l=>{var u;return{...l,property_images:(u=l.property_images)==null?void 0:u.sort((d,h)=>d.order-h.order)}}))||[];r(o)}catch(a){console.error("Error fetching projects:",a)}finally{i(!1)}})()},[]),e?s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-playfair mb-4",children:"Custom Home Projects in Edmonton (Portfolio)"}),s.jsx("p",{className:"text-gray-600",children:"Loading projects..."})]})})}):s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-playfair mb-4",children:"Custom Home Projects in Edmonton (Portfolio)"}),s.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"From concept to completion, we bring your vision to life with meticulous attention to detail. Explore our collection of luxury custom homes built throughout Edmonton and Spruce Grove."})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map(n=>{var c,o;const a=(c=n.property_images)==null?void 0:c[0];return s.jsx(le,{to:`/projects/${n.id}`,className:"group",children:s.jsxs("div",{className:"bg-white rounded-lg overflow-hidden shadow-lg transition-shadow duration-300 hover:shadow-xl",children:[s.jsxs("div",{className:"relative overflow-hidden aspect-[4/3]",children:[s.jsx("img",{src:(a==null?void 0:a.url)||"/placeholder-home.jpg",alt:(a==null?void 0:a.alt)||n.title,className:"w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-700",onError:l=>{const u=l.target;u.src="https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80"}}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"})]}),s.jsxs("div",{className:"p-6",children:[s.jsx("h3",{className:"text-2xl font-playfair mb-2",children:n.title}),s.jsxs("p",{className:"text-gray-600 flex items-center mb-4",children:[s.jsx(Ht,{size:18,className:"text-[#C0A458] mr-2"}),n.location]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-6 text-sm",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("span",{className:"block text-gray-600",children:"Beds"}),s.jsx("span",{className:"font-semibold",children:n.specs.beds||"N/A"})]}),s.jsxs("div",{className:"text-center border-x border-gray-200",children:[s.jsx("span",{className:"block text-gray-600",children:"Baths"}),s.jsx("span",{className:"font-semibold",children:n.specs.baths||"N/A"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("span",{className:"block text-gray-600",children:"Sq Ft"}),s.jsx("span",{className:"font-semibold",children:((o=n.specs.sqft)==null?void 0:o.toLocaleStr
383ing())||"N/A"})]})]}),s.jsxs("div",{className:"flex items-center text-[#C0A458] group-hover:translate-x-2 transition-transform duration-300",children:["View Details",s.jsx(xe,{className:"ml-2",size:18})]})]})]})},n.id)})})]})})},ob=()=>s.jsxs("div",{className:"text-center space-y-6 bg-[#F5F5DC] p-8 rounded-lg",children:[s.jsx("h3",{className:"text-2xl font-playfair text-gray-900",children:"Follow Our Journey"}),s.jsx("p",{className:"text-gray-600",children:"Stay connected with us on social media for daily inspiration, behind-the-scenes content, and project updates."}),s.jsxs("div",{className:"flex justify-center space-x-6",children:[s.jsx("a",{href:"https://www.instagram.com/castlestone.customhomes/",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ba,{size:28})}),s.jsx("a",{href:"https://www.facebook.com/jessie.s.sahota/reels/",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ma,{size:28})}),s.jsx("a",{href:"https://linkedin.com/company/castlestonecustomhomes",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ha,{size:28})})]}),s.jsxs("div",{className:"mt-6 space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Tag us in your posts: #CastleStoneHomes #LuxuryLiving #CustomHomes"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Follow us on Instagram for exclusive content and design inspiration!"})]})]}),lb=t=>{const r=t.replace(/\D/g,"");return r.length<=3?r:r.length<=6?`${r.slice(0,3)}-${r.slice(3)}`:`${r.slice(0,3)}-${r.slice(3,6)}-${r.slice(6,10)}`},cb=()=>{var I,H;const[t,r]=T.useState(0),[e,i]=T.useState([]),[n,a]=T.useState(!0),[c,o]=T.useState(null),[l,u]=T.useState(!1),[d,h]=T.useState(!1),[f,p]=T.useState(!1),[g,w]=T.useState({type:null,message:""}),b=T.useRef(null);T.useEffect(()=>{(async()=>{try{const{data:Z,error:$}=await fe.from("stories").select(`
384            *,
385            story_images (
386              id,
387              url,
388              alt,
389              order
390            )
391          `).order("date",{ascending:!1});if($)throw $;const X=(Z==null?void 0:Z.map(ee=>{var P;return{...ee,story_images:(P=ee.story_images)==null?void 0:P.sort((k,O)=>k.order-O.order)}}))||[];i(X)}catch(Z){console.error("Error fetching stories:",Z),o(Z instanceof Error?Z.message:"Failed to load stories")}finally{a(!1)}})()},[]);const x=()=>{r(W=>(W+1)%e.length)},j=()=>{r(W=>(W-1+e.length)%e.length)},S=W=>{const Z=lb(W.target.value);(Z===""||/^\d{3}-\d{3}-\d{4}$/.test(Z)||Z.length<12)&&(W.target.value=Z)},E=async W=>{var Z;W.preventDefault(),h(!0),w({type:null,message:""});try{const $=new FormData(W.currentTarget),X=$.get("phone");if(!/^\d{3}-\d{3}-\d{4}$/.test(X))throw new Error("Please enter a valid phone number in the format 123-456-7890");const ee=["name","email","phone","project_type","timeline","vision"];for(const O of ee){const z=$.get(O);if(!z||typeof z=="string"&&!z.trim())throw new Error("Please fill in all required fields")}const P={name:$.get("name"),email:$.get("email"),phone:X,project_type:$.get("project_type"),budget_range:"1m-2m",timeline:$.get("timeline"),location:"",requirements:$.get("vision"),preferred_contact_method:"email"},{error:k}=await fe.from("project_inquiries").insert([P]);if(k)throw k;w({type:"success",message:"Thank you for sharing your dream with us. We'll be in touch soon!"}),(Z=b.current)==null||Z.reset(),p(!0)}catch($){console.error("Error submitting inquiry:",$),w({type:"error",message:$ instanceof Error?$.message:"There was an error submitting your inquiry. Please try again."})}finally{h(!1)}};if(n)return s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsx("div",{className:"flex justify-center py-24",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#C0A458]"})})})});if(c)return s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsx("div",{className:"flex justify-center py-24",children:s.jsxs("div",{className:"inline-flex items-center justify-center p-4 bg-red-50 text-red-600 rounded-lg",children:[s.jsx(Dt,{className:"mr-2"}),c]})})})});const R=e[t],A=((H=(I=R==null?void 0:R.story_images)==null?void 0:I[0])==null?void 0:H.url)||"https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80";return s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsx("div",{className:"relative bg-gray-50 py-24",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsx("h2",{className:"text-4xl md:text-5xl font-playfair text-center mb-16",children:"There's More to Our Story"}),e.length>0?s.jsxs("div",{className:"relative",children:[s.jsxs("div",{className:"overflow-hidden",children:[s.jsxs("div",{className:"relative aspect-[16/9] rounded-lg overflow-hidden mb-8",children:[s.jsx("img",{src:A,alt:R.title,className:"absolute inset-0 w-full h-full object-cover",onError:W=>{const Z=W.target;Z.src="https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80"}}),s.jsx("div",{className:"absolute inset-0 bg-black/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-8 text-white",children:s.jsxs("div",{className:"max-w-3xl",children:[s.jsx("p",{className:"text-[#C0A458] mb-2",children:new Date(R.date).getFullYear()}),s.jsx("h3",{className:"text-3xl font-playfair mb-4",children:R.title}),s.jsx("p",{className:"text-lg text-gray-200",children:R.description}),s.jsxs(le,{to:`/about/story/${R.id}`,className:"inline-flex items-center text-white hover:text-[#C0A458] transition-colors mt-4",children:["Read Full Story",s.jsx(xe,{className:"ml-2"})]})]})})]}),s.jsx("div",{className:"max-w-3xl mx-auto",children:s.jsx("p",{className:"text-gray-600 leading-relaxed mb-8",children:R.content.split(`
392
393`)[0]})})]}),e.length>1&&s.jsxs("div",{className:"flex justify-between items-center mt-8",children:[s.jsxs("button",{onClick:j,className:"flex items-center text-gray-600 hover:text-[#C0A458] transition-colors",children:[s.jsx(Ll,{className:"mr-2"}),"Previous Story"]}),s.jsx("div",{className:"flex space-x-2",children:e.map((W,Z)=>s.jsx("button",{onClick:()=>r(Z),className:`w-2 h-2 rounded-full transition-colors ${t===Z?"bg-[#C0A458]":"bg-gray-300"}`},Z))}),s.jsxs("button",{onClick:x,className:"flex items-center text-gray-600 hover:text-[#C0A458] transition-colors",children:["Next Story",s.jsx(xe,{className:"ml-2"})]})]})]}):s.jsx("div",{className:"text-center text-gray-600",children:"No stories available yet."})]})}),s.jsx("div",{className:"py-24",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair text-center mb-8",children:"Our Foundation: Quality, Innovation, Transparency"}),s.jsx("p",{className:"text-xl text-gray-600 text-center max-w-3xl mx-auto mb-16",children:"We exist to deliver homes that defy expectations. Every Castle Stone build merges cutting-edge technology with timeless design, all anchored by meticulous craftsmanship. From $500K duplexes to $5M estates, we treat every project as a legacy."}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12",children:[s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Nw,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Innovation"}),s.jsx("p",{className:"text-gray-600",children:"Smart home integration · Energy-efficient systems"})]}),s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Zm,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Quality"}),s.jsx("p",{className:"text-gray-600",children:"Premium materials · 200+ point inspection process"})]}),s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Fw,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Transparency"}),s.jsx("p",{className:"text-gray-600",children:"Bi-weekly video updates · Open site visits"})]})]})]})}),s.jsxs("div",{className:"relative py-24 bg-gray-900",children:[s.jsx("div",{className:"absolute inset-0 opacity-20",children:s.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("pattern",{id:"blueprint",x:"0",y:"0",width:"20",height:"20",patternUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"#C0A458",strokeWidth:"0.5"})}),s.jsx("rect",{x:"0",y:"0",width:"100",height:"100",fill:"url(#blueprint)"})]})}),s.jsxs("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[s.jsx("h2",{className:"text-4xl md:text-5xl font-playfair text-white mb-8",children:"Your Vision, Our Blueprint"}),s.jsxs("button",{onClick:()=>u(!0),className:"inline-flex items-center px-8 py-3 border border-[#C0A458] text-[#C0A458] hover:bg-[#C0A458] hover:text-white transition-all duration-300 text-lg group",children:["Start Your Build",s.jsx(Ce,{className:"ml-2 group-hover:translate-x-1 transition-transform duration-300"})]})]})]}),s.jsx("div",{className:"py-24",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[s.jsxs("div",{className:"order-2 lg:order-1 relative",children:[s.jsx("img",{src:"https://images.unsplash.com/photo-1582540730843-f4418d96ccbe?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80",alt:"Steel beam construction",className:"rounded-lg shadow-xl"}),s.jsxs("div",{className:"absolute -bottom-6 -right-6 bg-[#F5F5DC] p-6 rounded-lg shadow-lg",children:[s.jsx("p",{className:"text-2xl font-playfair text-[#C0A458]",children:"40ft+"}),s.jsx("p",{className:"text-gray-600",children:"Clear Spans"})]})]}),s.jsxs("div",{className:"order-1 lg:order-2",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair mb-6",children:"Engineering Excellence with Steel Beam Construction"}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Our innovative use of steel beam construction allows us to create expansive, open-concept living space
393s that would be impossible with traditional building methods. These architectural marvels don't just support your home—they define it."}),s.jsxs("ul",{className:"space-y-4",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx(Cs,{className:"text-[#C0A458] mt-1 mr-3",size:20}),s.jsx("span",{className:"text-gray-600",children:"Spans of 40+ feet without support columns"})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(Cs,{className:"text-[#C0A458] mt-1 mr-3",size:20}),s.jsx("span",{className:"text-gray-600",children:"Floor-to-ceiling windows and sliding doors"})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(Cs,{className:"text-[#C0A458] mt-1 mr-3",size:20}),s.jsx("span",{className:"text-gray-600",children:"Enhanced structural integrity and longevity"})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(Cs,{className:"text-[#C0A458] mt-1 mr-3",size:20}),s.jsx("span",{className:"text-gray-600",children:"Flexible floor plans for future modifications"})]})]})]})]})]})})}),l&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-2xl w-full max-h-[90vh] overflow-y-auto relative",children:[s.jsx("button",{onClick:()=>u(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600",children:"×"}),f?s.jsx(ob,{}):s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"text-2xl font-playfair mb-6",children:"Tell Us About Your Dream Home"}),g.type&&s.jsx("div",{className:`mb-6 p-4 rounded-md ${g.type==="success"?"bg-green-50 text-green-800":"bg-red-50 text-red-800"}`,children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Dt,{className:"mr-2",size:20}),g.message]})}),s.jsxs("form",{ref:b,onSubmit:E,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"What type of project are you interested in? *"}),s.jsxs("select",{name:"project_type",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50",children:[s.jsx("option",{value:"",children:"Select Type"}),s.jsx("option",{value:"custom_home",children:"Custom Home Build"}),s.jsx("option",{value:"renovation",children:"Major Renovation"}),s.jsx("option",{value:"addition",children:"Addition"}),s.jsx("option",{value:"other",children:"Other"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"What's your desired timeline? *"}),s.jsxs("select",{name:"timeline",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50",children:[s.jsx("option",{value:"",children:"Select Timeline"}),s.jsx("option",{value:"immediate",children:"Within 6 months"}),s.jsx("option",{value:"6-12months",children:"6-12 months"}),s.jsx("option",{value:"1-2years",children:"1-2 years"}),s.jsx("option",{value:"exploring",children:"Just exploring options"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"Tell us about your vision *"}),s.jsx("textarea",{name:"vision",rows:4,required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50",placeholder:"Describe your dream project..."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"Name *"}),s.jsx("input",{type:"text",name:"name",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"Phone *"}),s.jsx("input",{type:"tel",name:"phone",required:!0,pattern:"\\d{3}-\\d{3}-\\d{4}",placeholder:"123-456-7890",onChange:S,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Format: 123-456-7890"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-gray-700 text-sm font-medium mb-2",children:"Email *"}),s.jsx("input",{type:"email",name:"email",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:border-[#C0A458] focus:ring focus:ring-[#C0A458] focus:ring-opacity-50"})]}),s.jsxs("div",{className:"flex justify-end space-x-4",children:[s.jsx("button",{type:"button",onClick:()=>u(!1),className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancel"}),s.jsx("button",{type:"submit",disabled:d,className:"px-6 py-2 bg-[#C0A458] text-white rounded-md hover:bg-[#9A834A] transition-colors flex items-center disabled:opacity-50",children:d?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Submitting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Mi,{size:18,className:"mr-2"}),"Submit"]})})]})]})]})]})})]})},Dd=()=>s.jsxs("div",{className:"text-center space-y-6 bg-[#F5F5DC] p-8 rounded-lg",children:[s.jsx("h3",{className:"text-2xl font-playfair text-gray-900",children:"Follow Our Journey"}),s.jsx("p",{className:"text-gray-600",children:"Stay connected with us on social media for daily inspiration, behind-the-scenes content, and project updates."}),s.jsxs("div",{className:"flex justify-center space-x-6",children:[s.jsx("a",{href:"https://www.instagram.com/castlestone.customhomes/",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ba,{size:28})}),s.jsx("a",{href:"https://www.facebook.com/jessie.s.sahota/reels/",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ma,{size:28})}),s.jsx("a",{href:"https://linkedin.com/company/castlestonecustomhomes",target:"_blank",rel:"noopener noreferrer",className:"p-4 bg-white text-[#C0A458] rounded-full hover:bg-[#C0A458] hover:text-white transition-colors shadow-md",children:s.jsx(Ha,{size:28})})]}),s.jsxs("div",{className:"mt-6 space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Tag us in your posts: #CastleStoneHomes #LuxuryLiving #CustomHomes"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Follow us on Instagram for exclusive content and design inspiration!"})]})]}),ub=t=>{const r=t.replace(/\D/g,"");return r.length<=3?r:r.length<=6?`${r.slice(0,3)}-${r.slice(3)}`:`${r.slice(0,3)}-${r.slice(3,6)}-${r.slice(6,10)}`},db=()=>{const[t,r]=T.useState(null),[e,i]=T.useState({type:null,message:""}),[n,a]=T.useState(!1),[c,o]=T.useState(!1),[l,u]=T.useState({type:null,message:""}),d=T.useRef(null),h=T.useRef(null),f=T.useRef(null),p=x=>{const j=ub(x.target.value);(j===""||/^\d{3}-\d{3}-\d{4}$/.test(j)||j.length<12)&&(x.target.value=j)},g=async x=>{var j;x.preventDefault();try{const S=new FormData(x.currentTarget),E=S.get("phone");if(E&&!/^\d{3}-\d{3}-\d{4}$/.test(E))throw new Error("Please enter a valid phone number in the format 123-456-7890");const R={name:S.get("name"),email:S.get("email"),phone:E,message:S.get("message")},{error:A}=await fe.from("contact_submissions").insert([R]);if(A||No("contact"),A)throw A;
393i({type:"success",message:"Thank you for your message. We'll be in touch soon!"}),(j=d.current)==null||j.reset(),o(!0)}catch(S){i({type:"error",message:S instanceof Error?S.message:"There was an error submitting your message. Please try again."})}},w=async x=>{var j;x.preventDefault();try{const S=new FormData(x.currentTarget),E=S.get("phone");if(!/^\d{3}-\d{3}-\d{4}$/.test(E))throw new Error("Please enter a valid phone number in the format 123-456-7890");const R={name:S.get("name"),email:S.get("email"),phone:E,project_type:S.get("project_type"),budget_range:S.get("budget_range"),timeline:S.get("timeline"),location:S.get("location"),requirements:S.get("requirements"),preferred_contact_method:S.get("preferred_contact")},{error:A}=await fe.from("project_inquiries").insert([R]);if(A||No("project"),A)throw A;i({type:"success",message:"Thank you for your inquiry. Our team will contact you shortly!"}),(j=h.current)==null||j.reset(),o(!0)}catch(S){i({type:"error",message:S instanceof Error?S.message:"There was an error submitting your inquiry. Please try again."})}},b=async x=>{var S;x.preventDefault();const j=new FormData(x.currentTarget);try{const E=Array.from(j.getAll("interests")),R=j.get("email");if(!R)throw new Error("Email is required");const A={email:R,interests:E},{error:I}=await fe.from("newsletter_subscribers").insert([A]);if(I||No("newsletter"),I)throw I.code==="23505"?new Error("You are already subscribed to our newsletter!"):I;u({type:"success",message:"Thank you for subscribing to our newsletter!"}),a(!0),(S=f.current)==null||S.reset()}catch(E){u({type:"error",message:E instanceof Error?E.message:"Failed to subscribe. Please try again."})}};return s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsxs("div",{className:"relative h-[40vh] bg-black",children:[s.jsx("div",{className:"absolute inset-0",children:s.jsx("img",{src:"https://images.unsplash.com/photo-1497366216548-37526070297c?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80",alt:"Contact Us",className:"w-full h-full object-cover opacity-50"})}),s.jsx("div",{className:"relative h-full flex items-center justify-center text-center",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-playfair text-white mb-4",children:"Get in Touch"}),s.jsx("p",{className:"text-xl text-gray-200",children:"Let's discuss your dream home"})]})})]}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 mb-16",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-4",children:s.jsx(Ua,{size:24})}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Call Us"}),s.jsx("p",{className:"text-gray-600",children:s.jsx("a",{href:"tel:+17802426941",className:"hover:text-[#C0A458]",children:"(780) 242-6941"})})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-4",children:s.jsx(Vn,{size:24})}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Email Us"}),s.jsx("p",{className:"text-gray-600",children:s.jsx("a",{href:"mailto:[email protected]",className:"hover:text-[#C0A458]",children:"[email protected]"})})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-4",children:s.jsx(Ht,{size:24})}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Visit Us"}),s.jsxs("p",{className:"text-gray-600",children:["Lake Ridge Estates",s.jsx("br",{}),"53217 Range Rd 263 #19",s.jsx("br",{}),"Spruce Grove, AB T7Y 1E2"]})]})]}),s.jsxs("div",{className:"flex justify-center space-x-4 mb-12",children:[s.jsx("button",{onClick:()=>r("contact"),className:`px-6 py-2 rounded-md transition-colors ${t==="contact"?"bg-[#C0A458] text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
393`,children:"Quick Contact"}),s.jsx("button",{onClick:()=>r("project"),className:`px-6 py-2 rounded-md transition-colors ${t==="project"?"bg-[#C0A458] text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:"Project Inquiry"})]}),e.type&&s.jsx("div",{className:`mb-8 p-4 rounded-md ${e.type==="success"?"bg-green-50 text-green-800":"bg-red-50 text-red-800"}`,children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Dt,{className:"mr-2",size:20}),e.message]})}),c&&s.jsx("div",{className:"mb-12 animate-fade-in",children:s.jsx(Dd,{})}),t==="contact"&&!c&&s.jsxs("form",{ref:d,onSubmit:g,className:"max-w-2xl mx-auto",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Name"}),s.jsx("input",{type:"text",name:"name",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),s.jsx("input",{type:"email",name:"email",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone (Optional)"}),s.jsx("input",{type:"tel",name:"phone",pattern:"\\d{3}-\\d{3}-\\d{4}",placeholder:"123-456-7890",onChange:p,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Format: 123-456-7890"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Message"}),s.jsx("textarea",{name:"message",required:!0,rows:4,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("button",{type:"submit",className:"w-full bg-[#C0A458] text-white py-3 px-6 rounded-md hover:bg-[#9A834A] transition-colors flex items-center justify-center",children:[s.jsx(Mi,{size:18,className:"mr-2"}),"Send Message"]})]}),t==="project"&&!c&&s.jsxs("form",{ref:h,onSubmit:w,className:"max-w-2xl mx-auto",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Name"}),s.jsx("input",{type:"text",name:"name",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),s.jsx("input",{type:"email",name:"email",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone"}),s.jsx("input",{type:"tel",name:"phone",required:!0,pattern:"\\d{3}-\\d{3}-\\d{4}",placeholder:"123-456-7890",onChange:p,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Format: 123-456-7890"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Project Type"}),s.jsxs("select",{name:"project_type",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",children:[s.jsx("option",{value:"",children:"Select Type"}),s.jsx("option",{value:"custom_home",children:"Custom Home"}),s.jsx("option",{value:"renovation",children:"Major Renovation"}),s.jsx("option",{value:"addition",children:"Home Addition"}),s.jsx("option",{value:"commercial",children:"Commercial Project"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Budget Range"}),s.jsxs("select",{name:"budget_range",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",children:[s.jsx("option",{value:"",children:"Select Range"}
393),s.jsx("option",{value:"500k-1m",children:"$500K - $1M"}),s.jsx("option",{value:"1m-2m",children:"$1M - $2M"}),s.jsx("option",{value:"2m-3m",children:"$2M - $3M"}),s.jsx("option",{value:"3m+",children:"$3M+"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Timeline"}),s.jsxs("select",{name:"timeline",required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",children:[s.jsx("option",{value:"",children:"Select Timeline"}),s.jsx("option",{value:"immediate",children:"Ready to Start"}),s.jsx("option",{value:"3-6months",children:"3-6 Months"}),s.jsx("option",{value:"6-12months",children:"6-12 Months"}),s.jsx("option",{value:"12months+",children:"12+ Months"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Location"}),s.jsx("input",{type:"text",name:"location",placeholder:"City/Area",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Project Requirements"}),s.jsx("textarea",{name:"requirements",rows:4,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",placeholder:"Tell us about your vision..."})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Preferred Contact Method"}),s.jsxs("div",{className:"flex space-x-4",children:[s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"radio",name:"preferred_contact",value:"email",defaultChecked:!0,className:"mr-2"}),"Email"]}),s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"radio",name:"preferred_contact",value:"phone",className:"mr-2"}),"Phone"]})]})]}),s.jsxs("button",{type:"submit",className:"w-full bg-[#C0A458] text-white py-3 px-6 rounded-md hover:bg-[#9A834A] transition-colors flex items-center justify-center",children:[s.jsx(Mi,{size:18,className:"mr-2"}),"Submit Inquiry"]})]}),s.jsxs("div",{className:"mt-24 max-w-2xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("h2",{className:"text-2xl font-playfair mb-2",children:"Stay Updated"}),s.jsx("p",{className:"text-gray-600",children:"Subscribe to our newsletter for the latest projects and design inspiration."})]}),l.type&&s.jsx("div",{className:`mb-8 p-4 rounded-md ${l.type==="success"?"bg-green-50 text-green-800":"bg-red-50 text-red-800"}`,children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Dt,{className:"mr-2",size:20}),l.message]})}),n?s.jsx(Dd,{}):s.jsxs("form",{ref:f,onSubmit:b,className:"space-y-6",children:[s.jsx("div",{children:s.jsx("input",{type:"email",name:"email",required:!0,placeholder:"Enter your email",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-700 mb-2",children:"I'm interested in:"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",name:"interests",value:"custom_homes",className:"mr-2"}),"Custom Homes"]}),s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",name:"interests",value:"renovations",className:"mr-2"}),"Renovations"]}),s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",name:"interests",value:"design_tips",className:"mr-2"}),"Design Tips"]}),s.jsxs("label",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",name:"interests",value:"market_updates",className:"mr-2"}),"Market Updates"]})]})]}),s.jsx("button",{type:"submit",className:"w-full bg-black text-white py-3 px-6 rounded-md hover:bg-gray-800 transition-colors flex items-center justify-center",children:"Subscribe to Newsletter"})]})]})]})]})},hb=async t=>{try{const r=t.name.split(".").pop(),e=`property-${Date.now()}-${Math.random().toString(36).substring(2,7)}.${r}`,{data:i,error:n}=await fe.storage.from("property-images").upload(e,t,{cacheControl:"3600",upsert:!1});if(n)throw n;const{data:{publicUrl:a}}=fe.storage.from("property-images").getPublicUrl(i.path);return a}catch(r){throw console.error("Error uploading image:",r),new Error("Failed to upload image")}},Jm=({onUploadComplete:t,onError:r,existingImages:e=[],onRemoveImage:i})=>{const[n,a]=T.useState(!1),[c,o]=T.useState(!1),[l,u]=T.useState({stage:"complete",message:""}),[d,h]=T.useState(null),f=T.useCallback(async b=>{try{if(a(!0),h(null),u({stage:"validating",message:"Checking file..."}),!b.type.startsWith("image/"))throw new Error("Please upload an image file (JPG, PNG, etc.)");const x=50*1024*1024;if(b.size>x)throw new Error("Image must be less than 50MB");u({stage:"optimizing",message:"Optimizing image..."}),await new Promise(S=>setTimeout(S,100)),u({stage:"uploading",message:"Uploading to server..."});const j=await hb(b);u({stage:"complete",message:"Upload successful!"}),t(j),setTimeout(()=>{u({stage:"complete",message:""})},2e3)}catch(x){console.error("Upload error:",x);const j=x instanceof Error?x.message:"Failed to upload image";h(j),u({stage:"error",message:j}),r==null||r(new Error(j))}finally{a(!1)}},[t,r]),p=T.useCallback(b=>{b.preventDefault(),b.stopPropagation(),b.type==="dragenter"||b.type==="dragover"?o(!0):b.type==="dragleave"&&o(!1)},[]),g=T.useCallback(async b=>{b.preventDefault(),b.stopPropagation(),o(!1),b.dataTransfer.files&&b.dataTransfer.files[0]&&await f(b.dataTransfer.files[0])},[f]),w=T.useCallback(async b=>{b.preventDefault(),b.target.files&&b.target.files[0]&&await f(b.target.files[0])},[f]);return s.jsxs("div",{className:"space-y-4",children:[d&&s.jsxs("div",{className:"p-4 bg-red-50 text-red-600 rounded-md flex items-center",children:[s.jsx(Dt,{className:"mr-2",size:18}),d]}),s.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center transition-all ${c?"border-[#C0A458] bg-[#F5F5DC]/50":n?"border-blue-300 bg-blue-50/50":"border-gray-300 hover:border-[#C0A458] hover:bg-[#F5F5DC]/2
3930"}`,onDragEnter:p,onDragLeave:p,onDragOver:p,onDrop:g,children:[s.jsx("input",{type:"file",accept:"image/*",onChange:w,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:n}),s.jsx("div",{className:"space-y-4",children:n?s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx("div",{className:"relative",children:s.jsx(Aw,{className:"animate-spin",size:24})}),s.jsx("div",{className:"text-sm font-medium text-gray-600",children:l.message}),s.jsx("div",{className:"w-full max-w-xs bg-gray-200 rounded-full h-1.5",children:s.jsx("div",{className:"bg-[#C0A458] h-1.5 rounded-full transition-all duration-300",style:{width:l.stage==="complete"?"100%":l.stage==="uploading"?"75%":l.stage==="optimizing"?"50%":l.stage==="validating"?"25%":"0%"}})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-[#F5F5DC] flex items-center justify-center",children:s.jsx(Rw,{className:"text-[#C0A458]",size:24})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-600",children:"Drag and drop an image here, or click to select"}),s.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Supports: JPG, PNG, WebP (Max 50MB)"})]})]})})]}),e&&e.length>0&&s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:e.map((b,x)=>s.jsxs("div",{className:"relative group",children:[s.jsx("img",{src:b,alt:`Property image ${x+1}`,className:"w-full h-32 object-cover rounded-lg"}),i&&s.jsx("button",{type:"button",onClick:()=>i(b),className:"absolute top-2 right-2 p-1.5 bg-red-500 text-white rounded-full opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(Bi,{size:16})}),s.jsxs("div",{className:"absolute bottom-2 left-2 bg-black/50 text-white text-xs px-2 py-1 rounded",children:["Image ",x+1]})]},b))})]})},fb=({property:t,onSave:r})=>{var ee;const[e,i]=T.useState((t==null?void 0:t.title)||""),[n,a]=T.useState((t==null?void 0:t.location)||""),[c,o]=T.useState((t==null?void 0:t.description)||""),[l,u]=T.useState((t==null?void 0:t.floor_plan_url)||""),[d,h]=T.useState((t==null?void 0:t.specs)||{beds:0,baths:0,sqft:0,yearBuilt:new Date().getFullYear(),lotSize:"",features:[]}),[f,p]=T.useState((t==null?void 0:t.featured)||!1),[g,w]=T.useState(((ee=t==null?void 0:t.property_images)==null?void 0:ee.map(P=>P.url))||[]),[b,x]=T.useState(!1),[j,S]=T.useState(null),[E,R]=T.useState(""),A=async P=>{if(P.preventDefault(),!b){x(!0),S(null),R("Starting save process...");try{if(!e.trim())throw new Error("Title is required");if(!n.trim())throw new Error("Location is required");if(g.length===0)throw new Error("At least one image is required");R("Saving property details...");const k={title:e,location:n,description:c,floor_plan_url:l,specs:d,featured:f};let O=t==null?void 0:t.id,z;if(O?z=await fe.from("properties").update(k).eq("id",O).select().single():z=await fe.from("properties").insert([k]).select().single(),z.error)throw new Error(`Failed to save property: ${z.error.message}`);if(O=z.data.id,O){if(R("Handling property images..."),t!=null&&t.id){R("Removing old images...");const{error:B}=await fe.from("property_images").delete().eq("property_id",O);if(B)throw new Error(`Failed to remove old images: ${B.message}`)}R(`Saving ${g.length} images...`);const D=g.map((B,K)=>({property_id:O,url:B,alt:`${e} - Image ${K+1}`,order:K})),{error:M}=await fe.from("property_images").insert(D);if(M)throw new Error(`Failed to save property images: ${M.message}`)}R("Save completed successfully!"),r==null||r()}catch(k){console.error("Save error:",k),S(k instanceof Error?k.message:"An error occurred while saving"),R("Save failed - check error message")}finally{x(!1)}}},I=P=>{w(k=>[...k,P]),R(`Added image: ${P} (${g.length+1} total)`)},H=P=>{w(k=>k.filter(O=>O!==P)),R(`Removed image (${g.length-1} remaining)`)},W=(P,k)=>{w(O=>{const z=[...O],[D]=z.splice(P,1);return z.splice(k,0,D),z})},Z=(P,k)=>{P.dataTransfer.setData("text/plain",k.toString())},$=P=>{P.preventDefault()},X=(P,k)=>{P.preventDefault();const O=parseInt(P.dataTransfer.getData("text/plain"));O!==k&&W(O,k)};return s.jsx("div",{className:"min-h-screen bg-white",children:s.jsxs("form",{onSubmit:A,className:"max-w-4xl mx-auto p-4 space-y-6",children:[j&&s.jsx("div",{className:"bg-red-50 text-red-600 p-4 rounded-md",children:j}),E&&s.jsx("div",{className:"bg-blue-50 text-blue-600 p-4 rounded-md",children:E}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Title"}
393),s.jsx("input",{type:"text",value:e,onChange:P=>i(P.target.value),required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Location"}),s.jsx("input",{type:"text",value:n,onChange:P=>a(P.target.value),required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Floor Plan URL"}),s.jsx("input",{type:"url",value:l,onChange:P=>u(P.target.value),placeholder:"https://example.com/floor-plan.jpg",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Add a URL to a high-resolution floor plan image"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),s.jsx("textarea",{value:c,onChange:P=>o(P.target.value),rows:4,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Bedrooms"}),s.jsx("input",{type:"number",value:d.beds,onChange:P=>h({...d,beds:parseInt(P.target.value)||0}),min:"0",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Bathrooms"}),s.jsx("input",{type:"number",step:"0.5",value:d.baths,onChange:P=>h({...d,baths:parseFloat(P.target.value)||0}),min:"0",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Square Footage"}),s.jsx("input",{type:"number",value:d.sqft,onChange:P=>h({...d,sqft:parseInt(P.target.value)||0}),min:"0",className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Year Built"}),s.jsx("input",{type:"number",value:d.yearBuilt,onChange:P=>h({...d,yearBuilt:parseInt(P.target.value)||new Date().getFullYear()}),min:"1900",max:new Date().getFullYear(),className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Lot Size"}),s.jsx("input",{type:"text",value:d.lotSize,onChange:P=>h({...d,lotSize:P.target.value}),className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",placeholder:"e.g., 0.5 acres"})]}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("input",{type:"checkbox",checked:f,onChange:P=>p(P.target.checked),className:"rounded border-gray-300 text-[#C0A458] focus:ring-[#C0A458]"}),s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Featured Property"})]})}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Property Images"}),s.jsx(Jm,{onUploadComplete:I,onError:P=>S(P.message)}),g.length>0&&s.jsxs("div",{className:"mt-4 p-4 bg-gray-50 rounded-md",children:[s.jsx("h4",{className:"font-medium text-gray-700 mb-2",children:"Current Images (Drag to reorder - First image will be the main image)"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:g.map((P,k)=>s.jsxs("div",{draggable:!0,onDragStart:O=>Z(O,k),onDragOver:$,onDrop:O=>X(O,k),className:"relative group bg-white rounded-lg shadow-sm border border-gray-200 cursor-move",children:[s.jsx("div",{className:"absolute top-2 left-2 bg-black/50 text-white px-2 py-1 rounded text-xs",children:k===0?"Main Image":`Image ${k+1}`}),s.jsx("div",{className:"absolute top-2 right-2 flex space-x-2",children:s.jsx("button",{type:"button",onClick:()=>H(P),className:"p-1 bg-red-500 text-white rounded-full opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(Wa,{size:16})})}),s.jsx("div",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(Um,{size:20})}),s.jsx("img",{src:P,alt:`Property image ${k+1}`,className:"w-full h-32 object-cover rounded-lg"})]},P))}),s.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:[g.length," image",g.length===1?"":"s"," ready to be saved"]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{type:"submit",disabled:b,className:"px-6 py-2 bg-[#C0A458] text-white rounded-md hover:bg-[#9A834A] transition-colors disabled:opacity-50 flex items-center",children:b?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Saving..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Gm,{size:18,className:"mr-2"}),"Save Property"]})})})]})})},mb=()=>{const[t,r]=T.useState([]),[e,i]=T.useState(!0),[n,a]=T.useState(!1),[c,o]=T.useState(),[l,u]=T.useState(null),d=async()=>{try{i(!0);const{data:g,error:w}=await fe.from("properties").select(`
394          *,
395          property_images (*)
396        `).order("created_at",{ascending:!1});if(w)throw w;r(g||[])}catch(g){console.error("Error fetching properties:",g),u(g instanceof Error?g.message:"Failed to load properties")}finally{i(!1)}};T.useEffect(()=>{d()},[]);const h=async g=>{if(window.confirm("Are you sure you want to delete this property?"))try{const{error:w}=await fe.from("properties").delete().eq("id",g);if(w)throw w;await d()}catch(w){console.error("Error deleting property:",w),u(w instanceof Error?w.message:"Failed to delete property")}},f=g=>{o(g),a(!0)},p=async()=>{await d(),a(!1),o(void 0)};return e?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx(qm,{className:"animate-spin text-[#C0A458]",size:32})}):n?s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h1",{className:"text-2xl font-playfair",children:c?"Edit Property":"Add New Property"}),s.jsx("button",{onClick:()=>{a(!1),o(void 0)},className:"text-gray-600 hover:text-gray-900",children:"Cancel"})]}),s.jsx(fb,{property:c,onSave:p})]}):s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h1",{className:"text-2xl font-playfair",children:"Property Management"}),s.jsxs("button",{onClick:()=>a(!0),className:"px-4 py-2 bg-[#C0A458] text-white rounded-md hover:bg-[#9A834A] transition-colors flex items-center",children:[s.jsx(Wm,{size:18,className:"mr-2"}),"Add Property"]})]}),l&&s.jsx("div",{className:"mb-8 p-4 bg-red-50 text-red-600 rounded-md",children:l}),s.jsx("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:s.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Property"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Location"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:t.map(g=>{var w,b,x;return s.jsxs("tr",{children:[s.jsx("td",{className:"px-6 py-4",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"h-12 w-12 flex-shrink-0",children:s.jsx("img",{src:((b=(w=g.property_images)==null?void 0:w[0])==null?void 0:b.url)||"https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80",alt:g.title,className:"h-12 w-12 object-cover rounded"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:g.title}),s.jsxs("div",{className:"text-sm text-gray-500",children:[g.specs.beds," beds · ",g.specs.baths," baths · ",(x=g.specs.sqft)==null?void 0:x.toLocaleStr
396ing()," sqft"]})]})]})}),s.jsx("td",{className:"px-6 py-4",children:s.jsx("div",{className:"text-sm text-gray-900",children:g.location})}),s.jsx("td",{className:"px-6 py-4",children:s.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${g.featured?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:g.featured?"Featured":"Standard"})}),s.jsx("td",{className:"px-6 py-4 text-sm font-medium",children:s.jsxs("div",{className:"flex space-x-3",children:[s.jsx("button",{onClick:()=>f(g),className:"text-[#C0A458] hover:text-[#9A834A]",children:s.jsx(Km,{size:18})}),s.jsx("button",{onClick:()=>h(g.id),className:"text-red-600 hover:text-red-900",children:s.jsx(Wa,{size:18})})]})})]},g.id)})})]})})]})},pb=({story:t,onSave:r})=>{var $;const[e,i]=T.useState((t==null?void 0:t.title)||""),[n,a]=T.useState((t==null?void 0:t.date)||new Date().toISOString().split("T")[0]),[c,o]=T.useState((t==null?void 0:t.description)||""),[l,u]=T.useState((t==null?void 0:t.content)||""),[d,h]=T.useState((t==null?void 0:t.featured)||!1),[f,p]=T.useState((($=t==null?void 0:t.story_images)==null?void 0:$.map(X=>X.url))||[]),[g,w]=T.useState(!1),[b,x]=T.useState(null),[j,S]=T.useState(""),E=async X=>{if(X.preventDefault(),!g){w(!0),x(null),S("Starting save process...");try{if(!e.trim())throw new Error("Title is required");if(!c.trim())throw new Error("Description is required");if(!l.trim())throw new Error("Content is required");if(f.length===0)throw new Error("At least one image is required");S("Saving story details...");const ee={title:e,date:n,description:c,content:l,featured:d};let P=t==null?void 0:t.id,k;if(P?k=await fe.from("stories").update(ee).eq("id",P).select().single():k=await fe.from("stories").insert([ee]).select().single(),k.error)throw new Error(`Failed to save story: ${k.error.message}`);if(P=k.data.id,P){if(S("Handling story images..."),t!=null&&t.id){S("Removing old images...");const{error:D}=await fe.from("story_images").delete().eq("story_id",P);if(D)throw new Error(`Failed to remove old images: ${D.message}`)}S(`Saving ${f.length} images...`);const O=f.map((D,M)=>({story_id:P,url:D,alt:`${e} - Image ${M+1}`,order:M})),{error:z}=await fe.from("story_images").insert(O);if(z)throw new Error(`Failed to save story images: ${z.message}`)}S("Save completed successfully!"),r==null||r()}catch(ee){console.error("Save error:",ee),x(ee instanceof Error?ee.message:"An error occurred while saving"),S("Save failed - check error message")}finally{w(!1)}}},R=X=>{p(ee=>[...ee,X]),S(`Added image: ${X} (${f.length+1} total)`)},A=X=>{p(ee=>ee.filter(P=>P!==X)),S(`Removed image (${f.length-1} remaining)`)},I=(X,ee)=>{p(P=>{const k=[...P],[O]=k.splice(X,1);return k.splice(ee,0,O),k})},H=(X,ee)=>{X.dataTransfer.setData("text/plain",ee.toString())},W=X=>{X.preventDefault()},Z=(X,ee)=>{X.preventDefault();const P=parseInt(X.dataTransfer.getData("text/plain"));P!==ee&&I(P,ee)};return s.jsx("div",{className:"min-h-screen bg-white",children:s.jsxs("form",{onSubmit:E,className:"max-w-4xl mx-auto p-4 space-y-6",children:[b&&s.jsx("div",{className:"bg-red-50 text-red-600 p-4 rounded-md",children:b}),j&&s.jsx("div",{className:"bg-blue-50 text-blue-600 p-4 rounded-md",children:j}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Title"}),s.jsx("input",{type:"text",value:e,onChange:X=>i(X.target.value),required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Date"}),s.jsx("input",{type:"date",value:n,onChange:X=>a(X.target.value),required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),s.jsx("input",{type:"text",value:c,onChange:X=>o(X.target.value),required:!0,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Content"}
396),s.jsx("textarea",{value:l,onChange:X=>u(X.target.value),required:!0,rows:10,className:"w-full p-3 border border-gray-300 rounded-md focus:ring-[#C0A458] focus:border-[#C0A458]",placeholder:"Use double line breaks to separate paragraphs..."})]}),s.jsx("div",{children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("input",{type:"checkbox",checked:d,onChange:X=>h(X.target.checked),className:"rounded border-gray-300 text-[#C0A458] focus:ring-[#C0A458]"}),s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Featured Story"})]})}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Story Images"}),s.jsx(Jm,{onUploadComplete:R,onError:X=>x(X.message)}),f.length>0&&s.jsxs("div",{className:"mt-4 p-4 bg-gray-50 rounded-md",children:[s.jsx("h4",{className:"font-medium text-gray-700 mb-2",children:"Current Images (Drag to reorder - First image will be the main image)"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:f.map((X,ee)=>s.jsxs("div",{draggable:!0,onDragStart:P=>H(P,ee),onDragOver:W,onDrop:P=>Z(P,ee),className:"relative group bg-white rounded-lg shadow-sm border border-gray-200 cursor-move",children:[s.jsx("div",{className:"absolute top-2 left-2 bg-black/50 text-white px-2 py-1 rounded text-xs",children:ee===0?"Main Image":`Image ${ee+1}`}),s.jsx("div",{className:"absolute top-2 right-2 flex space-x-2",children:s.jsx("button",{type:"button",onClick:()=>A(X),className:"p-1 bg-red-500 text-white rounded-full opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(Wa,{size:16})})}),s.jsx("div",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(Um,{size:20})}),s.jsx("img",{src:X,alt:`Story image ${ee+1}`,className:"w-full h-32 object-cover rounded-lg"})]},X))}),s.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:[f.length," image",f.length===1?"":"s"," ready to be saved"]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{type:"submit",disabled:g,className:"px-6 py-2 bg-[#C0A458] text-white rounded-md hover:bg-[#9A834A] transition-colors disabled:opacity-50 flex items-center",children:g?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Saving..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Gm,{size:18,className:"mr-2"}),"Save Story"]})})})]})})},gb=()=>{const[t,r]=T.useState([]),[e,i]=T.useState(!0),[n,a]=T.useState(!1),[c,o]=T.useState(),[l,u]=T.useState(null),d=async()=>{try{i(!0);const{data:g,error:w}=await fe.from("stories").select(`
397          *,
398          story_images (*)
399        `).order("created_at",{ascending:!1});if(w)throw w;r(g||[])}catch(g){console.error("Error fetching stories:",g),u(g instanceof Error?g.message:"Failed to load stories")}finally{i(!1)}};T.useEffect(()=>{d()},[]);const h=async g=>{if(window.confirm("Are you sure you want to delete this story?"))try{const{error:w}=await fe.from("stories").delete().eq("id",g);if(w)throw w;await d()}catch(w){console.error("Error deleting story:",w),u(w instanceof Error?w.message:"Failed to delete story")}},f=g=>{o(g),a(!0)},p=async()=>{await d(),a(!1),o(void 0)};return e?s.jsx("div",{className:"min-h-screen pt-20 px-4",children:s.jsx("div",{className:"max-w-7xl mx-auto",children:s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx(qm,{className:"animate-spin text-[#C0A458]",size:32})})})}):n?s.jsx("div",{className:"min-h-screen pt-20 px-4",children:s.jsxs("div",{className:"max-w-3xl mx-auto",children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h1",{className:"text-2xl font-playfair",children:c?"Edit Story":"Add New Story"}),s.jsx("button",{onClick:()=>{a(!1),o(void 0)},className:"text-gray-600 hover:text-gray-900",children:"Cancel"})]}),s.jsx(pb,{story:c,onSave:p})]})}):s.jsx("div",{className:"min-h-screen pt-20 px-4",children:s.jsxs("div",{className:"max-w-7xl mx-auto",children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h1",{className:"text-2xl font-playfair",children:"Stories Management"}),s.jsxs("button",{onClick:()=>a(!0),className:"px-4 py-2 bg-[#C0A458] text-white rounded-md hover:bg-[#9A834A] transition-colors flex items-center",children:[s.jsx(Wm,{size:18,className:"mr-2"}),"Add Story"]})]}),l&&s.jsx("div",{className:"mb-8 p-4 bg-red-50 text-red-600 rounded-md",children:l}),s.jsx("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:s.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Story"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Date"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:t.map(g=>{var w,b;return s.jsxs("tr",{children:[s.jsx("td",{className:"px-6 py-4",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"h-12 w-12 flex-shrink-0",children:s.jsx("img",{src:((b=(w=g.story_images)==null?void 0:w[0])==null?void 0:b.url)||"https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80",alt:g.title,className:"h-12 w-12 object-cover rounded"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:g.title}),s.jsx("div",{className:"text-sm text-gray-500",children:g.description})]})]})}),s.jsx("td",{className:"px-6 py-4",children:s.jsx("div",{className:"text-sm text-gray-900",children:new Date(g.date).toLocaleDateString()})}),s.jsx("td",{className:"px-6 py-4",children:s.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${g.featured?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:g.featured?"Featured":"Standard"})}),s.jsx("td",{className:"px-6 py-4 text-sm font-medium",children:s.jsxs("div",{className:"flex space-x-3",children:[s.jsx("button",{onClick:()=>f(g),className:"text-[#C0A458] hover:text-[#9A834A]",children:s.jsx(Km,{size:18})}),s.jsx("button",{onClick:()=>
399h(g.id),className:"text-red-600 hover:text-red-900",children:s.jsx(Wa,{size:18})})]})})]},g.id)})})]})})]})})},vb=()=>{const[t,r]=T.useState("properties");return s.jsx("div",{className:"min-h-screen bg-gray-50 pt-20",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsx("div",{className:"border-b border-gray-200 mb-8",children:s.jsxs("nav",{className:"-mb-px flex space-x-8",children:[s.jsxs("button",{onClick:()=>r("properties"),className:`py-4 px-1 border-b-2 font-medium text-sm ${t==="properties"?"border-[#C0A458] text-[#C0A458]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} flex items-center`,children:[s.jsx(Hr,{size:18,className:"mr-2"}),"Properties"]}),s.jsxs("button",{onClick:()=>r("stories"),className:`py-4 px-1 border-b-2 font-medium text-sm ${t==="stories"?"border-[#C0A458] text-[#C0A458]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} flex items-center`,children:[s.jsx(bw,{size:18,className:"mr-2"}),"Stories"]})]})}),t==="properties"?s.jsx(mb,{}):s.jsx(gb,{})]})})},xb=()=>{var l,u;const{id:t}=um(),[r,e]=T.useState(null),[i,n]=T.useState(!0),[a,c]=T.useState(null);if(T.useEffect(()=>{(async()=>{try{if(!t)throw new Error("No story ID provided");const{data:h,error:f}=await fe.from("stories").select(`
400            *,
401            story_images (
402              id,
403              url,
404              alt,
405              order
406            )
407          `).eq("id",t).single();if(f)throw f;h.story_images&&h.story_images.sort((p,g)=>p.order-g.order),e(h)}catch(h){console.error("Error fetching story:",h),c("Failed to load story details")}finally{n(!1)}})()},[t]),i)return s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#C0A458] mx-auto"}),s.jsx("p",{className:"mt-4 text-gray-600",children:"Loading story..."})]})})});if(a||!r)return s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.jsxs("div",{className:"text-center",children:[s.jsxs("div",{className:"inline-flex items-center justify-center p-4 bg-red-50 text-red-600 rounded-lg mb-4",children:[s.jsx(Dt,{className:"mr-2"}),a||"Story not found"]}),s.jsx("div",{children:s.jsxs(le,{to:"/about",className:"inline-flex items-center text-[#C0A458] hover:text-[#9A834A] transition-colors",children:[s.jsx(Ll,{className:"mr-2"}),"Back to About"]})})]})})});const o=((u=(l=r.story_images)==null?void 0:l[0])==null?void 0:u.url)||"https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80";return s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsxs("div",{className:"relative h-[60vh] overflow-hidden",children:[s.jsx("img",{src:o,alt:r.title,className:"absolute inset-0 w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-black/40"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-center",children:s.jsxs("div",{className:"max-w-4xl px-4",children:[s.jsx("p",{className:"text-[#C0A458] mb-2",children:new Date(r.date).getFullYear()}),s.jsx("h1",{className:"text-4xl md:text-6xl font-playfair text-white mb-4",children:r.title}),s.jsx("p",{className:"text-xl text-gray-200",children:r.description})]})})]}),s.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:[s.jsxs(le,{to:"/about",className:"inline-flex items-center text-[#C0A458] hover:text-[#9A834A] transition-colors mb-8",children:[s.jsx(Ll,{className:"mr-2"}),"Back to About"]}),s.jsx("div",{className:"prose prose-lg max-w-none",children:r.content.split(`
408
409`).map((d,h)=>s.jsx("p",{className:"mb-6 text-gray-600 leading-relaxed",children:d},h))}),r.story_images&&r.story_images.length>0&&s.jsxs("div",{className:"mt-16",children:[s.jsx("h2",{className:"text-2xl font-playfair mb-8",children:"Project Gallery"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:r.story_images.map((d,h)=>s.jsx("div",{className:"aspect-[4/3] overflow-hidden rounded-lg",children:s.jsx("img",{src:d.url,alt:d.alt||`${r.title} - Image ${h+1}`,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-500",onError:f=>{const p=f.target;p.src="https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80"}})},d.id))})]})]})]})},yb=()=>s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsxs(Tr,{children:[s.jsx("title",{children:"Custom Home Builder Edmonton | Castle Stone Custom Homes"}),s.jsx("meta",{name:"description",content:"Edmonton's premier custom home builder specializing in luxury residences. Experience unparalleled craftsmanship and innovative design with Castle Stone Custom Homes."}),s.jsx("link",{rel:"canonical",href:"https://castlestonecustomhomes.com/custom-home-builder
409-edmonton"})]}),s.jsxs("div",{className:"relative h-[80vh] overflow-hidden",children:[s.jsx("img",{src:"https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?auto=format&fit=crop&q=80&w=2070",alt:"Luxury custom home exterior",className:"absolute inset-0 w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-black/50"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsxs("div",{className:"text-center text-white px-4 max-w-4xl",children:[s.jsx("h1",{className:"text-5xl md:text-6xl font-playfair mb-6",children:"Custom Home Builder Edmonton"}),s.jsx("p",{className:"text-xl md:text-2xl font-light",children:"Crafting exceptional homes that reflect your unique vision and lifestyle"})]})})]}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-24",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair mb-4",children:"Why Choose Castle Stone"}),s.jsx("div",{className:"w-24 h-[1px] bg-[#C0A458] mx-auto"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12",children:[s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Il,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Architectural Excellence"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Innovative designs that push boundaries while maintaining timeless elegance"})]}),s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Vm,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Precision Craftsmanship"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Meticulous attention to detail in every aspect of construction"})]}),s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Zm,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Quality Assurance"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Rigorous quality control processes ensuring lasting value"})]}),s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Iw,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Premium Service"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Personalized attention and support throughout your journey"})]})]})]}),s.jsx("div",{className:"bg-gray-50 py-24",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair mb-4",children:"Our Building Process"}),s.jsx("div",{className:"w-24 h-[1px] bg-[#C0A458] mx-auto"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12",children:[s.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-sm hover:shadow-lg transition-shadow duration-300",children:[s.jsx("div",{className:"text-4xl font-playfair text-[#C0A458] mb-4",children:"01"}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Design Consultation"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"We begin with understanding your vision, lifestyle, and preferences to create a custom design that perfectly suits your needs."})]}),s.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-sm hover:shadow-lg transition-shadow duration-300",children:[s.jsx("div",{className:"text-4xl font-playfair text-[#C0A458] mb-4",children:"02"}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Detailed Planning"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Our team develops comprehensive plans, including architectural drawings, material selections, and construction timelines."})]}),s.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-sm hover:shadow-lg transition-shadow duration-300",children:[s.jsx("div",{className:"text-4xl font-playfair text-[#C0A458] mb-4",children:"03"}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Expert Construction"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"We bring your dream home to life with skilled craftsmanship, premium materials, and attention to every detail."})]})]})]})}),s.jsx("div",{className:"py-24",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16 items-center",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair mb-6",children:"Where Vision Meets Reality"}),s.jsx("p",{className:"text-gray-600 leading-relaxed mb-8",children:"Every Castle Stone home is a testament to our commitment to excellence. From the initial sketch to the final walkthrough, we ensure that every detail reflects your unique style and exceeds your expectations."}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4"}),s.jsx("span",{className:"text-gray-600",children:"Custom architectural design"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4"}),s.jsx("span",{className:"text-gray-600",children:"Premium material selection"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4"}),s.jsx("span",{className:"text-gray-600",children:"Energy-efficient systems"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4"}),s.jsx("span",{className:"text-gray-600",children:"Smart home integration"})]})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:"https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80",alt:"Luxury home interior",className:"rounded-lg shadow-xl"}),s.jsxs("div",{className:"absolute -bottom-6 -right-6 bg-[#F5F5DC] p-6 rounded-lg shadow-lg",children:[s.jsx("p",{className:"text-2xl font-playfair text-[#C0A458]",children:"15+"}),s.jsx("p",{className:"text-gray-600",children:"Years Experience"})]})]})]})})}),s.jsx("div",{className:"bg-[#C0A458] py-24",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center px-4",children:[s.jsx("h2",{className:"text-4xl md:text-5xl font-playfair text-white mb-6",children:"Ready to Build Your Dream Home?"}),s.jsx("p",{className:"text-xl text-white/90 mb-12 font-light",children:"Let's discuss your vision and create something extraordinary together."}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center space-y-4 sm:sp
409ace-y-0 sm:space-x-4",children:[s.jsxs(le,{to:"/contact",className:"inline-flex items-center px-8 py-3 bg-white text-[#C0A458] rounded hover:bg-gray-100 transition-colors font-medium group",children:["Schedule a Consultation",s.jsx(Ce,{className:"ml-2 group-hover:translate-x-1 transition-transform duration-300",size:20})]}),s.jsxs(le,{to:"/projects",className:"inline-flex items-center px-8 py-3 border border-white text-white hover:bg-white hover:text-[#C0A458] transition-colors font-medium group",children:["View Our Work",s.jsx(Ce,{className:"ml-2 group-hover:translate-x-1 transition-transform duration-300",size:20})]})]})]})})]}),wb=()=>s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsxs(Tr,{children:[s.jsx("title",{children:"Acreage Home Builder Alberta | Castle Stone Custom Homes"}),s.jsx("meta",{name:"description",content:"Specialized acreage home builder in Alberta. Creating stunning custom homes on rural properties with expert land development and sustainable design practices."}),s.jsx("link",{rel:"canonical",href:"https://castlestonecustomhomes.com/acreage-home-builder-alberta"})]}),s.jsxs("div",{className:"relative h-[80vh] overflow-hidden",children:[s.jsx("img",{src:"https://images.unsplash.com/photo-1564013799919-ab600027ffc6?auto=format&fit=crop&q=80&w=2070",alt:"Luxury acreage home",className:"absolute inset-0 w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-black/50"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsxs("div",{className:"text-center text-white px-4 max-w-4xl",children:[s.jsx("h1",{className:"text-5xl md:text-6xl font-playfair mb-6",children:"Acreage Home Builder Alberta"}),s.jsx("p",{className:"text-xl md:text-2xl font-light",children:"Building your dream country estate with expertise and vision"})]})})]}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-24",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair mb-4",children:"Acreage Expertise"}),s.jsx("div",{className:"w-24 h-[1px] bg-[#C0A458] mx-auto"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12",children:[s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Xm,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Land Development"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Expert assessment and preparation of your acreage property"})]}),s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Hr,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Custom Design"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Homes designed to complement your rural landscape"})]}),s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Ow,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Natural Integration"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Seamless blend of architecture with natural surroundings"})]}),s.jsxs("div",{className:"text-center group",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#F5F5DC] text-[#C0A458] mb-6 group-hover:scale-110 transition-transform duration-300",children:s.jsx(Cw,{size:36})}),s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Site Planning"}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Strategic positioning for optimal views and natural light"})]})]})]}),s.jsx("div",{className:"bg-gray-50 py-24",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair mb-4",children:"Our Acreage Expertise"}),s.jsx("div",{className:"w-24 h-[1px] bg-[#C0A458] mx-auto"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-12",children:[s.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-sm hover:shadow-lg transition-shadow duration-300",children:[s.jsx("h3",{className:"text-xl font-playfair mb-6",children:"Land Development Solutions"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4 mt-2"}),s.jsx("span",{className:"text-gray-600",children:"Comprehensive site analysis and planning"})]}),s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4 mt-2"}),s.jsx("span",{className:"text-gray-600",children:"Water well and septic system installation"})]}),s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4 mt-2"}),s.jsx("span",{className:"text-gray-600",children:"Power and utility connections"})]}),s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4 mt-2"}),s.jsx("span",{className:"text-gray-600",children:"Driveway and access road construction"})]})]})]}),s.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-sm hover:shadow-lg transition-shadow duration-300",children:[s.jsx("h3",{className:"text-xl font-playfair mb-6",children:"Custom Home Features"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4 mt-2"}),s.jsx("span",{className:"text-gray-600",children:"Energy-efficient design and systems"})]}),s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4 mt-2"}),s.jsx("span",{className:"text-gray-600",children:"Large windows for panoramic views"})]}),s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4 mt-2"}),s.jsx("span",{className:"text-gray-600",children:"Spacious outdoor living areas"})]}),s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4 mt-2"}),s.jsx("span",{className:"text-gray-600",children:"Custom storage and utility spaces"})]})]})]})]})]})}),s.jsx("div",{className:"py-24",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16 items-center",children:[s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:"https://images.unsplash.com/photo-1582540730843-f4418d96ccbe?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80",alt:"Acreage home construction",className:"rounded-lg shadow-xl"}),s.jsxs("div",{className:"absolute -bottom-6 -right-6 bg-[#F5F5DC] p-6 rounded-lg shadow-lg",children:[s.jsx("p",{className:"text-2xl font-playfair text-[#C0A458]",children:"5+"}),s.jsx("p",{className:"text-gray-600",children:"Acre Builds"})]})]}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-playfair mb-6",children:"Country Living, Luxury Standards"}),s.jsx("p",{className:"text-gray-600 leading-relaxed mb-8",children:"Building on acreage requires specialized knowledge and experience. From site preparation to utility connections, we handle every aspect of your rural custom home project with the same attention to detail and luxury standards you expect."}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4"}),s.jsx("span",{className:"text-gray-600",children:"Septic and well system expertise"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4"}),s.jsx("span",{className:"text-gray-600",children:"Rural electrical and utility planning"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4"}),s.jsx("span",{className:"text-gray-600",children:"Environmental impact considerations"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"w-2 h-2 bg-[#C0A458] rounded-full mr-4"}),s.jsx("span",{className:"text-gray-600",children:"Sustainable building practices"})]})]})]})]})})}),s.jsx("div",{className:"bg-[#C0A458] py-24",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center px-4",children:[s.jsx("h2",{className:"text-4xl md:text-5xl font-playfair text-white mb-6",children:"Build Your Dream Acreage Home"}),s.jsx("p",{className:"text-xl text-white/90 mb-12 font-light",children:"Let's create your perfect country retreat with expert guidance every step of the way."}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center space-y-4 sm:sp
409ace-y-0 sm:space-x-4",children:[s.jsxs(le,{to:"/contact",className:"inline-flex items-center px-8 py-3 bg-white text-[#C0A458] rounded hover:bg-gray-100 transition-colors font-medium group",children:["Start Your Journey",s.jsx(Ce,{className:"ml-2 group-hover:translate-x-1 transition-transform duration-300",size:20})]}),s.jsxs(le,{to:"/projects",className:"inline-flex items-center px-8 py-3 border border-white text-white hover:bg-white hover:text-[#C0A458] transition-colors font-medium group",children:["View Acreage Projects",s.jsx(Ce,{className:"ml-2 group-hover:translate-x-1 transition-transform duration-300",size:20})]})]})]})})]}),bb=()=>{const[t,r]=T.useState(!1),e=[{id:"snapshot",title:"2025 Market Snapshot"},{id:"trends",title:"Price & Inventory Trends"},{id:"neighbourhoods",title:"Neighbourhood Deep‑Dive"},{id:"rental",title:"Rental Scene & Vacancy"},{id:"taxes",title:"Taxes & Cost of Living"},{id:"lifestyle",title:"Lifestyle, Schools & Commute"},{id:"listings",title:"Notable Listings (Spring 2025)"},{id:"tips",title:"Buyer / Seller Playbook"},{id:"faqs",title:"FAQs"}],i=(n,a)=>{n.preventDefault();const c=document.getElementById(a);if(c){const u=c.getBoundingClientRect().top+window.pageYOffset-120;window.scrollTo({top:u,behavior:"smooth"}),r(!1)}};return s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsxs(Tr,{children:[s.jsx("title",{children:"Is Spruce Grove a Good Place to Live? | Castle Stone Custom Homes"}),s.jsx("meta",{name:"description",content:"Read the Analysis from Real Estate Experts, Average sold price is still below the half‑million mark, vacancy is under 1%, and commute time to downtown Edmonton is 25 minutes—here's why Spruce Grove is Alberta's hottest commuter city in 2025."}),s.jsx("link",{rel:"canonical",href:"https://castlestonecustomhomes.com/real-estate-in-spruce-grove-edmonton"})]}),s.jsx("div",{className:"bg-gray-50 border-b",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 py-3",children:s.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[s.jsx(le,{to:"/",className:"hover:text-[#C0A458]",children:"Castle Stone"}),s.jsx(Ce,{size:16}),s.jsx(le,{to:"/blog",className:"hover:text-[#C0A458]",children:"Blog"}),s.jsx(Ce,{size:16}),s.jsx("span",{className:"text-gray-400",children:"General"})]})})}),s.jsxs("div",{className:"lg:hidden sticky top-20 z-20 bg-white border-b",children:[s.jsxs("button",{onClick:()=>r(!t),className:"w-full px-4 py-3 flex items-center justify-between text-gray-700 hover:bg-gray-50",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(ts,{size:20,className:"mr-2"}),s.jsx("span",{children:"Table of Contents"})]}),s.jsx(Ce,{size:20,className:`transform transition-transform ${t?"rotate-90":""}`})]}),t&&s.jsx("div",{className:"absolute top-full left-0 right-0 bg-white border-b shadow-lg",children:s.jsx("nav",{className:"max-h-[70vh] overflow-y-auto p-4",children:s.jsx("ul",{className:"space-y-2",children:e.map(n=>s.jsx("li",{children:s.jsxs("a",{href:`#${n.id}`,onClick:a=>i(a,n.id),className:"flex items-center py-2 px-4 text-gray-700 hover:text-[#C0A458] hover:bg-gray-50 rounded transition-colors",children:[s.jsx(xe,{size:16,className:"mr-2"}),n.title]})},n.id))})})})]}),s.jsxs("div",{className:"relative h-[40vh] bg-black",children:[s.jsx("img",{src:"https://www.sprucegrove.org/media/5299/img_8535.jpg?crop=0.067834581025798008,0.31302734447590747,0.14945871483037876,0.35379729762152445&cropmode=percentage&width=1980&height=568&rnd=133531133380000000",alt:"Spruce Grove Aerial View",className:"absolute inset-0 w-full h-full object-cover opacity-50"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-center",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"text-4xl md:text-5xl font-playfair text-white mb-4",children:["Is Spruce Grove a Good Place to Live?",s.jsx("span",{className:"inline-block bg-[#C0A458] text-white text-sm px-2 py-1 rounded ml-2 align-middle",children:"2025 Guide"})]}),s.jsx("p",{className:"text-lg text-gray-200 max-w-2xl mx-auto italic",children:"Read the Analysis from Real Estate Experts, Average sold price is still below the half‑million mark, vacancy is under 1%, and commute time to downtown Edmonton is 25 minutes—here's why Spruce Grove is Alberta's hottest commuter city in 2025."})]})})]}),s.jsx("div",{className:"max-w-7xl mx-auto px-4 py-12",children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-12",children:[s.jsxs("div",{className:"lg:w-2/3",children:[s.jsxs("div",{className:"flex items-center space-x-6 mb-8 text-sm text-gray-600",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("img",{src:"https://rxgobdnsupmmsqaeyfdf.supabase.co/storage/v1/object/sign/our-assets/Untitled%20Design%20180x180.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJvdXItYXNzZXRzL1VudGl0bGVkIERlc2lnbiAxODB4MTgwLnBuZyIsImlhdCI6MTc0NjU2OTE0OSwiZXhwIjoxODMyOTY5MTQ5fQ.42_BX3czlUrLTnm3TWrSm4mJzP75QRm9S7xT--iNvz0",alt:"mybuilder.ca",className:"w-10 h-10 rounded-full mr-3"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:"mybuilder.ca"}),s.jsx("p",{children:"Castle Stone Marketing Team"})]})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(Zr,{size:16,className:"mr-2"}),s.jsx("span",{children:"12 min read"})]})]}),s.jsxs("section",{id:"snapshot",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"1. 2025 Market Snapshot"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{className:"bg-[#C0A458] text-white",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3 text-left",children:"Metric"}),s.jsx("th",{className:"px-6 py-3 text-left",children:"Latest Reading"}),s.jsx("th",{className:"px-6 py-3 text-left",children:"YoY Change"})]})}),s.jsxs("tbody",{className:"divide-y divide-gray-200",children:[s.jsxs("tr",{className:"bg-white",children:[s.jsx("td",{className:"px-6 py-4 font-medium",children:"Avg. sold price (all property types)"}),s.jsx("td",{className:"px-6 py-4 font-bold",children:"$397,500"}),s.jsx("td",{className:"px-6 py-4 text-green-600",children:"+4.2%"})]}),s.jsxs("tr",{className:"bg-gray-50",children:[s.jsx("td",{className:"px-6 py-4",children:"New listings (last 28 days)"}),s.jsx("td",{className:"px-6 py-4",children:"56"}),s.jsx("td",{className:"px-6 py-4 text-green-600",children:"+12%"})]}),s.jsxs("tr",{className:"bg-white",children:[s.jsx("td",{className:"px-6 py-4",children:"Avg. days on market (detached)"}),s.jsx("td",{className:"px-6 py-4",children:"30"}),s.jsx("td",{className:"px-6 py-4 text-green-600",children:"-9 days"})]}),s.jsxs("tr",{className:"bg-gray-50",children:[s.jsx("td",{className:"px-6 py-4",children:"Population (2025 est.)"}),s.jsx("td",{className:"px-6 py-4",children:"40,737"}),s.jsx("td",{className:"px-6 py-4 text-green-600",children:"+2%"})]}),s.jsxs("tr",{className:"bg-white",children:[s.jsx("td",{className:"px-6 py-4",children:"Rental vacancy rate"}),s.jsx("td",{className:"px-6 py-4 font-bold",children:"0.7%"}),s.jsx("td",{className:"px-6 py-4 text-green-600",children:"-0.3 ppt"})]}),s.jsxs("tr",{className:"bg-gray-50",children:[s.jsx("td",{className:"px-6 py-4",children:"Residential mill rate (2024)"}),s.jsx("td",{className:"px-6 py-4",children:"6.6398"}),s.jsx("td",{className:"px-6 py-4 text-red-600",children:"+2.2%"})]})]})]})}),s.jsx("div",{className:"mt-8 text-center",children:s.jsxs(le,{to:"/projects",className:"inline-flex items-center px-8 py-3 bg-[#C0A458] text-white rounded-md hover:bg-[#9A834A] transition-colors group",children:["Check Out Our Work in Spruce Grove",s.jsx(xe,{className:"ml-2 group-hover:translate-x-1 transition-transform"})]})})]}),s.jsxs("section",{id:"trends",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"2. Price & Inventory Trends"}),s.jsxs("div",{className:"bg-white rounded-lg",children:[s.jsx("p",{className:"text-lg font-medium mb-4",children:"Why prices keep climbing:"}),s.jsxs("ul",{className:"space-y-4 mb-6",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Supply squeeze:"})," active listings are still < 3‑month supply despite a spring bump in inventory."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Commuter demand:"})," Highway 16A puts downtown Edmonton 25 min away, drawing buyers priced out of the city core."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"New‑build pipeline:"})," mid‑size builders are concentrating on town‑homes < $450 k, nudging the entry‑level price floor upward."]})]})]}),s.jsxs("blockquote",{className:"border-l-4 border-[#C0A458] pl-4 italic text-gray-700 my-6",children:["Detached prices across the Greater Edmonton Area hit ",s.jsx("strong",{children:"$575 k"})," in March 2025—Spruce Grove's median sits ~15 % lower, preserving its value edge."]})]})]}),s.jsxs("section",{id:"neighbourhoods",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"3. Neighbourhood Deep‑Dive"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{className:"bg-[#C0A458] text-white",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3 text-left",children:"Area"}),s.jsx("th",{className:"px-6 py-3 text-left",children:"2025 Avg. Price"}),s.jsx("th",{className:"px-6 py-3 text-left",children:"Vibe"}),s.jsx("th",{className:"px-6 py-3 text-left",children:"Buyer Profile"})]})}),s.jsxs("tbody",{className:"divide-y divide-gray-200",children:[s.jsxs("tr",{className:"bg-white",children:[s.jsx("td",{className:"px-6 py-4 font-medium",children:"Greenbury"}),s.jsx("td",{className:"px-6 py-4",children:"$715k"}),s.jsx("td",{className:"px-6 py-4",children:"Brooklyn‑style brownstones by Jubilee Park"}),s.jsx("td",{className:"px-6 py-4",children:"Upsizing families seeking trails & Tri‑Leisure access"})]}),s.jsxs("tr",{className:"bg-gray-50",children:[s.jsx("td",{className:"px-6 py-4 font-medium",children:"Linkside"}),s.jsx("td",{className:"px-6 py-4",children:"$491k"}),s.jsx("td",{className:"px-6 py-4",children:"Golf‑course lots, wide streets"}),s.jsx("td",{className:"px-6 py-4",children:"Executive commuters, golfers"})]}),s.jsxs("tr",{className:"bg-white",children:[s.jsx("td",{className:"px-6 py-4 font-medium",children:"Jesperdale"}),s.jsx("td",{className:"px-6 py-4",children:"$345k"}),s.jsx("td",{className:"px-6 py-4",children:"Affordable duplexes, splash‑park"}),s.jsx("td",{className:"px-6 py-4",children:"First‑time buyers, young families"})]}),s.jsxs("tr",{className:"bg-gray-50",children:[s.jsx("td",{className:"px-6 py-4 font-medium",children:"Hilldowns"}),s.jsx("td",{className:"px-6 py-4",children:"$117k (condo)"}),s.jsx("td",{className:"px-6 py-4",children:"Older walk‑ups & mobile sites"}),s.jsx("td",{className:"px-6 py-4",children:"Investors chasing > 6% cap rates"})]}),s.jsxs("tr",{className:"bg-white",children:[s.jsx("td",{className:"px-6 py-4 font-medium",children:"Deer Park"}),s.jsx("td",{className:"px-6 py-4",children:"$599k (new)"}),s.jsx("td",{className:"px-6 py-4",children:"Large bungalows, mature trees"}),s.jsx("td",{className:"px-6 py-4",children:"Empty‑nesters, move‑down buyers"})]})]})]})})]}),s.jsxs("section",{id:"rental",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"4. Rental Scene & Vacancy"}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"text-center p-6 bg-white rounded-lg shadow-sm",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Vacancy Rate"}),s.jsx("p",{className:"text-3xl font-bold text-[#C0A458]",children:"0.7%"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Tightest in Edmonton CMA"})]}),s.jsxs("div",{className:"text-center p-6 bg-white rounded-lg shadow-sm",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Avg. Two-Bed Rent"}),s.jsx("p",{className:"text-3xl font-bold text-[#C0A458]",children:"$1,425"}),s.jsx("p",{className:"text-sm text-gray-500",children:"CMHC fall 2024"})]}),s.jsxs("div",{className:"text-center p-6 bg-white rounded-lg shadow-sm",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Cash Flow Potential"}),s.jsx("p",{className:"text-3xl font-bold text-[#C0A458]",children:"5%+"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Cap rate on townhomes"})]})]}),s.jsxs("p",{className:"mt-6 text-gray-700",children:[s.jsx("strong",{children:"Investor takeaway:"}
409)," With 20% down on a $350k townhouse, cash‑flow is realistic at today's sub‑5% mortgage rates—rare in Alberta's larger centres."]})]})]}),s.jsxs("section",{id:"taxes",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"5. Taxes & Cost of Living"}),s.jsx("div",{className:"bg-white rounded-lg",children:s.jsxs("ul",{className:"space-y-4",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Municipal residential mill rate 2024:"})," 6.6398 → ≈ $3,000 tax on a $450k home."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsx("span",{children:"No provincial sales tax and lower insurance rates than coastal cities keep ownership costs manageable."})]})]})})]}),s.jsxs("section",{id:"lifestyle",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"6. Lifestyle, Schools & Commute"}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Community Features"}),s.jsxs("ul",{className:"space-y-3",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Commute:"})," 11 km to Edmonton city limits; peak‑hour Yellowhead averages 25–30 min."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Schools:"})," 13 public + 10 separate, including brand‑new Copperhaven K‑9."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Recreation:"})," Tri‑Leisure Centre, 40 km of paved trails, Horizon Stage live‑arts venue."]})]})]})]}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"Lot Sizes"}),s.jsxs("p",{className:"text-gray-700",children:["Want a weekend‑warrior yard? Most Linkside and Harvest Ridge lots top ",s.jsx("strong",{children:"5,500 sq ft"}),"."]}),s.jsxs("div",{className:"mt-4 p-4 bg-white rounded",children:[s.jsx("p",{className:"text-sm text-gray-600",children:"Average Lot Sizes by Area:"}),s.jsxs("ul",{className:"mt-2 space-y-2",children:[s.jsx("li",{children:"Linkside: 50' × 110'"}),s.jsx("li",{children:"Harvest Ridge: 46' × 120'"}),s.jsx("li",{children:"Greenbury: 42' × 115'"})]})]})]})]})]}),s.jsxs("section",{id:"listings",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"7. Notable Listings (Spring 2025)"}),s.jsxs("div",{className:"space-y-6",children:[[{address:"10 Groat Pl",price:"$450k",details:"1,370 sq ft bungalow, vaulted ceilings, 6,750 sq ft lot"},{address:"2 George St",price:"$699k",details:"5‑bed, 2,500 sq ft two‑storey, triple garage, pond view"},{address:"29 Deer Park Cr",price:"$599k",details:"1,595 sq ft walk‑out backing onto greenbelt, built 2016"}].map((n,a)=>s.jsx("div",{className:"bg-gray-50 p-6 rounded-lg",children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-medium",children:n.address}),s.jsx("p",{className:"text-gray-600 mt-1",children:n.details})]}),s.jsx("span",{className:"text-[#C0A458] font-bold",children:n.price})]})},a)),s.jsx("p",{className:"text-sm text-gray-500 italic",children:"Listings courtesy of RE/MAX; availability subject to change."})]})]}),s.jsxs("section",{id:"tips",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"8. Buyer / Seller Playbook"}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"For Buyers"}),s.jsxs("ul",{className:"space-y-4",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Get pre-approved for 120 days."})," Bidding wars on < $500k homes are back."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Focus on inspections."})," Rapid growth means some 2014–2016 builds are hitting their first major maintenance cycle."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Leverage zero‑lot‑line lots."})," They trim ~$40k off purchase price without sacrificing interior square footage."]})]})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-playfair mb-4",children:"For Sellers"}),s.jsxs("ul",{className:"space-y-4",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Stage for families."})," 46% of residents have children at home—convert that spare room into a play‑nook."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Price just under search brackets"})," (e.g., $499,900 vs $505,000) to catch portal filters."]})]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"w-2 h-2 mt-2 bg-[#C0A458] rounded-full mr-3"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Upgrade curb appeal."})," Fresh hardy‑board paint and LED soffit lights have yielded 102% list‑to‑sale ratios this spring."]})]})]})]})]})]}),s.jsxs("section",{id:"faqs",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"9. FAQs"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"font-medium mb-2",children:"Are prices expected to drop if interest rates tick back up?"}),s.jsx("p",{className:"text-gray-700",children:"Analysts expect flat growth, not a dip—tight vacancy plus > 3% annual population growth keep a floor under prices."})]}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"font-medium mb-2",children:"Does Spruce Grove charge a land‑transfer tax?"}),s.jsx("p",{className:"text-gray-700",children:"Alberta uses low registration fees (~$275 on a $400k home), not a percentage‑based land‑transfer tax."})]})]})]}),s.jsxs("div",{className:"bg-[#F5F5DC] p-8 rounded-lg text-center mt-16",children:[s.jsx("h2",{className:"text-2xl font-playfair mb-4",children:"Ready to Make Your Move?"}),s.jsx("p",{className:"text-gray-700 mb-6",children:"Book a consultation with our team to explore Spruce Grove's finest properties and get expert guidance on your real estate journey."}),s.jsxs(le,{to:"/contact",className:`inline-flex items-center px-8 py-3 bg-[#C0A458] text-white rounded hover:bg-[#9A834A]
410                transition-colors`,children:["Schedule Consultation",s.jsx(xe,{className:"ml-2"})]})]})]}),s.jsx("div",{className:"lg:w-1/3 hidden lg:block",children:s.jsx("div",{className:"sticky top-24",children:s.jsxs("nav",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h2",{className:"text-xl font-playfair mb-4",children:"Table of Contents"}),s.jsx("ul",{className:"space-y-2",children:e.map(n=>s.jsx("li",{children:s.jsxs("a",{href:`#${n.id}`,onClick:a=>i(a,n.id),className:"flex items-center text-gray-700 hover:text-[#C0A458] transition-colors",children:[s.jsx(xe,{size:16,className:"mr-2"}),n.title]})},n.id))})]})})})]})})]})},jb=()=>{const[t,r]=T.useState(!1),e=[{id:"location",title:"Location Highlights"},{id:"property",title:"Property Details"},{id:"market",title:"Market Snapshot"},{id:"lifestyle",title:"Lifestyle & Recreation"},{id:"schools",title:"Schools"},{id:"why",title:"Why Residents Love Lake Ridge"}],i=(n,a)=>{n.preventDefault();const c=document.getElementById(a);if(c){const u=c.getBoundingClientRect().top+window.pageYOffset-120;window.scrollTo({top:u,behavior:"smooth"}),r(!1)}};return s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsxs(Tr,{children:[s.jsx("title",{children:"Lake Ridge Estates | Half‑Acre Lots on Big Lake – Rural Parkland County"}),s.jsx("meta",{name:"description",content:"Build your custom estate 25 min from downtown Edmonton. Explore prices, schools, trails & lifestyle in Lake Ridge Estates on Big Lake."}),s.jsx("link",{rel:"canonical",href:"https://castlestonecustomhomes.com/lake-ridge-estates-parkland-county"})]}),s.jsx("div",{className:"bg-gray-50 border-b",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 py-3",children:s.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[s.jsx(le,{to:"/",className:"hover:text-[#C0A458]",children:"Castle Stone"}),s.jsx(Ce,{size:16}),s.jsx(le,{to:"/blog",className:"hover:text-[#C0A458]",children:"Blog"}),s.jsx(Ce,{size:16}),s.jsx("span",{className:"text-gray-400",children:"Lake Ridge Estates"})]})})}),s.jsxs("div",{className:"lg:hidden sticky top-20 z-20 bg-white border-b",children:[s.jsxs("button",{onClick:()=>r(!t),className:"w-full px-4 py-3 flex items-center justify-between text-gray-700 hover:bg-gray-50",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(ts,{size:20,className:"mr-2"}),s.jsx("span",{children:"Table of Contents"})]}),s.jsx(Ce,{size:20,className:`transform transition-transform ${t?"rotate-90":""}`})]}),t&&s.jsx("div",{className:"absolute top-full left-0 right-0 bg-white border-b shadow-lg",children:s.jsx("nav",{className:"max-h-[70vh] overflow-y-auto p-4",children:s.jsx("ul",{className:"space-y-2",children:e.map(n=>s.jsx("li",{children:s.jsxs("a",{href:`#${n.id}`,onClick:a=>i(a,n.id),className:"flex items-center py-2 px-4 text-gray-700 hover:text-[#C0A458] hover:bg-gray-50 rounded transition-colors",children:[s.jsx(xe,{size:16,className:"mr-2"}),n.title]})},n.id))})})})]}),s.jsxs("div",{className:"relative h-[40vh] bg-black",children:[s.jsx("img",{src:"https://wkljadlmnqsapyvyydfy.supabase.co/storage/v1/object/public/property-images/property-1739777859414-xby3u.jpg",alt:"Lake Ridge Estates",className:"absolute inset-0 w-full h-full object-cover opacity-50"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-center",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"text-4xl md:text-5xl font-playfair text-white mb-4",children:["Lake Ridge Estates",s.jsx("span",{className:"inline-block bg-[#C0A458] text-white text-sm px-2 py-1 rounded ml-2 align-middle",children:"2025 Guide"})]}),s.jsx("p",{className:"text-lg text-gray-200 max-w-2xl mx-auto italic",children:"Build your custom estate 25 min from downtown Edmonton. Explore prices, schools, trails & lifestyle in Lake Ridge Estates on Big Lake."})]})})]}),s.jsx("div",{className:"max-w-7xl mx-auto px-4 py-12",children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-12",children:[s.jsxs("div",{className:"lg:w-2/3",children:[s.jsxs("div",{className:"flex items-center space-x-6 mb-8 text-sm text-gray-600",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("img",{src:"https://rxgobdnsupmmsqaeyfdf.supabase.co/storage/v1/object/sign/our-assets/Untitled%20Design%20180x180.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJvdXItYXNzZXRzL1VudGl0bGVkIERlc2lnbiAxODB4MTgwLnBuZyIsImlhdCI6MTc0NjU2OTE0OSwiZXhwIjoxODMyOTY5MTQ5fQ.42_BX3czlUrLTnm3TWrSm4mJzP75QRm9S7xT--iNvz0",alt:"mybuilder.ca",className:"w-10 h-10 rounded-full mr-3"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:"mybuilder.ca"}),s.jsx("p",{children:"Castle Stone Marketing Team"})]})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(Zr,{size:16,className:"mr-2"}),s.jsx("span",{children:"12 min read"})]})]}),s.jsxs("section",{id:"location",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Location Highlights"}),s.jsx("div",{className:"bg-white rounded-lg overflow-hidden shadow-lg mb-8",children:s.jsx("img",{src:"https://wkljadlmnqsapyvyydfy.supabase.co/storage/v1/object/public/property-images/property-1739777859414-xby3u.jpg",alt:"Lake Ridge Estates aerial view",className:"w-full h-64 object-cover"})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"p-6 bg-gray-50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center mb-4",children:[s.jsx(Ht,{className:"text-[#C0A458] mr-2"}),s.jsx("h3",{className:"font-medium",children:"Downtown Edmonton"})]}),s.jsx("p",{className:"text-gray-600",children:"~25 minutes to Rogers Place & ICE District"})]}),s.jsxs("div",{className:"p-6 bg-gray-50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center mb-4",children:[s.jsx(Ht,{className:"text-[#C0A458] mr-2"}),s.jsx("h3",{className:"font-medium",children:"Spruce Grove"})]}),s.jsx("p",{className:"text-gray-600",children:"~10 minutes to shopping & Tri Leisure Centre"})]}),s.jsxs("div",{className:"p-6 bg-gray-50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center mb-4",children:[s.jsx(Ht,{className:"text-[#C0A458] mr-2"}),s.jsx("h3",{className:"font-medium",children:"Major Routes"})]}),s.jsx("p",{className:"text-gray-600",children:"~5 minutes to Anthony Henday Dr./Hwy 16A"})]})]})]}),s.jsxs("section",{id:"property",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Property Details"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Licensed Builders"}),s.jsxs("ul",{className:"space-y-3",children:[s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://castlestonecustomhomes.com",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Castle Stone Custom Homes"})]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://kanvihomes.com",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Kanvi Homes"})]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://heredityhomes.ca",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Heredity Homes"})]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://vickyshomes.ca",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Vicky's Homes"})]})]})]}),s.jsx("div",{children:s.jsx("img",{src:"https://www.landflip.com/photos/119434/residential-05-acre-lot-for-sale-i-lehigh-acres-lee-county-florida-119434--CzFlG-XL.jpg",alt:"Example lot",className:"rounded-lg shadow-lg"})})]})]}),s.jsxs("section",{id:"market",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Market Snapshot (May 2025)"}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("p",{className:"text-xl mb-4",children:"Current listings range from $958k to $2.40M"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-2",children:"Bedrooms"}),s.jsx("p",{className:"text-gray-600",children:"4–5 bedrooms"})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-2",children:"Bathrooms"}),s.jsx("p",{className:"text-gray-600",children:"3–5 bathrooms"})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-2",children:"Property Taxes"}),s.jsx("p",{className:"text-gray-600",children:"~0.0060 of assessed value"})]})]})]})]}),s.jsxs
vendor: 4,881 bytes, line 410
410("section",{id:"lifestyle",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Lifestyle & Recreation"}),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Big Lake & Lois Hole Centennial Provincial Park"}),s.jsxs("ul",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://ebird.org/hotspot/L11286442/bird-list",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"223+ recorded bird species"})]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),"Trumpeter swans & peregrine falcons"]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),"Boardwalks & viewing platforms"]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),"Year-round nature photography"]})]}),s.jsx("img",{src:"https://images.squarespace-cdn.com/content/v1/65a841a8e093b0059852bd91/1706237822053-AJ0TG6N4HOSJWGNZ9L1A/IMG_7945-EditWEB.jpg",alt:"Atim Creek Natural Area",className:"w-full rounded-lg shadow-lg mb-8"})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Active Living"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[s.jsx("div",{children:s.jsxs("ul",{className:"space-y-3",children:[s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://www.albertaparks.ca/parks/central/atim-creek-pra/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Atim Creek Natural Area"})]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://www.sprucegrove.org/recreation/parks-trails/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Connected regional trail network"})]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://www.trileisure.com/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"TransAlta Tri Leisure Centre"})]}),s.jsxs("li",{className:"flex items-center text-gray-600",children:[s.jsx(xe,{size:16,className:"mr-2 text-[#C0A458]"}),s.jsx("a",{href:"https://glendalegolf.ca/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Glendale Golf & Country Club"})]})]})}),s.jsx("div",{children:s.jsx("img",{src:"https://www.physixgear.com/cdn/shop/articles/Benefits_of_an_Active_Lifestyle_1200x1200.jpg?v=1616582574",alt:"Active lifestyle",className:"rounded-lg shadow-lg"})})]})]})]})]}),s.jsxs("section",{id:"schools",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Schools"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:s.jsx("a",{href:"https://muirlake.psd.ca/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Muir Lake School (K-9)"})}),s.jsx("img",{src:"https://www.psd.ca/uploads/img_9704/1626912433-950w_img_9704.jpg",alt:"Muir Lake School",className:"rounded-lg shadow-lg mb-4"})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:s.jsx("a",{href:"https://sgchs.psd.ca/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#C0A458]",children:"Spruce Grove Composite High (10-12)"})}),s.jsx("img",{src:"https://www.psd.ca/uploads/sgchs2023winter.jpg",alt:"Spruce Grove Composite High School",className:"rounded-lg shadow-lg mb-4"})]})]})]}),s.jsxs("section",{id:"why",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Why Residents Love Lake Ridge Estates"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Space to Breathe"}),s.jsx("p",{className:"text-gray-600",children:"Half-acre lots perfect for triple garages or sport courts"})]}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Natural Beauty"}),s.jsx("p",{className:"text-gray-600",children:"Watch wildlife from your deck"})]}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Qu
410ick Access"}),s.jsx("p",{className:"text-gray-600",children:"Minutes to Anthony Henday Drive"})]}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Premium Community"}),s.jsx("p",{className:"text-gray-600",children:"Custom homes regularly exceed $1M"})]})]})]}),s.jsxs("div",{className:"bg-[#F5F5DC] p-8 rounded-lg text-center",children:[s.jsx("h2",{className:"text-2xl font-playfair mb-4",children:"Ready to Build Your Dream Home?"}),s.jsx("p",{className:"text-gray-700 mb-6",children:"Experience the perfect blend of rural tranquility and urban convenience. Book a private lot tour with Castle Stone Custom Homes."}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("a",{href:"https://mybuilder.ca/contact",target:"_blank",rel:"noopener noreferrer",className:"inline-block px-8 py-3 bg-[#C0A458] text-white rounded hover:bg-[#9A834A] transition-colors",children:"Get Featured"}),s.jsx("div",{className:"text-gray-600",children:"or"}),s.jsx(le,{to:"/contact",className:"inline-block px-8 py-3 border border-[#C0A458] text-[#C0A458] rounded hover:bg-[#C0A458] hover:text-white transition-colors",children:"Contact Us"})]})]})]}),s.jsx("div",{className:"lg:w-1/3 hidden lg:block",children:s.jsx("div",{className:"sticky top-24",children:s.jsxs("nav",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h2",{className:"text-xl font-playfair mb-4",children:"Table of Contents"}),s.jsx("ul",{className:"space-y-2",children:e.map(n=>s.jsx("li",{children:s.jsxs("a",{href:`#${n.id}`,onClick:a=>i(a,n.id),className:"flex items-center text-gray-700 hover:text-[#C0A458] transition-colors",children:[s.jsx(xe,{size:16,className:"mr-2"}),n.title]})},n.id))})]})})})]})})]})},Sb=()=>{const[t,r]=T.useState(!1),[e,i]=T.useState(0),n=[{id:"current-landscape",title:"The Current Landscape of Interest Rates"},{id:"unlocking-hidden-equity",title:"Unlocking Hidden Equity"},{id:"investors-strategy",title:"The Investor's Strategy in a Changing Market"},{id:"long-term-outlook",title:"Long-Term Outlook: Staying Ahead of the Curve"},{id:"final-thoughts",title:"Final Thoughts: Seizing the Moment"}];T.useEffect(()=>{const c=()=>{const l=window.pageYOffset,u=document.documentElement.scrollHeight-window.innerHeight,d=l/u*100;i(Math.min(d,100))},o=()=>{requestAnimationFrame(c)};return window.addEventListener("scroll",o,{passive:!0}),c(),()=>window.removeEventListener("scroll",o)},[]);const a=(c,o)=>{c.preventDefault();const l=document.getElementById(o);if(l){const h=l.getBoundingClientRect().top+window.pageYOffset-120;window.scrollTo({top:h,behavior:"smooth"}),r(!1)}};return s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsxs(Tr,{children:[s.jsx("title",{children:"Real Estate Investment Guide: Unlocking Hidden Equity | Castle Stone"}),s.jsx("meta",{name:"description",content:"Discover how fluctuating interest rates create both challenges and opportunities for real estate investors. Learn strategies to unlock hidden equity and thrive in any market."}),s.jsx("link",{rel:"canonical",href:"https://castlestonecustomhomes.com/real-estate-investment-guide"})]}),s.jsx("div",{className:"fixed top-0 left-0 w-full h-1 bg-gray-200 z-50",children:s.jsx("div",{className:"h-full bg-gradient-to-r from-[#C0A458] to-[#9A834A] transition-all duration-150 ease-out",style:{width:`${e}%`}})}),s.jsx("div",{className:"bg-gray-50 border-b",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 py-3",children:s.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[s.jsx(le,{to:"/",className:"hover:text-[#C0A458]",children:"Home"}),s.jsx(Ce,{size:16}),s.jsx(le,{to:"/blog",className:"hover:text-[#C0A458]",children:"Blog"}),s.jsx(Ce,{size:16}),s.jsx("span",{className:"text-gray-400",children:"Real Estate Investment Guide"})]})})}),s.jsxs("div",{className:"lg:hidden sticky top-20 z-20 bg-white border-b",children:[s.jsxs("button",{onClick:()=>r(!t),className:"w-full px-4 py-3 flex items-center justify-between text-gray-700 hover:bg-gray-50",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(ts,{size:20,className:"mr-2"}),s.jsx("span",{children:"Table of Contents"})]}),s.jsx(Ce,{size:20,className:`transform transition-transform ${t?"rotate-90":""}`})]}),t&&s.jsx("div",{className:"absolute top-full left-0 right-0 bg-white border-b shadow-lg",children:s.jsx("nav",{className:"max-h-[70vh] overflow-y-auto p-4",children:s.jsx("ul",{className:"space-y-2",children:n.map(c=>s.jsx("li",{children:s.jsxs("a",{href:`#${c.id}`,onClick:o=>a(o,c.id),className:"flex items-center py-2 px-4 text-gray-700 hover:text-[#C0A458] hover:bg-gray-50 rounded transition-colors",children:[s.jsx(xe,{size:16,className:"mr-2"}),c.title]})},c.id))})})})]}),s.jsxs("div",{className:"relative h-[40vh] bg-black",children:[s.jsx("img",{src:"https://images.unsplash.com/photo-1560472354-b33ff0c44a43?ixlib=rb-4.0.3&auto=format&fit=crop&w=2126&q=80",alt:"Real Estate Investment",className:"absolute inset-0 w-full h-full object-cover opacity-50"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-center",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"text-4xl md:text-5xl font-playfair text-white mb-4",children:["Real Estate Investment Guide",s.jsx("span",{className:"block mt-2 text-[#C0A458]",children:"Unlocking Hidden Equity"})]}),s.jsx("p",{className:"text-lg text-gray-200 max-w-2xl mx-auto",children:"In recent months, fluctuations in interest rates have created both challenges and opportunities for real estate investors."})]})})]}),s.jsx("div",{className:"max-w-7xl mx-auto px-4 py-12",children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-12",children:[s.jsxs("div",{className:"lg:w-2/3",children:[s.jsxs("div",{className:"flex items-center space-x-6 mb-8 text-sm text-gray-600",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("img",{src:"https://rxgobdnsupmmsqaeyfdf.supabase.co/storage/v1/object/sign/our-assets/Untitled%20Design%20180x180.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJvdXItYXNzZXRzL1VudGl0bGVkIERlc2lnbiAxODB4MTgwLnBuZyIsImlhdCI6MTc0NjU2OTE0OSwiZXhwIjoxODMyOTY5MTQ5fQ.42_BX3czlUrLTnm3TWrSm4mJzP75QRm9S7xT--iNvz0",alt:"Author",className:"w-10 h-10 rounded-full mr-3"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:"Castle Stone Investment Team"}),s.jsx("p",{children:"Real Estate Expert"})]})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(Zr,{size:16,className:"mr-2"}),s.jsx("span",{children:"8 min read"})]})]}),s.jsxs("section",{id:"current-landscape",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"The Current Landscape of Interest Rates"}),s.jsx("div",{className:"mb-8",children:s.jsx("img",{src:"https://images.unsplash.com/photo-1611974789855-9c2a0a7236
410a3?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80",alt:"Current Landscape",className:"w-full rounded-lg shadow-lg"})}),s.jsx("p",{className:"text-gray-600 leading-relaxed mb-6",children:"Interest rates have been on a rollercoaster ride, impacting the real estate market in significant ways. The Federal Reserve makes adjustments to interest rates in response to economic conditions. Recent data indicates a period of rising rates aimed at controlling inflation. However, historical trends show that real estate investments can still thrive even in higher rate environments."}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"As of now, mortgage rates hover around 6-7%. While this is significantly higher than the rates we saw a few years ago, it is essential to remember that higher rates can lead to lower property prices, creating potential buying opportunities."})]}),s.jsxs("section",{id:"unlocking-hidden-equity",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Unlocking Hidden Equity"}),s.jsx("p",{className:"text-gray-600 leading-relaxed mb-6",children:"Hidden equity refers to the value in y
410our property that hasn't been fully realized yet. When interest rates rise, many potential buyers are priced out of the market, leading to a slowdown in home sales. This slowdown can bring prices down, offering savvy investors a chance to buy properties at a lower cost."}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 mb-8",children:[s.jsx("div",{children:s.jsx("img",{src:"https://images.unsplash.com/photo-1560472354-b33ff0c44a43?ixlib=rb-4.0.3&auto=format&fit=crop&w=1026&q=80",alt:"Unlocking Hidden Equity",className:"w-full rounded-lg shadow-lg"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-[#F5F5DC] p-6 rounded-lg",children:[s.jsx("h3",{className:"font-medium text-[#C0A458] mb-2",children:"Leverage Existing Assets"}),s.jsx("p",{className:"text-gray-600 text-sm",children:"If your current mortgage is at a lower fixed rate, you could leverage this to your advantage by refinancing and tapping into current low-equity deals."})]}),s.jsxs("div",{className:"bg-[#F5F5DC] p-6 rounded-lg",children:[s.jsx("h3",{className:"font-medium text-[#C0A458] mb-2",children:"Fix-and-Flip Opportunities"}),s.jsx("p",{className:"text-gray-600 text-sm",children:"Real estate investors specializing in fix-and-flip projects can find opportunities amid declining home prices."})]})]})]})]}),s.jsxs("section",{id:"investors-strategy",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"The Investor's Strategy in a Changing Market"}),s.jsx("p",{className:"text-gray-600 leading-relaxed mb-8",children:"To make the most of the current interest rate environment, investors must adapt their strategies. Research is key. Understanding local market conditions is essential to pinpoint the best opportunities. Look at price trends, neighborhood developments, and the potential for appreciation."}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Research is Key"}),s.jsx("p",{className:"text-gray-600",children:"Understanding local market conditions is essential to pinpoint the best opportunities."})]}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Cash Advantage"}),s.jsx("p",{className:"text-gray-600",children:"Being a cash buyer can help you negotiate better deals and close quickly."})]}),s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Alternative Financing"}),s.jsx("p",{className:"text-gray-600",children:"Look into private loans or seller financing for creative solutions."})]})]}),s.jsx("img",{src:"https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80",alt:"Investment Strategy",className:"w-full rounded-lg shadow-lg"})]}),s.jsxs("section",{id:"long-term-outlook",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Long-Term Outlook: Staying Ahead of the Curve"}),s.jsx("p",{className:"text-gray-600 leading-relaxed mb-8",children:"While current interest rates may seem intimidating, the long-term outlook for real estate remains strong. Economic cycles fluctuate, and history shows that real estate values typically appreciate over time. Rather than being deterred by current market conditions, think about the future."}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 mb-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Technology Integration"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Utilizing technology can help streamline your investment strategies. Real estate analytics tools, virtual tours, and online marketplaces are now available, giving investors more access to information and potential properties than ever before."}),s.jsx("h3",{className:"text-xl font-medium mb-4",children:"Diversification Strategy"}),s.jsx("p",{className:"text-gray-600",children:"Don't put all your eggs in one basket. Exploring various types of real estate—residential, commercial, vacation rentals—can reduce your risk and create multiple streams of income."})]}),s.jsx("div",{children:s.jsx("img",{src:"https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80",alt:"Long Term Outlook",className:"w-full rounded-lg shadow-lg"})})]})]}),s.jsxs("section",{id:"final-thoughts",className:"mb-16",children:[s.jsx("h2",{className:"text-3xl font-playfair mb-6",children:"Final Thoughts: Seizing the Moment"}),s.jsx("p",{className:"text-gray-600 leading-relaxed mb-6",children:"Recent interest rate changes have undoubtedly created challenges for real estate investors, but they have also unveiled new opportunities to unlock hidden equity. By staying informed and adapting your strategies to market fluctuations, you can thrive in any environment."}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Whether you're looking to purchase your first property, refinance for more cash, or diversify your portfolio, now is the time to take action. Embrace the potential waiting to be discovered in today's market!"})]}),s.jsxs("div",{className:"bg-[#F5F5DC] p-8 rounded-lg text-center",children:[s.jsx("h2",{className:"text-2xl font-playfair mb-4",children:"Ready to Explore Investment Opportunities?"}),s.jsx("p",{className:"text-gray-700 mb-6",children:"Let Castle Stone Custom Homes help you identify and capitalize on real estate investment opportunities in 
410Edmonton's growing market."}),s.jsxs(le,{to:"/contact",className:"inline-flex items-center px-8 py-3 bg-[#C0A458] text-white rounded hover:bg-[#9A834A] transition-colors group",children:["Schedule Consultation",s.jsx(xe,{className:"ml-2 group-hover:translate-x-1 transition-transform"})]})]})]}),s.jsx("div",{className:"lg:w-1/3 hidden lg:block",children:s.jsx("div",{className:"sticky top-24",children:s.jsxs("nav",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("h2",{className:"text-xl font-playfair mb-4",children:"Table of Contents"}),s.jsx("ul",{className:"space-y-2",children:n.map(c=>s.jsx("li",{children:s.jsxs("a",{href:`#${c.id}`,onClick:o=>a(o,c.id),className:"flex items-center text-gray-700 hover:text-[#C0A458] transition-colors",children:[s.jsx(xe,{size:16,className:"mr-2"}),c.title]})},c.id))})]})})})]})})]})},_b=()=>{const[t,r]=T.useState(!1),e=[{id:"understanding-cost",title:"Understanding Cost Per Square Foot"},{id:"average-cost",title:"Average Cost Per Square Foot in Edmonton"},{id:"additional-considerations",title:"Additional Considerations"},{id:"engaging-contractors",title:"Engaging with Contractors"},{id:"financing-build",title:"Financing Your Build"},{id:"conclusion",title:"Conclusion"}],i=(n,a)=>{n.preventDefault();const c=document.getElementById(a);if(c){const u=c.getBoundingClientRect().top+window.pageYOffset-120;window.scrollTo({top:u,behavior:"smooth"}),r(!1)}};return s.jsxs("div",{className:"min-h-screen bg-white",children:[s.jsxs(Tr,{children:[s.jsx("title",{children:"Cost Per Square Foot to Build a House in Edmonton | Construction Guide"}),s.jsx("meta",{name:"description",content:"Complete guide to understanding construction costs per square foot in Edmonton. Learn about pricing factors, average costs, and budgeting tips for your dream home."})]}),s.jsx("div",{className:"bg-gray-50 py-4",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("nav",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[s.jsx(le,{to:"/",className:"hover:text-[#C0A458] transition-colors",children:"Home"}),s.jsx(Ce,{className:"w-4 h-4"}),s.jsx(le,{to:"/blog",className:"hover:text-[#C0A458] transition-colors",children:"Blog"}),s.jsx(Ce,{className:"w-4 h-4"}),s.jsx("span",{className:"text-gray-900",children:"Cost Per Square Foot to Build a House in Edmonton"})]})})}),s.jsxs("div",{className:"lg:hidden sticky top-20 z-40 bg-white border-b-2 border-[#C0A458] shadow-md",children:[s.jsxs("button",{onClick:()=>r(!t),className:"w-full px-6 py-4 flex items-center justify-between text-gray-900 hover:bg-[#F5F5DC] transition-colors",children:[s.jsxs("span",{className:"flex items-center",children:[s.jsx(ts,{className:"w-5 h-5 mr-3 text-[#C0A458]"}),s.jsx("span",{className:"font-medium",children:"Table of Contents"})]}),s.jsx(Ce,{className:`w-5 h-5 text-[#C0A458] transform transition-transform ${t?"rotate-90":""}`})]}),t&&s.jsx("div",{className:"border-t border-gray-200 bg-white shadow-lg",children:e.map(n=>s.jsxs("a",{href:`#${n.id}`,onClick:a=>i(a,n.id),className:"flex items-center py-3 px-6 text-gray-700 hover:text-[#C0A458] hover:bg-[#F5F5DC] transition-colors border-b border-gray-100 last:border-b-0",children:[s.jsx(Ce,{className:"w-4 h-4 mr-3 text-[#C0A458]"}),n.title]},n.id))})]}),s.jsxs("div",{className:"relative h-96 bg-gradient-to-r from-gray-900 to-gray-700",children:[s.jsx("img",{src:"https://images.unsplash.com/photo-1519501025264-65ba15a82390?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80",alt:"Edmonton skyline during sunset",className:"absolute inset-0 w-full h-full object-cover opacity-60"}),s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-40"}),s.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-full flex items-center",children:s.jsxs("div",{className:"text-white max-w-3xl",children:[s.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold mb-6 leading-tight",children:"Cost Per Square Foot to Build a House in Edmonton"}),s.jsx("p",{className:"text-xl md:text-2xl text-gray-200 leading-relaxed",children:"Are you considering building a home in Edmonton? Understanding the cost per square foot is crucial for budgeting your dream home."})]})})]}),s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.jsxs("div",{className:"lg:grid lg:grid-cols-4 lg:gap-12",children:[s.jsxs("div",{className:"lg:col-span-3",children:[s.jsxs("div",{className:"flex items-center mb-8 pb-6 border-b border-gray-200",children:[s.jsx("img",{src:"https://rxgobdnsupmmsqaeyfdf.supabase.co/storage/v1/object/sign/our-assets/Untitled%20Design%20180x180.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJvdXItYXNzZXRzL1VudGl0bGVkIERlc2lnbiAxODB4MTgwLnBuZyIsImlhdCI6MTc0NjU2OTE0OSwiZXhwIjoxODMyOTY5MTQ5fQ.42_BX3czlUrLTnm3TWrSm4mJzP75QRm9S7xT--iNvz0",alt:"mybuilder.ca",className:"w-12 h-12 rounded-full mr-4"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-semibold text-gray-900",children:"mybuilder.ca"}),s.jsx("div",{className:"text-gray-600",children:"Castle Stone Marketing Team"})]}),s.jsxs("div",{className:"ml-auto flex items-center text-gray-500",children:[s.jsx(Zr,{className:"w-4 h-4 mr-1"}),s.jsx("span",{children:"8 min read"})]})]}),s.jsxs("section",{id:"understanding-cost",className:"mb-12",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Understanding Cost Per Square Foot"}),s.jsxs("div",{className:"prose prose-lg max-w-none",children:[s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"When people refer to the cost per square foot, they are discussing the average price to construct one square foot of a house. This metric helps homeowners and builders estimate how much it will cost to build a home based on its total area."}),s.jsx("h3",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"Why Is It Important?"}),s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"Knowing the cost per square foot gives you a benchmark. If you know the average cost, you can compare different builders, styles, and materials. This means you can make informed decisions while keeping your budget in check."}),s.jsx("h3",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"Factors Influencing Cost"}),s.jsxs("ul",{className:"space-y-3 text-gray-700",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Location:"})," The specific area within Edmonton can significantly impact pricing. Urban locations like Downtown Edmonton usually have higher costs compared to suburban communities."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Size and Design:"})," More complex designs or larger homes require more materials and labor, which increases costs. Simple, straightforward designs tend to be less expensive."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Materials:"})," The choice of materials—whether high-end finishes or cost-effective alternatives—can either stretch or shrink y
410our budget."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Labor Costs:"})," The availability of skilled labor can influence construction costs. During peak times, you might encounter higher labor fees."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Permitting and Fees:"})," Local government permits, inspections, and other associated costs can vary. It's essential to factor these in while calculating overall expenses."]})]})]})]}),s.jsxs("section",{id:"average-cost",className:"mb-12",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Average Cost Per Square Foot in Edmonton"}),s.jsxs("div",{className:"prose prose-lg max-w-none",children:[s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"As of late 2023, the average cost to build a home in Edmonton ranges from $200 to $350 per square foot. This range can result in a cost of approximately $400,000 to $700,000 for a 2,000 square foot home."}),s.jsx("h3",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"Breakdown of Costs"}),s.jsx("div",{className:"bg-gray-50 p-6 rounded-lg mb-6",children:s.jsxs("ul",{className:"space-y-3 text-gray-700",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Basic Construction:"})," For simpler designs and lower-end materials, expect costs around $200-$250 per square foot."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Mid-Range Construction:"})," If you're looking for a balance between quality and cost, anticipate spending $250-$300 per square foot."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"High-End Construction:"})," Custom homes with premium materials and complex designs can run $300-$350 per square foot or even higher."]})]})})]})]}),s.jsxs("section",{id:"additional-considerations",className:"mb-12",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Additional Considerations"}),s.jsxs("div",{className:"prose prose-lg max-w-none",children:[s.jsx("h3",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"Custom vs. Pre-Designed Homes"}),s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"When you opt for custom-built homes, the cost can vary significantly based on your specific requirements. Pre-designed homes can offer cost efficiency, making them a popular choice among first-time builders."}),s.jsx("h3",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"Eco-Friendly Building Options"}),s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"If you're considering eco-friendly materials or energy-efficient designs, these can also affect the cost per square foot. While some eco-options may have a higher upfront cost, they can lead to savings in energy bills over time."}),s.jsx("h3",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"Property Value and Investment"}),s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"Building a home also means investing in your future. An understanding of construction costs can help you choose a location and design that boosts property value, making your investment worthwhile."})]})]}),s.jsxs("section",{id:"engaging-contractors",className:"mb-12",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Engaging with Contractors"}),s.jsxs("div",{className:"prose prose-lg max-w-none",children:[s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"When embarking on your building journey, it's essential to engage with multiple contractors to gather quotes."}),s.jsx("h3",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"What to Ask"}),s.jsxs("ul",{className:"space-y-3 text-gray-700",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Detailed Estimates:"})," Ensure each contractor provides a detailed breakdown of their estimates."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Previous Projects:"})," Request examples of past projects to gauge their quality of work."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Estimated Timeframe:"})," Understanding the timeline is crucial for planning your move-in date."]})]})]})]}),s.jsxs("section",{id:"financing-build",className:"mb-12",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Financing Your Build"}),s.jsxs("div",{className:"prose prose-lg max-w-none",children:[s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"While building a home is a substantial investment, there are various financing options available:"}),s.jsxs("ul",{className:"space-y-3 text-gray-700",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Construction Loans:"}
410)," These loans are designed specifically for home construction projects. They often convert to a traditional mortgage once the home is built."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Personal Loans:"})," If you have a smaller budget, personal loans can be a helpful alternative, though they typically come with higher interest rates."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Savings:"})," If you plan ahead, using savings can minimize debt and interest payments."]})]})]})]}),s.jsxs("section",{id:"conclusion",className:"mb-12",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Conclusion"}),s.jsxs("div",{className:"prose prose-lg max-w-none",children:[s.jsx("p",{className:"text-gray-700 leading-relaxed mb-6",children:"Understanding the cost per square foot to build a house in Edmonton is crucial for making sound decisions. It's important to consider various factors, including design, materials, and contractor options. While the average construction cost can vary, knowing what influences these prices helps you stay within your budget."}),s.jsx("p",{className:"text-gray-700 leading-relaxed",children:"Building your dream home can be an exciting journey. With the right information and planning, you can navigate costs effectively and make informed choices along the way."})]}),s.jsxs("div",{className:"bg-[#F5F5DC] p-8 rounded-lg text-center mt-12",children:[s.jsx("h2",{className:"text-2xl font-playfair mb-4",children:"Ready to Calculate Your Build Cost?"}),s.jsx("p",{className:"text-gray-700 mb-6",children:"Use our interactive cost estimator to get a personalized estimate for your Edmonton custom home project."}),s.jsxs(le,{to:"/",className:"inline-flex items-center px-8 py-3 bg-[#C0A458] text-white rounded hover:bg-[#9A834A] transition-colors group",children:["Try Our Cost Calculator",s.jsx(xe,{className:"ml-2 group-hover:translate-x-1 transition-transform"})]})]})]})]}),s.jsx("div",{className:"hidden lg:block lg:col-span-1",children:s.jsx("div",{className:"sticky top-24",children:s.jsxs("div",{className:"bg-[#F5F5DC] rounded-lg p-6 border border-[#C0A458]/20 shadow-sm",children:[s.jsx("h3",{className:"text-xl font-playfair text-gray-900 mb-6 pb-2 border-b border-[#C0A458]/30",children:"Table of Contents"}),s.jsx("nav",{className:"space-y-2",children:e.map(n=>s.jsxs("a",{href:`#${n.id}`,onClick:a=>i(a,n.id),className:"flex items-center py-2 px-3 text-gray-700 hover:text-[#C0A458] hover:bg-white/50 rounded transition-colors",children:[s.jsx(Ce,{className:"w-4 h-4 mr-3 text-[#C0A458]"}),n.title]},n.id))})]})})})]})})]})},Cb=()=>{T.useState(!1);const[t,r]=T.useState([]),[e,i]=T.useState(!0),[n,a]=T.useState(null),[c,o]=T.useState("all"),[l,u]=T.useState(0);T.useEffect(()=>{const w=()=>{const x=window.pageYOffset,j=document.documentElement.scrollHeight-window.innerHeight,S=x/j*100;u(Math.min(S,100))},b=()=>{requestAnimationFrame(w)};return window.addEventListener("scroll",b,{passive:!0}),w(),()=>window.removeEventListener("scroll",b)},[]),T.useEffect(()=>{(async()=>{try{const{data:b,error:x}=await fe.from("stories").select(`
411            *,
412            story_images (
413              id,
414              url,
415              alt,
416              order
417            )
418          `).order("date",{ascending:!1});if(x)throw x;const j=(b==null?void 0:b.map(S=>{var E;return{...S,story_images:(E=S.story_images)==null?void 0:E.sort((R,A)=>R.order-A.order)}}))||[];r(j)}catch(b){console.error("Error fetching stories:",b),a(b instanceof Error?b.message:"Failed to load stories")}finally{i(!1)}})()},[]);const d=[{id:"all",name:"All"},{id:"design",name:"Design"},{id:"construction",name:"Construction"},{id:"renovation",name:"Renovation"},{id:"tips",name:"Tips"},{id:"company-news",name:"Company News"},{id:"industry-insights",name:"Industry Insights"},{id:"general",name:"General"}],h=c==="all"?t:t.filter(w=>w.category===c),f=[{id:"spruce-grove-guide",title:"Is Spruce Grove a Good Place to Live?",description:"Read the Analysis from Real Estate Experts, Average sold price is still below the half‑million mark, vacancy is under 1%, and commute time to downtown Edmonton is 25 minutes—here's why Spruce Grove is Alberta's hottest commuter city in 2025.",image:"https://www.sprucegrove.org/media/5299/img_8535.jpg?crop=0.067834581025798008,0.31302734447590747,0.14945871483037876,0.35379729762152445&cropmode=percentage&width=1980&height=568&rnd=133531133380000000",link:"/real-estate-in-spruce-grove-edmonton",category:"Market Analysis",readingTime:12},{id:"lake-ridge-guide",title:"Lake Ridge Estates | Half‑Acre Lots on Big Lake",description:"Build your custom estate 25 min from downtown Edmonton. Explore prices, schools, trails & lifestyle in Lake Ridge Estates on Big Lake.",image:"https://wkljadlmnqsapyvyydfy.supabase.co/storage/v1/object/public/property-images/property-1739777859414-xby3u.jpg",link:"/lake-ridge-estates-parkland-county",category:"Community Guide",readingTime:12},{id:"investment-guide",title:"Real Estate Investment Guide: Unlocking Hidden Equity",description:"Discover how fluctuating interest rates create both challenges and opportunities for real estate investors. Learn strategies to unlock hidden equity and thrive in any market.",image:"https://images.unsplash.com/photo-1560472354-b33ff0c44a43?ixlib=rb-4.0.3&auto=format&fit=crop&w=2126&q=80",link:"/real-estate-investment-guide",category:"Investment Strategy",readingTime:8},{id:"edmonton-construction-costs",title:"Cost Per Square Foot to Build a House in Edmonton 2025",description:"Planning to build in Edmonton? Discover the real costs per square foot, from basic construction at $200/sqft to luxury builds at $350+/sqft. Get expert insights on budgeting your dream home.",image:"https://images.unsplash.com/photo-1541888946425-d81bb19240f5?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80",link:"/cost-per-square-foot-build-house-edmonton",category:"Construction Guide",readingTime:8}],p=w=>w.includes("Lake Ridge Estates")?"/lake-ridge-estates-parkland-county":w.includes("Spruce Grove")?"/real-estate-in-spruce-grove-edmonton":w.includes("Investment Guide")?"/real-estate-investment-guide":w.includes("Cost Per Square Foot")?"/cost-per-square-foot-build-house-edmonton":"#",g=w=>w.includes("Lake Ridge Estates")?"https://wkljadlmnqsapyvyydfy.supabase.co/storage/v1/object/public/property-images/property-1739777859414-xby3u.jpg":w.includes("Spruce Grove")?"https://www.sprucegrove.org/media/5299/img_8535.jpg?crop=0.067834581025798008,0.31302734447590747,0.14945871483037876,0.35379729762152445&cropmode=percentage&width=1980&height=568&rnd=133531133380000000":w.includes("Investment Guide")?"https://images.unsplash.com/photo-1560472354-b33ff0c44a43?ixlib=rb-4.0.3&auto=format&fit=crop&w=2126&q=80":w.includes("Cost Per Square Foot")?"https://images.unsplash.com/photo-1541888946425-d81bb19240f5?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80":"https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?ixlib=rb-1.2.1&auto=format&fit=crop&w=2850&q=80";return e?s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#C0A458]"})})})}):n?s.jsx("div",{className:"min-h-screen bg-white pt-20",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.jsxs("div",{className:"flex items-center justify-center text-red-600",children:[s.jsx(Dt,{className:"mr-2"}),n]})})}):s.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[s.jsxs(Tr,{children:[s.jsx("title",{children:"Blog | Castle Stone Custom Homes"}),s.jsx("meta",{name:"description",content:"Explore our latest insights on custom home building, design trends, and real estate market updates in Edmonton and 
418Spruce Grove."}),s.jsx("link",{rel:"canonical",href:"https://castlestonecustomhomes.com/blog"})]}),s.jsx("div",{className:"fixed top-0 left-0 w-full h-1 bg-gray-200 z-50",children:s.jsx("div",{className:"h-full bg-gradient-to-r from-[#C0A458] to-[#9A834A] transition-all duration-150 ease-out",style:{width:`${l}%`}})}),s.jsxs("div",{className:"relative h-[40vh] bg-black",children:[s.jsx("img",{src:"https://wkljadlmnqsapyvyydfy.supabase.co/storage/v1/object/public/property-images/property-1739777859414-xby3u.jpg",alt:"Spruce Grove Aerial View",className:"absolute inset-0 w-full h-full object-cover opacity-50"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-center",children:s.jsx("div",{children:s.jsx("h1",{className:"text-4xl md:text-5xl font-playfair text-white mb-4",children:"Insights"})})})]}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[s.jsx("div",{className:"flex overflow-x-auto pb-4 mb-8 -mx-4 px-4 sm:px-0 sm:mx-0 no-scrollbar",children:s.jsx("div",{className:"flex space-x-2",children:d.map(w=>s.jsx("button",{onClick:()=>o(w.id),className:`px-3 py-1.5 rounded-full whitespace-nowrap text-sm transition-colors ${c===w.id?"bg-[#C0A458] text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:w.name},w.id))})}),f.map((w,b)=>s.jsx("div",{className:"mb-16",children:s.jsx(le,{to:w.link,className:"group block",children:s.jsxs("div",{className:"relative aspect-[16/9] md:aspect-[21/9] rounded-lg overflow-hidden",children:[s.jsx("img",{src:w.image,alt:w.title,className:"absolute inset-0 w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-700"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent"}),s.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4 md:p-8",children:s.jsxs("div",{className:"max-w-3xl",children:[s.jsxs("div",{className:"flex items-center space-x-4 text-white/80 mb-2 md:mb-4",children:[s.jsx("span",{className:"bg-[#C0A458] px-2 py-0.5 rounded-full text-xs",children:"Featured"}),s.jsx("span",{className:"text-xs",children:w.category}),s.jsxs("span",{className:"flex items-center text-xs",children:[s.jsx(Zr,{size:14,className:"mr-1"}),w.readingTime," min"]})]}),s.jsx("h2",{className:"text-xl md:text-3xl font-playfair text-white mb-2 md:mb-4 group-hover:text-[#C0A458] transition-colors line-clamp-2 md:line-clamp-none",children:w.title}),s.jsx("p",{className:"text-sm md:text-lg text-gray-200 line-clamp-2 md:line-clamp-none",children:w.description})]})})]})})},w.id)),h.length>0&&s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:h.map(w=>s.jsx(le,{to:p(w.title),className:"group",children:s.jsxs("div",{className:"bg-white rounded-lg overflow-hidden transition-shadow duration-300 hover:shadow-lg",children:[s.jsx("div",{className:"relative aspect-[16/9]",children:s.jsx("img",{src:g(w.title),alt:w.title,className:"absolute inset-0 w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-700"})}),s.jsxs("div",{className:"p-4 md:p-6",children:[s.jsxs("div",{className:"flex items-center space-x-3 text-xs text-gray-600 mb-2",children:[s.jsx("span",{className:"capitalize",children:w.category.replace("-"," ")}),s.jsxs("span",{className:"flex items-center",children:[s.jsx(Zr,{size:12,className:"mr-1"}),w.reading_time," min"]})]}),s.jsx("h3",{className:"text-lg font-playfair mb-2 group-hover:text-[#C0A458] transition-colors line-clamp-2",children:w.title}),s.jsx("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:w.description}),s.jsxs("div",{className:"flex items-center text-[#C0A458] text-sm group-hover:translate-x-2 transition-transform duration-300",children:["Read More",s.jsx(xe,{className:"ml-1",size:16})]})]})]})},w.id))}),h.length===0&&s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-gray-600",children:"No stories found in this category."})})]})]})};vw();const li=({title:t,description:r})=>s.jsxs(Tr,{children:[s.jsx("title",{children:`${t} | Castle Stone Custom Homes`}),s.jsx("meta",{name:"description",content:r}),s.jsx("link",{rel:"canonical",href:`https://castlestonecustomhomes.com${window.location.pathname}`})]});function Nb(){const{pathname:t}=Yn();return T.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"}),xw(t)},[t]),null}function Tb(){return s.jsxs(s.Fragment,{children:[s.jsx(li,{title:"Luxury Custom Home Builder Edmonton",de
418scription:"Castle Stone Custom Homes builds exceptional luxury homes in Edmonton and Spruce Grove. Experience craftsmanship and innovation in every detail. Custom home building, renovations, and steel beam construction specialists."}),s.jsx(Zw,{}),s.jsx(Qw,{}),s.jsx(Jw,{}),s.jsx(Yw,{}),s.jsx($w,{}),s.jsx(eb,{}),s.jsx(rb,{})]})}function Eb(){return s.jsx(ey,{children:s.jsxs(gw,{children:[s.jsx(Nb,{}),s.jsxs("div",{className:"min-h-screen flex flex-col",children:[s.jsx(Ww,{}),s.jsx("main",{className:"flex-grow",children:s.jsxs(Zx,{children:[s.jsx(Qe,{path:"/",element:s.jsx(Tb,{})}),s.jsx(Qe,{path:"/custom-home-builder-edmonton",element:s.jsx(yb,{})}),s.jsx(Qe,{path:"/acreage-home-builder-alberta",element:s.jsx(wb,{})}),s.jsx(Qe,{path:"/real-estate-in-spruce-grove-edmonton",element:s.jsx(bb,{})}),s.jsx(Qe,{path:"/lake-ridge-estates-parkland-county",element:s.jsx(jb,{})}),s.jsx(Qe,{path:"/real-estate-investment-guide",element:s.jsx(Sb,{})}),s.jsx(Qe,{path:"/cost-per-square-foot-build-house-edmonton",element:s.jsx(_b,{})}),s.jsx(Qe,{path:"/blog",element:s.jsx(Cb,{})}),s.jsx(Qe,{path:"/projects",element:s.jsxs(s.Fragment,{children:[s.jsx(li,{title:"Our Custom Home Projects | Edmonton Luxury Homes",description:"Explore our portfolio of meticulously crafted luxury homes in Edmonton and Spruce Grove. View our latest custom builds, renovations, and steel beam construction projects."}),s.jsx(ab,{})]})}),s.jsx(Qe,{path:"/projects/:id",element:s.jsxs(s.Fragment,{children:[s.jsx(li,{title:"Custom Home Details | Edmonton Luxury Builder",description:"Discover the exceptional features and craftsmanship of this custom-built luxury home by Castle Stone. Edmonton's premier custom home builder delivering innovative designs and quality construction."}),s.jsx(sb,{})]})}),s.jsx(Qe,{path:"/about",element:s.jsxs(s.Fragment,{children:[s.jsx(li,{title:"About Castle Stone | Edmonton Custom Home Builder",description:"Learn about our commitment to excellence in custom home building in Edmonton and Spruce Grove. Discover our story, values, and dedication to quality craftsmanship since 2010."}),s.jsx(cb,{})]})}),s.jsx(Qe,{path:"/about/story/:id",element:s.jsxs(s.Fragment,{children:[s.jsx(li,{title:"Our Story | Edmonton Custom Home Builder",description:"Read about our journey and achievements in custom home building in Edmonton. Experience the Castle Stone difference with our innovative designs and quality construction."}),s.jsx(xb,{})]})}),s.jsx(Qe,{path:"/contact",element:s.jsxs(s.Fragment,{children:[s.jsx(li,{title:"Contact Us | Edmonton Custom Home Builder",description:"Get in touch with Castle Stone Custom Homes. Schedule a consultation for your dream home project in Edmonton or Spruce Grove. Custom home building, renovations, and steel beam construction specialists."}),s.jsx(db,{})]})}),s.jsx(Qe,{path:"/admin",element:s.jsx(vb,{})})]})}),s.jsx(qw,{})]})]})})}Kf(document.getElementById("root")).render(s.jsx(T.StrictMode,{children:s.jsx(tm,{children:s.jsx(Eb,{})})}));export{Hi 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.